@metarouter/ajs-starter-kit 1.0.93 → 1.0.95

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.
Files changed (40) hide show
  1. package/.dist/build-your-own/connection.etag.json +1 -0
  2. package/.dist/build-your-own/connection.json +22 -0
  3. package/.dist/build-your-own/kit.etag.json +1 -0
  4. package/.dist/build-your-own/metadata.json +20 -0
  5. package/.dist/build-your-own/playbook.etag.json +1 -0
  6. package/.dist/build-your-own/playbook.json +11 -0
  7. package/.dist/clinch/kit.etag.json +1 -1
  8. package/.dist/clinch/metadata.json +4 -0
  9. package/.dist/clinch/playbook.etag.json +1 -1
  10. package/.dist/clinch/playbook.json +14 -2
  11. package/.dist/connection-schemas.json +74 -2
  12. package/.dist/google-ads-audience/connection.etag.json +1 -0
  13. package/.dist/google-ads-audience/connection.json +36 -0
  14. package/.dist/google-ads-audience/kit.etag.json +1 -0
  15. package/.dist/google-ads-audience/metadata.json +18 -0
  16. package/.dist/google-ads-audience/playbook.etag.json +1 -0
  17. package/.dist/google-ads-audience/playbook.json +21 -0
  18. package/.dist/google-analytics-4-collect/kit.etag.json +1 -1
  19. package/.dist/google-analytics-4-collect/metadata.json +4 -0
  20. package/.dist/google-analytics-4-collect/playbook.etag.json +1 -1
  21. package/.dist/google-analytics-4-collect/playbook.json +21 -5
  22. package/.dist/google-cm360/connection.etag.json +1 -1
  23. package/.dist/google-cm360/connection.json +12 -2
  24. package/.dist/google-cm360/kit.etag.json +1 -1
  25. package/.dist/google-cm360/metadata.json +4 -0
  26. package/.dist/nextdoor-capi/connection.etag.json +1 -0
  27. package/.dist/nextdoor-capi/connection.json +23 -0
  28. package/.dist/nextdoor-capi/kit.etag.json +1 -0
  29. package/.dist/nextdoor-capi/metadata.json +20 -0
  30. package/.dist/nextdoor-capi/playbook.etag.json +1 -0
  31. package/.dist/nextdoor-capi/playbook.json +223 -0
  32. package/.dist/snapchat-capi/connection.etag.json +1 -0
  33. package/.dist/snapchat-capi/connection.json +29 -0
  34. package/.dist/snapchat-capi/kit.etag.json +1 -0
  35. package/.dist/snapchat-capi/metadata.json +20 -0
  36. package/.dist/snapchat-capi/playbook.etag.json +1 -0
  37. package/.dist/snapchat-capi/playbook.json +720 -0
  38. package/README.md +16 -6
  39. package/index.js +162 -167
  40. package/package.json +2 -2
@@ -0,0 +1,720 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "default": {
4
+ "filters": [
5
+ {
6
+ "byEventNames": {
7
+ "action": "allow",
8
+ "events": [
9
+ ""
10
+ ]
11
+ }
12
+ }
13
+ ]
14
+ },
15
+ "global": {
16
+ "mappings": [
17
+ {
18
+ "inputKey": "messageId",
19
+ "outputKey": "event_id"
20
+ },
21
+ {
22
+ "inputKey": "input",
23
+ "outputKey": "event_time",
24
+ "transforms": [
25
+ {
26
+ "expression": {
27
+ "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(TO_DATE_TIME(input.receivedAt, { inputFormat = \"2006-01-02T15:04:05Z07:00\" }))",
28
+ "lang": "lua"
29
+ }
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "inputKey": "context.page.url",
35
+ "outputKey": "event_source_url"
36
+ },
37
+ {
38
+ "inputKey": "input",
39
+ "outputKey": "action_source",
40
+ "transforms": [
41
+ {
42
+ "expression": {
43
+ "body": "if input.context.app.name or input.context.device.type or input.context.os.name then return 'MOBILE_APP' end return 'WEB'",
44
+ "lang": "lua"
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "inputKey": "anonymousId",
51
+ "outputKey": "user_data.external_id",
52
+ "transforms": [
53
+ {
54
+ "toHash": "sha256"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "inputKey": "context.providers.snapchatCAPI.ScCid",
60
+ "outputKey": "user_data.sc_click_id"
61
+ },
62
+ {
63
+ "inputKey": "context.ip",
64
+ "outputKey": "user_data.client_ip_address"
65
+ },
66
+ {
67
+ "inputKey": "context.userAgent",
68
+ "outputKey": "user_data.client_user_agent"
69
+ },
70
+ {
71
+ "inputKey": "input",
72
+ "outputKey": "user_data.em",
73
+ "transforms": [
74
+ {
75
+ "expression": {
76
+ "body": "local email = input.traits.email or input.context.traits.email\nif (email) then return TO_SHA256_HASH(LOWER(TRIM(email))) end",
77
+ "lang": "lua"
78
+ }
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "inputKey": "input",
84
+ "outputKey": "user_data.ph",
85
+ "transforms": [
86
+ {
87
+ "expression": {
88
+ "body": "local phone = input.traits.phone or input.context.traits.phone\nif (phone) then return TO_SHA256_HASH(TRIM(phone)) end",
89
+ "lang": "lua"
90
+ }
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "inputKey": "input",
96
+ "outputKey": "user_data.fn",
97
+ "transforms": [
98
+ {
99
+ "expression": {
100
+ "body": "local firstName = input.traits.firstName or input.context.traits.firstName\nif (firstName) then return TO_SHA256_HASH(LOWER(TRIM(firstName))) end",
101
+ "lang": "lua"
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "inputKey": "input",
108
+ "outputKey": "user_data.ln",
109
+ "transforms": [
110
+ {
111
+ "expression": {
112
+ "body": "local lastName = input.traits.lastName or input.context.traits.lastName\nif (lastName) then return TO_SHA256_HASH(LOWER(TRIM(lastName))) end",
113
+ "lang": "lua"
114
+ }
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "inputKey": "input",
120
+ "outputKey": "user_data.ge",
121
+ "transforms": [
122
+ {
123
+ "expression": {
124
+ "body": "local gender = input.traits.gender or input.context.traits.gender\nif (gender) then return TO_SHA256_HASH(LOWER(TRIM(gender))) end",
125
+ "lang": "lua"
126
+ }
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "inputKey": "input",
132
+ "outputKey": "user_data.ct",
133
+ "transforms": [
134
+ {
135
+ "expression": {
136
+ "body": "local city = input.traits.address.city or input.context.traits.address.city\nif (city) then return TO_SHA256_HASH(LOWER(city:gsub('%s+',''))) end",
137
+ "lang": "lua"
138
+ }
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "inputKey": "input",
144
+ "outputKey": "user_data.st",
145
+ "transforms": [
146
+ {
147
+ "expression": {
148
+ "body": "local state = input.traits.address.state or input.context.traits.address.state\nif (state) then return TO_SHA256_HASH(LOWER(TRIM(state))) end",
149
+ "lang": "lua"
150
+ }
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "inputKey": "input",
156
+ "outputKey": "user_data.zp",
157
+ "transforms": [
158
+ {
159
+ "expression": {
160
+ "body": "local postalCode = input.traits.address.postalCode or input.context.traits.address.postalCode\nif (postalCode) then return TO_SHA256_HASH(TRIM(postalCode)) end",
161
+ "lang": "lua"
162
+ }
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "inputKey": "input",
168
+ "outputKey": "user_data.country",
169
+ "transforms": [
170
+ {
171
+ "expression": {
172
+ "body": "local country = input.traits.address.country or input.context.traits.address.country\nif (country) then return TO_SHA256_HASH(TRIM(country)) end",
173
+ "lang": "lua"
174
+ }
175
+ }
176
+ ]
177
+ }
178
+ ],
179
+ "enrichments": [
180
+ {
181
+ "outputKey": "integration",
182
+ "staticString": "metarouter"
183
+ }
184
+ ]
185
+ },
186
+ "eventSpecific": {
187
+ "identify": {
188
+ "enrichments": [
189
+ {
190
+ "outputKey": "event_name",
191
+ "staticString": "LOGIN"
192
+ }
193
+ ]
194
+ },
195
+ "page": {
196
+ "mappings": [
197
+ {
198
+ "inputKey": "input",
199
+ "outputKey": "custom_data.content_name",
200
+ "transforms": [
201
+ {
202
+ "expression": {
203
+ "body": "return input.properties.name or input.properties.title",
204
+ "lang": "lua"
205
+ }
206
+ }
207
+ ]
208
+ }
209
+ ],
210
+ "enrichments": [
211
+ {
212
+ "outputKey": "event_name",
213
+ "staticString": "PAGE_VIEW"
214
+ }
215
+ ]
216
+ },
217
+ "products_searched": {
218
+ "mappings": [
219
+ {
220
+ "inputKey": "properties.query",
221
+ "outputKey": "custom_data.search_string"
222
+ }
223
+ ],
224
+ "enrichments": [
225
+ {
226
+ "outputKey": "event_name",
227
+ "staticString": "SEARCH"
228
+ }
229
+ ]
230
+ },
231
+ "product_list_viewed": {
232
+ "mappings": [
233
+ {
234
+ "inputKey": "properties.category",
235
+ "outputKey": "custom_data.content_category"
236
+ },
237
+ {
238
+ "inputKey": "properties.products",
239
+ "outputKey": "custom_data.content_ids",
240
+ "transforms": [
241
+ {
242
+ "pluckValues": {
243
+ "extractKey": "product_id"
244
+ }
245
+ }
246
+ ]
247
+ }
248
+ ],
249
+ "enrichments": [
250
+ {
251
+ "outputKey": "event_name",
252
+ "staticString": "LIST_VIEW"
253
+ },
254
+ {
255
+ "outputKey": "custom_data.content_type",
256
+ "staticString": "product"
257
+ }
258
+ ]
259
+ },
260
+ "product_viewed": {
261
+ "mappings": [
262
+ {
263
+ "inputKey": "properties.name",
264
+ "outputKey": "custom_data.content_name"
265
+ },
266
+ {
267
+ "inputKey": "properties.category",
268
+ "outputKey": "custom_data.content_category"
269
+ },
270
+ {
271
+ "inputKey": "properties.product_id",
272
+ "outputKey": "custom_data.content_ids"
273
+ }
274
+ ],
275
+ "enrichments": [
276
+ {
277
+ "outputKey": "event_name",
278
+ "staticString": "VIEW_CONTENT"
279
+ },
280
+ {
281
+ "outputKey": "custom_data.content_type",
282
+ "staticString": "product"
283
+ }
284
+ ]
285
+ },
286
+ "product_added": {
287
+ "mappings": [
288
+ {
289
+ "inputKey": "properties.name",
290
+ "outputKey": "custom_data.content_name"
291
+ },
292
+ {
293
+ "inputKey": "properties.category",
294
+ "outputKey": "custom_data.content_category"
295
+ },
296
+ {
297
+ "inputKey": "properties.product_id",
298
+ "outputKey": "custom_data.content_ids"
299
+ },
300
+ {
301
+ "inputKey": "input",
302
+ "outputKey": "custom_data.contents",
303
+ "transforms": [
304
+ {
305
+ "expression": {
306
+ "body": "return {{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n }}",
307
+ "lang": "lua"
308
+ }
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "inputKey": "properties.currency",
314
+ "outputKey": "custom_data.currency",
315
+ "transforms": [
316
+ {
317
+ "modifyString": "uppercase"
318
+ }
319
+ ],
320
+ "defaultString": "USD"
321
+ },
322
+ {
323
+ "inputKey": "properties.quantity",
324
+ "outputKey": "custom_data.num_items",
325
+ "transforms": [
326
+ {
327
+ "toScalar": "string"
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ "inputKey": "input",
333
+ "outputKey": "custom_data.value",
334
+ "transforms": [
335
+ {
336
+ "expression": {
337
+ "body": "return input.properties.price * (input.properties.quantity or 1)",
338
+ "lang": "lua"
339
+ }
340
+ }
341
+ ]
342
+ }
343
+ ],
344
+ "enrichments": [
345
+ {
346
+ "outputKey": "event_name",
347
+ "staticString": "ADD_CART"
348
+ },
349
+ {
350
+ "outputKey": "custom_data.content_type",
351
+ "staticString": "product"
352
+ }
353
+ ]
354
+ },
355
+ "product_added_to_wishlist": {
356
+ "mappings": [
357
+ {
358
+ "inputKey": "properties.name",
359
+ "outputKey": "custom_data.content_name"
360
+ },
361
+ {
362
+ "inputKey": "properties.category",
363
+ "outputKey": "custom_data.content_category"
364
+ },
365
+ {
366
+ "inputKey": "properties.product_id",
367
+ "outputKey": "custom_data.content_ids"
368
+ },
369
+ {
370
+ "inputKey": "input",
371
+ "outputKey": "custom_data.contents",
372
+ "transforms": [
373
+ {
374
+ "expression": {
375
+ "body": "return {{\n id=input.properties.product_id,\n quantity=input.properties.quantity or 1,\n item_price=input.properties.price\n }}",
376
+ "lang": "lua"
377
+ }
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ "inputKey": "properties.currency",
383
+ "outputKey": "custom_data.currency",
384
+ "transforms": [
385
+ {
386
+ "modifyString": "uppercase"
387
+ }
388
+ ],
389
+ "defaultString": "USD"
390
+ },
391
+ {
392
+ "inputKey": "properties.quantity",
393
+ "outputKey": "custom_data.num_items",
394
+ "transforms": [
395
+ {
396
+ "toScalar": "string"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "inputKey": "input",
402
+ "outputKey": "custom_data.value",
403
+ "transforms": [
404
+ {
405
+ "expression": {
406
+ "body": "return input.properties.price * (input.properties.quantity or 1)",
407
+ "lang": "lua"
408
+ }
409
+ }
410
+ ]
411
+ }
412
+ ],
413
+ "enrichments": [
414
+ {
415
+ "outputKey": "event_name",
416
+ "staticString": "ADD_TO_WISHLIST"
417
+ },
418
+ {
419
+ "outputKey": "custom_data.content_type",
420
+ "staticString": "product"
421
+ }
422
+ ]
423
+ },
424
+ "cart_viewed": {
425
+ "mappings": [
426
+ {
427
+ "inputKey": "input",
428
+ "outputKey": "custom_data.content_name",
429
+ "transforms": [
430
+ {
431
+ "expression": {
432
+ "body": "return input.properties.name or input.properties.title",
433
+ "lang": "lua"
434
+ }
435
+ }
436
+ ]
437
+ },
438
+ {
439
+ "inputKey": "properties.products",
440
+ "outputKey": "custom_data.content_ids",
441
+ "transforms": [
442
+ {
443
+ "pluckValues": {
444
+ "extractKey": "product_id"
445
+ }
446
+ }
447
+ ]
448
+ },
449
+ {
450
+ "inputKey": "input",
451
+ "outputKey": "custom_data.contents",
452
+ "transforms": [
453
+ {
454
+ "expression": {
455
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)",
456
+ "lang": "lua"
457
+ }
458
+ }
459
+ ]
460
+ },
461
+ {
462
+ "inputKey": "properties.currency",
463
+ "outputKey": "custom_data.currency",
464
+ "transforms": [
465
+ {
466
+ "modifyString": "uppercase"
467
+ }
468
+ ],
469
+ "defaultString": "USD"
470
+ },
471
+ {
472
+ "inputKey": "input",
473
+ "outputKey": "custom_data.num_items",
474
+ "transforms": [
475
+ {
476
+ "expression": {
477
+ "body": "return tostring(SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end)))",
478
+ "lang": "lua"
479
+ }
480
+ }
481
+ ]
482
+ },
483
+ {
484
+ "inputKey": "input",
485
+ "outputKey": "custom_data.value",
486
+ "transforms": [
487
+ {
488
+ "expression": {
489
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))",
490
+ "lang": "lua"
491
+ }
492
+ }
493
+ ]
494
+ }
495
+ ],
496
+ "enrichments": [
497
+ {
498
+ "outputKey": "event_name",
499
+ "staticString": "VIEW_CONTENT"
500
+ },
501
+ {
502
+ "outputKey": "custom_data.content_type",
503
+ "staticString": "product"
504
+ }
505
+ ]
506
+ },
507
+ "checkout_started": {
508
+ "mappings": [
509
+ {
510
+ "inputKey": "input",
511
+ "outputKey": "custom_data.content_name",
512
+ "transforms": [
513
+ {
514
+ "expression": {
515
+ "body": "return input.properties.name or input.properties.title",
516
+ "lang": "lua"
517
+ }
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ "inputKey": "properties.products",
523
+ "outputKey": "custom_data.content_ids",
524
+ "transforms": [
525
+ {
526
+ "pluckValues": {
527
+ "extractKey": "product_id"
528
+ }
529
+ }
530
+ ]
531
+ },
532
+ {
533
+ "inputKey": "input",
534
+ "outputKey": "custom_data.contents",
535
+ "transforms": [
536
+ {
537
+ "expression": {
538
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)",
539
+ "lang": "lua"
540
+ }
541
+ }
542
+ ]
543
+ },
544
+ {
545
+ "inputKey": "properties.currency",
546
+ "outputKey": "custom_data.currency",
547
+ "transforms": [
548
+ {
549
+ "modifyString": "uppercase"
550
+ }
551
+ ],
552
+ "defaultString": "USD"
553
+ },
554
+ {
555
+ "inputKey": "input",
556
+ "outputKey": "custom_data.num_items",
557
+ "transforms": [
558
+ {
559
+ "expression": {
560
+ "body": "return tostring(SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end)))",
561
+ "lang": "lua"
562
+ }
563
+ }
564
+ ]
565
+ },
566
+ {
567
+ "inputKey": "input",
568
+ "outputKey": "custom_data.value",
569
+ "transforms": [
570
+ {
571
+ "expression": {
572
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))",
573
+ "lang": "lua"
574
+ }
575
+ }
576
+ ]
577
+ }
578
+ ],
579
+ "enrichments": [
580
+ {
581
+ "outputKey": "event_name",
582
+ "staticString": "START_CHECKOUT"
583
+ },
584
+ {
585
+ "outputKey": "custom_data.content_type",
586
+ "staticString": "product"
587
+ }
588
+ ]
589
+ },
590
+ "payment_info_entered": {
591
+ "mappings": [
592
+ {
593
+ "inputKey": "properties.order_id",
594
+ "outputKey": "custom_data.content_name"
595
+ }
596
+ ],
597
+ "enrichments": [
598
+ {
599
+ "outputKey": "event_name",
600
+ "staticString": "ADD_BILLING"
601
+ }
602
+ ]
603
+ },
604
+ "order_completed": {
605
+ "mappings": [
606
+ {
607
+ "inputKey": "input",
608
+ "outputKey": "custom_data.content_name",
609
+ "transforms": [
610
+ {
611
+ "expression": {
612
+ "body": "return input.properties.name or input.properties.title",
613
+ "lang": "lua"
614
+ }
615
+ }
616
+ ]
617
+ },
618
+ {
619
+ "inputKey": "properties.products",
620
+ "outputKey": "custom_data.content_ids",
621
+ "transforms": [
622
+ {
623
+ "pluckValues": {
624
+ "extractKey": "product_id"
625
+ }
626
+ }
627
+ ]
628
+ },
629
+ {
630
+ "inputKey": "input",
631
+ "outputKey": "custom_data.contents",
632
+ "transforms": [
633
+ {
634
+ "expression": {
635
+ "body": "return MAP(\n input.properties.products,\n function (p)\n return {\n id=p.product_id,\n quantity=p.quantity or 1,\n item_price=p.price\n }\n end\n)",
636
+ "lang": "lua"
637
+ }
638
+ }
639
+ ]
640
+ },
641
+ {
642
+ "inputKey": "properties.currency",
643
+ "outputKey": "custom_data.currency",
644
+ "transforms": [
645
+ {
646
+ "modifyString": "uppercase"
647
+ }
648
+ ],
649
+ "defaultString": "USD"
650
+ },
651
+ {
652
+ "inputKey": "input",
653
+ "outputKey": "custom_data.num_items",
654
+ "transforms": [
655
+ {
656
+ "expression": {
657
+ "body": "return tostring(SUM(MAP(input.properties.products, function (p) return p.quantity or 1 end)))",
658
+ "lang": "lua"
659
+ }
660
+ }
661
+ ]
662
+ },
663
+ {
664
+ "inputKey": "properties.order_id",
665
+ "outputKey": "custom_data.order_id"
666
+ },
667
+ {
668
+ "inputKey": "input",
669
+ "outputKey": "custom_data.value",
670
+ "transforms": [
671
+ {
672
+ "expression": {
673
+ "body": "return SUM(MAP(input.properties.products, function (p) return p.price * (p.quantity or 1) end))",
674
+ "lang": "lua"
675
+ }
676
+ }
677
+ ]
678
+ }
679
+ ],
680
+ "enrichments": [
681
+ {
682
+ "outputKey": "event_name",
683
+ "staticString": "PURCHASE"
684
+ },
685
+ {
686
+ "outputKey": "custom_data.content_type",
687
+ "staticString": "product"
688
+ }
689
+ ]
690
+ },
691
+ "promotion_viewed": {
692
+ "mappings": [
693
+ {
694
+ "inputKey": "properties.name",
695
+ "outputKey": "custom_data.content_name"
696
+ }
697
+ ],
698
+ "enrichments": [
699
+ {
700
+ "outputKey": "event_name",
701
+ "staticString": "AD_VIEW"
702
+ }
703
+ ]
704
+ },
705
+ "promotion_clicked": {
706
+ "mappings": [
707
+ {
708
+ "inputKey": "properties.name",
709
+ "outputKey": "custom_data.content_name"
710
+ }
711
+ ],
712
+ "enrichments": [
713
+ {
714
+ "outputKey": "event_name",
715
+ "staticString": "AD_CLICK"
716
+ }
717
+ ]
718
+ }
719
+ }
720
+ }