@comet/brevo-api 2.1.1 → 2.1.2-canary-20241007102959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/brevo-contact/brevo-contact-import.console.d.ts.map +1 -1
- package/lib/brevo-contact/brevo-contact-import.console.js +10 -6
- package/lib/brevo-contact/brevo-contact-import.console.js.map +1 -1
- package/lib/brevo-contact/brevo-contact-import.controller.d.ts.map +1 -1
- package/lib/brevo-contact/brevo-contact-import.controller.js +13 -16
- package/lib/brevo-contact/brevo-contact-import.controller.js.map +1 -1
- package/lib/brevo-contact/brevo-contact-import.service.d.ts +26 -11
- package/lib/brevo-contact/brevo-contact-import.service.d.ts.map +1 -1
- package/lib/brevo-contact/brevo-contact-import.service.js +168 -75
- package/lib/brevo-contact/brevo-contact-import.service.js.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brevo-contact-import.console.d.ts","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.console.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAUlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAQvD,wBAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC,2BAA2B,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.console.d.ts","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.console.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAUlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAQvD,wBAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC,2BAA2B,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAgGtH"}
|
|
@@ -64,15 +64,19 @@ function createBrevoContactImportConsole({ Scope }) {
|
|
|
64
64
|
this.targetGroupRepository = targetGroupRepository;
|
|
65
65
|
this.logger = new common_1.Logger(BrevoContactImportConsole_1.name);
|
|
66
66
|
}
|
|
67
|
-
execute(
|
|
67
|
+
execute({ scope, path, targetGroupIds }) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const redirectUrl = this.config.brevo.resolveConfig(
|
|
70
|
-
const
|
|
71
|
-
if (!this.validateRedirectUrl(redirectUrl,
|
|
69
|
+
const redirectUrl = this.config.brevo.resolveConfig(scope).redirectUrlForImport;
|
|
70
|
+
const fileStream = fs.createReadStream(path);
|
|
71
|
+
if (!this.validateRedirectUrl(redirectUrl, scope)) {
|
|
72
72
|
throw new commander_1.InvalidOptionArgumentError("Invalid scope. Scope is not allowed");
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const result = yield this.brevoContactImportService.importContactsFromCsv({
|
|
75
|
+
fileStream,
|
|
76
|
+
scope,
|
|
77
|
+
redirectUrl,
|
|
78
|
+
targetGroupIds,
|
|
79
|
+
});
|
|
76
80
|
this.logger.log(result);
|
|
77
81
|
});
|
|
78
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brevo-contact-import.console.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.console.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAmF;AACnF,8CAAqD;AACrD,2CAAkE;AAClE,qDAAuD;AACvD,yCAAuD;AACvD,uCAAyB;AACzB,mDAAkD;AAElD,gGAA0F;AAE1F,6EAAuE;AAUvE,SAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAgD;;IACnG,IAEM,yBAAyB,iCAF/B,MAEM,yBAAyB;QAG3B,YACqB,GAAa,EACgB,MAAyB,EACtD,yBAAoD,EACnB,qBAA6D;YAH9F,QAAG,GAAH,GAAG,CAAU;YACgB,WAAM,GAAN,MAAM,CAAmB;YACtD,8BAAyB,GAAzB,yBAAyB,CAA2B;YACnB,0BAAqB,GAArB,qBAAqB,CAAwC;YANlG,WAAM,GAAG,IAAI,eAAM,CAAC,2BAAyB,CAAC,IAAI,CAAC,CAAC;QAOlE,CAAC;QAoDE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.console.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.console.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAmF;AACnF,8CAAqD;AACrD,2CAAkE;AAClE,qDAAuD;AACvD,yCAAuD;AACvD,uCAAyB;AACzB,mDAAkD;AAElD,gGAA0F;AAE1F,6EAAuE;AAUvE,SAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAgD;;IACnG,IAEM,yBAAyB,iCAF/B,MAEM,yBAAyB;QAG3B,YACqB,GAAa,EACgB,MAAyB,EACtD,yBAAoD,EACnB,qBAA6D;YAH9F,QAAG,GAAH,GAAG,CAAU;YACgB,WAAM,GAAN,MAAM,CAAmB;YACtD,8BAAyB,GAAzB,yBAAyB,CAA2B;YACnB,0BAAqB,GAArB,qBAAqB,CAAwC;YANlG,WAAM,GAAG,IAAI,eAAM,CAAC,2BAAyB,CAAC,IAAI,CAAC,CAAC;QAOlE,CAAC;QAoDE,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAkB;;gBACzD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC;gBAChF,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBAC7C,IAAI,CAAC,IAAI,C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","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.controller.d.ts","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,IAAI,EAAiC,MAAM,gBAAgB,CAAC;AAOrG,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,wBAAgB,kCAAkC,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC,2BAA2B,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CA6CzH"}
|
|
@@ -23,33 +23,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.createBrevoContactImportController = void 0;
|
|
25
25
|
const cms_api_1 = require("@comet/cms-api");
|
|
26
|
-
const core_1 = require("@mikro-orm/core");
|
|
27
|
-
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
28
26
|
const common_1 = require("@nestjs/common");
|
|
29
27
|
const platform_express_1 = require("@nestjs/platform-express");
|
|
28
|
+
const stream_1 = require("stream");
|
|
30
29
|
const brevo_contact_import_service_1 = require("../brevo-contact/brevo-contact-import.service");
|
|
31
30
|
const brevo_module_constants_1 = require("../config/brevo-module.constants");
|
|
32
31
|
function createBrevoContactImportController({ Scope }) {
|
|
33
32
|
let BrevoContactImportController = class BrevoContactImportController {
|
|
34
|
-
constructor(config, brevoContactImportService
|
|
33
|
+
constructor(config, brevoContactImportService) {
|
|
35
34
|
this.config = config;
|
|
36
35
|
this.brevoContactImportService = brevoContactImportService;
|
|
37
|
-
this.targetGroupRepository = targetGroupRepository;
|
|
38
36
|
}
|
|
39
37
|
upload(file, scope, listIds) {
|
|
40
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const content = file.buffer.toString("utf8");
|
|
42
39
|
const parsedScope = JSON.parse(scope);
|
|
43
40
|
const redirectUrl = this.config.brevo.resolveConfig(parsedScope).redirectUrlForImport;
|
|
44
|
-
|
|
45
|
-
if (contacts.length > 100) {
|
|
46
|
-
throw new cms_api_1.CometValidationException("Too many contacts in file. Currently we only support 100 contacts at once.");
|
|
47
|
-
}
|
|
48
|
-
let parsedListIds = undefined;
|
|
41
|
+
let targetGroupIds = undefined;
|
|
49
42
|
if (listIds)
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
43
|
+
targetGroupIds = JSON.parse(listIds);
|
|
44
|
+
const stream = stream_1.Readable.from(file.buffer);
|
|
45
|
+
return this.brevoContactImportService.importContactsFromCsv({
|
|
46
|
+
fileStream: stream,
|
|
47
|
+
scope: parsedScope,
|
|
48
|
+
redirectUrl,
|
|
49
|
+
targetGroupIds,
|
|
50
|
+
isAdminImport: true,
|
|
51
|
+
});
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
};
|
|
@@ -76,9 +75,7 @@ function createBrevoContactImportController({ Scope }) {
|
|
|
76
75
|
(0, common_1.Controller)("brevo-contacts-csv"),
|
|
77
76
|
__param(0, (0, common_1.Inject)(brevo_module_constants_1.BREVO_MODULE_CONFIG)),
|
|
78
77
|
__param(1, (0, common_1.Inject)(brevo_contact_import_service_1.BrevoContactImportService)),
|
|
79
|
-
|
|
80
|
-
__metadata("design:paramtypes", [Object, brevo_contact_import_service_1.BrevoContactImportService,
|
|
81
|
-
core_1.EntityRepository])
|
|
78
|
+
__metadata("design:paramtypes", [Object, brevo_contact_import_service_1.BrevoContactImportService])
|
|
82
79
|
], BrevoContactImportController);
|
|
83
80
|
return BrevoContactImportController;
|
|
84
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brevo-contact-import.controller.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.controller.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8E;AAC9E,2CAAqG;AACrG,+DAA2D;AAC3D,mCAAkC;AAElC,gGAA0F;AAE1F,6EAAuE;AAIvE,SAAgB,kCAAkC,CAAC,EAAE,KAAK,EAAgD;IACtG,IACM,4BAA4B,GADlC,MACM,4BAA4B;QAC9B,YACkD,MAAyB,EACnB,yBAAoD;YAD1D,WAAM,GAAN,MAAM,CAAmB;YACnB,8BAAyB,GAAzB,yBAAyB,CAA2B;QACzG,CAAC;QAgBE,MAAM,CACQ,IAAyB,EAC1B,KAAa,EACX,OAAgB;;gBAEjC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAgC,CAAC;gBACrE,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC;gBAEtF,IAAI,cAAc,GAAG,SAAS,CAAC;gBAC/B,IAAI,OAAO;oBAAE,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAa,CAAC;gBAE9D,MAAM,MAAM,GAAG,iBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC,yBAAyB,CAAC,qBAAqB,CAAC;oBACxD,UAAU,EAAE,MAAM;oBAClB,KAAK,EAAE,WAAW;oBAClB,WAAW;oBACX,cAAc;oBACd,aAAa,EAAE,IAAI;iBACtB,CAAC,CAAC;YACP,CAAC;SAAA;KACJ,CAAA;IApBS;QAdL,IAAA,aAAI,EAAC,QAAQ,CAAC;QACd,IAAA,wBAAe,EACZ,IAAA,kCAAe,EAAC,MAAM,EAAE;YACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE;YACtC,UAAU,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;gBACxB,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE;oBAC9B,OAAO,EAAE,CAAC,IAAI,kCAAwB,CAAC,0BAA0B,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;iBAC7F;gBAED,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC1B,CAAC;SACJ,CAAC,CACL;QACA,IAAA,4BAAkB,EAAC,CAAC,kBAAkB,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAE9D,WAAA,IAAA,qBAAY,GAAE,CAAA;QACd,WAAA,IAAA,aAAI,EAAC,OAAO,CAAC,CAAA;QACb,WAAA,IAAA,aAAI,EAAC,SAAS,CAAC,CAAA;;;;8DAgBnB;IAvCC,4BAA4B;QADjC,IAAA,mBAAU,EAAC,oBAAoB,CAAC;QAGxB,WAAA,IAAA,eAAM,EAAC,4CAAmB,CAAC,CAAA;QAC3B,WAAA,IAAA,eAAM,EAAC,wDAAyB,CAAC,CAAA;iDAA6C,wDAAyB;OAH1G,4BAA4B,CAwCjC;IAED,OAAO,4BAA4B,CAAC;AACxC,CAAC;AA7CD,gFA6CC"}
|
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EntityRepository } from "@mikro-orm/core";
|
|
3
|
+
import { TargetGroupInterface } from "src/target-group/entity/target-group-entity.factory";
|
|
4
|
+
import { Readable } from "stream";
|
|
5
|
+
import { BrevoApiContactsService } from "../brevo-api/brevo-api-contact.service";
|
|
2
6
|
import { BrevoContactsService } from "../brevo-contact/brevo-contacts.service";
|
|
3
7
|
import { BrevoModuleConfig } from "../config/brevo-module.config";
|
|
4
|
-
import { TargetGroupInterface } from "../target-group/entity/target-group-entity.factory";
|
|
5
8
|
import { TargetGroupsService } from "../target-group/target-groups.service";
|
|
6
9
|
import { EmailCampaignScopeInterface } from "../types";
|
|
10
|
+
export interface CsvImportInformation {
|
|
11
|
+
created: number;
|
|
12
|
+
updated: number;
|
|
13
|
+
failed: number;
|
|
14
|
+
failedColumns: unknown[];
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ImportContactsFromCsvParams {
|
|
18
|
+
fileStream: Readable;
|
|
19
|
+
scope: EmailCampaignScopeInterface;
|
|
20
|
+
redirectUrl: string;
|
|
21
|
+
targetGroupIds?: string[];
|
|
22
|
+
isAdminImport?: boolean;
|
|
23
|
+
}
|
|
7
24
|
export declare class BrevoContactImportService {
|
|
8
25
|
private readonly config;
|
|
9
26
|
private readonly brevoApiContactsService;
|
|
10
27
|
private readonly brevoContactsService;
|
|
11
28
|
private readonly targetGroupsService;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parseCsvToBrevoContacts(csvContent: string, redirectUrl: string): Promise<CreateDoubleOptInContactData[]>;
|
|
19
|
-
private processRow;
|
|
20
|
-
private createAndValidateRow;
|
|
29
|
+
private readonly targetGroupRepository;
|
|
30
|
+
constructor(config: BrevoModuleConfig, brevoApiContactsService: BrevoApiContactsService, brevoContactsService: BrevoContactsService, targetGroupsService: TargetGroupsService, targetGroupRepository: EntityRepository<TargetGroupInterface>);
|
|
31
|
+
importContactsFromCsv({ fileStream, scope, redirectUrl, targetGroupIds, isAdminImport, }: ImportContactsFromCsvParams): Promise<CsvImportInformation>;
|
|
32
|
+
private createOrUpdateBrevoContact;
|
|
33
|
+
private processCsvRow;
|
|
34
|
+
private createValidateableCsvRowClass;
|
|
21
35
|
}
|
|
36
|
+
export {};
|
|
22
37
|
//# sourceMappingURL=brevo-contact-import.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brevo-contact-import.service.d.ts","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.service.d.ts","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,uBAAuB,EAAgC,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAWvD,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,2BAA2B;IACjC,UAAU,EAAE,QAAQ,CAAC;IACrB,KAAK,EAAE,2BAA2B,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBACa,yBAAyB;IAED,OAAO,CAAC,QAAQ,CAAC,MAAM;IACpD,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACH,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAJzB,MAAM,EAAE,iBAAiB,EACtD,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,mBAAmB,EACP,qBAAqB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAG7G,qBAAqB,CAAC,EACxB,UAAU,EACV,KAAK,EACL,WAAW,EACX,cAAmB,EACnB,aAAqB,GACxB,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC;YAoEhD,0BAA0B;YAyC1B,aAAa;IA4B3B,OAAO,CAAC,6BAA6B;CAexC"}
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
8
31
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
32
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
33
|
};
|
|
@@ -20,6 +43,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
43
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
44
|
});
|
|
22
45
|
};
|
|
46
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
47
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
48
|
+
var m = o[Symbol.asyncIterator], i;
|
|
49
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
50
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
51
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
52
|
+
};
|
|
23
53
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
24
54
|
var t = {};
|
|
25
55
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -31,135 +61,198 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
31
61
|
}
|
|
32
62
|
return t;
|
|
33
63
|
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
34
67
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
68
|
exports.BrevoContactImportService = void 0;
|
|
36
|
-
const
|
|
69
|
+
const csv = __importStar(require("@fast-csv/parse"));
|
|
70
|
+
const core_1 = require("@mikro-orm/core");
|
|
71
|
+
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
37
72
|
const common_1 = require("@nestjs/common");
|
|
38
73
|
const class_validator_1 = require("class-validator");
|
|
74
|
+
const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
|
|
39
75
|
const brevo_api_utils_1 = require("../brevo-api/brevo-api.utils");
|
|
40
76
|
const brevo_api_contact_service_1 = require("../brevo-api/brevo-api-contact.service");
|
|
41
77
|
const brevo_contacts_service_1 = require("../brevo-contact/brevo-contacts.service");
|
|
42
78
|
const brevo_module_constants_1 = require("../config/brevo-module.constants");
|
|
43
79
|
const target_groups_service_1 = require("../target-group/target-groups.service");
|
|
44
|
-
class
|
|
80
|
+
class BasicValidateableRow {
|
|
45
81
|
}
|
|
46
82
|
__decorate([
|
|
47
83
|
(0, class_validator_1.IsEmail)(),
|
|
48
84
|
(0, class_validator_1.IsNotEmpty)(),
|
|
49
85
|
__metadata("design:type", String)
|
|
50
|
-
],
|
|
86
|
+
], BasicValidateableRow.prototype, "email", void 0);
|
|
51
87
|
let BrevoContactImportService = class BrevoContactImportService {
|
|
52
|
-
constructor(config, brevoApiContactsService, brevoContactsService, targetGroupsService) {
|
|
88
|
+
constructor(config, brevoApiContactsService, brevoContactsService, targetGroupsService, targetGroupRepository) {
|
|
53
89
|
this.config = config;
|
|
54
90
|
this.brevoApiContactsService = brevoApiContactsService;
|
|
55
91
|
this.brevoContactsService = brevoContactsService;
|
|
56
92
|
this.targetGroupsService = targetGroupsService;
|
|
93
|
+
this.targetGroupRepository = targetGroupRepository;
|
|
57
94
|
}
|
|
58
|
-
importContactsFromCsv(
|
|
95
|
+
importContactsFromCsv({ fileStream, scope, redirectUrl, targetGroupIds = [], isAdminImport = false, }) {
|
|
96
|
+
var _a, e_1, _b, _c;
|
|
59
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const failedColumns = [];
|
|
99
|
+
const targetGroups = yield this.targetGroupRepository.find({ id: { $in: targetGroupIds } });
|
|
100
|
+
for (const targetGroup of targetGroups) {
|
|
101
|
+
if (targetGroup.isMainList) {
|
|
102
|
+
throw new Error("Main lists are not allowed as target groups for import");
|
|
103
|
+
}
|
|
104
|
+
if (!(0, lodash_isequal_1.default)(Object.assign({}, targetGroup.scope), scope)) {
|
|
105
|
+
throw new Error("Target group scope does not match the scope of the import file");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const manuallyAssignedBrevoContacts = yield Promise.all(targetGroups.map((targetGroup) => {
|
|
109
|
+
return this.targetGroupsService.createIfNotExistsManuallyAssignedContactsTargetGroup(targetGroup);
|
|
110
|
+
}));
|
|
111
|
+
const targetGroupBrevoIds = [...targetGroups.map((targetGroup) => targetGroup.brevoId), ...manuallyAssignedBrevoContacts];
|
|
112
|
+
const rows = fileStream.pipe(csv.parse({ headers: true, delimiter: ";", ignoreEmpty: true })).on("error", (error) => {
|
|
113
|
+
throw error;
|
|
114
|
+
});
|
|
60
115
|
let created = 0;
|
|
61
116
|
let updated = 0;
|
|
62
117
|
let failed = 0;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
for (const contact of contacts) {
|
|
68
|
-
try {
|
|
69
|
-
let brevoContact;
|
|
118
|
+
try {
|
|
119
|
+
for (var _d = true, rows_1 = __asyncValues(rows), rows_1_1; rows_1_1 = yield rows_1.next(), _a = rows_1_1.done, !_a;) {
|
|
120
|
+
_c = rows_1_1.value;
|
|
121
|
+
_d = false;
|
|
70
122
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
123
|
+
const row = _c;
|
|
124
|
+
if (isAdminImport && created + updated + failed > 100) {
|
|
125
|
+
return {
|
|
126
|
+
created,
|
|
127
|
+
updated,
|
|
128
|
+
failed,
|
|
129
|
+
failedColumns,
|
|
130
|
+
errorMessage: "Too many contacts. Currently we only support 100 contacts at once, the first 100 contacts were handled. Please split the file and try again with the remaining contacts.",
|
|
131
|
+
};
|
|
76
132
|
}
|
|
77
|
-
|
|
78
|
-
|
|
133
|
+
try {
|
|
134
|
+
const contactData = yield this.processCsvRow(row, redirectUrl);
|
|
135
|
+
const result = yield this.createOrUpdateBrevoContact(contactData, scope, targetGroupBrevoIds);
|
|
136
|
+
switch (result) {
|
|
137
|
+
case "created":
|
|
138
|
+
created++;
|
|
139
|
+
break;
|
|
140
|
+
case "updated":
|
|
141
|
+
updated++;
|
|
142
|
+
break;
|
|
143
|
+
case "error":
|
|
144
|
+
failedColumns.push(row);
|
|
145
|
+
failed++;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
79
148
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const updatedBrevoContact = yield this.brevoApiContactsService.updateContact(brevoContact.id, Object.assign(Object.assign({}, contact), { listIds: [mainTargetGroupForScope.brevoId, ...targetGroupBrevoIds, ...brevoContact.listIds] }), scope);
|
|
84
|
-
if (updatedBrevoContact)
|
|
85
|
-
updated++;
|
|
86
|
-
else
|
|
149
|
+
catch (validationError) {
|
|
150
|
+
console.error(validationError);
|
|
151
|
+
failedColumns.push(row);
|
|
87
152
|
failed++;
|
|
153
|
+
}
|
|
88
154
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (success)
|
|
92
|
-
created++;
|
|
93
|
-
else
|
|
94
|
-
failed++;
|
|
155
|
+
finally {
|
|
156
|
+
_d = true;
|
|
95
157
|
}
|
|
96
158
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
159
|
+
}
|
|
160
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
161
|
+
finally {
|
|
162
|
+
try {
|
|
163
|
+
if (!_d && !_a && (_b = rows_1.return)) yield _b.call(rows_1);
|
|
100
164
|
}
|
|
165
|
+
finally { if (e_1) throw e_1.error; }
|
|
166
|
+
}
|
|
167
|
+
if (created + updated + failed === 0) {
|
|
168
|
+
return { created, updated, failed, failedColumns, errorMessage: "No contacts found." };
|
|
101
169
|
}
|
|
102
|
-
return { created, updated, failed };
|
|
170
|
+
return { created, updated, failed, failedColumns };
|
|
103
171
|
});
|
|
104
172
|
}
|
|
105
|
-
|
|
173
|
+
createOrUpdateBrevoContact(contact, scope, targetGroupBrevoIds) {
|
|
106
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
const contactData = yield this.processRow(row, redirectUrl);
|
|
117
|
-
brevoContacts.push(contactData);
|
|
175
|
+
try {
|
|
176
|
+
let brevoContact;
|
|
177
|
+
try {
|
|
178
|
+
brevoContact = yield this.brevoApiContactsService.findContact(contact.email, scope);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
if (!(0, brevo_api_utils_1.isErrorFromBrevo)(error)) {
|
|
182
|
+
throw error;
|
|
118
183
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
reject(validationError);
|
|
184
|
+
if (error.response.statusCode !== 404) {
|
|
185
|
+
throw error;
|
|
122
186
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
187
|
+
}
|
|
188
|
+
const mainTargetGroupForScope = yield this.targetGroupsService.createIfNotExistMainTargetGroupForScope(scope);
|
|
189
|
+
if (brevoContact && !brevoContact.emailBlacklisted) {
|
|
190
|
+
const updatedBrevoContact = yield this.brevoApiContactsService.updateContact(brevoContact.id, Object.assign(Object.assign({}, contact), { listIds: [mainTargetGroupForScope.brevoId, ...targetGroupBrevoIds, ...brevoContact.listIds] }), scope);
|
|
191
|
+
if (updatedBrevoContact)
|
|
192
|
+
return "updated";
|
|
193
|
+
}
|
|
194
|
+
else if (!brevoContact) {
|
|
195
|
+
const success = yield this.brevoContactsService.createDoubleOptInContact(Object.assign(Object.assign({}, contact), { scope, templateId: this.config.brevo.resolveConfig(scope).doubleOptInTemplateId, listIds: [mainTargetGroupForScope.brevoId, ...targetGroupBrevoIds] }));
|
|
196
|
+
if (success)
|
|
197
|
+
return "created";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
console.error(err);
|
|
202
|
+
}
|
|
203
|
+
return "error";
|
|
139
204
|
});
|
|
140
205
|
}
|
|
141
|
-
|
|
206
|
+
processCsvRow(row, redirectUrlForImport) {
|
|
142
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
-
const mappedRow =
|
|
144
|
-
|
|
208
|
+
const mappedRow = this.createValidateableCsvRowClass();
|
|
209
|
+
for (const key in row) {
|
|
145
210
|
if (key.toLowerCase() === "email") {
|
|
146
211
|
mappedRow.email = row[key];
|
|
147
212
|
}
|
|
148
213
|
else {
|
|
149
|
-
mappedRow[key] = row[key];
|
|
214
|
+
mappedRow[key.toUpperCase()] = row[key];
|
|
150
215
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
216
|
+
}
|
|
217
|
+
const errors = (0, class_validator_1.validateSync)(mappedRow);
|
|
218
|
+
if (errors.length > 0) {
|
|
219
|
+
throw errors;
|
|
220
|
+
}
|
|
221
|
+
const { email } = mappedRow, data = __rest(mappedRow, ["email"]);
|
|
222
|
+
return {
|
|
223
|
+
email: mappedRow.email,
|
|
224
|
+
redirectionUrl: redirectUrlForImport,
|
|
225
|
+
attributes: Object.assign({}, data),
|
|
226
|
+
};
|
|
154
227
|
});
|
|
155
228
|
}
|
|
229
|
+
createValidateableCsvRowClass() {
|
|
230
|
+
if (this.config.brevo.BrevoContactAttributes) {
|
|
231
|
+
const BrevoContactAttributesClass = this.config.brevo.BrevoContactAttributes;
|
|
232
|
+
class ValidateableRow extends BrevoContactAttributesClass {
|
|
233
|
+
}
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, class_validator_1.IsEmail)(),
|
|
236
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
237
|
+
__metadata("design:type", String)
|
|
238
|
+
], ValidateableRow.prototype, "email", void 0);
|
|
239
|
+
return new ValidateableRow();
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
class ValidateableRow extends BasicValidateableRow {
|
|
243
|
+
}
|
|
244
|
+
return new ValidateableRow();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
156
247
|
};
|
|
157
248
|
BrevoContactImportService = __decorate([
|
|
158
249
|
(0, common_1.Injectable)(),
|
|
159
250
|
__param(0, (0, common_1.Inject)(brevo_module_constants_1.BREVO_MODULE_CONFIG)),
|
|
251
|
+
__param(4, (0, nestjs_1.InjectRepository)("TargetGroup")),
|
|
160
252
|
__metadata("design:paramtypes", [Object, brevo_api_contact_service_1.BrevoApiContactsService,
|
|
161
253
|
brevo_contacts_service_1.BrevoContactsService,
|
|
162
|
-
target_groups_service_1.TargetGroupsService
|
|
254
|
+
target_groups_service_1.TargetGroupsService,
|
|
255
|
+
core_1.EntityRepository])
|
|
163
256
|
], BrevoContactImportService);
|
|
164
257
|
exports.BrevoContactImportService = BrevoContactImportService;
|
|
165
258
|
//# sourceMappingURL=brevo-contact-import.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brevo-contact-import.service.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brevo-contact-import.service.js","sourceRoot":"","sources":["../../src/brevo-contact/brevo-contact-import.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,0CAAmD;AACnD,8CAAqD;AACrD,2CAAoD;AACpD,qDAAoE;AACpE,oEAAqC;AAIrC,kEAAgE;AAChE,sFAA+G;AAC/G,oFAA+E;AAE/E,6EAAuE;AACvE,iFAA4E;AAG5E,MAAM,oBAAoB;CAOzB;AANG;IAAC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;mDACC;AAuBX,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAClC,YACkD,MAAyB,EACtD,uBAAgD,EAChD,oBAA0C,EAC1C,mBAAwC,EACP,qBAA6D;QAJjE,WAAM,GAAN,MAAM,CAAmB;QACtD,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,wBAAmB,GAAnB,mBAAmB,CAAqB;QACP,0BAAqB,GAArB,qBAAqB,CAAwC;IAChH,CAAC;IAEE,qBAAqB,CAAC,EACxB,UAAU,EACV,KAAK,EACL,WAAW,EACX,cAAc,GAAG,EAAE,EACnB,aAAa,GAAG,KAAK,GACK;;;YAC1B,MAAM,aAAa,GAAc,EAAE,CAAC;YACpC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;YAE5F,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;gBACpC,IAAI,WAAW,CAAC,UAAU,EAAE;oBACxB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;iBAC7E;gBAED,IAAI,CAAC,IAAA,wBAAO,oBAAM,WAAW,CAAC,KAAK,GAAI,KAAK,CAAC,EAAE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