diff --git a/.browserslistrc b/.browserslistrc index 80a929c..0edd668 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. [production] node >= 20.9.0 diff --git a/.dockerignore b/.dockerignore index c05e46a..4c95089 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Locals diff --git a/.env.vault b/.env.vault index be9e49a..48b44b1 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="j0pdIMi5eRbQg/VAF6SUfeZszgx4kmG2tqXiXo9Ilk2vD3cqqKRCC5RtZyENE+9O6ri7JOl2VRK/jv8GjFTwcOyJgqWiaApmZaTNcKfGy/5S+3eE7Ggz8d1J5LdLzT1v81x2bp3OsbZ0CJiMNbZRjQE6i6no0WgjLNTMxzod9oXMQY/I4xoY09sXPK4pmiK057PFnsmjjhcdEw8BW65ZH8q8SZsGHvTERJWX02Ycv106NotbYeV7HBvjrEqY9BqKjYhvoHT5NasnsBKVVAKmI41neV+X/+oQAJlMLbDe6G3V0rMZR9ii+bMVxfLtizPfQYr703znG07XzrSiFUgYPobsxvirDHXSuSTLju38K78qy5dT+DTA7olK8ksGhC/u1nryWUX+RG1CKuaRpMEa32DUtN4EKoI3NCa8jWfDEIsujm7pTJmt8vo6D/DkKC5K/6I9PBFV4Axh4HNOtll7q/bynqDEfyO/RENuSKvqbkSPctC6qMpqMH5OjAE8EM3hqKOW9wOre0LMl3tr13hkmDbufcKA8BrEb7Z1Mzecj/08sBVM7O5L4fR1gGCQp5dCV9ZvmkkF5GjHZAs+xiC2LyTX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rFXnW8xGZua" -DOTENV_VAULT_CI_VERSION=259 +DOTENV_VAULT_CI="cnC7+l8ER9i4RJIGOIdH9VTdbjBSzjFiSQZTlaQD7vgWp7r1grofbiDugQYRFev0HAxooIueVov/R3/7oGn09F7SS1LplxfCuh7mgboPM6LxytxjsLkjbQ1fnitbOz0mRsugFWIILzppVIYFd4zxAzkWx8jYg8gAx2iHswXpLkajvwqKAGpc7PSs/sCAlcwwbgWpT/wu+W0mGBe3I+bEFggCtKSFxqmiayNjontJcOQcALKakbFZv5L/2qLFf8TZsLufFyHYHeEOu2IWJYDqWq93J9oqA5tPekuz06hSIcNtkxI8x8ie2Tw8RXlxNTGA8/1jvUH5LwQKN3p0eN6w+gSTj0+2YQDb/g91nBGbXbJ0b5Tg+73cXYwaqDw3TG2WB8aWH7/NP2Zzl747cRmBemrV3yhF84lluYIuoEtV0WjKNIWIAS5S8OeE/EaoKwsm/KD64nvNjfnQpjMXKXc3RF8wSBAy3iP/YP9mS77NQ+YPwJAuFvejDAA1DaXK/O3lQ0kw9DF1LmF0v+Otr6jULJLhNNnV3z7P5JBPUhv0eJfNOUm/Z6ts7OPLArm0THPt6UrSxprqGoDRGIwRNe88J+1qjDlBt7X7+UYh9+h2wVkrdDmQkqRP7oE5s1QaD6EDo8/ZxRuiMw/v6p5wH9YOfDxZQslKY9eBpztxocttqqqK5Q7/XyfNRG1LrJWCSPWnUlEZSAxPOFP1KBEcdMh+Y5uws+GjEr9NpSNj17fn88et9yhrmquKIA8N+69W/xrfqftlDSVd0JXUPxM39rCRAH2lMBgUaNTRV2IWdj8gbBWKwfFhowadEena93XxLfkFcmIzhMyfv5dfTXL84xuTJBNjjGpLmBrj8K/1lE8fKDOJtztbf+WTbi+0HOF5" +DOTENV_VAULT_CI_VERSION=261 # stage DOTENV_VAULT_STAGE="bfqZYD8oVLWMZ0JR5LICV+sB/btaXavszxZLxTfwSH8U5fg=" diff --git a/.gitattributes b/.gitattributes index e50c79e..1287884 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Default diff --git a/.gitignore b/.gitignore index 98878b7..f361920 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Locals diff --git a/.npmignore b/.npmignore index 2db4497..c812030 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Locals diff --git a/.prettierignore b/.prettierignore index 5a9f8f9..3198e38 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index fa55c3d..28d6498 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` Mar 7, 2024 9:03 PM UTC. + * Last generated using `./settings.mjs` Mar 8, 2024 10:49 PM UTC. */ { "editor.formatOnType": false, diff --git a/.vscodeignore b/.vscodeignore index b93ace1..d085bde 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 7, 2024 9:03 PM UTC. +# Last generated Mar 8, 2024 10:49 PM UTC. # Locals diff --git a/package-lock.json b/package-lock.json index b2c02d9..208973b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.282", + "version": "1.0.283", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.282", + "version": "1.0.283", "cpu": [ "x64", "arm64" @@ -27,7 +27,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.890", + "@clevercanyon/utilities": "^1.0.891", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" @@ -1017,9 +1017,9 @@ } }, "node_modules/@clevercanyon/utilities": { - "version": "1.0.890", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.890.tgz", - "integrity": "sha512-UCYaXqPZ9aQFse5tIozWwAXZxzWNDcHWFVuyhQyq+yHr0u1wlhgJHfVV5FyZ8T+mdcGYfPd7o452kCvMNE9XGA==", + "version": "1.0.891", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.891.tgz", + "integrity": "sha512-Ge1X63WiH8tHDov10o1RHJgdPErbmTridrgJvYsiinIbgA3y+PIhT+bCED1Ph/FtQPxyJzQ6zRbQmy3jh1LQFQ==", "cpu": [ "x64", "arm64" @@ -1077,9 +1077,9 @@ } }, "node_modules/@clevercanyon/utilities.cfp": { - "version": "1.0.230", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.230.tgz", - "integrity": "sha512-geaCe2VHqI3ofMSIdLLdFSExzVAHhcdGdKdSdDe02fsQ0DH7i141p9BkCM461HBa9dWPV5DdtxX2TK414R+ymQ==", + "version": "1.0.231", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.231.tgz", + "integrity": "sha512-xRYfeKkt88QhLKcO9eiBt4EqoxuqVXPlauWkmkNSrLYq9KhALF/sqyDBSua5u0qPxc29swVI3sHX6kXkCZAc8Q==", "cpu": [ "x64", "arm64" @@ -1097,15 +1097,15 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.885", - "@clevercanyon/utilities.cfw": "^1.0.274", + "@clevercanyon/utilities": "^1.0.890", + "@clevercanyon/utilities.cfw": "^1.0.283", "@clevercanyon/utilities.web": "^1.0.152" } }, "node_modules/@clevercanyon/utilities.cfw": { - "version": "1.0.281", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.281.tgz", - "integrity": "sha512-lueLk4mbt/c+cB2UWvVmeNYlN+tmkmKYJ80lptY9+FMtMI02/QG7IOhL3gJzhkUzwfv/FhgxQvbiwrSamIot4Q==", + "version": "1.0.283", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.283.tgz", + "integrity": "sha512-v3awd9Nwl8dJJwOIWjmkzokxoN8Z/6KvJo+5m39//wHa+ySyfl3h28A6O7ETszENXfsDoW7I+G4q5GJBu2JuPQ==", "cpu": [ "x64", "arm64" @@ -1124,7 +1124,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.887", + "@clevercanyon/utilities": "^1.0.890", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" @@ -5323,9 +5323,9 @@ } }, "node_modules/@polka/url": { - "version": "1.0.0-next.24", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.24.tgz", - "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==", + "version": "1.0.0-next.25", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.25.tgz", + "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", "dev": true }, "node_modules/@preact/signals": { @@ -9518,9 +9518,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.696", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.696.tgz", - "integrity": "sha512-SOr0bHP52OvYg2chCsz/0+FUSMGFm8L8HKwPpx3cbwRY24EOemVJtbgTm+IFO8LzhcnPy+hXmTq7ZcZ8uUuaYg==", + "version": "1.4.699", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.699.tgz", + "integrity": "sha512-I7q3BbQi6e4tJJN5CRcyvxhK0iJb34TV8eJQcgh+fR2fQ8miMgZcEInckCo1U9exDHbfz7DLDnFn8oqH/VcRKw==", "dev": true }, "node_modules/emittery": { @@ -14208,10 +14208,13 @@ } }, "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14335,10 +14338,13 @@ } }, "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14428,10 +14434,13 @@ } }, "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14449,13 +14458,16 @@ } }, "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -29928,9 +29940,9 @@ } }, "node_modules/unplugin": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.8.3.tgz", - "integrity": "sha512-ZlLteXGDcyJgsbN2g4sZ3Dw6fpX1O5rjgeaA5MmQhhA2YxnTxsh43f8nDQgFOzcir0iv8GYMjtCV8MtyNnrhEg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.9.0.tgz", + "integrity": "sha512-14PslvMY3gNbXnQtNIRB566Q057L5Fe7f5LDEamxVi0QQVxoz5hrveBwwZLcKyHtZ09ysmipxRRj5Lv+BGz2Iw==", "dev": true, "dependencies": { "acorn": "^8.11.3", diff --git a/package.json b/package.json index 62e5130..0890312 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.283", + "version": "1.0.284", "license": "GPL-3.0-or-later", "name": "@clevercanyon/utilities.cfw", "description": "Utilities for JavaScript apps running in a Cloudflare Worker environment.", @@ -64,7 +64,7 @@ }, "dependencies": {}, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.890", + "@clevercanyon/utilities": "^1.0.891", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" diff --git a/src/cfw.ts b/src/cfw.ts index b6ddbca..fa9ba4d 100644 --- a/src/cfw.ts +++ b/src/cfw.ts @@ -106,28 +106,31 @@ const maybeInitializeGlobals = async (ircData: InitialRequestContextData): Promi * @returns Response promise. */ export const handleFetchEvent = async (ircData: InitialRequestContextData): Promise<$type.cfw.Response> => { - const { scheduledEvent, ctx, env, routes } = ircData; - let { request } = ircData; // Extracts wwritable irc data. + let { request } = ircData; // Extracts writable data. + const { scheduledEvent, ctx, env, routes } = ircData, + subrequestCounter = { value: 0 }; await maybeInitializeGlobals(ircData); // Initializes worker globals. const Logger = $class.getLogger(), // Initializes base audit and consent loggers. - baseAuditLogger = new Logger({ endpointToken: $env.get('APP_AUDIT_LOGGER_BEARER_TOKEN', { type: 'string', require: true }) }), - baseConsentLogger = new Logger({ endpointToken: $env.get('APP_CONSENT_LOGGER_BEARER_TOKEN', { type: 'string', require: true }) }); + // + auditLoggerBearerToken = $env.get('APP_AUDIT_LOGGER_BEARER_TOKEN', { type: 'string', require: true }), + consentLoggerBearerToken = $env.get('APP_CONSENT_LOGGER_BEARER_TOKEN', { type: 'string', require: true }), + // + baseAuditLogger = new Logger({ cfw: { ctx, subrequestCounter }, endpointToken: auditLoggerBearerToken }), + baseConsentLogger = new Logger({ cfw: { ctx, subrequestCounter }, endpointToken: consentLoggerBearerToken }); - // Initializes audit logger early so it’s available for any errors below. - // However, `request` is potentially rewritten, so reinitialize if it changes. - let auditLogger = baseAuditLogger.withContext({}, { cfw: { ctx }, request }); + let auditLogger = baseAuditLogger.withContext({}, { request }); try { let originalRequest = request; // Potentially rewritten. request = (await $http.prepareRequest(request, {})) as $type.cfw.Request; if (request !== originalRequest /* Reinitializes using rewritten request. */) { - auditLogger = baseAuditLogger.withContext({}, { cfw: { ctx }, request }); + auditLogger = baseAuditLogger.withContext({}, { request }); } const url = $url.parse(request.url) as $type.cfw.URL, - consentLogger = baseConsentLogger.withContext({}, { cfw: { ctx }, request }), + consentLogger = baseConsentLogger.withContext({}, { request }), rcData = $obj.freeze({ scheduledEvent, @@ -140,7 +143,7 @@ export const handleFetchEvent = async (ircData: InitialRequestContextData): Prom auditLogger, consentLogger, - subrequestCounter: { value: 0 }, + subrequestCounter, }); let response: Promise<$type.cfw.Response>; // Initialize. diff --git a/tsconfig.json b/tsconfig.json index fc473c4..6dd5ffd 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` Mar 7, 2024 9:03 PM UTC. + * Last generated using `./tsconfig.mjs` Mar 8, 2024 10:49 PM UTC. */ { "include": ["./src/**/*", "./dev-types.d.ts"], diff --git a/wrangler.toml b/wrangler.toml index a122111..9f89cec 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` Mar 7, 2024 9:03 PM UTC. +# Last generated using `./wrangler.mjs` Mar 8, 2024 10:49 PM UTC. ## send_metrics = false