@segment/action-destinations 3.335.2-staging.1 → 3.335.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/package.json +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +0 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +0 -184
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +0 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +0 -4
- 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 -43
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/categoryView/generated-types.js +0 -3
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/categoryView/index.d.ts +0 -5
- package/dist/destinations/movable-ink/categoryView/index.js +0 -43
- package/dist/destinations/movable-ink/categoryView/index.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +0 -20
- package/dist/destinations/movable-ink/conversion/generated-types.js +0 -3
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/conversion/index.d.ts +0 -5
- package/dist/destinations/movable-ink/conversion/index.js +0 -45
- package/dist/destinations/movable-ink/conversion/index.js.map +0 -1
- package/dist/destinations/movable-ink/fields.d.ts +0 -21
- package/dist/destinations/movable-ink/fields.js +0 -236
- package/dist/destinations/movable-ink/fields.js.map +0 -1
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +0 -7
- package/dist/destinations/movable-ink/identify/generated-types.js +0 -3
- package/dist/destinations/movable-ink/identify/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/identify/index.d.ts +0 -5
- package/dist/destinations/movable-ink/identify/index.js +0 -32
- package/dist/destinations/movable-ink/identify/index.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +0 -22
- package/dist/destinations/movable-ink/productAdded/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productAdded/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productAdded/index.js +0 -43
- package/dist/destinations/movable-ink/productAdded/index.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +0 -21
- package/dist/destinations/movable-ink/productViewed/generated-types.js +0 -3
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/productViewed/index.d.ts +0 -5
- package/dist/destinations/movable-ink/productViewed/index.js +0 -43
- package/dist/destinations/movable-ink/productViewed/index.js.map +0 -1
- package/dist/destinations/movable-ink/search/generated-types.d.ts +0 -12
- package/dist/destinations/movable-ink/search/generated-types.js +0 -3
- package/dist/destinations/movable-ink/search/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/search/index.d.ts +0 -5
- package/dist/destinations/movable-ink/search/index.js +0 -43
- package/dist/destinations/movable-ink/search/index.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +0 -25
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +0 -3
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +0 -1
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +0 -5
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +0 -48
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +0 -1
- package/dist/destinations/trackey/group.types.d.ts +0 -11
- package/dist/destinations/trackey/group.types.js +0 -3
- package/dist/destinations/trackey/group.types.js.map +0 -1
- package/dist/destinations/trackey/identify.types.d.ts +0 -11
- package/dist/destinations/trackey/identify.types.js +0 -3
- package/dist/destinations/trackey/identify.types.js.map +0 -1
- package/dist/destinations/trackey/track.types.d.ts +0 -12
- package/dist/destinations/trackey/track.types.js +0 -3
- package/dist/destinations/trackey/track.types.js.map +0 -1
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.335.
|
|
4
|
+
"version": "3.335.3-staging-1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AAEvB,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAC1D,MAAM,UAAU,GAAG,mBAAmB,CAAA;AACtC,MAAM,eAAe,GAAG,OAAO,CAAA;AAC/B,MAAM,QAAQ,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAA;AACnD,MAAM,UAAU,GAAG,0BAA0B,CAAA;AAC7C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,+BAAwC;CACnD,CAAA;AAED,QAAQ,CAAC,wBAAwB,eAAe,MAAM,UAAU,sBAAsB,EAAE,GAAG,EAAE;IAC3F,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,eAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,4BAAgB,CAAC,QAAQ,EAAE,eAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAEvF,cAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzC,cAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAA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E,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +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
|
-
email: { ...properties_1.email },
|
|
11
|
-
list_id: { ...properties_1.external_id }
|
|
12
|
-
},
|
|
13
|
-
perform: async (request, { payload }) => {
|
|
14
|
-
const { email, list_id } = payload;
|
|
15
|
-
if (!email || !list_id) {
|
|
16
|
-
throw new actions_core_1.IntegrationError("Insert the ID of the default list that you'd like to subscribe users", 'Missing required fields', 400);
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const profileData = await functions_1.getProfile(request, email);
|
|
20
|
-
const v = JSON.parse(profileData.content);
|
|
21
|
-
if (Object.keys(v).length !== 0) {
|
|
22
|
-
console.log(v);
|
|
23
|
-
const listData = {
|
|
24
|
-
data: [
|
|
25
|
-
{
|
|
26
|
-
type: 'profile',
|
|
27
|
-
id: v.data[0].id
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
};
|
|
31
|
-
const list = await functions_1.executeProfileList(request, 'DELETE', listData, list_id);
|
|
32
|
-
return list;
|
|
33
|
-
}
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
console.log(error);
|
|
38
|
-
throw new Error('An error occurred while processing the request');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.default = action;
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileToList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAK1E,4CAA6D;AAC7D,8CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,OAAO,EAAE,EAAE,GAAG,wBAAW,EAAE;KAC5B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;QAClC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE;YACtB,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,yBAAyB,EACzB,GAAG,CACJ,CAAA;SACF;QACD,IAAI;YACF,MAAM,WAAW,GAA2B,MAAM,sBAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YAC5E,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACzC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,MAAM,QAAQ,GAAa;oBACzB,IAAI,EAAE;wBACJ;4BACE,IAAI,EAAE,SAAS;4BACf,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;yBACjB;qBACF;iBACF,CAAA;gBAED,MAAM,IAAI,GAAG,MAAM,8BAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;gBAC3E,OAAO,IAAI,CAAA;aACZ;YACD,OAAM;SACP;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
movable_ink_url?: string;
|
|
3
|
-
user_id?: string;
|
|
4
|
-
anonymous_id?: string;
|
|
5
|
-
timestamp: string | number;
|
|
6
|
-
timezone?: string;
|
|
7
|
-
products_required_false?: {
|
|
8
|
-
id: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
price?: number;
|
|
11
|
-
url?: string;
|
|
12
|
-
quantity?: number;
|
|
13
|
-
[k: string]: unknown;
|
|
14
|
-
}[];
|
|
15
|
-
categories: {
|
|
16
|
-
id: string;
|
|
17
|
-
url?: string;
|
|
18
|
-
}[];
|
|
19
|
-
meta?: {
|
|
20
|
-
[k: string]: unknown;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/categoryView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +0,0 @@
|
|
|
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 fields_1 = require("../fields");
|
|
8
|
-
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
|
-
const action = {
|
|
10
|
-
title: 'Category View',
|
|
11
|
-
description: 'Send a "Category View" event to Movable Ink',
|
|
12
|
-
defaultSubscription: 'type = "track" and event = "Category Viewed"',
|
|
13
|
-
fields: {
|
|
14
|
-
movable_ink_url: fields_1.movable_ink_url,
|
|
15
|
-
user_id: fields_1.user_id,
|
|
16
|
-
anonymous_id: fields_1.anonymous_id,
|
|
17
|
-
timestamp: fields_1.timestamp,
|
|
18
|
-
timezone: fields_1.timezone,
|
|
19
|
-
products_required_false: fields_1.products_required_false,
|
|
20
|
-
categories: fields_1.categories,
|
|
21
|
-
meta: fields_1.meta
|
|
22
|
-
},
|
|
23
|
-
perform: (request, { settings, payload }) => {
|
|
24
|
-
const url = payload?.movable_ink_url ?? settings?.movable_ink_url;
|
|
25
|
-
if (!url)
|
|
26
|
-
throw new actions_core_1.IntegrationError('"Movable Ink URL" setting or "Movable Ink URL" field must be populated', 'MISSING_DESTINATION_URL', 400);
|
|
27
|
-
return request(url, {
|
|
28
|
-
method: 'POST',
|
|
29
|
-
json: {
|
|
30
|
-
event_name: 'Category View',
|
|
31
|
-
user_id: payload.user_id,
|
|
32
|
-
anonymous_id: payload.anonymous_id,
|
|
33
|
-
timestamp: payload.timestamp,
|
|
34
|
-
timezone: payload.timezone,
|
|
35
|
-
product: payload.products_required_false,
|
|
36
|
-
categories: payload.categories,
|
|
37
|
-
metadata: { ...omit_1.default(payload.meta, ['products_required_false', 'categories']) }
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.default = action;
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/categoryView/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAG1E,sCASkB;AAClB,uDAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,eAAe,EAAf,wBAAe;QACf,OAAO,EAAP,gBAAO;QACP,YAAY,EAAZ,qBAAY;QACZ,SAAS,EAAT,kBAAS;QACT,QAAQ,EAAR,iBAAQ;QACR,uBAAuB,EAAvB,gCAAuB;QACvB,UAAU,EAAV,mBAAU;QACV,IAAI,EAAJ,aAAI;KACL;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,CAAA;QACjE,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,+BAAgB,CACxB,wEAAwE,EACxE,yBAAyB,EACzB,GAAG,CACJ,CAAA;QAEH,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,eAAe;gBAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,uBAAuB;gBACxC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,QAAQ,EAAE,EAAE,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC,EAAE;aAC/E;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
movable_ink_url?: string;
|
|
3
|
-
user_id?: string;
|
|
4
|
-
anonymous_id?: string;
|
|
5
|
-
timestamp: string | number;
|
|
6
|
-
timezone?: string;
|
|
7
|
-
products: {
|
|
8
|
-
id: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
price?: number;
|
|
11
|
-
url?: string;
|
|
12
|
-
quantity?: number;
|
|
13
|
-
[k: string]: unknown;
|
|
14
|
-
}[];
|
|
15
|
-
order_id: string;
|
|
16
|
-
revenue: number;
|
|
17
|
-
meta?: {
|
|
18
|
-
[k: string]: unknown;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/conversion/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,45 +0,0 @@
|
|
|
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 fields_1 = require("../fields");
|
|
8
|
-
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
|
-
const action = {
|
|
10
|
-
title: 'Conversion',
|
|
11
|
-
description: 'Send a Conversion event Movable Ink',
|
|
12
|
-
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
13
|
-
fields: {
|
|
14
|
-
movable_ink_url: fields_1.movable_ink_url,
|
|
15
|
-
user_id: fields_1.user_id,
|
|
16
|
-
anonymous_id: fields_1.anonymous_id,
|
|
17
|
-
timestamp: fields_1.timestamp,
|
|
18
|
-
timezone: fields_1.timezone,
|
|
19
|
-
products: fields_1.products,
|
|
20
|
-
order_id: fields_1.order_id,
|
|
21
|
-
revenue: fields_1.revenue,
|
|
22
|
-
meta: fields_1.meta
|
|
23
|
-
},
|
|
24
|
-
perform: (request, { settings, payload }) => {
|
|
25
|
-
const url = payload?.movable_ink_url ?? settings?.movable_ink_url;
|
|
26
|
-
if (!url)
|
|
27
|
-
throw new actions_core_1.IntegrationError('"Movable Ink URL" setting or "Movable Ink URL" field must be populated', 'MISSING_DESTINATION_URL', 400);
|
|
28
|
-
return request(url, {
|
|
29
|
-
method: 'POST',
|
|
30
|
-
json: {
|
|
31
|
-
event_name: 'Conversion',
|
|
32
|
-
user_id: payload.user_id,
|
|
33
|
-
anonymous_id: payload.anonymous_id,
|
|
34
|
-
timestamp: payload.timestamp,
|
|
35
|
-
timezone: payload.timezone,
|
|
36
|
-
products: payload.products,
|
|
37
|
-
order_id: payload.order_id,
|
|
38
|
-
revenue: payload.revenue,
|
|
39
|
-
metadata: { ...omit_1.default(payload.meta, ['products', 'order_id', 'revenue']) }
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.default = action;
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/conversion/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAG1E,sCAUkB;AAClB,uDAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,qCAAqC;IAClD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,eAAe,EAAf,wBAAe;QACf,OAAO,EAAP,gBAAO;QACP,YAAY,EAAZ,qBAAY;QACZ,SAAS,EAAT,kBAAS;QACT,QAAQ,EAAR,iBAAQ;QACR,QAAQ,EAAR,iBAAQ;QACR,QAAQ,EAAR,iBAAQ;QACR,OAAO,EAAP,gBAAO;QACP,IAAI,EAAJ,aAAI;KACL;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,CAAA;QACjE,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,+BAAgB,CACxB,wEAAwE,EACxE,yBAAyB,EACzB,GAAG,CACJ,CAAA;QAEH,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,YAAY;gBACxB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,EAAE,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE;aACzE;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { InputField } from '@segment/actions-core/destination-kit/types';
|
|
2
|
-
export declare const movable_ink_url: InputField;
|
|
3
|
-
export declare const timestamp: InputField;
|
|
4
|
-
export declare const timezone: InputField;
|
|
5
|
-
export declare const event_name: InputField;
|
|
6
|
-
export declare const user_id: InputField;
|
|
7
|
-
export declare const anonymous_id: InputField;
|
|
8
|
-
export declare const meta: InputField;
|
|
9
|
-
export declare const query_url: InputField;
|
|
10
|
-
export declare const revenue: InputField;
|
|
11
|
-
export declare const revenue_required_false: InputField;
|
|
12
|
-
export declare const query: InputField;
|
|
13
|
-
export declare const order_id: InputField;
|
|
14
|
-
export declare const order_id_required_false: InputField;
|
|
15
|
-
export declare const product_quantity: InputField;
|
|
16
|
-
export declare const product: InputField;
|
|
17
|
-
export declare const product_with_quantity: InputField;
|
|
18
|
-
export declare const products: InputField;
|
|
19
|
-
export declare const products_required_false: InputField;
|
|
20
|
-
export declare const categories: InputField;
|
|
21
|
-
export declare const categories_required_false: InputField;
|