@walkeros/cli 4.2.0-next-1780577792479 → 4.2.0-next-1780610489068
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 +20 -5
- package/dist/cli.js +192 -74
- package/dist/index.d.ts +36 -3
- package/dist/index.js +141 -27
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @walkeros/cli
|
|
2
2
|
|
|
3
|
-
## 4.2.0-next-
|
|
3
|
+
## 4.2.0-next-1780610489068
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
server flows with external step packages resolve them at runtime.
|
|
10
10
|
`walkeros bundle -o flow.tar.gz` packs a server bundle directory into that
|
|
11
11
|
archive. Web single-file bundles do not support archive output.
|
|
12
|
+
- 6a72a32: The MCP `flow_simulate` and `flow_bundle` tools now accept a cloud
|
|
13
|
+
flow id as `configPath`, so you can simulate or bundle a saved flow without a
|
|
14
|
+
manual file round-trip, and repeated simulations reuse a prebuilt bundle for
|
|
15
|
+
faster runs. Loading or fetching a flow with no default project set now
|
|
16
|
+
returns a clear "no default project" error, and `flow_examples` surfaces a
|
|
17
|
+
referenced package's shipped examples when a step has none inline. Bundle
|
|
18
|
+
stats now report the real total bundle size and list package names instead of
|
|
19
|
+
a per-package estimate, and the GA4 transformer documents its wiring contract
|
|
20
|
+
via package hints.
|
|
12
21
|
- 9d066cc: Preview creation can now target a deployed version: pass
|
|
13
22
|
`source: { kind: 'deployment-version', deploymentVersionId }` to
|
|
14
23
|
`createPreview` (CLI) or the MCP `flow_manage` `preview_create` action to
|
|
@@ -20,6 +29,11 @@
|
|
|
20
29
|
without a redeploy. A future trace window upgrades a flow to full inbound and
|
|
21
30
|
outbound recording, and a null or past window reverts to the flow's `observe`
|
|
22
31
|
baseline and self-expires.
|
|
32
|
+
- 6a72a32: Source simulation gains a `collector` step that runs the real
|
|
33
|
+
collector enrichment and returns the fully enriched event. Transformer
|
|
34
|
+
simulation now accepts an optional raw `ingest` so request decoders like GA4
|
|
35
|
+
can be tested standalone by supplying a `url`. The `flow_simulate` MCP tool
|
|
36
|
+
accepts the new collector step and the transformer `ingest` input.
|
|
23
37
|
|
|
24
38
|
### Patch Changes
|
|
25
39
|
|
|
@@ -63,11 +77,12 @@
|
|
|
63
77
|
- Updated dependencies [c27d3c1]
|
|
64
78
|
- Updated dependencies [126c0f1]
|
|
65
79
|
- Updated dependencies [654ba38]
|
|
80
|
+
- Updated dependencies [6a72a32]
|
|
66
81
|
- Updated dependencies [3eb2467]
|
|
67
|
-
- @walkeros/core@4.2.0-next-
|
|
68
|
-
- @walkeros/collector@4.2.0-next-
|
|
69
|
-
- @walkeros/server-core@4.2.0-next-
|
|
70
|
-
- @walkeros/server-destination-api@4.2.0-next-
|
|
82
|
+
- @walkeros/core@4.2.0-next-1780610489068
|
|
83
|
+
- @walkeros/collector@4.2.0-next-1780610489068
|
|
84
|
+
- @walkeros/server-core@4.2.0-next-1780610489068
|
|
85
|
+
- @walkeros/server-destination-api@4.2.0-next-1780610489068
|
|
71
86
|
|
|
72
87
|
## 4.1.2
|
|
73
88
|
|
package/dist/cli.js
CHANGED
|
@@ -1961,7 +1961,7 @@ function kn(e4) {
|
|
|
1961
1961
|
for (const [e5, i3] of Object.entries(t4)) i3 && "object" == typeof i3 && ("object" === i3.type && i3.properties && "string" != typeof i3.title && (i3.title = e5), kn(i3));
|
|
1962
1962
|
}
|
|
1963
1963
|
}
|
|
1964
|
-
var e3, t3, i2, r3, a3, s4, c, l2, d, p, u2, m2, f, g2, h2, b2, v2, S, y, w2, k, C2, x, D3, P2, j, E, I2, O, J2, z2, L, $, q2, A, N, W, B, U2, V2, H, _2, Z2, G2, K, Q2, X2, Y2, ee2, te2, ie2, ne2, oe2, re, ae, se2, ce2, le3, de3, pe3, ue3, me3, fe3, ge3, he3, be3, ve3, Se3, ye3, we2, ke3, Ce3, xe3, De3, Pe3, je2, Ee2, Ie3, Oe2, Je2, Re3, Me3, Fe3, Te2, ze3, Le3, $e2, qe2, Ae2, Ne3, We3, Be3, Ue3, Ve3, He3, _e2, Ze2, Ge2, Ke3, Qe2, Xe2, Ye2, et2, tt2, it, nt3, ot2, rt3, at2, st3, ct2, lt3, dt2, pt3, ut2, mt3, ft2, gt3, ht2, bt,
|
|
1964
|
+
var e3, t3, i2, r3, a3, s4, c, l2, d, p, u2, m2, f, g2, h2, b2, v2, S, y, w2, k, C2, x, D3, P2, j, E, I2, O, J2, z2, L, $, q2, A, N, W, B, U2, V2, H, _2, Z2, G2, K, Q2, X2, Y2, ee2, te2, ie2, ne2, oe2, re, ae, se2, ce2, le3, de3, pe3, ue3, me3, fe3, ge3, he3, be3, ve3, Se3, ye3, we2, ke3, Ce3, xe3, De3, Pe3, je2, Ee2, Ie3, Oe2, Je2, Re3, Me3, Fe3, Te2, ze3, Le3, $e2, qe2, Ae2, Ne3, We3, Be3, Ue3, Ve3, He3, _e2, Ze2, Ge2, Ke3, Qe2, Xe2, Ye2, et2, tt2, it, nt3, ot2, rt3, at2, st3, ct2, lt3, dt2, pt3, ut2, mt3, ft2, gt3, ht2, bt, vt2, St2, yt2, wt2, kt, Ct2, xt, Dt2, Pt3, jt, Et2, It, Ot3, Jt2, Rt3, Mt3, Ft3, Tt, zt3, Lt2, $t, qt2, At, Nt, Wt2, Bt3, Ut2, Vt2, Ht3, _t2, Zt2, Gt3, Kt2, Qt2, Xt2, Yt2, ei, ti, ii, ni, oi, ri, ai, si, ci, li, di, pi, ui, mi, fi, gi, hi, bi, vi, Si, yi, wi, ki, Ci, xi, Di, ji, Ei, Ii, Oi, Ji, Ri, Mi, Fi, Ti, zi, Li, $i, Bi, Ui, Vi, Hi, _i, Zi, Gi, Ki, Qi, Xi, Yi, tn2, nn2, on2, rn2, sn2, cn2, ln, dn, xn;
|
|
1965
1965
|
var init_dev = __esm({
|
|
1966
1966
|
"../core/dist/dev.mjs"() {
|
|
1967
1967
|
"use strict";
|
|
@@ -2051,7 +2051,7 @@ var init_dev = __esm({
|
|
|
2051
2051
|
Oe2 = o2(ye3);
|
|
2052
2052
|
Je2 = o2(we2);
|
|
2053
2053
|
Re3 = {};
|
|
2054
|
-
t3(Re3, { BatchSchema: () => pt3, ConfigSchema: () => nt3, ContextSchema: () => at2, DLQSchema: () => yt2, DataSchema: () => ut2, DestinationPolicySchema: () => rt3, DestinationsSchema: () => ht2, InitDestinationsSchema: () => gt3, InitSchema: () => ft2, InstanceSchema: () => mt3, PartialConfigSchema: () => ot2, PushBatchContextSchema: () => ct2, PushContextSchema: () => st3, PushEventSchema: () => lt3, PushEventsSchema: () => dt2, PushResultSchema: () =>
|
|
2054
|
+
t3(Re3, { BatchSchema: () => pt3, ConfigSchema: () => nt3, ContextSchema: () => at2, DLQSchema: () => yt2, DataSchema: () => ut2, DestinationPolicySchema: () => rt3, DestinationsSchema: () => ht2, InitDestinationsSchema: () => gt3, InitSchema: () => ft2, InstanceSchema: () => mt3, PartialConfigSchema: () => ot2, PushBatchContextSchema: () => ct2, PushContextSchema: () => st3, PushEventSchema: () => lt3, PushEventsSchema: () => dt2, PushResultSchema: () => vt2, RefSchema: () => bt, ResultSchema: () => St2, batchJsonSchema: () => Dt2, configJsonSchema: () => wt2, contextJsonSchema: () => Ct2, instanceJsonSchema: () => Pt3, partialConfigJsonSchema: () => kt, pushContextJsonSchema: () => xt, resultJsonSchema: () => jt });
|
|
2055
2055
|
Me3 = {};
|
|
2056
2056
|
t3(Me3, { MatchExpressionSchema: () => ze3, RouteSchema: () => We3, RouteWithoutManySchema: () => He3 });
|
|
2057
2057
|
Fe3 = n3.enum(["eq", "contains", "prefix", "suffix", "regex", "gt", "lt", "exists"]).meta({ id: "MatcherOperator", title: "Matcher.Operator", description: "Supported operators for a match condition." });
|
|
@@ -2107,46 +2107,46 @@ var init_dev = __esm({
|
|
|
2107
2107
|
gt3 = n3.record(n3.string(), ft2).meta({ id: "DestinationInitDestinations", title: "Destination.InitDestinations", description: "Map of destination IDs to initialization configurations." }).describe("Map of destination IDs to initialization configurations");
|
|
2108
2108
|
ht2 = n3.record(n3.string(), mt3).meta({ id: "DestinationDestinations", title: "Destination.Destinations", description: "Map of destination IDs to runtime destination instances." }).describe("Map of destination IDs to runtime instances");
|
|
2109
2109
|
bt = n3.object({ type: n3.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: n3.unknown().optional().describe("Response from push()"), error: n3.unknown().optional().describe("Error if failed") }).meta({ id: "DestinationRef", title: "Destination.Ref", description: "Reference to a destination outcome (type + response data or error)." }).describe("Destination reference with type and response data");
|
|
2110
|
-
|
|
2111
|
-
|
|
2110
|
+
vt2 = n3.object({ queue: n3.array(Y2).optional().describe("Events queued (awaiting consent)"), error: n3.unknown().optional().describe("Error if push failed") }).meta({ id: "DestinationPushResult", title: "Destination.PushResult", description: "Result of a single destination push (queued events, optional error)." }).describe("Push operation result");
|
|
2111
|
+
St2 = n3.object({ ok: n3.boolean().describe("True if nothing failed"), event: n3.unknown().optional().describe("The processed event"), done: n3.record(n3.string(), bt).optional().describe("Destinations that processed successfully"), queued: n3.record(n3.string(), bt).optional().describe("Destinations that queued events"), failed: n3.record(n3.string(), bt).optional().describe("Destinations that failed to process") }).meta({ id: "DestinationResult", title: "Destination.Result", description: "Overall push result aggregated across all destinations (done/queued/failed maps)." }).describe("Push result with destination outcomes");
|
|
2112
2112
|
yt2 = n3.array(n3.tuple([Y2, n3.unknown()])).meta({ id: "DestinationDLQ", title: "Destination.DLQ", description: "Dead-letter queue: list of [event, error] tuples." }).describe("Dead letter queue: [(event, error), ...]");
|
|
2113
|
-
|
|
2113
|
+
wt2 = o2(nt3);
|
|
2114
2114
|
kt = o2(ot2);
|
|
2115
2115
|
Ct2 = o2(at2);
|
|
2116
2116
|
xt = o2(st3);
|
|
2117
2117
|
Dt2 = o2(pt3);
|
|
2118
2118
|
Pt3 = o2(mt3);
|
|
2119
|
-
jt = o2(
|
|
2119
|
+
jt = o2(St2);
|
|
2120
2120
|
Et2 = {};
|
|
2121
|
-
t3(Et2, { CommandTypeSchema: () => It, ConfigSchema: () =>
|
|
2121
|
+
t3(Et2, { CommandTypeSchema: () => It, ConfigSchema: () => Ot3, DestinationsSchema: () => Tt, InitConfigSchema: () => Rt3, InstanceSchema: () => zt3, PushContextSchema: () => Mt3, SessionDataSchema: () => Jt2, SourcesSchema: () => Ft3, commandTypeJsonSchema: () => Lt2, configJsonSchema: () => $t, initConfigJsonSchema: () => At, instanceJsonSchema: () => Wt2, pushContextJsonSchema: () => Nt, sessionDataJsonSchema: () => qt2 });
|
|
2122
2122
|
It = n3.union([n3.enum(["action", "config", "consent", "context", "destination", "elb", "globals", "hook", "init", "link", "run", "user", "walker"]), n3.string()]).meta({ id: "CollectorCommandType", title: "Collector.CommandType", description: "Collector command type identifier (standard or extension string)." }).describe("Collector command type: standard commands or custom string for extensions");
|
|
2123
|
-
|
|
2123
|
+
Ot3 = n3.object({ run: n3.boolean().describe("Whether to run collector automatically on initialization").optional(), globalsStatic: V2.describe("Static global properties that persist across collector runs"), sessionStatic: n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorSessionStatic", title: "Collector.SessionStatic", description: "Static session data that persists across collector runs." }).describe("Static session data that persists across collector runs"), logger: it.optional().describe("Logger configuration (level, handler)"), queueMax: n3.number().optional().describe("Maximum events retained in collector.queue (late-registration replay). FIFO drop on overflow. Default 1000.") }).meta({ id: "CollectorConfig", title: "Collector.Config", description: "Core collector configuration (globals/session statics, logger, buffer bounds)." }).describe("Core collector configuration");
|
|
2124
2124
|
Jt2 = V2.and(n3.object({ isStart: n3.boolean().describe("Whether this is a new session start"), storage: n3.boolean().describe("Whether storage is available"), id: c.describe("Session identifier").optional(), start: l2.describe("Session start timestamp").optional(), marketing: n3.literal(true).optional().describe("Marketing attribution flag"), updated: l2.describe("Last update timestamp").optional(), isNew: n3.boolean().describe("Whether this is a new session").optional(), device: c.describe("Device identifier").optional(), count: d.describe("Event count in session").optional(), runs: d.describe("Number of runs").optional() })).meta({ id: "CollectorSessionData", title: "Collector.SessionData", description: "Session state and tracking data." }).describe("Session state and tracking data");
|
|
2125
|
-
Rt3 =
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
zt3 = n3.object({ push: n3.unknown().describe("Push function for processing events"), command: n3.unknown().describe("Command function for walker commands"), allowed: n3.boolean().describe("Whether event processing is allowed"), config:
|
|
2125
|
+
Rt3 = Ot3.partial().extend({ consent: Z2.optional().describe("Initial consent state"), user: G2.optional().describe("Initial user data"), globals: V2.optional().describe("Initial global properties"), sources: n3.unknown().meta({ id: "CollectorInitSources", title: "Source.InitSources", description: "Source configurations map (id \u2192 InitSource)." }).optional().describe("Source configurations"), destinations: n3.unknown().meta({ id: "CollectorInitDestinations", title: "Destination.InitDestinations", description: "Destination configurations map (id \u2192 Init)." }).optional().describe("Destination configurations"), transformers: n3.unknown().meta({ id: "CollectorInitTransformers", title: "Transformer.Configs", description: "Transformer configurations map (id \u2192 Config)." }).optional().describe("Transformer configurations"), stores: n3.unknown().meta({ id: "CollectorInitStores", title: "Store.Configs", description: "Store configurations map (id \u2192 Config)." }).optional().describe("Store configurations"), custom: V2.optional().describe("Initial custom implementation-specific properties"), hooks: n3.unknown().meta({ id: "CollectorHooks", title: "Collector.Hooks", description: "Pipeline observation hooks." }).optional().describe("Pipeline observation hooks") }).meta({ id: "CollectorInitConfig", title: "Collector.InitConfig", description: "Collector initialization configuration with initial state (consent, user, globals, components, hooks)." }).describe("Collector initialization configuration with initial state");
|
|
2126
|
+
Mt3 = n3.object({ mapping: we2.optional().describe("Source-level mapping configuration") }).meta({ id: "CollectorPushContext", title: "Collector.PushContext", description: "Push context with optional source-level mapping." }).describe("Push context with optional source mapping");
|
|
2127
|
+
Ft3 = n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorSources", title: "Collector.Sources", description: "Map of source IDs to runtime source instances." }).describe("Map of source IDs to source instances");
|
|
2128
|
+
Tt = n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorDestinations", title: "Collector.Destinations", description: "Map of destination IDs to runtime destination instances." }).describe("Map of destination IDs to destination instances");
|
|
2129
|
+
zt3 = n3.object({ push: n3.unknown().describe("Push function for processing events"), command: n3.unknown().describe("Command function for walker commands"), allowed: n3.boolean().describe("Whether event processing is allowed"), config: Ot3.describe("Current collector configuration"), consent: Z2.describe("Current consent state"), custom: V2.describe("Custom implementation-specific properties"), sources: Ft3.describe("Registered source instances"), destinations: Tt.describe("Registered destination instances"), globals: V2.describe("Current global properties"), hooks: n3.unknown().describe("Lifecycle hook functions"), on: n3.unknown().describe("Event lifecycle configuration"), queue: n3.array(Y2).describe("Queued events awaiting processing"), round: n3.number().describe("Collector run count (increments with each run)"), session: n3.union([Jt2]).describe("Current session state"), timing: n3.number().describe("Event processing timing information"), user: G2.describe("Current user data") }).meta({ id: "CollectorInstance", title: "Collector.Instance", description: "Collector instance (runtime object with push/command + full state and component maps)." }).describe("Collector instance with state and methods");
|
|
2130
2130
|
Lt2 = o2(It);
|
|
2131
|
-
$
|
|
2131
|
+
$t = o2(Ot3);
|
|
2132
2132
|
qt2 = o2(Jt2);
|
|
2133
2133
|
At = o2(Rt3);
|
|
2134
|
-
Nt = o2(
|
|
2134
|
+
Nt = o2(Mt3);
|
|
2135
2135
|
Wt2 = o2(zt3);
|
|
2136
2136
|
Bt3 = {};
|
|
2137
|
-
t3(Bt3, { BaseEnvSchema: () => Ut2, ConfigSchema: () => Vt2, InitSchema: () => Zt2, InitSourceSchema: () =>
|
|
2137
|
+
t3(Bt3, { BaseEnvSchema: () => Ut2, ConfigSchema: () => Vt2, InitSchema: () => Zt2, InitSourceSchema: () => Gt3, InitSourcesSchema: () => Kt2, InstanceSchema: () => _t2, PartialConfigSchema: () => Ht3, baseEnvJsonSchema: () => Qt2, configJsonSchema: () => Xt2, initSourceJsonSchema: () => ti, initSourcesJsonSchema: () => ii, instanceJsonSchema: () => ei, partialConfigJsonSchema: () => Yt2 });
|
|
2138
2138
|
Ut2 = n3.object({ push: n3.unknown().meta({ id: "SourcePushFn", title: "Source.PushFn", description: "Collector push function passed to the source via dependency injection." }).describe("Collector push function"), command: n3.unknown().meta({ id: "SourceCommandFn", title: "Source.CommandFn", description: "Collector command function passed to the source." }).describe("Collector command function"), sources: n3.unknown().optional().describe("Map of registered source instances"), elb: n3.unknown().meta({ id: "ElbFn", title: "Elb.Fn", description: "Public `elb(...)` API function alias for collector.push." }).describe("Public API function (alias for collector.push)") }).catchall(n3.unknown()).meta({ id: "SourceBaseEnv", title: "Source.BaseEnv", description: "Base environment for source dependency injection; platform-specific sources extend this." }).describe("Base environment for dependency injection - platform-specific sources extend this");
|
|
2139
2139
|
Vt2 = we2.extend({ settings: n3.any().meta({ id: "SourceSettings", title: "Source.Settings", description: "Implementation-specific configuration (source-defined shape)." }).describe("Implementation-specific configuration").optional(), env: Ut2.optional().describe("Environment dependencies (platform-specific)"), id: c.describe("Source identifier (defaults to source key)").optional(), primary: n3.boolean().describe("Mark as primary (only one can be primary)").optional(), require: n3.array(n3.string()).optional().describe('Defer source initialization until these collector events fire (e.g., ["consent"])'), logger: it.optional().describe("Logger configuration (level, handler) to override the collector defaults"), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during source registration (boolean enables defaults, object configures specifics)"), ingest: n3.union([pe3, ue3]).optional().describe("Ingest metadata extraction mapping. Extracts values from raw request objects (Express req, Lambda event) using mapping syntax."), disabled: n3.boolean().describe("Completely skip this source (no init, no event capture)").optional(), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), init: n3.boolean().optional().describe("Init lifecycle flag set by collector to true after Instance.init() runs") }).meta({ id: "SourceConfig", title: "Source.Config", description: "Source configuration with mapping, environment, and lifecycle hooks." }).describe("Source configuration with mapping and environment");
|
|
2140
2140
|
Ht3 = Vt2.partial().meta({ id: "SourcePartialConfig", title: "Source.PartialConfig", description: "Partial source configuration with all fields optional." }).describe("Partial source configuration with all fields optional");
|
|
2141
|
-
|
|
2141
|
+
_t2 = n3.object({ type: n3.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: Vt2.describe("Current source configuration"), push: n3.any().meta({ id: "SourceInstancePushFn", title: "Source.PushFn", description: "Push function \u2014 THE HANDLER (flexible signature for platform compatibility)." }).describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: n3.any().meta({ id: "SourceDestroyFn", title: "Source.DestroyFn", description: "Cleanup function called when the source is removed." }).optional().describe("Cleanup function called when source is removed"), on: n3.unknown().optional().describe("Lifecycle hook function for event types") }).meta({ id: "SourceInstance", title: "Source.Instance", description: "Source instance (runtime object with push handler and lifecycle methods)." }).describe("Source instance with push handler and lifecycle methods");
|
|
2142
2142
|
Zt2 = n3.any().meta({ id: "SourceInit", title: "Source.Init", description: "Source initialization function: (config, env) => Instance | Promise<Instance>." }).describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
|
|
2143
|
-
|
|
2144
|
-
Kt2 = n3.record(n3.string(),
|
|
2143
|
+
Gt3 = n3.object({ code: Zt2.describe("Source initialization function"), config: Ht3.optional().describe("Partial configuration overrides"), env: Ut2.partial().optional().describe("Partial environment overrides"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), primary: n3.boolean().optional().describe("Mark as primary source (only one can be primary)") }).meta({ id: "SourceInitSource", title: "Source.InitSource", description: "Source initialization bundle (init function + config + env + primary flag)." }).describe("Source initialization configuration");
|
|
2144
|
+
Kt2 = n3.record(n3.string(), Gt3).meta({ id: "SourceInitSources", title: "Source.InitSources", description: "Map of source IDs to initialization configurations." }).describe("Map of source IDs to initialization configurations");
|
|
2145
2145
|
Qt2 = o2(Ut2);
|
|
2146
2146
|
Xt2 = o2(Vt2);
|
|
2147
2147
|
Yt2 = o2(Ht3);
|
|
2148
|
-
ei = o2(
|
|
2149
|
-
ti = o2(
|
|
2148
|
+
ei = o2(_t2);
|
|
2149
|
+
ti = o2(Gt3);
|
|
2150
2150
|
ii = o2(Kt2);
|
|
2151
2151
|
ni = {};
|
|
2152
2152
|
t3(ni, { ConfigSchema: () => oi, PartialConfigSchema: () => ri, configJsonSchema: () => ai, partialConfigJsonSchema: () => si });
|
|
@@ -3714,9 +3714,7 @@ async function bundleCore(flowSettings, buildOptions, logger, showStats = false)
|
|
|
3714
3714
|
if (showStats) {
|
|
3715
3715
|
const packageStats = Object.entries(buildOptions.packages).map(
|
|
3716
3716
|
([name, pkg]) => ({
|
|
3717
|
-
name: `${name}@${pkg.version || "latest"}
|
|
3718
|
-
size: 0
|
|
3719
|
-
// Size estimation not available for cached builds
|
|
3717
|
+
name: `${name}@${pkg.version || "latest"}`
|
|
3720
3718
|
})
|
|
3721
3719
|
);
|
|
3722
3720
|
const hasWildcardImports = /import\s+\*\s+as\s+\w+\s+from/.test(
|
|
@@ -3914,20 +3912,9 @@ async function collectBundleStats(outputPath, packages, startTime, entryContent)
|
|
|
3914
3912
|
const stats = await fs11.stat(outputPath);
|
|
3915
3913
|
const totalSize = stats.size;
|
|
3916
3914
|
const buildTime = Date.now() - startTime;
|
|
3917
|
-
const packageStats = Object.entries(packages).map(([name, pkg]) => {
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
`import\\s+\\{[^}]*\\}\\s+from\\s+['"]${name}['"]`,
|
|
3921
|
-
"g"
|
|
3922
|
-
);
|
|
3923
|
-
const hasImports = importPattern.test(entryContent) || namedImportPattern.test(entryContent);
|
|
3924
|
-
const packagesCount = Object.keys(packages).length;
|
|
3925
|
-
const estimatedSize = hasImports ? Math.floor(totalSize / packagesCount) : 0;
|
|
3926
|
-
return {
|
|
3927
|
-
name: `${name}@${pkg.version || "latest"}`,
|
|
3928
|
-
size: estimatedSize
|
|
3929
|
-
};
|
|
3930
|
-
});
|
|
3915
|
+
const packageStats = Object.entries(packages).map(([name, pkg]) => ({
|
|
3916
|
+
name: `${name}@${pkg.version || "latest"}`
|
|
3917
|
+
}));
|
|
3931
3918
|
const hasWildcardImports = /import\s+\*\s+as\s+\w+\s+from/.test(entryContent);
|
|
3932
3919
|
const treeshakingEffective = !hasWildcardImports;
|
|
3933
3920
|
return {
|
|
@@ -4730,12 +4717,9 @@ function displayStats(stats, logger) {
|
|
|
4730
4717
|
logger.info(`Tree-shaking: ${treeshakingStatus}`);
|
|
4731
4718
|
if (stats.packages.length > 0) {
|
|
4732
4719
|
logger.info(`
|
|
4733
|
-
|
|
4720
|
+
Packages:`);
|
|
4734
4721
|
stats.packages.forEach((pkg) => {
|
|
4735
|
-
|
|
4736
|
-
const pkgSizeKB = formatBytes(pkg.size);
|
|
4737
|
-
logger.info(` \u2022 ${pkg.name}: ${pkgSizeKB} KB`);
|
|
4738
|
-
}
|
|
4722
|
+
logger.info(` \u2022 ${pkg.name}`);
|
|
4739
4723
|
});
|
|
4740
4724
|
}
|
|
4741
4725
|
logger.info("\u2500".repeat(50));
|
|
@@ -6480,7 +6464,7 @@ async function mt2(e4, t4, o3) {
|
|
|
6480
6464
|
i3 = true;
|
|
6481
6465
|
break;
|
|
6482
6466
|
case n.Commands.Run:
|
|
6483
|
-
r4 = await
|
|
6467
|
+
r4 = await vt(e4, o3), i3 = true;
|
|
6484
6468
|
break;
|
|
6485
6469
|
case n.Commands.Session:
|
|
6486
6470
|
i3 = true;
|
|
@@ -6499,19 +6483,25 @@ async function mt2(e4, t4, o3) {
|
|
|
6499
6483
|
}
|
|
6500
6484
|
}
|
|
6501
6485
|
function ht(e4, t4) {
|
|
6486
|
+
return { timing: Math.round((Date.now() - e4.timing) / 10) / 100, source: { type: "collector", schema: "4", version: "4.2.0-next-1780610489068" }, ...t4 };
|
|
6487
|
+
}
|
|
6488
|
+
function yt(e4, t4) {
|
|
6502
6489
|
if (!t4.name) throw new Error("Event name is required");
|
|
6503
6490
|
const [n4, o3] = t4.name.split(" ");
|
|
6504
6491
|
if (!n4 || !o3) throw new Error("Event name is invalid");
|
|
6505
6492
|
const { timestamp: s5 = Date.now(), name: r4 = `${n4} ${o3}`, data: a4 = {}, context: i3 = {}, globals: c2 = e4.globals, custom: u3 = {}, user: d2 = e4.user, nested: l3 = [], consent: f2 = e4.consent, id: p2 = xe(), trigger: g3 = "", entity: m3 = n4, action: h3 = o3, timing: y2 = 0, source: w3 = { type: "collector", schema: "4" } } = t4;
|
|
6506
6493
|
return { name: r4, data: a4, context: i3, globals: c2, custom: u3, user: d2, nested: l3, consent: f2, id: p2, trigger: g3, entity: m3, action: h3, timestamp: s5, timing: y2, source: w3 };
|
|
6507
6494
|
}
|
|
6508
|
-
|
|
6495
|
+
function wt(e4, t4) {
|
|
6496
|
+
return yt(e4, ht(e4, t4));
|
|
6497
|
+
}
|
|
6498
|
+
async function vt(e4, t4) {
|
|
6509
6499
|
e4.allowed = true, e4.timing = Date.now(), t4 && (t4.consent && (e4.consent = ne(e4.consent, t4.consent), gt2(e4, n.Commands.Consent)), t4.user && (e4.user = ne(e4.user, t4.user), gt2(e4, n.Commands.User)), t4.globals && (e4.globals = ne(e4.config.globalsStatic || {}, t4.globals), gt2(e4, n.Commands.Globals)), t4.custom && (e4.custom = ne(e4.custom, t4.custom), gt2(e4, n.Commands.Custom))), Object.values(e4.destinations).forEach((e5) => {
|
|
6510
6500
|
e5.queuePush = [];
|
|
6511
6501
|
}), e4.queue = [], e4.round++, await Ie2(e4), await Re2(e4);
|
|
6512
6502
|
return await Ze(e4);
|
|
6513
6503
|
}
|
|
6514
|
-
function
|
|
6504
|
+
function Ot2(e4, t4) {
|
|
6515
6505
|
const n4 = at(async (n5, o3 = {}) => await Be(async () => {
|
|
6516
6506
|
const s5 = Date.now(), { id: r4, ingest: a4, respond: i3, mapping: c2, preChain: u3, include: d2, exclude: l3 } = o3;
|
|
6517
6507
|
let f2 = i3, p2 = n5;
|
|
@@ -6533,7 +6523,7 @@ function St2(e4, t4) {
|
|
|
6533
6523
|
if (n6.stopped) return n6.respond && (f2 = n6.respond), nt2({ ok: true });
|
|
6534
6524
|
if (n6.respond && (f2 = n6.respond), Array.isArray(n6.event)) {
|
|
6535
6525
|
const o4 = await Promise.all(n6.event.map(async (n7) => {
|
|
6536
|
-
const o5 = t4(n7), s6 =
|
|
6526
|
+
const o5 = t4(n7), s6 = yt(e4, o5);
|
|
6537
6527
|
return Ze(e4, s6, { id: r4, ingest: m3, respond: f2 }, g3);
|
|
6538
6528
|
}));
|
|
6539
6529
|
if (r4) {
|
|
@@ -6545,13 +6535,13 @@ function St2(e4, t4) {
|
|
|
6545
6535
|
}
|
|
6546
6536
|
p2 = n6.event;
|
|
6547
6537
|
}
|
|
6548
|
-
const h3 =
|
|
6538
|
+
const h3 = wt(e4, p2), y2 = await Ze(e4, h3, { id: r4, ingest: m3, respond: f2 }, g3);
|
|
6549
6539
|
if (r4) {
|
|
6550
6540
|
e4.status.sources[r4] || (e4.status.sources[r4] = { count: 0, duration: 0 });
|
|
6551
6541
|
const t5 = e4.status.sources[r4];
|
|
6552
6542
|
t5.count++, t5.lastAt = Date.now(), t5.duration += Date.now() - s5;
|
|
6553
6543
|
}
|
|
6554
|
-
return
|
|
6544
|
+
return y2;
|
|
6555
6545
|
}, (t5) => {
|
|
6556
6546
|
if (t5 instanceof We) throw t5;
|
|
6557
6547
|
return e4.status.failed++, e4.logger.error("push failed", { event: n5, ingest: o3.ingest, error: t5 }), nt2({ ok: false });
|
|
@@ -6568,7 +6558,7 @@ function St2(e4, t4) {
|
|
|
6568
6558
|
}
|
|
6569
6559
|
};
|
|
6570
6560
|
}
|
|
6571
|
-
function
|
|
6561
|
+
function Mt2(e4 = {}) {
|
|
6572
6562
|
const t4 = e4.maxEntries ?? 1e4, n4 = e4.lowWaterMark ?? 0.8, o3 = e4.sweepIntervalMs ?? 6e4, s5 = Math.floor(t4 * n4), r4 = /* @__PURE__ */ new Map(), a4 = { hits: 0, misses: 0, populates: 0, writes: 0, deletes: 0, evictions_entries: 0, evictions_ttl: 0 };
|
|
6573
6563
|
let i3;
|
|
6574
6564
|
o3 > 0 && (i3 = setInterval(function() {
|
|
@@ -6601,7 +6591,7 @@ function $t(e4 = {}) {
|
|
|
6601
6591
|
void 0 !== i3 && (clearInterval(i3), i3 = void 0), r4.clear();
|
|
6602
6592
|
} };
|
|
6603
6593
|
}
|
|
6604
|
-
function
|
|
6594
|
+
function Pt2(e4, t4) {
|
|
6605
6595
|
const { cacheConfig: n4, cacheStore: o3, namespace: s5, logger: r4, storeId: a4, collector: i3 } = t4, c2 = (e5, t5) => {
|
|
6606
6596
|
if (!i3) return;
|
|
6607
6597
|
const n5 = D2(i3, { stepId: `store.${a4}`, stepType: "store", phase: "in", eventId: "", now: Date.now() });
|
|
@@ -6657,7 +6647,7 @@ function Tt(e4, t4) {
|
|
|
6657
6647
|
r4 ? r4.warn(o4, { error: n5 }) : console.warn(o4, n5);
|
|
6658
6648
|
}
|
|
6659
6649
|
}
|
|
6660
|
-
function
|
|
6650
|
+
function zt2(e4, t4, n4) {
|
|
6661
6651
|
const o3 = `store.${n4}`, s5 = at(t4.get, "StoreGet", e4.hooks, e4.logger), r4 = at(t4.set, "StoreSet", e4.hooks, e4.logger), a4 = at(t4.delete, "StoreDelete", e4.hooks, e4.logger);
|
|
6662
6652
|
t4.get = async (t5) => {
|
|
6663
6653
|
const n5 = Date.now(), r5 = D2(e4, { stepId: o3, stepType: "store", phase: "in", eventId: "", now: n5 });
|
|
@@ -6693,7 +6683,7 @@ function _t2(e4, t4, n4) {
|
|
|
6693
6683
|
}
|
|
6694
6684
|
};
|
|
6695
6685
|
}
|
|
6696
|
-
async function
|
|
6686
|
+
async function Bt2(e4, t4 = {}) {
|
|
6697
6687
|
const n4 = {};
|
|
6698
6688
|
for (const [o4, s6] of Object.entries(t4)) {
|
|
6699
6689
|
const { code: t5, config: r4 = {}, env: a4 = {} } = s6, i3 = e4.logger.scope("store").scope(o4), c2 = { collector: e4, logger: i3, id: o4, config: r4, env: a4 }, u3 = await t5(c2);
|
|
@@ -6725,23 +6715,23 @@ async function Pt2(e4, t4 = {}) {
|
|
|
6725
6715
|
const s6 = o3[t5].cache;
|
|
6726
6716
|
if (!s6) continue;
|
|
6727
6717
|
let r4, a4;
|
|
6728
|
-
void 0 !== s6.store ? (r4 = n4[s6.store], a4 = s6.store) : (n4.__cache || (n4.__cache =
|
|
6718
|
+
void 0 !== s6.store ? (r4 = n4[s6.store], a4 = s6.store) : (n4.__cache || (n4.__cache = Mt2()), r4 = n4.__cache, a4 = "__cache");
|
|
6729
6719
|
const i3 = s6.namespace ?? t5;
|
|
6730
|
-
e4.logger.scope("store-cache").scope(t5).info(`store "${t5}" caches with namespace "${i3}:" via ${a4}`), n4[t5] =
|
|
6720
|
+
e4.logger.scope("store-cache").scope(t5).info(`store "${t5}" caches with namespace "${i3}:" via ${a4}`), n4[t5] = Pt2(n4[t5], { storeId: t5, cacheConfig: s6, cacheStore: r4, namespace: i3, logger: e4.logger.scope("store-cache").scope(t5), collector: e4 });
|
|
6731
6721
|
}
|
|
6732
|
-
for (const [t5, o4] of Object.entries(n4)) "__cache" !== t5 &&
|
|
6722
|
+
for (const [t5, o4] of Object.entries(n4)) "__cache" !== t5 && zt2(e4, o4, t5);
|
|
6733
6723
|
return n4;
|
|
6734
6724
|
}
|
|
6735
|
-
async function
|
|
6725
|
+
async function Ht2(e4) {
|
|
6736
6726
|
const t4 = ne({ globalsStatic: {}, sessionStatic: {}, run: true, queueMax: 1e3 }, e4, { merge: false, extend: false }), n4 = { level: e4.logger?.level, handler: e4.logger?.handler }, o3 = Me(n4), s5 = { ...t4.globalsStatic, ...e4.globals }, i3 = { allowed: false, config: t4, consent: e4.consent || {}, custom: e4.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s5, hooks: e4.hooks || {}, observers: /* @__PURE__ */ new Set(), logger: o3, on: {}, queue: [], round: 0, stateVersion: 0, cellVersion: {}, delivery: /* @__PURE__ */ new WeakMap(), session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {}, dropped: {} }, timing: Date.now(), user: e4.user || {}, sources: {}, pending: { destinations: {} }, hasShutdown: false, seenEvents: /* @__PURE__ */ new Set(), push: void 0, command: void 0 };
|
|
6737
|
-
i3.push =
|
|
6727
|
+
i3.push = Ot2(i3, (e5) => ht(i3, e5)), i3.command = (function(e5, t5) {
|
|
6738
6728
|
return at(async (n5, o4, s6) => await Be(async () => await t5(e5, n5, o4, s6), (t6) => {
|
|
6739
6729
|
if (t6 instanceof We) throw t6;
|
|
6740
6730
|
return e5.status.failed++, e5.logger.error("command failed", { command: n5, data: o4, error: t6 }), nt2({ ok: false });
|
|
6741
6731
|
})(), "Command", e5.hooks, e5.logger);
|
|
6742
6732
|
})(i3, mt2);
|
|
6743
6733
|
const c2 = e4.stores || {};
|
|
6744
|
-
return i3.stores = await
|
|
6734
|
+
return i3.stores = await Bt2(i3, c2), (function(e5, t5, n5) {
|
|
6745
6735
|
const o4 = /* @__PURE__ */ new Map();
|
|
6746
6736
|
for (const [n6, s7] of Object.entries(e5)) t5[n6] && o4.set(s7, t5[n6]);
|
|
6747
6737
|
if (0 !== o4.size) {
|
|
@@ -6755,7 +6745,7 @@ async function zt2(e4) {
|
|
|
6755
6745
|
}
|
|
6756
6746
|
}
|
|
6757
6747
|
}
|
|
6758
|
-
})(c2, i3.stores, e4), i3.stores.__cache || (i3.stores.__cache =
|
|
6748
|
+
})(c2, i3.stores, e4), i3.stores.__cache || (i3.stores.__cache = Mt2()), i3.destinations = await st2(i3, e4.destinations || {}), i3.transformers = await (async function(e5, t5 = {}) {
|
|
6759
6749
|
const n5 = {};
|
|
6760
6750
|
for (const [o4, s6] of Object.entries(t5)) {
|
|
6761
6751
|
const { code: t6, env: r4 = {} } = s6, a4 = sn(s6, "Transformer");
|
|
@@ -6786,9 +6776,9 @@ async function zt2(e4) {
|
|
|
6786
6776
|
return n5;
|
|
6787
6777
|
})(i3, e4.transformers || {}), i3;
|
|
6788
6778
|
}
|
|
6789
|
-
async function
|
|
6779
|
+
async function Rt2(e4) {
|
|
6790
6780
|
e4 = e4 || {};
|
|
6791
|
-
const t4 = await
|
|
6781
|
+
const t4 = await Ht2(e4), n4 = (o3 = t4, { type: "elb", config: {}, push: async (e5, t5, n5, s6, r5) => {
|
|
6792
6782
|
if ("string" == typeof e5 && e5.startsWith("walker ")) {
|
|
6793
6783
|
const n6 = e5.replace("walker ", "");
|
|
6794
6784
|
return o3.command(n6, t5);
|
|
@@ -6809,15 +6799,15 @@ async function Bt2(e4) {
|
|
|
6809
6799
|
const u3 = Object.values(t4.sources).filter((e5) => "elb" !== e5.type), d2 = u3.find((e5) => e5.config.primary);
|
|
6810
6800
|
return d2 ? c2 = d2.push : u3.length > 0 && (c2 = u3[0].push), { collector: t4, elb: c2 };
|
|
6811
6801
|
}
|
|
6812
|
-
function
|
|
6802
|
+
function Ft2(e4) {
|
|
6813
6803
|
if (null === e4 || "object" != typeof e4) return e4;
|
|
6814
|
-
if (Array.isArray(e4)) return e4.map(
|
|
6804
|
+
if (Array.isArray(e4)) return e4.map(Ft2);
|
|
6815
6805
|
const t4 = {};
|
|
6816
|
-
for (const [n4, o3] of Object.entries(e4)) t4[n4] = "function" == typeof o3 ? o3 :
|
|
6806
|
+
for (const [n4, o3] of Object.entries(e4)) t4[n4] = "function" == typeof o3 ? o3 : Ft2(o3);
|
|
6817
6807
|
return t4;
|
|
6818
6808
|
}
|
|
6819
|
-
function
|
|
6820
|
-
const t4 = [], { simulation: n4, ...o3 } = e4, s5 =
|
|
6809
|
+
function Gt2(e4) {
|
|
6810
|
+
const t4 = [], { simulation: n4, ...o3 } = e4, s5 = Ft2(o3);
|
|
6821
6811
|
for (const e5 of n4) {
|
|
6822
6812
|
const n5 = e5.startsWith("call:") ? e5.slice(5) : e5, o4 = n5.split(".");
|
|
6823
6813
|
let r4 = s5;
|
|
@@ -6970,7 +6960,7 @@ async function createEmitter(opts) {
|
|
|
6970
6960
|
}
|
|
6971
6961
|
}
|
|
6972
6962
|
};
|
|
6973
|
-
const { elb } = await
|
|
6963
|
+
const { elb } = await Rt2(collectorConfig);
|
|
6974
6964
|
elbFn = elb;
|
|
6975
6965
|
return elbFn;
|
|
6976
6966
|
}
|
|
@@ -7045,7 +7035,12 @@ init_bundler();
|
|
|
7045
7035
|
|
|
7046
7036
|
// src/commands/push/overrides.ts
|
|
7047
7037
|
init_parse_component_ref();
|
|
7048
|
-
var STEP_KINDS = [
|
|
7038
|
+
var STEP_KINDS = [
|
|
7039
|
+
"source",
|
|
7040
|
+
"destination",
|
|
7041
|
+
"transformer",
|
|
7042
|
+
"collector"
|
|
7043
|
+
];
|
|
7049
7044
|
function buildOverrides(flags, flowConfig) {
|
|
7050
7045
|
const simulateFlags = flags.simulate ?? [];
|
|
7051
7046
|
const mockFlags = flags.mock ?? [];
|
|
@@ -7058,7 +7053,9 @@ function buildOverrides(flags, flowConfig) {
|
|
|
7058
7053
|
const overrides = {};
|
|
7059
7054
|
for (const step of simulateFlags) {
|
|
7060
7055
|
const { type, name } = parseStep(step);
|
|
7061
|
-
if (type === "
|
|
7056
|
+
if (type === "collector") {
|
|
7057
|
+
continue;
|
|
7058
|
+
} else if (type === "destination") {
|
|
7062
7059
|
simulateNames.add(name);
|
|
7063
7060
|
if (!overrides.destinations) overrides.destinations = {};
|
|
7064
7061
|
overrides.destinations[name] = { simulate: true };
|
|
@@ -7631,7 +7628,7 @@ function planSimulate(flags) {
|
|
|
7631
7628
|
}
|
|
7632
7629
|
const [type] = types;
|
|
7633
7630
|
const ids = [...new Set(parsed.map((p2) => p2.name))];
|
|
7634
|
-
if ((type === "source" || type === "transformer") && ids.length > 1) {
|
|
7631
|
+
if ((type === "source" || type === "transformer" || type === "collector") && ids.length > 1) {
|
|
7635
7632
|
throw new Error(
|
|
7636
7633
|
`--simulate ${type}.* expects a single target; got ${ids.length}. Run one --simulate ${type}.NAME per invocation.`
|
|
7637
7634
|
);
|
|
@@ -7704,6 +7701,22 @@ async function runPushCommand(options) {
|
|
|
7704
7701
|
transformerId: plan.ids[0],
|
|
7705
7702
|
flow: options.flow,
|
|
7706
7703
|
mock: options.mock,
|
|
7704
|
+
ingest: options.ingest,
|
|
7705
|
+
silent: options.silent,
|
|
7706
|
+
verbose: options.verbose,
|
|
7707
|
+
snapshot: options.snapshot
|
|
7708
|
+
}
|
|
7709
|
+
)
|
|
7710
|
+
);
|
|
7711
|
+
break;
|
|
7712
|
+
case "collector":
|
|
7713
|
+
result = simulationToPushResult(
|
|
7714
|
+
await simulateCollector(
|
|
7715
|
+
config,
|
|
7716
|
+
resolvedEvent,
|
|
7717
|
+
{
|
|
7718
|
+
collectorName: plan.ids[0],
|
|
7719
|
+
flow: options.flow,
|
|
7707
7720
|
silent: options.silent,
|
|
7708
7721
|
verbose: options.verbose,
|
|
7709
7722
|
snapshot: options.snapshot
|
|
@@ -8248,7 +8261,10 @@ async function simulateTransformer(configOrPath, event, options) {
|
|
|
8248
8261
|
);
|
|
8249
8262
|
}
|
|
8250
8263
|
const inputEvent = event;
|
|
8251
|
-
const ingest =
|
|
8264
|
+
const ingest = {
|
|
8265
|
+
..._(options.transformerId),
|
|
8266
|
+
...options.ingest
|
|
8267
|
+
};
|
|
8252
8268
|
const captured = [];
|
|
8253
8269
|
logger.info(`Simulating transformer: ${options.transformerId}`);
|
|
8254
8270
|
let processedEvent = inputEvent;
|
|
@@ -8330,6 +8346,108 @@ async function simulateTransformer(configOrPath, event, options) {
|
|
|
8330
8346
|
await prepared.cleanup();
|
|
8331
8347
|
}
|
|
8332
8348
|
}
|
|
8349
|
+
async function simulateCollector(configOrPath, event, options) {
|
|
8350
|
+
const startTime = Date.now();
|
|
8351
|
+
const parsed = i2.PartialEventSchema.safeParse(event);
|
|
8352
|
+
if (!parsed.success) {
|
|
8353
|
+
return buildSimulationResult({
|
|
8354
|
+
step: "collector",
|
|
8355
|
+
name: options.collectorName,
|
|
8356
|
+
startTime,
|
|
8357
|
+
error: parsed.error.message
|
|
8358
|
+
});
|
|
8359
|
+
}
|
|
8360
|
+
let config;
|
|
8361
|
+
if (typeof configOrPath === "string") {
|
|
8362
|
+
config = await loadJsonConfig(configOrPath);
|
|
8363
|
+
} else {
|
|
8364
|
+
config = configOrPath;
|
|
8365
|
+
}
|
|
8366
|
+
const prepareInput = options.bundlePath ? {
|
|
8367
|
+
mode: "prebuilt",
|
|
8368
|
+
bundlePath: options.bundlePath,
|
|
8369
|
+
config,
|
|
8370
|
+
flow: options.flow,
|
|
8371
|
+
simulate: ["collector." + options.collectorName],
|
|
8372
|
+
silent: options.silent,
|
|
8373
|
+
verbose: options.verbose
|
|
8374
|
+
} : {
|
|
8375
|
+
mode: "build",
|
|
8376
|
+
config,
|
|
8377
|
+
flow: options.flow,
|
|
8378
|
+
simulate: ["collector." + options.collectorName],
|
|
8379
|
+
silent: options.silent,
|
|
8380
|
+
verbose: options.verbose
|
|
8381
|
+
};
|
|
8382
|
+
const prepared = await prepareFlow(prepareInput);
|
|
8383
|
+
try {
|
|
8384
|
+
const logger = createCLILogger({
|
|
8385
|
+
silent: options.silent,
|
|
8386
|
+
verbose: options.verbose
|
|
8387
|
+
});
|
|
8388
|
+
let snapshotCode;
|
|
8389
|
+
if (options.snapshot) {
|
|
8390
|
+
snapshotCode = await loadConfig(options.snapshot, {
|
|
8391
|
+
json: false
|
|
8392
|
+
});
|
|
8393
|
+
logger.debug(`Snapshot loaded (${snapshotCode.length} bytes)`);
|
|
8394
|
+
}
|
|
8395
|
+
const networkCalls = [];
|
|
8396
|
+
return await withFlowContext(
|
|
8397
|
+
{
|
|
8398
|
+
esmPath: prepared.bundlePath,
|
|
8399
|
+
platform: prepared.platform,
|
|
8400
|
+
logger,
|
|
8401
|
+
snapshotCode,
|
|
8402
|
+
networkCalls
|
|
8403
|
+
},
|
|
8404
|
+
async (module) => {
|
|
8405
|
+
const flowConfig = module.wireConfig(module.__configData ?? void 0);
|
|
8406
|
+
applyOverrides(flowConfig, prepared.overrides);
|
|
8407
|
+
if (flowConfig.sources) flowConfig.sources = {};
|
|
8408
|
+
if (flowConfig.destinations) flowConfig.destinations = {};
|
|
8409
|
+
const result = await module.startFlow(flowConfig);
|
|
8410
|
+
if (!result?.collector)
|
|
8411
|
+
throw new Error("Invalid bundle: collector not available");
|
|
8412
|
+
const collector = result.collector;
|
|
8413
|
+
if (options.state) {
|
|
8414
|
+
if (options.state.consent !== void 0)
|
|
8415
|
+
collector.consent = options.state.consent;
|
|
8416
|
+
if (options.state.user !== void 0)
|
|
8417
|
+
collector.user = options.state.user;
|
|
8418
|
+
if (options.state.globals !== void 0)
|
|
8419
|
+
collector.globals = options.state.globals;
|
|
8420
|
+
if (options.state.timing !== void 0)
|
|
8421
|
+
collector.timing = options.state.timing;
|
|
8422
|
+
}
|
|
8423
|
+
const enriched = wt(collector, event);
|
|
8424
|
+
const captured = [{ event: enriched, timestamp: Date.now() }];
|
|
8425
|
+
await collector.command("shutdown");
|
|
8426
|
+
return buildSimulationResult({
|
|
8427
|
+
step: "collector",
|
|
8428
|
+
name: options.collectorName,
|
|
8429
|
+
startTime,
|
|
8430
|
+
captured
|
|
8431
|
+
});
|
|
8432
|
+
},
|
|
8433
|
+
(error) => buildSimulationResult({
|
|
8434
|
+
step: "collector",
|
|
8435
|
+
name: options.collectorName,
|
|
8436
|
+
startTime,
|
|
8437
|
+
error
|
|
8438
|
+
})
|
|
8439
|
+
);
|
|
8440
|
+
} catch (error) {
|
|
8441
|
+
return buildSimulationResult({
|
|
8442
|
+
step: "collector",
|
|
8443
|
+
name: options.collectorName,
|
|
8444
|
+
startTime,
|
|
8445
|
+
error
|
|
8446
|
+
});
|
|
8447
|
+
} finally {
|
|
8448
|
+
await prepared.cleanup();
|
|
8449
|
+
}
|
|
8450
|
+
}
|
|
8333
8451
|
async function simulateDestination(configOrPath, event, options) {
|
|
8334
8452
|
const startTime = Date.now();
|
|
8335
8453
|
const parsed = i2.PartialEventSchema.safeParse(event);
|
|
@@ -8406,7 +8524,7 @@ async function simulateDestination(configOrPath, event, options) {
|
|
|
8406
8524
|
...devEnv.push,
|
|
8407
8525
|
simulation: devEnv.simulation
|
|
8408
8526
|
};
|
|
8409
|
-
const { wrappedEnv, calls } =
|
|
8527
|
+
const { wrappedEnv, calls } = Gt2(combined);
|
|
8410
8528
|
if (destConfig) destConfig.env = wrappedEnv;
|
|
8411
8529
|
trackedCalls = calls;
|
|
8412
8530
|
}
|
|
@@ -10442,7 +10560,7 @@ function validateMapping(input) {
|
|
|
10442
10560
|
// src/commands/validate/validators/entry.ts
|
|
10443
10561
|
init_dist();
|
|
10444
10562
|
import Ajv from "ajv";
|
|
10445
|
-
var CLIENT_HEADER = "walkeros-cli/4.2.0-next-
|
|
10563
|
+
var CLIENT_HEADER = "walkeros-cli/4.2.0-next-1780610489068";
|
|
10446
10564
|
var SECTIONS = ["destinations", "sources", "transformers"];
|
|
10447
10565
|
function resolveEntry(path19, flowConfig) {
|
|
10448
10566
|
const flows = flowConfig.flows;
|