@walkeros/web-destination-amplitude 4.8.1 → 4.8.2

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.
@@ -125,7 +125,8 @@ var MockRevenue = class {
125
125
  };
126
126
  var init = {
127
127
  amplitude: {
128
- initAll: () => Promise.resolve(),
128
+ init: noopPromise,
129
+ add: noopPromise,
129
130
  track: noop,
130
131
  identify: noop,
131
132
  revenue: noop,
@@ -136,15 +137,14 @@ var init = {
136
137
  setSessionId: noop,
137
138
  setGroup: noop,
138
139
  groupIdentify: noop,
139
- flush: noopPromise,
140
- add: noopPromise,
141
140
  Identify: MockIdentify,
142
141
  Revenue: MockRevenue
143
142
  }
144
143
  };
145
144
  var push = {
146
145
  amplitude: {
147
- initAll: () => Promise.resolve(),
146
+ init: noopPromise,
147
+ add: noopPromise,
148
148
  track: noop,
149
149
  identify: noop,
150
150
  revenue: noop,
@@ -155,14 +155,13 @@ var push = {
155
155
  setSessionId: noop,
156
156
  setGroup: noop,
157
157
  groupIdentify: noop,
158
- flush: noopPromise,
159
- add: noopPromise,
160
158
  Identify: MockIdentify,
161
159
  Revenue: MockRevenue
162
160
  }
163
161
  };
164
162
  var simulation = [
165
- "call:amplitude.initAll",
163
+ "call:amplitude.init",
164
+ "call:amplitude.add",
166
165
  "call:amplitude.track",
167
166
  "call:amplitude.identify",
168
167
  "call:amplitude.revenue",
@@ -184,8 +183,10 @@ __export(step_exports, {
184
183
  destinationLevelIdentify: () => destinationLevelIdentify,
185
184
  destinationLevelInclude: () => destinationLevelInclude,
186
185
  groupAssignmentWithProperties: () => groupAssignmentWithProperties,
186
+ groupAssignmentWithoutData: () => groupAssignmentWithoutData,
187
187
  orderCompleteMultiProduct: () => orderCompleteMultiProduct,
188
188
  ruleIncludeReplaces: () => ruleIncludeReplaces,
189
+ silentRule: () => silentRule,
189
190
  subscriptionRenewRevenue: () => subscriptionRenewRevenue,
190
191
  userLoginIdentify: () => userLoginIdentify,
191
192
  userLogoutReset: () => userLogoutReset,
@@ -200,7 +201,7 @@ var defaultEventForwarding = {
200
201
  };
201
202
  var wildcardIgnored = {
202
203
  public: false,
203
- in: (0, import_core.getEvent)("debug noise", { timestamp: 1700000101 }),
204
+ in: (0, import_core.createEvent)({ name: "debug noise", timestamp: 1700000101 }),
204
205
  mapping: { ignore: true },
205
206
  out: []
206
207
  };
@@ -264,7 +265,8 @@ var destinationLevelIdentify = {
264
265
  var userLoginIdentify = {
265
266
  title: "User login identify",
266
267
  description: "A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.",
267
- in: (0, import_core.getEvent)("user login", {
268
+ in: (0, import_core.createEvent)({
269
+ name: "user login",
268
270
  timestamp: 1700000105e3,
269
271
  data: {
270
272
  user_id: "new-user-123",
@@ -323,7 +325,7 @@ var userLoginIdentify = {
323
325
  var userLogoutReset = {
324
326
  title: "User logout reset",
325
327
  description: "A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.",
326
- in: (0, import_core.getEvent)("user logout", { timestamp: 1700000106 }),
328
+ in: (0, import_core.createEvent)({ name: "user logout", timestamp: 1700000106 }),
327
329
  mapping: {
328
330
  silent: true,
329
331
  settings: {
@@ -335,7 +337,8 @@ var userLogoutReset = {
335
337
  var subscriptionRenewRevenue = {
336
338
  title: "Subscription revenue",
337
339
  description: "A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.",
338
- in: (0, import_core.getEvent)("subscription renew", {
340
+ in: (0, import_core.createEvent)({
341
+ name: "subscription renew",
339
342
  timestamp: 1700000107,
340
343
  data: {
341
344
  plan_id: "plan-pro",
@@ -425,7 +428,7 @@ var orderCompleteMultiProduct = {
425
428
  data_currency: "EUR",
426
429
  data_shipping: 5.22,
427
430
  data_taxes: 73.76,
428
- data_total: 555,
431
+ data_value: 555,
429
432
  globals_pagegroup: "shop"
430
433
  }
431
434
  ]
@@ -434,7 +437,8 @@ var orderCompleteMultiProduct = {
434
437
  var groupAssignmentWithProperties = {
435
438
  title: "Group assignment",
436
439
  description: "A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.",
437
- in: (0, import_core.getEvent)("company update", {
440
+ in: (0, import_core.createEvent)({
441
+ name: "company update",
438
442
  timestamp: 1700000109,
439
443
  data: {
440
444
  company: "Acme",
@@ -509,6 +513,20 @@ var consentGrantOptIn = {
509
513
  settings: {},
510
514
  out: [["amplitude.setOptOut", false]]
511
515
  };
516
+ var silentRule = {
517
+ public: false,
518
+ description: "A rule with silent: true and no settings calls nothing.",
519
+ in: (0, import_core.getEvent)("page view", { timestamp: 1700000120 }),
520
+ mapping: { silent: true },
521
+ out: []
522
+ };
523
+ var groupAssignmentWithoutData = {
524
+ public: false,
525
+ description: "A silent rule whose group mapping finds no company sends nothing: an unmet mapping, not a failure, so the push returns normally.",
526
+ in: { name: "company update", entity: "company", action: "update" },
527
+ mapping: groupAssignmentWithProperties.mapping,
528
+ out: []
529
+ };
512
530
  // Annotate the CommonJS export names for ESM import in node:
513
531
  0 && (module.exports = {
514
532
  env,
@@ -104,7 +104,8 @@ var MockRevenue = class {
104
104
  };
105
105
  var init = {
106
106
  amplitude: {
107
- initAll: () => Promise.resolve(),
107
+ init: noopPromise,
108
+ add: noopPromise,
108
109
  track: noop,
109
110
  identify: noop,
110
111
  revenue: noop,
@@ -115,15 +116,14 @@ var init = {
115
116
  setSessionId: noop,
116
117
  setGroup: noop,
117
118
  groupIdentify: noop,
118
- flush: noopPromise,
119
- add: noopPromise,
120
119
  Identify: MockIdentify,
121
120
  Revenue: MockRevenue
122
121
  }
123
122
  };
124
123
  var push = {
125
124
  amplitude: {
126
- initAll: () => Promise.resolve(),
125
+ init: noopPromise,
126
+ add: noopPromise,
127
127
  track: noop,
128
128
  identify: noop,
129
129
  revenue: noop,
@@ -134,14 +134,13 @@ var push = {
134
134
  setSessionId: noop,
135
135
  setGroup: noop,
136
136
  groupIdentify: noop,
137
- flush: noopPromise,
138
- add: noopPromise,
139
137
  Identify: MockIdentify,
140
138
  Revenue: MockRevenue
141
139
  }
142
140
  };
143
141
  var simulation = [
144
- "call:amplitude.initAll",
142
+ "call:amplitude.init",
143
+ "call:amplitude.add",
145
144
  "call:amplitude.track",
146
145
  "call:amplitude.identify",
147
146
  "call:amplitude.revenue",
@@ -163,14 +162,16 @@ __export(step_exports, {
163
162
  destinationLevelIdentify: () => destinationLevelIdentify,
164
163
  destinationLevelInclude: () => destinationLevelInclude,
165
164
  groupAssignmentWithProperties: () => groupAssignmentWithProperties,
165
+ groupAssignmentWithoutData: () => groupAssignmentWithoutData,
166
166
  orderCompleteMultiProduct: () => orderCompleteMultiProduct,
167
167
  ruleIncludeReplaces: () => ruleIncludeReplaces,
168
+ silentRule: () => silentRule,
168
169
  subscriptionRenewRevenue: () => subscriptionRenewRevenue,
169
170
  userLoginIdentify: () => userLoginIdentify,
170
171
  userLogoutReset: () => userLogoutReset,
171
172
  wildcardIgnored: () => wildcardIgnored
172
173
  });
173
- import { getEvent } from "@walkeros/core";
174
+ import { createEvent, getEvent } from "@walkeros/core";
174
175
  var defaultEventForwarding = {
175
176
  title: "Default track",
176
177
  description: "A walker event is forwarded to Amplitude as an amplitude.track call with the event name and empty properties.",
@@ -179,7 +180,7 @@ var defaultEventForwarding = {
179
180
  };
180
181
  var wildcardIgnored = {
181
182
  public: false,
182
- in: getEvent("debug noise", { timestamp: 1700000101 }),
183
+ in: createEvent({ name: "debug noise", timestamp: 1700000101 }),
183
184
  mapping: { ignore: true },
184
185
  out: []
185
186
  };
@@ -243,7 +244,8 @@ var destinationLevelIdentify = {
243
244
  var userLoginIdentify = {
244
245
  title: "User login identify",
245
246
  description: "A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.",
246
- in: getEvent("user login", {
247
+ in: createEvent({
248
+ name: "user login",
247
249
  timestamp: 1700000105e3,
248
250
  data: {
249
251
  user_id: "new-user-123",
@@ -302,7 +304,7 @@ var userLoginIdentify = {
302
304
  var userLogoutReset = {
303
305
  title: "User logout reset",
304
306
  description: "A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.",
305
- in: getEvent("user logout", { timestamp: 1700000106 }),
307
+ in: createEvent({ name: "user logout", timestamp: 1700000106 }),
306
308
  mapping: {
307
309
  silent: true,
308
310
  settings: {
@@ -314,7 +316,8 @@ var userLogoutReset = {
314
316
  var subscriptionRenewRevenue = {
315
317
  title: "Subscription revenue",
316
318
  description: "A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.",
317
- in: getEvent("subscription renew", {
319
+ in: createEvent({
320
+ name: "subscription renew",
318
321
  timestamp: 1700000107,
319
322
  data: {
320
323
  plan_id: "plan-pro",
@@ -404,7 +407,7 @@ var orderCompleteMultiProduct = {
404
407
  data_currency: "EUR",
405
408
  data_shipping: 5.22,
406
409
  data_taxes: 73.76,
407
- data_total: 555,
410
+ data_value: 555,
408
411
  globals_pagegroup: "shop"
409
412
  }
410
413
  ]
@@ -413,7 +416,8 @@ var orderCompleteMultiProduct = {
413
416
  var groupAssignmentWithProperties = {
414
417
  title: "Group assignment",
415
418
  description: "A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.",
416
- in: getEvent("company update", {
419
+ in: createEvent({
420
+ name: "company update",
417
421
  timestamp: 1700000109,
418
422
  data: {
419
423
  company: "Acme",
@@ -488,6 +492,20 @@ var consentGrantOptIn = {
488
492
  settings: {},
489
493
  out: [["amplitude.setOptOut", false]]
490
494
  };
495
+ var silentRule = {
496
+ public: false,
497
+ description: "A rule with silent: true and no settings calls nothing.",
498
+ in: getEvent("page view", { timestamp: 1700000120 }),
499
+ mapping: { silent: true },
500
+ out: []
501
+ };
502
+ var groupAssignmentWithoutData = {
503
+ public: false,
504
+ description: "A silent rule whose group mapping finds no company sends nothing: an unmet mapping, not a failure, so the push returns normally.",
505
+ in: { name: "company update", entity: "company", action: "update" },
506
+ mapping: groupAssignmentWithProperties.mapping,
507
+ out: []
508
+ };
491
509
  export {
492
510
  env_exports as env,
493
511
  step_exports as step