@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.
- package/README.md +76 -0
- package/dist/dev.d.mts +211 -0
- package/dist/dev.d.ts +211 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +162 -0
- package/dist/examples/index.d.ts +162 -0
- package/dist/examples/index.js +369 -0
- package/dist/examples/index.mjs +347 -0
- package/dist/index.d.mts +122 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/walkerOS.json +1012 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @walkeros/server-destination-rudderstack
|
|
2
|
+
|
|
3
|
+
Server-side RudderStack CDP destination for
|
|
4
|
+
[walkerOS](https://github.com/elbwalker/walkerOS). Forwards events to
|
|
5
|
+
RudderStack via the official `@rudderstack/rudder-sdk-node` SDK with full
|
|
6
|
+
Segment Spec support (Track, Identify, Group, Page, Screen, Alias).
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @walkeros/server-destination-rudderstack
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"destinations": {
|
|
19
|
+
"rudderstack": {
|
|
20
|
+
"package": "@walkeros/server-destination-rudderstack",
|
|
21
|
+
"config": {
|
|
22
|
+
"settings": {
|
|
23
|
+
"writeKey": "YOUR_RUDDERSTACK_WRITE_KEY",
|
|
24
|
+
"dataPlaneUrl": "https://your-data-plane.rudderstack.com",
|
|
25
|
+
"userId": "user.id",
|
|
26
|
+
"anonymousId": "user.session"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Settings
|
|
35
|
+
|
|
36
|
+
| Setting | Type | Required | Default | Description |
|
|
37
|
+
| --------------- | ------------ | -------- | ---------------- | ----------------------------------------------- |
|
|
38
|
+
| `writeKey` | string | Yes | -- | RudderStack source write key |
|
|
39
|
+
| `dataPlaneUrl` | string | Yes | -- | RudderStack data plane URL |
|
|
40
|
+
| `userId` | string | No | `'user.id'` | Mapping path to resolve userId from events |
|
|
41
|
+
| `anonymousId` | string | No | `'user.session'` | Mapping path to resolve anonymousId from events |
|
|
42
|
+
| `identify` | MappingValue | No | -- | Destination-level identity mapping |
|
|
43
|
+
| `group` | MappingValue | No | -- | Destination-level group mapping |
|
|
44
|
+
| `flushAt` | number | No | `20` | Events to enqueue before flushing |
|
|
45
|
+
| `flushInterval` | number | No | `10000` | Max ms before auto-flush |
|
|
46
|
+
| `retryCount` | number | No | `3` | Retry attempts for failed batches |
|
|
47
|
+
| `gzip` | boolean | No | `true` | Enable gzip compression |
|
|
48
|
+
| `integrations` | Record | No | -- | Downstream destination filtering |
|
|
49
|
+
|
|
50
|
+
## Mapping Settings
|
|
51
|
+
|
|
52
|
+
Per-event mapping settings control which RudderStack methods are called:
|
|
53
|
+
|
|
54
|
+
| Setting | Effect | Use with `skip: true` |
|
|
55
|
+
| ---------- | ---------------------------- | ------------------------ |
|
|
56
|
+
| `identify` | Calls `analytics.identify()` | Yes, for login events |
|
|
57
|
+
| `group` | Calls `analytics.group()` | Yes, for company events |
|
|
58
|
+
| `page` | Calls `analytics.page()` | Yes, for page views |
|
|
59
|
+
| `screen` | Calls `analytics.screen()` | Yes, for mobile screens |
|
|
60
|
+
| `alias` | Calls `analytics.alias()` | Yes, for identity merges |
|
|
61
|
+
|
|
62
|
+
## Identity
|
|
63
|
+
|
|
64
|
+
Server-side RudderStack requires identity on every call. The destination
|
|
65
|
+
resolves `userId` and `anonymousId` from each event via the configured mapping
|
|
66
|
+
paths and attaches them to every SDK call.
|
|
67
|
+
|
|
68
|
+
## Alias
|
|
69
|
+
|
|
70
|
+
RudderStack supports `alias()` for linking anonymous and identified user
|
|
71
|
+
profiles. Configure via `mapping.settings.alias` with a `previousId` field.
|
|
72
|
+
|
|
73
|
+
## Shutdown
|
|
74
|
+
|
|
75
|
+
The destination implements `destroy()` calling `analytics.flush()` to ensure
|
|
76
|
+
buffered events are sent before process exit.
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
4
|
+
import { DestinationServer } from '@walkeros/server-core';
|
|
5
|
+
|
|
6
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
7
|
+
writeKey: z.ZodString;
|
|
8
|
+
dataPlaneUrl: z.ZodString;
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
anonymousId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
flushAt: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
maxQueueSize: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
maxInternalQueueSize: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
logLevel: z.ZodOptional<z.ZodString>;
|
|
17
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
gzip: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
21
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
22
|
+
integrations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
25
|
+
|
|
26
|
+
declare const MappingSchema: z.ZodObject<{
|
|
27
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
29
|
+
page: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
screen: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
+
alias: z.ZodOptional<z.ZodUnknown>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
34
|
+
|
|
35
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
36
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
37
|
+
|
|
38
|
+
type index$1_Mapping = Mapping;
|
|
39
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
40
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
41
|
+
declare const index$1_mapping: typeof mapping;
|
|
42
|
+
declare const index$1_settings: typeof settings;
|
|
43
|
+
declare namespace index$1 {
|
|
44
|
+
export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface Settings {
|
|
48
|
+
/** RudderStack source write key (required). */
|
|
49
|
+
writeKey: string;
|
|
50
|
+
/** RudderStack data plane URL (required). */
|
|
51
|
+
dataPlaneUrl: string;
|
|
52
|
+
/** walkerOS mapping value path to resolve userId from each event. */
|
|
53
|
+
userId?: string;
|
|
54
|
+
/** walkerOS mapping value path to resolve anonymousId from each event. */
|
|
55
|
+
anonymousId?: string;
|
|
56
|
+
/** Destination-level identity mapping (fires identify() on first push / change). */
|
|
57
|
+
identify?: Mapping$1.Value;
|
|
58
|
+
/** Destination-level group mapping (fires group() on first push / change). */
|
|
59
|
+
group?: Mapping$1.Value;
|
|
60
|
+
/** Downstream destination filtering. Passthrough to SDK integrations param. */
|
|
61
|
+
integrations?: Record<string, boolean | Record<string, unknown>>;
|
|
62
|
+
/** API path. Default: '/v1/batch'. */
|
|
63
|
+
path?: string;
|
|
64
|
+
/** Events to enqueue before flushing. Default: 20. */
|
|
65
|
+
flushAt?: number;
|
|
66
|
+
/** Max milliseconds before auto-flush. Default: 10000. */
|
|
67
|
+
flushInterval?: number;
|
|
68
|
+
/** Maximum batch payload size in bytes. Default: 460800 (~500KB). */
|
|
69
|
+
maxQueueSize?: number;
|
|
70
|
+
/** Maximum in-memory queue length. Default: 20000. */
|
|
71
|
+
maxInternalQueueSize?: number;
|
|
72
|
+
/** Log level. Default: 'info'. */
|
|
73
|
+
logLevel?: string;
|
|
74
|
+
/** Retry attempts for failed batches. Default: 3. */
|
|
75
|
+
retryCount?: number;
|
|
76
|
+
/** Completely disable the SDK. Default: false. */
|
|
77
|
+
enable?: boolean;
|
|
78
|
+
/** Enable gzip compression. Default: true. */
|
|
79
|
+
gzip?: boolean;
|
|
80
|
+
/** Runtime state -- not user-facing. Mutated by init/push. */
|
|
81
|
+
_analytics?: unknown;
|
|
82
|
+
_state?: RuntimeState;
|
|
83
|
+
}
|
|
84
|
+
interface RuntimeState {
|
|
85
|
+
lastIdentity?: {
|
|
86
|
+
userId?: string;
|
|
87
|
+
anonymousId?: string;
|
|
88
|
+
traitsHash?: string;
|
|
89
|
+
};
|
|
90
|
+
lastGroup?: {
|
|
91
|
+
groupId?: string;
|
|
92
|
+
traitsHash?: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Env -- optional SDK override. Production leaves this undefined and the
|
|
97
|
+
* destination creates a real Analytics instance. Tests provide a mock via
|
|
98
|
+
* env.analytics.
|
|
99
|
+
*/
|
|
100
|
+
interface Env extends DestinationServer.Env {
|
|
101
|
+
analytics?: RudderStackAnalyticsMock;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Mock-friendly interface for the Analytics instance methods the
|
|
105
|
+
* destination actually calls. Tests can provide this via env.analytics
|
|
106
|
+
* instead of the real SDK.
|
|
107
|
+
*/
|
|
108
|
+
interface RudderStackAnalyticsMock {
|
|
109
|
+
track: (params: Record<string, unknown>) => void;
|
|
110
|
+
identify: (params: Record<string, unknown>) => void;
|
|
111
|
+
group: (params: Record<string, unknown>) => void;
|
|
112
|
+
page: (params: Record<string, unknown>) => void;
|
|
113
|
+
screen: (params: Record<string, unknown>) => void;
|
|
114
|
+
alias: (params: Record<string, unknown>) => void;
|
|
115
|
+
flush: (callback?: (err?: Error, data?: unknown) => void) => Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare const push: Env;
|
|
119
|
+
declare const simulation: string[];
|
|
120
|
+
|
|
121
|
+
declare const env_push: typeof push;
|
|
122
|
+
declare const env_simulation: typeof simulation;
|
|
123
|
+
declare namespace env {
|
|
124
|
+
export { env_push as push, env_simulation as simulation };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
129
|
+
*/
|
|
130
|
+
type RudderStackStepExample = Flow.StepExample & {
|
|
131
|
+
settings?: Partial<Settings>;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* RudderStack server destination invokes the injected `env.analytics` SDK
|
|
135
|
+
* methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a
|
|
136
|
+
* raw HTTP endpoint. Each `out` entry is therefore
|
|
137
|
+
* `[callable, params]` where `callable` is the dotted method name
|
|
138
|
+
* (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
|
|
139
|
+
*
|
|
140
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
141
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* Default event forwarding -- analytics.track() with event name and empty
|
|
145
|
+
* properties. userId resolved from default settings.userId = 'user.id'.
|
|
146
|
+
*/
|
|
147
|
+
declare const defaultTrack: RudderStackStepExample;
|
|
148
|
+
/**
|
|
149
|
+
* Mapped event name -- mapping.name renames the event for RudderStack.
|
|
150
|
+
*/
|
|
151
|
+
declare const mappedEventName: RudderStackStepExample;
|
|
152
|
+
/**
|
|
153
|
+
* Destination-level identify -- fires analytics.identify() on first push
|
|
154
|
+
* when settings.identify mapping resolves. Then fires analytics.track().
|
|
155
|
+
*/
|
|
156
|
+
declare const destinationIdentify: RudderStackStepExample;
|
|
157
|
+
/**
|
|
158
|
+
* Per-event identify with skip -- user login fires identify() only.
|
|
159
|
+
*/
|
|
160
|
+
declare const userLoginIdentify: RudderStackStepExample;
|
|
161
|
+
/**
|
|
162
|
+
* Per-event group with skip -- company update fires group() only.
|
|
163
|
+
*/
|
|
164
|
+
declare const companyGroup: RudderStackStepExample;
|
|
165
|
+
/**
|
|
166
|
+
* Explicit page() call with properties. RudderStack requires name -- resolved
|
|
167
|
+
* from mapping. skip: true suppresses track().
|
|
168
|
+
*/
|
|
169
|
+
declare const pageView: RudderStackStepExample;
|
|
170
|
+
/**
|
|
171
|
+
* Screen call -- server-only method for mobile app backends.
|
|
172
|
+
* RudderStack requires name -- resolved from mapping.
|
|
173
|
+
*/
|
|
174
|
+
declare const screenView: RudderStackStepExample;
|
|
175
|
+
/**
|
|
176
|
+
* Alias call -- links anonymous user identity to registered user.
|
|
177
|
+
* skip: true suppresses track(). Requires previousId from mapping.
|
|
178
|
+
*/
|
|
179
|
+
declare const aliasUser: RudderStackStepExample;
|
|
180
|
+
/**
|
|
181
|
+
* AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.
|
|
182
|
+
*/
|
|
183
|
+
declare const anonymousOnly: RudderStackStepExample;
|
|
184
|
+
/**
|
|
185
|
+
* Wildcard ignore -- the event matches a mapping rule with ignore: true.
|
|
186
|
+
* The destination fires zero SDK calls.
|
|
187
|
+
*/
|
|
188
|
+
declare const wildcardIgnored: RudderStackStepExample;
|
|
189
|
+
|
|
190
|
+
type step_RudderStackStepExample = RudderStackStepExample;
|
|
191
|
+
declare const step_aliasUser: typeof aliasUser;
|
|
192
|
+
declare const step_anonymousOnly: typeof anonymousOnly;
|
|
193
|
+
declare const step_companyGroup: typeof companyGroup;
|
|
194
|
+
declare const step_defaultTrack: typeof defaultTrack;
|
|
195
|
+
declare const step_destinationIdentify: typeof destinationIdentify;
|
|
196
|
+
declare const step_mappedEventName: typeof mappedEventName;
|
|
197
|
+
declare const step_pageView: typeof pageView;
|
|
198
|
+
declare const step_screenView: typeof screenView;
|
|
199
|
+
declare const step_userLoginIdentify: typeof userLoginIdentify;
|
|
200
|
+
declare const step_wildcardIgnored: typeof wildcardIgnored;
|
|
201
|
+
declare namespace step {
|
|
202
|
+
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 };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare const index_env: typeof env;
|
|
206
|
+
declare const index_step: typeof step;
|
|
207
|
+
declare namespace index {
|
|
208
|
+
export { index_env as env, index_step as step };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
4
|
+
import { DestinationServer } from '@walkeros/server-core';
|
|
5
|
+
|
|
6
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
7
|
+
writeKey: z.ZodString;
|
|
8
|
+
dataPlaneUrl: z.ZodString;
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
anonymousId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
flushAt: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
maxQueueSize: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
maxInternalQueueSize: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
logLevel: z.ZodOptional<z.ZodString>;
|
|
17
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
enable: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
gzip: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
21
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
22
|
+
integrations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
25
|
+
|
|
26
|
+
declare const MappingSchema: z.ZodObject<{
|
|
27
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
29
|
+
page: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
screen: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
+
alias: z.ZodOptional<z.ZodUnknown>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
34
|
+
|
|
35
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
36
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
37
|
+
|
|
38
|
+
type index$1_Mapping = Mapping;
|
|
39
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
40
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
41
|
+
declare const index$1_mapping: typeof mapping;
|
|
42
|
+
declare const index$1_settings: typeof settings;
|
|
43
|
+
declare namespace index$1 {
|
|
44
|
+
export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface Settings {
|
|
48
|
+
/** RudderStack source write key (required). */
|
|
49
|
+
writeKey: string;
|
|
50
|
+
/** RudderStack data plane URL (required). */
|
|
51
|
+
dataPlaneUrl: string;
|
|
52
|
+
/** walkerOS mapping value path to resolve userId from each event. */
|
|
53
|
+
userId?: string;
|
|
54
|
+
/** walkerOS mapping value path to resolve anonymousId from each event. */
|
|
55
|
+
anonymousId?: string;
|
|
56
|
+
/** Destination-level identity mapping (fires identify() on first push / change). */
|
|
57
|
+
identify?: Mapping$1.Value;
|
|
58
|
+
/** Destination-level group mapping (fires group() on first push / change). */
|
|
59
|
+
group?: Mapping$1.Value;
|
|
60
|
+
/** Downstream destination filtering. Passthrough to SDK integrations param. */
|
|
61
|
+
integrations?: Record<string, boolean | Record<string, unknown>>;
|
|
62
|
+
/** API path. Default: '/v1/batch'. */
|
|
63
|
+
path?: string;
|
|
64
|
+
/** Events to enqueue before flushing. Default: 20. */
|
|
65
|
+
flushAt?: number;
|
|
66
|
+
/** Max milliseconds before auto-flush. Default: 10000. */
|
|
67
|
+
flushInterval?: number;
|
|
68
|
+
/** Maximum batch payload size in bytes. Default: 460800 (~500KB). */
|
|
69
|
+
maxQueueSize?: number;
|
|
70
|
+
/** Maximum in-memory queue length. Default: 20000. */
|
|
71
|
+
maxInternalQueueSize?: number;
|
|
72
|
+
/** Log level. Default: 'info'. */
|
|
73
|
+
logLevel?: string;
|
|
74
|
+
/** Retry attempts for failed batches. Default: 3. */
|
|
75
|
+
retryCount?: number;
|
|
76
|
+
/** Completely disable the SDK. Default: false. */
|
|
77
|
+
enable?: boolean;
|
|
78
|
+
/** Enable gzip compression. Default: true. */
|
|
79
|
+
gzip?: boolean;
|
|
80
|
+
/** Runtime state -- not user-facing. Mutated by init/push. */
|
|
81
|
+
_analytics?: unknown;
|
|
82
|
+
_state?: RuntimeState;
|
|
83
|
+
}
|
|
84
|
+
interface RuntimeState {
|
|
85
|
+
lastIdentity?: {
|
|
86
|
+
userId?: string;
|
|
87
|
+
anonymousId?: string;
|
|
88
|
+
traitsHash?: string;
|
|
89
|
+
};
|
|
90
|
+
lastGroup?: {
|
|
91
|
+
groupId?: string;
|
|
92
|
+
traitsHash?: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Env -- optional SDK override. Production leaves this undefined and the
|
|
97
|
+
* destination creates a real Analytics instance. Tests provide a mock via
|
|
98
|
+
* env.analytics.
|
|
99
|
+
*/
|
|
100
|
+
interface Env extends DestinationServer.Env {
|
|
101
|
+
analytics?: RudderStackAnalyticsMock;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Mock-friendly interface for the Analytics instance methods the
|
|
105
|
+
* destination actually calls. Tests can provide this via env.analytics
|
|
106
|
+
* instead of the real SDK.
|
|
107
|
+
*/
|
|
108
|
+
interface RudderStackAnalyticsMock {
|
|
109
|
+
track: (params: Record<string, unknown>) => void;
|
|
110
|
+
identify: (params: Record<string, unknown>) => void;
|
|
111
|
+
group: (params: Record<string, unknown>) => void;
|
|
112
|
+
page: (params: Record<string, unknown>) => void;
|
|
113
|
+
screen: (params: Record<string, unknown>) => void;
|
|
114
|
+
alias: (params: Record<string, unknown>) => void;
|
|
115
|
+
flush: (callback?: (err?: Error, data?: unknown) => void) => Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare const push: Env;
|
|
119
|
+
declare const simulation: string[];
|
|
120
|
+
|
|
121
|
+
declare const env_push: typeof push;
|
|
122
|
+
declare const env_simulation: typeof simulation;
|
|
123
|
+
declare namespace env {
|
|
124
|
+
export { env_push as push, env_simulation as simulation };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
129
|
+
*/
|
|
130
|
+
type RudderStackStepExample = Flow.StepExample & {
|
|
131
|
+
settings?: Partial<Settings>;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* RudderStack server destination invokes the injected `env.analytics` SDK
|
|
135
|
+
* methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a
|
|
136
|
+
* raw HTTP endpoint. Each `out` entry is therefore
|
|
137
|
+
* `[callable, params]` where `callable` is the dotted method name
|
|
138
|
+
* (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.
|
|
139
|
+
*
|
|
140
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
141
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* Default event forwarding -- analytics.track() with event name and empty
|
|
145
|
+
* properties. userId resolved from default settings.userId = 'user.id'.
|
|
146
|
+
*/
|
|
147
|
+
declare const defaultTrack: RudderStackStepExample;
|
|
148
|
+
/**
|
|
149
|
+
* Mapped event name -- mapping.name renames the event for RudderStack.
|
|
150
|
+
*/
|
|
151
|
+
declare const mappedEventName: RudderStackStepExample;
|
|
152
|
+
/**
|
|
153
|
+
* Destination-level identify -- fires analytics.identify() on first push
|
|
154
|
+
* when settings.identify mapping resolves. Then fires analytics.track().
|
|
155
|
+
*/
|
|
156
|
+
declare const destinationIdentify: RudderStackStepExample;
|
|
157
|
+
/**
|
|
158
|
+
* Per-event identify with skip -- user login fires identify() only.
|
|
159
|
+
*/
|
|
160
|
+
declare const userLoginIdentify: RudderStackStepExample;
|
|
161
|
+
/**
|
|
162
|
+
* Per-event group with skip -- company update fires group() only.
|
|
163
|
+
*/
|
|
164
|
+
declare const companyGroup: RudderStackStepExample;
|
|
165
|
+
/**
|
|
166
|
+
* Explicit page() call with properties. RudderStack requires name -- resolved
|
|
167
|
+
* from mapping. skip: true suppresses track().
|
|
168
|
+
*/
|
|
169
|
+
declare const pageView: RudderStackStepExample;
|
|
170
|
+
/**
|
|
171
|
+
* Screen call -- server-only method for mobile app backends.
|
|
172
|
+
* RudderStack requires name -- resolved from mapping.
|
|
173
|
+
*/
|
|
174
|
+
declare const screenView: RudderStackStepExample;
|
|
175
|
+
/**
|
|
176
|
+
* Alias call -- links anonymous user identity to registered user.
|
|
177
|
+
* skip: true suppresses track(). Requires previousId from mapping.
|
|
178
|
+
*/
|
|
179
|
+
declare const aliasUser: RudderStackStepExample;
|
|
180
|
+
/**
|
|
181
|
+
* AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.
|
|
182
|
+
*/
|
|
183
|
+
declare const anonymousOnly: RudderStackStepExample;
|
|
184
|
+
/**
|
|
185
|
+
* Wildcard ignore -- the event matches a mapping rule with ignore: true.
|
|
186
|
+
* The destination fires zero SDK calls.
|
|
187
|
+
*/
|
|
188
|
+
declare const wildcardIgnored: RudderStackStepExample;
|
|
189
|
+
|
|
190
|
+
type step_RudderStackStepExample = RudderStackStepExample;
|
|
191
|
+
declare const step_aliasUser: typeof aliasUser;
|
|
192
|
+
declare const step_anonymousOnly: typeof anonymousOnly;
|
|
193
|
+
declare const step_companyGroup: typeof companyGroup;
|
|
194
|
+
declare const step_defaultTrack: typeof defaultTrack;
|
|
195
|
+
declare const step_destinationIdentify: typeof destinationIdentify;
|
|
196
|
+
declare const step_mappedEventName: typeof mappedEventName;
|
|
197
|
+
declare const step_pageView: typeof pageView;
|
|
198
|
+
declare const step_screenView: typeof screenView;
|
|
199
|
+
declare const step_userLoginIdentify: typeof userLoginIdentify;
|
|
200
|
+
declare const step_wildcardIgnored: typeof wildcardIgnored;
|
|
201
|
+
declare namespace step {
|
|
202
|
+
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 };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare const index_env: typeof env;
|
|
206
|
+
declare const index_step: typeof step;
|
|
207
|
+
declare namespace index {
|
|
208
|
+
export { index_env as env, index_step as step };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,s=Object.defineProperty,t=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(e,t)=>{for(var a in t)s(e,a,{get:t[a],enumerable:!0})},r={};i(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,i,r,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let u of a(i))n.call(e,u)||u===r||s(e,u,{get:()=>i[u],enumerable:!(o=t(i,u))||o.enumerable});return e})(s({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>d,SettingsSchema:()=>l,mapping:()=>g,settings:()=>c});var u=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),l=p.z.object({writeKey:p.z.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:p.z.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:p.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:p.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:p.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:p.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 20.").optional(),flushInterval:p.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:p.z.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:p.z.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:p.z.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:p.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:p.z.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:p.z.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:p.z.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:p.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:p.z.record(p.z.string(),p.z.unknown()).describe('Enable/disable downstream RudderStack destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),m=require("@walkeros/core/dev"),d=m.z.object({identify:m.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:m.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:m.z.unknown().describe("Per-event page call. Resolves to { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:m.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:m.z.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),c=(0,u.zodToSchema)(l),g=(0,u.zodToSchema)(d),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>f,simulation:()=>w});var b=()=>{};var f={analytics:{track:b,identify:b,group:b,page:b,screen:b,alias:b,flush:()=>Promise.resolve()}},w=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],k={};i(k,{aliasUser:()=>O,anonymousOnly:()=>P,companyGroup:()=>E,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>R,screenView:()=>x,userLoginIdentify:()=>S,wildcardIgnored:()=>_});var h=require("@walkeros/core"),I={in:(0,h.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},z={in:(0,h.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},D={in:(0,h.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},S={in:(0,h.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},E={in:(0,h.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},R={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},x={in:(0,h.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={in:(0,h.getEvent)("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},P={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},_={in:(0,h.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.',\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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n 'call:analytics.alias',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: RudderStackStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: RudderStackStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: RudderStackStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore: true },\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,aAAE,OAAO;AAAA,EACrC,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,cAAc,aACX,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,cAAc,aACX,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,gEAAgE,EACzE,SAAS;AAAA,EACZ,sBAAsB,aACnB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,iDAAiD,EAC1D,SAAS;AAAA,EACZ,UAAU,aACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,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,SAAS,UAAU;AAAA,EAC7B,CAAC;AAAA,EACD,UAAU;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAA0C;AAAA,EACrD,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,s=(s,a)=>{for(var t in a)e(s,t,{get:a[t],enumerable:!0})},a={};s(a,{MappingSchema:()=>o,SettingsSchema:()=>n,mapping:()=>u,settings:()=>p});import{zodToSchema as t}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var n=i.object({writeKey:i.string().min(1).describe("RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup."),dataPlaneUrl:i.string().url().describe("RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com"),userId:i.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:i.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),path:i.string().describe("API path route (like /v1/batch).").optional(),flushAt:i.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 20.").optional(),flushInterval:i.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxQueueSize:i.number().int().positive().describe("Maximum batch payload size in bytes. Default: 460800 (~500KB).").optional(),maxInternalQueueSize:i.number().int().positive().describe("Maximum in-memory queue length. Default: 20000.").optional(),logLevel:i.string().describe("SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.").optional(),retryCount:i.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),enable:i.boolean().describe("Set to false to no-op all SDK calls. Default: true.").optional(),gzip:i.boolean().describe("Enable gzip compression for requests. Default: true.").optional(),identify:i.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:i.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),integrations:i.record(i.string(),i.unknown()).describe('Enable/disable downstream RudderStack destinations. Example: { "All": true, "Mixpanel": false }.').optional()});import{z as r}from"@walkeros/core/dev";var o=r.object({identify:r.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:r.unknown().describe("Per-event page call. Resolves to { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.").optional(),alias:r.unknown().describe("Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.").optional()}),p=t(n),u=t(o),l={};s(l,{env:()=>m,step:()=>y});var m={};s(m,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,alias:d,flush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen","call:analytics.alias"],y={};s(y,{aliasUser:()=>S,anonymousOnly:()=>R,companyGroup:()=>I,defaultTrack:()=>b,destinationIdentify:()=>k,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>w,wildcardIgnored:()=>x});import{getEvent as v}from"@walkeros/core";var b={in:v("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},f={in:v("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},k={in:v("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},w={in:v("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},I={in:v("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},h={in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},D={in:v("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},S={in:v("identity merge",{timestamp:1700000107,user:{id:"registered-456",session:"s3ss10n"},data:{anonymous_id:"anonymous-123"}}),mapping:{skip:!0,settings:{alias:{map:{previousId:"data.anonymous_id"}}}},out:[["analytics.alias",{userId:"registered-456",previousId:"anonymous-123",timestamp:new Date(1700000107)}]]},R={in:v("product view",{timestamp:1700000108,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108)}]]},x={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{l as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../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":["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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'RudderStack source write key. Find it in the RudderStack dashboard under Sources > Setup.',\n ),\n dataPlaneUrl: z\n .string()\n .url()\n .describe(\n 'RudderStack data plane URL. Required. Example: https://your-data-plane.rudderstack.com',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 20.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum batch payload size in bytes. Default: 460800 (~500KB).')\n .optional(),\n maxInternalQueueSize: z\n .number()\n .int()\n .positive()\n .describe('Maximum in-memory queue length. Default: 20000.')\n .optional(),\n logLevel: z\n .string()\n .describe(\n \"SDK log level: 'info', 'debug', 'error', or 'silly'. Default: 'info'.\",\n )\n .optional(),\n retryCount: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n enable: z\n .boolean()\n .describe('Set to false to no-op all SDK calls. Default: true.')\n .optional(),\n gzip: z\n .boolean()\n .describe('Enable gzip compression for requests. Default: true.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream RudderStack destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { name, properties? } or true for minimal page(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { name, properties? } or true for minimal screen(). RudderStack requires name (falls back to empty string). Use with skip: true.',\n )\n .optional(),\n alias: z\n .unknown()\n .describe(\n 'Per-event alias call. Resolves to { previousId }. Links anonymous user to identified user. Use with rule-level skip: true.',\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, RudderStackAnalyticsMock } from '../types';\n\ntype SdkCall = (_params: Record<string, unknown>) => void;\ntype SdkFlush = (\n _callback?: (err?: Error, data?: unknown) => void,\n) => Promise<void>;\n\nconst noop: SdkCall = () => {};\nconst asyncNoop: SdkFlush = () => Promise.resolve();\n\nfunction createMockAnalytics(): RudderStackAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n alias: noop,\n flush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n 'call:analytics.alias',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type RudderStackStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * RudderStack server destination invokes the injected `env.analytics` SDK\n * methods (`track`, `identify`, `group`, `page`, `screen`, `alias`) — not a\n * raw HTTP endpoint. Each `out` entry is therefore\n * `[callable, params]` where `callable` is the dotted method name\n * (e.g. `'analytics.track'`) and `params` is the object passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for RudderStack.\n */\nexport const mappedEventName: RudderStackStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: RudderStackStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: RudderStackStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties. RudderStack requires name -- resolved\n * from mapping. skip: true suppresses track().\n */\nexport const pageView: RudderStackStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n * RudderStack requires name -- resolved from mapping.\n */\nexport const screenView: RudderStackStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * Alias call -- links anonymous user identity to registered user.\n * skip: true suppresses track(). Requires previousId from mapping.\n */\nexport const aliasUser: RudderStackStepExample = {\n in: getEvent('identity merge', {\n timestamp: 1700000107,\n user: { id: 'registered-456', session: 's3ss10n' },\n data: {\n anonymous_id: 'anonymous-123',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n alias: {\n map: {\n previousId: 'data.anonymous_id',\n },\n },\n },\n },\n out: [\n [\n 'analytics.alias',\n {\n userId: 'registered-456',\n previousId: 'anonymous-123',\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. RudderStack accepts anonymousId alone.\n */\nexport const anonymousOnly: RudderStackStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n },\n ],\n ],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: RudderStackStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: { ignore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