n8n-nodes-segment 1.0.0
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/LICENSE +46 -0
- package/README.md +419 -0
- package/dist/credentials/SegmentApi.credentials.d.ts +10 -0
- package/dist/credentials/SegmentApi.credentials.d.ts.map +1 -0
- package/dist/credentials/SegmentApi.credentials.js +88 -0
- package/dist/credentials/SegmentApi.credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Segment/Segment.node.d.ts +6 -0
- package/dist/nodes/Segment/Segment.node.d.ts.map +1 -0
- package/dist/nodes/Segment/Segment.node.js +283 -0
- package/dist/nodes/Segment/Segment.node.js.map +1 -0
- package/dist/nodes/Segment/SegmentTrigger.node.d.ts +6 -0
- package/dist/nodes/Segment/SegmentTrigger.node.d.ts.map +1 -0
- package/dist/nodes/Segment/SegmentTrigger.node.js +257 -0
- package/dist/nodes/Segment/SegmentTrigger.node.js.map +1 -0
- package/dist/nodes/Segment/actions/audiences/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/audiences/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/audiences/index.js +304 -0
- package/dist/nodes/Segment/actions/audiences/index.js.map +1 -0
- package/dist/nodes/Segment/actions/auditTrail/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/auditTrail/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/auditTrail/index.js +192 -0
- package/dist/nodes/Segment/actions/auditTrail/index.js.map +1 -0
- package/dist/nodes/Segment/actions/catalog/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/catalog/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/catalog/index.js +144 -0
- package/dist/nodes/Segment/actions/catalog/index.js.map +1 -0
- package/dist/nodes/Segment/actions/computedTraits/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/computedTraits/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/computedTraits/index.js +257 -0
- package/dist/nodes/Segment/actions/computedTraits/index.js.map +1 -0
- package/dist/nodes/Segment/actions/destinations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/destinations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/destinations/index.js +297 -0
- package/dist/nodes/Segment/actions/destinations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/functions/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/functions/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/functions/index.js +389 -0
- package/dist/nodes/Segment/actions/functions/index.js.map +1 -0
- package/dist/nodes/Segment/actions/labels/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/labels/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/labels/index.js +221 -0
- package/dist/nodes/Segment/actions/labels/index.js.map +1 -0
- package/dist/nodes/Segment/actions/regulations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/regulations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/regulations/index.js +322 -0
- package/dist/nodes/Segment/actions/regulations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/sources/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/sources/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/sources/index.js +371 -0
- package/dist/nodes/Segment/actions/sources/index.js.map +1 -0
- package/dist/nodes/Segment/actions/spaces/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/spaces/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/spaces/index.js +328 -0
- package/dist/nodes/Segment/actions/spaces/index.js.map +1 -0
- package/dist/nodes/Segment/actions/track/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/track/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/track/index.js +499 -0
- package/dist/nodes/Segment/actions/track/index.js.map +1 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.js +340 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.js.map +1 -0
- package/dist/nodes/Segment/actions/transformations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/transformations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/transformations/index.js +280 -0
- package/dist/nodes/Segment/actions/transformations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/users/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/users/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/users/index.js +233 -0
- package/dist/nodes/Segment/actions/users/index.js.map +1 -0
- package/dist/nodes/Segment/actions/warehouses/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/warehouses/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/warehouses/index.js +313 -0
- package/dist/nodes/Segment/actions/warehouses/index.js.map +1 -0
- package/dist/nodes/Segment/actions/workspace/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/workspace/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/workspace/index.js +100 -0
- package/dist/nodes/Segment/actions/workspace/index.js.map +1 -0
- package/dist/nodes/Segment/constants/index.d.ts +23 -0
- package/dist/nodes/Segment/constants/index.d.ts.map +1 -0
- package/dist/nodes/Segment/constants/index.js +720 -0
- package/dist/nodes/Segment/constants/index.js.map +1 -0
- package/dist/nodes/Segment/segment.svg +6 -0
- package/dist/nodes/Segment/transport/index.d.ts +35 -0
- package/dist/nodes/Segment/transport/index.d.ts.map +1 -0
- package/dist/nodes/Segment/transport/index.js +127 -0
- package/dist/nodes/Segment/transport/index.js.map +1 -0
- package/dist/nodes/Segment/utils/index.d.ts +67 -0
- package/dist/nodes/Segment/utils/index.d.ts.map +1 -0
- package/dist/nodes/Segment/utils/index.js +216 -0
- package/dist/nodes/Segment/utils/index.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.trackFields = exports.trackOperations = void 0;
|
|
10
|
+
exports.executeTrack = executeTrack;
|
|
11
|
+
const transport_1 = require("../../transport");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
exports.trackOperations = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Operation',
|
|
16
|
+
name: 'operation',
|
|
17
|
+
type: 'options',
|
|
18
|
+
noDataExpression: true,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
resource: ['track'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
name: 'Alias',
|
|
27
|
+
value: 'alias',
|
|
28
|
+
description: 'Merge two user identities',
|
|
29
|
+
action: 'Alias two user identities',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Batch',
|
|
33
|
+
value: 'batch',
|
|
34
|
+
description: 'Send a batch of events (up to 500KB)',
|
|
35
|
+
action: 'Send batch of events',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Group',
|
|
39
|
+
value: 'group',
|
|
40
|
+
description: 'Associate a user with a group',
|
|
41
|
+
action: 'Associate user with group',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Identify',
|
|
45
|
+
value: 'identify',
|
|
46
|
+
description: 'Identify a user with traits',
|
|
47
|
+
action: 'Identify a user',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Page',
|
|
51
|
+
value: 'page',
|
|
52
|
+
description: 'Track a page view',
|
|
53
|
+
action: 'Track page view',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Screen',
|
|
57
|
+
value: 'screen',
|
|
58
|
+
description: 'Track a screen view (mobile)',
|
|
59
|
+
action: 'Track screen view',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Track',
|
|
63
|
+
value: 'track',
|
|
64
|
+
description: 'Track a user action or event',
|
|
65
|
+
action: 'Track an event',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
default: 'track',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
exports.trackFields = [
|
|
72
|
+
// Track operation fields
|
|
73
|
+
{
|
|
74
|
+
displayName: 'User ID',
|
|
75
|
+
name: 'userId',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
description: 'Unique identifier for the user. Either userId or anonymousId is required.',
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
resource: ['track'],
|
|
82
|
+
operation: ['track', 'identify', 'page', 'screen', 'group'],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Anonymous ID',
|
|
88
|
+
name: 'anonymousId',
|
|
89
|
+
type: 'string',
|
|
90
|
+
default: '',
|
|
91
|
+
description: 'Anonymous identifier for the user. Either userId or anonymousId is required.',
|
|
92
|
+
displayOptions: {
|
|
93
|
+
show: {
|
|
94
|
+
resource: ['track'],
|
|
95
|
+
operation: ['track', 'identify', 'page', 'screen', 'group'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Event Name',
|
|
101
|
+
name: 'event',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
default: '',
|
|
105
|
+
description: 'Name of the event being tracked',
|
|
106
|
+
displayOptions: {
|
|
107
|
+
show: {
|
|
108
|
+
resource: ['track'],
|
|
109
|
+
operation: ['track'],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Properties',
|
|
115
|
+
name: 'properties',
|
|
116
|
+
type: 'json',
|
|
117
|
+
default: '{}',
|
|
118
|
+
description: 'Free-form dictionary of event properties (JSON)',
|
|
119
|
+
displayOptions: {
|
|
120
|
+
show: {
|
|
121
|
+
resource: ['track'],
|
|
122
|
+
operation: ['track', 'page', 'screen'],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: 'Traits',
|
|
128
|
+
name: 'traits',
|
|
129
|
+
type: 'json',
|
|
130
|
+
default: '{}',
|
|
131
|
+
description: 'Free-form dictionary of user traits (JSON)',
|
|
132
|
+
displayOptions: {
|
|
133
|
+
show: {
|
|
134
|
+
resource: ['track'],
|
|
135
|
+
operation: ['identify', 'group'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
displayName: 'Page Name',
|
|
141
|
+
name: 'name',
|
|
142
|
+
type: 'string',
|
|
143
|
+
default: '',
|
|
144
|
+
description: 'Name of the page',
|
|
145
|
+
displayOptions: {
|
|
146
|
+
show: {
|
|
147
|
+
resource: ['track'],
|
|
148
|
+
operation: ['page'],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
displayName: 'Page Category',
|
|
154
|
+
name: 'category',
|
|
155
|
+
type: 'string',
|
|
156
|
+
default: '',
|
|
157
|
+
description: 'Category of the page',
|
|
158
|
+
displayOptions: {
|
|
159
|
+
show: {
|
|
160
|
+
resource: ['track'],
|
|
161
|
+
operation: ['page'],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Screen Name',
|
|
167
|
+
name: 'name',
|
|
168
|
+
type: 'string',
|
|
169
|
+
default: '',
|
|
170
|
+
description: 'Name of the mobile screen',
|
|
171
|
+
displayOptions: {
|
|
172
|
+
show: {
|
|
173
|
+
resource: ['track'],
|
|
174
|
+
operation: ['screen'],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
displayName: 'Screen Category',
|
|
180
|
+
name: 'category',
|
|
181
|
+
type: 'string',
|
|
182
|
+
default: '',
|
|
183
|
+
description: 'Category of the mobile screen',
|
|
184
|
+
displayOptions: {
|
|
185
|
+
show: {
|
|
186
|
+
resource: ['track'],
|
|
187
|
+
operation: ['screen'],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
displayName: 'Group ID',
|
|
193
|
+
name: 'groupId',
|
|
194
|
+
type: 'string',
|
|
195
|
+
required: true,
|
|
196
|
+
default: '',
|
|
197
|
+
description: 'Unique identifier for the group',
|
|
198
|
+
displayOptions: {
|
|
199
|
+
show: {
|
|
200
|
+
resource: ['track'],
|
|
201
|
+
operation: ['group'],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
// Alias operation fields
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Previous ID',
|
|
208
|
+
name: 'previousId',
|
|
209
|
+
type: 'string',
|
|
210
|
+
required: true,
|
|
211
|
+
default: '',
|
|
212
|
+
description: 'The existing user ID to be merged',
|
|
213
|
+
displayOptions: {
|
|
214
|
+
show: {
|
|
215
|
+
resource: ['track'],
|
|
216
|
+
operation: ['alias'],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: 'New User ID',
|
|
222
|
+
name: 'userId',
|
|
223
|
+
type: 'string',
|
|
224
|
+
required: true,
|
|
225
|
+
default: '',
|
|
226
|
+
description: 'The new user ID that will replace the previous ID',
|
|
227
|
+
displayOptions: {
|
|
228
|
+
show: {
|
|
229
|
+
resource: ['track'],
|
|
230
|
+
operation: ['alias'],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
// Batch operation fields
|
|
235
|
+
{
|
|
236
|
+
displayName: 'Events (JSON)',
|
|
237
|
+
name: 'batchEvents',
|
|
238
|
+
type: 'json',
|
|
239
|
+
required: true,
|
|
240
|
+
default: '[]',
|
|
241
|
+
description: 'Array of events to send in batch (JSON). Each event should include type, userId/anonymousId, and event-specific fields.',
|
|
242
|
+
displayOptions: {
|
|
243
|
+
show: {
|
|
244
|
+
resource: ['track'],
|
|
245
|
+
operation: ['batch'],
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
// Additional options
|
|
250
|
+
{
|
|
251
|
+
displayName: 'Additional Options',
|
|
252
|
+
name: 'additionalOptions',
|
|
253
|
+
type: 'collection',
|
|
254
|
+
placeholder: 'Add Option',
|
|
255
|
+
default: {},
|
|
256
|
+
displayOptions: {
|
|
257
|
+
show: {
|
|
258
|
+
resource: ['track'],
|
|
259
|
+
operation: ['track', 'identify', 'page', 'screen', 'group', 'alias'],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
options: [
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Context (JSON)',
|
|
265
|
+
name: 'context',
|
|
266
|
+
type: 'json',
|
|
267
|
+
default: '{}',
|
|
268
|
+
description: 'Dictionary of extra information about the event context',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
displayName: 'Integrations (JSON)',
|
|
272
|
+
name: 'integrations',
|
|
273
|
+
type: 'json',
|
|
274
|
+
default: '{}',
|
|
275
|
+
description: 'Dictionary specifying which destinations should receive this event',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
displayName: 'IP Address',
|
|
279
|
+
name: 'ip',
|
|
280
|
+
type: 'string',
|
|
281
|
+
default: '',
|
|
282
|
+
description: 'IP address of the user',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
displayName: 'Message ID',
|
|
286
|
+
name: 'messageId',
|
|
287
|
+
type: 'string',
|
|
288
|
+
default: '',
|
|
289
|
+
description: 'Unique message identifier for deduplication (auto-generated if not provided)',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Timestamp',
|
|
293
|
+
name: 'timestamp',
|
|
294
|
+
type: 'string',
|
|
295
|
+
default: '',
|
|
296
|
+
description: 'ISO 8601 timestamp of when the event occurred (defaults to current time)',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
displayName: 'User Agent',
|
|
300
|
+
name: 'userAgent',
|
|
301
|
+
type: 'string',
|
|
302
|
+
default: '',
|
|
303
|
+
description: 'User agent of the device',
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
];
|
|
308
|
+
async function executeTrack(index) {
|
|
309
|
+
const operation = this.getNodeParameter('operation', index);
|
|
310
|
+
let response;
|
|
311
|
+
if (operation === 'track') {
|
|
312
|
+
const userId = this.getNodeParameter('userId', index, '');
|
|
313
|
+
const anonymousId = this.getNodeParameter('anonymousId', index, '');
|
|
314
|
+
(0, utils_1.validateIdentifiers)(userId, anonymousId);
|
|
315
|
+
const event = this.getNodeParameter('event', index);
|
|
316
|
+
const properties = (0, utils_1.parseJson)(this.getNodeParameter('properties', index, '{}'));
|
|
317
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
318
|
+
const body = {
|
|
319
|
+
type: 'track',
|
|
320
|
+
event,
|
|
321
|
+
properties,
|
|
322
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
323
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
324
|
+
};
|
|
325
|
+
if (userId)
|
|
326
|
+
body.userId = userId;
|
|
327
|
+
if (anonymousId)
|
|
328
|
+
body.anonymousId = anonymousId;
|
|
329
|
+
if (additionalOptions.context) {
|
|
330
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
331
|
+
}
|
|
332
|
+
if (additionalOptions.integrations) {
|
|
333
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
334
|
+
}
|
|
335
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/track', body);
|
|
336
|
+
}
|
|
337
|
+
else if (operation === 'identify') {
|
|
338
|
+
const userId = this.getNodeParameter('userId', index, '');
|
|
339
|
+
const anonymousId = this.getNodeParameter('anonymousId', index, '');
|
|
340
|
+
(0, utils_1.validateIdentifiers)(userId, anonymousId);
|
|
341
|
+
const traits = (0, utils_1.parseJson)(this.getNodeParameter('traits', index, '{}'));
|
|
342
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
343
|
+
const body = {
|
|
344
|
+
type: 'identify',
|
|
345
|
+
traits,
|
|
346
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
347
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
348
|
+
};
|
|
349
|
+
if (userId)
|
|
350
|
+
body.userId = userId;
|
|
351
|
+
if (anonymousId)
|
|
352
|
+
body.anonymousId = anonymousId;
|
|
353
|
+
if (additionalOptions.context) {
|
|
354
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
355
|
+
}
|
|
356
|
+
if (additionalOptions.integrations) {
|
|
357
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
358
|
+
}
|
|
359
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/identify', body);
|
|
360
|
+
}
|
|
361
|
+
else if (operation === 'page') {
|
|
362
|
+
const userId = this.getNodeParameter('userId', index, '');
|
|
363
|
+
const anonymousId = this.getNodeParameter('anonymousId', index, '');
|
|
364
|
+
(0, utils_1.validateIdentifiers)(userId, anonymousId);
|
|
365
|
+
const name = this.getNodeParameter('name', index, '');
|
|
366
|
+
const category = this.getNodeParameter('category', index, '');
|
|
367
|
+
const properties = (0, utils_1.parseJson)(this.getNodeParameter('properties', index, '{}'));
|
|
368
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
369
|
+
const body = {
|
|
370
|
+
type: 'page',
|
|
371
|
+
properties,
|
|
372
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
373
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
374
|
+
};
|
|
375
|
+
if (userId)
|
|
376
|
+
body.userId = userId;
|
|
377
|
+
if (anonymousId)
|
|
378
|
+
body.anonymousId = anonymousId;
|
|
379
|
+
if (name)
|
|
380
|
+
body.name = name;
|
|
381
|
+
if (category)
|
|
382
|
+
body.category = category;
|
|
383
|
+
if (additionalOptions.context) {
|
|
384
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
385
|
+
}
|
|
386
|
+
if (additionalOptions.integrations) {
|
|
387
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
388
|
+
}
|
|
389
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/page', body);
|
|
390
|
+
}
|
|
391
|
+
else if (operation === 'screen') {
|
|
392
|
+
const userId = this.getNodeParameter('userId', index, '');
|
|
393
|
+
const anonymousId = this.getNodeParameter('anonymousId', index, '');
|
|
394
|
+
(0, utils_1.validateIdentifiers)(userId, anonymousId);
|
|
395
|
+
const name = this.getNodeParameter('name', index, '');
|
|
396
|
+
const category = this.getNodeParameter('category', index, '');
|
|
397
|
+
const properties = (0, utils_1.parseJson)(this.getNodeParameter('properties', index, '{}'));
|
|
398
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
399
|
+
const body = {
|
|
400
|
+
type: 'screen',
|
|
401
|
+
properties,
|
|
402
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
403
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
404
|
+
};
|
|
405
|
+
if (userId)
|
|
406
|
+
body.userId = userId;
|
|
407
|
+
if (anonymousId)
|
|
408
|
+
body.anonymousId = anonymousId;
|
|
409
|
+
if (name)
|
|
410
|
+
body.name = name;
|
|
411
|
+
if (category)
|
|
412
|
+
body.category = category;
|
|
413
|
+
if (additionalOptions.context) {
|
|
414
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
415
|
+
}
|
|
416
|
+
if (additionalOptions.integrations) {
|
|
417
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
418
|
+
}
|
|
419
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/screen', body);
|
|
420
|
+
}
|
|
421
|
+
else if (operation === 'group') {
|
|
422
|
+
const userId = this.getNodeParameter('userId', index, '');
|
|
423
|
+
const anonymousId = this.getNodeParameter('anonymousId', index, '');
|
|
424
|
+
(0, utils_1.validateIdentifiers)(userId, anonymousId);
|
|
425
|
+
const groupId = this.getNodeParameter('groupId', index);
|
|
426
|
+
const traits = (0, utils_1.parseJson)(this.getNodeParameter('traits', index, '{}'));
|
|
427
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
428
|
+
const body = {
|
|
429
|
+
type: 'group',
|
|
430
|
+
groupId,
|
|
431
|
+
traits,
|
|
432
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
433
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
434
|
+
};
|
|
435
|
+
if (userId)
|
|
436
|
+
body.userId = userId;
|
|
437
|
+
if (anonymousId)
|
|
438
|
+
body.anonymousId = anonymousId;
|
|
439
|
+
if (additionalOptions.context) {
|
|
440
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
441
|
+
}
|
|
442
|
+
if (additionalOptions.integrations) {
|
|
443
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
444
|
+
}
|
|
445
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/group', body);
|
|
446
|
+
}
|
|
447
|
+
else if (operation === 'alias') {
|
|
448
|
+
const userId = this.getNodeParameter('userId', index);
|
|
449
|
+
const previousId = this.getNodeParameter('previousId', index);
|
|
450
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', index, {});
|
|
451
|
+
const body = {
|
|
452
|
+
type: 'alias',
|
|
453
|
+
userId,
|
|
454
|
+
previousId,
|
|
455
|
+
messageId: additionalOptions.messageId || (0, utils_1.generateMessageId)(),
|
|
456
|
+
timestamp: additionalOptions.timestamp || (0, utils_1.getTimestamp)(),
|
|
457
|
+
};
|
|
458
|
+
if (additionalOptions.context) {
|
|
459
|
+
body.context = (0, utils_1.parseJson)(additionalOptions.context);
|
|
460
|
+
}
|
|
461
|
+
if (additionalOptions.integrations) {
|
|
462
|
+
body.integrations = (0, utils_1.parseJson)(additionalOptions.integrations);
|
|
463
|
+
}
|
|
464
|
+
response = await transport_1.trackingApiRequest.call(this, 'POST', '/alias', body);
|
|
465
|
+
}
|
|
466
|
+
else if (operation === 'batch') {
|
|
467
|
+
const batchEventsJson = this.getNodeParameter('batchEvents', index);
|
|
468
|
+
const events = (0, utils_1.parseJson)(batchEventsJson, []);
|
|
469
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
470
|
+
throw new Error('Batch events must be a non-empty array');
|
|
471
|
+
}
|
|
472
|
+
// Add messageId and timestamp to events if not present
|
|
473
|
+
const processedEvents = events.map((event) => ({
|
|
474
|
+
messageId: (0, utils_1.generateMessageId)(),
|
|
475
|
+
timestamp: (0, utils_1.getTimestamp)(),
|
|
476
|
+
...event,
|
|
477
|
+
}));
|
|
478
|
+
// Split into batches respecting size limits
|
|
479
|
+
const batches = (0, utils_1.splitIntoBatches)(processedEvents);
|
|
480
|
+
const responses = [];
|
|
481
|
+
for (const batch of batches) {
|
|
482
|
+
const batchResponse = await transport_1.trackingApiRequest.call(this, 'POST', '/batch', {
|
|
483
|
+
batch,
|
|
484
|
+
});
|
|
485
|
+
responses.push(batchResponse);
|
|
486
|
+
}
|
|
487
|
+
response = {
|
|
488
|
+
success: true,
|
|
489
|
+
batchCount: batches.length,
|
|
490
|
+
totalEvents: processedEvents.length,
|
|
491
|
+
responses,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
throw new Error(`Unknown operation: ${operation}`);
|
|
496
|
+
}
|
|
497
|
+
return [{ json: response }];
|
|
498
|
+
}
|
|
499
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Segment/actions/track/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA+SH,oCAqNC;AAjgBD,+CAAqD;AACrD,uCAAgH;AAEnG,QAAA,eAAe,GAAsB;IACjD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,2BAA2B;gBACxC,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,sCAAsC;gBACnD,MAAM,EAAE,sBAAsB;aAC9B;YACD;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,+BAA+B;gBAC5C,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,6BAA6B;gBAC1C,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,8BAA8B;gBAC3C,MAAM,EAAE,mBAAmB;aAC3B;YACD;gBACC,IAAI,EAAE,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AAO,GAAG,IAAA,wBAAgB,EAAC,eAAe,CAAC,CAAC;QAElD,MAAM,SAAS,GAAkB,EAAE,CAAC;QACpC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,aAAa,GAAG,MAAM,8BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;gBAC3E,KAAK;aACL,CAAC,CAAC;YACH,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC/B,CAAC;QAED,QAAQ,GAAG;YACV,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,OAAO,CAAC,MAAM;YAC1B,WAAW,EAAE,eAAe,CAAC,MAAM;YACnC,SAAS;SACT,CAAC;IACH,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const trackingPlansOperations: INodeProperties[];
|
|
3
|
+
export declare const trackingPlansFields: INodeProperties[];
|
|
4
|
+
export declare function executeTrackingPlans(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../nodes/Segment/actions/trackingPlans/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAe,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIxG,eAAO,MAAM,uBAAuB,EAAE,eAAe,EAqEpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAAe,EAuKhD,CAAC;AAEF,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAkI/B"}
|