From 491d42042c7a14bed236638d6ae12bbc937e597e Mon Sep 17 00:00:00 2001 From: Jason Caldwell Date: Tue, 12 Mar 2024 03:25:42 -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 | 142 +++++++++++++++++++++--------------------- package.json | 2 +- src/cfw.ts | 14 ++++- src/tests/redis.ts | 18 +++--- tsconfig.json | 2 +- wrangler.toml | 2 +- 15 files changed, 107 insertions(+), 97 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index cecda54..4a5ba13 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. [production] node >= 20.9.0 diff --git a/.dockerignore b/.dockerignore index 36b48a5..d9d6ab4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Locals diff --git a/.env.vault b/.env.vault index ab84538..22f0dd8 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="Sb5mdDZO+NmnBeW9JNWXg4aNay1O/soLVgqFtyVZSe3NPtPHgh0L6dihSski4wCd3FnhID7Xo7OZXHNzOUuLH3HDiHAX3j7YLj79CW3taOaO12ldBzzOG7xtBUOlsL92CUBQtUUXuMh2/UNzA3BgYyHejuXcq0KKRV7Lt2qulKzC4alYfSJXM+mbIiILuaDis5WYRHl86RcjryMSs/cSI3AP38d1sfQtmHSHPfPgGESS51Bsqzsw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oIf1GM6GWsx+3kHPRkNpsEH3MDVyYf216WWWkQn0DJRXpkc6su+k4JG4wLdUIRkSAn//CrukMC9WcXlh6KuxMw1sC/dbGzzV8V16P8jprf0OPincn4/6g+QePt6RvThuLvwHS0LnNXMZfRp7Szzhnj0M/3fMpDSYOEfqZjJrb7XgNT9pvlUDz7IdwLrj/lLmieD0DoN" +DOTENV_VAULT_CI_VERSION=275 # stage DOTENV_VAULT_STAGE="bfqZYD8oVLWMZ0JR5LICV+sB/btaXavszxZLxTfwSH8U5fg=" diff --git a/.gitattributes b/.gitattributes index 72deaa8..8303013 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Default diff --git a/.gitignore b/.gitignore index 271e117..57c7fef 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Locals diff --git a/.npmignore b/.npmignore index 7bf0d2f..4e7ee59 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Locals diff --git a/.prettierignore b/.prettierignore index 8b64347..4ade4d4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index dc4846b..d12dfa4 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 12, 2024 2:30 AM UTC. + * Last generated using `./settings.mjs` Mar 12, 2024 7:25 AM UTC. */ { "editor.formatOnType": false, diff --git a/.vscodeignore b/.vscodeignore index 1fd162e..2080334 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Mar 12, 2024 2:30 AM UTC. +# Last generated Mar 12, 2024 7:25 AM UTC. # Locals diff --git a/package-lock.json b/package-lock.json index 1f5e1e3..a0ed862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.289", + "version": "1.0.290", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@clevercanyon/utilities.cfw", - "version": "1.0.289", + "version": "1.0.290", "cpu": [ "x64", "arm64" @@ -1077,9 +1077,9 @@ } }, "node_modules/@clevercanyon/utilities.cfp": { - "version": "1.0.235", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.235.tgz", - "integrity": "sha512-j56PjgTbjM9rspr4Qfd+K2iQdV989jQRU57/2Hb/5bYolOyTwDEFV8u9cs82sqW4REuNUbBEMoQaqA3wwR/vFQ==", + "version": "1.0.236", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.236.tgz", + "integrity": "sha512-VfqDzHC8jsPwfTCyBxpNyV2JcsiWUwVN3unNqQfwMFg1X6vCam+HuLXRQ7Mx4EtJE2C19GHa6Lc0d+KqBUXexg==", "cpu": [ "x64", "arm64" @@ -1097,15 +1097,15 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.892", - "@clevercanyon/utilities.cfw": "^1.0.287", + "@clevercanyon/utilities": "^1.0.898", + "@clevercanyon/utilities.cfw": "^1.0.290", "@clevercanyon/utilities.web": "^1.0.152" } }, "node_modules/@clevercanyon/utilities.cfw": { - "version": "1.0.289", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.289.tgz", - "integrity": "sha512-VYihYGXFMTD5ITkK3IBUNqUyBGxjb153Snx3T3Dz1dGhi+zP/5ar+9083+NsL3WonSbhSwuMqSHCqlLmShyorA==", + "version": "1.0.290", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.290.tgz", + "integrity": "sha512-JBIRRGP8BIcdE9NsukLafP/8i8PF0U+eiTBGm3JFKBAJUmu1Uve8wWZaAEkpUtShTxsn9nHyM90OLjFAiDTVlg==", "cpu": [ "x64", "arm64" @@ -1124,7 +1124,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.892", + "@clevercanyon/utilities": "^1.0.898", "@cloudflare/ai": "1.0.53", "@upstash/ratelimit": "1.0.0", "@upstash/redis": "1.28.0" @@ -3588,13 +3588,13 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -5475,9 +5475,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz", - "integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", + "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", "cpu": [ "arm" ], @@ -5488,9 +5488,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz", - "integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", + "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", "cpu": [ "arm64" ], @@ -5501,9 +5501,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz", - "integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", + "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", "cpu": [ "arm64" ], @@ -5514,9 +5514,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz", - "integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", + "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", "cpu": [ "x64" ], @@ -5527,9 +5527,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz", - "integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", + "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", "cpu": [ "arm" ], @@ -5540,9 +5540,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz", - "integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", + "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", "cpu": [ "arm64" ], @@ -5553,9 +5553,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz", - "integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", + "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", "cpu": [ "arm64" ], @@ -5566,9 +5566,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz", - "integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", + "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", "cpu": [ "riscv64" ], @@ -5579,9 +5579,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz", - "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", + "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", "cpu": [ "x64" ], @@ -5592,9 +5592,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz", - "integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", + "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", "cpu": [ "x64" ], @@ -5605,9 +5605,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz", - "integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", + "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", "cpu": [ "arm64" ], @@ -5618,9 +5618,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz", - "integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", + "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", "cpu": [ "ia32" ], @@ -5631,9 +5631,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz", - "integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", + "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", "cpu": [ "x64" ], @@ -26668,9 +26668,9 @@ } }, "node_modules/rollup": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz", - "integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.0.tgz", + "integrity": "sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -26683,19 +26683,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.1", - "@rollup/rollup-android-arm64": "4.12.1", - "@rollup/rollup-darwin-arm64": "4.12.1", - "@rollup/rollup-darwin-x64": "4.12.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.1", - "@rollup/rollup-linux-arm64-gnu": "4.12.1", - "@rollup/rollup-linux-arm64-musl": "4.12.1", - "@rollup/rollup-linux-riscv64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-musl": "4.12.1", - "@rollup/rollup-win32-arm64-msvc": "4.12.1", - "@rollup/rollup-win32-ia32-msvc": "4.12.1", - "@rollup/rollup-win32-x64-msvc": "4.12.1", + "@rollup/rollup-android-arm-eabi": "4.13.0", + "@rollup/rollup-android-arm64": "4.13.0", + "@rollup/rollup-darwin-arm64": "4.13.0", + "@rollup/rollup-darwin-x64": "4.13.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.0", + "@rollup/rollup-linux-arm64-gnu": "4.13.0", + "@rollup/rollup-linux-arm64-musl": "4.13.0", + "@rollup/rollup-linux-riscv64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-gnu": "4.13.0", + "@rollup/rollup-linux-x64-musl": "4.13.0", + "@rollup/rollup-win32-arm64-msvc": "4.13.0", + "@rollup/rollup-win32-ia32-msvc": "4.13.0", + "@rollup/rollup-win32-x64-msvc": "4.13.0", "fsevents": "~2.3.2" } }, diff --git a/package.json b/package.json index 23377f5..a05b405 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.290", + "version": "1.0.291", "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/cfw.ts b/src/cfw.ts index 95e77ae..6a13bf2 100644 --- a/src/cfw.ts +++ b/src/cfw.ts @@ -291,6 +291,16 @@ export const serviceBindingRequest = async ( return new Request(requestInfo, requestInit); }; +/** + * Logs a heartbeat for monitoring purposes. + * + * @param rcData Request context data. + * @param id Heartbeat ID; e.g., `JGndBRX5LXN79q5q1GkpsmaQ`. + */ +export const heartbeat = async (rcData: $type.$cfw.RequestContextData, id: string): Promise => { + await $http.heartbeat(id, { cfw: rcData }); +}; + // --- // Misc utilities. @@ -401,8 +411,8 @@ const subrequestCounterProxy = (target: Type, subrequestCou * @returns Promise of a {@see $type.cfw.Response}. */ const handleFetchCache = async (rcData: RequestContextData, route: Route): Promise<$type.cfw.Response> => { - const { caches, Request } = cfw, - { ctx, url, request } = rcData; + const { Request } = cfw, + { ctx, url, request, caches } = rcData; // Populates cache key. diff --git a/src/tests/redis.ts b/src/tests/redis.ts index 9e64f43..00bc641 100644 --- a/src/tests/redis.ts +++ b/src/tests/redis.ts @@ -2,7 +2,7 @@ * Test suite. */ -import { $redis, cfw } from '#index.ts'; +import { $cfw, $redis, cfw } from '#index.ts'; import { $time, type $type } from '@clevercanyon/utilities'; import { describe, expect, test } from 'vitest'; @@ -18,7 +18,7 @@ describe('$redis', async () => { error: async () => true, flush: async () => true, }, - mockStdRequestContextData = { + mockRequestContextData = $cfw.rcDataPrepare({ ctx: { waitUntil: (): void => undefined, passThroughOnException: (): void => undefined, @@ -34,7 +34,7 @@ describe('$redis', async () => { auditLogger: mockLoggerInterface, consentLogger: mockLoggerInterface, subrequestCounter: { value: 0 }, - }, + }), redis = $redis.instance(); test('.set(), .get()', async () => { @@ -62,7 +62,7 @@ describe('$redis', async () => { test( '.rateLimiter()', async () => { - const rateLimiter = $redis.rateLimiter(mockStdRequestContextData, { + const rateLimiter = $redis.rateLimiter(mockRequestContextData, { slidingWindow: [10, '10s'], // 10 every 10 seconds. }); expect(await rateLimiter.limit('testKey')).toMatchObject({ success: true }); // 1 @@ -76,14 +76,14 @@ describe('$redis', async () => { expect(await rateLimiter.limit('testKey')).toMatchObject({ success: true }); // 9 expect(await rateLimiter.limit('testKey')).toMatchObject({ success: true }); // 10 - let thrownResponse: unknown; + let thrown: unknown; // Initialize. try { await rateLimiter.limit('testKey'); // 11 - } catch (thrown: unknown) { - thrownResponse = thrown; // Limit reached; response thrown. + } catch (unknownThrown: unknown) { + thrown = unknownThrown; // Limit reached; response thrown. } - expect(thrownResponse instanceof Response).toBe(true); - expect((thrownResponse as $type.cfw.Response).status).toBe(429); + expect(thrown instanceof Response).toBe(true); + expect((thrown as $type.cfw.Response).status).toBe(429); // Blocks until allowed to resume operations given the defined rate limiter. expect(await rateLimiter.blockUntilReady('testKey', $time.secondInMilliseconds * 10)).toMatchObject({ success: true }); diff --git a/tsconfig.json b/tsconfig.json index 2ef49c8..8be94ad 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 12, 2024 2:30 AM UTC. + * Last generated using `./tsconfig.mjs` Mar 12, 2024 7:25 AM UTC. */ { "include": ["./src/**/*", "./dev-types.d.ts"], diff --git a/wrangler.toml b/wrangler.toml index 70c59f0..335e5bd 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 12, 2024 2:30 AM UTC. +# Last generated using `./wrangler.mjs` Mar 12, 2024 7:25 AM UTC. ## send_metrics = false