@segment/action-destinations 3.219.0-staging.0 → 3.220.0-54bb01e8
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/ambee/subscribeUserToCampaign/index.js +4 -2
- package/dist/destinations/ambee/subscribeUserToCampaign/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/syncAudiences/index.js +6 -3
- package/dist/destinations/braze-cohorts/syncAudiences/index.js.map +1 -1
- package/dist/destinations/cordial/identities-fields.d.ts +1 -1
- package/dist/destinations/cordial/identities-fields.js +5 -3
- package/dist/destinations/cordial/identities-fields.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +10 -5
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +0 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -1
- package/dist/destinations/google-sheets/postSheet/index.js +2 -1
- package/dist/destinations/google-sheets/postSheet/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertContact/index.d.ts +1 -1
- package/dist/destinations/hubspot/upsertContact/index.js +28 -8
- package/dist/destinations/hubspot/upsertContact/index.js.map +1 -1
- package/dist/destinations/index.js +2 -2
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +5 -9
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -21
- package/dist/destinations/klaviyo/upsertProfile/index.js +5 -150
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/launchdarkly-audiences/syncAudience/index.js +12 -6
- package/dist/destinations/launchdarkly-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +8 -4
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js +2 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -1
- package/dist/destinations/loops/createOrUpdateContact/generated-types.d.ts +1 -1
- package/dist/destinations/loops/createOrUpdateContact/index.js +2 -2
- package/dist/destinations/loops/createOrUpdateContact/index.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js +8 -4
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js.map +1 -1
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js +2 -1
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardGroupEvent/index.js +10 -5
- package/dist/destinations/outfunnel/forwardGroupEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js +8 -4
- package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardTrackEvent/index.js +8 -4
- package/dist/destinations/outfunnel/forwardTrackEvent/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +1 -0
- package/dist/destinations/segment-profiles/segment-properties.js +9 -1
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendGroup/index.js +3 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendIdentify/index.js +3 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendSubscription/index.js +4 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/functions.js +7 -1
- package/dist/destinations/the-trade-desk-crm/functions.js.map +1 -1
- package/dist/destinations/the-trade-desk-crm/index.js +1 -1
- package/dist/destinations/tiktok-audiences/properties.js +8 -4
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/trackey/generated-types.d.ts +3 -0
- package/dist/destinations/trackey/generated-types.js.map +1 -0
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/{yahoo-audiences/createSegment/generated-types.js → trackey/group.types.js} +1 -1
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/{klaviyo/trackEvent/generated-types.js → trackey/identify.types.js} +1 -1
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/index.d.ts +4 -0
- package/dist/destinations/trackey/index.js +206 -0
- package/dist/destinations/trackey/index.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/{yahoo-audiences/createCustomerNode/generated-types.js → trackey/track.types.js} +1 -1
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js +6 -3
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js.map +1 -1
- package/dist/destinations/webhook/send/index.js +3 -1
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/generated-types.d.ts +2 -4
- package/dist/destinations/yahoo-audiences/index.js +47 -42
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/types.d.ts +6 -0
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +4 -5
- package/dist/destinations/yahoo-audiences/updateSegment/index.d.ts +2 -2
- package/dist/destinations/yahoo-audiences/updateSegment/index.js +66 -65
- package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/utils-rt.d.ts +3 -3
- package/dist/destinations/yahoo-audiences/utils-rt.js +28 -20
- package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -1
- package/dist/destinations/yahoo-audiences/utils-tax.d.ts +3 -5
- package/dist/destinations/yahoo-audiences/utils-tax.js +28 -17
- package/dist/destinations/yahoo-audiences/utils-tax.js.map +1 -1
- package/package.json +1 -1
- package/dist/destinations/klaviyo/config.d.ts +0 -1
- package/dist/destinations/klaviyo/config.js +0 -5
- package/dist/destinations/klaviyo/config.js.map +0 -1
- package/dist/destinations/klaviyo/orderCompleted/generated-types.d.ts +0 -22
- package/dist/destinations/klaviyo/orderCompleted/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/orderCompleted/index.d.ts +0 -5
- package/dist/destinations/klaviyo/orderCompleted/index.js +0 -152
- package/dist/destinations/klaviyo/orderCompleted/index.js.map +0 -1
- package/dist/destinations/klaviyo/trackEvent/generated-types.d.ts +0 -16
- package/dist/destinations/klaviyo/trackEvent/generated-types.js.map +0 -1
- package/dist/destinations/klaviyo/trackEvent/index.d.ts +0 -5
- package/dist/destinations/klaviyo/trackEvent/index.js +0 -118
- package/dist/destinations/klaviyo/trackEvent/index.js.map +0 -1
- package/dist/destinations/klaviyo/types.d.ts +0 -61
- package/dist/destinations/klaviyo/types.js +0 -8
- package/dist/destinations/klaviyo/types.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.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.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
- /package/dist/destinations/{klaviyo/orderCompleted → trackey}/generated-types.js +0 -0
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.update_taxonomy = exports.gen_oauth1_signature = exports.gen_random_id = exports.gen_segment_subtaxonomy_payload = exports.gen_customer_taxonomy_payload = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
|
|
5
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
6
|
+
function gen_customer_taxonomy_payload(settings) {
|
|
6
7
|
const data = {
|
|
7
|
-
id:
|
|
8
|
-
name:
|
|
9
|
-
description:
|
|
8
|
+
id: settings.engage_space_id,
|
|
9
|
+
name: settings.engage_space_id,
|
|
10
|
+
description: settings.customer_desc,
|
|
10
11
|
users: {
|
|
11
12
|
include: [settings.mdm_id]
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
const req_body_form = `--SEGMENT-DATA\r\nContent-Disposition: form-data; name="metadata"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n{ "description" : "${
|
|
15
|
+
const req_body_form = `--SEGMENT-DATA\r\nContent-Disposition: form-data; name="metadata"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n{ "description" : "${settings.customer_desc}" }\r\n--SEGMENT-DATA\r\nContent-Disposition: form-data; name="data"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n${JSON.stringify(data)}\r\n--SEGMENT-DATA--`;
|
|
15
16
|
return req_body_form;
|
|
16
17
|
}
|
|
17
18
|
exports.gen_customer_taxonomy_payload = gen_customer_taxonomy_payload;
|
|
@@ -21,7 +22,7 @@ function gen_segment_subtaxonomy_payload(payload) {
|
|
|
21
22
|
name: payload.segment_audience_key,
|
|
22
23
|
type: 'SEGMENT'
|
|
23
24
|
};
|
|
24
|
-
const req_body_form = `--SEGMENT-DATA\r\nContent-Disposition: form-data; name="metadata"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n{ "description" : "${
|
|
25
|
+
const req_body_form = `--SEGMENT-DATA\r\nContent-Disposition: form-data; name="metadata"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n{ "description" : "Create segment ${data.id}" }\r\n--SEGMENT-DATA\r\nContent-Disposition: form-data; name="data"\r\nContent-Type: application/json;charset=UTF-8\r\n\r\n${JSON.stringify(data)}\r\n--SEGMENT-DATA--`;
|
|
25
26
|
return req_body_form;
|
|
26
27
|
}
|
|
27
28
|
exports.gen_segment_subtaxonomy_payload = gen_segment_subtaxonomy_payload;
|
|
@@ -48,20 +49,30 @@ function gen_oauth1_signature(client_key, client_secret, method, url) {
|
|
|
48
49
|
}
|
|
49
50
|
exports.gen_oauth1_signature = gen_oauth1_signature;
|
|
50
51
|
async function update_taxonomy(engage_space_id, tx_creds, request, body_form_data) {
|
|
51
|
-
const tx_client_secret = tx_creds.
|
|
52
|
-
const tx_client_key = tx_creds.
|
|
52
|
+
const tx_client_secret = tx_creds.tx_client_secret;
|
|
53
|
+
const tx_client_key = tx_creds.tx_client_key;
|
|
53
54
|
const url = `https://datax.yahooapis.com/v1/taxonomy/append${engage_space_id.length > 0 ? '/' + engage_space_id : ''}`;
|
|
54
55
|
const oauth1_auth_string = gen_oauth1_signature(tx_client_key, tx_client_secret, 'PUT', url);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
try {
|
|
57
|
+
const add_segment_node = await request(url, {
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
body: body_form_data,
|
|
60
|
+
headers: {
|
|
61
|
+
Authorization: oauth1_auth_string,
|
|
62
|
+
'Content-Type': 'multipart/form-data; boundary=SEGMENT-DATA'
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return await add_segment_node.json();
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const _error = error;
|
|
69
|
+
if (parseInt(_error.response.status) == 401) {
|
|
70
|
+
throw new actions_core_1.IntegrationError(`Error while updating taxonomy: ${JSON.stringify(_error.response.data)} ${_error.response.status}. Validate Yahoo credentials`, 'YAHOO_TAXONOMY_API_AUTH_ERR', 400);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
throw error;
|
|
61
74
|
}
|
|
62
|
-
}
|
|
63
|
-
console.log('upd tax status:', add_segment_node.status);
|
|
64
|
-
return await add_segment_node.json();
|
|
75
|
+
}
|
|
65
76
|
}
|
|
66
77
|
exports.update_taxonomy = update_taxonomy;
|
|
67
78
|
//# sourceMappingURL=utils-tax.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-tax.js","sourceRoot":"","sources":["../../../src/destinations/yahoo-audiences/utils-tax.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils-tax.js","sourceRoot":"","sources":["../../../src/destinations/yahoo-audiences/utils-tax.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAEnC,wDAAuE;AAEvE,SAAgB,6BAA6B,CAAC,QAAkB;IAC9D,MAAM,IAAI,GAAG;QACX,EAAE,EAAE,QAAQ,CAAC,eAAe;QAC5B,IAAI,EAAE,QAAQ,CAAC,eAAe;QAC9B,WAAW,EAAE,QAAQ,CAAC,aAAa;QACnC,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;SAC3B;KACF,CAAA;IAED,MAAM,aAAa,GAAG,+IACpB,QAAQ,CAAC,aACX,+HAA+H,IAAI,CAAC,SAAS,CAC3I,IAAI,CACL,sBAAsB,CAAA;IACvB,OAAO,aAAa,CAAA;AACtB,CAAC;AAhBD,sEAgBC;AAED,SAAgB,+BAA+B,CAAC,OAAyB;IACvE,MAAM,IAAI,GAAG;QACX,EAAE,EAAE,OAAO,CAAC,mBAAmB;QAC/B,IAAI,EAAE,OAAO,CAAC,oBAAoB;QAClC,IAAI,EAAE,SAAS;KAChB,CAAA;IACD,M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AC,QAAQ,CAAC,MAClB,8BAA8B,EAC9B,6BAA6B,EAC7B,GAAG,CACJ,CAAA;SACF;aAAM;YACL,MAAM,KAAK,CAAA;SACZ;KACF;AACH,CAAC;AApCD,0CAoCC"}
|
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.220.0-54bb01e8",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const API_URL = "https://a.klaviyo.com/api";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/config.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,2BAA2B,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
profile: {
|
|
3
|
-
email?: string;
|
|
4
|
-
phone_number?: string;
|
|
5
|
-
other_properties?: {
|
|
6
|
-
[k: string]: unknown;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
metric_name: string;
|
|
10
|
-
properties: {
|
|
11
|
-
[k: string]: unknown;
|
|
12
|
-
};
|
|
13
|
-
time?: string | number;
|
|
14
|
-
value?: number;
|
|
15
|
-
unique_id?: string;
|
|
16
|
-
products?: {
|
|
17
|
-
value?: number;
|
|
18
|
-
properties?: {
|
|
19
|
-
[k: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
}[];
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
const createEventData = (payload) => ({
|
|
6
|
-
data: {
|
|
7
|
-
type: 'event',
|
|
8
|
-
attributes: {
|
|
9
|
-
properties: { ...payload.properties },
|
|
10
|
-
time: payload.time,
|
|
11
|
-
value: payload.value,
|
|
12
|
-
metric: {
|
|
13
|
-
data: {
|
|
14
|
-
type: 'metric',
|
|
15
|
-
attributes: {
|
|
16
|
-
name: 'Order Completed'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
profile: {
|
|
21
|
-
data: {
|
|
22
|
-
type: 'profile',
|
|
23
|
-
attributes: {
|
|
24
|
-
...payload.profile
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const sendProductRequests = async (payload, eventData, request) => {
|
|
32
|
-
if (payload.products && Array.isArray(payload.products)) {
|
|
33
|
-
const productPromises = payload?.products?.map((product) => {
|
|
34
|
-
eventData.data.attributes.properties = product.properties;
|
|
35
|
-
eventData.data.attributes.value = product.value;
|
|
36
|
-
eventData.data.attributes.metric.data.attributes.name = 'Ordered Product';
|
|
37
|
-
return request(`${config_1.API_URL}/events/`, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
json: eventData
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
await Promise.all(productPromises);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const action = {
|
|
46
|
-
title: 'Order Completed',
|
|
47
|
-
description: 'Order Completed Event action tracks users Order Completed events and associate it with their profile.',
|
|
48
|
-
defaultSubscription: 'type = "track"',
|
|
49
|
-
fields: {
|
|
50
|
-
profile: {
|
|
51
|
-
label: 'Profile',
|
|
52
|
-
description: `Properties of the profile that triggered this event.`,
|
|
53
|
-
type: 'object',
|
|
54
|
-
properties: {
|
|
55
|
-
email: {
|
|
56
|
-
label: 'Email',
|
|
57
|
-
type: 'string'
|
|
58
|
-
},
|
|
59
|
-
phone_number: {
|
|
60
|
-
label: 'Phone Number',
|
|
61
|
-
type: 'string'
|
|
62
|
-
},
|
|
63
|
-
other_properties: {
|
|
64
|
-
label: 'Other Properties',
|
|
65
|
-
type: 'object'
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
required: true
|
|
69
|
-
},
|
|
70
|
-
metric_name: {
|
|
71
|
-
label: 'Metric Name',
|
|
72
|
-
description: 'Name of the event. Must be less than 128 characters.',
|
|
73
|
-
type: 'string',
|
|
74
|
-
default: {
|
|
75
|
-
'@path': '$.event'
|
|
76
|
-
},
|
|
77
|
-
required: true
|
|
78
|
-
},
|
|
79
|
-
properties: {
|
|
80
|
-
description: `Properties of this event.`,
|
|
81
|
-
label: 'Properties',
|
|
82
|
-
type: 'object',
|
|
83
|
-
default: {
|
|
84
|
-
'@path': '$.properties'
|
|
85
|
-
},
|
|
86
|
-
required: true
|
|
87
|
-
},
|
|
88
|
-
time: {
|
|
89
|
-
label: 'Time',
|
|
90
|
-
description: `When this event occurred. By default, the time the request was received will be used.
|
|
91
|
-
The time is truncated to the second. The time must be after the year 2000 and can only
|
|
92
|
-
be up to 1 year in the future.
|
|
93
|
-
`,
|
|
94
|
-
type: 'datetime',
|
|
95
|
-
default: {
|
|
96
|
-
'@path': '$.timestamp'
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
value: {
|
|
100
|
-
label: 'Value',
|
|
101
|
-
description: 'A numeric value to associate with this event. For example, the dollar amount of a purchase.',
|
|
102
|
-
type: 'number'
|
|
103
|
-
},
|
|
104
|
-
unique_id: {
|
|
105
|
-
label: 'Unique ID',
|
|
106
|
-
description: `A unique identifier for an event. If the unique_id is repeated for the same
|
|
107
|
-
profile and metric, only the first processed event will be recorded. If this is not
|
|
108
|
-
present, this will use the time to the second. Using the default, this limits only one
|
|
109
|
-
event per profile per second.
|
|
110
|
-
`,
|
|
111
|
-
type: 'string',
|
|
112
|
-
default: {
|
|
113
|
-
'@path': '$.event'
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
products: {
|
|
117
|
-
label: 'Products',
|
|
118
|
-
description: 'List of products purchased in the order.',
|
|
119
|
-
multiple: true,
|
|
120
|
-
type: 'object',
|
|
121
|
-
properties: {
|
|
122
|
-
value: {
|
|
123
|
-
label: 'Value',
|
|
124
|
-
description: 'A numeric value to associate with this event. For example, the dollar amount of a purchase.',
|
|
125
|
-
type: 'number'
|
|
126
|
-
},
|
|
127
|
-
properties: {
|
|
128
|
-
description: `Properties of this event.`,
|
|
129
|
-
label: 'Properties',
|
|
130
|
-
type: 'object'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
perform: async (request, { payload }) => {
|
|
136
|
-
const { email, phone_number } = payload.profile;
|
|
137
|
-
if (!email && !phone_number) {
|
|
138
|
-
throw new actions_core_1.IntegrationError('One of Phone Number or Email is required.', 'Missing required fields', 400);
|
|
139
|
-
}
|
|
140
|
-
const eventData = createEventData(payload);
|
|
141
|
-
const event = await request(`${config_1.API_URL}/events/`, {
|
|
142
|
-
method: 'POST',
|
|
143
|
-
json: eventData
|
|
144
|
-
});
|
|
145
|
-
if (event.status == 202 && Array.isArray(payload.products)) {
|
|
146
|
-
await sendProductRequests(payload, eventData, request);
|
|
147
|
-
}
|
|
148
|
-
return event;
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
exports.default = action;
|
|
152
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/orderCompleted/index.ts"],"names":[],"mappings":";;AAGA,wDAAuE;AACvE,sCAAmC;AAGnC,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,EAA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CAA0C;YACvD,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,6FAA6F;oBAC1G,IAAI,EAAE,QAAQ;iBACf;gBACD,UAAU,EAAE;oBACV,WAAW,EAAE,2BAA2B;oBACxC,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAA;QAE/C,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,EAAE;YAC3B,MAAM,IAAI,+BAAgB,CAAC,2CAA2C,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAA;SACxG;QAED,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;QAE1C,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,UAAU,EAAE;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;SAChB,CAAC,CAAA;QAEF,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC1D,MAAM,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;SACvD;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
profile: {
|
|
3
|
-
email?: string | null;
|
|
4
|
-
phone_number?: string | null;
|
|
5
|
-
other_properties?: {
|
|
6
|
-
[k: string]: unknown;
|
|
7
|
-
} | null;
|
|
8
|
-
};
|
|
9
|
-
metric_name: string;
|
|
10
|
-
properties: {
|
|
11
|
-
[k: string]: unknown;
|
|
12
|
-
};
|
|
13
|
-
time?: string | number;
|
|
14
|
-
value?: number;
|
|
15
|
-
unique_id?: string;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/trackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Track Event',
|
|
7
|
-
description: 'Track user events and associate it with their profile.',
|
|
8
|
-
defaultSubscription: 'type = "track"',
|
|
9
|
-
fields: {
|
|
10
|
-
profile: {
|
|
11
|
-
label: 'Profile',
|
|
12
|
-
description: `Properties of the profile that triggered this event.`,
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
email: {
|
|
16
|
-
label: 'Email',
|
|
17
|
-
type: 'string',
|
|
18
|
-
allowNull: true
|
|
19
|
-
},
|
|
20
|
-
phone_number: {
|
|
21
|
-
label: 'Phone Number',
|
|
22
|
-
type: 'string',
|
|
23
|
-
allowNull: true
|
|
24
|
-
},
|
|
25
|
-
other_properties: {
|
|
26
|
-
label: 'Other Properties',
|
|
27
|
-
type: 'object',
|
|
28
|
-
allowNull: true
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
required: true
|
|
32
|
-
},
|
|
33
|
-
metric_name: {
|
|
34
|
-
label: 'Metric Name',
|
|
35
|
-
description: 'Name of the event. Must be less than 128 characters.',
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: {
|
|
38
|
-
'@path': '$.event'
|
|
39
|
-
},
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
properties: {
|
|
43
|
-
description: `Properties of this event.`,
|
|
44
|
-
label: 'Properties',
|
|
45
|
-
type: 'object',
|
|
46
|
-
default: {
|
|
47
|
-
'@path': '$.properties'
|
|
48
|
-
},
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
time: {
|
|
52
|
-
label: 'Time',
|
|
53
|
-
description: `When this event occurred. By default, the time the request was received will be used.
|
|
54
|
-
The time is truncated to the second. The time must be after the year 2000 and can only
|
|
55
|
-
be up to 1 year in the future.
|
|
56
|
-
`,
|
|
57
|
-
type: 'datetime',
|
|
58
|
-
default: {
|
|
59
|
-
'@path': '$.timestamp'
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
value: {
|
|
63
|
-
label: 'Value',
|
|
64
|
-
description: 'A numeric value to associate with this event. For example, the dollar amount of a purchase.',
|
|
65
|
-
type: 'number'
|
|
66
|
-
},
|
|
67
|
-
unique_id: {
|
|
68
|
-
label: 'Unique ID',
|
|
69
|
-
description: `A unique identifier for an event. If the unique_id is repeated for the same
|
|
70
|
-
profile and metric, only the first processed event will be recorded. If this is not
|
|
71
|
-
present, this will use the time to the second. Using the default, this limits only one
|
|
72
|
-
event per profile per second.
|
|
73
|
-
`,
|
|
74
|
-
type: 'string',
|
|
75
|
-
default: {
|
|
76
|
-
'@path': '$.event'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
perform: (request, { payload }) => {
|
|
81
|
-
const { email, phone_number } = payload.profile;
|
|
82
|
-
if (!email && !phone_number) {
|
|
83
|
-
throw new actions_core_1.IntegrationError('One of Phone Number or Email is required.', 'Missing required fields', 400);
|
|
84
|
-
}
|
|
85
|
-
const eventData = {
|
|
86
|
-
data: {
|
|
87
|
-
type: 'event',
|
|
88
|
-
attributes: {
|
|
89
|
-
properties: { ...payload.properties },
|
|
90
|
-
time: payload.time,
|
|
91
|
-
value: payload.value,
|
|
92
|
-
metric: {
|
|
93
|
-
data: {
|
|
94
|
-
type: 'metric',
|
|
95
|
-
attributes: {
|
|
96
|
-
name: payload.metric_name
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
profile: {
|
|
101
|
-
data: {
|
|
102
|
-
type: 'profile',
|
|
103
|
-
attributes: {
|
|
104
|
-
...payload.profile
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
return request(`${config_1.API_URL}/events/`, {
|
|
112
|
-
method: 'POST',
|
|
113
|
-
json: eventData
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
exports.default = action;
|
|
118
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/trackEvent/index.ts"],"names":[],"mappings":";;AAIA,wDAAwD;AACxD,sCAAmC;AAEnC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,wDAAwD;IACrE,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,IAAI;iBAChB;gBACD,YAAY,EAAE;oBACZ,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,IAAI;iBAChB;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,IAAI;iBAChB;aACF;YACD,QAAQ,EAAE,IAAI;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;g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qBACF;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE;4BACJ,IAAI,EAAE,SAAS;4BACf,UAAU,EAAE;gCACV,GAAG,OAAO,CAAC,OAAO;6BACnB;yBACF;qBACF;iBACF;aACF;SACF,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,gBAAO,UAAU,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;SAChB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { HTTPError } from '@segment/actions-core';
|
|
2
|
-
export declare class KlaviyoAPIError extends HTTPError {
|
|
3
|
-
response: Response & {
|
|
4
|
-
data: {
|
|
5
|
-
errors: Array<{
|
|
6
|
-
id: string;
|
|
7
|
-
status: number;
|
|
8
|
-
code: string;
|
|
9
|
-
title: string;
|
|
10
|
-
detail: string;
|
|
11
|
-
source: {
|
|
12
|
-
pointer: string;
|
|
13
|
-
};
|
|
14
|
-
meta: {
|
|
15
|
-
duplicate_profile_id: string;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
content: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export interface ProfileData {
|
|
23
|
-
data: {
|
|
24
|
-
type: string;
|
|
25
|
-
id?: string;
|
|
26
|
-
attributes: {
|
|
27
|
-
email?: string;
|
|
28
|
-
external_id?: string;
|
|
29
|
-
phone_number?: string;
|
|
30
|
-
[key: string]: string | Record<string, unknown> | undefined;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface EventData {
|
|
35
|
-
data: {
|
|
36
|
-
type: string;
|
|
37
|
-
attributes: {
|
|
38
|
-
properties?: object;
|
|
39
|
-
time?: string | number;
|
|
40
|
-
value?: number;
|
|
41
|
-
metric: {
|
|
42
|
-
data: {
|
|
43
|
-
type: string;
|
|
44
|
-
attributes: {
|
|
45
|
-
name?: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
profile: {
|
|
50
|
-
data: {
|
|
51
|
-
type: string;
|
|
52
|
-
attributes: {
|
|
53
|
-
email?: string;
|
|
54
|
-
phone_number?: string;
|
|
55
|
-
other_properties?: object;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KlaviyoAPIError = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
class KlaviyoAPIError extends actions_core_1.HTTPError {
|
|
6
|
-
}
|
|
7
|
-
exports.KlaviyoAPIError = KlaviyoAPIError;
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AAEjD,MAAa,eAAgB,SAAQ,wBAAS;CAmB7C;AAnBD,0CAmBC"}
|
|
@@ -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":""}
|