diff --git a/.changeset/stale-wombats-cover.md b/.changeset/stale-wombats-cover.md new file mode 100644 index 0000000000..bd6172cb1b --- /dev/null +++ b/.changeset/stale-wombats-cover.md @@ -0,0 +1,5 @@ +--- +"active-campaign-client": minor +--- + +Refactor active campaign pacakge and create index file diff --git a/package-lock.json b/package-lock.json index 5ed9e06ff0..3b410b8de4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1790,6 +1790,1155 @@ "node": ">=14.0.0" } }, + "node_modules/@aws-sdk/client-cognito-identity-provider": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity-provider/-/client-cognito-identity-provider-3.696.0.tgz", + "integrity": "sha512-hC31OhTlchMkIVExJTLtisay9BgWkHkV1qW/OZhaLiUeiM3FlDi+80ZGaiSg1hoFgOUR5SQL1kEf177/6PWJgg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.696.0", + "@aws-sdk/client-sts": "3.696.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@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.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/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-cognito-identity-provider/node_modules/@aws-crypto/sha256-browser/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-cognito-identity-provider/node_modules/@aws-crypto/sha256-browser/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-cognito-identity-provider/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-cognito-identity-provider/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-cognito-identity-provider/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-cognito-identity-provider/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-cognito-identity-provider/node_modules/@aws-crypto/util/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-cognito-identity-provider/node_modules/@aws-crypto/util/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-cognito-identity-provider/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-cognito-identity-provider/node_modules/@aws-sdk/client-sso": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.696.0.tgz", + "integrity": "sha512-q5TTkd08JS0DOkHfUL853tuArf7NrPeqoS5UOvqJho8ibV9Ak/a/HO4kNvy9Nj3cib/toHYHsQIEtecUPSUUrQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@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.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.696.0.tgz", + "integrity": "sha512-ikxQ3mo86d1mAq5zTaQAh8rLBERwL+I4MUYu/IVYW2hhl9J2SDsl0SgnKeXQG6S8zWuHcBO587zsZaRta1MQ/g==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@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.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.696.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/client-sts": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.696.0.tgz", + "integrity": "sha512-eJOxR8/UyI7kGSRyE751Ea7MKEzllQs7eNveDJy9OP4t/jsN/P19HJ1YHeA1np40JRTUBfqa6WLAAiIXsk8rkg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.696.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-node": "3.696.0", + "@aws-sdk/middleware-host-header": "3.696.0", + "@aws-sdk/middleware-logger": "3.696.0", + "@aws-sdk/middleware-recursion-detection": "3.696.0", + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/region-config-resolver": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@aws-sdk/util-user-agent-browser": "3.696.0", + "@aws-sdk/util-user-agent-node": "3.696.0", + "@smithy/config-resolver": "^3.0.12", + "@smithy/core": "^2.5.3", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/hash-node": "^3.0.10", + "@smithy/invalid-dependency": "^3.0.10", + "@smithy/middleware-content-length": "^3.0.12", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-retry": "^3.0.27", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@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.27", + "@smithy/util-defaults-mode-node": "^3.0.27", + "@smithy/util-endpoints": "^2.1.6", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/core": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.696.0.tgz", + "integrity": "sha512-3c9III1k03DgvRZWg8vhVmfIXPG6hAciN9MzQTzqGngzWAELZF/WONRTRQuDFixVtarQatmLHYVw/atGeA2Byw==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/core": "^2.5.3", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.7", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/util-middleware": "^3.0.10", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.696.0.tgz", + "integrity": "sha512-T9iMFnJL7YTlESLpVFT3fg1Lkb1lD+oiaIC8KMpepb01gDUBIpj9+Y+pA/cgRWW0yRxmkDXNazAE2qQTVFGJzA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.696.0.tgz", + "integrity": "sha512-GV6EbvPi2eq1+WgY/o2RFA3P7HGmnkIzCNmhwtALFlqMroLYWKE7PSeHw66Uh1dFQeVESn0/+hiUNhu1mB0emA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.7", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/util-stream": "^3.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.696.0.tgz", + "integrity": "sha512-9WsZZofjPjNAAZhIh7c7FOhLK8CR3RnGgUm1tdZzV6ZSM1BuS2m6rdwIilRxAh3fxxKDkmW/r/aYmmCYwA+AYA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/credential-provider-env": "3.696.0", + "@aws-sdk/credential-provider-http": "3.696.0", + "@aws-sdk/credential-provider-process": "3.696.0", + "@aws-sdk/credential-provider-sso": "3.696.0", + "@aws-sdk/credential-provider-web-identity": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.696.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.696.0.tgz", + "integrity": "sha512-8F6y5FcfRuMJouC5s207Ko1mcVvOXReBOlJmhIwE4QH1CnO/CliIyepnAZrRQ659mo5wIuquz6gXnpYbitEVMg==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.696.0", + "@aws-sdk/credential-provider-http": "3.696.0", + "@aws-sdk/credential-provider-ini": "3.696.0", + "@aws-sdk/credential-provider-process": "3.696.0", + "@aws-sdk/credential-provider-sso": "3.696.0", + "@aws-sdk/credential-provider-web-identity": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.696.0.tgz", + "integrity": "sha512-mL1RcFDe9sfmyU5K1nuFkO8UiJXXxLX4JO1gVaDIOvPqwStpUAwi3A1BoeZhWZZNQsiKI810RnYGo0E0WB/hUA==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.696.0.tgz", + "integrity": "sha512-4SSZ9Nk08JSu4/rX1a+dEac/Ims1HCXfV7YLUe5LGdtRLSKRoQQUy+hkFaGYoSugP/p1UfUPl3BuTO9Vv8z1pA==", + "dependencies": { + "@aws-sdk/client-sso": "3.696.0", + "@aws-sdk/core": "3.696.0", + "@aws-sdk/token-providers": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.696.0.tgz", + "integrity": "sha512-XJ/CVlWChM0VCoc259vWguFUjJDn/QwDqHwbx+K9cg3v6yrqXfK5ai+p/6lx0nQpnk4JzPVeYYxWRpaTsGC9rg==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.696.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.696.0.tgz", + "integrity": "sha512-zELJp9Ta2zkX7ELggMN9qMCgekqZhFC5V2rOr4hJDEb/Tte7gpfKSObAnw/3AYiVqt36sjHKfdkoTsuwGdEoDg==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/middleware-logger": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.696.0.tgz", + "integrity": "sha512-KhkHt+8AjCxcR/5Zp3++YPJPpFQzxpr+jmONiT/Jw2yqnSngZ0Yspm5wGoRx2hS1HJbyZNuaOWEGuJoxLeBKfA==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.696.0.tgz", + "integrity": "sha512-si/maV3Z0hH7qa99f9ru2xpS5HlfSVcasRlNUXKSDm611i7jFMWwGNLUOXFAOLhXotPX5G3Z6BLwL34oDeBMug==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.696.0.tgz", + "integrity": "sha512-Lvyj8CTyxrHI6GHd2YVZKIRI5Fmnugt3cpJo0VrKKEgK5zMySwEZ1n4dqPK6czYRWKd5+WnYHYAuU+Wdk6Jsjw==", + "dependencies": { + "@aws-sdk/core": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@aws-sdk/util-endpoints": "3.696.0", + "@smithy/core": "^2.5.3", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.696.0.tgz", + "integrity": "sha512-7EuH142lBXjI8yH6dVS/CZeiK/WZsmb/8zP6bQbVYpMrppSTgB3MzZZdxVZGzL5r8zPQOU10wLC4kIMy0qdBVQ==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/token-providers": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.696.0.tgz", + "integrity": "sha512-fvTcMADrkwRdNwVmJXi2pSPf1iizmUqczrR1KusH4XehI/KybS4U6ViskRT0v07vpxwL7x+iaD/8fR0PUu5L/g==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.696.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/types": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.696.0.tgz", + "integrity": "sha512-9rTvUJIAj5d3//U5FDPWGJ1nFJLuWb30vugGOrWk7aNZ6y9tuA3PI7Cc9dP8WEXKVyK1vuuk8rSFP2iqXnlgrw==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/util-endpoints": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.696.0.tgz", + "integrity": "sha512-T5s0IlBVX+gkb9g/I6CLt4yAZVzMSiGnbUqWihWsHvQR1WOoIcndQy/Oz/IJXT9T2ipoy7a80gzV6a5mglrioA==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "@smithy/util-endpoints": "^2.1.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.696.0.tgz", + "integrity": "sha512-Z5rVNDdmPOe6ELoM5AhF/ja5tSjbe6ctSctDPb0JdDf4dT0v2MfwhJKzXju2RzX8Es/77Glh7MlaXLE0kCB9+Q==", + "dependencies": { + "@aws-sdk/types": "3.696.0", + "@smithy/types": "^3.7.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.696.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.696.0.tgz", + "integrity": "sha512-KhKqcfyXIB0SCCt+qsu4eJjsfiOrNzK5dCV7RAW2YIpp+msxGUUX0NdRE9rkzjiv+3EMktgJm3eEIS+yxtlVdQ==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.696.0", + "@aws-sdk/types": "3.696.0", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "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-cognito-identity-provider/node_modules/@smithy/abort-controller": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.8.tgz", + "integrity": "sha512-+3DOBcUn5/rVjlxGvUPKc416SExarAQ+Qe0bqk30YSUjbepwpS7QN0cyKUSifvLJhdMZ0WPzPP5ymut0oonrpQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/config-resolver": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.12.tgz", + "integrity": "sha512-YAJP9UJFZRZ8N+UruTeq78zkdjUHmzsY62J4qKWZ4SXB4QXJ/+680EfXXgkYA2xj77ooMqtUY9m406zGNqwivQ==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/core": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.5.3.tgz", + "integrity": "sha512-96uW8maifUSmehaeW7uydWn7wBc98NEeNI3zN8vqakGpyCQgzyJaA64Z4FCOUmAdCJkhppd/7SZ798Fo4Xx37g==", + "dependencies": { + "@smithy/middleware-serde": "^3.0.10", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-stream": "^3.3.1", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/credential-provider-imds": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.7.tgz", + "integrity": "sha512-cEfbau+rrWF8ylkmmVAObOmjbTIzKyUC5TkBL58SbLywD0RCBC4JAUKbmtSm2w5KUJNRPGgpGFMvE2FKnuNlWQ==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.10", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/fetch-http-handler": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-4.1.1.tgz", + "integrity": "sha512-bH7QW0+JdX0bPBadXt8GwMof/jz0H28I84hU1Uet9ISpzUqXqRQ3fEZJ+ANPOhzSEczYvANNl3uDQDYArSFDtA==", + "dependencies": { + "@smithy/protocol-http": "^4.1.7", + "@smithy/querystring-builder": "^3.0.10", + "@smithy/types": "^3.7.1", + "@smithy/util-base64": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/hash-node": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.10.tgz", + "integrity": "sha512-3zWGWCHI+FlJ5WJwx73Mw2llYR8aflVyZN5JhoqLxbdPZi6UyKSdCeXAWJw9ja22m6S6Tzz1KZ+kAaSwvydi0g==", + "dependencies": { + "@smithy/types": "^3.7.1", + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/invalid-dependency": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.10.tgz", + "integrity": "sha512-Lp2L65vFi+cj0vFMu2obpPW69DU+6O5g3086lmI4XcnRCG8PxvpWC7XyaVwJCxsZFzueHjXnrOH/E0pl0zikfA==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", + "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/middleware-content-length": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.12.tgz", + "integrity": "sha512-1mDEXqzM20yywaMDuf5o9ue8OkJ373lSPbaSjyEvkWdqELhFMyNNgKGWL/rCSf4KME8B+HlHKuR8u9kRj8HzEQ==", + "dependencies": { + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/middleware-endpoint": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.2.3.tgz", + "integrity": "sha512-Hdl9296i/EMptaX7agrSzJZDiz5Y8XPUeBbctTmMtnCguGpqfU3jVsTUan0VLaOhsnquqWLL8Bl5HrlbVGT1og==", + "dependencies": { + "@smithy/core": "^2.5.3", + "@smithy/middleware-serde": "^3.0.10", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/shared-ini-file-loader": "^3.1.11", + "@smithy/types": "^3.7.1", + "@smithy/url-parser": "^3.0.10", + "@smithy/util-middleware": "^3.0.10", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/middleware-retry": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.27.tgz", + "integrity": "sha512-H3J/PjJpLL7Tt+fxDKiOD25sMc94YetlQhCnYeNmina2LZscAdu0ZEZPas/kwePHABaEtqp7hqa5S4UJgMs1Tg==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/protocol-http": "^4.1.7", + "@smithy/service-error-classification": "^3.0.10", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "@smithy/util-middleware": "^3.0.10", + "@smithy/util-retry": "^3.0.10", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/middleware-serde": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.10.tgz", + "integrity": "sha512-MnAuhh+dD14F428ubSJuRnmRsfOpxSzvRhaGVTvd/lrUDE3kxzCCmH8lnVTvoNQnV2BbJ4c15QwZ3UdQBtFNZA==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/middleware-stack": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.10.tgz", + "integrity": "sha512-grCHyoiARDBBGPyw2BeicpjgpsDFWZZxptbVKb3CRd/ZA15F/T6rZjCCuBUjJwdck1nwUuIxYtsS4H9DDpbP5w==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/node-config-provider": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.11.tgz", + "integrity": "sha512-URq3gT3RpDikh/8MBJUB+QGZzfS7Bm6TQTqoh4CqE8NBuyPkWa5eUXj0XFcFfeZVgg3WMh1u19iaXn8FvvXxZw==", + "dependencies": { + "@smithy/property-provider": "^3.1.10", + "@smithy/shared-ini-file-loader": "^3.1.11", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/node-http-handler": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.3.1.tgz", + "integrity": "sha512-fr+UAOMGWh6bn4YSEezBCpJn9Ukp9oR4D32sCjCo7U81evE11YePOQ58ogzyfgmjIO79YeOdfXXqr0jyhPQeMg==", + "dependencies": { + "@smithy/abort-controller": "^3.1.8", + "@smithy/protocol-http": "^4.1.7", + "@smithy/querystring-builder": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/property-provider": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.10.tgz", + "integrity": "sha512-n1MJZGTorTH2DvyTVj+3wXnd4CzjJxyXeOgnTlgNVFxaaMeT4OteEp4QrzF8p9ee2yg42nvyVK6R/awLCakjeQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/protocol-http": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.7.tgz", + "integrity": "sha512-FP2LepWD0eJeOTm0SjssPcgqAlDFzOmRXqXmGhfIM52G7Lrox/pcpQf6RP4F21k0+O12zaqQt5fCDOeBtqY6Cg==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/querystring-builder": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.10.tgz", + "integrity": "sha512-nT9CQF3EIJtIUepXQuBFb8dxJi3WVZS3XfuDksxSCSn+/CzZowRLdhDn+2acbBv8R6eaJqPupoI/aRFIImNVPQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "@smithy/util-uri-escape": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/querystring-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.10.tgz", + "integrity": "sha512-Oa0XDcpo9SmjhiDD9ua2UyM3uU01ZTuIrNdZvzwUTykW1PM8o2yJvMh1Do1rY5sUQg4NDV70dMi0JhDx4GyxuQ==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/service-error-classification": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.10.tgz", + "integrity": "sha512-zHe642KCqDxXLuhs6xmHVgRwy078RfqxP2wRDpIyiF8EmsWXptMwnMwbVa50lw+WOGNrYm9zbaEg0oDe3PTtvQ==", + "dependencies": { + "@smithy/types": "^3.7.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/shared-ini-file-loader": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.11.tgz", + "integrity": "sha512-AUdrIZHFtUgmfSN4Gq9nHu3IkHMa1YDcN+s061Nfm+6pQ0mJy85YQDB0tZBCmls0Vuj22pLwDPmL92+Hvfwwlg==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/signature-v4": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.2.3.tgz", + "integrity": "sha512-pPSQQ2v2vu9vc8iew7sszLd0O09I5TRc5zhY71KA+Ao0xYazIG+uLeHbTJfIWGO3BGVLiXjUr3EEeCcEQLjpWQ==", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/util-middleware": "^3.0.10", + "@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-cognito-identity-provider/node_modules/@smithy/smithy-client": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.4.4.tgz", + "integrity": "sha512-dPGoJuSZqvirBq+yROapBcHHvFjChoAQT8YPWJ820aPHHiowBlB3RL1Q4kPT1hx0qKgJuf+HhyzKi5Gbof4fNA==", + "dependencies": { + "@smithy/core": "^2.5.3", + "@smithy/middleware-endpoint": "^3.2.3", + "@smithy/middleware-stack": "^3.0.10", + "@smithy/protocol-http": "^4.1.7", + "@smithy/types": "^3.7.1", + "@smithy/util-stream": "^3.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/types": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.7.1.tgz", + "integrity": "sha512-XKLcLXZY7sUQgvvWyeaL/qwNPp6V3dWcUjqrQKjSb+tzYiCy340R/c64LV5j+Tnb2GhmunEX0eou+L+m2hJNYA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/url-parser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.10.tgz", + "integrity": "sha512-j90NUalTSBR2NaZTuruEgavSdh8MLirf58LoGSk4AtQfyIymogIhgnGUU2Mga2bkMkpSoC9gxb74xBXL5afKAQ==", + "dependencies": { + "@smithy/querystring-parser": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-base64": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", + "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-body-length-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-3.0.0.tgz", + "integrity": "sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ==", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-body-length-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-3.0.0.tgz", + "integrity": "sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", + "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-config-provider": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-3.0.0.tgz", + "integrity": "sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-defaults-mode-browser": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.27.tgz", + "integrity": "sha512-GV8NvPy1vAGp7u5iD/xNKUxCorE4nQzlyl057qRac+KwpH5zq8wVq6rE3lPPeuFLyQXofPN6JwxL1N9ojGapiQ==", + "dependencies": { + "@smithy/property-provider": "^3.1.10", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-defaults-mode-node": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.27.tgz", + "integrity": "sha512-7+4wjWfZqZxZVJvDutO+i1GvL6bgOajEkop4FuR6wudFlqBiqwxw3HoH6M9NgeCd37km8ga8NPp2JacQEtAMPg==", + "dependencies": { + "@smithy/config-resolver": "^3.0.12", + "@smithy/credential-provider-imds": "^3.2.7", + "@smithy/node-config-provider": "^3.1.11", + "@smithy/property-provider": "^3.1.10", + "@smithy/smithy-client": "^3.4.4", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-endpoints": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.6.tgz", + "integrity": "sha512-mFV1t3ndBh0yZOJgWxO9J/4cHZVn5UG1D8DeCc6/echfNkeEJWu9LD7mgGH5fHrEdR7LDoWw7PQO6QiGpHXhgA==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.11", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-hex-encoding": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz", + "integrity": "sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-middleware": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.10.tgz", + "integrity": "sha512-eJO+/+RsrG2RpmY68jZdwQtnfsxjmPxzMlQpnHKjFPwrYqvlcT+fHdT+ZVwcjlWSrByOhGr9Ff2GG17efc192A==", + "dependencies": { + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-retry": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.10.tgz", + "integrity": "sha512-1l4qatFp4PiU6j7UsbasUHL2VU023NRB/gfaa1M0rDqVrRN4g3mCArLRyH3OuktApA4ye+yjWQHjdziunw2eWA==", + "dependencies": { + "@smithy/service-error-classification": "^3.0.10", + "@smithy/types": "^3.7.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-stream": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.3.1.tgz", + "integrity": "sha512-Ff68R5lJh2zj+AUTvbAU/4yx+6QPRzg7+pI7M1FbtQHcRIp7xvguxVsQBKyB3fwiOwhAKu0lnNyYBaQfSW6TNw==", + "dependencies": { + "@smithy/fetch-http-handler": "^4.1.1", + "@smithy/node-http-handler": "^3.3.1", + "@smithy/types": "^3.7.1", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-buffer-from": "^3.0.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/client-cognito-identity-provider/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", + "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", + "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity-provider/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/ie11-detection": { "version": "3.0.0", "license": "Apache-2.0", @@ -32774,7 +33923,9 @@ "version": "1.0.0" }, "node_modules/fast-xml-parser": { - "version": "4.3.2", + "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", @@ -32785,7 +33936,6 @@ "url": "https://paypal.me/naturalintelligence" } ], - "license": "MIT", "dependencies": { "strnum": "^1.0.5" }, @@ -51792,6 +52942,7 @@ "packages/active-campaign-client": { "version": "0.1.1", "dependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.696.0", "@types/aws-lambda": "^8.10.126", "@types/jest": "^29.5.1", "aws-lambda": "^1.0.7", diff --git a/packages/active-campaign-client/.env.example b/packages/active-campaign-client/.env.example index aabb8523e9..eca72b4959 100644 --- a/packages/active-campaign-client/.env.example +++ b/packages/active-campaign-client/.env.example @@ -1,3 +1,5 @@ AC_BASE_URL=your_account_url AC_API_KEY=your_api_key SENDER_URL=localhost:3000 +AWS_REGION="region" +AWS_USER_POOL_ID="region_DFWF81fRa" diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index ef972019b7..385348bc3f 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -4,13 +4,15 @@ "description": "Implements ActiveCampaign API to add, update and delete Accounts and to add and update lists", "scripts": { "lint": "eslint src", - "test": "jest" + "test": "jest", + "build": "tsc" }, "devDependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.696.0", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "^8.57.1", - "eslint": "^8.57.1", "dotenv": "16.4.5", + "eslint": "^8.57.1", "eslint-config-custom": "^0.1.0" }, "dependencies": { diff --git a/packages/active-campaign-client/src/__tests__/contact_flow.test.ts b/packages/active-campaign-client/src/__tests__/contact_flow.test.ts new file mode 100644 index 0000000000..b830db1d57 --- /dev/null +++ b/packages/active-campaign-client/src/__tests__/contact_flow.test.ts @@ -0,0 +1,43 @@ +import { addContact } from '../helpers/addContact'; +import { deleteContact } from '../helpers/deleteContact'; +import { updateContact } from '../helpers/updateContact'; +import { User } from '../types/user'; + +const user: User = { + username: '466e0280-9061-7007-c3e0-beb6be672f68', + email: `test@example${new Date().getTime()}e.com`, + given_name: 'Giovanni', + family_name: 'Doe', + 'custom:mailinglist_accepted': 'true', + 'custom:company_type': 'Test Co', + 'custom:job_role': 'Developer', +}; + +// remove .skip to run the test, be aware it does a real API call so it will create, update and delete a contact in the active campaign account +// NB: this test is not idempotent and it must run in this order +describe.skip('Active campaign integration contact flow', () => { + it('should create a contact successfully', async () => { + const response = await addContact(user); + expect(response.statusCode).toBe(200); + }); + + it('should update a contact successfully', async () => { + const updatedUser: User = { + ...user, + email: `test@example${new Date().getTime()}e.com`, + given_name: 'new given_name', + family_name: 'new family_name', + 'custom:mailinglist_accepted': 'true', + 'custom:company_type': 'new company_type', + 'custom:job_role': 'new job_role', + }; + + const response = await updateContact(updatedUser); + expect(response.statusCode).toBe(200); + }); + + it('should delete a contact successfully', async () => { + const response = await deleteContact(user.username); + expect(response.statusCode).toBe(200); + }); +}); diff --git a/packages/active-campaign-client/src/__tests__/empty-test.test.ts b/packages/active-campaign-client/src/__tests__/empty-test.test.ts deleted file mode 100644 index ec129970f5..0000000000 --- a/packages/active-campaign-client/src/__tests__/empty-test.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('nothing', () => { - it('should not fail tests without tests but it does', async () => { - expect(1).toBe(1); - }); -}); diff --git a/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts b/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts deleted file mode 100644 index f912c7cc39..0000000000 --- a/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { addContact } from '../../handlers/addContact'; -import { SQSEvent } from 'aws-lambda'; - -// remove .skip to run the test, be aware it does a real API call so it will create a contact in the active campaign account -describe.skip('addContact handler', () => { - it('should create a contact successfully', async () => { - const event: SQSEvent = { - Records: [ - { - messageId: '1', - receiptHandle: '1', - body: JSON.stringify({ - username: `test@example${new Date().getTime()}e.com`, - firstName: 'Giovanni', - cognitoId: '466e0280-9061-7007-c3e0-beb6be672f68', - lastName: 'Doe', - company: 'Test Co', - role: 'Developer', - mailinglistAccepted: true, - }), - attributes: { - ApproximateReceiveCount: '1', - SentTimestamp: '1', - SenderId: '1', - ApproximateFirstReceiveTimestamp: '1', - }, - messageAttributes: {}, - md5OfBody: '1', - eventSource: 'aws:sqs', - eventSourceARN: 'arn:aws:sqs:region:account-id:queue-name', - awsRegion: 'region', - }, - ], - }; - - const response = await addContact(event); - expect(response.statusCode).toBe(200); - }); -}); diff --git a/packages/active-campaign-client/src/__tests__/handlers/deleteContact.test.ts b/packages/active-campaign-client/src/__tests__/handlers/deleteContact.test.ts deleted file mode 100644 index f6b809496b..0000000000 --- a/packages/active-campaign-client/src/__tests__/handlers/deleteContact.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { deleteContact } from '../../handlers/deleteContact'; -import { SQSEvent } from 'aws-lambda'; - -// remove .skip to run the test, be aware it does a real API call so it will create a contact in the active campaign account -describe.skip('deleteContact handler', () => { - it('should delete a contact successfully', async () => { - const event: SQSEvent = { - Records: [ - { - messageId: '1', - receiptHandle: '1', - body: JSON.stringify({ - // Replace this with the existing email of the contact you want to delete, otherwise the test will fail - cognitoId: `466e0280-9061-7007-c3e0-beb6be672f68`, - }), - attributes: { - ApproximateReceiveCount: '1', - SentTimestamp: '1', - SenderId: '1', - ApproximateFirstReceiveTimestamp: '1', - }, - messageAttributes: {}, - md5OfBody: '1', - eventSource: 'aws:sqs', - eventSourceARN: 'arn:aws:sqs:region:account-id:queue-name', - awsRegion: 'region', - }, - ], - }; - - const response = await deleteContact(event); - expect(response.statusCode).toBe(200); - }); -}); diff --git a/packages/active-campaign-client/src/__tests__/handlers/updateContact.test.ts b/packages/active-campaign-client/src/__tests__/handlers/updateContact.test.ts deleted file mode 100644 index 521c774cf9..0000000000 --- a/packages/active-campaign-client/src/__tests__/handlers/updateContact.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { updateContact } from '../../handlers/updateContact'; -import { SQSEvent } from 'aws-lambda'; - -// remove .skip to run the test, be aware it does a real API call so it will create a contact in the active campaign account -describe.skip('updateContact handler', () => { - it('should update a contact successfully', async () => { - const event: SQSEvent = { - Records: [ - { - messageId: '1', - receiptHandle: '1', - body: JSON.stringify({ - username: `test@example1731961399739e.com`, - firstName: 'Alberto', - lastName: 'Doe', - company: 'Test Co', - role: 'Developer', - mailinglistAccepted: true, - cognitoId: '466e0280-9061-7007-c3e0-beb6be672f68', - }), - attributes: { - ApproximateReceiveCount: '1', - SentTimestamp: '1', - SenderId: '1', - ApproximateFirstReceiveTimestamp: '1', - }, - messageAttributes: {}, - md5OfBody: '1', - eventSource: 'aws:sqs', - eventSourceARN: 'arn:aws:sqs:region:account-id:queue-name', - awsRegion: 'region', - }, - ], - }; - - const response = await updateContact(event); - expect(response.statusCode).toBe(200); - }); -}); diff --git a/packages/active-campaign-client/src/__tests__/handlers/createList.test.ts b/packages/active-campaign-client/src/__tests__/helpers/createList.test.ts similarity index 95% rename from packages/active-campaign-client/src/__tests__/handlers/createList.test.ts rename to packages/active-campaign-client/src/__tests__/helpers/createList.test.ts index 1c8d722ace..c4d3e1b1b0 100644 --- a/packages/active-campaign-client/src/__tests__/handlers/createList.test.ts +++ b/packages/active-campaign-client/src/__tests__/helpers/createList.test.ts @@ -1,4 +1,4 @@ -import { createList } from '../../handlers/createList'; +import { createList } from '../../helpers/createList'; import { SQSEvent } from 'aws-lambda'; describe.skip('createList handler', () => { diff --git a/packages/active-campaign-client/src/__tests__/handlers/deleteList.test.ts b/packages/active-campaign-client/src/__tests__/helpers/deleteList.test.ts similarity index 93% rename from packages/active-campaign-client/src/__tests__/handlers/deleteList.test.ts rename to packages/active-campaign-client/src/__tests__/helpers/deleteList.test.ts index 90ffd8ce87..78e4a5f702 100644 --- a/packages/active-campaign-client/src/__tests__/handlers/deleteList.test.ts +++ b/packages/active-campaign-client/src/__tests__/helpers/deleteList.test.ts @@ -1,4 +1,4 @@ -import { deleteList } from '../../handlers/deleteList'; +import { deleteList } from '../../helpers/deleteList'; import { SQSEvent } from 'aws-lambda'; describe.skip('deleteList handler', () => { diff --git a/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts b/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts new file mode 100644 index 0000000000..a2ab058139 --- /dev/null +++ b/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts @@ -0,0 +1,82 @@ +import { ListUsersCommandOutput } from '@aws-sdk/client-cognito-identity-provider'; +import { listUsersCommandOutputToUser } from '../../helpers/listUsersCommandOutputToUser'; +import { User } from '../../types/user'; + +const listUsersCommandOutput: ListUsersCommandOutput = { + $metadata: { + httpStatusCode: 200, + requestId: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + attempts: 1, + totalRetryDelay: 0, + }, + Users: [ + { + Attributes: [ + { + Name: 'email', + Value: 'test@mail.com', + }, + { + Name: 'email_verified', + Value: 'true', + }, + { + Name: 'family_name', + Value: 'Doe', + }, + { + Name: 'given_name', + Value: 'Giovanni', + }, + { + Name: 'custom:mailinglist_accepted', + Value: 'true', + }, + { + Name: 'custom:user_preferences', + Value: + '{"subscribedWebinarSlugs":["comunicazioni-a-valore-legale","nuove-api-io","live","cooming-soon","test","always-live","PagoPA-multe"]}', + }, + { + Name: 'custom:company_type', + Value: 'gestore-di-pubblico-servizio', + }, + { + Name: 'custom:job_role', + Value: 'Developer', + }, + { + Name: 'custom:privacy_accepted', + Value: 'true', + }, + { + Name: 'sub', + Value: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + }, + ], + Enabled: true, + UserStatus: 'CONFIRMED', + Username: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + }, + ], +}; + +describe('addContact handler', () => { + it('should properly convert ListUsersCommandOutput to User', async () => { + const user = listUsersCommandOutputToUser(listUsersCommandOutput); + const expectedUser: User = { + username: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + email: 'test@mail.com', + given_name: 'Giovanni', + family_name: 'Doe', + 'custom:mailinglist_accepted': 'true', + 'custom:company_type': 'gestore-di-pubblico-servizio', + 'custom:job_role': 'Developer', + }; + expect(user).toBeDefined(); + Object.keys(expectedUser).forEach((value) => { + const key = value as keyof User; + expect(user![key]).toBe(expectedUser[key]); + }); + }); +}); diff --git a/packages/active-campaign-client/src/utils/activeCampaignClient.ts b/packages/active-campaign-client/src/clients/activeCampaignClient.ts similarity index 93% rename from packages/active-campaign-client/src/utils/activeCampaignClient.ts rename to packages/active-campaign-client/src/clients/activeCampaignClient.ts index 53cd3ccaa5..ed3beb1301 100644 --- a/packages/active-campaign-client/src/utils/activeCampaignClient.ts +++ b/packages/active-campaign-client/src/clients/activeCampaignClient.ts @@ -22,7 +22,7 @@ export class ActiveCampaignClient { private async makeRequest( method: string, path: string, - data?: any, + data?: ContactPayload | ListPayload, params?: Record ): Promise { return new Promise((resolve, reject) => { @@ -114,8 +114,6 @@ export class ActiveCampaignClient { } export const acClient = new ActiveCampaignClient( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - process.env.AC_BASE_URL!, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - process.env.AC_API_KEY! + process.env.AC_BASE_URL || '', + process.env.AC_API_KEY || '' ); diff --git a/packages/active-campaign-client/src/clients/cognitoClient.ts b/packages/active-campaign-client/src/clients/cognitoClient.ts new file mode 100644 index 0000000000..9d9a2ccadf --- /dev/null +++ b/packages/active-campaign-client/src/clients/cognitoClient.ts @@ -0,0 +1,5 @@ +import { CognitoIdentityProviderClient } from '@aws-sdk/client-cognito-identity-provider'; + +export const cognitoClient = new CognitoIdentityProviderClient({ + region: process.env.AWS_REGION, +}); diff --git a/packages/active-campaign-client/src/handlers/addContact.ts b/packages/active-campaign-client/src/handlers/addContact.ts deleted file mode 100644 index e6bdadb7ca..0000000000 --- a/packages/active-campaign-client/src/handlers/addContact.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { acClient } from '../utils/activeCampaignClient'; -import { SignUpUserData } from 'nextjs-website/src/lib/types/sign-up'; -import { ContactPayload } from '../types/contactPayload'; - -export async function addContact(event: { - readonly Records: SQSEvent['Records']; -}): Promise { - try { - const firstMessage = event.Records[0] ?? { body: '{}' }; - // Parse request body - const userData: SignUpUserData & { readonly cognitoId: string } = - JSON.parse(firstMessage.body); - - // Transform to AC payload - const acPayload: ContactPayload = { - contact: { - email: userData.username, - firstName: userData.firstName, - lastName: userData.lastName, - phone: `cognito:${userData.cognitoId}`, - fieldValues: [ - { - field: '2', - value: userData.company, - }, - { - field: '1', - value: userData.role, - }, - { - field: '3', - value: userData.mailinglistAccepted ? 'TRUE' : 'FALSE', - }, - ], - }, - }; - - const response = await acClient.createContact(acPayload); - - return { - statusCode: 200, - body: JSON.stringify(response), - }; - } catch (error) { - console.error('Error:', error); - return { - statusCode: 500, - body: JSON.stringify({ message: 'Internal server error' }), - }; - } -} diff --git a/packages/active-campaign-client/src/handlers/updateContact.ts b/packages/active-campaign-client/src/handlers/updateContact.ts deleted file mode 100644 index dff29e4bd5..0000000000 --- a/packages/active-campaign-client/src/handlers/updateContact.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { acClient } from '../utils/activeCampaignClient'; -import { ContactPayload } from '../types/contactPayload'; - -export async function updateContact(event: { - readonly Records: SQSEvent['Records']; -}): Promise { - try { - const firstMessage = event.Records[0] ?? { body: '{}' }; - // Parse request body - const userData = JSON.parse(firstMessage.body); - - if (!userData.username) { - return { - statusCode: 400, - body: JSON.stringify({ message: 'Missing email' }), - }; - } - - const contactId = await acClient.getContactByCognitoId(userData.cognitoId); - - if (!contactId) { - return { - statusCode: 404, - body: JSON.stringify({ message: 'Contact not found' }), - }; - } - - const acPayload: ContactPayload = { - contact: { - email: userData.username, - firstName: userData.firstName, - lastName: userData.lastName, - fieldValues: [ - { - field: '2', - value: userData.company, - }, - { - field: '1', - value: userData.role, - }, - { - field: '3', - value: userData.mailinglistAccepted ? 'TRUE' : 'FALSE', - }, - ], - }, - }; - - const response = await acClient.updateContact(contactId, acPayload); - - return { - statusCode: 200, - body: JSON.stringify(response), - }; - } catch (error) { - console.error('Error:', error); - return { - statusCode: 500, - body: JSON.stringify({ message: 'Internal server error' }), - }; - } -} diff --git a/packages/active-campaign-client/src/helpers/addContact.ts b/packages/active-campaign-client/src/helpers/addContact.ts new file mode 100644 index 0000000000..1b5c843d9d --- /dev/null +++ b/packages/active-campaign-client/src/helpers/addContact.ts @@ -0,0 +1,46 @@ +import { APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../clients/activeCampaignClient'; +import { ContactPayload } from '../types/contactPayload'; +import { User } from '../types/user'; + +export async function addContact(user: User): Promise { + try { + // Transform to AC payload + const acPayload: ContactPayload = { + contact: { + email: user.email, + firstName: user.given_name, + lastName: user.family_name, + phone: `cognito:${user.username}`, + fieldValues: [ + { + field: '2', + value: user['custom:company_type'], + }, + { + field: '1', + value: user['custom:job_role'], + }, + { + field: '3', + value: + user['custom:mailinglist_accepted'] === 'true' ? 'TRUE' : 'FALSE', + }, + ], + }, + }; + + const response = await acClient.createContact(acPayload); + + return { + statusCode: 200, + body: JSON.stringify(response), + }; + } catch (error) { + console.error('Error:', error); + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } +} diff --git a/packages/active-campaign-client/src/handlers/createList.ts b/packages/active-campaign-client/src/helpers/createList.ts similarity index 94% rename from packages/active-campaign-client/src/handlers/createList.ts rename to packages/active-campaign-client/src/helpers/createList.ts index db5996dc5a..d614f1bd12 100644 --- a/packages/active-campaign-client/src/handlers/createList.ts +++ b/packages/active-campaign-client/src/helpers/createList.ts @@ -1,5 +1,5 @@ import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { acClient } from '../utils/activeCampaignClient'; +import { acClient } from '../clients/activeCampaignClient'; import { ListPayload } from '../types/listPayload'; import { WebinarPayload } from '../types/webinarPayload'; diff --git a/packages/active-campaign-client/src/handlers/deleteContact.ts b/packages/active-campaign-client/src/helpers/deleteContact.ts similarity index 58% rename from packages/active-campaign-client/src/handlers/deleteContact.ts rename to packages/active-campaign-client/src/helpers/deleteContact.ts index 1d72f6d691..085c6bc1a8 100644 --- a/packages/active-campaign-client/src/handlers/deleteContact.ts +++ b/packages/active-campaign-client/src/helpers/deleteContact.ts @@ -1,14 +1,10 @@ -import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { acClient } from '../utils/activeCampaignClient'; +import { APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../clients/activeCampaignClient'; -export async function deleteContact(event: { - readonly Records: SQSEvent['Records']; -}): Promise { +export async function deleteContact( + cognitoId: string +): Promise { try { - const firstMessage = event.Records[0] ?? { body: '{}' }; - // Parse request body - const { cognitoId } = JSON.parse(firstMessage.body); - const contactId = await acClient.getContactByCognitoId(cognitoId); if (!contactId) { diff --git a/packages/active-campaign-client/src/handlers/deleteList.ts b/packages/active-campaign-client/src/helpers/deleteList.ts similarity index 94% rename from packages/active-campaign-client/src/handlers/deleteList.ts rename to packages/active-campaign-client/src/helpers/deleteList.ts index 22ea9ac9c5..1d19d32689 100644 --- a/packages/active-campaign-client/src/handlers/deleteList.ts +++ b/packages/active-campaign-client/src/helpers/deleteList.ts @@ -1,5 +1,5 @@ import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { acClient } from '../utils/activeCampaignClient'; +import { acClient } from '../clients/activeCampaignClient'; export async function deleteList(event: { readonly Records: SQSEvent['Records']; diff --git a/packages/active-campaign-client/src/helpers/getUserFromCognito.ts b/packages/active-campaign-client/src/helpers/getUserFromCognito.ts new file mode 100644 index 0000000000..41d02e7c7b --- /dev/null +++ b/packages/active-campaign-client/src/helpers/getUserFromCognito.ts @@ -0,0 +1,19 @@ +import { ListUsersCommand } from '@aws-sdk/client-cognito-identity-provider'; +import { cognitoClient } from '../clients/cognitoClient'; +import { QueueEvent } from '../types/queueEvent'; +import { listUsersCommandOutputToUser } from './listUsersCommandOutputToUser'; + +export async function getUserFromCognito(queueEvent: QueueEvent) { + const command = new ListUsersCommand({ + UserPoolId: process.env.COGNITO_USER_POOL_ID, + Filter: `username = "${queueEvent.detail.additionalEventData.sub}"`, + }); + const listUsersCommandOutput = await cognitoClient.send(command); + const user = listUsersCommandOutputToUser(listUsersCommandOutput); + if (!user) { + // eslint-disable-next-line functional/no-throw-statements + throw new Error('User not found'); + } + console.log('User:', JSON.stringify(user, null, 2)); // TODO: Remove after testing + return user; +} diff --git a/packages/active-campaign-client/src/helpers/listUsersCommandOutputToUser.ts b/packages/active-campaign-client/src/helpers/listUsersCommandOutputToUser.ts new file mode 100644 index 0000000000..773149c355 --- /dev/null +++ b/packages/active-campaign-client/src/helpers/listUsersCommandOutputToUser.ts @@ -0,0 +1,21 @@ +import { ListUsersCommandOutput } from '@aws-sdk/client-cognito-identity-provider'; +import { User } from '../types/user'; + +export function listUsersCommandOutputToUser( + listUsersCommandOutput: ListUsersCommandOutput +) { + const userData = listUsersCommandOutput.Users?.[0]; + if (!userData) { + return undefined; + } + return { + username: userData.Username, + ...userData.Attributes?.reduce((acc, attr) => { + if (!attr.Name || !attr.Value) { + return acc; + } + acc[attr.Name] = attr.Value || ''; + return acc; + }, {} as Record), + } as User; +} diff --git a/packages/active-campaign-client/src/helpers/updateContact.ts b/packages/active-campaign-client/src/helpers/updateContact.ts new file mode 100644 index 0000000000..469b7b138d --- /dev/null +++ b/packages/active-campaign-client/src/helpers/updateContact.ts @@ -0,0 +1,54 @@ +import { APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../clients/activeCampaignClient'; +import { ContactPayload } from '../types/contactPayload'; +import { User } from '../types/user'; + +export async function updateContact( + user: User +): Promise { + try { + const acPayload: ContactPayload = { + contact: { + email: user.email, + firstName: user.given_name, + lastName: user.family_name, + phone: `cognito:${user.username}`, + fieldValues: [ + { + field: '2', + value: user['custom:company_type'], + }, + { + field: '1', + value: user['custom:job_role'], + }, + { + field: '3', + value: + user['custom:mailinglist_accepted'] === 'true' ? 'TRUE' : 'FALSE', + }, + ], + }, + }; + const contactId = await acClient.getContactByCognitoId(user.username); + if (!contactId) { + return { + statusCode: 404, + body: JSON.stringify({ message: 'Contact not found' }), + }; + } + + const response = await acClient.updateContact(contactId, acPayload); + + return { + statusCode: 200, + body: JSON.stringify(response), + }; + } catch (error) { + console.error('Error:', error); + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } +} diff --git a/packages/active-campaign-client/src/index.ts b/packages/active-campaign-client/src/index.ts index 87b5a2fdae..a3d2e6fa5e 100644 --- a/packages/active-campaign-client/src/index.ts +++ b/packages/active-campaign-client/src/index.ts @@ -1,12 +1,38 @@ import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -import { addContact } from './handlers/addContact'; +import { getUserFromCognito } from './helpers/getUserFromCognito'; +import { QueueEvent } from './types/queueEvent'; +import { addContact } from './helpers/addContact'; +import { updateContact } from './helpers/updateContact'; +import { deleteContact } from './helpers/deleteContact'; export async function handler(event: { readonly Records: SQSEvent['Records']; }): Promise { - console.log('Event:', event); - return { - statusCode: 200, - body: JSON.stringify(event), - }; + try { + console.log('Event:', event); // TODO: Remove after testing + const queueEvent = JSON.parse( + event.Records[0].body + ) as unknown as QueueEvent; + switch (queueEvent.detail.eventName) { + case 'ConfirmSignUp': + return await addContact(await getUserFromCognito(queueEvent)); + case 'UpdateUserAttributes': + return await updateContact(await getUserFromCognito(queueEvent)); + case 'DeleteUser': + return await deleteContact(queueEvent.detail.additionalEventData.sub); + default: + console.log('Unknown event:', queueEvent.detail.eventName); + break; + } + return { + statusCode: 200, + body: JSON.stringify(event), + }; + } catch (error) { + console.error('Error:', error); + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } } diff --git a/packages/active-campaign-client/src/types/queueEvent.ts b/packages/active-campaign-client/src/types/queueEvent.ts new file mode 100644 index 0000000000..aee4519189 --- /dev/null +++ b/packages/active-campaign-client/src/types/queueEvent.ts @@ -0,0 +1,13 @@ +export type QueueEventType = + | 'UpdateUserAttributes' + | 'DeleteUser' + | 'ConfirmSignUp'; + +export type QueueEvent = { + readonly detail: { + readonly eventName: QueueEventType; + readonly additionalEventData: { + readonly sub: string; + }; + }; +}; diff --git a/packages/active-campaign-client/src/types/user.ts b/packages/active-campaign-client/src/types/user.ts new file mode 100644 index 0000000000..b293734dec --- /dev/null +++ b/packages/active-campaign-client/src/types/user.ts @@ -0,0 +1,9 @@ +export type User = { + readonly username: string; + readonly email: string; + readonly given_name: string; + readonly family_name: string; + readonly 'custom:mailinglist_accepted': string; + readonly 'custom:company_type': string; + readonly 'custom:job_role': string; +};