@segment/action-destinations 3.39.2 → 3.41.1-alpha.3
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/dist/destinations/cordial/addContactToList/generated-types.d.ts +6 -0
- package/dist/destinations/cordial/addContactToList/generated-types.js +3 -0
- package/dist/destinations/cordial/addContactToList/generated-types.js.map +1 -0
- package/dist/destinations/cordial/addContactToList/index.d.ts +5 -0
- package/dist/destinations/cordial/addContactToList/index.js +45 -0
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -0
- package/dist/destinations/cordial/common-fields.d.ts +2 -0
- package/dist/destinations/cordial/common-fields.js +21 -0
- package/dist/destinations/cordial/common-fields.js.map +1 -0
- package/dist/destinations/cordial/cordial-client.d.ts +36 -0
- package/dist/destinations/cordial/cordial-client.js +121 -0
- package/dist/destinations/cordial/cordial-client.js.map +1 -0
- package/dist/destinations/cordial/createContactactivity/generated-types.d.ts +9 -0
- package/dist/destinations/cordial/createContactactivity/generated-types.js +3 -0
- package/dist/destinations/cordial/createContactactivity/generated-types.js.map +1 -0
- package/dist/destinations/cordial/createContactactivity/index.d.ts +5 -0
- package/dist/destinations/cordial/createContactactivity/index.js +46 -0
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -0
- package/dist/destinations/cordial/generated-types.d.ts +4 -0
- package/dist/destinations/cordial/generated-types.js +3 -0
- package/dist/destinations/cordial/generated-types.js.map +1 -0
- package/dist/destinations/cordial/index.d.ts +4 -0
- package/dist/destinations/cordial/index.js +53 -0
- package/dist/destinations/cordial/index.js.map +1 -0
- package/dist/destinations/cordial/removeContactFromList/generated-types.d.ts +6 -0
- package/dist/destinations/cordial/removeContactFromList/generated-types.js +3 -0
- package/dist/destinations/cordial/removeContactFromList/generated-types.js.map +1 -0
- package/dist/destinations/cordial/removeContactFromList/index.d.ts +5 -0
- package/dist/destinations/cordial/removeContactFromList/index.js +47 -0
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -0
- package/dist/destinations/cordial/upsertContact/generated-types.d.ts +7 -0
- package/dist/destinations/cordial/upsertContact/generated-types.js +3 -0
- package/dist/destinations/cordial/upsertContact/generated-types.js.map +1 -0
- package/dist/destinations/cordial/upsertContact/index.d.ts +5 -0
- package/dist/destinations/cordial/upsertContact/index.js +33 -0
- package/dist/destinations/cordial/upsertContact/index.js.map +1 -0
- package/dist/destinations/cordial/user-identifier.d.ts +5 -0
- package/dist/destinations/cordial/user-identifier.js +11 -0
- package/dist/destinations/cordial/user-identifier.js.map +1 -0
- package/dist/destinations/customerio/createUpdateDevice/index.js +1 -5
- package/dist/destinations/customerio/createUpdateDevice/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js +1 -5
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js +1 -5
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/customerio/trackPageView/index.js +1 -5
- package/dist/destinations/customerio/trackPageView/index.js.map +1 -1
- package/dist/destinations/customerio/trackScreenView/index.js +1 -5
- package/dist/destinations/customerio/trackScreenView/index.js.map +1 -1
- package/dist/destinations/customerio/utils.d.ts +1 -0
- package/dist/destinations/customerio/utils.js +12 -1
- package/dist/destinations/customerio/utils.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +5 -5
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -1
- package/dist/destinations/friendbuy/cloudUtil.d.ts +6 -0
- package/dist/destinations/friendbuy/cloudUtil.js +39 -0
- package/dist/destinations/friendbuy/cloudUtil.js.map +1 -0
- package/dist/destinations/friendbuy/generated-types.d.ts +4 -0
- package/dist/destinations/friendbuy/generated-types.js +3 -0
- package/dist/destinations/friendbuy/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/index.d.ts +4 -0
- package/dist/destinations/friendbuy/index.js +57 -0
- package/dist/destinations/friendbuy/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.d.ts +13 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js +36 -0
- package/dist/destinations/friendbuy/trackCustomEvent/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.d.ts +25 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackCustomer/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackCustomer/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackCustomer/index.js +44 -0
- package/dist/destinations/friendbuy/trackCustomer/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.d.ts +34 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackPurchase/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackPurchase/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js +56 -0
- package/dist/destinations/friendbuy/trackPurchase/index.js.map +1 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.d.ts +19 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.js +3 -0
- package/dist/destinations/friendbuy/trackSignUp/generated-types.js.map +1 -0
- package/dist/destinations/friendbuy/trackSignUp/index.d.ts +5 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js +39 -0
- package/dist/destinations/friendbuy/trackSignUp/index.js.map +1 -0
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +5 -6
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/voyage/generated-types.d.ts +3 -0
- package/dist/destinations/voyage/generated-types.js +3 -0
- package/dist/destinations/voyage/generated-types.js.map +1 -0
- package/dist/destinations/voyage/index.d.ts +4 -0
- package/dist/destinations/voyage/index.js +43 -0
- package/dist/destinations/voyage/index.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.d.ts +19 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js +3 -0
- package/dist/destinations/voyage/trackOrderPlaced/generated-types.js.map +1 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.d.ts +5 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js +167 -0
- package/dist/destinations/voyage/trackOrderPlaced/index.js.map +1 -0
- package/dist/destinations/voyage/utils.d.ts +31 -0
- package/dist/destinations/voyage/utils.js +8 -0
- package/dist/destinations/voyage/utils.js.map +1 -0
- package/dist/lib/test-data.js +13 -0
- package/dist/lib/test-data.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const user_identifier_1 = require("../user-identifier");
|
|
8
|
+
const common_fields_1 = require("../common-fields");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Add Contact to List',
|
|
11
|
+
description: 'Add Contact to Cordial List',
|
|
12
|
+
defaultSubscription: 'type = "group"',
|
|
13
|
+
fields: {
|
|
14
|
+
...common_fields_1.commonFields,
|
|
15
|
+
groupId: {
|
|
16
|
+
label: 'Group ID',
|
|
17
|
+
description: 'Segment Group ID',
|
|
18
|
+
type: 'string',
|
|
19
|
+
required: true,
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.groupId'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
listName: {
|
|
25
|
+
label: 'List Name',
|
|
26
|
+
description: 'Cordial List Name',
|
|
27
|
+
type: 'string',
|
|
28
|
+
default: {
|
|
29
|
+
'@if': {
|
|
30
|
+
exists: { '@path': '$.traits.name' },
|
|
31
|
+
then: { '@path': '$.traits.name' },
|
|
32
|
+
else: { '@path': '$.groupId' }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
perform: async (request, { settings, payload }) => {
|
|
38
|
+
const client = new cordial_client_1.default(settings, request);
|
|
39
|
+
const list = await client.upsertList(payload.groupId, payload.listName);
|
|
40
|
+
const userIdentifier = user_identifier_1.getUserIdentifier(payload.identifyByKey, payload.identifyByValue);
|
|
41
|
+
return client.addContactToList(userIdentifier, list);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = action;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,wDAAsD;AACtD,oDAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,6BAA6B;IAC1C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,GAAG,4BAAY;QACf,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBACpC,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBAClC,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;iBAC/B;aACF;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QACvE,MAAM,cAAc,GAAG,mCAAiB,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QACxF,OAAO,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonFields = void 0;
|
|
4
|
+
exports.commonFields = {
|
|
5
|
+
identifyByKey: {
|
|
6
|
+
label: 'Contact IdentifyBy key',
|
|
7
|
+
description: 'Property key by which Cordial contact should be identified. May be any primary or secondary key (e.g. cID, email, segment_id etc.)',
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
identifyByValue: {
|
|
12
|
+
label: 'Contact IdentifyBy value',
|
|
13
|
+
description: 'Value for defined key',
|
|
14
|
+
type: 'string',
|
|
15
|
+
required: true,
|
|
16
|
+
default: {
|
|
17
|
+
'@path': '$.userId'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=common-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-fields.js","sourceRoot":"","sources":["../../../src/destinations/cordial/common-fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAA+B;IACtD,aAAa,EAAE;QACb,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,oIAAoI;QACtI,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;KACf;IACD,eAAe,EAAE;QACf,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE,UAAU;SACpB;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Settings } from './generated-types';
|
|
2
|
+
import { RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { Payload as ContactActivityPayload } from './createContactactivity/generated-types';
|
|
4
|
+
import { UserIdentifier } from "./user-identifier";
|
|
5
|
+
interface Attribute {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
key: string;
|
|
9
|
+
}
|
|
10
|
+
interface ContactAttributes {
|
|
11
|
+
[key: string]: string | number;
|
|
12
|
+
}
|
|
13
|
+
interface List {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
segment_group_id: string;
|
|
17
|
+
}
|
|
18
|
+
declare class CordialClient {
|
|
19
|
+
private readonly apiUrl;
|
|
20
|
+
private readonly request;
|
|
21
|
+
constructor(settings: Settings, request: RequestClient);
|
|
22
|
+
addContactActivity(payload: ContactActivityPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
23
|
+
upsertContact(userIdentifier: UserIdentifier, attributes?: ContactAttributes): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
24
|
+
getList(segmentGroupId: string, listName?: string): Promise<List | null>;
|
|
25
|
+
upsertList(segmentGroupId: string, listName?: string): Promise<List>;
|
|
26
|
+
addContactToList(userIdentifier: UserIdentifier, list: List): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
27
|
+
removeContactFromList(userIdentifier: UserIdentifier, list: List): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
28
|
+
transformAttributes(rawAttributes: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}): Promise<ContactAttributes>;
|
|
31
|
+
protected getAttributes(): Promise<{
|
|
32
|
+
[key: string]: Attribute;
|
|
33
|
+
}>;
|
|
34
|
+
protected prepareListName(listName: string): string;
|
|
35
|
+
}
|
|
36
|
+
export default CordialClient;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class CordialClient {
|
|
4
|
+
constructor(settings, request) {
|
|
5
|
+
this.apiUrl = `${settings.endpoint}/v2`;
|
|
6
|
+
this.request = request;
|
|
7
|
+
}
|
|
8
|
+
addContactActivity(payload) {
|
|
9
|
+
return this.request(`${this.apiUrl}/contactactivities`, {
|
|
10
|
+
method: 'post',
|
|
11
|
+
json: {
|
|
12
|
+
[payload.identifyByKey]: payload.identifyByValue,
|
|
13
|
+
a: payload.action,
|
|
14
|
+
time: payload.time,
|
|
15
|
+
properties: payload.properties
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async upsertContact(userIdentifier, attributes) {
|
|
20
|
+
return this.request(`${this.apiUrl}/contacts`, {
|
|
21
|
+
method: 'post',
|
|
22
|
+
json: {
|
|
23
|
+
...userIdentifier,
|
|
24
|
+
...attributes,
|
|
25
|
+
request_source: 'integration-segment'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async getList(segmentGroupId, listName) {
|
|
30
|
+
let result = null;
|
|
31
|
+
try {
|
|
32
|
+
const lists = await this.request(`${this.apiUrl}/accountlists`, {
|
|
33
|
+
method: 'get'
|
|
34
|
+
});
|
|
35
|
+
for (const list of lists.data) {
|
|
36
|
+
if (list.segment_group_id == segmentGroupId) {
|
|
37
|
+
result = list;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!result && listName) {
|
|
42
|
+
listName = this.prepareListName(listName);
|
|
43
|
+
for (const list of lists.data) {
|
|
44
|
+
if (list.name == listName) {
|
|
45
|
+
result = list;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
async upsertList(segmentGroupId, listName) {
|
|
57
|
+
const list = await this.getList(segmentGroupId, listName);
|
|
58
|
+
if (list) {
|
|
59
|
+
return list;
|
|
60
|
+
}
|
|
61
|
+
if (!listName) {
|
|
62
|
+
listName = 'segment_' + segmentGroupId;
|
|
63
|
+
}
|
|
64
|
+
listName = this.prepareListName(listName);
|
|
65
|
+
const response = await this.request(`${this.apiUrl}/accountlists`, {
|
|
66
|
+
method: 'post',
|
|
67
|
+
json: {
|
|
68
|
+
name: listName,
|
|
69
|
+
enhanced: true,
|
|
70
|
+
segment_group_id: segmentGroupId
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
id: response.data.id,
|
|
75
|
+
name: listName,
|
|
76
|
+
segment_group_id: segmentGroupId
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async addContactToList(userIdentifier, list) {
|
|
80
|
+
return this.request(`${this.apiUrl}/contacts`, {
|
|
81
|
+
method: 'post',
|
|
82
|
+
json: {
|
|
83
|
+
...userIdentifier,
|
|
84
|
+
[list.name]: true
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async removeContactFromList(userIdentifier, list) {
|
|
89
|
+
return this.request(`${this.apiUrl}/contacts`, {
|
|
90
|
+
method: 'post',
|
|
91
|
+
json: {
|
|
92
|
+
...userIdentifier,
|
|
93
|
+
[list.name]: false
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async transformAttributes(rawAttributes) {
|
|
98
|
+
const attributes = {};
|
|
99
|
+
const availableAttributes = await this.getAttributes();
|
|
100
|
+
for (const key in availableAttributes) {
|
|
101
|
+
if (key in rawAttributes) {
|
|
102
|
+
const value = rawAttributes[key];
|
|
103
|
+
if (typeof value !== 'object') {
|
|
104
|
+
attributes[key] = value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return attributes;
|
|
109
|
+
}
|
|
110
|
+
async getAttributes() {
|
|
111
|
+
const response = await this.request(`${this.apiUrl}/accountcontactattributes`, {
|
|
112
|
+
method: 'get'
|
|
113
|
+
});
|
|
114
|
+
return response.data;
|
|
115
|
+
}
|
|
116
|
+
prepareListName(listName) {
|
|
117
|
+
return listName.replace(' ', '-');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.default = CordialClient;
|
|
121
|
+
//# sourceMappingURL=cordial-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;AA0BA,MAAM,aAAa;IAIjB,YAAY,QAAkB,EAAE,OAAsB;QACpD,IAAI,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,KAAK,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,kBAAkB,CAAC,OAA+B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,oBAAoB,EAAE;YACtD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe;gBAChD,CAAC,EAAE,OAAO,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,mBAAmB,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAA;QAEtD,KAAK,MAAM,GAAG,IAAI,mBAAmB,EAAE;YACrC,IAAI,GAAG,IAAI,aAAa,EAAE;gBACxB,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;gBAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;oBAC7B,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;iBACxB;aACF;SACF;QAED,OAAO,UAAU,CAAA;IACnB,CAAC;IAES,KAAK,CAAC,aAAa;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAA+B,GAAG,IAAI,CAAC,MAAM,2BAA2B,EAAE;YAC3G,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAES,eAAe,CAAC,QAAgB;QACxC,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACnC,CAAC;CACF;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const common_fields_1 = require("../common-fields");
|
|
8
|
+
const action = {
|
|
9
|
+
title: 'Create Contactactivity',
|
|
10
|
+
description: "Create Cordial Contactactivity from Segment's track and page events",
|
|
11
|
+
defaultSubscription: 'type = "track" or type = "page"',
|
|
12
|
+
fields: {
|
|
13
|
+
...common_fields_1.commonFields,
|
|
14
|
+
action: {
|
|
15
|
+
label: 'Event name',
|
|
16
|
+
description: 'Segment event name',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
default: {
|
|
20
|
+
'@path': '$.event'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
time: {
|
|
24
|
+
label: 'Event sentAt',
|
|
25
|
+
description: 'Segment event sentAt',
|
|
26
|
+
type: 'datetime',
|
|
27
|
+
default: {
|
|
28
|
+
'@path': '$.sentAt'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
properties: {
|
|
32
|
+
label: 'Event properties',
|
|
33
|
+
description: 'Segment event properties',
|
|
34
|
+
type: 'object',
|
|
35
|
+
default: {
|
|
36
|
+
'@path': '$.properties'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
perform: (request, { settings, payload }) => {
|
|
41
|
+
const client = new cordial_client_1.default(settings, request);
|
|
42
|
+
return client.addContactActivity(payload);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.default = action;
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,oDAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,qEAAqE;IAClF,mBAAmB,EAAE,iCAAiC;IACtD,MAAM,EAAE;QACN,GAAG,4BAAY;QACf,MAAM,EAAE;YACN,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/cordial/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const createContactactivity_1 = __importDefault(require("./createContactactivity"));
|
|
7
|
+
const upsertContact_1 = __importDefault(require("./upsertContact"));
|
|
8
|
+
const addContactToList_1 = __importDefault(require("./addContactToList"));
|
|
9
|
+
const removeContactFromList_1 = __importDefault(require("./removeContactFromList"));
|
|
10
|
+
const destination = {
|
|
11
|
+
name: 'Cordial',
|
|
12
|
+
description: 'Sync Segment Users, Groups and Events to Cordial',
|
|
13
|
+
slug: 'actions-cordial',
|
|
14
|
+
mode: 'cloud',
|
|
15
|
+
authentication: {
|
|
16
|
+
scheme: 'basic',
|
|
17
|
+
fields: {
|
|
18
|
+
apiKey: {
|
|
19
|
+
label: 'API Key',
|
|
20
|
+
description: 'Your Cordial API Key',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
endpoint: {
|
|
25
|
+
label: 'Endpoint',
|
|
26
|
+
description: "Cordial API endpoint. Leave default, unless you've been provided with another one. [See more details](https://support.cordial.com/hc/en-us/sections/200553578-REST-API-Introduction-and-Overview)",
|
|
27
|
+
type: 'string',
|
|
28
|
+
required: true,
|
|
29
|
+
format: 'uri',
|
|
30
|
+
choices: [
|
|
31
|
+
{ label: 'US-EAST (https://api.cordial.io)', value: 'https://api.cordial.io' },
|
|
32
|
+
{ label: 'US-WEST (https://api.usw2.cordial.io)', value: 'https://api.usw2.cordial.io' },
|
|
33
|
+
{ label: 'Staging (https://api.stg.cordialdev.com)', value: 'https://api.stg.cordialdev.com' }
|
|
34
|
+
],
|
|
35
|
+
default: 'https://api.cordial.io'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
testAuthentication: (request, { settings }) => {
|
|
39
|
+
return request(settings.endpoint + '/v2/health');
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
extendRequest({ settings }) {
|
|
43
|
+
return { username: settings.apiKey };
|
|
44
|
+
},
|
|
45
|
+
actions: {
|
|
46
|
+
createContactactivity: createContactactivity_1.default,
|
|
47
|
+
upsertContact: upsertContact_1.default,
|
|
48
|
+
addContactToList: addContactToList_1.default,
|
|
49
|
+
removeContactFromList: removeContactFromList_1.default
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.default = destination;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/cordial/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAC3D,oEAA2C;AAC3C,0EAAiD;AACjD,oFAA2D;AAE3D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,mMAAmM;gBAChN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,kCAAkC,EAAE,KAAK,EAAE,wBAAwB,EAAE;oBAC9E,EAAE,KAAK,EAAE,uCAAuC,EAAE,KAAK,EAAE,6BAA6B,EAAE;oBACxF,EAAE,KAAK,EAAE,0CAA0C,EAAE,KAAK,EAAE,gCAAgC,EAAE;iBAC/F;gBACD,OAAO,EAAE,wBAAwB;aAClC;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,YAAY,CAAC,CAAA;QAClD,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAA;IACtC,CAAC;IAED,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;QACrB,aAAa,EAAb,uBAAa;QACb,gBAAgB,EAAhB,0BAAgB;QAChB,qBAAqB,EAArB,+BAAqB;KACtB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeContactFromList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const user_identifier_1 = require("../user-identifier");
|
|
8
|
+
const common_fields_1 = require("../common-fields");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Remove Contact from List',
|
|
11
|
+
description: 'Remove Contact from Cordial List',
|
|
12
|
+
fields: {
|
|
13
|
+
...common_fields_1.commonFields,
|
|
14
|
+
groupId: {
|
|
15
|
+
label: 'Group ID',
|
|
16
|
+
description: 'Segment Group ID',
|
|
17
|
+
type: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
default: {
|
|
20
|
+
'@path': '$.groupId'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
listName: {
|
|
24
|
+
label: 'List Name',
|
|
25
|
+
description: 'Cordial List Name',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: {
|
|
28
|
+
'@if': {
|
|
29
|
+
exists: { '@path': '$.traits.name' },
|
|
30
|
+
then: { '@path': '$.traits.name' },
|
|
31
|
+
else: { '@path': '$.groupId' }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
perform: async (request, { settings, payload }) => {
|
|
37
|
+
const client = new cordial_client_1.default(settings, request);
|
|
38
|
+
const list = await client.getList(payload.groupId, payload.listName);
|
|
39
|
+
if (!list) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
const userIdentifier = user_identifier_1.getUserIdentifier(payload.identifyByKey, payload.identifyByValue);
|
|
43
|
+
return client.removeContactFromList(userIdentifier, list);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.default = action;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeContactFromList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,wDAAsD;AACtD,oDAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,kCAAkC;IAC/C,MAAM,EAAE;QACN,GAAG,4BAAY;QACf,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBACpC,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBAClC,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;iBAC/B;aACF;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;QAEpE,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;QACD,MAAM,cAAc,GAAG,mCAAiB,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QACxF,OAAO,MAAM,CAAC,qBAAqB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC3D,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertContact/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const user_identifier_1 = require("../user-identifier");
|
|
8
|
+
const common_fields_1 = require("../common-fields");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Upsert Contact',
|
|
11
|
+
description: "Upsert Cordial Contact from Segment's identify events",
|
|
12
|
+
defaultSubscription: 'type = "identify"',
|
|
13
|
+
fields: {
|
|
14
|
+
...common_fields_1.commonFields,
|
|
15
|
+
attributes: {
|
|
16
|
+
label: 'Contact Attributes',
|
|
17
|
+
description: 'Contact Attributes',
|
|
18
|
+
type: 'object',
|
|
19
|
+
required: false,
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.traits'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
perform: async (request, { settings, payload }) => {
|
|
26
|
+
const client = new cordial_client_1.default(settings, request);
|
|
27
|
+
const attributes = payload.attributes ? await client.transformAttributes(payload.attributes) : undefined;
|
|
28
|
+
const userIdentifier = user_identifier_1.getUserIdentifier(payload.identifyByKey, payload.identifyByValue);
|
|
29
|
+
return client.upsertContact(userIdentifier, attributes);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.default = action;
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertContact/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,wDAAsD;AACtD,oDAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,uDAAuD;IACpE,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,GAAG,4BAAY;QACf,UAAU,EAAE;YACV,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxG,MAAM,cAAc,GAAG,mCAAiB,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QACxF,OAAO,MAAM,CAAC,aAAa,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;IACzD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserIdentifier = void 0;
|
|
4
|
+
function getUserIdentifier(identifyByKey, identifyByValue) {
|
|
5
|
+
return {
|
|
6
|
+
[identifyByKey]: identifyByValue,
|
|
7
|
+
identifyBy: [identifyByKey]
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.getUserIdentifier = getUserIdentifier;
|
|
11
|
+
//# sourceMappingURL=user-identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-identifier.js","sourceRoot":"","sources":["../../../src/destinations/cordial/user-identifier.ts"],"names":[],"mappings":";;;AAKA,SAAgB,iBAAiB,CAAC,aAAqB,EAAE,eAAuB;IAC9E,OAAO;QACL,CAAC,aAAa,CAAC,EAAE,eAAe;QAChC,UAAU,EAAE,CAAC,aAAa,CAAC;KAC5B,CAAA;AACH,CAAC;AALD,8CAKC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
|
|
7
3
|
const utils_1 = require("../utils");
|
|
8
4
|
const action = {
|
|
9
5
|
title: 'Create or Update Device',
|
|
@@ -55,7 +51,7 @@ const action = {
|
|
|
55
51
|
perform: (request, { settings, payload }) => {
|
|
56
52
|
let lastUsed = payload.last_used;
|
|
57
53
|
if (lastUsed && payload.convert_timestamp !== false) {
|
|
58
|
-
lastUsed =
|
|
54
|
+
lastUsed = utils_1.convertValidTimestamp(lastUsed);
|
|
59
55
|
}
|
|
60
56
|
return request(`${utils_1.trackApiEndpoint(settings.accountRegion)}/api/v1/customers/${payload.person_id}/devices`, {
|
|
61
57
|
method: 'put',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdateDevice/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdateDevice/index.ts"],"names":[],"mappings":";;AAGA,oCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,uGAAuG;IACpH,mB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