@walkeros/web-destination-amplitude 4.8.1-next-1792019907609 → 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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,52 @@
1
1
  # @walkeros/web-destination-amplitude
2
2
 
3
- ## 4.8.1-next-1792019907609
3
+ ## 4.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - b1d65e2: Amplitude loads each plugin package only when that plugin is enabled.
8
+ The package now imports cleanly under Node and tsx, so simulation and tooling
9
+ no longer fail on a browser-only plugin that the flow never uses.
10
+ - 2374f54: Without Session Replay, Experiment or Guides & Surveys settings only
11
+ Amplitude analytics starts; enabling one still starts all three. Options now
12
+ reach the SDK (`autocapture: false` was lost before). A missing `apiKey` is a
13
+ `config` error and a failed init is retried by the next push.
14
+ - 7e5fc27: A silent rule whose identify, group or similar mapping resolves to
15
+ nothing sends nothing, counts as delivered and writes one DEBUG line naming
16
+ the call and mapping key, never the value. An identity or group that is
17
+ already current writes nothing.
18
+ - 7e5fc27: Settings accept SDK options that the schema does not list and pass
19
+ them through to the SDK, so a newer SDK option no longer fails validation.
20
+ Amplitude events from a setup with plugins no longer carry the
21
+ `amplitude-ts-unified` library prefix.
22
+ - 2374f54: A failed vendor call, a missing required setting (`config`) and an
23
+ event that cannot be sent (`missing-input`) are reported as failed pushes,
24
+ with the dead-letter queue and one ERROR line, instead of counting as
25
+ delivered. Rules with `silent: true` send no event. Settings schemas reject
26
+ unknown keys.
27
+ - Updated dependencies [2374f54]
28
+ - Updated dependencies [7e5fc27]
29
+ - Updated dependencies [2374f54]
30
+ - Updated dependencies [964590a]
31
+ - Updated dependencies [4100ede]
32
+ - Updated dependencies [2374f54]
33
+ - Updated dependencies [2374f54]
34
+ - Updated dependencies [15eb7b2]
35
+ - Updated dependencies [33a2779]
36
+ - Updated dependencies [33a2779]
37
+ - Updated dependencies [b1d65e2]
38
+ - Updated dependencies [964590a]
39
+ - Updated dependencies [2374f54]
40
+ - @walkeros/core@4.8.2
41
+ - @walkeros/web-core@4.8.2
42
+
43
+ ## 4.8.1
4
44
 
5
45
  ### Patch Changes
6
46
 
7
47
  - Updated dependencies [1062e99]
8
- - @walkeros/core@4.8.1-next-1792019907609
9
- - @walkeros/web-core@4.8.1-next-1792019907609
48
+ - @walkeros/core@4.8.1
49
+ - @walkeros/web-core@4.8.1
10
50
 
11
51
  ## 4.8.0
12
52
 
package/README.md CHANGED
@@ -45,6 +45,13 @@ npm install @walkeros/web-destination-amplitude
45
45
  }
46
46
  ```
47
47
 
48
+ ## Plugins
49
+
50
+ With only `apiKey` and the analytics options, only Amplitude analytics starts.
51
+ Each plugin starts only from its own setting: `sessionReplay` starts Session
52
+ Replay, `experiment` with a `deploymentKey` starts Experiment, and `engagement`
53
+ starts Guides & Surveys, which loads its SDK from cdn.amplitude.com.
54
+
48
55
  ## Documentation
49
56
 
50
57
  Full configuration, mapping, and examples live in the docs:
package/dist/dev.d.mts CHANGED
@@ -27,7 +27,7 @@ declare const SettingsSchema: z.ZodObject<{
27
27
  sessionReplay: z.ZodOptional<z.ZodUnknown>;
28
28
  experiment: z.ZodOptional<z.ZodUnknown>;
29
29
  engagement: z.ZodOptional<z.ZodUnknown>;
30
- }, z.core.$strip>;
30
+ }, z.core.$loose>;
31
31
  type Settings$1 = z.infer<typeof SettingsSchema>;
32
32
 
33
33
  declare const MappingSchema: z.ZodObject<{
@@ -52,6 +52,8 @@ declare namespace index$1 {
52
52
  }
53
53
 
54
54
  type BrowserOptions = Omit<Types.BrowserOptions, 'identify'>;
55
+ type AmplitudeBrowserOptions = Types.BrowserOptions;
56
+ type AmplitudePlugin = Types.Plugin;
55
57
  /**
56
58
  * Destination-level settings.
57
59
  *
@@ -83,55 +85,53 @@ interface RuntimeState {
83
85
  };
84
86
  }
85
87
  /**
86
- * Amplitude SDK surface — the subset of @amplitude/unified the
87
- * destination actually uses. Mirrors the real module's named exports so
88
- * tests can mock each method individually via env.amplitude.
88
+ * Amplitude SDK surface: the subset of @amplitude/unified the
89
+ * destination actually uses. Mirrors the real client's methods so tests can
90
+ * mock each one via env.amplitude. Generic over the Identify and Revenue
91
+ * instances, so the real SDK gets back the instances it created.
89
92
  */
90
- interface AmplitudeSDK {
91
- initAll: (apiKey: string, options?: Record<string, unknown>) => Promise<void>;
92
- track: (eventType: string, eventProperties?: Record<string, unknown>) => void;
93
- identify: (identify: IdentifyInstance) => void;
94
- revenue: (revenue: RevenueInstance) => void;
95
- reset: () => void;
96
- setOptOut: (optOut: boolean) => void;
97
- setUserId: (userId: string | undefined) => void;
98
- setDeviceId: (deviceId: string) => void;
99
- setSessionId: (sessionId: number) => void;
100
- setGroup: (groupType: string, groupName: string | string[]) => void;
101
- groupIdentify: (groupType: string, groupName: string, identify: IdentifyInstance) => void;
102
- flush: () => {
103
- promise: Promise<void>;
104
- };
105
- add: (plugin: unknown) => {
106
- promise: Promise<void>;
107
- };
108
- Identify: new () => IdentifyInstance;
109
- Revenue: new () => RevenueInstance;
93
+ interface AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> {
94
+ /** Analytics. */
95
+ init: (apiKey: string, options?: AmplitudeBrowserOptions) => unknown;
96
+ /** One plugin: Session Replay, Experiment or Guides & Surveys. */
97
+ add: (plugin: AmplitudePlugin) => unknown;
98
+ track: (eventType: string, eventProperties?: Record<string, unknown>) => unknown;
99
+ identify: (identify: I) => unknown;
100
+ revenue: (revenue: R) => unknown;
101
+ reset: () => unknown;
102
+ setOptOut: (optOut: boolean) => unknown;
103
+ setUserId: (userId: string | undefined) => unknown;
104
+ setDeviceId: (deviceId: string) => unknown;
105
+ setSessionId: (sessionId: number) => unknown;
106
+ setGroup: (groupType: string, groupName: string | string[]) => unknown;
107
+ groupIdentify: (groupType: string, groupName: string, identify: I) => unknown;
108
+ Identify: new () => I;
109
+ Revenue: new () => R;
110
110
  }
111
- /** Chainable Identify — mirrors @amplitude/unified Identify class. */
111
+ /** Chainable Identify, as the @amplitude/unified Identify class. */
112
112
  interface IdentifyInstance {
113
- set: (property: string, value: unknown) => IdentifyInstance;
114
- setOnce: (property: string, value: unknown) => IdentifyInstance;
115
- add: (property: string, value: number) => IdentifyInstance;
116
- append: (property: string, value: unknown) => IdentifyInstance;
117
- prepend: (property: string, value: unknown) => IdentifyInstance;
118
- preInsert: (property: string, value: unknown) => IdentifyInstance;
119
- postInsert: (property: string, value: unknown) => IdentifyInstance;
120
- remove: (property: string, value: unknown) => IdentifyInstance;
121
- unset: (property: string) => IdentifyInstance;
122
- clearAll: () => IdentifyInstance;
113
+ set(property: string, value: unknown): IdentifyInstance;
114
+ setOnce(property: string, value: unknown): IdentifyInstance;
115
+ add(property: string, value: number): IdentifyInstance;
116
+ append(property: string, value: unknown): IdentifyInstance;
117
+ prepend(property: string, value: unknown): IdentifyInstance;
118
+ preInsert(property: string, value: unknown): IdentifyInstance;
119
+ postInsert(property: string, value: unknown): IdentifyInstance;
120
+ remove(property: string, value: unknown): IdentifyInstance;
121
+ unset(property: string): IdentifyInstance;
122
+ clearAll(): IdentifyInstance;
123
123
  }
124
- /** Chainable Revenue — mirrors @amplitude/unified Revenue class. */
124
+ /** Chainable Revenue, as the @amplitude/unified Revenue class. */
125
125
  interface RevenueInstance {
126
- setProductId: (id: string) => RevenueInstance;
127
- setPrice: (price: number) => RevenueInstance;
128
- setQuantity: (quantity: number) => RevenueInstance;
129
- setRevenueType: (type: string) => RevenueInstance;
130
- setCurrency: (currency: string) => RevenueInstance;
131
- setRevenue: (revenue: number) => RevenueInstance;
132
- setReceipt: (receipt: string) => RevenueInstance;
133
- setReceiptSig: (signature: string) => RevenueInstance;
134
- setEventProperties: (properties: Record<string, unknown>) => RevenueInstance;
126
+ setProductId(id: string): RevenueInstance;
127
+ setPrice(price: number): RevenueInstance;
128
+ setQuantity(quantity: number): RevenueInstance;
129
+ setRevenueType(type: string): RevenueInstance;
130
+ setCurrency(currency: string): RevenueInstance;
131
+ setRevenue(revenue: number): RevenueInstance;
132
+ setReceipt(receipt: string): RevenueInstance;
133
+ setReceiptSig(signature: string): RevenueInstance;
134
+ setEventProperties(properties: Record<string, unknown>): RevenueInstance;
135
135
  }
136
136
  /**
137
137
  * Env — optional SDK override. Production leaves this undefined and the
@@ -264,6 +264,14 @@ declare const consentRevokeOptOut: AmplitudeStepExample;
264
264
  * Consent granted → amplitude.setOptOut(false).
265
265
  */
266
266
  declare const consentGrantOptIn: AmplitudeStepExample;
267
+ /** A silent rule without settings of its own calls nothing. */
268
+ declare const silentRule: AmplitudeStepExample;
269
+ /**
270
+ * The silent group rule of groupAssignmentWithProperties on an update
271
+ * without data: no group resolves, so nothing is sent. A declared skip: an
272
+ * unmet mapping, not a failure.
273
+ */
274
+ declare const groupAssignmentWithoutData: AmplitudeStepExample;
267
275
 
268
276
  type step_AmplitudeStepExample = AmplitudeStepExample;
269
277
  declare const step_consentGrantOptIn: typeof consentGrantOptIn;
@@ -272,14 +280,16 @@ declare const step_defaultEventForwarding: typeof defaultEventForwarding;
272
280
  declare const step_destinationLevelIdentify: typeof destinationLevelIdentify;
273
281
  declare const step_destinationLevelInclude: typeof destinationLevelInclude;
274
282
  declare const step_groupAssignmentWithProperties: typeof groupAssignmentWithProperties;
283
+ declare const step_groupAssignmentWithoutData: typeof groupAssignmentWithoutData;
275
284
  declare const step_orderCompleteMultiProduct: typeof orderCompleteMultiProduct;
276
285
  declare const step_ruleIncludeReplaces: typeof ruleIncludeReplaces;
286
+ declare const step_silentRule: typeof silentRule;
277
287
  declare const step_subscriptionRenewRevenue: typeof subscriptionRenewRevenue;
278
288
  declare const step_userLoginIdentify: typeof userLoginIdentify;
279
289
  declare const step_userLogoutReset: typeof userLogoutReset;
280
290
  declare const step_wildcardIgnored: typeof wildcardIgnored;
281
291
  declare namespace step {
282
- export { type step_AmplitudeStepExample as AmplitudeStepExample, step_consentGrantOptIn as consentGrantOptIn, step_consentRevokeOptOut as consentRevokeOptOut, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_groupAssignmentWithProperties as groupAssignmentWithProperties, step_orderCompleteMultiProduct as orderCompleteMultiProduct, step_ruleIncludeReplaces as ruleIncludeReplaces, step_subscriptionRenewRevenue as subscriptionRenewRevenue, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
292
+ export { type step_AmplitudeStepExample as AmplitudeStepExample, step_consentGrantOptIn as consentGrantOptIn, step_consentRevokeOptOut as consentRevokeOptOut, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_groupAssignmentWithProperties as groupAssignmentWithProperties, step_groupAssignmentWithoutData as groupAssignmentWithoutData, step_orderCompleteMultiProduct as orderCompleteMultiProduct, step_ruleIncludeReplaces as ruleIncludeReplaces, step_silentRule as silentRule, step_subscriptionRenewRevenue as subscriptionRenewRevenue, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
283
293
  }
284
294
 
285
295
  declare const index_env: typeof env;
package/dist/dev.d.ts CHANGED
@@ -27,7 +27,7 @@ declare const SettingsSchema: z.ZodObject<{
27
27
  sessionReplay: z.ZodOptional<z.ZodUnknown>;
28
28
  experiment: z.ZodOptional<z.ZodUnknown>;
29
29
  engagement: z.ZodOptional<z.ZodUnknown>;
30
- }, z.core.$strip>;
30
+ }, z.core.$loose>;
31
31
  type Settings$1 = z.infer<typeof SettingsSchema>;
32
32
 
33
33
  declare const MappingSchema: z.ZodObject<{
@@ -52,6 +52,8 @@ declare namespace index$1 {
52
52
  }
53
53
 
54
54
  type BrowserOptions = Omit<Types.BrowserOptions, 'identify'>;
55
+ type AmplitudeBrowserOptions = Types.BrowserOptions;
56
+ type AmplitudePlugin = Types.Plugin;
55
57
  /**
56
58
  * Destination-level settings.
57
59
  *
@@ -83,55 +85,53 @@ interface RuntimeState {
83
85
  };
84
86
  }
85
87
  /**
86
- * Amplitude SDK surface — the subset of @amplitude/unified the
87
- * destination actually uses. Mirrors the real module's named exports so
88
- * tests can mock each method individually via env.amplitude.
88
+ * Amplitude SDK surface: the subset of @amplitude/unified the
89
+ * destination actually uses. Mirrors the real client's methods so tests can
90
+ * mock each one via env.amplitude. Generic over the Identify and Revenue
91
+ * instances, so the real SDK gets back the instances it created.
89
92
  */
90
- interface AmplitudeSDK {
91
- initAll: (apiKey: string, options?: Record<string, unknown>) => Promise<void>;
92
- track: (eventType: string, eventProperties?: Record<string, unknown>) => void;
93
- identify: (identify: IdentifyInstance) => void;
94
- revenue: (revenue: RevenueInstance) => void;
95
- reset: () => void;
96
- setOptOut: (optOut: boolean) => void;
97
- setUserId: (userId: string | undefined) => void;
98
- setDeviceId: (deviceId: string) => void;
99
- setSessionId: (sessionId: number) => void;
100
- setGroup: (groupType: string, groupName: string | string[]) => void;
101
- groupIdentify: (groupType: string, groupName: string, identify: IdentifyInstance) => void;
102
- flush: () => {
103
- promise: Promise<void>;
104
- };
105
- add: (plugin: unknown) => {
106
- promise: Promise<void>;
107
- };
108
- Identify: new () => IdentifyInstance;
109
- Revenue: new () => RevenueInstance;
93
+ interface AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> {
94
+ /** Analytics. */
95
+ init: (apiKey: string, options?: AmplitudeBrowserOptions) => unknown;
96
+ /** One plugin: Session Replay, Experiment or Guides & Surveys. */
97
+ add: (plugin: AmplitudePlugin) => unknown;
98
+ track: (eventType: string, eventProperties?: Record<string, unknown>) => unknown;
99
+ identify: (identify: I) => unknown;
100
+ revenue: (revenue: R) => unknown;
101
+ reset: () => unknown;
102
+ setOptOut: (optOut: boolean) => unknown;
103
+ setUserId: (userId: string | undefined) => unknown;
104
+ setDeviceId: (deviceId: string) => unknown;
105
+ setSessionId: (sessionId: number) => unknown;
106
+ setGroup: (groupType: string, groupName: string | string[]) => unknown;
107
+ groupIdentify: (groupType: string, groupName: string, identify: I) => unknown;
108
+ Identify: new () => I;
109
+ Revenue: new () => R;
110
110
  }
111
- /** Chainable Identify — mirrors @amplitude/unified Identify class. */
111
+ /** Chainable Identify, as the @amplitude/unified Identify class. */
112
112
  interface IdentifyInstance {
113
- set: (property: string, value: unknown) => IdentifyInstance;
114
- setOnce: (property: string, value: unknown) => IdentifyInstance;
115
- add: (property: string, value: number) => IdentifyInstance;
116
- append: (property: string, value: unknown) => IdentifyInstance;
117
- prepend: (property: string, value: unknown) => IdentifyInstance;
118
- preInsert: (property: string, value: unknown) => IdentifyInstance;
119
- postInsert: (property: string, value: unknown) => IdentifyInstance;
120
- remove: (property: string, value: unknown) => IdentifyInstance;
121
- unset: (property: string) => IdentifyInstance;
122
- clearAll: () => IdentifyInstance;
113
+ set(property: string, value: unknown): IdentifyInstance;
114
+ setOnce(property: string, value: unknown): IdentifyInstance;
115
+ add(property: string, value: number): IdentifyInstance;
116
+ append(property: string, value: unknown): IdentifyInstance;
117
+ prepend(property: string, value: unknown): IdentifyInstance;
118
+ preInsert(property: string, value: unknown): IdentifyInstance;
119
+ postInsert(property: string, value: unknown): IdentifyInstance;
120
+ remove(property: string, value: unknown): IdentifyInstance;
121
+ unset(property: string): IdentifyInstance;
122
+ clearAll(): IdentifyInstance;
123
123
  }
124
- /** Chainable Revenue — mirrors @amplitude/unified Revenue class. */
124
+ /** Chainable Revenue, as the @amplitude/unified Revenue class. */
125
125
  interface RevenueInstance {
126
- setProductId: (id: string) => RevenueInstance;
127
- setPrice: (price: number) => RevenueInstance;
128
- setQuantity: (quantity: number) => RevenueInstance;
129
- setRevenueType: (type: string) => RevenueInstance;
130
- setCurrency: (currency: string) => RevenueInstance;
131
- setRevenue: (revenue: number) => RevenueInstance;
132
- setReceipt: (receipt: string) => RevenueInstance;
133
- setReceiptSig: (signature: string) => RevenueInstance;
134
- setEventProperties: (properties: Record<string, unknown>) => RevenueInstance;
126
+ setProductId(id: string): RevenueInstance;
127
+ setPrice(price: number): RevenueInstance;
128
+ setQuantity(quantity: number): RevenueInstance;
129
+ setRevenueType(type: string): RevenueInstance;
130
+ setCurrency(currency: string): RevenueInstance;
131
+ setRevenue(revenue: number): RevenueInstance;
132
+ setReceipt(receipt: string): RevenueInstance;
133
+ setReceiptSig(signature: string): RevenueInstance;
134
+ setEventProperties(properties: Record<string, unknown>): RevenueInstance;
135
135
  }
136
136
  /**
137
137
  * Env — optional SDK override. Production leaves this undefined and the
@@ -264,6 +264,14 @@ declare const consentRevokeOptOut: AmplitudeStepExample;
264
264
  * Consent granted → amplitude.setOptOut(false).
265
265
  */
266
266
  declare const consentGrantOptIn: AmplitudeStepExample;
267
+ /** A silent rule without settings of its own calls nothing. */
268
+ declare const silentRule: AmplitudeStepExample;
269
+ /**
270
+ * The silent group rule of groupAssignmentWithProperties on an update
271
+ * without data: no group resolves, so nothing is sent. A declared skip: an
272
+ * unmet mapping, not a failure.
273
+ */
274
+ declare const groupAssignmentWithoutData: AmplitudeStepExample;
267
275
 
268
276
  type step_AmplitudeStepExample = AmplitudeStepExample;
269
277
  declare const step_consentGrantOptIn: typeof consentGrantOptIn;
@@ -272,14 +280,16 @@ declare const step_defaultEventForwarding: typeof defaultEventForwarding;
272
280
  declare const step_destinationLevelIdentify: typeof destinationLevelIdentify;
273
281
  declare const step_destinationLevelInclude: typeof destinationLevelInclude;
274
282
  declare const step_groupAssignmentWithProperties: typeof groupAssignmentWithProperties;
283
+ declare const step_groupAssignmentWithoutData: typeof groupAssignmentWithoutData;
275
284
  declare const step_orderCompleteMultiProduct: typeof orderCompleteMultiProduct;
276
285
  declare const step_ruleIncludeReplaces: typeof ruleIncludeReplaces;
286
+ declare const step_silentRule: typeof silentRule;
277
287
  declare const step_subscriptionRenewRevenue: typeof subscriptionRenewRevenue;
278
288
  declare const step_userLoginIdentify: typeof userLoginIdentify;
279
289
  declare const step_userLogoutReset: typeof userLogoutReset;
280
290
  declare const step_wildcardIgnored: typeof wildcardIgnored;
281
291
  declare namespace step {
282
- export { type step_AmplitudeStepExample as AmplitudeStepExample, step_consentGrantOptIn as consentGrantOptIn, step_consentRevokeOptOut as consentRevokeOptOut, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_groupAssignmentWithProperties as groupAssignmentWithProperties, step_orderCompleteMultiProduct as orderCompleteMultiProduct, step_ruleIncludeReplaces as ruleIncludeReplaces, step_subscriptionRenewRevenue as subscriptionRenewRevenue, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
292
+ export { type step_AmplitudeStepExample as AmplitudeStepExample, step_consentGrantOptIn as consentGrantOptIn, step_consentRevokeOptOut as consentRevokeOptOut, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_groupAssignmentWithProperties as groupAssignmentWithProperties, step_groupAssignmentWithoutData as groupAssignmentWithoutData, step_orderCompleteMultiProduct as orderCompleteMultiProduct, step_ruleIncludeReplaces as ruleIncludeReplaces, step_silentRule as silentRule, step_subscriptionRenewRevenue as subscriptionRenewRevenue, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset, step_wildcardIgnored as wildcardIgnored };
283
293
  }
284
294
 
285
295
  declare const index_env: typeof env;
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,s=(e,n)=>{for(var i in n)t(e,i,{get:n[i],enumerable:!0})},a={};s(a,{examples:()=>y,schemas:()=>o}),module.exports=(e=a,((e,s,a,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let d of i(s))r.call(e,d)||d===a||t(e,d,{get:()=>s[d],enumerable:!(o=n(s,d))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};s(o,{MappingSchema:()=>c,SettingsSchema:()=>p,mapping:()=>v,settings:()=>m});var d=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),p=u.z.object({apiKey:u.z.string().min(1).describe('Your Amplitude project API key. Find it in your Amplitude project settings under "General" → "API Keys" (like a1b2c3d4e5f6789012345678abcdef12).'),serverZone:u.z.enum(["US","EU"]).describe("Amplitude server zone. Default: US.").optional(),flushIntervalMillis:u.z.number().int().positive().describe("How often (in ms) to flush the event queue. Default: 1000.").optional(),flushQueueSize:u.z.number().int().positive().describe("Max queued events before a flush. Default: 30.").optional(),flushMaxRetries:u.z.number().int().nonnegative().describe("Max retries on failed flush. Default: 5.").optional(),transport:u.z.enum(["fetch","xhr","beacon"]).describe("HTTP transport. Default: fetch.").optional(),useBatch:u.z.boolean().describe("Use the Amplitude batch endpoint instead of the standard endpoint. Default: false.").optional(),appVersion:u.z.string().describe("Application version; tagged onto every event.").optional(),identify:u.z.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.").optional(),sessionReplay:u.z.unknown().describe("Session Replay options, passed to the Session Replay plugin. @amplitude/unified sets up the plugin on every init, whether or not this is set; it records a sampled share of sessions, set by the project sampling settings in Amplitude when present, else by sampleRate (default 0).").optional(),experiment:u.z.unknown().describe("Feature Experiment options. Passed to the Experiment plugin only when they include `deploymentKey`. @amplitude/unified sets up the plugin on every init; without a deploymentKey it uses the API key.").optional(),engagement:u.z.unknown().describe("Guides & Surveys options object. @amplitude/unified loads the Guides & Surveys SDK from cdn.amplitude.com on every init, whether or not this is set; `true` passes no options.").optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to an object with any of: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.").optional(),revenue:l.z.unknown().describe("Revenue mapping. Resolves to a single object or (via loop) an array of objects, each with: productId, price, quantity, revenueType, currency, revenue, receipt, receiptSig, eventProperties. One amplitude.revenue() call fires per item.").optional(),group:l.z.unknown().describe("Group assignment. Resolves to { type, name } → amplitude.setGroup(type, name).").optional(),groupIdentify:l.z.unknown().describe("Group properties. Resolves to { type, name, set?, setOnce?, ... } → amplitude.groupIdentify(type, name, identify).").optional(),reset:l.z.unknown().describe("Logout trigger. Resolves to a truthy value → amplitude.reset() (clears userId, regenerates deviceId). Typically used with silent: true on a user logout rule.").optional()}),m=(0,d.zodToSchema)(p),v=(0,d.zodToSchema)(c),y={};s(y,{env:()=>g,step:()=>O});var g={};s(g,{init:()=>_,push:()=>w,simulation:()=>k});var h=()=>{},f=()=>({promise:Promise.resolve()}),b=class{constructor(){this._ops={}}_record(e,t,n){return this._ops[e]||(this._ops[e]={}),this._ops[e][t]=n,this}set(e,t){return this._record("set",e,t)}setOnce(e,t){return this._record("setOnce",e,t)}add(e,t){return this._record("add",e,t)}append(e,t){return this._record("append",e,t)}prepend(e,t){return this._record("prepend",e,t)}preInsert(e,t){return this._record("preInsert",e,t)}postInsert(e,t){return this._record("postInsert",e,t)}remove(e,t){return this._record("remove",e,t)}unset(e){return this._record("unset",e)}clearAll(){return this._ops.clearAll={},this}toJSON(){return this._ops}},I=class{constructor(){this._data={}}setProductId(e){return this._data.productId=e,this}setPrice(e){return this._data.price=e,this}setQuantity(e){return this._data.quantity=e,this}setRevenueType(e){return this._data.revenueType=e,this}setCurrency(e){return this._data.currency=e,this}setRevenue(e){return this._data.revenue=e,this}setReceipt(e){return this._data.receipt=e,this}setReceiptSig(e){return this._data.receiptSig=e,this}setEventProperties(e){return this._data.eventProperties=e,this}toJSON(){return this._data}},_={amplitude:{initAll:()=>Promise.resolve(),track:h,identify:h,revenue:h,reset:h,setOptOut:h,setUserId:h,setDeviceId:h,setSessionId:h,setGroup:h,groupIdentify:h,flush:f,add:f,Identify:b,Revenue:I}},w={amplitude:{initAll:()=>Promise.resolve(),track:h,identify:h,revenue:h,reset:h,setOptOut:h,setUserId:h,setDeviceId:h,setSessionId:h,setGroup:h,groupIdentify:h,flush:f,add:f,Identify:b,Revenue:I}},k=["call:amplitude.initAll","call:amplitude.track","call:amplitude.identify","call:amplitude.revenue","call:amplitude.reset","call:amplitude.setOptOut","call:amplitude.setUserId","call:amplitude.setDeviceId","call:amplitude.setSessionId","call:amplitude.setGroup","call:amplitude.groupIdentify"],O={};s(O,{consentGrantOptIn:()=>x,consentRevokeOptOut:()=>q,defaultEventForwarding:()=>R,destinationLevelIdentify:()=>P,destinationLevelInclude:()=>S,groupAssignmentWithProperties:()=>T,orderCompleteMultiProduct:()=>G,ruleIncludeReplaces:()=>E,subscriptionRenewRevenue:()=>D,userLoginIdentify:()=>U,userLogoutReset:()=>j,wildcardIgnored:()=>z});var A=require("@walkeros/core"),R={title:"Default track",description:"A walker event is forwarded to Amplitude as an amplitude.track call with the event name and empty properties.",in:(0,A.getEvent)("product view",{timestamp:1700000100}),out:[["amplitude.track","product view",{}]]},z={public:!1,in:(0,A.getEvent)("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},S={title:"Include data",description:"With include: ['data'] in the destination config, the event data section is flattened into prefixed event_properties on every track call.",in:(0,A.getEvent)("product view",{timestamp:1700000102}),configInclude:["data"],out:[["amplitude.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},E={title:"Rule include overrides",description:"With include: ['data'] in the destination config, the rule's include: ['globals'] replaces it, so this event forwards only globals.",in:(0,A.getEvent)("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["amplitude.track","order complete",{globals_pagegroup:"shop"}]]},P={title:"Destination identify",description:"With settings.identify mapping user, device, and session to 'user.id', 'user.device', and 'user.session', the destination sets userId, deviceId, and sessionId before the track call. A non-numeric session string is hashed to a stable number. Setters only re-fire when the resolved values change.",in:(0,A.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{user:"user.id",device:"user.device",session:"user.session"}}},out:[["amplitude.setUserId","us3r"],["amplitude.setDeviceId","c00k13"],["amplitude.setSessionId",394324160],["amplitude.track","page view",{}]]},U={title:"User login identify",description:"A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.",in:(0,A.getEvent)("user login",{timestamp:1700000105e3,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!0,settings:{identify:{map:{user:"data.user_id",set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},setOnce:{map:{first_login:"timestamp"}},add:{map:{login_count:{value:1}}}}}}},out:[["amplitude.setUserId","new-user-123"],["amplitude.identify",{set:{plan:"premium",company:"Acme",email:"user@acme.com"},setOnce:{first_login:1700000105e3},add:{login_count:1}}]]},j={title:"User logout reset",description:"A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.",in:(0,A.getEvent)("user logout",{timestamp:1700000106}),mapping:{silent:!0,settings:{reset:!0}},out:[["amplitude.reset"]]},D={title:"Subscription revenue",description:"A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.",in:(0,A.getEvent)("subscription renew",{timestamp:1700000107,data:{plan_id:"plan-pro",amount:9.99}}),mapping:{silent:!0,settings:{revenue:{map:{productId:"data.plan_id",price:"data.amount",revenueType:{value:"renewal"},currency:{key:"data.currency",value:"EUR"}}}}},out:[["amplitude.revenue",{productId:"plan-pro",price:9.99,revenueType:"renewal",currency:"EUR"}]]},G={title:"Multi-product order",description:"An order fires one amplitude.revenue call per nested product plus a single track for the order totals.",in:(0,A.getEvent)("order complete",{timestamp:1700000108}),mapping:{include:["data","globals"],settings:{revenue:{loop:["nested",{condition:e=>{var t;return"number"==typeof(null==(t=null==e?void 0:e.data)?void 0:t.price)},map:{productId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1},revenueType:{value:"purchase"},currency:{key:"data.currency",value:"EUR"}}}]}}},out:[["amplitude.revenue",{productId:"ers",price:420,quantity:1,revenueType:"purchase",currency:"EUR"}],["amplitude.revenue",{productId:"cc",price:42,quantity:1,revenueType:"purchase",currency:"EUR"}],["amplitude.track","order complete",{data_id:"0rd3r1d",data_currency:"EUR",data_shipping:5.22,data_taxes:73.76,data_total:555,globals_pagegroup:"shop"}]]},T={title:"Group assignment",description:"A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.",in:(0,A.getEvent)("company update",{timestamp:1700000109,data:{company:"Acme",industry:"tech",employee_count:50,founded_year:2020}}),mapping:{silent:!0,settings:{group:{map:{type:{value:"company"},name:"data.company"}},groupIdentify:{map:{type:{value:"company"},name:"data.company",set:{map:{industry:"data.industry",size:"data.employee_count"}},setOnce:{map:{founded:"data.founded_year"}}}}}},out:[["amplitude.setGroup","company","Acme"],["amplitude.groupIdentify","company","Acme",{set:{industry:"tech",size:50},setOnce:{founded:2020}}]]},q={title:"Consent revoked",description:"With consent: { analytics: true } in the destination config, a walker consent command that denies analytics opts out of Amplitude tracking via setOptOut(true).",command:"consent",before:{analytics:!0},in:{analytics:!1},settings:{},out:[["amplitude.setOptOut",!1],["amplitude.setOptOut",!0]]},x={title:"Consent granted",description:"With consent: { analytics: true } in the destination config, a walker consent command that grants analytics opts into Amplitude tracking via setOptOut(false).",command:"consent",in:{analytics:!0},settings:{},out:[["amplitude.setOptOut",!1]]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a=(e,n)=>{for(var i in n)t(e,i,{get:n[i],enumerable:!0})},s={};a(s,{examples:()=>y,schemas:()=>o}),module.exports=(e=s,((e,a,s,o)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let p of i(a))r.call(e,p)||p===s||t(e,p,{get:()=>a[p],enumerable:!(o=n(a,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};a(o,{MappingSchema:()=>c,SettingsSchema:()=>d,mapping:()=>g,settings:()=>m});var p=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),d=u.z.object({apiKey:u.z.string().min(1).describe('Your Amplitude project API key. Find it in your Amplitude project settings under "General" → "API Keys" (like a1b2c3d4e5f6789012345678abcdef12).'),serverZone:u.z.enum(["US","EU"]).describe("Amplitude server zone. Default: US.").optional(),flushIntervalMillis:u.z.number().int().positive().describe("How often (in ms) to flush the event queue. Default: 1000.").optional(),flushQueueSize:u.z.number().int().positive().describe("Max queued events before a flush. Default: 30.").optional(),flushMaxRetries:u.z.number().int().nonnegative().describe("Max retries on failed flush. Default: 5.").optional(),transport:u.z.enum(["fetch","xhr","beacon"]).describe("HTTP transport. Default: fetch.").optional(),useBatch:u.z.boolean().describe("Use the Amplitude batch endpoint instead of the standard endpoint. Default: false.").optional(),appVersion:u.z.string().describe("Application version; tagged onto every event.").optional(),identify:u.z.unknown().describe("walkerOS mapping value resolving to an identity object. Keys: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.").optional(),sessionReplay:u.z.unknown().describe("Session Replay options. When set, the Session Replay plugin starts; the other plugins start only from their own settings. It records a sampled share of sessions, set by the project sampling settings in Amplitude when present, else by sampleRate (default 0).").optional(),experiment:u.z.unknown().describe("Feature Experiment options. The Experiment plugin starts only when they include `deploymentKey`; the other plugins start only from their own settings.").optional(),engagement:u.z.unknown().describe("Guides & Surveys options object; `true` passes no options. When set, the Guides & Surveys plugin starts and loads its SDK from cdn.amplitude.com; the other plugins start only from their own settings.").optional()}).loose(),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to an object with any of: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.").optional(),revenue:l.z.unknown().describe("Revenue mapping. Resolves to a single object or (via loop) an array of objects, each with: productId, price, quantity, revenueType, currency, revenue, receipt, receiptSig, eventProperties. One amplitude.revenue() call fires per item.").optional(),group:l.z.unknown().describe("Group assignment. Resolves to { type, name } → amplitude.setGroup(type, name).").optional(),groupIdentify:l.z.unknown().describe("Group properties. Resolves to { type, name, set?, setOnce?, ... } → amplitude.groupIdentify(type, name, identify).").optional(),reset:l.z.unknown().describe("Logout trigger. Resolves to a truthy value → amplitude.reset() (clears userId, regenerates deviceId). Typically used with silent: true on a user logout rule.").optional()}),m=(0,p.zodToSchema)(d),g=(0,p.zodToSchema)(c),y={};a(y,{env:()=>v,step:()=>O});var v={};a(v,{init:()=>_,push:()=>w,simulation:()=>k});var h=()=>{},f=()=>({promise:Promise.resolve()}),b=class{constructor(){this._ops={}}_record(e,t,n){return this._ops[e]||(this._ops[e]={}),this._ops[e][t]=n,this}set(e,t){return this._record("set",e,t)}setOnce(e,t){return this._record("setOnce",e,t)}add(e,t){return this._record("add",e,t)}append(e,t){return this._record("append",e,t)}prepend(e,t){return this._record("prepend",e,t)}preInsert(e,t){return this._record("preInsert",e,t)}postInsert(e,t){return this._record("postInsert",e,t)}remove(e,t){return this._record("remove",e,t)}unset(e){return this._record("unset",e)}clearAll(){return this._ops.clearAll={},this}toJSON(){return this._ops}},I=class{constructor(){this._data={}}setProductId(e){return this._data.productId=e,this}setPrice(e){return this._data.price=e,this}setQuantity(e){return this._data.quantity=e,this}setRevenueType(e){return this._data.revenueType=e,this}setCurrency(e){return this._data.currency=e,this}setRevenue(e){return this._data.revenue=e,this}setReceipt(e){return this._data.receipt=e,this}setReceiptSig(e){return this._data.receiptSig=e,this}setEventProperties(e){return this._data.eventProperties=e,this}toJSON(){return this._data}},_={amplitude:{init:f,add:f,track:h,identify:h,revenue:h,reset:h,setOptOut:h,setUserId:h,setDeviceId:h,setSessionId:h,setGroup:h,groupIdentify:h,Identify:b,Revenue:I}},w={amplitude:{init:f,add:f,track:h,identify:h,revenue:h,reset:h,setOptOut:h,setUserId:h,setDeviceId:h,setSessionId:h,setGroup:h,groupIdentify:h,Identify:b,Revenue:I}},k=["call:amplitude.init","call:amplitude.add","call:amplitude.track","call:amplitude.identify","call:amplitude.revenue","call:amplitude.reset","call:amplitude.setOptOut","call:amplitude.setUserId","call:amplitude.setDeviceId","call:amplitude.setSessionId","call:amplitude.setGroup","call:amplitude.groupIdentify"],O={};a(O,{consentGrantOptIn:()=>x,consentRevokeOptOut:()=>q,defaultEventForwarding:()=>R,destinationLevelIdentify:()=>U,destinationLevelInclude:()=>S,groupAssignmentWithProperties:()=>G,groupAssignmentWithoutData:()=>M,orderCompleteMultiProduct:()=>T,ruleIncludeReplaces:()=>E,silentRule:()=>W,subscriptionRenewRevenue:()=>D,userLoginIdentify:()=>P,userLogoutReset:()=>j,wildcardIgnored:()=>z});var A=require("@walkeros/core"),R={title:"Default track",description:"A walker event is forwarded to Amplitude as an amplitude.track call with the event name and empty properties.",in:(0,A.getEvent)("product view",{timestamp:1700000100}),out:[["amplitude.track","product view",{}]]},z={public:!1,in:(0,A.createEvent)({name:"debug noise",timestamp:1700000101}),mapping:{ignore:!0},out:[]},S={title:"Include data",description:"With include: ['data'] in the destination config, the event data section is flattened into prefixed event_properties on every track call.",in:(0,A.getEvent)("product view",{timestamp:1700000102}),configInclude:["data"],out:[["amplitude.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420}]]},E={title:"Rule include overrides",description:"With include: ['data'] in the destination config, the rule's include: ['globals'] replaces it, so this event forwards only globals.",in:(0,A.getEvent)("order complete",{timestamp:1700000103}),configInclude:["data"],mapping:{include:["globals"]},out:[["amplitude.track","order complete",{globals_pagegroup:"shop"}]]},U={title:"Destination identify",description:"With settings.identify mapping user, device, and session to 'user.id', 'user.device', and 'user.session', the destination sets userId, deviceId, and sessionId before the track call. A non-numeric session string is hashed to a stable number. Setters only re-fire when the resolved values change.",in:(0,A.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{user:"user.id",device:"user.device",session:"user.session"}}},out:[["amplitude.setUserId","us3r"],["amplitude.setDeviceId","c00k13"],["amplitude.setSessionId",394324160],["amplitude.track","page view",{}]]},P={title:"User login identify",description:"A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.",in:(0,A.createEvent)({name:"user login",timestamp:1700000105e3,data:{user_id:"new-user-123",plan:"premium",company:"Acme",email:"user@acme.com"}}),mapping:{silent:!0,settings:{identify:{map:{user:"data.user_id",set:{map:{plan:"data.plan",company:"data.company",email:"data.email"}},setOnce:{map:{first_login:"timestamp"}},add:{map:{login_count:{value:1}}}}}}},out:[["amplitude.setUserId","new-user-123"],["amplitude.identify",{set:{plan:"premium",company:"Acme",email:"user@acme.com"},setOnce:{first_login:1700000105e3},add:{login_count:1}}]]},j={title:"User logout reset",description:"A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.",in:(0,A.createEvent)({name:"user logout",timestamp:1700000106}),mapping:{silent:!0,settings:{reset:!0}},out:[["amplitude.reset"]]},D={title:"Subscription revenue",description:"A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.",in:(0,A.createEvent)({name:"subscription renew",timestamp:1700000107,data:{plan_id:"plan-pro",amount:9.99}}),mapping:{silent:!0,settings:{revenue:{map:{productId:"data.plan_id",price:"data.amount",revenueType:{value:"renewal"},currency:{key:"data.currency",value:"EUR"}}}}},out:[["amplitude.revenue",{productId:"plan-pro",price:9.99,revenueType:"renewal",currency:"EUR"}]]},T={title:"Multi-product order",description:"An order fires one amplitude.revenue call per nested product plus a single track for the order totals.",in:(0,A.getEvent)("order complete",{timestamp:1700000108}),mapping:{include:["data","globals"],settings:{revenue:{loop:["nested",{condition:e=>{var t;return"number"==typeof(null==(t=null==e?void 0:e.data)?void 0:t.price)},map:{productId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1},revenueType:{value:"purchase"},currency:{key:"data.currency",value:"EUR"}}}]}}},out:[["amplitude.revenue",{productId:"ers",price:420,quantity:1,revenueType:"purchase",currency:"EUR"}],["amplitude.revenue",{productId:"cc",price:42,quantity:1,revenueType:"purchase",currency:"EUR"}],["amplitude.track","order complete",{data_id:"0rd3r1d",data_currency:"EUR",data_shipping:5.22,data_taxes:73.76,data_value:555,globals_pagegroup:"shop"}]]},G={title:"Group assignment",description:"A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.",in:(0,A.createEvent)({name:"company update",timestamp:1700000109,data:{company:"Acme",industry:"tech",employee_count:50,founded_year:2020}}),mapping:{silent:!0,settings:{group:{map:{type:{value:"company"},name:"data.company"}},groupIdentify:{map:{type:{value:"company"},name:"data.company",set:{map:{industry:"data.industry",size:"data.employee_count"}},setOnce:{map:{founded:"data.founded_year"}}}}}},out:[["amplitude.setGroup","company","Acme"],["amplitude.groupIdentify","company","Acme",{set:{industry:"tech",size:50},setOnce:{founded:2020}}]]},q={title:"Consent revoked",description:"With consent: { analytics: true } in the destination config, a walker consent command that denies analytics opts out of Amplitude tracking via setOptOut(true).",command:"consent",before:{analytics:!0},in:{analytics:!1},settings:{},out:[["amplitude.setOptOut",!1],["amplitude.setOptOut",!0]]},x={title:"Consent granted",description:"With consent: { analytics: true } in the destination config, a walker consent command that grants analytics opts into Amplitude tracking via setOptOut(false).",command:"consent",in:{analytics:!0},settings:{},out:[["amplitude.setOptOut",!1]]},W={public:!1,description:"A rule with silent: true and no settings calls nothing.",in:(0,A.getEvent)("page view",{timestamp:1700000120}),mapping:{silent:!0},out:[]},M={public:!1,description:"A silent rule whose group mapping finds no company sends nothing: an unmet mapping, not a failure, so the push returns normally.",in:{name:"company update",entity:"company",action:"update"},mapping:G.mapping,out:[]};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Amplitude project API key. Find it in your Amplitude project settings under \"General\" → \"API Keys\" (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n serverZone: z\n .enum(['US', 'EU'])\n .describe('Amplitude server zone. Default: US.')\n .optional(),\n flushIntervalMillis: z\n .number()\n .int()\n .positive()\n .describe('How often (in ms) to flush the event queue. Default: 1000.')\n .optional(),\n flushQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Max queued events before a flush. Default: 30.')\n .optional(),\n flushMaxRetries: z\n .number()\n .int()\n .nonnegative()\n .describe('Max retries on failed flush. Default: 5.')\n .optional(),\n transport: z\n .enum(['fetch', 'xhr', 'beacon'])\n .describe('HTTP transport. Default: fetch.')\n .optional(),\n useBatch: z\n .boolean()\n .describe(\n 'Use the Amplitude batch endpoint instead of the standard endpoint. Default: false.',\n )\n .optional(),\n appVersion: z\n .string()\n .describe('Application version; tagged onto every event.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.',\n )\n .optional(),\n sessionReplay: z\n .unknown()\n .describe(\n 'Session Replay options, passed to the Session Replay plugin. @amplitude/unified sets up the plugin on every init, whether or not this is set; it records a sampled share of sessions, set by the project sampling settings in Amplitude when present, else by sampleRate (default 0).',\n )\n .optional(),\n experiment: z\n .unknown()\n .describe(\n 'Feature Experiment options. Passed to the Experiment plugin only when they include `deploymentKey`. @amplitude/unified sets up the plugin on every init; without a deploymentKey it uses the API key.',\n )\n .optional(),\n engagement: z\n .unknown()\n .describe(\n 'Guides & Surveys options object. @amplitude/unified loads the Guides & Surveys SDK from cdn.amplitude.com on every init, whether or not this is set; `true` passes no options.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to an object with any of: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.',\n )\n .optional(),\n revenue: z\n .unknown()\n .describe(\n 'Revenue mapping. Resolves to a single object or (via loop) an array of objects, each with: productId, price, quantity, revenueType, currency, revenue, receipt, receiptSig, eventProperties. One amplitude.revenue() call fires per item.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Group assignment. Resolves to { type, name } → amplitude.setGroup(type, name).',\n )\n .optional(),\n groupIdentify: z\n .unknown()\n .describe(\n 'Group properties. Resolves to { type, name, set?, setOnce?, ... } → amplitude.groupIdentify(type, name, identify).',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → amplitude.reset() (clears userId, regenerates deviceId). Typically used with silent: true on a user logout rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, IdentifyInstance, RevenueInstance } from '../types';\n\n/**\n * Example environment configurations for the Amplitude destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.amplitude` undefined — the destination falls back\n * to the real `@amplitude/unified` module namespace.\n */\n\nconst noop = () => {};\nconst noopPromise = () => ({ promise: Promise.resolve() });\n\n/**\n * Minimal chainable Identify mock. The real SDK class has the same shape.\n * Tests spy by replacing these methods with jest.fn() in the test runner.\n */\nclass MockIdentify implements IdentifyInstance {\n _ops: Record<string, Record<string, unknown>> = {};\n\n private _record(op: string, prop: string, value?: unknown) {\n if (!this._ops[op]) this._ops[op] = {};\n this._ops[op][prop] = value;\n return this;\n }\n\n set(prop: string, value: unknown) {\n return this._record('set', prop, value);\n }\n setOnce(prop: string, value: unknown) {\n return this._record('setOnce', prop, value);\n }\n add(prop: string, value: unknown) {\n return this._record('add', prop, value);\n }\n append(prop: string, value: unknown) {\n return this._record('append', prop, value);\n }\n prepend(prop: string, value: unknown) {\n return this._record('prepend', prop, value);\n }\n preInsert(prop: string, value: unknown) {\n return this._record('preInsert', prop, value);\n }\n postInsert(prop: string, value: unknown) {\n return this._record('postInsert', prop, value);\n }\n remove(prop: string, value: unknown) {\n return this._record('remove', prop, value);\n }\n unset(prop: string) {\n return this._record('unset', prop);\n }\n clearAll() {\n this._ops['clearAll'] = {};\n return this;\n }\n\n toJSON() {\n return this._ops;\n }\n}\n\n/** Minimal chainable Revenue mock. */\nclass MockRevenue implements RevenueInstance {\n _data: Record<string, unknown> = {};\n\n setProductId(v: string) {\n this._data.productId = v;\n return this;\n }\n setPrice(v: number) {\n this._data.price = v;\n return this;\n }\n setQuantity(v: number) {\n this._data.quantity = v;\n return this;\n }\n setRevenueType(v: string) {\n this._data.revenueType = v;\n return this;\n }\n setCurrency(v: string) {\n this._data.currency = v;\n return this;\n }\n setRevenue(v: number) {\n this._data.revenue = v;\n return this;\n }\n setReceipt(v: string) {\n this._data.receipt = v;\n return this;\n }\n setReceiptSig(v: string) {\n this._data.receiptSig = v;\n return this;\n }\n setEventProperties(v: unknown) {\n this._data.eventProperties = v;\n return this;\n }\n\n toJSON() {\n return this._data;\n }\n}\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n amplitude: {\n initAll: () => Promise.resolve(),\n track: noop,\n identify: noop,\n revenue: noop,\n reset: noop,\n setOptOut: noop,\n setUserId: noop,\n setDeviceId: noop,\n setSessionId: noop,\n setGroup: noop,\n groupIdentify: noop,\n flush: noopPromise,\n add: noopPromise,\n Identify: MockIdentify,\n Revenue: MockRevenue,\n },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n amplitude: {\n initAll: () => Promise.resolve(),\n track: noop,\n identify: noop,\n revenue: noop,\n reset: noop,\n setOptOut: noop,\n setUserId: noop,\n setDeviceId: noop,\n setSessionId: noop,\n setGroup: noop,\n groupIdentify: noop,\n flush: noopPromise,\n add: noopPromise,\n Identify: MockIdentify,\n Revenue: MockRevenue,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:amplitude.initAll',\n 'call:amplitude.track',\n 'call:amplitude.identify',\n 'call:amplitude.revenue',\n 'call:amplitude.reset',\n 'call:amplitude.setOptOut',\n 'call:amplitude.setUserId',\n 'call:amplitude.setDeviceId',\n 'call:amplitude.setSessionId',\n 'call:amplitude.setGroup',\n 'call:amplitude.groupIdentify',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings and/or an\n * `await` hint for async scenarios. The test runner reads `settings`\n * from the example and merges it into the base destination settings\n * on top of the fixed apiKey. `configInclude` is passed as config-level\n * include when registering the destination.\n */\nexport type AmplitudeStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes\n * amplitude.track(event.name, event_properties). With no mapping and\n * no destination-level include, event_properties is `{}`.\n */\nexport const defaultEventForwarding: AmplitudeStepExample = {\n title: 'Default track',\n description:\n 'A walker event is forwarded to Amplitude as an amplitude.track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['amplitude.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: AmplitudeStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level include (config.include) flattens the walkerOS `data`\n * section into prefixed event_properties on every push.\n */\nexport const destinationLevelInclude: AmplitudeStepExample = {\n title: 'Include data',\n description:\n \"With include: ['data'] in the destination config, the event data section is flattened into prefixed event_properties on every track call.\",\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'amplitude.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n ],\n};\n\n/**\n * Per-rule include REPLACES the destination-level config.include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: AmplitudeStepExample = {\n title: 'Rule include overrides',\n description:\n \"With include: ['data'] in the destination config, the rule's include: ['globals'] replaces it, so this event forwards only globals.\",\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'amplitude.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). The destination sets user/device/session IDs\n * and tracks them in runtime state; subsequent pushes with unchanged\n * values do NOT re-fire the setters.\n *\n * This example represents the first push in a fresh session. user.id,\n * user.device, user.session come from the walkerOS session fixture.\n *\n * The walkerOS fixture's user.session is 's3ss10n' (string). The\n * destination deterministically hashes non-numeric session strings via\n * djb2 so the same walkerOS session always maps to the same Amplitude\n * session number (cross-page-load consistency). djb2('s3ss10n') = 394324160.\n */\nexport const destinationLevelIdentify: AmplitudeStepExample = {\n title: 'Destination identify',\n description:\n \"With settings.identify mapping user, device, and session to 'user.id', 'user.device', and 'user.session', the destination sets userId, deviceId, and sessionId before the track call. A non-numeric session string is hashed to a stable number. Setters only re-fire when the resolved values change.\",\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n user: 'user.id',\n device: 'user.device',\n session: 'user.session',\n },\n },\n },\n out: [\n ['amplitude.setUserId', 'us3r'],\n ['amplitude.setDeviceId', 'c00k13'],\n ['amplitude.setSessionId', 394324160],\n ['amplitude.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify with the full operation vocabulary - this is the\n * \"user login\" pattern: set user_id, enrich user properties. `silent: true`\n * suppresses the default amplitude.track() call because we're running\n * identity side effects only.\n */\nexport const userLoginIdentify: AmplitudeStepExample = {\n title: 'User login identify',\n description:\n 'A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.',\n in: getEvent('user login', {\n timestamp: 1700000105000,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n user: 'data.user_id',\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n setOnce: {\n map: {\n first_login: 'timestamp',\n },\n },\n add: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n ['amplitude.setUserId', 'new-user-123'],\n [\n 'amplitude.identify',\n {\n set: {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n setOnce: {\n first_login: 1700000105000,\n },\n add: {\n login_count: 1,\n },\n },\n ],\n ],\n};\n\n/**\n * User logout - reset: true fires amplitude.reset(), which clears userId\n * and regenerates deviceId. `silent: true` because we're only running the\n * reset side effect, no default track().\n */\nexport const userLogoutReset: AmplitudeStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.',\n in: getEvent('user logout', { timestamp: 1700000106 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['amplitude.reset']],\n};\n\n/**\n * Single-product revenue - resolves `settings.revenue` to one object and\n * fires one amplitude.revenue() call. Note the `{ key: \"data.currency\",\n * value: \"EUR\" }` fallback syntax: try data.currency, default to \"EUR\".\n *\n * The walkerOS default event has no data.currency, so the fallback fires.\n */\nexport const subscriptionRenewRevenue: AmplitudeStepExample = {\n title: 'Subscription revenue',\n description:\n 'A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.',\n in: getEvent('subscription renew', {\n timestamp: 1700000107,\n data: {\n plan_id: 'plan-pro',\n amount: 9.99,\n },\n }),\n mapping: {\n silent: true,\n settings: {\n revenue: {\n map: {\n productId: 'data.plan_id',\n price: 'data.amount',\n revenueType: { value: 'renewal' },\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'amplitude.revenue',\n {\n productId: 'plan-pro',\n price: 9.99,\n revenueType: 'renewal',\n currency: 'EUR',\n },\n ],\n ],\n};\n\n/**\n * Multi-product order - the canonical Amplitude ecommerce pattern.\n * `revenue.loop: [\"nested\", { map: ... }]` iterates event.nested and\n * resolves one revenue item per entry. Each becomes a separate\n * amplitude.revenue() call. The order-level track() fires once with\n * include-based event_properties.\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift. Products have `data.price`; the\n * gift has only `data.name`. The `condition` on the loop inner value\n * filters to products only (price must be present).\n */\nexport const orderCompleteMultiProduct: AmplitudeStepExample = {\n title: 'Multi-product order',\n description:\n 'An order fires one amplitude.revenue call per nested product plus a single track for the order totals.',\n in: getEvent('order complete', { timestamp: 1700000108 }),\n mapping: {\n include: ['data', 'globals'],\n settings: {\n revenue: {\n loop: [\n 'nested',\n {\n // Only iterate nested entries that have a price field (products).\n condition: (value: unknown) => {\n const v = value as { data?: { price?: unknown } };\n return typeof v?.data?.price === 'number';\n },\n map: {\n productId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n revenueType: { value: 'purchase' },\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n ],\n },\n },\n },\n out: [\n [\n 'amplitude.revenue',\n {\n productId: 'ers',\n price: 420,\n quantity: 1,\n revenueType: 'purchase',\n currency: 'EUR',\n },\n ],\n [\n 'amplitude.revenue',\n {\n productId: 'cc',\n price: 42,\n quantity: 1,\n revenueType: 'purchase',\n currency: 'EUR',\n },\n ],\n [\n 'amplitude.track',\n 'order complete',\n {\n data_id: '0rd3r1d',\n data_currency: 'EUR',\n data_shipping: 5.22,\n data_taxes: 73.76,\n data_total: 555,\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Group assignment + group properties. Typically used for B2B products\n * where a user belongs to a company. Both SDK calls fire on the same rule.\n */\nexport const groupAssignmentWithProperties: AmplitudeStepExample = {\n title: 'Group assignment',\n description:\n 'A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.',\n in: getEvent('company update', {\n timestamp: 1700000109,\n data: {\n company: 'Acme',\n industry: 'tech',\n employee_count: 50,\n founded_year: 2020,\n },\n }),\n mapping: {\n silent: true,\n settings: {\n group: {\n map: {\n type: { value: 'company' },\n name: 'data.company',\n },\n },\n groupIdentify: {\n map: {\n type: { value: 'company' },\n name: 'data.company',\n set: {\n map: {\n industry: 'data.industry',\n size: 'data.employee_count',\n },\n },\n setOnce: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n ['amplitude.setGroup', 'company', 'Acme'],\n [\n 'amplitude.groupIdentify',\n 'company',\n 'Acme',\n {\n set: {\n industry: 'tech',\n size: 50,\n },\n setOnce: {\n founded: 2020,\n },\n },\n ],\n ],\n};\n\n/**\n * Consent revoked → amplitude.setOptOut(true). The destination checks\n * the consent keys declared in config.consent and toggles optOut\n * accordingly (strict: all required keys must be granted).\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentRevokeOptOut: AmplitudeStepExample = {\n title: 'Consent revoked',\n description:\n 'With consent: { analytics: true } in the destination config, a walker consent command that denies analytics opts out of Amplitude tracking via setOptOut(true).',\n command: 'consent',\n before: { analytics: true },\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [\n ['amplitude.setOptOut', false],\n ['amplitude.setOptOut', true],\n ],\n};\n\n/**\n * Consent granted → amplitude.setOptOut(false).\n */\nexport const consentGrantOptIn: AmplitudeStepExample = {\n title: 'Consent granted',\n description:\n 'With consent: { analytics: true } in the destination config, a walker consent command that grants analytics opts into Amplitude tracking via setOptOut(false).',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n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AW,KAAK;AAAA,EAC1B,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK;AAAA,IACH,CAAC,uBAAuB,KAAK;AAAA,IAC7B,CAAC,uBAAuB,IAAI;AAAA,EAC9B;AACF;AAKO,IAAM,oBAA0C;AAAA,EACrD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,uBAAuB,KAAK,CAAC;AACtC;","names":["import_dev","import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your Amplitude project API key. Find it in your Amplitude project settings under \"General\" → \"API Keys\" (like a1b2c3d4e5f6789012345678abcdef12).',\n ),\n serverZone: z\n .enum(['US', 'EU'])\n .describe('Amplitude server zone. Default: US.')\n .optional(),\n flushIntervalMillis: z\n .number()\n .int()\n .positive()\n .describe('How often (in ms) to flush the event queue. Default: 1000.')\n .optional(),\n flushQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Max queued events before a flush. Default: 30.')\n .optional(),\n flushMaxRetries: z\n .number()\n .int()\n .nonnegative()\n .describe('Max retries on failed flush. Default: 5.')\n .optional(),\n transport: z\n .enum(['fetch', 'xhr', 'beacon'])\n .describe('HTTP transport. Default: fetch.')\n .optional(),\n useBatch: z\n .boolean()\n .describe(\n 'Use the Amplitude batch endpoint instead of the standard endpoint. Default: false.',\n )\n .optional(),\n appVersion: z\n .string()\n .describe('Application version; tagged onto every event.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an identity object. Keys: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.',\n )\n .optional(),\n sessionReplay: z\n .unknown()\n .describe(\n 'Session Replay options. When set, the Session Replay plugin starts; the other plugins start only from their own settings. It records a sampled share of sessions, set by the project sampling settings in Amplitude when present, else by sampleRate (default 0).',\n )\n .optional(),\n experiment: z\n .unknown()\n .describe(\n 'Feature Experiment options. The Experiment plugin starts only when they include `deploymentKey`; the other plugins start only from their own settings.',\n )\n .optional(),\n engagement: z\n .unknown()\n .describe(\n 'Guides & Surveys options object; `true` passes no options. When set, the Guides & Surveys plugin starts and loads its SDK from cdn.amplitude.com; the other plugins start only from their own settings.',\n )\n .optional(),\n })\n // Pass-through settings are loose: every other Amplitude BrowserOptions\n // key (serverUrl, defaultTracking, ...) is forwarded to the SDK as given.\n .loose();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to an object with any of: user, device, session, set, setOnce, add, append, prepend, preInsert, postInsert, remove, unset, clearAll.',\n )\n .optional(),\n revenue: z\n .unknown()\n .describe(\n 'Revenue mapping. Resolves to a single object or (via loop) an array of objects, each with: productId, price, quantity, revenueType, currency, revenue, receipt, receiptSig, eventProperties. One amplitude.revenue() call fires per item.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Group assignment. Resolves to { type, name } → amplitude.setGroup(type, name).',\n )\n .optional(),\n groupIdentify: z\n .unknown()\n .describe(\n 'Group properties. Resolves to { type, name, set?, setOnce?, ... } → amplitude.groupIdentify(type, name, identify).',\n )\n .optional(),\n reset: z\n .unknown()\n .describe(\n 'Logout trigger. Resolves to a truthy value → amplitude.reset() (clears userId, regenerates deviceId). Typically used with silent: true on a user logout rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, IdentifyInstance, RevenueInstance } from '../types';\n\n/**\n * Example environment configurations for the Amplitude destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.amplitude` undefined — the destination falls back\n * to the real `@amplitude/unified` module namespace.\n */\n\nconst noop = () => {};\nconst noopPromise = () => ({ promise: Promise.resolve() });\n\n/**\n * Minimal chainable Identify mock. The real SDK class has the same shape.\n * Tests spy by replacing these methods with jest.fn() in the test runner.\n */\nclass MockIdentify implements IdentifyInstance {\n _ops: Record<string, Record<string, unknown>> = {};\n\n private _record(op: string, prop: string, value?: unknown) {\n if (!this._ops[op]) this._ops[op] = {};\n this._ops[op][prop] = value;\n return this;\n }\n\n set(prop: string, value: unknown) {\n return this._record('set', prop, value);\n }\n setOnce(prop: string, value: unknown) {\n return this._record('setOnce', prop, value);\n }\n add(prop: string, value: unknown) {\n return this._record('add', prop, value);\n }\n append(prop: string, value: unknown) {\n return this._record('append', prop, value);\n }\n prepend(prop: string, value: unknown) {\n return this._record('prepend', prop, value);\n }\n preInsert(prop: string, value: unknown) {\n return this._record('preInsert', prop, value);\n }\n postInsert(prop: string, value: unknown) {\n return this._record('postInsert', prop, value);\n }\n remove(prop: string, value: unknown) {\n return this._record('remove', prop, value);\n }\n unset(prop: string) {\n return this._record('unset', prop);\n }\n clearAll() {\n this._ops['clearAll'] = {};\n return this;\n }\n\n toJSON() {\n return this._ops;\n }\n}\n\n/** Minimal chainable Revenue mock. */\nclass MockRevenue implements RevenueInstance {\n _data: Record<string, unknown> = {};\n\n setProductId(v: string) {\n this._data.productId = v;\n return this;\n }\n setPrice(v: number) {\n this._data.price = v;\n return this;\n }\n setQuantity(v: number) {\n this._data.quantity = v;\n return this;\n }\n setRevenueType(v: string) {\n this._data.revenueType = v;\n return this;\n }\n setCurrency(v: string) {\n this._data.currency = v;\n return this;\n }\n setRevenue(v: number) {\n this._data.revenue = v;\n return this;\n }\n setReceipt(v: string) {\n this._data.receipt = v;\n return this;\n }\n setReceiptSig(v: string) {\n this._data.receiptSig = v;\n return this;\n }\n setEventProperties(v: unknown) {\n this._data.eventProperties = v;\n return this;\n }\n\n toJSON() {\n return this._data;\n }\n}\n\n/**\n * Pre-init env — all methods are no-ops until the test runner wires spies.\n */\nexport const init: Env | undefined = {\n amplitude: {\n init: noopPromise,\n add: noopPromise,\n track: noop,\n identify: noop,\n revenue: noop,\n reset: noop,\n setOptOut: noop,\n setUserId: noop,\n setDeviceId: noop,\n setSessionId: noop,\n setGroup: noop,\n groupIdentify: noop,\n Identify: MockIdentify,\n Revenue: MockRevenue,\n },\n};\n\n/**\n * Post-init env — same shape. The test runner clones this and replaces\n * individual methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = {\n amplitude: {\n init: noopPromise,\n add: noopPromise,\n track: noop,\n identify: noop,\n revenue: noop,\n reset: noop,\n setOptOut: noop,\n setUserId: noop,\n setDeviceId: noop,\n setSessionId: noop,\n setGroup: noop,\n groupIdentify: noop,\n Identify: MockIdentify,\n Revenue: MockRevenue,\n },\n};\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:amplitude.init',\n 'call:amplitude.add',\n 'call:amplitude.track',\n 'call:amplitude.identify',\n 'call:amplitude.revenue',\n 'call:amplitude.reset',\n 'call:amplitude.setOptOut',\n 'call:amplitude.setUserId',\n 'call:amplitude.setDeviceId',\n 'call:amplitude.setSessionId',\n 'call:amplitude.setGroup',\n 'call:amplitude.groupIdentify',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { createEvent, getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings and/or an\n * `await` hint for async scenarios. The test runner reads `settings`\n * from the example and merges it into the base destination settings\n * on top of the fixed apiKey. `configInclude` is passed as config-level\n * include when registering the destination.\n */\nexport type AmplitudeStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes\n * amplitude.track(event.name, event_properties). With no mapping and\n * no destination-level include, event_properties is `{}`.\n */\nexport const defaultEventForwarding: AmplitudeStepExample = {\n title: 'Default track',\n description:\n 'A walker event is forwarded to Amplitude as an amplitude.track call with the event name and empty properties.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['amplitude.track', 'product view', {}]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: AmplitudeStepExample = {\n public: false,\n in: createEvent({ name: 'debug noise', timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Destination-level include (config.include) flattens the walkerOS `data`\n * section into prefixed event_properties on every push.\n */\nexport const destinationLevelInclude: AmplitudeStepExample = {\n title: 'Include data',\n description:\n \"With include: ['data'] in the destination config, the event data section is flattened into prefixed event_properties on every track call.\",\n in: getEvent('product view', { timestamp: 1700000102 }),\n configInclude: ['data'],\n out: [\n [\n 'amplitude.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n ],\n ],\n};\n\n/**\n * Per-rule include REPLACES the destination-level config.include for the\n * matched rule. Here destination-level sends `data`, but the rule\n * overrides it with `globals` only.\n */\nexport const ruleIncludeReplaces: AmplitudeStepExample = {\n title: 'Rule include overrides',\n description:\n \"With include: ['data'] in the destination config, the rule's include: ['globals'] replaces it, so this event forwards only globals.\",\n in: getEvent('order complete', { timestamp: 1700000103 }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'amplitude.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). The destination sets user/device/session IDs\n * and tracks them in runtime state; subsequent pushes with unchanged\n * values do NOT re-fire the setters.\n *\n * This example represents the first push in a fresh session. user.id,\n * user.device, user.session come from the walkerOS session fixture.\n *\n * The walkerOS fixture's user.session is 's3ss10n' (string). The\n * destination deterministically hashes non-numeric session strings via\n * djb2 so the same walkerOS session always maps to the same Amplitude\n * session number (cross-page-load consistency). djb2('s3ss10n') = 394324160.\n */\nexport const destinationLevelIdentify: AmplitudeStepExample = {\n title: 'Destination identify',\n description:\n \"With settings.identify mapping user, device, and session to 'user.id', 'user.device', and 'user.session', the destination sets userId, deviceId, and sessionId before the track call. A non-numeric session string is hashed to a stable number. Setters only re-fire when the resolved values change.\",\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n user: 'user.id',\n device: 'user.device',\n session: 'user.session',\n },\n },\n },\n out: [\n ['amplitude.setUserId', 'us3r'],\n ['amplitude.setDeviceId', 'c00k13'],\n ['amplitude.setSessionId', 394324160],\n ['amplitude.track', 'page view', {}],\n ],\n};\n\n/**\n * Per-event identify with the full operation vocabulary - this is the\n * \"user login\" pattern: set user_id, enrich user properties. `silent: true`\n * suppresses the default amplitude.track() call because we're running\n * identity side effects only.\n */\nexport const userLoginIdentify: AmplitudeStepExample = {\n title: 'User login identify',\n description:\n 'A user login sets the Amplitude userId and runs identify with set, setOnce, and add operations.',\n in: createEvent({\n name: 'user login',\n timestamp: 1700000105000,\n data: {\n user_id: 'new-user-123',\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n }),\n mapping: {\n silent: true,\n settings: {\n identify: {\n map: {\n user: 'data.user_id',\n set: {\n map: {\n plan: 'data.plan',\n company: 'data.company',\n email: 'data.email',\n },\n },\n setOnce: {\n map: {\n first_login: 'timestamp',\n },\n },\n add: {\n map: {\n login_count: { value: 1 },\n },\n },\n },\n },\n },\n },\n out: [\n ['amplitude.setUserId', 'new-user-123'],\n [\n 'amplitude.identify',\n {\n set: {\n plan: 'premium',\n company: 'Acme',\n email: 'user@acme.com',\n },\n setOnce: {\n first_login: 1700000105000,\n },\n add: {\n login_count: 1,\n },\n },\n ],\n ],\n};\n\n/**\n * User logout - reset: true fires amplitude.reset(), which clears userId\n * and regenerates deviceId. `silent: true` because we're only running the\n * reset side effect, no default track().\n */\nexport const userLogoutReset: AmplitudeStepExample = {\n title: 'User logout reset',\n description:\n 'A user logout calls amplitude.reset to clear the userId and regenerate the deviceId.',\n in: createEvent({ name: 'user logout', timestamp: 1700000106 }),\n mapping: {\n silent: true,\n settings: {\n reset: true,\n },\n },\n out: [['amplitude.reset']],\n};\n\n/**\n * Single-product revenue - resolves `settings.revenue` to one object and\n * fires one amplitude.revenue() call. Note the `{ key: \"data.currency\",\n * value: \"EUR\" }` fallback syntax: try data.currency, default to \"EUR\".\n *\n * The walkerOS default event has no data.currency, so the fallback fires.\n */\nexport const subscriptionRenewRevenue: AmplitudeStepExample = {\n title: 'Subscription revenue',\n description:\n 'A subscription renewal fires a single amplitude.revenue call with productId, price, and currency fallback.',\n in: createEvent({\n name: 'subscription renew',\n timestamp: 1700000107,\n data: {\n plan_id: 'plan-pro',\n amount: 9.99,\n },\n }),\n mapping: {\n silent: true,\n settings: {\n revenue: {\n map: {\n productId: 'data.plan_id',\n price: 'data.amount',\n revenueType: { value: 'renewal' },\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n },\n },\n out: [\n [\n 'amplitude.revenue',\n {\n productId: 'plan-pro',\n price: 9.99,\n revenueType: 'renewal',\n currency: 'EUR',\n },\n ],\n ],\n};\n\n/**\n * Multi-product order - the canonical Amplitude ecommerce pattern.\n * `revenue.loop: [\"nested\", { map: ... }]` iterates event.nested and\n * resolves one revenue item per entry. Each becomes a separate\n * amplitude.revenue() call. The order-level track() fires once with\n * include-based event_properties.\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift. Products have `data.price`; the\n * gift has only `data.name`. The `condition` on the loop inner value\n * filters to products only (price must be present).\n */\nexport const orderCompleteMultiProduct: AmplitudeStepExample = {\n title: 'Multi-product order',\n description:\n 'An order fires one amplitude.revenue call per nested product plus a single track for the order totals.',\n in: getEvent('order complete', { timestamp: 1700000108 }),\n mapping: {\n include: ['data', 'globals'],\n settings: {\n revenue: {\n loop: [\n 'nested',\n {\n // Only iterate nested entries that have a price field (products).\n condition: (value: unknown) => {\n const v = value as { data?: { price?: unknown } };\n return typeof v?.data?.price === 'number';\n },\n map: {\n productId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n revenueType: { value: 'purchase' },\n currency: { key: 'data.currency', value: 'EUR' },\n },\n },\n ],\n },\n },\n },\n out: [\n [\n 'amplitude.revenue',\n {\n productId: 'ers',\n price: 420,\n quantity: 1,\n revenueType: 'purchase',\n currency: 'EUR',\n },\n ],\n [\n 'amplitude.revenue',\n {\n productId: 'cc',\n price: 42,\n quantity: 1,\n revenueType: 'purchase',\n currency: 'EUR',\n },\n ],\n [\n 'amplitude.track',\n 'order complete',\n {\n data_id: '0rd3r1d',\n data_currency: 'EUR',\n data_shipping: 5.22,\n data_taxes: 73.76,\n data_value: 555,\n globals_pagegroup: 'shop',\n },\n ],\n ],\n};\n\n/**\n * Group assignment + group properties. Typically used for B2B products\n * where a user belongs to a company. Both SDK calls fire on the same rule.\n */\nexport const groupAssignmentWithProperties: AmplitudeStepExample = {\n title: 'Group assignment',\n description:\n 'A company update assigns the user to a group and sets group properties via setGroup and groupIdentify.',\n in: createEvent({\n name: 'company update',\n timestamp: 1700000109,\n data: {\n company: 'Acme',\n industry: 'tech',\n employee_count: 50,\n founded_year: 2020,\n },\n }),\n mapping: {\n silent: true,\n settings: {\n group: {\n map: {\n type: { value: 'company' },\n name: 'data.company',\n },\n },\n groupIdentify: {\n map: {\n type: { value: 'company' },\n name: 'data.company',\n set: {\n map: {\n industry: 'data.industry',\n size: 'data.employee_count',\n },\n },\n setOnce: {\n map: {\n founded: 'data.founded_year',\n },\n },\n },\n },\n },\n },\n out: [\n ['amplitude.setGroup', 'company', 'Acme'],\n [\n 'amplitude.groupIdentify',\n 'company',\n 'Acme',\n {\n set: {\n industry: 'tech',\n size: 50,\n },\n setOnce: {\n founded: 2020,\n },\n },\n ],\n ],\n};\n\n/**\n * Consent revoked → amplitude.setOptOut(true). The destination checks\n * the consent keys declared in config.consent and toggles optOut\n * accordingly (strict: all required keys must be granted).\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentRevokeOptOut: AmplitudeStepExample = {\n title: 'Consent revoked',\n description:\n 'With consent: { analytics: true } in the destination config, a walker consent command that denies analytics opts out of Amplitude tracking via setOptOut(true).',\n command: 'consent',\n before: { analytics: true },\n in: { analytics: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [\n ['amplitude.setOptOut', false],\n ['amplitude.setOptOut', true],\n ],\n};\n\n/**\n * Consent granted → amplitude.setOptOut(false).\n */\nexport const consentGrantOptIn: AmplitudeStepExample = {\n title: 'Consent granted',\n description:\n 'With consent: { analytics: true } in the destination config, a walker consent command that grants analytics opts into Amplitude tracking via setOptOut(false).',\n command: 'consent',\n in: { analytics: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['amplitude.setOptOut', false]],\n};\n\n/** A silent rule without settings of its own calls nothing. */\nexport const silentRule: AmplitudeStepExample = {\n public: false,\n description: 'A rule with silent: true and no settings calls nothing.',\n in: getEvent('page view', { timestamp: 1700000120 }),\n mapping: { silent: true },\n out: [],\n};\n\n/**\n * The silent group rule of groupAssignmentWithProperties on an update\n * without data: no group resolves, so nothing is sent. A declared skip: an\n * unmet mapping, not a failure.\n */\nexport const groupAssignmentWithoutData: AmplitudeStepExample = {\n public: false,\n description:\n 'A silent rule whose group mapping finds no company sends nothing: an unmet mapping, not a failure, so the push returns normally.',\n in: { name: 'company update', entity: 'company', action: 'update' },\n mapping: groupAssignmentWithProperties.mapping,\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,YAAY,aACT,KAAK,CAAC,MAAM,IAAI,CAAC,EACjB,SAAS,qCAAqC,EAC9C,SAAS;AAAA,EACZ,qBAAqB,aAClB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,4DAA4D,EACrE,SAAS;AAAA,EACZ,gBAAgB,aACb,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,iBAAiB,aACd,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,SAAS,0CAA0C,EACnD,SAAS;AAAA,EACZ,WAAW,aACR,KAAK,CAAC,SAAS,OAAO,QAAQ,CAAC,EAC/B,SAAS,iCAAiC,EAC1C,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,aACT,OAAO,EACP,SAAS,+CAA+C,EACxD,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,eAAe,aACZ,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,aACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,aACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EAGA,MAAM;;;ACzET,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,c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