@walkeros/server-destination-segment 3.3.0-next-1776098542393
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 +69 -0
- package/dist/dev.d.mts +195 -0
- package/dist/dev.d.ts +195 -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 +149 -0
- package/dist/examples/index.d.ts +149 -0
- package/dist/examples/index.js +360 -0
- package/dist/examples/index.mjs +338 -0
- package/dist/index.d.mts +119 -0
- package/dist/index.d.ts +119 -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 +986 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @walkeros/server-destination-segment
|
|
2
|
+
|
|
3
|
+
Server-side Segment CDP destination for
|
|
4
|
+
[walkerOS](https://github.com/elbwalker/walkerOS). Forwards events to Segment
|
|
5
|
+
via the official `@segment/analytics-node` SDK with full Segment Spec support
|
|
6
|
+
(Track, Identify, Group, Page, Screen).
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @walkeros/server-destination-segment
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"destinations": {
|
|
19
|
+
"segment": {
|
|
20
|
+
"package": "@walkeros/server-destination-segment",
|
|
21
|
+
"config": {
|
|
22
|
+
"settings": {
|
|
23
|
+
"writeKey": "YOUR_SEGMENT_WRITE_KEY",
|
|
24
|
+
"userId": "user.id",
|
|
25
|
+
"anonymousId": "user.session"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Settings
|
|
34
|
+
|
|
35
|
+
| Setting | Type | Required | Default | Description |
|
|
36
|
+
| --------------- | ------------ | -------- | -------------------------- | -------------------------------------------------------------- |
|
|
37
|
+
| `writeKey` | string | Yes | -- | Segment source write key |
|
|
38
|
+
| `userId` | string | No | `'user.id'` | Mapping path to resolve userId from events |
|
|
39
|
+
| `anonymousId` | string | No | `'user.session'` | Mapping path to resolve anonymousId from events |
|
|
40
|
+
| `identify` | MappingValue | No | -- | Destination-level identity mapping |
|
|
41
|
+
| `group` | MappingValue | No | -- | Destination-level group mapping |
|
|
42
|
+
| `host` | string | No | `'https://api.segment.io'` | API endpoint (use `https://events.eu1.segmentapis.com` for EU) |
|
|
43
|
+
| `flushAt` | number | No | `15` | Events to enqueue before flushing |
|
|
44
|
+
| `flushInterval` | number | No | `10000` | Max ms before auto-flush |
|
|
45
|
+
| `maxRetries` | number | No | `3` | Retry attempts for failed batches |
|
|
46
|
+
| `consent` | Record | No | -- | walkerOS consent key to Segment category mapping |
|
|
47
|
+
| `integrations` | Record | No | -- | Downstream destination filtering |
|
|
48
|
+
|
|
49
|
+
## Mapping Settings
|
|
50
|
+
|
|
51
|
+
Per-event mapping settings control which Segment methods are called:
|
|
52
|
+
|
|
53
|
+
| Setting | Effect | Use with `skip: true` |
|
|
54
|
+
| ---------- | ---------------------------- | ----------------------- |
|
|
55
|
+
| `identify` | Calls `analytics.identify()` | Yes, for login events |
|
|
56
|
+
| `group` | Calls `analytics.group()` | Yes, for company events |
|
|
57
|
+
| `page` | Calls `analytics.page()` | Yes, for page views |
|
|
58
|
+
| `screen` | Calls `analytics.screen()` | Yes, for mobile screens |
|
|
59
|
+
|
|
60
|
+
## Identity
|
|
61
|
+
|
|
62
|
+
Server-side Segment requires identity on every call. The destination resolves
|
|
63
|
+
`userId` and `anonymousId` from each event via the configured mapping paths and
|
|
64
|
+
attaches them to every SDK call.
|
|
65
|
+
|
|
66
|
+
## Shutdown
|
|
67
|
+
|
|
68
|
+
The destination implements `destroy()` calling `analytics.closeAndFlush()` to
|
|
69
|
+
ensure buffered events are sent before process exit.
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
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
|
+
import { Analytics } from '@segment/analytics-node';
|
|
6
|
+
|
|
7
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
8
|
+
writeKey: z.ZodString;
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
anonymousId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
host: z.ZodOptional<z.ZodString>;
|
|
12
|
+
path: z.ZodOptional<z.ZodString>;
|
|
13
|
+
flushAt: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
httpRequestTimeout: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
19
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
20
|
+
consent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
21
|
+
integrations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
24
|
+
|
|
25
|
+
declare const MappingSchema: z.ZodObject<{
|
|
26
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
page: z.ZodOptional<z.ZodUnknown>;
|
|
29
|
+
screen: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
32
|
+
|
|
33
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
34
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
35
|
+
|
|
36
|
+
type index$1_Mapping = Mapping;
|
|
37
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
38
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
39
|
+
declare const index$1_mapping: typeof mapping;
|
|
40
|
+
declare const index$1_settings: typeof settings;
|
|
41
|
+
declare namespace index$1 {
|
|
42
|
+
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 };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface Settings {
|
|
46
|
+
/** Segment source write key (required). */
|
|
47
|
+
writeKey: string;
|
|
48
|
+
/** walkerOS mapping value path to resolve userId from each event. */
|
|
49
|
+
userId?: string;
|
|
50
|
+
/** walkerOS mapping value path to resolve anonymousId from each event. */
|
|
51
|
+
anonymousId?: string;
|
|
52
|
+
/** Destination-level identity mapping (fires identify() on first push / change). */
|
|
53
|
+
identify?: Mapping$1.Value;
|
|
54
|
+
/** Destination-level group mapping (fires group() on first push / change). */
|
|
55
|
+
group?: Mapping$1.Value;
|
|
56
|
+
/** walkerOS consent key -> Segment categoryPreferences key mapping. */
|
|
57
|
+
consent?: Record<string, string>;
|
|
58
|
+
/** Downstream destination filtering. Passthrough to SDK. */
|
|
59
|
+
integrations?: Record<string, boolean | Record<string, unknown>>;
|
|
60
|
+
/** Base URL of Segment API. Default: 'https://api.segment.io'. */
|
|
61
|
+
host?: string;
|
|
62
|
+
/** API path. Default: '/v1/batch'. */
|
|
63
|
+
path?: string;
|
|
64
|
+
/** Events to enqueue before flushing. Default: 15. */
|
|
65
|
+
flushAt?: number;
|
|
66
|
+
/** Max milliseconds before auto-flush. Default: 10000. */
|
|
67
|
+
flushInterval?: number;
|
|
68
|
+
/** Retry attempts for failed batches. Default: 3. */
|
|
69
|
+
maxRetries?: number;
|
|
70
|
+
/** HTTP request timeout (ms). Default: 10000. */
|
|
71
|
+
httpRequestTimeout?: number;
|
|
72
|
+
/** Completely disable the SDK. Default: false. */
|
|
73
|
+
disable?: boolean;
|
|
74
|
+
/** Runtime state -- not user-facing. Mutated by init/push. */
|
|
75
|
+
_analytics?: Analytics;
|
|
76
|
+
_state?: RuntimeState;
|
|
77
|
+
}
|
|
78
|
+
interface RuntimeState {
|
|
79
|
+
lastIdentity?: {
|
|
80
|
+
userId?: string;
|
|
81
|
+
anonymousId?: string;
|
|
82
|
+
traitsHash?: string;
|
|
83
|
+
};
|
|
84
|
+
lastGroup?: {
|
|
85
|
+
groupId?: string;
|
|
86
|
+
traitsHash?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Env -- optional SDK override. Production leaves this undefined and the
|
|
91
|
+
* destination creates a real Analytics instance. Tests provide a mock via
|
|
92
|
+
* env.analytics.
|
|
93
|
+
*/
|
|
94
|
+
interface Env extends DestinationServer.Env {
|
|
95
|
+
analytics?: SegmentAnalyticsMock;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Mock-friendly interface for the Analytics instance methods the
|
|
99
|
+
* destination actually calls. Tests can provide this via env.analytics
|
|
100
|
+
* instead of the real SDK.
|
|
101
|
+
*/
|
|
102
|
+
interface SegmentAnalyticsMock {
|
|
103
|
+
track: (params: Record<string, unknown>) => void;
|
|
104
|
+
identify: (params: Record<string, unknown>) => void;
|
|
105
|
+
group: (params: Record<string, unknown>) => void;
|
|
106
|
+
page: (params: Record<string, unknown>) => void;
|
|
107
|
+
screen: (params: Record<string, unknown>) => void;
|
|
108
|
+
closeAndFlush: (opts?: {
|
|
109
|
+
timeout?: number;
|
|
110
|
+
}) => Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare const push: Env;
|
|
114
|
+
declare const simulation: string[];
|
|
115
|
+
|
|
116
|
+
declare const env_push: typeof push;
|
|
117
|
+
declare const env_simulation: typeof simulation;
|
|
118
|
+
declare namespace env {
|
|
119
|
+
export { env_push as push, env_simulation as simulation };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
124
|
+
*/
|
|
125
|
+
type SegmentStepExample = Flow.StepExample & {
|
|
126
|
+
settings?: Partial<Settings>;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Default event forwarding -- analytics.track() with event name and empty
|
|
130
|
+
* properties. userId resolved from default settings.userId = 'user.id'.
|
|
131
|
+
*/
|
|
132
|
+
declare const defaultTrack: SegmentStepExample;
|
|
133
|
+
/**
|
|
134
|
+
* Mapped event name -- mapping.name renames the event for Segment.
|
|
135
|
+
*/
|
|
136
|
+
declare const mappedEventName: SegmentStepExample;
|
|
137
|
+
/**
|
|
138
|
+
* Destination-level identify -- fires analytics.identify() on first push
|
|
139
|
+
* when settings.identify mapping resolves. Then fires analytics.track().
|
|
140
|
+
*/
|
|
141
|
+
declare const destinationIdentify: SegmentStepExample;
|
|
142
|
+
/**
|
|
143
|
+
* Per-event identify with skip -- user login fires identify() only.
|
|
144
|
+
*/
|
|
145
|
+
declare const userLoginIdentify: SegmentStepExample;
|
|
146
|
+
/**
|
|
147
|
+
* Per-event group with skip -- company update fires group() only.
|
|
148
|
+
*/
|
|
149
|
+
declare const companyGroup: SegmentStepExample;
|
|
150
|
+
/**
|
|
151
|
+
* Explicit page() call with properties -- the canonical Segment page view.
|
|
152
|
+
* skip: true suppresses track(); settings.page fires analytics.page().
|
|
153
|
+
*/
|
|
154
|
+
declare const pageView: SegmentStepExample;
|
|
155
|
+
/**
|
|
156
|
+
* Screen call -- server-only method for mobile app backends.
|
|
157
|
+
*/
|
|
158
|
+
declare const screenView: SegmentStepExample;
|
|
159
|
+
/**
|
|
160
|
+
* AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.
|
|
161
|
+
*/
|
|
162
|
+
declare const anonymousOnly: SegmentStepExample;
|
|
163
|
+
/**
|
|
164
|
+
* Consent context forwarding -- settings.consent maps walkerOS consent
|
|
165
|
+
* keys to Segment categoryPreferences on the context object.
|
|
166
|
+
*/
|
|
167
|
+
declare const consentForwarding: SegmentStepExample;
|
|
168
|
+
/**
|
|
169
|
+
* Wildcard ignore -- the event matches a mapping rule with ignore: true.
|
|
170
|
+
* The destination fires zero SDK calls.
|
|
171
|
+
*/
|
|
172
|
+
declare const wildcardIgnored: SegmentStepExample;
|
|
173
|
+
|
|
174
|
+
type step_SegmentStepExample = SegmentStepExample;
|
|
175
|
+
declare const step_anonymousOnly: typeof anonymousOnly;
|
|
176
|
+
declare const step_companyGroup: typeof companyGroup;
|
|
177
|
+
declare const step_consentForwarding: typeof consentForwarding;
|
|
178
|
+
declare const step_defaultTrack: typeof defaultTrack;
|
|
179
|
+
declare const step_destinationIdentify: typeof destinationIdentify;
|
|
180
|
+
declare const step_mappedEventName: typeof mappedEventName;
|
|
181
|
+
declare const step_pageView: typeof pageView;
|
|
182
|
+
declare const step_screenView: typeof screenView;
|
|
183
|
+
declare const step_userLoginIdentify: typeof userLoginIdentify;
|
|
184
|
+
declare const step_wildcardIgnored: typeof wildcardIgnored;
|
|
185
|
+
declare namespace step {
|
|
186
|
+
export { type step_SegmentStepExample as SegmentStepExample, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_consentForwarding as consentForwarding, 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 };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare const index_env: typeof env;
|
|
190
|
+
declare const index_step: typeof step;
|
|
191
|
+
declare namespace index {
|
|
192
|
+
export { index_env as env, index_step as step };
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
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
|
+
import { Analytics } from '@segment/analytics-node';
|
|
6
|
+
|
|
7
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
8
|
+
writeKey: z.ZodString;
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
anonymousId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
host: z.ZodOptional<z.ZodString>;
|
|
12
|
+
path: z.ZodOptional<z.ZodString>;
|
|
13
|
+
flushAt: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
flushInterval: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
httpRequestTimeout: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
19
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
20
|
+
consent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
21
|
+
integrations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
24
|
+
|
|
25
|
+
declare const MappingSchema: z.ZodObject<{
|
|
26
|
+
identify: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
group: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
page: z.ZodOptional<z.ZodUnknown>;
|
|
29
|
+
screen: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
32
|
+
|
|
33
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
34
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
35
|
+
|
|
36
|
+
type index$1_Mapping = Mapping;
|
|
37
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
38
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
39
|
+
declare const index$1_mapping: typeof mapping;
|
|
40
|
+
declare const index$1_settings: typeof settings;
|
|
41
|
+
declare namespace index$1 {
|
|
42
|
+
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 };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface Settings {
|
|
46
|
+
/** Segment source write key (required). */
|
|
47
|
+
writeKey: string;
|
|
48
|
+
/** walkerOS mapping value path to resolve userId from each event. */
|
|
49
|
+
userId?: string;
|
|
50
|
+
/** walkerOS mapping value path to resolve anonymousId from each event. */
|
|
51
|
+
anonymousId?: string;
|
|
52
|
+
/** Destination-level identity mapping (fires identify() on first push / change). */
|
|
53
|
+
identify?: Mapping$1.Value;
|
|
54
|
+
/** Destination-level group mapping (fires group() on first push / change). */
|
|
55
|
+
group?: Mapping$1.Value;
|
|
56
|
+
/** walkerOS consent key -> Segment categoryPreferences key mapping. */
|
|
57
|
+
consent?: Record<string, string>;
|
|
58
|
+
/** Downstream destination filtering. Passthrough to SDK. */
|
|
59
|
+
integrations?: Record<string, boolean | Record<string, unknown>>;
|
|
60
|
+
/** Base URL of Segment API. Default: 'https://api.segment.io'. */
|
|
61
|
+
host?: string;
|
|
62
|
+
/** API path. Default: '/v1/batch'. */
|
|
63
|
+
path?: string;
|
|
64
|
+
/** Events to enqueue before flushing. Default: 15. */
|
|
65
|
+
flushAt?: number;
|
|
66
|
+
/** Max milliseconds before auto-flush. Default: 10000. */
|
|
67
|
+
flushInterval?: number;
|
|
68
|
+
/** Retry attempts for failed batches. Default: 3. */
|
|
69
|
+
maxRetries?: number;
|
|
70
|
+
/** HTTP request timeout (ms). Default: 10000. */
|
|
71
|
+
httpRequestTimeout?: number;
|
|
72
|
+
/** Completely disable the SDK. Default: false. */
|
|
73
|
+
disable?: boolean;
|
|
74
|
+
/** Runtime state -- not user-facing. Mutated by init/push. */
|
|
75
|
+
_analytics?: Analytics;
|
|
76
|
+
_state?: RuntimeState;
|
|
77
|
+
}
|
|
78
|
+
interface RuntimeState {
|
|
79
|
+
lastIdentity?: {
|
|
80
|
+
userId?: string;
|
|
81
|
+
anonymousId?: string;
|
|
82
|
+
traitsHash?: string;
|
|
83
|
+
};
|
|
84
|
+
lastGroup?: {
|
|
85
|
+
groupId?: string;
|
|
86
|
+
traitsHash?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Env -- optional SDK override. Production leaves this undefined and the
|
|
91
|
+
* destination creates a real Analytics instance. Tests provide a mock via
|
|
92
|
+
* env.analytics.
|
|
93
|
+
*/
|
|
94
|
+
interface Env extends DestinationServer.Env {
|
|
95
|
+
analytics?: SegmentAnalyticsMock;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Mock-friendly interface for the Analytics instance methods the
|
|
99
|
+
* destination actually calls. Tests can provide this via env.analytics
|
|
100
|
+
* instead of the real SDK.
|
|
101
|
+
*/
|
|
102
|
+
interface SegmentAnalyticsMock {
|
|
103
|
+
track: (params: Record<string, unknown>) => void;
|
|
104
|
+
identify: (params: Record<string, unknown>) => void;
|
|
105
|
+
group: (params: Record<string, unknown>) => void;
|
|
106
|
+
page: (params: Record<string, unknown>) => void;
|
|
107
|
+
screen: (params: Record<string, unknown>) => void;
|
|
108
|
+
closeAndFlush: (opts?: {
|
|
109
|
+
timeout?: number;
|
|
110
|
+
}) => Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare const push: Env;
|
|
114
|
+
declare const simulation: string[];
|
|
115
|
+
|
|
116
|
+
declare const env_push: typeof push;
|
|
117
|
+
declare const env_simulation: typeof simulation;
|
|
118
|
+
declare namespace env {
|
|
119
|
+
export { env_push as push, env_simulation as simulation };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Extended step example that may carry destination-level settings overrides.
|
|
124
|
+
*/
|
|
125
|
+
type SegmentStepExample = Flow.StepExample & {
|
|
126
|
+
settings?: Partial<Settings>;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Default event forwarding -- analytics.track() with event name and empty
|
|
130
|
+
* properties. userId resolved from default settings.userId = 'user.id'.
|
|
131
|
+
*/
|
|
132
|
+
declare const defaultTrack: SegmentStepExample;
|
|
133
|
+
/**
|
|
134
|
+
* Mapped event name -- mapping.name renames the event for Segment.
|
|
135
|
+
*/
|
|
136
|
+
declare const mappedEventName: SegmentStepExample;
|
|
137
|
+
/**
|
|
138
|
+
* Destination-level identify -- fires analytics.identify() on first push
|
|
139
|
+
* when settings.identify mapping resolves. Then fires analytics.track().
|
|
140
|
+
*/
|
|
141
|
+
declare const destinationIdentify: SegmentStepExample;
|
|
142
|
+
/**
|
|
143
|
+
* Per-event identify with skip -- user login fires identify() only.
|
|
144
|
+
*/
|
|
145
|
+
declare const userLoginIdentify: SegmentStepExample;
|
|
146
|
+
/**
|
|
147
|
+
* Per-event group with skip -- company update fires group() only.
|
|
148
|
+
*/
|
|
149
|
+
declare const companyGroup: SegmentStepExample;
|
|
150
|
+
/**
|
|
151
|
+
* Explicit page() call with properties -- the canonical Segment page view.
|
|
152
|
+
* skip: true suppresses track(); settings.page fires analytics.page().
|
|
153
|
+
*/
|
|
154
|
+
declare const pageView: SegmentStepExample;
|
|
155
|
+
/**
|
|
156
|
+
* Screen call -- server-only method for mobile app backends.
|
|
157
|
+
*/
|
|
158
|
+
declare const screenView: SegmentStepExample;
|
|
159
|
+
/**
|
|
160
|
+
* AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.
|
|
161
|
+
*/
|
|
162
|
+
declare const anonymousOnly: SegmentStepExample;
|
|
163
|
+
/**
|
|
164
|
+
* Consent context forwarding -- settings.consent maps walkerOS consent
|
|
165
|
+
* keys to Segment categoryPreferences on the context object.
|
|
166
|
+
*/
|
|
167
|
+
declare const consentForwarding: SegmentStepExample;
|
|
168
|
+
/**
|
|
169
|
+
* Wildcard ignore -- the event matches a mapping rule with ignore: true.
|
|
170
|
+
* The destination fires zero SDK calls.
|
|
171
|
+
*/
|
|
172
|
+
declare const wildcardIgnored: SegmentStepExample;
|
|
173
|
+
|
|
174
|
+
type step_SegmentStepExample = SegmentStepExample;
|
|
175
|
+
declare const step_anonymousOnly: typeof anonymousOnly;
|
|
176
|
+
declare const step_companyGroup: typeof companyGroup;
|
|
177
|
+
declare const step_consentForwarding: typeof consentForwarding;
|
|
178
|
+
declare const step_defaultTrack: typeof defaultTrack;
|
|
179
|
+
declare const step_destinationIdentify: typeof destinationIdentify;
|
|
180
|
+
declare const step_mappedEventName: typeof mappedEventName;
|
|
181
|
+
declare const step_pageView: typeof pageView;
|
|
182
|
+
declare const step_screenView: typeof screenView;
|
|
183
|
+
declare const step_userLoginIdentify: typeof userLoginIdentify;
|
|
184
|
+
declare const step_wildcardIgnored: typeof wildcardIgnored;
|
|
185
|
+
declare namespace step {
|
|
186
|
+
export { type step_SegmentStepExample as SegmentStepExample, step_anonymousOnly as anonymousOnly, step_companyGroup as companyGroup, step_consentForwarding as consentForwarding, 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 };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare const index_env: typeof env;
|
|
190
|
+
declare const index_step: typeof step;
|
|
191
|
+
declare namespace index {
|
|
192
|
+
export { index_env as env, index_step as step };
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,s)=>{for(var n in s)t(e,n,{get:s[n],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 p of n(i))a.call(e,p)||p===r||t(e,p,{get:()=>i[p],enumerable:!(o=s(i,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>d});var p=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),u=m.z.object({writeKey:m.z.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:m.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:m.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:m.z.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:m.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:m.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:m.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:m.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:m.z.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:m.z.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:m.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:m.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:m.z.record(m.z.string(),m.z.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:m.z.record(m.z.string(),m.z.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:l.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:l.z.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:l.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),d=(0,p.zodToSchema)(u),g=(0,p.zodToSchema)(c),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>w,simulation:()=>f});var b=()=>{};var w={analytics:{track:b,identify:b,group:b,page:b,screen:b,closeAndFlush:()=>Promise.resolve()}},f=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],k={};i(k,{anonymousOnly:()=>O,companyGroup:()=>E,consentForwarding:()=>x,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>P,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>R});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)}]},P={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]},A={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",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]},O={in:(0,h.getEvent)("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]},x={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]},R={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 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\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 host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\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: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\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 consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment 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 { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with 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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: 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];\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 SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\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: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\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 * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\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 '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 * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\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: SegmentStepExample = {\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 '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 * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\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 '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 * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\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 category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\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: SegmentStepExample = {\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,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,aACH,OAAO,EACP,IAAI,EACJ;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;A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,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,OAAO;AAAA,MACP,YAAY,CAAC;AAAA,MACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAC9B,SAAS;AAAA,QACP,SAAS;AAAA,UACP,qBAAqB;AAAA,YACnB,WAAW;AAAA,YACX,aAAa;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,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,t)=>{for(var n in t)e(s,n,{get:t[n],enumerable:!0})},t={};s(t,{MappingSchema:()=>o,SettingsSchema:()=>i,mapping:()=>m,settings:()=>p});import{zodToSchema as n}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({writeKey:a.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:a.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:a.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:a.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:a.string().describe("API path route (like /v1/batch).").optional(),flushAt:a.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:a.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:a.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:a.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:a.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:a.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:a.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:a.record(a.string(),a.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:a.record(a.string(),a.unknown()).describe('Enable/disable downstream Segment 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 { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),p=n(i),m=n(o),u={};s(u,{env:()=>l,step:()=>y});var l={};s(l,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,closeAndFlush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],y={};s(y,{anonymousOnly:()=>S,companyGroup:()=>I,consentForwarding:()=>A,defaultTrack:()=>w,destinationIdentify:()=>b,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>k,wildcardIgnored:()=>P});import{getEvent as v}from"@walkeros/core";var w={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)}]},b={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)}]]},k={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:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",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",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]},S={in:v("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]},A={in:v("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]},P={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{u as examples,t 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 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\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 host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\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: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\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 consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment 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 { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with 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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: 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];\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 SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\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: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\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 * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\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 '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 * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\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: SegmentStepExample = {\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 '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 * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\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 '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 * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\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 category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\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: SegmentStepExample = {\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;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAA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