@metarouter/ajs-starter-kit 1.0.121 → 1.0.122
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/.dist/button/connection.etag.json +1 -0
- package/.dist/button/connection.json +26 -0
- package/.dist/button/kit.etag.json +1 -0
- package/.dist/button/metadata.json +21 -0
- package/.dist/button/playbook.etag.json +1 -0
- package/.dist/button/playbook.json +141 -0
- package/README.md +2 -0
- package/index.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"2fb442d098325d4ac2d4cf93871b5a1d"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"params": [
|
|
3
|
+
{
|
|
4
|
+
"name": "API_KEY",
|
|
5
|
+
"exampleValue": "my-api-key"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"default": {
|
|
9
|
+
"endpoint": "https://api.usebutton.com/v1/order",
|
|
10
|
+
"method": "POST",
|
|
11
|
+
"headers": [
|
|
12
|
+
{
|
|
13
|
+
"key": "Accept-Encoding",
|
|
14
|
+
"value": "application/json"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"key": "Content-Type",
|
|
18
|
+
"value": "application/json"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"transform": {
|
|
22
|
+
"lang": "lua",
|
|
23
|
+
"body": "local auth = BASE64_ENCODE(\"$$API_KEY$$:\")\nrequest.headers[\"Authorization\"] = \"Basic \" .. auth\nreturn request"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"d877f39358279e01f0127d56eb00907a"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"isDraft": false,
|
|
3
|
+
"isDeprecated": false,
|
|
4
|
+
"isBeta": true,
|
|
5
|
+
"friendlyName": "Button",
|
|
6
|
+
"description": "Button is a commerce optimization platform that enhances affiliate, creator, and social traffic through AI-driven solutions.",
|
|
7
|
+
"logo": "https://cdn.metarouter.io/button.png",
|
|
8
|
+
"color": "#0076FF",
|
|
9
|
+
"eventSource": {
|
|
10
|
+
"isAndroidApp": false,
|
|
11
|
+
"isIosApp": false,
|
|
12
|
+
"isWebApp": true
|
|
13
|
+
},
|
|
14
|
+
"inputSchema": "analytics_js",
|
|
15
|
+
"releaseNotes": [
|
|
16
|
+
{
|
|
17
|
+
"date": "2025-02-19T22:00:00.000Z",
|
|
18
|
+
"note": "Version: 0.1.0\nBeta Version\nButton initial release"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"64e7cfb0aedd617a5abb97559137ff29"
|
|
@@ -0,0 +1,141 @@
|
|
|
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": "context.providers.button.btn_ref",
|
|
19
|
+
"outputKey": "btn_ref"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"inputKey": "anonymousId",
|
|
23
|
+
"outputKey": "customer.id"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"inputKey": "input",
|
|
27
|
+
"outputKey": "customer.email_sha256",
|
|
28
|
+
"transforms": [
|
|
29
|
+
{
|
|
30
|
+
"expression": {
|
|
31
|
+
"body": "local email = input.traits.email or input.context.traits.email\nif email then return TO_SHA256_HASH(LOWER(TRIM(email))) end",
|
|
32
|
+
"lang": "lua"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"inputKey": "input",
|
|
39
|
+
"outputKey": "customer.device_id",
|
|
40
|
+
"transforms": [
|
|
41
|
+
{
|
|
42
|
+
"expression": {
|
|
43
|
+
"body": "if (input.context.device and input.context.device.adTrackingEnabled) then\n local id = input.context.device.advertisingId or input.context.device.id\n if id and #id > 0 then return id end\nend",
|
|
44
|
+
"lang": "lua"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"inputKey": "input",
|
|
51
|
+
"outputKey": "purchase_date",
|
|
52
|
+
"transforms": [
|
|
53
|
+
{
|
|
54
|
+
"expression": {
|
|
55
|
+
"body": "return input.timestamp or input.originalTimestamp or input.sentAt",
|
|
56
|
+
"lang": "lua"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"inputKey": "input",
|
|
63
|
+
"outputKey": "partner_order_channel",
|
|
64
|
+
"transforms": [
|
|
65
|
+
{
|
|
66
|
+
"expression": {
|
|
67
|
+
"body": "if input.context.app.name or input.context.device.type or input.context.os.name then return 'app' end\nreturn 'webview'",
|
|
68
|
+
"lang": "lua"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"event_specific": {
|
|
76
|
+
"order_completed": {
|
|
77
|
+
"enrichments": [
|
|
78
|
+
{
|
|
79
|
+
"outputKey": "total_as_decimal",
|
|
80
|
+
"staticBool": false
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"mappings": [
|
|
84
|
+
{
|
|
85
|
+
"inputKey": "input",
|
|
86
|
+
"outputKey": "total",
|
|
87
|
+
"transforms": [
|
|
88
|
+
{
|
|
89
|
+
"expression": {
|
|
90
|
+
"lang": "lua",
|
|
91
|
+
"body": "return SUM(MAP(input.properties.products, function (p) return (p.price or 0) * 100 * (p.quantity or 1) end))"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"inputKey": "properties.currency",
|
|
98
|
+
"outputKey": "currency",
|
|
99
|
+
"transforms": [
|
|
100
|
+
{
|
|
101
|
+
"modifyString": "uppercase"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"defaultString": "USD"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"inputKey": "properties.order_id",
|
|
108
|
+
"outputKey": "order_id",
|
|
109
|
+
"defaultString": "",
|
|
110
|
+
"transforms": [
|
|
111
|
+
{
|
|
112
|
+
"toScalar": "string"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputKey": "properties.order_id",
|
|
118
|
+
"outputKey": "customer_order_id",
|
|
119
|
+
"defaultString": "",
|
|
120
|
+
"transforms": [
|
|
121
|
+
{
|
|
122
|
+
"toScalar": "string"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"inputKey": "input",
|
|
128
|
+
"outputKey": "line_items",
|
|
129
|
+
"transforms": [
|
|
130
|
+
{
|
|
131
|
+
"expression": {
|
|
132
|
+
"lang": "lua",
|
|
133
|
+
"body": "return MAP(\n input.properties.products,\n function (p)\n local item = {\n identifer = p.product_id or p.sku or '',\n total = (p.price or 0) * 100 * (p.quantity or 1),\n quantity = p.quantity or 1,\n sku = p.sku or '',\n category = { p.category or '' },\n description = p.name or '',\n attributes = attributes\n }\n local attributes = {}\n if (p.brand) then attributes.brand = p.brand end\n if (p.name) then attributes.name = p.name end\n if (p.variant) then attributes.variant = p.variant end\n if (p.coupon) then attributes.coupon = p.coupon end\n if (p.position) then attributes.position = p.position end\n if (p.url) then attributes.url = p.url end\n if (p.image_url) then attributes.image_url = p.image_url end\n if (next(attributes)) then item.attributes = attributes end\n return item\n end\n)"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ previously.
|
|
|
8
8
|
## 2025-02
|
|
9
9
|
- Amazon Data Firehose (BETA)
|
|
10
10
|
- AWIN
|
|
11
|
+
- Button (BETA)
|
|
11
12
|
- Merkle
|
|
12
13
|
- Moloco Commerce Media
|
|
13
14
|
|
|
@@ -109,6 +110,7 @@ previously.
|
|
|
109
110
|
|----------|------|-------------|
|
|
110
111
|
| Amazon Data Firehose (BETA) | 2025-02 | Version: 0.1.0 Beta Version Amazon Data Firehose initial release. |
|
|
111
112
|
| AWIN | 2025-02 | Version: 1.0.0 Stable release |
|
|
113
|
+
| Button (BETA) | 2025-02 | Version: 0.1.0 Beta Version Button initial release |
|
|
112
114
|
| Merkle | 2025-02 | Version: 1.2.0 Updated mappings to comply with Merkle's requirements Added required fields: ipAddress, userAgent, pageUrl Added optional fields: rawEmail Updated type field of page event to viewpage |
|
|
113
115
|
| Moloco Commerce Media | 2025-02 | Version: 1.0.0 New Event: session_started -> Mapped to Moloco's LAND event (web) New Event: application_open -> Mapped to Moloco's LAND event (mobile) Updated Event: screen -> Mapped to Moloco's PAGE_VIEW or HOME event based on input.name and/or input.properties.name (mobile) Updated Event: order_completed -> Added mapping for Moloco's shipping_charge field using MetaRouter's properties.shipping (web & mobile) Stable release |
|
|
114
116
|
| Blueshift | 2025-01 | Version: 1.0.0 Stable release |
|
package/index.js
CHANGED
|
@@ -172,6 +172,12 @@ exports['build-your-own'] = {
|
|
|
172
172
|
metadata: require('./.dist/build-your-own/metadata.json')
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
exports.button = {
|
|
176
|
+
endpointSchema: require('./.dist/button/connection.json'),
|
|
177
|
+
playbook: require('./.dist/button/playbook.json'),
|
|
178
|
+
metadata: require('./.dist/button/metadata.json')
|
|
179
|
+
}
|
|
180
|
+
|
|
175
181
|
exports.clinch = {
|
|
176
182
|
endpointSchema: require('./.dist/clinch/connection.json'),
|
|
177
183
|
playbook: require('./.dist/clinch/playbook.json'),
|
|
@@ -616,6 +622,11 @@ exports.etags = {
|
|
|
616
622
|
playbook: require('./.dist/build-your-own/playbook.etag.json'),
|
|
617
623
|
kit: require('./.dist/build-your-own/kit.etag.json')
|
|
618
624
|
},
|
|
625
|
+
button: {
|
|
626
|
+
endpointSchema: require('./.dist/button/connection.etag.json'),
|
|
627
|
+
playbook: require('./.dist/button/playbook.etag.json'),
|
|
628
|
+
kit: require('./.dist/button/kit.etag.json')
|
|
629
|
+
},
|
|
619
630
|
clinch: {
|
|
620
631
|
endpointSchema: require('./.dist/clinch/connection.etag.json'),
|
|
621
632
|
playbook: require('./.dist/clinch/playbook.etag.json'),
|