@metarouter/ajs-starter-kit 1.0.67 → 1.0.69

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.
@@ -1 +1 @@
1
- "f8667d47e7c87fcfe6e97b371ce5eb2d"
1
+ "3c438ef311690dbc4757b07d2399312a"
@@ -1 +1 @@
1
- "2d91ab698f70628a0dd1315050a37f46"
1
+ "e74c6dc1800f44708c6bd7344c6ddb58"
@@ -128,7 +128,7 @@
128
128
  "expressions": [
129
129
  {
130
130
  "lang": "lua",
131
- "body": "local eventName = REPLACE(LOWER(input.event), \" \", \"_\")\nlocal results = {}\n\nlocal flatten = FLATTEN(input.properties, \"\", \"_\", 2, { array_start_index = 1 })\nresults[eventName] = flatten\n\nreturn { properties = results }"
131
+ "body": "if input.event then\n local eventName = REPLACE(LOWER(input.event), \" \", \"_\")\n local results = {}\n local flatten = FLATTEN(input.properties, \"\", \"_\", 2, { array_start_index = 1 })\n results[eventName] = flatten\n return { properties = results }\nend"
132
132
  }
133
133
  ]
134
134
  }
@@ -1 +1 @@
1
- "dca5841b9eb56f231eeecb81da0da760"
1
+ "1d393c4efd874fac2d3b07c9e537a4b6"
@@ -1 +1 @@
1
- "4f8f201e28e6eef7e88e9ead092d1e8e"
1
+ "7b81587a718ccd28d6ce08a1050f0acf"
@@ -406,7 +406,7 @@
406
406
  "transforms": [
407
407
  {
408
408
  "expression": {
409
- "body": "local event_details = {}\nevent_details.name = REPLACE(LOWER(input.event), \" \", \"_\")\nlocal params = input.properties\nlocal gclid = DECODE_URL_QUERY(input.context.page.url).gclid\nif gclid then params.gclid = gclid end\nlocal dclid = DECODE_URL_QUERY(input.context.page.url).dclid\nif dclid then params.dclid = dclid end\nparams.data_source = 'S2S'\nevent_details.params = params\nreturn event_details",
409
+ "body": "if input.event ~= nil then\n local event_details = {}\n event_details.name = REPLACE(LOWER(input.event), \" \", \"_\")\n local params = input.properties\n local gclid = DECODE_URL_QUERY(input.context.page.url).gclid\n if gclid then params.gclid = gclid end\n local dclid = DECODE_URL_QUERY(input.context.page.url).dclid\n if dclid then params.dclid = dclid end\n params.data_source = 'S2S'\n event_details.params = params\n return event_details\nend",
410
410
  "lang": "lua"
411
411
  }
412
412
  }
@@ -0,0 +1 @@
1
+ "d2efd4a8bf22b5a0400ebd29bc491588"
@@ -0,0 +1,12 @@
1
+ {
2
+ "default": {
3
+ "endpoint": "http://control.kochava.com/track/json",
4
+ "method": "POST"
5
+ },
6
+ "eventSpecific": {
7
+ "identify": {
8
+ "endpoint": "http://control.kochava.com/v1/cpi/identityLink.php",
9
+ "method": "POST"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ "2c344987d84ba89015a2841aceec62b3"
@@ -0,0 +1,20 @@
1
+ {
2
+ "isDraft": false,
3
+ "isBeta": true,
4
+ "friendlyName": "Kochava",
5
+ "description": "Kochava offers mobile app attribution and mobile app analytics for full app performance through the funnel.",
6
+ "logo": "https://cdn.metarouter.io/logo.svg",
7
+ "color": "#ff0000",
8
+ "eventSource": {
9
+ "isAndroidApp": true,
10
+ "isIosApp": true,
11
+ "isWebApp": false
12
+ },
13
+ "inputSchema": "analytics_js",
14
+ "releaseNotes": [
15
+ {
16
+ "date": "2023-09-07T00:00:00.000Z",
17
+ "note": "Kochava initial release."
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1 @@
1
+ "31c16d5c1398bc0634d1a843b03be464"
@@ -0,0 +1,487 @@
1
+ {
2
+ "version": "v0.0.1",
3
+ "params": [
4
+ {
5
+ "name": "KOCHAVA_APP_ID",
6
+ "exampleValue": "my-kochava-app-id"
7
+ },
8
+ {
9
+ "name": "USER_ID",
10
+ "exampleValue": "my-user-id"
11
+ }
12
+ ],
13
+ "global": {
14
+ "enrichments": [
15
+ {
16
+ "staticString": "$$KOCHAVA_APP_ID$$",
17
+ "outputKey": "kochava_app_id"
18
+ }
19
+ ],
20
+ "mappings": [
21
+ {
22
+ "inputKey": "anonymousId",
23
+ "outputKey": "kochava_device_id"
24
+ }
25
+ ]
26
+ },
27
+ "eventSpecific": {
28
+ "application_installed": {
29
+ "enrichments": [
30
+ {
31
+ "staticString": "install",
32
+ "outputKey": "action"
33
+ }
34
+ ],
35
+ "mappings": [
36
+ {
37
+ "inputKey": "context.device.adTrackingEnabled",
38
+ "outputKey": "data.app_tracking_transparency.att",
39
+ "defaultBool": false
40
+ },
41
+ {
42
+ "inputKey": "context.device.advertisingId",
43
+ "outputKey": "data.device_ids",
44
+ "transforms": [
45
+ {
46
+ "expression": {
47
+ "lang": "lua",
48
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "inputKey": "context.ip",
55
+ "outputKey": "data.origination_ip"
56
+ },
57
+ {
58
+ "inputKey": "context.userAgent",
59
+ "outputKey": "data.device_ua"
60
+ },
61
+ {
62
+ "inputKey": "context.library.version",
63
+ "outputKey": "data.app_version"
64
+ },
65
+ {
66
+ "inputKey": "input",
67
+ "outputKey": "data.usertime",
68
+ "transforms": [
69
+ {
70
+ "expression": {
71
+ "lang": "lua",
72
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
73
+ }
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ },
79
+ "identify": {
80
+ "enrichments": [
81
+ {
82
+ "staticString": "$$USER_ID$$",
83
+ "outputKey": "data.app_userid"
84
+ }
85
+ ],
86
+ "mappings": [
87
+ {
88
+ "inputKey": "context.device.advertisingId",
89
+ "outputKey": "device_id",
90
+ "transforms": [
91
+ {
92
+ "expression": {
93
+ "lang": "lua",
94
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId\n }\nend"
95
+ }
96
+ }
97
+ ]
98
+ }
99
+ ]
100
+ },
101
+ "checkout_started": {
102
+ "enrichments": [
103
+ {
104
+ "staticString": "event",
105
+ "outputKey": "action"
106
+ },
107
+ {
108
+ "staticString": "",
109
+ "outputKey": "data.device_ver"
110
+ },
111
+ {
112
+ "staticString": "Checkout Start",
113
+ "outputKey": "data.event_name"
114
+ }
115
+ ],
116
+ "mappings": [
117
+ {
118
+ "inputKey": "context.device.adTrackingEnabled",
119
+ "outputKey": "data.app_tracking_transparency.att",
120
+ "defaultBool": false
121
+ },
122
+ {
123
+ "inputKey": "context.device.advertisingId",
124
+ "outputKey": "data.device_ids",
125
+ "transforms": [
126
+ {
127
+ "expression": {
128
+ "lang": "lua",
129
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
130
+ }
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "inputKey": "context.ip",
136
+ "outputKey": "data.origination_ip"
137
+ },
138
+ {
139
+ "inputKey": "context.userAgent",
140
+ "outputKey": "data.device_ua"
141
+ },
142
+ {
143
+ "inputKey": "context.library.version",
144
+ "outputKey": "data.app_version"
145
+ },
146
+ {
147
+ "inputKey": "input",
148
+ "outputKey": "data.event_data.name",
149
+ "transforms": [
150
+ {
151
+ "expression": {
152
+ "lang": "lua",
153
+ "body": "return JOIN(PLUCK(input.properties.products, 'name'), ',')"
154
+ }
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "inputKey": "input",
160
+ "outputKey": "data.event_data.content_id",
161
+ "transforms": [
162
+ {
163
+ "expression": {
164
+ "lang": "lua",
165
+ "body": "return JOIN(PLUCK(input.properties.products, 'product_id'), ',')"
166
+ }
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "inputKey": "properties.currency",
172
+ "outputKey": "data.event_data.currency",
173
+ "transforms": [
174
+ {
175
+ "modifyString": "uppercase"
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "inputKey": "properties.quantity",
181
+ "outputKey": "data.event_data.quantity"
182
+ },
183
+ {
184
+ "inputKey": "input",
185
+ "outputKey": "data.usertime",
186
+ "transforms": [
187
+ {
188
+ "expression": {
189
+ "lang": "lua",
190
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
191
+ }
192
+ }
193
+ ]
194
+ }
195
+ ]
196
+ },
197
+ "order_completed": {
198
+ "enrichments": [
199
+ {
200
+ "staticString": "event",
201
+ "outputKey": "action"
202
+ },
203
+ {
204
+ "staticString": "",
205
+ "outputKey": "data.device_ver"
206
+ },
207
+ {
208
+ "staticString": "Purchase",
209
+ "outputKey": "data.event_name"
210
+ }
211
+ ],
212
+ "mappings": [
213
+ {
214
+ "inputKey": "context.device.adTrackingEnabled",
215
+ "outputKey": "data.app_tracking_transparency.att",
216
+ "defaultBool": false
217
+ },
218
+ {
219
+ "inputKey": "context.device.advertisingId",
220
+ "outputKey": "data.device_ids",
221
+ "transforms": [
222
+ {
223
+ "expression": {
224
+ "lang": "lua",
225
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
226
+ }
227
+ }
228
+ ]
229
+ },
230
+ {
231
+ "inputKey": "context.ip",
232
+ "outputKey": "data.origination_ip"
233
+ },
234
+ {
235
+ "inputKey": "context.userAgent",
236
+ "outputKey": "data.device_ua"
237
+ },
238
+ {
239
+ "inputKey": "context.library.version",
240
+ "outputKey": "data.app_version"
241
+ },
242
+ {
243
+ "inputKey": "input",
244
+ "outputKey": "data.event_data.name",
245
+ "transforms": [
246
+ {
247
+ "expression": {
248
+ "lang": "lua",
249
+ "body": "return JOIN(PLUCK(input.properties.products, 'name'), ',')"
250
+ }
251
+ }
252
+ ]
253
+ },
254
+ {
255
+ "inputKey": "input",
256
+ "outputKey": "data.event_data.content_id",
257
+ "transforms": [
258
+ {
259
+ "expression": {
260
+ "lang": "lua",
261
+ "body": "return JOIN(PLUCK(input.properties.products, 'product_id'), ',')"
262
+ }
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "inputKey": "properties.revenue",
268
+ "outputKey": "data.event_data.price"
269
+ },
270
+ {
271
+ "inputKey": "properties.currency",
272
+ "outputKey": "data.event_data.currency",
273
+ "transforms": [
274
+ {
275
+ "modifyString": "uppercase"
276
+ }
277
+ ]
278
+ },
279
+ {
280
+ "inputKey": "input",
281
+ "outputKey": "data.usertime",
282
+ "transforms": [
283
+ {
284
+ "expression": {
285
+ "lang": "lua",
286
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
287
+ }
288
+ }
289
+ ]
290
+ }
291
+ ]
292
+ },
293
+ "product_added": {
294
+ "enrichments": [
295
+ {
296
+ "staticString": "event",
297
+ "outputKey": "action"
298
+ },
299
+ {
300
+ "staticString": "",
301
+ "outputKey": "data.device_ver"
302
+ },
303
+ {
304
+ "staticString": "Add to Cart",
305
+ "outputKey": "data.event_name"
306
+ }
307
+ ],
308
+ "mappings": [
309
+ {
310
+ "inputKey": "context.device.adTrackingEnabled",
311
+ "outputKey": "data.app_tracking_transparency.att",
312
+ "defaultBool": false
313
+ },
314
+ {
315
+ "inputKey": "context.device.advertisingId",
316
+ "outputKey": "data.device_ids",
317
+ "transforms": [
318
+ {
319
+ "expression": {
320
+ "lang": "lua",
321
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
322
+ }
323
+ }
324
+ ]
325
+ },
326
+ {
327
+ "inputKey": "context.ip",
328
+ "outputKey": "data.origination_ip"
329
+ },
330
+ {
331
+ "inputKey": "context.userAgent",
332
+ "outputKey": "data.device_ua"
333
+ },
334
+ {
335
+ "inputKey": "context.library.version",
336
+ "outputKey": "data.app_version"
337
+ },
338
+ {
339
+ "inputKey": "properties.name",
340
+ "outputKey": "data.event_data.name"
341
+ },
342
+ {
343
+ "inputKey": "properties.product_id",
344
+ "outputKey": "data.event_data.content_id"
345
+ },
346
+ {
347
+ "inputKey": "properties.quantity",
348
+ "outputKey": "data.event_data.quantity"
349
+ },
350
+ {
351
+ "inputKey": "input",
352
+ "outputKey": "data.usertime",
353
+ "transforms": [
354
+ {
355
+ "expression": {
356
+ "lang": "lua",
357
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
358
+ }
359
+ }
360
+ ]
361
+ }
362
+ ]
363
+ },
364
+ "products_searched": {
365
+ "enrichments": [
366
+ {
367
+ "staticString": "event",
368
+ "outputKey": "action"
369
+ },
370
+ {
371
+ "staticString": "",
372
+ "outputKey": "data.device_ver"
373
+ },
374
+ {
375
+ "staticString": "Search",
376
+ "outputKey": "data.event_name"
377
+ }
378
+ ],
379
+ "mappings": [
380
+ {
381
+ "inputKey": "context.device.adTrackingEnabled",
382
+ "outputKey": "data.app_tracking_transparency.att",
383
+ "defaultBool": false
384
+ },
385
+ {
386
+ "inputKey": "context.device.advertisingId",
387
+ "outputKey": "data.device_ids",
388
+ "transforms": [
389
+ {
390
+ "expression": {
391
+ "lang": "lua",
392
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
393
+ }
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "inputKey": "context.ip",
399
+ "outputKey": "data.origination_ip"
400
+ },
401
+ {
402
+ "inputKey": "context.userAgent",
403
+ "outputKey": "data.device_ua"
404
+ },
405
+ {
406
+ "inputKey": "context.library.version",
407
+ "outputKey": "data.app_version"
408
+ },
409
+ {
410
+ "inputKey": "properties.query",
411
+ "outputKey": "data.event_data.uri"
412
+ },
413
+ {
414
+ "inputKey": "input",
415
+ "outputKey": "data.usertime",
416
+ "transforms": [
417
+ {
418
+ "expression": {
419
+ "lang": "lua",
420
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
421
+ }
422
+ }
423
+ ]
424
+ }
425
+ ]
426
+ }
427
+ },
428
+ "default": {
429
+ "enrichments": [
430
+ {
431
+ "staticString": "event",
432
+ "outputKey": "action"
433
+ },
434
+ {
435
+ "staticString": "",
436
+ "outputKey": "data.device_ver"
437
+ }
438
+ ],
439
+ "mappings": [
440
+ {
441
+ "inputKey": "context.device.adTrackingEnabled",
442
+ "outputKey": "data.app_tracking_transparency.att",
443
+ "defaultBool": false
444
+ },
445
+ {
446
+ "inputKey": "event",
447
+ "outputKey": "data.event_name"
448
+ },
449
+ {
450
+ "inputKey": "context.device.advertisingId",
451
+ "outputKey": "data.device_ids",
452
+ "transforms": [
453
+ {
454
+ "expression": {
455
+ "lang": "lua",
456
+ "body": "local deviceType = input.context.device.type\nif deviceType == 'ios' then\n return {\n idfa = input.context.device.advertisingId,\n idfv = input.context.device.id\n }\nelseif deviceType == 'android' then\n return {\n adid = input.context.device.advertisingId,\n android_id = input.context.device.id\n }\nend"
457
+ }
458
+ }
459
+ ]
460
+ },
461
+ {
462
+ "inputKey": "context.ip",
463
+ "outputKey": "data.origination_ip"
464
+ },
465
+ {
466
+ "inputKey": "context.userAgent",
467
+ "outputKey": "data.device_ua"
468
+ },
469
+ {
470
+ "inputKey": "context.library.version",
471
+ "outputKey": "data.app_version"
472
+ },
473
+ {
474
+ "inputKey": "input",
475
+ "outputKey": "data.usertime",
476
+ "transforms": [
477
+ {
478
+ "expression": {
479
+ "lang": "lua",
480
+ "body": "return MILLISECONDS_SINCE_EPOCH(input.receivedAt)"
481
+ }
482
+ }
483
+ ]
484
+ }
485
+ ]
486
+ }
487
+ }
@@ -1 +1 @@
1
- "252b65e36d2cc36c9d2ab136f728ffeb"
1
+ "10a518198184390b592e1b0380311205"
@@ -3,15 +3,32 @@
3
3
  {
4
4
  "name": "REFRESH_TOKEN",
5
5
  "exampleValue": "my-refresh-token"
6
+ },
7
+ {
8
+ "name": "VENDOR",
9
+ "exampleValue": "my-vendor-id"
6
10
  }
7
11
  ],
8
12
  "default": {
9
13
  "endpoint": "https://api.roomvo.com/v1/order_events/",
10
14
  "method": "POST",
11
- "providerAuth": {
12
- "roomvo": {
13
- "refreshToken": "$$REFRESH_TOKEN$$"
14
- }
15
+ "oauth2_auth": {
16
+ "request": {
17
+ "url": "https://api.roomvo.com/v1/tokens/refresh/",
18
+ "contentType": "application/json",
19
+ "method": "POST",
20
+ "body": [
21
+ {
22
+ "key": "refresh",
23
+ "value": "$$REFRESH_TOKEN$$"
24
+ },
25
+ {
26
+ "key": "permissions",
27
+ "value": "[{\"permission\": \"aperture_api.add_vendor_orderevent\", \"obj\": \"$$VENDOR$$\"}]"
28
+ }
29
+ ]
30
+ },
31
+ "responseAccessTokenKey": "access"
15
32
  },
16
33
  "batchSize": 100,
17
34
  "transform": {
@@ -1 +1 @@
1
- "e12b8a8aa10b33a98bf97bd6f201d9c2"
1
+ "1d3b54db1a0e6aee90f13d19de82f1b8"
package/index.js CHANGED
@@ -223,6 +223,13 @@ exports.kinesis = {
223
223
  metadata: require('./.dist/kinesis/metadata.json')
224
224
  }
225
225
 
226
+ exports.kochava = {
227
+ connectionTemplate: connectionSchemas.properties.kochava,
228
+ endpointSchema: require('./.dist/kochava/connection.json'),
229
+ playbook: require('./.dist/kochava/playbook.json'),
230
+ metadata: require('./.dist/kochava/metadata.json')
231
+ }
232
+
226
233
  exports.lytics = {
227
234
  connectionTemplate: connectionSchemas.properties.lytics,
228
235
  endpointSchema: require('./.dist/lytics/connection.json'),
@@ -562,6 +569,10 @@ exports.etags = {
562
569
  playbook: require('./.dist/kinesis/playbook.etag.json'),
563
570
  kit: require('./.dist/kinesis/kit.etag.json')
564
571
  },
572
+ kochava: {
573
+ playbook: require('./.dist/kochava/playbook.etag.json'),
574
+ kit: require('./.dist/kochava/kit.etag.json')
575
+ },
565
576
  lytics: {
566
577
  endpointSchema: require('./.dist/lytics/connection.etag.json'),
567
578
  playbook: require('./.dist/lytics/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {