diff --git a/package-lock.json b/package-lock.json index 6f7c486..3743601 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,11 +13,12 @@ "@aws-sdk/client-cloudfront": "3.590.0", "@aws-sdk/client-elastic-beanstalk": "3.590.0", "@aws-sdk/client-s3": "3.591.0", + "@aws-sdk/client-sqs": "3.682.0", "@aws-sdk/client-sts": "3.590.0", "@aws-sdk/credential-providers": "3.590.0", "@aws-sdk/util-endpoints": "3.587.0", "@dbbs/next-cache-handler-core": "1.2.0", - "@dbbs/next-cache-handler-s3": "1.1.4", + "@dbbs/next-cache-handler-s3": "1.2.0", "aws-cdk-lib": "2.144.0", "aws-sdk": "2.1635.0", "cdk-assets": "2.144.0", @@ -471,6 +472,647 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-sqs": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.682.0.tgz", + "integrity": "sha512-93r0i2VwiHiZkcXfWVoxMpyw91Ou0C6gyS7AzPHoZ9ZoXV1VaBFqQ/FmcLzzNa9pwjE6k/Pn7VJMNKBezE8EmQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/client-sts": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-sdk-sqs": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/md5-js": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/client-sso": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.682.0.tgz", + "integrity": "sha512-PYH9RFUMYLFl66HSBq4tIx6fHViMLkhJHTYJoJONpBs+Td+NwVJ895AdLtDsBIhMS0YseCbPpuyjUCJgsUrwUw==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.682.0.tgz", + "integrity": "sha512-ZPZ7Y/r/w3nx/xpPzGSqSQsB090Xk5aZZOH+WBhTDn/pBEuim09BYXCLzvvxb7R7NnuoQdrTJiwimdJAhHl7ZQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/client-sts": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.682.0.tgz", + "integrity": "sha512-xKuo4HksZ+F8m9DOfx/ZuWNhaPuqZFPwwy0xqcBT6sWH7OAuBjv/fnpOTzyQhpVTWddlf+ECtMAMrxjxuOExGQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-node": "3.682.0", + "@aws-sdk/middleware-host-header": "3.679.0", + "@aws-sdk/middleware-logger": "3.679.0", + "@aws-sdk/middleware-recursion-detection": "3.679.0", + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/region-config-resolver": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@aws-sdk/util-user-agent-browser": "3.679.0", + "@aws-sdk/util-user-agent-node": "3.682.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/core": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.679.0.tgz", + "integrity": "sha512-CS6PWGX8l4v/xyvX8RtXnBisdCa5+URzKd0L6GvHChype9qKUVxO/Gg6N/y43Hvg7MNWJt9FBPNWIxUB+byJwg==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/signature-v4": "^4.2.0", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-middleware": "^3.0.7", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.679.0.tgz", + "integrity": "sha512-EdlTYbzMm3G7VUNAMxr9S1nC1qUNqhKlAxFU8E7cKsAe8Bp29CD5HAs3POc56AVo9GC4yRIS+/mtlZSmrckzUA==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.679.0.tgz", + "integrity": "sha512-ZoKLubW5DqqV1/2a3TSn+9sSKg0T8SsYMt1JeirnuLJF0mCoYFUaWMyvxxKuxPoqvUsaycxKru4GkpJ10ltNBw==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-stream": "^3.1.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.682.0.tgz", + "integrity": "sha512-6eqWeHdK6EegAxqDdiCi215nT3QZPwukgWAYuVxNfJ/5m0/P7fAzF+D5kKVgByUvGJEbq/FEL8Fw7OBe64AA+g==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.682.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.682.0.tgz", + "integrity": "sha512-HSmDqZcBVZrTctHCT9m++vdlDfJ1ARI218qmZa+TZzzOFNpKWy6QyHMEra45GB9GnkkMmV6unoDSPMuN0AqcMg==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.679.0", + "@aws-sdk/credential-provider-http": "3.679.0", + "@aws-sdk/credential-provider-ini": "3.682.0", + "@aws-sdk/credential-provider-process": "3.679.0", + "@aws-sdk/credential-provider-sso": "3.682.0", + "@aws-sdk/credential-provider-web-identity": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.679.0.tgz", + "integrity": "sha512-u/p4TV8kQ0zJWDdZD4+vdQFTMhkDEJFws040Gm113VHa/Xo1SYOjbpvqeuFoz6VmM0bLvoOWjxB9MxnSQbwKpQ==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.682.0.tgz", + "integrity": "sha512-h7IH1VsWgV6YAJSWWV6y8uaRjGqLY3iBpGZlXuTH/c236NMLaNv+WqCBLeBxkFGUb2WeQ+FUPEJDCD69rgLIkg==", + "dependencies": { + "@aws-sdk/client-sso": "3.682.0", + "@aws-sdk/core": "3.679.0", + "@aws-sdk/token-providers": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.679.0.tgz", + "integrity": "sha512-a74tLccVznXCaBefWPSysUcLXYJiSkeUmQGtalNgJ1vGkE36W5l/8czFiiowdWdKWz7+x6xf0w+Kjkjlj42Ung==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.679.0.tgz", + "integrity": "sha512-y176HuQ8JRY3hGX8rQzHDSbCl9P5Ny9l16z4xmaiLo+Qfte7ee4Yr3yaAKd7GFoJ3/Mhud2XZ37fR015MfYl2w==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-logger": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.679.0.tgz", + "integrity": "sha512-0vet8InEj7nvIvGKk+ch7bEF5SyZ7Us9U7YTEgXPrBNStKeRUsgwRm0ijPWWd0a3oz2okaEwXsFl7G/vI0XiEA==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.679.0.tgz", + "integrity": "sha512-sQoAZFsQiW/LL3DfKMYwBoGjYDEnMbA9WslWN8xneCmBAwKo6IcSksvYs23PP8XMIoBGe2I2J9BSr654XWygTQ==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.682.0.tgz", + "integrity": "sha512-7TyvYR9HdGH1/Nq0eeApUTM4izB6rExiw87khVYuJwZHr6FmvIL1FsOVFro/4WlXa0lg4LiYOm/8H8dHv+fXTg==", + "dependencies": { + "@aws-sdk/core": "3.679.0", + "@aws-sdk/types": "3.679.0", + "@aws-sdk/util-endpoints": "3.679.0", + "@smithy/core": "^2.4.8", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.679.0.tgz", + "integrity": "sha512-Ybx54P8Tg6KKq5ck7uwdjiKif7n/8g1x+V0V9uTjBjRWqaIgiqzXwKWoPj6NCNkE7tJNtqI4JrNxp/3S3HvmRw==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/token-providers": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.679.0.tgz", + "integrity": "sha512-1/+Zso/x2jqgutKixYFQEGli0FELTgah6bm7aB+m2FAWH4Hz7+iMUsazg6nSWm714sG9G3h5u42Dmpvi9X6/hA==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.679.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/types": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.679.0.tgz", + "integrity": "sha512-NwVq8YvInxQdJ47+zz4fH3BRRLC6lL+WLkvr242PVBbUOLRyK/lkwHlfiKUoeVIMyK5NF+up6TRg71t/8Bny6Q==", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/util-endpoints": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.679.0.tgz", + "integrity": "sha512-YL6s4Y/1zC45OvddvgE139fjeWSKKPgLlnfrvhVL7alNyY9n7beR4uhoDpNrt5mI6sn9qiBF17790o+xLAXjjg==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "@smithy/util-endpoints": "^2.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.679.0.tgz", + "integrity": "sha512-CusSm2bTBG1kFypcsqU8COhnYc6zltobsqs3nRrvYqYaOqtMnuE46K4XTWpnzKgwDejgZGOE+WYyprtAxrPvmQ==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/types": "^3.5.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.682.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.682.0.tgz", + "integrity": "sha512-so5s+j0gPoTS0HM4HPL+G0ajk0T6cQAg8JXzRgvyiQAxqie+zGCZAV3VuVeMNWMVbzsgZl0pYZaatPFTLG/AxA==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.682.0", + "@aws-sdk/types": "3.679.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@smithy/signature-v4": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.2.1.tgz", + "integrity": "sha512-NsV1jF4EvmO5wqmaSzlnTVetemBS3FZHdyc5CExbDljcyJCEEkJr8ANu2JvtNbVg/9MvKAWV44kTrGS+Pi4INg==", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "@smithy/protocol-http": "^4.1.5", + "@smithy/types": "^3.6.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-middleware": "^3.0.8", + "@smithy/util-uri-escape": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/@smithy/util-buffer-from/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sqs/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/client-sso": { "version": "3.590.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.590.0.tgz", @@ -927,6 +1569,34 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/middleware-sdk-sqs": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.679.0.tgz", + "integrity": "sha512-GjOpT9GRMH6n3Rm9ZsRsrIbLxBPE3/L1KMkIn2uZj14uqz1pdE4ALCN9b9ZkPN+L//rsUrYqtd9gq9Hn9c2FJw==", + "dependencies": { + "@aws-sdk/types": "3.679.0", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sqs/node_modules/@aws-sdk/types": { + "version": "3.679.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.679.0.tgz", + "integrity": "sha512-NwVq8YvInxQdJ47+zz4fH3BRRLC6lL+WLkvr242PVBbUOLRyK/lkwHlfiKUoeVIMyK5NF+up6TRg71t/8Bny6Q==", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/@aws-sdk/middleware-signing": { "version": "3.587.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.587.0.tgz", @@ -1252,9 +1922,9 @@ } }, "node_modules/@dbbs/next-cache-handler-s3": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@dbbs/next-cache-handler-s3/-/next-cache-handler-s3-1.1.4.tgz", - "integrity": "sha512-Tkg+JQIFwZqmDk+S254h7qNeqbU2ucq4Bfrauo1aicFlhgb3PvVoewu99CBlkaKqy2nBv8/lX2ICHQjaMR3ENQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@dbbs/next-cache-handler-s3/-/next-cache-handler-s3-1.2.0.tgz", + "integrity": "sha512-WbPOEbJVciiO27+29uLe5guIoLWxe/RI1dMIVl0yvEDIEP6OemrTpnha5BWyZyZA6dM3heXB9hUZw9SF9CAM3Q==", "dependencies": { "@aws-sdk/client-s3": "3.583.0" } @@ -3173,11 +3843,11 @@ } }, "node_modules/@smithy/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-p6GlFGBt9K4MYLu72YuJ523NVR4A8oHlC5M2JO6OmQqN8kAc/uh1JqLE+FizTokrSJGg0CSvC+BrsmGzKtsZKA==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.6.tgz", + "integrity": "sha512-0XuhuHQlEqbNQZp7QxxrFTdVWdwxch4vjxYgfInF91hZFkPxf9QDrdQka0KfxFMPqLNzSw0b95uGTrLliQUavQ==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3202,14 +3872,14 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.1.tgz", - "integrity": "sha512-hbkYJc20SBDz2qqLzttjI/EqXemtmWk0ooRznLsiXp3066KQRTvuKHa7U4jCZCJq6Dozqvy0R1/vNESC9inPJg==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.10.tgz", + "integrity": "sha512-Uh0Sz9gdUuz538nvkPiyv1DZRX9+D15EKDtnQP5rYVAzM/dnYk3P8cg73jcxyOitPgT3mE3OVj7ky7sibzHWkw==", "dependencies": { - "@smithy/node-config-provider": "^3.1.0", - "@smithy/types": "^3.0.0", + "@smithy/node-config-provider": "^3.1.9", + "@smithy/types": "^3.6.0", "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.0", + "@smithy/util-middleware": "^3.0.8", "tslib": "^2.6.2" }, "engines": { @@ -3217,17 +3887,17 @@ } }, "node_modules/@smithy/core": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.1.1.tgz", - "integrity": "sha512-0vbIwwUcg0FMhTVJgMhbsRSAFL0rwduy/OQz7Xq1pJXJOyaGv+PGjj1iGawRlzBUPA5BkJv7S6q+YU2U8gk/WA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.5.1.tgz", + "integrity": "sha512-DujtuDA7BGEKExJ05W5OdxCoyekcKT3Rhg1ZGeiUWaz2BJIWXjZmsG/DIP4W48GHno7AQwRsaCb8NcBgH3QZpg==", "dependencies": { - "@smithy/middleware-endpoint": "^3.0.1", - "@smithy/middleware-retry": "^3.0.3", - "@smithy/middleware-serde": "^3.0.0", - "@smithy/protocol-http": "^4.0.0", - "@smithy/smithy-client": "^3.1.1", - "@smithy/types": "^3.0.0", - "@smithy/util-middleware": "^3.0.0", + "@smithy/middleware-serde": "^3.0.8", + "@smithy/protocol-http": "^4.1.5", + "@smithy/types": "^3.6.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-middleware": "^3.0.8", + "@smithy/util-stream": "^3.2.1", + "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { @@ -3235,14 +3905,14 @@ } }, "node_modules/@smithy/credential-provider-imds": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.1.0.tgz", - "integrity": "sha512-q4A4d38v8pYYmseu/jTS3Z5I3zXlEOe5Obi+EJreVKgSVyWUHOd7/yaVCinC60QG4MRyCs98tcxBH1IMC0bu7Q==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.5.tgz", + "integrity": "sha512-4FTQGAsuwqTzVMmiRVTn0RR9GrbRfkP0wfu/tXWVHd2LgNpTY0uglQpIScXK4NaEyXbB3JmZt8gfVqO50lP8wg==", "dependencies": { - "@smithy/node-config-provider": "^3.1.0", - "@smithy/property-provider": "^3.1.0", - "@smithy/types": "^3.0.0", - "@smithy/url-parser": "^3.0.0", + "@smithy/node-config-provider": "^3.1.9", + "@smithy/property-provider": "^3.1.8", + "@smithy/types": "^3.6.0", + "@smithy/url-parser": "^3.0.8", "tslib": "^2.6.2" }, "engines": { @@ -3312,13 +3982,13 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.0.1.tgz", - "integrity": "sha512-uaH74i5BDj+rBwoQaXioKpI0SHBJFtOVwzrCpxZxphOW0ki5jhj7dXvDMYM2IJem8TpdFvS2iC08sjOblfFGFg==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.9.tgz", + "integrity": "sha512-hYNVQOqhFQ6vOpenifFME546f0GfJn2OiQ3M0FDmuUu8V/Uiwy2wej7ZXxFBNqdx0R5DZAqWM1l6VRhGz8oE6A==", "dependencies": { - "@smithy/protocol-http": "^4.0.0", - "@smithy/querystring-builder": "^3.0.0", - "@smithy/types": "^3.0.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/querystring-builder": "^3.0.7", + "@smithy/types": "^3.5.0", "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" } @@ -3335,11 +4005,11 @@ } }, "node_modules/@smithy/hash-node": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.0.tgz", - "integrity": "sha512-84qXstNemP3XS5jcof0el6+bDfjzuvhJPQTEfro3lgtbCtKgzPm3MgiS6ehXVPjeQ5+JS0HqmTz8f/RYfzHVxw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.8.tgz", + "integrity": "sha512-tlNQYbfpWXHimHqrvgo14DrMAgUBua/cNoz9fMYcDmYej7MAmUcjav/QKQbFc3NrcPxeJ7QClER4tWZmfwoPng==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" @@ -3362,11 +4032,11 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.0.tgz", - "integrity": "sha512-F6wBBaEFgJzj0s4KUlliIGPmqXemwP6EavgvDqYwCH40O5Xr2iMHvS8todmGVZtuJCorBkXsYLyTu4PuizVq5g==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.8.tgz", + "integrity": "sha512-7Qynk6NWtTQhnGTTZwks++nJhQ1O54Mzi7fz4PqZOiYXb4Z1Flpb2yRvdALoggTS8xjtohWUM+RygOtB30YL3Q==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" } }, @@ -3382,22 +4052,22 @@ } }, "node_modules/@smithy/md5-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-3.0.0.tgz", - "integrity": "sha512-Tm0vrrVzjlD+6RCQTx7D3Ls58S3FUH1ZCtU1MIh/qQmaOo1H9lMN2as6CikcEwgattnA9SURSdoJJ27xMcEfMA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-3.0.8.tgz", + "integrity": "sha512-LwApfTK0OJ/tCyNUXqnWCKoE2b4rDSr4BJlDAVCkiWYeHESr+y+d5zlAanuLW6fnitVJRD/7d9/kN/ZM9Su4mA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" } }, "node_modules/@smithy/middleware-content-length": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.0.tgz", - "integrity": "sha512-3C4s4d/iGobgCtk2tnWW6+zSTOBg1PRAm2vtWZLdriwTroFbbWNSr3lcyzHdrQHnEXYCC5K52EbpfodaIUY8sg==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.10.tgz", + "integrity": "sha512-T4dIdCs1d/+/qMpwhJ1DzOhxCZjZHbHazEPJWdB4GDi2HjIZllVzeBEcdJUN0fomV8DURsgOyrbEUzg3vzTaOg==", "dependencies": { - "@smithy/protocol-http": "^4.0.0", - "@smithy/types": "^3.0.0", + "@smithy/protocol-http": "^4.1.5", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3405,16 +4075,17 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.0.1.tgz", - "integrity": "sha512-lQ/UOdGD4KM5kLZiAl0q8Qy3dPbynvAXKAdXnYlrA1OpaUwr+neSsVokDZpY6ZVb5Yx8jnus29uv6XWpM9P4SQ==", - "dependencies": { - "@smithy/middleware-serde": "^3.0.0", - "@smithy/node-config-provider": "^3.1.0", - "@smithy/shared-ini-file-loader": "^3.1.0", - "@smithy/types": "^3.0.0", - "@smithy/url-parser": "^3.0.0", - "@smithy/util-middleware": "^3.0.0", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.2.1.tgz", + "integrity": "sha512-wWO3xYmFm6WRW8VsEJ5oU6h7aosFXfszlz3Dj176pTij6o21oZnzkCLzShfmRaaCHDkBXWBdO0c4sQAvLFP6zA==", + "dependencies": { + "@smithy/core": "^2.5.1", + "@smithy/middleware-serde": "^3.0.8", + "@smithy/node-config-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.9", + "@smithy/types": "^3.6.0", + "@smithy/url-parser": "^3.0.8", + "@smithy/util-middleware": "^3.0.8", "tslib": "^2.6.2" }, "engines": { @@ -3422,17 +4093,17 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.3.tgz", - "integrity": "sha512-Wve1qzJb83VEU/6q+/I0cQdAkDnuzELC6IvIBwDzUEiGpKqXgX1v10FUuZGbRS6Ov/P+HHthcAoHOJZQvZNAkA==", - "dependencies": { - "@smithy/node-config-provider": "^3.1.0", - "@smithy/protocol-http": "^4.0.0", - "@smithy/service-error-classification": "^3.0.0", - "@smithy/smithy-client": "^3.1.1", - "@smithy/types": "^3.0.0", - "@smithy/util-middleware": "^3.0.0", - "@smithy/util-retry": "^3.0.0", + "version": "3.0.25", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.25.tgz", + "integrity": "sha512-m1F70cPaMBML4HiTgCw5I+jFNtjgz5z5UdGnUbG37vw6kh4UvizFYjqJGHvicfgKMkDL6mXwyPp5mhZg02g5sg==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.5", + "@smithy/service-error-classification": "^3.0.8", + "@smithy/smithy-client": "^3.4.2", + "@smithy/types": "^3.6.0", + "@smithy/util-middleware": "^3.0.8", + "@smithy/util-retry": "^3.0.8", "tslib": "^2.6.2", "uuid": "^9.0.1" }, @@ -3441,11 +4112,11 @@ } }, "node_modules/@smithy/middleware-serde": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.0.tgz", - "integrity": "sha512-I1vKG1foI+oPgG9r7IMY1S+xBnmAn1ISqployvqkwHoSb8VPsngHDTOgYGYBonuOKndaWRUGJZrKYYLB+Ane6w==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.8.tgz", + "integrity": "sha512-Xg2jK9Wc/1g/MBMP/EUn2DLspN8LNt+GMe7cgF+Ty3vl+Zvu+VeZU5nmhveU+H8pxyTsjrAkci8NqY6OuvZnjA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3453,11 +4124,11 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.0.tgz", - "integrity": "sha512-+H0jmyfAyHRFXm6wunskuNAqtj7yfmwFB6Fp37enytp2q047/Od9xetEaUbluyImOlGnGpaVGaVfjwawSr+i6Q==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.8.tgz", + "integrity": "sha512-d7ZuwvYgp1+3682Nx0MD3D/HtkmZd49N3JUndYWQXfRZrYEnCWYc8BHcNmVsPAp9gKvlurdg/mubE6b/rPS9MA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3465,13 +4136,13 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.0.tgz", - "integrity": "sha512-ngfB8QItUfTFTfHMvKuc2g1W60V1urIgZHqD1JNFZC2tTWXahqf2XvKXqcBS7yZqR7GqkQQZy11y/lNOUWzq7Q==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.9.tgz", + "integrity": "sha512-qRHoah49QJ71eemjuS/WhUXB+mpNtwHRWQr77J/m40ewBVVwvo52kYAmb7iuaECgGTTcYxHS4Wmewfwy++ueew==", "dependencies": { - "@smithy/property-provider": "^3.1.0", - "@smithy/shared-ini-file-loader": "^3.1.0", - "@smithy/types": "^3.0.0", + "@smithy/property-provider": "^3.1.8", + "@smithy/shared-ini-file-loader": "^3.1.9", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3479,14 +4150,14 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.0.0.tgz", - "integrity": "sha512-3trD4r7NOMygwLbUJo4eodyQuypAWr7uvPnebNJ9a70dQhVn+US8j/lCnvoJS6BXfZeF7PkkkI0DemVJw+n+eQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.2.5.tgz", + "integrity": "sha512-PkOwPNeKdvX/jCpn0A8n9/TyoxjGZB8WVoJmm9YzsnAgggTj4CrjpRHlTQw7dlLZ320n1mY1y+nTRUDViKi/3w==", "dependencies": { - "@smithy/abort-controller": "^3.0.0", - "@smithy/protocol-http": "^4.0.0", - "@smithy/querystring-builder": "^3.0.0", - "@smithy/types": "^3.0.0", + "@smithy/abort-controller": "^3.1.6", + "@smithy/protocol-http": "^4.1.5", + "@smithy/querystring-builder": "^3.0.8", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3494,11 +4165,11 @@ } }, "node_modules/@smithy/property-provider": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.0.tgz", - "integrity": "sha512-Tj3+oVhqdZgemjCiWjFlADfhvLF4C/uKDuKo7/tlEsRQ9+3emCreR2xndj970QSRSsiCEU8hZW3/8JQu+n5w4Q==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.8.tgz", + "integrity": "sha512-ukNUyo6rHmusG64lmkjFeXemwYuKge1BJ8CtpVKmrxQxc6rhUX0vebcptFA9MmrGsnLhwnnqeH83VTU9hwOpjA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3506,11 +4177,11 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.0.0.tgz", - "integrity": "sha512-qOQZOEI2XLWRWBO9AgIYuHuqjZ2csyr8/IlgFDHDNuIgLAMRx2Bl8ck5U5D6Vh9DPdoaVpuzwWMa0xcdL4O/AQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.5.tgz", + "integrity": "sha512-hsjtwpIemmCkm3ZV5fd/T0bPIugW1gJXwZ/hpuVubt2hEUApIoUTrf6qIdh9MAWlw0vjMrA1ztJLAwtNaZogvg==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3518,11 +4189,11 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.0.tgz", - "integrity": "sha512-bW8Fi0NzyfkE0TmQphDXr1AmBDbK01cA4C1Z7ggwMAU5RDz5AAv/KmoRwzQAS0kxXNf/D2ALTEgwK0U2c4LtRg==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.8.tgz", + "integrity": "sha512-btYxGVqFUARbUrN6VhL9c3dnSviIwBYD9Rz1jHuN1hgh28Fpv2xjU1HeCeDJX68xctz7r4l1PBnFhGg1WBBPuA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "@smithy/util-uri-escape": "^3.0.0", "tslib": "^2.6.2" }, @@ -3531,11 +4202,11 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.0.tgz", - "integrity": "sha512-UzHwthk0UEccV4dHzPySnBy34AWw3V9lIqUTxmozQ+wPDAO9csCWMfOLe7V9A2agNYy7xE+Pb0S6K/J23JSzfQ==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.8.tgz", + "integrity": "sha512-BtEk3FG7Ks64GAbt+JnKqwuobJNX8VmFLBsKIwWr1D60T426fGrV2L3YS5siOcUhhp6/Y6yhBw1PSPxA5p7qGg==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3543,22 +4214,22 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.0.tgz", - "integrity": "sha512-3BsBtOUt2Gsnc3X23ew+r2M71WwtpHfEDGhHYHSDg6q1t8FrWh15jT25DLajFV1H+PpxAJ6gqe9yYeRUsmSdFA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.8.tgz", + "integrity": "sha512-uEC/kCCFto83bz5ZzapcrgGqHOh/0r69sZ2ZuHlgoD5kYgXJEThCoTuw/y1Ub3cE7aaKdznb+jD9xRPIfIwD7g==", "dependencies": { - "@smithy/types": "^3.0.0" + "@smithy/types": "^3.6.0" }, "engines": { "node": ">=16.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.0.tgz", - "integrity": "sha512-dAM7wSX0NR3qTNyGVN/nwwpEDzfV9T/3AN2eABExWmda5VqZKSsjlINqomO5hjQWGv+IIkoXfs3u2vGSNz8+Rg==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.9.tgz", + "integrity": "sha512-/+OsJRNtoRbtsX0UpSgWVxFZLsJHo/4sTr+kBg/J78sr7iC+tHeOvOJrS5hCpVQ6sWBbhWLp1UNiuMyZhE6pmA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3583,15 +4254,16 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.1.1.tgz", - "integrity": "sha512-tj4Ku7MpzZR8cmVuPcSbrLFVxmptWktmJMwST/uIEq4sarabEdF8CbmQdYB7uJ/X51Qq2EYwnRsoS7hdR4B7rA==", - "dependencies": { - "@smithy/middleware-endpoint": "^3.0.1", - "@smithy/middleware-stack": "^3.0.0", - "@smithy/protocol-http": "^4.0.0", - "@smithy/types": "^3.0.0", - "@smithy/util-stream": "^3.0.1", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.4.2.tgz", + "integrity": "sha512-dxw1BDxJiY9/zI3cBqfVrInij6ShjpV4fmGHesGZZUiP9OSE/EVfdwdRz0PgvkEvrZHpsj2htRaHJfftE8giBA==", + "dependencies": { + "@smithy/core": "^2.5.1", + "@smithy/middleware-endpoint": "^3.2.1", + "@smithy/middleware-stack": "^3.0.8", + "@smithy/protocol-http": "^4.1.5", + "@smithy/types": "^3.6.0", + "@smithy/util-stream": "^3.2.1", "tslib": "^2.6.2" }, "engines": { @@ -3599,9 +4271,9 @@ } }, "node_modules/@smithy/types": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.0.0.tgz", - "integrity": "sha512-VvWuQk2RKFuOr98gFhjca7fkBS+xLLURT8bUjk5XQoV0ZLm7WPwWPPY3/AwzTLuUBDeoKDCthfe1AsTUWaSEhw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.6.0.tgz", + "integrity": "sha512-8VXK/KzOHefoC65yRgCn5vG1cysPJjHnOVt9d0ybFQSmJgQj152vMn4EkYhGuaOmnnZvCPav/KnYyE6/KsNZ2w==", "dependencies": { "tslib": "^2.6.2" }, @@ -3610,12 +4282,12 @@ } }, "node_modules/@smithy/url-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.0.tgz", - "integrity": "sha512-2XLazFgUu+YOGHtWihB3FSLAfCUajVfNBXGGYjOaVKjLAuAxx3pSBY3hBgLzIgB17haf59gOG3imKqTy8mcrjw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.8.tgz", + "integrity": "sha512-4FdOhwpTW7jtSFWm7SpfLGKIBC9ZaTKG5nBF0wK24aoQKQyDIKUw3+KFWCQ9maMzrgTJIuOvOnsV2lLGW5XjTg==", "dependencies": { - "@smithy/querystring-parser": "^3.0.0", - "@smithy/types": "^3.0.0", + "@smithy/querystring-parser": "^3.0.8", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" } }, @@ -3675,13 +4347,13 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.3.tgz", - "integrity": "sha512-3DFON2bvXJAukJe+qFgPV/rorG7ZD3m4gjCXHD1V5z/tgKQp5MCTCLntrd686tX6tj8Uli3lefWXJudNg5WmCA==", + "version": "3.0.25", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.25.tgz", + "integrity": "sha512-fRw7zymjIDt6XxIsLwfJfYUfbGoO9CmCJk6rjJ/X5cd20+d2Is7xjU5Kt/AiDt6hX8DAf5dztmfP5O82gR9emA==", "dependencies": { - "@smithy/property-provider": "^3.1.0", - "@smithy/smithy-client": "^3.1.1", - "@smithy/types": "^3.0.0", + "@smithy/property-provider": "^3.1.8", + "@smithy/smithy-client": "^3.4.2", + "@smithy/types": "^3.6.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, @@ -3690,16 +4362,16 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.3.tgz", - "integrity": "sha512-D0b8GJXecT00baoSQ3Iieu3k3mZ7GY8w1zmg8pdogYrGvWJeLcIclqk2gbkG4K0DaBGWrO6v6r20iwIFfDYrmA==", - "dependencies": { - "@smithy/config-resolver": "^3.0.1", - "@smithy/credential-provider-imds": "^3.1.0", - "@smithy/node-config-provider": "^3.1.0", - "@smithy/property-provider": "^3.1.0", - "@smithy/smithy-client": "^3.1.1", - "@smithy/types": "^3.0.0", + "version": "3.0.25", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.25.tgz", + "integrity": "sha512-H3BSZdBDiVZGzt8TG51Pd2FvFO0PAx/A0mJ0EH8a13KJ6iUCdYnw/Dk/MdC1kTd0eUuUGisDFaxXVXo4HHFL1g==", + "dependencies": { + "@smithy/config-resolver": "^3.0.10", + "@smithy/credential-provider-imds": "^3.2.5", + "@smithy/node-config-provider": "^3.1.9", + "@smithy/property-provider": "^3.1.8", + "@smithy/smithy-client": "^3.4.2", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3707,12 +4379,12 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.0.1.tgz", - "integrity": "sha512-ZRT0VCOnKlVohfoABMc8lWeQo/JEFuPWctfNRXgTHbyOVssMOLYFUNWukxxiHRGVAhV+n3c0kPW+zUqckjVPEA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.4.tgz", + "integrity": "sha512-kPt8j4emm7rdMWQyL0F89o92q10gvCUa6sBkBtDJ7nV2+P7wpXczzOfoDJ49CKXe5CCqb8dc1W+ZdLlrKzSAnQ==", "dependencies": { - "@smithy/node-config-provider": "^3.1.0", - "@smithy/types": "^3.0.0", + "@smithy/node-config-provider": "^3.1.9", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3731,11 +4403,11 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.0.tgz", - "integrity": "sha512-q5ITdOnV2pXHSVDnKWrwgSNTDBAMHLptFE07ua/5Ty5WJ11bvr0vk2a7agu7qRhrCFRQlno5u3CneU5EELK+DQ==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.8.tgz", + "integrity": "sha512-p7iYAPaQjoeM+AKABpYWeDdtwQNxasr4aXQEA/OmbOaug9V0odRVDy3Wx4ci8soljE/JXQo+abV0qZpW8NX0yA==", "dependencies": { - "@smithy/types": "^3.0.0", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3743,12 +4415,12 @@ } }, "node_modules/@smithy/util-retry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.0.tgz", - "integrity": "sha512-nK99bvJiziGv/UOKJlDvFF45F00WgPLKVIGUfAK+mDhzVN2hb/S33uW2Tlhg5PVBoqY7tDVqL0zmu4OxAHgo9g==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.8.tgz", + "integrity": "sha512-TCEhLnY581YJ+g1x0hapPz13JFqzmh/pMWL2KEFASC51qCfw3+Y47MrTmea4bUE5vsdxQ4F6/KFbUeSz22Q1ow==", "dependencies": { - "@smithy/service-error-classification": "^3.0.0", - "@smithy/types": "^3.0.0", + "@smithy/service-error-classification": "^3.0.8", + "@smithy/types": "^3.6.0", "tslib": "^2.6.2" }, "engines": { @@ -3756,13 +4428,13 @@ } }, "node_modules/@smithy/util-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.0.1.tgz", - "integrity": "sha512-7F7VNNhAsfMRA8I986YdOY5fE0/T1/ZjFF6OLsqkvQVNP3vZ/szYDfGCyphb7ioA09r32K/0qbSFfNFU68aSzA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.2.1.tgz", + "integrity": "sha512-R3ufuzJRxSJbE58K9AEnL/uSZyVdHzud9wLS8tIbXclxKzoe09CRohj2xV8wpx5tj7ZbiJaKYcutMm1eYgz/0A==", "dependencies": { - "@smithy/fetch-http-handler": "^3.0.1", - "@smithy/node-http-handler": "^3.0.0", - "@smithy/types": "^3.0.0", + "@smithy/fetch-http-handler": "^4.0.0", + "@smithy/node-http-handler": "^3.2.5", + "@smithy/types": "^3.6.0", "@smithy/util-base64": "^3.0.0", "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-hex-encoding": "^3.0.0", @@ -3773,6 +4445,18 @@ "node": ">=16.0.0" } }, + "node_modules/@smithy/util-stream/node_modules/@smithy/fetch-http-handler": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-4.0.0.tgz", + "integrity": "sha512-MLb1f5tbBO2X6K4lMEKJvxeLooyg7guq48C2zKr4qM7F2Gpkz4dc+hdSgu77pCJ76jVqFBjZczHYAs6dp15N+g==", + "dependencies": { + "@smithy/protocol-http": "^4.1.5", + "@smithy/querystring-builder": "^3.0.8", + "@smithy/types": "^3.6.0", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, "node_modules/@smithy/util-uri-escape": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", diff --git a/package.json b/package.json index 206b22f..4531d47 100644 --- a/package.json +++ b/package.json @@ -62,11 +62,12 @@ "@aws-sdk/client-cloudfront": "3.590.0", "@aws-sdk/client-elastic-beanstalk": "3.590.0", "@aws-sdk/client-s3": "3.591.0", + "@aws-sdk/client-sqs": "3.682.0", "@aws-sdk/client-sts": "3.590.0", "@aws-sdk/credential-providers": "3.590.0", "@aws-sdk/util-endpoints": "3.587.0", "@dbbs/next-cache-handler-core": "1.2.0", - "@dbbs/next-cache-handler-s3": "1.1.4", + "@dbbs/next-cache-handler-s3": "1.2.0", "aws-cdk-lib": "2.144.0", "aws-sdk": "2.1635.0", "cdk-assets": "2.144.0", diff --git a/src/build/cache/handlers/appRouterRevalidate.ts b/src/build/cache/handlers/appRouterRevalidate.ts new file mode 100644 index 0000000..27fec38 --- /dev/null +++ b/src/build/cache/handlers/appRouterRevalidate.ts @@ -0,0 +1,15 @@ +export default `import { NextResponse, NextRequest } from 'next/server' +import { revalidatePath } from 'next/cache' + +export const POST = async (req: NextRequest) => { + try { + const { path } = await req.json() + + revalidatePath(path) + + return NextResponse.json({ message: 'Revalidated' }, { status: 200 }) + } catch (err) { + return NextResponse.json({ error: (err as Error).message }, { status: 500 }) + } +} +` diff --git a/src/build/next.ts b/src/build/next.ts index 1f7a63e..9d86b96 100644 --- a/src/build/next.ts +++ b/src/build/next.ts @@ -1,13 +1,16 @@ import childProcess from 'node:child_process' -import fs from 'node:fs' +import fs from 'fs/promises' import path from 'node:path' import { type ProjectPackager, type ProjectSettings, loadFile } from '../common/project' import loadConfig from '../commands/helpers/loadConfig' +import appRouterRevalidate from './cache/handlers/appRouterRevalidate' interface BuildOptions { packager: ProjectPackager nextConfigPath: string s3BucketName: string + isAppDir: boolean + projectPath: string } interface BuildAppOptions { @@ -18,7 +21,7 @@ interface BuildAppOptions { export const OUTPUT_FOLDER = 'serverless-next' -const setNextOptions = async (nextConfigPath: string, s3BucketName: string) => { +const setNextOptions = async (nextConfigPath: string, s3BucketName: string): Promise<() => Promise> => { // set s3 bucket name for cache handler during build time process.env.STATIC_BUCKET_NAME = s3BucketName @@ -34,7 +37,7 @@ const setNextOptions = async (nextConfigPath: string, s3BucketName: string) => { cacheHandler: require.resolve(path.join('..', 'cacheHandler', 'index.js')) } - const currentContent = fs.readFileSync(nextConfigPath, 'utf-8') + const currentContent = await fs.readFile(nextConfigPath, 'utf-8') let updatedContent = `module.exports = ${JSON.stringify(updatedConfig, null, 4)};\n` @@ -43,45 +46,63 @@ const setNextOptions = async (nextConfigPath: string, s3BucketName: string) => { updatedContent = `export default ${JSON.stringify(updatedConfig, null, 4)};\n` } - fs.writeFileSync(nextConfigPath, updatedContent, 'utf-8') + await fs.writeFile(nextConfigPath, updatedContent, 'utf-8') // Function to revert back to original content of file - return () => { - fs.writeFileSync(nextConfigPath, currentContent, 'utf-8') + return async () => { + fs.writeFile(nextConfigPath, currentContent, 'utf-8') } } -export const buildNext = async (options: BuildOptions) => { - const { packager, nextConfigPath, s3BucketName } = options +const appendRevalidateApi = async (projectPath: string, isAppDir: boolean): Promise => { + const routeFolderPath = path.join(projectPath, isAppDir ? 'src/app' : 'src', 'api', 'revalidate') + const routePath = path.join(routeFolderPath, 'route.ts') + if ((await fs.stat(routeFolderPath)).isDirectory()) { + await fs.mkdir(routeFolderPath, { recursive: true }) + } + + fs.writeFile(routePath, appRouterRevalidate, 'utf-8') + + return routePath +} +export const buildNext = async (options: BuildOptions): Promise<() => Promise> => { + const { packager, nextConfigPath, s3BucketName, projectPath, isAppDir } = options + + const revalidateRoutePath = await appendRevalidateApi(projectPath, isAppDir) const clearNextConfig = await setNextOptions(nextConfigPath, s3BucketName) childProcess.execSync(packager.buildCommand, { stdio: 'inherit' }) - // Reverts changes to next project - return clearNextConfig + // Reverts changes to the next project + return async () => { + await Promise.all([clearNextConfig(), fs.rm(revalidateRoutePath)]) + } } -const copyAssets = (outputPath: string, appPath: string) => { +const copyAssets = async (outputPath: string, appPath: string) => { // Copying static assets (like js, css, images, .etc) - fs.cpSync(path.join(appPath, '.next', 'static'), path.join(outputPath, '_next', 'static'), { recursive: true }) - - fs.cpSync(path.join(appPath, '.next', 'standalone'), path.join(outputPath, 'server'), { - recursive: true - }) + await Promise.all([ + fs.cp(path.join(appPath, '.next', 'static'), path.join(outputPath, '_next', 'static'), { recursive: true }), + fs.cp(path.join(appPath, '.next', 'standalone'), path.join(outputPath, 'server'), { + recursive: true + }) + ]) } export const buildApp = async (options: BuildAppOptions) => { const { projectSettings, outputPath, s3BucketName } = options - const { packager, nextConfigPath, projectPath } = projectSettings + const { packager, nextConfigPath, projectPath, isAppDir } = projectSettings const cleanNextApp = await buildNext({ packager, nextConfigPath, - s3BucketName + s3BucketName, + isAppDir, + projectPath }) - copyAssets(outputPath, projectPath) + await copyAssets(outputPath, projectPath) return cleanNextApp } diff --git a/src/cdk/constructs/CheckExpirationLambdaEdge.ts b/src/cdk/constructs/CheckExpirationLambdaEdge.ts index ac05807..4af49bc 100644 --- a/src/cdk/constructs/CheckExpirationLambdaEdge.ts +++ b/src/cdk/constructs/CheckExpirationLambdaEdge.ts @@ -1,4 +1,5 @@ import { Construct } from 'constructs' +import * as iam from 'aws-cdk-lib/aws-iam' import * as cdk from 'aws-cdk-lib' import * as lambda from 'aws-cdk-lib/aws-lambda' import * as cloudfront from 'aws-cdk-lib/aws-cloudfront' @@ -9,9 +10,11 @@ import { CacheConfig } from '../../types' interface CheckExpirationLambdaEdgeProps extends cdk.StackProps { renderWorkerQueueUrl: string + renderWorkerQueueArn: string buildOutputPath: string nodejs?: string cacheConfig: CacheConfig + region: string } const NodeJSEnvironmentMapping: Record = { @@ -23,7 +26,7 @@ export class CheckExpirationLambdaEdge extends Construct { public readonly lambdaEdge: cloudfront.experimental.EdgeFunction constructor(scope: Construct, id: string, props: CheckExpirationLambdaEdgeProps) { - const { nodejs, buildOutputPath, cacheConfig, renderWorkerQueueUrl } = props + const { nodejs, buildOutputPath, cacheConfig, renderWorkerQueueUrl, renderWorkerQueueArn, region } = props super(scope, id) const nodeJSEnvironment = NodeJSEnvironmentMapping[nodejs ?? ''] ?? NodeJSEnvironmentMapping['20'] @@ -32,7 +35,8 @@ export class CheckExpirationLambdaEdge extends Construct { buildLambda(name, buildOutputPath, { define: { 'process.env.RENDER_QUEUE_URL': JSON.stringify(renderWorkerQueueUrl), - 'process.env.CACHE_CONFIG': JSON.stringify(cacheConfig) + 'process.env.CACHE_CONFIG': JSON.stringify(cacheConfig), + 'process.env.QUEUE_REGION': JSON.stringify(region) } }) @@ -49,6 +53,13 @@ export class CheckExpirationLambdaEdge extends Construct { logGroup }) + this.lambdaEdge.addToRolePolicy( + new iam.PolicyStatement({ + actions: ['sqs:SendMessage'], + resources: [renderWorkerQueueArn] + }) + ) + logGroup.grantWrite(this.lambdaEdge) } } diff --git a/src/cdk/constructs/RenderServerDistribution.ts b/src/cdk/constructs/RenderServerDistribution.ts index 81fc1c7..b999287 100644 --- a/src/cdk/constructs/RenderServerDistribution.ts +++ b/src/cdk/constructs/RenderServerDistribution.ts @@ -82,8 +82,8 @@ export class RenderServerDistribution extends Construct { this.ebInstanceProfileRole.addToPolicy( new iam.PolicyStatement({ - actions: ['s3:Get*', 's3:Put*'], - resources: [`${staticS3Bucket.bucketArn}/*`] + actions: ['s3:Get*', 's3:Put*', 's3:ListBucket'], + resources: [staticS3Bucket.bucketArn, `${staticS3Bucket.bucketArn}/*`] }) ) diff --git a/src/cdk/constructs/RenderWorkerDistribution.ts b/src/cdk/constructs/RenderWorkerDistribution.ts index d80d19d..e452d0f 100644 --- a/src/cdk/constructs/RenderWorkerDistribution.ts +++ b/src/cdk/constructs/RenderWorkerDistribution.ts @@ -95,7 +95,8 @@ export class RenderWorkerDistribution extends Construct { this.deadLetterQueue = new sqs.Queue(this, 'DeadLetterQueue', { queueName: `${appName}-dead-letter-queue`, retentionPeriod: Duration.days(14), - removalPolicy: isProduction ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY + removalPolicy: isProduction ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY, + fifo: true }) /** @@ -108,7 +109,8 @@ export class RenderWorkerDistribution extends Construct { queue: this.deadLetterQueue, maxReceiveCount: 3 }, - removalPolicy: isProduction ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY + removalPolicy: isProduction ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY, + fifo: true }) /** @@ -155,8 +157,8 @@ export class RenderWorkerDistribution extends Construct { */ instanceRole.addToPolicy( new iam.PolicyStatement({ - actions: ['s3:Get*', 's3:Put*'], - resources: [`${staticS3Bucket.bucketArn}/*`] + actions: ['s3:Get*', 's3:Put*', 's3:ListBucket'], + resources: [staticS3Bucket.bucketArn, `${staticS3Bucket.bucketArn}/*`] }) ) @@ -319,6 +321,7 @@ export class RenderWorkerDistribution extends Construct { }) addOutput(this, `${appName}-RenderWorkerQueueUrl`, this.workerQueue.queueUrl) + addOutput(this, `${appName}-RenderWorkerQueueArn`, this.workerQueue.queueArn) addOutput(this, `${appName}-RenderWorkerApplicationName`, this.application.applicationName!) addOutput(this, `${appName}-RenderWorkerEnvironmentName`, this.environment.environmentName!) addOutput(this, `${appName}-RenderWorkerVersionsBucketName`, this.versionsBucket.bucketName) diff --git a/src/cdk/stacks/NextCloudfrontStack.ts b/src/cdk/stacks/NextCloudfrontStack.ts index 67a3dfe..a16c687 100644 --- a/src/cdk/stacks/NextCloudfrontStack.ts +++ b/src/cdk/stacks/NextCloudfrontStack.ts @@ -8,10 +8,11 @@ import { CheckExpirationLambdaEdge } from '../constructs/CheckExpirationLambdaEd export interface NextCloudfrontStackProps extends StackProps { nodejs?: string - region?: string + region: string staticBucketName: string renderServerDomain: string renderWorkerQueueUrl: string + renderWorkerQueueArn: string buildOutputPath: string cacheConfig: CacheConfig imageTTL?: number @@ -30,6 +31,7 @@ export class NextCloudfrontStack extends Stack { staticBucketName, renderServerDomain, renderWorkerQueueUrl, + renderWorkerQueueArn, region, cacheConfig, imageTTL @@ -48,7 +50,9 @@ export class NextCloudfrontStack extends Stack { nodejs, renderWorkerQueueUrl, buildOutputPath, - cacheConfig + cacheConfig, + renderWorkerQueueArn, + region }) const staticBucket = s3.Bucket.fromBucketAttributes(this, `${id}-StaticAssetsBucket`, { diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index 23d959f..de4113e 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -142,6 +142,7 @@ export const deploy = async (config: DeployConfig) => { staticBucketName: nextRenderServerStackOutput.StaticBucketName, renderServerDomain: nextRenderServerStackOutput.RenderServerDomain, renderWorkerQueueUrl: nextRenderServerStackOutput.RenderWorkerQueueUrl, + renderWorkerQueueArn: nextRenderServerStackOutput.RenderWorkerQueueArn, buildOutputPath: outputPath, crossRegionReferences: true, region, @@ -242,6 +243,6 @@ export const deploy = async (config: DeployConfig) => { console.error('Failed to deploy:', err) } finally { cleanOutputFolder() - cleanNextApp?.() + await cleanNextApp?.() } } diff --git a/src/common/project.ts b/src/common/project.ts index 744db5c..e000a90 100644 --- a/src/common/project.ts +++ b/src/common/project.ts @@ -13,6 +13,7 @@ export interface ProjectSettings { isMonorepo: boolean projectPath: string nextConfigPath: string + isAppDir: boolean } export const findPackager = (appPath: string): ProjectPackager | undefined => { @@ -29,6 +30,10 @@ export const findNextConfig = (appPath: string): string | undefined => { return ['next.config.js', 'next.config.mjs'].find((config) => fs.existsSync(path.join(appPath, config))) } +const checkIsAppDir = (appPath: string): boolean => { + return fs.existsSync(path.join(appPath, 'src', 'app')) +} + export const getProjectSettings = (projectPath: string): ProjectSettings | undefined => { let currentPath = projectPath const nextConfig = findNextConfig(projectPath) @@ -46,7 +51,8 @@ export const getProjectSettings = (projectPath: string): ProjectSettings | undef packager, isMonorepo: currentPath !== projectPath, projectPath, - nextConfigPath: path.join(projectPath, nextConfig) + nextConfigPath: path.join(projectPath, nextConfig), + isAppDir: checkIsAppDir(projectPath) } } diff --git a/src/lambdas/checkExpiration.ts b/src/lambdas/checkExpiration.ts index ee3bb9b..3e51b75 100644 --- a/src/lambdas/checkExpiration.ts +++ b/src/lambdas/checkExpiration.ts @@ -1,36 +1,98 @@ -import type { CloudFrontRequestCallback, Context, CloudFrontResponseEvent } from 'aws-lambda' +import type { CloudFrontRequestCallback, Context, CloudFrontResponseEvent, CloudFrontHeaders } from 'aws-lambda' +import { SQSClient, SendMessageCommand } from '@aws-sdk/client-sqs' -function checkFileIsExpired(date: string): boolean { - if (date) { - return new Date(date).getTime() < new Date().getTime() +const sqs = new SQSClient({ region: process.env.QUEUE_REGION! }) + +/** + * Checks if a file is expired based on HTTP headers + * @param headers - Object containing HTTP headers + * @param headers.expires - Expires header value + * @param headers['cache-control'] - Cache-Control header value + * @param headers['last-modified'] - Last-Modified header value + * @returns boolean indicating if the file is expired + */ +function checkFileIsExpired(headers: CloudFrontHeaders): boolean { + const expiresHeader = headers['expires'] ? headers['expires'][0].value : null + const cacheControlHeader = headers['cache-control'] ? headers['cache-control'][0].value : null + const lastModifiedHeader = headers['last-modified'] ? headers['last-modified'][0].value : null + const now = Date.now() + + // Check Expires header + if (expiresHeader && new Date(expiresHeader).getTime() <= now) { + return true + } + + // Check Cache-Control: max-age + if (cacheControlHeader && lastModifiedHeader) { + const maxAgeMatch = cacheControlHeader.match(/max-age=(\d+)/) + if (maxAgeMatch) { + const maxAgeSeconds = parseInt(maxAgeMatch[1], 10) + const responseDate = new Date(lastModifiedHeader).getTime() + const expiryTime = responseDate + maxAgeSeconds * 1000 + + return expiryTime <= now + } } return false } +/** + * Extracts the page router path from an S3 URI by removing the cache hash + * @param {string} s3Uri - The S3 URI containing the full path (e.g., '/blog/post/abc123') + * @returns {string} The cleaned router path without cache hash. Special case: returns '/' for '/index' + * + * @description + * This function processes S3 URIs by: + * 1. Splitting the path into segments + * 2. Removing the last segment (cache hash) + * 3. Building actual NextJS page path + */ +function getPageRouterPath(s3Uri: string) { + const path = s3Uri.split('/').slice(0, -1).join('/') + return path === '/index' ? '/' : path +} + +/** + * Lambda handler for checking file expiration in CloudFront responses + * @param event - CloudFront response event + * @param _context - Lambda context + * @param callback - CloudFront request callback + * @returns Promise + * + * @throws Will throw an error if SQS message sending fails + */ export const handler = async ( event: CloudFrontResponseEvent, _context: Context, callback: CloudFrontRequestCallback ): Promise => { const response = event.Records[0].cf.response + const request = event.Records[0].cf.request const headers = response.headers - const expiresSrc = 'Expires' - const cacheControlSrc = 'Cache-Control' - try { - // Check if file is expired - if (headers[expiresSrc.toLowerCase()] && checkFileIsExpired(headers[expiresSrc.toLowerCase()][0].value)) { - headers[cacheControlSrc.toLowerCase()] = [{ key: cacheControlSrc, value: 'no-cache' }] + // Check if file is expired using Expires or Cache-Control headers + if (checkFileIsExpired(headers)) { + headers['cache-control'] = [{ key: 'Cache-Control', value: 'no-cache' }] + + // Send message to SQS for page revalidation. + await sqs.send( + new SendMessageCommand({ + QueueUrl: process.env.RENDER_QUEUE_URL!, + MessageBody: JSON.stringify({ + path: `${getPageRouterPath(request.uri)}${request.querystring ? `?${request.querystring}` : ''}` + }) + }) + ) } + callback(null, response) - } catch (_e) { - const error = _e as Error + } catch (error) { callback(null, { status: '500', statusDescription: 'Internal Server Error', - body: `Error: ${error.message}` + body: `Error: ${(error as Error).message}` }) } } diff --git a/src/lambdas/edgeRouting.ts b/src/lambdas/edgeRouting.ts index 8fb2621..3ea8287 100644 --- a/src/lambdas/edgeRouting.ts +++ b/src/lambdas/edgeRouting.ts @@ -1,79 +1,18 @@ import { S3Client, HeadObjectCommand } from '@aws-sdk/client-s3' import type { CloudFrontRequestEvent, CloudFrontRequestCallback, CloudFrontRequest, Context } from 'aws-lambda' -import http, { type RequestOptions } from 'http' import crypto from 'node:crypto' import { CacheConfig } from '../types' -import { HEADER_DEVICE_TYPE } from '../constants' +import { + makeHTTPRequest, + convertCloudFrontHeaders, + transformQueryToObject, + transformCookiesToObject, + getCurrentDeviceType, + getFileExtensionTypeFromRequest +} from './utils/request' const s3 = new S3Client({ region: process.env.S3_BUCKET_REGION! }) -async function makeHTTPRequest(options: RequestOptions): Promise<{ - body: string - statusCode?: number - statusMessage?: string -}> { - return new Promise((resolve, reject) => { - const req = http.request(options, (res) => { - let data = '' - - res.on('data', (chunk) => { - data += chunk - }) - - res.on('end', () => { - resolve({ - body: data, - statusCode: res.statusCode, - statusMessage: res.statusMessage - }) - }) - }) - - req.on('error', (e) => { - reject(e) - }) - - req.end() - }) -} - -function convertCloudFrontHeaders( - cloudfrontHeaders: CloudFrontRequest['headers'] | undefined, - allowHeaders?: string[] -): RequestOptions['headers'] { - if (!cloudfrontHeaders) return {} - - return Object.keys(cloudfrontHeaders).reduce( - (prev, key) => - !allowHeaders?.length || allowHeaders.includes(key) - ? { - ...prev, - [key]: cloudfrontHeaders[key][0].value - } - : prev, - {} - ) -} - -function transformQueryToObject(query: string) { - return query ? Object.fromEntries(new URLSearchParams(query).entries()) : {} -} - -function transformCookiesToObject(cookies: Array<{ key?: string | undefined; value: string }>) { - if (!cookies?.length) return {} - - return cookies.reduce( - (res, { value }) => { - value.split(';').forEach((cookie) => { - const [key, val] = cookie.split('=').map((part) => part.trim()) - res[key] = val - }) - return res - }, - {} as Record - ) -} - function buildCacheKey(keys: string[], data: Record, prefix: string) { if (!keys.length) return null @@ -82,38 +21,6 @@ function buildCacheKey(keys: string[], data: Record, return !cacheKeys.length ? null : `${prefix}(${cacheKeys.join('-')})` } -function getCurrentDeviceType(headers: CloudFrontRequest['headers'] | undefined) { - const deviceHeaders = convertCloudFrontHeaders(headers, Object.values(HEADER_DEVICE_TYPE)) - if (!deviceHeaders || !Object.keys(deviceHeaders).length) return null - - if (deviceHeaders[HEADER_DEVICE_TYPE.Desktop] === 'true') { - return null - } else if (deviceHeaders[HEADER_DEVICE_TYPE.Mobile] === 'true') { - return 'mobile' - } else if (deviceHeaders[HEADER_DEVICE_TYPE.Tablet] === 'true') { - return 'tablet' - } else if (deviceHeaders[HEADER_DEVICE_TYPE.SmartTV] === 'true') { - return 'smarttv' - } - - return null -} - -function getFileExtensionTypeFromRequest(request: CloudFrontRequest) { - const contentType = request.headers['content-type']?.[0]?.value ?? '' - const isRSC = request.querystring.includes('_rsc') - - if (isRSC) { - return 'rsc' - } - - if (contentType.includes('json') || request.uri.endsWith('.json')) { - return 'json' - } - - return 'html' -} - function getPageKeyFromRequest(request: CloudFrontRequest) { const key = request.uri.replace('/', '') @@ -136,7 +43,7 @@ function getS3ObjectPath(request: CloudFrontRequest, cacheConfig: CacheConfig) { const fileExtension = getFileExtensionTypeFromRequest(request) const cacheKey = [ - cacheConfig.enableDeviceSplit ? getCurrentDeviceType(request.headers) : null, + cacheConfig.enableDeviceSplit ? getCurrentDeviceType(request.headers) : undefined, buildCacheKey( cacheConfig.cacheCookies?.toSorted() ?? [], transformCookiesToObject(request.headers.cookie), @@ -182,6 +89,7 @@ export const handler = async ( const { s3Key } = getS3ObjectPath(request, cacheConfig) const ebAppUrl = process.env.EB_APP_URL! const originalUri = request.uri + const queryParams = request.querystring ? `?${request.querystring}` : '' try { // Check if file exists in S3 @@ -189,14 +97,14 @@ export const handler = async ( if (isFileExists) { // Modify s3 path request - request.uri = `/${s3Key}` + request.uri = `/${s3Key}${queryParams}` // If file exists, allow the request to proceed to S3 callback(null, request) } else { - const options: http.RequestOptions = { + const options = { hostname: ebAppUrl, - path: `${originalUri}${request.querystring ? `?${request.querystring}` : ''}`, + path: `${originalUri}${queryParams}`, method: request.method, headers: convertCloudFrontHeaders(request.headers) } diff --git a/src/lambdas/utils/request.ts b/src/lambdas/utils/request.ts new file mode 100644 index 0000000..4b384c0 --- /dev/null +++ b/src/lambdas/utils/request.ts @@ -0,0 +1,137 @@ +import http, { type RequestOptions } from 'http' +import type { CloudFrontRequest } from 'aws-lambda' +import { HEADER_DEVICE_TYPE } from '../../constants' + +/** + * Makes an HTTP request with the given options and returns a promise with the response + * @param {RequestOptions & { body?: string }} options - HTTP request options including optional body + * @returns {Promise<{body: string, statusCode?: number, statusMessage?: string}>} Response object containing body, status code and message + */ +export async function makeHTTPRequest(options: RequestOptions & { body?: string }): Promise<{ + body: string + statusCode?: number + statusMessage?: string +}> { + return new Promise((resolve, reject) => { + const req = http.request(options, (res) => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }) + + res.on('end', () => { + resolve({ + body: data, + statusCode: res.statusCode, + statusMessage: res.statusMessage + }) + }) + }) + + if (options.body) { + req.write(options.body) + } + + req.on('error', (e) => { + reject(e) + }) + + req.end() + }) +} + +/** + * Converts CloudFront headers to standard HTTP request headers + * @param {CloudFrontRequest['headers'] | undefined} cloudfrontHeaders - Headers from CloudFront request + * @param {string[]} [allowHeaders] - Optional array of allowed header keys to filter + * @returns {RequestOptions['headers']} Converted headers object + */ +export function convertCloudFrontHeaders( + cloudfrontHeaders: CloudFrontRequest['headers'] | undefined, + allowHeaders?: string[] +): RequestOptions['headers'] { + if (!cloudfrontHeaders) return {} + + return Object.keys(cloudfrontHeaders).reduce( + (prev, key) => + !allowHeaders?.length || allowHeaders.includes(key) + ? { + ...prev, + [key]: cloudfrontHeaders[key][0].value + } + : prev, + {} + ) +} + +/** + * Transforms a query string into an object + * @param {string} query - URL query string + * @returns {Record} Object containing query parameters + */ +export function transformQueryToObject(query: string) { + return query ? Object.fromEntries(new URLSearchParams(query).entries()) : {} +} + +/** + * Transforms an array of cookies into a single cookie object + * @param {Array<{ key?: string | undefined; value: string }>} cookies - Array of cookie objects + * @returns {Record} Object containing cookie key-value pairs + */ +export function transformCookiesToObject(cookies: Array<{ key?: string | undefined; value: string }>) { + if (!cookies?.length) return {} + + return cookies.reduce( + (res, { value }) => { + value.split(';').forEach((cookie) => { + const [key, val] = cookie.split('=').map((part) => part.trim()) + res[key] = val + }) + return res + }, + {} as Record + ) +} + +/** + * Determines the current device type based on CloudFront request headers + * @param {CloudFrontRequest['headers'] | undefined} headers - CloudFront request headers + * @returns {'mobile' | 'tablet' | 'smarttv' | null} Device type or null if not determined + */ +export function getCurrentDeviceType(headers: CloudFrontRequest['headers'] | undefined) { + const deviceHeaders = convertCloudFrontHeaders(headers, Object.values(HEADER_DEVICE_TYPE)) + if (!deviceHeaders || !Object.keys(deviceHeaders).length) return + + if (deviceHeaders[HEADER_DEVICE_TYPE.Desktop] === 'true') { + return + } else if (deviceHeaders[HEADER_DEVICE_TYPE.Mobile] === 'true') { + return 'mobile' + } else if (deviceHeaders[HEADER_DEVICE_TYPE.Tablet] === 'true') { + return 'tablet' + } else if (deviceHeaders[HEADER_DEVICE_TYPE.SmartTV] === 'true') { + return 'smarttv' + } + + return +} + +/** + * Determines the file extension type from a CloudFront request + * @param {CloudFrontRequest} request - CloudFront request object + * @returns {'rsc' | 'json' | 'html'} File extension type + */ +export function getFileExtensionTypeFromRequest(request: CloudFrontRequest) { + const contentType = request.headers['content-type']?.[0]?.value ?? '' + const isRSC = request.querystring.includes('_rsc') + + if (isRSC) { + return 'rsc' + } + + if (contentType.includes('json') || request.uri.endsWith('.json')) { + return 'json' + } + + return 'html' +}