@walkeros/web-destination-plausible 2.1.0 → 2.2.0-next-1772811722420
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 +21 -21
- package/dist/examples/index.mjs +21 -21
- package/dist/walkerOS.json +3 -3
- package/package.json +3 -3
package/dist/examples/index.js
CHANGED
|
@@ -81,38 +81,38 @@ __export(step_exports, {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
// ../../../core/dist/index.mjs
|
|
84
|
-
var
|
|
84
|
+
var e = Object.defineProperty;
|
|
85
85
|
var a = {};
|
|
86
|
-
((
|
|
87
|
-
for (var o in n) t
|
|
86
|
+
((t, n) => {
|
|
87
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
88
88
|
})(a, { Level: () => u });
|
|
89
|
-
var u = ((
|
|
90
|
-
var
|
|
91
|
-
function
|
|
92
|
-
n = { ...
|
|
93
|
-
const o = Object.entries(
|
|
94
|
-
const i =
|
|
95
|
-
return n.merge && Array.isArray(i) && Array.isArray(r) ?
|
|
89
|
+
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(u || {});
|
|
90
|
+
var H = { merge: true, shallow: true, extend: true };
|
|
91
|
+
function I(e2, t = {}, n = {}) {
|
|
92
|
+
n = { ...H, ...n };
|
|
93
|
+
const o = Object.entries(t).reduce((t2, [o2, r]) => {
|
|
94
|
+
const i = e2[o2];
|
|
95
|
+
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;
|
|
96
96
|
}, {});
|
|
97
|
-
return n.shallow ? { ...
|
|
97
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function re(e2 = {}) {
|
|
100
100
|
var _a;
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
const [
|
|
104
|
-
|
|
101
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = I({ 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: "2.1.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
|
|
102
|
+
if (e2.name) {
|
|
103
|
+
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
104
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
105
105
|
}
|
|
106
106
|
return r;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const n =
|
|
110
|
-
return
|
|
108
|
+
function ie(e2 = "entity action", t = {}) {
|
|
109
|
+
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 } };
|
|
110
|
+
return re({ ...{ "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 });
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// src/examples/step.ts
|
|
114
114
|
var purchase = {
|
|
115
|
-
in:
|
|
115
|
+
in: ie("order complete", { timestamp: 1700000200 }),
|
|
116
116
|
mapping: {
|
|
117
117
|
name: "purchase",
|
|
118
118
|
data: {
|
|
@@ -137,7 +137,7 @@ var purchase = {
|
|
|
137
137
|
]
|
|
138
138
|
};
|
|
139
139
|
var customEvent = {
|
|
140
|
-
in:
|
|
140
|
+
in: ie("entity action", { timestamp: 1700000201 }),
|
|
141
141
|
mapping: {
|
|
142
142
|
name: "Custom Event",
|
|
143
143
|
data: {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -60,38 +60,38 @@ __export(step_exports, {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
// ../../../core/dist/index.mjs
|
|
63
|
-
var
|
|
63
|
+
var e = Object.defineProperty;
|
|
64
64
|
var a = {};
|
|
65
|
-
((
|
|
66
|
-
for (var o in n) t
|
|
65
|
+
((t, n) => {
|
|
66
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
67
67
|
})(a, { Level: () => u });
|
|
68
|
-
var u = ((
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
n = { ...
|
|
72
|
-
const o = Object.entries(
|
|
73
|
-
const i =
|
|
74
|
-
return n.merge && Array.isArray(i) && Array.isArray(r) ?
|
|
68
|
+
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.WARN = 1] = "WARN", e2[e2.INFO = 2] = "INFO", e2[e2.DEBUG = 3] = "DEBUG", e2))(u || {});
|
|
69
|
+
var H = { merge: true, shallow: true, extend: true };
|
|
70
|
+
function I(e2, t = {}, n = {}) {
|
|
71
|
+
n = { ...H, ...n };
|
|
72
|
+
const o = Object.entries(t).reduce((t2, [o2, r]) => {
|
|
73
|
+
const i = e2[o2];
|
|
74
|
+
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;
|
|
75
75
|
}, {});
|
|
76
|
-
return n.shallow ? { ...
|
|
76
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function re(e2 = {}) {
|
|
79
79
|
var _a;
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const [
|
|
83
|
-
|
|
80
|
+
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = I({ 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: "2.1.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
|
|
81
|
+
if (e2.name) {
|
|
82
|
+
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
83
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
84
84
|
}
|
|
85
85
|
return r;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const n =
|
|
89
|
-
return
|
|
87
|
+
function ie(e2 = "entity action", t = {}) {
|
|
88
|
+
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 } };
|
|
89
|
+
return re({ ...{ "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 });
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// src/examples/step.ts
|
|
93
93
|
var purchase = {
|
|
94
|
-
in:
|
|
94
|
+
in: ie("order complete", { timestamp: 1700000200 }),
|
|
95
95
|
mapping: {
|
|
96
96
|
name: "purchase",
|
|
97
97
|
data: {
|
|
@@ -116,7 +116,7 @@ var purchase = {
|
|
|
116
116
|
]
|
|
117
117
|
};
|
|
118
118
|
var customEvent = {
|
|
119
|
-
in:
|
|
119
|
+
in: ie("entity action", { timestamp: 1700000201 }),
|
|
120
120
|
mapping: {
|
|
121
121
|
name: "Custom Event",
|
|
122
122
|
data: {
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-plausible",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": "web"
|
|
7
7
|
},
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"group": "gr0up",
|
|
123
123
|
"count": 1,
|
|
124
124
|
"version": {
|
|
125
|
-
"source": "2.
|
|
125
|
+
"source": "2.1.1",
|
|
126
126
|
"tagging": 1
|
|
127
127
|
},
|
|
128
128
|
"source": {
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"group": "gr0up",
|
|
245
245
|
"count": 1,
|
|
246
246
|
"version": {
|
|
247
|
-
"source": "2.
|
|
247
|
+
"source": "2.1.1",
|
|
248
248
|
"tagging": 1
|
|
249
249
|
},
|
|
250
250
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-plausible",
|
|
3
3
|
"description": "Plausible web destination for walkerOS",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0-next-1772811722420",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"update": "npx npm-check-updates -u && npm update"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@walkeros/web-core": "
|
|
39
|
+
"@walkeros/web-core": "2.2.0-next-1772811722420"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@walkeros/collector": "
|
|
42
|
+
"@walkeros/collector": "2.2.0-next-1772811722420"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|