@walkeros/core 0.4.2 → 0.5.0
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 +45 -8
- package/dist/dev.d.mts +10 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/index.d.mts +16 -6
- package/dist/index.d.ts +16 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="left">
|
|
2
|
-
<a href="https://
|
|
3
|
-
<img title="elbwalker" src="https://www.
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img title="elbwalker" src="https://www.walkeros.io/img/elbwalker_logo.png" width="256px"/>
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -15,7 +15,35 @@ data manipulation, validation, mapping, and more.
|
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```bash
|
|
19
|
+
npm install @walkeros/core
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
The core package provides types and utilities used across walkerOS. In a Flow
|
|
25
|
+
configuration:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"version": 1,
|
|
30
|
+
"flows": {
|
|
31
|
+
"default": {
|
|
32
|
+
"web": {},
|
|
33
|
+
"destinations": {
|
|
34
|
+
"api": {
|
|
35
|
+
"package": "@walkeros/web-destination-api",
|
|
36
|
+
"config": {
|
|
37
|
+
"url": "https://collect.example.com/events"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Import utilities directly:
|
|
19
47
|
|
|
20
48
|
```ts
|
|
21
49
|
import { assign, anonymizeIP, getMappingValue } from '@walkeros/core';
|
|
@@ -119,7 +147,7 @@ getId(10); // Returns 10-character string
|
|
|
119
147
|
|
|
120
148
|
`getMappingValue(event: WalkerOS.Event, mapping: Mapping.Data, options?: Mapping.Options): Promise<WalkerOS.Property | undefined>`
|
|
121
149
|
extracts values from events using
|
|
122
|
-
[mapping configurations](https://www.
|
|
150
|
+
[mapping configurations](https://www.walkeros.io/docs/destinations/event-mapping).
|
|
123
151
|
|
|
124
152
|
```ts
|
|
125
153
|
// Simple path mapping
|
|
@@ -300,13 +328,22 @@ validates event structure and throws on invalid events.
|
|
|
300
328
|
|
|
301
329
|
Validates that values conform to walkerOS property types.
|
|
302
330
|
|
|
303
|
-
|
|
331
|
+
## Type Definitions
|
|
332
|
+
|
|
333
|
+
See [src/types/](./src/types/) for TypeScript interfaces:
|
|
334
|
+
|
|
335
|
+
- [event.ts](./src/types/event.ts) - Event structure
|
|
336
|
+
- [destination.ts](./src/types/destination.ts) - Destination interface
|
|
337
|
+
- [source.ts](./src/types/source.ts) - Source interface
|
|
338
|
+
- [mapping.ts](./src/types/mapping.ts) - Mapping configuration
|
|
304
339
|
|
|
305
|
-
|
|
340
|
+
## Related
|
|
306
341
|
|
|
307
|
-
- [
|
|
342
|
+
- [Website Documentation](https://www.walkeros.io/docs/)
|
|
343
|
+
- [Collector Package](../collector/) - Event processing engine
|
|
344
|
+
- [Web Core](https://www.walkeros.io/docs/sources/web/) - Browser-specific
|
|
308
345
|
functions
|
|
309
|
-
- [Server Core](https://www.
|
|
346
|
+
- [Server Core](https://www.walkeros.io/docs/sources/server/) - Node.js server
|
|
310
347
|
functions
|
|
311
348
|
|
|
312
349
|
## Contribute
|
package/dist/dev.d.mts
CHANGED
|
@@ -3425,6 +3425,7 @@ declare const ServerSchema: z.ZodObject<{}, z.core.$loose>;
|
|
|
3425
3425
|
*/
|
|
3426
3426
|
declare const SourceReferenceSchema: z.ZodObject<{
|
|
3427
3427
|
package: z.ZodString;
|
|
3428
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3428
3429
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3429
3430
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3430
3431
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3440,6 +3441,7 @@ declare const SourceReferenceSchema: z.ZodObject<{
|
|
|
3440
3441
|
*/
|
|
3441
3442
|
declare const DestinationReferenceSchema: z.ZodObject<{
|
|
3442
3443
|
package: z.ZodString;
|
|
3444
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3443
3445
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3444
3446
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3445
3447
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3461,6 +3463,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
3461
3463
|
server: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3462
3464
|
sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3463
3465
|
package: z.ZodString;
|
|
3466
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3464
3467
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3465
3468
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3466
3469
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3469,6 +3472,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
3469
3472
|
}, z.core.$strip>>>;
|
|
3470
3473
|
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3471
3474
|
package: z.ZodString;
|
|
3475
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3472
3476
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3473
3477
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3474
3478
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3503,6 +3507,7 @@ declare const SetupSchema: z.ZodObject<{
|
|
|
3503
3507
|
server: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3504
3508
|
sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3505
3509
|
package: z.ZodString;
|
|
3510
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3506
3511
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3507
3512
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3508
3513
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3511,6 +3516,7 @@ declare const SetupSchema: z.ZodObject<{
|
|
|
3511
3516
|
}, z.core.$strip>>>;
|
|
3512
3517
|
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3513
3518
|
package: z.ZodString;
|
|
3519
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3514
3520
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3515
3521
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3516
3522
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3574,6 +3580,7 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
|
|
|
3574
3580
|
} | undefined;
|
|
3575
3581
|
sources?: Record<string, {
|
|
3576
3582
|
package: string;
|
|
3583
|
+
code?: string | undefined;
|
|
3577
3584
|
config?: unknown;
|
|
3578
3585
|
env?: unknown;
|
|
3579
3586
|
primary?: boolean | undefined;
|
|
@@ -3582,6 +3589,7 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
|
|
|
3582
3589
|
}> | undefined;
|
|
3583
3590
|
destinations?: Record<string, {
|
|
3584
3591
|
package: string;
|
|
3592
|
+
code?: string | undefined;
|
|
3585
3593
|
config?: unknown;
|
|
3586
3594
|
env?: unknown;
|
|
3587
3595
|
variables?: Record<string, string | number | boolean> | undefined;
|
|
@@ -3632,6 +3640,7 @@ declare function safeParseConfig(data: unknown): z.ZodSafeParseResult<{
|
|
|
3632
3640
|
} | undefined;
|
|
3633
3641
|
sources?: Record<string, {
|
|
3634
3642
|
package: string;
|
|
3643
|
+
code?: string | undefined;
|
|
3635
3644
|
config?: unknown;
|
|
3636
3645
|
env?: unknown;
|
|
3637
3646
|
primary?: boolean | undefined;
|
|
@@ -3640,6 +3649,7 @@ declare function safeParseConfig(data: unknown): z.ZodSafeParseResult<{
|
|
|
3640
3649
|
}> | undefined;
|
|
3641
3650
|
destinations?: Record<string, {
|
|
3642
3651
|
package: string;
|
|
3652
|
+
code?: string | undefined;
|
|
3643
3653
|
config?: unknown;
|
|
3644
3654
|
env?: unknown;
|
|
3645
3655
|
variables?: Record<string, string | number | boolean> | undefined;
|
package/dist/dev.d.ts
CHANGED
|
@@ -3425,6 +3425,7 @@ declare const ServerSchema: z.ZodObject<{}, z.core.$loose>;
|
|
|
3425
3425
|
*/
|
|
3426
3426
|
declare const SourceReferenceSchema: z.ZodObject<{
|
|
3427
3427
|
package: z.ZodString;
|
|
3428
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3428
3429
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3429
3430
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3430
3431
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3440,6 +3441,7 @@ declare const SourceReferenceSchema: z.ZodObject<{
|
|
|
3440
3441
|
*/
|
|
3441
3442
|
declare const DestinationReferenceSchema: z.ZodObject<{
|
|
3442
3443
|
package: z.ZodString;
|
|
3444
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3443
3445
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3444
3446
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3445
3447
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3461,6 +3463,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
3461
3463
|
server: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3462
3464
|
sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3463
3465
|
package: z.ZodString;
|
|
3466
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3464
3467
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3465
3468
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3466
3469
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3469,6 +3472,7 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
3469
3472
|
}, z.core.$strip>>>;
|
|
3470
3473
|
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3471
3474
|
package: z.ZodString;
|
|
3475
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3472
3476
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3473
3477
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3474
3478
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3503,6 +3507,7 @@ declare const SetupSchema: z.ZodObject<{
|
|
|
3503
3507
|
server: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
3504
3508
|
sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3505
3509
|
package: z.ZodString;
|
|
3510
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3506
3511
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3507
3512
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3508
3513
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3511,6 +3516,7 @@ declare const SetupSchema: z.ZodObject<{
|
|
|
3511
3516
|
}, z.core.$strip>>>;
|
|
3512
3517
|
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3513
3518
|
package: z.ZodString;
|
|
3519
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3514
3520
|
config: z.ZodOptional<z.ZodUnknown>;
|
|
3515
3521
|
env: z.ZodOptional<z.ZodUnknown>;
|
|
3516
3522
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -3574,6 +3580,7 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
|
|
|
3574
3580
|
} | undefined;
|
|
3575
3581
|
sources?: Record<string, {
|
|
3576
3582
|
package: string;
|
|
3583
|
+
code?: string | undefined;
|
|
3577
3584
|
config?: unknown;
|
|
3578
3585
|
env?: unknown;
|
|
3579
3586
|
primary?: boolean | undefined;
|
|
@@ -3582,6 +3589,7 @@ declare function safeParseSetup(data: unknown): z.ZodSafeParseResult<{
|
|
|
3582
3589
|
}> | undefined;
|
|
3583
3590
|
destinations?: Record<string, {
|
|
3584
3591
|
package: string;
|
|
3592
|
+
code?: string | undefined;
|
|
3585
3593
|
config?: unknown;
|
|
3586
3594
|
env?: unknown;
|
|
3587
3595
|
variables?: Record<string, string | number | boolean> | undefined;
|
|
@@ -3632,6 +3640,7 @@ declare function safeParseConfig(data: unknown): z.ZodSafeParseResult<{
|
|
|
3632
3640
|
} | undefined;
|
|
3633
3641
|
sources?: Record<string, {
|
|
3634
3642
|
package: string;
|
|
3643
|
+
code?: string | undefined;
|
|
3635
3644
|
config?: unknown;
|
|
3636
3645
|
env?: unknown;
|
|
3637
3646
|
primary?: boolean | undefined;
|
|
@@ -3640,6 +3649,7 @@ declare function safeParseConfig(data: unknown): z.ZodSafeParseResult<{
|
|
|
3640
3649
|
}> | undefined;
|
|
3641
3650
|
destinations?: Record<string, {
|
|
3642
3651
|
package: string;
|
|
3652
|
+
code?: string | undefined;
|
|
3643
3653
|
config?: unknown;
|
|
3644
3654
|
env?: unknown;
|
|
3645
3655
|
variables?: Record<string, string | number | boolean> | undefined;
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,t=Object.prototype.hasOwnProperty,r=(e,n)=>{for(var o in n)i(e,o,{get:n[o],enumerable:!0})},a={};r(a,{schemas:()=>s,z:()=>c.z,zodToSchema:()=>un}),module.exports=(e=a,((e,r,a,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of o(r))t.call(e,c)||c===a||i(e,c,{get:()=>r[c],enumerable:!(s=n(r,c))||s.enumerable});return e})(i({},"__esModule",{value:!0}),e));var s={};r(s,{BaseContextConfig:()=>H,BatchConfig:()=>_,CollectorSchemas:()=>ui,ConsentSchema:()=>ne,Counter:()=>g,DeepPartialEventSchema:()=>de,DestinationReferenceSchema:()=>Qi,DestinationSchemas:()=>Ve,DestinationsMapConfig:()=>$,DisabledConfig:()=>O,EntitiesSchema:()=>se,EntitySchema:()=>ae,EventSchema:()=>ce,FlowConfigSchema:()=>Ki,FlowSchemas:()=>Wi,GenericEnvConfig:()=>N,GenericSettingsConfig:()=>T,HandlersConfig:()=>x,IdConfig:()=>L,Identifier:()=>b,InitConfig:()=>M,LoopSchema:()=>we,MapSchema:()=>Ce,MappingResultSchema:()=>xe,MappingSchemas:()=>Se,OptionalPrimitiveValue:()=>z,OrderedPropertiesSchema:()=>ee,PartialEventSchema:()=>le,PolicySchema:()=>Pe,PrimaryConfig:()=>q,PrimitiveSchema:()=>Bi,PrimitiveValue:()=>h,ProcessingControlConfig:()=>F,PropertiesSchema:()=>Z,PropertySchema:()=>Y,PropertyTypeSchema:()=>X,QueueConfig:()=>R,RequiredBoolean:()=>u,RequiredNumber:()=>p,RequiredString:()=>d,RuleSchema:()=>Je,RulesSchema:()=>Ee,RuntimeInstanceConfig:()=>A,SetSchema:()=>ke,SetupSchema:()=>Xi,SourceReferenceSchema:()=>$i,SourceSchema:()=>re,SourceSchemas:()=>Ji,SourceTypeSchema:()=>ie,SourcesMapConfig:()=>G,TaggingVersion:()=>f,Timestamp:()=>m,UserSchema:()=>oe,UtilitySchemas:()=>S,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>ye,VerboseConfig:()=>I,VersionSchema:()=>te,WalkerOSSchemas:()=>Q,configJsonSchema:()=>tn,consentJsonSchema:()=>ze,createArraySchema:()=>ln,createConsentConfig:()=>B,createDataTransformationConfig:()=>U,createEnumSchema:()=>dn,createMappingRulesConfig:()=>V,createObjectSchema:()=>sn,createPolicyConfig:()=>W,createTupleSchema:()=>pn,destinationReferenceJsonSchema:()=>an,entityJsonSchema:()=>fe,eventJsonSchema:()=>pe,loopJsonSchema:()=>Le,mapJsonSchema:()=>Oe,orderedPropertiesJsonSchema:()=>ge,parseConfig:()=>en,parseSetup:()=>Yi,partialEventJsonSchema:()=>ue,policyJsonSchema:()=>qe,propertiesJsonSchema:()=>me,ruleJsonSchema:()=>Te,rulesJsonSchema:()=>Ne,safeParseConfig:()=>nn,safeParseSetup:()=>Zi,setJsonSchema:()=>Me,setupJsonSchema:()=>on,sourceReferenceJsonSchema:()=>rn,sourceTypeJsonSchema:()=>he,userJsonSchema:()=>be,valueConfigJsonSchema:()=>Re,valueJsonSchema:()=>Ie,z:()=>c.z,zodToSchema:()=>un});var c=require("zod");function l(e,i,n="draft-7"){return c.z.toJSONSchema(e,{target:n})}var d=c.z.string(),p=c.z.number(),u=c.z.boolean(),b=c.z.string().min(1),m=c.z.number().int().positive(),g=c.z.number().int().nonnegative(),f=c.z.number().describe("Tagging version number"),h=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]),z=h.optional(),S={};r(S,{ErrorHandlerSchema:()=>w,HandlerSchema:()=>C,LogHandlerSchema:()=>k,StorageSchema:()=>y,StorageTypeSchema:()=>v,errorHandlerJsonSchema:()=>J,handlerJsonSchema:()=>D,logHandlerJsonSchema:()=>E,storageJsonSchema:()=>P,storageTypeJsonSchema:()=>j});var v=c.z.enum(["local","session","cookie"]).describe("Storage mechanism: local, session, or cookie"),y=c.z.object({Local:c.z.literal("local"),Session:c.z.literal("session"),Cookie:c.z.literal("cookie")}).describe("Storage type constants for type-safe references"),w=c.z.any().describe("Error handler function: (error, state?) => void"),k=c.z.any().describe("Log handler function: (message, verbose?) => void"),C=c.z.object({Error:w.describe("Error handler function"),Log:k.describe("Log handler function")}).describe("Handler interface with error and log functions"),j=l(v),P=l(y),J=l(w),E=l(k),D=l(C),x=c.z.object({onError:w.optional().describe("Error handler function: (error, state?) => void"),onLog:k.optional().describe("Log handler function: (message, verbose?) => void")}).partial(),I=c.z.object({verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional()}).partial(),R=c.z.object({queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional()}).partial(),L=c.z.object({}).partial(),M=c.z.object({init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional()}).partial(),O=c.z.object({disabled:c.z.boolean().describe("Set to true to disable").optional()}).partial(),q=c.z.object({primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).partial(),T=c.z.object({settings:c.z.any().optional().describe("Implementation-specific configuration")}).partial(),N=c.z.object({env:c.z.any().optional().describe("Environment dependencies (platform-specific)")}).partial();function U(e,i){return c.z.object({data:c.z.union([e,i]).optional().describe("Data transformation rules")}).partial()}function V(e){return c.z.object({mapping:e.optional().describe("Event mapping rules")}).partial()}function W(e){return c.z.object({policy:e.optional().describe("Pre-processing policy rules")}).partial()}function B(e){return c.z.object({consent:e.optional().describe("Required consent states")}).partial()}var A=c.z.object({type:c.z.string().optional().describe("Instance type identifier"),config:c.z.unknown().describe("Instance configuration")}).partial(),H=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:c.z.unknown().describe("Configuration"),env:c.z.unknown().describe("Environment dependencies")}).partial(),_=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),batched:c.z.unknown().optional().describe("Batch of events to be processed")}).partial(),F=c.z.object({ignore:c.z.boolean().describe("Set to true to skip processing").optional(),condition:c.z.string().optional().describe("Condition function: return true to process")}).partial(),G=c.z.object({sources:c.z.record(c.z.string(),c.z.unknown()).describe("Map of source instances")}).partial(),$=c.z.object({destinations:c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination instances")}).partial(),Q={};r(Q,{ConsentSchema:()=>ne,DeepPartialEventSchema:()=>de,EntitiesSchema:()=>se,EntitySchema:()=>ae,EventSchema:()=>ce,OrderedPropertiesSchema:()=>ee,PartialEventSchema:()=>le,PropertiesSchema:()=>Z,PropertySchema:()=>Y,PropertyTypeSchema:()=>X,SourceSchema:()=>re,SourceTypeSchema:()=>ie,UserSchema:()=>oe,VersionSchema:()=>te,consentJsonSchema:()=>ze,entityJsonSchema:()=>fe,eventJsonSchema:()=>pe,orderedPropertiesJsonSchema:()=>ge,partialEventJsonSchema:()=>ue,propertiesJsonSchema:()=>me,sourceTypeJsonSchema:()=>he,userJsonSchema:()=>be});var K,X=c.z.lazy(()=>c.z.union([c.z.boolean(),c.z.string(),c.z.number(),c.z.record(c.z.string(),Y)])),Y=c.z.lazy(()=>c.z.union([X,c.z.array(X)])),Z=c.z.record(c.z.string(),Y.optional()).describe("Flexible property collection with optional values"),ee=c.z.record(c.z.string(),c.z.tuple([Y,c.z.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control"),ie=c.z.union([c.z.enum(["web","server","app","other"]),c.z.string()]).describe("Source type: web, server, app, other, or custom"),ne=c.z.record(c.z.string(),c.z.boolean()).describe("Consent requirement mapping (group name → state)"),oe=Z.and(c.z.object({id:c.z.string().optional().describe("User identifier"),device:c.z.string().optional().describe("Device identifier"),session:c.z.string().optional().describe("Session identifier"),hash:c.z.string().optional().describe("Hashed identifier"),address:c.z.string().optional().describe("User address"),email:c.z.string().email().optional().describe("User email address"),phone:c.z.string().optional().describe("User phone number"),userAgent:c.z.string().optional().describe("Browser user agent string"),browser:c.z.string().optional().describe("Browser name"),browserVersion:c.z.string().optional().describe("Browser version"),deviceType:c.z.string().optional().describe("Device type (mobile, desktop, tablet)"),os:c.z.string().optional().describe("Operating system"),osVersion:c.z.string().optional().describe("Operating system version"),screenSize:c.z.string().optional().describe("Screen dimensions"),language:c.z.string().optional().describe("User language"),country:c.z.string().optional().describe("User country"),region:c.z.string().optional().describe("User region/state"),city:c.z.string().optional().describe("User city"),zip:c.z.string().optional().describe("User postal code"),timezone:c.z.string().optional().describe("User timezone"),ip:c.z.string().optional().describe("User IP address"),internal:c.z.boolean().optional().describe("Internal user flag (employee, test user)")})).describe("User identification and properties"),te=Z.and(c.z.object({source:d.describe('Walker implementation version (e.g., "2.0.0")'),tagging:f})).describe("Walker version information"),re=Z.and(c.z.object({type:ie.describe("Source type identifier"),id:d.describe("Source identifier (typically URL on web)"),previous_id:d.describe("Previous source identifier (typically referrer on web)")})).describe("Event source information"),ae=c.z.lazy(()=>c.z.object({entity:c.z.string().describe("Entity name"),data:Z.describe("Entity-specific properties"),nested:c.z.array(ae).describe("Nested child entities"),context:ee.describe("Entity context data")})).describe("Nested entity structure with recursive nesting support"),se=c.z.array(ae).describe("Array of nested entities"),ce=c.z.object({name:c.z.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'),data:Z.describe("Event-specific properties"),context:ee.describe("Ordered context properties with priorities"),globals:Z.describe("Global properties shared across events"),custom:Z.describe("Custom implementation-specific properties"),user:oe.describe("User identification and attributes"),nested:se.describe("Related nested entities"),consent:ne.describe("Consent states at event time"),id:b.describe("Unique event identifier (timestamp-based)"),trigger:d.describe("Event trigger identifier"),entity:d.describe("Parsed entity from event name"),action:d.describe("Parsed action from event name"),timestamp:m.describe("Unix timestamp in milliseconds since epoch"),timing:p.describe("Event processing timing information"),group:d.describe("Event grouping identifier"),count:g.describe("Event count in session"),version:te.describe("Walker version information"),source:re.describe("Event source information")}).describe("Complete walkerOS event structure"),le=ce.partial().describe("Partial event structure with all fields optional"),de=ce.partial().describe("Partial event structure with all top-level fields optional"),pe=l(ce),ue=l(le),be=l(oe),me=l(Z),ge=l(ee),fe=l(ae),he=l(ie),ze=l(ne),Se={};r(Se,{ConfigSchema:()=>De,LoopSchema:()=>we,MapSchema:()=>Ce,PolicySchema:()=>Pe,ResultSchema:()=>xe,RuleSchema:()=>Je,RulesSchema:()=>Ee,SetSchema:()=>ke,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>ye,configJsonSchema:()=>Ue,loopJsonSchema:()=>Le,mapJsonSchema:()=>Oe,policyJsonSchema:()=>qe,ruleJsonSchema:()=>Te,rulesJsonSchema:()=>Ne,setJsonSchema:()=>Me,valueConfigJsonSchema:()=>Re,valueJsonSchema:()=>Ie});var ve=c.z.lazy(()=>c.z.union([c.z.string().describe('String value or property path (e.g., "data.id")'),c.z.number().describe("Numeric value"),c.z.boolean().describe("Boolean value"),c.z.lazy(()=>K),c.z.array(ve).describe("Array of values")])),ye=c.z.array(ve).describe("Array of transformation values"),we=c.z.lazy(()=>c.z.tuple([ve,ve]).describe("Loop transformation: [source, transform] tuple for array processing")),ke=c.z.lazy(()=>c.z.array(ve).describe("Set: Array of values for selection or combination")),Ce=c.z.lazy(()=>c.z.record(c.z.string(),ve).describe("Map: Object mapping keys to transformation values")),je=K=c.z.object({key:c.z.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'),value:c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).optional().describe("Static primitive value"),fn:c.z.string().optional().describe("Custom transformation function as string (serialized)"),map:Ce.optional().describe("Object mapping: transform event data to structured output"),loop:we.optional().describe("Loop transformation: [source, transform] for array processing"),set:ke.optional().describe("Set of values: combine or select from multiple values"),consent:ne.optional().describe("Required consent states to include this value"),condition:c.z.string().optional().describe("Condition function as string: return true to include value"),validate:c.z.string().optional().describe("Validation function as string: return true if value is valid")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value transformation configuration with multiple strategies"),Pe=c.z.record(c.z.string(),ve).describe("Policy rules for event pre-processing (key → value mapping)"),Je=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),condition:c.z.string().optional().describe("Condition function as string: return true to process event"),consent:ne.optional().describe("Required consent states to process this event"),settings:c.z.any().optional().describe("Destination-specific settings for this event mapping"),data:c.z.union([ve,ye]).optional().describe("Data transformation rules for event"),ignore:c.z.boolean().optional().describe("Set to true to skip processing this event"),name:c.z.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'),policy:Pe.optional().describe("Event-level policy overrides (applied after config-level policy)")}).describe("Mapping rule for specific entity-action combination"),Ee=c.z.record(c.z.string(),c.z.record(c.z.string(),c.z.union([Je,c.z.array(Je)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support"),De=c.z.object({consent:ne.optional().describe("Required consent states to process any events"),data:c.z.union([ve,ye]).optional().describe("Global data transformation applied to all events"),mapping:Ee.optional().describe("Entity-action specific mapping rules"),policy:Pe.optional().describe("Pre-processing policy rules applied before mapping")}).describe("Shared mapping configuration for sources and destinations"),xe=c.z.object({eventMapping:Je.optional().describe("Resolved mapping rule for event"),mappingKey:c.z.string().optional().describe('Mapping key used (e.g., "product.view")')}).describe("Mapping resolution result"),Ie=l(ve),Re=l(je),Le=l(we),Me=l(ke),Oe=l(Ce),qe=l(Pe),Te=l(Je),Ne=l(Ee),Ue=l(De),Ve={};r(Ve,{BatchSchema:()=>Qe,ConfigSchema:()=>We,ContextSchema:()=>He,DLQSchema:()=>ti,DataSchema:()=>Ke,DestinationPolicySchema:()=>Ae,DestinationsSchema:()=>ei,InitDestinationsSchema:()=>Ze,InitSchema:()=>Ye,InstanceSchema:()=>Xe,PartialConfigSchema:()=>Be,PushBatchContextSchema:()=>Fe,PushContextSchema:()=>_e,PushEventSchema:()=>Ge,PushEventsSchema:()=>$e,PushResultSchema:()=>ni,RefSchema:()=>ii,ResultSchema:()=>oi,batchJsonSchema:()=>li,configJsonSchema:()=>ri,contextJsonSchema:()=>si,instanceJsonSchema:()=>di,partialConfigJsonSchema:()=>ai,pushContextJsonSchema:()=>ci,resultJsonSchema:()=>pi});var We=c.z.object({consent:ne.optional().describe("Required consent states to send events to this destination"),settings:c.z.any().describe("Implementation-specific configuration").optional(),data:c.z.union([ve,ye]).optional().describe("Global data transformation applied to all events for this destination"),env:c.z.any().describe("Environment dependencies (platform-specific)").optional(),id:b.describe("Destination instance identifier (defaults to destination key)").optional(),init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional(),mapping:Ee.optional().describe("Entity-action specific mapping rules for this destination"),policy:Pe.optional().describe("Pre-processing policy rules applied before event mapping"),queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional(),verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional(),onError:w.optional(),onLog:k.optional()}).describe("Destination configuration"),Be=We.partial().describe("Partial destination configuration with all fields optional"),Ae=Pe.describe("Destination policy rules for event pre-processing"),He=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:We.describe("Destination configuration"),data:c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data"),env:c.z.unknown().describe("Environment dependencies")}).describe("Destination context for init and push functions"),_e=He.extend({mapping:Je.optional().describe("Resolved mapping rule for this specific event")}).describe("Push context with event-specific mapping"),Fe=_e.describe("Batch push context with event-specific mapping"),Ge=c.z.object({event:ce.describe("The event to process"),mapping:Je.optional().describe("Mapping rule for this event")}).describe("Event with optional mapping for batch processing"),$e=c.z.array(Ge).describe("Array of events with mappings"),Qe=c.z.object({key:c.z.string().describe('Batch key (usually mapping key like "product.view")'),events:c.z.array(ce).describe("Array of events in batch"),data:c.z.array(c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional()).describe("Transformed data for each event"),mapping:Je.optional().describe("Shared mapping rule for batch")}).describe("Batch of events grouped by mapping key"),Ke=c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)"),Xe=c.z.object({config:We.describe("Destination configuration"),queue:c.z.array(ce).optional().describe("Queued events awaiting consent"),dlq:c.z.array(c.z.tuple([ce,c.z.unknown()])).optional().describe("Dead letter queue (failed events with errors)"),type:c.z.string().optional().describe("Destination type identifier"),env:c.z.unknown().optional().describe("Environment dependencies"),init:c.z.unknown().optional().describe("Initialization function"),push:c.z.unknown().describe("Push function for single events"),pushBatch:c.z.unknown().optional().describe("Batch push function"),on:c.z.unknown().optional().describe("Event lifecycle hook function")}).describe("Destination instance (runtime object with functions)"),Ye=c.z.object({code:Xe.describe("Destination instance with implementation"),config:Be.optional().describe("Partial configuration overrides"),env:c.z.unknown().optional().describe("Partial environment overrides")}).describe("Destination initialization configuration"),Ze=c.z.record(c.z.string(),Ye).describe("Map of destination IDs to initialization configurations"),ei=c.z.record(c.z.string(),Xe).describe("Map of destination IDs to runtime instances"),ii=c.z.object({id:c.z.string().describe("Destination ID"),destination:Xe.describe("Destination instance")}).describe("Destination reference (ID + instance)"),ni=c.z.object({queue:c.z.array(ce).optional().describe("Events queued (awaiting consent)"),error:c.z.unknown().optional().describe("Error if push failed")}).describe("Push operation result"),oi=c.z.object({successful:c.z.array(ii).describe("Destinations that processed successfully"),queued:c.z.array(ii).describe("Destinations that queued events"),failed:c.z.array(ii).describe("Destinations that failed to process")}).describe("Overall destination processing result"),ti=c.z.array(c.z.tuple([ce,c.z.unknown()])).describe("Dead letter queue: [(event, error), ...]"),ri=l(We),ai=l(Be),si=l(He),ci=l(_e),li=l(Qe),di=l(Xe),pi=l(oi),ui={};r(ui,{CommandTypeSchema:()=>bi,ConfigSchema:()=>mi,DestinationsSchema:()=>Si,InitConfigSchema:()=>fi,InstanceSchema:()=>vi,PushContextSchema:()=>hi,SessionDataSchema:()=>gi,SourcesSchema:()=>zi,commandTypeJsonSchema:()=>yi,configJsonSchema:()=>wi,initConfigJsonSchema:()=>Ci,instanceJsonSchema:()=>Pi,pushContextJsonSchema:()=>ji,sessionDataJsonSchema:()=>ki});var bi=c.z.union([c.z.enum(["action","config","consent","context","destination","elb","globals","hook","init","link","run","user","walker"]),c.z.string()]).describe("Collector command type: standard commands or custom string for extensions"),mi=c.z.object({run:c.z.boolean().describe("Whether to run collector automatically on initialization").optional(),tagging:f,globalsStatic:Z.describe("Static global properties that persist across collector runs"),sessionStatic:c.z.record(c.z.string(),c.z.unknown()).describe("Static session data that persists across collector runs"),verbose:c.z.boolean().describe("Enable verbose logging for debugging"),onError:w.optional(),onLog:k.optional()}).describe("Core collector configuration"),gi=Z.and(c.z.object({isStart:c.z.boolean().describe("Whether this is a new session start"),storage:c.z.boolean().describe("Whether storage is available"),id:b.describe("Session identifier").optional(),start:m.describe("Session start timestamp").optional(),marketing:c.z.literal(!0).optional().describe("Marketing attribution flag"),updated:m.describe("Last update timestamp").optional(),isNew:c.z.boolean().describe("Whether this is a new session").optional(),device:b.describe("Device identifier").optional(),count:g.describe("Event count in session").optional(),runs:g.describe("Number of runs").optional()})).describe("Session state and tracking data"),fi=mi.partial().extend({consent:ne.optional().describe("Initial consent state"),user:oe.optional().describe("Initial user data"),globals:Z.optional().describe("Initial global properties"),sources:c.z.unknown().optional().describe("Source configurations"),destinations:c.z.unknown().optional().describe("Destination configurations"),custom:Z.optional().describe("Initial custom implementation-specific properties")}).describe("Collector initialization configuration with initial state"),hi=c.z.object({mapping:De.optional().describe("Source-level mapping configuration")}).describe("Push context with optional source mapping"),zi=c.z.record(c.z.string(),c.z.unknown()).describe("Map of source IDs to source instances"),Si=c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination IDs to destination instances"),vi=c.z.object({push:c.z.unknown().describe("Push function for processing events"),command:c.z.unknown().describe("Command function for walker commands"),allowed:c.z.boolean().describe("Whether event processing is allowed"),config:mi.describe("Current collector configuration"),consent:ne.describe("Current consent state"),count:c.z.number().describe("Event count (increments with each event)"),custom:Z.describe("Custom implementation-specific properties"),sources:zi.describe("Registered source instances"),destinations:Si.describe("Registered destination instances"),globals:Z.describe("Current global properties"),group:c.z.string().describe("Event grouping identifier"),hooks:c.z.unknown().describe("Lifecycle hook functions"),on:c.z.unknown().describe("Event lifecycle configuration"),queue:c.z.array(ce).describe("Queued events awaiting processing"),round:c.z.number().describe("Collector run count (increments with each run)"),session:c.z.union([gi]).describe("Current session state"),timing:c.z.number().describe("Event processing timing information"),user:oe.describe("Current user data"),version:c.z.string().describe("Walker implementation version")}).describe("Collector instance with state and methods"),yi=l(bi),wi=l(mi),ki=l(gi),Ci=l(fi),ji=l(hi),Pi=l(vi),Ji={};r(Ji,{BaseEnvSchema:()=>Ei,ConfigSchema:()=>Di,InitSchema:()=>Ri,InitSourceSchema:()=>Li,InitSourcesSchema:()=>Mi,InstanceSchema:()=>Ii,PartialConfigSchema:()=>xi,baseEnvJsonSchema:()=>Oi,configJsonSchema:()=>qi,initSourceJsonSchema:()=>Ui,initSourcesJsonSchema:()=>Vi,instanceJsonSchema:()=>Ni,partialConfigJsonSchema:()=>Ti});var Ei=c.z.object({push:c.z.unknown().describe("Collector push function"),command:c.z.unknown().describe("Collector command function"),sources:c.z.unknown().optional().describe("Map of registered source instances"),elb:c.z.unknown().describe("Public API function (alias for collector.push)")}).catchall(c.z.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this"),Di=De.extend({settings:c.z.any().describe("Implementation-specific configuration").optional(),env:Ei.optional().describe("Environment dependencies (platform-specific)"),id:b.describe("Source identifier (defaults to source key)").optional(),onError:w.optional(),disabled:c.z.boolean().describe("Set to true to disable").optional(),primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).describe("Source configuration with mapping and environment"),xi=Di.partial().describe("Partial source configuration with all fields optional"),Ii=c.z.object({type:c.z.string().describe('Source type identifier (e.g., "browser", "dataLayer")'),config:Di.describe("Current source configuration"),push:c.z.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"),destroy:c.z.any().optional().describe("Cleanup function called when source is removed"),on:c.z.unknown().optional().describe("Lifecycle hook function for event types")}).describe("Source instance with push handler and lifecycle methods"),Ri=c.z.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>"),Li=c.z.object({code:Ri.describe("Source initialization function"),config:xi.optional().describe("Partial configuration overrides"),env:Ei.partial().optional().describe("Partial environment overrides"),primary:c.z.boolean().optional().describe("Mark as primary source (only one can be primary)")}).describe("Source initialization configuration"),Mi=c.z.record(c.z.string(),Li).describe("Map of source IDs to initialization configurations"),Oi=l(Ei),qi=l(Di),Ti=l(xi),Ni=l(Ii),Ui=l(Li),Vi=l(Mi),Wi={};r(Wi,{ConfigSchema:()=>Ki,DefinitionsSchema:()=>Hi,DestinationReferenceSchema:()=>Qi,PackagesSchema:()=>_i,PrimitiveSchema:()=>Bi,ServerSchema:()=>Gi,SetupSchema:()=>Xi,SourceReferenceSchema:()=>$i,VariablesSchema:()=>Ai,WebSchema:()=>Fi,configJsonSchema:()=>tn,destinationReferenceJsonSchema:()=>an,parseConfig:()=>en,parseSetup:()=>Yi,safeParseConfig:()=>nn,safeParseSetup:()=>Zi,setupJsonSchema:()=>on,sourceReferenceJsonSchema:()=>rn});var Bi=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).describe("Primitive value: string, number, or boolean"),Ai=c.z.record(c.z.string(),Bi).describe("Variables for interpolation"),Hi=c.z.record(c.z.string(),c.z.unknown()).describe("Reusable configuration definitions"),_i=c.z.record(c.z.string(),c.z.object({version:c.z.string().optional(),imports:c.z.array(c.z.string()).optional(),path:c.z.string().optional()})).describe("NPM packages to bundle"),Fi=c.z.object({windowCollector:c.z.string().optional().describe('Window property name for collector instance (default: "collector")'),windowElb:c.z.string().optional().describe('Window property name for elb function (default: "elb")')}).describe("Web platform configuration"),Gi=c.z.object({}).passthrough().describe("Server platform configuration (reserved for future options)"),$i=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'),config:c.z.unknown().optional().describe("Source-specific configuration object"),env:c.z.unknown().optional().describe("Source environment configuration"),primary:c.z.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."),variables:Ai.optional().describe("Source-level variables (highest priority in cascade)"),definitions:Hi.optional().describe("Source-level definitions (highest priority in cascade)")}).describe("Source package reference with configuration"),Qi=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'),config:c.z.unknown().optional().describe("Destination-specific configuration object"),env:c.z.unknown().optional().describe("Destination environment configuration"),variables:Ai.optional().describe("Destination-level variables (highest priority in cascade)"),definitions:Hi.optional().describe("Destination-level definitions (highest priority in cascade)")}).describe("Destination package reference with configuration"),Ki=c.z.object({web:Fi.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."),server:Gi.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."),sources:c.z.record(c.z.string(),$i).optional().describe("Source configurations (data capture) keyed by unique identifier"),destinations:c.z.record(c.z.string(),Qi).optional().describe("Destination configurations (data output) keyed by unique identifier"),collector:c.z.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"),packages:_i.optional().describe("NPM packages to bundle"),variables:Ai.optional().describe("Flow-level variables (override Setup.variables, overridden by source/destination variables)"),definitions:Hi.optional().describe("Flow-level definitions (extend Setup.definitions, overridden by source/destination definitions)")}).refine(e=>{const i=void 0!==e.web,n=void 0!==e.server;return(i||n)&&!(i&&n)},{message:'Exactly one of "web" or "server" must be present'}).describe("Single flow configuration for one deployment target"),Xi=c.z.object({version:c.z.literal(1,{error:"Only version 1 is currently supported"}).describe("Configuration schema version (currently only 1 is supported)"),$schema:c.z.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v1.json")'),variables:Ai.optional().describe("Shared variables for interpolation across all flows (use ${VAR_NAME} or ${VAR_NAME:default} syntax)"),definitions:Hi.optional().describe('Reusable configuration definitions (reference with JSON Schema $ref syntax: { "$ref": "#/definitions/name" })'),flows:c.z.record(c.z.string(),Ki).refine(e=>Object.keys(e).length>0,{message:"At least one flow is required"}).describe("Named flow configurations (e.g., production, staging, development)")}).describe("Complete multi-flow walkerOS configuration (walkeros.config.json)");function Yi(e){return Xi.parse(e)}function Zi(e){return Xi.safeParse(e)}function en(e){return Ki.parse(e)}function nn(e){return Ki.safeParse(e)}var on=c.z.toJSONSchema(Xi,{target:"draft-7"}),tn=l(Ki),rn=l($i),an=l(Qi);function sn(e,i){const n=[],o={};for(const[i,t]of Object.entries(e)){t.required&&n.push(i);const e={type:t.type};if(t.description&&(e.description=t.description),t.pattern&&(e.pattern=t.pattern),void 0!==t.minLength&&(e.minLength=t.minLength),void 0!==t.maxLength&&(e.maxLength=t.maxLength),void 0!==t.minimum&&(e.minimum=t.minimum),void 0!==t.maximum&&(e.maximum=t.maximum),t.enum&&(e.enum=[...t.enum]),void 0!==t.default&&(e.default=t.default),"object"===t.type&&t.properties){const i={};for(const[e,n]of Object.entries(t.properties))i[e]=cn(n);e.properties=i}"array"===t.type&&t.items&&(e.items=cn(t.items)),o[i]=e}const t={type:"object",properties:o};return i&&(t.title=i),n.length>0&&(t.required=n),t}function cn(e){const i={type:e.type};if(e.description&&(i.description=e.description),e.pattern&&(i.pattern=e.pattern),void 0!==e.minLength&&(i.minLength=e.minLength),void 0!==e.maxLength&&(i.maxLength=e.maxLength),void 0!==e.minimum&&(i.minimum=e.minimum),void 0!==e.maximum&&(i.maximum=e.maximum),e.enum&&(i.enum=[...e.enum]),void 0!==e.default&&(i.default=e.default),"object"===e.type&&e.properties){const n={};for(const[i,o]of Object.entries(e.properties))n[i]=cn(o);i.properties=n}return"array"===e.type&&e.items&&(i.items=cn(e.items)),i}function ln(e,i){const n={type:"array",items:cn(e)};return void 0!==i?.minItems&&(n.minItems=i.minItems),void 0!==i?.maxItems&&(n.maxItems=i.maxItems),i?.description&&(n.description=i.description),i?.title&&(n.title=i.title),n}function dn(e,i="string",n){const o={type:i,enum:[...e]};return n?.description&&(o.description=n.description),n?.title&&(o.title=n.title),o}function pn(e,i,n){return ln({type:"object"},{minItems:2,maxItems:2,description:n||"Tuple with exactly 2 elements [source, transform]"})}function un(e){return c.z.toJSONSchema(e,{target:"draft-7"})}//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,t=Object.prototype.hasOwnProperty,r=(e,n)=>{for(var o in n)i(e,o,{get:n[o],enumerable:!0})},a={};r(a,{schemas:()=>s,z:()=>c.z,zodToSchema:()=>un}),module.exports=(e=a,((e,r,a,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of o(r))t.call(e,c)||c===a||i(e,c,{get:()=>r[c],enumerable:!(s=n(r,c))||s.enumerable});return e})(i({},"__esModule",{value:!0}),e));var s={};r(s,{BaseContextConfig:()=>H,BatchConfig:()=>_,CollectorSchemas:()=>ui,ConsentSchema:()=>ne,Counter:()=>g,DeepPartialEventSchema:()=>de,DestinationReferenceSchema:()=>Qi,DestinationSchemas:()=>Ve,DestinationsMapConfig:()=>$,DisabledConfig:()=>O,EntitiesSchema:()=>se,EntitySchema:()=>ae,EventSchema:()=>ce,FlowConfigSchema:()=>Ki,FlowSchemas:()=>Wi,GenericEnvConfig:()=>T,GenericSettingsConfig:()=>N,HandlersConfig:()=>x,IdConfig:()=>L,Identifier:()=>m,InitConfig:()=>M,LoopSchema:()=>we,MapSchema:()=>Ce,MappingResultSchema:()=>xe,MappingSchemas:()=>Se,OptionalPrimitiveValue:()=>z,OrderedPropertiesSchema:()=>ee,PartialEventSchema:()=>le,PolicySchema:()=>Pe,PrimaryConfig:()=>q,PrimitiveSchema:()=>Bi,PrimitiveValue:()=>h,ProcessingControlConfig:()=>F,PropertiesSchema:()=>Z,PropertySchema:()=>Y,PropertyTypeSchema:()=>X,QueueConfig:()=>R,RequiredBoolean:()=>u,RequiredNumber:()=>p,RequiredString:()=>d,RuleSchema:()=>Je,RulesSchema:()=>Ee,RuntimeInstanceConfig:()=>A,SetSchema:()=>ke,SetupSchema:()=>Xi,SourceReferenceSchema:()=>$i,SourceSchema:()=>re,SourceSchemas:()=>Ji,SourceTypeSchema:()=>ie,SourcesMapConfig:()=>G,TaggingVersion:()=>f,Timestamp:()=>b,UserSchema:()=>oe,UtilitySchemas:()=>S,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>ye,VerboseConfig:()=>I,VersionSchema:()=>te,WalkerOSSchemas:()=>Q,configJsonSchema:()=>tn,consentJsonSchema:()=>ze,createArraySchema:()=>ln,createConsentConfig:()=>B,createDataTransformationConfig:()=>U,createEnumSchema:()=>dn,createMappingRulesConfig:()=>V,createObjectSchema:()=>sn,createPolicyConfig:()=>W,createTupleSchema:()=>pn,destinationReferenceJsonSchema:()=>an,entityJsonSchema:()=>fe,eventJsonSchema:()=>pe,loopJsonSchema:()=>Le,mapJsonSchema:()=>Oe,orderedPropertiesJsonSchema:()=>ge,parseConfig:()=>en,parseSetup:()=>Yi,partialEventJsonSchema:()=>ue,policyJsonSchema:()=>qe,propertiesJsonSchema:()=>be,ruleJsonSchema:()=>Ne,rulesJsonSchema:()=>Te,safeParseConfig:()=>nn,safeParseSetup:()=>Zi,setJsonSchema:()=>Me,setupJsonSchema:()=>on,sourceReferenceJsonSchema:()=>rn,sourceTypeJsonSchema:()=>he,userJsonSchema:()=>me,valueConfigJsonSchema:()=>Re,valueJsonSchema:()=>Ie,z:()=>c.z,zodToSchema:()=>un});var c=require("zod");function l(e,i,n="draft-7"){return c.z.toJSONSchema(e,{target:n})}var d=c.z.string(),p=c.z.number(),u=c.z.boolean(),m=c.z.string().min(1),b=c.z.number().int().positive(),g=c.z.number().int().nonnegative(),f=c.z.number().describe("Tagging version number"),h=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]),z=h.optional(),S={};r(S,{ErrorHandlerSchema:()=>w,HandlerSchema:()=>C,LogHandlerSchema:()=>k,StorageSchema:()=>y,StorageTypeSchema:()=>v,errorHandlerJsonSchema:()=>J,handlerJsonSchema:()=>D,logHandlerJsonSchema:()=>E,storageJsonSchema:()=>P,storageTypeJsonSchema:()=>j});var v=c.z.enum(["local","session","cookie"]).describe("Storage mechanism: local, session, or cookie"),y=c.z.object({Local:c.z.literal("local"),Session:c.z.literal("session"),Cookie:c.z.literal("cookie")}).describe("Storage type constants for type-safe references"),w=c.z.any().describe("Error handler function: (error, state?) => void"),k=c.z.any().describe("Log handler function: (message, verbose?) => void"),C=c.z.object({Error:w.describe("Error handler function"),Log:k.describe("Log handler function")}).describe("Handler interface with error and log functions"),j=l(v),P=l(y),J=l(w),E=l(k),D=l(C),x=c.z.object({onError:w.optional().describe("Error handler function: (error, state?) => void"),onLog:k.optional().describe("Log handler function: (message, verbose?) => void")}).partial(),I=c.z.object({verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional()}).partial(),R=c.z.object({queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional()}).partial(),L=c.z.object({}).partial(),M=c.z.object({init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional()}).partial(),O=c.z.object({disabled:c.z.boolean().describe("Set to true to disable").optional()}).partial(),q=c.z.object({primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).partial(),N=c.z.object({settings:c.z.any().optional().describe("Implementation-specific configuration")}).partial(),T=c.z.object({env:c.z.any().optional().describe("Environment dependencies (platform-specific)")}).partial();function U(e,i){return c.z.object({data:c.z.union([e,i]).optional().describe("Data transformation rules")}).partial()}function V(e){return c.z.object({mapping:e.optional().describe("Event mapping rules")}).partial()}function W(e){return c.z.object({policy:e.optional().describe("Pre-processing policy rules")}).partial()}function B(e){return c.z.object({consent:e.optional().describe("Required consent states")}).partial()}var A=c.z.object({type:c.z.string().optional().describe("Instance type identifier"),config:c.z.unknown().describe("Instance configuration")}).partial(),H=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:c.z.unknown().describe("Configuration"),env:c.z.unknown().describe("Environment dependencies")}).partial(),_=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),batched:c.z.unknown().optional().describe("Batch of events to be processed")}).partial(),F=c.z.object({ignore:c.z.boolean().describe("Set to true to skip processing").optional(),condition:c.z.string().optional().describe("Condition function: return true to process")}).partial(),G=c.z.object({sources:c.z.record(c.z.string(),c.z.unknown()).describe("Map of source instances")}).partial(),$=c.z.object({destinations:c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination instances")}).partial(),Q={};r(Q,{ConsentSchema:()=>ne,DeepPartialEventSchema:()=>de,EntitiesSchema:()=>se,EntitySchema:()=>ae,EventSchema:()=>ce,OrderedPropertiesSchema:()=>ee,PartialEventSchema:()=>le,PropertiesSchema:()=>Z,PropertySchema:()=>Y,PropertyTypeSchema:()=>X,SourceSchema:()=>re,SourceTypeSchema:()=>ie,UserSchema:()=>oe,VersionSchema:()=>te,consentJsonSchema:()=>ze,entityJsonSchema:()=>fe,eventJsonSchema:()=>pe,orderedPropertiesJsonSchema:()=>ge,partialEventJsonSchema:()=>ue,propertiesJsonSchema:()=>be,sourceTypeJsonSchema:()=>he,userJsonSchema:()=>me});var K,X=c.z.lazy(()=>c.z.union([c.z.boolean(),c.z.string(),c.z.number(),c.z.record(c.z.string(),Y)])),Y=c.z.lazy(()=>c.z.union([X,c.z.array(X)])),Z=c.z.record(c.z.string(),Y.optional()).describe("Flexible property collection with optional values"),ee=c.z.record(c.z.string(),c.z.tuple([Y,c.z.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control"),ie=c.z.union([c.z.enum(["web","server","app","other"]),c.z.string()]).describe("Source type: web, server, app, other, or custom"),ne=c.z.record(c.z.string(),c.z.boolean()).describe("Consent requirement mapping (group name → state)"),oe=Z.and(c.z.object({id:c.z.string().optional().describe("User identifier"),device:c.z.string().optional().describe("Device identifier"),session:c.z.string().optional().describe("Session identifier"),hash:c.z.string().optional().describe("Hashed identifier"),address:c.z.string().optional().describe("User address"),email:c.z.string().email().optional().describe("User email address"),phone:c.z.string().optional().describe("User phone number"),userAgent:c.z.string().optional().describe("Browser user agent string"),browser:c.z.string().optional().describe("Browser name"),browserVersion:c.z.string().optional().describe("Browser version"),deviceType:c.z.string().optional().describe("Device type (mobile, desktop, tablet)"),os:c.z.string().optional().describe("Operating system"),osVersion:c.z.string().optional().describe("Operating system version"),screenSize:c.z.string().optional().describe("Screen dimensions"),language:c.z.string().optional().describe("User language"),country:c.z.string().optional().describe("User country"),region:c.z.string().optional().describe("User region/state"),city:c.z.string().optional().describe("User city"),zip:c.z.string().optional().describe("User postal code"),timezone:c.z.string().optional().describe("User timezone"),ip:c.z.string().optional().describe("User IP address"),internal:c.z.boolean().optional().describe("Internal user flag (employee, test user)")})).describe("User identification and properties"),te=Z.and(c.z.object({source:d.describe('Walker implementation version (e.g., "2.0.0")'),tagging:f})).describe("Walker version information"),re=Z.and(c.z.object({type:ie.describe("Source type identifier"),id:d.describe("Source identifier (typically URL on web)"),previous_id:d.describe("Previous source identifier (typically referrer on web)")})).describe("Event source information"),ae=c.z.lazy(()=>c.z.object({entity:c.z.string().describe("Entity name"),data:Z.describe("Entity-specific properties"),nested:c.z.array(ae).describe("Nested child entities"),context:ee.describe("Entity context data")})).describe("Nested entity structure with recursive nesting support"),se=c.z.array(ae).describe("Array of nested entities"),ce=c.z.object({name:c.z.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'),data:Z.describe("Event-specific properties"),context:ee.describe("Ordered context properties with priorities"),globals:Z.describe("Global properties shared across events"),custom:Z.describe("Custom implementation-specific properties"),user:oe.describe("User identification and attributes"),nested:se.describe("Related nested entities"),consent:ne.describe("Consent states at event time"),id:m.describe("Unique event identifier (timestamp-based)"),trigger:d.describe("Event trigger identifier"),entity:d.describe("Parsed entity from event name"),action:d.describe("Parsed action from event name"),timestamp:b.describe("Unix timestamp in milliseconds since epoch"),timing:p.describe("Event processing timing information"),group:d.describe("Event grouping identifier"),count:g.describe("Event count in session"),version:te.describe("Walker version information"),source:re.describe("Event source information")}).describe("Complete walkerOS event structure"),le=ce.partial().describe("Partial event structure with all fields optional"),de=ce.partial().describe("Partial event structure with all top-level fields optional"),pe=l(ce),ue=l(le),me=l(oe),be=l(Z),ge=l(ee),fe=l(ae),he=l(ie),ze=l(ne),Se={};r(Se,{ConfigSchema:()=>De,LoopSchema:()=>we,MapSchema:()=>Ce,PolicySchema:()=>Pe,ResultSchema:()=>xe,RuleSchema:()=>Je,RulesSchema:()=>Ee,SetSchema:()=>ke,ValueConfigSchema:()=>je,ValueSchema:()=>ve,ValuesSchema:()=>ye,configJsonSchema:()=>Ue,loopJsonSchema:()=>Le,mapJsonSchema:()=>Oe,policyJsonSchema:()=>qe,ruleJsonSchema:()=>Ne,rulesJsonSchema:()=>Te,setJsonSchema:()=>Me,valueConfigJsonSchema:()=>Re,valueJsonSchema:()=>Ie});var ve=c.z.lazy(()=>c.z.union([c.z.string().describe('String value or property path (e.g., "data.id")'),c.z.number().describe("Numeric value"),c.z.boolean().describe("Boolean value"),c.z.lazy(()=>K),c.z.array(ve).describe("Array of values")])),ye=c.z.array(ve).describe("Array of transformation values"),we=c.z.lazy(()=>c.z.tuple([ve,ve]).describe("Loop transformation: [source, transform] tuple for array processing")),ke=c.z.lazy(()=>c.z.array(ve).describe("Set: Array of values for selection or combination")),Ce=c.z.lazy(()=>c.z.record(c.z.string(),ve).describe("Map: Object mapping keys to transformation values")),je=K=c.z.object({key:c.z.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'),value:c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).optional().describe("Static primitive value"),fn:c.z.string().optional().describe("Custom transformation function as string (serialized)"),map:Ce.optional().describe("Object mapping: transform event data to structured output"),loop:we.optional().describe("Loop transformation: [source, transform] for array processing"),set:ke.optional().describe("Set of values: combine or select from multiple values"),consent:ne.optional().describe("Required consent states to include this value"),condition:c.z.string().optional().describe("Condition function as string: return true to include value"),validate:c.z.string().optional().describe("Validation function as string: return true if value is valid")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value transformation configuration with multiple strategies"),Pe=c.z.record(c.z.string(),ve).describe("Policy rules for event pre-processing (key → value mapping)"),Je=c.z.object({batch:c.z.number().optional().describe("Batch size: bundle N events for batch processing"),condition:c.z.string().optional().describe("Condition function as string: return true to process event"),consent:ne.optional().describe("Required consent states to process this event"),settings:c.z.any().optional().describe("Destination-specific settings for this event mapping"),data:c.z.union([ve,ye]).optional().describe("Data transformation rules for event"),ignore:c.z.boolean().optional().describe("Set to true to skip processing this event"),name:c.z.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'),policy:Pe.optional().describe("Event-level policy overrides (applied after config-level policy)")}).describe("Mapping rule for specific entity-action combination"),Ee=c.z.record(c.z.string(),c.z.record(c.z.string(),c.z.union([Je,c.z.array(Je)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support"),De=c.z.object({consent:ne.optional().describe("Required consent states to process any events"),data:c.z.union([ve,ye]).optional().describe("Global data transformation applied to all events"),mapping:Ee.optional().describe("Entity-action specific mapping rules"),policy:Pe.optional().describe("Pre-processing policy rules applied before mapping")}).describe("Shared mapping configuration for sources and destinations"),xe=c.z.object({eventMapping:Je.optional().describe("Resolved mapping rule for event"),mappingKey:c.z.string().optional().describe('Mapping key used (e.g., "product.view")')}).describe("Mapping resolution result"),Ie=l(ve),Re=l(je),Le=l(we),Me=l(ke),Oe=l(Ce),qe=l(Pe),Ne=l(Je),Te=l(Ee),Ue=l(De),Ve={};r(Ve,{BatchSchema:()=>Qe,ConfigSchema:()=>We,ContextSchema:()=>He,DLQSchema:()=>ti,DataSchema:()=>Ke,DestinationPolicySchema:()=>Ae,DestinationsSchema:()=>ei,InitDestinationsSchema:()=>Ze,InitSchema:()=>Ye,InstanceSchema:()=>Xe,PartialConfigSchema:()=>Be,PushBatchContextSchema:()=>Fe,PushContextSchema:()=>_e,PushEventSchema:()=>Ge,PushEventsSchema:()=>$e,PushResultSchema:()=>ni,RefSchema:()=>ii,ResultSchema:()=>oi,batchJsonSchema:()=>li,configJsonSchema:()=>ri,contextJsonSchema:()=>si,instanceJsonSchema:()=>di,partialConfigJsonSchema:()=>ai,pushContextJsonSchema:()=>ci,resultJsonSchema:()=>pi});var We=c.z.object({consent:ne.optional().describe("Required consent states to send events to this destination"),settings:c.z.any().describe("Implementation-specific configuration").optional(),data:c.z.union([ve,ye]).optional().describe("Global data transformation applied to all events for this destination"),env:c.z.any().describe("Environment dependencies (platform-specific)").optional(),id:m.describe("Destination instance identifier (defaults to destination key)").optional(),init:c.z.boolean().describe("Whether to initialize immediately").optional(),loadScript:c.z.boolean().describe("Whether to load external script (for web destinations)").optional(),mapping:Ee.optional().describe("Entity-action specific mapping rules for this destination"),policy:Pe.optional().describe("Pre-processing policy rules applied before event mapping"),queue:c.z.boolean().describe("Whether to queue events when consent is not granted").optional(),verbose:c.z.boolean().describe("Enable verbose logging for debugging").optional(),onError:w.optional(),onLog:k.optional()}).describe("Destination configuration"),Be=We.partial().describe("Partial destination configuration with all fields optional"),Ae=Pe.describe("Destination policy rules for event pre-processing"),He=c.z.object({collector:c.z.unknown().describe("Collector instance (runtime object)"),config:We.describe("Destination configuration"),data:c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data"),env:c.z.unknown().describe("Environment dependencies")}).describe("Destination context for init and push functions"),_e=He.extend({mapping:Je.optional().describe("Resolved mapping rule for this specific event")}).describe("Push context with event-specific mapping"),Fe=_e.describe("Batch push context with event-specific mapping"),Ge=c.z.object({event:ce.describe("The event to process"),mapping:Je.optional().describe("Mapping rule for this event")}).describe("Event with optional mapping for batch processing"),$e=c.z.array(Ge).describe("Array of events with mappings"),Qe=c.z.object({key:c.z.string().describe('Batch key (usually mapping key like "product.view")'),events:c.z.array(ce).describe("Array of events in batch"),data:c.z.array(c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional()).describe("Transformed data for each event"),mapping:Je.optional().describe("Shared mapping rule for batch")}).describe("Batch of events grouped by mapping key"),Ke=c.z.union([c.z.unknown(),c.z.array(c.z.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)"),Xe=c.z.object({config:We.describe("Destination configuration"),queue:c.z.array(ce).optional().describe("Queued events awaiting consent"),dlq:c.z.array(c.z.tuple([ce,c.z.unknown()])).optional().describe("Dead letter queue (failed events with errors)"),type:c.z.string().optional().describe("Destination type identifier"),env:c.z.unknown().optional().describe("Environment dependencies"),init:c.z.unknown().optional().describe("Initialization function"),push:c.z.unknown().describe("Push function for single events"),pushBatch:c.z.unknown().optional().describe("Batch push function"),on:c.z.unknown().optional().describe("Event lifecycle hook function")}).describe("Destination instance (runtime object with functions)"),Ye=c.z.object({code:Xe.describe("Destination instance with implementation"),config:Be.optional().describe("Partial configuration overrides"),env:c.z.unknown().optional().describe("Partial environment overrides")}).describe("Destination initialization configuration"),Ze=c.z.record(c.z.string(),Ye).describe("Map of destination IDs to initialization configurations"),ei=c.z.record(c.z.string(),Xe).describe("Map of destination IDs to runtime instances"),ii=c.z.object({id:c.z.string().describe("Destination ID"),destination:Xe.describe("Destination instance")}).describe("Destination reference (ID + instance)"),ni=c.z.object({queue:c.z.array(ce).optional().describe("Events queued (awaiting consent)"),error:c.z.unknown().optional().describe("Error if push failed")}).describe("Push operation result"),oi=c.z.object({successful:c.z.array(ii).describe("Destinations that processed successfully"),queued:c.z.array(ii).describe("Destinations that queued events"),failed:c.z.array(ii).describe("Destinations that failed to process")}).describe("Overall destination processing result"),ti=c.z.array(c.z.tuple([ce,c.z.unknown()])).describe("Dead letter queue: [(event, error), ...]"),ri=l(We),ai=l(Be),si=l(He),ci=l(_e),li=l(Qe),di=l(Xe),pi=l(oi),ui={};r(ui,{CommandTypeSchema:()=>mi,ConfigSchema:()=>bi,DestinationsSchema:()=>Si,InitConfigSchema:()=>fi,InstanceSchema:()=>vi,PushContextSchema:()=>hi,SessionDataSchema:()=>gi,SourcesSchema:()=>zi,commandTypeJsonSchema:()=>yi,configJsonSchema:()=>wi,initConfigJsonSchema:()=>Ci,instanceJsonSchema:()=>Pi,pushContextJsonSchema:()=>ji,sessionDataJsonSchema:()=>ki});var mi=c.z.union([c.z.enum(["action","config","consent","context","destination","elb","globals","hook","init","link","run","user","walker"]),c.z.string()]).describe("Collector command type: standard commands or custom string for extensions"),bi=c.z.object({run:c.z.boolean().describe("Whether to run collector automatically on initialization").optional(),tagging:f,globalsStatic:Z.describe("Static global properties that persist across collector runs"),sessionStatic:c.z.record(c.z.string(),c.z.unknown()).describe("Static session data that persists across collector runs"),verbose:c.z.boolean().describe("Enable verbose logging for debugging"),onError:w.optional(),onLog:k.optional()}).describe("Core collector configuration"),gi=Z.and(c.z.object({isStart:c.z.boolean().describe("Whether this is a new session start"),storage:c.z.boolean().describe("Whether storage is available"),id:m.describe("Session identifier").optional(),start:b.describe("Session start timestamp").optional(),marketing:c.z.literal(!0).optional().describe("Marketing attribution flag"),updated:b.describe("Last update timestamp").optional(),isNew:c.z.boolean().describe("Whether this is a new session").optional(),device:m.describe("Device identifier").optional(),count:g.describe("Event count in session").optional(),runs:g.describe("Number of runs").optional()})).describe("Session state and tracking data"),fi=bi.partial().extend({consent:ne.optional().describe("Initial consent state"),user:oe.optional().describe("Initial user data"),globals:Z.optional().describe("Initial global properties"),sources:c.z.unknown().optional().describe("Source configurations"),destinations:c.z.unknown().optional().describe("Destination configurations"),custom:Z.optional().describe("Initial custom implementation-specific properties")}).describe("Collector initialization configuration with initial state"),hi=c.z.object({mapping:De.optional().describe("Source-level mapping configuration")}).describe("Push context with optional source mapping"),zi=c.z.record(c.z.string(),c.z.unknown()).describe("Map of source IDs to source instances"),Si=c.z.record(c.z.string(),c.z.unknown()).describe("Map of destination IDs to destination instances"),vi=c.z.object({push:c.z.unknown().describe("Push function for processing events"),command:c.z.unknown().describe("Command function for walker commands"),allowed:c.z.boolean().describe("Whether event processing is allowed"),config:bi.describe("Current collector configuration"),consent:ne.describe("Current consent state"),count:c.z.number().describe("Event count (increments with each event)"),custom:Z.describe("Custom implementation-specific properties"),sources:zi.describe("Registered source instances"),destinations:Si.describe("Registered destination instances"),globals:Z.describe("Current global properties"),group:c.z.string().describe("Event grouping identifier"),hooks:c.z.unknown().describe("Lifecycle hook functions"),on:c.z.unknown().describe("Event lifecycle configuration"),queue:c.z.array(ce).describe("Queued events awaiting processing"),round:c.z.number().describe("Collector run count (increments with each run)"),session:c.z.union([gi]).describe("Current session state"),timing:c.z.number().describe("Event processing timing information"),user:oe.describe("Current user data"),version:c.z.string().describe("Walker implementation version")}).describe("Collector instance with state and methods"),yi=l(mi),wi=l(bi),ki=l(gi),Ci=l(fi),ji=l(hi),Pi=l(vi),Ji={};r(Ji,{BaseEnvSchema:()=>Ei,ConfigSchema:()=>Di,InitSchema:()=>Ri,InitSourceSchema:()=>Li,InitSourcesSchema:()=>Mi,InstanceSchema:()=>Ii,PartialConfigSchema:()=>xi,baseEnvJsonSchema:()=>Oi,configJsonSchema:()=>qi,initSourceJsonSchema:()=>Ui,initSourcesJsonSchema:()=>Vi,instanceJsonSchema:()=>Ti,partialConfigJsonSchema:()=>Ni});var Ei=c.z.object({push:c.z.unknown().describe("Collector push function"),command:c.z.unknown().describe("Collector command function"),sources:c.z.unknown().optional().describe("Map of registered source instances"),elb:c.z.unknown().describe("Public API function (alias for collector.push)")}).catchall(c.z.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this"),Di=De.extend({settings:c.z.any().describe("Implementation-specific configuration").optional(),env:Ei.optional().describe("Environment dependencies (platform-specific)"),id:m.describe("Source identifier (defaults to source key)").optional(),onError:w.optional(),disabled:c.z.boolean().describe("Set to true to disable").optional(),primary:c.z.boolean().describe("Mark as primary (only one can be primary)").optional()}).describe("Source configuration with mapping and environment"),xi=Di.partial().describe("Partial source configuration with all fields optional"),Ii=c.z.object({type:c.z.string().describe('Source type identifier (e.g., "browser", "dataLayer")'),config:Di.describe("Current source configuration"),push:c.z.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"),destroy:c.z.any().optional().describe("Cleanup function called when source is removed"),on:c.z.unknown().optional().describe("Lifecycle hook function for event types")}).describe("Source instance with push handler and lifecycle methods"),Ri=c.z.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>"),Li=c.z.object({code:Ri.describe("Source initialization function"),config:xi.optional().describe("Partial configuration overrides"),env:Ei.partial().optional().describe("Partial environment overrides"),primary:c.z.boolean().optional().describe("Mark as primary source (only one can be primary)")}).describe("Source initialization configuration"),Mi=c.z.record(c.z.string(),Li).describe("Map of source IDs to initialization configurations"),Oi=l(Ei),qi=l(Di),Ni=l(xi),Ti=l(Ii),Ui=l(Li),Vi=l(Mi),Wi={};r(Wi,{ConfigSchema:()=>Ki,DefinitionsSchema:()=>Hi,DestinationReferenceSchema:()=>Qi,PackagesSchema:()=>_i,PrimitiveSchema:()=>Bi,ServerSchema:()=>Gi,SetupSchema:()=>Xi,SourceReferenceSchema:()=>$i,VariablesSchema:()=>Ai,WebSchema:()=>Fi,configJsonSchema:()=>tn,destinationReferenceJsonSchema:()=>an,parseConfig:()=>en,parseSetup:()=>Yi,safeParseConfig:()=>nn,safeParseSetup:()=>Zi,setupJsonSchema:()=>on,sourceReferenceJsonSchema:()=>rn});var Bi=c.z.union([c.z.string(),c.z.number(),c.z.boolean()]).describe("Primitive value: string, number, or boolean"),Ai=c.z.record(c.z.string(),Bi).describe("Variables for interpolation"),Hi=c.z.record(c.z.string(),c.z.unknown()).describe("Reusable configuration definitions"),_i=c.z.record(c.z.string(),c.z.object({version:c.z.string().optional(),imports:c.z.array(c.z.string()).optional(),path:c.z.string().optional()})).describe("NPM packages to bundle"),Fi=c.z.object({windowCollector:c.z.string().optional().describe('Window property name for collector instance (default: "collector")'),windowElb:c.z.string().optional().describe('Window property name for elb function (default: "elb")')}).describe("Web platform configuration"),Gi=c.z.object({}).passthrough().describe("Server platform configuration (reserved for future options)"),$i=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'),code:c.z.string().optional().describe('Named export to use from the package (e.g., "sourceExpress"). If omitted, uses default export.'),config:c.z.unknown().optional().describe("Source-specific configuration object"),env:c.z.unknown().optional().describe("Source environment configuration"),primary:c.z.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."),variables:Ai.optional().describe("Source-level variables (highest priority in cascade)"),definitions:Hi.optional().describe("Source-level definitions (highest priority in cascade)")}).describe("Source package reference with configuration"),Qi=c.z.object({package:c.z.string().min(1,"Package name cannot be empty").describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'),code:c.z.string().optional().describe('Named export to use from the package (e.g., "destinationAnalytics"). If omitted, uses default export.'),config:c.z.unknown().optional().describe("Destination-specific configuration object"),env:c.z.unknown().optional().describe("Destination environment configuration"),variables:Ai.optional().describe("Destination-level variables (highest priority in cascade)"),definitions:Hi.optional().describe("Destination-level definitions (highest priority in cascade)")}).describe("Destination package reference with configuration"),Ki=c.z.object({web:Fi.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."),server:Gi.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."),sources:c.z.record(c.z.string(),$i).optional().describe("Source configurations (data capture) keyed by unique identifier"),destinations:c.z.record(c.z.string(),Qi).optional().describe("Destination configurations (data output) keyed by unique identifier"),collector:c.z.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"),packages:_i.optional().describe("NPM packages to bundle"),variables:Ai.optional().describe("Flow-level variables (override Setup.variables, overridden by source/destination variables)"),definitions:Hi.optional().describe("Flow-level definitions (extend Setup.definitions, overridden by source/destination definitions)")}).refine(e=>{const i=void 0!==e.web,n=void 0!==e.server;return(i||n)&&!(i&&n)},{message:'Exactly one of "web" or "server" must be present'}).describe("Single flow configuration for one deployment target"),Xi=c.z.object({version:c.z.literal(1,{error:"Only version 1 is currently supported"}).describe("Configuration schema version (currently only 1 is supported)"),$schema:c.z.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v1.json")'),variables:Ai.optional().describe("Shared variables for interpolation across all flows (use ${VAR_NAME} or ${VAR_NAME:default} syntax)"),definitions:Hi.optional().describe('Reusable configuration definitions (reference with JSON Schema $ref syntax: { "$ref": "#/definitions/name" })'),flows:c.z.record(c.z.string(),Ki).refine(e=>Object.keys(e).length>0,{message:"At least one flow is required"}).describe("Named flow configurations (e.g., production, staging, development)")}).describe("Complete multi-flow walkerOS configuration (walkeros.config.json)");function Yi(e){return Xi.parse(e)}function Zi(e){return Xi.safeParse(e)}function en(e){return Ki.parse(e)}function nn(e){return Ki.safeParse(e)}var on=c.z.toJSONSchema(Xi,{target:"draft-7"}),tn=l(Ki),rn=l($i),an=l(Qi);function sn(e,i){const n=[],o={};for(const[i,t]of Object.entries(e)){t.required&&n.push(i);const e={type:t.type};if(t.description&&(e.description=t.description),t.pattern&&(e.pattern=t.pattern),void 0!==t.minLength&&(e.minLength=t.minLength),void 0!==t.maxLength&&(e.maxLength=t.maxLength),void 0!==t.minimum&&(e.minimum=t.minimum),void 0!==t.maximum&&(e.maximum=t.maximum),t.enum&&(e.enum=[...t.enum]),void 0!==t.default&&(e.default=t.default),"object"===t.type&&t.properties){const i={};for(const[e,n]of Object.entries(t.properties))i[e]=cn(n);e.properties=i}"array"===t.type&&t.items&&(e.items=cn(t.items)),o[i]=e}const t={type:"object",properties:o};return i&&(t.title=i),n.length>0&&(t.required=n),t}function cn(e){const i={type:e.type};if(e.description&&(i.description=e.description),e.pattern&&(i.pattern=e.pattern),void 0!==e.minLength&&(i.minLength=e.minLength),void 0!==e.maxLength&&(i.maxLength=e.maxLength),void 0!==e.minimum&&(i.minimum=e.minimum),void 0!==e.maximum&&(i.maximum=e.maximum),e.enum&&(i.enum=[...e.enum]),void 0!==e.default&&(i.default=e.default),"object"===e.type&&e.properties){const n={};for(const[i,o]of Object.entries(e.properties))n[i]=cn(o);i.properties=n}return"array"===e.type&&e.items&&(i.items=cn(e.items)),i}function ln(e,i){const n={type:"array",items:cn(e)};return void 0!==i?.minItems&&(n.minItems=i.minItems),void 0!==i?.maxItems&&(n.maxItems=i.maxItems),i?.description&&(n.description=i.description),i?.title&&(n.title=i.title),n}function dn(e,i="string",n){const o={type:i,enum:[...e]};return n?.description&&(o.description=n.description),n?.title&&(o.title=n.title),o}function pn(e,i,n){return ln({type:"object"},{minItems:2,maxItems:2,description:n||"Tuple with exactly 2 elements [source, transform]"})}function un(e){return c.z.toJSONSchema(e,{target:"draft-7"})}//# sourceMappingURL=dev.js.map
|