@walkeros/web-destination-meta 0.4.2 → 0.5.0

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.
@@ -102,24 +102,24 @@ var c = {};
102
102
  for (var r in n) e(t, r, { get: n[r], enumerable: true });
103
103
  })(c, { Level: () => a });
104
104
  var a = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(a || {});
105
- var k = { merge: true, shallow: true, extend: true };
106
- function E(e2, t = {}, n = {}) {
107
- n = { ...k, ...n };
105
+ var E = { merge: true, shallow: true, extend: true };
106
+ function S(e2, t = {}, n = {}) {
107
+ n = { ...E, ...n };
108
108
  const r = Object.entries(t).reduce((t2, [r2, o]) => {
109
109
  const i = e2[r2];
110
110
  return n.merge && Array.isArray(i) && Array.isArray(o) ? t2[r2] = o.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || r2 in e2) && (t2[r2] = o), t2;
111
111
  }, {});
112
112
  return n.shallow ? { ...e2, ...r } : (Object.assign(e2, r), e2);
113
113
  }
114
- function $(e2) {
114
+ function A(e2) {
115
115
  return Array.isArray(e2);
116
116
  }
117
- function T(e2) {
118
- return "object" == typeof e2 && null !== e2 && !$(e2) && "[object Object]" === Object.prototype.toString.call(e2);
117
+ function _(e2) {
118
+ return "object" == typeof e2 && null !== e2 && !A(e2) && "[object Object]" === Object.prototype.toString.call(e2);
119
119
  }
120
- function z(e2 = {}) {
120
+ function W(e2 = {}) {
121
121
  var _a;
122
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", r = e2.count || 1, o = E({ 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}-${r}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: r, version: { source: "0.4.2", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
122
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", r = e2.count || 1, o = S({ 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}-${r}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: r, version: { source: "0.5.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
123
123
  if (e2.name) {
124
124
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
125
125
  t2 && n2 && (o.entity = t2, o.action = n2);
@@ -128,7 +128,7 @@ function z(e2 = {}) {
128
128
  }
129
129
  function B(e2 = "entity action", t = {}) {
130
130
  const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
131
- return z({ ...{ "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: 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 });
131
+ return W({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t, name: e2 });
132
132
  }
133
133
 
134
134
  // src/examples/events.ts
@@ -212,7 +212,7 @@ var Purchase2 = {
212
212
  loop: [
213
213
  "nested",
214
214
  {
215
- condition: (entity) => T(entity) && entity.entity === "product",
215
+ condition: (entity) => _(entity) && entity.entity === "product",
216
216
  map: {
217
217
  id: "data.id",
218
218
  quantity: { key: "data.quantity", value: 1 }
@@ -259,7 +259,7 @@ var InitiateCheckout2 = {
259
259
  loop: [
260
260
  "nested",
261
261
  {
262
- condition: (entity) => T(entity) && entity.entity === "product",
262
+ condition: (entity) => _(entity) && entity.entity === "product",
263
263
  map: {
264
264
  id: "data.id",
265
265
  quantity: { key: "data.quantity", value: 1 }
@@ -80,24 +80,24 @@ var c = {};
80
80
  for (var r in n) e(t, r, { get: n[r], enumerable: true });
81
81
  })(c, { Level: () => a });
82
82
  var a = ((e2) => (e2[e2.ERROR = 0] = "ERROR", e2[e2.INFO = 1] = "INFO", e2[e2.DEBUG = 2] = "DEBUG", e2))(a || {});
83
- var k = { merge: true, shallow: true, extend: true };
84
- function E(e2, t = {}, n = {}) {
85
- n = { ...k, ...n };
83
+ var E = { merge: true, shallow: true, extend: true };
84
+ function S(e2, t = {}, n = {}) {
85
+ n = { ...E, ...n };
86
86
  const r = Object.entries(t).reduce((t2, [r2, o]) => {
87
87
  const i = e2[r2];
88
88
  return n.merge && Array.isArray(i) && Array.isArray(o) ? t2[r2] = o.reduce((e3, t3) => e3.includes(t3) ? e3 : [...e3, t3], [...i]) : (n.extend || r2 in e2) && (t2[r2] = o), t2;
89
89
  }, {});
90
90
  return n.shallow ? { ...e2, ...r } : (Object.assign(e2, r), e2);
91
91
  }
92
- function $(e2) {
92
+ function A(e2) {
93
93
  return Array.isArray(e2);
94
94
  }
95
- function T(e2) {
96
- return "object" == typeof e2 && null !== e2 && !$(e2) && "[object Object]" === Object.prototype.toString.call(e2);
95
+ function _(e2) {
96
+ return "object" == typeof e2 && null !== e2 && !A(e2) && "[object Object]" === Object.prototype.toString.call(e2);
97
97
  }
98
- function z(e2 = {}) {
98
+ function W(e2 = {}) {
99
99
  var _a;
100
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", r = e2.count || 1, o = E({ 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}-${r}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: r, version: { source: "0.4.2", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
100
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", r = e2.count || 1, o = S({ 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}-${r}`, trigger: "test", entity: "entity", action: "action", timestamp: t, timing: 3.14, group: n, count: r, version: { source: "0.5.0", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
101
101
  if (e2.name) {
102
102
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
103
103
  t2 && n2 && (o.entity = t2, o.action = n2);
@@ -106,7 +106,7 @@ function z(e2 = {}) {
106
106
  }
107
107
  function B(e2 = "entity action", t = {}) {
108
108
  const n = t.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), r = { data: { id: "ers", name: "Everyday Ruck Snack", color: "black", size: "l", price: 420 } }, o = { data: { id: "cc", name: "Cool Cap", size: "one size", price: 42 } };
109
- return z({ ...{ "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: 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 });
109
+ return W({ ...{ "cart view": { data: { currency: "EUR", value: 2 * r.data.price }, context: { shopping: ["cart", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", data: { ...r.data, quantity: 2 }, context: { shopping: ["cart", 0] }, nested: [] }], trigger: "load" }, "checkout view": { data: { step: "payment", currency: "EUR", value: r.data.price + o.data.price }, context: { shopping: ["checkout", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["checkout", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["checkout", 0] }, nested: [] }], trigger: "load" }, "order complete": { data: { id: "0rd3r1d", currency: "EUR", shipping: 5.22, taxes: 73.76, total: 555 }, context: { shopping: ["complete", 0] }, globals: { pagegroup: "shop" }, nested: [{ entity: "product", ...r, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "product", ...o, context: { shopping: ["complete", 0] }, nested: [] }, { entity: "gift", data: { name: "Surprise" }, context: { shopping: ["complete", 0] }, nested: [] }], trigger: "load" }, "page view": { data: { domain: "www.example.com", title: "walkerOS documentation", referrer: "https://www.walkeros.io/", search: "?foo=bar", hash: "#hash", id: "/docs/" }, globals: { pagegroup: "docs" }, trigger: "load" }, "product add": { ...r, context: { shopping: ["intent", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "click" }, "product view": { ...r, context: { shopping: ["detail", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "product visible": { data: { ...r.data, position: 3, promo: true }, context: { shopping: ["discover", 0] }, globals: { pagegroup: "shop" }, nested: [], trigger: "load" }, "promotion visible": { data: { name: "Setting up tracking easily", position: "hero" }, context: { ab_test: ["engagement", 0] }, globals: { pagegroup: "homepage" }, trigger: "visible" }, "session start": { data: { id: "s3ss10n", start: n, isNew: true, count: 1, runs: 1, isStart: true, storage: true, referrer: "", device: "c00k13" }, user: { id: "us3r", device: "c00k13", session: "s3ss10n", hash: "h4sh", address: "street number", email: "user@example.com", phone: "+49 123 456 789", userAgent: "Mozilla...", browser: "Chrome", browserVersion: "90", deviceType: "desktop", language: "de-DE", country: "DE", region: "HH", city: "Hamburg", zip: "20354", timezone: "Berlin", os: "walkerOS", osVersion: "1.0", screenSize: "1337x420", ip: "127.0.0.0", internal: true, custom: "value" } } }[e2], ...t, name: e2 });
110
110
  }
111
111
 
112
112
  // src/examples/events.ts
@@ -190,7 +190,7 @@ var Purchase2 = {
190
190
  loop: [
191
191
  "nested",
192
192
  {
193
- condition: (entity) => T(entity) && entity.entity === "product",
193
+ condition: (entity) => _(entity) && entity.entity === "product",
194
194
  map: {
195
195
  id: "data.id",
196
196
  quantity: { key: "data.quantity", value: 1 }
@@ -237,7 +237,7 @@ var InitiateCheckout2 = {
237
237
  loop: [
238
238
  "nested",
239
239
  {
240
- condition: (entity) => T(entity) && entity.entity === "product",
240
+ condition: (entity) => _(entity) && entity.entity === "product",
241
241
  map: {
242
242
  id: "data.id",
243
243
  quantity: { key: "data.quantity", value: 1 }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/web-destination-meta",
3
3
  "description": "Meta pixel web destination for walkerOS",
4
- "version": "0.4.2",
4
+ "version": "0.5.0",
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": "0.4.2"
38
+ "@walkeros/web-core": "0.5.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/facebook-pixel": "^0.0.31"