@walkeros/web-destination-plausible 0.1.0 → 0.1.1
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/examples/index.js +8 -8
- package/dist/examples/index.mjs +8 -8
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/examples/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var e;
|
|
|
36
36
|
var t;
|
|
37
37
|
var n = Object.getOwnPropertyNames;
|
|
38
38
|
var r = (e = { "package.json"(e2, t2) {
|
|
39
|
-
t2.exports = { name: "@walkeros/core", description: "Core types and platform-agnostic utilities for walkerOS", version: "0.1.
|
|
39
|
+
t2.exports = { name: "@walkeros/core", description: "Core types and platform-agnostic utilities for walkerOS", version: "0.1.1", main: "./dist/index.js", module: "./dist/index.mjs", types: "./dist/index.d.ts", license: "MIT", files: ["dist/**"], scripts: { build: "tsup --silent", clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist", dev: "jest --watchAll --colors", lint: 'tsc && eslint "**/*.ts*"', test: "jest", update: "npx npm-check-updates -u && npm update" }, dependencies: {}, devDependencies: {}, repository: { url: "git+https://github.com/elbwalker/walkerOS.git", directory: "packages/core" }, author: "elbwalker <hello@elbwalker.com>", homepage: "https://github.com/elbwalker/walkerOS#readme", bugs: { url: "https://github.com/elbwalker/walkerOS/issues" }, keywords: ["walker", "walkerOS", "analytics", "tracking", "data collection", "measurement", "data privacy", "privacy friendly", "web analytics", "product analytics", "core", "types", "utils"], funding: [{ type: "GitHub Sponsors", url: "https://github.com/sponsors/elbwalker" }] };
|
|
40
40
|
} }, function() {
|
|
41
41
|
return t || (0, e[n(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
42
42
|
});
|
|
@@ -49,24 +49,24 @@ function v(e2, t2 = {}, n2 = {}) {
|
|
|
49
49
|
}, {});
|
|
50
50
|
return n2.shallow ? { ...e2, ...r2 } : (Object.assign(e2, r2), e2);
|
|
51
51
|
}
|
|
52
|
-
var { version:
|
|
53
|
-
function
|
|
52
|
+
var { version: R } = r();
|
|
53
|
+
function V(e2 = {}) {
|
|
54
54
|
var _a;
|
|
55
|
-
const t2 = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n2 = e2.group || "gr0up", r2 = e2.count || 1, o = v({ 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: `${t2}-${n2}-${r2}`, trigger: "test", entity: "entity", action: "action", timestamp: t2, timing: 3.14, group: n2, count: r2, version: { source:
|
|
55
|
+
const t2 = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n2 = e2.group || "gr0up", r2 = e2.count || 1, o = v({ 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: `${t2}-${n2}-${r2}`, trigger: "test", entity: "entity", action: "action", timestamp: t2, timing: 3.14, group: n2, count: r2, version: { source: R, 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 [t3, n3] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
58
58
|
t3 && n3 && (o.entity = t3, o.action = n3);
|
|
59
59
|
}
|
|
60
60
|
return o;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function H(e2 = "entity action", t2 = {}) {
|
|
63
63
|
const n2 = t2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r2 = { 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 } };
|
|
64
|
-
return
|
|
64
|
+
return V({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r2.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r2.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r2.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r2, 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", ...r2, 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.elbwalker.com/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r2, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r2, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r2.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: n2, 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], ...t2, name: e2 });
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// src/examples/events.ts
|
|
68
68
|
function purchase() {
|
|
69
|
-
const event =
|
|
69
|
+
const event = H("order complete");
|
|
70
70
|
return [
|
|
71
71
|
"purchase",
|
|
72
72
|
{
|
|
@@ -78,7 +78,7 @@ function purchase() {
|
|
|
78
78
|
];
|
|
79
79
|
}
|
|
80
80
|
function customEvent() {
|
|
81
|
-
const event =
|
|
81
|
+
const event = H();
|
|
82
82
|
return [
|
|
83
83
|
"Custom Event",
|
|
84
84
|
{
|
package/dist/examples/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ var e;
|
|
|
16
16
|
var t;
|
|
17
17
|
var n = Object.getOwnPropertyNames;
|
|
18
18
|
var r = (e = { "package.json"(e2, t2) {
|
|
19
|
-
t2.exports = { name: "@walkeros/core", description: "Core types and platform-agnostic utilities for walkerOS", version: "0.1.
|
|
19
|
+
t2.exports = { name: "@walkeros/core", description: "Core types and platform-agnostic utilities for walkerOS", version: "0.1.1", main: "./dist/index.js", module: "./dist/index.mjs", types: "./dist/index.d.ts", license: "MIT", files: ["dist/**"], scripts: { build: "tsup --silent", clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist", dev: "jest --watchAll --colors", lint: 'tsc && eslint "**/*.ts*"', test: "jest", update: "npx npm-check-updates -u && npm update" }, dependencies: {}, devDependencies: {}, repository: { url: "git+https://github.com/elbwalker/walkerOS.git", directory: "packages/core" }, author: "elbwalker <hello@elbwalker.com>", homepage: "https://github.com/elbwalker/walkerOS#readme", bugs: { url: "https://github.com/elbwalker/walkerOS/issues" }, keywords: ["walker", "walkerOS", "analytics", "tracking", "data collection", "measurement", "data privacy", "privacy friendly", "web analytics", "product analytics", "core", "types", "utils"], funding: [{ type: "GitHub Sponsors", url: "https://github.com/sponsors/elbwalker" }] };
|
|
20
20
|
} }, function() {
|
|
21
21
|
return t || (0, e[n(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
22
22
|
});
|
|
@@ -29,24 +29,24 @@ function v(e2, t2 = {}, n2 = {}) {
|
|
|
29
29
|
}, {});
|
|
30
30
|
return n2.shallow ? { ...e2, ...r2 } : (Object.assign(e2, r2), e2);
|
|
31
31
|
}
|
|
32
|
-
var { version:
|
|
33
|
-
function
|
|
32
|
+
var { version: R } = r();
|
|
33
|
+
function V(e2 = {}) {
|
|
34
34
|
var _a;
|
|
35
|
-
const t2 = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n2 = e2.group || "gr0up", r2 = e2.count || 1, o = v({ 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: `${t2}-${n2}-${r2}`, trigger: "test", entity: "entity", action: "action", timestamp: t2, timing: 3.14, group: n2, count: r2, version: { source:
|
|
35
|
+
const t2 = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n2 = e2.group || "gr0up", r2 = e2.count || 1, o = v({ 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: `${t2}-${n2}-${r2}`, trigger: "test", entity: "entity", action: "action", timestamp: t2, timing: 3.14, group: n2, count: r2, version: { source: R, tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
|
|
36
36
|
if (e2.name) {
|
|
37
37
|
const [t3, n3] = (_a = e2.name.split(" ")) != null ? _a : [];
|
|
38
38
|
t3 && n3 && (o.entity = t3, o.action = n3);
|
|
39
39
|
}
|
|
40
40
|
return o;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function H(e2 = "entity action", t2 = {}) {
|
|
43
43
|
const n2 = t2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r2 = { 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 } };
|
|
44
|
-
return
|
|
44
|
+
return V({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r2.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r2.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r2.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r2, 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", ...r2, 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.elbwalker.com/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r2, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r2, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r2.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: n2, 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], ...t2, name: e2 });
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// src/examples/events.ts
|
|
48
48
|
function purchase() {
|
|
49
|
-
const event =
|
|
49
|
+
const event = H("order complete");
|
|
50
50
|
return [
|
|
51
51
|
"purchase",
|
|
52
52
|
{
|
|
@@ -58,7 +58,7 @@ function purchase() {
|
|
|
58
58
|
];
|
|
59
59
|
}
|
|
60
60
|
function customEvent() {
|
|
61
|
-
const event =
|
|
61
|
+
const event = H();
|
|
62
62
|
return [
|
|
63
63
|
"Custom Event",
|
|
64
64
|
{
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var e,t,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},i={};s(i,{DestinationPlausible:()=>h,default:()=>A,destinationPlausible:()=>S,destinationPlausibleExamples:()=>y});var c=Object.getOwnPropertyNames,p=(e={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.
|
|
1
|
+
"use strict";var Destination=(()=>{var e,t,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},i={};s(i,{DestinationPlausible:()=>h,default:()=>A,destinationPlausible:()=>S,destinationPlausibleExamples:()=>y});var c=Object.getOwnPropertyNames,p=(e={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.1",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return t||(0,e[c(e)[0]])((t={exports:{}}).exports,t),t.exports}),l={merge:!0,shallow:!0,extend:!0};function u(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}var{version:d}=p();function g(e={}){var t;const n=e.timestamp||(new Date).setHours(0,13,37,0),o=e.group||"gr0up",r=e.count||1,a=function(e,t={},n={}){n={...l,...n};const o=Object.entries(t).reduce((t,[o,r])=>{const a=e[o];return n.merge&&Array.isArray(a)&&Array.isArray(r)?t[o]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...a]):(n.extend||o in e)&&(t[o]=r),t},{});return n.shallow?{...e,...o}:(Object.assign(e,o),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],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:!0},id:`${n}-${o}-${r}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:o,count:r,version:{source:d,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[n,o]=null!=(t=e.name.split(" "))?t:[];n&&o&&(a.entity=n,a.action=o)}return a}function m(e="entity action",t={}){const n=t.timestamp||(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}};return g({...{"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.elbwalker.com/",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:!0},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:!0,count:1,runs:1,isStart:!0,storage:!0,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:!0,custom:"value"}}}[e],...t,name:e})}function b(e){const t={window:globalThis.window,document:globalThis.document};return e?{...t,...e}:t}var h={},y={};s(y,{destinationPlausibleExamples:()=>E});var v={};function w(){return["purchase",{revenue:{currency:"EUR",amount:m("order complete").data.total}}]}function f(){const e=m();return["Custom Event",{props:e.data,revenue:e.data.number}]}s(v,{customEvent:()=>f,purchase:()=>w});var k={};s(k,{config:()=>j,customEvent:()=>x,purchase:()=>O});var x={name:"Custom Event",data:{map:{props:"data",revenue:"data.number"}}},O={name:"purchase",data:{map:{revenue:{map:{currency:{value:"EUR"},amount:"data.total"}}}}},j={entity:{action:x},order:{complete:O}},E={events:v,mapping:k},S={type:"plausible",config:{},init({config:e,env:t}){const{window:n}=b(t),o=n,r=e.settings||{};return e.loadScript&&function(e,t,n="https://plausible.io/js/script.manual.js"){const{document:o}=b(t),r=o,a=r.createElement("script");a.src=n,e&&(a.dataset.domain=e);r.head.appendChild(a)}(r.domain,t),o.plausible=o.plausible||function(){(o.plausible.q=o.plausible.q||[]).push(arguments)},e},push(e,{config:t,data:n,env:o}){const r=u(n)?n:{},{window:a}=b(o);(0,a.plausible)(`${e.name}`,r)}};var P,A=S;return P=i,((e,t,s,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of r(t))a.call(e,c)||c===s||n(e,c,{get:()=>t[c],enumerable:!(i=o(t,c))||i.enumerable});return e})(n({},"__esModule",{value:!0}),P)})();
|
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return a}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}var Destination=function(){var e,t,r=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.timestamp||(new Date).setHours(0,13,37,0),r=e.group||"gr0up",n=e.count||1,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=_object_spread({},g,r);var n=Object.entries(t).reduce(function(t,n){var o=_sliced_to_array(n,2),a=o[0],i=o[1],s=e[a];return r.merge&&Array.isArray(s)&&Array.isArray(i)?t[a]=i.reduce(function(e,t){return e.includes(t)?e:_to_consumable_array(e).concat([t])},_to_consumable_array(s)):(r.extend||a in e)&&(t[a]=i),t},{});return r.shallow?_object_spread({},e,n):(Object.assign(e,n),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],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:!0},id:"".concat(t,"-").concat(r,"-").concat(n),trigger:"test",entity:"entity",action:"action",timestamp:t,timing:3.14,group:r,count:n,version:{source:m,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){var a,i=_sliced_to_array(null!==(a=e.name.split(" "))&&void 0!==a?a:[],2),s=i[0],c=i[1];s&&c&&(o.entity=s,o.action=c)}return o},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"entity action",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.timestamp||(new Date).setHours(0,13,37,0),o={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},a={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return n(_object_spread_props(_object_spread({},{"cart view":{data:{currency:"EUR",value:2*o.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:_object_spread_props(_object_spread({},o.data),{quantity:2}),context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:o.data.price+a.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[_object_spread_props(_object_spread({entity:"product"},o),{context:{shopping:["checkout",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{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:[_object_spread_props(_object_spread({entity:"product"},o),{context:{shopping:["complete",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{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.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":_object_spread_props(_object_spread({},o),{context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"}),"product view":_object_spread_props(_object_spread({},o),{context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"}),"product visible":{data:_object_spread_props(_object_spread({},o.data),{position:3,promo:!0}),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:r,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,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:!0,custom:"value"}}}[e],t),{name:e}))},a=function(e){var t={window:globalThis.window,document:globalThis.document};return e?_object_spread({},t,e):t},i=function(){return["purchase",{revenue:{currency:"EUR",amount:o("order complete").data.total}}]},s=function(){var e=o();return["Custom Event",{props:e.data,revenue:e.data.number}]},c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,d=function(e,t){for(var r in t)c(e,r,{get:t[r],enumerable:!0})},_={};d(_,{DestinationPlausible:function(){return f},default:function(){return E},destinationPlausible:function(){return P},destinationPlausibleExamples:function(){return h}});var b=Object.getOwnPropertyNames,y=(e={"package.json":function(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.0",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return t||(0,e[b(e)[0]])((t={exports:{}}).exports,t),t.exports}),g={merge:!0,shallow:!0,extend:!0},m=y().version,f={},h={};d(h,{destinationPlausibleExamples:function(){return S}});var v={};d(v,{customEvent:function(){return s},purchase:function(){return i}});var w={};d(w,{config:function(){return x},customEvent:function(){return O},purchase:function(){return k}});var j,O={name:"Custom Event",data:{map:{props:"data",revenue:"data.number"}}},k={name:"purchase",data:{map:{revenue:{map:{currency:{value:"EUR"},amount:"data.total"}}}}},x={entity:{action:O},order:{complete:k}},S={events:v,mapping:w},P={type:"plausible",config:{},init:function(e){var t=e.config,r=e.env,n=a(r).window,o=t.settings||{};return t.loadScript&&function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://plausible.io/js/script.manual.js",n=a(t).document,o=n.createElement("script");o.src=r,e&&(o.dataset.domain=e),n.head.appendChild(o)}(o.domain,r),n.plausible=n.plausible||function(){(n.plausible.q=n.plausible.q||[]).push(arguments)},t},push:function(e,t){t.config;var n=t.data,o=t.env,i=r(n)?n:{};(0,a(o).window.plausible)("".concat(e.name),i)}},E=P;return j=_,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var s,d=function(){var o=s.value;p.call(e,o)||o===r||c(e,o,{get:function(){return t[o]},enumerable:!(n=l(t,o))||n.enumerable})},_=u(t)[Symbol.iterator]();!(o=(s=_.next()).done);o=!0)d()}catch(e){a=!0,i=e}finally{try{o||null==_.return||_.return()}finally{if(a)throw i}}}return e}(c({},"__esModule",{value:!0}),j)}();
|
|
1
|
+
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return a}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}var Destination=function(){var e,t,r=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.timestamp||(new Date).setHours(0,13,37,0),r=e.group||"gr0up",n=e.count||1,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=_object_spread({},g,r);var n=Object.entries(t).reduce(function(t,n){var o=_sliced_to_array(n,2),a=o[0],i=o[1],s=e[a];return r.merge&&Array.isArray(s)&&Array.isArray(i)?t[a]=i.reduce(function(e,t){return e.includes(t)?e:_to_consumable_array(e).concat([t])},_to_consumable_array(s)):(r.extend||a in e)&&(t[a]=i),t},{});return r.shallow?_object_spread({},e,n):(Object.assign(e,n),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],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:!0},id:"".concat(t,"-").concat(r,"-").concat(n),trigger:"test",entity:"entity",action:"action",timestamp:t,timing:3.14,group:r,count:n,version:{source:m,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){var a,i=_sliced_to_array(null!==(a=e.name.split(" "))&&void 0!==a?a:[],2),s=i[0],c=i[1];s&&c&&(o.entity=s,o.action=c)}return o},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"entity action",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.timestamp||(new Date).setHours(0,13,37,0),o={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},a={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return n(_object_spread_props(_object_spread({},{"cart view":{data:{currency:"EUR",value:2*o.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:_object_spread_props(_object_spread({},o.data),{quantity:2}),context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:o.data.price+a.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[_object_spread_props(_object_spread({entity:"product"},o),{context:{shopping:["checkout",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{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:[_object_spread_props(_object_spread({entity:"product"},o),{context:{shopping:["complete",0]},nested:[]}),_object_spread_props(_object_spread({entity:"product"},a),{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.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":_object_spread_props(_object_spread({},o),{context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"}),"product view":_object_spread_props(_object_spread({},o),{context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"}),"product visible":{data:_object_spread_props(_object_spread({},o.data),{position:3,promo:!0}),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:r,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,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:!0,custom:"value"}}}[e],t),{name:e}))},a=function(e){var t={window:globalThis.window,document:globalThis.document};return e?_object_spread({},t,e):t},i=function(){return["purchase",{revenue:{currency:"EUR",amount:o("order complete").data.total}}]},s=function(){var e=o();return["Custom Event",{props:e.data,revenue:e.data.number}]},c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,d=function(e,t){for(var r in t)c(e,r,{get:t[r],enumerable:!0})},_={};d(_,{DestinationPlausible:function(){return f},default:function(){return E},destinationPlausible:function(){return P},destinationPlausibleExamples:function(){return h}});var b=Object.getOwnPropertyNames,y=(e={"package.json":function(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.1",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return t||(0,e[b(e)[0]])((t={exports:{}}).exports,t),t.exports}),g={merge:!0,shallow:!0,extend:!0},m=y().version,f={},h={};d(h,{destinationPlausibleExamples:function(){return S}});var v={};d(v,{customEvent:function(){return s},purchase:function(){return i}});var w={};d(w,{config:function(){return x},customEvent:function(){return O},purchase:function(){return k}});var j,O={name:"Custom Event",data:{map:{props:"data",revenue:"data.number"}}},k={name:"purchase",data:{map:{revenue:{map:{currency:{value:"EUR"},amount:"data.total"}}}}},x={entity:{action:O},order:{complete:k}},S={events:v,mapping:w},P={type:"plausible",config:{},init:function(e){var t=e.config,r=e.env,n=a(r).window,o=t.settings||{};return t.loadScript&&function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://plausible.io/js/script.manual.js",n=a(t).document,o=n.createElement("script");o.src=r,e&&(o.dataset.domain=e),n.head.appendChild(o)}(o.domain,r),n.plausible=n.plausible||function(){(n.plausible.q=n.plausible.q||[]).push(arguments)},t},push:function(e,t){t.config;var n=t.data,o=t.env,i=r(n)?n:{};(0,a(o).window.plausible)("".concat(e.name),i)}},E=P;return j=_,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var s,d=function(){var o=s.value;p.call(e,o)||o===r||c(e,o,{get:function(){return t[o]},enumerable:!(n=l(t,o))||n.enumerable})},_=u(t)[Symbol.iterator]();!(o=(s=_.next()).done);o=!0)d()}catch(e){a=!0,i=e}finally{try{o||null==_.return||_.return()}finally{if(a)throw i}}}return e}(c({},"__esModule",{value:!0}),j)}();
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c={};i(c,{DestinationPlausible:()=>y,default:()=>A,destinationPlausible:()=>P,destinationPlausibleExamples:()=>v}),module.exports=(e=c,((e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of a(t))s.call(e,c)||c===n||r(e,c,{get:()=>t[c],enumerable:!(i=o(t,c))||i.enumerable});return e})(r({},"__esModule",{value:!0}),e));var p=Object.getOwnPropertyNames,l=(t={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.
|
|
1
|
+
"use strict";var e,t,n,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c={};i(c,{DestinationPlausible:()=>y,default:()=>A,destinationPlausible:()=>P,destinationPlausibleExamples:()=>v}),module.exports=(e=c,((e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of a(t))s.call(e,c)||c===n||r(e,c,{get:()=>t[c],enumerable:!(i=o(t,c))||i.enumerable});return e})(r({},"__esModule",{value:!0}),e));var p=Object.getOwnPropertyNames,l=(t={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.1",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return n||(0,t[p(t)[0]])((n={exports:{}}).exports,n),n.exports}),u={merge:!0,shallow:!0,extend:!0};function d(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}var{version:g}=l();function m(e={}){var t;const n=e.timestamp||(new Date).setHours(0,13,37,0),r=e.group||"gr0up",o=e.count||1,a=function(e,t={},n={}){n={...u,...n};const r=Object.entries(t).reduce((t,[r,o])=>{const a=e[r];return n.merge&&Array.isArray(a)&&Array.isArray(o)?t[r]=o.reduce((e,t)=>e.includes(t)?e:[...e,t],[...a]):(n.extend||r in e)&&(t[r]=o),t},{});return n.shallow?{...e,...r}:(Object.assign(e,r),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],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:!0},id:`${n}-${r}-${o}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:r,count:o,version:{source:g,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[n,r]=null!=(t=e.name.split(" "))?t:[];n&&r&&(a.entity=n,a.action=r)}return a}function b(e="entity action",t={}){const n=t.timestamp||(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}};return m({...{"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.elbwalker.com/",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:!0},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:!0,count:1,runs:1,isStart:!0,storage:!0,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:!0,custom:"value"}}}[e],...t,name:e})}var h=require("@walkeros/web-core"),y={},v={};i(v,{destinationPlausibleExamples:()=>S});var w={};function f(){return["purchase",{revenue:{currency:"EUR",amount:b("order complete").data.total}}]}function k(){const e=b();return["Custom Event",{props:e.data,revenue:e.data.number}]}i(w,{customEvent:()=>k,purchase:()=>f});var x={};i(x,{config:()=>E,customEvent:()=>O,purchase:()=>j});var O={name:"Custom Event",data:{map:{props:"data",revenue:"data.number"}}},j={name:"purchase",data:{map:{revenue:{map:{currency:{value:"EUR"},amount:"data.total"}}}}},E={entity:{action:O},order:{complete:j}},S={events:w,mapping:x},P={type:"plausible",config:{},init({config:e,env:t}){const{window:n}=(0,h.getEnvironment)(t),r=n,o=e.settings||{};return e.loadScript&&function(e,t,n="https://plausible.io/js/script.manual.js"){const{document:r}=(0,h.getEnvironment)(t),o=r,a=o.createElement("script");a.src=n,e&&(a.dataset.domain=e);o.head.appendChild(a)}(o.domain,t),r.plausible=r.plausible||function(){(r.plausible.q=r.plausible.q||[]).push(arguments)},e},push(e,{config:t,data:n,env:r}){const o=d(n)?n:{},{window:a}=(0,h.getEnvironment)(r);(0,a.plausible)(`${e.name}`,o)}};var A=P;//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t,a=Object.defineProperty,o=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},n=Object.getOwnPropertyNames,r=(e={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.
|
|
1
|
+
var e,t,a=Object.defineProperty,o=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},n=Object.getOwnPropertyNames,r=(e={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.1",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports}),s={merge:!0,shallow:!0,extend:!0};function i(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}var{version:c}=r();function p(e={}){var t;const a=e.timestamp||(new Date).setHours(0,13,37,0),o=e.group||"gr0up",n=e.count||1,r=function(e,t={},a={}){a={...s,...a};const o=Object.entries(t).reduce((t,[o,n])=>{const r=e[o];return a.merge&&Array.isArray(r)&&Array.isArray(n)?t[o]=n.reduce((e,t)=>e.includes(t)?e:[...e,t],[...r]):(a.extend||o in e)&&(t[o]=n),t},{});return a.shallow?{...e,...o}:(Object.assign(e,o),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],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:!0},id:`${a}-${o}-${n}`,trigger:"test",entity:"entity",action:"action",timestamp:a,timing:3.14,group:o,count:n,version:{source:c,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[a,o]=null!=(t=e.name.split(" "))?t:[];a&&o&&(r.entity=a,r.action=o)}return r}function l(e="entity action",t={}){const a=t.timestamp||(new Date).setHours(0,13,37,0),o={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},n={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return p({...{"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+n.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...o,context:{shopping:["checkout",0]},nested:[]},{entity:"product",...n,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",...n,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.elbwalker.com/",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:!0},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:a,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,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:!0,custom:"value"}}}[e],...t,name:e})}import{getEnvironment as d}from"@walkeros/web-core";var u={},g={};o(g,{destinationPlausibleExamples:()=>f});var m={};function h(){return["purchase",{revenue:{currency:"EUR",amount:l("order complete").data.total}}]}function b(){const e=l();return["Custom Event",{props:e.data,revenue:e.data.number}]}o(m,{customEvent:()=>b,purchase:()=>h});var y={};o(y,{config:()=>k,customEvent:()=>v,purchase:()=>w});var v={name:"Custom Event",data:{map:{props:"data",revenue:"data.number"}}},w={name:"purchase",data:{map:{revenue:{map:{currency:{value:"EUR"},amount:"data.total"}}}}},k={entity:{action:v},order:{complete:w}},f={events:m,mapping:y},x={type:"plausible",config:{},init({config:e,env:t}){const{window:a}=d(t),o=a,n=e.settings||{};return e.loadScript&&function(e,t,a="https://plausible.io/js/script.manual.js"){const{document:o}=d(t),n=o,r=n.createElement("script");r.src=a,e&&(r.dataset.domain=e);n.head.appendChild(r)}(n.domain,t),o.plausible=o.plausible||function(){(o.plausible.q=o.plausible.q||[]).push(arguments)},e},push(e,{config:t,data:a,env:o}){const n=i(a)?a:{},{window:r}=d(o);(0,r.plausible)(`${e.name}`,n)}};var j=x;export{u as DestinationPlausible,j as default,x as destinationPlausible,g as destinationPlausibleExamples};//# sourceMappingURL=index.mjs.map
|
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": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"update": "npx npm-check-updates -u && npm update"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@walkeros/web-core": "0.1.
|
|
33
|
+
"@walkeros/web-core": "0.1.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {},
|
|
36
36
|
"repository": {
|