@metarouter/ajs-starter-kit 1.0.49 → 1.0.50

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
- "771fc7e90ba57065f67bb20ae2212f21"
1
+ "6e0d1c652f1c2a69669a6acbd409cbcf"
@@ -14,6 +14,10 @@
14
14
  {
15
15
  "date": "2022-10-06T00:00:00.000Z",
16
16
  "note": "Bloomreach CDP initial release."
17
+ },
18
+ {
19
+ "date": "2022-11-03T00:00:00.000Z",
20
+ "note": "Bloomreach update timestamp, add filters."
17
21
  }
18
22
  ]
19
23
  }
@@ -1 +1 @@
1
- "6e7f86328abfefe5e848d8683d233c7c"
1
+ "59dea129a645a42b21508a0530939794"
@@ -25,7 +25,7 @@
25
25
  "transforms": [
26
26
  {
27
27
  "expression": {
28
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
28
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
29
29
  "lang": "lua"
30
30
  }
31
31
  }
@@ -51,7 +51,7 @@
51
51
  "transforms": [
52
52
  {
53
53
  "expression": {
54
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
54
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
55
55
  "lang": "lua"
56
56
  }
57
57
  }
@@ -135,7 +135,7 @@
135
135
  "transforms": [
136
136
  {
137
137
  "expression": {
138
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
138
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
139
139
  "lang": "lua"
140
140
  }
141
141
  }
@@ -199,7 +199,7 @@
199
199
  "transforms": [
200
200
  {
201
201
  "expression": {
202
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
202
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
203
203
  "lang": "lua"
204
204
  }
205
205
  }
@@ -263,7 +263,7 @@
263
263
  "transforms": [
264
264
  {
265
265
  "expression": {
266
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
266
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
267
267
  "lang": "lua"
268
268
  }
269
269
  }
@@ -343,7 +343,7 @@
343
343
  "transforms": [
344
344
  {
345
345
  "expression": {
346
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
346
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
347
347
  "lang": "lua"
348
348
  }
349
349
  }
@@ -399,7 +399,7 @@
399
399
  "transforms": [
400
400
  {
401
401
  "expression": {
402
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
402
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
403
403
  "lang": "lua"
404
404
  }
405
405
  }
@@ -409,28 +409,20 @@
409
409
  }
410
410
  },
411
411
  "default": {
412
- "mappings": [
413
- {
414
- "inputKey": "event",
415
- "outputKey": "event_type"
416
- },
417
- {
418
- "inputKey": "input",
419
- "outputKey": "timestamp",
420
- "transforms": [
421
- {
422
- "expression": {
423
- "body": "return MILLISECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp) * 1000",
424
- "lang": "lua"
425
- }
426
- }
427
- ]
428
- }
429
- ],
430
- "expressions": [
412
+ "filters": [
431
413
  {
432
- "body": "local result = input.properties\nresult.location = input.context.page.url\nreturn { properties = result }",
433
- "lang": "lua"
414
+ "byEventNames": {
415
+ "action": "whitelist",
416
+ "events": [
417
+ "page",
418
+ "identify",
419
+ "order_completed",
420
+ "product_added",
421
+ "product_removed",
422
+ "checkout_step_completed",
423
+ "product_viewed"
424
+ ]
425
+ }
434
426
  }
435
427
  ]
436
428
  }
@@ -0,0 +1 @@
1
+ "295069460d88aee0a2fb5c1a425bc1a1"
@@ -0,0 +1,52 @@
1
+ {
2
+ "params": [
3
+ {
4
+ "name": "SITE_ID",
5
+ "exampleValue": "my-site-id"
6
+ },
7
+ {
8
+ "name": "API_KEY",
9
+ "exampleValue": "my-api-key"
10
+ }
11
+ ],
12
+ "eventSpecific": {
13
+ "identify": {
14
+ "endpoint": "https://track.customer.io/api/v1/customers/",
15
+ "method": "PUT",
16
+ "batchSize": 1,
17
+ "headers": [
18
+ {
19
+ "key": "Content-Type",
20
+ "value": "application/json"
21
+ },
22
+ {
23
+ "key": "Accept",
24
+ "value": "*/*"
25
+ }
26
+ ],
27
+ "transform": {
28
+ "lang": "lua",
29
+ "body": "local auth = BASE64_ENCODE(\"$$SITE_ID$$:$$API_KEY$$\")\nrequest.headers[\"Authorization\"] = \"Basic \" .. auth\n\nlocal identifier = batch[1].id\nrequest.url = request.url .. identifier\n\nrequest.body = batch[1]\n\nreturn request"
30
+ }
31
+ }
32
+ },
33
+ "default": {
34
+ "endpoint": "https://track.customer.io/api/v1/",
35
+ "method": "POST",
36
+ "batchSize": 1,
37
+ "headers": [
38
+ {
39
+ "key": "Content-Type",
40
+ "value": "application/json"
41
+ },
42
+ {
43
+ "key": "Accept",
44
+ "value": "*/*"
45
+ }
46
+ ],
47
+ "transform": {
48
+ "lang": "lua",
49
+ "body": "function isEmpty(s)\n return s == nil or s == ''\nend\n\nlocal identifier = batch[1].data.userId\n\nif isEmpty(identifier) then request.url = request.url .. \"events\"\nelse request.url = request.url .. \"customers/\" .. identifier .. \"/events\"\nend\n\nlocal auth = BASE64_ENCODE(\"$$SITE_ID$$:$$API_KEY$$\")\n\nrequest.headers[\"Authorization\"] = \"Basic \" .. auth\nrequest.body = batch[1]\nreturn request"
50
+ }
51
+ }
52
+ }
@@ -0,0 +1 @@
1
+ "a1e32a346da720ad3d9deda0ce7ff2ba"
@@ -0,0 +1,19 @@
1
+ {
2
+ "isDraft": false,
3
+ "friendlyName": "Customer.io",
4
+ "description": "Customer.io is an automated messaging platform for tech-savvy marketers who want more control and flexibility to craft and send data-driven emails, push notifications, in-app messages, and SMS.",
5
+ "logo": "https://cdn.metarouter.io/logo.svg",
6
+ "color": "#5721cc",
7
+ "eventSource": {
8
+ "isAndroidApp": false,
9
+ "isIosApp": false,
10
+ "isWebApp": true
11
+ },
12
+ "inputSchema": "analytics_js",
13
+ "releaseNotes": [
14
+ {
15
+ "date": "2022-11-07T00:00:00.000Z",
16
+ "note": "Customer.io initial release."
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1 @@
1
+ "8f9baba65df62fbb53c01b37b949936c"
@@ -0,0 +1,189 @@
1
+ {
2
+ "version": "v1.0.1",
3
+ "global": {
4
+ "mappings": [
5
+ {
6
+ "inputKey": "anonymousId",
7
+ "outputKey": "anonymous_id"
8
+ }
9
+ ]
10
+ },
11
+ "eventSpecific": {
12
+ "identify": {
13
+ "filters": [
14
+ {
15
+ "byConditions": {
16
+ "action": "allow",
17
+ "when": {
18
+ "stringNotEqual": {
19
+ "inputPath": "userId",
20
+ "value": ""
21
+ }
22
+ }
23
+ }
24
+ }
25
+ ],
26
+ "mappings": [
27
+ {
28
+ "inputKey": "userId",
29
+ "outputKey": "id"
30
+ },
31
+ {
32
+ "inputKey": "input",
33
+ "outputKey": "email_sha256",
34
+ "transforms": [
35
+ {
36
+ "expression": {
37
+ "lang": "lua",
38
+ "body": "return TO_SHA256_HASH(LOWER(TRIM(input.traits.email)))"
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "inputKey": "input",
45
+ "outputKey": "created_at",
46
+ "transforms": [
47
+ {
48
+ "expression": {
49
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
50
+ "lang": "lua"
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ },
57
+ "page": {
58
+ "mappings": [
59
+ {
60
+ "inputKey": "properties",
61
+ "outputKey": "data"
62
+ },
63
+ {
64
+ "inputKey": "context.page.url",
65
+ "outputKey": "name"
66
+ },
67
+ {
68
+ "inputKey": "messageId",
69
+ "outputKey": "id"
70
+ },
71
+ {
72
+ "inputKey": "userId",
73
+ "outputKey": "data.userId",
74
+ "defaultString": ""
75
+ },
76
+ {
77
+ "inputKey": "input",
78
+ "outputKey": "timestamp",
79
+ "transforms": [
80
+ {
81
+ "expression": {
82
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
83
+ "lang": "lua"
84
+ }
85
+ }
86
+ ]
87
+ }
88
+ ],
89
+ "enrichments": [
90
+ {
91
+ "staticString": "page",
92
+ "outputKey": "type"
93
+ }
94
+ ]
95
+ },
96
+ "screen": {
97
+ "mappings": [
98
+ {
99
+ "inputKey": "properties",
100
+ "outputKey": "data"
101
+ },
102
+ {
103
+ "inputKey": "properties.name",
104
+ "outputKey": "name",
105
+ "transforms": [
106
+ {
107
+ "modifyString": "trim"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "inputKey": "messageId",
113
+ "outputKey": "id"
114
+ },
115
+ {
116
+ "inputKey": "userId",
117
+ "outputKey": "data.userId",
118
+ "defaultString": ""
119
+ },
120
+ {
121
+ "inputKey": "properties.category",
122
+ "outputKey": "data.from"
123
+ },
124
+ {
125
+ "inputKey": "input",
126
+ "outputKey": "timestamp",
127
+ "transforms": [
128
+ {
129
+ "expression": {
130
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
131
+ "lang": "lua"
132
+ }
133
+ }
134
+ ]
135
+ }
136
+ ],
137
+ "enrichments": [
138
+ {
139
+ "staticString": "screen",
140
+ "outputKey": "type"
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ "default": {
146
+ "mappings": [
147
+ {
148
+ "inputKey": "properties",
149
+ "outputKey": "data"
150
+ },
151
+ {
152
+ "inputKey": "messageId",
153
+ "outputKey": "id"
154
+ },
155
+ {
156
+ "inputKey": "userId",
157
+ "outputKey": "data.userId",
158
+ "defaultString": ""
159
+ },
160
+ {
161
+ "inputKey": "event",
162
+ "outputKey": "name",
163
+ "transforms": [
164
+ {
165
+ "modifyString": "trim"
166
+ }
167
+ ]
168
+ },
169
+ {
170
+ "inputKey": "input",
171
+ "outputKey": "timestamp",
172
+ "transforms": [
173
+ {
174
+ "expression": {
175
+ "body": "return SECONDS_SINCE_EPOCH_FROM_RFC3999(input.timestamp)",
176
+ "lang": "lua"
177
+ }
178
+ }
179
+ ]
180
+ }
181
+ ],
182
+ "enrichments": [
183
+ {
184
+ "staticString": "event",
185
+ "outputKey": "type"
186
+ }
187
+ ]
188
+ }
189
+ }
package/index.js CHANGED
@@ -103,6 +103,13 @@ exports.criteo = {
103
103
  metadata: require('./.dist/criteo/metadata.json')
104
104
  }
105
105
 
106
+ exports['customer-io'] = {
107
+ connectionTemplate: connectionSchemas.properties.customerIo,
108
+ endpointSchema: require('./.dist/customer-io/connection.json'),
109
+ playbook: require('./.dist/customer-io/playbook.json'),
110
+ metadata: require('./.dist/customer-io/metadata.json')
111
+ }
112
+
106
113
  exports['facebook-pixel'] = {
107
114
  connectionTemplate: connectionSchemas.properties.facebookPixel,
108
115
  endpointSchema: require('./.dist/facebook-pixel/connection.json'),
@@ -366,6 +373,11 @@ exports.etags = {
366
373
  playbook: require('./.dist/criteo/playbook.etag.json'),
367
374
  kit: require('./.dist/criteo/kit.etag.json')
368
375
  },
376
+ 'customer-io': {
377
+ endpointSchema: require('./.dist/customer-io/connection.etag.json'),
378
+ playbook: require('./.dist/customer-io/playbook.etag.json'),
379
+ kit: require('./.dist/customer-io/kit.etag.json')
380
+ },
369
381
  'facebook-pixel': {
370
382
  endpointSchema: require('./.dist/facebook-pixel/connection.etag.json'),
371
383
  playbook: require('./.dist/facebook-pixel/playbook.etag.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/ajs-starter-kit",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "MetaRouter analytics.js starter kit",
5
5
  "main": "index.js",
6
6
  "scripts": {