@segment/action-destinations 3.227.2-staging.8 → 3.227.3-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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +3 -3
- package/dist/destinations/klaviyo/functions.js +19 -10
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +8 -0
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +21 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +0 -5
- package/dist/destinations/klaviyo/addProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/addProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/addProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/addProfileToList/index.js +0 -61
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +0 -1
- package/dist/destinations/klaviyo/properties.d.ts +0 -4
- package/dist/destinations/klaviyo/properties.js +0 -21
- package/dist/destinations/klaviyo/properties.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +0 -3
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +0 -5
- package/dist/destinations/klaviyo/removeProfileToList/index.js +0 -62
- package/dist/destinations/klaviyo/removeProfileToList/index.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/yahoo-audiences/createCustomerNode/generated-types.d.ts +0 -4
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js +0 -3
- package/dist/destinations/yahoo-audiences/createCustomerNode/generated-types.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.d.ts +0 -5
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js +0 -33
- package/dist/destinations/yahoo-audiences/createCustomerNode/index.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.d.ts +0 -6
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js +0 -3
- package/dist/destinations/yahoo-audiences/createSegment/generated-types.js.map +0 -1
- package/dist/destinations/yahoo-audiences/createSegment/index.d.ts +0 -5
- package/dist/destinations/yahoo-audiences/createSegment/index.js +0 -45
- package/dist/destinations/yahoo-audiences/createSegment/index.js.map +0 -1
- package/dist/destinations/yahoo-audiences/utils.d.ts +0 -4
- package/dist/destinations/yahoo-audiences/utils.js +0 -30
- package/dist/destinations/yahoo-audiences/utils.js.map +0 -1
|
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
|
|
|
9
9
|
y: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
|
|
12
|
-
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<
|
|
12
|
+
export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Address> | Partial<OnlinePresence> | Partial<Phone> | Partial<Constituent>)[];
|
|
13
13
|
export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
|
|
14
14
|
export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
|
|
15
15
|
export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RequestClient, DynamicFieldResponse } from '@segment/actions-core';
|
|
2
|
-
import {
|
|
3
|
-
export declare function getListIdDynamicData(request: RequestClient, settings:
|
|
4
|
-
export declare function
|
|
2
|
+
import { Settings } from './generated-types';
|
|
3
|
+
export declare function getListIdDynamicData(request: RequestClient, settings: Settings): Promise<DynamicFieldResponse>;
|
|
4
|
+
export declare function addProfileToList(request: RequestClient, profileId: string, listId: string): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addProfileToList = exports.getListIdDynamicData = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
5
|
const config_1 = require("./config");
|
|
5
6
|
async function getListIdDynamicData(request, settings) {
|
|
6
7
|
try {
|
|
@@ -9,11 +10,12 @@ async function getListIdDynamicData(request, settings) {
|
|
|
9
10
|
headers: {
|
|
10
11
|
Authorization: `Klaviyo-API-Key ${settings.api_key}`,
|
|
11
12
|
Accept: 'application/json',
|
|
12
|
-
revision:
|
|
13
|
+
revision: config_1.REVISION_DATE
|
|
13
14
|
},
|
|
14
15
|
skipResponseCloning: true
|
|
15
16
|
});
|
|
16
|
-
const
|
|
17
|
+
const parsedContent = JSON.parse(result.content);
|
|
18
|
+
const choices = parsedContent.data.map((list) => {
|
|
17
19
|
return { value: list.id, label: list.attributes.name };
|
|
18
20
|
});
|
|
19
21
|
return {
|
|
@@ -32,17 +34,24 @@ async function getListIdDynamicData(request, settings) {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
exports.getListIdDynamicData = getListIdDynamicData;
|
|
35
|
-
async function
|
|
37
|
+
async function addProfileToList(request, profileId, listId) {
|
|
38
|
+
const listData = {
|
|
39
|
+
data: [
|
|
40
|
+
{
|
|
41
|
+
type: 'profile',
|
|
42
|
+
id: profileId
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
36
46
|
try {
|
|
37
|
-
|
|
38
|
-
method:
|
|
39
|
-
json:
|
|
47
|
+
await request(`${config_1.API_URL}/lists/${listId}/relationships/profiles/`, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
json: listData
|
|
40
50
|
});
|
|
41
|
-
return list;
|
|
42
51
|
}
|
|
43
52
|
catch (error) {
|
|
44
|
-
throw new
|
|
53
|
+
throw new actions_core_1.APIError('An error occurred while processing the request', 400);
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
|
-
exports.
|
|
56
|
+
exports.addProfileToList = addProfileToList;
|
|
48
57
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/functions.ts"],"names":[],"mappings":";;;AAAA,wDAAqF;AACrF,qCAAiD;AAI1C,KAAK,UAAU,oBAAoB,CAAC,OAAsB,EAAE,QAAkB;IACnF,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,SAAS,EAAE;YAChD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,aAAa,EAAE,mBAAmB,QAAQ,CAAC,OAAO,EAAE;gBACpD,MAAM,EAAE,kBAAkB;gBAC1B,QAAQ,EAAE,sBAAa;aACxB;YACD,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAA;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAyB,CAAA;QACxE,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAkD,EAAE,EAAE;YAC5F,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;AA5BD,oDA4BC;AAEM,KAAK,UAAU,gBAAgB,CAAC,OAAsB,EAAE,SAAiB,EAAE,MAAc;IAC9F,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,SAAS;gBACf,EAAE,EAAE,SAAS;aACd;SACF;KACF,CAAA;IAED,IAAI;QACF,MAAM,OAAO,CAAC,GAAG,gBAAO,UAAU,MAAM,0BAA0B,EAAE;YAClE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;KACH;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,uBAAQ,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAA;KAC1E;AACH,CAAC;AAlBD,4CAkBC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_1 = require("../config");
|
|
4
4
|
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const functions_1 = require("../functions");
|
|
5
6
|
const action = {
|
|
6
7
|
title: 'Upsert Profile',
|
|
7
8
|
description: 'Upsert user profile.',
|
|
@@ -116,10 +117,21 @@ const action = {
|
|
|
116
117
|
default: {
|
|
117
118
|
'@path': '$.properties'
|
|
118
119
|
}
|
|
120
|
+
},
|
|
121
|
+
list_id: {
|
|
122
|
+
label: 'List Id',
|
|
123
|
+
description: `'Insert the ID of the default list that you'd like to subscribe users to when you call .identify().'`,
|
|
124
|
+
type: 'string',
|
|
125
|
+
dynamic: true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
dynamicFields: {
|
|
129
|
+
list_id: async (request, { settings }) => {
|
|
130
|
+
return functions_1.getListIdDynamicData(request, settings);
|
|
119
131
|
}
|
|
120
132
|
},
|
|
121
133
|
perform: async (request, { payload }) => {
|
|
122
|
-
const { email, external_id, phone_number, ...otherAttributes } = payload;
|
|
134
|
+
const { email, external_id, phone_number, list_id, ...otherAttributes } = payload;
|
|
123
135
|
if (!email && !phone_number && !external_id) {
|
|
124
136
|
throw new actions_core_1.PayloadValidationError('One of External ID, Phone Number and Email is required.');
|
|
125
137
|
}
|
|
@@ -139,6 +151,11 @@ const action = {
|
|
|
139
151
|
method: 'POST',
|
|
140
152
|
json: profileData
|
|
141
153
|
});
|
|
154
|
+
if (list_id) {
|
|
155
|
+
const content = JSON.parse(profile?.content);
|
|
156
|
+
const id = content.data.id;
|
|
157
|
+
await functions_1.addProfileToList(request, id, list_id);
|
|
158
|
+
}
|
|
142
159
|
return profile;
|
|
143
160
|
}
|
|
144
161
|
catch (error) {
|
|
@@ -152,6 +169,9 @@ const action = {
|
|
|
152
169
|
method: 'PATCH',
|
|
153
170
|
json: profileData
|
|
154
171
|
});
|
|
172
|
+
if (list_id) {
|
|
173
|
+
await functions_1.addProfileToList(request, id, list_id);
|
|
174
|
+
}
|
|
155
175
|
return profile;
|
|
156
176
|
}
|
|
157
177
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;AAExE,4CAAqE;AAErE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,sBAAsB;IACnC,mBAAmB,EAAE,mBAAmB;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OAAO,KAAK,EAAE;YACd,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAwB,CAAA;YAE7C,IAAI,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;gBAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;gBAC7C,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAA;gBAEzD,IAAI,EAAE,EAAE;oBACN,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;oBAExB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,aAAa,EAAE,EAAE,EAAE;wBACzD,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;qBAClB,CAAC,CAAA;oBAEF,IAAI,OAAO,EAAE;wBACX,MAAM,4BAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;qBAC7C;oBACD,OAAO,OAAO,CAAA;iBACf;aACF;YAED,MAAM,IAAI,uBAAQ,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAA;SAC1E;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.227.
|
|
4
|
+
"version": "3.227.3-staging.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/addProfileToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const functions_1 = require("../functions");
|
|
5
|
-
const properties_1 = require("../properties");
|
|
6
|
-
const action = {
|
|
7
|
-
title: 'Add To List',
|
|
8
|
-
description: 'Add to list',
|
|
9
|
-
fields: {
|
|
10
|
-
profile_id: { ...properties_1.profile_id },
|
|
11
|
-
list_id: { ...properties_1.list_id },
|
|
12
|
-
enable_batching: { ...properties_1.enable_batching }
|
|
13
|
-
},
|
|
14
|
-
dynamicFields: {
|
|
15
|
-
list_id: async (request, { settings }) => {
|
|
16
|
-
return functions_1.getListIdDynamicData(request, settings);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
perform: async (request, { payload }) => {
|
|
20
|
-
const { profile_id, list_id } = payload;
|
|
21
|
-
if (!list_id) {
|
|
22
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
const listData = {
|
|
26
|
-
data: [
|
|
27
|
-
{
|
|
28
|
-
type: 'profile',
|
|
29
|
-
id: profile_id
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
};
|
|
33
|
-
const list = await functions_1.executeProfileList(request, 'POST', listData, list_id);
|
|
34
|
-
return list;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
throw new Error('An error occurred while processing the request');
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
performBatch: async (request, { payload }) => {
|
|
41
|
-
try {
|
|
42
|
-
if (!payload[0].list_id) {
|
|
43
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
44
|
-
}
|
|
45
|
-
const batch_data = { data: [] };
|
|
46
|
-
payload.forEach((data) => {
|
|
47
|
-
if (!data.list_id) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
batch_data.data.push({ type: 'profile', id: data.profile_id });
|
|
51
|
-
});
|
|
52
|
-
const list = await functions_1.executeProfileList(request, 'POST', batch_data, payload[0].list_id);
|
|
53
|
-
return list;
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
throw new Error('An error occurred while processing the request');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
exports.default = action;
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/addProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAAgG;AAIhG,4CAAuE;AACvE,8CAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE;QACN,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;QAC7B,OAAO,EAAE,EAAE,GAAG,oBAAO,EAAE;QACvB,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;KACxC;IACD,aAAa,EAAE;QACb,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAiC,EAAE;YACtE,OAAO,gCAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAChD,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QACvC,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,QAAQ,GAAa;gBACzB,IAAI,EAAE;oBACJ;wBACE,IAAI,EAAE,SAAS;wBACf,EAAE,EAAE,UAAU;qBACf;iBACF;aACF,CAAA;YAED,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;YACzE,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3C,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;gBACvB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;aACF;YAED,MAAM,UAAU,GAAa,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;YACzC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBACvB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;oBACjB,OAAM;iBACP;gBACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;YAChE,CAAC,CAAC,CAAA;YACF,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;YACtF,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.profile_id = exports.list_id = exports.enable_batching = void 0;
|
|
4
|
-
exports.enable_batching = {
|
|
5
|
-
label: 'Enable Batching',
|
|
6
|
-
description: 'Enable batching of requests to the Klaviyo.',
|
|
7
|
-
type: 'boolean',
|
|
8
|
-
default: true
|
|
9
|
-
};
|
|
10
|
-
exports.list_id = {
|
|
11
|
-
label: 'List Id',
|
|
12
|
-
description: `'Insert the ID of the default list that you'd like to subscribe users to when you call .identify().'`,
|
|
13
|
-
type: 'string',
|
|
14
|
-
dynamic: true
|
|
15
|
-
};
|
|
16
|
-
exports.profile_id = {
|
|
17
|
-
label: 'Profile Id',
|
|
18
|
-
description: 'Profile Id of User',
|
|
19
|
-
type: 'string'
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,sGAAsG;IACnH,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,oBAAoB;IACjC,IAAI,EAAE,QAAQ;CACf,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const functions_1 = require("../functions");
|
|
5
|
-
const properties_1 = require("../properties");
|
|
6
|
-
const action = {
|
|
7
|
-
title: 'Remove profile from list',
|
|
8
|
-
description: 'Remove profile from list',
|
|
9
|
-
fields: {
|
|
10
|
-
profile_id: { ...properties_1.profile_id },
|
|
11
|
-
list_id: { ...properties_1.list_id },
|
|
12
|
-
enable_batching: { ...properties_1.enable_batching }
|
|
13
|
-
},
|
|
14
|
-
dynamicFields: {
|
|
15
|
-
list_id: async (request, { settings }) => {
|
|
16
|
-
return functions_1.getListIdDynamicData(request, settings);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
perform: async (request, { payload }) => {
|
|
20
|
-
const { profile_id, list_id } = payload;
|
|
21
|
-
if (!list_id) {
|
|
22
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
const listData = {
|
|
26
|
-
data: [
|
|
27
|
-
{
|
|
28
|
-
type: 'profile',
|
|
29
|
-
id: profile_id
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
};
|
|
33
|
-
const list = await functions_1.executeProfileList(request, 'DELETE', listData, list_id);
|
|
34
|
-
return list;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
console.log(error);
|
|
38
|
-
throw new Error('An error occurred while processing the request');
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
performBatch: async (request, { payload }) => {
|
|
42
|
-
try {
|
|
43
|
-
if (!payload[0].list_id) {
|
|
44
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
45
|
-
}
|
|
46
|
-
const batch_data = { data: [] };
|
|
47
|
-
payload.forEach((data) => {
|
|
48
|
-
if (!data.list_id) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
batch_data.data.push({ type: 'profile', id: data.profile_id });
|
|
52
|
-
});
|
|
53
|
-
const list = await functions_1.executeProfileList(request, 'DELETE', batch_data, payload[0].list_id);
|
|
54
|
-
return list;
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
throw new Error('An error occurred while processing the request');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.default = action;
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAAgG;AAKhG,4CAAuE;AACvE,8CAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,MAAM,EAAE;QACN,UAAU,EAAE,EAAE,GAAG,uBAAU,EAAE;QAC7B,OAAO,EAAE,EAAE,GAAG,oBAAO,EAAE;QACvB,eAAe,EAAE,EAAE,GAAG,4BAAe,EAAE;KACxC;IACD,aAAa,EAAE;QACb,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAiC,EAAE;YACtE,OAAO,gCAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAChD,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAEvC,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,QAAQ,GAAa;gBACzB,IAAI,EAAE;oBACJ;wBACE,IAAI,EAAE,SAAS;wBACf,EAAE,EAAE,UAAU;qBACf;iBACF;aACF,CAAA;YAED,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;YAC3E,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3C,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;gBACvB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;aACF;YAED,MAAM,UAAU,GAAa,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;YACzC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBACvB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;oBACjB,OAAM;iBACP;gBACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;YAChE,CAAC,CAAC,CAAA;YAEF,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;YACxF,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum ApiRegions {
|
|
2
|
-
US = "US \uD83C\uDDFA\uD83C\uDDF8",
|
|
3
|
-
EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
|
|
4
|
-
}
|
|
5
|
-
export declare enum StrictMode {
|
|
6
|
-
ON = "1",
|
|
7
|
-
OFF = "0"
|
|
8
|
-
}
|
|
9
|
-
export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
|
|
10
|
-
export declare function getApiServerUrl(apiRegion: string | undefined): "https://api-eu.mixpanel.com" | "https://api.mixpanel.com";
|
|
11
|
-
export declare function getBrowser(userAgent: string): string;
|
|
12
|
-
export declare function getBrowserVersion(userAgent: string): string | undefined;
|
|
13
|
-
export declare function cheapGuid(maxlen?: number): string;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cheapGuid = exports.getBrowserVersion = exports.getBrowser = exports.getApiServerUrl = exports.getConcatenatedName = exports.StrictMode = exports.ApiRegions = void 0;
|
|
4
|
-
var ApiRegions;
|
|
5
|
-
(function (ApiRegions) {
|
|
6
|
-
ApiRegions["US"] = "US \uD83C\uDDFA\uD83C\uDDF8";
|
|
7
|
-
ApiRegions["EU"] = "EU \uD83C\uDDEA\uD83C\uDDFA";
|
|
8
|
-
})(ApiRegions = exports.ApiRegions || (exports.ApiRegions = {}));
|
|
9
|
-
var StrictMode;
|
|
10
|
-
(function (StrictMode) {
|
|
11
|
-
StrictMode["ON"] = "1";
|
|
12
|
-
StrictMode["OFF"] = "0";
|
|
13
|
-
})(StrictMode = exports.StrictMode || (exports.StrictMode = {}));
|
|
14
|
-
function getConcatenatedName(firstName, lastName, name) {
|
|
15
|
-
return name ?? (firstName && lastName ? `${firstName} ${lastName}` : undefined);
|
|
16
|
-
}
|
|
17
|
-
exports.getConcatenatedName = getConcatenatedName;
|
|
18
|
-
function getApiServerUrl(apiRegion) {
|
|
19
|
-
if (apiRegion == ApiRegions.EU) {
|
|
20
|
-
return 'https://api-eu.mixpanel.com';
|
|
21
|
-
}
|
|
22
|
-
return 'https://api.mixpanel.com';
|
|
23
|
-
}
|
|
24
|
-
exports.getApiServerUrl = getApiServerUrl;
|
|
25
|
-
function getBrowser(userAgent) {
|
|
26
|
-
if (userAgent.includes(' OPR/')) {
|
|
27
|
-
if (userAgent.includes('Mini')) {
|
|
28
|
-
return 'Opera Mini';
|
|
29
|
-
}
|
|
30
|
-
return 'Opera';
|
|
31
|
-
}
|
|
32
|
-
else if (/(BlackBerry|PlayBook|BB10)/i.test(userAgent)) {
|
|
33
|
-
return 'BlackBerry';
|
|
34
|
-
}
|
|
35
|
-
else if (userAgent.includes('IEMobile') || userAgent.includes('WPDesktop')) {
|
|
36
|
-
return 'Internet Explorer Mobile';
|
|
37
|
-
}
|
|
38
|
-
else if (userAgent.includes('SamsungBrowser/')) {
|
|
39
|
-
return 'Samsung Internet';
|
|
40
|
-
}
|
|
41
|
-
else if (userAgent.includes('Edge') || userAgent.includes('Edg/')) {
|
|
42
|
-
return 'Microsoft Edge';
|
|
43
|
-
}
|
|
44
|
-
else if (userAgent.includes('FBIOS')) {
|
|
45
|
-
return 'Facebook Mobile';
|
|
46
|
-
}
|
|
47
|
-
else if (userAgent.includes('Chrome')) {
|
|
48
|
-
return 'Chrome';
|
|
49
|
-
}
|
|
50
|
-
else if (userAgent.includes('CriOS')) {
|
|
51
|
-
return 'Chrome iOS';
|
|
52
|
-
}
|
|
53
|
-
else if (userAgent.includes('UCWEB') || userAgent.includes('UCBrowser')) {
|
|
54
|
-
return 'UC Browser';
|
|
55
|
-
}
|
|
56
|
-
else if (userAgent.includes('FxiOS')) {
|
|
57
|
-
return 'Firefox iOS';
|
|
58
|
-
}
|
|
59
|
-
else if (userAgent.includes('Safari')) {
|
|
60
|
-
return 'Safari';
|
|
61
|
-
}
|
|
62
|
-
else if (userAgent.includes('Android')) {
|
|
63
|
-
return 'Android Mobile';
|
|
64
|
-
}
|
|
65
|
-
else if (userAgent.includes('Konqueror')) {
|
|
66
|
-
return 'Konqueror';
|
|
67
|
-
}
|
|
68
|
-
else if (userAgent.includes('Firefox')) {
|
|
69
|
-
return 'Firefox';
|
|
70
|
-
}
|
|
71
|
-
else if (userAgent.includes('MSIE') || userAgent.includes('Trident/')) {
|
|
72
|
-
return 'Internet Explorer';
|
|
73
|
-
}
|
|
74
|
-
else if (userAgent.includes('Gecko')) {
|
|
75
|
-
return 'Mozilla';
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return '';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.getBrowser = getBrowser;
|
|
82
|
-
function getBrowserVersion(userAgent) {
|
|
83
|
-
const browser = getBrowser(userAgent);
|
|
84
|
-
const versionRegexs = {
|
|
85
|
-
'Internet Explorer Mobile': /rv:(\d+(\.\d+)?)/,
|
|
86
|
-
'Microsoft Edge': /Edge?\/(\d+(\.\d+)?)/,
|
|
87
|
-
Chrome: /Chrome\/(\d+(\.\d+)?)/,
|
|
88
|
-
'Chrome iOS': /CriOS\/(\d+(\.\d+)?)/,
|
|
89
|
-
'UC Browser': /(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,
|
|
90
|
-
Safari: /Version\/(\d+(\.\d+)?)/,
|
|
91
|
-
'Mobile Safari': /Version\/(\d+(\.\d+)?)/,
|
|
92
|
-
Opera: /(Opera|OPR)\/(\d+(\.\d+)?)/,
|
|
93
|
-
Firefox: /Firefox\/(\d+(\.\d+)?)/,
|
|
94
|
-
'Firefox iOS': /FxiOS\/(\d+(\.\d+)?)/,
|
|
95
|
-
Konqueror: /Konqueror:(\d+(\.\d+)?)/,
|
|
96
|
-
BlackBerry: /BlackBerry (\d+(\.\d+)?)/,
|
|
97
|
-
'Android Mobile': /android\s(\d+(\.\d+)?)/,
|
|
98
|
-
'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
|
|
99
|
-
'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
|
|
100
|
-
Mozilla: /rv:(\d+(\.\d+)?)/
|
|
101
|
-
};
|
|
102
|
-
const regex = versionRegexs[browser];
|
|
103
|
-
if (!regex)
|
|
104
|
-
return regex;
|
|
105
|
-
const matches = regex.exec(userAgent);
|
|
106
|
-
if (!matches) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
return matches[matches.length - 2];
|
|
110
|
-
}
|
|
111
|
-
exports.getBrowserVersion = getBrowserVersion;
|
|
112
|
-
function cheapGuid(maxlen) {
|
|
113
|
-
const guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);
|
|
114
|
-
return maxlen ? guid.substring(0, maxlen) : guid;
|
|
115
|
-
}
|
|
116
|
-
exports.cheapGuid = cheapGuid;
|
|
117
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/mixpanel/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,gDAAc,CAAA;IACd,gDAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sBAAQ,CAAA;IACR,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,SAAgB,mBAAmB,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IACtF,OAAO,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACjF,CAAC;AAFD,kDAEC;AAED,SAAgB,eAAe,CAAC,SAA6B;IAC3D,IAAI,SAAS,IAAI,UAAU,CAAC,EAAE,EAAE;QAC9B,OAAO,6BAA6B,CAAA;KACrC;IACD,OAAO,0BAA0B,CAAA;AACnC,CAAC;AALD,0CAKC;AAED,SAAgB,UAAU,CAAC,SAAiB;IAC1C,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC/B,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC9B,OAAO,YAAY,CAAA;SACpB;QACD,OAAO,OAAO,CAAA;KACf;S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,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACtG,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClD,CAAC;AAHD,8BAGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_tax_1 = require("../utils-tax");
|
|
4
|
-
const utils_tax_2 = require("../utils-tax");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Create top-level CUSTOMER node in Yahoo taxonomy',
|
|
7
|
-
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
8
|
-
description: '',
|
|
9
|
-
fields: {
|
|
10
|
-
engage_space_id: {
|
|
11
|
-
label: 'Engage Space Id',
|
|
12
|
-
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
customer_desc: {
|
|
17
|
-
label: 'Customer Description',
|
|
18
|
-
description: 'Provide a description for the Customer node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
19
|
-
type: 'string',
|
|
20
|
-
required: false
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
perform: async (request, { settings, payload }) => {
|
|
24
|
-
const tx_creds = {
|
|
25
|
-
tx_client_key: settings.taxonomy_client_key,
|
|
26
|
-
tx_client_secret: settings.taxonomy_client_secret
|
|
27
|
-
};
|
|
28
|
-
const taxonomy_payload = utils_tax_1.gen_customer_taxonomy_payload(settings, payload);
|
|
29
|
-
return await utils_tax_2.update_taxonomy('', tx_creds, request, taxonomy_payload);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.default = action;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createCustomerNode/index.ts"],"names":[],"mappings":";;AAGA,4CAA4D;AAC5D,4CAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kDAAkD;IACzD,mBAAmB,EAAE,0DAA0D;IAC/E,WAAW,EAAE,EAAE;IACf,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,mJAAmJ;YACrJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG;YACf,aAAa,EAAE,QAAQ,CAAC,mBAAmB;YAC3C,gBAAgB,EAAE,QAAQ,CAAC,sBAAsB;SAClD,CAAA;QACD,MAAM,gBAAgB,GAAG,yCAA6B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACzE,OAAO,MAAM,2BAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAA;IACvE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_tax_1 = require("../utils-tax");
|
|
4
|
-
const utils_tax_2 = require("../utils-tax");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Create SEGMENT sub-node in Yahoo taxonomy',
|
|
7
|
-
description: 'Use this action to generate SEGMENT sub-node within CUSTOMER node in Yahoo taxonomy',
|
|
8
|
-
defaultSubscription: 'event = "Audience Entered" and event = "Audience Exited"',
|
|
9
|
-
fields: {
|
|
10
|
-
segment_audience_key: {
|
|
11
|
-
label: 'Audience Key',
|
|
12
|
-
description: 'Provide audience key. This maps to the "Name" of the Segment node in Yahoo taxonomy',
|
|
13
|
-
type: 'string',
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
segment_audience_id: {
|
|
17
|
-
label: 'Audience Id',
|
|
18
|
-
description: 'Provide audience Id (aud_...) from audience URL in Segment Engage. This maps to the "Id" of the Segment node in Yahoo taxonomy',
|
|
19
|
-
type: 'string',
|
|
20
|
-
required: true
|
|
21
|
-
},
|
|
22
|
-
engage_space_id: {
|
|
23
|
-
label: 'Engage Space Id',
|
|
24
|
-
description: 'Provide Engage Space Id found in Unify > Settings > API Access. This maps to the "Id" and "Name" of the top-level Customer node in Yahoo taxonomy and specifies the parent node for your Segment node in Yahoo taxonomy',
|
|
25
|
-
type: 'string',
|
|
26
|
-
required: false
|
|
27
|
-
},
|
|
28
|
-
customer_desc: {
|
|
29
|
-
label: 'Space Description',
|
|
30
|
-
description: 'Provide the description for Segment node in Yahoo taxonomy. This must be less then 1000 characters',
|
|
31
|
-
type: 'string',
|
|
32
|
-
required: false
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
perform: async (request, { payload, settings }) => {
|
|
36
|
-
const tx_creds = {
|
|
37
|
-
tx_client_key: settings.taxonomy_client_key,
|
|
38
|
-
tx_client_secret: settings.taxonomy_client_secret
|
|
39
|
-
};
|
|
40
|
-
const body_form_data = utils_tax_1.gen_segment_subtaxonomy_payload(payload);
|
|
41
|
-
return await utils_tax_2.update_taxonomy(String(payload.engage_space_id), tx_creds, request, body_form_data);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.default = action;
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/yahoo-audiences/createSegment/index.ts"],"names":[],"mappings":";;AAIA,4CAA8D;AAC9D,4CAA8C;AAG9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,2CAA2C;IAClD,WAAW,EAAE,qFAAqF;IAClG,mBAAmB,EAAE,0DAA0D;IAE/E,MAAM,EAAE;QACN,oBAAoB,EAAE;YACpB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,qFAAqF;YAClG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,gIAAgI;YAClI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,yNAAyN;YAC3N,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,aAAa,EAAE;YACb,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,oGAAoG;YACjH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG;YACf,aAAa,EAAE,QAAQ,CAAC,mBAAmB;YAC3C,gBAAgB,EAAE,QAAQ,CAAC,sBAAsB;SAClD,CAAA;QAED,MAAM,cAAc,GAAG,2CAA+B,CAAC,OAAO,CAAC,CAAA;QAC/D,OAAO,MAAM,2BAAe,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IAClG,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RequestClient } from '@segment/actions-core';
|
|
2
|
-
import { CredsObj } from './types';
|
|
3
|
-
export declare function gen_random_id(length: number): string;
|
|
4
|
-
export declare function update_taxonomy(engage_space_id: string, tx_creds: CredsObj, request: RequestClient, body_form_data: string): Promise<any>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.update_taxonomy = exports.gen_random_id = void 0;
|
|
4
|
-
const utils_tax_1 = require("./utils-tax");
|
|
5
|
-
function gen_random_id(length) {
|
|
6
|
-
const pattern = 'abcdefghijklmnopqrstuvwxyz123456789';
|
|
7
|
-
const result = [];
|
|
8
|
-
for (let i = 0; i < length; i++) {
|
|
9
|
-
result.push(pattern[Math.floor(Math.random() * pattern.length)]);
|
|
10
|
-
}
|
|
11
|
-
return result.join('');
|
|
12
|
-
}
|
|
13
|
-
exports.gen_random_id = gen_random_id;
|
|
14
|
-
async function update_taxonomy(engage_space_id, tx_creds, request, body_form_data) {
|
|
15
|
-
const tx_client_secret = tx_creds.tx_client_key;
|
|
16
|
-
const tx_client_key = tx_creds.tx_client_secret;
|
|
17
|
-
const url = `https://datax.yahooapis.com/v1/taxonomy/append${engage_space_id.length > 0 ? '/' + engage_space_id : ''}`;
|
|
18
|
-
const oauth1_auth_string = utils_tax_1.gen_oauth1_signature(tx_client_key, tx_client_secret, 'PUT', url);
|
|
19
|
-
const add_segment_node = await request(url, {
|
|
20
|
-
method: 'PUT',
|
|
21
|
-
body: body_form_data,
|
|
22
|
-
headers: {
|
|
23
|
-
Authorization: oauth1_auth_string,
|
|
24
|
-
'Content-Type': 'multipart/form-data; boundary=SEGMENT-DATA'
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return await add_segment_node.json();
|
|
28
|
-
}
|
|
29
|
-
exports.update_taxonomy = update_taxonomy;
|
|
30
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/yahoo-audiences/utils.ts"],"names":[],"mappings":";;;AAEA,2CAAkD;AAQlD,SAAgB,aAAa,CAAC,MAAc;IAC1C,MAAM,OAAO,GAAG,qCAAqC,CAAA;IACrD,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KACjE;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAPD,sCAOC;AAEM,KAAK,UAAU,eAAe,CACnC,eAAuB,EACvB,QAAkB,EAClB,OAAsB,EACtB,cAAsB;IAEtB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAA;IAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAA;IAC/C,MAAM,GAAG,GAAG,iDAAiD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IACtH,MAAM,kBAAkB,GAAG,gCAAoB,CAAC,aAAa,EAAE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