Skip to content

Commit 889b4fc

Browse files
authored
Merge pull request #739 from chaynHQ/develop
Merge Develop onto Main
2 parents b9d95ad + b91ed2a commit 889b4fc

File tree

7 files changed

+46
-36
lines changed

7 files changed

+46
-36
lines changed

.github/workflows/community-issue-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Issue Comment Workflows
1010

1111
on:
1212
workflow_run:
13-
workflows: [Label Stale Contributions]
13+
workflows: ["Label Stale Contributions"]
1414
types:
1515
- completed
1616
issues:

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@nestjs/axios": "^3.0.3",
3434
"@nestjs/common": "^10.4.13",
3535
"@nestjs/config": "^3.3.0",
36-
"@nestjs/core": "^10.4.4",
36+
"@nestjs/core": "^10.4.15",
3737
"@nestjs/platform-express": "^10.4.12",
3838
"@nestjs/swagger": "^7.4.0",
3939
"@nestjs/terminus": "^10.2.3",
@@ -49,12 +49,12 @@
4949
"lodash": "^4.17.21",
5050
"newrelic": "^12.5.1",
5151
"pg": "^8.11.5",
52-
"pg-connection-string": "^2.6.4",
52+
"pg-connection-string": "^2.7.0",
5353
"reflect-metadata": "^0.2.1",
5454
"rimraf": "^6.0.1",
5555
"rollbar": "^2.26.4",
5656
"rxjs": "^7.8.1",
57-
"storyblok-js-client": "^6.9.2",
57+
"storyblok-js-client": "^6.10.6",
5858
"typeorm": "^0.3.20"
5959
},
6060
"devDependencies": {
@@ -67,7 +67,7 @@
6767
"@types/express": "^5.0.0",
6868
"@types/jest": "^29.5.13",
6969
"@types/lodash": "^4.17.13",
70-
"@types/node": "^22.8.1",
70+
"@types/node": "^22.10.1",
7171
"@types/supertest": "^6.0.2",
7272
"eslint": "^9.14.0",
7373
"eslint-config-prettier": "^9.1.0",

src/api/mailchimp/mailchimp-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const createMailchimpProfile = async (
3232
try {
3333
return await mailchimp.lists.addListMember(mailchimpAudienceId, profileData);
3434
} catch (error) {
35-
throw new Error(`Create mailchimp profile API call failed: ${error}`);
35+
throw new Error(`Create mailchimp profile API call failed: ${JSON.stringify(error)}`);
3636
}
3737
};
3838

src/crisp/crisp.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,9 @@ export class CrispService {
101101
email: string,
102102
): Promise<CrispProfileDataResponse> {
103103
try {
104-
const crispPeopleData = CrispClient.website.updatePeopleData(
105-
crispWebsiteId,
106-
email,
107-
peopleData,
108-
);
104+
const crispPeopleData = CrispClient.website.updatePeopleData(crispWebsiteId, email, {
105+
data: peopleData,
106+
});
109107
return crispPeopleData;
110108
} catch (error) {
111109
throw new Error(`Update crisp profile API call failed: ${error}`);

src/service-user-profiles/service-user-profiles.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ export class ServiceUserProfilesService {
238238
// UPDATE THE FILTERS to the current requirements
239239
public async bulkUploadMailchimpProfiles() {
240240
try {
241-
const filterStartDate = '2023-01-01'; // UPDATE
242-
const filterEndDate = '2024-01-01'; // UPDATE
241+
const filterStartDate = '2024-10-29'; // UPDATE
242+
const filterEndDate = '2025-01-06'; // UPDATE
243243
const users = await this.userRepository.find({
244244
where: {
245245
// UPDATE TO ANY FILTERS

src/user/user.controller.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiTags } from '@nestjs
1414
import { Request } from 'express';
1515
import { UserEntity } from 'src/entities/user.entity';
1616
import { SuperAdminAuthGuard } from 'src/partner-admin/super-admin-auth.guard';
17+
import { ServiceUserProfilesService } from 'src/service-user-profiles/service-user-profiles.service';
1718
import { formatUserObject } from 'src/utils/serialize';
1819
import { FirebaseAuthGuard } from '../firebase/firebase-auth.guard';
1920
import { ControllerDecorator } from '../utils/controller.decorator';
@@ -27,7 +28,10 @@ import { UserService } from './user.service';
2728
@ControllerDecorator()
2829
@Controller('/v1/user')
2930
export class UserController {
30-
constructor(private readonly userService: UserService) {}
31+
constructor(
32+
private readonly userService: UserService,
33+
private readonly serviceUserProfilesService: ServiceUserProfilesService,
34+
) {}
3135

3236
@Post()
3337
@ApiOperation({
@@ -105,4 +109,12 @@ export class UserController {
105109
const users = await this.userService.getUsers(userQuery, include || [], fields, limit);
106110
return users.map((u) => formatUserObject(u));
107111
}
112+
113+
@ApiBearerAuth()
114+
@Get('/bulk-upload-mailchimp-profiles')
115+
@UseGuards(SuperAdminAuthGuard)
116+
async bulkUploadMailchimpProfiles() {
117+
await this.serviceUserProfilesService.bulkUploadMailchimpProfiles();
118+
return 'ok';
119+
}
108120
}

yarn.lock

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,17 +1285,17 @@
12851285
dotenv-expand "10.0.0"
12861286
lodash "4.17.21"
12871287

1288-
"@nestjs/core@^10.4.4":
1289-
version "10.4.4"
1290-
resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-10.4.4.tgz#12cb1110da6d76e12ceccf0e92f6f5220fe27525"
1291-
integrity sha512-y9tjmAzU6LTh1cC/lWrRsCcOd80khSR0qAHAqwY2svbW+AhsR/XCzgpZrAAKJrm/dDfjLCZKyxJSayeirGcW5Q==
1288+
"@nestjs/core@^10.4.15":
1289+
version "10.4.15"
1290+
resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-10.4.15.tgz#1343a3395d5c54e9b792608cb75eef39053806d5"
1291+
integrity sha512-UBejmdiYwaH6fTsz2QFBlC1cJHM+3UDeLZN+CiP9I1fRv2KlBZsmozGLbV5eS1JAVWJB4T5N5yQ0gjN8ZvcS2w==
12921292
dependencies:
12931293
uid "2.0.2"
12941294
"@nuxtjs/opencollective" "0.3.2"
12951295
fast-safe-stringify "2.1.1"
12961296
iterare "1.2.1"
12971297
path-to-regexp "3.3.0"
1298-
tslib "2.7.0"
1298+
tslib "2.8.1"
12991299

13001300
13011301
version "2.0.5"
@@ -1792,12 +1792,12 @@
17921792
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
17931793
integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==
17941794

1795-
"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^22.8.1":
1796-
version "22.8.1"
1797-
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.1.tgz#b39d4b98165e2ae792ce213f610c7c6108ccfa16"
1798-
integrity sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==
1795+
"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^22.10.1":
1796+
version "22.10.1"
1797+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766"
1798+
integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==
17991799
dependencies:
1800-
undici-types "~6.19.8"
1800+
undici-types "~6.20.0"
18011801

18021802
"@types/node@^10.0.3":
18031803
version "10.17.60"
@@ -5834,10 +5834,10 @@ pg-cloudflare@^1.1.1:
58345834
resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz#e6d5833015b170e23ae819e8c5d7eaedb472ca98"
58355835
integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==
58365836

5837-
pg-connection-string@^2.6.4:
5838-
version "2.6.4"
5839-
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.6.4.tgz#f543862adfa49fa4e14bc8a8892d2a84d754246d"
5840-
integrity sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==
5837+
pg-connection-string@^2.6.4, pg-connection-string@^2.7.0:
5838+
version "2.7.0"
5839+
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.7.0.tgz#f1d3489e427c62ece022dba98d5262efcb168b37"
5840+
integrity sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==
58415841

58425842
58435843
version "1.0.1"
@@ -6575,10 +6575,10 @@ [email protected]:
65756575
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
65766576
integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
65776577

6578-
storyblok-js-client@^6.9.2:
6579-
version "6.9.2"
6580-
resolved "https://registry.yarnpkg.com/storyblok-js-client/-/storyblok-js-client-6.9.2.tgz#af37c6f8ea0968603e4fcccac01228b715a8439c"
6581-
integrity sha512-31GM5X/SIP4eJsSMCpAnaPDRmmUotSSWD3Umnuzf3CGqjyakot2Gv5QmuV23fRM7TCDUQlg5wurROmAzkKMKKg==
6578+
storyblok-js-client@^6.10.6:
6579+
version "6.10.6"
6580+
resolved "https://registry.yarnpkg.com/storyblok-js-client/-/storyblok-js-client-6.10.6.tgz#951bd131ae8db34e1b8e67e1ee41f2c5e0da5dbb"
6581+
integrity sha512-4n/n6tkLu3kmZwb2aSZgwqGta8DodbQbGjuclWY+A6xsmrVWrRBytUs+5lvJVTGkshLflVPhufeO4j/1zvVSPQ==
65826582

65836583
stream-events@^1.0.5:
65846584
version "1.0.5"
@@ -7137,10 +7137,10 @@ undici-types@~5.26.4:
71377137
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
71387138
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
71397139

7140-
undici-types@~6.19.8:
7141-
version "6.19.8"
7142-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
7143-
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
7140+
undici-types@~6.20.0:
7141+
version "6.20.0"
7142+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433"
7143+
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
71447144

71457145
71467146
version "5.28.4"

0 commit comments

Comments
 (0)