@walkeros/web-destination-api 4.0.0 → 4.0.1-next-1778183328892
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/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.js +20 -20
- package/dist/examples/index.mjs +20 -20
- package/dist/walkerOS.json +4 -4
- package/package.json +3 -3
package/dist/examples/index.js
CHANGED
|
@@ -59,37 +59,37 @@ __export(step_exports, {
|
|
|
59
59
|
|
|
60
60
|
// ../../../core/dist/index.mjs
|
|
61
61
|
var e = Object.defineProperty;
|
|
62
|
-
var
|
|
62
|
+
var s = {};
|
|
63
63
|
((t, n) => {
|
|
64
|
-
for (var
|
|
65
|
-
})(
|
|
64
|
+
for (var r in n) e(t, r, { get: n[r], enumerable: true });
|
|
65
|
+
})(s, { Level: () => c });
|
|
66
66
|
var c = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(c || {});
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
n = { ...
|
|
70
|
-
const
|
|
71
|
-
const i = e2[
|
|
72
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
67
|
+
var J = { merge: true, shallow: true, extend: true };
|
|
68
|
+
function X(e2, t = {}, n = {}) {
|
|
69
|
+
n = { ...J, ...n };
|
|
70
|
+
const r = Object.entries(t).reduce((t2, [r2, o]) => {
|
|
71
|
+
const i = e2[r2];
|
|
72
|
+
return n.merge && Array.isArray(i) && Array.isArray(o) ? t2[r2] = o.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || r2 in e2) && (t2[r2] = o), t2;
|
|
73
73
|
}, {});
|
|
74
|
-
return n.shallow ? { ...e2, ...
|
|
74
|
+
return n.shallow ? { ...e2, ...r } : (Object.assign(e2, r), e2);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function be() {
|
|
77
77
|
let e2 = "";
|
|
78
78
|
for (let t = 0; t < 16; t++) e2 += (16 * Math.random() | 0).toString(16);
|
|
79
79
|
return e2;
|
|
80
80
|
}
|
|
81
81
|
function ve(e2 = {}) {
|
|
82
82
|
var _a;
|
|
83
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n =
|
|
83
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = X({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" } }], consent: { functional: true }, id: e2.id || be(), trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, source: { type: "collector", schema: "4" } }, e2, { merge: false });
|
|
84
84
|
if (e2.name) {
|
|
85
|
-
const [t2,
|
|
86
|
-
t2 &&
|
|
85
|
+
const [t2, r] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
86
|
+
t2 && r && (n.entity = t2, n.action = r);
|
|
87
87
|
}
|
|
88
88
|
return n;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
92
|
-
return ve({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
90
|
+
function he(e2 = "entity action", t = {}) {
|
|
91
|
+
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
|
|
92
|
+
return ve({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t, name: e2 });
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// src/examples/step.ts
|
|
@@ -97,7 +97,7 @@ var URL = "https://api.example.com/events";
|
|
|
97
97
|
var entityAction = {
|
|
98
98
|
title: "Entity action",
|
|
99
99
|
description: "A generic entity action event is forwarded to the configured API endpoint with the mapped data JSON body.",
|
|
100
|
-
in:
|
|
100
|
+
in: he("entity action", { timestamp: 1700000500 }),
|
|
101
101
|
mapping: {
|
|
102
102
|
data: "data"
|
|
103
103
|
},
|
|
@@ -118,7 +118,7 @@ var entityAction = {
|
|
|
118
118
|
var pageView = {
|
|
119
119
|
title: "Page view",
|
|
120
120
|
description: "A page view is POSTed to the configured API endpoint with the event data section as the JSON body.",
|
|
121
|
-
in:
|
|
121
|
+
in: he("page view", { timestamp: 1700000501 }),
|
|
122
122
|
mapping: {
|
|
123
123
|
data: "data"
|
|
124
124
|
},
|
|
@@ -141,7 +141,7 @@ var pageView = {
|
|
|
141
141
|
var customTransform = {
|
|
142
142
|
title: "Custom payload",
|
|
143
143
|
description: "An order event is reshaped via a data mapping into a custom JSON body for the API endpoint.",
|
|
144
|
-
in:
|
|
144
|
+
in: he("order complete", { timestamp: 1700000502 }),
|
|
145
145
|
mapping: {
|
|
146
146
|
data: {
|
|
147
147
|
map: {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -38,37 +38,37 @@ __export(step_exports, {
|
|
|
38
38
|
|
|
39
39
|
// ../../../core/dist/index.mjs
|
|
40
40
|
var e = Object.defineProperty;
|
|
41
|
-
var
|
|
41
|
+
var s = {};
|
|
42
42
|
((t, n) => {
|
|
43
|
-
for (var
|
|
44
|
-
})(
|
|
43
|
+
for (var r in n) e(t, r, { get: n[r], enumerable: true });
|
|
44
|
+
})(s, { Level: () => c });
|
|
45
45
|
var c = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(c || {});
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
n = { ...
|
|
49
|
-
const
|
|
50
|
-
const i = e2[
|
|
51
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
46
|
+
var J = { merge: true, shallow: true, extend: true };
|
|
47
|
+
function X(e2, t = {}, n = {}) {
|
|
48
|
+
n = { ...J, ...n };
|
|
49
|
+
const r = Object.entries(t).reduce((t2, [r2, o]) => {
|
|
50
|
+
const i = e2[r2];
|
|
51
|
+
return n.merge && Array.isArray(i) && Array.isArray(o) ? t2[r2] = o.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || r2 in e2) && (t2[r2] = o), t2;
|
|
52
52
|
}, {});
|
|
53
|
-
return n.shallow ? { ...e2, ...
|
|
53
|
+
return n.shallow ? { ...e2, ...r } : (Object.assign(e2, r), e2);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function be() {
|
|
56
56
|
let e2 = "";
|
|
57
57
|
for (let t = 0; t < 16; t++) e2 += (16 * Math.random() | 0).toString(16);
|
|
58
58
|
return e2;
|
|
59
59
|
}
|
|
60
60
|
function ve(e2 = {}) {
|
|
61
61
|
var _a;
|
|
62
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n =
|
|
62
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = X({ name: "entity action", data: { string: "foo", number: 1, boolean: true, array: [0, "text", false], not: void 0 }, context: { dev: ["test", 1] }, globals: { lang: "elb" }, custom: { completely: "random" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n" }, nested: [{ entity: "child", data: { is: "subordinated" } }], consent: { functional: true }, id: e2.id || be(), trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, source: { type: "collector", schema: "4" } }, e2, { merge: false });
|
|
63
63
|
if (e2.name) {
|
|
64
|
-
const [t2,
|
|
65
|
-
t2 &&
|
|
64
|
+
const [t2, r] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
65
|
+
t2 && r && (n.entity = t2, n.action = r);
|
|
66
66
|
}
|
|
67
67
|
return n;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
71
|
-
return ve({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
69
|
+
function he(e2 = "entity action", t = {}) {
|
|
70
|
+
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
|
|
71
|
+
return ve({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t, name: e2 });
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/examples/step.ts
|
|
@@ -76,7 +76,7 @@ var URL = "https://api.example.com/events";
|
|
|
76
76
|
var entityAction = {
|
|
77
77
|
title: "Entity action",
|
|
78
78
|
description: "A generic entity action event is forwarded to the configured API endpoint with the mapped data JSON body.",
|
|
79
|
-
in:
|
|
79
|
+
in: he("entity action", { timestamp: 1700000500 }),
|
|
80
80
|
mapping: {
|
|
81
81
|
data: "data"
|
|
82
82
|
},
|
|
@@ -97,7 +97,7 @@ var entityAction = {
|
|
|
97
97
|
var pageView = {
|
|
98
98
|
title: "Page view",
|
|
99
99
|
description: "A page view is POSTed to the configured API endpoint with the event data section as the JSON body.",
|
|
100
|
-
in:
|
|
100
|
+
in: he("page view", { timestamp: 1700000501 }),
|
|
101
101
|
mapping: {
|
|
102
102
|
data: "data"
|
|
103
103
|
},
|
|
@@ -120,7 +120,7 @@ var pageView = {
|
|
|
120
120
|
var customTransform = {
|
|
121
121
|
title: "Custom payload",
|
|
122
122
|
description: "An order event is reshaped via a data mapping into a custom JSON body for the API endpoint.",
|
|
123
|
-
in:
|
|
123
|
+
in: he("order complete", { timestamp: 1700000502 }),
|
|
124
124
|
mapping: {
|
|
125
125
|
data: {
|
|
126
126
|
map: {
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-api",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.1-next-1778183328892",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"consent": {
|
|
156
156
|
"functional": true
|
|
157
157
|
},
|
|
158
|
-
"id": "
|
|
158
|
+
"id": "e8404b4b3d64ae78",
|
|
159
159
|
"trigger": "load",
|
|
160
160
|
"entity": "order",
|
|
161
161
|
"action": "complete",
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"consent": {
|
|
234
234
|
"functional": true
|
|
235
235
|
},
|
|
236
|
-
"id": "
|
|
236
|
+
"id": "0d31c723ecdc5fc7",
|
|
237
237
|
"trigger": "test",
|
|
238
238
|
"entity": "entity",
|
|
239
239
|
"action": "action",
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
"consent": {
|
|
300
300
|
"functional": true
|
|
301
301
|
},
|
|
302
|
-
"id": "
|
|
302
|
+
"id": "e2e4708d829b802f",
|
|
303
303
|
"trigger": "load",
|
|
304
304
|
"entity": "page",
|
|
305
305
|
"action": "view",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-api",
|
|
3
3
|
"description": "Web API destination for walkerOS",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.1-next-1778183328892",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"update": "npx npm-check-updates -u && npm update"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@walkeros/web-core": "4.0.
|
|
40
|
+
"@walkeros/web-core": "4.0.1-next-1778183328892"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@walkeros/collector": "4.0.
|
|
43
|
+
"@walkeros/collector": "4.0.1-next-1778183328892"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|