From 83eaac32b5d98327b85d27c22653ce942fa34aab Mon Sep 17 00:00:00 2001 From: Jason Caldwell Date: Sat, 16 Mar 2024 14:24:18 -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 | 16 ++++++++-------- package.json | 2 +- src/resources/types/cfw.ts | 12 ++++++++++++ src/resources/types/env.d.ts | 3 ++- src/resources/types/gtag.d.ts | 3 ++- src/resources/types/turnstile.d.ts | 3 ++- src/type.ts | 12 +++++++++--- tsconfig.json | 2 +- wrangler.toml | 2 +- 18 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 src/resources/types/cfw.ts diff --git a/.browserslistrc b/.browserslistrc index f75944b2..889c5508 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. [production] node >= 20.9.0 diff --git a/.dockerignore b/.dockerignore index f99bbc3b..45e28fd6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Locals diff --git a/.env.vault b/.env.vault index 72d0d324..5a685f86 100644 --- a/.env.vault +++ b/.env.vault @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="7GW98NfL4hM4N6HbfeDXCKreVxKvcVPupFRnZ8XJ+pomaQ==" DOTENV_VAULT_MAIN_VERSION=1 # dev -DOTENV_VAULT_DEV="1O0cYOF/FlUUEXaQGATWmzHpVQ241EnjCZYaAVqgwAKm0xv+GPUZbBGNaVoaE6keUUL2DRvfLE2z+l6+rv2kb979t5T+9WaZKMY5kHUgYP3YuKaBzPqoKa0G785JlH1+7exn8CwCzb5+A6Rh0SRJTo4kQi+LA9t2vIb8dlmzcqJTIYK95sbhHtDPAN3L1ZLipCxBCosLHt7yoim3A3YAwwUAV7G4JvCUGYeS/VN0Chlm5uWEDD0utd7v1XXxiyNfaQ==" -DOTENV_VAULT_DEV_VERSION=461 +DOTENV_VAULT_DEV="KTkZsq9IrH/SMhrj1Ux9TdOLFbyrPTHSXYWgBbLqYETy5cPEBU4tES0bE7VbFTyoXg2XOoZHYwWIAJ0S70eZXBqrNo01t7Tuza4puAM8CaTpoXtbsTf388zeVBVD7Mv44SAFIAoFqDJgn3fiG28JKKLJecdk3UoOKdIgY/JJmtSkyn1oZSg94abLUsciSPPi7qEJzGVlOjTdUqv6W3Cp1e5a9698d5zWEtxFO6WsZQxgiBXdon/ZjVhz4cfrHkWiuQ==" +DOTENV_VAULT_DEV_VERSION=463 # ci -DOTENV_VAULT_CI="SZjAXZsdqeqtxcdrWlS0wCo/MsMQtrgRFpk3gZ8/sf6h/DwmxNNvPghrcQHOO3E/xoYqYiBr48juochkdIzJk6dD8FB+IBQGW8bihMNzkvkKalyhfEXrtI1dqKTwNxcdsfrAU7O6plVSPcSDLwOR9ZgxvxOu7ZTWFHIZ9YM1IQ==" -DOTENV_VAULT_CI_VERSION=461 +DOTENV_VAULT_CI="QeppaXeS0hY13B+HhFsge7Pj815wD9L4te9xFY1Gj8n8mRt34ukiMiW1HYc57cUgN4PJXWxhrXpzhQTh+4Nt/K0uKTTeCMzLXMbFL3+MB8dIvruBmhcUCyEFF1vBWTiTWOrbMFbXtlB/p3ignH3NB/XbvIrulaMv/Je1g/Vp/Q==" +DOTENV_VAULT_CI_VERSION=463 # stage DOTENV_VAULT_STAGE="aRP8su2YV4jZu3w1HZ/SLaots0IwJDFw75TCpvXEFeNp7tw=" diff --git a/.gitattributes b/.gitattributes index 5a22d86d..768c8d01 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Default diff --git a/.gitignore b/.gitignore index 267b615f..fe16f53b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Locals diff --git a/.npmignore b/.npmignore index eca15090..086f054c 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Locals diff --git a/.prettierignore b/.prettierignore index 95aad839..1c794d3b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index 0f14dcbf..437c1280 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 16, 2024 1:27 PM UTC. + * Last generated using `./settings.mjs` Mar 16, 2024 6:23 PM UTC. */ { "editor.formatOnType": false, diff --git a/.vscodeignore b/.vscodeignore index 021b945e..5807dc61 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 16, 2024 1:27 PM UTC. +# Last generated Mar 16, 2024 6:23 PM UTC. # Locals diff --git a/package-lock.json b/package-lock.json index da43fdcf..0479a730 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@clevercanyon/utilities", - "version": "1.0.916", + "version": "1.0.917", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@clevercanyon/utilities", - "version": "1.0.916", + "version": "1.0.917", "cpu": [ "x64", "arm64" @@ -1026,9 +1026,9 @@ } }, "node_modules/@clevercanyon/utilities": { - "version": "1.0.916", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.916.tgz", - "integrity": "sha512-a/2ptQKTDmdM2KhvqB1B5s6tfMq9w+gI5u8CH8owAlWsplvGQJbSTTopsjvy+WUscgD+fuTN4VF/T9bXyQ2m+w==", + "version": "1.0.917", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.917.tgz", + "integrity": "sha512-LujVeF758nukpuU1l3xeP4jCpGslvqamcpjHesLb75G9269kugakoU5wqOK7I+499CqziomJDB5LL+bTaQoQRQ==", "cpu": [ "x64", "arm64" @@ -1408,9 +1408,9 @@ } }, "node_modules/@csstools/css-color-parser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-1.6.0.tgz", - "integrity": "sha512-Wc1X6jZvGhT8Bii4jUF6tC3Je3wgDFg7D/SvGKndrnakDsCPk4TMxtt4AQHyWdMBrBJ1hLjXbppaXgP1DUIpBw==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-1.6.2.tgz", + "integrity": "sha512-mlt0PomBlDXMGcbPAqCG36Fw35LZTtaSgCQCHEs4k8QTv1cUKe0rJDlFSJMHtqrgQiLC7LAAS9+s9kKQp2ou/Q==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index a138e775..1d7a4e03 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.917", + "version": "1.0.918", "license": "GPL-3.0-or-later", "name": "@clevercanyon/utilities", "description": "Utilities for JavaScript apps running in any environment.", diff --git a/src/resources/types/cfw.ts b/src/resources/types/cfw.ts new file mode 100644 index 00000000..0866f4a5 --- /dev/null +++ b/src/resources/types/cfw.ts @@ -0,0 +1,12 @@ +/** + * Types. + */ +// organize-imports-ignore + +import { type $type } from '#index.ts'; +export type * from '@cloudflare/workers-types/experimental'; +import type * as cfw from '@cloudflare/workers-types/experimental'; + +export type Request = cfw.Request & { + c10n?: $type.RequestC10n['c10n']; +}; diff --git a/src/resources/types/env.d.ts b/src/resources/types/env.d.ts index a1a731fe..bc91c8da 100644 --- a/src/resources/types/env.d.ts +++ b/src/resources/types/env.d.ts @@ -1,6 +1,7 @@ /** - * Defines types for environments. + * Types. */ + interface Navigator { globalPrivacyControl: string; } diff --git a/src/resources/types/gtag.d.ts b/src/resources/types/gtag.d.ts index 889ca270..c1dc99d8 100644 --- a/src/resources/types/gtag.d.ts +++ b/src/resources/types/gtag.d.ts @@ -1,6 +1,7 @@ /** - * Defines types for Google Analytics. + * Types. */ + interface Window { dataLayer: IArguments[]; gtag: (...args: unknown[]) => void; diff --git a/src/resources/types/turnstile.d.ts b/src/resources/types/turnstile.d.ts index ecb67cd5..aefec958 100644 --- a/src/resources/types/turnstile.d.ts +++ b/src/resources/types/turnstile.d.ts @@ -1,6 +1,7 @@ /** - * Defines types for Turnstile. + * Types. */ + interface Window { onloadTurnstile: () => void; } diff --git a/src/type.ts b/src/type.ts index 6297b310..b8fb2bb7 100644 --- a/src/type.ts +++ b/src/type.ts @@ -8,8 +8,8 @@ import '#@initialize.ts'; import { type Dayjs } from 'dayjs'; +import type * as cfw from '#@types/cfw.ts'; import { type Interface as LoggerInterface } from '#@classes/logger.ts'; -import type * as cfw from '@cloudflare/workers-types/experimental'; import { $to, type $http } from '#index.ts'; // --- @@ -56,6 +56,7 @@ export type { $RawHeadersInit as RawHeadersInit }; export type { $Request as Request }; export type { $RequestInit as RequestInit }; +export type { $RequestC10n as RequestC10n }; export type { $Response as Response }; export type { $ResponseInit as ResponseInit }; @@ -491,9 +492,14 @@ type $Headers = Headers | cfw.Headers; type $HeadersInit = HeadersInit | cfw.HeadersInit | $StrKeyable<{ [x: string]: string }>; type $RawHeadersInit = HeadersInit | cfw.HeadersInit | $StrKeyable<{ [x: string]: string }> | string; -type $Request = Request | cfw.Request; +type $Request = (Request | cfw.Request) & { cache?: string }; type $RequestInit = (RequestInit | cfw.RequestInit) & { cache?: string }; - +type $RequestC10n = { + c10n?: { + scheduledEvent?: $cfw.ScheduledEvent; + serviceBinding?: { subrequestCounter: $cfw.SubrequestCounter }; + }; +}; type $Response = Response | cfw.Response; type $ResponseInit = ResponseInit | cfw.ResponseInit; type $BodyInit = BodyInit | cfw.BodyInit; diff --git a/tsconfig.json b/tsconfig.json index 045c8f2c..40ea4b7a 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 16, 2024 1:27 PM UTC. + * Last generated using `./tsconfig.mjs` Mar 16, 2024 6:23 PM UTC. */ { "include": ["./src/**/*", "./dev-types.d.ts"], diff --git a/wrangler.toml b/wrangler.toml index d038f1fe..6ea85478 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 16, 2024 1:27 PM UTC. +# Last generated using `./wrangler.mjs` Mar 16, 2024 6:23 PM UTC. ## send_metrics = false