@segment/action-destinations 3.335.2-staging.0 → 3.335.2-staging.1
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/amazon-ads/generated-types.d.ts +3 -0
- package/dist/destinations/amazon-ads/generated-types.js +3 -0
- package/dist/destinations/amazon-ads/generated-types.js.map +1 -0
- package/dist/destinations/amazon-ads/index.d.ts +4 -0
- package/dist/destinations/amazon-ads/index.js +87 -0
- package/dist/destinations/amazon-ads/index.js.map +1 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +2 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js +3 -0
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +1 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.d.ts +5 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.js +15 -0
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -0
- package/dist/destinations/amazon-ads/types.d.ts +22 -0
- package/dist/destinations/amazon-ads/types.js +11 -0
- package/dist/destinations/amazon-ads/types.js.map +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +43 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/segment/generated-types.d.ts +0 -1
- package/dist/destinations/segment/index.js +3 -13
- package/dist/destinations/segment/index.js.map +1 -1
- package/dist/destinations/segment/properties.d.ts +1 -1
- package/dist/destinations/segment/properties.js +3 -3
- package/dist/destinations/segment/properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/index.js +5 -16
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/index.js +5 -16
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/index.js +5 -16
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/index.js +5 -16
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/index.js +5 -16
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/segment-profiles/generated-types.d.ts +0 -1
- package/dist/destinations/segment-profiles/index.js +0 -18
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js +5 -20
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js +5 -20
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js +5 -21
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
movable_ink_url?: string;
|
|
3
|
+
event_name: string;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
anonymous_id?: string;
|
|
6
|
+
timestamp: string | number;
|
|
7
|
+
timezone?: string;
|
|
8
|
+
products_required_false?: {
|
|
9
|
+
id: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
price?: number;
|
|
12
|
+
url?: string;
|
|
13
|
+
quantity?: number;
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
}[];
|
|
16
|
+
categories_required_false?: {
|
|
17
|
+
id: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}[];
|
|
20
|
+
order_id_required_false?: string;
|
|
21
|
+
revenue_required_false?: number;
|
|
22
|
+
meta?: {
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/sendCustomEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const fields_1 = require("../fields");
|
|
8
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Send Custom Event',
|
|
11
|
+
description: 'Send a Custom Segment event to Movable Ink',
|
|
12
|
+
defaultSubscription: 'type = "track"',
|
|
13
|
+
fields: {
|
|
14
|
+
movable_ink_url: fields_1.movable_ink_url,
|
|
15
|
+
event_name: fields_1.event_name,
|
|
16
|
+
user_id: fields_1.user_id,
|
|
17
|
+
anonymous_id: fields_1.anonymous_id,
|
|
18
|
+
timestamp: fields_1.timestamp,
|
|
19
|
+
timezone: fields_1.timezone,
|
|
20
|
+
products_required_false: fields_1.products_required_false,
|
|
21
|
+
categories_required_false: fields_1.categories_required_false,
|
|
22
|
+
order_id_required_false: fields_1.order_id_required_false,
|
|
23
|
+
revenue_required_false: fields_1.revenue_required_false,
|
|
24
|
+
meta: fields_1.meta
|
|
25
|
+
},
|
|
26
|
+
perform: (request, { settings, payload }) => {
|
|
27
|
+
const url = payload?.movable_ink_url ?? settings?.movable_ink_url;
|
|
28
|
+
if (!url)
|
|
29
|
+
throw new actions_core_1.IntegrationError('"Movable Ink URL" setting or "Movable Ink URL" field must be populated', 'MISSING_DESTINATION_URL', 400);
|
|
30
|
+
return request(url, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
json: {
|
|
33
|
+
event_name: payload.event_name,
|
|
34
|
+
user_id: payload.user_id,
|
|
35
|
+
anonymous_id: payload.anonymous_id,
|
|
36
|
+
timestamp: payload.timestamp,
|
|
37
|
+
timezone: payload.timezone,
|
|
38
|
+
products: payload.products_required_false,
|
|
39
|
+
categories: payload.categories_required_false,
|
|
40
|
+
order_id: payload.order_id_required_false,
|
|
41
|
+
revenue: payload.revenue_required_false,
|
|
42
|
+
metadata: { ...omit_1.default(payload.meta, ['products', 'categories', 'order_id', 'revenue']) }
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.default = action;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/sendCustomEvent/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAG1E,sCAYkB;AAClB,uDAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,eAAe,EAAf,wBAAe;QACf,UAAU,EAAV,mBAAU;QACV,OAAO,EAAP,gBAAO;QACP,YAAY,EAAZ,qBAAY;QACZ,SAAS,EAAT,kBAAS;QACT,QAAQ,EAAR,iBAAQ;QACR,uBAAuB,EAAvB,gCAAuB;QACvB,yBAAyB,EAAzB,kCAAyB;QACzB,uBAAuB,EAAvB,gCAAuB;QACvB,sBAAsB,EAAtB,+BAAsB;QACtB,IAAI,EAAJ,aAAI;KACL;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,CAAA;QACjE,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,+BAAgB,CACxB,wEAAwE,EACxE,yBAAyB,EACzB,GAAG,CACJ,CAAA;QAEH,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,OAAO,CAAC,uBAAuB;gBACzC,UAAU,EAAE,OAAO,CAAC,yBAAyB;gBAC7C,QAAQ,EAAE,OAAO,CAAC,uBAAuB;gBACzC,OAAO,EAAE,OAAO,CAAC,sBAAsB;gBACvC,QAAQ,EAAE,EAAE,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE;aACvF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -21,22 +21,12 @@ const destination = {
|
|
|
21
21
|
description: 'The **Write Key** of a Segment source.',
|
|
22
22
|
type: 'string',
|
|
23
23
|
required: true
|
|
24
|
-
},
|
|
25
|
-
endpoint: {
|
|
26
|
-
label: 'Endpoint Region',
|
|
27
|
-
description: 'The region to send your data.',
|
|
28
|
-
type: 'string',
|
|
29
|
-
format: 'text',
|
|
30
|
-
choices: Object.keys(properties_1.SEGMENT_ENDPOINTS).map((key) => ({
|
|
31
|
-
label: properties_1.SEGMENT_ENDPOINTS[key].label,
|
|
32
|
-
value: key
|
|
33
|
-
})),
|
|
34
|
-
default: properties_1.DEFAULT_SEGMENT_ENDPOINT
|
|
35
24
|
}
|
|
36
25
|
},
|
|
37
26
|
testAuthentication: async (request, { settings }) => {
|
|
38
|
-
const { source_write_key
|
|
39
|
-
|
|
27
|
+
const { source_write_key } = settings;
|
|
28
|
+
const AWS_REGION = process.env['AWS_REGION'] || properties_1.DEFAULT_SEGMENT_ENDPOINT;
|
|
29
|
+
return request(`${properties_1.SEGMENT_ENDPOINTS[AWS_REGION].cdn}/projects/${source_write_key}/settings`);
|
|
40
30
|
}
|
|
41
31
|
},
|
|
42
32
|
extendRequest({ settings }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment/index.ts"],"names":[],"mappings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YACL,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aAC1F;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;QACZ,SAAS,EAAT,mBAAS;QACT,UAAU,EAAV,oBAAU;QACV,QAAQ,EAAR,kBAAQ;QACR,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_SEGMENT_ENDPOINT = exports.SEGMENT_ENDPOINTS = void 0;
|
|
4
4
|
exports.SEGMENT_ENDPOINTS = {
|
|
5
|
-
|
|
5
|
+
'us-west-2': {
|
|
6
6
|
label: 'North America',
|
|
7
7
|
url: 'https://api.segment.io/v1',
|
|
8
8
|
cdn: 'https://cdn.segment.com/v1'
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
'eu-west-1': {
|
|
11
11
|
label: 'Europe',
|
|
12
12
|
url: 'https://events.eu1.segmentapis.com/v1',
|
|
13
13
|
cdn: 'https://cdn.segment.com/v1'
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
exports.DEFAULT_SEGMENT_ENDPOINT = '
|
|
16
|
+
exports.DEFAULT_SEGMENT_ENDPOINT = 'us-west-2';
|
|
17
17
|
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/segment/properties.ts"],"names":[],"mappings":";;;AAMa,QAAA,iBAAiB,GAAuC;IACnE,
|
|
1
|
+
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/segment/properties.ts"],"names":[],"mappings":";;;AAMa,QAAA,iBAAiB,GAAuC;IACnE,WAAW,EAAE;QACX,KAAK,EAAE,eAAe;QACtB,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,4BAA4B;KAClC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,uCAAuC;QAC5C,GAAG,EAAE,4BAA4B;KAClC;CACF,CAAA;AAEY,QAAA,wBAAwB,GAAG,WAAW,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Group',
|
|
@@ -26,7 +25,7 @@ const action = {
|
|
|
26
25
|
timezone: segment_properties_1.timezone,
|
|
27
26
|
traits: segment_properties_1.traits
|
|
28
27
|
},
|
|
29
|
-
perform: (
|
|
28
|
+
perform: (_request, { payload, statsContext }) => {
|
|
30
29
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
31
30
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
32
31
|
}
|
|
@@ -51,21 +50,11 @@ const action = {
|
|
|
51
50
|
},
|
|
52
51
|
traits: {
|
|
53
52
|
...payload?.traits
|
|
54
|
-
}
|
|
53
|
+
},
|
|
54
|
+
type: 'group'
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
60
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendGroup']);
|
|
61
|
-
const payload = { ...groupPayload, type: 'group' };
|
|
62
|
-
return { batch: [payload] };
|
|
63
|
-
}
|
|
64
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
65
|
-
return request(`${selectedSegmentEndpoint}/group`, {
|
|
66
|
-
method: 'POST',
|
|
67
|
-
json: groupPayload
|
|
68
|
-
});
|
|
56
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendGroup']);
|
|
57
|
+
return { batch: [groupPayload] };
|
|
69
58
|
}
|
|
70
59
|
};
|
|
71
60
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendGroup/index.ts"],"names":[],"mappings":";;AAGA,8DAkB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendGroup/index.ts"],"names":[],"mappings":";;AAGA,8DAkB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,wGAAwG;IACrH,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,QAAQ,EAAE,EAAE,GAAG,6BAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,SAAS,EAAT,8BAAS;QACT,WAAW,EAAX,gCAAW;QACX,mBAAmB,EAAnB,wCAAmB;QACnB,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;QACN,QAAQ,EAAR,6BAAQ;QACR,OAAO,EAAP,4BAAO;QACP,gBAAgB,EAAhB,qCAAgB;QAChB,IAAI,EAAJ,yBAAI;QACJ,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR,MAAM,EAAN,2BAAM;KACP;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QAED,MAAM,YAAY,GAAW;YAC3B,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,OAAO,EAAE,OAAO,EAAE,QAAQ;YAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,OAAO,EAAE;gBACP,GAAG,EAAE,OAAO,EAAE,WAAW;gBACzB,QAAQ,EAAE,OAAO,EAAE,mBAAmB;gBACtC,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,EAAE,EAAE,OAAO,EAAE,UAAU;gBACvB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,EAAE,EAAE,OAAO,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,OAAO,EAAE,IAAI;gBACnB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,SAAS,EAAE,OAAO,EAAE,UAAU;gBAC9B,QAAQ,EAAE,OAAO,EAAE,QAAQ;aAC5B;YACD,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;YACD,IAAI,EAAE,OAAO;SACd,CAAA;QAID,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAC/F,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,CAAA;IAClC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Identify',
|
|
@@ -26,7 +25,7 @@ const action = {
|
|
|
26
25
|
group_id: segment_properties_1.group_id,
|
|
27
26
|
traits: segment_properties_1.traits
|
|
28
27
|
},
|
|
29
|
-
perform: (
|
|
28
|
+
perform: (_request, { payload, statsContext }) => {
|
|
30
29
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
31
30
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
32
31
|
}
|
|
@@ -51,21 +50,11 @@ const action = {
|
|
|
51
50
|
},
|
|
52
51
|
traits: {
|
|
53
52
|
...payload?.traits
|
|
54
|
-
}
|
|
53
|
+
},
|
|
54
|
+
type: 'identify'
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
60
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendIdentify']);
|
|
61
|
-
const payload = { ...identifyPayload, type: 'identify' };
|
|
62
|
-
return { batch: [payload] };
|
|
63
|
-
}
|
|
64
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
65
|
-
return request(`${selectedSegmentEndpoint}/identify`, {
|
|
66
|
-
method: 'POST',
|
|
67
|
-
json: identifyPayload
|
|
68
|
-
});
|
|
56
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendIdentify']);
|
|
57
|
+
return { batch: [identifyPayload] };
|
|
69
58
|
}
|
|
70
59
|
};
|
|
71
60
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAkB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAkB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAA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EAAE,MAAM;gBACvB,SAAS,EAAE,OAAO,EAAE,UAAU;gBAC9B,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ;aAC3B;YACD,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;YACD,IAAI,EAAE,UAAU;SACjB,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAA;QAClG,OAAO,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE,CAAA;IACrC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Page',
|
|
@@ -28,7 +27,7 @@ const action = {
|
|
|
28
27
|
group_id: segment_properties_1.group_id,
|
|
29
28
|
properties: segment_properties_1.properties
|
|
30
29
|
},
|
|
31
|
-
perform: (
|
|
30
|
+
perform: (_request, { payload, statsContext }) => {
|
|
32
31
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
33
32
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
34
33
|
}
|
|
@@ -61,21 +60,11 @@ const action = {
|
|
|
61
60
|
title: payload?.page?.title,
|
|
62
61
|
url: payload?.page?.url,
|
|
63
62
|
...payload?.properties
|
|
64
|
-
}
|
|
63
|
+
},
|
|
64
|
+
type: 'page'
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
70
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendPage']);
|
|
71
|
-
const payload = { ...pagePayload, type: 'page' };
|
|
72
|
-
return { batch: [payload] };
|
|
73
|
-
}
|
|
74
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
75
|
-
return request(`${selectedSegmentEndpoint}/page`, {
|
|
76
|
-
method: 'POST',
|
|
77
|
-
json: pagePayload
|
|
78
|
-
});
|
|
66
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendPage']);
|
|
67
|
+
return { batch: [pagePayload] };
|
|
79
68
|
}
|
|
80
69
|
};
|
|
81
70
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendPage/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendPage/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,uFAAuF;IACpG,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,SAAS,EAAT,8BAAS;QACT,SAAS,EAAT,8BAAS;QACT,aAAa,EAAb,kCAAa;QACb,WAAW,EAAX,gCAAW;QACX,mBAAmB,EAAnB,wCAAmB;QACnB,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;QACN,QAAQ,EAAR,6BAAQ;QACR,OAAO,EAAP,4BAAO;QACP,gBAAgB,EAAhB,qCAAgB;QAChB,IAAI,EAAJ,yBAAI;QACJ,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR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B,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG;gBACvB,GAAG,OAAO,EAAE,UAAU;aACvB;YACD,IAAI,EAAE,MAAM;SACb,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAA;QAC9F,OAAO,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Screen',
|
|
@@ -27,7 +26,7 @@ const action = {
|
|
|
27
26
|
group_id: segment_properties_1.group_id,
|
|
28
27
|
properties: segment_properties_1.properties
|
|
29
28
|
},
|
|
30
|
-
perform: (
|
|
29
|
+
perform: (_request, { payload, statsContext }) => {
|
|
31
30
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
32
31
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
33
32
|
}
|
|
@@ -53,21 +52,11 @@ const action = {
|
|
|
53
52
|
properties: {
|
|
54
53
|
name: payload?.screen_name,
|
|
55
54
|
...payload?.properties
|
|
56
|
-
}
|
|
55
|
+
},
|
|
56
|
+
type: 'screen'
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
62
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendScreen']);
|
|
63
|
-
const payload = { ...screenPayload, type: 'screen' };
|
|
64
|
-
return { batch: [payload] };
|
|
65
|
-
}
|
|
66
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
67
|
-
return request(`${selectedSegmentEndpoint}/screen`, {
|
|
68
|
-
method: 'POST',
|
|
69
|
-
json: screenPayload
|
|
70
|
-
});
|
|
58
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendScreen']);
|
|
59
|
+
return { batch: [screenPayload] };
|
|
71
60
|
}
|
|
72
61
|
};
|
|
73
62
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendScreen/index.ts"],"names":[],"mappings":";;AAGA,8DAmB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendScreen/index.ts"],"names":[],"mappings":";;AAGA,8DAmB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,8FAA8F;IAC3G,mBAAmB,EAAE,iBAAiB;IACtC,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,SAAS,EAAT,8BAAS;QACT,WAAW,EAAX,gCAAW;QACX,WAAW,EAAX,gCAAW;QACX,mBAAmB,EAAnB,wCAAmB;QACnB,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;QACN,QAAQ,EAAR,6BAAQ;QACR,OAAO,EAAP,4BAAO;QACP,gBAAgB,EAAhB,qCAAgB;QAChB,IAAI,EAAJ,yBAAI;QACJ,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR,QAAQ,EAAR,6BAAQ;QACR,UAAU,EAAV,+BAAU;KACX;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAA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_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Track',
|
|
@@ -28,7 +27,7 @@ const action = {
|
|
|
28
27
|
properties: segment_properties_1.properties,
|
|
29
28
|
traits: segment_properties_1.traits
|
|
30
29
|
},
|
|
31
|
-
perform: (
|
|
30
|
+
perform: (_request, { payload, statsContext }) => {
|
|
32
31
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
33
32
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
34
33
|
}
|
|
@@ -57,21 +56,11 @@ const action = {
|
|
|
57
56
|
},
|
|
58
57
|
properties: {
|
|
59
58
|
...payload?.properties
|
|
60
|
-
}
|
|
59
|
+
},
|
|
60
|
+
type: 'track'
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
66
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendTrack']);
|
|
67
|
-
const payload = { ...trackPayload, type: 'track' };
|
|
68
|
-
return { batch: [payload] };
|
|
69
|
-
}
|
|
70
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
71
|
-
return request(`${selectedSegmentEndpoint}/track`, {
|
|
72
|
-
method: 'POST',
|
|
73
|
-
json: trackPayload
|
|
74
|
-
});
|
|
62
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendTrack']);
|
|
63
|
+
return { batch: [trackPayload] };
|
|
75
64
|
}
|
|
76
65
|
};
|
|
77
66
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index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OAAO,EAAE,MAAM;gBACvB,EAAE,EAAE,OAAO,EAAE,UAAU;gBACvB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,EAAE,EAAE,OAAO,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,OAAO,EAAE,IAAI;gBACnB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,SAAS,EAAE,OAAO,EAAE,UAAU;gBAC9B,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ;aAC3B;YACD,UAAU,EAAE;gBACV,GAAG,OAAO,EAAE,UAAU;aACvB;YACD,IAAI,EAAE,OAAO;SACd,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAC/F,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,CAAA;IAClC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const properties_1 = require("./properties");
|
|
7
6
|
const sendGroup_1 = __importDefault(require("./sendGroup"));
|
|
8
7
|
const sendIdentify_1 = __importDefault(require("./sendIdentify"));
|
|
9
8
|
const sendSubscription_1 = __importDefault(require("./sendSubscription"));
|
|
@@ -11,23 +10,6 @@ const destination = {
|
|
|
11
10
|
name: 'Segment Profiles',
|
|
12
11
|
slug: 'actions-segment-profiles',
|
|
13
12
|
mode: 'cloud',
|
|
14
|
-
authentication: {
|
|
15
|
-
scheme: 'custom',
|
|
16
|
-
fields: {
|
|
17
|
-
endpoint: {
|
|
18
|
-
label: 'Endpoint Region',
|
|
19
|
-
description: 'The region to send your data.',
|
|
20
|
-
type: 'string',
|
|
21
|
-
format: 'text',
|
|
22
|
-
choices: Object.keys(properties_1.SEGMENT_ENDPOINTS).map((key) => ({
|
|
23
|
-
label: properties_1.SEGMENT_ENDPOINTS[key].label,
|
|
24
|
-
value: key
|
|
25
|
-
})),
|
|
26
|
-
default: properties_1.DEFAULT_SEGMENT_ENDPOINT,
|
|
27
|
-
required: true
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
13
|
actions: {
|
|
32
14
|
sendGroup: sendGroup_1.default,
|
|
33
15
|
sendIdentify: sendIdentify_1.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;AAEnC,kEAAyC;AAEzC,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;QACZ,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const helperFunctions_1 = require("../helperFunctions");
|
|
5
|
-
const properties_1 = require("../properties");
|
|
6
4
|
const errors_1 = require("../errors");
|
|
7
5
|
const action = {
|
|
8
6
|
title: 'Send Group',
|
|
@@ -16,7 +14,7 @@ const action = {
|
|
|
16
14
|
traits: segment_properties_1.traits,
|
|
17
15
|
timestamp: segment_properties_1.timestamp
|
|
18
16
|
},
|
|
19
|
-
perform: (
|
|
17
|
+
perform: (_request, { payload, statsContext }) => {
|
|
20
18
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
21
19
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
22
20
|
}
|
|
@@ -30,24 +28,11 @@ const action = {
|
|
|
30
28
|
timestamp: payload?.timestamp,
|
|
31
29
|
integrations: {
|
|
32
30
|
All: false
|
|
33
|
-
}
|
|
31
|
+
},
|
|
32
|
+
type: 'group'
|
|
34
33
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (features && features['actions-segment-profiles-tapi-internal-enabled']) {
|
|
39
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, `action:sendGroup`]);
|
|
40
|
-
const payload = { ...groupPayload, type: 'group' };
|
|
41
|
-
return { batch: [payload] };
|
|
42
|
-
}
|
|
43
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
44
|
-
return request(`${selectedSegmentEndpoint}/group`, {
|
|
45
|
-
method: 'POST',
|
|
46
|
-
json: groupPayload,
|
|
47
|
-
headers: {
|
|
48
|
-
authorization: helperFunctions_1.generateSegmentAPIAuthHeaders(payload.engage_space)
|
|
49
|
-
}
|
|
50
|
-
});
|
|
34
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, `action:sendGroup`]);
|
|
35
|
+
return { batch: [groupPayload] };
|
|
51
36
|
}
|
|
52
37
|
};
|
|
53
38
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendGroup/index.ts"],"names":[],"mappings":";;AAGA,8DAAwG;AACxG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendGroup/index.ts"],"names":[],"mappings":";;AAGA,8DAAwG;AACxG,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,wGAAwG;IACrH,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,YAAY,EAAZ,iCAAY;QACZ,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,QAAQ,EAAE,EAAE,GAAG,6BAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,MAAM,EAAN,2BAAM;QACN,SAAS,EAAT,8BAAS;KACV;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QACD,MAAM,YAAY,GAAW;YAC3B,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,OAAO,EAAE,OAAO,EAAE,QAAQ;YAC1B,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;YACD,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,YAAY,EAAE;gBAGZ,GAAG,EAAE,KAAK;aACX;YACD,IAAI,EAAE,OAAO;SACd,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAC/F,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,CAAA;IAClC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const helperFunctions_1 = require("../helperFunctions");
|
|
5
|
-
const properties_1 = require("../properties");
|
|
6
4
|
const errors_1 = require("../errors");
|
|
7
5
|
const action = {
|
|
8
6
|
title: 'Send Identify',
|
|
@@ -16,7 +14,7 @@ const action = {
|
|
|
16
14
|
traits: segment_properties_1.traits,
|
|
17
15
|
timestamp: segment_properties_1.timestamp
|
|
18
16
|
},
|
|
19
|
-
perform: (
|
|
17
|
+
perform: (_request, { payload, statsContext }) => {
|
|
20
18
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
21
19
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
22
20
|
}
|
|
@@ -30,24 +28,11 @@ const action = {
|
|
|
30
28
|
timestamp: payload?.timestamp,
|
|
31
29
|
integrations: {
|
|
32
30
|
All: false
|
|
33
|
-
}
|
|
31
|
+
},
|
|
32
|
+
type: 'identify'
|
|
34
33
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (features && features['actions-segment-profiles-tapi-internal-enabled']) {
|
|
39
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, `action:sendIdentify`]);
|
|
40
|
-
const payload = { ...identityPayload, type: 'identify' };
|
|
41
|
-
return { batch: [payload] };
|
|
42
|
-
}
|
|
43
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
44
|
-
return request(`${selectedSegmentEndpoint}/identify`, {
|
|
45
|
-
method: 'POST',
|
|
46
|
-
json: identityPayload,
|
|
47
|
-
headers: {
|
|
48
|
-
authorization: helperFunctions_1.generateSegmentAPIAuthHeaders(payload.engage_space)
|
|
49
|
-
}
|
|
50
|
-
});
|
|
34
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, `action:sendIdentify`]);
|
|
35
|
+
return { batch: [identityPayload] };
|
|
51
36
|
}
|
|
52
37
|
};
|
|
53
38
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAAwG;AACxG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAAwG;AACxG,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,gIAAgI;IAClI,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,YAAY,EAAZ,iCAAY;QACZ,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,QAAQ,EAAR,6BAAQ;QACR,MAAM,EAAN,2BAAM;QACN,SAAS,EAAT,8BAAS;KACV;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QACD,MAAM,eAAe,GAAW;YAC9B,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,OAAO,EAAE,OAAO,EAAE,QAAQ;YAC1B,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;YACD,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,YAAY,EAAE;gBAGZ,GAAG,EAAE,KAAK;aACX;YACD,IAAI,EAAE,UAAU;SACjB,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAA;QAClG,OAAO,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE,CAAA;IACrC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|