@walkeros/web-destination-api 1.1.0 → 1.1.1-next-1769158278557
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 +15 -15
- package/dist/examples/index.mjs +15 -15
- package/package.json +2 -2
package/dist/examples/index.js
CHANGED
|
@@ -60,35 +60,35 @@ __export(events_exports, {
|
|
|
60
60
|
var e = Object.defineProperty;
|
|
61
61
|
var a = {};
|
|
62
62
|
((t, n) => {
|
|
63
|
-
for (var
|
|
63
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
64
64
|
})(a, { Level: () => u });
|
|
65
65
|
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(u || {});
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
n = {
|
|
69
|
-
const
|
|
70
|
-
const i = e2[
|
|
71
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
66
|
+
var A = { merge: true, shallow: true, extend: true };
|
|
67
|
+
function $(e2, t = {}, n = {}) {
|
|
68
|
+
n = { ...A, ...n };
|
|
69
|
+
const o = Object.entries(t).reduce((t2, [o2, r]) => {
|
|
70
|
+
const i = e2[o2];
|
|
71
|
+
return n.merge && Array.isArray(i) && Array.isArray(r) ? t2[o2] = r.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || o2 in e2) && (t2[o2] = r), t2;
|
|
72
72
|
}, {});
|
|
73
|
-
return n.shallow ? { ...e2, ...
|
|
73
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
74
74
|
}
|
|
75
75
|
function H(e2 = {}) {
|
|
76
76
|
var _a;
|
|
77
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up",
|
|
77
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = $({ 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" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "1.0.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
|
|
78
78
|
if (e2.name) {
|
|
79
79
|
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
80
|
-
t2 && n2 && (
|
|
80
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return r;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
86
|
-
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
84
|
+
function Z(e2 = "entity action", t = {}) {
|
|
85
|
+
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), o = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, r = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
|
|
86
|
+
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 * o.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...o.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: o.data.price + r.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...r, 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", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...r, 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": { ...o, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...o, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...o.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 });
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// src/examples/events.ts
|
|
90
90
|
function entity_action() {
|
|
91
|
-
const event =
|
|
91
|
+
const event = Z("entity action");
|
|
92
92
|
return JSON.stringify(event.data);
|
|
93
93
|
}
|
|
94
94
|
|
package/dist/examples/index.mjs
CHANGED
|
@@ -38,35 +38,35 @@ __export(events_exports, {
|
|
|
38
38
|
var e = Object.defineProperty;
|
|
39
39
|
var a = {};
|
|
40
40
|
((t, n) => {
|
|
41
|
-
for (var
|
|
41
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
42
42
|
})(a, { Level: () => u });
|
|
43
43
|
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(u || {});
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
n = {
|
|
47
|
-
const
|
|
48
|
-
const i = e2[
|
|
49
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
44
|
+
var A = { merge: true, shallow: true, extend: true };
|
|
45
|
+
function $(e2, t = {}, n = {}) {
|
|
46
|
+
n = { ...A, ...n };
|
|
47
|
+
const o = Object.entries(t).reduce((t2, [o2, r]) => {
|
|
48
|
+
const i = e2[o2];
|
|
49
|
+
return n.merge && Array.isArray(i) && Array.isArray(r) ? t2[o2] = r.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || o2 in e2) && (t2[o2] = r), t2;
|
|
50
50
|
}, {});
|
|
51
|
-
return n.shallow ? { ...e2, ...
|
|
51
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
52
52
|
}
|
|
53
53
|
function H(e2 = {}) {
|
|
54
54
|
var _a;
|
|
55
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up",
|
|
55
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = $({ 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" }, nested: [], context: { element: ["child", 0] } }], consent: { functional: true }, id: `${t}-${n}-${o}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: o, version: { source: "1.0.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
|
|
56
56
|
if (e2.name) {
|
|
57
57
|
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
58
|
-
t2 && n2 && (
|
|
58
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return r;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
64
|
-
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
62
|
+
function Z(e2 = "entity action", t = {}) {
|
|
63
|
+
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), o = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, r = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
|
|
64
|
+
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 * o.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...o.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: o.data.price + r.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...r, 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", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...r, 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": { ...o, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...o, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...o.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 });
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// src/examples/events.ts
|
|
68
68
|
function entity_action() {
|
|
69
|
-
const event =
|
|
69
|
+
const event = Z("entity action");
|
|
70
70
|
return JSON.stringify(event.data);
|
|
71
71
|
}
|
|
72
72
|
|
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": "1.1.
|
|
4
|
+
"version": "1.1.1-next-1769158278557",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"update": "npx npm-check-updates -u && npm update"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@walkeros/web-core": "1.0.
|
|
38
|
+
"@walkeros/web-core": "1.0.1-next-1769158278557"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {},
|
|
41
41
|
"repository": {
|