@walkeros/cli 2.1.0 → 2.2.0-next-1772811722420
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 +31 -0
- package/dist/cli.js +1301 -1149
- package/dist/examples/flow-complete.json +47 -5
- package/dist/index.d.ts +2211 -400
- package/dist/index.js +420 -359
- package/dist/index.js.map +1 -1
- package/dist/runtime/main.js +507 -367
- package/examples/flow-complete.json +47 -5
- package/package.json +5 -5
package/dist/runtime/main.js
CHANGED
|
@@ -31,179 +31,183 @@ var init_stdin = __esm({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
// ../core/dist/index.mjs
|
|
34
|
-
function
|
|
35
|
-
const n3 = { ...
|
|
36
|
-
for (const o2 of Object.keys(
|
|
37
|
-
const r2 =
|
|
38
|
-
"required" === o2 && Array.isArray(r2) && Array.isArray(i2) ? n3[o2] = [.../* @__PURE__ */ new Set([...r2, ...i2])] :
|
|
34
|
+
function O(e3, t) {
|
|
35
|
+
const n3 = { ...e3 };
|
|
36
|
+
for (const o2 of Object.keys(t)) {
|
|
37
|
+
const r2 = e3[o2], i2 = t[o2];
|
|
38
|
+
"required" === o2 && Array.isArray(r2) && Array.isArray(i2) ? n3[o2] = [.../* @__PURE__ */ new Set([...r2, ...i2])] : S(r2) && S(i2) ? n3[o2] = O(r2, i2) : n3[o2] = i2;
|
|
39
39
|
}
|
|
40
40
|
return n3;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function $(e3, t, n3, o2) {
|
|
43
43
|
let r2 = {};
|
|
44
|
-
for (const i2 of [
|
|
44
|
+
for (const i2 of [e3, o2]) {
|
|
45
45
|
if (!i2) continue;
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
46
|
+
const e4 = [x(i2, "*", "*"), x(i2, "*", n3), x(i2, t, "*"), x(i2, t, n3)];
|
|
47
|
+
for (const t2 of e4) t2 && (r2 = O(r2, t2));
|
|
48
48
|
}
|
|
49
49
|
return r2;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const o2 =
|
|
51
|
+
function x(e3, t, n3) {
|
|
52
|
+
const o2 = e3[t];
|
|
53
53
|
if (!o2 || "object" != typeof o2) return;
|
|
54
54
|
const r2 = o2[n3];
|
|
55
55
|
return r2 && "object" == typeof r2 ? r2 : void 0;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return "object" == typeof
|
|
57
|
+
function S(e3) {
|
|
58
|
+
return "object" == typeof e3 && null !== e3 && !Array.isArray(e3);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
throw new Error(String(
|
|
60
|
+
function E(e3) {
|
|
61
|
+
throw new Error(String(e3));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
for (const n3 of
|
|
66
|
-
return
|
|
63
|
+
function A(...e3) {
|
|
64
|
+
const t = {};
|
|
65
|
+
for (const n3 of e3) n3 && Object.assign(t, n3);
|
|
66
|
+
return t;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const
|
|
70
|
-
for (const n3 of
|
|
71
|
-
return
|
|
68
|
+
function N(...e3) {
|
|
69
|
+
const t = {};
|
|
70
|
+
for (const n3 of e3) n3 && Object.assign(t, n3);
|
|
71
|
+
return t;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if ("string" == typeof
|
|
75
|
-
const r2 =
|
|
73
|
+
function P(e3, t, n3, o2) {
|
|
74
|
+
if ("string" == typeof e3) {
|
|
75
|
+
const r2 = e3.match(/^\$def\.([a-zA-Z_][a-zA-Z0-9_]*)$/);
|
|
76
76
|
if (r2) {
|
|
77
|
-
const
|
|
78
|
-
return void 0 === n3[
|
|
77
|
+
const e4 = r2[1];
|
|
78
|
+
return void 0 === n3[e4] && E(`Definition "${e4}" not found`), P(n3[e4], t, n3, o2);
|
|
79
79
|
}
|
|
80
|
-
let i2 =
|
|
81
|
-
if (void 0 !==
|
|
82
|
-
|
|
80
|
+
let i2 = e3.replace(/\$var\.([a-zA-Z_][a-zA-Z0-9_]*)/g, (e4, n4) => {
|
|
81
|
+
if (void 0 !== t[n4]) return String(t[n4]);
|
|
82
|
+
E(`Variable "${n4}" not found`);
|
|
83
83
|
});
|
|
84
|
-
return i2 = i2.replace(/\$env\.([a-zA-Z_][a-zA-Z0-9_]*)(?::([^"}\s]*))?/g, (
|
|
84
|
+
return i2 = i2.replace(/\$env\.([a-zA-Z_][a-zA-Z0-9_]*)(?::([^"}\s]*))?/g, (e4, t2, n4) => o2?.deferred ? void 0 !== n4 ? `${T}${t2}:${n4}` : `${T}${t2}` : "undefined" != typeof process && void 0 !== process.env?.[t2] ? process.env[t2] : void 0 !== n4 ? n4 : void E(`Environment variable "${t2}" not found and no default provided`)), i2;
|
|
85
85
|
}
|
|
86
|
-
if (Array.isArray(
|
|
87
|
-
if (null !==
|
|
86
|
+
if (Array.isArray(e3)) return e3.map((e4) => P(e4, t, n3, o2));
|
|
87
|
+
if (null !== e3 && "object" == typeof e3) {
|
|
88
88
|
const r2 = {};
|
|
89
|
-
for (const [i2, s2] of Object.entries(
|
|
89
|
+
for (const [i2, s2] of Object.entries(e3)) r2[i2] = P(s2, t, n3, o2);
|
|
90
90
|
return r2;
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return e3;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
return
|
|
94
|
+
function _(e3) {
|
|
95
|
+
const t = e3.startsWith("@"), n3 = e3.replace("@", "").replace(/[/-]/g, "_").split("_").filter((e4) => e4.length > 0).map((e4, t2) => 0 === t2 ? e4 : e4.charAt(0).toUpperCase() + e4.slice(1)).join("");
|
|
96
|
+
return t ? "_" + n3 : n3;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
100
|
-
if (!
|
|
101
|
-
return n3[
|
|
98
|
+
function R(e3, t, n3) {
|
|
99
|
+
if (t) return t;
|
|
100
|
+
if (!e3 || !n3) return;
|
|
101
|
+
return n3[e3] ? _(e3) : void 0;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const o2 = Object.keys(
|
|
105
|
-
|
|
106
|
-
const r2 =
|
|
107
|
-
r2 ||
|
|
103
|
+
function C(e3, t, n3) {
|
|
104
|
+
const o2 = Object.keys(e3.flows);
|
|
105
|
+
t || (1 === o2.length ? t = o2[0] : E(`Multiple flows found (${o2.join(", ")}). Please specify a flow.`));
|
|
106
|
+
const r2 = e3.flows[t];
|
|
107
|
+
r2 || E(`Flow "${t}" not found. Available: ${o2.join(", ")}`);
|
|
108
108
|
const i2 = JSON.parse(JSON.stringify(r2));
|
|
109
|
-
if (i2.sources) for (const [
|
|
110
|
-
const s3 =
|
|
111
|
-
i2.sources[
|
|
109
|
+
if (i2.sources) for (const [t2, o3] of Object.entries(i2.sources)) {
|
|
110
|
+
const s3 = A(e3.variables, r2.variables, o3.variables), c3 = N(e3.definitions, r2.definitions, o3.definitions), a3 = P(o3.config, s3, c3, n3), u4 = R(o3.package, o3.code, i2.packages), f2 = "string" == typeof o3.code || "object" == typeof o3.code ? o3.code : void 0, l2 = u4 || f2;
|
|
111
|
+
i2.sources[t2] = { package: o3.package, config: a3, env: o3.env, primary: o3.primary, variables: o3.variables, definitions: o3.definitions, next: o3.next, code: l2 };
|
|
112
112
|
}
|
|
113
|
-
if (i2.destinations) for (const [
|
|
114
|
-
const s3 =
|
|
115
|
-
i2.destinations[
|
|
113
|
+
if (i2.destinations) for (const [t2, o3] of Object.entries(i2.destinations)) {
|
|
114
|
+
const s3 = A(e3.variables, r2.variables, o3.variables), c3 = N(e3.definitions, r2.definitions, o3.definitions), a3 = P(o3.config, s3, c3, n3), u4 = R(o3.package, o3.code, i2.packages), f2 = "string" == typeof o3.code || "object" == typeof o3.code ? o3.code : void 0, l2 = u4 || f2;
|
|
115
|
+
i2.destinations[t2] = { package: o3.package, config: a3, env: o3.env, variables: o3.variables, definitions: o3.definitions, before: o3.before, code: l2 };
|
|
116
|
+
}
|
|
117
|
+
if (i2.stores) for (const [t2, o3] of Object.entries(i2.stores)) {
|
|
118
|
+
const s3 = A(e3.variables, r2.variables, o3.variables), c3 = N(e3.definitions, r2.definitions, o3.definitions), a3 = P(o3.config, s3, c3, n3), u4 = R(o3.package, o3.code, i2.packages), f2 = "string" == typeof o3.code || "object" == typeof o3.code ? o3.code : void 0, l2 = u4 || f2;
|
|
119
|
+
i2.stores[t2] = { package: o3.package, config: a3, env: o3.env, variables: o3.variables, definitions: o3.definitions, code: l2 };
|
|
116
120
|
}
|
|
117
121
|
if (i2.collector) {
|
|
118
|
-
const
|
|
122
|
+
const t2 = A(e3.variables, r2.variables), o3 = N(e3.definitions, r2.definitions), s3 = P(i2.collector, t2, o3, n3);
|
|
119
123
|
i2.collector = s3;
|
|
120
124
|
}
|
|
121
|
-
const s2 =
|
|
125
|
+
const s2 = e3.contract, c2 = r2.contract;
|
|
122
126
|
if (s2 || c2) {
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
for (const n6 of
|
|
126
|
-
if (
|
|
127
|
-
const o4 = n6[
|
|
128
|
-
if (o4 && "object" == typeof o4) for (const n7 of Object.keys(o4)) "*" !== n7 &&
|
|
127
|
+
const e4 = (function(...e5) {
|
|
128
|
+
const t3 = /* @__PURE__ */ new Set();
|
|
129
|
+
for (const n6 of e5) if (n6) for (const e6 of Object.keys(n6)) {
|
|
130
|
+
if (e6.startsWith("$")) continue;
|
|
131
|
+
const o4 = n6[e6];
|
|
132
|
+
if (o4 && "object" == typeof o4) for (const n7 of Object.keys(o4)) "*" !== n7 && t3.add(`${e6}\0${n7}`);
|
|
129
133
|
}
|
|
130
134
|
const n5 = /* @__PURE__ */ new Set(), o3 = /* @__PURE__ */ new Set();
|
|
131
|
-
for (const
|
|
132
|
-
if (
|
|
133
|
-
n5.add(
|
|
134
|
-
const r3 =
|
|
135
|
-
if (r3 && "object" == typeof r3) for (const
|
|
135
|
+
for (const t4 of e5) if (t4) for (const e6 of Object.keys(t4)) {
|
|
136
|
+
if (e6.startsWith("$") || "*" === e6) continue;
|
|
137
|
+
n5.add(e6);
|
|
138
|
+
const r3 = t4[e6];
|
|
139
|
+
if (r3 && "object" == typeof r3) for (const e7 of Object.keys(r3)) "*" !== e7 && o3.add(e7);
|
|
136
140
|
}
|
|
137
|
-
for (const
|
|
138
|
-
return [...
|
|
139
|
-
})(s2, c2),
|
|
140
|
-
for (const [n5, o3] of
|
|
141
|
-
const
|
|
142
|
-
Object.keys(
|
|
141
|
+
for (const e6 of n5) for (const n6 of o3) t3.add(`${e6}\0${n6}`);
|
|
142
|
+
return [...t3].map((e6) => e6.split("\0"));
|
|
143
|
+
})(s2, c2), t2 = {};
|
|
144
|
+
for (const [n5, o3] of e4) {
|
|
145
|
+
const e5 = $(s2 || {}, n5, o3, c2);
|
|
146
|
+
Object.keys(e5).length > 0 && (t2[n5] || (t2[n5] = {}), t2[n5][o3] = { schema: W(e5) });
|
|
143
147
|
}
|
|
144
|
-
if (i2.transformers) for (const [,
|
|
148
|
+
if (i2.transformers) for (const [, e5] of Object.entries(i2.transformers)) z(e5.config, t2);
|
|
145
149
|
const n4 = s2?.$tagging ?? c2?.$tagging;
|
|
146
150
|
if ("number" == typeof n4) {
|
|
147
|
-
const
|
|
148
|
-
void 0 ===
|
|
151
|
+
const e5 = i2.collector || {};
|
|
152
|
+
void 0 === e5.tagging && (e5.tagging = n4), i2.collector = e5;
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
return i2;
|
|
152
156
|
}
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
for (const [n3, o2] of Object.entries(
|
|
156
|
-
return
|
|
157
|
+
function W(e3) {
|
|
158
|
+
const t = {};
|
|
159
|
+
for (const [n3, o2] of Object.entries(e3)) M.has(n3) || (null === o2 || "object" != typeof o2 || Array.isArray(o2) ? t[n3] = o2 : t[n3] = W(o2));
|
|
160
|
+
return t;
|
|
157
161
|
}
|
|
158
|
-
function
|
|
159
|
-
if (!
|
|
160
|
-
const n3 =
|
|
161
|
-
for (const
|
|
162
|
+
function z(e3, t) {
|
|
163
|
+
if (!e3 || "object" != typeof e3) return;
|
|
164
|
+
const n3 = e3;
|
|
165
|
+
for (const e4 of Object.keys(n3)) "$contract" === n3[e4] ? n3[e4] = t : "object" == typeof n3[e4] && null !== n3[e4] && z(n3[e4], t);
|
|
162
166
|
}
|
|
163
|
-
function
|
|
164
|
-
return void 0 !==
|
|
167
|
+
function D(e3) {
|
|
168
|
+
return void 0 !== e3.web ? "web" : void 0 !== e3.server ? "server" : void E("Config must have web or server key");
|
|
165
169
|
}
|
|
166
|
-
function
|
|
167
|
-
return { message:
|
|
170
|
+
function fe(e3) {
|
|
171
|
+
return { message: e3.message, name: e3.name, stack: e3.stack, cause: e3.cause };
|
|
168
172
|
}
|
|
169
|
-
function
|
|
173
|
+
function le(e3, t) {
|
|
170
174
|
let n3, o2 = {};
|
|
171
|
-
return
|
|
172
|
-
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
175
|
-
return "string" == typeof
|
|
176
|
-
})(
|
|
177
|
-
}
|
|
178
|
-
function
|
|
179
|
-
const { level:
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
n3 ? n3(
|
|
175
|
+
return e3 instanceof Error ? (n3 = e3.message, o2.error = fe(e3)) : n3 = e3, void 0 !== t && (t instanceof Error ? o2.error = fe(t) : "object" == typeof t && null !== t ? (o2 = { ...o2, ...t }, "error" in o2 && o2.error instanceof Error && (o2.error = fe(o2.error))) : o2.value = t), { message: n3, context: o2 };
|
|
176
|
+
}
|
|
177
|
+
function de(e3 = {}) {
|
|
178
|
+
return ge({ level: void 0 !== e3.level ? (function(e4) {
|
|
179
|
+
return "string" == typeof e4 ? u[e4] : e4;
|
|
180
|
+
})(e3.level) : 0, handler: e3.handler, jsonHandler: e3.jsonHandler, scope: [] });
|
|
181
|
+
}
|
|
182
|
+
function ge(e3) {
|
|
183
|
+
const { level: t, handler: n3, jsonHandler: o2, scope: r2 } = e3, i2 = (e4, o3, i3) => {
|
|
184
|
+
if (e4 <= t) {
|
|
185
|
+
const t2 = le(o3, i3);
|
|
186
|
+
n3 ? n3(e4, t2.message, t2.context, r2, pe) : pe(e4, t2.message, t2.context, r2);
|
|
183
187
|
}
|
|
184
188
|
};
|
|
185
|
-
return { error: (
|
|
186
|
-
const o3 =
|
|
187
|
-
throw n3 ? n3(0, o3.message, o3.context, r2,
|
|
188
|
-
}, json: (
|
|
189
|
-
o2 ? o2(
|
|
190
|
-
}, scope: (
|
|
191
|
-
}
|
|
192
|
-
var
|
|
189
|
+
return { error: (e4, t2) => i2(0, e4, t2), warn: (e4, t2) => i2(1, e4, t2), info: (e4, t2) => i2(2, e4, t2), debug: (e4, t2) => i2(3, e4, t2), throw: (e4, t2) => {
|
|
190
|
+
const o3 = le(e4, t2);
|
|
191
|
+
throw n3 ? n3(0, o3.message, o3.context, r2, pe) : pe(0, o3.message, o3.context, r2), new Error(o3.message);
|
|
192
|
+
}, json: (e4) => {
|
|
193
|
+
o2 ? o2(e4) : console.log(JSON.stringify(e4, null, 2));
|
|
194
|
+
}, scope: (e4) => ge({ level: t, handler: n3, jsonHandler: o2, scope: [...r2, e4] }) };
|
|
195
|
+
}
|
|
196
|
+
var e, a, u, T, M, pe;
|
|
193
197
|
var init_dist = __esm({
|
|
194
198
|
"../core/dist/index.mjs"() {
|
|
195
199
|
"use strict";
|
|
196
|
-
|
|
200
|
+
e = Object.defineProperty;
|
|
197
201
|
a = {};
|
|
198
|
-
((
|
|
199
|
-
for (var o2 in n3) t
|
|
202
|
+
((t, n3) => {
|
|
203
|
+
for (var o2 in n3) e(t, o2, { get: n3[o2], enumerable: true });
|
|
200
204
|
})(a, { Level: () => u });
|
|
201
|
-
u = ((
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const r2 = `${u[
|
|
206
|
-
i2 ? s2(r2,
|
|
205
|
+
u = ((e3) => (e3[e3.ERROR = 0] = "ERROR", e3[e3.WARN = 1] = "WARN", e3[e3.INFO = 2] = "INFO", e3[e3.DEBUG = 3] = "DEBUG", e3))(u || {});
|
|
206
|
+
T = "__WALKEROS_ENV:";
|
|
207
|
+
M = /* @__PURE__ */ new Set(["description", "examples", "title", "$comment"]);
|
|
208
|
+
pe = (e3, t, n3, o2) => {
|
|
209
|
+
const r2 = `${u[e3]}${o2.length > 0 ? ` [${o2.join(":")}]` : ""}`, i2 = Object.keys(n3).length > 0, s2 = 0 === e3 ? console.error : 1 === e3 ? console.warn : console.log;
|
|
210
|
+
i2 ? s2(r2, t, n3) : s2(r2, t);
|
|
207
211
|
};
|
|
208
212
|
}
|
|
209
213
|
});
|
|
@@ -218,7 +222,7 @@ function createCLILogger(options = {}) {
|
|
|
218
222
|
stderr = false
|
|
219
223
|
} = options;
|
|
220
224
|
const out = stderr ? console.error : console.log;
|
|
221
|
-
return
|
|
225
|
+
return de({
|
|
222
226
|
// Let handler control visibility — pass everything through
|
|
223
227
|
level: u.DEBUG,
|
|
224
228
|
handler: (level, message, _context, scope) => {
|
|
@@ -578,9 +582,9 @@ function $constructor(name, initializer3, params) {
|
|
|
578
582
|
const proto = _3.prototype;
|
|
579
583
|
const keys = Object.keys(proto);
|
|
580
584
|
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
581
|
-
const
|
|
582
|
-
if (!(
|
|
583
|
-
inst[
|
|
585
|
+
const k2 = keys[i2];
|
|
586
|
+
if (!(k2 in inst)) {
|
|
587
|
+
inst[k2] = proto[k2].bind(inst);
|
|
584
588
|
}
|
|
585
589
|
}
|
|
586
590
|
}
|
|
@@ -718,7 +722,7 @@ function assert(_3) {
|
|
|
718
722
|
}
|
|
719
723
|
function getEnumValues(entries) {
|
|
720
724
|
const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
|
|
721
|
-
const values = Object.entries(entries).filter(([
|
|
725
|
+
const values = Object.entries(entries).filter(([k2, _3]) => numericValues.indexOf(+k2) === -1).map(([_3, v2]) => v2);
|
|
722
726
|
return values;
|
|
723
727
|
}
|
|
724
728
|
function joinValues(array2, separator = "|") {
|
|
@@ -940,8 +944,8 @@ function stringifyPrimitive(value) {
|
|
|
940
944
|
return `${value}`;
|
|
941
945
|
}
|
|
942
946
|
function optionalKeys(shape) {
|
|
943
|
-
return Object.keys(shape).filter((
|
|
944
|
-
return shape[
|
|
947
|
+
return Object.keys(shape).filter((k2) => {
|
|
948
|
+
return shape[k2]._zod.optin === "optional" && shape[k2]._zod.optout === "optional";
|
|
945
949
|
});
|
|
946
950
|
}
|
|
947
951
|
function pick(schema, mask) {
|
|
@@ -1165,8 +1169,8 @@ function getLengthableOrigin(input) {
|
|
|
1165
1169
|
return "unknown";
|
|
1166
1170
|
}
|
|
1167
1171
|
function parsedType(data) {
|
|
1168
|
-
const
|
|
1169
|
-
switch (
|
|
1172
|
+
const t = typeof data;
|
|
1173
|
+
switch (t) {
|
|
1170
1174
|
case "number": {
|
|
1171
1175
|
return Number.isNaN(data) ? "nan" : "number";
|
|
1172
1176
|
}
|
|
@@ -1183,7 +1187,7 @@ function parsedType(data) {
|
|
|
1183
1187
|
}
|
|
1184
1188
|
}
|
|
1185
1189
|
}
|
|
1186
|
-
return
|
|
1190
|
+
return t;
|
|
1187
1191
|
}
|
|
1188
1192
|
function issue(...args) {
|
|
1189
1193
|
const [iss, input, inst] = args;
|
|
@@ -1198,8 +1202,8 @@ function issue(...args) {
|
|
|
1198
1202
|
return { ...iss };
|
|
1199
1203
|
}
|
|
1200
1204
|
function cleanEnum(obj) {
|
|
1201
|
-
return Object.entries(obj).filter(([
|
|
1202
|
-
return Number.isNaN(Number.parseInt(
|
|
1205
|
+
return Object.entries(obj).filter(([k2, _3]) => {
|
|
1206
|
+
return Number.isNaN(Number.parseInt(k2, 10));
|
|
1203
1207
|
}).map((el) => el[1]);
|
|
1204
1208
|
}
|
|
1205
1209
|
function base64ToUint8Array(base643) {
|
|
@@ -1259,8 +1263,8 @@ var init_util = __esm({
|
|
|
1259
1263
|
}
|
|
1260
1264
|
});
|
|
1261
1265
|
getParsedType = (data) => {
|
|
1262
|
-
const
|
|
1263
|
-
switch (
|
|
1266
|
+
const t = typeof data;
|
|
1267
|
+
switch (t) {
|
|
1264
1268
|
case "undefined":
|
|
1265
1269
|
return "undefined";
|
|
1266
1270
|
case "string":
|
|
@@ -1299,7 +1303,7 @@ var init_util = __esm({
|
|
|
1299
1303
|
}
|
|
1300
1304
|
return "object";
|
|
1301
1305
|
default:
|
|
1302
|
-
throw new Error(`Unknown data type: ${
|
|
1306
|
+
throw new Error(`Unknown data type: ${t}`);
|
|
1303
1307
|
}
|
|
1304
1308
|
};
|
|
1305
1309
|
propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
@@ -1481,9 +1485,9 @@ var init_parse = __esm({
|
|
|
1481
1485
|
throw new $ZodAsyncError();
|
|
1482
1486
|
}
|
|
1483
1487
|
if (result.issues.length) {
|
|
1484
|
-
const
|
|
1485
|
-
captureStackTrace(
|
|
1486
|
-
throw
|
|
1488
|
+
const e3 = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1489
|
+
captureStackTrace(e3, _params?.callee);
|
|
1490
|
+
throw e3;
|
|
1487
1491
|
}
|
|
1488
1492
|
return result.value;
|
|
1489
1493
|
};
|
|
@@ -1494,9 +1498,9 @@ var init_parse = __esm({
|
|
|
1494
1498
|
if (result instanceof Promise)
|
|
1495
1499
|
result = await result;
|
|
1496
1500
|
if (result.issues.length) {
|
|
1497
|
-
const
|
|
1498
|
-
captureStackTrace(
|
|
1499
|
-
throw
|
|
1501
|
+
const e3 = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1502
|
+
captureStackTrace(e3, params?.callee);
|
|
1503
|
+
throw e3;
|
|
1500
1504
|
}
|
|
1501
1505
|
return result.value;
|
|
1502
1506
|
};
|
|
@@ -2402,9 +2406,9 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
2402
2406
|
}
|
|
2403
2407
|
function normalizeDef(def) {
|
|
2404
2408
|
const keys = Object.keys(def.shape);
|
|
2405
|
-
for (const
|
|
2406
|
-
if (!def.shape?.[
|
|
2407
|
-
throw new Error(`Invalid element at key "${
|
|
2409
|
+
for (const k2 of keys) {
|
|
2410
|
+
if (!def.shape?.[k2]?._zod?.traits?.has("$ZodType")) {
|
|
2411
|
+
throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
|
|
2408
2412
|
}
|
|
2409
2413
|
}
|
|
2410
2414
|
const okeys = optionalKeys(def.shape);
|
|
@@ -2420,12 +2424,12 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
2420
2424
|
const unrecognized = [];
|
|
2421
2425
|
const keySet = def.keySet;
|
|
2422
2426
|
const _catchall = def.catchall._zod;
|
|
2423
|
-
const
|
|
2427
|
+
const t = _catchall.def.type;
|
|
2424
2428
|
const isOptionalOut = _catchall.optout === "optional";
|
|
2425
2429
|
for (const key in input) {
|
|
2426
2430
|
if (keySet.has(key))
|
|
2427
2431
|
continue;
|
|
2428
|
-
if (
|
|
2432
|
+
if (t === "never") {
|
|
2429
2433
|
unrecognized.push(key);
|
|
2430
2434
|
continue;
|
|
2431
2435
|
}
|
|
@@ -2544,10 +2548,10 @@ function handleIntersectionResults(result, left, right) {
|
|
|
2544
2548
|
for (const iss of left.issues) {
|
|
2545
2549
|
if (iss.code === "unrecognized_keys") {
|
|
2546
2550
|
unrecIssue ?? (unrecIssue = iss);
|
|
2547
|
-
for (const
|
|
2548
|
-
if (!unrecKeys.has(
|
|
2549
|
-
unrecKeys.set(
|
|
2550
|
-
unrecKeys.get(
|
|
2551
|
+
for (const k2 of iss.keys) {
|
|
2552
|
+
if (!unrecKeys.has(k2))
|
|
2553
|
+
unrecKeys.set(k2, {});
|
|
2554
|
+
unrecKeys.get(k2).l = true;
|
|
2551
2555
|
}
|
|
2552
2556
|
} else {
|
|
2553
2557
|
result.issues.push(iss);
|
|
@@ -2555,16 +2559,16 @@ function handleIntersectionResults(result, left, right) {
|
|
|
2555
2559
|
}
|
|
2556
2560
|
for (const iss of right.issues) {
|
|
2557
2561
|
if (iss.code === "unrecognized_keys") {
|
|
2558
|
-
for (const
|
|
2559
|
-
if (!unrecKeys.has(
|
|
2560
|
-
unrecKeys.set(
|
|
2561
|
-
unrecKeys.get(
|
|
2562
|
+
for (const k2 of iss.keys) {
|
|
2563
|
+
if (!unrecKeys.has(k2))
|
|
2564
|
+
unrecKeys.set(k2, {});
|
|
2565
|
+
unrecKeys.get(k2).r = true;
|
|
2562
2566
|
}
|
|
2563
2567
|
} else {
|
|
2564
2568
|
result.issues.push(iss);
|
|
2565
2569
|
}
|
|
2566
2570
|
}
|
|
2567
|
-
const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([
|
|
2571
|
+
const bothKeys = [...unrecKeys].filter(([, f2]) => f2.l && f2.r).map(([k2]) => k2);
|
|
2568
2572
|
if (bothKeys.length && unrecIssue) {
|
|
2569
2573
|
result.issues.push({ ...unrecIssue, keys: bothKeys });
|
|
2570
2574
|
}
|
|
@@ -3376,8 +3380,8 @@ var init_schemas = __esm({
|
|
|
3376
3380
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
3377
3381
|
const normalized = _normalized.value;
|
|
3378
3382
|
const parseStr = (key) => {
|
|
3379
|
-
const
|
|
3380
|
-
return `shape[${
|
|
3383
|
+
const k2 = esc(key);
|
|
3384
|
+
return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`;
|
|
3381
3385
|
};
|
|
3382
3386
|
doc.write(`const input = payload.value;`);
|
|
3383
3387
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -3388,27 +3392,27 @@ var init_schemas = __esm({
|
|
|
3388
3392
|
doc.write(`const newResult = {};`);
|
|
3389
3393
|
for (const key of normalized.keys) {
|
|
3390
3394
|
const id = ids[key];
|
|
3391
|
-
const
|
|
3395
|
+
const k2 = esc(key);
|
|
3392
3396
|
const schema = shape[key];
|
|
3393
3397
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
3394
3398
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
3395
3399
|
if (isOptionalOut) {
|
|
3396
3400
|
doc.write(`
|
|
3397
3401
|
if (${id}.issues.length) {
|
|
3398
|
-
if (${
|
|
3402
|
+
if (${k2} in input) {
|
|
3399
3403
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
3400
3404
|
...iss,
|
|
3401
|
-
path: iss.path ? [${
|
|
3405
|
+
path: iss.path ? [${k2}, ...iss.path] : [${k2}]
|
|
3402
3406
|
})));
|
|
3403
3407
|
}
|
|
3404
3408
|
}
|
|
3405
3409
|
|
|
3406
3410
|
if (${id}.value === undefined) {
|
|
3407
|
-
if (${
|
|
3408
|
-
newResult[${
|
|
3411
|
+
if (${k2} in input) {
|
|
3412
|
+
newResult[${k2}] = undefined;
|
|
3409
3413
|
}
|
|
3410
3414
|
} else {
|
|
3411
|
-
newResult[${
|
|
3415
|
+
newResult[${k2}] = ${id}.value;
|
|
3412
3416
|
}
|
|
3413
3417
|
|
|
3414
3418
|
`);
|
|
@@ -3417,16 +3421,16 @@ var init_schemas = __esm({
|
|
|
3417
3421
|
if (${id}.issues.length) {
|
|
3418
3422
|
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
3419
3423
|
...iss,
|
|
3420
|
-
path: iss.path ? [${
|
|
3424
|
+
path: iss.path ? [${k2}, ...iss.path] : [${k2}]
|
|
3421
3425
|
})));
|
|
3422
3426
|
}
|
|
3423
3427
|
|
|
3424
3428
|
if (${id}.value === undefined) {
|
|
3425
|
-
if (${
|
|
3426
|
-
newResult[${
|
|
3429
|
+
if (${k2} in input) {
|
|
3430
|
+
newResult[${k2}] = undefined;
|
|
3427
3431
|
}
|
|
3428
3432
|
} else {
|
|
3429
|
-
newResult[${
|
|
3433
|
+
newResult[${k2}] = ${id}.value;
|
|
3430
3434
|
}
|
|
3431
3435
|
|
|
3432
3436
|
`);
|
|
@@ -3553,11 +3557,11 @@ var init_schemas = __esm({
|
|
|
3553
3557
|
const pv = option._zod.propValues;
|
|
3554
3558
|
if (!pv || Object.keys(pv).length === 0)
|
|
3555
3559
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
3556
|
-
for (const [
|
|
3557
|
-
if (!propValues[
|
|
3558
|
-
propValues[
|
|
3560
|
+
for (const [k2, v2] of Object.entries(pv)) {
|
|
3561
|
+
if (!propValues[k2])
|
|
3562
|
+
propValues[k2] = /* @__PURE__ */ new Set();
|
|
3559
3563
|
for (const val of v2) {
|
|
3560
|
-
propValues[
|
|
3564
|
+
propValues[k2].add(val);
|
|
3561
3565
|
}
|
|
3562
3566
|
}
|
|
3563
3567
|
}
|
|
@@ -3863,7 +3867,7 @@ var init_schemas = __esm({
|
|
|
3863
3867
|
const values = getEnumValues(def.entries);
|
|
3864
3868
|
const valuesSet = new Set(values);
|
|
3865
3869
|
inst._zod.values = valuesSet;
|
|
3866
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((
|
|
3870
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k2) => propertyKeyTypes.has(typeof k2)).map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2.toString()).join("|")})$`);
|
|
3867
3871
|
inst._zod.parse = (payload, _ctx) => {
|
|
3868
3872
|
const input = payload.value;
|
|
3869
3873
|
if (valuesSet.has(input)) {
|
|
@@ -6203,17 +6207,17 @@ var init_he = __esm({
|
|
|
6203
6207
|
number: { unit: "", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }
|
|
6204
6208
|
// no unit
|
|
6205
6209
|
};
|
|
6206
|
-
const typeEntry = (
|
|
6207
|
-
const typeLabel = (
|
|
6208
|
-
const
|
|
6209
|
-
if (
|
|
6210
|
-
return
|
|
6211
|
-
return
|
|
6212
|
-
};
|
|
6213
|
-
const withDefinite = (
|
|
6214
|
-
const verbFor = (
|
|
6215
|
-
const
|
|
6216
|
-
const gender =
|
|
6210
|
+
const typeEntry = (t) => t ? TypeNames[t] : void 0;
|
|
6211
|
+
const typeLabel = (t) => {
|
|
6212
|
+
const e3 = typeEntry(t);
|
|
6213
|
+
if (e3)
|
|
6214
|
+
return e3.label;
|
|
6215
|
+
return t ?? TypeNames.unknown.label;
|
|
6216
|
+
};
|
|
6217
|
+
const withDefinite = (t) => `\u05D4${typeLabel(t)}`;
|
|
6218
|
+
const verbFor = (t) => {
|
|
6219
|
+
const e3 = typeEntry(t);
|
|
6220
|
+
const gender = e3?.gender ?? "m";
|
|
6217
6221
|
return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA";
|
|
6218
6222
|
};
|
|
6219
6223
|
const getSizing = (origin) => {
|
|
@@ -13267,11 +13271,11 @@ function record(keyType, valueType, params) {
|
|
|
13267
13271
|
});
|
|
13268
13272
|
}
|
|
13269
13273
|
function partialRecord(keyType, valueType, params) {
|
|
13270
|
-
const
|
|
13271
|
-
|
|
13274
|
+
const k2 = clone(keyType);
|
|
13275
|
+
k2._zod.values = void 0;
|
|
13272
13276
|
return new ZodRecord({
|
|
13273
13277
|
type: "record",
|
|
13274
|
-
keyType:
|
|
13278
|
+
keyType: k2,
|
|
13275
13279
|
valueType,
|
|
13276
13280
|
...util_exports.normalizeParams(params)
|
|
13277
13281
|
});
|
|
@@ -14256,8 +14260,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
14256
14260
|
}
|
|
14257
14261
|
const type = schema.type;
|
|
14258
14262
|
if (Array.isArray(type)) {
|
|
14259
|
-
const typeSchemas = type.map((
|
|
14260
|
-
const typeSchema = { ...schema, type:
|
|
14263
|
+
const typeSchemas = type.map((t) => {
|
|
14264
|
+
const typeSchema = { ...schema, type: t };
|
|
14261
14265
|
return convertBaseSchema(typeSchema, ctx);
|
|
14262
14266
|
});
|
|
14263
14267
|
if (typeSchemas.length === 0) {
|
|
@@ -14948,186 +14952,186 @@ var init_zod = __esm({
|
|
|
14948
14952
|
});
|
|
14949
14953
|
|
|
14950
14954
|
// ../core/dist/dev.mjs
|
|
14951
|
-
function o(
|
|
14952
|
-
return external_exports.toJSONSchema(
|
|
14955
|
+
function o(e3, n3, i2 = "draft-7") {
|
|
14956
|
+
return external_exports.toJSONSchema(e3, { target: i2 });
|
|
14953
14957
|
}
|
|
14954
|
-
function L(
|
|
14955
|
-
return external_exports.object({ data: external_exports.union([
|
|
14958
|
+
function L(e3, n3) {
|
|
14959
|
+
return external_exports.object({ data: external_exports.union([e3, n3]).optional().describe("Data transformation rules") }).partial();
|
|
14956
14960
|
}
|
|
14957
|
-
function N2(
|
|
14958
|
-
return external_exports.object({ mapping:
|
|
14961
|
+
function N2(e3) {
|
|
14962
|
+
return external_exports.object({ mapping: e3.optional().describe("Event mapping rules") }).partial();
|
|
14959
14963
|
}
|
|
14960
|
-
function
|
|
14961
|
-
return external_exports.object({ policy:
|
|
14964
|
+
function q(e3) {
|
|
14965
|
+
return external_exports.object({ policy: e3.optional().describe("Pre-processing policy rules") }).partial();
|
|
14962
14966
|
}
|
|
14963
|
-
function
|
|
14964
|
-
return external_exports.object({ consent:
|
|
14967
|
+
function T2(e3) {
|
|
14968
|
+
return external_exports.object({ consent: e3.optional().describe("Required consent states") }).partial();
|
|
14965
14969
|
}
|
|
14966
|
-
function
|
|
14967
|
-
return
|
|
14970
|
+
function oi(e3) {
|
|
14971
|
+
return ti.parse(e3);
|
|
14968
14972
|
}
|
|
14969
|
-
function
|
|
14970
|
-
return
|
|
14973
|
+
function ri(e3) {
|
|
14974
|
+
return ti.safeParse(e3);
|
|
14971
14975
|
}
|
|
14972
|
-
function
|
|
14973
|
-
return
|
|
14976
|
+
function ai(e3) {
|
|
14977
|
+
return Zn.parse(e3);
|
|
14974
14978
|
}
|
|
14975
|
-
function
|
|
14976
|
-
return
|
|
14979
|
+
function si(e3) {
|
|
14980
|
+
return Zn.safeParse(e3);
|
|
14977
14981
|
}
|
|
14978
|
-
function
|
|
14982
|
+
function fi(e3) {
|
|
14979
14983
|
let n3;
|
|
14980
14984
|
try {
|
|
14981
|
-
n3 = JSON.parse(
|
|
14985
|
+
n3 = JSON.parse(e3);
|
|
14982
14986
|
} catch (n4) {
|
|
14983
|
-
const { line: i3, column:
|
|
14984
|
-
if (
|
|
14985
|
-
const i4 =
|
|
14987
|
+
const { line: i3, column: t2 } = (function(e4, n5) {
|
|
14988
|
+
if (e4 instanceof SyntaxError) {
|
|
14989
|
+
const i4 = e4.message.match(/position\s+(\d+)/);
|
|
14986
14990
|
if (i4) {
|
|
14987
|
-
return
|
|
14991
|
+
return gi(n5, parseInt(i4[1], 10));
|
|
14988
14992
|
}
|
|
14989
|
-
const
|
|
14990
|
-
if (
|
|
14993
|
+
const t3 = e4.message.match(/line\s+(\d+)\s+column\s+(\d+)/);
|
|
14994
|
+
if (t3) return { line: parseInt(t3[1], 10), column: parseInt(t3[2], 10) };
|
|
14991
14995
|
}
|
|
14992
14996
|
return { line: 1, column: 1 };
|
|
14993
|
-
})(n4,
|
|
14994
|
-
return { valid: false, errors: [{ message: n4 instanceof Error ? n4.message : "Invalid JSON", severity: "error", line: i3, column:
|
|
14997
|
+
})(n4, e3);
|
|
14998
|
+
return { valid: false, errors: [{ message: n4 instanceof Error ? n4.message : "Invalid JSON", severity: "error", line: i3, column: t2 }], warnings: [] };
|
|
14995
14999
|
}
|
|
14996
|
-
const i2 = [],
|
|
15000
|
+
const i2 = [], t = [], o2 = ti.safeParse(n3);
|
|
14997
15001
|
if (!o2.success) for (const n4 of o2.error.issues) {
|
|
14998
|
-
const
|
|
14999
|
-
i2.push({ message: n4.message, severity: "error", path:
|
|
15002
|
+
const t2 = n4.path.join("."), o3 = vi(e3, n4.path);
|
|
15003
|
+
i2.push({ message: n4.message, severity: "error", path: t2 || "root", ...o3 });
|
|
15000
15004
|
}
|
|
15001
|
-
const r2 = (function(
|
|
15002
|
-
if (!(
|
|
15003
|
-
const n4 = {}, i3 = {},
|
|
15005
|
+
const r2 = (function(e4) {
|
|
15006
|
+
if (!(Si(e4) && "version" in e4 && "flows" in e4 && Si(e4.flows))) return;
|
|
15007
|
+
const n4 = {}, i3 = {}, t2 = [], o3 = [], r3 = [], a3 = [], s2 = [];
|
|
15004
15008
|
let c2;
|
|
15005
|
-
|
|
15006
|
-
for (const l3 of Object.values(
|
|
15007
|
-
c2 || ("web" in l3 ? c2 = "web" : "server" in l3 && (c2 = "server")),
|
|
15008
|
-
for (const
|
|
15009
|
-
const s3 = "sources" ===
|
|
15010
|
-
if (
|
|
15009
|
+
wi(n4, e4.variables), ki(i3, e4.definitions), Ci(s2, e4.contract);
|
|
15010
|
+
for (const l3 of Object.values(e4.flows)) if (Si(l3)) {
|
|
15011
|
+
c2 || ("web" in l3 ? c2 = "web" : "server" in l3 && (c2 = "server")), wi(n4, l3.variables), ki(i3, l3.definitions), Ci(s2, l3.contract);
|
|
15012
|
+
for (const e5 of ["sources", "destinations", "transformers"]) {
|
|
15013
|
+
const s3 = "sources" === e5 ? "source" : "destinations" === e5 ? "destination" : "transformer", d2 = "sources" === e5 ? t2 : "destinations" === e5 ? o3 : r3;
|
|
15014
|
+
if (Si(l3[e5])) for (const [t3, o4] of Object.entries(l3[e5])) d2.push(t3), Si(o4) && (wi(n4, o4.variables), ki(i3, o4.definitions), "string" == typeof o4.package && a3.push({ package: o4.package, shortName: t3, type: s3, platform: c2 || "web" }));
|
|
15011
15015
|
}
|
|
15012
15016
|
}
|
|
15013
|
-
const l2 = { variables: n4, definitions: i3, stepNames: { sources:
|
|
15017
|
+
const l2 = { variables: n4, definitions: i3, stepNames: { sources: t2, destinations: o3, transformers: r3 } };
|
|
15014
15018
|
c2 && (l2.platform = c2);
|
|
15015
15019
|
a3.length > 0 && (l2.packages = a3);
|
|
15016
15020
|
s2.length > 0 && (l2.contract = s2);
|
|
15017
15021
|
return l2;
|
|
15018
15022
|
})(n3);
|
|
15019
15023
|
if (r2) {
|
|
15020
|
-
const n4 = (function(
|
|
15024
|
+
const n4 = (function(e4, n5) {
|
|
15021
15025
|
const i3 = [];
|
|
15022
15026
|
if (n5.variables) {
|
|
15023
|
-
const
|
|
15027
|
+
const t2 = /\$var\.(\w+)/g;
|
|
15024
15028
|
let o3;
|
|
15025
|
-
for (; null !== (o3 =
|
|
15026
|
-
const
|
|
15027
|
-
i3.push({ message: `Unknown variable "$var.${o3[1]}". Defined: ${Object.keys(n5.variables).join(", ") || "none"}`, severity: "warning", path: `$var.${o3[1]}`, ...
|
|
15029
|
+
for (; null !== (o3 = t2.exec(e4)); ) if (!(o3[1] in n5.variables)) {
|
|
15030
|
+
const t3 = hi(e4, o3.index, o3[0].length);
|
|
15031
|
+
i3.push({ message: `Unknown variable "$var.${o3[1]}". Defined: ${Object.keys(n5.variables).join(", ") || "none"}`, severity: "warning", path: `$var.${o3[1]}`, ...t3 });
|
|
15028
15032
|
}
|
|
15029
15033
|
}
|
|
15030
15034
|
if (n5.definitions) {
|
|
15031
|
-
const
|
|
15035
|
+
const t2 = /\$def\.(\w+)/g;
|
|
15032
15036
|
let o3;
|
|
15033
|
-
for (; null !== (o3 =
|
|
15034
|
-
const
|
|
15035
|
-
i3.push({ message: `Unknown definition "$def.${o3[1]}". Defined: ${Object.keys(n5.definitions).join(", ") || "none"}`, severity: "warning", path: `$def.${o3[1]}`, ...
|
|
15037
|
+
for (; null !== (o3 = t2.exec(e4)); ) if (!(o3[1] in n5.definitions)) {
|
|
15038
|
+
const t3 = hi(e4, o3.index, o3[0].length);
|
|
15039
|
+
i3.push({ message: `Unknown definition "$def.${o3[1]}". Defined: ${Object.keys(n5.definitions).join(", ") || "none"}`, severity: "warning", path: `$def.${o3[1]}`, ...t3 });
|
|
15036
15040
|
}
|
|
15037
15041
|
}
|
|
15038
15042
|
return i3;
|
|
15039
|
-
})(
|
|
15040
|
-
|
|
15043
|
+
})(e3, r2);
|
|
15044
|
+
t.push(...n4);
|
|
15041
15045
|
}
|
|
15042
|
-
return { valid: 0 === i2.length, errors: i2, warnings:
|
|
15046
|
+
return { valid: 0 === i2.length, errors: i2, warnings: t, context: r2 };
|
|
15043
15047
|
}
|
|
15044
|
-
function
|
|
15045
|
-
let i2 = 1,
|
|
15046
|
-
for (let o2 = 0; o2 < n3 && o2 <
|
|
15047
|
-
return { line: i2, column:
|
|
15048
|
+
function gi(e3, n3) {
|
|
15049
|
+
let i2 = 1, t = 1;
|
|
15050
|
+
for (let o2 = 0; o2 < n3 && o2 < e3.length; o2++) "\n" === e3[o2] ? (i2++, t = 1) : t++;
|
|
15051
|
+
return { line: i2, column: t };
|
|
15048
15052
|
}
|
|
15049
|
-
function
|
|
15050
|
-
const
|
|
15051
|
-
return { line:
|
|
15053
|
+
function hi(e3, n3, i2) {
|
|
15054
|
+
const t = gi(e3, n3), o2 = gi(e3, n3 + i2);
|
|
15055
|
+
return { line: t.line, column: t.column, endLine: o2.line, endColumn: o2.column };
|
|
15052
15056
|
}
|
|
15053
|
-
function
|
|
15057
|
+
function vi(e3, n3) {
|
|
15054
15058
|
if (0 === n3.length) return { line: 1, column: 1 };
|
|
15055
15059
|
const i2 = n3[n3.length - 1];
|
|
15056
15060
|
if ("string" == typeof i2) {
|
|
15057
|
-
const n4 = `"${i2}"`,
|
|
15058
|
-
if (-1 !==
|
|
15061
|
+
const n4 = `"${i2}"`, t = e3.lastIndexOf(n4);
|
|
15062
|
+
if (-1 !== t) return gi(e3, t);
|
|
15059
15063
|
}
|
|
15060
15064
|
return { line: 1, column: 1 };
|
|
15061
15065
|
}
|
|
15062
|
-
function
|
|
15063
|
-
return "object" == typeof
|
|
15066
|
+
function Si(e3) {
|
|
15067
|
+
return "object" == typeof e3 && null !== e3 && !Array.isArray(e3);
|
|
15064
15068
|
}
|
|
15065
|
-
function
|
|
15066
|
-
return "string" == typeof
|
|
15069
|
+
function yi(e3) {
|
|
15070
|
+
return "string" == typeof e3 || "number" == typeof e3 || "boolean" == typeof e3;
|
|
15067
15071
|
}
|
|
15068
|
-
function
|
|
15069
|
-
if (
|
|
15072
|
+
function wi(e3, n3) {
|
|
15073
|
+
if (Si(n3)) for (const [i2, t] of Object.entries(n3)) yi(t) && (e3[i2] = t);
|
|
15070
15074
|
}
|
|
15071
|
-
function
|
|
15072
|
-
if (
|
|
15075
|
+
function ki(e3, n3) {
|
|
15076
|
+
if (Si(n3)) for (const [i2, t] of Object.entries(n3)) e3[i2] = t;
|
|
15073
15077
|
}
|
|
15074
|
-
function
|
|
15075
|
-
if (
|
|
15076
|
-
if (i2.startsWith("$") || !
|
|
15077
|
-
const n4 =
|
|
15078
|
-
if (n4) for (const
|
|
15079
|
-
else
|
|
15078
|
+
function Ci(e3, n3) {
|
|
15079
|
+
if (Si(n3)) for (const [i2, t] of Object.entries(n3)) {
|
|
15080
|
+
if (i2.startsWith("$") || !Si(t)) continue;
|
|
15081
|
+
const n4 = e3.find((e4) => e4.entity === i2), o2 = Object.keys(t);
|
|
15082
|
+
if (n4) for (const e4 of o2) n4.actions.includes(e4) || n4.actions.push(e4);
|
|
15083
|
+
else e3.push({ entity: i2, actions: o2 });
|
|
15080
15084
|
}
|
|
15081
15085
|
}
|
|
15082
|
-
function
|
|
15083
|
-
const i2 = [],
|
|
15084
|
-
for (const [n4, o3] of Object.entries(
|
|
15086
|
+
function ji(e3, n3) {
|
|
15087
|
+
const i2 = [], t = {};
|
|
15088
|
+
for (const [n4, o3] of Object.entries(e3)) {
|
|
15085
15089
|
o3.required && i2.push(n4);
|
|
15086
|
-
const
|
|
15087
|
-
if (o3.description && (
|
|
15090
|
+
const e4 = { type: o3.type };
|
|
15091
|
+
if (o3.description && (e4.description = o3.description), o3.pattern && (e4.pattern = o3.pattern), void 0 !== o3.minLength && (e4.minLength = o3.minLength), void 0 !== o3.maxLength && (e4.maxLength = o3.maxLength), void 0 !== o3.minimum && (e4.minimum = o3.minimum), void 0 !== o3.maximum && (e4.maximum = o3.maximum), o3.enum && (e4.enum = [...o3.enum]), void 0 !== o3.default && (e4.default = o3.default), "object" === o3.type && o3.properties) {
|
|
15088
15092
|
const n5 = {};
|
|
15089
|
-
for (const [
|
|
15090
|
-
|
|
15093
|
+
for (const [e5, i3] of Object.entries(o3.properties)) n5[e5] = xi(i3);
|
|
15094
|
+
e4.properties = n5;
|
|
15091
15095
|
}
|
|
15092
|
-
"array" === o3.type && o3.items && (
|
|
15096
|
+
"array" === o3.type && o3.items && (e4.items = xi(o3.items)), t[n4] = e4;
|
|
15093
15097
|
}
|
|
15094
|
-
const o2 = { type: "object", properties:
|
|
15098
|
+
const o2 = { type: "object", properties: t };
|
|
15095
15099
|
return n3 && (o2.title = n3), i2.length > 0 && (o2.required = i2), o2;
|
|
15096
15100
|
}
|
|
15097
|
-
function
|
|
15098
|
-
const n3 = { type:
|
|
15099
|
-
if (
|
|
15101
|
+
function xi(e3) {
|
|
15102
|
+
const n3 = { type: e3.type };
|
|
15103
|
+
if (e3.description && (n3.description = e3.description), e3.pattern && (n3.pattern = e3.pattern), void 0 !== e3.minLength && (n3.minLength = e3.minLength), void 0 !== e3.maxLength && (n3.maxLength = e3.maxLength), void 0 !== e3.minimum && (n3.minimum = e3.minimum), void 0 !== e3.maximum && (n3.maximum = e3.maximum), e3.enum && (n3.enum = [...e3.enum]), void 0 !== e3.default && (n3.default = e3.default), "object" === e3.type && e3.properties) {
|
|
15100
15104
|
const i2 = {};
|
|
15101
|
-
for (const [n4,
|
|
15105
|
+
for (const [n4, t] of Object.entries(e3.properties)) i2[n4] = xi(t);
|
|
15102
15106
|
n3.properties = i2;
|
|
15103
15107
|
}
|
|
15104
|
-
return "array" ===
|
|
15108
|
+
return "array" === e3.type && e3.items && (n3.items = xi(e3.items)), n3;
|
|
15105
15109
|
}
|
|
15106
|
-
function
|
|
15107
|
-
const i2 = { type: "array", items:
|
|
15110
|
+
function Ji(e3, n3) {
|
|
15111
|
+
const i2 = { type: "array", items: xi(e3) };
|
|
15108
15112
|
return void 0 !== n3?.minItems && (i2.minItems = n3.minItems), void 0 !== n3?.maxItems && (i2.maxItems = n3.maxItems), n3?.description && (i2.description = n3.description), n3?.title && (i2.title = n3.title), i2;
|
|
15109
15113
|
}
|
|
15110
|
-
function
|
|
15111
|
-
const
|
|
15112
|
-
return i2?.description && (
|
|
15114
|
+
function Pi(e3, n3 = "string", i2) {
|
|
15115
|
+
const t = { type: n3, enum: [...e3] };
|
|
15116
|
+
return i2?.description && (t.description = i2.description), i2?.title && (t.title = i2.title), t;
|
|
15113
15117
|
}
|
|
15114
|
-
function
|
|
15115
|
-
return
|
|
15118
|
+
function Ei(e3, n3, i2) {
|
|
15119
|
+
return Ji({ type: "object" }, { minItems: 2, maxItems: 2, description: i2 || "Tuple with exactly 2 elements [source, transform]" });
|
|
15116
15120
|
}
|
|
15117
|
-
function
|
|
15118
|
-
return external_exports.toJSONSchema(
|
|
15121
|
+
function Di(e3) {
|
|
15122
|
+
return external_exports.toJSONSchema(e3, { target: "draft-7" });
|
|
15119
15123
|
}
|
|
15120
|
-
var
|
|
15124
|
+
var e2, n, i, r, a2, s, c, l, d, p, u2, m, b, f, g, h, v, S2, y, w, k, C2, j, x2, J, P2, E2, D2, I, R2, O2, M2, z3, U, V, W2, $2, B, A2, F, H, G, Q, _2, K, X, Y, Z, ee, ne, ie, te, oe, re, ae, se, ce, le2, de2, pe2, ue, me, be, fe2, ge2, he, ve, Se, ye, we, ke, Ce, je, xe, Je, Pe, Ee, De, Ie, Re, Oe, Le, Ne, qe, Te, Me, ze, Ue, Ve, We, $e, Be, Ae, Fe, He, Ge, Qe, _e, Ke, Xe, Ye, Ze, en, nn, tn, on, rn, an, sn, cn, ln, dn, pn, un, mn, bn, fn, gn, hn, vn, Sn, yn, wn, kn, Cn, jn, xn, Jn, Pn, En, Dn, In, Rn, On, Ln, Nn, qn, Tn, Mn, zn, Un, Vn, Wn, $n, Bn, An, Fn, Hn, Gn, Qn, _n, Kn, Xn, Yn, Zn, ei, ni, ii, ti, ci, li, di, pi, ui, mi, bi;
|
|
15121
15125
|
var init_dev = __esm({
|
|
15122
15126
|
"../core/dist/dev.mjs"() {
|
|
15123
15127
|
"use strict";
|
|
15124
15128
|
init_zod();
|
|
15125
|
-
|
|
15129
|
+
e2 = Object.defineProperty;
|
|
15126
15130
|
n = (n3, i2) => {
|
|
15127
|
-
for (var
|
|
15131
|
+
for (var t in i2) e2(n3, t, { get: i2[t], enumerable: true });
|
|
15128
15132
|
};
|
|
15129
15133
|
i = {};
|
|
15130
|
-
n(i, { BaseContextConfig: () => z3, BatchConfig: () => U, CollectorSchemas: () => sn, ConsentSchema: () => K, ContractActionsSchema: () =>
|
|
15134
|
+
n(i, { BaseContextConfig: () => z3, BatchConfig: () => U, CollectorSchemas: () => sn, ConsentSchema: () => K, ContractActionsSchema: () => Xn, ContractSchema: () => Yn, ContractSchemaEntry: () => Kn, Counter: () => d, DeepPartialEventSchema: () => oe, DestinationReferenceSchema: () => Qn, DestinationSchemas: () => Ne, DestinationsMapConfig: () => $2, EntitiesSchema: () => ne, EntitySchema: () => ee, EventSchema: () => ie, FlowConfigSchema: () => Zn, FlowSchemas: () => Tn, GenericEnvConfig: () => O2, GenericSettingsConfig: () => R2, HandlersConfig: () => x2, IdConfig: () => E2, Identifier: () => c, InitConfig: () => D2, LoopSchema: () => ge2, MapSchema: () => ve, MappingResultSchema: () => je, MappingSchemas: () => me, OptionalPrimitiveValue: () => m, OrderedPropertiesSchema: () => Q, PartialEventSchema: () => te, PolicySchema: () => ye, PrimaryConfig: () => I, PrimitiveSchema: () => Mn, PrimitiveValue: () => u2, ProcessingControlConfig: () => V, PropertiesSchema: () => G, PropertySchema: () => H, PropertyTypeSchema: () => F, QueueConfig: () => P2, RequiredBoolean: () => s, RequiredNumber: () => a2, RequiredString: () => r, RuleSchema: () => we, RulesSchema: () => ke, RuntimeInstanceConfig: () => M2, SetSchema: () => he, SetupSchema: () => ti, SetupV2Schema: () => ii, SourceReferenceSchema: () => Hn, SourceSchema: () => Z, SourceSchemas: () => kn, SourceTypeSchema: () => _2, SourcesMapConfig: () => W2, StoreReferenceSchema: () => _n, TaggingVersion: () => p, Timestamp: () => l, UserSchema: () => X, UtilitySchemas: () => b, ValueConfigSchema: () => Se, ValueSchema: () => be, ValuesSchema: () => fe2, VerboseConfig: () => J, VersionSchema: () => Y, WalkerOSSchemas: () => B, configJsonSchema: () => di, consentJsonSchema: () => ue, createArraySchema: () => Ji, createConsentConfig: () => T2, createDataTransformationConfig: () => L, createEnumSchema: () => Pi, createMappingRulesConfig: () => N2, createObjectSchema: () => ji, createPolicyConfig: () => q, createTupleSchema: () => Ei, destinationReferenceJsonSchema: () => ui, entityJsonSchema: () => de2, eventJsonSchema: () => re, loopJsonSchema: () => Pe, mapJsonSchema: () => De, orderedPropertiesJsonSchema: () => le2, parseConfig: () => ai, parseSetup: () => oi, partialEventJsonSchema: () => ae, policyJsonSchema: () => Ie, propertiesJsonSchema: () => ce, ruleJsonSchema: () => Re, rulesJsonSchema: () => Oe, safeParseConfig: () => si, safeParseSetup: () => ri, setJsonSchema: () => Ee, setupJsonSchema: () => ci, setupV2JsonSchema: () => li, sourceReferenceJsonSchema: () => pi, sourceTypeJsonSchema: () => pe2, storeReferenceJsonSchema: () => bi, userJsonSchema: () => se, validateFlowSetup: () => fi, valueConfigJsonSchema: () => Je, valueJsonSchema: () => xe, z: () => external_exports, zodToSchema: () => Di });
|
|
15131
15135
|
r = external_exports.string();
|
|
15132
15136
|
a2 = external_exports.number();
|
|
15133
15137
|
s = external_exports.boolean();
|
|
@@ -15138,7 +15142,7 @@ var init_dev = __esm({
|
|
|
15138
15142
|
u2 = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]);
|
|
15139
15143
|
m = u2.optional();
|
|
15140
15144
|
b = {};
|
|
15141
|
-
n(b, { ErrorHandlerSchema: () => h, HandlerSchema: () => S2, LogHandlerSchema: () => v, StorageSchema: () => g, StorageTypeSchema: () => f, errorHandlerJsonSchema: () =>
|
|
15145
|
+
n(b, { ErrorHandlerSchema: () => h, HandlerSchema: () => S2, LogHandlerSchema: () => v, StorageSchema: () => g, StorageTypeSchema: () => f, errorHandlerJsonSchema: () => k, handlerJsonSchema: () => j, logHandlerJsonSchema: () => C2, storageJsonSchema: () => w, storageTypeJsonSchema: () => y });
|
|
15142
15146
|
f = external_exports.enum(["local", "session", "cookie"]).describe("Storage mechanism: local, session, or cookie");
|
|
15143
15147
|
g = external_exports.object({ Local: external_exports.literal("local"), Session: external_exports.literal("session"), Cookie: external_exports.literal("cookie") }).describe("Storage type constants for type-safe references");
|
|
15144
15148
|
h = external_exports.any().describe("Error handler function: (error, state?) => void");
|
|
@@ -15146,25 +15150,25 @@ var init_dev = __esm({
|
|
|
15146
15150
|
S2 = external_exports.object({ Error: h.describe("Error handler function"), Log: v.describe("Log handler function") }).describe("Handler interface with error and log functions");
|
|
15147
15151
|
y = o(f);
|
|
15148
15152
|
w = o(g);
|
|
15149
|
-
|
|
15153
|
+
k = o(h);
|
|
15150
15154
|
C2 = o(v);
|
|
15151
|
-
|
|
15155
|
+
j = o(S2);
|
|
15152
15156
|
x2 = external_exports.object({ onError: h.optional().describe("Error handler function: (error, state?) => void"), onLog: v.optional().describe("Log handler function: (message, verbose?) => void") }).partial();
|
|
15153
15157
|
J = external_exports.object({ verbose: external_exports.boolean().describe("Enable verbose logging for debugging").optional() }).partial();
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
|
|
15158
|
+
P2 = external_exports.object({ queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional() }).partial();
|
|
15159
|
+
E2 = external_exports.object({}).partial();
|
|
15160
|
+
D2 = external_exports.object({ init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional() }).partial();
|
|
15157
15161
|
I = external_exports.object({ primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).partial();
|
|
15158
|
-
|
|
15159
|
-
|
|
15162
|
+
R2 = external_exports.object({ settings: external_exports.any().optional().describe("Implementation-specific configuration") }).partial();
|
|
15163
|
+
O2 = external_exports.object({ env: external_exports.any().optional().describe("Environment dependencies (platform-specific)") }).partial();
|
|
15160
15164
|
M2 = external_exports.object({ type: external_exports.string().optional().describe("Instance type identifier"), config: external_exports.unknown().describe("Instance configuration") }).partial();
|
|
15161
15165
|
z3 = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: external_exports.unknown().describe("Configuration"), env: external_exports.unknown().describe("Environment dependencies") }).partial();
|
|
15162
15166
|
U = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), batched: external_exports.unknown().optional().describe("Batch of events to be processed") }).partial();
|
|
15163
15167
|
V = external_exports.object({ ignore: external_exports.boolean().describe("Set to true to skip processing").optional(), condition: external_exports.string().optional().describe("Condition function: return true to process") }).partial();
|
|
15164
|
-
|
|
15168
|
+
W2 = external_exports.object({ sources: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of source instances") }).partial();
|
|
15165
15169
|
$2 = external_exports.object({ destinations: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of destination instances") }).partial();
|
|
15166
15170
|
B = {};
|
|
15167
|
-
n(B, { ConsentSchema: () => K, DeepPartialEventSchema: () => oe, EntitiesSchema: () => ne, EntitySchema: () => ee, EventSchema: () => ie, OrderedPropertiesSchema: () => Q, PartialEventSchema: () => te, PropertiesSchema: () => G, PropertySchema: () => H, PropertyTypeSchema: () => F, SourceSchema: () => Z, SourceTypeSchema: () => _2, UserSchema: () => X, VersionSchema: () => Y, consentJsonSchema: () => ue, entityJsonSchema: () =>
|
|
15171
|
+
n(B, { ConsentSchema: () => K, DeepPartialEventSchema: () => oe, EntitiesSchema: () => ne, EntitySchema: () => ee, EventSchema: () => ie, OrderedPropertiesSchema: () => Q, PartialEventSchema: () => te, PropertiesSchema: () => G, PropertySchema: () => H, PropertyTypeSchema: () => F, SourceSchema: () => Z, SourceTypeSchema: () => _2, UserSchema: () => X, VersionSchema: () => Y, consentJsonSchema: () => ue, entityJsonSchema: () => de2, eventJsonSchema: () => re, orderedPropertiesJsonSchema: () => le2, partialEventJsonSchema: () => ae, propertiesJsonSchema: () => ce, sourceTypeJsonSchema: () => pe2, userJsonSchema: () => se });
|
|
15168
15172
|
F = external_exports.lazy(() => external_exports.union([external_exports.boolean(), external_exports.string(), external_exports.number(), external_exports.record(external_exports.string(), H)]));
|
|
15169
15173
|
H = external_exports.lazy(() => external_exports.union([F, external_exports.array(F)]));
|
|
15170
15174
|
G = external_exports.record(external_exports.string(), H.optional()).describe("Flexible property collection with optional values");
|
|
@@ -15183,54 +15187,54 @@ var init_dev = __esm({
|
|
|
15183
15187
|
ae = o(te);
|
|
15184
15188
|
se = o(X);
|
|
15185
15189
|
ce = o(G);
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15190
|
+
le2 = o(Q);
|
|
15191
|
+
de2 = o(ee);
|
|
15192
|
+
pe2 = o(_2);
|
|
15189
15193
|
ue = o(K);
|
|
15190
15194
|
me = {};
|
|
15191
|
-
n(me, { ConfigSchema: () => Ce, LoopSchema: () =>
|
|
15195
|
+
n(me, { ConfigSchema: () => Ce, LoopSchema: () => ge2, MapSchema: () => ve, PolicySchema: () => ye, ResultSchema: () => je, RuleSchema: () => we, RulesSchema: () => ke, SetSchema: () => he, ValueConfigSchema: () => Se, ValueSchema: () => be, ValuesSchema: () => fe2, configJsonSchema: () => Le, loopJsonSchema: () => Pe, mapJsonSchema: () => De, policyJsonSchema: () => Ie, ruleJsonSchema: () => Re, rulesJsonSchema: () => Oe, setJsonSchema: () => Ee, valueConfigJsonSchema: () => Je, valueJsonSchema: () => xe });
|
|
15192
15196
|
be = external_exports.lazy(() => external_exports.union([external_exports.string().describe('String value or property path (e.g., "data.id")'), external_exports.number().describe("Numeric value"), external_exports.boolean().describe("Boolean value"), external_exports.lazy(() => A2), external_exports.array(be).describe("Array of values")]));
|
|
15193
|
-
|
|
15194
|
-
|
|
15197
|
+
fe2 = external_exports.array(be).describe("Array of transformation values");
|
|
15198
|
+
ge2 = external_exports.lazy(() => external_exports.tuple([be, be]).describe("Loop transformation: [source, transform] tuple for array processing"));
|
|
15195
15199
|
he = external_exports.lazy(() => external_exports.array(be).describe("Set: Array of values for selection or combination"));
|
|
15196
15200
|
ve = external_exports.lazy(() => external_exports.record(external_exports.string(), be).describe("Map: Object mapping keys to transformation values"));
|
|
15197
|
-
Se = A2 = external_exports.object({ key: external_exports.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Custom transformation function as string (serialized)"), map: ve.optional().describe("Object mapping: transform event data to structured output"), loop:
|
|
15201
|
+
Se = A2 = external_exports.object({ key: external_exports.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Custom transformation function as string (serialized)"), map: ve.optional().describe("Object mapping: transform event data to structured output"), loop: ge2.optional().describe("Loop transformation: [source, transform] for array processing"), set: he.optional().describe("Set of values: combine or select from multiple values"), consent: K.optional().describe("Required consent states to include this value"), condition: external_exports.string().optional().describe("Condition function as string: return true to include value"), validate: external_exports.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e3) => Object.keys(e3).length > 0, { message: "ValueConfig must have at least one property" }).describe("Value transformation configuration with multiple strategies");
|
|
15198
15202
|
ye = external_exports.record(external_exports.string(), be).describe("Policy rules for event pre-processing (key \u2192 value mapping)");
|
|
15199
|
-
we = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), condition: external_exports.string().optional().describe("Condition function as string: return true to process event"), consent: K.optional().describe("Required consent states to process this event"), settings: external_exports.any().optional().describe("Destination-specific settings for this event mapping"), data: external_exports.union([be,
|
|
15203
|
+
we = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), condition: external_exports.string().optional().describe("Condition function as string: return true to process event"), consent: K.optional().describe("Required consent states to process this event"), settings: external_exports.any().optional().describe("Destination-specific settings for this event mapping"), data: external_exports.union([be, fe2]).optional().describe("Data transformation rules for event"), ignore: external_exports.boolean().optional().describe("Set to true to skip processing this event"), name: external_exports.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), policy: ye.optional().describe("Event-level policy overrides (applied after config-level policy)") }).describe("Mapping rule for specific entity-action combination");
|
|
15200
15204
|
ke = external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.union([we, external_exports.array(we)])).optional()).describe("Nested mapping rules: { entity: { action: Rule | Rule[] } } with wildcard support");
|
|
15201
|
-
Ce = external_exports.object({ consent: K.optional().describe("Required consent states to process any events"), data: external_exports.union([be,
|
|
15205
|
+
Ce = external_exports.object({ consent: K.optional().describe("Required consent states to process any events"), data: external_exports.union([be, fe2]).optional().describe("Global data transformation applied to all events"), mapping: ke.optional().describe("Entity-action specific mapping rules"), policy: ye.optional().describe("Pre-processing policy rules applied before mapping") }).describe("Shared mapping configuration for sources and destinations");
|
|
15202
15206
|
je = external_exports.object({ eventMapping: we.optional().describe("Resolved mapping rule for event"), mappingKey: external_exports.string().optional().describe('Mapping key used (e.g., "product.view")') }).describe("Mapping resolution result");
|
|
15203
15207
|
xe = o(be);
|
|
15204
15208
|
Je = o(Se);
|
|
15205
|
-
|
|
15206
|
-
|
|
15209
|
+
Pe = o(ge2);
|
|
15210
|
+
Ee = o(he);
|
|
15207
15211
|
De = o(ve);
|
|
15208
15212
|
Ie = o(ye);
|
|
15209
|
-
|
|
15210
|
-
|
|
15213
|
+
Re = o(we);
|
|
15214
|
+
Oe = o(ke);
|
|
15211
15215
|
Le = o(Ce);
|
|
15212
15216
|
Ne = {};
|
|
15213
|
-
n(Ne, { BatchSchema: () => Be, ConfigSchema: () =>
|
|
15214
|
-
|
|
15215
|
-
|
|
15217
|
+
n(Ne, { BatchSchema: () => Be, ConfigSchema: () => qe, ContextSchema: () => ze, DLQSchema: () => Ye, DataSchema: () => Ae, DestinationPolicySchema: () => Me, DestinationsSchema: () => Qe, InitDestinationsSchema: () => Ge, InitSchema: () => He, InstanceSchema: () => Fe, PartialConfigSchema: () => Te, PushBatchContextSchema: () => Ve, PushContextSchema: () => Ue, PushEventSchema: () => We, PushEventsSchema: () => $e, PushResultSchema: () => Ke, RefSchema: () => _e, ResultSchema: () => Xe, batchJsonSchema: () => on, configJsonSchema: () => Ze, contextJsonSchema: () => nn, instanceJsonSchema: () => rn, partialConfigJsonSchema: () => en, pushContextJsonSchema: () => tn, resultJsonSchema: () => an });
|
|
15218
|
+
qe = external_exports.object({ consent: K.optional().describe("Required consent states to send events to this destination"), settings: external_exports.any().describe("Implementation-specific configuration").optional(), data: external_exports.union([be, fe2]).optional().describe("Global data transformation applied to all events for this destination"), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Destination instance identifier (defaults to destination key)").optional(), init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: ke.optional().describe("Entity-action specific mapping rules for this destination"), policy: ye.optional().describe("Pre-processing policy rules applied before event mapping"), queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional(), verbose: external_exports.boolean().describe("Enable verbose logging for debugging").optional(), onError: h.optional(), onLog: v.optional() }).describe("Destination configuration");
|
|
15219
|
+
Te = qe.partial().describe("Partial destination configuration with all fields optional");
|
|
15216
15220
|
Me = ye.describe("Destination policy rules for event pre-processing");
|
|
15217
|
-
ze = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config:
|
|
15221
|
+
ze = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: qe.describe("Destination configuration"), data: external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data"), env: external_exports.unknown().describe("Environment dependencies") }).describe("Destination context for init and push functions");
|
|
15218
15222
|
Ue = ze.extend({ mapping: we.optional().describe("Resolved mapping rule for this specific event") }).describe("Push context with event-specific mapping");
|
|
15219
15223
|
Ve = Ue.describe("Batch push context with event-specific mapping");
|
|
15220
15224
|
We = external_exports.object({ event: ie.describe("The event to process"), mapping: we.optional().describe("Mapping rule for this event") }).describe("Event with optional mapping for batch processing");
|
|
15221
15225
|
$e = external_exports.array(We).describe("Array of events with mappings");
|
|
15222
15226
|
Be = external_exports.object({ key: external_exports.string().describe('Batch key (usually mapping key like "product.view")'), events: external_exports.array(ie).describe("Array of events in batch"), data: external_exports.array(external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional()).describe("Transformed data for each event"), mapping: we.optional().describe("Shared mapping rule for batch") }).describe("Batch of events grouped by mapping key");
|
|
15223
15227
|
Ae = external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)");
|
|
15224
|
-
Fe = external_exports.object({ config:
|
|
15225
|
-
He = external_exports.object({ code: Fe.describe("Destination instance with implementation"), config:
|
|
15228
|
+
Fe = external_exports.object({ config: qe.describe("Destination configuration"), queue: external_exports.array(ie).optional().describe("Queued events awaiting consent"), dlq: external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).optional().describe("Dead letter queue (failed events with errors)"), type: external_exports.string().optional().describe("Destination type identifier"), env: external_exports.unknown().optional().describe("Environment dependencies"), init: external_exports.unknown().optional().describe("Initialization function"), push: external_exports.unknown().describe("Push function for single events"), pushBatch: external_exports.unknown().optional().describe("Batch push function"), on: external_exports.unknown().optional().describe("Event lifecycle hook function") }).describe("Destination instance (runtime object with functions)");
|
|
15229
|
+
He = external_exports.object({ code: Fe.describe("Destination instance with implementation"), config: Te.optional().describe("Partial configuration overrides"), env: external_exports.unknown().optional().describe("Partial environment overrides") }).describe("Destination initialization configuration");
|
|
15226
15230
|
Ge = external_exports.record(external_exports.string(), He).describe("Map of destination IDs to initialization configurations");
|
|
15227
15231
|
Qe = external_exports.record(external_exports.string(), Fe).describe("Map of destination IDs to runtime instances");
|
|
15228
15232
|
_e = external_exports.object({ type: external_exports.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: external_exports.unknown().optional().describe("Response from push()"), error: external_exports.unknown().optional().describe("Error if failed") }).describe("Destination reference with type and response data");
|
|
15229
15233
|
Ke = external_exports.object({ queue: external_exports.array(ie).optional().describe("Events queued (awaiting consent)"), error: external_exports.unknown().optional().describe("Error if push failed") }).describe("Push operation result");
|
|
15230
15234
|
Xe = external_exports.object({ ok: external_exports.boolean().describe("True if nothing failed"), event: external_exports.unknown().optional().describe("The processed event"), done: external_exports.record(external_exports.string(), _e).optional().describe("Destinations that processed successfully"), queued: external_exports.record(external_exports.string(), _e).optional().describe("Destinations that queued events"), failed: external_exports.record(external_exports.string(), _e).optional().describe("Destinations that failed to process") }).describe("Push result with destination outcomes");
|
|
15231
15235
|
Ye = external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).describe("Dead letter queue: [(event, error), ...]");
|
|
15232
|
-
Ze = o(
|
|
15233
|
-
en = o(
|
|
15236
|
+
Ze = o(qe);
|
|
15237
|
+
en = o(Te);
|
|
15234
15238
|
nn = o(ze);
|
|
15235
15239
|
tn = o(Ue);
|
|
15236
15240
|
on = o(Be);
|
|
@@ -15253,22 +15257,22 @@ var init_dev = __esm({
|
|
|
15253
15257
|
yn = o(un);
|
|
15254
15258
|
wn = o(fn);
|
|
15255
15259
|
kn = {};
|
|
15256
|
-
n(kn, { BaseEnvSchema: () => Cn, ConfigSchema: () => jn, InitSchema: () =>
|
|
15260
|
+
n(kn, { BaseEnvSchema: () => Cn, ConfigSchema: () => jn, InitSchema: () => Pn, InitSourceSchema: () => En, InitSourcesSchema: () => Dn, InstanceSchema: () => Jn, PartialConfigSchema: () => xn, baseEnvJsonSchema: () => In, configJsonSchema: () => Rn, initSourceJsonSchema: () => Nn, initSourcesJsonSchema: () => qn, instanceJsonSchema: () => Ln, partialConfigJsonSchema: () => On });
|
|
15257
15261
|
Cn = external_exports.object({ push: external_exports.unknown().describe("Collector push function"), command: external_exports.unknown().describe("Collector command function"), sources: external_exports.unknown().optional().describe("Map of registered source instances"), elb: external_exports.unknown().describe("Public API function (alias for collector.push)") }).catchall(external_exports.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this");
|
|
15258
15262
|
jn = Ce.extend({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: Cn.optional().describe("Environment dependencies (platform-specific)"), id: c.describe("Source identifier (defaults to source key)").optional(), onError: h.optional(), primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).describe("Source configuration with mapping and environment");
|
|
15259
15263
|
xn = jn.partial().describe("Partial source configuration with all fields optional");
|
|
15260
15264
|
Jn = external_exports.object({ type: external_exports.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: jn.describe("Current source configuration"), push: external_exports.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: external_exports.any().optional().describe("Cleanup function called when source is removed"), on: external_exports.unknown().optional().describe("Lifecycle hook function for event types") }).describe("Source instance with push handler and lifecycle methods");
|
|
15261
|
-
|
|
15262
|
-
|
|
15263
|
-
Dn = external_exports.record(external_exports.string(),
|
|
15265
|
+
Pn = external_exports.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
|
|
15266
|
+
En = external_exports.object({ code: Pn.describe("Source initialization function"), config: xn.optional().describe("Partial configuration overrides"), env: Cn.partial().optional().describe("Partial environment overrides"), primary: external_exports.boolean().optional().describe("Mark as primary source (only one can be primary)") }).describe("Source initialization configuration");
|
|
15267
|
+
Dn = external_exports.record(external_exports.string(), En).describe("Map of source IDs to initialization configurations");
|
|
15264
15268
|
In = o(Cn);
|
|
15265
|
-
|
|
15266
|
-
|
|
15269
|
+
Rn = o(jn);
|
|
15270
|
+
On = o(xn);
|
|
15267
15271
|
Ln = o(Jn);
|
|
15268
|
-
Nn = o(
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
n(
|
|
15272
|
+
Nn = o(En);
|
|
15273
|
+
qn = o(Dn);
|
|
15274
|
+
Tn = {};
|
|
15275
|
+
n(Tn, { ConfigSchema: () => Zn, ContractActionsSchema: () => Xn, ContractSchema: () => Yn, ContractSchemaEntry: () => Kn, DefinitionsSchema: () => Un, DestinationReferenceSchema: () => Qn, InlineCodeSchema: () => Bn, PackagesSchema: () => Vn, PrimitiveSchema: () => Mn, ServerSchema: () => $n, SetupSchema: () => ti, SetupV2Schema: () => ii, SourceReferenceSchema: () => Hn, StepExampleSchema: () => An, StepExamplesSchema: () => Fn, StoreReferenceSchema: () => _n, TransformerReferenceSchema: () => Gn, VariablesSchema: () => zn, WebSchema: () => Wn, configJsonSchema: () => di, destinationReferenceJsonSchema: () => ui, parseConfig: () => ai, parseSetup: () => oi, safeParseConfig: () => si, safeParseSetup: () => ri, setupJsonSchema: () => ci, setupV2JsonSchema: () => li, sourceReferenceJsonSchema: () => pi, storeReferenceJsonSchema: () => bi, transformerReferenceJsonSchema: () => mi });
|
|
15272
15276
|
Mn = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).describe("Primitive value: string, number, or boolean");
|
|
15273
15277
|
zn = external_exports.record(external_exports.string(), Mn).describe("Variables for interpolation");
|
|
15274
15278
|
Un = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Reusable configuration definitions");
|
|
@@ -15281,23 +15285,25 @@ var init_dev = __esm({
|
|
|
15281
15285
|
Hn = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'), code: external_exports.union([external_exports.string(), Bn]).optional().describe('Either a named export string (e.g., "sourceExpress") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Source-specific configuration object"), env: external_exports.unknown().optional().describe("Source environment configuration"), primary: external_exports.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."), variables: zn.optional().describe("Source-level variables (highest priority in cascade)"), definitions: Un.optional().describe("Source-level definitions (highest priority in cascade)"), next: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional().describe("First transformer in post-source chain. If omitted, events route directly to collector."), examples: Fn.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Source package reference with configuration");
|
|
15282
15286
|
Gn = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'), code: external_exports.union([external_exports.string(), Bn]).optional().describe('Either a named export string (e.g., "transformerEnricher") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Transformer-specific configuration object"), env: external_exports.unknown().optional().describe("Transformer environment configuration"), next: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional().describe("Next transformer in chain. If omitted: pre-collector routes to collector, post-collector routes to destination."), variables: zn.optional().describe("Transformer-level variables (highest priority in cascade)"), definitions: Un.optional().describe("Transformer-level definitions (highest priority in cascade)"), examples: Fn.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Transformer package reference with configuration");
|
|
15283
15287
|
Qn = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'), code: external_exports.union([external_exports.string(), Bn]).optional().describe('Either a named export string (e.g., "destinationAnalytics") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Destination-specific configuration object"), env: external_exports.unknown().optional().describe("Destination environment configuration"), variables: zn.optional().describe("Destination-level variables (highest priority in cascade)"), definitions: Un.optional().describe("Destination-level definitions (highest priority in cascade)"), before: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional().describe("First transformer in pre-destination chain. If omitted, events are sent directly from collector."), examples: Fn.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Destination package reference with configuration");
|
|
15284
|
-
_n = external_exports.
|
|
15285
|
-
Kn = external_exports.record(external_exports.string(),
|
|
15286
|
-
Xn = external_exports.record(external_exports.string(),
|
|
15287
|
-
Yn = external_exports.
|
|
15288
|
-
|
|
15288
|
+
_n = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe("Store package specifier with optional version"), code: external_exports.union([external_exports.string(), Bn]).optional().describe("Named export string or inline code definition"), config: external_exports.unknown().optional().describe("Store-specific configuration object"), env: external_exports.unknown().optional().describe("Store environment configuration"), variables: zn.optional().describe("Store-level variables (highest priority in cascade)"), definitions: Un.optional().describe("Store-level definitions (highest priority in cascade)"), examples: Fn.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Store package reference with configuration");
|
|
15289
|
+
Kn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("JSON Schema object for event validation with description/examples annotations");
|
|
15290
|
+
Xn = external_exports.record(external_exports.string(), Kn).describe("Action-level contract entries");
|
|
15291
|
+
Yn = external_exports.record(external_exports.string(), external_exports.union([Xn, external_exports.number()])).describe("Data contract: entity-action keyed JSON Schema with additive inheritance");
|
|
15292
|
+
Zn = external_exports.object({ web: Wn.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."), server: $n.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."), contract: Yn.optional().describe("Flow-level data contract (merges on top of Setup-level contract)"), sources: external_exports.record(external_exports.string(), Hn).optional().describe("Source configurations (data capture) keyed by unique identifier"), destinations: external_exports.record(external_exports.string(), Qn).optional().describe("Destination configurations (data output) keyed by unique identifier"), transformers: external_exports.record(external_exports.string(), Gn).optional().describe("Transformer configurations (event transformation) keyed by unique identifier"), stores: external_exports.record(external_exports.string(), _n).optional().describe("Store configurations (key-value storage) keyed by unique identifier"), collector: external_exports.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"), packages: Vn.optional().describe("NPM packages to bundle"), variables: zn.optional().describe("Flow-level variables (override Setup.variables, overridden by source/destination variables)"), definitions: Un.optional().describe("Flow-level definitions (extend Setup.definitions, overridden by source/destination definitions)") }).refine((e3) => {
|
|
15293
|
+
const n3 = void 0 !== e3.web, i2 = void 0 !== e3.server;
|
|
15289
15294
|
return (n3 || i2) && !(n3 && i2);
|
|
15290
15295
|
}, { message: 'Exactly one of "web" or "server" must be present' }).describe("Single flow configuration for one deployment target");
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15296
|
+
ei = external_exports.object({ $schema: external_exports.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v2.json")'), include: external_exports.array(external_exports.string()).optional().describe("Folders to include in the bundle output"), variables: zn.optional().describe("Shared variables for interpolation across all flows (use $var.name syntax)"), definitions: Un.optional().describe("Reusable configuration definitions (use $def.name syntax)"), flows: external_exports.record(external_exports.string(), Zn).refine((e3) => Object.keys(e3).length > 0, { message: "At least one flow is required" }).describe("Named flow configurations (e.g., production, staging, development)") });
|
|
15297
|
+
ni = ei.extend({ version: external_exports.literal(1).describe("Configuration schema version 1") }).describe("walkerOS v1 configuration");
|
|
15298
|
+
ii = ei.extend({ version: external_exports.literal(2).describe("Configuration schema version 2"), contract: Yn.optional().describe("Data contract: entity-action keyed JSON Schema with additive inheritance") }).describe("walkerOS v2 configuration with data contracts");
|
|
15299
|
+
ti = external_exports.union([ni, ii]).describe("Complete multi-flow walkerOS configuration (walkeros.config.json)");
|
|
15300
|
+
ci = external_exports.toJSONSchema(ti, { target: "draft-7" });
|
|
15301
|
+
li = external_exports.toJSONSchema(ii, { target: "draft-7" });
|
|
15302
|
+
di = o(Zn);
|
|
15303
|
+
pi = o(Hn);
|
|
15304
|
+
ui = o(Qn);
|
|
15305
|
+
mi = o(Gn);
|
|
15306
|
+
bi = o(_n);
|
|
15301
15307
|
}
|
|
15302
15308
|
});
|
|
15303
15309
|
|
|
@@ -15369,15 +15375,15 @@ function loadBundleConfig(rawConfig, options) {
|
|
|
15369
15375
|
const setup = validateFlowSetup(rawConfig);
|
|
15370
15376
|
const availableFlows = getAvailableFlows(setup);
|
|
15371
15377
|
const flowName = resolveFlow(setup, options.flowName, availableFlows);
|
|
15372
|
-
let flowConfig =
|
|
15373
|
-
const platform =
|
|
15378
|
+
let flowConfig = C(setup, flowName, { deferred: true });
|
|
15379
|
+
const platform = D(flowConfig);
|
|
15374
15380
|
if (!platform) {
|
|
15375
15381
|
throw new Error(
|
|
15376
15382
|
`Invalid configuration: flow "${flowName}" must have a "web" or "server" key.`
|
|
15377
15383
|
);
|
|
15378
15384
|
}
|
|
15379
15385
|
if (platform === "web") {
|
|
15380
|
-
flowConfig =
|
|
15386
|
+
flowConfig = C(setup, flowName);
|
|
15381
15387
|
}
|
|
15382
15388
|
const buildDefaults = getBuildDefaults(platform);
|
|
15383
15389
|
const packages = flowConfig.packages || {};
|
|
@@ -15455,11 +15461,11 @@ var init_config = __esm({
|
|
|
15455
15461
|
|
|
15456
15462
|
// ../server/core/dist/index.mjs
|
|
15457
15463
|
import { createHash as n2 } from "crypto";
|
|
15458
|
-
async function u3(
|
|
15459
|
-
return (await (async function(
|
|
15460
|
-
const
|
|
15461
|
-
return
|
|
15462
|
-
})(
|
|
15464
|
+
async function u3(t, e3) {
|
|
15465
|
+
return (await (async function(t2) {
|
|
15466
|
+
const e4 = n2("sha256");
|
|
15467
|
+
return e4.update(t2), e4.digest("hex");
|
|
15468
|
+
})(t)).slice(0, e3);
|
|
15463
15469
|
}
|
|
15464
15470
|
var init_dist2 = __esm({
|
|
15465
15471
|
"../server/core/dist/index.mjs"() {
|
|
@@ -15788,11 +15794,18 @@ async function copyIncludes(includes, sourceDir, outputDir, logger) {
|
|
|
15788
15794
|
const sourcePath = path8.resolve(sourceDir, include);
|
|
15789
15795
|
const folderName = path8.basename(include);
|
|
15790
15796
|
const destPath = path8.join(outputDir, folderName);
|
|
15797
|
+
const resolvedOutput = path8.resolve(outputDir);
|
|
15798
|
+
const resolvedSource = path8.resolve(sourcePath);
|
|
15799
|
+
if (resolvedSource === resolvedOutput || resolvedOutput.startsWith(resolvedSource + path8.sep) || resolvedSource.startsWith(resolvedOutput + path8.sep)) {
|
|
15800
|
+
throw new Error(
|
|
15801
|
+
`Circular include detected: "${include}" resolves to "${resolvedSource}" which overlaps with output directory "${resolvedOutput}"`
|
|
15802
|
+
);
|
|
15803
|
+
}
|
|
15791
15804
|
if (await fs8.pathExists(sourcePath)) {
|
|
15792
15805
|
await fs8.copy(sourcePath, destPath);
|
|
15793
15806
|
logger.debug(`Copied ${include} to output`);
|
|
15794
15807
|
} else {
|
|
15795
|
-
logger.
|
|
15808
|
+
logger.warn(`Include folder not found: ${include}`);
|
|
15796
15809
|
}
|
|
15797
15810
|
}
|
|
15798
15811
|
}
|
|
@@ -16141,6 +16154,18 @@ function detectTransformerPackages(flowConfig) {
|
|
|
16141
16154
|
}
|
|
16142
16155
|
return transformerPackages;
|
|
16143
16156
|
}
|
|
16157
|
+
function detectStorePackages(flowConfig) {
|
|
16158
|
+
const storePackages = /* @__PURE__ */ new Set();
|
|
16159
|
+
const stores = flowConfig.stores;
|
|
16160
|
+
if (stores) {
|
|
16161
|
+
for (const [, storeConfig] of Object.entries(stores)) {
|
|
16162
|
+
if (typeof storeConfig === "object" && storeConfig !== null && "package" in storeConfig && typeof storeConfig.package === "string") {
|
|
16163
|
+
storePackages.add(storeConfig.package);
|
|
16164
|
+
}
|
|
16165
|
+
}
|
|
16166
|
+
}
|
|
16167
|
+
return storePackages;
|
|
16168
|
+
}
|
|
16144
16169
|
function detectExplicitCodeImports(flowConfig) {
|
|
16145
16170
|
const explicitCodeImports = /* @__PURE__ */ new Map();
|
|
16146
16171
|
const destinations = flowConfig.destinations;
|
|
@@ -16196,22 +16221,37 @@ function detectExplicitCodeImports(flowConfig) {
|
|
|
16196
16221
|
}
|
|
16197
16222
|
}
|
|
16198
16223
|
}
|
|
16224
|
+
const stores = flowConfig.stores;
|
|
16225
|
+
if (stores) {
|
|
16226
|
+
for (const [, storeConfig] of Object.entries(stores)) {
|
|
16227
|
+
if (typeof storeConfig === "object" && storeConfig !== null && "package" in storeConfig && typeof storeConfig.package === "string" && "code" in storeConfig && typeof storeConfig.code === "string") {
|
|
16228
|
+
const isAutoGenerated = storeConfig.code.startsWith("_");
|
|
16229
|
+
if (!isAutoGenerated) {
|
|
16230
|
+
if (!explicitCodeImports.has(storeConfig.package)) {
|
|
16231
|
+
explicitCodeImports.set(storeConfig.package, /* @__PURE__ */ new Set());
|
|
16232
|
+
}
|
|
16233
|
+
explicitCodeImports.get(storeConfig.package).add(storeConfig.code);
|
|
16234
|
+
}
|
|
16235
|
+
}
|
|
16236
|
+
}
|
|
16237
|
+
}
|
|
16199
16238
|
return explicitCodeImports;
|
|
16200
16239
|
}
|
|
16201
|
-
function generateImportStatements(packages, destinationPackages, sourcePackages, transformerPackages, explicitCodeImports) {
|
|
16240
|
+
function generateImportStatements(packages, destinationPackages, sourcePackages, transformerPackages, storePackages, explicitCodeImports) {
|
|
16202
16241
|
const importStatements = [];
|
|
16203
16242
|
const examplesMappings = [];
|
|
16204
16243
|
const usedPackages = /* @__PURE__ */ new Set([
|
|
16205
16244
|
...destinationPackages,
|
|
16206
16245
|
...sourcePackages,
|
|
16207
|
-
...transformerPackages
|
|
16246
|
+
...transformerPackages,
|
|
16247
|
+
...storePackages
|
|
16208
16248
|
]);
|
|
16209
16249
|
for (const [packageName, packageConfig] of Object.entries(packages)) {
|
|
16210
16250
|
const isUsedByDestOrSource = usedPackages.has(packageName);
|
|
16211
16251
|
const hasExplicitCode = explicitCodeImports.has(packageName);
|
|
16212
16252
|
const namedImportsToGenerate = [];
|
|
16213
16253
|
if (isUsedByDestOrSource && !hasExplicitCode) {
|
|
16214
|
-
const varName =
|
|
16254
|
+
const varName = _(packageName);
|
|
16215
16255
|
importStatements.push(`import ${varName} from '${packageName}';`);
|
|
16216
16256
|
}
|
|
16217
16257
|
if (hasExplicitCode) {
|
|
@@ -16260,16 +16300,73 @@ function generateImportStatements(packages, destinationPackages, sourcePackages,
|
|
|
16260
16300
|
}
|
|
16261
16301
|
return { importStatements, examplesMappings };
|
|
16262
16302
|
}
|
|
16303
|
+
function validateComponentNames(components, section) {
|
|
16304
|
+
for (const name of Object.keys(components)) {
|
|
16305
|
+
if (!VALID_JS_IDENTIFIER.test(name)) {
|
|
16306
|
+
throw new Error(
|
|
16307
|
+
`Invalid ${section} name "${name}": must be a valid JavaScript identifier (use camelCase, e.g., "${name.replace(/-([a-z])/g, (_3, c2) => c2.toUpperCase())}")`
|
|
16308
|
+
);
|
|
16309
|
+
}
|
|
16310
|
+
}
|
|
16311
|
+
}
|
|
16312
|
+
function validateStoreReferences(flowConfig, storeIds) {
|
|
16313
|
+
const refs = [];
|
|
16314
|
+
function collectRefs(obj, path11) {
|
|
16315
|
+
if (typeof obj === "string" && obj.startsWith("$store:")) {
|
|
16316
|
+
refs.push({ ref: obj.slice(7), location: path11 });
|
|
16317
|
+
} else if (obj && typeof obj === "object") {
|
|
16318
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
16319
|
+
collectRefs(val, `${path11}.${key}`);
|
|
16320
|
+
}
|
|
16321
|
+
}
|
|
16322
|
+
}
|
|
16323
|
+
for (const [section, components] of Object.entries({
|
|
16324
|
+
sources: flowConfig.sources || {},
|
|
16325
|
+
destinations: flowConfig.destinations || {},
|
|
16326
|
+
transformers: flowConfig.transformers || {}
|
|
16327
|
+
})) {
|
|
16328
|
+
for (const [id, component] of Object.entries(
|
|
16329
|
+
components
|
|
16330
|
+
)) {
|
|
16331
|
+
collectRefs(component, `${section}.${id}`);
|
|
16332
|
+
}
|
|
16333
|
+
}
|
|
16334
|
+
for (const { ref, location } of refs) {
|
|
16335
|
+
if (!storeIds.has(ref)) {
|
|
16336
|
+
const available = storeIds.size > 0 ? `Available stores: ${Array.from(storeIds).join(", ")}` : "No stores defined";
|
|
16337
|
+
throw new Error(
|
|
16338
|
+
`Store reference "$store:${ref}" in ${location} \u2014 store "${ref}" not found. ${available}`
|
|
16339
|
+
);
|
|
16340
|
+
}
|
|
16341
|
+
}
|
|
16342
|
+
}
|
|
16263
16343
|
async function createEntryPoint(flowConfig, buildOptions, packagePaths) {
|
|
16264
16344
|
const destinationPackages = detectDestinationPackages(flowConfig);
|
|
16265
16345
|
const sourcePackages = detectSourcePackages(flowConfig);
|
|
16266
16346
|
const transformerPackages = detectTransformerPackages(flowConfig);
|
|
16347
|
+
const storePackages = detectStorePackages(flowConfig);
|
|
16267
16348
|
const explicitCodeImports = detectExplicitCodeImports(flowConfig);
|
|
16349
|
+
const storeIds = new Set(
|
|
16350
|
+
Object.keys(
|
|
16351
|
+
flowConfig.stores || {}
|
|
16352
|
+
)
|
|
16353
|
+
);
|
|
16354
|
+
validateStoreReferences(flowConfig, storeIds);
|
|
16355
|
+
const flowWithSections = flowConfig;
|
|
16356
|
+
if (flowWithSections.sources)
|
|
16357
|
+
validateComponentNames(flowWithSections.sources, "sources");
|
|
16358
|
+
if (flowWithSections.destinations)
|
|
16359
|
+
validateComponentNames(flowWithSections.destinations, "destinations");
|
|
16360
|
+
if (flowWithSections.transformers)
|
|
16361
|
+
validateComponentNames(flowWithSections.transformers, "transformers");
|
|
16362
|
+
if (flowWithSections.stores)
|
|
16363
|
+
validateComponentNames(flowWithSections.stores, "stores");
|
|
16268
16364
|
const { importStatements } = generateImportStatements(
|
|
16269
16365
|
buildOptions.packages,
|
|
16270
16366
|
destinationPackages,
|
|
16271
16367
|
sourcePackages,
|
|
16272
16368
|
transformerPackages,
|
|
16369
|
+
storePackages,
|
|
16273
16370
|
explicitCodeImports
|
|
16274
16371
|
);
|
|
16275
16372
|
const importsCode = importStatements.join("\n");
|
|
@@ -16322,6 +16419,7 @@ function buildConfigObject(flowConfig, explicitCodeImports) {
|
|
|
16322
16419
|
const sources = flowWithProps.sources || {};
|
|
16323
16420
|
const destinations = flowWithProps.destinations || {};
|
|
16324
16421
|
const transformers = flowWithProps.transformers || {};
|
|
16422
|
+
const stores = flowWithProps.stores || {};
|
|
16325
16423
|
Object.entries(sources).forEach(([name, source]) => {
|
|
16326
16424
|
if (source.code !== true) {
|
|
16327
16425
|
validateReference("Source", name, source);
|
|
@@ -16347,7 +16445,7 @@ function buildConfigObject(flowConfig, explicitCodeImports) {
|
|
|
16347
16445
|
if (source.code && typeof source.code === "string" && explicitCodeImports.has(source.package)) {
|
|
16348
16446
|
codeVar = source.code;
|
|
16349
16447
|
} else {
|
|
16350
|
-
codeVar =
|
|
16448
|
+
codeVar = _(source.package);
|
|
16351
16449
|
}
|
|
16352
16450
|
const configStr = source.config ? processConfigValue(source.config) : "{}";
|
|
16353
16451
|
const envStr = source.env ? `,
|
|
@@ -16369,7 +16467,7 @@ function buildConfigObject(flowConfig, explicitCodeImports) {
|
|
|
16369
16467
|
if (dest.code && typeof dest.code === "string" && explicitCodeImports.has(dest.package)) {
|
|
16370
16468
|
codeVar = dest.code;
|
|
16371
16469
|
} else {
|
|
16372
|
-
codeVar =
|
|
16470
|
+
codeVar = _(dest.package);
|
|
16373
16471
|
}
|
|
16374
16472
|
const configStr = dest.config ? processConfigValue(dest.config) : "{}";
|
|
16375
16473
|
const envStr = dest.env ? `,
|
|
@@ -16391,7 +16489,7 @@ function buildConfigObject(flowConfig, explicitCodeImports) {
|
|
|
16391
16489
|
if (transformer.code && typeof transformer.code === "string" && explicitCodeImports.has(transformer.package)) {
|
|
16392
16490
|
codeVar = transformer.code;
|
|
16393
16491
|
} else {
|
|
16394
|
-
codeVar =
|
|
16492
|
+
codeVar = _(transformer.package);
|
|
16395
16493
|
}
|
|
16396
16494
|
const configStr = transformer.config ? processConfigValue(transformer.config) : "{}";
|
|
16397
16495
|
const envStr = transformer.env ? `,
|
|
@@ -16403,11 +16501,38 @@ function buildConfigObject(flowConfig, explicitCodeImports) {
|
|
|
16403
16501
|
config: ${configStr}${envStr}${nextStr}
|
|
16404
16502
|
}`;
|
|
16405
16503
|
});
|
|
16504
|
+
Object.entries(stores).forEach(([name, store]) => {
|
|
16505
|
+
if (store.package || isInlineCode(store.code)) {
|
|
16506
|
+
validateReference("Store", name, store);
|
|
16507
|
+
}
|
|
16508
|
+
});
|
|
16509
|
+
const storesEntries = Object.entries(stores).filter(([, store]) => store.package || isInlineCode(store.code)).map(([key, store]) => {
|
|
16510
|
+
if (isInlineCode(store.code)) {
|
|
16511
|
+
return ` ${key}: ${generateInlineCode(store.code, store.config || {}, store.env)}`;
|
|
16512
|
+
}
|
|
16513
|
+
let codeVar;
|
|
16514
|
+
if (store.code && typeof store.code === "string" && explicitCodeImports.has(store.package)) {
|
|
16515
|
+
codeVar = store.code;
|
|
16516
|
+
} else {
|
|
16517
|
+
codeVar = _(store.package);
|
|
16518
|
+
}
|
|
16519
|
+
const configStr = store.config ? processConfigValue(store.config) : "{}";
|
|
16520
|
+
const envStr = store.env ? `,
|
|
16521
|
+
env: ${processConfigValue(store.env)}` : "";
|
|
16522
|
+
return ` ${key}: {
|
|
16523
|
+
code: ${codeVar},
|
|
16524
|
+
config: ${configStr}${envStr}
|
|
16525
|
+
}`;
|
|
16526
|
+
});
|
|
16406
16527
|
const collectorStr = flowWithProps.collector ? `,
|
|
16407
16528
|
...${processConfigValue(flowWithProps.collector)}` : "";
|
|
16408
16529
|
const transformersStr = transformersEntries.length > 0 ? `,
|
|
16409
16530
|
transformers: {
|
|
16410
16531
|
${transformersEntries.join(",\n")}
|
|
16532
|
+
}` : "";
|
|
16533
|
+
const storesStr = storesEntries.length > 0 ? `,
|
|
16534
|
+
stores: {
|
|
16535
|
+
${storesEntries.join(",\n")}
|
|
16411
16536
|
}` : "";
|
|
16412
16537
|
return `{
|
|
16413
16538
|
sources: {
|
|
@@ -16415,7 +16540,7 @@ ${sourcesEntries.join(",\n")}
|
|
|
16415
16540
|
},
|
|
16416
16541
|
destinations: {
|
|
16417
16542
|
${destinationsEntries.join(",\n")}
|
|
16418
|
-
}${transformersStr}${collectorStr}
|
|
16543
|
+
}${transformersStr}${storesStr}${collectorStr}
|
|
16419
16544
|
}`;
|
|
16420
16545
|
}
|
|
16421
16546
|
function processConfigValue(value) {
|
|
@@ -16425,10 +16550,14 @@ function serializeWithCode(value, indent) {
|
|
|
16425
16550
|
const spaces = " ".repeat(indent);
|
|
16426
16551
|
const nextSpaces = " ".repeat(indent + 1);
|
|
16427
16552
|
if (typeof value === "string") {
|
|
16553
|
+
if (value.startsWith("$store:")) {
|
|
16554
|
+
const storeId = value.slice(7);
|
|
16555
|
+
return `stores.${storeId}`;
|
|
16556
|
+
}
|
|
16428
16557
|
if (value.startsWith("$code:")) {
|
|
16429
16558
|
return value.slice(6);
|
|
16430
16559
|
}
|
|
16431
|
-
const esc2 =
|
|
16560
|
+
const esc2 = T.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16432
16561
|
const markerRe = new RegExp(
|
|
16433
16562
|
esc2 + "([a-zA-Z_][a-zA-Z0-9_]*)(?::((?:(?!" + esc2 + `)[^\\s"'])*))?`,
|
|
16434
16563
|
"g"
|
|
@@ -16473,7 +16602,7 @@ ${spaces}]`;
|
|
|
16473
16602
|
const entries = Object.entries(value);
|
|
16474
16603
|
if (entries.length === 0) return "{}";
|
|
16475
16604
|
const props = entries.map(
|
|
16476
|
-
([
|
|
16605
|
+
([k2, v2]) => `${nextSpaces}${JSON.stringify(k2)}: ${serializeWithCode(v2, indent + 1)}`
|
|
16477
16606
|
);
|
|
16478
16607
|
return `{
|
|
16479
16608
|
${props.join(",\n")}
|
|
@@ -16533,6 +16662,7 @@ function generatePlatformWrapper(configObject, userCode, buildOptions) {
|
|
|
16533
16662
|
}`;
|
|
16534
16663
|
}
|
|
16535
16664
|
}
|
|
16665
|
+
var VALID_JS_IDENTIFIER;
|
|
16536
16666
|
var init_bundler = __esm({
|
|
16537
16667
|
"src/commands/bundle/bundler.ts"() {
|
|
16538
16668
|
"use strict";
|
|
@@ -16540,6 +16670,7 @@ var init_bundler = __esm({
|
|
|
16540
16670
|
init_package_manager();
|
|
16541
16671
|
init_tmp();
|
|
16542
16672
|
init_build_cache();
|
|
16673
|
+
VALID_JS_IDENTIFIER = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
16543
16674
|
}
|
|
16544
16675
|
});
|
|
16545
16676
|
|
|
@@ -16568,9 +16699,17 @@ var init_api_client = __esm({
|
|
|
16568
16699
|
}
|
|
16569
16700
|
});
|
|
16570
16701
|
|
|
16702
|
+
// src/commands/bundle/dockerfile.ts
|
|
16703
|
+
import fs10 from "fs-extra";
|
|
16704
|
+
var init_dockerfile = __esm({
|
|
16705
|
+
"src/commands/bundle/dockerfile.ts"() {
|
|
16706
|
+
"use strict";
|
|
16707
|
+
}
|
|
16708
|
+
});
|
|
16709
|
+
|
|
16571
16710
|
// src/commands/bundle/index.ts
|
|
16572
16711
|
import path9 from "path";
|
|
16573
|
-
import
|
|
16712
|
+
import fs11 from "fs-extra";
|
|
16574
16713
|
async function bundle(configOrPath, options = {}) {
|
|
16575
16714
|
let rawConfig;
|
|
16576
16715
|
let configPath = path9.resolve(process.cwd(), "walkeros.config.json");
|
|
@@ -16608,6 +16747,7 @@ var init_bundle = __esm({
|
|
|
16608
16747
|
init_upload();
|
|
16609
16748
|
init_stats();
|
|
16610
16749
|
init_api_client();
|
|
16750
|
+
init_dockerfile();
|
|
16611
16751
|
}
|
|
16612
16752
|
});
|
|
16613
16753
|
|
|
@@ -16618,13 +16758,13 @@ __export(utils_exports, {
|
|
|
16618
16758
|
prepareBundleForRun: () => prepareBundleForRun
|
|
16619
16759
|
});
|
|
16620
16760
|
import path10 from "path";
|
|
16621
|
-
import
|
|
16761
|
+
import fs12 from "fs-extra";
|
|
16622
16762
|
async function prepareBundleForRun(configPath, options) {
|
|
16623
16763
|
const tempDir = getTmpPath(
|
|
16624
16764
|
void 0,
|
|
16625
16765
|
`run-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
16626
16766
|
);
|
|
16627
|
-
await
|
|
16767
|
+
await fs12.ensureDir(tempDir);
|
|
16628
16768
|
const tempPath = path10.join(tempDir, "bundle.mjs");
|
|
16629
16769
|
await bundle(configPath, {
|
|
16630
16770
|
cache: true,
|