@walkeros/web-destination-segment 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.
@@ -98,16 +98,15 @@ interface Env extends DestinationWeb.Env {
98
98
  analytics?: SegmentSDK;
99
99
  }
100
100
 
101
- declare const init: Env | undefined;
101
+ declare const init$1: Env | undefined;
102
102
  declare const push: Env;
103
103
  /** Simulation tracking paths for CLI --simulate. */
104
104
  declare const simulation: string[];
105
105
 
106
- declare const env_init: typeof init;
107
106
  declare const env_push: typeof push;
108
107
  declare const env_simulation: typeof simulation;
109
108
  declare namespace env {
110
- export { env_init as init, env_push as push, env_simulation as simulation };
109
+ export { init$1 as init, env_push as push, env_simulation as simulation };
111
110
  }
112
111
 
113
112
  /**
@@ -118,6 +117,13 @@ type SegmentStepExample = Flow.StepExample & {
118
117
  settings?: Partial<Settings>;
119
118
  configInclude?: string[];
120
119
  };
120
+ /**
121
+ * Destination bootstrap.
122
+ * Given the canonical apiKey setting, init calls analytics.load() with the
123
+ * Segment writeKey and the walkerOS defaults (initialPageview: false).
124
+ * Reproduce by passing the same settings as the destination config.
125
+ */
126
+ declare const init: Flow.StepExample;
121
127
  /**
122
128
  * Default event forwarding — every walkerOS event becomes
123
129
  * analytics.track(event.name, properties). With no mapping and no
@@ -219,6 +225,7 @@ declare const step_consentRevokeNoOp: typeof consentRevokeNoOp;
219
225
  declare const step_defaultEventForwarding: typeof defaultEventForwarding;
220
226
  declare const step_destinationLevelIdentify: typeof destinationLevelIdentify;
221
227
  declare const step_destinationLevelInclude: typeof destinationLevelInclude;
228
+ declare const step_init: typeof init;
222
229
  declare const step_orderCompletedEcommerce: typeof orderCompletedEcommerce;
223
230
  declare const step_pageViewAsPage: typeof pageViewAsPage;
224
231
  declare const step_pageViewMinimal: typeof pageViewMinimal;
@@ -228,7 +235,7 @@ declare const step_userLoginIdentify: typeof userLoginIdentify;
228
235
  declare const step_userLogoutReset: typeof userLogoutReset;
229
236
  declare const step_wildcardIgnored: typeof wildcardIgnored;
230
237
  declare namespace step {
231
- export { type step_SegmentStepExample as SegmentStepExample, step_companyUpdateGroup as companyUpdateGroup, step_consentContextForwarded as consentContextForwarded, step_consentGrantDeferredLoad as consentGrantDeferredLoad, step_consentRevokeNoOp as consentRevokeNoOp, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_orderCompletedEcommerce as orderCompletedEcommerce, step_pageViewAsPage as pageViewAsPage, step_pageViewMinimal as pageViewMinimal, step_profileUpdateTraitsOnly as profileUpdateTraitsOnly, step_ruleIncludeReplaces as ruleIncludeReplaces, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
238
+ export { type step_SegmentStepExample as SegmentStepExample, step_companyUpdateGroup as companyUpdateGroup, step_consentContextForwarded as consentContextForwarded, step_consentGrantDeferredLoad as consentGrantDeferredLoad, step_consentRevokeNoOp as consentRevokeNoOp, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_init as init, step_orderCompletedEcommerce as orderCompletedEcommerce, step_pageViewAsPage as pageViewAsPage, step_pageViewMinimal as pageViewMinimal, step_profileUpdateTraitsOnly as profileUpdateTraitsOnly, step_ruleIncludeReplaces as ruleIncludeReplaces, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
232
239
  }
233
240
 
234
241
  export { env, step };
@@ -98,16 +98,15 @@ interface Env extends DestinationWeb.Env {
98
98
  analytics?: SegmentSDK;
99
99
  }
100
100
 
101
- declare const init: Env | undefined;
101
+ declare const init$1: Env | undefined;
102
102
  declare const push: Env;
103
103
  /** Simulation tracking paths for CLI --simulate. */
104
104
  declare const simulation: string[];
105
105
 
106
- declare const env_init: typeof init;
107
106
  declare const env_push: typeof push;
108
107
  declare const env_simulation: typeof simulation;
109
108
  declare namespace env {
110
- export { env_init as init, env_push as push, env_simulation as simulation };
109
+ export { init$1 as init, env_push as push, env_simulation as simulation };
111
110
  }
112
111
 
113
112
  /**
@@ -118,6 +117,13 @@ type SegmentStepExample = Flow.StepExample & {
118
117
  settings?: Partial<Settings>;
119
118
  configInclude?: string[];
120
119
  };
120
+ /**
121
+ * Destination bootstrap.
122
+ * Given the canonical apiKey setting, init calls analytics.load() with the
123
+ * Segment writeKey and the walkerOS defaults (initialPageview: false).
124
+ * Reproduce by passing the same settings as the destination config.
125
+ */
126
+ declare const init: Flow.StepExample;
121
127
  /**
122
128
  * Default event forwarding — every walkerOS event becomes
123
129
  * analytics.track(event.name, properties). With no mapping and no
@@ -219,6 +225,7 @@ declare const step_consentRevokeNoOp: typeof consentRevokeNoOp;
219
225
  declare const step_defaultEventForwarding: typeof defaultEventForwarding;
220
226
  declare const step_destinationLevelIdentify: typeof destinationLevelIdentify;
221
227
  declare const step_destinationLevelInclude: typeof destinationLevelInclude;
228
+ declare const step_init: typeof init;
222
229
  declare const step_orderCompletedEcommerce: typeof orderCompletedEcommerce;
223
230
  declare const step_pageViewAsPage: typeof pageViewAsPage;
224
231
  declare const step_pageViewMinimal: typeof pageViewMinimal;
@@ -228,7 +235,7 @@ declare const step_userLoginIdentify: typeof userLoginIdentify;
228
235
  declare const step_userLogoutReset: typeof userLogoutReset;
229
236
  declare const step_wildcardIgnored: typeof wildcardIgnored;
230
237
  declare namespace step {
231
- export { type step_SegmentStepExample as SegmentStepExample, step_companyUpdateGroup as companyUpdateGroup, step_consentContextForwarded as consentContextForwarded, step_consentGrantDeferredLoad as consentGrantDeferredLoad, step_consentRevokeNoOp as consentRevokeNoOp, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_orderCompletedEcommerce as orderCompletedEcommerce, step_pageViewAsPage as pageViewAsPage, step_pageViewMinimal as pageViewMinimal, step_profileUpdateTraitsOnly as profileUpdateTraitsOnly, step_ruleIncludeReplaces as ruleIncludeReplaces, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
238
+ export { type step_SegmentStepExample as SegmentStepExample, step_companyUpdateGroup as companyUpdateGroup, step_consentContextForwarded as consentContextForwarded, step_consentGrantDeferredLoad as consentGrantDeferredLoad, step_consentRevokeNoOp as consentRevokeNoOp, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_init as init, step_orderCompletedEcommerce as orderCompletedEcommerce, step_pageViewAsPage as pageViewAsPage, step_pageViewMinimal as pageViewMinimal, step_profileUpdateTraitsOnly as profileUpdateTraitsOnly, step_ruleIncludeReplaces as ruleIncludeReplaces, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
232
239
  }
233
240
 
234
241
  export { env, step };
@@ -77,6 +77,7 @@ __export(step_exports, {
77
77
  defaultEventForwarding: () => defaultEventForwarding,
78
78
  destinationLevelIdentify: () => destinationLevelIdentify,
79
79
  destinationLevelInclude: () => destinationLevelInclude,
80
+ init: () => init2,
80
81
  orderCompletedEcommerce: () => orderCompletedEcommerce,
81
82
  pageViewAsPage: () => pageViewAsPage,
82
83
  pageViewMinimal: () => pageViewMinimal,
@@ -94,9 +95,9 @@ var c = {};
94
95
  for (var o in n) e(t, o, { get: n[o], enumerable: true });
95
96
  })(c, { Level: () => u });
96
97
  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 || {});
97
- var F = { merge: true, shallow: true, extend: true };
98
+ var W = { merge: true, shallow: true, extend: true };
98
99
  function L(e2, t = {}, n = {}) {
99
- n = { ...F, ...n };
100
+ n = { ...W, ...n };
100
101
  const o = Object.entries(t).reduce((t2, [o2, r]) => {
101
102
  const i = e2[o2];
102
103
  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;
@@ -105,7 +106,7 @@ function L(e2, t = {}, n = {}) {
105
106
  }
106
107
  function fe(e2 = {}) {
107
108
  var _a;
108
- 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 });
109
+ 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 });
109
110
  if (e2.name) {
110
111
  const [t2, n2] = (_a = e2.name.split(" ")) != null ? _a : [];
111
112
  t2 && n2 && (r.entity = t2, r.action = n2);
@@ -118,9 +119,23 @@ function le(e2 = "entity action", t = {}) {
118
119
  }
119
120
 
120
121
  // src/examples/step.ts
122
+ var init2 = {
123
+ in: {
124
+ settings: {
125
+ apiKey: "test-project"
126
+ }
127
+ },
128
+ out: [
129
+ [
130
+ "analytics.load",
131
+ { writeKey: "test-project" },
132
+ { initialPageview: false }
133
+ ]
134
+ ]
135
+ };
121
136
  var defaultEventForwarding = {
122
137
  in: le("product view", { timestamp: 1700000100 }),
123
- out: ["analytics.track", "product view", {}]
138
+ out: [["analytics.track", "product view", {}]]
124
139
  };
125
140
  var wildcardIgnored = {
126
141
  in: le("debug noise", { timestamp: 1700000101 }),
@@ -131,15 +146,17 @@ var destinationLevelInclude = {
131
146
  in: le("product view", { timestamp: 1700000102 }),
132
147
  configInclude: ["data"],
133
148
  out: [
134
- "analytics.track",
135
- "product view",
136
- {
137
- data_id: "ers",
138
- data_name: "Everyday Ruck Snack",
139
- data_color: "black",
140
- data_size: "l",
141
- data_price: 420
142
- }
149
+ [
150
+ "analytics.track",
151
+ "product view",
152
+ {
153
+ data_id: "ers",
154
+ data_name: "Everyday Ruck Snack",
155
+ data_color: "black",
156
+ data_size: "l",
157
+ data_price: 420
158
+ }
159
+ ]
143
160
  ]
144
161
  };
145
162
  var ruleIncludeReplaces = {
@@ -149,11 +166,13 @@ var ruleIncludeReplaces = {
149
166
  include: ["globals"]
150
167
  },
151
168
  out: [
152
- "analytics.track",
153
- "order complete",
154
- {
155
- globals_pagegroup: "shop"
156
- }
169
+ [
170
+ "analytics.track",
171
+ "order complete",
172
+ {
173
+ globals_pagegroup: "shop"
174
+ }
175
+ ]
157
176
  ]
158
177
  };
159
178
  var destinationLevelIdentify = {
@@ -206,14 +225,16 @@ var userLoginIdentify = {
206
225
  }
207
226
  },
208
227
  out: [
209
- "analytics.identify",
210
- "new-user-123",
211
- {
212
- email: "user@acme.com",
213
- name: "Jane Doe",
214
- plan: "premium",
215
- company: { name: "Acme", id: "comp-456" }
216
- }
228
+ [
229
+ "analytics.identify",
230
+ "new-user-123",
231
+ {
232
+ email: "user@acme.com",
233
+ name: "Jane Doe",
234
+ plan: "premium",
235
+ company: { name: "Acme", id: "comp-456" }
236
+ }
237
+ ]
217
238
  ]
218
239
  };
219
240
  var profileUpdateTraitsOnly = {
@@ -242,13 +263,15 @@ var profileUpdateTraitsOnly = {
242
263
  }
243
264
  },
244
265
  out: [
245
- "analytics.identify",
246
- void 0,
247
- {
248
- name: "Jane Q. Doe",
249
- avatar: "https://example.com/avatar.png",
250
- phone: "+1234567890"
251
- }
266
+ [
267
+ "analytics.identify",
268
+ void 0,
269
+ {
270
+ name: "Jane Q. Doe",
271
+ avatar: "https://example.com/avatar.png",
272
+ phone: "+1234567890"
273
+ }
274
+ ]
252
275
  ]
253
276
  };
254
277
  var userLogoutReset = {
@@ -259,7 +282,7 @@ var userLogoutReset = {
259
282
  reset: true
260
283
  }
261
284
  },
262
- out: ["analytics.reset"]
285
+ out: [["analytics.reset"]]
263
286
  };
264
287
  var companyUpdateGroup = {
265
288
  in: le("company update", {
@@ -291,14 +314,16 @@ var companyUpdateGroup = {
291
314
  }
292
315
  },
293
316
  out: [
294
- "analytics.group",
295
- "comp-456",
296
- {
297
- name: "Acme",
298
- industry: "tech",
299
- employees: 50,
300
- plan: "enterprise"
301
- }
317
+ [
318
+ "analytics.group",
319
+ "comp-456",
320
+ {
321
+ name: "Acme",
322
+ industry: "tech",
323
+ employees: 50,
324
+ plan: "enterprise"
325
+ }
326
+ ]
302
327
  ]
303
328
  };
304
329
  var pageViewAsPage = {
@@ -327,12 +352,14 @@ var pageViewAsPage = {
327
352
  }
328
353
  },
329
354
  out: [
330
- "analytics.page",
331
- "docs",
332
- "Getting Started",
333
- {
334
- section: "tutorials"
335
- }
355
+ [
356
+ "analytics.page",
357
+ "docs",
358
+ "Getting Started",
359
+ {
360
+ section: "tutorials"
361
+ }
362
+ ]
336
363
  ]
337
364
  };
338
365
  var pageViewMinimal = {
@@ -343,7 +370,7 @@ var pageViewMinimal = {
343
370
  page: true
344
371
  }
345
372
  },
346
- out: ["analytics.page"]
373
+ out: [["analytics.page"]]
347
374
  };
348
375
  var orderCompletedEcommerce = {
349
376
  in: le("order complete", { timestamp: 1700000111 }),
@@ -379,31 +406,33 @@ var orderCompletedEcommerce = {
379
406
  }
380
407
  },
381
408
  out: [
382
- "analytics.track",
383
- "Order Completed",
384
- {
385
- order_id: "0rd3r1d",
386
- currency: "EUR",
387
- shipping: 5.22,
388
- tax: 73.76,
389
- total: 555,
390
- products: [
391
- {
392
- product_id: "ers",
393
- name: "Everyday Ruck Snack",
394
- price: 420,
395
- quantity: 1,
396
- currency: "EUR"
397
- },
398
- {
399
- product_id: "cc",
400
- name: "Cool Cap",
401
- price: 42,
402
- quantity: 1,
403
- currency: "EUR"
404
- }
405
- ]
406
- }
409
+ [
410
+ "analytics.track",
411
+ "Order Completed",
412
+ {
413
+ order_id: "0rd3r1d",
414
+ currency: "EUR",
415
+ shipping: 5.22,
416
+ tax: 73.76,
417
+ total: 555,
418
+ products: [
419
+ {
420
+ product_id: "ers",
421
+ name: "Everyday Ruck Snack",
422
+ price: 420,
423
+ quantity: 1,
424
+ currency: "EUR"
425
+ },
426
+ {
427
+ product_id: "cc",
428
+ name: "Cool Cap",
429
+ price: 42,
430
+ quantity: 1,
431
+ currency: "EUR"
432
+ }
433
+ ]
434
+ }
435
+ ]
407
436
  ]
408
437
  };
409
438
  var consentContextForwarded = {
@@ -418,28 +447,32 @@ var consentContextForwarded = {
418
447
  }
419
448
  },
420
449
  out: [
421
- "analytics.track",
422
- "product view",
423
- {},
424
- {
425
- context: {
426
- consent: {
427
- categoryPreferences: {
428
- Analytics: true,
429
- Advertising: true
450
+ [
451
+ "analytics.track",
452
+ "product view",
453
+ {},
454
+ {
455
+ context: {
456
+ consent: {
457
+ categoryPreferences: {
458
+ Analytics: true,
459
+ Advertising: true
460
+ }
430
461
  }
431
462
  }
432
463
  }
433
- }
464
+ ]
434
465
  ]
435
466
  };
436
467
  var consentGrantDeferredLoad = {
437
468
  command: "consent",
438
469
  in: { analytics: true },
439
470
  out: [
440
- "analytics.load",
441
- { writeKey: "test-project" },
442
- { initialPageview: false }
471
+ [
472
+ "analytics.load",
473
+ { writeKey: "test-project" },
474
+ { initialPageview: false }
475
+ ]
443
476
  ]
444
477
  };
445
478
  var consentRevokeNoOp = {