@segment/action-destinations 3.65.0 → 3.67.0
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/braze/index.js +2 -2
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/clevertap/index.js +23 -5
- package/dist/destinations/clevertap/index.js.map +1 -1
- package/dist/destinations/clevertap/userDelete/index.js +1 -1
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
- package/dist/destinations/clevertap/userUpload/index.js +5 -5
- package/dist/destinations/clevertap/userUpload/index.js.map +1 -1
- package/dist/destinations/close/createUpdateContactAndLead/index.js +9 -7
- package/dist/destinations/close/createUpdateContactAndLead/index.js.map +1 -1
- package/dist/destinations/close/index.js +6 -4
- package/dist/destinations/close/index.js.map +1 -1
- package/dist/destinations/cordial/addContactToList/generated-types.d.ts +3 -2
- package/dist/destinations/cordial/addContactToList/index.js +13 -15
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
- package/dist/destinations/cordial/cordial-client.d.ts +8 -28
- package/dist/destinations/cordial/cordial-client.js +19 -90
- package/dist/destinations/cordial/cordial-client.js.map +1 -1
- package/dist/destinations/cordial/createContactactivity/generated-types.d.ts +6 -2
- package/dist/destinations/cordial/createContactactivity/index.js +26 -9
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
- package/dist/destinations/cordial/index.js +6 -9
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/removeContactFromList/generated-types.d.ts +3 -3
- package/dist/destinations/cordial/removeContactFromList/index.js +9 -22
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
- package/dist/destinations/cordial/upsertContact/generated-types.d.ts +3 -2
- package/dist/destinations/cordial/upsertContact/index.js +11 -11
- package/dist/destinations/cordial/upsertContact/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +2 -0
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addToCart/index.js +2 -0
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +2 -0
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +2 -0
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/customEvent/index.js +2 -0
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +1 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js +7 -1
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js +2 -0
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/login/index.js +2 -0
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/pageView/index.js +2 -0
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/purchase/index.js +2 -0
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/refund/index.js +2 -0
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +2 -0
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/search/index.js +2 -0
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/selectItem/index.js +2 -0
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +2 -0
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/signUp/index.js +2 -0
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewCart/index.js +2 -0
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewItem/index.js +2 -0
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewItemList/index.js +2 -0
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +1 -0
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +2 -0
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/cordial/common-fields.d.ts +0 -2
- package/dist/destinations/cordial/common-fields.js +0 -21
- package/dist/destinations/cordial/common-fields.js.map +0 -1
- package/dist/destinations/cordial/user-identifier.d.ts +0 -5
- package/dist/destinations/cordial/user-identifier.js +0 -11
- package/dist/destinations/cordial/user-identifier.js.map +0 -1
|
@@ -49,8 +49,8 @@ const destination = {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
onDelete: async (request, { payload }) => {
|
|
53
|
-
return request(
|
|
52
|
+
onDelete: async (request, { payload, settings }) => {
|
|
53
|
+
return request(`${settings.endpoint}/users/delete`, {
|
|
54
54
|
method: 'post',
|
|
55
55
|
json: {
|
|
56
56
|
external_ids: [payload.userId]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/braze/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAqD;AACrD,gEAAuC;AACvC,kEAAyC;AACzC,8DAAqC;AACrC,oEAA2C;AAC3C,4EAAmD;AAEnD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,gDAAgD;IAC7D,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,yDAAyD;gBACtE,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EACT,+IAA+I;gBACjJ,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,gGAAgG;gBAC7G,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,wCAAwC,EAAE,KAAK,EAA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AE,UAAU,QAAQ,CAAC,OAAO,EAAE;aAC5C;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,UAAU,EAAV,oBAAU;QACV,aAAa,EAAb,uBAAa;QACb,WAAW,EAAX,qBAAW;QACX,YAAY,EAAZ,sBAAY;KACb;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,+CAA+C;YAC1D,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;SAC1C;QACD;YACE,IAAI,EAAE,uBAAuB;YAC7B,SAAS,EAAE,2BAA2B;YACtC,aAAa,EAAE,eAAe;YAC9B,OAAO,EAAE,4BAAa,CAAC,uBAAa,CAAC,MAAM,CAAC;SAC7C;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,mBAAmB;YAClC,OAAO,EAAE,4BAAa,CAAC,2BAAiB,CAAC,MAAM,CAAC;SACjD;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -5,29 +5,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const userUpload_1 = __importDefault(require("./userUpload"));
|
|
7
7
|
const userDelete_1 = __importDefault(require("./userDelete"));
|
|
8
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
8
9
|
const destination = {
|
|
9
10
|
name: 'Clevertap (Actions)',
|
|
10
11
|
slug: 'actions-clevertap',
|
|
11
12
|
mode: 'cloud',
|
|
12
|
-
description: '
|
|
13
|
+
description: 'CleverTap is a customer engagement and retention platform that provides the functionality to integrate app analytics and marketing. The platform helps customers increase user engagement in three ways:' +
|
|
14
|
+
' 1) Tracks actions users are taking and analyzes how people use the product.' +
|
|
15
|
+
' 2) [Segment](https://docs.clevertap.com/docs/segments) users based on their actions and run targeted [campaigns](https://docs.clevertap.com/docs/intro-to-campaigns) to these segments.' +
|
|
16
|
+
' 3) [Analyze](https://docs.clevertap.com/docs/intro-to-reports) each campaign to understand its effect on user engagement and business metrics',
|
|
13
17
|
authentication: {
|
|
14
18
|
scheme: 'custom',
|
|
15
19
|
fields: {
|
|
16
20
|
clevertapAccountId: {
|
|
17
21
|
label: 'CleverTap Account ID',
|
|
18
|
-
description: '
|
|
22
|
+
description: 'CleverTap Account Id. This can be found under [Settings Page](https://developer.clevertap.com/docs/authentication#getting-your-account-credentials).',
|
|
19
23
|
type: 'string',
|
|
20
24
|
required: true
|
|
21
25
|
},
|
|
22
26
|
clevertapPasscode: {
|
|
23
27
|
label: 'CleverTap Account Passcode',
|
|
24
|
-
description: '
|
|
28
|
+
description: 'CleverTap Passcode. This can be found under [Settings Page](https://developer.clevertap.com/docs/authentication#getting-your-account-credentials).',
|
|
25
29
|
type: 'string',
|
|
26
30
|
required: true
|
|
27
31
|
},
|
|
28
32
|
clevertapEndpoint: {
|
|
29
33
|
label: 'REST Endpoint',
|
|
30
|
-
description: '
|
|
34
|
+
description: 'Learn More about [Account regions](https://docs.clevertap.com/docs/build-segment-destination#set-up-segment-destination-action).',
|
|
31
35
|
type: 'string',
|
|
32
36
|
format: 'uri',
|
|
33
37
|
choices: [
|
|
@@ -45,7 +49,21 @@ const destination = {
|
|
|
45
49
|
actions: {
|
|
46
50
|
userUpload: userUpload_1.default,
|
|
47
51
|
userDelete: userDelete_1.default
|
|
48
|
-
}
|
|
52
|
+
},
|
|
53
|
+
presets: [
|
|
54
|
+
{
|
|
55
|
+
name: 'Event Name is Delete User',
|
|
56
|
+
subscribe: 'event = "Delete User"',
|
|
57
|
+
partnerAction: 'userDelete',
|
|
58
|
+
mapping: actions_core_1.defaultValues(userDelete_1.default.fields)
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Event Type is Identify',
|
|
62
|
+
subscribe: 'type = "identify"',
|
|
63
|
+
partnerAction: 'userUpload',
|
|
64
|
+
mapping: actions_core_1.defaultValues(userUpload_1.default.fields)
|
|
65
|
+
}
|
|
66
|
+
],
|
|
49
67
|
};
|
|
50
68
|
exports.default = destination;
|
|
51
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/clevertap/index.ts"],"names":[],"mappings":";;;;;AAGA,8DAAqC;AAErC,8DAAqC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/clevertap/index.ts"],"names":[],"mappings":";;;;;AAGA,8DAAqC;AAErC,8DAAqC;AACrC,wDAAoD;AAEpD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,0MAA0M;QACrN,8EAA8E;QAC9E,2LAA2L;QAC3L,gJAAgJ;IAClJ,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,kBAAkB,EAAE;gBAClB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,sJAAsJ;gBACnK,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,oJAAoJ;gBACjK,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,kIAAkI;gBAC/I,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACP,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;oBACrD,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,+BAA+B,EAAC;iBACtD;gBACD,OAAO,EAAE,+BAA+B;gBACxC,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IAED,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,UAAU,EAAV,oBAAU;KACX;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,2BAA2B;YACjC,SAAS,EAAE,uBAAuB;YAClC,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;SAC1C;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,SAAS,EAAE,mBAAmB;YAC9B,aAAa,EAAE,YAAY;YAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;SAC1C;KACF;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userDelete/index.ts"],"names":[],"mappings":";;AAKA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC;YAC9B,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;QACxC,MAAM,KAAK,GAAgB;YACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAA;QACD,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,iBAAiB,yBAAyB,EAAE;YACrE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,wBAAwB,EAAE,GAAG,QAAQ,CAAC,kBAAkB,EAAE;gBAC1D,sBAAsB,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE;aACxD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -7,21 +7,21 @@ const action = {
|
|
|
7
7
|
description: 'The User Upload Action enables you to create or update user profiles in CleverTap.',
|
|
8
8
|
fields: {
|
|
9
9
|
ts: {
|
|
10
|
-
label: '
|
|
10
|
+
label: 'Created At',
|
|
11
11
|
type: 'string',
|
|
12
|
-
description: '
|
|
12
|
+
description: 'A timestamp when the person was created',
|
|
13
13
|
default: { '@path': '$.timestamp' }
|
|
14
14
|
},
|
|
15
15
|
profileData: {
|
|
16
|
-
label: '
|
|
16
|
+
label: 'Person Attributes',
|
|
17
17
|
type: 'object',
|
|
18
|
-
description: '
|
|
18
|
+
description: 'Optional attributes for the person. When updating a person attributes added or updated, not removed',
|
|
19
19
|
default: { '@path': '$.properties' }
|
|
20
20
|
},
|
|
21
21
|
identity: {
|
|
22
22
|
label: 'Identity',
|
|
23
23
|
type: 'string',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'The Id used to uniquely identify a person in CleverTap',
|
|
25
25
|
default: { '@path': '$.userId' },
|
|
26
26
|
required: true
|
|
27
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userUpload/index.ts"],"names":[],"mappings":";;AAKA,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,oFAAoF;IACjG,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/clevertap/userUpload/index.ts"],"names":[],"mappings":";;AAKA,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,oFAAoF;IACjG,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE,EAAC,OAAO,EAAE,aAAa,EAAC;SAClC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qGAAqG;YAClH,OAAO,EAAE,EAAC,OAAO,EAAE,cAAc,EAAC;SACnC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE,EAAC,OAAO,EAAE,UAAU,EAAC;YAC9B,QAAQ,EAAE,IAAI;SACf;KACF;IAGD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;QACxC,MAAM,KAAK,GAAmB;YAC5B,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,EAAE,EAAE,OAAO,CAAC,EAAE;SACf,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,iBAAiB,WAAW,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,GAAG,EAAE,CAAC,KAAK,CAAC;aACb;YACD,OAAO,EAAE;gBACP,wBAAwB,EAAE,GAAG,QAAQ,CAAC,kBAAkB,EAAE;gBAC1D,sBAAsB,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE;aACxD;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const action = {
|
|
4
4
|
title: 'Create or Update Contact and Lead',
|
|
5
|
-
description: 'Create or Update Contact and/or Lead. At first Close will try to find ' +
|
|
5
|
+
description: 'Create or Update Contact and/or Lead. At first, Close will try to find ' +
|
|
6
6
|
'Lead via Lead Company ID. If Lead is not found, Close will try to find ' +
|
|
7
7
|
'a Contact either via Contact User ID or via Contact Email. If Contact is ' +
|
|
8
8
|
'not found, Close will create a new Lead and Contact. It will also create ' +
|
|
9
9
|
'a new Lead and Contact if Contact is found but exists under a Lead with ' +
|
|
10
|
-
'different Lead Company ID.
|
|
11
|
-
'
|
|
12
|
-
'
|
|
10
|
+
'different Lead Company ID. If the Action does not specify Lead Company ' +
|
|
11
|
+
'ID, Close will update the Contact and also the Contact’s Lead. It might ' +
|
|
12
|
+
'happen that Close will find multiple Contacts with the same Contact User ' +
|
|
13
|
+
'ID or Contact Email. In such case, Close will update up to 10 Contacts, ' +
|
|
14
|
+
'ordered by creation date.',
|
|
13
15
|
defaultSubscription: 'type = "identify"',
|
|
14
16
|
fields: {
|
|
15
17
|
lead_name: {
|
|
@@ -32,13 +34,13 @@ const action = {
|
|
|
32
34
|
},
|
|
33
35
|
lead_description: {
|
|
34
36
|
label: 'Lead Description',
|
|
35
|
-
description: 'Description of the Lead',
|
|
37
|
+
description: 'Description of the Lead.',
|
|
36
38
|
type: 'string',
|
|
37
39
|
required: false
|
|
38
40
|
},
|
|
39
41
|
lead_status_id: {
|
|
40
42
|
label: 'Lead Status ID',
|
|
41
|
-
description: 'ID of the Lead Status (`stat_xxxx`). You can get it in Close in Statuses & Pipelines page.',
|
|
43
|
+
description: 'ID of the Lead Status (`stat_xxxx`). You can get it in Close in the Statuses & Pipelines page.',
|
|
42
44
|
type: 'string',
|
|
43
45
|
required: false
|
|
44
46
|
},
|
|
@@ -59,7 +61,7 @@ const action = {
|
|
|
59
61
|
},
|
|
60
62
|
contact_email: {
|
|
61
63
|
label: 'Contact Email',
|
|
62
|
-
description: '
|
|
64
|
+
description: 'Used to lookup Contact if Contact User ID is not set. If the Contact already has different email address, this value will be appended.',
|
|
63
65
|
type: 'string',
|
|
64
66
|
required: false,
|
|
65
67
|
default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/close/createUpdateContactAndLead/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/close/createUpdateContactAndLead/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,yEAAyE;QACzE,yEAAyE;QACzE,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,yEAAyE;QACzE,0EAA0E;QAC1E,2EAA2E;QAC3E,0EAA0E;QAC1E,2BAA2B;IAC7B,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,O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,GAAG;YACf,mCAAmC,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAmC;YACtF,mCAAmC,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAmC;YACtF,wBAAwB,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB;YAC/D,6BAA6B,EAAE,IAAI,CAAC,OAAO,CAAC,6BAA6B;YACzE,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,2BAA2B;YACrE,gCAAgC,EAAE,IAAI,CAAC,OAAO,CAAC,gCAAgC;YAC/E,iCAAiC,EAAE,IAAI,CAAC,OAAO,CAAC,iCAAiC;SAClF,CAAA;QACD,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;QAG1C,OAAO,cAAc,CAAC,wBAAwB,CAAA;QAC9C,OAAO,cAAc,CAAC,6BAA6B,CAAA;QACnD,OAAO,cAAc,CAAC,2BAA2B,CAAA;QACjD,OAAO,cAAc,CAAC,gCAAgC,CAAA;QACtD,OAAO,cAAc,CAAC,iCAAiC,CAAA;QAEvD,OAAO,OAAO,CAAC,qFAAqF,EAAE;YACpG,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE;SACnC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -24,8 +24,9 @@ const destination = {
|
|
|
24
24
|
'Custom Field in Close first, and then the integration will use ' +
|
|
25
25
|
'this field to store the Company ID when creating new contacts, ' +
|
|
26
26
|
'and/or will be used as a lookup key when updating existing ' +
|
|
27
|
-
'Lead. If this field is not
|
|
28
|
-
"lookup and de-dupe based on Contact's
|
|
27
|
+
'Lead. The Custom Field type must be a text. If this field is not ' +
|
|
28
|
+
"filled out, it will only lookup and de-dupe based on Contact's " +
|
|
29
|
+
'email.',
|
|
29
30
|
type: 'string',
|
|
30
31
|
default: '',
|
|
31
32
|
required: false
|
|
@@ -37,8 +38,9 @@ const destination = {
|
|
|
37
38
|
'Custom Field in Close first, and then the integration will use ' +
|
|
38
39
|
'this field to store the User ID when creating new contacts, ' +
|
|
39
40
|
'and/or will be used as a lookup key when updating existing ' +
|
|
40
|
-
'Contacts.
|
|
41
|
-
'
|
|
41
|
+
'Contacts. The Custom Field type must be a text. ' +
|
|
42
|
+
'If this field is not filled out, it will only look up and de-dupe ' +
|
|
43
|
+
'based on email.',
|
|
42
44
|
type: 'string',
|
|
43
45
|
default: '',
|
|
44
46
|
required: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/close/index.ts"],"names":[],"mappings":";;;;;AAGA,8FAAqE;AAErE,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,iDAAiD;oBACjD,4DAA4D;oBAC5D,iEAAiE;oBACjE,iEAAiE;oBACjE,6DAA6D;oBAC7D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/close/index.ts"],"names":[],"mappings":";;;;;AAGA,8FAAqE;AAErE,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,OAAO;QACf,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,iDAAiD;oBACjD,4DAA4D;oBAC5D,iEAAiE;oBACjE,iEAAiE;oBACjE,6DAA6D;oBAC7D,mEAAmE;oBACnE,iEAAiE;oBACjE,QAAQ;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;aAChB;YACD,mCAAmC,EAAE;gBACnC,KAAK,EAAE,qCAAqC;gBAC5C,WAAW,EACT,oDAAoD;oBACpD,4DAA4D;oBAC5D,iEAAiE;oBACjE,8DAA8D;oBAC9D,6DAA6D;oBAC7D,kDAAkD;oBAClD,oEAAoE;oBACpE,iBAAiB;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,6CAA6C,CAAC,CAAA;QAC/D,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,QAAQ,EAAE,EAAE;SACb,CAAA;IACH,CAAC;IAQD,OAAO,EAAE;QACP,0BAA0B,EAA1B,oCAA0B;KAC3B;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -4,17 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
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
7
|
const action = {
|
|
10
8
|
title: 'Add Contact to List',
|
|
11
|
-
description: 'Add
|
|
9
|
+
description: 'Add contact to a list. If the list does not exist in Cordial it will be created.',
|
|
12
10
|
defaultSubscription: 'type = "group"',
|
|
13
11
|
fields: {
|
|
14
|
-
|
|
12
|
+
userIdentities: {
|
|
13
|
+
label: 'User Identities',
|
|
14
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
+
type: 'object',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultObjectUI: 'keyvalue:only'
|
|
18
|
+
},
|
|
15
19
|
groupId: {
|
|
16
20
|
label: 'Group ID',
|
|
17
|
-
description: 'Segment
|
|
21
|
+
description: 'Segment group id. Required.',
|
|
18
22
|
type: 'string',
|
|
19
23
|
required: true,
|
|
20
24
|
default: {
|
|
@@ -22,23 +26,17 @@ const action = {
|
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
listName: {
|
|
25
|
-
label: 'List
|
|
26
|
-
description: 'Cordial
|
|
29
|
+
label: 'List name',
|
|
30
|
+
description: 'Cordial list name. Optional. If list name is empty, the name of the list will be set to segment_[groupId].',
|
|
27
31
|
type: 'string',
|
|
28
32
|
default: {
|
|
29
|
-
'@
|
|
30
|
-
exists: { '@path': '$.traits.name' },
|
|
31
|
-
then: { '@path': '$.traits.name' },
|
|
32
|
-
else: { '@path': '$.groupId' }
|
|
33
|
-
}
|
|
33
|
+
'@path': '$.traits.name'
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
perform: async (request, { settings, payload }) => {
|
|
38
38
|
const client = new cordial_client_1.default(settings, request);
|
|
39
|
-
|
|
40
|
-
const userIdentifier = user_identifier_1.getUserIdentifier(payload.identifyByKey, payload.identifyByValue);
|
|
41
|
-
return client.addContactToList(userIdentifier, list);
|
|
39
|
+
return client.addContactToList(payload);
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
42
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/addContactToList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,kFAAkF;IAC/F,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,oTAAoT;YACtT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,6BAA6B;YAC1C,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,EACT,4GAA4G;YAC9G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;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,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
import { Settings } from './generated-types';
|
|
2
2
|
import { RequestClient } from '@segment/actions-core';
|
|
3
|
-
import { Payload as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
}
|
|
3
|
+
import { Payload as AddContactToListPayload } from './addContactToList/generated-types';
|
|
4
|
+
import { Payload as CreateContactactivityPayload } from './createContactactivity/generated-types';
|
|
5
|
+
import { Payload as RemoveContactFromListPayload } from './removeContactFromList/generated-types';
|
|
6
|
+
import { Payload as UpsertContactPayload } from './upsertContact/generated-types';
|
|
18
7
|
declare class CordialClient {
|
|
19
8
|
private readonly apiUrl;
|
|
20
9
|
private readonly request;
|
|
21
10
|
constructor(settings: Settings, request: RequestClient);
|
|
22
|
-
addContactActivity(payload:
|
|
23
|
-
upsertContact(
|
|
24
|
-
|
|
25
|
-
|
|
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;
|
|
11
|
+
addContactActivity(payload: CreateContactactivityPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
12
|
+
upsertContact(payload: UpsertContactPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
13
|
+
addContactToList(payload: AddContactToListPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
14
|
+
removeContactFromList(payload: RemoveContactFromListPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
35
15
|
}
|
|
36
16
|
export default CordialClient;
|
|
@@ -2,120 +2,49 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class CordialClient {
|
|
4
4
|
constructor(settings, request) {
|
|
5
|
-
this.apiUrl = `${settings.endpoint}/
|
|
5
|
+
this.apiUrl = `${settings.endpoint}/api/segment`;
|
|
6
6
|
this.request = request;
|
|
7
7
|
}
|
|
8
8
|
addContactActivity(payload) {
|
|
9
|
-
return this.request(`${this.apiUrl}/
|
|
9
|
+
return this.request(`${this.apiUrl}/createContactactivity`, {
|
|
10
10
|
method: 'post',
|
|
11
11
|
json: {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
userIdentities: payload.userIdentities,
|
|
13
|
+
action: payload.action,
|
|
14
14
|
time: payload.time,
|
|
15
|
-
properties: payload.properties
|
|
15
|
+
properties: payload.properties,
|
|
16
|
+
context: payload.context
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
async upsertContact(
|
|
20
|
-
return this.request(`${this.apiUrl}/
|
|
20
|
+
async upsertContact(payload) {
|
|
21
|
+
return this.request(`${this.apiUrl}/upsertContact`, {
|
|
21
22
|
method: 'post',
|
|
22
23
|
json: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
request_source: 'integration-segment'
|
|
24
|
+
userIdentities: payload.userIdentities,
|
|
25
|
+
attributes: payload.attributes
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
async
|
|
30
|
-
|
|
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`, {
|
|
29
|
+
async addContactToList(payload) {
|
|
30
|
+
return this.request(`${this.apiUrl}/addContactToList`, {
|
|
66
31
|
method: 'post',
|
|
67
32
|
json: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
33
|
+
userIdentities: payload.userIdentities,
|
|
34
|
+
groupId: payload.groupId,
|
|
35
|
+
listName: payload.listName
|
|
71
36
|
}
|
|
72
37
|
});
|
|
73
|
-
return {
|
|
74
|
-
id: response.data.id,
|
|
75
|
-
name: listName,
|
|
76
|
-
segment_group_id: segmentGroupId
|
|
77
|
-
};
|
|
78
38
|
}
|
|
79
|
-
async
|
|
80
|
-
return this.request(`${this.apiUrl}/
|
|
39
|
+
async removeContactFromList(payload) {
|
|
40
|
+
return this.request(`${this.apiUrl}/removeContactFromList`, {
|
|
81
41
|
method: 'post',
|
|
82
42
|
json: {
|
|
83
|
-
|
|
84
|
-
|
|
43
|
+
userIdentities: payload.userIdentities,
|
|
44
|
+
groupId: payload.groupId
|
|
85
45
|
}
|
|
86
46
|
});
|
|
87
47
|
}
|
|
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
48
|
}
|
|
120
49
|
exports.default = CordialClient;
|
|
121
50
|
//# sourceMappingURL=cordial-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cordial-client.js","sourceRoot":"","sources":["../../../src/destinations/cordial/cordial-client.ts"],"names":[],"mappings":";;AAOA,MAAM,aAAa;IAIjB,YAAY,QAAkB,EAAE,OAAsB;QACpD,IAAI,CAAC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,cAAc,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,kBAAkB,CAAC,OAAqC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,wBAAwB,EAAE;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,MAAM,EAAE,OA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|
[k: string]: unknown;
|
|
8
9
|
};
|
|
10
|
+
context?: {
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
};
|
|
9
13
|
}
|
|
@@ -4,37 +4,54 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
-
const common_fields_1 = require("../common-fields");
|
|
8
7
|
const action = {
|
|
9
8
|
title: 'Create Contactactivity',
|
|
10
|
-
description:
|
|
9
|
+
description: 'Create a new contact activity.',
|
|
11
10
|
defaultSubscription: 'type = "track" or type = "page"',
|
|
12
11
|
fields: {
|
|
13
|
-
|
|
12
|
+
userIdentities: {
|
|
13
|
+
label: 'User Identities',
|
|
14
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
+
type: 'object',
|
|
16
|
+
required: true,
|
|
17
|
+
defaultObjectUI: 'keyvalue:only'
|
|
18
|
+
},
|
|
14
19
|
action: {
|
|
15
20
|
label: 'Event name',
|
|
16
|
-
description: '
|
|
21
|
+
description: 'Event name. Required.',
|
|
17
22
|
type: 'string',
|
|
18
23
|
required: true,
|
|
19
24
|
default: {
|
|
20
|
-
'@
|
|
25
|
+
'@if': {
|
|
26
|
+
exists: { '@path': '$.event' },
|
|
27
|
+
then: { '@path': '$.event' },
|
|
28
|
+
else: 'pageView'
|
|
29
|
+
}
|
|
21
30
|
}
|
|
22
31
|
},
|
|
23
32
|
time: {
|
|
24
|
-
label: 'Event
|
|
25
|
-
description: '
|
|
33
|
+
label: 'Event timestamp',
|
|
34
|
+
description: 'Event timestamp. Optional. Date format is ISO 8601 standard. If empty, the request upload time will be used. ',
|
|
26
35
|
type: 'datetime',
|
|
27
36
|
default: {
|
|
28
|
-
'@path': '$.
|
|
37
|
+
'@path': '$.timestamp'
|
|
29
38
|
}
|
|
30
39
|
},
|
|
31
40
|
properties: {
|
|
32
41
|
label: 'Event properties',
|
|
33
|
-
description: '
|
|
42
|
+
description: 'An object of additional event attributes. Optional.',
|
|
34
43
|
type: 'object',
|
|
35
44
|
default: {
|
|
36
45
|
'@path': '$.properties'
|
|
37
46
|
}
|
|
47
|
+
},
|
|
48
|
+
context: {
|
|
49
|
+
label: 'Event context',
|
|
50
|
+
description: 'Event context as it appears in Segment. Optional. We use context to capture event metadata like sender ip and device info.',
|
|
51
|
+
type: 'object',
|
|
52
|
+
default: {
|
|
53
|
+
'@path': '$.context'
|
|
54
|
+
}
|
|
38
55
|
}
|
|
39
56
|
},
|
|
40
57
|
perform: (request, { settings, payload }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/createContactactivity/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,iCAAiC;IACtD,MAAM,EAAE;QACN,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,oTAAoT;YACtT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;oBAC9B,IAAI,EAAE,EAAE,OAAO,EAAE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