@walkeros/web-destination-plausible 1.0.0 → 1.0.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 +16 -16
- package/dist/examples/index.mjs +16 -16
- package/package.json +2 -2
package/dist/examples/index.js
CHANGED
|
@@ -85,35 +85,35 @@ __export(events_exports, {
|
|
|
85
85
|
var e = Object.defineProperty;
|
|
86
86
|
var a = {};
|
|
87
87
|
((t, n) => {
|
|
88
|
-
for (var
|
|
88
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
89
89
|
})(a, { Level: () => u });
|
|
90
90
|
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(u || {});
|
|
91
|
-
var
|
|
92
|
-
function
|
|
93
|
-
n = {
|
|
94
|
-
const
|
|
95
|
-
const i = e2[
|
|
96
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
91
|
+
var A = { merge: true, shallow: true, extend: true };
|
|
92
|
+
function $(e2, t = {}, n = {}) {
|
|
93
|
+
n = { ...A, ...n };
|
|
94
|
+
const o = Object.entries(t).reduce((t2, [o2, r]) => {
|
|
95
|
+
const i = e2[o2];
|
|
96
|
+
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;
|
|
97
97
|
}, {});
|
|
98
|
-
return n.shallow ? { ...e2, ...
|
|
98
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
99
99
|
}
|
|
100
100
|
function H(e2 = {}) {
|
|
101
101
|
var _a;
|
|
102
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up",
|
|
102
|
+
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 });
|
|
103
103
|
if (e2.name) {
|
|
104
104
|
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
105
|
-
t2 && n2 && (
|
|
105
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
106
106
|
}
|
|
107
|
-
return
|
|
107
|
+
return r;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
111
|
-
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
109
|
+
function Z(e2 = "entity action", t = {}) {
|
|
110
|
+
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 } };
|
|
111
|
+
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 });
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// src/examples/events.ts
|
|
115
115
|
function purchase() {
|
|
116
|
-
const event =
|
|
116
|
+
const event = Z("order complete");
|
|
117
117
|
return [
|
|
118
118
|
"purchase",
|
|
119
119
|
{
|
|
@@ -125,7 +125,7 @@ function purchase() {
|
|
|
125
125
|
];
|
|
126
126
|
}
|
|
127
127
|
function customEvent() {
|
|
128
|
-
const event =
|
|
128
|
+
const event = Z();
|
|
129
129
|
return [
|
|
130
130
|
"Custom Event",
|
|
131
131
|
{
|
package/dist/examples/index.mjs
CHANGED
|
@@ -63,35 +63,35 @@ __export(events_exports, {
|
|
|
63
63
|
var e = Object.defineProperty;
|
|
64
64
|
var a = {};
|
|
65
65
|
((t, n) => {
|
|
66
|
-
for (var
|
|
66
|
+
for (var o in n) e(t, o, { get: n[o], enumerable: true });
|
|
67
67
|
})(a, { Level: () => u });
|
|
68
68
|
var u = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(u || {});
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
n = {
|
|
72
|
-
const
|
|
73
|
-
const i = e2[
|
|
74
|
-
return n.merge && Array.isArray(i) && Array.isArray(
|
|
69
|
+
var A = { merge: true, shallow: true, extend: true };
|
|
70
|
+
function $(e2, t = {}, n = {}) {
|
|
71
|
+
n = { ...A, ...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 ? { ...e2, ...
|
|
76
|
+
return n.shallow ? { ...e2, ...o } : (Object.assign(e2, o), e2);
|
|
77
77
|
}
|
|
78
78
|
function H(e2 = {}) {
|
|
79
79
|
var _a;
|
|
80
|
-
const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up",
|
|
80
|
+
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 });
|
|
81
81
|
if (e2.name) {
|
|
82
82
|
const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
83
|
-
t2 && n2 && (
|
|
83
|
+
t2 && n2 && (r.entity = t2, r.action = n2);
|
|
84
84
|
}
|
|
85
|
-
return
|
|
85
|
+
return r;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0),
|
|
89
|
-
return H({ ...{ "cart view": { data: { currency: "EUR", value: 2 *
|
|
87
|
+
function Z(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 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 });
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// src/examples/events.ts
|
|
93
93
|
function purchase() {
|
|
94
|
-
const event =
|
|
94
|
+
const event = Z("order complete");
|
|
95
95
|
return [
|
|
96
96
|
"purchase",
|
|
97
97
|
{
|
|
@@ -103,7 +103,7 @@ function purchase() {
|
|
|
103
103
|
];
|
|
104
104
|
}
|
|
105
105
|
function customEvent() {
|
|
106
|
-
const event =
|
|
106
|
+
const event = Z();
|
|
107
107
|
return [
|
|
108
108
|
"Custom Event",
|
|
109
109
|
{
|
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": "1.0.
|
|
4
|
+
"version": "1.0.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": {
|