@segment/action-destinations 3.244.0 → 3.244.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/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/customerio/deleteObject/generated-types.d.ts +4 -0
- package/dist/destinations/customerio/deleteObject/generated-types.js +3 -0
- package/dist/destinations/customerio/deleteObject/generated-types.js.map +1 -0
- package/dist/destinations/customerio/deleteObject/index.d.ts +5 -0
- package/dist/destinations/customerio/deleteObject/index.js +48 -0
- package/dist/destinations/customerio/deleteObject/index.js.map +1 -0
- package/dist/destinations/customerio/deletePerson/generated-types.d.ts +3 -0
- package/dist/destinations/customerio/deletePerson/generated-types.js +3 -0
- package/dist/destinations/customerio/deletePerson/generated-types.js.map +1 -0
- package/dist/destinations/customerio/deletePerson/index.d.ts +5 -0
- package/dist/destinations/customerio/deletePerson/index.js +41 -0
- package/dist/destinations/customerio/deletePerson/index.js.map +1 -0
- package/dist/destinations/customerio/deleteRelationship/generated-types.d.ts +6 -0
- package/dist/destinations/customerio/deleteRelationship/generated-types.js +3 -0
- package/dist/destinations/customerio/deleteRelationship/generated-types.js.map +1 -0
- package/dist/destinations/customerio/deleteRelationship/index.d.ts +5 -0
- package/dist/destinations/customerio/deleteRelationship/index.js +82 -0
- package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -0
- package/dist/destinations/customerio/reportDeliveryEvent/generated-types.d.ts +10 -0
- package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js +3 -0
- package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js.map +1 -0
- package/dist/destinations/customerio/reportDeliveryEvent/index.d.ts +5 -0
- package/dist/destinations/customerio/reportDeliveryEvent/index.js +121 -0
- package/dist/destinations/customerio/reportDeliveryEvent/index.js.map +1 -0
- package/dist/destinations/customerio/suppressPerson/generated-types.d.ts +3 -0
- package/dist/destinations/customerio/suppressPerson/generated-types.js +3 -0
- package/dist/destinations/customerio/suppressPerson/generated-types.js.map +1 -0
- package/dist/destinations/customerio/suppressPerson/index.d.ts +5 -0
- package/dist/destinations/customerio/suppressPerson/index.js +41 -0
- package/dist/destinations/customerio/suppressPerson/index.js.map +1 -0
- package/dist/destinations/customerio/test-helper.d.ts +6 -0
- package/dist/destinations/customerio/test-helper.js +84 -0
- package/dist/destinations/customerio/test-helper.js.map +1 -0
- package/dist/destinations/customerio/unsuppressPerson/generated-types.d.ts +3 -0
- package/dist/destinations/customerio/unsuppressPerson/generated-types.js +3 -0
- package/dist/destinations/customerio/unsuppressPerson/generated-types.js.map +1 -0
- package/dist/destinations/customerio/unsuppressPerson/index.d.ts +5 -0
- package/dist/destinations/customerio/unsuppressPerson/index.js +41 -0
- package/dist/destinations/customerio/unsuppressPerson/index.js.map +1 -0
- package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
- package/dist/destinations/engage/sendgrid/Profile.js +3 -0
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +18 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +94 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +19 -6
- package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -1
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js +7 -0
- package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.d.ts +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +43 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/linkedin-conversions/api/api.test.js +118 -0
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +4 -1
- package/dist/destinations/linkedin-conversions/api/index.js +118 -27
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +1 -0
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +11 -2
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/types.d.ts +2 -0
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +14 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +113 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +20 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +174 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +1 -0
- package/dist/destinations/responsys/rsp-operations.d.ts +14 -0
- package/dist/destinations/responsys/rsp-operations.js +33 -0
- package/dist/destinations/responsys/rsp-operations.js.map +1 -0
- package/dist/destinations/responsys/rsp-properties.d.ts +4 -0
- package/dist/destinations/responsys/rsp-properties.js +27 -0
- package/dist/destinations/responsys/rsp-properties.js.map +1 -0
- package/dist/destinations/responsys/sendAudience/index.js +0 -1
- package/dist/destinations/responsys/sendAudience/index.js.map +1 -1
- package/dist/destinations/responsys/sendCustomTraits/index.js +0 -1
- package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -1
- package/dist/destinations/responsys/upsertListMember/index.js +2 -5
- package/dist/destinations/responsys/upsertListMember/index.js.map +1 -1
- package/dist/destinations/responsys/utils.d.ts +0 -1
- package/dist/destinations/responsys/utils.js +4 -14
- package/dist/destinations/responsys/utils.js.map +1 -1
- package/dist/destinations/segment/segment-properties.d.ts +1 -0
- package/dist/destinations/segment/segment-properties.js +7 -1
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendGroup/index.js +39 -25
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendIdentify/index.js +39 -25
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendPage/index.js +47 -33
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendScreen/index.js +40 -26
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendTrack/index.js +43 -29
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +499 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.d.ts +8 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +126 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +13 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +40 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -0
- package/dist/destinations/tiktok-conversions-sandbox/index.js +2 -2
- package/dist/destinations/tiktok-conversions-sandbox/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +16 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/utils.d.ts +8 -0
- package/dist/destinations/tiktok-offline-conversions/utils.js +67 -0
- package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions-sandbox/index.js +2 -2
- package/dist/destinations/tiktok-offline-conversions-sandbox/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js +1 -1
- package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js.map +1 -1
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/webhook/send/index.js +6 -0
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const test_data_1 = require("../../../../lib/test-data");
|
|
8
|
+
const index_1 = __importDefault(require("../../index"));
|
|
9
|
+
const nock_1 = __importDefault(require("nock"));
|
|
10
|
+
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
11
|
+
const actionSlug = 'updateUserProfile';
|
|
12
|
+
const destinationSlug = 'Braze';
|
|
13
|
+
const seedName = `${destinationSlug}#${actionSlug}`;
|
|
14
|
+
const receivedAt = '2021-08-03T17:40:04.055Z';
|
|
15
|
+
const settings = {
|
|
16
|
+
app_id: 'my-app-id',
|
|
17
|
+
api_key: 'my-api-key',
|
|
18
|
+
endpoint: 'https://rest.iad-01.braze.com'
|
|
19
|
+
};
|
|
20
|
+
describe(`Testing snapshot for ${destinationSlug}'s ${actionSlug} destination action:`, () => {
|
|
21
|
+
it('required fields', async () => {
|
|
22
|
+
const action = index_1.default.actions[actionSlug];
|
|
23
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, true);
|
|
24
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
25
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
26
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
27
|
+
const event = actions_core_1.createTestEvent({
|
|
28
|
+
properties: eventData
|
|
29
|
+
});
|
|
30
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
31
|
+
event: event,
|
|
32
|
+
mapping: event.properties,
|
|
33
|
+
settings: settingsData,
|
|
34
|
+
auth: undefined
|
|
35
|
+
});
|
|
36
|
+
const request = responses[0].request;
|
|
37
|
+
const rawBody = await request.text();
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.parse(rawBody);
|
|
40
|
+
expect(json).toMatchSnapshot();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
expect(rawBody).toMatchSnapshot();
|
|
45
|
+
}
|
|
46
|
+
expect(request.headers).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('all fields', async () => {
|
|
49
|
+
const action = index_1.default.actions[actionSlug];
|
|
50
|
+
const [eventData, settingsData] = test_data_1.generateTestData(seedName, index_1.default, action, false);
|
|
51
|
+
nock_1.default(/.*/).persist().get(/.*/).reply(200);
|
|
52
|
+
nock_1.default(/.*/).persist().post(/.*/).reply(200);
|
|
53
|
+
nock_1.default(/.*/).persist().put(/.*/).reply(200);
|
|
54
|
+
const event = actions_core_1.createTestEvent({
|
|
55
|
+
properties: eventData
|
|
56
|
+
});
|
|
57
|
+
const responses = await testDestination.testAction(actionSlug, {
|
|
58
|
+
event: event,
|
|
59
|
+
mapping: event.properties,
|
|
60
|
+
settings: settingsData,
|
|
61
|
+
auth: undefined
|
|
62
|
+
});
|
|
63
|
+
const request = responses[0].request;
|
|
64
|
+
const rawBody = await request.text();
|
|
65
|
+
try {
|
|
66
|
+
const json = JSON.parse(rawBody);
|
|
67
|
+
expect(json).toMatchSnapshot();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
expect(rawBody).toMatchSnapshot();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
it('it should work with batched events', async () => {
|
|
75
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
76
|
+
const events = [
|
|
77
|
+
actions_core_1.createTestEvent({
|
|
78
|
+
event: 'Test Event 1',
|
|
79
|
+
type: 'track',
|
|
80
|
+
receivedAt,
|
|
81
|
+
properties: {}
|
|
82
|
+
}),
|
|
83
|
+
actions_core_1.createTestEvent({
|
|
84
|
+
event: 'Test Event 2',
|
|
85
|
+
type: 'track',
|
|
86
|
+
receivedAt,
|
|
87
|
+
properties: {}
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
91
|
+
events,
|
|
92
|
+
useDefaultMappings: true,
|
|
93
|
+
mapping: {
|
|
94
|
+
external_id: {
|
|
95
|
+
'@path': '$.userId'
|
|
96
|
+
},
|
|
97
|
+
user_alias: {},
|
|
98
|
+
braze_id: {
|
|
99
|
+
'@path': '$.properties.braze_id'
|
|
100
|
+
},
|
|
101
|
+
name: {
|
|
102
|
+
'@path': '$.event'
|
|
103
|
+
},
|
|
104
|
+
time: {
|
|
105
|
+
'@path': '$.receivedAt'
|
|
106
|
+
},
|
|
107
|
+
properties: {
|
|
108
|
+
'@path': '$.properties'
|
|
109
|
+
},
|
|
110
|
+
products: {
|
|
111
|
+
'@path': '$.properties.products'
|
|
112
|
+
},
|
|
113
|
+
enable_batching: true,
|
|
114
|
+
_update_existing_only: true
|
|
115
|
+
},
|
|
116
|
+
settings: {
|
|
117
|
+
...settings
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
expect(responses.length).toBe(1);
|
|
121
|
+
expect(responses[0].status).toBe(200);
|
|
122
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
123
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
124
|
+
});
|
|
125
|
+
it('it should work with a single batched events', async () => {
|
|
126
|
+
nock_1.default('https://rest.iad-01.braze.com').post('/users/track').reply(200, {});
|
|
127
|
+
const events = [
|
|
128
|
+
actions_core_1.createTestEvent({
|
|
129
|
+
event: 'Test Event 1',
|
|
130
|
+
type: 'track',
|
|
131
|
+
receivedAt,
|
|
132
|
+
properties: {
|
|
133
|
+
products: [
|
|
134
|
+
{
|
|
135
|
+
quantity: 1,
|
|
136
|
+
product_id: 'Bowflex Treadmill 10',
|
|
137
|
+
price: 100
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
quantity: 2,
|
|
141
|
+
product_id: 'Bowflex Treadmill 20',
|
|
142
|
+
price: 200
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
];
|
|
148
|
+
const responses = await testDestination.testBatchAction(actionSlug, {
|
|
149
|
+
events,
|
|
150
|
+
useDefaultMappings: true,
|
|
151
|
+
mapping: {
|
|
152
|
+
external_id: {
|
|
153
|
+
'@path': '$.userId'
|
|
154
|
+
},
|
|
155
|
+
user_alias: {},
|
|
156
|
+
braze_id: {
|
|
157
|
+
'@path': '$.properties.braze_id'
|
|
158
|
+
},
|
|
159
|
+
name: {
|
|
160
|
+
'@path': '$.event'
|
|
161
|
+
},
|
|
162
|
+
time: {
|
|
163
|
+
'@path': '$.receivedAt'
|
|
164
|
+
},
|
|
165
|
+
properties: {
|
|
166
|
+
'@path': '$.properties'
|
|
167
|
+
},
|
|
168
|
+
products: {
|
|
169
|
+
'@path': '$.properties.products'
|
|
170
|
+
},
|
|
171
|
+
enable_batching: true,
|
|
172
|
+
_update_existing_only: true
|
|
173
|
+
},
|
|
174
|
+
settings: {
|
|
175
|
+
...settings
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
expect(responses.length).toBe(1);
|
|
179
|
+
expect(responses[0].status).toBe(200);
|
|
180
|
+
expect(responses[0].options.headers).toMatchSnapshot();
|
|
181
|
+
expect(responses[0].options.json).toMatchSnapshot();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=snapshot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.test.js","sourceRoot":"","sources":["../../../../../src/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4F;AAC5F,yDAA4D;AAC5D,wDAAqC;AACrC,gDAAuB;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AC,UAAU,EAAE;YAClE,MAAM;YACN,kBAAkB,EAAE,IAAI;YACxB,OAAO,EAAE;gBACP,WAAW,EAAE;oBACX,OAAO,EAAE,UAAU;iBACpB;gBACD,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE;oBACR,OAAO,EAAE,uBAAuB;iBACjC;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,SAAS;iBACnB;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,cAAc;iBACxB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE,cAAc;iBACxB;gBACD,QAAQ,EAAE;oBACR,OAAO,EAAE,uBAAuB;iBACjC;gBACD,eAAe,EAAE,IAAI;gBACrB,qBAAqB,EAAE,IAAI;aAC5B;YACD,QAAQ,EAAE;gBACR,GAAG,QAAQ;aACZ;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,CAAA;QACtD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/deleteObject/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Delete Object',
|
|
6
|
+
description: 'Delete an object in Customer.io.',
|
|
7
|
+
defaultSubscription: 'event = "Object Deleted"',
|
|
8
|
+
fields: {
|
|
9
|
+
object_id: {
|
|
10
|
+
label: 'Object ID',
|
|
11
|
+
description: 'An object ID used to identify an object.',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: {
|
|
14
|
+
'@path': '$.context.groupId'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
object_type_id: {
|
|
18
|
+
label: 'Object Type ID',
|
|
19
|
+
description: 'An object ID type used to identify the type of object.',
|
|
20
|
+
type: 'string',
|
|
21
|
+
default: {
|
|
22
|
+
'@if': {
|
|
23
|
+
exists: { '@path': '$.properties.object_type_id' },
|
|
24
|
+
then: { '@path': '$.properties.object_type_id' },
|
|
25
|
+
else: { '@path': '$.properties.objectTypeId' }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
performBatch: (request, { payload: payloads, settings }) => {
|
|
31
|
+
return utils_1.sendBatch(request, payloads.map((payload) => ({
|
|
32
|
+
action: 'delete',
|
|
33
|
+
payload,
|
|
34
|
+
settings,
|
|
35
|
+
type: 'object'
|
|
36
|
+
})));
|
|
37
|
+
},
|
|
38
|
+
perform: (request, { payload, settings }) => {
|
|
39
|
+
return utils_1.sendSingle(request, {
|
|
40
|
+
action: 'delete',
|
|
41
|
+
payload,
|
|
42
|
+
settings,
|
|
43
|
+
type: 'object'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.default = action;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/deleteObject/index.ts"],"names":[],"mappings":";;AAGA,oCAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kCAAkC;IAC/C,mBAAmB,EAAE,0BAA0B;IAC/C,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,0CAA0C;YACvD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,wDAAwD;YACrE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;oBAClD,IAAI,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE;oBAChD,IAAI,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;iBAC/C;aACF;SACF;KACF;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzD,OAAO,iBAAS,CACd,OAAO,EACP,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,QAAQ;YAChB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CACJ,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,kBAAU,CAAC,OAAO,EAAE;YACzB,MAAM,EAAE,QAAQ;YAChB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/deletePerson/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Delete Person',
|
|
6
|
+
description: 'Delete a person in Customer.io.',
|
|
7
|
+
defaultSubscription: 'event = "User Deleted"',
|
|
8
|
+
fields: {
|
|
9
|
+
person_id: {
|
|
10
|
+
label: 'Person ID',
|
|
11
|
+
description: 'The ID used to uniquely identify a person in Customer.io. [Learn more](https://customer.io/docs/identifying-people/#identifiers).',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: {
|
|
14
|
+
'@if': {
|
|
15
|
+
exists: { '@path': '$.userId' },
|
|
16
|
+
then: { '@path': '$.userId' },
|
|
17
|
+
else: { '@path': '$.traits.email' }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
performBatch: (request, { payload: payloads, settings }) => {
|
|
24
|
+
return utils_1.sendBatch(request, payloads.map((payload) => ({
|
|
25
|
+
action: 'delete',
|
|
26
|
+
payload,
|
|
27
|
+
settings,
|
|
28
|
+
type: 'person'
|
|
29
|
+
})));
|
|
30
|
+
},
|
|
31
|
+
perform: (request, { payload, settings }) => {
|
|
32
|
+
return utils_1.sendSingle(request, {
|
|
33
|
+
action: 'delete',
|
|
34
|
+
payload,
|
|
35
|
+
settings,
|
|
36
|
+
type: 'person'
|
|
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/customerio/deletePerson/index.ts"],"names":[],"mappings":";;AAGA,oCAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,iCAAiC;IAC9C,mBAAmB,EAAE,wBAAwB;IAC7C,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,mIAAmI;YACrI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;KACF;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzD,OAAO,iBAAS,CACd,OAAO,EACP,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,QAAQ;YAChB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CACJ,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,kBAAU,CAAC,OAAO,EAAE;YACzB,MAAM,EAAE,QAAQ;YAChB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/deleteRelationship/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Delete Relationship',
|
|
6
|
+
description: `Delete a relationship between a person and an object in Customer.io.`,
|
|
7
|
+
defaultSubscription: 'event = "Relationship Deleted"',
|
|
8
|
+
fields: {
|
|
9
|
+
person_id: {
|
|
10
|
+
label: 'Person ID',
|
|
11
|
+
description: 'The ID used to uniquely identify a person in Customer.io. [Learn more](https://customer.io/docs/identifying-people/#identifiers).',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: {
|
|
14
|
+
'@if': {
|
|
15
|
+
exists: { '@path': '$.userId' },
|
|
16
|
+
then: { '@path': '$.userId' },
|
|
17
|
+
else: { '@path': '$.traits.email' }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
anonymous_id: {
|
|
23
|
+
label: 'Anonymous ID',
|
|
24
|
+
description: 'An optional anonymous ID. This is used to tie anonymous events to this person. [Learn more](https://customer.io/docs/anonymous-events/).',
|
|
25
|
+
type: 'string',
|
|
26
|
+
default: {
|
|
27
|
+
'@path': '$.anonymousId'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
object_id: {
|
|
31
|
+
label: 'Object ID',
|
|
32
|
+
description: 'An object ID used to identify an object.',
|
|
33
|
+
type: 'string',
|
|
34
|
+
default: {
|
|
35
|
+
'@path': '$.context.groupId'
|
|
36
|
+
},
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
object_type_id: {
|
|
40
|
+
label: 'Object Type ID',
|
|
41
|
+
description: 'An object ID type used to identify the type of object.',
|
|
42
|
+
type: 'string',
|
|
43
|
+
default: {
|
|
44
|
+
'@if': {
|
|
45
|
+
exists: { '@path': '$.properties.object_type_id' },
|
|
46
|
+
then: { '@path': '$.properties.object_type_id' },
|
|
47
|
+
else: { '@path': '$.properties.objectTypeId' }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
performBatch: (request, { payload: payloads, settings }) => {
|
|
53
|
+
return utils_1.sendBatch(request, payloads.map((payload) => ({
|
|
54
|
+
action: 'delete_relationships',
|
|
55
|
+
settings,
|
|
56
|
+
...mapPayload(payload)
|
|
57
|
+
})));
|
|
58
|
+
},
|
|
59
|
+
perform: (request, { payload, settings }) => {
|
|
60
|
+
return utils_1.sendSingle(request, {
|
|
61
|
+
action: 'delete_relationships',
|
|
62
|
+
settings,
|
|
63
|
+
...mapPayload(payload)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function mapPayload(payload) {
|
|
68
|
+
const { anonymous_id, person_id } = payload;
|
|
69
|
+
return {
|
|
70
|
+
type: 'object',
|
|
71
|
+
payload: {
|
|
72
|
+
...payload,
|
|
73
|
+
cio_relationships: [
|
|
74
|
+
{
|
|
75
|
+
identifiers: utils_1.resolveIdentifiers({ anonymous_id, person_id })
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
exports.default = action;
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/deleteRelationship/index.ts"],"names":[],"mappings":";;AAGA,oCAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,sEAAsE;IACnF,mBAAmB,EAAE,gCAAgC;IACrD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,mIAAmI;YACrI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,0IAA0I;YAC5I,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aAC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AkB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;iBAC7D;aACF;SACF;KACF,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/reportDeliveryEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Report Delivery Event',
|
|
6
|
+
description: 'Report delivery metrics for a message sent from the Customer.io Journeys product.',
|
|
7
|
+
defaultSubscription: 'event = "Report Delivery Event"',
|
|
8
|
+
fields: {
|
|
9
|
+
delivery_id: {
|
|
10
|
+
label: 'Delivery ID',
|
|
11
|
+
description: 'The CIO-Delivery-ID from the message that you want to associate the metric with.',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: {
|
|
14
|
+
'@path': '$.properties.deliveryId'
|
|
15
|
+
},
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
metric: {
|
|
19
|
+
label: 'Metric',
|
|
20
|
+
description: `The metric you want to report back to Customer.io. Not all metrics are available for all channels. Please refer to the [documentation](https://customer.io/docs/api/track/#operation/metrics) for more information.`,
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: {
|
|
23
|
+
'@path': '$.properties.metric'
|
|
24
|
+
},
|
|
25
|
+
required: true,
|
|
26
|
+
choices: [
|
|
27
|
+
{ label: 'Delivered', value: 'delivered' },
|
|
28
|
+
{ label: 'Opened', value: 'opened' },
|
|
29
|
+
{ label: 'Clicked', value: 'clicked' },
|
|
30
|
+
{ label: 'Converted', value: 'converted' },
|
|
31
|
+
{ label: 'Marked as Spam', value: 'spammed' },
|
|
32
|
+
{ label: 'Bounced', value: 'bounced' },
|
|
33
|
+
{ label: 'Suppressed', value: 'dropped' },
|
|
34
|
+
{ label: 'Deferred', value: 'deferred' }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
recipient: {
|
|
38
|
+
label: 'Recipient',
|
|
39
|
+
description: `Information about who the message was delivered to. For email, SMS and mobile push this is the email address, phone number and device token, respectively.`,
|
|
40
|
+
type: 'string',
|
|
41
|
+
default: {
|
|
42
|
+
'@path': '$.properties.recipient'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
reason: {
|
|
46
|
+
label: 'Reason',
|
|
47
|
+
description: 'For metrics indicating a failure, this field provides information for the failure.',
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: {
|
|
50
|
+
'@path': '$.properties.reason'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
href: {
|
|
54
|
+
label: 'Href',
|
|
55
|
+
description: 'For click metrics, this is the link that was clicked.',
|
|
56
|
+
type: 'string',
|
|
57
|
+
default: {
|
|
58
|
+
'@path': '$.properties.href'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
action_name: {
|
|
62
|
+
label: 'Action Name',
|
|
63
|
+
description: 'For In-App messages, this is the name of the action that was clicked.',
|
|
64
|
+
type: 'string',
|
|
65
|
+
default: {
|
|
66
|
+
'@path': '$.properties.actionName'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
action_value: {
|
|
70
|
+
label: 'Action Value',
|
|
71
|
+
description: 'For In-App messages, this is the value of the action that was clicked.',
|
|
72
|
+
type: 'string',
|
|
73
|
+
default: {
|
|
74
|
+
'@path': '$.properties.actionValue'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
timestamp: {
|
|
78
|
+
label: 'Timestamp',
|
|
79
|
+
description: 'A timestamp of when the metric event took place. Default is when the event was triggered.',
|
|
80
|
+
type: 'datetime',
|
|
81
|
+
format: 'date-time',
|
|
82
|
+
default: {
|
|
83
|
+
'@path': '$.timestamp'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
perform: (request, { payload, settings }) => {
|
|
88
|
+
const metricsRequest = {
|
|
89
|
+
delivery_id: payload.delivery_id,
|
|
90
|
+
metric: payload.metric,
|
|
91
|
+
timestamp: Math.floor(Date.now() / 1000)
|
|
92
|
+
};
|
|
93
|
+
const unix_timestamp = Number(utils_1.convertValidTimestamp(payload.timestamp));
|
|
94
|
+
if (!isNaN(unix_timestamp)) {
|
|
95
|
+
metricsRequest.timestamp = unix_timestamp;
|
|
96
|
+
}
|
|
97
|
+
if (payload.recipient) {
|
|
98
|
+
metricsRequest.recipient = payload.recipient;
|
|
99
|
+
}
|
|
100
|
+
if (payload.reason) {
|
|
101
|
+
metricsRequest.reason = payload.reason;
|
|
102
|
+
}
|
|
103
|
+
if (payload.href) {
|
|
104
|
+
metricsRequest.href = payload.href;
|
|
105
|
+
}
|
|
106
|
+
if (payload.action_name) {
|
|
107
|
+
metricsRequest.metadata = metricsRequest.metadata || {};
|
|
108
|
+
metricsRequest.metadata.action_name = payload.action_name;
|
|
109
|
+
}
|
|
110
|
+
if (payload.action_value) {
|
|
111
|
+
metricsRequest.metadata = metricsRequest.metadata || {};
|
|
112
|
+
metricsRequest.metadata.action_value = payload.action_value;
|
|
113
|
+
}
|
|
114
|
+
return request(utils_1.trackApiEndpoint(settings) + '/api/v1/metrics', {
|
|
115
|
+
json: metricsRequest,
|
|
116
|
+
method: 'post'
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
exports.default = action;
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/reportDeliveryEvent/index.ts"],"names":[],"mappings":";;AAGA,oCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,mFAAmF;IAChG,mBAAmB,EAAE,iCAAiC;IACtD,MAAM,EAAE;QACN,WAAW,E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AG,OAAO,CAAC,IAAI,CAAA;SACnC;QAED,IAAI,OAAO,CAAC,WAAW,EAAE;YACvB,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAA;YACvD,cAAc,CAAC,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;SAC1D;QACD,IAAI,OAAO,CAAC,YAAY,EAAE;YACxB,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAA;YACvD,cAAc,CAAC,QAAQ,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAA;SAC5D;QAED,OAAO,OAAO,CAAC,wBAAgB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,EAAE;YAC7D,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAoBD,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/suppressPerson/generated-types.ts"],"names":[],"mappings":""}
|