@segment/action-destinations 3.233.0-streams.5 → 3.234.0-segment-cleanup.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/display-video-360/addToAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/index.js +5 -2
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/errors.d.ts +2 -1
- package/dist/destinations/display-video-360/errors.js +7 -4
- package/dist/destinations/display-video-360/errors.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +19 -12
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/properties.d.ts +1 -1
- package/dist/destinations/display-video-360/properties.js +14 -17
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/index.js +5 -2
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.d.ts +8 -1
- package/dist/destinations/display-video-360/shared.js +29 -8
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.d.ts +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.d.ts +0 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js +5 -41
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.d.ts +0 -9
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js +1 -22
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/s3.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js +1 -37
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/operations.d.ts +1 -20
- package/dist/destinations/liveramp-audiences/operations.js +1 -67
- package/dist/destinations/liveramp-audiences/operations.js.map +1 -1
- 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/package.json +3 -4
|
@@ -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 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.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,sCAAkE;AAElE,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AAQ,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"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const subscription_properties_1 = require("./subscription-properties");
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
|
-
const helperFunctions_1 = require("../helperFunctions");
|
|
6
|
-
const properties_1 = require("../properties");
|
|
7
5
|
const segment_properties_1 = require("../segment-properties");
|
|
8
6
|
const subscriptionStatusConfig = [
|
|
9
7
|
{ status: 'SUBSCRIBED', matchingStatuses: ['true', 'subscribed'] },
|
|
@@ -180,14 +178,10 @@ const action = {
|
|
|
180
178
|
traits: subscription_properties_1.traits,
|
|
181
179
|
timestamp: segment_properties_1.timestamp
|
|
182
180
|
},
|
|
183
|
-
perform: (
|
|
181
|
+
perform: (_request, { payload, statsContext }) => {
|
|
184
182
|
const statsClient = statsContext?.statsClient;
|
|
185
183
|
const tags = statsContext?.tags;
|
|
186
184
|
tags?.push(`action:sendSubscription`);
|
|
187
|
-
if (!settings.endpoint || !(settings.endpoint in properties_1.SEGMENT_ENDPOINTS)) {
|
|
188
|
-
statsClient?.incr('invalid_endpoint', 1, tags);
|
|
189
|
-
throw errors_1.InvalidEndpointSelectedThrowableError;
|
|
190
|
-
}
|
|
191
185
|
validateSubscriptions(payload, statsClient, tags);
|
|
192
186
|
const externalIds = enrichExternalIds(payload, []);
|
|
193
187
|
const messagingSubscriptions = enrichMessagingSubscriptions(payload, []);
|
|
@@ -205,22 +199,12 @@ const action = {
|
|
|
205
199
|
timestamp: payload?.timestamp,
|
|
206
200
|
integrations: {
|
|
207
201
|
All: false
|
|
208
|
-
}
|
|
202
|
+
},
|
|
203
|
+
type: 'identify'
|
|
209
204
|
};
|
|
210
205
|
statsClient?.incr('success', 1, tags);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const payload = { ...subscriptionPayload, type: 'identify' };
|
|
214
|
-
return { batch: [payload] };
|
|
215
|
-
}
|
|
216
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
217
|
-
return request(`${selectedSegmentEndpoint}/identify`, {
|
|
218
|
-
method: 'POST',
|
|
219
|
-
json: subscriptionPayload,
|
|
220
|
-
headers: {
|
|
221
|
-
authorization: helperFunctions_1.generateSegmentAPIAuthHeaders(payload.engage_space)
|
|
222
|
-
}
|
|
223
|
-
});
|
|
206
|
+
statsClient?.incr('tapi_internal', 1, tags);
|
|
207
|
+
return { batch: [subscriptionPayload] };
|
|
224
208
|
}
|
|
225
209
|
};
|
|
226
210
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendSubscription/index.ts"],"names":[],"mappings":";;AAGA,uEAekC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendSubscription/index.ts"],"names":[],"mappings":";;AAGA,uEAekC;AAClC,sCASkB;AAClB,8DAAiD;AAQjD,MAAM,wBAAwB,GAA+B;IAC3D,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE;IAClE,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE;IACvE,EAAE,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,EAAE;CAC9F,CAAA;AAUD,MAAM,iBAAiB,GAA8B;IACnD;QACE,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,OAAO;QACnB,kBAAkB,EAAE,CAAC,2BAA2B,CAAC;QACjD,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,MAAM,EAAE,IAAI;KACb;IACD;QACE,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,OAAO;QACnB,kBAAkB,EAAE,CAAC,yBAAyB,EAAE,8BAA8B,CAAC;QAC/E,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC;QAC7B,MAAM,EAAE,KAAK;KACd;IACD;QACE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EAAE,IAAI,CAAC,CAAA;QAEjD,MAAM,WAAW,GAAgB,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAE/D,MAAM,sBAAsB,GAA4B,4BAA4B,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QACjG,MAAM,mBAAmB,GAAW;YAClC,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;YACD,OAAO,EAAE;gBACP,uBAAuB,EAAE,sBAAsB;gBAC/C,WAAW;gBACX,4BAA4B,EAAE,IAAI;aACnC;YACD,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,YAAY,EAAE;gBAGZ,GAAG,EAAE,KAAK;aACX;YACD,IAAI,EAAE,UAAU;SACjB,CAAA;QAED,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;QACrC,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;QAC3C,OAAO,EAAE,KAAK,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAA;IACzC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.234.0-segment-cleanup.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -39,13 +39,12 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
42
|
-
"@aws-sdk/client-s3": "^3.473.0",
|
|
43
42
|
"@bufbuild/buf": "^1.28.0",
|
|
44
43
|
"@bufbuild/protobuf": "^1.4.2",
|
|
45
44
|
"@bufbuild/protoc-gen-es": "^1.4.2",
|
|
46
45
|
"@segment/a1-notation": "^2.1.4",
|
|
47
|
-
"@segment/actions-core": "3.
|
|
48
|
-
"@segment/actions-shared": "^1.
|
|
46
|
+
"@segment/actions-core": "^3.92.0",
|
|
47
|
+
"@segment/actions-shared": "^1.73.0",
|
|
49
48
|
"@types/node": "^18.11.15",
|
|
50
49
|
"ajv-formats": "^2.1.1",
|
|
51
50
|
"aws4": "^1.12.0",
|