@segment/action-destinations 3.260.0-staging.2 → 3.260.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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/index.js +1 -0
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/customerio/test-helper.d.ts +1 -1
- package/dist/destinations/customerio/utils.d.ts +1 -1
- package/dist/destinations/display-video-360/index.js +4 -2
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +1 -1
- package/dist/destinations/engage/utils/EngageActionPerformer.js +1 -0
- package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -1
- package/dist/destinations/engage/utils/ResponseError.d.ts +1 -0
- package/dist/destinations/engage/utils/ResponseError.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +2 -2
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kafka/index.js +14 -7
- package/dist/destinations/kafka/index.js.map +1 -1
- package/dist/destinations/kafka/utils.d.ts +4 -0
- package/dist/destinations/kafka/utils.js +39 -1
- package/dist/destinations/kafka/utils.js.map +1 -1
- package/dist/destinations/kameleoon/group/generated-types.d.ts +11 -0
- package/dist/destinations/kameleoon/group/generated-types.js.map +1 -0
- package/dist/destinations/{responsys/asyncMergePetRecords → kameleoon/group}/index.d.ts +1 -1
- package/dist/destinations/kameleoon/group/index.js +85 -0
- package/dist/destinations/kameleoon/group/index.js.map +1 -0
- package/dist/destinations/kameleoon/identify/generated-types.d.ts +10 -0
- package/dist/destinations/kameleoon/identify/generated-types.js.map +1 -0
- package/dist/destinations/{responsys/asyncMergeProfileListMembers → kameleoon/identify}/index.d.ts +1 -1
- package/dist/destinations/kameleoon/identify/index.js +78 -0
- package/dist/destinations/kameleoon/identify/index.js.map +1 -0
- package/dist/destinations/kameleoon/index.js +15 -9
- package/dist/destinations/kameleoon/index.js.map +1 -1
- package/dist/destinations/kameleoon/logEvent/generated-types.d.ts +2 -0
- package/dist/destinations/kameleoon/logEvent/index.js +13 -1
- package/dist/destinations/kameleoon/logEvent/index.js.map +1 -1
- package/dist/destinations/kameleoon/page/generated-types.d.ts +14 -0
- package/dist/destinations/{engage/sendgrid/Profile.js → kameleoon/page/generated-types.js} +1 -1
- package/dist/destinations/kameleoon/page/generated-types.js.map +1 -0
- package/dist/destinations/kameleoon/page/index.d.ts +5 -0
- package/dist/destinations/kameleoon/page/index.js +90 -0
- package/dist/destinations/kameleoon/page/index.js.map +1 -0
- package/dist/destinations/klaviyo/functions.d.ts +4 -7
- package/dist/destinations/klaviyo/functions.js +1 -80
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +0 -97
- package/dist/destinations/klaviyo/upsertProfile/index.js +19 -29
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/moloco-rmp/index.js +2 -2
- package/dist/destinations/segment/segment-properties.d.ts +0 -1
- package/dist/destinations/segment/segment-properties.js +1 -8
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/generated-types.d.ts +0 -1
- package/dist/destinations/segment/sendGroup/index.js +0 -2
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +0 -1
- package/dist/destinations/segment/sendIdentify/index.js +0 -2
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/generated-types.d.ts +0 -1
- package/dist/destinations/segment/sendPage/index.js +0 -2
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/generated-types.d.ts +0 -1
- package/dist/destinations/segment/sendScreen/index.js +0 -2
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +0 -1
- package/dist/destinations/segment/sendTrack/index.js +0 -2
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js +420 -488
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
- package/dist/destinations/snap-conversions-api/index.js +42 -42
- package/dist/destinations/snap-conversions-api/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +97 -18
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +7 -29
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.d.ts +31 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.js +174 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-deprecated.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.d.ts +16 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.js +640 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-input-fields-v3.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.d.ts +0 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +593 -119
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +3 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +6 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -1
- package/dist/destinations/spiffy/generated-types.d.ts +5 -0
- package/dist/destinations/spiffy/generated-types.js +3 -0
- package/dist/destinations/spiffy/generated-types.js.map +1 -0
- package/dist/destinations/spiffy/index.d.ts +4 -0
- package/dist/destinations/spiffy/index.js +62 -0
- package/dist/destinations/spiffy/index.js.map +1 -0
- package/dist/destinations/spiffy/send/generated-types.d.ts +8 -0
- package/dist/destinations/spiffy/send/generated-types.js +3 -0
- package/dist/destinations/spiffy/send/generated-types.js.map +1 -0
- package/dist/destinations/spiffy/send/index.d.ts +5 -0
- package/dist/destinations/spiffy/send/index.js +42 -0
- package/dist/destinations/spiffy/send/index.js.map +1 -0
- package/dist/destinations/stackadapt/forwardEvent/generated-types.d.ts +4 -4
- package/dist/destinations/stackadapt/forwardEvent/index.js +11 -7
- package/dist/destinations/stackadapt/forwardEvent/index.js.map +1 -1
- package/dist/destinations/xtremepush/generated-types.d.ts +4 -0
- package/dist/destinations/xtremepush/generated-types.js +3 -0
- package/dist/destinations/xtremepush/generated-types.js.map +1 -0
- package/dist/destinations/xtremepush/identify/generated-types.d.ts +14 -0
- package/dist/destinations/xtremepush/identify/generated-types.js +3 -0
- package/dist/destinations/xtremepush/identify/generated-types.js.map +1 -0
- package/dist/destinations/xtremepush/identify/index.d.ts +5 -0
- package/dist/destinations/xtremepush/identify/index.js +87 -0
- package/dist/destinations/xtremepush/identify/index.js.map +1 -0
- package/dist/destinations/xtremepush/index.d.ts +4 -0
- package/dist/destinations/xtremepush/index.js +66 -0
- package/dist/destinations/xtremepush/index.js.map +1 -0
- package/dist/destinations/xtremepush/track/generated-types.d.ts +15 -0
- package/dist/destinations/xtremepush/track/generated-types.js +3 -0
- package/dist/destinations/xtremepush/track/generated-types.js.map +1 -0
- package/dist/destinations/xtremepush/track/index.d.ts +5 -0
- package/dist/destinations/xtremepush/track/index.js +95 -0
- package/dist/destinations/xtremepush/track/index.js.map +1 -0
- package/package.json +4 -4
- package/dist/destinations/engage/sendgrid/Profile.d.ts +0 -6
- package/dist/destinations/engage/sendgrid/Profile.js.map +0 -1
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +0 -21
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +0 -174
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
- package/dist/destinations/responsys/rsp-operations.js +0 -33
- package/dist/destinations/responsys/rsp-operations.js.map +0 -1
- package/dist/destinations/responsys/rsp-properties.d.ts +0 -4
- package/dist/destinations/responsys/rsp-properties.js +0 -27
- package/dist/destinations/responsys/rsp-properties.js.map +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +0 -381
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +0 -581
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +0 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +0 -4
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +0 -97
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +0 -1
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -30
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +0 -316
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +0 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +0 -3
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +0 -43
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
- /package/dist/destinations/{responsys/asyncMergePetRecords → kameleoon/group}/generated-types.js +0 -0
- /package/dist/destinations/{responsys/asyncMergeProfileListMembers → kameleoon/identify}/generated-types.js +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
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 omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const properties_1 = require("../properties");
|
|
8
|
+
const action = {
|
|
9
|
+
title: 'Group Event',
|
|
10
|
+
description: 'Send group traits to Kameleoon',
|
|
11
|
+
defaultSubscription: 'type = "group"',
|
|
12
|
+
fields: {
|
|
13
|
+
anonymousId: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Anonymous id',
|
|
16
|
+
label: 'Anonymous ID',
|
|
17
|
+
default: { '@path': '$.anonymousId' }
|
|
18
|
+
},
|
|
19
|
+
userId: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The ID associated with the user',
|
|
22
|
+
label: 'User ID',
|
|
23
|
+
default: { '@path': '$.userId' }
|
|
24
|
+
},
|
|
25
|
+
groupId: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'The group id',
|
|
28
|
+
label: 'Group ID',
|
|
29
|
+
required: true,
|
|
30
|
+
default: { '@path': '$.groupId' }
|
|
31
|
+
},
|
|
32
|
+
properties: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
required: false,
|
|
35
|
+
description: 'Traits to send with the event',
|
|
36
|
+
label: 'User Traits',
|
|
37
|
+
default: {
|
|
38
|
+
'@path': '$.traits'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
kameleoonVisitorCode: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: false,
|
|
44
|
+
description: 'Kameleoon Visitor Code - a unique identifier for the user',
|
|
45
|
+
label: 'Kameleoon Visitor Code',
|
|
46
|
+
default: {
|
|
47
|
+
'@path': '$.traits.kameleoonVisitorCode'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
timestamp: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
format: 'date-time',
|
|
53
|
+
required: true,
|
|
54
|
+
description: 'The timestamp of the event',
|
|
55
|
+
label: 'Timestamp',
|
|
56
|
+
default: { '@path': '$.timestamp' }
|
|
57
|
+
},
|
|
58
|
+
messageId: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
required: true,
|
|
61
|
+
description: 'The Segment messageId',
|
|
62
|
+
label: 'MessageId',
|
|
63
|
+
default: { '@path': '$.messageId' }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
perform: (request, data) => {
|
|
67
|
+
const payload = {
|
|
68
|
+
...omit_1.default(data.payload, ['kameleoonVisitorCode']),
|
|
69
|
+
properties: {
|
|
70
|
+
...(data.payload.properties || {}),
|
|
71
|
+
kameleoonVisitorCode: data.payload.kameleoonVisitorCode
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return request(properties_1.BASE_URL, {
|
|
75
|
+
headers: {
|
|
76
|
+
authorization: `Basic ${data.settings.apiKey}`,
|
|
77
|
+
'x-segment-settings': data.settings.sitecode
|
|
78
|
+
},
|
|
79
|
+
method: 'post',
|
|
80
|
+
json: payload
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
exports.default = action;
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/group/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;SAClC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+BAA+B;YAC5C,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,2DAA2D;YACxE,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE;gBACP,OAAO,EAAE,+BAA+B;aACzC;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,4BAA4B;YACzC,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG;YACd,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,sBAAsB,CAAC,CAAC;YAC/C,UAAU,EAAE;gBACV,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;gBAClC,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;aACxD;SACF,CAAA;QACD,OAAO,OAAO,CAAC,qBAAQ,EAAE;YACvB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAC9C,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;aAC7C;YACD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/identify/generated-types.ts"],"names":[],"mappings":""}
|
package/dist/destinations/{responsys/asyncMergeProfileListMembers → kameleoon/identify}/index.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionDefinition } from '@segment/actions-core';
|
|
1
|
+
import type { ActionDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from '../generated-types';
|
|
3
3
|
import type { Payload } from './generated-types';
|
|
4
4
|
declare const action: ActionDefinition<Settings, Payload>;
|
|
@@ -0,0 +1,78 @@
|
|
|
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 omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const properties_1 = require("../properties");
|
|
8
|
+
const action = {
|
|
9
|
+
title: 'Identify Event',
|
|
10
|
+
description: 'Send user traits to Kameleoon',
|
|
11
|
+
defaultSubscription: 'type = "identify"',
|
|
12
|
+
fields: {
|
|
13
|
+
anonymousId: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Anonymous id',
|
|
16
|
+
label: 'Anonymous ID',
|
|
17
|
+
default: { '@path': '$.anonymousId' }
|
|
18
|
+
},
|
|
19
|
+
userId: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The ID associated with the user',
|
|
22
|
+
label: 'User ID',
|
|
23
|
+
default: { '@path': '$.userId' }
|
|
24
|
+
},
|
|
25
|
+
properties: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
required: false,
|
|
28
|
+
description: 'Traits to send with the event',
|
|
29
|
+
label: 'User Traits',
|
|
30
|
+
default: {
|
|
31
|
+
'@path': '$.traits'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
kameleoonVisitorCode: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: false,
|
|
37
|
+
description: 'Kameleoon Visitor Code - a unique identifier for the user',
|
|
38
|
+
label: 'Kameleoon Visitor Code',
|
|
39
|
+
default: {
|
|
40
|
+
'@path': '$.traits.kameleoonVisitorCode'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
timestamp: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
format: 'date-time',
|
|
46
|
+
required: true,
|
|
47
|
+
description: 'The timestamp of the event',
|
|
48
|
+
label: 'Timestamp',
|
|
49
|
+
default: { '@path': '$.timestamp' }
|
|
50
|
+
},
|
|
51
|
+
messageId: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: true,
|
|
54
|
+
description: 'The Segment messageId',
|
|
55
|
+
label: 'MessageId',
|
|
56
|
+
default: { '@path': '$.messageId' }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
perform: (request, data) => {
|
|
60
|
+
const payload = {
|
|
61
|
+
...omit_1.default(data.payload, ['kameleoonVisitorCode']),
|
|
62
|
+
properties: {
|
|
63
|
+
...(data.payload.properties || {}),
|
|
64
|
+
kameleoonVisitorCode: data.payload.kameleoonVisitorCode
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return request(properties_1.BASE_URL, {
|
|
68
|
+
headers: {
|
|
69
|
+
authorization: `Basic ${data.settings.apiKey}`,
|
|
70
|
+
'x-segment-settings': data.settings.sitecode
|
|
71
|
+
},
|
|
72
|
+
method: 'post',
|
|
73
|
+
json: payload
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.default = action;
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/identify/index.ts"],"names":[],"mappings":";;;;;AAIA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EA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AE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -5,6 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const logEvent_1 = __importDefault(require("./logEvent"));
|
|
8
|
+
const identify_1 = __importDefault(require("./identify"));
|
|
9
|
+
const group_1 = __importDefault(require("./group"));
|
|
10
|
+
const page_1 = __importDefault(require("./page"));
|
|
8
11
|
const properties_1 = require("./properties");
|
|
9
12
|
const presets = [
|
|
10
13
|
{
|
|
@@ -17,22 +20,22 @@ const presets = [
|
|
|
17
20
|
{
|
|
18
21
|
name: 'Page Calls',
|
|
19
22
|
subscribe: 'type = "page"',
|
|
20
|
-
partnerAction: '
|
|
21
|
-
mapping: actions_core_1.defaultValues(
|
|
23
|
+
partnerAction: 'page',
|
|
24
|
+
mapping: actions_core_1.defaultValues(page_1.default.fields),
|
|
22
25
|
type: 'automatic'
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
|
-
name: '
|
|
26
|
-
subscribe: 'type = "
|
|
27
|
-
partnerAction: '
|
|
28
|
-
mapping: actions_core_1.defaultValues(
|
|
28
|
+
name: 'Group Calls',
|
|
29
|
+
subscribe: 'type = "group"',
|
|
30
|
+
partnerAction: 'group',
|
|
31
|
+
mapping: actions_core_1.defaultValues(group_1.default.fields),
|
|
29
32
|
type: 'automatic'
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
35
|
name: 'Identify Calls',
|
|
33
36
|
subscribe: 'type = "identify"',
|
|
34
|
-
partnerAction: '
|
|
35
|
-
mapping: actions_core_1.defaultValues(
|
|
37
|
+
partnerAction: 'identify',
|
|
38
|
+
mapping: actions_core_1.defaultValues(identify_1.default.fields),
|
|
36
39
|
type: 'automatic'
|
|
37
40
|
}
|
|
38
41
|
];
|
|
@@ -71,7 +74,10 @@ const destination = {
|
|
|
71
74
|
},
|
|
72
75
|
presets,
|
|
73
76
|
actions: {
|
|
74
|
-
logEvent: logEvent_1.default
|
|
77
|
+
logEvent: logEvent_1.default,
|
|
78
|
+
identify: identify_1.default,
|
|
79
|
+
group: group_1.default,
|
|
80
|
+
page: page_1.default
|
|
75
81
|
}
|
|
76
82
|
};
|
|
77
83
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/kameleoon/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,0DAAiC;AACjC,6CAAuC;AAEvC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,UAAU;QACzB,OAAO,EAAE,4BAAa,CAAC,kBAAQ,CAAC,MAAM,CAAC;QACvC,IAAI,EAAE,WAAW;KAClB;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/kameleoon/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,0DAAiC;AACjC,0DAAiC;AACjC,oDAA2B;AAC3B,kDAAyB;AAEzB,6CAAuC;AAEvC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,UAAU;QACzB,OAAO,EAAE,4BAAa,CAAC,kBAAQ,CAAC,MAAM,CAAC;QACvC,IAAI,EAAE,WAAW;KAClB;IACD;QACE,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,MAAM;QACrB,OAAO,EAAE,4BAAa,CAAC,cAAI,CAAC,MAAM,CAAC;QACnC,IAAI,EAAE,WAAW;KAClB;IACD;QACE,IA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CAAC,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;iBACxC,IAAI,CAAC,GAAG,CAAC,CAAA;YAEZ,OAAO,OAAO,CAAC,qBAAQ,GAAG,aAAa,GAAG,MAAM,EAAE;gBAChD,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO;IACP,OAAO,EAAE;QACP,QAAQ,EAAR,kBAAQ;QACR,QAAQ,EAAR,kBAAQ;QACR,KAAK,EAAL,eAAK;QACL,IAAI,EAAJ,cAAI;KACL;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -7,9 +7,21 @@ const omit_1 = __importDefault(require("lodash/omit"));
|
|
|
7
7
|
const properties_1 = require("../properties");
|
|
8
8
|
const action = {
|
|
9
9
|
title: 'Log Event',
|
|
10
|
-
description: 'Send
|
|
10
|
+
description: 'Send a track event to Kameleoon',
|
|
11
11
|
defaultSubscription: 'type = "track"',
|
|
12
12
|
fields: {
|
|
13
|
+
anonymousId: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Anonymous id',
|
|
16
|
+
label: 'Anonymous ID',
|
|
17
|
+
default: { '@path': '$.anonymousId' }
|
|
18
|
+
},
|
|
19
|
+
userId: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The ID associated with the user',
|
|
22
|
+
label: 'User ID',
|
|
23
|
+
default: { '@path': '$.userId' }
|
|
24
|
+
},
|
|
13
25
|
event: {
|
|
14
26
|
type: 'string',
|
|
15
27
|
required: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/logEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/logEvent/index.ts"],"names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AQ,EAAE;YACvB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAC9C,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;aAC7C;YACD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
anonymousId?: string;
|
|
3
|
+
userId?: string;
|
|
4
|
+
properties?: {
|
|
5
|
+
[k: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
kameleoonVisitorCode?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
context?: {
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
timestamp: string;
|
|
13
|
+
messageId?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/page/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
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 omit_1 = __importDefault(require("lodash/omit"));
|
|
7
|
+
const properties_1 = require("../properties");
|
|
8
|
+
const action = {
|
|
9
|
+
title: 'Page Event',
|
|
10
|
+
description: 'Send a page event to Kameleoon',
|
|
11
|
+
defaultSubscription: 'type = "page"',
|
|
12
|
+
fields: {
|
|
13
|
+
anonymousId: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Anonymous id',
|
|
16
|
+
label: 'Anonymous ID',
|
|
17
|
+
default: { '@path': '$.anonymousId' }
|
|
18
|
+
},
|
|
19
|
+
userId: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The ID associated with the user',
|
|
22
|
+
label: 'User ID',
|
|
23
|
+
default: { '@path': '$.userId' }
|
|
24
|
+
},
|
|
25
|
+
properties: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
required: false,
|
|
28
|
+
description: 'Page properties',
|
|
29
|
+
label: 'Properties',
|
|
30
|
+
default: { '@path': '$.properties' }
|
|
31
|
+
},
|
|
32
|
+
kameleoonVisitorCode: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: false,
|
|
35
|
+
description: 'Kameleoon Visitor Code - a unique identifier for the user',
|
|
36
|
+
label: 'Kameleoon Visitor Code',
|
|
37
|
+
default: { '@path': '$.properties.kameleoonVisitorCode' }
|
|
38
|
+
},
|
|
39
|
+
name: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: false,
|
|
42
|
+
description: 'The name of the page',
|
|
43
|
+
label: 'Page Name',
|
|
44
|
+
default: {
|
|
45
|
+
'@path': '$.name'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
context: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
required: false,
|
|
51
|
+
description: 'Context properties to send with the event',
|
|
52
|
+
label: 'Context properties',
|
|
53
|
+
default: { '@path': '$.context' }
|
|
54
|
+
},
|
|
55
|
+
timestamp: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
format: 'date-time',
|
|
58
|
+
required: true,
|
|
59
|
+
description: 'The timestamp of the event',
|
|
60
|
+
label: 'Timestamp',
|
|
61
|
+
default: { '@path': '$.timestamp' }
|
|
62
|
+
},
|
|
63
|
+
messageId: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
required: false,
|
|
66
|
+
description: 'The Segment messageId',
|
|
67
|
+
label: 'MessageId',
|
|
68
|
+
default: { '@path': '$.messageId' }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
perform: (request, data) => {
|
|
72
|
+
const payload = {
|
|
73
|
+
...omit_1.default(data.payload, ['kameleoonVisitorCode']),
|
|
74
|
+
properties: {
|
|
75
|
+
...(data.payload.properties || {}),
|
|
76
|
+
kameleoonVisitorCode: data.payload.kameleoonVisitorCode
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return request(properties_1.BASE_URL, {
|
|
80
|
+
headers: {
|
|
81
|
+
authorization: `Basic ${data.settings.apiKey}`,
|
|
82
|
+
'x-segment-settings': data.settings.sitecode
|
|
83
|
+
},
|
|
84
|
+
method: 'post',
|
|
85
|
+
json: payload
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.default = action;
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/kameleoon/page/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAA8B;AAE9B,8CAAwC;AAExC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,gCAAgC;IAC7C,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iCAAiC;YAC9C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,iBAAiB;YAC9B,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EA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C9C,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;aAC7C;YACD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { RequestClient, DynamicFieldResponse } from '@segment/actions-core';
|
|
2
|
-
import { ImportJobPayload
|
|
2
|
+
import { ImportJobPayload } from './types';
|
|
3
3
|
import { Payload } from './upsertProfile/generated-types';
|
|
4
|
-
import { ModifiedResponse } from '@segment/actions-core/*';
|
|
5
4
|
export declare function getListIdDynamicData(request: RequestClient): Promise<DynamicFieldResponse>;
|
|
6
|
-
export declare function addProfileToList(request: RequestClient, id: string, list_id: string | undefined): Promise<ModifiedResponse<unknown>>;
|
|
7
|
-
export declare function removeProfileFromList(request: RequestClient, ids: string[], list_id: string): Promise<ModifiedResponse<unknown>>;
|
|
5
|
+
export declare function addProfileToList(request: RequestClient, id: string, list_id: string | undefined): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
6
|
+
export declare function removeProfileFromList(request: RequestClient, ids: string[], list_id: string): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
8
7
|
export declare function createProfile(request: RequestClient, email: string | undefined, external_id: string | undefined): Promise<any>;
|
|
9
8
|
export declare function buildHeaders(authKey: string): {
|
|
10
9
|
Authorization: string;
|
|
@@ -17,7 +16,5 @@ export declare const createImportJobPayload: (profiles: Payload[], listId?: stri
|
|
|
17
16
|
};
|
|
18
17
|
export declare const sendImportJobRequest: (request: RequestClient, importJobPayload: {
|
|
19
18
|
data: ImportJobPayload;
|
|
20
|
-
}) => Promise<ModifiedResponse<
|
|
19
|
+
}) => Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
21
20
|
export declare function getProfiles(request: RequestClient, emails: string[] | undefined, external_ids: string[] | undefined): Promise<string[]>;
|
|
22
|
-
export declare function pollKlaviyoJobStatus(request: RequestClient, jobId: string, interval?: number, timeout?: number): Promise<KlaviyoJobStatusResponse>;
|
|
23
|
-
export declare function subscribeProfiles(request: RequestClient, profiles: SubProfile | SubProfile[], customSource?: string): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getProfiles = exports.sendImportJobRequest = exports.createImportJobPayload = exports.buildHeaders = exports.createProfile = exports.removeProfileFromList = exports.addProfileToList = exports.getListIdDynamicData = void 0;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
async function getListIdDynamicData(request) {
|
|
6
6
|
try {
|
|
@@ -143,83 +143,4 @@ async function getProfiles(request, emails, external_ids) {
|
|
|
143
143
|
return Array.from(new Set(profileIds));
|
|
144
144
|
}
|
|
145
145
|
exports.getProfiles = getProfiles;
|
|
146
|
-
async function pollKlaviyoJobStatus(request, jobId, interval = 10000, timeout = 300000) {
|
|
147
|
-
const startTime = Date.now();
|
|
148
|
-
return new Promise((resolve, reject) => {
|
|
149
|
-
const checkStatus = async () => {
|
|
150
|
-
try {
|
|
151
|
-
const response = await request(`${config_1.API_URL}/profile-bulk-import-jobs/${jobId}/`, {
|
|
152
|
-
method: 'GET',
|
|
153
|
-
headers: {
|
|
154
|
-
revision: '2023-10-15.pre'
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
const parsedData = JSON.parse(response.data);
|
|
158
|
-
const jobStatus = parsedData.data.attributes.status;
|
|
159
|
-
if (jobStatus === 'complete') {
|
|
160
|
-
resolve(parsedData);
|
|
161
|
-
}
|
|
162
|
-
else if (Date.now() - startTime > timeout) {
|
|
163
|
-
reject(new Error('Polling timed out'));
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
setTimeout(checkStatusWrapper, interval);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
catch (error) {
|
|
170
|
-
reject(error);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
const checkStatusWrapper = () => {
|
|
174
|
-
checkStatus().catch(reject);
|
|
175
|
-
};
|
|
176
|
-
checkStatusWrapper();
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
exports.pollKlaviyoJobStatus = pollKlaviyoJobStatus;
|
|
180
|
-
async function subscribeProfiles(request, profiles, customSource = 'Marketing Event') {
|
|
181
|
-
if (!Array.isArray(profiles)) {
|
|
182
|
-
profiles = [profiles];
|
|
183
|
-
}
|
|
184
|
-
const profileSubscriptions = profiles.map((profile) => {
|
|
185
|
-
const profileData = {
|
|
186
|
-
type: 'profile',
|
|
187
|
-
attributes: {}
|
|
188
|
-
};
|
|
189
|
-
if (profile.email) {
|
|
190
|
-
profileData.attributes.email = profile?.email;
|
|
191
|
-
}
|
|
192
|
-
if (profile.phone_number) {
|
|
193
|
-
profileData.attributes.phone_number = profile?.phone_number;
|
|
194
|
-
}
|
|
195
|
-
return profileData;
|
|
196
|
-
});
|
|
197
|
-
const subData = {
|
|
198
|
-
data: {
|
|
199
|
-
type: 'profile-subscription-bulk-create-job',
|
|
200
|
-
attributes: {
|
|
201
|
-
custom_source: customSource,
|
|
202
|
-
profiles: {
|
|
203
|
-
data: profileSubscriptions
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const listId = profiles[0].list_id;
|
|
209
|
-
if (listId) {
|
|
210
|
-
subData.data.relationships = {
|
|
211
|
-
list: {
|
|
212
|
-
data: {
|
|
213
|
-
type: 'list',
|
|
214
|
-
id: listId
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
await request(`${config_1.API_URL}/profile-subscription-bulk-create-jobs/`, {
|
|
220
|
-
method: 'POST',
|
|
221
|
-
json: subData
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
exports.subscribeProfiles = subscribeProfiles;
|
|
225
146
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AACA,qCAAiD;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AACA,qCAAiD;AAY1C,KAAK,UAAU,oBAAoB,CAAC,OAAsB;IAC/D,IAAI;QACF,MAAM,MAAM,GAAmB,MAAM,OAAO,CAAC,GAAG,gBAAO,SAAS,EAAE;YAChE,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAkD,EAAE,EAAE;YACzG,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;QACxD,CAAC,CAAC,CAAA;QACF,OAAO;YACL,OAAO;SACR,CAAA;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO;YACL,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE;gBACL,OAAO,EAAG,GAAgB,CAAC,OAAO,IAAI,eAAe;gBACrD,IAAI,EAAG,GAAgB,CAAC,MAAM,GAAG,EAAE,IAAI,eAAe;aACvD;SACF,CAAA;KACF;AACH,CAAC;AArBD,oDAqBC;AAEM,KAAK,UAAU,gBAAgB,CAAC,OAAsB,EAAE,EAAU,EAAE,OAA2B;IACpG,MAAM,QAAQ,GAAa;QACzB,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,SAAS;gBACf,EAAE,EAAE,EAAE;aACP;SACF;KACF,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,UAAU,OAAO,0BAA0B,EAAE;QAChF,MAAM,EAAE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