@walkeros/cli 2.0.0 → 2.1.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/CHANGELOG.md +60 -0
- package/README.md +57 -46
- package/dist/cli.js +17006 -1330
- package/dist/dev.d.ts +20 -28
- package/dist/dev.js +19 -13
- package/dist/dev.js.map +1 -1
- package/dist/examples/README.md +8 -8
- package/dist/examples/flow-complete.json +164 -1
- package/dist/examples/flow-complete.md +2 -2
- package/dist/examples/flow-selfhost-test.json +24 -0
- package/dist/index.d.ts +182 -67
- package/dist/index.js +2321 -1020
- package/dist/index.js.map +1 -1
- package/dist/runtime/main.js +16129 -912
- package/examples/README.md +8 -8
- package/examples/flow-complete.json +164 -1
- package/examples/flow-complete.md +2 -2
- package/examples/flow-selfhost-test.json +24 -0
- package/package.json +7 -8
package/dist/dev.d.ts
CHANGED
|
@@ -7,19 +7,6 @@ import { z } from '@walkeros/core/dev';
|
|
|
7
7
|
* Follows walkerOS patterns from @walkeros/core.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Run mode schema.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Validates CLI run mode for the `run` command.
|
|
15
|
-
* - `collect`: Run as event collector
|
|
16
|
-
* - `serve`: Run as HTTP server
|
|
17
|
-
*/
|
|
18
|
-
declare const RunModeSchema: z.ZodEnum<{
|
|
19
|
-
collect: "collect";
|
|
20
|
-
serve: "serve";
|
|
21
|
-
}>;
|
|
22
|
-
type RunMode = z.infer<typeof RunModeSchema>;
|
|
23
10
|
/**
|
|
24
11
|
* Port number schema.
|
|
25
12
|
*
|
|
@@ -50,10 +37,6 @@ declare const FilePathSchema: z.ZodString;
|
|
|
50
37
|
* Validates all options for the `walkeros run` command.
|
|
51
38
|
*/
|
|
52
39
|
declare const RunOptionsSchema: z.ZodObject<{
|
|
53
|
-
mode: z.ZodEnum<{
|
|
54
|
-
collect: "collect";
|
|
55
|
-
serve: "serve";
|
|
56
|
-
}>;
|
|
57
40
|
flow: z.ZodString;
|
|
58
41
|
port: z.ZodDefault<z.ZodNumber>;
|
|
59
42
|
flowName: z.ZodOptional<z.ZodString>;
|
|
@@ -71,15 +54,17 @@ type RunOptions = z.infer<typeof RunOptionsSchema>;
|
|
|
71
54
|
*
|
|
72
55
|
* @remarks
|
|
73
56
|
* Validates the type of validation to perform.
|
|
57
|
+
* - `contract`: Validate a data contract
|
|
74
58
|
* - `event`: Validate a walkerOS event object
|
|
75
59
|
* - `flow`: Validate a flow configuration file
|
|
76
60
|
* - `mapping`: Validate mapping rules
|
|
77
61
|
*/
|
|
78
|
-
declare const ValidationTypeSchema: z.
|
|
62
|
+
declare const ValidationTypeSchema: z.ZodEnum<{
|
|
79
63
|
flow: "flow";
|
|
64
|
+
contract: "contract";
|
|
80
65
|
event: "event";
|
|
81
66
|
mapping: "mapping";
|
|
82
|
-
}
|
|
67
|
+
}>;
|
|
83
68
|
type ValidationType = z.infer<typeof ValidationTypeSchema>;
|
|
84
69
|
/**
|
|
85
70
|
* Validate options schema.
|
|
@@ -89,6 +74,7 @@ type ValidationType = z.infer<typeof ValidationTypeSchema>;
|
|
|
89
74
|
*/
|
|
90
75
|
declare const ValidateOptionsSchema: z.ZodObject<{
|
|
91
76
|
flow: z.ZodOptional<z.ZodString>;
|
|
77
|
+
path: z.ZodOptional<z.ZodString>;
|
|
92
78
|
}, z.core.$strip>;
|
|
93
79
|
type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
|
|
94
80
|
/**
|
|
@@ -99,13 +85,15 @@ type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
|
|
|
99
85
|
* rather than ZodObject instances. Define shape first, then wrap.
|
|
100
86
|
*/
|
|
101
87
|
declare const ValidateInputShape: {
|
|
102
|
-
type: z.
|
|
88
|
+
type: z.ZodEnum<{
|
|
103
89
|
flow: "flow";
|
|
90
|
+
contract: "contract";
|
|
104
91
|
event: "event";
|
|
105
92
|
mapping: "mapping";
|
|
106
|
-
}
|
|
93
|
+
}>;
|
|
107
94
|
input: z.ZodString;
|
|
108
95
|
flow: z.ZodOptional<z.ZodString>;
|
|
96
|
+
path: z.ZodOptional<z.ZodString>;
|
|
109
97
|
};
|
|
110
98
|
/**
|
|
111
99
|
* Validate input schema for MCP tools.
|
|
@@ -114,13 +102,15 @@ declare const ValidateInputShape: {
|
|
|
114
102
|
* Full input schema including type and input source.
|
|
115
103
|
*/
|
|
116
104
|
declare const ValidateInputSchema: z.ZodObject<{
|
|
117
|
-
type: z.
|
|
105
|
+
type: z.ZodEnum<{
|
|
118
106
|
flow: "flow";
|
|
107
|
+
contract: "contract";
|
|
119
108
|
event: "event";
|
|
120
109
|
mapping: "mapping";
|
|
121
|
-
}
|
|
110
|
+
}>;
|
|
122
111
|
input: z.ZodString;
|
|
123
112
|
flow: z.ZodOptional<z.ZodString>;
|
|
113
|
+
path: z.ZodOptional<z.ZodString>;
|
|
124
114
|
}, z.core.$strip>;
|
|
125
115
|
type ValidateInput = z.infer<typeof ValidateInputSchema>;
|
|
126
116
|
|
|
@@ -209,12 +199,14 @@ type SimulateOptions = z.infer<typeof SimulateOptionsSchema>;
|
|
|
209
199
|
*/
|
|
210
200
|
declare const SimulateInputShape: {
|
|
211
201
|
configPath: z.ZodString;
|
|
212
|
-
event: z.ZodString
|
|
202
|
+
event: z.ZodOptional<z.ZodString>;
|
|
213
203
|
flow: z.ZodOptional<z.ZodString>;
|
|
214
204
|
platform: z.ZodOptional<z.ZodEnum<{
|
|
215
205
|
web: "web";
|
|
216
206
|
server: "server";
|
|
217
207
|
}>>;
|
|
208
|
+
example: z.ZodOptional<z.ZodString>;
|
|
209
|
+
step: z.ZodOptional<z.ZodString>;
|
|
218
210
|
};
|
|
219
211
|
/**
|
|
220
212
|
* Simulate input schema for MCP tools.
|
|
@@ -224,12 +216,14 @@ declare const SimulateInputShape: {
|
|
|
224
216
|
*/
|
|
225
217
|
declare const SimulateInputSchema: z.ZodObject<{
|
|
226
218
|
configPath: z.ZodString;
|
|
227
|
-
event: z.ZodString
|
|
219
|
+
event: z.ZodOptional<z.ZodString>;
|
|
228
220
|
flow: z.ZodOptional<z.ZodString>;
|
|
229
221
|
platform: z.ZodOptional<z.ZodEnum<{
|
|
230
222
|
web: "web";
|
|
231
223
|
server: "server";
|
|
232
224
|
}>>;
|
|
225
|
+
example: z.ZodOptional<z.ZodString>;
|
|
226
|
+
step: z.ZodOptional<z.ZodString>;
|
|
233
227
|
}, z.core.$strip>;
|
|
234
228
|
type SimulateInput = z.infer<typeof SimulateInputSchema>;
|
|
235
229
|
|
|
@@ -305,8 +299,6 @@ declare const index_PushInputSchema: typeof PushInputSchema;
|
|
|
305
299
|
declare const index_PushInputShape: typeof PushInputShape;
|
|
306
300
|
type index_PushOptions = PushOptions;
|
|
307
301
|
declare const index_PushOptionsSchema: typeof PushOptionsSchema;
|
|
308
|
-
type index_RunMode = RunMode;
|
|
309
|
-
declare const index_RunModeSchema: typeof RunModeSchema;
|
|
310
302
|
type index_RunOptions = RunOptions;
|
|
311
303
|
declare const index_RunOptionsSchema: typeof RunOptionsSchema;
|
|
312
304
|
type index_SimulateInput = SimulateInput;
|
|
@@ -322,7 +314,7 @@ declare const index_ValidateOptionsSchema: typeof ValidateOptionsSchema;
|
|
|
322
314
|
type index_ValidationType = ValidationType;
|
|
323
315
|
declare const index_ValidationTypeSchema: typeof ValidationTypeSchema;
|
|
324
316
|
declare namespace index {
|
|
325
|
-
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
|
|
317
|
+
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_RunOptions as RunOptions, index_RunOptionsSchema as RunOptionsSchema, 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 };
|
|
326
318
|
}
|
|
327
319
|
|
|
328
320
|
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
|
-
RunModeSchema: () => RunModeSchema,
|
|
20
19
|
RunOptionsSchema: () => RunOptionsSchema,
|
|
21
20
|
SimulateInputSchema: () => SimulateInputSchema,
|
|
22
21
|
SimulateInputShape: () => SimulateInputShape,
|
|
@@ -29,14 +28,12 @@ __export(schemas_exports, {
|
|
|
29
28
|
|
|
30
29
|
// src/schemas/primitives.ts
|
|
31
30
|
import { z } from "@walkeros/core/dev";
|
|
32
|
-
var RunModeSchema = z.enum(["collect", "serve"]).describe("CLI run mode: collect events or serve HTTP");
|
|
33
31
|
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");
|
|
34
32
|
var FilePathSchema = z.string().min(1, "File path cannot be empty").describe("Path to configuration file");
|
|
35
33
|
|
|
36
34
|
// src/schemas/run.ts
|
|
37
35
|
import { z as z2 } from "@walkeros/core/dev";
|
|
38
36
|
var RunOptionsSchema = z2.object({
|
|
39
|
-
mode: RunModeSchema,
|
|
40
37
|
flow: FilePathSchema,
|
|
41
38
|
port: PortSchema.default(8080),
|
|
42
39
|
flowName: z2.string().optional().describe("Specific flow name to run")
|
|
@@ -44,19 +41,20 @@ var RunOptionsSchema = z2.object({
|
|
|
44
41
|
|
|
45
42
|
// src/schemas/validate.ts
|
|
46
43
|
import { z as z3 } from "@walkeros/core/dev";
|
|
47
|
-
var ValidationTypeSchema = z3.
|
|
48
|
-
z3.enum(["event", "flow", "mapping"]),
|
|
49
|
-
z3.string().regex(/^(destinations|sources|transformers)\.\w+$|^\w+$/)
|
|
50
|
-
]).describe(
|
|
51
|
-
'Validation type: "event", "flow", "mapping", or dot-notation path (e.g., "destinations.snowplow") to validate a specific entry against its package schema'
|
|
52
|
-
);
|
|
44
|
+
var ValidationTypeSchema = z3.enum(["contract", "event", "flow", "mapping"]).describe('Validation type: "event", "flow", "mapping", or "contract"');
|
|
53
45
|
var ValidateOptionsSchema = z3.object({
|
|
54
|
-
flow: z3.string().optional().describe("Flow name for multi-flow configs")
|
|
46
|
+
flow: z3.string().optional().describe("Flow name for multi-flow configs"),
|
|
47
|
+
path: z3.string().optional().describe(
|
|
48
|
+
'Entry path for package schema validation (e.g., "destinations.snowplow", "sources.browser")'
|
|
49
|
+
)
|
|
55
50
|
});
|
|
56
51
|
var ValidateInputShape = {
|
|
57
52
|
type: ValidationTypeSchema,
|
|
58
53
|
input: z3.string().min(1).describe("JSON string, file path, or URL to validate"),
|
|
59
|
-
flow: z3.string().optional().describe("Flow name for multi-flow configs")
|
|
54
|
+
flow: z3.string().optional().describe("Flow name for multi-flow configs"),
|
|
55
|
+
path: z3.string().optional().describe(
|
|
56
|
+
'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
|
+
)
|
|
60
58
|
};
|
|
61
59
|
var ValidateInputSchema = z3.object(ValidateInputShape);
|
|
62
60
|
|
|
@@ -89,9 +87,17 @@ var SimulateOptionsSchema = z5.object({
|
|
|
89
87
|
});
|
|
90
88
|
var SimulateInputShape = {
|
|
91
89
|
configPath: FilePathSchema.describe("Path to flow configuration file"),
|
|
92
|
-
event: z5.string().min(1).describe(
|
|
90
|
+
event: z5.string().min(1).optional().describe(
|
|
91
|
+
"Event as JSON string, file path, or URL. Optional when example is provided."
|
|
92
|
+
),
|
|
93
93
|
flow: z5.string().optional().describe("Flow name for multi-flow configs"),
|
|
94
|
-
platform: PlatformSchema.optional().describe("Override platform detection")
|
|
94
|
+
platform: PlatformSchema.optional().describe("Override platform detection"),
|
|
95
|
+
example: z5.string().optional().describe(
|
|
96
|
+
'Name of a step example to use as event input (uses its "in" value)'
|
|
97
|
+
),
|
|
98
|
+
step: z5.string().optional().describe(
|
|
99
|
+
'Step target in type.name format (e.g. "destination.gtag") to narrow example lookup'
|
|
100
|
+
)
|
|
95
101
|
};
|
|
96
102
|
var SimulateInputSchema = z5.object(SimulateInputShape);
|
|
97
103
|
|
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 {\n RunModeSchema,\n PortSchema,\n FilePathSchema,\n type RunMode,\n} 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 * Run mode schema.\n *\n * @remarks\n * Validates CLI run mode for the `run` command.\n * - `collect`: Run as event collector\n * - `serve`: Run as HTTP server\n */\nexport const RunModeSchema = z\n .enum(['collect', 'serve'])\n .describe('CLI run mode: collect events or serve HTTP');\n\nexport type RunMode = z.infer<typeof RunModeSchema>;\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 { RunModeSchema, 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 mode: RunModeSchema,\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 * - `event`: Validate a walkerOS event object\n * - `flow`: Validate a flow configuration file\n * - `mapping`: Validate mapping rules\n */\nexport const ValidationTypeSchema = z\n .union([\n z.enum(['event', 'flow', 'mapping']),\n z.string().regex(/^(destinations|sources|transformers)\\.\\w+$|^\\w+$/),\n ])\n .describe(\n 'Validation type: \"event\", \"flow\", \"mapping\", or dot-notation path ' +\n '(e.g., \"destinations.snowplow\") to validate a specific entry against its package schema',\n );\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});\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};\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)',\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('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 * 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;AAAA;;;ACOA,SAAS,SAAS;AAUX,IAAM,gBA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OAAO;AAAA,EACxC,QAAQA,GAAE,QAAQ,EAAE,SAAS,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","z","z"]}
|
|
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)',\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('Path to flow configuration file'),\n event: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Event as JSON string, file path, or URL. Optional when example is provided.',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n example: z\n .string()\n .optional()\n .describe(\n 'Name of a step example to use as event input (uses its \"in\" value)',\n ),\n step: z\n .string()\n .optional()\n .describe(\n 'Step target in type.name format (e.g. \"destination.gtag\") to narrow example lookup',\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,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E,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","z","z"]}
|
package/dist/examples/README.md
CHANGED
|
@@ -60,14 +60,14 @@ Feature Inventory and usage examples.
|
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
# Web flow (opens browser with demo events)
|
|
63
|
-
walkeros
|
|
63
|
+
walkeros run examples/flow-complete.json --flow web
|
|
64
64
|
|
|
65
65
|
# Server flow (HTTP collection endpoint)
|
|
66
66
|
walkeros run examples/flow-complete.json --flow server
|
|
67
67
|
|
|
68
68
|
# Both (full pipeline)
|
|
69
69
|
# Terminal 1: walkeros run examples/flow-complete.json --flow server
|
|
70
|
-
# Terminal 2: walkeros
|
|
70
|
+
# Terminal 2: walkeros run examples/flow-complete.json --flow web
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
---
|
|
@@ -92,7 +92,7 @@ event flow testing
|
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
walkeros bundle examples/web-serve.json
|
|
95
|
-
walkeros run
|
|
95
|
+
walkeros run examples/web-serve.js -p 3000
|
|
96
96
|
# Open http://localhost:3000 in browser
|
|
97
97
|
```
|
|
98
98
|
|
|
@@ -159,7 +159,7 @@ web-serve.json
|
|
|
159
159
|
|
|
160
160
|
```bash
|
|
161
161
|
walkeros bundle examples/server-collect.json
|
|
162
|
-
walkeros run
|
|
162
|
+
walkeros run examples/server-collect.mjs -p 8080
|
|
163
163
|
|
|
164
164
|
# In another terminal, send test event:
|
|
165
165
|
curl -X POST http://localhost:8080/collect \
|
|
@@ -199,7 +199,7 @@ export GTM_CONTAINER_ID="GTM-XXXXX"
|
|
|
199
199
|
export GTM_SERVER_URL="https://your-gtm-server.com"
|
|
200
200
|
|
|
201
201
|
# Run in Docker
|
|
202
|
-
walkeros run
|
|
202
|
+
walkeros run examples/server-collection.json -p 8080
|
|
203
203
|
|
|
204
204
|
# Send test event (in another terminal)
|
|
205
205
|
curl -X POST http://localhost:8080/collect \
|
|
@@ -228,14 +228,14 @@ The simplest way to see the complete event flow:
|
|
|
228
228
|
|
|
229
229
|
```bash
|
|
230
230
|
walkeros bundle examples/server-collect.json
|
|
231
|
-
walkeros run
|
|
231
|
+
walkeros run examples/server-collect.mjs -p 8080
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
**Terminal 2 - Start web server**:
|
|
235
235
|
|
|
236
236
|
```bash
|
|
237
237
|
walkeros bundle examples/web-serve.json
|
|
238
|
-
walkeros run
|
|
238
|
+
walkeros run examples/web-serve.js -p 3000
|
|
239
239
|
```
|
|
240
240
|
|
|
241
241
|
**Browser**: Open http://localhost:3000
|
|
@@ -253,7 +253,7 @@ For production with real analytics platforms:
|
|
|
253
253
|
**1. Start collection server**:
|
|
254
254
|
|
|
255
255
|
```bash
|
|
256
|
-
walkeros run
|
|
256
|
+
walkeros run examples/server-collection.json -p 8080
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
**2. Bundle web tracking** (configured to send to localhost:8080):
|
|
@@ -318,6 +318,89 @@
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
},
|
|
322
|
+
"examples": {
|
|
323
|
+
"page-view": {
|
|
324
|
+
"in": {
|
|
325
|
+
"name": "page view",
|
|
326
|
+
"data": { "title": "Home", "path": "/" },
|
|
327
|
+
"entity": "page",
|
|
328
|
+
"action": "view"
|
|
329
|
+
},
|
|
330
|
+
"mapping": {
|
|
331
|
+
"name": "page_view",
|
|
332
|
+
"data": {
|
|
333
|
+
"map": {
|
|
334
|
+
"page_title": "data.title",
|
|
335
|
+
"page_location": "data.path"
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"out": [
|
|
340
|
+
"event",
|
|
341
|
+
"page_view",
|
|
342
|
+
{ "page_title": "Home", "page_location": "/" }
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
"product-add": {
|
|
346
|
+
"in": {
|
|
347
|
+
"name": "product add",
|
|
348
|
+
"data": {
|
|
349
|
+
"id": "SKU-001",
|
|
350
|
+
"name": "Blue Shirt",
|
|
351
|
+
"price": 49.99,
|
|
352
|
+
"currency": "EUR",
|
|
353
|
+
"quantity": 2
|
|
354
|
+
},
|
|
355
|
+
"entity": "product",
|
|
356
|
+
"action": "add"
|
|
357
|
+
},
|
|
358
|
+
"mapping": {
|
|
359
|
+
"name": "add_to_cart",
|
|
360
|
+
"data": {
|
|
361
|
+
"map": {
|
|
362
|
+
"currency": { "key": "data.currency", "value": "EUR" },
|
|
363
|
+
"value": "data.price",
|
|
364
|
+
"items": {
|
|
365
|
+
"loop": [
|
|
366
|
+
"this",
|
|
367
|
+
{
|
|
368
|
+
"map": {
|
|
369
|
+
"item_id": "data.id",
|
|
370
|
+
"item_name": "data.name",
|
|
371
|
+
"quantity": { "key": "data.quantity", "value": 1 }
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"out": [
|
|
380
|
+
"event",
|
|
381
|
+
"add_to_cart",
|
|
382
|
+
{
|
|
383
|
+
"currency": "EUR",
|
|
384
|
+
"value": 49.99,
|
|
385
|
+
"items": [
|
|
386
|
+
{
|
|
387
|
+
"item_id": "SKU-001",
|
|
388
|
+
"item_name": "Blue Shirt",
|
|
389
|
+
"quantity": 2
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
"test-ignored": {
|
|
396
|
+
"in": {
|
|
397
|
+
"name": "test debug",
|
|
398
|
+
"data": { "message": "This should be ignored" },
|
|
399
|
+
"entity": "test",
|
|
400
|
+
"action": "debug"
|
|
401
|
+
},
|
|
402
|
+
"out": false
|
|
403
|
+
}
|
|
321
404
|
}
|
|
322
405
|
},
|
|
323
406
|
"api": {
|
|
@@ -417,6 +500,25 @@
|
|
|
417
500
|
"context.language": "headers.accept-language",
|
|
418
501
|
"context.referer": "headers.referer"
|
|
419
502
|
}
|
|
503
|
+
},
|
|
504
|
+
"examples": {
|
|
505
|
+
"post-event": {
|
|
506
|
+
"in": {
|
|
507
|
+
"method": "POST",
|
|
508
|
+
"path": "/collect",
|
|
509
|
+
"headers": { "content-type": "application/json" },
|
|
510
|
+
"body": {
|
|
511
|
+
"name": "page view",
|
|
512
|
+
"data": { "title": "Home", "url": "https://example.com" }
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"out": {
|
|
516
|
+
"name": "page view",
|
|
517
|
+
"data": { "title": "Home", "url": "https://example.com" },
|
|
518
|
+
"entity": "page",
|
|
519
|
+
"action": "view"
|
|
520
|
+
}
|
|
521
|
+
}
|
|
420
522
|
}
|
|
421
523
|
}
|
|
422
524
|
},
|
|
@@ -427,7 +529,32 @@
|
|
|
427
529
|
"push": "$code:(event) => event.name.startsWith('internal_') || event.name.startsWith('debug_') ? false : event"
|
|
428
530
|
},
|
|
429
531
|
"next": "fingerprint",
|
|
430
|
-
"config": {}
|
|
532
|
+
"config": {},
|
|
533
|
+
"examples": {
|
|
534
|
+
"passes-normal": {
|
|
535
|
+
"in": {
|
|
536
|
+
"name": "page view",
|
|
537
|
+
"data": { "title": "Home" },
|
|
538
|
+
"entity": "page",
|
|
539
|
+
"action": "view"
|
|
540
|
+
},
|
|
541
|
+
"out": {
|
|
542
|
+
"name": "page view",
|
|
543
|
+
"data": { "title": "Home" },
|
|
544
|
+
"entity": "page",
|
|
545
|
+
"action": "view"
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"filters-internal": {
|
|
549
|
+
"in": {
|
|
550
|
+
"name": "internal_heartbeat",
|
|
551
|
+
"data": {},
|
|
552
|
+
"entity": "internal",
|
|
553
|
+
"action": "heartbeat"
|
|
554
|
+
},
|
|
555
|
+
"out": false
|
|
556
|
+
}
|
|
557
|
+
}
|
|
431
558
|
},
|
|
432
559
|
"fingerprint": {
|
|
433
560
|
"package": "@walkeros/server-transformer-fingerprint",
|
|
@@ -610,6 +737,42 @@
|
|
|
610
737
|
}
|
|
611
738
|
}
|
|
612
739
|
}
|
|
740
|
+
},
|
|
741
|
+
"examples": {
|
|
742
|
+
"purchase": {
|
|
743
|
+
"in": {
|
|
744
|
+
"name": "order complete",
|
|
745
|
+
"data": {
|
|
746
|
+
"id": "ORD-123",
|
|
747
|
+
"total": 149.97,
|
|
748
|
+
"currency": "EUR"
|
|
749
|
+
},
|
|
750
|
+
"entity": "order",
|
|
751
|
+
"action": "complete"
|
|
752
|
+
},
|
|
753
|
+
"mapping": {
|
|
754
|
+
"name": "Purchase",
|
|
755
|
+
"data": {
|
|
756
|
+
"map": {
|
|
757
|
+
"value": "data.total",
|
|
758
|
+
"currency": { "key": "data.currency", "value": "EUR" },
|
|
759
|
+
"order_id": "data.id"
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
"out": {
|
|
764
|
+
"data": [
|
|
765
|
+
{
|
|
766
|
+
"event_name": "Purchase",
|
|
767
|
+
"custom_data": {
|
|
768
|
+
"value": 149.97,
|
|
769
|
+
"currency": "EUR",
|
|
770
|
+
"order_id": "ORD-123"
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
}
|
|
613
776
|
}
|
|
614
777
|
},
|
|
615
778
|
"demo": {
|
|
@@ -33,7 +33,7 @@ complete event tracking architecture.
|
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
cd walkerOS
|
|
36
|
-
npx walkeros
|
|
36
|
+
npx walkeros run packages/cli/examples/flow-complete.json --flow web
|
|
37
37
|
# Open http://localhost:3000 - demo events fire automatically
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -64,7 +64,7 @@ curl -X POST http://localhost:8080/collect \
|
|
|
64
64
|
npx walkeros run packages/cli/examples/flow-complete.json --flow server
|
|
65
65
|
|
|
66
66
|
# Terminal 2: Start web (sends to server via API destination)
|
|
67
|
-
npx walkeros
|
|
67
|
+
npx walkeros run packages/cli/examples/flow-complete.json --flow web
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
---
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flows": {
|
|
4
|
+
"default": {
|
|
5
|
+
"server": {},
|
|
6
|
+
"packages": {
|
|
7
|
+
"@walkeros/collector": {}
|
|
8
|
+
},
|
|
9
|
+
"sources": {
|
|
10
|
+
"http": {
|
|
11
|
+
"package": "@walkeros/server-source-express",
|
|
12
|
+
"primary": true,
|
|
13
|
+
"config": {
|
|
14
|
+
"settings": {
|
|
15
|
+
"port": 8080,
|
|
16
|
+
"cors": true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"destinations": {}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|