Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Develop onto Main #739

Merged
merged 7 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/community-issue-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Issue Comment Workflows

on:
workflow_run:
workflows: [Label Stale Contributions]
workflows: ["Label Stale Contributions"]
types:
- completed
issues:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -49,12 +49,12 @@
"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",
"rxjs": "^7.8.1",
"storyblok-js-client": "^6.9.2",
"storyblok-js-client": "^6.10.6",
"typeorm": "^0.3.20"
},
"devDependencies": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/api/mailchimp/mailchimp-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
}
};

Expand Down
8 changes: 3 additions & 5 deletions src/crisp/crisp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ export class CrispService {
email: string,
): Promise<CrispProfileDataResponse> {
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}`);
Expand Down
4 changes: 2 additions & 2 deletions src/service-user-profiles/service-user-profiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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({
Expand Down Expand Up @@ -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';
}
}
44 changes: 22 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]":
version "2.0.5"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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==

[email protected]:
version "1.0.1"
Expand Down Expand Up @@ -6575,10 +6575,10 @@ [email protected]:
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"
Expand Down Expand Up @@ -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==

[email protected]:
version "5.28.4"
Expand Down
Loading