From 4fa6184e217ac56d10ed875d1d500cd4ef33a127 Mon Sep 17 00:00:00 2001 From: Kylee Fields <43586156+kyleecodes@users.noreply.github.com> Date: Sun, 5 Jan 2025 21:28:00 -0500 Subject: [PATCH 1/7] Actions: Update community-issue-comment.yml --- .github/workflows/community-issue-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/community-issue-comment.yml b/.github/workflows/community-issue-comment.yml index 40f6e8cd..4d6ba8fc 100644 --- a/.github/workflows/community-issue-comment.yml +++ b/.github/workflows/community-issue-comment.yml @@ -10,7 +10,7 @@ name: Issue Comment Workflows on: workflow_run: - workflows: [Label Stale Contributions] + workflows: ["Label Stale Contributions"] types: - completed issues: From 54c97b976a6d01ab938898c679ada3ffdea7e24a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:17:18 +0000 Subject: [PATCH 2/7] chore(deps): bump storyblok-js-client from 6.9.2 to 6.10.6 (#738) Bumps [storyblok-js-client](https://github.com/storyblok/storyblok-js-client) from 6.9.2 to 6.10.6. - [Release notes](https://github.com/storyblok/storyblok-js-client/releases) - [Changelog](https://github.com/storyblok/storyblok-js-client/blob/main/changelog.md) - [Commits](https://github.com/storyblok/storyblok-js-client/compare/v6.9.2...v6.10.6) --- updated-dependencies: - dependency-name: storyblok-js-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f1f8de2d..c3bafbd7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "rimraf": "^6.0.1", "rollbar": "^2.26.4", "rxjs": "^7.8.1", - "storyblok-js-client": "^6.9.2", + "storyblok-js-client": "^6.10.6", "typeorm": "^0.3.20" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 5315a84f..ae68ea69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6575,10 +6575,10 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -storyblok-js-client@^6.9.2: - version "6.9.2" - resolved "https://registry.yarnpkg.com/storyblok-js-client/-/storyblok-js-client-6.9.2.tgz#af37c6f8ea0968603e4fcccac01228b715a8439c" - integrity sha512-31GM5X/SIP4eJsSMCpAnaPDRmmUotSSWD3Umnuzf3CGqjyakot2Gv5QmuV23fRM7TCDUQlg5wurROmAzkKMKKg== +storyblok-js-client@^6.10.6: + version "6.10.6" + resolved "https://registry.yarnpkg.com/storyblok-js-client/-/storyblok-js-client-6.10.6.tgz#951bd131ae8db34e1b8e67e1ee41f2c5e0da5dbb" + integrity sha512-4n/n6tkLu3kmZwb2aSZgwqGta8DodbQbGjuclWY+A6xsmrVWrRBytUs+5lvJVTGkshLflVPhufeO4j/1zvVSPQ== stream-events@^1.0.5: version "1.0.5" From 409afb0eb6daa96df2796ce992bf5104c25a0091 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:17:29 +0000 Subject: [PATCH 3/7] chore(deps): bump pg-connection-string from 2.6.4 to 2.7.0 (#730) Bumps [pg-connection-string](https://github.com/brianc/node-postgres/tree/HEAD/packages/pg-connection-string) from 2.6.4 to 2.7.0. - [Changelog](https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md) - [Commits](https://github.com/brianc/node-postgres/commits/pg-connection-string@2.7.0/packages/pg-connection-string) --- updated-dependencies: - dependency-name: pg-connection-string dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c3bafbd7..98ad5d2c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "lodash": "^4.17.21", "newrelic": "^12.5.1", "pg": "^8.11.5", - "pg-connection-string": "^2.6.4", + "pg-connection-string": "^2.7.0", "reflect-metadata": "^0.2.1", "rimraf": "^6.0.1", "rollbar": "^2.26.4", diff --git a/yarn.lock b/yarn.lock index ae68ea69..67247216 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5834,10 +5834,10 @@ pg-cloudflare@^1.1.1: resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz#e6d5833015b170e23ae819e8c5d7eaedb472ca98" integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q== -pg-connection-string@^2.6.4: - version "2.6.4" - resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.6.4.tgz#f543862adfa49fa4e14bc8a8892d2a84d754246d" - integrity sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA== +pg-connection-string@^2.6.4, pg-connection-string@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.7.0.tgz#f1d3489e427c62ece022dba98d5262efcb168b37" + integrity sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA== pg-int8@1.0.1: version "1.0.1" From e443259c3e59bd62fc2b4b4b531445a03148192c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:17:44 +0000 Subject: [PATCH 4/7] chore(deps-dev): bump @types/node from 22.8.1 to 22.10.1 (#722) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.8.1 to 22.10.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Anna Hughes --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 98ad5d2c..687b6746 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@types/express": "^5.0.0", "@types/jest": "^29.5.13", "@types/lodash": "^4.17.13", - "@types/node": "^22.8.1", + "@types/node": "^22.10.1", "@types/supertest": "^6.0.2", "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", diff --git a/yarn.lock b/yarn.lock index 67247216..37a50497 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1792,12 +1792,12 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== -"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^22.8.1": - version "22.8.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.1.tgz#b39d4b98165e2ae792ce213f610c7c6108ccfa16" - integrity sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg== +"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^22.10.1": + version "22.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" + integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== dependencies: - undici-types "~6.19.8" + undici-types "~6.20.0" "@types/node@^10.0.3": version "10.17.60" @@ -7137,10 +7137,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.19.8: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== undici@5.28.4: version "5.28.4" From 069586d157d4b2b1e23d30ec1aad085e22730da4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:18:04 +0000 Subject: [PATCH 5/7] chore(deps): bump @nestjs/core from 10.4.4 to 10.4.15 (#729) Bumps [@nestjs/core](https://github.com/nestjs/nest/tree/HEAD/packages/core) from 10.4.4 to 10.4.15. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/commits/v10.4.15/packages/core) --- updated-dependencies: - dependency-name: "@nestjs/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 687b6746..59b5947e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@nestjs/axios": "^3.0.3", "@nestjs/common": "^10.4.13", "@nestjs/config": "^3.3.0", - "@nestjs/core": "^10.4.4", + "@nestjs/core": "^10.4.15", "@nestjs/platform-express": "^10.4.12", "@nestjs/swagger": "^7.4.0", "@nestjs/terminus": "^10.2.3", diff --git a/yarn.lock b/yarn.lock index 37a50497..cef4329f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1285,17 +1285,17 @@ dotenv-expand "10.0.0" lodash "4.17.21" -"@nestjs/core@^10.4.4": - version "10.4.4" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-10.4.4.tgz#12cb1110da6d76e12ceccf0e92f6f5220fe27525" - integrity sha512-y9tjmAzU6LTh1cC/lWrRsCcOd80khSR0qAHAqwY2svbW+AhsR/XCzgpZrAAKJrm/dDfjLCZKyxJSayeirGcW5Q== +"@nestjs/core@^10.4.15": + version "10.4.15" + resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-10.4.15.tgz#1343a3395d5c54e9b792608cb75eef39053806d5" + integrity sha512-UBejmdiYwaH6fTsz2QFBlC1cJHM+3UDeLZN+CiP9I1fRv2KlBZsmozGLbV5eS1JAVWJB4T5N5yQ0gjN8ZvcS2w== dependencies: uid "2.0.2" "@nuxtjs/opencollective" "0.3.2" fast-safe-stringify "2.1.1" iterare "1.2.1" path-to-regexp "3.3.0" - tslib "2.7.0" + tslib "2.8.1" "@nestjs/mapped-types@2.0.5": version "2.0.5" From deb1d56df62a3025d54c8db5d375276111c1f8be Mon Sep 17 00:00:00 2001 From: Anna Hughes Date: Mon, 6 Jan 2025 13:18:26 +0000 Subject: [PATCH 6/7] fix: crisp people data error (#740) --- src/api/mailchimp/mailchimp-api.ts | 2 +- src/crisp/crisp.service.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/mailchimp/mailchimp-api.ts b/src/api/mailchimp/mailchimp-api.ts index 06937b29..9c3561fe 100644 --- a/src/api/mailchimp/mailchimp-api.ts +++ b/src/api/mailchimp/mailchimp-api.ts @@ -32,7 +32,7 @@ export const createMailchimpProfile = async ( try { return await mailchimp.lists.addListMember(mailchimpAudienceId, profileData); } catch (error) { - throw new Error(`Create mailchimp profile API call failed: ${error}`); + throw new Error(`Create mailchimp profile API call failed: ${JSON.stringify(error)}`); } }; diff --git a/src/crisp/crisp.service.ts b/src/crisp/crisp.service.ts index fa4ba7dc..4079384c 100644 --- a/src/crisp/crisp.service.ts +++ b/src/crisp/crisp.service.ts @@ -101,11 +101,9 @@ export class CrispService { email: string, ): Promise { try { - const crispPeopleData = CrispClient.website.updatePeopleData( - crispWebsiteId, - email, - peopleData, - ); + const crispPeopleData = CrispClient.website.updatePeopleData(crispWebsiteId, email, { + data: peopleData, + }); return crispPeopleData; } catch (error) { throw new Error(`Update crisp profile API call failed: ${error}`); From b91ed2a819735fcbca9699902326c16314fb39b5 Mon Sep 17 00:00:00 2001 From: Anna Hughes Date: Mon, 6 Jan 2025 13:29:33 +0000 Subject: [PATCH 7/7] feat: mailchimp bulk upload route (#741) --- .../service-user-profiles.service.ts | 4 ++-- src/user/user.controller.ts | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/service-user-profiles/service-user-profiles.service.ts b/src/service-user-profiles/service-user-profiles.service.ts index ccc4d49c..0fa62a31 100644 --- a/src/service-user-profiles/service-user-profiles.service.ts +++ b/src/service-user-profiles/service-user-profiles.service.ts @@ -238,8 +238,8 @@ export class ServiceUserProfilesService { // UPDATE THE FILTERS to the current requirements public async bulkUploadMailchimpProfiles() { try { - const filterStartDate = '2023-01-01'; // UPDATE - const filterEndDate = '2024-01-01'; // UPDATE + const filterStartDate = '2024-10-29'; // UPDATE + const filterEndDate = '2025-01-06'; // UPDATE const users = await this.userRepository.find({ where: { // UPDATE TO ANY FILTERS diff --git a/src/user/user.controller.ts b/src/user/user.controller.ts index f0f6d124..30713ccb 100644 --- a/src/user/user.controller.ts +++ b/src/user/user.controller.ts @@ -14,6 +14,7 @@ import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiTags } from '@nestjs import { Request } from 'express'; import { UserEntity } from 'src/entities/user.entity'; import { SuperAdminAuthGuard } from 'src/partner-admin/super-admin-auth.guard'; +import { ServiceUserProfilesService } from 'src/service-user-profiles/service-user-profiles.service'; import { formatUserObject } from 'src/utils/serialize'; import { FirebaseAuthGuard } from '../firebase/firebase-auth.guard'; import { ControllerDecorator } from '../utils/controller.decorator'; @@ -27,7 +28,10 @@ import { UserService } from './user.service'; @ControllerDecorator() @Controller('/v1/user') export class UserController { - constructor(private readonly userService: UserService) {} + constructor( + private readonly userService: UserService, + private readonly serviceUserProfilesService: ServiceUserProfilesService, + ) {} @Post() @ApiOperation({ @@ -105,4 +109,12 @@ export class UserController { const users = await this.userService.getUsers(userQuery, include || [], fields, limit); return users.map((u) => formatUserObject(u)); } + + @ApiBearerAuth() + @Get('/bulk-upload-mailchimp-profiles') + @UseGuards(SuperAdminAuthGuard) + async bulkUploadMailchimpProfiles() { + await this.serviceUserProfilesService.bulkUploadMailchimpProfiles(); + return 'ok'; + } }