From 7ac487f9195a0a508b563b0b8f89bb1284c5ddba Mon Sep 17 00:00:00 2001 From: Marco Ponchia Date: Wed, 4 Dec 2024 16:44:37 +0100 Subject: [PATCH 1/4] [DEV-2054] Fix webinar codec (#1265) * Fix webinar codec * Add changeset * Update package lock --- .changeset/big-zebras-eat.md | 5 ++ .../src/app/[productSlug]/overview/page.tsx | 2 +- apps/nextjs-website/src/app/page.tsx | 2 +- .../lib/strapi/codecs/RelatedLinksCodec.ts | 3 +- apps/nextjs-website/src/lib/types/webinar.ts | 2 +- package-lock.json | 74 ++++++++++++++++++- 6 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 .changeset/big-zebras-eat.md diff --git a/.changeset/big-zebras-eat.md b/.changeset/big-zebras-eat.md new file mode 100644 index 0000000000..4244d795f7 --- /dev/null +++ b/.changeset/big-zebras-eat.md @@ -0,0 +1,5 @@ +--- +"nextjs-website": minor +--- + +Fix related links and webinar codec diff --git a/apps/nextjs-website/src/app/[productSlug]/overview/page.tsx b/apps/nextjs-website/src/app/[productSlug]/overview/page.tsx index 900fac6fc5..08a05eba41 100644 --- a/apps/nextjs-website/src/app/[productSlug]/overview/page.tsx +++ b/apps/nextjs-website/src/app/[productSlug]/overview/page.tsx @@ -90,7 +90,7 @@ export type OverviewPageProps = { }[]; }; readonly relatedLinks?: { - readonly title: string; + readonly title?: string; readonly links: { text: string; href: string; diff --git a/apps/nextjs-website/src/app/page.tsx b/apps/nextjs-website/src/app/page.tsx index 8ba2f9d854..8f5506c0c2 100644 --- a/apps/nextjs-website/src/app/page.tsx +++ b/apps/nextjs-website/src/app/page.tsx @@ -56,7 +56,7 @@ type EcosystemProps = { }; type ComingSoonDocumentationProps = { - readonly title: string; + readonly title?: string; readonly links: readonly { readonly text: string; readonly href: string; diff --git a/apps/nextjs-website/src/lib/strapi/codecs/RelatedLinksCodec.ts b/apps/nextjs-website/src/lib/strapi/codecs/RelatedLinksCodec.ts index 53fa9ffd4a..4bc222ccc9 100644 --- a/apps/nextjs-website/src/lib/strapi/codecs/RelatedLinksCodec.ts +++ b/apps/nextjs-website/src/lib/strapi/codecs/RelatedLinksCodec.ts @@ -1,7 +1,8 @@ import * as t from 'io-ts/lib'; import { LinkCodec } from './LinkCodec'; +import { NullToUndefinedCodec } from './NullToUndefinedCodec'; export const RelatedLinksCodec = t.type({ - title: t.string, + title: t.union([NullToUndefinedCodec, t.string]), links: t.array(LinkCodec), }); diff --git a/apps/nextjs-website/src/lib/types/webinar.ts b/apps/nextjs-website/src/lib/types/webinar.ts index b0ae646619..7d7dc145ad 100644 --- a/apps/nextjs-website/src/lib/types/webinar.ts +++ b/apps/nextjs-website/src/lib/types/webinar.ts @@ -35,7 +35,7 @@ export type Webinar = { }[]; }; readonly relatedLinks?: { - readonly title: string; + readonly title?: string; readonly links: readonly { readonly text: string; readonly href: string; diff --git a/package-lock.json b/package-lock.json index 3b410b8de4..a0a960bbc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1794,6 +1794,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", @@ -1845,6 +1846,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -1859,6 +1861,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -1870,6 +1873,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -1882,6 +1886,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dev": true, "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -1894,6 +1899,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", @@ -1907,6 +1913,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" } @@ -1915,6 +1922,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "dev": true, "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", @@ -1925,6 +1933,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -1936,6 +1945,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -1948,6 +1958,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dev": true, "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -1960,6 +1971,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", @@ -2008,6 +2020,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", @@ -2060,6 +2073,7 @@ "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==", + "dev": true, "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", @@ -2110,6 +2124,7 @@ "version": "3.696.0", "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.696.0.tgz", "integrity": "sha512-3c9III1k03DgvRZWg8vhVmfIXPG6hAciN9MzQTzqGngzWAELZF/WONRTRQuDFixVtarQatmLHYVw/atGeA2Byw==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/core": "^2.5.3", @@ -2131,6 +2146,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2146,6 +2162,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2166,6 +2183,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/credential-provider-env": "3.696.0", @@ -2191,6 +2209,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/credential-provider-env": "3.696.0", "@aws-sdk/credential-provider-http": "3.696.0", @@ -2213,6 +2232,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2229,6 +2249,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/client-sso": "3.696.0", "@aws-sdk/core": "3.696.0", @@ -2247,6 +2268,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2265,6 +2287,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/protocol-http": "^4.1.7", @@ -2279,6 +2302,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/types": "^3.7.1", @@ -2292,6 +2316,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/protocol-http": "^4.1.7", @@ -2306,6 +2331,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/core": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2323,6 +2349,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/node-config-provider": "^3.1.11", @@ -2339,6 +2366,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/property-provider": "^3.1.9", @@ -2357,6 +2385,7 @@ "version": "3.696.0", "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.696.0.tgz", "integrity": "sha512-9rTvUJIAj5d3//U5FDPWGJ1nFJLuWb30vugGOrWk7aNZ6y9tuA3PI7Cc9dP8WEXKVyK1vuuk8rSFP2iqXnlgrw==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2369,6 +2398,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/types": "^3.7.1", @@ -2383,6 +2413,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/types": "3.696.0", "@smithy/types": "^3.7.1", @@ -2394,6 +2425,7 @@ "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==", + "dev": true, "dependencies": { "@aws-sdk/middleware-user-agent": "3.696.0", "@aws-sdk/types": "3.696.0", @@ -2417,6 +2449,7 @@ "version": "3.1.8", "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.8.tgz", "integrity": "sha512-+3DOBcUn5/rVjlxGvUPKc416SExarAQ+Qe0bqk30YSUjbepwpS7QN0cyKUSifvLJhdMZ0WPzPP5ymut0oonrpQ==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2429,6 +2462,7 @@ "version": "3.0.12", "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.12.tgz", "integrity": "sha512-YAJP9UJFZRZ8N+UruTeq78zkdjUHmzsY62J4qKWZ4SXB4QXJ/+680EfXXgkYA2xj77ooMqtUY9m406zGNqwivQ==", + "dev": true, "dependencies": { "@smithy/node-config-provider": "^3.1.11", "@smithy/types": "^3.7.1", @@ -2444,6 +2478,7 @@ "version": "2.5.3", "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.5.3.tgz", "integrity": "sha512-96uW8maifUSmehaeW7uydWn7wBc98NEeNI3zN8vqakGpyCQgzyJaA64Z4FCOUmAdCJkhppd/7SZ798Fo4Xx37g==", + "dev": true, "dependencies": { "@smithy/middleware-serde": "^3.0.10", "@smithy/protocol-http": "^4.1.7", @@ -2462,6 +2497,7 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.7.tgz", "integrity": "sha512-cEfbau+rrWF8ylkmmVAObOmjbTIzKyUC5TkBL58SbLywD0RCBC4JAUKbmtSm2w5KUJNRPGgpGFMvE2FKnuNlWQ==", + "dev": true, "dependencies": { "@smithy/node-config-provider": "^3.1.11", "@smithy/property-provider": "^3.1.10", @@ -2477,6 +2513,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/protocol-http": "^4.1.7", "@smithy/querystring-builder": "^3.0.10", @@ -2489,6 +2526,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.10.tgz", "integrity": "sha512-3zWGWCHI+FlJ5WJwx73Mw2llYR8aflVyZN5JhoqLxbdPZi6UyKSdCeXAWJw9ja22m6S6Tzz1KZ+kAaSwvydi0g==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "@smithy/util-buffer-from": "^3.0.0", @@ -2503,6 +2541,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.10.tgz", "integrity": "sha512-Lp2L65vFi+cj0vFMu2obpPW69DU+6O5g3086lmI4XcnRCG8PxvpWC7XyaVwJCxsZFzueHjXnrOH/E0pl0zikfA==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2512,6 +2551,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2523,6 +2563,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/protocol-http": "^4.1.7", "@smithy/types": "^3.7.1", @@ -2536,6 +2577,7 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.2.3.tgz", "integrity": "sha512-Hdl9296i/EMptaX7agrSzJZDiz5Y8XPUeBbctTmMtnCguGpqfU3jVsTUan0VLaOhsnquqWLL8Bl5HrlbVGT1og==", + "dev": true, "dependencies": { "@smithy/core": "^2.5.3", "@smithy/middleware-serde": "^3.0.10", @@ -2554,6 +2596,7 @@ "version": "3.0.27", "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.27.tgz", "integrity": "sha512-H3J/PjJpLL7Tt+fxDKiOD25sMc94YetlQhCnYeNmina2LZscAdu0ZEZPas/kwePHABaEtqp7hqa5S4UJgMs1Tg==", + "dev": true, "dependencies": { "@smithy/node-config-provider": "^3.1.11", "@smithy/protocol-http": "^4.1.7", @@ -2573,6 +2616,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.10.tgz", "integrity": "sha512-MnAuhh+dD14F428ubSJuRnmRsfOpxSzvRhaGVTvd/lrUDE3kxzCCmH8lnVTvoNQnV2BbJ4c15QwZ3UdQBtFNZA==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2585,6 +2629,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.10.tgz", "integrity": "sha512-grCHyoiARDBBGPyw2BeicpjgpsDFWZZxptbVKb3CRd/ZA15F/T6rZjCCuBUjJwdck1nwUuIxYtsS4H9DDpbP5w==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2597,6 +2642,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/property-provider": "^3.1.10", "@smithy/shared-ini-file-loader": "^3.1.11", @@ -2611,6 +2657,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.3.1.tgz", "integrity": "sha512-fr+UAOMGWh6bn4YSEezBCpJn9Ukp9oR4D32sCjCo7U81evE11YePOQ58ogzyfgmjIO79YeOdfXXqr0jyhPQeMg==", + "dev": true, "dependencies": { "@smithy/abort-controller": "^3.1.8", "@smithy/protocol-http": "^4.1.7", @@ -2626,6 +2673,7 @@ "version": "3.1.10", "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.10.tgz", "integrity": "sha512-n1MJZGTorTH2DvyTVj+3wXnd4CzjJxyXeOgnTlgNVFxaaMeT4OteEp4QrzF8p9ee2yg42nvyVK6R/awLCakjeQ==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2638,6 +2686,7 @@ "version": "4.1.7", "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.7.tgz", "integrity": "sha512-FP2LepWD0eJeOTm0SjssPcgqAlDFzOmRXqXmGhfIM52G7Lrox/pcpQf6RP4F21k0+O12zaqQt5fCDOeBtqY6Cg==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2650,6 +2699,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.10.tgz", "integrity": "sha512-nT9CQF3EIJtIUepXQuBFb8dxJi3WVZS3XfuDksxSCSn+/CzZowRLdhDn+2acbBv8R6eaJqPupoI/aRFIImNVPQ==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "@smithy/util-uri-escape": "^3.0.0", @@ -2663,6 +2713,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.10.tgz", "integrity": "sha512-Oa0XDcpo9SmjhiDD9ua2UyM3uU01ZTuIrNdZvzwUTykW1PM8o2yJvMh1Do1rY5sUQg4NDV70dMi0JhDx4GyxuQ==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2675,6 +2726,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.10.tgz", "integrity": "sha512-zHe642KCqDxXLuhs6xmHVgRwy078RfqxP2wRDpIyiF8EmsWXptMwnMwbVa50lw+WOGNrYm9zbaEg0oDe3PTtvQ==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1" }, @@ -2686,6 +2738,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2698,6 +2751,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.2.3.tgz", "integrity": "sha512-pPSQQ2v2vu9vc8iew7sszLd0O09I5TRc5zhY71KA+Ao0xYazIG+uLeHbTJfIWGO3BGVLiXjUr3EEeCcEQLjpWQ==", + "dev": true, "dependencies": { "@smithy/is-array-buffer": "^3.0.0", "@smithy/protocol-http": "^4.1.7", @@ -2716,6 +2770,7 @@ "version": "3.4.4", "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.4.4.tgz", "integrity": "sha512-dPGoJuSZqvirBq+yROapBcHHvFjChoAQT8YPWJ820aPHHiowBlB3RL1Q4kPT1hx0qKgJuf+HhyzKi5Gbof4fNA==", + "dev": true, "dependencies": { "@smithy/core": "^2.5.3", "@smithy/middleware-endpoint": "^3.2.3", @@ -2733,6 +2788,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2744,6 +2800,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.10.tgz", "integrity": "sha512-j90NUalTSBR2NaZTuruEgavSdh8MLirf58LoGSk4AtQfyIymogIhgnGUU2Mga2bkMkpSoC9gxb74xBXL5afKAQ==", + "dev": true, "dependencies": { "@smithy/querystring-parser": "^3.0.10", "@smithy/types": "^3.7.1", @@ -2754,6 +2811,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", + "dev": true, "dependencies": { "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-utf8": "^3.0.0", @@ -2767,6 +2825,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" } @@ -2775,6 +2834,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2786,6 +2846,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" @@ -2798,6 +2859,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2809,6 +2871,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/property-provider": "^3.1.10", "@smithy/smithy-client": "^3.4.4", @@ -2824,6 +2887,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/config-resolver": "^3.0.12", "@smithy/credential-provider-imds": "^3.2.7", @@ -2841,6 +2905,7 @@ "version": "2.1.6", "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.6.tgz", "integrity": "sha512-mFV1t3ndBh0yZOJgWxO9J/4cHZVn5UG1D8DeCc6/echfNkeEJWu9LD7mgGH5fHrEdR7LDoWw7PQO6QiGpHXhgA==", + "dev": true, "dependencies": { "@smithy/node-config-provider": "^3.1.11", "@smithy/types": "^3.7.1", @@ -2854,6 +2919,7 @@ "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==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2865,6 +2931,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.10.tgz", "integrity": "sha512-eJO+/+RsrG2RpmY68jZdwQtnfsxjmPxzMlQpnHKjFPwrYqvlcT+fHdT+ZVwcjlWSrByOhGr9Ff2GG17efc192A==", + "dev": true, "dependencies": { "@smithy/types": "^3.7.1", "tslib": "^2.6.2" @@ -2877,6 +2944,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.10.tgz", "integrity": "sha512-1l4qatFp4PiU6j7UsbasUHL2VU023NRB/gfaa1M0rDqVrRN4g3mCArLRyH3OuktApA4ye+yjWQHjdziunw2eWA==", + "dev": true, "dependencies": { "@smithy/service-error-classification": "^3.0.10", "@smithy/types": "^3.7.1", @@ -2890,6 +2958,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/fetch-http-handler": "^4.1.1", "@smithy/node-http-handler": "^3.3.1", @@ -2908,6 +2977,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", + "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2919,6 +2989,7 @@ "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==", + "dev": true, "dependencies": { "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" @@ -2931,6 +3002,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "dev": true, "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -52942,7 +53014,6 @@ "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", @@ -52951,6 +53022,7 @@ "typescript": "^5.0.2" }, "devDependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.696.0", "@eslint/eslintrc": "^2.1.4", "@eslint/js": "^8.57.1", "dotenv": "16.4.5", From 67d15f1d1025e896b5766f7fe4a67198477ce396 Mon Sep 17 00:00:00 2001 From: devportal-portalsandtools-github-bot Date: Wed, 4 Dec 2024 16:52:58 +0100 Subject: [PATCH 2/4] Update CHANGELOG and prepare next release (#1247) --- .changeset/big-zebras-eat.md | 5 ----- .changeset/dry-papayas-switch.md | 5 ----- .changeset/flat-walls-cough.md | 5 ----- .changeset/hungry-eels-stare.md | 5 ----- .changeset/many-pens-grab.md | 5 ----- .changeset/silly-geese-shop.md | 5 ----- .changeset/six-yaks-obey.md | 5 ----- .changeset/smooth-laws-do.md | 5 ----- .changeset/soft-socks-build.md | 5 ----- .changeset/stale-wombats-cover.md | 5 ----- .changeset/ten-trains-grin.md | 5 ----- apps/infrastructure/CHANGELOG.md | 12 ++++++++++++ apps/infrastructure/package.json | 2 +- apps/nextjs-website/CHANGELOG.md | 7 +++++++ apps/nextjs-website/package.json | 2 +- package-lock.json | 6 +++--- packages/active-campaign-client/CHANGELOG.md | 13 +++++++++++++ packages/active-campaign-client/package.json | 2 +- 18 files changed, 38 insertions(+), 61 deletions(-) delete mode 100644 .changeset/big-zebras-eat.md delete mode 100644 .changeset/dry-papayas-switch.md delete mode 100644 .changeset/flat-walls-cough.md delete mode 100644 .changeset/hungry-eels-stare.md delete mode 100644 .changeset/many-pens-grab.md delete mode 100644 .changeset/silly-geese-shop.md delete mode 100644 .changeset/six-yaks-obey.md delete mode 100644 .changeset/smooth-laws-do.md delete mode 100644 .changeset/soft-socks-build.md delete mode 100644 .changeset/stale-wombats-cover.md delete mode 100644 .changeset/ten-trains-grin.md diff --git a/.changeset/big-zebras-eat.md b/.changeset/big-zebras-eat.md deleted file mode 100644 index 4244d795f7..0000000000 --- a/.changeset/big-zebras-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"nextjs-website": minor ---- - -Fix related links and webinar codec diff --git a/.changeset/dry-papayas-switch.md b/.changeset/dry-papayas-switch.md deleted file mode 100644 index e52832ac15..0000000000 --- a/.changeset/dry-papayas-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"active-campaign-client": minor ---- - -Add handler for updating and deleting contact diff --git a/.changeset/flat-walls-cough.md b/.changeset/flat-walls-cough.md deleted file mode 100644 index e35e9653fe..0000000000 --- a/.changeset/flat-walls-cough.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"active-campaign-client": minor ---- - -Add package setup and the lambda function to add user to Active Campaign diff --git a/.changeset/hungry-eels-stare.md b/.changeset/hungry-eels-stare.md deleted file mode 100644 index 885647f4fb..0000000000 --- a/.changeset/hungry-eels-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"nextjs-website": minor ---- - -Add history to send query endpoint diff --git a/.changeset/many-pens-grab.md b/.changeset/many-pens-grab.md deleted file mode 100644 index cbc0f7d35a..0000000000 --- a/.changeset/many-pens-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"active-campaign-client": minor ---- - -Add handlers for create list and delete list on Active Campaign diff --git a/.changeset/silly-geese-shop.md b/.changeset/silly-geese-shop.md deleted file mode 100644 index a257302d65..0000000000 --- a/.changeset/silly-geese-shop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"infrastructure": minor ---- - -Implemented active campaign syncer infrastructure diff --git a/.changeset/six-yaks-obey.md b/.changeset/six-yaks-obey.md deleted file mode 100644 index 8d7db22d60..0000000000 --- a/.changeset/six-yaks-obey.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"infrastructure": patch ---- - -Fix img_src CSP directive to see also in Dev the images inserted using production's CMS diff --git a/.changeset/smooth-laws-do.md b/.changeset/smooth-laws-do.md deleted file mode 100644 index df459d6565..0000000000 --- a/.changeset/smooth-laws-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"infrastructure": patch ---- - -Added permissions to deploy the ac sync lambdas via GH actions diff --git a/.changeset/soft-socks-build.md b/.changeset/soft-socks-build.md deleted file mode 100644 index ee002d02e0..0000000000 --- a/.changeset/soft-socks-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"infrastructure": minor ---- - -Langfuse infrastructure implemented diff --git a/.changeset/stale-wombats-cover.md b/.changeset/stale-wombats-cover.md deleted file mode 100644 index bd6172cb1b..0000000000 --- a/.changeset/stale-wombats-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"active-campaign-client": minor ---- - -Refactor active campaign pacakge and create index file diff --git a/.changeset/ten-trains-grin.md b/.changeset/ten-trains-grin.md deleted file mode 100644 index 1951726bf8..0000000000 --- a/.changeset/ten-trains-grin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"active-campaign-client": patch ---- - -Removed axios, removed .env except than for the test, create new main handler to execute function in aws lambda diff --git a/apps/infrastructure/CHANGELOG.md b/apps/infrastructure/CHANGELOG.md index 278b5cf783..a34f895e62 100644 --- a/apps/infrastructure/CHANGELOG.md +++ b/apps/infrastructure/CHANGELOG.md @@ -1,5 +1,17 @@ # infrastructure +## 1.4.0 + +### Minor Changes + +- e1f67d6: Implemented active campaign syncer infrastructure +- e623940: Langfuse infrastructure implemented + +### Patch Changes + +- bbe33fc: Fix img_src CSP directive to see also in Dev the images inserted using production's CMS +- 94ca22c: Added permissions to deploy the ac sync lambdas via GH actions + ## 1.3.0 ### Minor Changes diff --git a/apps/infrastructure/package.json b/apps/infrastructure/package.json index 23c0fbb057..47276be978 100644 --- a/apps/infrastructure/package.json +++ b/apps/infrastructure/package.json @@ -1,5 +1,5 @@ { "name": "infrastructure", - "version": "1.3.0", + "version": "1.4.0", "private": true } diff --git a/apps/nextjs-website/CHANGELOG.md b/apps/nextjs-website/CHANGELOG.md index b4e15e6da9..b4cb6bad65 100644 --- a/apps/nextjs-website/CHANGELOG.md +++ b/apps/nextjs-website/CHANGELOG.md @@ -1,5 +1,12 @@ # nextjs-website +## 4.13.0 + +### Minor Changes + +- 7ac487f: Fix related links and webinar codec +- fe61351: Add history to send query endpoint + ## 4.12.0 ### Minor Changes diff --git a/apps/nextjs-website/package.json b/apps/nextjs-website/package.json index 75ca40b1c6..56c45d9b2a 100644 --- a/apps/nextjs-website/package.json +++ b/apps/nextjs-website/package.json @@ -1,6 +1,6 @@ { "name": "nextjs-website", - "version": "4.12.0", + "version": "4.13.0", "private": true, "scripts": { "download-docs": "./scripts/fetch-docs.sh docs/from-gitbook", diff --git a/package-lock.json b/package-lock.json index a0a960bbc6..d520543f04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,10 +58,10 @@ } }, "apps/infrastructure": { - "version": "1.3.0" + "version": "1.4.0" }, "apps/nextjs-website": { - "version": "4.12.0", + "version": "4.13.0", "dependencies": { "@apidevtools/swagger-parser": "^10.1.0", "@aws-amplify/auth": "^5.6.6", @@ -53012,7 +53012,7 @@ } }, "packages/active-campaign-client": { - "version": "0.1.1", + "version": "0.2.0", "dependencies": { "@types/aws-lambda": "^8.10.126", "@types/jest": "^29.5.1", diff --git a/packages/active-campaign-client/CHANGELOG.md b/packages/active-campaign-client/CHANGELOG.md index e3ef97d23b..a46830c935 100644 --- a/packages/active-campaign-client/CHANGELOG.md +++ b/packages/active-campaign-client/CHANGELOG.md @@ -1,5 +1,18 @@ # active-campaign-client +## 0.2.0 + +### Minor Changes + +- 3239223: Add handler for updating and deleting contact +- 07703f2: Add package setup and the lambda function to add user to Active Campaign +- 3197206: Add handlers for create list and delete list on Active Campaign +- c6a3f41: Refactor active campaign pacakge and create index file + +### Patch Changes + +- e725bb1: Removed axios, removed .env except than for the test, create new main handler to execute function in aws lambda + ## 0.1.1 ### Patch Changes diff --git a/packages/active-campaign-client/package.json b/packages/active-campaign-client/package.json index 385348bc3f..308850df00 100644 --- a/packages/active-campaign-client/package.json +++ b/packages/active-campaign-client/package.json @@ -1,6 +1,6 @@ { "name": "active-campaign-client", - "version": "0.1.1", + "version": "0.2.0", "description": "Implements ActiveCampaign API to add, update and delete Accounts and to add and update lists", "scripts": { "lint": "eslint src", From d1dae75e7aba1564cdb23efa68e971ff07589752 Mon Sep 17 00:00:00 2001 From: tommaso1 Date: Thu, 5 Dec 2024 09:26:43 +0100 Subject: [PATCH 3/4] [DEV-1983][DEV-1986] Add function to subscribe and unsubscribe contact from active campaign list (#1257) * Add function to subscribe and upsubscribe contact from active campaign list * Update packages/active-campaign-client/src/__tests__/handlers/manageListSubscription.test.ts Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> * Update packages/active-campaign-client/src/__tests__/handlers/manageListSubscription.test.ts Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> * Update packages/active-campaign-client/.env.example Co-authored-by: Marco Ponchia * pr comments --------- Co-authored-by: t Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> Co-authored-by: Marco Ponchia --- .changeset/plenty-parrots-attend.md | 5 ++ packages/active-campaign-client/.env.example | 2 + .../helpers/manageListSubscription.test.ts | 21 +++++++ .../src/clients/activeCampaignClient.ts | 23 ++++++- .../src/helpers/manageListSubscription.ts | 60 +++++++++++++++++++ .../src/types/listStatusPayload.ts | 4 +- 6 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 .changeset/plenty-parrots-attend.md create mode 100644 packages/active-campaign-client/src/__tests__/helpers/manageListSubscription.test.ts create mode 100644 packages/active-campaign-client/src/helpers/manageListSubscription.ts diff --git a/.changeset/plenty-parrots-attend.md b/.changeset/plenty-parrots-attend.md new file mode 100644 index 0000000000..2dca24136d --- /dev/null +++ b/.changeset/plenty-parrots-attend.md @@ -0,0 +1,5 @@ +--- +"active-campaign-client": minor +--- + +Add function to subscribe and upsubscribe contact from active campaign list diff --git a/packages/active-campaign-client/.env.example b/packages/active-campaign-client/.env.example index eca72b4959..9127f4a182 100644 --- a/packages/active-campaign-client/.env.example +++ b/packages/active-campaign-client/.env.example @@ -3,3 +3,5 @@ AC_API_KEY=your_api_key SENDER_URL=localhost:3000 AWS_REGION="region" AWS_USER_POOL_ID="region_DFWF81fRa" +COGNITO_USER_ID=66ae52a0-f051-7080-04a1-465b3a4f44cc +LIST_NAME=test-webinar-1732097286071 \ No newline at end of file diff --git a/packages/active-campaign-client/src/__tests__/helpers/manageListSubscription.test.ts b/packages/active-campaign-client/src/__tests__/helpers/manageListSubscription.test.ts new file mode 100644 index 0000000000..a49abb0dd2 --- /dev/null +++ b/packages/active-campaign-client/src/__tests__/helpers/manageListSubscription.test.ts @@ -0,0 +1,21 @@ +// remove .skip to run the test, be aware it does real API calls +import { + addContactToList, + removeContactToList, +} from '../../helpers/manageListSubscription'; + +describe.skip('manage list subscription', () => { + const cognitoUserId = process.env.COGNITO_USER_ID || ''; + const listName = process.env.LIST_NAME || ''; + + it('should subscribe the contact to the list', async () => { + const result = await addContactToList(cognitoUserId, listName); + + expect(result.statusCode).toBe(200); + }); + + it('should unsubscribe the contact from the list', async () => { + const result = await removeContactToList(cognitoUserId, listName); + expect(result.statusCode).toBe(200); + }); +}); diff --git a/packages/active-campaign-client/src/clients/activeCampaignClient.ts b/packages/active-campaign-client/src/clients/activeCampaignClient.ts index ed3beb1301..b49aab7c46 100644 --- a/packages/active-campaign-client/src/clients/activeCampaignClient.ts +++ b/packages/active-campaign-client/src/clients/activeCampaignClient.ts @@ -1,6 +1,7 @@ import * as https from 'https'; import { ContactPayload } from '../types/contactPayload'; import { ListPayload } from '../types/listPayload'; +import { ListStatusPayload } from '../types/listStatusPayload'; export class ActiveCampaignClient { private readonly baseUrl: string; @@ -22,7 +23,7 @@ export class ActiveCampaignClient { private async makeRequest( method: string, path: string, - data?: ContactPayload | ListPayload, + data?: ContactPayload | ListPayload | ListStatusPayload, params?: Record ): Promise { return new Promise((resolve, reject) => { @@ -111,6 +112,26 @@ export class ActiveCampaignClient { async deleteList(id: number) { return this.makeRequest('DELETE', `/api/3/lists/${id}`); } + + async addContactToList(contactId: string, listId: number) { + return this.makeRequest('POST', `/api/3/contactLists`, { + contactList: { + contact: contactId, + list: listId, + status: 1, // subscribe + }, + }); + } + + async removeContactFromList(contactId: string, listId: number) { + return this.makeRequest('POST', `/api/3/contactLists`, { + contactList: { + contact: contactId, + list: listId, + status: 2, // unsubscrbe + }, + }); + } } export const acClient = new ActiveCampaignClient( diff --git a/packages/active-campaign-client/src/helpers/manageListSubscription.ts b/packages/active-campaign-client/src/helpers/manageListSubscription.ts new file mode 100644 index 0000000000..fe610f656b --- /dev/null +++ b/packages/active-campaign-client/src/helpers/manageListSubscription.ts @@ -0,0 +1,60 @@ +import { APIGatewayProxyResult } from 'aws-lambda'; +import { acClient } from '../clients/activeCampaignClient'; + +export async function addContactToList( + cognitoId: string, + listName: string +): Promise { + try { + const contactId = await acClient.getContactByCognitoId(cognitoId); + if (!contactId) { + return { + statusCode: 404, + body: JSON.stringify({ message: 'Contact not found' }), + }; + } + + const listId = await acClient.getListIdByName(listName); + + const response = await acClient.addContactToList(contactId, listId); + return { + statusCode: 200, + body: JSON.stringify(response), + }; + } catch (error) { + console.error('Error:', error); + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } +} + +export async function removeContactToList( + cognitoId: string, + listName: string +): Promise { + try { + const contactId = await acClient.getContactByCognitoId(cognitoId); + if (!contactId) { + return { + statusCode: 404, + body: JSON.stringify({ message: 'Contact not found' }), + }; + } + + const listId = await acClient.getListIdByName(listName); + + const response = await acClient.removeContactFromList(contactId, listId); + 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/types/listStatusPayload.ts b/packages/active-campaign-client/src/types/listStatusPayload.ts index 84b34131b8..009119b9ae 100644 --- a/packages/active-campaign-client/src/types/listStatusPayload.ts +++ b/packages/active-campaign-client/src/types/listStatusPayload.ts @@ -1,7 +1,7 @@ export type ListStatusPayload = { readonly contactList: { - readonly list: string; + readonly list: number; readonly contact: string; - readonly status: string; + readonly status: number; }; }; From b9003b60182a27dd558c0098a157cecdccedf4be Mon Sep 17 00:00:00 2001 From: Marco Ponchia Date: Thu, 5 Dec 2024 09:48:17 +0100 Subject: [PATCH 4/4] [DEV-2045] Refactor index and add queue event parser helper (#1259) * Add function to subscribe and upsubscribe contact from active campaign list * Update packages/active-campaign-client/src/__tests__/handlers/manageListSubscription.test.ts Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> * Update packages/active-campaign-client/src/__tests__/handlers/manageListSubscription.test.ts Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> * Refactor index and add queue event parser helper * Update packages/active-campaign-client/.env.example Co-authored-by: Marco Ponchia * pr comments * Connect webinar events to active campaign endpoint * Fix console log --------- Co-authored-by: t Co-authored-by: tommaso1 Co-authored-by: marcobottaro <39835990+marcobottaro@users.noreply.github.com> --- .../listUsersCommandOutputToUser.test.ts | 2 +- .../helpers/queueEventParser.test.ts | 216 ++++++++++++++++++ .../src/handlers/sqsQueueHandler.ts | 46 ++++ .../src/helpers/queueEventParser.ts | 33 +++ packages/active-campaign-client/src/index.ts | 40 +--- .../src/types/queueEvent.ts | 5 +- 6 files changed, 305 insertions(+), 37 deletions(-) create mode 100644 packages/active-campaign-client/src/__tests__/helpers/queueEventParser.test.ts create mode 100644 packages/active-campaign-client/src/handlers/sqsQueueHandler.ts create mode 100644 packages/active-campaign-client/src/helpers/queueEventParser.ts diff --git a/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts b/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts index a2ab058139..d52071522e 100644 --- a/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts +++ b/packages/active-campaign-client/src/__tests__/helpers/listUsersCommandOutputToUser.test.ts @@ -61,7 +61,7 @@ const listUsersCommandOutput: ListUsersCommandOutput = { ], }; -describe('addContact handler', () => { +describe('Helpers: listUsersCommandOutputToUser', () => { it('should properly convert ListUsersCommandOutput to User', async () => { const user = listUsersCommandOutputToUser(listUsersCommandOutput); const expectedUser: User = { diff --git a/packages/active-campaign-client/src/__tests__/helpers/queueEventParser.test.ts b/packages/active-campaign-client/src/__tests__/helpers/queueEventParser.test.ts new file mode 100644 index 0000000000..37db2c381d --- /dev/null +++ b/packages/active-campaign-client/src/__tests__/helpers/queueEventParser.test.ts @@ -0,0 +1,216 @@ +import { queueEventParser } from '../../helpers/queueEventParser'; +import { QueueEvent, QueueEventType } from '../../types/queueEvent'; + +const MOCK_WEBINAR_ID = 'webinar-id'; +const MOCK_COGNITO_ID = 'c67ec280-799a-40d6-b398-2a2b31aefbbd'; + +const generateMockBody = (eventName?: QueueEventType, webinarId?: string) => { + const webinarData = webinarId ? { webinarId } : {}; + return { + ...webinarData, + version: '0', + id: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + 'detail-type': 'AWS API Call via CloudTrail', + source: 'aws.cognito-idp', + account: '99999999999', + time: '2024-11-25T13:34:12Z', + region: 'region', + resources: [], + detail: { + eventVersion: '1.08', + userIdentity: { + type: 'Unknown', + principalId: 'Anonymous', + }, + eventTime: '2024-11-25T13:34:12Z', + eventSource: 'cognito-idp.amazonaws.com', + eventName: `${eventName || 'Unknown'}`, + awsRegion: 'region', + sourceIPAddress: '1.1.1.1', + userAgent: + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', + requestParameters: { + userAttributes: 'HIDDEN_DUE_TO_SECURITY_REASONS', + accessToken: 'HIDDEN_DUE_TO_SECURITY_REASONS', + }, + responseElements: null, + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + requestID: 'c67ec280-799a-40d6-b398-2a2b31aefbbd', + eventID: '1b231015-853a-4042-a157-4127a9ec5530', + readOnly: false, + eventType: 'AwsApiCall', + managementEvent: true, + recipientAccountId: '999999999', + eventCategory: 'Management', + tlsDetails: { + tlsVersion: 'TLSv1.3', + cipherSuite: 'TLS_AES_128_GCM_SHA256', + clientProvidedHostHeader: 'clientProvidedHostHeader', + }, + }, + }; +}; + +const generateSQSMockEvent = (params?: { + readonly eventType?: QueueEventType; + readonly webinarId?: string; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + readonly customBody?: Record; +}) => ({ + Records: [ + { + messageId: '983ad1cf-e06a-4393-8382-e51af60c4f58', + receiptHandle: 'receiptHandle', + body: JSON.stringify( + params?.customBody || + generateMockBody(params?.eventType, params?.webinarId) + ), + attributes: { + ApproximateReceiveCount: '1', + SentTimestamp: '99999999', + SequenceNumber: '1245', + MessageGroupId: 'userEvents', + SenderId: 'SenderId', + MessageDeduplicationId: 'MessageDeduplicationId', + ApproximateFirstReceiveTimestamp: '99999999', + }, + messageAttributes: {}, + md5OfBody: 'sdf1df457fg71d5sf1dfsd7', + eventSource: 'aws:sqs', + eventSourceARN: 'eventSourceARN', + awsRegion: 'awsRegion', + }, + ], +}); + +describe('Helpers: queueEventParser', () => { + it('should rise an error if event is different from QueueEventType', async () => { + const sqsEvent = generateSQSMockEvent(); + expect(() => { + queueEventParser(sqsEvent); + }).toThrow('Event missing required fields'); + }); + + it('should rise an error if body is not a valid JSON', async () => { + const sqsEvent = generateSQSMockEvent(); + expect(() => { + queueEventParser(sqsEvent); + }).toThrow('Event missing required fields'); + }); + + it('should properly convert UpdateUserAttributes event', async () => { + const sqsEvent = generateSQSMockEvent({ + eventType: 'UpdateUserAttributes', + }); + const parsedQueueEvent = queueEventParser(sqsEvent); + const queueEvent: QueueEvent = { + detail: { + eventName: 'UpdateUserAttributes', + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + }, + }; + expect(parsedQueueEvent.detail.eventName).toEqual( + queueEvent.detail.eventName + ); + expect(parsedQueueEvent.detail.additionalEventData.sub).toEqual( + queueEvent.detail.additionalEventData.sub + ); + }); + + it('should properly convert DeleteUser event', async () => { + const sqsEvent = generateSQSMockEvent({ eventType: 'DeleteUser' }); + const parsedQueueEvent = queueEventParser(sqsEvent); + const queueEvent: QueueEvent = { + detail: { + eventName: 'DeleteUser', + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + }, + }; + expect(parsedQueueEvent.detail.eventName).toEqual( + queueEvent.detail.eventName + ); + expect(parsedQueueEvent.detail.additionalEventData.sub).toEqual( + queueEvent.detail.additionalEventData.sub + ); + }); + + it('should properly convert ConfirmSignUp event', async () => { + const sqsEvent = generateSQSMockEvent({ eventType: 'ConfirmSignUp' }); + const parsedQueueEvent = queueEventParser(sqsEvent); + const queueEvent: QueueEvent = { + detail: { + eventName: 'ConfirmSignUp', + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + }, + }; + expect(parsedQueueEvent.detail.eventName).toEqual( + queueEvent.detail.eventName + ); + expect(parsedQueueEvent.detail.additionalEventData.sub).toEqual( + queueEvent.detail.additionalEventData.sub + ); + }); + + it('should properly convert DynamoINSERT event', async () => { + const sqsEvent = generateSQSMockEvent({ + eventType: 'DynamoINSERT', + webinarId: MOCK_WEBINAR_ID, + }); + const parsedQueueEvent = queueEventParser(sqsEvent); + const queueEvent: QueueEvent = { + detail: { + eventName: 'DynamoINSERT', + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + }, + webinarId: MOCK_WEBINAR_ID, + }; + expect(parsedQueueEvent.detail.eventName).toEqual( + queueEvent.detail.eventName + ); + expect(parsedQueueEvent.detail.additionalEventData.sub).toEqual( + queueEvent.detail.additionalEventData.sub + ); + expect(parsedQueueEvent.webinarId).toEqual(queueEvent.webinarId); + }); + + it('should properly convert DynamoREMOVE event', async () => { + const sqsEvent = generateSQSMockEvent({ + eventType: 'DynamoREMOVE', + webinarId: MOCK_WEBINAR_ID, + }); + const parsedQueueEvent = queueEventParser(sqsEvent); + const queueEvent: QueueEvent = { + detail: { + eventName: 'DynamoREMOVE', + additionalEventData: { + sub: MOCK_COGNITO_ID, + }, + }, + webinarId: MOCK_WEBINAR_ID, + }; + expect(parsedQueueEvent.detail.eventName).toEqual( + queueEvent.detail.eventName + ); + expect(parsedQueueEvent.detail.additionalEventData.sub).toEqual( + queueEvent.detail.additionalEventData.sub + ); + expect(parsedQueueEvent.webinarId).toEqual(queueEvent.webinarId); + }); + + it('should rise an error if webinar id is missing for Dynamo event', async () => { + const sqsEvent = generateSQSMockEvent({ eventType: 'DynamoREMOVE' }); + expect(() => { + queueEventParser(sqsEvent); + }).toThrow('Event missing required fields'); + }); +}); diff --git a/packages/active-campaign-client/src/handlers/sqsQueueHandler.ts b/packages/active-campaign-client/src/handlers/sqsQueueHandler.ts new file mode 100644 index 0000000000..3522ef77fb --- /dev/null +++ b/packages/active-campaign-client/src/handlers/sqsQueueHandler.ts @@ -0,0 +1,46 @@ +import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; +import { getUserFromCognito } from '../helpers/getUserFromCognito'; +import { addContact } from '../helpers/addContact'; +import { updateContact } from '../helpers/updateContact'; +import { deleteContact } from '../helpers/deleteContact'; +import { queueEventParser } from '../helpers/queueEventParser'; +import { + addContactToList, + removeContactToList, +} from '../helpers/manageListSubscription'; + +export async function sqsQueueHandler(event: { + readonly Records: SQSEvent['Records']; +}): Promise { + try { + console.log('Event:', event); // TODO: Remove after testing + const queueEvent = queueEventParser(event); + 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); + case 'DynamoINSERT': + return await addContactToList( + queueEvent.detail.additionalEventData.sub, + queueEvent.webinarId || '' + ); + case 'DynamoREMOVE': + return await removeContactToList( + queueEvent.detail.additionalEventData.sub, + queueEvent.webinarId || '' + ); + default: + // eslint-disable-next-line functional/no-throw-statements + throw new Error('Unknown event'); + } + } catch (error) { + console.error('Error:', error); // TODO: Remove after testing + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }), + }; + } +} diff --git a/packages/active-campaign-client/src/helpers/queueEventParser.ts b/packages/active-campaign-client/src/helpers/queueEventParser.ts new file mode 100644 index 0000000000..0b9ae8b8cb --- /dev/null +++ b/packages/active-campaign-client/src/helpers/queueEventParser.ts @@ -0,0 +1,33 @@ +import { SQSEvent } from 'aws-lambda'; +import { QueueEvent, QueueEventType } from '../types/queueEvent'; + +const queueEvents: readonly QueueEventType[] = [ + 'ConfirmSignUp', + 'UpdateUserAttributes', + 'DeleteUser', + 'DynamoINSERT', + 'DynamoREMOVE', +]; + +const dynamoEvents: readonly QueueEventType[] = [ + 'DynamoINSERT', + 'DynamoREMOVE', +]; + +export function queueEventParser(event: { + readonly Records: SQSEvent['Records']; +}): QueueEvent { + const queueEvent = JSON.parse(event.Records[0].body) as unknown as QueueEvent; + + if ( + !queueEvents.includes(queueEvent.detail.eventName) || + !queueEvent.detail.additionalEventData.sub || + (dynamoEvents.includes(queueEvent.detail.eventName) && + !queueEvent.webinarId) + ) { + // eslint-disable-next-line functional/no-throw-statements + throw new Error('Event missing required fields'); + } + + return queueEvent; +} diff --git a/packages/active-campaign-client/src/index.ts b/packages/active-campaign-client/src/index.ts index a3d2e6fa5e..0d1edb3b65 100644 --- a/packages/active-campaign-client/src/index.ts +++ b/packages/active-campaign-client/src/index.ts @@ -1,38 +1,8 @@ -import { APIGatewayProxyResult, SQSEvent } from 'aws-lambda'; -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'; +import { SQSEvent } from 'aws-lambda'; +import { sqsQueueHandler } from './handlers/sqsQueueHandler'; -export async function handler(event: { +export async function sqsQueue(event: { readonly Records: SQSEvent['Records']; -}): Promise { - 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' }), - }; - } +}) { + return await sqsQueueHandler(event); } diff --git a/packages/active-campaign-client/src/types/queueEvent.ts b/packages/active-campaign-client/src/types/queueEvent.ts index aee4519189..df216bc813 100644 --- a/packages/active-campaign-client/src/types/queueEvent.ts +++ b/packages/active-campaign-client/src/types/queueEvent.ts @@ -1,7 +1,9 @@ export type QueueEventType = | 'UpdateUserAttributes' | 'DeleteUser' - | 'ConfirmSignUp'; + | 'ConfirmSignUp' + | 'DynamoINSERT' + | 'DynamoREMOVE'; export type QueueEvent = { readonly detail: { @@ -10,4 +12,5 @@ export type QueueEvent = { readonly sub: string; }; }; + readonly webinarId?: string; };