@walkeros/cli 4.3.1-next-1784373088875 → 4.3.1
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 +11 -6
- package/dist/cli.js +136 -93
- package/dist/index.d.ts +34 -50
- package/dist/index.js +20 -135
- package/dist/index.js.map +1 -1
- package/openapi/spec.json +77 -13
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @walkeros/cli
|
|
2
2
|
|
|
3
|
-
## 4.3.1
|
|
3
|
+
## 4.3.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -15,13 +15,18 @@
|
|
|
15
15
|
secrets land in code or artifacts. Ingest posts carry a versioned envelope
|
|
16
16
|
with release provenance, and `walkeros observe start` opens sessions from the
|
|
17
17
|
terminal.
|
|
18
|
+
- 747e42f: The deprecated telemetry bundle options that baked a plaintext ingest
|
|
19
|
+
token into wrapped browser bundles are removed; observation wiring now always
|
|
20
|
+
uses the bake-nothing `observe` connect config. `walkeros observe start` sends
|
|
21
|
+
`level` and `replace`, renders the activation URL, web credential, server env
|
|
22
|
+
block, expiry, and record count, and keeps the session warm while waiting.
|
|
18
23
|
- Updated dependencies [f2030ab]
|
|
19
24
|
- Updated dependencies [2d6ab82]
|
|
20
|
-
- @walkeros/core@4.3.1
|
|
21
|
-
- @walkeros/collector@4.3.1
|
|
22
|
-
- @walkeros/server-core@4.3.1
|
|
23
|
-
- @walkeros/server-destination-api@4.3.1
|
|
24
|
-
- @walkeros/transformer-validate@4.3.1
|
|
25
|
+
- @walkeros/core@4.3.1
|
|
26
|
+
- @walkeros/collector@4.3.1
|
|
27
|
+
- @walkeros/server-core@4.3.1
|
|
28
|
+
- @walkeros/server-destination-api@4.3.1
|
|
29
|
+
- @walkeros/transformer-validate@4.3.1
|
|
25
30
|
|
|
26
31
|
## 4.3.0
|
|
27
32
|
|
package/dist/cli.js
CHANGED
|
@@ -549,7 +549,7 @@ function $e(e4, t4) {
|
|
|
549
549
|
}
|
|
550
550
|
return n5;
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function je(e4, t4 = {}, n5 = {}) {
|
|
553
553
|
const r6 = { ...t4, ...n5 }, o4 = {};
|
|
554
554
|
let s4 = !e4 || 0 === Object.keys(e4).length;
|
|
555
555
|
return Object.keys(r6).forEach((t5) => {
|
|
@@ -726,7 +726,7 @@ async function tt(e4, t4, n5) {
|
|
|
726
726
|
if (e5 instanceof Xe) throw e5;
|
|
727
727
|
return g3.logger.error("mapping condition failed", { event: g3.event, error: e5 }), false;
|
|
728
728
|
})(e4, g3)) return;
|
|
729
|
-
if (a4 && !
|
|
729
|
+
if (a4 && !je(a4, g3.consent)) return m3;
|
|
730
730
|
let h2 = ue(m3) ? m3 : e4;
|
|
731
731
|
if (c2 && (h2 = await Ye(c2, (e5) => {
|
|
732
732
|
if (e5 instanceof Xe) throw e5;
|
|
@@ -873,20 +873,20 @@ function At(e4) {
|
|
|
873
873
|
return null;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function jt(e4) {
|
|
877
877
|
return "object" == typeof e4 && null !== e4 && !Array.isArray(e4);
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function St(e4) {
|
|
880
880
|
if (!e4) return null;
|
|
881
881
|
const t4 = e4.split("."), [n5, r6, o4] = t4;
|
|
882
882
|
if (3 !== t4.length || !n5 || !r6 || !o4) return null;
|
|
883
883
|
const s4 = At(n5);
|
|
884
|
-
if (!
|
|
884
|
+
if (!jt(s4)) return null;
|
|
885
885
|
const i5 = s4.kid, a4 = s4.alg;
|
|
886
886
|
if ("string" != typeof i5 || "ES256" !== a4) return null;
|
|
887
887
|
const c2 = At(r6);
|
|
888
888
|
if (!(function(e5) {
|
|
889
|
-
if (!
|
|
889
|
+
if (!jt(e5)) return false;
|
|
890
890
|
const t5 = e5;
|
|
891
891
|
return "string" == typeof t5.iss && Array.isArray(t5.aud) && t5.aud.every((e6) => "string" == typeof e6) && "number" == typeof t5.iat && "number" == typeof t5.sxp && "string" == typeof t5.art && wt.test(t5.art) && "string" == typeof t5.sri && "string" == typeof t5.pb && "activate" === t5.cap && "string" == typeof t5.jti && "string" == typeof t5.pid && (void 0 === t5.ses || "string" == typeof t5.ses) && (void 0 === t5.sb || "string" == typeof t5.sb);
|
|
892
892
|
})(c2)) return null;
|
|
@@ -894,7 +894,7 @@ function jt(e4) {
|
|
|
894
894
|
return u2 && 64 === u2.byteLength ? { grant: c2, kid: i5, signed: $t(`${n5}.${r6}`), signature: u2 } : null;
|
|
895
895
|
}
|
|
896
896
|
async function It(e4, t4) {
|
|
897
|
-
const n5 =
|
|
897
|
+
const n5 = St(e4);
|
|
898
898
|
if (!n5) return { ok: false, reason: "malformed" };
|
|
899
899
|
const { grant: r6, kid: o4, signed: s4, signature: i5 } = n5;
|
|
900
900
|
if (r6.iss !== t4.iss) return { ok: false, reason: "foreign-issuer" };
|
|
@@ -946,9 +946,13 @@ function on(e4, t4) {
|
|
|
946
946
|
}
|
|
947
947
|
function sn(e4) {
|
|
948
948
|
const t4 = e4.batchMs, n5 = "number" == typeof t4 && Number.isFinite(t4) && t4 > 0 ? Math.floor(t4) : 50, r6 = e4.batchSize, o4 = "number" == typeof r6 && Number.isFinite(r6) && r6 >= 1 ? Math.floor(r6) : 50, s4 = e4.maxBodyBytes, i5 = "number" == typeof s4 && Number.isFinite(s4) && s4 >= 1 ? Math.floor(s4) : 6e4, a4 = e4.fetch ?? ((e5, t5) => globalThis.fetch(e5, t5)), c2 = e4.onError ?? (() => {
|
|
949
|
-
});
|
|
950
|
-
|
|
951
|
-
|
|
949
|
+
}), u2 = {};
|
|
950
|
+
for (const [t5, n6] of Object.entries(e4.headers ?? {})) {
|
|
951
|
+
const e5 = t5.toLowerCase();
|
|
952
|
+
"authorization" !== e5 && "content-type" !== e5 && (u2[t5] = n6);
|
|
953
|
+
}
|
|
954
|
+
let f3 = [], l3 = null, p3 = 0;
|
|
955
|
+
function d2(e5) {
|
|
952
956
|
const t5 = { v: 1, records: e5 }, n6 = JSON.stringify(t5);
|
|
953
957
|
if (e5.length <= 1) return [n6];
|
|
954
958
|
if ((function(e6) {
|
|
@@ -965,26 +969,26 @@ function sn(e4) {
|
|
|
965
969
|
return t6;
|
|
966
970
|
})(n6) <= i5) return [n6];
|
|
967
971
|
const r7 = Math.floor(e5.length / 2);
|
|
968
|
-
return [...
|
|
972
|
+
return [...d2(e5.slice(0, r7)), ...d2(e5.slice(r7))];
|
|
969
973
|
}
|
|
970
|
-
function
|
|
971
|
-
return Promise.resolve().then(() => a4(e4.url, { method: "POST", headers: { ...
|
|
974
|
+
function m3(t5) {
|
|
975
|
+
return Promise.resolve().then(() => a4(e4.url, { method: "POST", headers: { ...u2, "Content-Type": "application/json", Authorization: `Bearer ${e4.token}` }, body: t5 })).then((t6) => {
|
|
972
976
|
t6 && "object" == typeof t6 && "number" == typeof t6.status && e4.onStatus?.(t6.status), t6 && "object" == typeof t6 && "ok" in t6 && !t6.ok && c2(new Error(`Observer responded ${t6.status}`));
|
|
973
977
|
}).catch((e5) => {
|
|
974
978
|
c2(e5);
|
|
975
979
|
});
|
|
976
980
|
}
|
|
977
|
-
function
|
|
978
|
-
if (0 ===
|
|
979
|
-
const e5 =
|
|
980
|
-
|
|
981
|
-
const t5 =
|
|
981
|
+
function g3() {
|
|
982
|
+
if (0 === f3.length) return;
|
|
983
|
+
const e5 = f3;
|
|
984
|
+
f3 = [], l3 && (clearTimeout(l3), l3 = null);
|
|
985
|
+
const t5 = d2(e5);
|
|
982
986
|
(async () => {
|
|
983
|
-
for (const e6 of t5) await
|
|
987
|
+
for (const e6 of t5) await m3(e6);
|
|
984
988
|
})();
|
|
985
989
|
}
|
|
986
990
|
return (e5) => {
|
|
987
|
-
|
|
991
|
+
f3.push({ ...e5, seq: ++p3 }), f3.length >= o4 ? g3() : null === l3 && (l3 = setTimeout(g3, n5));
|
|
988
992
|
};
|
|
989
993
|
}
|
|
990
994
|
function vn(e4) {
|
|
@@ -1024,12 +1028,12 @@ async function wn(e4, t4) {
|
|
|
1024
1028
|
const n5 = await yn(e4, t4);
|
|
1025
1029
|
return { packageName: n5.packageName, version: n5.version, type: n5.type, platform: n5.platform, schemas: n5.schemas, examples: n5.examples, ...n5.hints ? { hints: n5.hints } : {} };
|
|
1026
1030
|
}
|
|
1027
|
-
function
|
|
1031
|
+
function jn(e4) {
|
|
1028
1032
|
const t4 = (e4.startsWith(An) ? e4.slice(5) : e4).split(".");
|
|
1029
1033
|
return t4.some((e5) => "" === e5) ? [] : t4;
|
|
1030
1034
|
}
|
|
1031
1035
|
function xn(e4) {
|
|
1032
|
-
if (!e4.startsWith(
|
|
1036
|
+
if (!e4.startsWith(Sn)) return null;
|
|
1033
1037
|
const t4 = e4.slice(5).split("."), [n5, r6, o4] = t4;
|
|
1034
1038
|
return 3 === t4.length && n5 && r6 && o4 ? { pb: n5, ses: r6, secret: o4 } : null;
|
|
1035
1039
|
}
|
|
@@ -1250,7 +1254,7 @@ function ur(e4, t4) {
|
|
|
1250
1254
|
function fr(e4, t4) {
|
|
1251
1255
|
return "Transformer" === t4 && (void 0 === e4.code && void 0 === e4.package && void 0 === e4.import && (void 0 !== e4.before || void 0 !== e4.next || void 0 !== e4.cache || void 0 !== e4.state || void 0 !== e4.mapping));
|
|
1252
1256
|
}
|
|
1253
|
-
var e, t, r, i, f, l, m, v, b, T, D, F, U, L, K, q, J, G, re, we, Ie, Pe, qe, Xe, wt, xt, Ot, Nt, tn, kn, An,
|
|
1257
|
+
var e, t, r, i, f, l, m, v, b, T, D, F, U, L, K, q, J, G, re, we, Ie, Pe, qe, Xe, wt, xt, Ot, Nt, tn, kn, An, Sn, Rn, Fn, Un, sr, ir, ar, cr;
|
|
1254
1258
|
var init_dist = __esm({
|
|
1255
1259
|
"../core/dist/index.mjs"() {
|
|
1256
1260
|
"use strict";
|
|
@@ -1300,7 +1304,7 @@ var init_dist = __esm({
|
|
|
1300
1304
|
tn = null;
|
|
1301
1305
|
kn = "observe";
|
|
1302
1306
|
An = "call:";
|
|
1303
|
-
|
|
1307
|
+
Sn = "obsw_";
|
|
1304
1308
|
Rn = /* @__PURE__ */ new WeakMap();
|
|
1305
1309
|
Fn = "__walkeros_cache_v__";
|
|
1306
1310
|
Un = "__walkeros_cache_exp__";
|
|
@@ -2408,7 +2412,7 @@ function qn(e4) {
|
|
|
2408
2412
|
for (const [e5, i5] of Object.entries(t4)) i5 && "object" == typeof i5 && ("object" === i5.type && i5.properties && "string" != typeof i5.title && (i5.title = e5), qn(i5));
|
|
2409
2413
|
}
|
|
2410
2414
|
}
|
|
2411
|
-
var e3, t3, i3, r4, a3, s2, c, l2, d, p, u, m2, f2, g2, b2, h, v2, S, y2, w2, k2, C2, x, j, P2, D2, E, O, I2, R3, $, A, z3, L2, q2, N2, W, B2, U3, _2, H2, V, Z2, G2, K3, Q2, X3, Y3, ee3, te3, ie3, ne3, oe2, re3, ae3, se2, ce, le2, de2, pe2, ue2, me2, fe, ge2, be2, he2, ve2,
|
|
2415
|
+
var e3, t3, i3, r4, a3, s2, c, l2, d, p, u, m2, f2, g2, b2, h, v2, S, y2, w2, k2, C2, x, j, P2, D2, E, O, I2, R3, $, A, z3, L2, q2, N2, W, B2, U3, _2, H2, V, Z2, G2, K3, Q2, X3, Y3, ee3, te3, ie3, ne3, oe2, re3, ae3, se2, ce, le2, de2, pe2, ue2, me2, fe, ge2, be2, he2, ve2, Se, ye2, we2, ke2, Ce2, xe, je2, Pe2, De, Ee2, Oe2, Ie2, Re3, Je3, Me, Te, Fe3, $e2, Ae, ze2, Le2, qe2, Ne3, We3, Be3, Ue3, _e2, He2, Ve3, Ze3, Ge3, Ke3, Qe3, Xe3, Ye3, et3, tt3, it2, nt3, ot2, rt2, at2, st2, ct2, lt3, dt2, pt3, ut2, mt2, ft2, gt3, bt3, ht3, vt3, St3, yt2, wt3, kt3, Ct2, xt3, jt3, Pt, Dt2, Et2, Ot3, It3, Rt2, Jt2, Mt2, Tt2, Ft, $t3, At3, zt, Lt2, qt2, Nt3, Wt2, Bt, Ut, _t2, Ht2, Vt2, Zt, Gt2, Kt, Qt, Xt, Yt2, ei, ti, ii, ni, oi, ri, ai, si, ci, li, di, pi, ui, mi, fi, gi, bi, hi, vi, Si, yi, wi, ki, Ci, xi, ji, Di, Ei, Oi, Ii, Ri, Ji, Mi, Ti, Fi, $i, Ai, zi, Li, Ui, _i, Hi, Vi, Zi, Gi, Ki, Qi, Xi, Yi, tn2, nn2, on2, rn3, an, sn2, cn, dn, bn3, hn2, vn3, Sn2, yn3, wn3, kn3, Cn3, Wn;
|
|
2412
2416
|
var init_dev = __esm({
|
|
2413
2417
|
"../core/dist/dev.mjs"() {
|
|
2414
2418
|
"use strict";
|
|
@@ -2417,7 +2421,7 @@ var init_dev = __esm({
|
|
|
2417
2421
|
for (var n5 in i5) e3(t4, n5, { get: i5[n5], enumerable: true });
|
|
2418
2422
|
};
|
|
2419
2423
|
i3 = {};
|
|
2420
|
-
t3(i3, { BaseContextConfig: () => A, CacheRuleSchema: () => Ye3, CacheSchema: () => et3, CacheSchemas: () => Ze3, ClickIdEntrySchema: () => rn3, CodeSchema: () => tn2, CollectorSchemas: () => Ot3, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Ti, ContractSchema: () => Fi, ContractSchemaEntry: () => Ri, Counter: () => d, CredentialsSchema: () => sn2, DeepPartialEventSchema: () => ie3, DestinationSchemas: () => Me, DestinationsMapConfig: () => q2, EntitiesSchema: () => Y3, EntitySchema: () => X3, EventCacheRuleSchema: () => Ge3, EventCacheSchema: () => Ke3, EventSchema: () => ee3, FlowBundlePackageSchema: () => vi, FlowBundleSchema: () => Si, FlowCodeSchema: () => yi, FlowConfigSchema: () => Ai, FlowDestinationSchema: () => Oi, FlowJsonSchema: () => Li, FlowSchema: () => zi, FlowSchemas: () => fi, FlowSourceSchema: () => Di, FlowStoreSchema: () => Ii, FlowTransformerSchema: () => Ei, GenericEnvConfig: () => R3, GenericSettingsConfig: () => I2, HandlersConfig: () => x, HintSchema: () => nn2, HintsSchema: () => on2, IdConfig: () => D2, Identifier: () => c, InitConfig: () => E, LoggerConfigSchema: () => nt3, LoggerHandlerSchema: () => it2, LoopSchema: () => fe, MapSchema: () => be2, MappingResultSchema: () => Ce2, MappingSchemas: () => pe2, MatchExpressionSchema: () => Ae, MatcherSchemas: () => Te, OptionalPrimitiveValue: () => u, OrderedPropertiesSchema: () => H2, PartialEventSchema: () => te3, PolicySchema: () => ve2, PrimaryConfig: () => O, PrimitiveValue: () => p, ProcessingControlConfig: () => z3, PropertiesSchema: () => _2, PropertySchema: () => U3, PropertyTypeSchema: () => B2, QueueConfig: () => P2, RequiredBoolean: () => s2, RequiredNumber: () => a3, RequiredString: () => r4, RouteSchema: () => Be3, RouteWithoutManySchema: () => Ve3, RuleSchema: () => ye2, RulesSchema: () => we2, RuntimeInstanceConfig: () => $, ServiceAccountSchema: () => an, SetSchema: () => ge2, SourceSchema: () => Q2, SourceSchemas: () => Ut, SourceTypeSchema: () => V, SourcesMapConfig: () => L2, StateSchema: () => tt3, StoreCacheRuleSchema: () => Qe3, StoreCacheSchema: () => Xe3, StoreSchemas: () => li, Timestamp: () => l2, TransformerSchemas: () => oi, UserSchema: () => G2, UtilitySchemas: () => m2, ValidateEventsSchema: () => ji, ValueConfigSchema: () => he2, ValueSchema: () => ue2, ValuesSchema: () => me2, VerboseConfig: () => j, WalkerOSSchemas: () => N2, configJsonSchema: () => Ui, consentJsonSchema: () => de2, contractJsonSchema: () => Xi, contractRuleJsonSchema: () => Qi, createArraySchema: () => $n, createConsentConfig: () => F3, createDataTransformationConfig: () => J3, createEnumSchema: () => An2, createMappingRulesConfig: () => M2, createObjectSchema: () => Tn2, createPolicyConfig: () => T3, createTupleSchema: () => zn2, credentialsJsonSchema: () => cn, destinationJsonSchema: () => Zi, entityJsonSchema: () => ce, eventJsonSchema: () => ne3, flowConfigJsonSchema: () => Hi, flowJsonSchema: () => _i, loopJsonSchema: () => Pe2, mapJsonSchema: () => Ee2, orderedPropertiesJsonSchema: () => se2, parseConfig: () => qi, parseFlow: () => Wi, partialEventJsonSchema: () => oe2, policyJsonSchema: () => Oe2, propertiesJsonSchema: () => ae3, ruleJsonSchema: () => Ie2, rulesJsonSchema: () => Re3, safeParseConfig: () => Ni, safeParseFlow: () => Bi, setJsonSchema: () => De, sourceJsonSchema: () => Vi, sourceTypeJsonSchema: () => le2, storeJsonSchema: () => Ki, transformerJsonSchema: () => Gi, userJsonSchema: () => re3, validateEventsJsonSchema: () => Yi, validateFlowConfig: () => gn, valueConfigJsonSchema: () =>
|
|
2424
|
+
t3(i3, { BaseContextConfig: () => A, CacheRuleSchema: () => Ye3, CacheSchema: () => et3, CacheSchemas: () => Ze3, ClickIdEntrySchema: () => rn3, CodeSchema: () => tn2, CollectorSchemas: () => Ot3, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Ti, ContractSchema: () => Fi, ContractSchemaEntry: () => Ri, Counter: () => d, CredentialsSchema: () => sn2, DeepPartialEventSchema: () => ie3, DestinationSchemas: () => Me, DestinationsMapConfig: () => q2, EntitiesSchema: () => Y3, EntitySchema: () => X3, EventCacheRuleSchema: () => Ge3, EventCacheSchema: () => Ke3, EventSchema: () => ee3, FlowBundlePackageSchema: () => vi, FlowBundleSchema: () => Si, FlowCodeSchema: () => yi, FlowConfigSchema: () => Ai, FlowDestinationSchema: () => Oi, FlowJsonSchema: () => Li, FlowSchema: () => zi, FlowSchemas: () => fi, FlowSourceSchema: () => Di, FlowStoreSchema: () => Ii, FlowTransformerSchema: () => Ei, GenericEnvConfig: () => R3, GenericSettingsConfig: () => I2, HandlersConfig: () => x, HintSchema: () => nn2, HintsSchema: () => on2, IdConfig: () => D2, Identifier: () => c, InitConfig: () => E, LoggerConfigSchema: () => nt3, LoggerHandlerSchema: () => it2, LoopSchema: () => fe, MapSchema: () => be2, MappingResultSchema: () => Ce2, MappingSchemas: () => pe2, MatchExpressionSchema: () => Ae, MatcherSchemas: () => Te, OptionalPrimitiveValue: () => u, OrderedPropertiesSchema: () => H2, PartialEventSchema: () => te3, PolicySchema: () => ve2, PrimaryConfig: () => O, PrimitiveValue: () => p, ProcessingControlConfig: () => z3, PropertiesSchema: () => _2, PropertySchema: () => U3, PropertyTypeSchema: () => B2, QueueConfig: () => P2, RequiredBoolean: () => s2, RequiredNumber: () => a3, RequiredString: () => r4, RouteSchema: () => Be3, RouteWithoutManySchema: () => Ve3, RuleSchema: () => ye2, RulesSchema: () => we2, RuntimeInstanceConfig: () => $, ServiceAccountSchema: () => an, SetSchema: () => ge2, SourceSchema: () => Q2, SourceSchemas: () => Ut, SourceTypeSchema: () => V, SourcesMapConfig: () => L2, StateSchema: () => tt3, StoreCacheRuleSchema: () => Qe3, StoreCacheSchema: () => Xe3, StoreSchemas: () => li, Timestamp: () => l2, TransformerSchemas: () => oi, UserSchema: () => G2, UtilitySchemas: () => m2, ValidateEventsSchema: () => ji, ValueConfigSchema: () => he2, ValueSchema: () => ue2, ValuesSchema: () => me2, VerboseConfig: () => j, WalkerOSSchemas: () => N2, configJsonSchema: () => Ui, consentJsonSchema: () => de2, contractJsonSchema: () => Xi, contractRuleJsonSchema: () => Qi, createArraySchema: () => $n, createConsentConfig: () => F3, createDataTransformationConfig: () => J3, createEnumSchema: () => An2, createMappingRulesConfig: () => M2, createObjectSchema: () => Tn2, createPolicyConfig: () => T3, createTupleSchema: () => zn2, credentialsJsonSchema: () => cn, destinationJsonSchema: () => Zi, entityJsonSchema: () => ce, eventJsonSchema: () => ne3, flowConfigJsonSchema: () => Hi, flowJsonSchema: () => _i, loopJsonSchema: () => Pe2, mapJsonSchema: () => Ee2, orderedPropertiesJsonSchema: () => se2, parseConfig: () => qi, parseFlow: () => Wi, partialEventJsonSchema: () => oe2, policyJsonSchema: () => Oe2, propertiesJsonSchema: () => ae3, ruleJsonSchema: () => Ie2, rulesJsonSchema: () => Re3, safeParseConfig: () => Ni, safeParseFlow: () => Bi, setJsonSchema: () => De, sourceJsonSchema: () => Vi, sourceTypeJsonSchema: () => le2, storeJsonSchema: () => Ki, transformerJsonSchema: () => Gi, userJsonSchema: () => re3, validateEventsJsonSchema: () => Yi, validateFlowConfig: () => gn, valueConfigJsonSchema: () => je2, valueJsonSchema: () => xe, z: () => n3, zodToSchema: () => Ln2 });
|
|
2421
2425
|
r4 = n3.string();
|
|
2422
2426
|
a3 = n3.number();
|
|
2423
2427
|
s2 = n3.boolean();
|
|
@@ -2476,7 +2480,7 @@ var init_dev = __esm({
|
|
|
2476
2480
|
le2 = o2(V);
|
|
2477
2481
|
de2 = o2(Z2);
|
|
2478
2482
|
pe2 = {};
|
|
2479
|
-
t3(pe2, { ConfigSchema: () => ke2, LoopSchema: () => fe, MapSchema: () => be2, PolicySchema: () => ve2, ResultSchema: () => Ce2, RulePatchSchema: () =>
|
|
2483
|
+
t3(pe2, { ConfigSchema: () => ke2, LoopSchema: () => fe, MapSchema: () => be2, PolicySchema: () => ve2, ResultSchema: () => Ce2, RulePatchSchema: () => Se, RuleSchema: () => ye2, RulesSchema: () => we2, SetSchema: () => ge2, ValueConfigSchema: () => he2, ValueSchema: () => ue2, ValuesSchema: () => me2, configJsonSchema: () => Je3, loopJsonSchema: () => Pe2, mapJsonSchema: () => Ee2, policyJsonSchema: () => Oe2, ruleJsonSchema: () => Ie2, rulesJsonSchema: () => Re3, setJsonSchema: () => De, valueConfigJsonSchema: () => je2, valueJsonSchema: () => xe });
|
|
2480
2484
|
ue2 = n3.lazy(() => n3.union([n3.string().describe('String value or property path (e.g., "data.id")'), n3.number().describe("Numeric value"), n3.boolean().describe("Boolean value"), n3.lazy(() => W), n3.array(ue2).describe("Array of values")])).meta({ id: "MappingValue", title: "Mapping.Value", description: "Polymorphic transform primitive used in every mapping field. A string path, constant, operator object (map/loop/set/condition/consent), or array of values." });
|
|
2481
2485
|
me2 = n3.array(ue2).meta({ id: "MappingValues", title: "Mapping.Values", description: "Array of transformation values." }).describe("Array of transformation values");
|
|
2482
2486
|
fe = n3.lazy(() => n3.tuple([ue2, ue2]).describe("Loop transformation: [source, transform] tuple for array processing")).meta({ id: "MappingLoop", title: "Mapping.Loop", description: "Loop tuple [source, transform] for iterating and transforming arrays." });
|
|
@@ -2484,13 +2488,13 @@ var init_dev = __esm({
|
|
|
2484
2488
|
be2 = n3.lazy(() => n3.record(n3.string(), ue2).describe("Map: Object mapping keys to transformation values")).meta({ id: "MappingMap", title: "Mapping.Map", description: "Map: object mapping keys to transformation values." });
|
|
2485
2489
|
he2 = W = n3.object({ key: n3.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: n3.union([n3.string(), n3.number(), n3.boolean()]).optional().describe("Static primitive value"), fn: n3.string().optional().describe("Custom transformation function as string (serialized)"), map: be2.optional().describe("Object mapping: transform event data to structured output"), loop: fe.optional().describe("Loop transformation: [source, transform] for array processing"), set: ge2.optional().describe("Set of values: combine or select from multiple values"), consent: Z2.optional().describe("Required consent states to include this value"), condition: n3.string().optional().describe("Condition function as string: return true to include value"), validate: n3.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e4) => Object.keys(e4).length > 0, { message: "ValueConfig must have at least one property" }).meta({ id: "MappingValueConfig", title: "Mapping.ValueConfig", description: "Object-form value transformation with map/loop/set/condition/consent etc." }).describe("Value transformation configuration with multiple strategies");
|
|
2486
2490
|
ve2 = n3.record(n3.string(), ue2).meta({ id: "MappingPolicy", title: "Mapping.Policy", description: "Policy rules for event pre-processing (key \u2192 value transformation)." }).describe("Policy rules for event pre-processing (key \u2192 value mapping)");
|
|
2487
|
-
|
|
2488
|
-
ye2 = n3.object({ name: n3.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: n3.union([ue2, me2]).optional().describe("Data transformation rules for event"), settings: n3.unknown().optional().describe("Destination-specific settings for this event mapping"), condition: n3.string().optional().describe("Condition function as string: return true to process event"), consent: Z2.optional().describe("Required consent states to process this event"), policy: ve2.optional().describe("Event-level policy overrides (applied after config-level policy)"), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).optional().describe("Batch scheduling: bare number is the debounce wait window (legacy); object form supports wait/size/age."), include: n3.array(n3.string()).optional().describe('Event sections (e.g. ["context", "globals"]) flattened into context.data'), ignore: n3.boolean().optional().describe("Skip the event entirely. No push, no side effects. Use for suppression."), silent: n3.boolean().optional().describe("Run side effects (settings.identify, ...) but suppress the destination default push call."), extend:
|
|
2491
|
+
Se = n3.object({ name: n3.string().nullable().optional(), data: n3.union([ue2, me2]).nullable().optional(), settings: n3.unknown().nullable().optional(), condition: n3.string().nullable().optional(), consent: Z2.nullable().optional(), policy: ve2.nullable().optional(), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).nullable().optional(), include: n3.array(n3.string()).nullable().optional(), ignore: n3.boolean().nullable().optional(), silent: n3.boolean().nullable().optional() }).meta({ id: "MappingRulePatch", title: "Mapping.RulePatch", description: "Partial rule deep-merged onto a package-shipped default; a null value clears the inherited field." }).describe("Partial rule for `extend`; null clears an inherited field");
|
|
2492
|
+
ye2 = n3.object({ name: n3.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: n3.union([ue2, me2]).optional().describe("Data transformation rules for event"), settings: n3.unknown().optional().describe("Destination-specific settings for this event mapping"), condition: n3.string().optional().describe("Condition function as string: return true to process event"), consent: Z2.optional().describe("Required consent states to process this event"), policy: ve2.optional().describe("Event-level policy overrides (applied after config-level policy)"), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).optional().describe("Batch scheduling: bare number is the debounce wait window (legacy); object form supports wait/size/age."), include: n3.array(n3.string()).optional().describe('Event sections (e.g. ["context", "globals"]) flattened into context.data'), ignore: n3.boolean().optional().describe("Skip the event entirely. No push, no side effects. Use for suppression."), silent: n3.boolean().optional().describe("Run side effects (settings.identify, ...) but suppress the destination default push call."), extend: Se.optional().describe("Merge mode: a partial rule deep-merged onto the package-shipped default at this key (instead of replacing it). A null value clears an inherited field."), remove: n3.array(n3.string()).optional().describe("Dotted paths stripped from the produced data payload after evaluation (applied last).") }).meta({ id: "MappingRule", title: "Mapping.Rule", description: "Configuration for transforming a single event at one stage of the flow (source or destination)." }).describe("Mapping rule for specific entity-action combination");
|
|
2489
2493
|
we2 = n3.record(n3.string(), n3.record(n3.string(), n3.union([ye2, n3.array(ye2)])).optional()).meta({ id: "MappingRules", title: "Mapping.Rules", description: 'Event mapping rules tree: entity \u2192 action \u2192 Rule (or Rule[]). Use "*" as wildcard for entity or action.' }).describe('Event mapping rules: entity \u2192 action \u2192 Rule. Keys match event name split by space. Use "*" as wildcard for entity or action. Priority: exact > entity wildcard > action wildcard > global wildcard (*\u2192*).');
|
|
2490
2494
|
ke2 = n3.object({ consent: Z2.optional().describe("Required consent states to process any events"), data: n3.union([ue2, me2]).optional().describe("Global data transformation applied to all events"), include: n3.array(n3.string()).optional().describe("Event sections to flatten into context.data"), mapping: we2.optional().describe("Entity-action specific mapping rules"), policy: ve2.optional().describe("Pre-processing policy rules applied before mapping") }).meta({ id: "MappingConfig", title: "Mapping.Config", description: "Shared mapping configuration (consent, data, include, mapping, policy)." }).describe("Shared mapping configuration for sources and destinations");
|
|
2491
2495
|
Ce2 = n3.object({ eventMapping: ye2.optional().describe("Resolved mapping rule for event"), mappingKey: n3.string().optional().describe('Mapping key used (e.g., "product.view")') }).meta({ id: "MappingResult", title: "Mapping.Result", description: "Mapping resolution result (matched rule + key)." }).describe("Mapping resolution result");
|
|
2492
2496
|
xe = o2(ue2);
|
|
2493
|
-
|
|
2497
|
+
je2 = o2(he2);
|
|
2494
2498
|
Pe2 = o2(fe);
|
|
2495
2499
|
De = o2(ge2);
|
|
2496
2500
|
Ee2 = o2(be2);
|
|
@@ -5146,12 +5150,21 @@ export default async function(context = {}) {
|
|
|
5146
5150
|
function readObserveConnect(flowSettings, logger) {
|
|
5147
5151
|
const observe = flowSettings.config?.observe;
|
|
5148
5152
|
if (!observe) return void 0;
|
|
5149
|
-
const { url, binding } = observe;
|
|
5153
|
+
const { url, binding, level, sample } = observe;
|
|
5150
5154
|
if (url === void 0 && binding === void 0) return void 0;
|
|
5151
5155
|
const trimmedUrl = typeof url === "string" ? url.trim() : "";
|
|
5152
5156
|
const trimmedBinding = typeof binding === "string" ? binding.trim() : "";
|
|
5153
5157
|
if (trimmedUrl !== "" && trimmedBinding !== "") {
|
|
5154
|
-
return {
|
|
5158
|
+
return {
|
|
5159
|
+
url: trimmedUrl,
|
|
5160
|
+
binding: trimmedBinding,
|
|
5161
|
+
// Same JSON-borne prudence as the pair: only known-shaped public
|
|
5162
|
+
// values reach the emitted literal.
|
|
5163
|
+
...level === "off" || level === "standard" || level === "trace" ? { level } : {},
|
|
5164
|
+
// Sample is a fraction in [0, 1] per the Flow.Observe contract; the
|
|
5165
|
+
// range test also drops NaN and the infinities.
|
|
5166
|
+
...typeof sample === "number" && sample >= 0 && sample <= 1 ? { sample } : {}
|
|
5167
|
+
};
|
|
5155
5168
|
}
|
|
5156
5169
|
const missing = [
|
|
5157
5170
|
...trimmedUrl === "" ? ["url"] : [],
|
|
@@ -5174,11 +5187,6 @@ function emitObserveAssignment(observe) {
|
|
|
5174
5187
|
config.observe = ${JSON.stringify(literal)};`;
|
|
5175
5188
|
}
|
|
5176
5189
|
function generateWebEntry(stage1Path, dataPayload, options = {}) {
|
|
5177
|
-
if (options.observe !== void 0 && options.telemetry !== void 0) {
|
|
5178
|
-
throw new Error(
|
|
5179
|
-
"generateWebEntry: `observe` (bake-nothing connect module) and `telemetry` (baked ingest token) are mutually exclusive observer wirings. Pass `observe` alone; the per-session credential arrives out-of-band at boot instead of being baked."
|
|
5180
|
-
);
|
|
5181
|
-
}
|
|
5182
5190
|
const assignments = [];
|
|
5183
5191
|
if (options.windowCollector) {
|
|
5184
5192
|
assignments.push(
|
|
@@ -5199,30 +5207,13 @@ function generateWebEntry(stage1Path, dataPayload, options = {}) {
|
|
|
5199
5207
|
}` : "";
|
|
5200
5208
|
const stage1Specifier = toFileImportSpecifier(stage1Path);
|
|
5201
5209
|
const observeBlock = options.observe ? emitObserveAssignment(options.observe) : "";
|
|
5202
|
-
|
|
5203
|
-
import { createBatchedPoster as __cbp, createTelemetryObserver as __cto } from '@walkeros/core';` : "";
|
|
5204
|
-
const telemetryBlock = options.telemetry ? `
|
|
5205
|
-
// --- Telemetry wiring ---
|
|
5206
|
-
{
|
|
5207
|
-
const __emit = __cbp({
|
|
5208
|
-
url: ${JSON.stringify(options.telemetry.observerUrl)},
|
|
5209
|
-
token: ${JSON.stringify(options.telemetry.ingestToken)},
|
|
5210
|
-
});
|
|
5211
|
-
const __observer = __cto(__emit, {
|
|
5212
|
-
flowId: ${JSON.stringify(options.telemetry.flowId)},
|
|
5213
|
-
level: ${JSON.stringify(options.telemetry.level ?? "standard")},
|
|
5214
|
-
sample: ${JSON.stringify(options.telemetry.sample ?? 1)},
|
|
5215
|
-
});
|
|
5216
|
-
collector.observers.add(__observer);
|
|
5217
|
-
collector.observeLevel = function () { return ${JSON.stringify(options.telemetry.level ?? "standard")}; };
|
|
5218
|
-
}` : "";
|
|
5219
|
-
return `import { startFlow, wireConfig } from '${stage1Specifier}';${telemetryImport}
|
|
5210
|
+
return `import { startFlow, wireConfig } from '${stage1Specifier}';
|
|
5220
5211
|
|
|
5221
5212
|
const __configData = ${dataPayload};
|
|
5222
5213
|
|
|
5223
5214
|
(async () => {
|
|
5224
5215
|
const config = wireConfig(__configData);${envBlock}${observeBlock}
|
|
5225
|
-
const { collector, elb } = await startFlow(config);${
|
|
5216
|
+
const { collector, elb } = await startFlow(config);${assignmentCode}
|
|
5226
5217
|
})();`;
|
|
5227
5218
|
}
|
|
5228
5219
|
function processConfigValue(value) {
|
|
@@ -5867,7 +5858,7 @@ var init_contract = __esm({
|
|
|
5867
5858
|
"src/core/contract.ts"() {
|
|
5868
5859
|
"use strict";
|
|
5869
5860
|
init_config_file();
|
|
5870
|
-
bakedContractVersion = true ? "
|
|
5861
|
+
bakedContractVersion = true ? "4.0.0" : PLACEHOLDER;
|
|
5871
5862
|
}
|
|
5872
5863
|
});
|
|
5873
5864
|
|
|
@@ -6339,7 +6330,6 @@ function formatPreviewCreated(preview, options) {
|
|
|
6339
6330
|
}
|
|
6340
6331
|
const lines = [
|
|
6341
6332
|
`Preview created (${preview.id})`,
|
|
6342
|
-
` Token: ${preview.token}`,
|
|
6343
6333
|
` Created by: ${preview.createdBy}`,
|
|
6344
6334
|
` Bundle URL: ${preview.bundleUrl}`,
|
|
6345
6335
|
"",
|
|
@@ -6365,15 +6355,20 @@ var observe_exports = {};
|
|
|
6365
6355
|
__export(observe_exports, {
|
|
6366
6356
|
formatObserveSession: () => formatObserveSession,
|
|
6367
6357
|
getObserveSession: () => getObserveSession,
|
|
6358
|
+
heartbeatObserveSession: () => heartbeatObserveSession,
|
|
6368
6359
|
observeStartCommand: () => observeStartCommand,
|
|
6369
6360
|
startObserveSession: () => startObserveSession,
|
|
6370
6361
|
waitForObserveSessionSettled: () => waitForObserveSessionSettled
|
|
6371
6362
|
});
|
|
6363
|
+
function isObserveLevel(value) {
|
|
6364
|
+
return OBSERVE_LEVELS2.includes(value);
|
|
6365
|
+
}
|
|
6372
6366
|
async function startObserveSession(options) {
|
|
6373
6367
|
const pid = options.projectId ?? requireProjectId();
|
|
6374
6368
|
const body = {
|
|
6375
6369
|
settingsName: options.settingsName,
|
|
6376
|
-
...options.
|
|
6370
|
+
...options.replace ? { replace: true } : {},
|
|
6371
|
+
...options.level !== void 0 ? { level: options.level } : {}
|
|
6377
6372
|
};
|
|
6378
6373
|
const response = await apiFetch(
|
|
6379
6374
|
`/api/projects/${pid}/flows/${options.flowId}/observe-sessions`,
|
|
@@ -6404,12 +6399,26 @@ async function getObserveSession(options) {
|
|
|
6404
6399
|
}
|
|
6405
6400
|
return response.json();
|
|
6406
6401
|
}
|
|
6402
|
+
async function heartbeatObserveSession(options) {
|
|
6403
|
+
const pid = options.projectId ?? requireProjectId();
|
|
6404
|
+
try {
|
|
6405
|
+
await apiFetch(
|
|
6406
|
+
`/api/projects/${pid}/flows/${options.flowId}/observe-sessions/${options.sessionId}/heartbeat`,
|
|
6407
|
+
{ method: "POST" }
|
|
6408
|
+
);
|
|
6409
|
+
} catch {
|
|
6410
|
+
}
|
|
6411
|
+
}
|
|
6407
6412
|
async function waitForObserveSessionSettled(options) {
|
|
6408
6413
|
const deadline = Date.now() + options.timeoutMs;
|
|
6409
6414
|
for (; ; ) {
|
|
6415
|
+
await heartbeatObserveSession(options);
|
|
6410
6416
|
const session = await getObserveSession(options);
|
|
6411
|
-
|
|
6412
|
-
|
|
6417
|
+
const remainingMs = deadline - Date.now();
|
|
6418
|
+
if (session.status !== "arming" || remainingMs <= 0) return session;
|
|
6419
|
+
await new Promise(
|
|
6420
|
+
(resolve4) => setTimeout(resolve4, Math.min(options.pollIntervalMs, remainingMs))
|
|
6421
|
+
);
|
|
6413
6422
|
}
|
|
6414
6423
|
}
|
|
6415
6424
|
function formatObserveSession(session) {
|
|
@@ -6419,33 +6428,58 @@ function formatObserveSession(session) {
|
|
|
6419
6428
|
lines.push("");
|
|
6420
6429
|
if (session.web) {
|
|
6421
6430
|
lines.push(" Web");
|
|
6422
|
-
lines.push(` Preview: ${session.web.previewId}`);
|
|
6423
|
-
lines.push(` Token: ${session.web.token}`);
|
|
6424
6431
|
lines.push(` Bundle URL: ${session.web.bundleUrl}`);
|
|
6425
|
-
lines.push(
|
|
6426
|
-
|
|
6427
|
-
);
|
|
6432
|
+
lines.push(` Credential: ${session.web.credential}`);
|
|
6433
|
+
if (session.web.activationUrl) {
|
|
6434
|
+
lines.push(` Activate: ${session.web.activationUrl}`);
|
|
6435
|
+
} else if (session.web.previewEnabled) {
|
|
6436
|
+
lines.push(
|
|
6437
|
+
` Activate: no activation link minted yet${arming ? " (still arming)" : ""}; open the Observe window in the app to mint one`
|
|
6438
|
+
);
|
|
6439
|
+
} else {
|
|
6440
|
+
lines.push(
|
|
6441
|
+
" Activate: not available: the deployed web bundle cannot verify activation grants (redeploy the web flow first)"
|
|
6442
|
+
);
|
|
6443
|
+
}
|
|
6428
6444
|
} else {
|
|
6429
6445
|
lines.push(` Web: no web part${arming ? " yet (still arming)" : ""}`);
|
|
6430
6446
|
}
|
|
6431
6447
|
lines.push("");
|
|
6432
|
-
if (session.
|
|
6448
|
+
if (session.server) {
|
|
6433
6449
|
lines.push(" Server");
|
|
6434
6450
|
if (session.serverFlowName) {
|
|
6435
6451
|
lines.push(` Flow: ${session.serverFlowName}`);
|
|
6436
6452
|
}
|
|
6437
|
-
lines.push(
|
|
6453
|
+
lines.push(
|
|
6454
|
+
session.server.endpoint ? ` Endpoint: ${session.server.endpoint}` : ` Endpoint: not live${arming ? " yet (still arming)" : ""}`
|
|
6455
|
+
);
|
|
6456
|
+
lines.push(" Env:");
|
|
6457
|
+
lines.push(
|
|
6458
|
+
` WALKEROS_OBSERVER_URL=${session.server.env.WALKEROS_OBSERVER_URL}`
|
|
6459
|
+
);
|
|
6460
|
+
lines.push(
|
|
6461
|
+
` WALKEROS_DEPLOYMENT_ID=${session.server.env.WALKEROS_DEPLOYMENT_ID}`
|
|
6462
|
+
);
|
|
6463
|
+
lines.push(
|
|
6464
|
+
` WALKEROS_INGEST_TOKEN=${session.server.env.WALKEROS_INGEST_TOKEN}`
|
|
6465
|
+
);
|
|
6438
6466
|
} else {
|
|
6439
6467
|
lines.push(
|
|
6440
|
-
` Server: no
|
|
6468
|
+
` Server: no server part${arming ? " yet (still arming)" : ""}`
|
|
6441
6469
|
);
|
|
6442
6470
|
}
|
|
6443
6471
|
lines.push("");
|
|
6472
|
+
lines.push(` Expires: ${session.expiresAt}`);
|
|
6473
|
+
lines.push(` Records: ${session.recordsReceived}`);
|
|
6474
|
+
lines.push("");
|
|
6444
6475
|
lines.push(
|
|
6445
6476
|
" The session lives server-side; closing this terminal does not end it."
|
|
6446
6477
|
);
|
|
6478
|
+
lines.push(
|
|
6479
|
+
" Sessions idle out server-side when no tab or traffic keeps them alive."
|
|
6480
|
+
);
|
|
6447
6481
|
return {
|
|
6448
|
-
stdoutLast: session.
|
|
6482
|
+
stdoutLast: session.server?.endpoint ?? null,
|
|
6449
6483
|
stderr: lines.join("\n")
|
|
6450
6484
|
};
|
|
6451
6485
|
}
|
|
@@ -6480,15 +6514,20 @@ async function observeStartCommand(flowId, options) {
|
|
|
6480
6514
|
printLoginCta();
|
|
6481
6515
|
return;
|
|
6482
6516
|
}
|
|
6517
|
+
let level;
|
|
6483
6518
|
if (options.level !== void 0) {
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6519
|
+
if (!isObserveLevel(options.level)) {
|
|
6520
|
+
throw new Error(
|
|
6521
|
+
`Invalid --level value: ${options.level} (expected ${OBSERVE_LEVELS2.join(", ")})`
|
|
6522
|
+
);
|
|
6523
|
+
}
|
|
6524
|
+
level = options.level;
|
|
6487
6525
|
}
|
|
6488
6526
|
let timeoutSeconds = DEFAULT_WAIT_SECONDS;
|
|
6489
6527
|
if (options.timeout !== void 0) {
|
|
6490
|
-
|
|
6491
|
-
|
|
6528
|
+
const rawTimeout = options.timeout.trim();
|
|
6529
|
+
timeoutSeconds = rawTimeout === "" ? Number.NaN : Number(rawTimeout);
|
|
6530
|
+
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds < 0) {
|
|
6492
6531
|
throw new Error(
|
|
6493
6532
|
`Invalid --timeout value: ${options.timeout} (expected a non-negative number of seconds)`
|
|
6494
6533
|
);
|
|
@@ -6500,7 +6539,8 @@ async function observeStartCommand(flowId, options) {
|
|
|
6500
6539
|
projectId,
|
|
6501
6540
|
flowId,
|
|
6502
6541
|
settingsName,
|
|
6503
|
-
|
|
6542
|
+
...options.replace === true ? { replace: true } : {},
|
|
6543
|
+
...level !== void 0 ? { level } : {}
|
|
6504
6544
|
});
|
|
6505
6545
|
let timedOut = false;
|
|
6506
6546
|
if (options.wait !== false) {
|
|
@@ -6532,7 +6572,7 @@ async function observeStartCommand(flowId, options) {
|
|
|
6532
6572
|
handleCliError(error);
|
|
6533
6573
|
}
|
|
6534
6574
|
}
|
|
6535
|
-
var DEFAULT_WAIT_SECONDS, DEFAULT_POLL_INTERVAL_MS2;
|
|
6575
|
+
var OBSERVE_LEVELS2, DEFAULT_WAIT_SECONDS, DEFAULT_POLL_INTERVAL_MS2;
|
|
6536
6576
|
var init_observe = __esm({
|
|
6537
6577
|
"src/commands/observe/index.ts"() {
|
|
6538
6578
|
"use strict";
|
|
@@ -6542,6 +6582,7 @@ var init_observe = __esm({
|
|
|
6542
6582
|
init_output();
|
|
6543
6583
|
init_config_file();
|
|
6544
6584
|
init_flows();
|
|
6585
|
+
OBSERVE_LEVELS2 = ["off", "standard", "trace"];
|
|
6545
6586
|
DEFAULT_WAIT_SECONDS = 300;
|
|
6546
6587
|
DEFAULT_POLL_INTERVAL_MS2 = 3e3;
|
|
6547
6588
|
}
|
|
@@ -6643,7 +6684,7 @@ function U2(e4, t4, n5) {
|
|
|
6643
6684
|
function K2(e4) {
|
|
6644
6685
|
const t4 = [], n5 = [], { simulation: o4, ...r6 } = e4, s4 = U2(r6, /* @__PURE__ */ new WeakMap(), 0);
|
|
6645
6686
|
for (const e5 of o4) {
|
|
6646
|
-
const o5 =
|
|
6687
|
+
const o5 = jn(e5);
|
|
6647
6688
|
if (0 === o5.length) continue;
|
|
6648
6689
|
const r7 = o5.join(".");
|
|
6649
6690
|
if (o5.length - 1 >= 8) {
|
|
@@ -7356,7 +7397,7 @@ async function jt2(e4, t4, n5 = {}, o4) {
|
|
|
7356
7397
|
const E2 = n5.ingest ? { ...n5.ingest, _meta: { ...n5.ingest._meta, path: [...n5.ingest._meta.path] } } : I("unknown");
|
|
7357
7398
|
if (!C3.length && !r7.queueOn?.length) return I3(), { id: o5, destination: r7, skipped: true };
|
|
7358
7399
|
if (!C3.length && r7.queueOn?.length) {
|
|
7359
|
-
if (!
|
|
7400
|
+
if (!je(r7.config.consent, s4)) return I3(), { id: o5, destination: r7, skipped: true };
|
|
7360
7401
|
let t5 = false;
|
|
7361
7402
|
try {
|
|
7362
7403
|
t5 = await $t2(e4, r7, o5, true);
|
|
@@ -7368,7 +7409,7 @@ async function jt2(e4, t4, n5 = {}, o4) {
|
|
|
7368
7409
|
return I3(), { id: o5, destination: r7, skipped: !t5 };
|
|
7369
7410
|
}
|
|
7370
7411
|
const S2 = [], q3 = C3.filter((t5) => {
|
|
7371
|
-
const n6 =
|
|
7412
|
+
const n6 = je(r7.config.consent, s4, t5.consent);
|
|
7372
7413
|
if (n6) return t5.consent = n6, S2.push(t5), false;
|
|
7373
7414
|
const a5 = _(e4, { stepId: o("destination", o5), stepType: "destination", phase: "skip", eventId: "string" == typeof t5.id ? t5.id : "", now: Date.now(), ...T2(t5, E2, e4) });
|
|
7374
7415
|
return a5.skipReason = "consent", s4 && (a5.consent = { ...s4 }), r7.config.consent && (a5.meta = { required: { ...r7.config.consent } }), on(e4, a5), true;
|
|
@@ -7697,7 +7738,7 @@ function Nt2(e4, t4, n5) {
|
|
|
7697
7738
|
if (!o4 || !r6) throw new Error("Event name is invalid");
|
|
7698
7739
|
const { timestamp: s4 = Date.now(), name: a4 = `${o4} ${r6}`, data: i5 = {}, context: c2 = {}, globals: u2 = e4.globals, custom: d2 = {}, user: l3 = e4.user, nested: f3 = [], consent: p3 = e4.consent, id: g3 = Ne(), trigger: m3 = "", entity: h2 = o4, action: v3 = r6, timing: y3 = 0, source: w3 = { type: "collector", schema: "4" } } = t4, b3 = w3.count ?? (e4.count += 1), k3 = w3.trace ?? n5?._meta.trace ?? e4.trace, I3 = { ...w3, count: b3 };
|
|
7699
7740
|
void 0 !== k3 && (I3.trace = k3);
|
|
7700
|
-
const C3 = e4.name ?? w3.platform ?? "default", E2 = e4.release ?? "4.3.1
|
|
7741
|
+
const C3 = e4.name ?? w3.platform ?? "default", E2 = e4.release ?? "4.3.1";
|
|
7701
7742
|
return I3.release = { ...w3.release, [C3]: E2 }, { name: a4, data: i5, context: c2, globals: u2, custom: d2, user: l3, nested: f3, consent: p3, id: g3, trigger: m3, entity: h2, action: v3, timestamp: s4, timing: y3, source: I3 };
|
|
7702
7743
|
}
|
|
7703
7744
|
function Yt(e4, t4, n5) {
|
|
@@ -7721,7 +7762,7 @@ function rn2(e4, t4) {
|
|
|
7721
7762
|
const t5 = await nt(p3, c2, e4);
|
|
7722
7763
|
if (t5.ignore) return Dt({ ok: true });
|
|
7723
7764
|
if (c2.consent) {
|
|
7724
|
-
if (!
|
|
7765
|
+
if (!je(c2.consent, e4.consent, t5.event.consent)) return Dt({ ok: true });
|
|
7725
7766
|
}
|
|
7726
7767
|
p3 = t5.event;
|
|
7727
7768
|
}
|
|
@@ -8034,16 +8075,16 @@ function Cn2(e4, t4) {
|
|
|
8034
8075
|
} catch {
|
|
8035
8076
|
return null;
|
|
8036
8077
|
}
|
|
8037
|
-
})(),
|
|
8078
|
+
})(), r7 = t5 ?? (function() {
|
|
8038
8079
|
try {
|
|
8039
8080
|
return bn2.window?.localStorage.getItem(Nt) ?? null;
|
|
8040
8081
|
} catch {
|
|
8041
8082
|
return null;
|
|
8042
8083
|
}
|
|
8043
8084
|
})();
|
|
8044
|
-
if (!
|
|
8045
|
-
const u2 = xn(
|
|
8046
|
-
if (!u2) return void (null === t5 ? (e4.logger.warn("observe: malformed stored credential cleared"), kn2(
|
|
8085
|
+
if (!r7) return;
|
|
8086
|
+
const u2 = xn(r7);
|
|
8087
|
+
if (!u2) return void (null === t5 ? (e4.logger.warn("observe: malformed stored credential cleared"), kn2(r7)) : e4.logger.warn("observe: malformed credential ignored"));
|
|
8047
8088
|
if (u2.pb !== n5.binding) return void e4.logger.warn("observe: credential binding mismatch, credential ignored");
|
|
8048
8089
|
let d2;
|
|
8049
8090
|
!(function(e5) {
|
|
@@ -8051,18 +8092,18 @@ function Cn2(e4, t4) {
|
|
|
8051
8092
|
bn2.window?.localStorage.setItem(Nt, e5);
|
|
8052
8093
|
} catch {
|
|
8053
8094
|
}
|
|
8054
|
-
})(
|
|
8095
|
+
})(r7), null !== t5 && (function() {
|
|
8055
8096
|
const e5 = bn2.window, t6 = bn2.URLSearchParams;
|
|
8056
8097
|
if (e5 && t6) try {
|
|
8057
|
-
const n6 = e5.location.href, o5 = n6.indexOf("#"),
|
|
8098
|
+
const n6 = e5.location.href, o5 = n6.indexOf("#"), r8 = o5 >= 0 ? n6.slice(o5) : "", a4 = o5 >= 0 ? n6.slice(0, o5) : n6, i5 = a4.indexOf("?"), c2 = i5 >= 0 ? a4.slice(0, i5) : a4, u3 = new t6(i5 >= 0 ? a4.slice(i5 + 1) : "");
|
|
8058
8099
|
u3.delete(Nt);
|
|
8059
8100
|
const d3 = u3.toString();
|
|
8060
|
-
e5.history.replaceState({}, "", `${c2}${d3 ? `?${d3}` : ""}${
|
|
8101
|
+
e5.history.replaceState({}, "", `${c2}${d3 ? `?${d3}` : ""}${r8}`);
|
|
8061
8102
|
} catch {
|
|
8062
8103
|
}
|
|
8063
8104
|
})();
|
|
8064
8105
|
const l3 = sn({ url: `${n5.url}/ingest/${u2.ses}`, token: u2.secret, headers: { "X-Walkeros-Binding": n5.binding }, onStatus: (t6) => {
|
|
8065
|
-
401 === t6 && (kn2(
|
|
8106
|
+
401 === t6 && (kn2(r7), d2 && e4.observers.delete(d2));
|
|
8066
8107
|
} });
|
|
8067
8108
|
d2 = vt(/* @__PURE__ */ (function(e5, t6) {
|
|
8068
8109
|
return void 0 === t6 ? e5 : (n6) => e5({ ...n6, flowId: t6 });
|
|
@@ -8070,7 +8111,9 @@ function Cn2(e4, t4) {
|
|
|
8070
8111
|
const f3 = n5.level;
|
|
8071
8112
|
return void (void 0 !== f3 && (e4.observeLevel = () => f3));
|
|
8072
8113
|
}
|
|
8073
|
-
"off"
|
|
8114
|
+
if ("off" === n5.level) return;
|
|
8115
|
+
const r6 = n5.level;
|
|
8116
|
+
void 0 !== r6 && (e4.observeLevel = () => r6), e4.observers.add(vt(In(sn({ url: `${n5.url}/ingest/${n5.sessionId}`, token: n5.token }), e4.release), { flowId: o4, level: n5.level, sample: n5.sample }));
|
|
8074
8117
|
}
|
|
8075
8118
|
async function En(e4) {
|
|
8076
8119
|
e4 = e4 || {};
|
|
@@ -13750,7 +13793,7 @@ function validateMapping(input) {
|
|
|
13750
13793
|
// src/commands/validate/validators/entry.ts
|
|
13751
13794
|
init_dist();
|
|
13752
13795
|
import Ajv from "ajv";
|
|
13753
|
-
var CLIENT_HEADER = "walkeros-cli/4.3.1
|
|
13796
|
+
var CLIENT_HEADER = "walkeros-cli/4.3.1";
|
|
13754
13797
|
var SECTIONS = ["destinations", "sources", "transformers"];
|
|
13755
13798
|
function resolveEntry(path19, flowConfig) {
|
|
13756
13799
|
const flows = flowConfig.flows;
|
|
@@ -15161,7 +15204,7 @@ observeCmd.command("start <flowId>").description(
|
|
|
15161
15204
|
"Flow settings name (auto-resolved when the flow has exactly one)"
|
|
15162
15205
|
).option("--project <projectId>", "Project ID (overrides default)").option(
|
|
15163
15206
|
"--level <level>",
|
|
15164
|
-
"Observation detail level
|
|
15207
|
+
"Observation detail level: off, standard, or trace"
|
|
15165
15208
|
).option("--replace", "Replace an existing active session for this flow").option("--no-wait", "Do not wait for the session to settle").option(
|
|
15166
15209
|
"--timeout <seconds>",
|
|
15167
15210
|
"Seconds to wait for the session to settle (default: 300)"
|