@walkeros/web-destination-api 3.3.1 → 3.4.0-next-1776749829492

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.
@@ -64,9 +64,9 @@ var c = {};
64
64
  for (var o in n) e(t, o, { get: n[o], enumerable: true });
65
65
  })(c, { Level: () => u });
66
66
  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 || {});
67
- var F = { merge: true, shallow: true, extend: true };
67
+ var W = { merge: true, shallow: true, extend: true };
68
68
  function L(e2, t = {}, n = {}) {
69
- n = { ...F, ...n };
69
+ n = { ...W, ...n };
70
70
  const o = Object.entries(t).reduce((t2, [o2, r]) => {
71
71
  const i = e2[o2];
72
72
  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,7 +75,7 @@ function L(e2, t = {}, n = {}) {
75
75
  }
76
76
  function fe(e2 = {}) {
77
77
  var _a;
78
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ 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: "3.3.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
78
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ 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: "3.4.0-next-1776749829492", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
79
79
  if (e2.name) {
80
80
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
81
81
  t2 && n2 && (r.entity = t2, r.action = n2);
@@ -88,31 +88,46 @@ function le(e2 = "entity action", t = {}) {
88
88
  }
89
89
 
90
90
  // src/examples/step.ts
91
+ var URL = "https://api.example.com/events";
91
92
  var entityAction = {
92
93
  in: le("entity action", { timestamp: 1700000500 }),
93
94
  mapping: {
94
95
  data: "data"
95
96
  },
96
- out: JSON.stringify({
97
- string: "foo",
98
- number: 1,
99
- boolean: true,
100
- array: [0, "text", false]
101
- })
97
+ out: [
98
+ [
99
+ "sendWeb",
100
+ URL,
101
+ JSON.stringify({
102
+ string: "foo",
103
+ number: 1,
104
+ boolean: true,
105
+ array: [0, "text", false]
106
+ }),
107
+ { headers: void 0, method: void 0, transport: "fetch" }
108
+ ]
109
+ ]
102
110
  };
103
111
  var pageView = {
104
112
  in: le("page view", { timestamp: 1700000501 }),
105
113
  mapping: {
106
114
  data: "data"
107
115
  },
108
- out: JSON.stringify({
109
- domain: "www.example.com",
110
- title: "walkerOS documentation",
111
- referrer: "https://www.walkeros.io/",
112
- search: "?foo=bar",
113
- hash: "#hash",
114
- id: "/docs/"
115
- })
116
+ out: [
117
+ [
118
+ "sendWeb",
119
+ URL,
120
+ JSON.stringify({
121
+ domain: "www.example.com",
122
+ title: "walkerOS documentation",
123
+ referrer: "https://www.walkeros.io/",
124
+ search: "?foo=bar",
125
+ hash: "#hash",
126
+ id: "/docs/"
127
+ }),
128
+ { headers: void 0, method: void 0, transport: "fetch" }
129
+ ]
130
+ ]
116
131
  };
117
132
  var customTransform = {
118
133
  in: le("order complete", { timestamp: 1700000502 }),
@@ -129,15 +144,22 @@ var customTransform = {
129
144
  }
130
145
  }
131
146
  },
132
- out: JSON.stringify({
133
- order_id: "0rd3r1d",
134
- amount: 555,
135
- tax: 73.76,
136
- shipping_cost: 5.22,
137
- currency: "EUR",
138
- event_name: "order complete",
139
- user_id: "us3r"
140
- })
147
+ out: [
148
+ [
149
+ "sendWeb",
150
+ URL,
151
+ JSON.stringify({
152
+ order_id: "0rd3r1d",
153
+ amount: 555,
154
+ tax: 73.76,
155
+ shipping_cost: 5.22,
156
+ currency: "EUR",
157
+ event_name: "order complete",
158
+ user_id: "us3r"
159
+ }),
160
+ { headers: void 0, method: void 0, transport: "fetch" }
161
+ ]
162
+ ]
141
163
  };
142
164
  // Annotate the CommonJS export names for ESM import in node:
143
165
  0 && (module.exports = {
@@ -43,9 +43,9 @@ var c = {};
43
43
  for (var o in n) e(t, o, { get: n[o], enumerable: true });
44
44
  })(c, { Level: () => u });
45
45
  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 || {});
46
- var F = { merge: true, shallow: true, extend: true };
46
+ var W = { merge: true, shallow: true, extend: true };
47
47
  function L(e2, t = {}, n = {}) {
48
- n = { ...F, ...n };
48
+ n = { ...W, ...n };
49
49
  const o = Object.entries(t).reduce((t2, [o2, r]) => {
50
50
  const i = e2[o2];
51
51
  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;
@@ -54,7 +54,7 @@ function L(e2, t = {}, n = {}) {
54
54
  }
55
55
  function fe(e2 = {}) {
56
56
  var _a;
57
- const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ 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: "3.3.1", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
57
+ const t = e2.timestamp || (/* @__PURE__ */ new Date()).setHours(0, 13, 37, 0), n = e2.group || "gr0up", o = e2.count || 1, r = L({ 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: "3.4.0-next-1776749829492", tagging: 1 }, source: { type: "web", id: "https://localhost:80", previous_id: "http://remotehost:9001" } }, e2, { merge: false });
58
58
  if (e2.name) {
59
59
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
60
60
  t2 && n2 && (r.entity = t2, r.action = n2);
@@ -67,31 +67,46 @@ function le(e2 = "entity action", t = {}) {
67
67
  }
68
68
 
69
69
  // src/examples/step.ts
70
+ var URL = "https://api.example.com/events";
70
71
  var entityAction = {
71
72
  in: le("entity action", { timestamp: 1700000500 }),
72
73
  mapping: {
73
74
  data: "data"
74
75
  },
75
- out: JSON.stringify({
76
- string: "foo",
77
- number: 1,
78
- boolean: true,
79
- array: [0, "text", false]
80
- })
76
+ out: [
77
+ [
78
+ "sendWeb",
79
+ URL,
80
+ JSON.stringify({
81
+ string: "foo",
82
+ number: 1,
83
+ boolean: true,
84
+ array: [0, "text", false]
85
+ }),
86
+ { headers: void 0, method: void 0, transport: "fetch" }
87
+ ]
88
+ ]
81
89
  };
82
90
  var pageView = {
83
91
  in: le("page view", { timestamp: 1700000501 }),
84
92
  mapping: {
85
93
  data: "data"
86
94
  },
87
- out: JSON.stringify({
88
- domain: "www.example.com",
89
- title: "walkerOS documentation",
90
- referrer: "https://www.walkeros.io/",
91
- search: "?foo=bar",
92
- hash: "#hash",
93
- id: "/docs/"
94
- })
95
+ out: [
96
+ [
97
+ "sendWeb",
98
+ URL,
99
+ JSON.stringify({
100
+ domain: "www.example.com",
101
+ title: "walkerOS documentation",
102
+ referrer: "https://www.walkeros.io/",
103
+ search: "?foo=bar",
104
+ hash: "#hash",
105
+ id: "/docs/"
106
+ }),
107
+ { headers: void 0, method: void 0, transport: "fetch" }
108
+ ]
109
+ ]
95
110
  };
96
111
  var customTransform = {
97
112
  in: le("order complete", { timestamp: 1700000502 }),
@@ -108,15 +123,22 @@ var customTransform = {
108
123
  }
109
124
  }
110
125
  },
111
- out: JSON.stringify({
112
- order_id: "0rd3r1d",
113
- amount: 555,
114
- tax: 73.76,
115
- shipping_cost: 5.22,
116
- currency: "EUR",
117
- event_name: "order complete",
118
- user_id: "us3r"
119
- })
126
+ out: [
127
+ [
128
+ "sendWeb",
129
+ URL,
130
+ JSON.stringify({
131
+ order_id: "0rd3r1d",
132
+ amount: 555,
133
+ tax: 73.76,
134
+ shipping_cost: 5.22,
135
+ currency: "EUR",
136
+ event_name: "order complete",
137
+ user_id: "us3r"
138
+ }),
139
+ { headers: void 0, method: void 0, transport: "fetch" }
140
+ ]
141
+ ]
120
142
  };
121
143
  export {
122
144
  env_exports as env,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/web-destination-api",
4
- "version": "3.3.1",
4
+ "version": "3.4.0-next-1776749829492",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "web"
@@ -162,7 +162,7 @@
162
162
  "group": "gr0up",
163
163
  "count": 1,
164
164
  "version": {
165
- "source": "3.3.1",
165
+ "source": "3.4.0-next-1776749829492",
166
166
  "tagging": 1
167
167
  },
168
168
  "source": {
@@ -184,7 +184,16 @@
184
184
  }
185
185
  }
186
186
  },
187
- "out": "{\"order_id\":\"0rd3r1d\",\"amount\":555,\"tax\":73.76,\"shipping_cost\":5.22,\"currency\":\"EUR\",\"event_name\":\"order complete\",\"user_id\":\"us3r\"}"
187
+ "out": [
188
+ [
189
+ "sendWeb",
190
+ "https://api.example.com/events",
191
+ "{\"order_id\":\"0rd3r1d\",\"amount\":555,\"tax\":73.76,\"shipping_cost\":5.22,\"currency\":\"EUR\",\"event_name\":\"order complete\",\"user_id\":\"us3r\"}",
192
+ {
193
+ "transport": "fetch"
194
+ }
195
+ ]
196
+ ]
188
197
  },
189
198
  "entityAction": {
190
199
  "in": {
@@ -243,7 +252,7 @@
243
252
  "group": "gr0up",
244
253
  "count": 1,
245
254
  "version": {
246
- "source": "3.3.1",
255
+ "source": "3.4.0-next-1776749829492",
247
256
  "tagging": 1
248
257
  },
249
258
  "source": {
@@ -255,7 +264,16 @@
255
264
  "mapping": {
256
265
  "data": "data"
257
266
  },
258
- "out": "{\"string\":\"foo\",\"number\":1,\"boolean\":true,\"array\":[0,\"text\",false]}"
267
+ "out": [
268
+ [
269
+ "sendWeb",
270
+ "https://api.example.com/events",
271
+ "{\"string\":\"foo\",\"number\":1,\"boolean\":true,\"array\":[0,\"text\",false]}",
272
+ {
273
+ "transport": "fetch"
274
+ }
275
+ ]
276
+ ]
259
277
  },
260
278
  "pageView": {
261
279
  "in": {
@@ -312,7 +330,7 @@
312
330
  "group": "gr0up",
313
331
  "count": 1,
314
332
  "version": {
315
- "source": "3.3.1",
333
+ "source": "3.4.0-next-1776749829492",
316
334
  "tagging": 1
317
335
  },
318
336
  "source": {
@@ -324,7 +342,16 @@
324
342
  "mapping": {
325
343
  "data": "data"
326
344
  },
327
- "out": "{\"domain\":\"www.example.com\",\"title\":\"walkerOS documentation\",\"referrer\":\"https://www.walkeros.io/\",\"search\":\"?foo=bar\",\"hash\":\"#hash\",\"id\":\"/docs/\"}"
345
+ "out": [
346
+ [
347
+ "sendWeb",
348
+ "https://api.example.com/events",
349
+ "{\"domain\":\"www.example.com\",\"title\":\"walkerOS documentation\",\"referrer\":\"https://www.walkeros.io/\",\"search\":\"?foo=bar\",\"hash\":\"#hash\",\"id\":\"/docs/\"}",
350
+ {
351
+ "transport": "fetch"
352
+ }
353
+ ]
354
+ ]
328
355
  }
329
356
  }
330
357
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/web-destination-api",
3
3
  "description": "Web API destination for walkerOS",
4
- "version": "3.3.1",
4
+ "version": "3.4.0-next-1776749829492",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -37,10 +37,10 @@
37
37
  "update": "npx npm-check-updates -u && npm update"
38
38
  },
39
39
  "dependencies": {
40
- "@walkeros/web-core": "3.3.1"
40
+ "@walkeros/web-core": "3.4.0-next-1776749829492"
41
41
  },
42
42
  "devDependencies": {
43
- "@walkeros/collector": "3.3.1"
43
+ "@walkeros/collector": "3.4.0-next-1776749829492"
44
44
  },
45
45
  "repository": {
46
46
  "url": "git+https://github.com/elbwalker/walkerOS.git",