@segment/action-destinations 3.248.0-staging-c759641be → 3.248.0-staging-78c2b0a41
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/klaviyo/addProfileToList/index.js +15 -2
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/segment-profiles/index.js +3 -1
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +2 -0
- package/dist/destinations/segment-profiles/segment-properties.js +14 -1
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendTrack/generated-types.d.ts +10 -0
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js +3 -0
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js.map +1 -0
- package/dist/destinations/segment-profiles/sendTrack/index.d.ts +5 -0
- package/dist/destinations/segment-profiles/sendTrack/index.js +41 -0
- package/dist/destinations/segment-profiles/sendTrack/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -19,8 +19,21 @@ const action = {
|
|
|
19
19
|
if (!email && !external_id) {
|
|
20
20
|
throw new actions_core_1.PayloadValidationError('One of Email or External Id is required');
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
try {
|
|
23
|
+
const profileId = await functions_1.createProfile(request, email, external_id);
|
|
24
|
+
return await functions_1.addProfileToList(request, profileId, list_id);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
const apiError = error;
|
|
28
|
+
if (apiError.errors && Array.isArray(apiError.errors)) {
|
|
29
|
+
const detailedError = apiError.errors[0];
|
|
30
|
+
const errorMessage = detailedError.detail || 'An error occurred while processing the request.';
|
|
31
|
+
throw new actions_core_1.IntegrationError(errorMessage, detailedError.code || 'UNEXPECTED_ERROR', detailedError.status || 500);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
24
37
|
},
|
|
25
38
|
performBatch: async (request, { payload }) => {
|
|
26
39
|
payload = payload.filter((profile) => profile.email || profile.external_id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/addProfileToList/index.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/addProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAAkG;AAGlG,4CAA4G;AAC5G,8CAAwF;AAGxF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,qBAAqB;IAClC,mBAAmB,EAAE,4BAA4B;IACjD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,OAAO,EAAE,EAAE,GAAG,oBAAO,EAAE;QACvB,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;QAC/B,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;QACvC,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;KAC9B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAC/C,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE;YAC1B,MAAM,IAAI,qCAAsB,CAAC,yCAAyC,CAAC,CAAA;SAC5E;QAED,IAAI;YACF,MAAM,SAAS,GAAG,MAAM,yBAAa,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;YAClE,OAAO,MAAM,4BAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;SAC3D;QAAC,OAAO,KAAc,EAAE;YACvB,MAAM,QAAQ,GAAG,KAAoC,CAAA;YAErD,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACrD,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;gBACxC,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,IAAI,iDAAiD,CAAA;gBAC9F,MAAM,IAAI,+BAAgB,CAAC,YAAY,EAAE,aAAa,CAAC,IAAI,IAAI,kBAAkB,EAAE,aAAa,CAAC,MAAM,IAAI,GAAG,CAAC,CAAA;aAChH;iBAAM;gBACL,MAAM,KAAK,CAAA;aACZ;SACF;IACH,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAE3C,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAA;QAClC,MAAM,gBAAgB,GAAG,kCAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAChE,OAAO,gCAAoB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const sendGroup_1 = __importDefault(require("./sendGroup"));
|
|
7
7
|
const sendIdentify_1 = __importDefault(require("./sendIdentify"));
|
|
8
8
|
const sendSubscription_1 = __importDefault(require("./sendSubscription"));
|
|
9
|
+
const sendTrack_1 = __importDefault(require("./sendTrack"));
|
|
9
10
|
const destination = {
|
|
10
11
|
name: 'Segment Profiles',
|
|
11
12
|
slug: 'actions-segment-profiles',
|
|
@@ -13,7 +14,8 @@ const destination = {
|
|
|
13
14
|
actions: {
|
|
14
15
|
sendGroup: sendGroup_1.default,
|
|
15
16
|
sendIdentify: sendIdentify_1.default,
|
|
16
|
-
sendSubscription: sendSubscription_1.default
|
|
17
|
+
sendSubscription: sendSubscription_1.default,
|
|
18
|
+
sendTrack: sendTrack_1.default
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
21
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;AACnC,kEAAyC;AACzC,0EAAiD;AACjD,4DAAmC;AAEnC,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;QAChB,SAAS,EAAT,mBAAS;KACV;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -5,3 +5,5 @@ export declare const group_id: InputField;
|
|
|
5
5
|
export declare const traits: InputField;
|
|
6
6
|
export declare const engage_space: InputField;
|
|
7
7
|
export declare const timestamp: InputField;
|
|
8
|
+
export declare const event_name: InputField;
|
|
9
|
+
export declare const properties: InputField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timestamp = exports.engage_space = exports.traits = exports.group_id = exports.anonymous_id = exports.user_id = void 0;
|
|
3
|
+
exports.properties = exports.event_name = exports.timestamp = exports.engage_space = exports.traits = exports.group_id = exports.anonymous_id = exports.user_id = void 0;
|
|
4
4
|
exports.user_id = {
|
|
5
5
|
label: 'User ID',
|
|
6
6
|
description: 'Unique identifier for the user in your database. A userId or an anonymousId is required.',
|
|
@@ -38,4 +38,17 @@ exports.timestamp = {
|
|
|
38
38
|
'@path': '$.timestamp'
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
+
exports.event_name = {
|
|
42
|
+
label: 'Event Name',
|
|
43
|
+
description: 'Name of the action that a user has performed.',
|
|
44
|
+
type: 'string',
|
|
45
|
+
required: true
|
|
46
|
+
};
|
|
47
|
+
exports.properties = {
|
|
48
|
+
label: 'Properties',
|
|
49
|
+
description: 'Free-form dictionary of properties that describe the screen.',
|
|
50
|
+
type: 'object',
|
|
51
|
+
defaultObjectUI: 'keyvalue',
|
|
52
|
+
additionalProperties: true
|
|
53
|
+
};
|
|
41
54
|
//# sourceMappingURL=segment-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendTrack/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const segment_properties_1 = require("../segment-properties");
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Send Track',
|
|
7
|
+
description: '',
|
|
8
|
+
fields: {
|
|
9
|
+
user_id: segment_properties_1.user_id,
|
|
10
|
+
anonymous_id: segment_properties_1.anonymous_id,
|
|
11
|
+
timestamp: segment_properties_1.timestamp,
|
|
12
|
+
event_name: segment_properties_1.event_name,
|
|
13
|
+
group_id: segment_properties_1.group_id,
|
|
14
|
+
properties: segment_properties_1.properties
|
|
15
|
+
},
|
|
16
|
+
perform: (_, { payload, statsContext }) => {
|
|
17
|
+
if (!payload.anonymous_id && !payload.user_id) {
|
|
18
|
+
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
19
|
+
}
|
|
20
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, `action:sendTrack`]);
|
|
21
|
+
return {
|
|
22
|
+
batch: [
|
|
23
|
+
{
|
|
24
|
+
userId: payload?.user_id,
|
|
25
|
+
anonymousId: payload?.anonymous_id,
|
|
26
|
+
timestamp: payload?.timestamp,
|
|
27
|
+
event: payload?.event_name,
|
|
28
|
+
integrations: {
|
|
29
|
+
All: false
|
|
30
|
+
},
|
|
31
|
+
properties: {
|
|
32
|
+
...payload?.properties
|
|
33
|
+
},
|
|
34
|
+
type: 'track'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.default = action;
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,8DAA0G;AAC1G,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,SAAS,EAAT,8BAAS;QACT,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR,UAAU,EAAV,+BAAU;KACX;IACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACxC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QACD,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAE/F,OAAO;YACL,KAAK,EAAE;gBACL;oBACE,MAAM,EAAE,OAAO,EAAE,OAAO;oBACxB,WAAW,EAAE,OAAO,EAAE,YAAY;oBAClC,SAAS,EAAE,OAAO,EAAE,SAAS;oBAC7B,KAAK,EAAE,OAAO,EAAE,UAAU;oBAC1B,YAAY,EAAE;wBAGZ,GAAG,EAAE,KAAK;qBACX;oBACD,UAAU,EAAE;wBACV,GAAG,OAAO,EAAE,UAAU;qBACvB;oBACD,IAAI,EAAE,OAAO;iBACd;aACF;SACF,CAAA;IACH,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.248.0-staging-
|
|
4
|
+
"version": "3.248.0-staging-78c2b0a41",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|