@walkeros/server-destination-rudderstack 3.4.0-next-1776749829492

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,162 @@
1
+ import { Mapping, Flow } from '@walkeros/core';
2
+ import { DestinationServer } from '@walkeros/server-core';
3
+
4
+ interface Settings {
5
+ /** RudderStack source write key (required). */
6
+ writeKey: string;
7
+ /** RudderStack data plane URL (required). */
8
+ dataPlaneUrl: string;
9
+ /** walkerOS mapping value path to resolve userId from each event. */
10
+ userId?: string;
11
+ /** walkerOS mapping value path to resolve anonymousId from each event. */
12
+ anonymousId?: string;
13
+ /** Destination-level identity mapping (fires identify() on first push / change). */
14
+ identify?: Mapping.Value;
15
+ /** Destination-level group mapping (fires group() on first push / change). */
16
+ group?: Mapping.Value;
17
+ /** Downstream destination filtering. Passthrough to SDK integrations param. */
18
+ integrations?: Record<string, boolean | Record<string, unknown>>;
19
+ /** API path. Default: '/v1/batch'. */
20
+ path?: string;
21
+ /** Events to enqueue before flushing. Default: 20. */
22
+ flushAt?: number;
23
+ /** Max milliseconds before auto-flush. Default: 10000. */
24
+ flushInterval?: number;
25
+ /** Maximum batch payload size in bytes. Default: 460800 (~500KB). */
26
+ maxQueueSize?: number;
27
+ /** Maximum in-memory queue length. Default: 20000. */
28
+ maxInternalQueueSize?: number;
29
+ /** Log level. Default: 'info'. */
30
+ logLevel?: string;
31
+ /** Retry attempts for failed batches. Default: 3. */
32
+ retryCount?: number;
33
+ /** Completely disable the SDK. Default: false. */
34
+ enable?: boolean;
35
+ /** Enable gzip compression. Default: true. */
36
+ gzip?: boolean;
37
+ /** Runtime state -- not user-facing. Mutated by init/push. */
38
+ _analytics?: unknown;
39
+ _state?: RuntimeState;
40
+ }
41
+ interface RuntimeState {
42
+ lastIdentity?: {
43
+ userId?: string;
44
+ anonymousId?: string;
45
+ traitsHash?: string;
46
+ };
47
+ lastGroup?: {
48
+ groupId?: string;
49
+ traitsHash?: string;
50
+ };
51
+ }
52
+ /**
53
+ * Env -- optional SDK override. Production leaves this undefined and the
54
+ * destination creates a real Analytics instance. Tests provide a mock via
55
+ * env.analytics.
56
+ */
57
+ interface Env extends DestinationServer.Env {
58
+ analytics?: RudderStackAnalyticsMock;
59
+ }
60
+ /**
61
+ * Mock-friendly interface for the Analytics instance methods the
62
+ * destination actually calls. Tests can provide this via env.analytics
63
+ * instead of the real SDK.
64
+ */
65
+ interface RudderStackAnalyticsMock {
66
+ track: (params: Record<string, unknown>) => void;
67
+ identify: (params: Record<string, unknown>) => void;
68
+ group: (params: Record<string, unknown>) => void;
69
+ page: (params: Record<string, unknown>) => void;
70
+ screen: (params: Record<string, unknown>) => void;
71
+ alias: (params: Record<string, unknown>) => void;
72
+ flush: (callback?: (err?: Error, data?: unknown) => void) => Promise<void>;
73
+ }
74
+
75
+ declare const push: Env;
76
+ declare const simulation: string[];
77
+
78
+ declare const env_push: typeof push;
79
+ declare const env_simulation: typeof simulation;
80
+ declare namespace env {
81
+ export { env_push as push, env_simulation as simulation };
82
+ }
83
+
84
+ /**
85
+ * Extended step example that may carry destination-level settings overrides.
86
+ */
87
+ type RudderStackStepExample = Flow.StepExample & {
88
+ settings?: Partial<Settings>;
89
+ };
90
+ /**
91
+ * RudderStack server destination invokes the injected `env.analytics` SDK
92
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a
93
+ * raw HTTP endpoint. Each `out` entry is therefore
94
+ * `[callable, params]` where `callable` is the dotted method name
95
+ * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
96
+ *
97
+ * Examples may emit multiple calls in order (e.g. identify + track), so
98
+ * every `out` is wrapped as `[[callable, params], ...]`.
99
+ */
100
+ /**
101
+ * Default event forwarding -- analytics.track() with event name and empty
102
+ * properties. userId resolved from default settings.userId = 'user.id'.
103
+ */
104
+ declare const defaultTrack: RudderStackStepExample;
105
+ /**
106
+ * Mapped event name -- mapping.name renames the event for RudderStack.
107
+ */
108
+ declare const mappedEventName: RudderStackStepExample;
109
+ /**
110
+ * Destination-level identify -- fires analytics.identify() on first push
111
+ * when settings.identify mapping resolves. Then fires analytics.track().
112
+ */
113
+ declare const destinationIdentify: RudderStackStepExample;
114
+ /**
115
+ * Per-event identify with skip -- user login fires identify() only.
116
+ */
117
+ declare const userLoginIdentify: RudderStackStepExample;
118
+ /**
119
+ * Per-event group with skip -- company update fires group() only.
120
+ */
121
+ declare const companyGroup: RudderStackStepExample;
122
+ /**
123
+ * Explicit page() call with properties. RudderStack requires name -- resolved
124
+ * from mapping. skip: true suppresses track().
125
+ */
126
+ declare const pageView: RudderStackStepExample;
127
+ /**
128
+ * Screen call -- server-only method for mobile app backends.
129
+ * RudderStack requires name -- resolved from mapping.
130
+ */
131
+ declare const screenView: RudderStackStepExample;
132
+ /**
133
+ * Alias call -- links anonymous user identity to registered user.
134
+ * skip: true suppresses track(). Requires previousId from mapping.
135
+ */
136
+ declare const aliasUser: RudderStackStepExample;
137
+ /**
138
+ * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.
139
+ */
140
+ declare const anonymousOnly: RudderStackStepExample;
141
+ /**
142
+ * Wildcard ignore -- the event matches a mapping rule with ignore: true.
143
+ * The destination fires zero SDK calls.
144
+ */
145
+ declare const wildcardIgnored: RudderStackStepExample;
146
+
147
+ type step_RudderStackStepExample = RudderStackStepExample;
148
+ declare const step_aliasUser: typeof aliasUser;
149
+ declare const step_anonymousOnly: typeof anonymousOnly;
150
+ declare const step_companyGroup: typeof companyGroup;
151
+ declare const step_defaultTrack: typeof defaultTrack;
152
+ declare const step_destinationIdentify: typeof destinationIdentify;
153
+ declare const step_mappedEventName: typeof mappedEventName;
154
+ declare const step_pageView: typeof pageView;
155
+ declare const step_screenView: typeof screenView;
156
+ declare const step_userLoginIdentify: typeof userLoginIdentify;
157
+ declare const step_wildcardIgnored: typeof wildcardIgnored;
158
+ declare namespace step {
159
+ export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_pageView as pageView, step_screenView as screenView, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
160
+ }
161
+
162
+ export { env, step };
@@ -0,0 +1,162 @@
1
+ import { Mapping, Flow } from '@walkeros/core';
2
+ import { DestinationServer } from '@walkeros/server-core';
3
+
4
+ interface Settings {
5
+ /** RudderStack source write key (required). */
6
+ writeKey: string;
7
+ /** RudderStack data plane URL (required). */
8
+ dataPlaneUrl: string;
9
+ /** walkerOS mapping value path to resolve userId from each event. */
10
+ userId?: string;
11
+ /** walkerOS mapping value path to resolve anonymousId from each event. */
12
+ anonymousId?: string;
13
+ /** Destination-level identity mapping (fires identify() on first push / change). */
14
+ identify?: Mapping.Value;
15
+ /** Destination-level group mapping (fires group() on first push / change). */
16
+ group?: Mapping.Value;
17
+ /** Downstream destination filtering. Passthrough to SDK integrations param. */
18
+ integrations?: Record<string, boolean | Record<string, unknown>>;
19
+ /** API path. Default: '/v1/batch'. */
20
+ path?: string;
21
+ /** Events to enqueue before flushing. Default: 20. */
22
+ flushAt?: number;
23
+ /** Max milliseconds before auto-flush. Default: 10000. */
24
+ flushInterval?: number;
25
+ /** Maximum batch payload size in bytes. Default: 460800 (~500KB). */
26
+ maxQueueSize?: number;
27
+ /** Maximum in-memory queue length. Default: 20000. */
28
+ maxInternalQueueSize?: number;
29
+ /** Log level. Default: 'info'. */
30
+ logLevel?: string;
31
+ /** Retry attempts for failed batches. Default: 3. */
32
+ retryCount?: number;
33
+ /** Completely disable the SDK. Default: false. */
34
+ enable?: boolean;
35
+ /** Enable gzip compression. Default: true. */
36
+ gzip?: boolean;
37
+ /** Runtime state -- not user-facing. Mutated by init/push. */
38
+ _analytics?: unknown;
39
+ _state?: RuntimeState;
40
+ }
41
+ interface RuntimeState {
42
+ lastIdentity?: {
43
+ userId?: string;
44
+ anonymousId?: string;
45
+ traitsHash?: string;
46
+ };
47
+ lastGroup?: {
48
+ groupId?: string;
49
+ traitsHash?: string;
50
+ };
51
+ }
52
+ /**
53
+ * Env -- optional SDK override. Production leaves this undefined and the
54
+ * destination creates a real Analytics instance. Tests provide a mock via
55
+ * env.analytics.
56
+ */
57
+ interface Env extends DestinationServer.Env {
58
+ analytics?: RudderStackAnalyticsMock;
59
+ }
60
+ /**
61
+ * Mock-friendly interface for the Analytics instance methods the
62
+ * destination actually calls. Tests can provide this via env.analytics
63
+ * instead of the real SDK.
64
+ */
65
+ interface RudderStackAnalyticsMock {
66
+ track: (params: Record<string, unknown>) => void;
67
+ identify: (params: Record<string, unknown>) => void;
68
+ group: (params: Record<string, unknown>) => void;
69
+ page: (params: Record<string, unknown>) => void;
70
+ screen: (params: Record<string, unknown>) => void;
71
+ alias: (params: Record<string, unknown>) => void;
72
+ flush: (callback?: (err?: Error, data?: unknown) => void) => Promise<void>;
73
+ }
74
+
75
+ declare const push: Env;
76
+ declare const simulation: string[];
77
+
78
+ declare const env_push: typeof push;
79
+ declare const env_simulation: typeof simulation;
80
+ declare namespace env {
81
+ export { env_push as push, env_simulation as simulation };
82
+ }
83
+
84
+ /**
85
+ * Extended step example that may carry destination-level settings overrides.
86
+ */
87
+ type RudderStackStepExample = Flow.StepExample & {
88
+ settings?: Partial<Settings>;
89
+ };
90
+ /**
91
+ * RudderStack server destination invokes the injected `env.analytics` SDK
92
+ * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a
93
+ * raw HTTP endpoint. Each `out` entry is therefore
94
+ * `[callable, params]` where `callable` is the dotted method name
95
+ * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
96
+ *
97
+ * Examples may emit multiple calls in order (e.g. identify + track), so
98
+ * every `out` is wrapped as `[[callable, params], ...]`.
99
+ */
100
+ /**
101
+ * Default event forwarding -- analytics.track() with event name and empty
102
+ * properties. userId resolved from default settings.userId = 'user.id'.
103
+ */
104
+ declare const defaultTrack: RudderStackStepExample;
105
+ /**
106
+ * Mapped event name -- mapping.name renames the event for RudderStack.
107
+ */
108
+ declare const mappedEventName: RudderStackStepExample;
109
+ /**
110
+ * Destination-level identify -- fires analytics.identify() on first push
111
+ * when settings.identify mapping resolves. Then fires analytics.track().
112
+ */
113
+ declare const destinationIdentify: RudderStackStepExample;
114
+ /**
115
+ * Per-event identify with skip -- user login fires identify() only.
116
+ */
117
+ declare const userLoginIdentify: RudderStackStepExample;
118
+ /**
119
+ * Per-event group with skip -- company update fires group() only.
120
+ */
121
+ declare const companyGroup: RudderStackStepExample;
122
+ /**
123
+ * Explicit page() call with properties. RudderStack requires name -- resolved
124
+ * from mapping. skip: true suppresses track().
125
+ */
126
+ declare const pageView: RudderStackStepExample;
127
+ /**
128
+ * Screen call -- server-only method for mobile app backends.
129
+ * RudderStack requires name -- resolved from mapping.
130
+ */
131
+ declare const screenView: RudderStackStepExample;
132
+ /**
133
+ * Alias call -- links anonymous user identity to registered user.
134
+ * skip: true suppresses track(). Requires previousId from mapping.
135
+ */
136
+ declare const aliasUser: RudderStackStepExample;
137
+ /**
138
+ * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.
139
+ */
140
+ declare const anonymousOnly: RudderStackStepExample;
141
+ /**
142
+ * Wildcard ignore -- the event matches a mapping rule with ignore: true.
143
+ * The destination fires zero SDK calls.
144
+ */
145
+ declare const wildcardIgnored: RudderStackStepExample;
146
+
147
+ type step_RudderStackStepExample = RudderStackStepExample;
148
+ declare const step_aliasUser: typeof aliasUser;
149
+ declare const step_anonymousOnly: typeof anonymousOnly;
150
+ declare const step_companyGroup: typeof companyGroup;
151
+ declare const step_defaultTrack: typeof defaultTrack;
152
+ declare const step_destinationIdentify: typeof destinationIdentify;
153
+ declare const step_mappedEventName: typeof mappedEventName;
154
+ declare const step_pageView: typeof pageView;
155
+ declare const step_screenView: typeof screenView;
156
+ declare const step_userLoginIdentify: typeof userLoginIdentify;
157
+ declare const step_wildcardIgnored: typeof wildcardIgnored;
158
+ declare namespace step {
159
+ export { type step_RudderStackStepExample as RudderStackStepExample, step_aliasUser as aliasUser, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_defaultTrack as defaultTrack, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_pageView as pageView, step_screenView as screenView, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
160
+ }
161
+
162
+ export { env, step };
@@ -0,0 +1,369 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/examples/index.ts
21
+ var examples_exports = {};
22
+ __export(examples_exports, {
23
+ env: () => env_exports,
24
+ step: () => step_exports
25
+ });
26
+ module.exports = __toCommonJS(examples_exports);
27
+
28
+ // src/examples/env.ts
29
+ var env_exports = {};
30
+ __export(env_exports, {
31
+ push: () => push,
32
+ simulation: () => simulation
33
+ });
34
+ var noop = () => {
35
+ };
36
+ var asyncNoop = () => Promise.resolve();
37
+ function createMockAnalytics() {
38
+ return {
39
+ track: noop,
40
+ identify: noop,
41
+ group: noop,
42
+ page: noop,
43
+ screen: noop,
44
+ alias: noop,
45
+ flush: asyncNoop
46
+ };
47
+ }
48
+ var push = {
49
+ analytics: createMockAnalytics()
50
+ };
51
+ var simulation = [
52
+ "call:analytics.track",
53
+ "call:analytics.identify",
54
+ "call:analytics.group",
55
+ "call:analytics.page",
56
+ "call:analytics.screen",
57
+ "call:analytics.alias"
58
+ ];
59
+
60
+ // src/examples/step.ts
61
+ var step_exports = {};
62
+ __export(step_exports, {
63
+ aliasUser: () => aliasUser,
64
+ anonymousOnly: () => anonymousOnly,
65
+ companyGroup: () => companyGroup,
66
+ defaultTrack: () => defaultTrack,
67
+ destinationIdentify: () => destinationIdentify,
68
+ mappedEventName: () => mappedEventName,
69
+ pageView: () => pageView,
70
+ screenView: () => screenView,
71
+ userLoginIdentify: () => userLoginIdentify,
72
+ wildcardIgnored: () => wildcardIgnored
73
+ });
74
+ var import_core = require("@walkeros/core");
75
+ var defaultTrack = {
76
+ in: (0, import_core.getEvent)("product view", {
77
+ timestamp: 1700000100,
78
+ user: { id: "us3r", session: "s3ss10n" }
79
+ }),
80
+ out: [
81
+ [
82
+ "analytics.track",
83
+ {
84
+ userId: "us3r",
85
+ anonymousId: "s3ss10n",
86
+ event: "product view",
87
+ properties: {},
88
+ timestamp: /* @__PURE__ */ new Date(1700000100)
89
+ }
90
+ ]
91
+ ]
92
+ };
93
+ var mappedEventName = {
94
+ in: (0, import_core.getEvent)("order complete", {
95
+ timestamp: 1700000101,
96
+ user: { id: "us3r", session: "s3ss10n" }
97
+ }),
98
+ mapping: {
99
+ name: "Order Completed"
100
+ },
101
+ out: [
102
+ [
103
+ "analytics.track",
104
+ {
105
+ userId: "us3r",
106
+ anonymousId: "s3ss10n",
107
+ event: "Order Completed",
108
+ properties: {},
109
+ timestamp: /* @__PURE__ */ new Date(1700000101)
110
+ }
111
+ ]
112
+ ]
113
+ };
114
+ var destinationIdentify = {
115
+ in: (0, import_core.getEvent)("page view", {
116
+ timestamp: 1700000102,
117
+ user: { id: "us3r", session: "s3ss10n", email: "user@example.com" }
118
+ }),
119
+ settings: {
120
+ identify: {
121
+ map: {
122
+ traits: {
123
+ map: {
124
+ email: "user.email"
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ out: [
131
+ [
132
+ "analytics.identify",
133
+ {
134
+ userId: "us3r",
135
+ anonymousId: "s3ss10n",
136
+ traits: { email: "user@example.com" },
137
+ timestamp: /* @__PURE__ */ new Date(1700000102)
138
+ }
139
+ ],
140
+ [
141
+ "analytics.track",
142
+ {
143
+ userId: "us3r",
144
+ anonymousId: "s3ss10n",
145
+ event: "page view",
146
+ properties: {},
147
+ timestamp: /* @__PURE__ */ new Date(1700000102)
148
+ }
149
+ ]
150
+ ]
151
+ };
152
+ var userLoginIdentify = {
153
+ in: (0, import_core.getEvent)("user login", {
154
+ timestamp: 1700000103,
155
+ user: { id: "us3r", session: "s3ss10n" },
156
+ data: {
157
+ user_id: "new-user-123",
158
+ email: "user@acme.com",
159
+ name: "Jane Doe",
160
+ plan: "premium"
161
+ }
162
+ }),
163
+ mapping: {
164
+ skip: true,
165
+ settings: {
166
+ identify: {
167
+ map: {
168
+ userId: "data.user_id",
169
+ traits: {
170
+ map: {
171
+ email: "data.email",
172
+ name: "data.name",
173
+ plan: "data.plan"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ out: [
181
+ [
182
+ "analytics.identify",
183
+ {
184
+ userId: "new-user-123",
185
+ anonymousId: "s3ss10n",
186
+ traits: { email: "user@acme.com", name: "Jane Doe", plan: "premium" },
187
+ timestamp: /* @__PURE__ */ new Date(1700000103)
188
+ }
189
+ ]
190
+ ]
191
+ };
192
+ var companyGroup = {
193
+ in: (0, import_core.getEvent)("company update", {
194
+ timestamp: 1700000104,
195
+ user: { id: "us3r", session: "s3ss10n" },
196
+ data: {
197
+ company_id: "comp-456",
198
+ company_name: "Acme",
199
+ industry: "tech",
200
+ employees: 50
201
+ }
202
+ }),
203
+ mapping: {
204
+ skip: true,
205
+ settings: {
206
+ group: {
207
+ map: {
208
+ groupId: "data.company_id",
209
+ traits: {
210
+ map: {
211
+ name: "data.company_name",
212
+ industry: "data.industry",
213
+ employees: "data.employees"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ },
220
+ out: [
221
+ [
222
+ "analytics.group",
223
+ {
224
+ userId: "us3r",
225
+ anonymousId: "s3ss10n",
226
+ groupId: "comp-456",
227
+ traits: { name: "Acme", industry: "tech", employees: 50 },
228
+ timestamp: /* @__PURE__ */ new Date(1700000104)
229
+ }
230
+ ]
231
+ ]
232
+ };
233
+ var pageView = {
234
+ in: (0, import_core.getEvent)("page view", {
235
+ timestamp: 1700000105,
236
+ user: { id: "us3r", session: "s3ss10n" },
237
+ data: {
238
+ title: "Getting Started",
239
+ section: "tutorials"
240
+ }
241
+ }),
242
+ mapping: {
243
+ skip: true,
244
+ settings: {
245
+ page: {
246
+ map: {
247
+ name: "data.title",
248
+ properties: {
249
+ map: {
250
+ section: "data.section"
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ },
257
+ out: [
258
+ [
259
+ "analytics.page",
260
+ {
261
+ userId: "us3r",
262
+ anonymousId: "s3ss10n",
263
+ name: "Getting Started",
264
+ properties: { section: "tutorials" },
265
+ timestamp: /* @__PURE__ */ new Date(1700000105)
266
+ }
267
+ ]
268
+ ]
269
+ };
270
+ var screenView = {
271
+ in: (0, import_core.getEvent)("screen view", {
272
+ timestamp: 1700000106,
273
+ user: { id: "us3r", session: "s3ss10n" },
274
+ data: {
275
+ screen_name: "Welcome",
276
+ section: "onboarding",
277
+ build: "1.2.3"
278
+ }
279
+ }),
280
+ mapping: {
281
+ skip: true,
282
+ settings: {
283
+ screen: {
284
+ map: {
285
+ name: "data.screen_name",
286
+ properties: {
287
+ map: {
288
+ build: "data.build"
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+ },
295
+ out: [
296
+ [
297
+ "analytics.screen",
298
+ {
299
+ userId: "us3r",
300
+ anonymousId: "s3ss10n",
301
+ name: "Welcome",
302
+ properties: { build: "1.2.3" },
303
+ timestamp: /* @__PURE__ */ new Date(1700000106)
304
+ }
305
+ ]
306
+ ]
307
+ };
308
+ var aliasUser = {
309
+ in: (0, import_core.getEvent)("identity merge", {
310
+ timestamp: 1700000107,
311
+ user: { id: "registered-456", session: "s3ss10n" },
312
+ data: {
313
+ anonymous_id: "anonymous-123"
314
+ }
315
+ }),
316
+ mapping: {
317
+ skip: true,
318
+ settings: {
319
+ alias: {
320
+ map: {
321
+ previousId: "data.anonymous_id"
322
+ }
323
+ }
324
+ }
325
+ },
326
+ out: [
327
+ [
328
+ "analytics.alias",
329
+ {
330
+ userId: "registered-456",
331
+ previousId: "anonymous-123",
332
+ timestamp: /* @__PURE__ */ new Date(1700000107)
333
+ }
334
+ ]
335
+ ]
336
+ };
337
+ var anonymousOnly = {
338
+ in: (0, import_core.getEvent)("product view", {
339
+ timestamp: 1700000108,
340
+ user: { session: "s3ss10n" }
341
+ }),
342
+ settings: {
343
+ userId: void 0
344
+ },
345
+ out: [
346
+ [
347
+ "analytics.track",
348
+ {
349
+ anonymousId: "s3ss10n",
350
+ event: "product view",
351
+ properties: {},
352
+ timestamp: /* @__PURE__ */ new Date(1700000108)
353
+ }
354
+ ]
355
+ ]
356
+ };
357
+ var wildcardIgnored = {
358
+ in: (0, import_core.getEvent)("debug noise", {
359
+ timestamp: 1700000109,
360
+ user: { id: "us3r", session: "s3ss10n" }
361
+ }),
362
+ mapping: { ignore: true },
363
+ out: []
364
+ };
365
+ // Annotate the CommonJS export names for ESM import in node:
366
+ 0 && (module.exports = {
367
+ env,
368
+ step
369
+ });