@walkeros/cli 4.6.1 → 4.7.0-next-1790245733116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/dist/cli.js +10104 -11209
- package/dist/dev.d.ts +4 -25
- package/dist/dev.js +38 -47
- package/dist/dev.js.map +1 -1
- package/dist/examples/README.md +1 -0
- package/dist/examples/flow-complete.json +2 -4
- package/dist/examples/index.js +2 -4
- package/dist/examples/index.js.map +1 -1
- package/dist/index.d.ts +393 -262
- package/dist/index.js +1167 -3560
- package/dist/index.js.map +1 -1
- package/examples/README.md +1 -0
- package/examples/flow-complete.json +2 -4
- package/openapi/spec.json +10 -162
- package/package.json +11 -16
package/dist/dev.d.ts
CHANGED
|
@@ -24,25 +24,6 @@ declare const PortSchema: z.ZodNumber;
|
|
|
24
24
|
*/
|
|
25
25
|
declare const FilePathSchema: z.ZodString;
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* Run Command Schemas
|
|
29
|
-
*
|
|
30
|
-
* Zod schemas for run command options validation.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Run command options schema.
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* Validates all options for the `walkeros run` command.
|
|
38
|
-
*/
|
|
39
|
-
declare const RunOptionsSchema: z.ZodObject<{
|
|
40
|
-
flow: z.ZodString;
|
|
41
|
-
port: z.ZodDefault<z.ZodNumber>;
|
|
42
|
-
flowName: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
type RunOptions = z.infer<typeof RunOptionsSchema>;
|
|
45
|
-
|
|
46
27
|
/**
|
|
47
28
|
* Validate Command Schemas
|
|
48
29
|
*
|
|
@@ -60,9 +41,9 @@ type RunOptions = z.infer<typeof RunOptionsSchema>;
|
|
|
60
41
|
* - `mapping`: Validate mapping rules
|
|
61
42
|
*/
|
|
62
43
|
declare const ValidationTypeSchema: z.ZodEnum<{
|
|
63
|
-
flow: "flow";
|
|
64
44
|
contract: "contract";
|
|
65
45
|
event: "event";
|
|
46
|
+
flow: "flow";
|
|
66
47
|
mapping: "mapping";
|
|
67
48
|
}>;
|
|
68
49
|
type ValidationType = z.infer<typeof ValidationTypeSchema>;
|
|
@@ -86,9 +67,9 @@ type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
|
|
|
86
67
|
*/
|
|
87
68
|
declare const ValidateInputShape: {
|
|
88
69
|
type: z.ZodEnum<{
|
|
89
|
-
flow: "flow";
|
|
90
70
|
contract: "contract";
|
|
91
71
|
event: "event";
|
|
72
|
+
flow: "flow";
|
|
92
73
|
mapping: "mapping";
|
|
93
74
|
}>;
|
|
94
75
|
input: z.ZodString;
|
|
@@ -103,9 +84,9 @@ declare const ValidateInputShape: {
|
|
|
103
84
|
*/
|
|
104
85
|
declare const ValidateInputSchema: z.ZodObject<{
|
|
105
86
|
type: z.ZodEnum<{
|
|
106
|
-
flow: "flow";
|
|
107
87
|
contract: "contract";
|
|
108
88
|
event: "event";
|
|
89
|
+
flow: "flow";
|
|
109
90
|
mapping: "mapping";
|
|
110
91
|
}>;
|
|
111
92
|
input: z.ZodString;
|
|
@@ -297,8 +278,6 @@ declare const index_PushInputSchema: typeof PushInputSchema;
|
|
|
297
278
|
declare const index_PushInputShape: typeof PushInputShape;
|
|
298
279
|
type index_PushOptions = PushOptions;
|
|
299
280
|
declare const index_PushOptionsSchema: typeof PushOptionsSchema;
|
|
300
|
-
type index_RunOptions = RunOptions;
|
|
301
|
-
declare const index_RunOptionsSchema: typeof RunOptionsSchema;
|
|
302
281
|
type index_SimulateInput = SimulateInput;
|
|
303
282
|
declare const index_SimulateInputSchema: typeof SimulateInputSchema;
|
|
304
283
|
declare const index_SimulateInputShape: typeof SimulateInputShape;
|
|
@@ -312,7 +291,7 @@ declare const index_ValidateOptionsSchema: typeof ValidateOptionsSchema;
|
|
|
312
291
|
type index_ValidationType = ValidationType;
|
|
313
292
|
declare const index_ValidationTypeSchema: typeof ValidationTypeSchema;
|
|
314
293
|
declare namespace index {
|
|
315
|
-
export { type index_BundleInput as BundleInput, index_BundleInputSchema as BundleInputSchema, index_BundleInputShape as BundleInputShape, type index_BundleOptions as BundleOptions, index_BundleOptionsSchema as BundleOptionsSchema, index_FilePathSchema as FilePathSchema, type index_Platform as Platform, index_PlatformSchema as PlatformSchema, index_PortSchema as PortSchema, type index_PushInput as PushInput, index_PushInputSchema as PushInputSchema, index_PushInputShape as PushInputShape, type index_PushOptions as PushOptions, index_PushOptionsSchema as PushOptionsSchema, type
|
|
294
|
+
export { type index_BundleInput as BundleInput, index_BundleInputSchema as BundleInputSchema, index_BundleInputShape as BundleInputShape, type index_BundleOptions as BundleOptions, index_BundleOptionsSchema as BundleOptionsSchema, index_FilePathSchema as FilePathSchema, type index_Platform as Platform, index_PlatformSchema as PlatformSchema, index_PortSchema as PortSchema, type index_PushInput as PushInput, index_PushInputSchema as PushInputSchema, index_PushInputShape as PushInputShape, type index_PushOptions as PushOptions, index_PushOptionsSchema as PushOptionsSchema, type index_SimulateInput as SimulateInput, index_SimulateInputSchema as SimulateInputSchema, index_SimulateInputShape as SimulateInputShape, type index_SimulateOptions as SimulateOptions, index_SimulateOptionsSchema as SimulateOptionsSchema, type index_ValidateInput as ValidateInput, index_ValidateInputSchema as ValidateInputSchema, index_ValidateInputShape as ValidateInputShape, type index_ValidateOptions as ValidateOptions, index_ValidateOptionsSchema as ValidateOptionsSchema, type index_ValidationType as ValidationType, index_ValidationTypeSchema as ValidationTypeSchema };
|
|
316
295
|
}
|
|
317
296
|
|
|
318
297
|
export { index as schemas };
|
package/dist/dev.js
CHANGED
|
@@ -16,7 +16,6 @@ __export(schemas_exports, {
|
|
|
16
16
|
PushInputSchema: () => PushInputSchema,
|
|
17
17
|
PushInputShape: () => PushInputShape,
|
|
18
18
|
PushOptionsSchema: () => PushOptionsSchema,
|
|
19
|
-
RunOptionsSchema: () => RunOptionsSchema,
|
|
20
19
|
SimulateInputSchema: () => SimulateInputSchema,
|
|
21
20
|
SimulateInputShape: () => SimulateInputShape,
|
|
22
21
|
SimulateOptionsSchema: () => SimulateOptionsSchema,
|
|
@@ -31,89 +30,81 @@ import { z } from "@walkeros/core/dev";
|
|
|
31
30
|
var PortSchema = z.number().int("Port must be an integer").min(1, "Port must be at least 1").max(65535, "Port must be at most 65535").describe("HTTP server port number");
|
|
32
31
|
var FilePathSchema = z.string().min(1, "File path cannot be empty").describe("Path to configuration file");
|
|
33
32
|
|
|
34
|
-
// src/schemas/run.ts
|
|
35
|
-
import { z as z2 } from "@walkeros/core/dev";
|
|
36
|
-
var RunOptionsSchema = z2.object({
|
|
37
|
-
flow: FilePathSchema,
|
|
38
|
-
port: PortSchema.default(8080),
|
|
39
|
-
flowName: z2.string().optional().describe("Specific flow name to run")
|
|
40
|
-
});
|
|
41
|
-
|
|
42
33
|
// src/schemas/validate.ts
|
|
43
|
-
import { z as
|
|
44
|
-
var ValidationTypeSchema =
|
|
45
|
-
var ValidateOptionsSchema =
|
|
46
|
-
flow:
|
|
47
|
-
path:
|
|
34
|
+
import { z as z2 } from "@walkeros/core/dev";
|
|
35
|
+
var ValidationTypeSchema = z2.enum(["contract", "event", "flow", "mapping"]).describe('Validation type: "event", "flow", "mapping", or "contract"');
|
|
36
|
+
var ValidateOptionsSchema = z2.object({
|
|
37
|
+
flow: z2.string().optional().describe("Flow name for multi-flow configs"),
|
|
38
|
+
path: z2.string().optional().describe(
|
|
48
39
|
'Entry path for package schema validation (e.g., "destinations.snowplow", "sources.browser")'
|
|
49
40
|
)
|
|
50
41
|
});
|
|
51
42
|
var ValidateInputShape = {
|
|
52
43
|
type: ValidationTypeSchema,
|
|
53
|
-
input:
|
|
54
|
-
flow:
|
|
55
|
-
path:
|
|
44
|
+
input: z2.string().min(1).describe("JSON string, file path, or URL to validate"),
|
|
45
|
+
flow: z2.string().optional().describe("Flow name for multi-flow configs"),
|
|
46
|
+
path: z2.string().optional().describe(
|
|
56
47
|
'Entry path for package schema validation (e.g., "destinations.snowplow"). When provided, validates the entry against its package JSON Schema instead of using --type.'
|
|
57
48
|
)
|
|
58
49
|
};
|
|
59
|
-
var ValidateInputSchema =
|
|
50
|
+
var ValidateInputSchema = z2.object(ValidateInputShape);
|
|
60
51
|
|
|
61
52
|
// src/schemas/bundle.ts
|
|
62
|
-
import { z as
|
|
63
|
-
var BundleOptionsSchema =
|
|
64
|
-
silent:
|
|
65
|
-
verbose:
|
|
66
|
-
stats:
|
|
67
|
-
cache:
|
|
68
|
-
flowName:
|
|
53
|
+
import { z as z3 } from "@walkeros/core/dev";
|
|
54
|
+
var BundleOptionsSchema = z3.object({
|
|
55
|
+
silent: z3.boolean().optional().describe("Suppress all output"),
|
|
56
|
+
verbose: z3.boolean().optional().describe("Enable verbose logging"),
|
|
57
|
+
stats: z3.boolean().optional().default(true).describe("Return bundle statistics"),
|
|
58
|
+
cache: z3.boolean().optional().default(true).describe("Enable package caching"),
|
|
59
|
+
flowName: z3.string().optional().describe("Flow name for multi-flow configs")
|
|
69
60
|
});
|
|
70
61
|
var BundleInputShape = {
|
|
71
62
|
configPath: FilePathSchema.describe(
|
|
72
63
|
"Path to flow configuration file (JSON or JavaScript), URL, or inline JSON string"
|
|
73
64
|
),
|
|
74
|
-
flow:
|
|
75
|
-
stats:
|
|
76
|
-
output:
|
|
65
|
+
flow: z3.string().optional().describe("Flow name for multi-flow configs"),
|
|
66
|
+
stats: z3.boolean().optional().default(true).describe("Return bundle statistics"),
|
|
67
|
+
output: z3.string().optional().describe("Output file path (defaults to config-defined)")
|
|
77
68
|
};
|
|
78
|
-
var BundleInputSchema =
|
|
69
|
+
var BundleInputSchema = z3.object(BundleInputShape);
|
|
79
70
|
|
|
80
71
|
// src/schemas/simulate.ts
|
|
81
|
-
import { z as
|
|
82
|
-
var PlatformSchema =
|
|
83
|
-
var SimulateOptionsSchema =
|
|
84
|
-
silent:
|
|
85
|
-
verbose:
|
|
86
|
-
json:
|
|
72
|
+
import { z as z4 } from "@walkeros/core/dev";
|
|
73
|
+
var PlatformSchema = z4.enum(["web", "server"]).describe("Platform type for event processing");
|
|
74
|
+
var SimulateOptionsSchema = z4.object({
|
|
75
|
+
silent: z4.boolean().optional().describe("Suppress all output"),
|
|
76
|
+
verbose: z4.boolean().optional().describe("Enable verbose logging"),
|
|
77
|
+
json: z4.boolean().optional().describe("Format output as JSON")
|
|
87
78
|
});
|
|
88
79
|
var SimulateInputShape = {
|
|
89
80
|
configPath: FilePathSchema.describe(
|
|
90
81
|
"Path to flow configuration file, URL, or inline JSON string"
|
|
91
82
|
),
|
|
92
|
-
event:
|
|
83
|
+
event: z4.string().min(1).optional().describe(
|
|
93
84
|
"Event as JSON string, file path, or URL. For sources: { content, trigger?, env? }."
|
|
94
85
|
),
|
|
95
|
-
flow:
|
|
86
|
+
flow: z4.string().optional().describe("Flow name for multi-flow configs"),
|
|
96
87
|
platform: PlatformSchema.optional().describe("Override platform detection"),
|
|
97
|
-
step:
|
|
88
|
+
step: z4.string().optional().describe(
|
|
98
89
|
'Step target in type.name format (e.g. "source.browser", "destination.gtag")'
|
|
99
90
|
)
|
|
100
91
|
};
|
|
101
|
-
var SimulateInputSchema =
|
|
92
|
+
var SimulateInputSchema = z4.object(SimulateInputShape);
|
|
102
93
|
|
|
103
94
|
// src/schemas/push.ts
|
|
104
|
-
import { z as
|
|
105
|
-
var PushOptionsSchema =
|
|
106
|
-
silent:
|
|
107
|
-
verbose:
|
|
108
|
-
json:
|
|
95
|
+
import { z as z5 } from "@walkeros/core/dev";
|
|
96
|
+
var PushOptionsSchema = z5.object({
|
|
97
|
+
silent: z5.boolean().optional().describe("Suppress all output"),
|
|
98
|
+
verbose: z5.boolean().optional().describe("Enable verbose logging"),
|
|
99
|
+
json: z5.boolean().optional().describe("Format output as JSON")
|
|
109
100
|
});
|
|
110
101
|
var PushInputShape = {
|
|
111
102
|
configPath: FilePathSchema.describe("Path to flow configuration file"),
|
|
112
|
-
event:
|
|
113
|
-
flow:
|
|
103
|
+
event: z5.string().min(1).describe("Event as JSON string, file path, or URL"),
|
|
104
|
+
flow: z5.string().optional().describe("Flow name for multi-flow configs"),
|
|
114
105
|
platform: PlatformSchema.optional().describe("Override platform detection")
|
|
115
106
|
};
|
|
116
|
-
var PushInputSchema =
|
|
107
|
+
var PushInputSchema = z5.object(PushInputShape);
|
|
117
108
|
export {
|
|
118
109
|
schemas_exports as schemas
|
|
119
110
|
};
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/primitives.ts","../src/schemas/run.ts","../src/schemas/validate.ts","../src/schemas/bundle.ts","../src/schemas/simulate.ts","../src/schemas/push.ts"],"sourcesContent":["/**\n * CLI Schemas\n *\n * Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nexport { PortSchema, FilePathSchema } from './primitives';\n\nexport { RunOptionsSchema, type RunOptions } from './run';\n\nexport {\n ValidationTypeSchema,\n ValidateOptionsSchema,\n ValidateInputShape,\n ValidateInputSchema,\n type ValidationType,\n type ValidateOptions,\n type ValidateInput,\n} from './validate';\n\nexport {\n BundleOptionsSchema,\n BundleInputShape,\n BundleInputSchema,\n type BundleOptions,\n type BundleInput,\n} from './bundle';\n\nexport {\n PlatformSchema,\n SimulateOptionsSchema,\n SimulateInputShape,\n SimulateInputSchema,\n type Platform,\n type SimulateOptions,\n type SimulateInput,\n} from './simulate';\n\nexport {\n PushOptionsSchema,\n PushInputShape,\n PushInputSchema,\n type PushOptions,\n type PushInput,\n} from './push';\n","/**\n * CLI Primitive Schemas\n *\n * Basic Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Port number schema.\n *\n * @remarks\n * Validates HTTP server port number.\n * Must be integer between 1-65535.\n */\nexport const PortSchema = z\n .number()\n .int('Port must be an integer')\n .min(1, 'Port must be at least 1')\n .max(65535, 'Port must be at most 65535')\n .describe('HTTP server port number');\n\n/**\n * File path schema.\n *\n * @remarks\n * Basic string validation for file paths.\n * File existence is checked separately (Zod can't check filesystem).\n */\nexport const FilePathSchema = z\n .string()\n .min(1, 'File path cannot be empty')\n .describe('Path to configuration file');\n","/**\n * Run Command Schemas\n *\n * Zod schemas for run command options validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { PortSchema, FilePathSchema } from './primitives';\n\n/**\n * Run command options schema.\n *\n * @remarks\n * Validates all options for the `walkeros run` command.\n */\nexport const RunOptionsSchema = z.object({\n flow: FilePathSchema,\n port: PortSchema.default(8080),\n flowName: z.string().optional().describe('Specific flow name to run'),\n});\n\nexport type RunOptions = z.infer<typeof RunOptionsSchema>;\n","/**\n * Validate Command Schemas\n *\n * Zod schemas for validate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Validation type schema.\n *\n * @remarks\n * Validates the type of validation to perform.\n * - `contract`: Validate a data contract\n * - `event`: Validate a walkerOS event object\n * - `flow`: Validate a flow configuration file\n * - `mapping`: Validate mapping rules\n */\nexport const ValidationTypeSchema = z\n .enum(['contract', 'event', 'flow', 'mapping'])\n .describe('Validation type: \"event\", \"flow\", \"mapping\", or \"contract\"');\n\nexport type ValidationType = z.infer<typeof ValidationTypeSchema>;\n\n/**\n * Validate options schema.\n *\n * @remarks\n * Options for the programmatic validate() API.\n */\nexport const ValidateOptionsSchema = z.object({\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\", \"sources.browser\")',\n ),\n});\n\nexport type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const ValidateInputShape = {\n type: ValidationTypeSchema,\n input: z\n .string()\n .min(1)\n .describe('JSON string, file path, or URL to validate'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\"). When provided, validates the entry against its package JSON Schema instead of using --type.',\n ),\n};\n\n/**\n * Validate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including type and input source.\n */\nexport const ValidateInputSchema = z.object(ValidateInputShape);\n\nexport type ValidateInput = z.infer<typeof ValidateInputSchema>;\n","/**\n * Bundle Command Schemas\n *\n * Zod schemas for bundle command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Bundle options schema.\n *\n * @remarks\n * Options for the programmatic bundle() API.\n */\nexport const BundleOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n cache: z\n .boolean()\n .optional()\n .default(true)\n .describe('Enable package caching'),\n flowName: z.string().optional().describe('Flow name for multi-flow configs'),\n});\n\nexport type BundleOptions = z.infer<typeof BundleOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const BundleInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file (JSON or JavaScript), URL, or inline JSON string',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n output: z\n .string()\n .optional()\n .describe('Output file path (defaults to config-defined)'),\n};\n\n/**\n * Bundle input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path and options.\n */\nexport const BundleInputSchema = z.object(BundleInputShape);\n\nexport type BundleInput = z.infer<typeof BundleInputSchema>;\n","/**\n * Simulate Command Schemas\n *\n * Zod schemas for simulate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Platform schema.\n *\n * @remarks\n * Validates platform type for event simulation.\n */\nexport const PlatformSchema = z\n .enum(['web', 'server'])\n .describe('Platform type for event processing');\n\nexport type Platform = z.infer<typeof PlatformSchema>;\n\n/**\n * Simulate options schema.\n *\n * @remarks\n * Options for the programmatic simulate() API.\n */\nexport const SimulateOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type SimulateOptions = z.infer<typeof SimulateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const SimulateInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file, URL, or inline JSON string',\n ),\n event: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Event as JSON string, file path, or URL. For sources: { content, trigger?, env? }.',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n step: z\n .string()\n .optional()\n .describe(\n 'Step target in type.name format (e.g. \"source.browser\", \"destination.gtag\")',\n ),\n};\n\n/**\n * Simulate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const SimulateInputSchema = z.object(SimulateInputShape);\n\nexport type SimulateInput = z.infer<typeof SimulateInputSchema>;\n","/**\n * Push Command Schemas\n *\n * Zod schemas for push command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\nimport { PlatformSchema } from './simulate';\n\n/**\n * Push options schema.\n *\n * @remarks\n * Options for the programmatic push() API.\n */\nexport const PushOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type PushOptions = z.infer<typeof PushOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const PushInputShape = {\n configPath: FilePathSchema.describe('Path to flow configuration file'),\n event: z.string().min(1).describe('Event as JSON string, file path, or URL'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n};\n\n/**\n * Push input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const PushInputSchema = z.object(PushInputShape);\n\nexport type PushInput = z.infer<typeof PushInputSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,SAAS,SAAS;AASX,IAAM,aAAa,EACvB,OAAO,EACP,IAAI,yBAAyB,EAC7B,IAAI,GAAG,yBAAyB,EAChC,IAAI,OAAO,4BAA4B,EACvC,SAAS,yBAAyB;AAS9B,IAAM,iBAAiB,EAC3B,OAAO,EACP,IAAI,GAAG,2BAA2B,EAClC,SAAS,4BAA4B;;;AC3BxC,SAAS,KAAAA,UAAS;AASX,IAAM,mBAAmBC,GAAE,OAAO;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,WAAW,QAAQ,IAAI;AAAA,EAC7B,UAAUA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B;AACtE,CAAC;;;ACbD,SAAS,KAAAC,UAAS;AAYX,IAAM,uBAAuBA,GACjC,KAAK,CAAC,YAAY,SAAS,QAAQ,SAAS,CAAC,EAC7C,SAAS,4DAA4D;AAUjE,IAAM,wBAAwBA,GAAE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BAAkBA,GAAE,OAAO,cAAc;","names":["z","z","z","z","z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/primitives.ts","../src/schemas/validate.ts","../src/schemas/bundle.ts","../src/schemas/simulate.ts","../src/schemas/push.ts"],"sourcesContent":["/**\n * CLI Schemas\n *\n * Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nexport { PortSchema, FilePathSchema } from './primitives';\n\nexport {\n ValidationTypeSchema,\n ValidateOptionsSchema,\n ValidateInputShape,\n ValidateInputSchema,\n type ValidationType,\n type ValidateOptions,\n type ValidateInput,\n} from './validate';\n\nexport {\n BundleOptionsSchema,\n BundleInputShape,\n BundleInputSchema,\n type BundleOptions,\n type BundleInput,\n} from './bundle';\n\nexport {\n PlatformSchema,\n SimulateOptionsSchema,\n SimulateInputShape,\n SimulateInputSchema,\n type Platform,\n type SimulateOptions,\n type SimulateInput,\n} from './simulate';\n\nexport {\n PushOptionsSchema,\n PushInputShape,\n PushInputSchema,\n type PushOptions,\n type PushInput,\n} from './push';\n","/**\n * CLI Primitive Schemas\n *\n * Basic Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Port number schema.\n *\n * @remarks\n * Validates HTTP server port number.\n * Must be integer between 1-65535.\n */\nexport const PortSchema = z\n .number()\n .int('Port must be an integer')\n .min(1, 'Port must be at least 1')\n .max(65535, 'Port must be at most 65535')\n .describe('HTTP server port number');\n\n/**\n * File path schema.\n *\n * @remarks\n * Basic string validation for file paths.\n * File existence is checked separately (Zod can't check filesystem).\n */\nexport const FilePathSchema = z\n .string()\n .min(1, 'File path cannot be empty')\n .describe('Path to configuration file');\n","/**\n * Validate Command Schemas\n *\n * Zod schemas for validate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Validation type schema.\n *\n * @remarks\n * Validates the type of validation to perform.\n * - `contract`: Validate a data contract\n * - `event`: Validate a walkerOS event object\n * - `flow`: Validate a flow configuration file\n * - `mapping`: Validate mapping rules\n */\nexport const ValidationTypeSchema = z\n .enum(['contract', 'event', 'flow', 'mapping'])\n .describe('Validation type: \"event\", \"flow\", \"mapping\", or \"contract\"');\n\nexport type ValidationType = z.infer<typeof ValidationTypeSchema>;\n\n/**\n * Validate options schema.\n *\n * @remarks\n * Options for the programmatic validate() API.\n */\nexport const ValidateOptionsSchema = z.object({\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\", \"sources.browser\")',\n ),\n});\n\nexport type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const ValidateInputShape = {\n type: ValidationTypeSchema,\n input: z\n .string()\n .min(1)\n .describe('JSON string, file path, or URL to validate'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\"). When provided, validates the entry against its package JSON Schema instead of using --type.',\n ),\n};\n\n/**\n * Validate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including type and input source.\n */\nexport const ValidateInputSchema = z.object(ValidateInputShape);\n\nexport type ValidateInput = z.infer<typeof ValidateInputSchema>;\n","/**\n * Bundle Command Schemas\n *\n * Zod schemas for bundle command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Bundle options schema.\n *\n * @remarks\n * Options for the programmatic bundle() API.\n */\nexport const BundleOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n cache: z\n .boolean()\n .optional()\n .default(true)\n .describe('Enable package caching'),\n flowName: z.string().optional().describe('Flow name for multi-flow configs'),\n});\n\nexport type BundleOptions = z.infer<typeof BundleOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const BundleInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file (JSON or JavaScript), URL, or inline JSON string',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n output: z\n .string()\n .optional()\n .describe('Output file path (defaults to config-defined)'),\n};\n\n/**\n * Bundle input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path and options.\n */\nexport const BundleInputSchema = z.object(BundleInputShape);\n\nexport type BundleInput = z.infer<typeof BundleInputSchema>;\n","/**\n * Simulate Command Schemas\n *\n * Zod schemas for simulate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Platform schema.\n *\n * @remarks\n * Validates platform type for event simulation.\n */\nexport const PlatformSchema = z\n .enum(['web', 'server'])\n .describe('Platform type for event processing');\n\nexport type Platform = z.infer<typeof PlatformSchema>;\n\n/**\n * Simulate options schema.\n *\n * @remarks\n * Options for the programmatic simulate() API.\n */\nexport const SimulateOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type SimulateOptions = z.infer<typeof SimulateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const SimulateInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file, URL, or inline JSON string',\n ),\n event: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Event as JSON string, file path, or URL. For sources: { content, trigger?, env? }.',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n step: z\n .string()\n .optional()\n .describe(\n 'Step target in type.name format (e.g. \"source.browser\", \"destination.gtag\")',\n ),\n};\n\n/**\n * Simulate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const SimulateInputSchema = z.object(SimulateInputShape);\n\nexport type SimulateInput = z.infer<typeof SimulateInputSchema>;\n","/**\n * Push Command Schemas\n *\n * Zod schemas for push command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\nimport { PlatformSchema } from './simulate';\n\n/**\n * Push options schema.\n *\n * @remarks\n * Options for the programmatic push() API.\n */\nexport const PushOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type PushOptions = z.infer<typeof PushOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const PushInputShape = {\n configPath: FilePathSchema.describe('Path to flow configuration file'),\n event: z.string().min(1).describe('Event as JSON string, file path, or URL'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n};\n\n/**\n * Push input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const PushInputSchema = z.object(PushInputShape);\n\nexport type PushInput = z.infer<typeof PushInputSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AS,EAAE,SAAS,qBAAqB;AAAA,EAC7D,SAASA,GAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,wBAAwB;AAAA,EACjE,MAAMA,GAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAC/D,CAAC;AAWM,IAAM,iBAAiB;AAAA,EAC5B,YAAY,eAAe,SAAS,iCAAiC;AAAA,EACrE,OAAOA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,yCAAyC;AAAA,EAC3E,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,UAAU,eAAe,SAAS,EAAE,SAAS,6BAA6B;AAC5E;AAQO,IAAM,kBAAkBA,GAAE,OAAO,cAAc;","names":["z","z","z","z","z","z","z"]}
|
package/dist/examples/README.md
CHANGED
|
@@ -354,6 +354,7 @@ Flow configs use the `Flow.Config` format:
|
|
|
354
354
|
- `@walkeros/server-destination-meta` → `destinationMeta` (Meta CAPI)
|
|
355
355
|
- `@walkeros/server-destination-aws` → `destinationAWS`
|
|
356
356
|
- `@walkeros/server-destination-gcp` → `destinationGCP`
|
|
357
|
+
- `@walkeros/server-destination-piwikpro` → `destinationPiwikPro`
|
|
357
358
|
|
|
358
359
|
**Universal**:
|
|
359
360
|
|
|
@@ -376,8 +376,7 @@
|
|
|
376
376
|
"map": {
|
|
377
377
|
"transaction_id": "data.id",
|
|
378
378
|
"value": {
|
|
379
|
-
"
|
|
380
|
-
"fn": "$code:(v) => Math.round(v * 100)"
|
|
379
|
+
"fn": "$code:(event) => Math.round(event.data.total * 100)"
|
|
381
380
|
},
|
|
382
381
|
"currency": {
|
|
383
382
|
"key": "data.currency",
|
|
@@ -624,8 +623,7 @@
|
|
|
624
623
|
"language": { "key": "headers.accept-language" },
|
|
625
624
|
"referer": { "key": "headers.referer" },
|
|
626
625
|
"anonymizedIp": {
|
|
627
|
-
"
|
|
628
|
-
"fn": "$code:(ip) => ip ? ip.replace(/\\.\\d+$/, '.0') : ''"
|
|
626
|
+
"fn": "$code:(req) => req.ip ? req.ip.replace(/\\.\\d+$/, '.0') : ''"
|
|
629
627
|
}
|
|
630
628
|
}
|
|
631
629
|
}
|
package/dist/examples/index.js
CHANGED
|
@@ -399,8 +399,7 @@ var flow_complete_default = {
|
|
|
399
399
|
map: {
|
|
400
400
|
transaction_id: "data.id",
|
|
401
401
|
value: {
|
|
402
|
-
|
|
403
|
-
fn: "$code:(v) => Math.round(v * 100)"
|
|
402
|
+
fn: "$code:(event) => Math.round(event.data.total * 100)"
|
|
404
403
|
},
|
|
405
404
|
currency: {
|
|
406
405
|
key: "data.currency",
|
|
@@ -647,8 +646,7 @@ var flow_complete_default = {
|
|
|
647
646
|
language: { key: "headers.accept-language" },
|
|
648
647
|
referer: { key: "headers.referer" },
|
|
649
648
|
anonymizedIp: {
|
|
650
|
-
|
|
651
|
-
fn: "$code:(ip) => ip ? ip.replace(/\\.\\d+$/, '.0') : ''"
|
|
649
|
+
fn: "$code:(req) => req.ip ? req.ip.replace(/\\.\\d+$/, '.0') : ''"
|
|
652
650
|
}
|
|
653
651
|
}
|
|
654
652
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/validators.ts","../../examples/flow-complete.json","../../examples/flow-simple.json","../../src/examples/index.ts"],"sourcesContent":["/**\n * Configuration Type Guards and Validators\n *\n * Type checking utilities for configuration validation.\n * Uses Zod schemas from @walkeros/core for Flow.Json validation.\n */\n\nimport type { Flow } from '@walkeros/core';\nimport { isObject } from '@walkeros/core';\nimport { schemas } from '@walkeros/core/dev';\n\nconst { safeParseConfig } = schemas;\n\n/**\n * Detect platform from a single flow.\n *\n * Platform is determined by `flow.config.platform`.\n */\nexport function detectPlatform(\n flow: Record<string, unknown>,\n): 'web' | 'server' | undefined {\n const config = flow.config;\n if (!isObject(config)) return undefined;\n const platform = config.platform;\n if (platform === 'web' || platform === 'server') return platform;\n return undefined;\n}\n\n/**\n * Type guard: Check if config is a valid Flow.Json structure.\n *\n * @remarks\n * Uses Zod validation from @walkeros/core.\n * Returns false instead of throwing on invalid input.\n *\n * @example\n * ```typescript\n * if (isFlowConfig(config)) {\n * const flowSettings = getFlowSettings(config, 'production');\n * }\n * ```\n */\nexport function isFlowConfig(data: unknown): data is Flow.Json {\n const result = safeParseConfig(data);\n return result.success;\n}\n\n/**\n * Validate Flow.Json and throw descriptive error if invalid.\n *\n * @remarks\n * Uses Zod validation from @walkeros/core.\n * Provides detailed error messages from Zod.\n *\n * @param data - Raw configuration data\n * @returns Validated Flow.Json\n * @throws Error with descriptive message if validation fails\n */\nexport function validateFlowConfig(data: unknown): Flow.Json {\n // After successful Zod parse, the data conforms structurally to Flow.Json.\n // The existing `isFlowConfig` guard re-narrows `unknown` to `Flow.Json` via\n // the same schema — TS can't see through `safeParseConfig` because it\n // returns a Zod-inferred type that differs nominally (not structurally)\n // from the Flow.Json interface.\n if (isFlowConfig(data)) return data;\n\n // Not parseable — format Zod errors for CLI display.\n const result = safeParseConfig(data);\n if (result.success) {\n // Defensive: isFlowConfig and safeParseConfig disagreed (cannot happen).\n throw new Error('Invalid configuration: failed Flow.Json type guard.');\n }\n const errors = result.error.issues\n .map((issue) => {\n const path =\n issue.path.length > 0 ? issue.path.map(String).join('.') : 'root';\n return ` - ${path}: ${issue.message}`;\n })\n .join('\\n');\n throw new Error(`Invalid configuration:\\n${errors}`);\n}\n\n/**\n * Get available flow names from a Flow.Json.\n *\n * @param config - Flow.Json configuration\n * @returns Array of flow names\n */\nexport function getAvailableFlows(config: Flow.Json): string[] {\n return Object.keys(config.flows);\n}\n","{\n \"$schema\": \"https://walkeros.io/schema/flow/v4.json\",\n \"version\": 4,\n \"variables\": {\n \"currency\": \"EUR\",\n \"flowVersion\": \"1.0.0\",\n \"ga4MeasurementId\": \"$env.GA4_MEASUREMENT_ID:G-DEMO123456\",\n \"apiUrl\": \"$env.API_URL:http://localhost:8080/collect\",\n \"ga4ItemsLoop\": {\n \"loop\": [\n \"nested\",\n {\n \"condition\": \"$code:(value, context) => value.entity === 'product'\",\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"price\": \"data.price\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n },\n \"metaContentsLoop\": {\n \"loop\": [\n \"nested\",\n {\n \"map\": {\n \"id\": \"data.id\",\n \"item_price\": \"data.price\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n },\n \"contract\": {\n \"default\": {\n \"description\": \"Web shop tracking contract\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"globals\": {\n \"type\": \"object\",\n \"properties\": {\n \"environment\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\"\n }\n }\n },\n \"consent\": {\n \"type\": \"object\",\n \"required\": [\"functional\"],\n \"properties\": {\n \"functional\": {\n \"type\": \"boolean\",\n \"const\": true\n }\n }\n }\n }\n },\n \"events\": {\n \"product\": {\n \"*\": {\n \"description\": \"A product in the catalog\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"name\"],\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"Product SKU\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"Display name\"\n }\n }\n }\n }\n },\n \"add\": {\n \"description\": \"Product added to cart\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"quantity\"],\n \"properties\": {\n \"quantity\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"description\": \"Purchase completed\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"total\"],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"total\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"flows\": {\n \"web\": {\n \"sources\": {\n \"browser\": {\n \"package\": \"@walkeros/web-source-browser\",\n \"primary\": true,\n \"config\": {\n \"settings\": {\n \"prefix\": \"data-elb\",\n \"pageview\": true,\n \"session\": {\n \"consent\": {\n \"marketing\": true\n }\n },\n \"elb\": \"elb\",\n \"elbLayer\": true\n }\n }\n },\n \"dataLayer\": {\n \"package\": \"@walkeros/web-source-datalayer\",\n \"next\": \"enricher\",\n \"config\": {\n \"require\": [\"session\"],\n \"settings\": {\n \"name\": \"dataLayer\",\n \"prefix\": \"gtag\"\n },\n \"mapping\": {\n \"gtag\": {\n \"add_to_cart\": {\n \"name\": \"product add\",\n \"data\": {\n \"map\": {\n \"id\": \"items.0.item_id\",\n \"name\": \"items.0.item_name\",\n \"price\": \"items.0.price\",\n \"currency\": \"currency\",\n \"quantity\": {\n \"key\": \"items.0.quantity\",\n \"value\": 1\n }\n }\n }\n },\n \"purchase\": {\n \"name\": \"order complete\",\n \"data\": {\n \"map\": {\n \"id\": \"transaction_id\",\n \"total\": \"value\",\n \"currency\": \"currency\",\n \"tax\": \"tax\",\n \"shipping\": \"shipping\"\n }\n }\n }\n }\n }\n }\n },\n \"demo\": {\n \"package\": \"@walkeros/source-demo\",\n \"config\": {\n \"settings\": {\n \"events\": [\n {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"path\": \"/\"\n },\n \"delay\": 0\n },\n {\n \"name\": \"product view\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"category\": \"Clothing\"\n },\n \"delay\": 300\n },\n {\n \"name\": \"product add\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"quantity\": 2\n },\n \"delay\": 600\n },\n {\n \"name\": \"test debug\",\n \"data\": {\n \"message\": \"This should be ignored\"\n },\n \"delay\": 800\n },\n {\n \"name\": \"order complete\",\n \"data\": {\n \"id\": \"ORD-123\",\n \"total\": 149.97,\n \"currency\": \"EUR\",\n \"tax\": 12.5,\n \"shipping\": 5.99\n },\n \"user\": {\n \"email\": \"customer@example.com\",\n \"id\": \"U-456\",\n \"device\": \"d3v1c3\",\n \"session\": \"s3ss10n\"\n },\n \"nested\": [\n {\n \"entity\": \"product\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"quantity\": 2\n }\n },\n {\n \"entity\": \"product\",\n \"data\": {\n \"id\": \"SKU-002\",\n \"name\": \"Red Cap\",\n \"price\": 24.99,\n \"quantity\": 1\n }\n }\n ],\n \"delay\": 1000\n }\n ]\n }\n }\n }\n },\n \"transformers\": {\n \"enricher\": {\n \"code\": {\n \"type\": \"enricher\",\n \"push\": \"$code:(event) => ({ ...event, context: { ...event.context, enrichedAt: Date.now() } })\"\n },\n \"config\": {}\n }\n },\n \"destinations\": {\n \"ga4\": {\n \"package\": \"@walkeros/web-destination-gtag\",\n \"config\": {\n \"require\": [\"consent\", \"user\"],\n \"consent\": {\n \"marketing\": true\n },\n \"settings\": {\n \"ga4\": {\n \"measurementId\": \"$var.ga4MeasurementId\"\n }\n },\n \"mapping\": {\n \"page\": {\n \"view\": {\n \"name\": \"page_view\",\n \"data\": {\n \"map\": {\n \"page_title\": \"data.title\",\n \"page_location\": \"data.path\"\n }\n }\n }\n },\n \"product\": {\n \"view\": {\n \"name\": \"view_item\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": [\n {\n \"key\": \"data.sku\"\n },\n {\n \"key\": \"data.id\"\n }\n ],\n \"item_name\": \"data.name\",\n \"item_category\": \"data.category\",\n \"price\": \"data.price\"\n }\n }\n ]\n }\n }\n }\n },\n \"add\": {\n \"name\": \"add_to_cart\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"name\": \"purchase\",\n \"data\": {\n \"map\": {\n \"transaction_id\": \"data.id\",\n \"value\": {\n \"key\": \"data.total\",\n \"fn\": \"$code:(v) => Math.round(v * 100)\"\n },\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"tax\": \"data.tax\",\n \"shipping\": \"data.shipping\",\n \"items\": \"$var.ga4ItemsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n }\n }\n },\n \"examples\": {\n \"page-view\": {\n \"in\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"path\": \"/\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n },\n \"mapping\": {\n \"name\": \"page_view\",\n \"data\": {\n \"map\": {\n \"page_title\": \"data.title\",\n \"page_location\": \"data.path\"\n }\n }\n },\n \"out\": [\n \"event\",\n \"page_view\",\n {\n \"page_title\": \"Home\",\n \"page_location\": \"/\"\n }\n ]\n },\n \"product-add\": {\n \"in\": {\n \"name\": \"product add\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"quantity\": 2\n },\n \"entity\": \"product\",\n \"action\": \"add\"\n },\n \"mapping\": {\n \"name\": \"add_to_cart\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"EUR\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n },\n \"out\": [\n \"event\",\n \"add_to_cart\",\n {\n \"currency\": \"EUR\",\n \"value\": 49.99,\n \"items\": [\n {\n \"item_id\": \"SKU-001\",\n \"item_name\": \"Blue Shirt\",\n \"quantity\": 2\n }\n ]\n }\n ]\n },\n \"test-ignored\": {\n \"in\": {\n \"name\": \"test debug\",\n \"data\": {\n \"message\": \"This should be ignored\"\n },\n \"entity\": \"test\",\n \"action\": \"debug\"\n },\n \"out\": false\n }\n }\n },\n \"api\": {\n \"package\": \"@walkeros/web-destination-api\",\n \"config\": {\n \"settings\": {\n \"url\": \"$var.apiUrl\",\n \"batch\": 5,\n \"transform\": \"$code:(data) => JSON.stringify(data)\"\n },\n \"data\": {\n \"map\": {\n \"sent_at\": {\n \"fn\": \"$code:() => Date.now()\"\n },\n \"flow_version\": \"$var.flowVersion\"\n }\n },\n \"mapping\": {\n \"order\": {\n \"complete\": {\n \"data\": {\n \"map\": {\n \"transaction_id\": \"data.id\",\n \"value\": \"data.total\",\n \"currency\": \"data.currency\",\n \"user_email\": {\n \"key\": \"user.email\",\n \"consent\": {\n \"marketing\": true\n }\n },\n \"items\": \"$var.ga4ItemsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n }\n }\n }\n },\n \"debug\": {\n \"code\": {\n \"type\": \"debug-logger\",\n \"push\": \"$code:(event, ctx) => { ctx.logger.info('[DEBUG]', event.name, event.data); }\"\n },\n \"config\": {\n \"consent\": {}\n }\n }\n },\n \"collector\": {\n \"consent\": {\n \"functional\": true,\n \"marketing\": false\n },\n \"user\": {\n \"id\": \"anonymous\"\n },\n \"globals\": {\n \"environment\": \"demo\",\n \"version\": \"$var.flowVersion\"\n },\n \"custom\": {\n \"campaign\": \"flow-demo\"\n }\n },\n \"config\": {\n \"platform\": \"web\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/collector\": {},\n \"@walkeros/web-source-browser\": {},\n \"@walkeros/web-source-datalayer\": {},\n \"@walkeros/source-demo\": {},\n \"@walkeros/web-destination-gtag\": {},\n \"@walkeros/web-destination-api\": {}\n }\n }\n }\n },\n \"server\": {\n \"variables\": {\n \"metaPixelId\": \"$env.META_PIXEL_ID:123456789012345\",\n \"metaAccessToken\": \"$env.META_ACCESS_TOKEN:demo_token\"\n },\n \"sources\": {\n \"http\": {\n \"package\": \"@walkeros/server-source-express\",\n \"primary\": true,\n \"next\": [\"filter\"],\n \"cache\": {\n \"rules\": [\n {\n \"match\": {\n \"key\": \"ingest.method\",\n \"operator\": \"eq\",\n \"value\": \"GET\"\n },\n \"key\": [\"ingest.method\", \"ingest.path\"],\n \"ttl\": 300,\n \"update\": {\n \"headers.X-Cache\": {\n \"key\": \"cache.status\"\n }\n }\n }\n ]\n },\n \"config\": {\n \"settings\": {\n \"path\": \"/collect\",\n \"port\": 8080,\n \"cors\": true,\n \"healthCheck\": true\n },\n \"ingest\": {\n \"map\": {\n \"method\": { \"key\": \"method\" },\n \"path\": { \"key\": \"path\" },\n \"context\": {\n \"map\": {\n \"ip\": { \"key\": \"ip\" },\n \"userAgent\": { \"key\": \"headers.user-agent\" },\n \"language\": { \"key\": \"headers.accept-language\" },\n \"referer\": { \"key\": \"headers.referer\" },\n \"anonymizedIp\": {\n \"key\": \"ip\",\n \"fn\": \"$code:(ip) => ip ? ip.replace(/\\\\.\\\\d+$/, '.0') : ''\"\n }\n }\n }\n }\n }\n },\n \"examples\": {\n \"post-event\": {\n \"in\": {\n \"method\": \"POST\",\n \"path\": \"/collect\",\n \"headers\": {\n \"content-type\": \"application/json\"\n },\n \"body\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"url\": \"https://example.com\"\n }\n }\n },\n \"out\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"url\": \"https://example.com\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n }\n }\n }\n }\n },\n \"transformers\": {\n \"filter\": {\n \"code\": {\n \"type\": \"filter\",\n \"push\": \"$code:(event) => event.name.startsWith('internal_') || event.name.startsWith('debug_') ? false : event\"\n },\n \"next\": \"fingerprint\",\n \"config\": {},\n \"examples\": {\n \"passes-normal\": {\n \"in\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n },\n \"out\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n }\n },\n \"filters-internal\": {\n \"in\": {\n \"name\": \"internal_heartbeat\",\n \"data\": {},\n \"entity\": \"internal\",\n \"action\": \"heartbeat\"\n },\n \"out\": false\n }\n }\n },\n \"fingerprint\": {\n \"package\": \"@walkeros/server-transformer-fingerprint\",\n \"config\": {\n \"settings\": {\n \"fields\": [\n \"context.ip\",\n \"context.userAgent\",\n \"context.language\",\n {\n \"fn\": \"$code:() => new Date().toISOString().slice(0, 10)\"\n }\n ],\n \"output\": \"user.hash\",\n \"length\": 16\n }\n }\n }\n },\n \"destinations\": {\n \"meta\": {\n \"package\": \"@walkeros/server-destination-meta\",\n \"before\": \"fingerprint\",\n \"config\": {\n \"settings\": {\n \"pixelId\": \"$var.metaPixelId\",\n \"accessToken\": \"$var.metaAccessToken\",\n \"user_data\": {\n \"external_id\": {\n \"set\": [\"user.device\", \"user.session\"]\n }\n }\n },\n \"policy\": {\n \"user_data.em\": {\n \"key\": \"user.email\",\n \"consent\": {\n \"marketing\": true\n }\n },\n \"user_data.external_id\": \"user.id\",\n \"custom_data.server_processed\": {\n \"value\": true\n },\n \"custom_data.request_meta\": {\n \"map\": {\n \"ip\": \"context.ip\",\n \"ua\": \"context.userAgent\"\n }\n }\n },\n \"mapping\": {\n \"page\": {\n \"view\": {\n \"name\": \"PageView\",\n \"data\": \"data\"\n }\n },\n \"product\": {\n \"view\": {\n \"name\": \"ViewContent\",\n \"data\": {\n \"map\": {\n \"value\": \"data.price\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"content_type\": {\n \"value\": \"product\"\n },\n \"content_ids\": {\n \"set\": [\"data.id\"]\n }\n }\n }\n },\n \"add\": {\n \"name\": \"AddToCart\",\n \"data\": {\n \"map\": {\n \"value\": \"data.price\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"content_type\": {\n \"value\": \"product\"\n },\n \"contents\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"id\": \"data.id\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"name\": \"Purchase\",\n \"data\": {\n \"map\": {\n \"value\": \"data.total\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"order_id\": \"data.id\",\n \"contents\": \"$var.metaContentsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n },\n \"*\": {\n \"click\": {\n \"name\": \"CustomEvent\",\n \"data\": \"data\"\n }\n }\n }\n },\n \"examples\": {\n \"purchase\": {\n \"in\": {\n \"name\": \"order complete\",\n \"data\": {\n \"id\": \"ORD-123\",\n \"total\": 149.97,\n \"currency\": \"EUR\"\n },\n \"entity\": \"order\",\n \"action\": \"complete\"\n },\n \"mapping\": {\n \"name\": \"Purchase\",\n \"data\": {\n \"map\": {\n \"value\": \"data.total\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"EUR\"\n },\n \"order_id\": \"data.id\"\n }\n }\n },\n \"out\": {\n \"data\": [\n {\n \"event_name\": \"Purchase\",\n \"custom_data\": {\n \"value\": 149.97,\n \"currency\": \"EUR\",\n \"order_id\": \"ORD-123\"\n }\n }\n ]\n }\n }\n }\n },\n \"demo\": {\n \"package\": \"@walkeros/destination-demo\",\n \"config\": {\n \"settings\": {\n \"name\": \"Server Events\",\n \"values\": [\"name\", \"data\", \"nested\", \"user\", \"consent\", \"context\"]\n }\n }\n }\n },\n \"collector\": {\n \"consent\": {\n \"functional\": true\n },\n \"globals\": {\n \"environment\": \"demo\",\n \"version\": \"$var.flowVersion\",\n \"platform\": \"server\",\n \"startedAt\": \"$code:Date.now()\"\n }\n },\n \"config\": {\n \"platform\": \"server\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/core\": {\n \"path\": \"../../core\"\n },\n \"@walkeros/collector\": {\n \"path\": \"../../collector\"\n },\n \"@walkeros/server-source-express\": {},\n \"@walkeros/server-destination-meta\": {},\n \"@walkeros/destination-demo\": {},\n \"@walkeros/server-transformer-fingerprint\": {}\n }\n }\n }\n }\n }\n}\n","{\n \"version\": 4,\n \"flows\": {\n \"default\": {\n \"destinations\": {\n \"demo\": {\n \"package\": \"@walkeros/destination-demo\",\n \"config\": {\n \"settings\": {\n \"name\": \"Simple Demo\",\n \"values\": [\"name\", \"data\", \"user\", \"consent\"]\n }\n }\n }\n },\n \"config\": {\n \"platform\": \"web\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/collector\": {\n \"version\": \"latest\",\n \"imports\": [\"startFlow\"]\n },\n \"@walkeros/destination-demo\": {\n \"version\": \"latest\"\n }\n }\n }\n }\n }\n }\n}\n","/**\n * Typed re-exports of bundled example flow configurations.\n *\n * Importing JSON files via `resolveJsonModule` produces a deeply structural\n * type whose literals are widened (`version: number` instead of `4`,\n * `platform: string` instead of `'web' | 'server'`). That widened shape is\n * not assignable to `Flow.Json` and forces every consumer to cast away to\n * `Record<string, unknown>`, losing all type information about the example.\n *\n * Routing the imports through `validateFlowConfig` (a real type guard backed\n * by the canonical Zod schema in `@walkeros/core`) launders the JSON into a\n * proper `Flow.Json` value with no `as` cast at any call site:\n *\n * - The Zod parser checks the structure at module load time. If an example\n * drifts away from the schema, the package fails to load loudly instead\n * of producing a silently broken value.\n * - The return type is `Flow.Json` (the canonical interface), not the Zod\n * inferred shape, because `validateFlowConfig` uses `isFlowConfig` as a\n * `data is Flow.Json` type predicate.\n *\n * Pattern choice (`: Flow.Json` annotation via runtime validator) was picked\n * over `satisfies Flow.Json` and `as const satisfies Flow.Json` because:\n *\n * - `: Flow.Json` annotation alone fails: the JSON's widened literals do\n * not satisfy the literal constraints (`version: 4`, platform unions).\n * - `satisfies Flow.Json` fails for the same reason.\n * - `as const satisfies Flow.Json` cannot be applied to a JSON import\n * (TypeScript does not support `as const` on imported values).\n * - A wrapper-function or runtime-validator approach is the only pattern\n * that produces a `Flow.Json`-typed value without an `as` cast anywhere\n * in the chain. It also gives consumers a load-time correctness check\n * for free.\n *\n * Cost: one Zod parse per example at module init. Examples are loaded by\n * tests, MCP servers, and dev seed scripts. None are perf-critical.\n */\n\nimport { validateFlowConfig } from '../config/validators.js';\n\nimport flowCompleteImport from '../../examples/flow-complete.json';\nimport flowSimpleImport from '../../examples/flow-simple.json';\n\nexport const flowComplete = validateFlowConfig(flowCompleteImport);\nexport const flowSimple = validateFlowConfig(flowSimpleImport);\n"],"mappings":";AAQA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAExB,IAAM,EAAE,gBAAgB,IAAI;AA+BrB,SAAS,aAAa,MAAkC;AAC7D,QAAM,SAAS,gBAAgB,IAAI;AACnC,SAAO,OAAO;AAChB;AAaO,SAAS,mBAAmB,MAA0B;AAM3D,MAAI,aAAa,IAAI,EAAG,QAAO;AAG/B,QAAM,SAAS,gBAAgB,IAAI;AACnC,MAAI,OAAO,SAAS;AAElB,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,QAAM,SAAS,OAAO,MAAM,OACzB,IAAI,CAAC,UAAU;AACd,UAAM,OACJ,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,MAAM,EAAE,KAAK,GAAG,IAAI;AAC7D,WAAO,OAAO,IAAI,KAAK,MAAM,OAAO;AAAA,EACtC,CAAC,EACA,KAAK,IAAI;AACZ,QAAM,IAAI,MAAM;AAAA,EAA2B,MAAM,EAAE;AACrD;;;AChFA;AAAA,EACE,SAAW;AAAA,EACX,SAAW;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AAC;AAAA,UAC/C;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACp5BA;AAAA,EACE,SAAW;AAAA,EACX,OAAS;AAAA,IACP,SAAW;AAAA,MACT,cAAgB;AAAA,QACd,MAAQ;AAAA,UACN,SAAW;AAAA,UACX,QAAU;AAAA,YACR,UAAY;AAAA,cACV,MAAQ;AAAA,cACR,QAAU,CAAC,QAAQ,QAAQ,QAAQ,SAAS;AAAA,YAC9C;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA,QAAU;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACR,UAAY;AAAA,YACV,uBAAuB;AAAA,cACrB,SAAW;AAAA,cACX,SAAW,CAAC,WAAW;AAAA,YACzB;AAAA,YACA,8BAA8B;AAAA,cAC5B,SAAW;AAAA,YACb;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACWO,IAAM,eAAe,mBAAmB,qBAAkB;AAC1D,IAAM,aAAa,mBAAmB,mBAAgB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/validators.ts","../../examples/flow-complete.json","../../examples/flow-simple.json","../../src/examples/index.ts"],"sourcesContent":["/**\n * Configuration Type Guards and Validators\n *\n * Type checking utilities for configuration validation.\n * Uses Zod schemas from @walkeros/core for Flow.Json validation.\n */\n\nimport type { Flow } from '@walkeros/core';\nimport { isObject } from '@walkeros/core';\nimport { schemas } from '@walkeros/core/dev';\n\nconst { safeParseConfig } = schemas;\n\n/**\n * Detect platform from a single flow.\n *\n * Platform is determined by `flow.config.platform`.\n */\nexport function detectPlatform(\n flow: Record<string, unknown>,\n): 'web' | 'server' | undefined {\n const config = flow.config;\n if (!isObject(config)) return undefined;\n const platform = config.platform;\n if (platform === 'web' || platform === 'server') return platform;\n return undefined;\n}\n\n/**\n * Type guard: Check if config is a valid Flow.Json structure.\n *\n * @remarks\n * Uses Zod validation from @walkeros/core.\n * Returns false instead of throwing on invalid input.\n *\n * @example\n * ```typescript\n * if (isFlowConfig(config)) {\n * const flowSettings = getFlowSettings(config, 'production');\n * }\n * ```\n */\nexport function isFlowConfig(data: unknown): data is Flow.Json {\n const result = safeParseConfig(data);\n return result.success;\n}\n\n/**\n * Validate Flow.Json and throw descriptive error if invalid.\n *\n * @remarks\n * Uses Zod validation from @walkeros/core.\n * Provides detailed error messages from Zod.\n *\n * @param data - Raw configuration data\n * @returns Validated Flow.Json\n * @throws Error with descriptive message if validation fails\n */\nexport function validateFlowConfig(data: unknown): Flow.Json {\n // After successful Zod parse, the data conforms structurally to Flow.Json.\n // The existing `isFlowConfig` guard re-narrows `unknown` to `Flow.Json` via\n // the same schema — TS can't see through `safeParseConfig` because it\n // returns a Zod-inferred type that differs nominally (not structurally)\n // from the Flow.Json interface.\n if (isFlowConfig(data)) return data;\n\n // Not parseable — format Zod errors for CLI display.\n const result = safeParseConfig(data);\n if (result.success) {\n // Defensive: isFlowConfig and safeParseConfig disagreed (cannot happen).\n throw new Error('Invalid configuration: failed Flow.Json type guard.');\n }\n const errors = result.error.issues\n .map((issue) => {\n const path =\n issue.path.length > 0 ? issue.path.map(String).join('.') : 'root';\n return ` - ${path}: ${issue.message}`;\n })\n .join('\\n');\n throw new Error(`Invalid configuration:\\n${errors}`);\n}\n\n/**\n * Get available flow names from a Flow.Json.\n *\n * @param config - Flow.Json configuration\n * @returns Array of flow names\n */\nexport function getAvailableFlows(config: Flow.Json): string[] {\n return Object.keys(config.flows);\n}\n","{\n \"$schema\": \"https://walkeros.io/schema/flow/v4.json\",\n \"version\": 4,\n \"variables\": {\n \"currency\": \"EUR\",\n \"flowVersion\": \"1.0.0\",\n \"ga4MeasurementId\": \"$env.GA4_MEASUREMENT_ID:G-DEMO123456\",\n \"apiUrl\": \"$env.API_URL:http://localhost:8080/collect\",\n \"ga4ItemsLoop\": {\n \"loop\": [\n \"nested\",\n {\n \"condition\": \"$code:(value, context) => value.entity === 'product'\",\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"price\": \"data.price\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n },\n \"metaContentsLoop\": {\n \"loop\": [\n \"nested\",\n {\n \"map\": {\n \"id\": \"data.id\",\n \"item_price\": \"data.price\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n },\n \"contract\": {\n \"default\": {\n \"description\": \"Web shop tracking contract\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"globals\": {\n \"type\": \"object\",\n \"properties\": {\n \"environment\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\"\n }\n }\n },\n \"consent\": {\n \"type\": \"object\",\n \"required\": [\"functional\"],\n \"properties\": {\n \"functional\": {\n \"type\": \"boolean\",\n \"const\": true\n }\n }\n }\n }\n },\n \"events\": {\n \"product\": {\n \"*\": {\n \"description\": \"A product in the catalog\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"name\"],\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"Product SKU\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"Display name\"\n }\n }\n }\n }\n },\n \"add\": {\n \"description\": \"Product added to cart\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"quantity\"],\n \"properties\": {\n \"quantity\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"description\": \"Purchase completed\",\n \"properties\": {\n \"data\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"total\"],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"total\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n }\n }\n }\n }\n }\n }\n }\n },\n \"flows\": {\n \"web\": {\n \"sources\": {\n \"browser\": {\n \"package\": \"@walkeros/web-source-browser\",\n \"primary\": true,\n \"config\": {\n \"settings\": {\n \"prefix\": \"data-elb\",\n \"pageview\": true,\n \"session\": {\n \"consent\": {\n \"marketing\": true\n }\n },\n \"elb\": \"elb\",\n \"elbLayer\": true\n }\n }\n },\n \"dataLayer\": {\n \"package\": \"@walkeros/web-source-datalayer\",\n \"next\": \"enricher\",\n \"config\": {\n \"require\": [\"session\"],\n \"settings\": {\n \"name\": \"dataLayer\",\n \"prefix\": \"gtag\"\n },\n \"mapping\": {\n \"gtag\": {\n \"add_to_cart\": {\n \"name\": \"product add\",\n \"data\": {\n \"map\": {\n \"id\": \"items.0.item_id\",\n \"name\": \"items.0.item_name\",\n \"price\": \"items.0.price\",\n \"currency\": \"currency\",\n \"quantity\": {\n \"key\": \"items.0.quantity\",\n \"value\": 1\n }\n }\n }\n },\n \"purchase\": {\n \"name\": \"order complete\",\n \"data\": {\n \"map\": {\n \"id\": \"transaction_id\",\n \"total\": \"value\",\n \"currency\": \"currency\",\n \"tax\": \"tax\",\n \"shipping\": \"shipping\"\n }\n }\n }\n }\n }\n }\n },\n \"demo\": {\n \"package\": \"@walkeros/source-demo\",\n \"config\": {\n \"settings\": {\n \"events\": [\n {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"path\": \"/\"\n },\n \"delay\": 0\n },\n {\n \"name\": \"product view\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"category\": \"Clothing\"\n },\n \"delay\": 300\n },\n {\n \"name\": \"product add\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"quantity\": 2\n },\n \"delay\": 600\n },\n {\n \"name\": \"test debug\",\n \"data\": {\n \"message\": \"This should be ignored\"\n },\n \"delay\": 800\n },\n {\n \"name\": \"order complete\",\n \"data\": {\n \"id\": \"ORD-123\",\n \"total\": 149.97,\n \"currency\": \"EUR\",\n \"tax\": 12.5,\n \"shipping\": 5.99\n },\n \"user\": {\n \"email\": \"customer@example.com\",\n \"id\": \"U-456\",\n \"device\": \"d3v1c3\",\n \"session\": \"s3ss10n\"\n },\n \"nested\": [\n {\n \"entity\": \"product\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"quantity\": 2\n }\n },\n {\n \"entity\": \"product\",\n \"data\": {\n \"id\": \"SKU-002\",\n \"name\": \"Red Cap\",\n \"price\": 24.99,\n \"quantity\": 1\n }\n }\n ],\n \"delay\": 1000\n }\n ]\n }\n }\n }\n },\n \"transformers\": {\n \"enricher\": {\n \"code\": {\n \"type\": \"enricher\",\n \"push\": \"$code:(event) => ({ ...event, context: { ...event.context, enrichedAt: Date.now() } })\"\n },\n \"config\": {}\n }\n },\n \"destinations\": {\n \"ga4\": {\n \"package\": \"@walkeros/web-destination-gtag\",\n \"config\": {\n \"require\": [\"consent\", \"user\"],\n \"consent\": {\n \"marketing\": true\n },\n \"settings\": {\n \"ga4\": {\n \"measurementId\": \"$var.ga4MeasurementId\"\n }\n },\n \"mapping\": {\n \"page\": {\n \"view\": {\n \"name\": \"page_view\",\n \"data\": {\n \"map\": {\n \"page_title\": \"data.title\",\n \"page_location\": \"data.path\"\n }\n }\n }\n },\n \"product\": {\n \"view\": {\n \"name\": \"view_item\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": [\n {\n \"key\": \"data.sku\"\n },\n {\n \"key\": \"data.id\"\n }\n ],\n \"item_name\": \"data.name\",\n \"item_category\": \"data.category\",\n \"price\": \"data.price\"\n }\n }\n ]\n }\n }\n }\n },\n \"add\": {\n \"name\": \"add_to_cart\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"name\": \"purchase\",\n \"data\": {\n \"map\": {\n \"transaction_id\": \"data.id\",\n \"value\": {\n \"fn\": \"$code:(event) => Math.round(event.data.total * 100)\"\n },\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"tax\": \"data.tax\",\n \"shipping\": \"data.shipping\",\n \"items\": \"$var.ga4ItemsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n }\n }\n },\n \"examples\": {\n \"page-view\": {\n \"in\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"path\": \"/\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n },\n \"mapping\": {\n \"name\": \"page_view\",\n \"data\": {\n \"map\": {\n \"page_title\": \"data.title\",\n \"page_location\": \"data.path\"\n }\n }\n },\n \"out\": [\n \"event\",\n \"page_view\",\n {\n \"page_title\": \"Home\",\n \"page_location\": \"/\"\n }\n ]\n },\n \"product-add\": {\n \"in\": {\n \"name\": \"product add\",\n \"data\": {\n \"id\": \"SKU-001\",\n \"name\": \"Blue Shirt\",\n \"price\": 49.99,\n \"currency\": \"EUR\",\n \"quantity\": 2\n },\n \"entity\": \"product\",\n \"action\": \"add\"\n },\n \"mapping\": {\n \"name\": \"add_to_cart\",\n \"data\": {\n \"map\": {\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"EUR\"\n },\n \"value\": \"data.price\",\n \"items\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"item_id\": \"data.id\",\n \"item_name\": \"data.name\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n },\n \"out\": [\n \"event\",\n \"add_to_cart\",\n {\n \"currency\": \"EUR\",\n \"value\": 49.99,\n \"items\": [\n {\n \"item_id\": \"SKU-001\",\n \"item_name\": \"Blue Shirt\",\n \"quantity\": 2\n }\n ]\n }\n ]\n },\n \"test-ignored\": {\n \"in\": {\n \"name\": \"test debug\",\n \"data\": {\n \"message\": \"This should be ignored\"\n },\n \"entity\": \"test\",\n \"action\": \"debug\"\n },\n \"out\": false\n }\n }\n },\n \"api\": {\n \"package\": \"@walkeros/web-destination-api\",\n \"config\": {\n \"settings\": {\n \"url\": \"$var.apiUrl\",\n \"batch\": 5,\n \"transform\": \"$code:(data) => JSON.stringify(data)\"\n },\n \"data\": {\n \"map\": {\n \"sent_at\": {\n \"fn\": \"$code:() => Date.now()\"\n },\n \"flow_version\": \"$var.flowVersion\"\n }\n },\n \"mapping\": {\n \"order\": {\n \"complete\": {\n \"data\": {\n \"map\": {\n \"transaction_id\": \"data.id\",\n \"value\": \"data.total\",\n \"currency\": \"data.currency\",\n \"user_email\": {\n \"key\": \"user.email\",\n \"consent\": {\n \"marketing\": true\n }\n },\n \"items\": \"$var.ga4ItemsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n }\n }\n }\n },\n \"debug\": {\n \"code\": {\n \"type\": \"debug-logger\",\n \"push\": \"$code:(event, ctx) => { ctx.logger.info('[DEBUG]', event.name, event.data); }\"\n },\n \"config\": {\n \"consent\": {}\n }\n }\n },\n \"collector\": {\n \"consent\": {\n \"functional\": true,\n \"marketing\": false\n },\n \"user\": {\n \"id\": \"anonymous\"\n },\n \"globals\": {\n \"environment\": \"demo\",\n \"version\": \"$var.flowVersion\"\n },\n \"custom\": {\n \"campaign\": \"flow-demo\"\n }\n },\n \"config\": {\n \"platform\": \"web\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/collector\": {},\n \"@walkeros/web-source-browser\": {},\n \"@walkeros/web-source-datalayer\": {},\n \"@walkeros/source-demo\": {},\n \"@walkeros/web-destination-gtag\": {},\n \"@walkeros/web-destination-api\": {}\n }\n }\n }\n },\n \"server\": {\n \"variables\": {\n \"metaPixelId\": \"$env.META_PIXEL_ID:123456789012345\",\n \"metaAccessToken\": \"$env.META_ACCESS_TOKEN:demo_token\"\n },\n \"sources\": {\n \"http\": {\n \"package\": \"@walkeros/server-source-express\",\n \"primary\": true,\n \"next\": [\"filter\"],\n \"cache\": {\n \"rules\": [\n {\n \"match\": {\n \"key\": \"ingest.method\",\n \"operator\": \"eq\",\n \"value\": \"GET\"\n },\n \"key\": [\"ingest.method\", \"ingest.path\"],\n \"ttl\": 300,\n \"update\": {\n \"headers.X-Cache\": {\n \"key\": \"cache.status\"\n }\n }\n }\n ]\n },\n \"config\": {\n \"settings\": {\n \"path\": \"/collect\",\n \"port\": 8080,\n \"cors\": true,\n \"healthCheck\": true\n },\n \"ingest\": {\n \"map\": {\n \"method\": { \"key\": \"method\" },\n \"path\": { \"key\": \"path\" },\n \"context\": {\n \"map\": {\n \"ip\": { \"key\": \"ip\" },\n \"userAgent\": { \"key\": \"headers.user-agent\" },\n \"language\": { \"key\": \"headers.accept-language\" },\n \"referer\": { \"key\": \"headers.referer\" },\n \"anonymizedIp\": {\n \"fn\": \"$code:(req) => req.ip ? req.ip.replace(/\\\\.\\\\d+$/, '.0') : ''\"\n }\n }\n }\n }\n }\n },\n \"examples\": {\n \"post-event\": {\n \"in\": {\n \"method\": \"POST\",\n \"path\": \"/collect\",\n \"headers\": {\n \"content-type\": \"application/json\"\n },\n \"body\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"url\": \"https://example.com\"\n }\n }\n },\n \"out\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\",\n \"url\": \"https://example.com\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n }\n }\n }\n }\n },\n \"transformers\": {\n \"filter\": {\n \"code\": {\n \"type\": \"filter\",\n \"push\": \"$code:(event) => event.name.startsWith('internal_') || event.name.startsWith('debug_') ? false : event\"\n },\n \"next\": \"fingerprint\",\n \"config\": {},\n \"examples\": {\n \"passes-normal\": {\n \"in\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n },\n \"out\": {\n \"name\": \"page view\",\n \"data\": {\n \"title\": \"Home\"\n },\n \"entity\": \"page\",\n \"action\": \"view\"\n }\n },\n \"filters-internal\": {\n \"in\": {\n \"name\": \"internal_heartbeat\",\n \"data\": {},\n \"entity\": \"internal\",\n \"action\": \"heartbeat\"\n },\n \"out\": false\n }\n }\n },\n \"fingerprint\": {\n \"package\": \"@walkeros/server-transformer-fingerprint\",\n \"config\": {\n \"settings\": {\n \"fields\": [\n \"context.ip\",\n \"context.userAgent\",\n \"context.language\",\n {\n \"fn\": \"$code:() => new Date().toISOString().slice(0, 10)\"\n }\n ],\n \"output\": \"user.hash\",\n \"length\": 16\n }\n }\n }\n },\n \"destinations\": {\n \"meta\": {\n \"package\": \"@walkeros/server-destination-meta\",\n \"before\": \"fingerprint\",\n \"config\": {\n \"settings\": {\n \"pixelId\": \"$var.metaPixelId\",\n \"accessToken\": \"$var.metaAccessToken\",\n \"user_data\": {\n \"external_id\": {\n \"set\": [\"user.device\", \"user.session\"]\n }\n }\n },\n \"policy\": {\n \"user_data.em\": {\n \"key\": \"user.email\",\n \"consent\": {\n \"marketing\": true\n }\n },\n \"user_data.external_id\": \"user.id\",\n \"custom_data.server_processed\": {\n \"value\": true\n },\n \"custom_data.request_meta\": {\n \"map\": {\n \"ip\": \"context.ip\",\n \"ua\": \"context.userAgent\"\n }\n }\n },\n \"mapping\": {\n \"page\": {\n \"view\": {\n \"name\": \"PageView\",\n \"data\": \"data\"\n }\n },\n \"product\": {\n \"view\": {\n \"name\": \"ViewContent\",\n \"data\": {\n \"map\": {\n \"value\": \"data.price\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"content_type\": {\n \"value\": \"product\"\n },\n \"content_ids\": {\n \"set\": [\"data.id\"]\n }\n }\n }\n },\n \"add\": {\n \"name\": \"AddToCart\",\n \"data\": {\n \"map\": {\n \"value\": \"data.price\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"content_type\": {\n \"value\": \"product\"\n },\n \"contents\": {\n \"loop\": [\n \"this\",\n {\n \"map\": {\n \"id\": \"data.id\",\n \"quantity\": {\n \"key\": \"data.quantity\",\n \"value\": 1\n }\n }\n }\n ]\n }\n }\n }\n }\n },\n \"order\": {\n \"complete\": {\n \"name\": \"Purchase\",\n \"data\": {\n \"map\": {\n \"value\": \"data.total\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"$var.currency\"\n },\n \"order_id\": \"data.id\",\n \"contents\": \"$var.metaContentsLoop\"\n }\n }\n }\n },\n \"test\": {\n \"*\": {\n \"ignore\": true\n }\n },\n \"*\": {\n \"click\": {\n \"name\": \"CustomEvent\",\n \"data\": \"data\"\n }\n }\n }\n },\n \"examples\": {\n \"purchase\": {\n \"in\": {\n \"name\": \"order complete\",\n \"data\": {\n \"id\": \"ORD-123\",\n \"total\": 149.97,\n \"currency\": \"EUR\"\n },\n \"entity\": \"order\",\n \"action\": \"complete\"\n },\n \"mapping\": {\n \"name\": \"Purchase\",\n \"data\": {\n \"map\": {\n \"value\": \"data.total\",\n \"currency\": {\n \"key\": \"data.currency\",\n \"value\": \"EUR\"\n },\n \"order_id\": \"data.id\"\n }\n }\n },\n \"out\": {\n \"data\": [\n {\n \"event_name\": \"Purchase\",\n \"custom_data\": {\n \"value\": 149.97,\n \"currency\": \"EUR\",\n \"order_id\": \"ORD-123\"\n }\n }\n ]\n }\n }\n }\n },\n \"demo\": {\n \"package\": \"@walkeros/destination-demo\",\n \"config\": {\n \"settings\": {\n \"name\": \"Server Events\",\n \"values\": [\"name\", \"data\", \"nested\", \"user\", \"consent\", \"context\"]\n }\n }\n }\n },\n \"collector\": {\n \"consent\": {\n \"functional\": true\n },\n \"globals\": {\n \"environment\": \"demo\",\n \"version\": \"$var.flowVersion\",\n \"platform\": \"server\",\n \"startedAt\": \"$code:Date.now()\"\n }\n },\n \"config\": {\n \"platform\": \"server\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/core\": {\n \"path\": \"../../core\"\n },\n \"@walkeros/collector\": {\n \"path\": \"../../collector\"\n },\n \"@walkeros/server-source-express\": {},\n \"@walkeros/server-destination-meta\": {},\n \"@walkeros/destination-demo\": {},\n \"@walkeros/server-transformer-fingerprint\": {}\n }\n }\n }\n }\n }\n}\n","{\n \"version\": 4,\n \"flows\": {\n \"default\": {\n \"destinations\": {\n \"demo\": {\n \"package\": \"@walkeros/destination-demo\",\n \"config\": {\n \"settings\": {\n \"name\": \"Simple Demo\",\n \"values\": [\"name\", \"data\", \"user\", \"consent\"]\n }\n }\n }\n },\n \"config\": {\n \"platform\": \"web\",\n \"bundle\": {\n \"packages\": {\n \"@walkeros/collector\": {\n \"version\": \"latest\",\n \"imports\": [\"startFlow\"]\n },\n \"@walkeros/destination-demo\": {\n \"version\": \"latest\"\n }\n }\n }\n }\n }\n }\n}\n","/**\n * Typed re-exports of bundled example flow configurations.\n *\n * Importing JSON files via `resolveJsonModule` produces a deeply structural\n * type whose literals are widened (`version: number` instead of `4`,\n * `platform: string` instead of `'web' | 'server'`). That widened shape is\n * not assignable to `Flow.Json` and forces every consumer to cast away to\n * `Record<string, unknown>`, losing all type information about the example.\n *\n * Routing the imports through `validateFlowConfig` (a real type guard backed\n * by the canonical Zod schema in `@walkeros/core`) launders the JSON into a\n * proper `Flow.Json` value with no `as` cast at any call site:\n *\n * - The Zod parser checks the structure at module load time. If an example\n * drifts away from the schema, the package fails to load loudly instead\n * of producing a silently broken value.\n * - The return type is `Flow.Json` (the canonical interface), not the Zod\n * inferred shape, because `validateFlowConfig` uses `isFlowConfig` as a\n * `data is Flow.Json` type predicate.\n *\n * Pattern choice (`: Flow.Json` annotation via runtime validator) was picked\n * over `satisfies Flow.Json` and `as const satisfies Flow.Json` because:\n *\n * - `: Flow.Json` annotation alone fails: the JSON's widened literals do\n * not satisfy the literal constraints (`version: 4`, platform unions).\n * - `satisfies Flow.Json` fails for the same reason.\n * - `as const satisfies Flow.Json` cannot be applied to a JSON import\n * (TypeScript does not support `as const` on imported values).\n * - A wrapper-function or runtime-validator approach is the only pattern\n * that produces a `Flow.Json`-typed value without an `as` cast anywhere\n * in the chain. It also gives consumers a load-time correctness check\n * for free.\n *\n * Cost: one Zod parse per example at module init. Examples are loaded by\n * tests, MCP servers, and dev seed scripts. None are perf-critical.\n */\n\nimport { validateFlowConfig } from '../config/validators.js';\n\nimport flowCompleteImport from '../../examples/flow-complete.json';\nimport flowSimpleImport from '../../examples/flow-simple.json';\n\nexport const flowComplete = validateFlowConfig(flowCompleteImport);\nexport const flowSimple = validateFlowConfig(flowSimpleImport);\n"],"mappings":";AAQA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAExB,IAAM,EAAE,gBAAgB,IAAI;AA+BrB,SAAS,aAAa,MAAkC;AAC7D,QAAM,SAAS,gBAAgB,IAAI;AACnC,SAAO,OAAO;AAChB;AAaO,SAAS,mBAAmB,MAA0B;AAM3D,MAAI,aAAa,IAAI,EAAG,QAAO;AAG/B,QAAM,SAAS,gBAAgB,IAAI;AACnC,MAAI,OAAO,SAAS;AAElB,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,QAAM,SAAS,OAAO,MAAM,OACzB,IAAI,CAAC,UAAU;AACd,UAAM,OACJ,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,MAAM,EAAE,KAAK,GAAG,IAAI;AAC7D,WAAO,OAAO,IAAI,KAAK,MAAM,OAAO;AAAA,EACtC,CAAC,EACA,KAAK,IAAI;AACZ,QAAM,IAAI,MAAM;AAAA,EAA2B,MAAM,EAAE;AACrD;;;AChFA;AAAA,EACE,SAAW;AAAA,EACX,SAAW;AAAA,EACX,WAAa;AAAA,IACX,UAAY;AAAA,IACZ,aAAe;AAAA,IACf,kBAAoB;AAAA,I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