Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions .github/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions .smooai-logs/output.ansi
Original file line number Diff line number Diff line change
Expand Up @@ -2025,3 +2025,142 @@
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
{
"msg": "An API error occurred: Status: 400 (undefined); Message: Bad Request",
"time": "2026-06-13T21:41:02.339Z",
"error": "Bad Request",
"errorDetails": [
{
"message": "Bad Request",
"name": "Error",
"stack": "Error: Bad Request\n at /Users/brentrager/dev/smooai/utils/src/api/sqsHandler.spec.ts:51:22\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:103:11\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:595:26\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:877:20\n at new Promise (<anonymous>)\n at runWithTimeout (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:850:10)\n at runTest (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1345:12)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)",
"status": 400
}
],
"@message": "An API error occurred: Status: 400 (undefined); Message: Bad Request",
"@requestId": "test-request-id",
"@timestamp": "2026-06-13T21:41:02.339Z",
"LogLevel": "error",
"callerContext": {
"loggerName": "AwsServerLogger",
"stack": [
"/Users/brentrager/dev/smooai/utils/src/api/sqsHandler.ts:21:20",
"processTicksAndRejections (node:internal/process/task_queues:105:5)"
]
},
"correlationId": "0a6c1887-9546-462a-8980-9bded4f7e001",
"http": {
"request": {
}
},
"lambda": {
"requestId": "test-request-id"
},
"level": 50,
"name": "AwsServerLogger",
"nodeEnv": "test",
"queue": {
"messageApproximateReceiveCount": "1",
"messageId": "msg1"
},
"requestId": "0a6c1887-9546-462a-8980-9bded4f7e001",
"traceId": "0a6c1887-9546-462a-8980-9bded4f7e001"
}
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
{
"msg": "A schema validation error occurred: Invalid schema at \"test\"",
"time": "2026-06-13T21:41:02.345Z",
"error": "Invalid schema at \"test\"",
"errorDetails": [
{
"message": "Invalid schema at \"test\"",
"name": "HumanReadableSchemaError",
"schemaError": {
"issues": [
{
"message": "Invalid schema",
"path": [
"test"
]
}
],
"message": "Invalid schema",
"name": "SchemaError",
"stack": "SchemaError: Invalid schema\n at /Users/brentrager/dev/smooai/utils/src/api/sqsHandler.spec.ts:62:25\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:103:11\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:595:26\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:877:20\n at new Promise (<anonymous>)\n at runWithTimeout (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:850:10)\n at runTest (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1345:12)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)"
},
"stack": "HumanReadableSchemaError: Invalid schema at \"test\"\n at /Users/brentrager/dev/smooai/utils/src/api/sqsHandler.spec.ts:63:32\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:103:11\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:595:26\n at file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:877:20\n at new Promise (<anonymous>)\n at runWithTimeout (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:850:10)\n at runTest (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1345:12)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)\n at runSuite (file:///Users/brentrager/dev/smooai/utils/node_modules/.pnpm/@vitest+runner@3.1.1/node_modules/@vitest/runner/dist/index.js:1491:8)"
}
],
"@message": "A schema validation error occurred: Invalid schema at \"test\"",
"@requestId": "test-request-id",
"@timestamp": "2026-06-13T21:41:02.345Z",
"LogLevel": "error",
"callerContext": {
"loggerName": "AwsServerLogger",
"stack": [
"/Users/brentrager/dev/smooai/utils/src/api/sqsHandler.ts:23:20",
"processTicksAndRejections (node:internal/process/task_queues:105:5)"
]
},
"correlationId": "ee33229b-e157-4675-bf49-113d62cfb947",
"http": {
"request": {
}
},
"lambda": {
"requestId": "test-request-id"
},
"level": 50,
"name": "AwsServerLogger",
"nodeEnv": "test",
"queue": {
"messageApproximateReceiveCount": "1",
"messageId": "msg1"
},
"requestId": "ee33229b-e157-4675-bf49-113d62cfb947",
"traceId": "ee33229b-e157-4675-bf49-113d62cfb947"
}
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
{
"msg": "A validation error occurred: ✖ Expected string, received number\n → at name",
"time": "2026-06-13T21:41:02.346Z",
"@message": "A validation error occurred: ✖ Expected string, received number\n → at name",
"@requestId": "test-request-id",
"@timestamp": "2026-06-13T21:41:02.346Z",
"LogLevel": "error",
"callerContext": {
"loggerName": "AwsServerLogger",
"stack": [
"/Users/brentrager/dev/smooai/utils/src/api/sqsHandler.ts:26:20",
"processTicksAndRejections (node:internal/process/task_queues:105:5)"
]
},
"context": {
"message": "[\n {\n \"code\": \"invalid_type\",\n \"expected\": \"string\",\n \"path\": [\n \"name\"\n ],\n \"message\": \"Expected string, received number\"\n }\n]",
"name": "ZodError"
},
"correlationId": "853af3e3-d453-417e-b108-b4428e5aae62",
"http": {
"request": {
}
},
"lambda": {
"requestId": "test-request-id"
},
"level": 50,
"name": "AwsServerLogger",
"nodeEnv": "test",
"queue": {
"messageApproximateReceiveCount": "1",
"messageId": "msg1"
},
"requestId": "853af3e3-d453-417e-b108-b4428e5aae62",
"traceId": "853af3e3-d453-417e-b108-b4428e5aae62"
}
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
<a name="readme-top"></a>

<p align="center">
<a href="https://smoo.ai"><img src="https://smoo.ai/images/logo/logo.svg" alt="Smoo AI" width="220" /></a>
<a href="https://smoo.ai"><img src=".github/banner.png" alt="@smooai/utils — TypeScript utilities, zero boilerplate" width="100%" /></a>
</p>

<h1 align="center">@smooai/utils</h1>

<p align="center">
<strong>Battle-tested TypeScript utilities that eliminate the boilerplate — Lambda handlers, human-readable validation, case-insensitive collections, and more.</strong>
<a href="https://www.npmjs.com/package/@smooai/utils"><img src="https://img.shields.io/npm/v/@smooai/utils?style=for-the-badge&color=00A6A6&label=npm&logo=npm&logoColor=white&labelColor=020618" alt="npm"></a>
<a href="https://smoo.ai"><img src="https://img.shields.io/badge/Smoo_AI-platform-00A6A6?style=for-the-badge&labelColor=020618" alt="Smoo AI"></a>
<img src="https://img.shields.io/badge/license-MIT-F49F0A?style=for-the-badge&labelColor=020618" alt="license">
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@smooai/utils"><img src="https://img.shields.io/npm/v/@smooai/utils?style=flat-square&color=00A6A6&label=npm" alt="npm"></a>
<a href="https://www.npmjs.com/package/@smooai/utils"><img src="https://img.shields.io/npm/dw/@smooai/utils?style=flat-square&color=F49F0A&label=downloads" alt="downloads"></a>
<img src="https://img.shields.io/badge/Smoo_AI-platform-00A6A6?style=flat-square" alt="Smoo AI">
<img src="https://img.shields.io/badge/license-MIT-F49F0A?style=flat-square" alt="license">
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
</p>

<p align="center">
<a href="#features">Features</a> ·
<a href="#install">Install</a> ·
<a href="#usage">Usage</a> ·
<a href="#part-of-smoo-ai">Platform</a>
<a href="#-features"><b>Features</b></a> &nbsp;·&nbsp; <a href="#-install"><b>Install</b></a> &nbsp;·&nbsp; <a href="#-usage"><b>Usage</b></a> &nbsp;·&nbsp; <a href="#-part-of-smoo-ai"><b>Platform</b></a>
</p>

---
Expand Down Expand Up @@ -268,14 +262,10 @@ pnpm lint

## 🧩 Part of Smoo AI <a name="part-of-smoo-ai"></a>

@smooai/utils is part of the [Smoo AI](https://smoo.ai) platform — an AI-powered business platform with AI built into every product. It's the shared foundation under our open-source packages.

- [@smooai/logger](https://github.com/SmooAI/logger) — contextual structured logging
- [@smooai/fetch](https://github.com/SmooAI/fetch) — typed HTTP with retries
- [@smooai/file](https://github.com/SmooAI/file) — stream-first file ops with magic-byte validation
- [@smooai/config](https://github.com/SmooAI/config) — typed config, secrets, and feature flags
`@smooai/utils` is built and open-sourced by **[Smoo AI](https://smoo.ai)** — the AI-powered business platform with AI built into every product: CRM, customer support, campaigns, field service, observability, and developer tools.

Browse the rest at [npmjs.com/org/smooai](https://www.npmjs.com/org/smooai) and [github.com/SmooAI](https://github.com/SmooAI).
- 🧰 **More open source from Smoo AI** — [smoo.ai/open-source](https://smoo.ai/open-source)
- 🧩 **Sibling packages** — [@smooai/logger](https://github.com/SmooAI/logger), [@smooai/fetch](https://github.com/SmooAI/fetch), [@smooai/file](https://github.com/SmooAI/file), [@smooai/config](https://github.com/SmooAI/config)

## 🤝 Contributing <a name="contributing"></a>

Expand Down
Loading