From ccc931a0b958785145e60ab5b6162dbdc862cc1f Mon Sep 17 00:00:00 2001 From: Jason Caldwell Date: Thu, 4 Apr 2024 19:57:20 -0400 Subject: [PATCH] Project update. [p][robotic] --- .browserslistrc | 2 +- .dockerignore | 2 +- .env.vault | 8 ++++---- .gitattributes | 2 +- .gitignore | 2 +- .npmignore | 2 +- .prettierignore | 2 +- .vscode/settings.json | 2 +- .vscodeignore | 2 +- package-lock.json | 12 ++++++------ package.json | 2 +- src/api.ts | 9 +++++---- tsconfig.json | 2 +- wrangler.toml | 2 +- 14 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index aee51b8..7d674db 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. [production] node >= 20.9.0 diff --git a/.dockerignore b/.dockerignore index 7fe150c..8fd2a2e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Locals diff --git a/.env.vault b/.env.vault index 2507553..cb5e1c6 100644 --- a/.env.vault +++ b/.env.vault @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="3rfi+ClkONvfHPiU9FTBcC1+Um/L8QeM9dRw1jFzEqzZXw==" DOTENV_VAULT_MAIN_VERSION=1 # dev -DOTENV_VAULT_DEV="soKiKFF6PaUiJymdH24sf+AYMxJkXrbgVYTptfKaDRP+6aFlcr6g+97pyxx+tJ8k2AbeQVY8GXy/jZyFpEnqTpNIba1fKWWjEk9oekPiG8WWWuy+CoTfDa/IQ58tjByJxJ0xRl6UOaThURKA5J3LqdB/P7ZebuIQ+gKnON/Nro538q7B2Rxyb/UM3GyO+4/1ryN9TwAYA3Gfr0/d5/EMOq1et+FQZjdg/dDQZID1cRtyb6uUtQ0EO2ASagzhATspodoDaQ1J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YFHtXs/x9Q+HTGCHdF5DlQ6nkL0DuEy6G9wWuzkFT61Is+3ZsbHJSx2RhLDagCxsSXODVw0oto7Nsc6niwfMGvOZ1JEGA3TxogJ9od+8bBVfwjE3QuB4An9ORvqyMYwyUgdw1p5IolU/Dy/W+EUHhPw//H48OTZldErp6DeQpRc/SJZs4lI6FqjmgcBa3SysKI9" +DOTENV_VAULT_CI_VERSION=307 # stage DOTENV_VAULT_STAGE="bfqZYD8oVLWMZ0JR5LICV+sB/btaXavszxZLxTfwSH8U5fg=" diff --git a/.gitattributes b/.gitattributes index a2bfede..0f3a1fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Default diff --git a/.gitignore b/.gitignore index 9ef60ab..abc7008 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Locals diff --git a/.npmignore b/.npmignore index fb7a04d..fddf777 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Locals diff --git a/.prettierignore b/.prettierignore index c1d10e2..d57a20d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d285a3..97d91da 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./settings.mjs`. * - * Last generated using `./settings.mjs` Apr 4, 2024 11:53 PM UTC. + * Last generated using `./settings.mjs` Apr 4, 2024 11:57 PM UTC. */ { "editor.formatOnType": false, diff --git a/.vscodeignore b/.vscodeignore index c40685b..29a8fbb 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Apr 4, 2024 11:53 PM UTC. +# Last generated Apr 4, 2024 11:57 PM UTC. # Locals diff --git a/package-lock.json b/package-lock.json index 2647c34..f0f897b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.305", + "version": "1.0.306", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.305", + "version": "1.0.306", "cpu": [ "x64", "arm64" @@ -1033,9 +1033,9 @@ } }, "node_modules/@clevercanyon/utilities.cfw": { - "version": "1.0.305", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.305.tgz", - "integrity": "sha512-cAeJ6v1CNGAdPDC0siLynWcospLX6DG9Z8RHcQlwlGXaY/IV0ovjuc9850+gprfOZTBbsPzVW93xxRAoD1EfyQ==", + "version": "1.0.306", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.306.tgz", + "integrity": "sha512-A7Q0zTqbJEdhcJGONPdH+QzMYNCgQOwGgxDOelzKLP3QPM/BldpyPdZEhnJ4re13gFVvU9PjJlmZS3VNRmggcg==", "cpu": [ "x64", "arm64" @@ -1054,7 +1054,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.936", + "@clevercanyon/utilities": "^1.0.940", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" diff --git a/package.json b/package.json index ab98e1d..644b2f9 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.306", + "version": "1.0.307", "license": "GPL-3.0-or-later", "name": "@clevercanyon/utilities.cfw", "description": "Utilities for JavaScript apps running in a Cloudflare Worker environment.", diff --git a/src/api.ts b/src/api.ts index 16e5eaf..5b928ea 100644 --- a/src/api.ts +++ b/src/api.ts @@ -26,14 +26,15 @@ export type CatchThrownOptions = { * Catches an error thrown by an API. * * @param rcData Request context data. + * @param thrown Thrown; e.g., error, response. * @param options {@see CatchThrownOptions}. */ -export const catchThrown = async (rcData: $type.$cfw.RequestContextData, options: CatchThrownOptions): Promise => { +export const catchThrown = async (rcData: $type.$cfw.RequestContextData, thrown: unknown, options: CatchThrownOptions): Promise => { + if ($is.response(thrown)) throw thrown; + const { auditLogger } = rcData, opts = $obj.defaults({}, options) as Required, - { responseType, responseConfig, thrown, expectedCauses } = opts; - - if ($is.response(thrown)) throw thrown; + { responseType, responseConfig, expectedCauses } = opts; const message = $error.safeMessageFrom(thrown, { expectedCauses, diff --git a/tsconfig.json b/tsconfig.json index 44bf29a..0af743c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./tsconfig.mjs`. * - * Last generated using `./tsconfig.mjs` Apr 4, 2024 11:53 PM UTC. + * Last generated using `./tsconfig.mjs` Apr 4, 2024 11:57 PM UTC. */ { "include": ["./src/**/*", "./dev-types.d.ts"], diff --git a/wrangler.toml b/wrangler.toml index 208ac40..7d25cbf 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -7,7 +7,7 @@ # @note This entire file will be updated automatically. # @note Instead of editing here, please review `./wrangler.mjs`. # -# Last generated using `./wrangler.mjs` Apr 4, 2024 11:53 PM UTC. +# Last generated using `./wrangler.mjs` Apr 4, 2024 11:57 PM UTC. ## send_metrics = false