diff --git a/.github/banner.png b/.github/banner.png new file mode 100644 index 00000000..280ef70c Binary files /dev/null and b/.github/banner.png differ diff --git a/.github/banner.svg b/.github/banner.svg new file mode 100644 index 00000000..8b35ae7a --- /dev/null +++ b/.github/banner.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + @smooai/utils + + TypeScript utilities, zero boilerplate + SMOO AI · AI BUILT INTO EVERY PRODUCT + \ No newline at end of file diff --git a/.smooai-logs/output.ansi b/.smooai-logs/output.ansi index 032ac884..e136c92c 100644 --- a/.smooai-logs/output.ansi +++ b/.smooai-logs/output.ansi @@ -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 ()\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 ()\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 ()\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" +} +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- diff --git a/README.md b/README.md index 9ebe1157..faa12dca 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,22 @@

- Smoo AI + @smooai/utils — TypeScript utilities, zero boilerplate

-

@smooai/utils

-

- Battle-tested TypeScript utilities that eliminate the boilerplate — Lambda handlers, human-readable validation, case-insensitive collections, and more. + npm + Smoo AI + license

- npm downloads - Smoo AI - license TypeScript

- Features · - Install · - Usage · - Platform + Features  ·  Install  ·  Usage  ·  Platform

--- @@ -268,14 +262,10 @@ pnpm lint ## 🧩 Part of Smoo AI -@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