From e736a4efb52037fe2a6272a7a5fdb75216f5ec57 Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 11:11:50 +0200 Subject: [PATCH 01/11] add api signature for contacts --- packages/active-campaign-client/package.json | 9 +++++++++ .../src/manageContacts.ts | 18 ++++++++++++++++++ .../active-campaign-client/src/manageLists.ts | 0 3 files changed, 27 insertions(+) create mode 100644 packages/active-campaign-client/package.json create mode 100644 packages/active-campaign-client/src/manageContacts.ts create mode 100644 packages/active-campaign-client/src/manageLists.ts diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json new file mode 100644 index 0000000000..c4fac393dc --- /dev/null +++ b/packages/active-campaign-client/package.json @@ -0,0 +1,9 @@ +{ + "name": "active-campaign-client", + "version": "0.1.0", + "description": "Implements ActiveCampaign API to add, update and delete Accounts and to add and update lists", + "scripts": { + "lint": "eslint src", + "test": "echo \"Error: no test specified\" && exit 1" + } +} diff --git a/packages/active-campaign-client/src/manageContacts.ts b/packages/active-campaign-client/src/manageContacts.ts new file mode 100644 index 0000000000..cad155f4e0 --- /dev/null +++ b/packages/active-campaign-client/src/manageContacts.ts @@ -0,0 +1,18 @@ +//check https://developers.activecampaign.com/reference/contact for informations on the contact api for Active Campaign + +//Signup user data is used as a reference for now, if needed, update it with a type we can easily retrieve +import { SignUpUserData } from "nextjs-website/src/lib/types/sign-up"; + +//https://developers.activecampaign.com/reference/create-a-new-contact +export type AddContact = (contactInfo: SignUpUserData) => unknown;//torna la risposta + +//the return value could be the contact id +//https://developers.activecampaign.com/reference/list-all-contacts +//export type FetchContact = (searchQuery: string) => number; + +//the contactId is the id used on Active Campaign, which must be retrieved +//https://developers.activecampaign.com/reference/delete-contact +export type DeleteContact = (contactId: number) => unknown; + +//https://developers.activecampaign.com/reference/update-a-contact-new +export type UpdateContact = (contactId: number, contactInfo: SignUpUserData) => unknown; diff --git a/packages/active-campaign-client/src/manageLists.ts b/packages/active-campaign-client/src/manageLists.ts new file mode 100644 index 0000000000..e69de29bb2 From cedf714a3fbb4219f05c3afe1f775585d44ddc64 Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:05:28 +0200 Subject: [PATCH 02/11] add list management --- packages/active-campaign-client/src/manageContacts.ts | 8 ++++++-- packages/active-campaign-client/src/manageLists.ts | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/active-campaign-client/src/manageContacts.ts b/packages/active-campaign-client/src/manageContacts.ts index cad155f4e0..57df014238 100644 --- a/packages/active-campaign-client/src/manageContacts.ts +++ b/packages/active-campaign-client/src/manageContacts.ts @@ -12,7 +12,11 @@ export type AddContact = (contactInfo: SignUpUserData) => unknown;//torna la ris //the contactId is the id used on Active Campaign, which must be retrieved //https://developers.activecampaign.com/reference/delete-contact -export type DeleteContact = (contactId: number) => unknown; +export type DeleteContact = (contactId: string) => unknown; //https://developers.activecampaign.com/reference/update-a-contact-new -export type UpdateContact = (contactId: number, contactInfo: SignUpUserData) => unknown; +export type UpdateContact = (contactId: string, contactInfo: SignUpUserData) => unknown; + +//https://developers.activecampaign.com/reference/update-list-status-for-contact +//status can have 2 values: "1" -> subscribe, "2" -> unsubscribe +export type UpdateListStatus = (listId: string, contactId: string, status: string) => unknown; diff --git a/packages/active-campaign-client/src/manageLists.ts b/packages/active-campaign-client/src/manageLists.ts index e69de29bb2..93ee3b91b9 100644 --- a/packages/active-campaign-client/src/manageLists.ts +++ b/packages/active-campaign-client/src/manageLists.ts @@ -0,0 +1,6 @@ +import { Webinar } from "nextjs-website/src/lib/types/webinar"; + +//https://developers.activecampaign.com/reference/create-new-list +//listInfo should include all the needed info for the api +//Important: the api returns the id of the list on Active Campaign +export type CreateList = (listInfo: Webinar) => unknown;//torna la risposta From 9ada8453b23828a5ea020e9f7c42314cf0e86cc5 Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:10:17 +0200 Subject: [PATCH 03/11] update package-lock --- package-lock.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package-lock.json b/package-lock.json index cef58cbc3a..3576bec1fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29913,6 +29913,10 @@ "node": ">=0.4.0" } }, + "node_modules/active-campaign-client": { + "resolved": "packages/active-campaign-client", + "link": true + }, "node_modules/address": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/address/-/address-2.0.2.tgz", @@ -57854,6 +57858,9 @@ "url": "https://github.com/sponsors/wooorm" } }, + "packages/active-campaign-client": { + "version": "0.1.0" + }, "packages/core": { "version": "0.1.0", "extraneous": true, From 7673a2edc0120e23a334b19c98a08892ac18a44a Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:20:43 +0200 Subject: [PATCH 04/11] add eslintrc.json --- packages/active-campaign-client/.eslintrc.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/active-campaign-client/.eslintrc.json diff --git a/packages/active-campaign-client/.eslintrc.json b/packages/active-campaign-client/.eslintrc.json new file mode 100644 index 0000000000..5ad55be13b --- /dev/null +++ b/packages/active-campaign-client/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "root": true, + "extends": [ + "custom" + ], + "overrides": [ + { + "files": ["**/*.ts"], + "rules": { + "functional/prefer-readonly-type": "off", + "functional/no-expression-statements": "off", + "functional/no-expression-statement": "off", + "functional/immutable-data": "off", + "@typescript-eslint/no-non-null-assertion": "off" + } + } + ] +} From c261229f08da02f031cd662a927cfb2b5941de8b Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:22:54 +0200 Subject: [PATCH 05/11] update package.json and eslint --- packages/active-campaign-client/.eslintrc.json | 12 ------------ packages/active-campaign-client/package.json | 4 ++++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/active-campaign-client/.eslintrc.json b/packages/active-campaign-client/.eslintrc.json index 5ad55be13b..027a424614 100644 --- a/packages/active-campaign-client/.eslintrc.json +++ b/packages/active-campaign-client/.eslintrc.json @@ -2,17 +2,5 @@ "root": true, "extends": [ "custom" - ], - "overrides": [ - { - "files": ["**/*.ts"], - "rules": { - "functional/prefer-readonly-type": "off", - "functional/no-expression-statements": "off", - "functional/no-expression-statement": "off", - "functional/immutable-data": "off", - "@typescript-eslint/no-non-null-assertion": "off" - } - } ] } diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index c4fac393dc..dd49a7c4fa 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -5,5 +5,9 @@ "scripts": { "lint": "eslint src", "test": "echo \"Error: no test specified\" && exit 1" + }, + "devDependencies": { + "eslint": "^8.40.0", + "eslint-config-custom": "*" } } From 460a08428b5832a6b68c872173a3435b7ba2973b Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:25:20 +0200 Subject: [PATCH 06/11] migrate eslint --- packages/active-campaign-client/eslint.config.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/active-campaign-client/eslint.config.mjs diff --git a/packages/active-campaign-client/eslint.config.mjs b/packages/active-campaign-client/eslint.config.mjs new file mode 100644 index 0000000000..4ab73ed78c --- /dev/null +++ b/packages/active-campaign-client/eslint.config.mjs @@ -0,0 +1,13 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); +export default [...compat.extends("custom")]; \ No newline at end of file From 2ec3f98687209dcd5b0d2559b11c93bf599a97cf Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:52:28 +0200 Subject: [PATCH 07/11] fix issues with linting --- package-lock.json | 87 ++++++++++++++++++- .../active-campaign-client/eslint.config.mjs | 13 --- packages/active-campaign-client/package.json | 2 + .../src/manageContacts.ts | 15 +++- .../active-campaign-client/src/manageLists.ts | 4 +- packages/active-campaign-client/tsconfig.json | 8 ++ 6 files changed, 106 insertions(+), 23 deletions(-) delete mode 100644 packages/active-campaign-client/eslint.config.mjs create mode 100644 packages/active-campaign-client/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 3576bec1fd..b3fffa4301 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29871,9 +29871,9 @@ } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", + "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", "bin": { "acorn": "bin/acorn" }, @@ -57859,7 +57859,86 @@ } }, "packages/active-campaign-client": { - "version": "0.1.0" + "version": "0.1.0", + "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.12.0", + "eslint": "^8.40.0", + "eslint-config-custom": "*" + } + }, + "packages/active-campaign-client/node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/active-campaign-client/node_modules/@eslint/js": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", + "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "packages/active-campaign-client/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/active-campaign-client/node_modules/espree": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", + "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "dev": true, + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/active-campaign-client/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "packages/core": { "version": "0.1.0", diff --git a/packages/active-campaign-client/eslint.config.mjs b/packages/active-campaign-client/eslint.config.mjs deleted file mode 100644 index 4ab73ed78c..0000000000 --- a/packages/active-campaign-client/eslint.config.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import js from "@eslint/js"; -import { FlatCompat } from "@eslint/eslintrc"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); -export default [...compat.extends("custom")]; \ No newline at end of file diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index dd49a7c4fa..243031a722 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -7,6 +7,8 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.12.0", "eslint": "^8.40.0", "eslint-config-custom": "*" } diff --git a/packages/active-campaign-client/src/manageContacts.ts b/packages/active-campaign-client/src/manageContacts.ts index 57df014238..65a1618fda 100644 --- a/packages/active-campaign-client/src/manageContacts.ts +++ b/packages/active-campaign-client/src/manageContacts.ts @@ -1,10 +1,10 @@ //check https://developers.activecampaign.com/reference/contact for informations on the contact api for Active Campaign //Signup user data is used as a reference for now, if needed, update it with a type we can easily retrieve -import { SignUpUserData } from "nextjs-website/src/lib/types/sign-up"; +import { SignUpUserData } from 'nextjs-website/src/lib/types/sign-up'; //https://developers.activecampaign.com/reference/create-a-new-contact -export type AddContact = (contactInfo: SignUpUserData) => unknown;//torna la risposta +export type AddContact = (contactInfo: SignUpUserData) => unknown; //torna la risposta //the return value could be the contact id //https://developers.activecampaign.com/reference/list-all-contacts @@ -15,8 +15,15 @@ export type AddContact = (contactInfo: SignUpUserData) => unknown;//torna la ris export type DeleteContact = (contactId: string) => unknown; //https://developers.activecampaign.com/reference/update-a-contact-new -export type UpdateContact = (contactId: string, contactInfo: SignUpUserData) => unknown; +export type UpdateContact = ( + contactId: string, + contactInfo: SignUpUserData +) => unknown; //https://developers.activecampaign.com/reference/update-list-status-for-contact //status can have 2 values: "1" -> subscribe, "2" -> unsubscribe -export type UpdateListStatus = (listId: string, contactId: string, status: string) => unknown; +export type UpdateListStatus = ( + listId: string, + contactId: string, + status: string +) => unknown; diff --git a/packages/active-campaign-client/src/manageLists.ts b/packages/active-campaign-client/src/manageLists.ts index 93ee3b91b9..ab03beaf40 100644 --- a/packages/active-campaign-client/src/manageLists.ts +++ b/packages/active-campaign-client/src/manageLists.ts @@ -1,6 +1,6 @@ -import { Webinar } from "nextjs-website/src/lib/types/webinar"; +import { Webinar } from 'nextjs-website/src/lib/types/webinar'; //https://developers.activecampaign.com/reference/create-new-list //listInfo should include all the needed info for the api //Important: the api returns the id of the list on Active Campaign -export type CreateList = (listInfo: Webinar) => unknown;//torna la risposta +export type CreateList = (listInfo: Webinar) => unknown; //torna la risposta diff --git a/packages/active-campaign-client/tsconfig.json b/packages/active-campaign-client/tsconfig.json new file mode 100644 index 0000000000..75eba9f992 --- /dev/null +++ b/packages/active-campaign-client/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"] +} From 89b6cc8a87116a886c889f86312987935a3af835 Mon Sep 17 00:00:00 2001 From: Marcello Bertoli Date: Thu, 17 Oct 2024 15:53:07 +0200 Subject: [PATCH 08/11] add changeset --- .changeset/great-rockets-know.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/great-rockets-know.md diff --git a/.changeset/great-rockets-know.md b/.changeset/great-rockets-know.md new file mode 100644 index 0000000000..605807d853 --- /dev/null +++ b/.changeset/great-rockets-know.md @@ -0,0 +1,5 @@ +--- +"active-campaign-client": patch +--- + +Create package and add function signatures From 6e2a83066a77ace86c854a41ed05745b1196238b Mon Sep 17 00:00:00 2001 From: t Date: Mon, 28 Oct 2024 23:20:34 +0100 Subject: [PATCH 09/11] scaffold, and api calls --- package-lock.json | 372 ++++++++++-------- .../active-campaign-client/jest.config.ts | 6 + packages/active-campaign-client/package.json | 11 +- .../src/__tests__/handlers/addContact.test.ts | 32 ++ .../src/activeCampaign.ts | 31 ++ .../src/activeCampaignClient.ts | 72 ++++ .../active-campaign-client/src/cognito.ts | 7 + .../src/handlers/addContact.ts | 57 +++ .../src/handlers/createList.ts | 45 +++ .../src/handlers/deleteContact.ts | 34 ++ .../src/handlers/updateContact.ts | 53 +++ .../src/handlers/updateListStatus.ts | 43 ++ 12 files changed, 606 insertions(+), 157 deletions(-) create mode 100644 packages/active-campaign-client/jest.config.ts create mode 100644 packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts create mode 100644 packages/active-campaign-client/src/activeCampaign.ts create mode 100644 packages/active-campaign-client/src/activeCampaignClient.ts create mode 100644 packages/active-campaign-client/src/cognito.ts create mode 100644 packages/active-campaign-client/src/handlers/addContact.ts create mode 100644 packages/active-campaign-client/src/handlers/createList.ts create mode 100644 packages/active-campaign-client/src/handlers/deleteContact.ts create mode 100644 packages/active-campaign-client/src/handlers/updateContact.ts create mode 100644 packages/active-campaign-client/src/handlers/updateListStatus.ts diff --git a/package-lock.json b/package-lock.json index b3fffa4301..80a6e49923 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10887,7 +10887,6 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -12298,8 +12297,7 @@ "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@braintree/sanitize-url": { "version": "7.0.0", @@ -16654,7 +16652,7 @@ }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" @@ -16665,7 +16663,7 @@ }, "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/resolve-uri": { "version": "3.1.1", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -16673,7 +16671,7 @@ }, "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -17633,7 +17631,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -17649,7 +17646,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -17658,7 +17654,6 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, "engines": { "node": ">=6" } @@ -17667,7 +17662,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -17680,7 +17674,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -17693,7 +17686,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -17705,7 +17697,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -17720,7 +17711,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -17732,7 +17722,6 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, "engines": { "node": ">=8" } @@ -17741,7 +17730,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", - "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -17758,7 +17746,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", - "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", @@ -17831,7 +17818,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", - "dev": true, "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" @@ -17844,7 +17830,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", - "dev": true, "dependencies": { "jest-get-type": "^29.6.3" }, @@ -17872,7 +17857,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", - "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -17887,7 +17871,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", - "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", @@ -17941,7 +17924,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", - "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -17955,7 +17937,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", - "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", @@ -17970,7 +17951,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", - "dev": true, "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", @@ -17985,7 +17965,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -18010,14 +17989,12 @@ "node_modules/@jest/transform/node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/@jest/transform/node_modules/write-file-atomic": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -28314,22 +28291,22 @@ }, "node_modules/@tsconfig/node10": { "version": "1.0.9", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@turf/boolean-clockwise": { @@ -28380,16 +28357,14 @@ "license": "MIT" }, "node_modules/@types/aws-lambda": { - "version": "8.10.126", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.126.tgz", - "integrity": "sha512-5eh4ffLdGYgGYI1Xr6W5L4IVse4RR7L2ns5OVUXA52nW5GFapIcGMcCzHAIMMOdpcQs3aGVxbvFlJNZH6IpgEQ==", - "dev": true + "version": "8.10.145", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.145.tgz", + "integrity": "sha512-dtByW6WiFk5W5Jfgz1VM+YPA21xMXTuSFoLYIDY0L44jDLLflVPtZkYuu3/YxpGcvjzKFBZLU+GyKjR0HOYtyw==" }, "node_modules/@types/babel__core": { "version": "7.20.4", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.4.tgz", "integrity": "sha512-mLnSC22IC4vcWiuObSRjrLd9XcBTGf59vUSoq2jkQDJ/QQ8PMI9rSuzE+aEV8karUMbskw07bKYoUJCKTUaygg==", - "dev": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -28402,7 +28377,6 @@ "version": "7.6.7", "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", - "dev": true, "dependencies": { "@babel/types": "^7.0.0" } @@ -28411,7 +28385,6 @@ "version": "7.4.4", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -28421,7 +28394,6 @@ "version": "7.20.4", "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", - "dev": true, "dependencies": { "@babel/types": "^7.20.7" } @@ -28664,7 +28636,6 @@ "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -28800,9 +28771,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.1", - "dev": true, - "license": "MIT", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -30254,7 +30225,7 @@ }, "node_modules/arg": { "version": "4.1.3", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/argparse": { @@ -30625,6 +30596,116 @@ "ieee754": "^1.2.1" } }, + "node_modules/aws-lambda": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/aws-lambda/-/aws-lambda-1.0.7.tgz", + "integrity": "sha512-9GNFMRrEMG5y3Jvv+V4azWvc+qNWdWLTjDdhf/zgMlz8haaaLWv0xeAIWxz9PuWUBawsVxy0zZotjCdR3Xq+2w==", + "dependencies": { + "aws-sdk": "^2.814.0", + "commander": "^3.0.2", + "js-yaml": "^3.14.1", + "watchpack": "^2.0.0-beta.10" + }, + "bin": { + "lambda": "bin/lambda" + } + }, + "node_modules/aws-lambda/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/aws-lambda/node_modules/commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" + }, + "node_modules/aws-lambda/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/aws-sdk": { + "version": "2.1691.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1691.0.tgz", + "integrity": "sha512-/F2YC+DlsY3UBM2Bdnh5RLHOPNibS/+IcjUuhP8XuctyrN+MlL+fWDAiela32LTDk7hMy4rx8MTgvbJ+0blO5g==", + "hasInstallScript": true, + "dependencies": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/aws-sdk/node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/aws-sdk/node_modules/events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/aws-sdk/node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "node_modules/aws-sdk/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/aws-sdk/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" + }, + "node_modules/aws-sdk/node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/aws-sdk/node_modules/uuid": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/axe-core": { "version": "4.6.3", "license": "MPL-2.0", @@ -30666,7 +30747,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", @@ -30876,7 +30956,6 @@ "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -30892,7 +30971,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -30908,7 +30986,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -31007,7 +31084,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -31068,7 +31144,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -31588,7 +31663,6 @@ }, "node_modules/bs-logger": { "version": "0.2.6", - "dev": true, "license": "MIT", "dependencies": { "fast-json-stable-stringify": "2.x" @@ -32060,7 +32134,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, "engines": { "node": ">=10" } @@ -32275,8 +32348,7 @@ "node_modules/cjs-module-lexer": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", - "dev": true + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==" }, "node_modules/ckeditor5": { "version": "42.0.2", @@ -32612,8 +32684,7 @@ "node_modules/collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==" }, "node_modules/collection-visit": { "version": "1.0.0", @@ -33352,7 +33423,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -33371,7 +33441,7 @@ }, "node_modules/create-require": { "version": "1.1.1", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/crelt": { @@ -34394,7 +34464,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", - "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -34703,7 +34772,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true, "engines": { "node": ">=8" } @@ -34748,7 +34816,7 @@ }, "node_modules/diff": { "version": "4.0.2", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -34758,7 +34826,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -35137,7 +35204,6 @@ "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", - "dev": true, "dependencies": { "jake": "^10.8.5" }, @@ -35176,7 +35242,6 @@ "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "dev": true, "engines": { "node": ">=12" }, @@ -36666,7 +36731,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -36766,7 +36830,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -37266,7 +37329,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", - "dev": true, "dependencies": { "minimatch": "^5.0.1" } @@ -37275,7 +37337,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -37284,7 +37345,6 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -39626,7 +39686,6 @@ }, "node_modules/import-local": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", @@ -40085,7 +40144,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, "engines": { "node": ">=6" } @@ -40772,7 +40830,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.1.tgz", "integrity": "sha512-opCrKqbthmq3SKZ10mFMQG9dk3fTa3quaOLD35kJa5ejwZHd9xAr+kLuziiZz2cG32s4lMZxNdmdcEQnTDP4+g==", - "dev": true, "engines": { "node": ">=8" } @@ -40781,7 +40838,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", - "dev": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -40797,7 +40853,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -40809,7 +40864,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -40824,7 +40878,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -40838,7 +40891,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -40850,7 +40902,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, "dependencies": { "semver": "^7.5.3" }, @@ -40865,7 +40916,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -40880,7 +40930,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -40894,7 +40943,6 @@ "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", - "dev": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -40924,7 +40972,6 @@ "version": "10.9.1", "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", - "dev": true, "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -40942,7 +40989,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", - "dev": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -40968,7 +41014,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", - "dev": true, "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", @@ -40982,7 +41027,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", - "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -41013,7 +41057,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", @@ -41046,7 +41089,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", @@ -41091,7 +41133,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", - "dev": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -41106,7 +41147,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", - "dev": true, "dependencies": { "detect-newline": "^3.0.0" }, @@ -41118,7 +41158,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "dev": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -41186,7 +41225,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -41211,7 +41249,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", - "dev": true, "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" @@ -41224,7 +41261,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "dev": true, "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -41284,7 +41320,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, "engines": { "node": ">=6" }, @@ -41301,7 +41336,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -41310,7 +41344,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", @@ -41330,7 +41363,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "dev": true, "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" @@ -41343,7 +41375,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", @@ -41375,7 +41406,6 @@ "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -41385,7 +41415,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -41418,7 +41447,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, "engines": { "node": ">=8" } @@ -41427,7 +41455,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", @@ -41458,7 +41485,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -41470,7 +41496,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -41517,7 +41542,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", - "dev": true, "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", @@ -41536,7 +41560,6 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -41551,7 +41574,6 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -41576,6 +41598,14 @@ "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==" }, + "node_modules/jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/joi": { "version": "17.10.2", "resolved": "https://registry.npmjs.org/joi/-/joi-17.10.2.tgz", @@ -42803,7 +42833,6 @@ }, "node_modules/lodash.memoize": { "version": "4.1.2", - "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { @@ -43192,7 +43221,6 @@ }, "node_modules/make-error": { "version": "1.3.6", - "dev": true, "license": "ISC" }, "node_modules/make-iterator": { @@ -48162,7 +48190,6 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", - "dev": true, "license": "MIT", "dependencies": { "find-up": "^4.0.0" @@ -48173,7 +48200,6 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -48185,7 +48211,6 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -48196,7 +48221,6 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", - "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -48210,7 +48234,6 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -49243,7 +49266,6 @@ "version": "6.0.4", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", - "dev": true, "funding": [ { "type": "individual", @@ -51370,7 +51392,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, "engines": { "node": ">=10" } @@ -51886,6 +51907,11 @@ } } }, + "node_modules/sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" + }, "node_modules/saxes": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", @@ -53815,7 +53841,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -54791,7 +54816,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -55180,28 +55204,29 @@ } }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", - "dev": true, + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", "jest-util": "^29.0.0", "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", @@ -55211,6 +55236,9 @@ "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -55222,26 +55250,10 @@ } } }, - "node_modules/ts-jest/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -55251,7 +55263,6 @@ }, "node_modules/ts-jest/node_modules/yargs-parser": { "version": "21.1.1", - "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -55270,7 +55281,7 @@ }, "node_modules/ts-node": { "version": "10.9.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -56534,14 +56545,13 @@ }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { "version": "9.1.3", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", - "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -56554,8 +56564,7 @@ "node_modules/v8-to-istanbul/node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/v8flags": { "version": "2.1.1", @@ -57555,6 +57564,26 @@ "node": ">= 10" } }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -57728,7 +57757,7 @@ }, "node_modules/yn": { "version": "3.1.1", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -57860,6 +57889,15 @@ }, "packages/active-campaign-client": { "version": "0.1.0", + "dependencies": { + "@types/aws-lambda": "^8.10.145", + "@types/jest": "^29.5.14", + "aws-lambda": "^1.0.7", + "axios": "^1.7.7", + "jest": "^29.7.0", + "ts-jest": "^29.2.5", + "typescript": "^5.6.3" + }, "devDependencies": { "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.12.0", @@ -57899,6 +57937,16 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "packages/active-campaign-client/node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "packages/active-campaign-client/node_modules/eslint-visitor-keys": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", @@ -57940,6 +57988,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/active-campaign-client/node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "packages/core": { "version": "0.1.0", "extraneous": true, diff --git a/packages/active-campaign-client/jest.config.ts b/packages/active-campaign-client/jest.config.ts new file mode 100644 index 0000000000..4e255c584a --- /dev/null +++ b/packages/active-campaign-client/jest.config.ts @@ -0,0 +1,6 @@ +/* eslint-disable functional/immutable-data */ +/* eslint-disable functional/no-expression-statements */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index 243031a722..07c69875e9 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -4,12 +4,21 @@ "description": "Implements ActiveCampaign API to add, update and delete Accounts and to add and update lists", "scripts": { "lint": "eslint src", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jest" }, "devDependencies": { "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.12.0", "eslint": "^8.40.0", "eslint-config-custom": "*" + }, + "dependencies": { + "@types/aws-lambda": "^8.10.145", + "@types/jest": "^29.5.14", + "aws-lambda": "^1.0.7", + "axios": "^1.7.7", + "jest": "^29.7.0", + "ts-jest": "^29.2.5", + "typescript": "^5.6.3" } } diff --git a/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts b/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts new file mode 100644 index 0000000000..7c800b6839 --- /dev/null +++ b/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts @@ -0,0 +1,32 @@ +import { handler } from '../../handlers/addContact'; + +describe('addContact handler', () => { + it('should create a contact successfully', async () => { + const event = { + headers: { + Authorization: 'test-token', + }, + body: JSON.stringify({ + username: 'test@example.com', + firstName: 'John', + lastName: 'Doe', + company: 'Test Co', + role: 'Developer', + mailinglistAccepted: true, + }), + }; + + const response = await handler(event as any); + expect(response.statusCode).toBe(200); + }); + + it('should return 401 for missing authorization', async () => { + const event = { + headers: {}, + body: JSON.stringify({}), + }; + + const response = await handler(event as any); + expect(response.statusCode).toBe(401); + }); +}); diff --git a/packages/active-campaign-client/src/activeCampaign.ts b/packages/active-campaign-client/src/activeCampaign.ts new file mode 100644 index 0000000000..3dd620a126 --- /dev/null +++ b/packages/active-campaign-client/src/activeCampaign.ts @@ -0,0 +1,31 @@ +export type ACContactPayload = { + readonly contact: { + readonly email: string; + readonly firstName: string; + readonly lastName: string; + readonly phone?: string; + readonly fieldValues: readonly { + readonly field: string; + readonly value: string; + }[]; + }; +}; + +export type ACListPayload = { + readonly list: { + readonly name: string; + readonly stringid: string; + readonly sender_url: string; + readonly sender_reminder: string; + readonly subscription_notify?: string; + readonly unsubscription_notify?: string; + }; +}; + +export type ACListStatusPayload = { + readonly contactList: { + readonly list: string; + readonly contact: string; + readonly status: string; + }; +}; diff --git a/packages/active-campaign-client/src/activeCampaignClient.ts b/packages/active-campaign-client/src/activeCampaignClient.ts new file mode 100644 index 0000000000..742aeda81c --- /dev/null +++ b/packages/active-campaign-client/src/activeCampaignClient.ts @@ -0,0 +1,72 @@ +/* eslint-disable functional/no-expression-statements */ +/* eslint-disable functional/no-this-expressions */ +/* eslint-disable functional/no-classes */ +import axios from 'axios'; +import { + ACContactPayload, + ACListPayload, + ACListStatusPayload, +} from './activeCampaign'; + +export class ActiveCampaignClient { + private readonly baseUrl: string; + private readonly apiKey: string; + + constructor(baseUrl: string, apiKey: string) { + this.baseUrl = baseUrl; + this.apiKey = apiKey; + } + + private getHeaders() { + return { + 'Api-Token': this.apiKey, + 'Content-Type': 'application/json', + }; + } + + async createContact(data: ACContactPayload) { + const response = await axios.post(`${this.baseUrl}/api/3/contacts`, data, { + headers: this.getHeaders(), + }); + return response.data; + } + + async updateContact(contactId: string, data: ACContactPayload) { + const response = await axios.put( + `${this.baseUrl}/api/3/contacts/${contactId}`, + data, + { headers: this.getHeaders() } + ); + return response.data; + } + + async deleteContact(contactId: string) { + const response = await axios.delete( + `${this.baseUrl}/api/3/contacts/${contactId}`, + { headers: this.getHeaders() } + ); + return response.data; + } + + async createList(data: ACListPayload) { + const response = await axios.post(`${this.baseUrl}/api/3/lists`, data, { + headers: this.getHeaders(), + }); + return response.data; + } + + async updateListStatus(data: ACListStatusPayload) { + const response = await axios.post( + `${this.baseUrl}/api/3/contactLists`, + data, + { headers: this.getHeaders() } + ); + return response.data; + } +} + +export const acClient = new ActiveCampaignClient( + process.env.AC_BASE_URL || 'https://uqido1728911682.activehosted.com', + process.env.AC_API_KEY || + 'c9d193d287bd1e5e7f8dc5a6a8ec673d4c1d48bf4d84abd440d4f33cc405f78828f1d0e9' +); diff --git a/packages/active-campaign-client/src/cognito.ts b/packages/active-campaign-client/src/cognito.ts new file mode 100644 index 0000000000..3ced183fad --- /dev/null +++ b/packages/active-campaign-client/src/cognito.ts @@ -0,0 +1,7 @@ +import { CognitoIdentityServiceProvider } from 'aws-sdk'; + +export async function validateCognitoToken(token: string): Promise { + // TODO: Implement actual token validation when AWS credentials are available + // For local testing, return true if token exists + return !!token; +} diff --git a/packages/active-campaign-client/src/handlers/addContact.ts b/packages/active-campaign-client/src/handlers/addContact.ts new file mode 100644 index 0000000000..c58a3b28ed --- /dev/null +++ b/packages/active-campaign-client/src/handlers/addContact.ts @@ -0,0 +1,57 @@ +/* eslint-disable functional/no-try-statements */ +/* eslint-disable functional/no-expression-statements */ +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; +import { acClient, ActiveCampaignClient } from '../activeCampaignClient'; +import { validateCognitoToken } from '../cognito'; +import { SignUpUserData } from 'nextjs-website/src/lib/types/sign-up'; +import { ACContactPayload } from '../activeCampaign'; + +export async function handler( + event: APIGatewayProxyEvent +): Promise { + try { + // Validate authorization + const token = event.headers.Authorization; + if (!token || !(await validateCognitoToken(token))) { + return { + statusCode: 401, + body: JSON.stringify({ message: 'Unauthorized' }), + }; + } + + // Parse request body + const userData: SignUpUserData = JSON.parse(event.body || '{}'); + + // Transform to AC payload + const acPayload: ACContactPayload = { + contact: { + email: userData.username, + firstName: userData.firstName, + lastName: userData.lastName, + fieldValues: [ + { + field: 'company', + value: userData.company, + }, + { + field: 'role', + value: userData.role, + }, + ], + }, + }; + + 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/handlers/createList.ts new file mode 100644 index 0000000000..4d1453cff7 --- /dev/null +++ b/packages/active-campaign-client/src/handlers/createList.ts @@ -0,0 +1,45 @@ +/* eslint-disable functional/no-try-statements */ +/* eslint-disable functional/no-expression-statements */ +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../activeCampaignClient'; +import { validateCognitoToken } from '../cognito'; +import { ACListPayload } from '../activeCampaign'; +import { Webinar } from 'nextjs-website/src/lib/types/webinar'; + +export async function handler( + event: APIGatewayProxyEvent +): Promise { + try { + const token = event.headers.Authorization; + if (!token || !(await validateCognitoToken(token))) { + return { + statusCode: 401, + body: JSON.stringify({ message: 'Unauthorized' }), + }; + } + + const webinarData: Webinar = JSON.parse(event.body || '{}'); + + const acPayload: ACListPayload = { + list: { + name: webinarData.title, + stringid: webinarData.slug, + sender_url: process.env.SENDER_URL || 'https://example.com', + sender_reminder: 'Reminder for your webinar registration', + }, + }; + + const response = await acClient.createList(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/deleteContact.ts b/packages/active-campaign-client/src/handlers/deleteContact.ts new file mode 100644 index 0000000000..442c374b93 --- /dev/null +++ b/packages/active-campaign-client/src/handlers/deleteContact.ts @@ -0,0 +1,34 @@ +/* eslint-disable functional/no-try-statements */ +/* eslint-disable functional/no-expression-statements */ +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../activeCampaignClient'; +import { validateCognitoToken } from '../cognito'; + +export async function handler( + event: APIGatewayProxyEvent +): Promise { + try { + const token = event.headers.Authorization; + if (!token || !(await validateCognitoToken(token))) { + return { + statusCode: 401, + body: JSON.stringify({ message: 'Unauthorized' }), + }; + } + + const { contactId } = JSON.parse(event.body || '{}'); + + const response = await acClient.deleteContact(contactId); + + 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 new file mode 100644 index 0000000000..06e76e31d4 --- /dev/null +++ b/packages/active-campaign-client/src/handlers/updateContact.ts @@ -0,0 +1,53 @@ +/* eslint-disable functional/no-try-statements */ +/* eslint-disable functional/no-expression-statements */ +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; +import { validateCognitoToken } from '../cognito'; +import { ACContactPayload } from '../activeCampaign'; +import { acClient } from '../activeCampaignClient'; + +export async function handler( + event: APIGatewayProxyEvent +): Promise { + try { + const token = event.headers.Authorization; + if (!token || !(await validateCognitoToken(token))) { + return { + statusCode: 401, + body: JSON.stringify({ message: 'Unauthorized' }), + }; + } + + const { contactId, ...userData } = JSON.parse(event.body || '{}'); + + const acPayload: ACContactPayload = { + contact: { + email: userData.username, + firstName: userData.firstName, + lastName: userData.lastName, + fieldValues: [ + { + field: 'company', + value: userData.company, + }, + { + field: 'role', + value: userData.role, + }, + ], + }, + }; + + 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/handlers/updateListStatus.ts b/packages/active-campaign-client/src/handlers/updateListStatus.ts new file mode 100644 index 0000000000..d5059f9bbb --- /dev/null +++ b/packages/active-campaign-client/src/handlers/updateListStatus.ts @@ -0,0 +1,43 @@ +/* eslint-disable functional/no-try-statements */ +/* eslint-disable functional/no-expression-statements */ +import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../activeCampaignClient'; +import { validateCognitoToken } from '../cognito'; +import { ACListStatusPayload } from '../activeCampaign'; + +export async function handler( + event: APIGatewayProxyEvent +): Promise { + try { + const token = event.headers.Authorization; + if (!token || !(await validateCognitoToken(token))) { + return { + statusCode: 401, + body: JSON.stringify({ message: 'Unauthorized' }), + }; + } + + const { listId, contactId, status } = JSON.parse(event.body || '{}'); + + const acPayload: ACListStatusPayload = { + contactList: { + list: listId, + contact: contactId, + status, + }, + }; + + const response = await acClient.updateListStatus(acPayload); + + return { + statusCode: 200, + body: JSON.stringify(response), + }; + } catch (error) { + console.error('Error:', error); + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } +} From 62d5416ebc1aad86d6ae1ad01f9c68399f6e4da7 Mon Sep 17 00:00:00 2001 From: t Date: Wed, 30 Oct 2024 12:00:53 +0100 Subject: [PATCH 10/11] add contact fix --- package-lock.json | 12 ++++++++++++ packages/active-campaign-client/package.json | 3 ++- .../src/__tests__/handlers/addContact.test.ts | 2 +- .../src/activeCampaignClient.ts | 9 ++++++--- .../src/handlers/addContact.ts | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80a6e49923..02b3ce8806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57894,6 +57894,7 @@ "@types/jest": "^29.5.14", "aws-lambda": "^1.0.7", "axios": "^1.7.7", + "dotenv": "16.4.5", "jest": "^29.7.0", "ts-jest": "^29.2.5", "typescript": "^5.6.3" @@ -57947,6 +57948,17 @@ "proxy-from-env": "^1.1.0" } }, + "packages/active-campaign-client/node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "packages/active-campaign-client/node_modules/eslint-visitor-keys": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index 07c69875e9..12b2a889d3 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -19,6 +19,7 @@ "axios": "^1.7.7", "jest": "^29.7.0", "ts-jest": "^29.2.5", - "typescript": "^5.6.3" + "typescript": "^5.6.3", + "dotenv": "16.4.5" } } diff --git a/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts b/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts index 7c800b6839..8e34fb4dad 100644 --- a/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts +++ b/packages/active-campaign-client/src/__tests__/handlers/addContact.test.ts @@ -7,7 +7,7 @@ describe('addContact handler', () => { Authorization: 'test-token', }, body: JSON.stringify({ - username: 'test@example.com', + username: `test@example${new Date().getTime()}e.com`, firstName: 'John', lastName: 'Doe', company: 'Test Co', diff --git a/packages/active-campaign-client/src/activeCampaignClient.ts b/packages/active-campaign-client/src/activeCampaignClient.ts index 742aeda81c..325e177317 100644 --- a/packages/active-campaign-client/src/activeCampaignClient.ts +++ b/packages/active-campaign-client/src/activeCampaignClient.ts @@ -7,6 +7,10 @@ import { ACListPayload, ACListStatusPayload, } from './activeCampaign'; +import * as dotenv from 'dotenv'; + +// eslint-disable-next-line functional/no-expression-statements +dotenv.config({ path: '.env' }); export class ActiveCampaignClient { private readonly baseUrl: string; @@ -66,7 +70,6 @@ export class ActiveCampaignClient { } export const acClient = new ActiveCampaignClient( - process.env.AC_BASE_URL || 'https://uqido1728911682.activehosted.com', - process.env.AC_API_KEY || - 'c9d193d287bd1e5e7f8dc5a6a8ec673d4c1d48bf4d84abd440d4f33cc405f78828f1d0e9' + process.env.AC_BASE_URL!, + process.env.AC_API_KEY! ); diff --git a/packages/active-campaign-client/src/handlers/addContact.ts b/packages/active-campaign-client/src/handlers/addContact.ts index c58a3b28ed..2b982c4d1a 100644 --- a/packages/active-campaign-client/src/handlers/addContact.ts +++ b/packages/active-campaign-client/src/handlers/addContact.ts @@ -1,7 +1,7 @@ /* eslint-disable functional/no-try-statements */ /* eslint-disable functional/no-expression-statements */ import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { acClient, ActiveCampaignClient } from '../activeCampaignClient'; +import { acClient } from '../activeCampaignClient'; import { validateCognitoToken } from '../cognito'; import { SignUpUserData } from 'nextjs-website/src/lib/types/sign-up'; import { ACContactPayload } from '../activeCampaign'; From ed7f1653e4a8b6a5a7ddee356614fac01a3c1dc8 Mon Sep 17 00:00:00 2001 From: t Date: Wed, 30 Oct 2024 12:06:45 +0100 Subject: [PATCH 11/11] delete non add --- .../src/handlers/createList.ts | 45 ---------------- .../src/handlers/deleteContact.ts | 34 ------------ .../src/handlers/updateContact.ts | 53 ------------------- .../src/handlers/updateListStatus.ts | 43 --------------- 4 files changed, 175 deletions(-) delete mode 100644 packages/active-campaign-client/src/handlers/createList.ts delete mode 100644 packages/active-campaign-client/src/handlers/deleteContact.ts delete mode 100644 packages/active-campaign-client/src/handlers/updateContact.ts delete mode 100644 packages/active-campaign-client/src/handlers/updateListStatus.ts diff --git a/packages/active-campaign-client/src/handlers/createList.ts b/packages/active-campaign-client/src/handlers/createList.ts deleted file mode 100644 index 4d1453cff7..0000000000 --- a/packages/active-campaign-client/src/handlers/createList.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable functional/no-try-statements */ -/* eslint-disable functional/no-expression-statements */ -import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { acClient } from '../activeCampaignClient'; -import { validateCognitoToken } from '../cognito'; -import { ACListPayload } from '../activeCampaign'; -import { Webinar } from 'nextjs-website/src/lib/types/webinar'; - -export async function handler( - event: APIGatewayProxyEvent -): Promise { - try { - const token = event.headers.Authorization; - if (!token || !(await validateCognitoToken(token))) { - return { - statusCode: 401, - body: JSON.stringify({ message: 'Unauthorized' }), - }; - } - - const webinarData: Webinar = JSON.parse(event.body || '{}'); - - const acPayload: ACListPayload = { - list: { - name: webinarData.title, - stringid: webinarData.slug, - sender_url: process.env.SENDER_URL || 'https://example.com', - sender_reminder: 'Reminder for your webinar registration', - }, - }; - - const response = await acClient.createList(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/deleteContact.ts b/packages/active-campaign-client/src/handlers/deleteContact.ts deleted file mode 100644 index 442c374b93..0000000000 --- a/packages/active-campaign-client/src/handlers/deleteContact.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* eslint-disable functional/no-try-statements */ -/* eslint-disable functional/no-expression-statements */ -import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { acClient } from '../activeCampaignClient'; -import { validateCognitoToken } from '../cognito'; - -export async function handler( - event: APIGatewayProxyEvent -): Promise { - try { - const token = event.headers.Authorization; - if (!token || !(await validateCognitoToken(token))) { - return { - statusCode: 401, - body: JSON.stringify({ message: 'Unauthorized' }), - }; - } - - const { contactId } = JSON.parse(event.body || '{}'); - - const response = await acClient.deleteContact(contactId); - - 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 06e76e31d4..0000000000 --- a/packages/active-campaign-client/src/handlers/updateContact.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* eslint-disable functional/no-try-statements */ -/* eslint-disable functional/no-expression-statements */ -import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { validateCognitoToken } from '../cognito'; -import { ACContactPayload } from '../activeCampaign'; -import { acClient } from '../activeCampaignClient'; - -export async function handler( - event: APIGatewayProxyEvent -): Promise { - try { - const token = event.headers.Authorization; - if (!token || !(await validateCognitoToken(token))) { - return { - statusCode: 401, - body: JSON.stringify({ message: 'Unauthorized' }), - }; - } - - const { contactId, ...userData } = JSON.parse(event.body || '{}'); - - const acPayload: ACContactPayload = { - contact: { - email: userData.username, - firstName: userData.firstName, - lastName: userData.lastName, - fieldValues: [ - { - field: 'company', - value: userData.company, - }, - { - field: 'role', - value: userData.role, - }, - ], - }, - }; - - 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/handlers/updateListStatus.ts b/packages/active-campaign-client/src/handlers/updateListStatus.ts deleted file mode 100644 index d5059f9bbb..0000000000 --- a/packages/active-campaign-client/src/handlers/updateListStatus.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable functional/no-try-statements */ -/* eslint-disable functional/no-expression-statements */ -import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; -import { acClient } from '../activeCampaignClient'; -import { validateCognitoToken } from '../cognito'; -import { ACListStatusPayload } from '../activeCampaign'; - -export async function handler( - event: APIGatewayProxyEvent -): Promise { - try { - const token = event.headers.Authorization; - if (!token || !(await validateCognitoToken(token))) { - return { - statusCode: 401, - body: JSON.stringify({ message: 'Unauthorized' }), - }; - } - - const { listId, contactId, status } = JSON.parse(event.body || '{}'); - - const acPayload: ACListStatusPayload = { - contactList: { - list: listId, - contact: contactId, - status, - }, - }; - - const response = await acClient.updateListStatus(acPayload); - - return { - statusCode: 200, - body: JSON.stringify(response), - }; - } catch (error) { - console.error('Error:', error); - return { - statusCode: 500, - body: JSON.stringify({ message: 'Internal server error' }), - }; - } -}