@powerhousedao/workflow 6.2.3-dev.12 → 6.2.3-dev.14
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/dist/node/{PieceMarkdown-Q9C9CPGu.mjs → PieceMarkdown-D9nI2gI2.mjs} +2 -2
- package/dist/node/{PieceMarkdown-Q9C9CPGu.mjs.map → PieceMarkdown-D9nI2gI2.mjs.map} +1 -1
- package/dist/node/{editor-D7WL8J_4.mjs → editor-iDEb5EeC.mjs} +2 -2
- package/dist/node/{editor-D7WL8J_4.mjs.map → editor-iDEb5EeC.mjs.map} +1 -1
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/pieces/reactor/descriptor.json +424 -0
- package/dist/node/pieces/reactor/index.mjs +1646 -703
- package/dist/node/pieces/reactor/index.mjs.map +1 -1
- package/dist/node/pieces/reactor/package.json +9 -0
- package/dist/powerhouse.manifest.json +14 -4
- package/package.json +7 -7
|
@@ -1,18 +1,1382 @@
|
|
|
1
|
-
import * as z from "zod/mini";
|
|
2
1
|
import crypto from "crypto";
|
|
2
|
+
Object.freeze({ status: "aborted" });
|
|
3
|
+
function $constructor(name, initializer, params) {
|
|
4
|
+
function init(inst, def) {
|
|
5
|
+
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
6
|
+
value: {
|
|
7
|
+
def,
|
|
8
|
+
constr: _,
|
|
9
|
+
traits: /* @__PURE__ */ new Set()
|
|
10
|
+
},
|
|
11
|
+
enumerable: false
|
|
12
|
+
});
|
|
13
|
+
if (inst._zod.traits.has(name)) return;
|
|
14
|
+
inst._zod.traits.add(name);
|
|
15
|
+
initializer(inst, def);
|
|
16
|
+
const proto = _.prototype;
|
|
17
|
+
const keys = Object.keys(proto);
|
|
18
|
+
for (let i = 0; i < keys.length; i++) {
|
|
19
|
+
const k = keys[i];
|
|
20
|
+
if (!(k in inst)) inst[k] = proto[k].bind(inst);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const Parent = params?.Parent ?? Object;
|
|
24
|
+
class Definition extends Parent {}
|
|
25
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
26
|
+
function _(def) {
|
|
27
|
+
var _a;
|
|
28
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
29
|
+
init(inst, def);
|
|
30
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
31
|
+
for (const fn of inst._zod.deferred) fn();
|
|
32
|
+
return inst;
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(_, "init", { value: init });
|
|
35
|
+
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
36
|
+
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
37
|
+
return inst?._zod?.traits?.has(name);
|
|
38
|
+
} });
|
|
39
|
+
Object.defineProperty(_, "name", { value: name });
|
|
40
|
+
return _;
|
|
41
|
+
}
|
|
42
|
+
var $ZodAsyncError = class extends Error {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var $ZodEncodeError = class extends Error {
|
|
48
|
+
constructor(name) {
|
|
49
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
50
|
+
this.name = "ZodEncodeError";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const globalConfig = {};
|
|
54
|
+
function config(newConfig) {
|
|
55
|
+
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
56
|
+
return globalConfig;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
|
|
60
|
+
function getEnumValues(entries) {
|
|
61
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
62
|
+
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
63
|
+
}
|
|
64
|
+
function jsonStringifyReplacer(_, value) {
|
|
65
|
+
if (typeof value === "bigint") return value.toString();
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
function cached(getter) {
|
|
69
|
+
return { get value() {
|
|
70
|
+
{
|
|
71
|
+
const value = getter();
|
|
72
|
+
Object.defineProperty(this, "value", { value });
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
throw new Error("cached value already set");
|
|
76
|
+
} };
|
|
77
|
+
}
|
|
78
|
+
function nullish(input) {
|
|
79
|
+
return input === null || input === void 0;
|
|
80
|
+
}
|
|
81
|
+
function cleanRegex(source) {
|
|
82
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
83
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
84
|
+
return source.slice(start, end);
|
|
85
|
+
}
|
|
86
|
+
const EVALUATING = Symbol("evaluating");
|
|
87
|
+
function defineLazy(object, key, getter) {
|
|
88
|
+
let value = void 0;
|
|
89
|
+
Object.defineProperty(object, key, {
|
|
90
|
+
get() {
|
|
91
|
+
if (value === EVALUATING) return;
|
|
92
|
+
if (value === void 0) {
|
|
93
|
+
value = EVALUATING;
|
|
94
|
+
value = getter();
|
|
95
|
+
}
|
|
96
|
+
return value;
|
|
97
|
+
},
|
|
98
|
+
set(v) {
|
|
99
|
+
Object.defineProperty(object, key, { value: v });
|
|
100
|
+
},
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
105
|
+
function isObject(data) {
|
|
106
|
+
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
107
|
+
}
|
|
108
|
+
cached(() => {
|
|
109
|
+
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
110
|
+
try {
|
|
111
|
+
new Function("");
|
|
112
|
+
return true;
|
|
113
|
+
} catch (_) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
function isPlainObject(o) {
|
|
118
|
+
if (isObject(o) === false) return false;
|
|
119
|
+
const ctor = o.constructor;
|
|
120
|
+
if (ctor === void 0) return true;
|
|
121
|
+
if (typeof ctor !== "function") return true;
|
|
122
|
+
const prot = ctor.prototype;
|
|
123
|
+
if (isObject(prot) === false) return false;
|
|
124
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
const propertyKeyTypes = new Set([
|
|
128
|
+
"string",
|
|
129
|
+
"number",
|
|
130
|
+
"symbol"
|
|
131
|
+
]);
|
|
132
|
+
function escapeRegex(str) {
|
|
133
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
134
|
+
}
|
|
135
|
+
function clone(inst, def, params) {
|
|
136
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
137
|
+
if (!def || params?.parent) cl._zod.parent = inst;
|
|
138
|
+
return cl;
|
|
139
|
+
}
|
|
140
|
+
function normalizeParams(_params) {
|
|
141
|
+
const params = _params;
|
|
142
|
+
if (!params) return {};
|
|
143
|
+
if (typeof params === "string") return { error: () => params };
|
|
144
|
+
if (params?.message !== void 0) {
|
|
145
|
+
if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
|
|
146
|
+
params.error = params.message;
|
|
147
|
+
}
|
|
148
|
+
delete params.message;
|
|
149
|
+
if (typeof params.error === "string") return {
|
|
150
|
+
...params,
|
|
151
|
+
error: () => params.error
|
|
152
|
+
};
|
|
153
|
+
return params;
|
|
154
|
+
}
|
|
155
|
+
function optionalKeys(shape) {
|
|
156
|
+
return Object.keys(shape).filter((k) => {
|
|
157
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, -Number.MAX_VALUE, Number.MAX_VALUE;
|
|
161
|
+
function aborted(x, startIndex = 0) {
|
|
162
|
+
if (x.aborted === true) return true;
|
|
163
|
+
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
function prefixIssues(path, issues) {
|
|
167
|
+
return issues.map((iss) => {
|
|
168
|
+
var _a;
|
|
169
|
+
(_a = iss).path ?? (_a.path = []);
|
|
170
|
+
iss.path.unshift(path);
|
|
171
|
+
return iss;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function unwrapMessage(message) {
|
|
175
|
+
return typeof message === "string" ? message : message?.message;
|
|
176
|
+
}
|
|
177
|
+
function finalizeIssue(iss, ctx, config) {
|
|
178
|
+
const full = {
|
|
179
|
+
...iss,
|
|
180
|
+
path: iss.path ?? []
|
|
181
|
+
};
|
|
182
|
+
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
183
|
+
delete full.inst;
|
|
184
|
+
delete full.continue;
|
|
185
|
+
if (!ctx?.reportInput) delete full.input;
|
|
186
|
+
return full;
|
|
187
|
+
}
|
|
188
|
+
function getLengthableOrigin(input) {
|
|
189
|
+
if (Array.isArray(input)) return "array";
|
|
190
|
+
if (typeof input === "string") return "string";
|
|
191
|
+
return "unknown";
|
|
192
|
+
}
|
|
193
|
+
function issue(...args) {
|
|
194
|
+
const [iss, input, inst] = args;
|
|
195
|
+
if (typeof iss === "string") return {
|
|
196
|
+
message: iss,
|
|
197
|
+
code: "custom",
|
|
198
|
+
input,
|
|
199
|
+
inst
|
|
200
|
+
};
|
|
201
|
+
return { ...iss };
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
|
|
205
|
+
const initializer = (inst, def) => {
|
|
206
|
+
inst.name = "$ZodError";
|
|
207
|
+
Object.defineProperty(inst, "_zod", {
|
|
208
|
+
value: inst._zod,
|
|
209
|
+
enumerable: false
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(inst, "issues", {
|
|
212
|
+
value: def,
|
|
213
|
+
enumerable: false
|
|
214
|
+
});
|
|
215
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
216
|
+
Object.defineProperty(inst, "toString", {
|
|
217
|
+
value: () => inst.message,
|
|
218
|
+
enumerable: false
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
const $ZodError = $constructor("$ZodError", initializer);
|
|
222
|
+
const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
|
|
225
|
+
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
226
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
227
|
+
const result = schema._zod.run({
|
|
228
|
+
value,
|
|
229
|
+
issues: []
|
|
230
|
+
}, ctx);
|
|
231
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
232
|
+
if (result.issues.length) {
|
|
233
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
234
|
+
captureStackTrace(e, _params?.callee);
|
|
235
|
+
throw e;
|
|
236
|
+
}
|
|
237
|
+
return result.value;
|
|
238
|
+
};
|
|
239
|
+
const parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
240
|
+
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
241
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
242
|
+
let result = schema._zod.run({
|
|
243
|
+
value,
|
|
244
|
+
issues: []
|
|
245
|
+
}, ctx);
|
|
246
|
+
if (result instanceof Promise) result = await result;
|
|
247
|
+
if (result.issues.length) {
|
|
248
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
249
|
+
captureStackTrace(e, params?.callee);
|
|
250
|
+
throw e;
|
|
251
|
+
}
|
|
252
|
+
return result.value;
|
|
253
|
+
};
|
|
254
|
+
const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
255
|
+
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
256
|
+
const ctx = _ctx ? {
|
|
257
|
+
..._ctx,
|
|
258
|
+
async: false
|
|
259
|
+
} : { async: false };
|
|
260
|
+
const result = schema._zod.run({
|
|
261
|
+
value,
|
|
262
|
+
issues: []
|
|
263
|
+
}, ctx);
|
|
264
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
265
|
+
return result.issues.length ? {
|
|
266
|
+
success: false,
|
|
267
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
268
|
+
} : {
|
|
269
|
+
success: true,
|
|
270
|
+
data: result.value
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
274
|
+
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
275
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
276
|
+
let result = schema._zod.run({
|
|
277
|
+
value,
|
|
278
|
+
issues: []
|
|
279
|
+
}, ctx);
|
|
280
|
+
if (result instanceof Promise) result = await result;
|
|
281
|
+
return result.issues.length ? {
|
|
282
|
+
success: false,
|
|
283
|
+
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
284
|
+
} : {
|
|
285
|
+
success: true,
|
|
286
|
+
data: result.value
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
290
|
+
const string$1 = (params) => {
|
|
291
|
+
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
292
|
+
return new RegExp(`^${regex}$`);
|
|
293
|
+
};
|
|
294
|
+
const number$2 = /^-?\d+(?:\.\d+)?$/;
|
|
295
|
+
const boolean$1 = /^(?:true|false)$/i;
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
|
|
298
|
+
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
299
|
+
var _a;
|
|
300
|
+
inst._zod ?? (inst._zod = {});
|
|
301
|
+
inst._zod.def = def;
|
|
302
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
303
|
+
});
|
|
304
|
+
const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
305
|
+
var _a;
|
|
306
|
+
$ZodCheck.init(inst, def);
|
|
307
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
308
|
+
const val = payload.value;
|
|
309
|
+
return !nullish(val) && val.length !== void 0;
|
|
310
|
+
});
|
|
311
|
+
inst._zod.onattach.push((inst) => {
|
|
312
|
+
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
313
|
+
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
314
|
+
});
|
|
315
|
+
inst._zod.check = (payload) => {
|
|
316
|
+
const input = payload.value;
|
|
317
|
+
if (input.length >= def.minimum) return;
|
|
318
|
+
const origin = getLengthableOrigin(input);
|
|
319
|
+
payload.issues.push({
|
|
320
|
+
origin,
|
|
321
|
+
code: "too_small",
|
|
322
|
+
minimum: def.minimum,
|
|
323
|
+
inclusive: true,
|
|
324
|
+
input,
|
|
325
|
+
inst,
|
|
326
|
+
continue: !def.abort
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
});
|
|
330
|
+
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
331
|
+
var _a, _b;
|
|
332
|
+
$ZodCheck.init(inst, def);
|
|
333
|
+
inst._zod.onattach.push((inst) => {
|
|
334
|
+
const bag = inst._zod.bag;
|
|
335
|
+
bag.format = def.format;
|
|
336
|
+
if (def.pattern) {
|
|
337
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
338
|
+
bag.patterns.add(def.pattern);
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
342
|
+
def.pattern.lastIndex = 0;
|
|
343
|
+
if (def.pattern.test(payload.value)) return;
|
|
344
|
+
payload.issues.push({
|
|
345
|
+
origin: "string",
|
|
346
|
+
code: "invalid_format",
|
|
347
|
+
format: def.format,
|
|
348
|
+
input: payload.value,
|
|
349
|
+
...def.pattern ? { pattern: def.pattern.toString() } : {},
|
|
350
|
+
inst,
|
|
351
|
+
continue: !def.abort
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
else (_b = inst._zod).check ?? (_b.check = () => {});
|
|
355
|
+
});
|
|
356
|
+
const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
357
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
358
|
+
inst._zod.check = (payload) => {
|
|
359
|
+
def.pattern.lastIndex = 0;
|
|
360
|
+
if (def.pattern.test(payload.value)) return;
|
|
361
|
+
payload.issues.push({
|
|
362
|
+
origin: "string",
|
|
363
|
+
code: "invalid_format",
|
|
364
|
+
format: "regex",
|
|
365
|
+
input: payload.value,
|
|
366
|
+
pattern: def.pattern.toString(),
|
|
367
|
+
inst,
|
|
368
|
+
continue: !def.abort
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
});
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
|
|
374
|
+
const version = {
|
|
375
|
+
major: 4,
|
|
376
|
+
minor: 3,
|
|
377
|
+
patch: 6
|
|
378
|
+
};
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
|
|
381
|
+
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
382
|
+
var _a;
|
|
383
|
+
inst ?? (inst = {});
|
|
384
|
+
inst._zod.def = def;
|
|
385
|
+
inst._zod.bag = inst._zod.bag || {};
|
|
386
|
+
inst._zod.version = version;
|
|
387
|
+
const checks = [...inst._zod.def.checks ?? []];
|
|
388
|
+
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
389
|
+
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
390
|
+
if (checks.length === 0) {
|
|
391
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
392
|
+
inst._zod.deferred?.push(() => {
|
|
393
|
+
inst._zod.run = inst._zod.parse;
|
|
394
|
+
});
|
|
395
|
+
} else {
|
|
396
|
+
const runChecks = (payload, checks, ctx) => {
|
|
397
|
+
let isAborted = aborted(payload);
|
|
398
|
+
let asyncResult;
|
|
399
|
+
for (const ch of checks) {
|
|
400
|
+
if (ch._zod.def.when) {
|
|
401
|
+
if (!ch._zod.def.when(payload)) continue;
|
|
402
|
+
} else if (isAborted) continue;
|
|
403
|
+
const currLen = payload.issues.length;
|
|
404
|
+
const _ = ch._zod.check(payload);
|
|
405
|
+
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
406
|
+
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
407
|
+
await _;
|
|
408
|
+
if (payload.issues.length === currLen) return;
|
|
409
|
+
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
410
|
+
});
|
|
411
|
+
else {
|
|
412
|
+
if (payload.issues.length === currLen) continue;
|
|
413
|
+
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (asyncResult) return asyncResult.then(() => {
|
|
417
|
+
return payload;
|
|
418
|
+
});
|
|
419
|
+
return payload;
|
|
420
|
+
};
|
|
421
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
422
|
+
if (aborted(canary)) {
|
|
423
|
+
canary.aborted = true;
|
|
424
|
+
return canary;
|
|
425
|
+
}
|
|
426
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
427
|
+
if (checkResult instanceof Promise) {
|
|
428
|
+
if (ctx.async === false) throw new $ZodAsyncError();
|
|
429
|
+
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
430
|
+
}
|
|
431
|
+
return inst._zod.parse(checkResult, ctx);
|
|
432
|
+
};
|
|
433
|
+
inst._zod.run = (payload, ctx) => {
|
|
434
|
+
if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
|
|
435
|
+
if (ctx.direction === "backward") {
|
|
436
|
+
const canary = inst._zod.parse({
|
|
437
|
+
value: payload.value,
|
|
438
|
+
issues: []
|
|
439
|
+
}, {
|
|
440
|
+
...ctx,
|
|
441
|
+
skipChecks: true
|
|
442
|
+
});
|
|
443
|
+
if (canary instanceof Promise) return canary.then((canary) => {
|
|
444
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
445
|
+
});
|
|
446
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
447
|
+
}
|
|
448
|
+
const result = inst._zod.parse(payload, ctx);
|
|
449
|
+
if (result instanceof Promise) {
|
|
450
|
+
if (ctx.async === false) throw new $ZodAsyncError();
|
|
451
|
+
return result.then((result) => runChecks(result, checks, ctx));
|
|
452
|
+
}
|
|
453
|
+
return runChecks(result, checks, ctx);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
defineLazy(inst, "~standard", () => ({
|
|
457
|
+
validate: (value) => {
|
|
458
|
+
try {
|
|
459
|
+
const r = safeParse(inst, value);
|
|
460
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
461
|
+
} catch (_) {
|
|
462
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
vendor: "zod",
|
|
466
|
+
version: 1
|
|
467
|
+
}));
|
|
468
|
+
});
|
|
469
|
+
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
470
|
+
$ZodType.init(inst, def);
|
|
471
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
472
|
+
inst._zod.parse = (payload, _) => {
|
|
473
|
+
if (def.coerce) try {
|
|
474
|
+
payload.value = String(payload.value);
|
|
475
|
+
} catch (_) {}
|
|
476
|
+
if (typeof payload.value === "string") return payload;
|
|
477
|
+
payload.issues.push({
|
|
478
|
+
expected: "string",
|
|
479
|
+
code: "invalid_type",
|
|
480
|
+
input: payload.value,
|
|
481
|
+
inst
|
|
482
|
+
});
|
|
483
|
+
return payload;
|
|
484
|
+
};
|
|
485
|
+
});
|
|
486
|
+
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
487
|
+
$ZodType.init(inst, def);
|
|
488
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
|
|
489
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
490
|
+
if (def.coerce) try {
|
|
491
|
+
payload.value = Number(payload.value);
|
|
492
|
+
} catch (_) {}
|
|
493
|
+
const input = payload.value;
|
|
494
|
+
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
495
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
496
|
+
payload.issues.push({
|
|
497
|
+
expected: "number",
|
|
498
|
+
code: "invalid_type",
|
|
499
|
+
input,
|
|
500
|
+
inst,
|
|
501
|
+
...received ? { received } : {}
|
|
502
|
+
});
|
|
503
|
+
return payload;
|
|
504
|
+
};
|
|
505
|
+
});
|
|
506
|
+
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
507
|
+
$ZodType.init(inst, def);
|
|
508
|
+
inst._zod.pattern = boolean$1;
|
|
509
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
510
|
+
if (def.coerce) try {
|
|
511
|
+
payload.value = Boolean(payload.value);
|
|
512
|
+
} catch (_) {}
|
|
513
|
+
const input = payload.value;
|
|
514
|
+
if (typeof input === "boolean") return payload;
|
|
515
|
+
payload.issues.push({
|
|
516
|
+
expected: "boolean",
|
|
517
|
+
code: "invalid_type",
|
|
518
|
+
input,
|
|
519
|
+
inst
|
|
520
|
+
});
|
|
521
|
+
return payload;
|
|
522
|
+
};
|
|
523
|
+
});
|
|
524
|
+
const $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
|
|
525
|
+
$ZodType.init(inst, def);
|
|
526
|
+
inst._zod.parse = (payload) => payload;
|
|
527
|
+
});
|
|
528
|
+
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
529
|
+
$ZodType.init(inst, def);
|
|
530
|
+
inst._zod.parse = (payload) => payload;
|
|
531
|
+
});
|
|
532
|
+
const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
533
|
+
$ZodType.init(inst, def);
|
|
534
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
535
|
+
const input = payload.value;
|
|
536
|
+
if (typeof input === "undefined") return payload;
|
|
537
|
+
payload.issues.push({
|
|
538
|
+
expected: "void",
|
|
539
|
+
code: "invalid_type",
|
|
540
|
+
input,
|
|
541
|
+
inst
|
|
542
|
+
});
|
|
543
|
+
return payload;
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
function handleArrayResult(result, final, index) {
|
|
547
|
+
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
548
|
+
final.value[index] = result.value;
|
|
549
|
+
}
|
|
550
|
+
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
551
|
+
$ZodType.init(inst, def);
|
|
552
|
+
inst._zod.parse = (payload, ctx) => {
|
|
553
|
+
const input = payload.value;
|
|
554
|
+
if (!Array.isArray(input)) {
|
|
555
|
+
payload.issues.push({
|
|
556
|
+
expected: "array",
|
|
557
|
+
code: "invalid_type",
|
|
558
|
+
input,
|
|
559
|
+
inst
|
|
560
|
+
});
|
|
561
|
+
return payload;
|
|
562
|
+
}
|
|
563
|
+
payload.value = Array(input.length);
|
|
564
|
+
const proms = [];
|
|
565
|
+
for (let i = 0; i < input.length; i++) {
|
|
566
|
+
const item = input[i];
|
|
567
|
+
const result = def.element._zod.run({
|
|
568
|
+
value: item,
|
|
569
|
+
issues: []
|
|
570
|
+
}, ctx);
|
|
571
|
+
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
572
|
+
else handleArrayResult(result, payload, i);
|
|
573
|
+
}
|
|
574
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
575
|
+
return payload;
|
|
576
|
+
};
|
|
577
|
+
});
|
|
578
|
+
function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
579
|
+
if (result.issues.length) {
|
|
580
|
+
if (isOptionalOut && !(key in input)) return;
|
|
581
|
+
final.issues.push(...prefixIssues(key, result.issues));
|
|
582
|
+
}
|
|
583
|
+
if (result.value === void 0) {
|
|
584
|
+
if (key in input) final.value[key] = void 0;
|
|
585
|
+
} else final.value[key] = result.value;
|
|
586
|
+
}
|
|
587
|
+
function normalizeDef(def) {
|
|
588
|
+
const keys = Object.keys(def.shape);
|
|
589
|
+
for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
590
|
+
const okeys = optionalKeys(def.shape);
|
|
591
|
+
return {
|
|
592
|
+
...def,
|
|
593
|
+
keys,
|
|
594
|
+
keySet: new Set(keys),
|
|
595
|
+
numKeys: keys.length,
|
|
596
|
+
optionalKeys: new Set(okeys)
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
600
|
+
const unrecognized = [];
|
|
601
|
+
const keySet = def.keySet;
|
|
602
|
+
const _catchall = def.catchall._zod;
|
|
603
|
+
const t = _catchall.def.type;
|
|
604
|
+
const isOptionalOut = _catchall.optout === "optional";
|
|
605
|
+
for (const key in input) {
|
|
606
|
+
if (keySet.has(key)) continue;
|
|
607
|
+
if (t === "never") {
|
|
608
|
+
unrecognized.push(key);
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
const r = _catchall.run({
|
|
612
|
+
value: input[key],
|
|
613
|
+
issues: []
|
|
614
|
+
}, ctx);
|
|
615
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
616
|
+
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
617
|
+
}
|
|
618
|
+
if (unrecognized.length) payload.issues.push({
|
|
619
|
+
code: "unrecognized_keys",
|
|
620
|
+
keys: unrecognized,
|
|
621
|
+
input,
|
|
622
|
+
inst
|
|
623
|
+
});
|
|
624
|
+
if (!proms.length) return payload;
|
|
625
|
+
return Promise.all(proms).then(() => {
|
|
626
|
+
return payload;
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
630
|
+
$ZodType.init(inst, def);
|
|
631
|
+
if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
|
|
632
|
+
const sh = def.shape;
|
|
633
|
+
Object.defineProperty(def, "shape", { get: () => {
|
|
634
|
+
const newSh = { ...sh };
|
|
635
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
636
|
+
return newSh;
|
|
637
|
+
} });
|
|
638
|
+
}
|
|
639
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
640
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
641
|
+
const shape = def.shape;
|
|
642
|
+
const propValues = {};
|
|
643
|
+
for (const key in shape) {
|
|
644
|
+
const field = shape[key]._zod;
|
|
645
|
+
if (field.values) {
|
|
646
|
+
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
647
|
+
for (const v of field.values) propValues[key].add(v);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return propValues;
|
|
651
|
+
});
|
|
652
|
+
const isObject$2 = isObject;
|
|
653
|
+
const catchall = def.catchall;
|
|
654
|
+
let value;
|
|
655
|
+
inst._zod.parse = (payload, ctx) => {
|
|
656
|
+
value ?? (value = _normalized.value);
|
|
657
|
+
const input = payload.value;
|
|
658
|
+
if (!isObject$2(input)) {
|
|
659
|
+
payload.issues.push({
|
|
660
|
+
expected: "object",
|
|
661
|
+
code: "invalid_type",
|
|
662
|
+
input,
|
|
663
|
+
inst
|
|
664
|
+
});
|
|
665
|
+
return payload;
|
|
666
|
+
}
|
|
667
|
+
payload.value = {};
|
|
668
|
+
const proms = [];
|
|
669
|
+
const shape = value.shape;
|
|
670
|
+
for (const key of value.keys) {
|
|
671
|
+
const el = shape[key];
|
|
672
|
+
const isOptionalOut = el._zod.optout === "optional";
|
|
673
|
+
const r = el._zod.run({
|
|
674
|
+
value: input[key],
|
|
675
|
+
issues: []
|
|
676
|
+
}, ctx);
|
|
677
|
+
if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
|
|
678
|
+
else handlePropertyResult(r, payload, key, input, isOptionalOut);
|
|
679
|
+
}
|
|
680
|
+
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
681
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
682
|
+
};
|
|
683
|
+
});
|
|
684
|
+
function handleUnionResults(results, final, inst, ctx) {
|
|
685
|
+
for (const result of results) if (result.issues.length === 0) {
|
|
686
|
+
final.value = result.value;
|
|
687
|
+
return final;
|
|
688
|
+
}
|
|
689
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
690
|
+
if (nonaborted.length === 1) {
|
|
691
|
+
final.value = nonaborted[0].value;
|
|
692
|
+
return nonaborted[0];
|
|
693
|
+
}
|
|
694
|
+
final.issues.push({
|
|
695
|
+
code: "invalid_union",
|
|
696
|
+
input: final.value,
|
|
697
|
+
inst,
|
|
698
|
+
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
699
|
+
});
|
|
700
|
+
return final;
|
|
701
|
+
}
|
|
702
|
+
const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
703
|
+
$ZodType.init(inst, def);
|
|
704
|
+
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
705
|
+
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
706
|
+
defineLazy(inst._zod, "values", () => {
|
|
707
|
+
if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
708
|
+
});
|
|
709
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
710
|
+
if (def.options.every((o) => o._zod.pattern)) {
|
|
711
|
+
const patterns = def.options.map((o) => o._zod.pattern);
|
|
712
|
+
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
const single = def.options.length === 1;
|
|
716
|
+
const first = def.options[0]._zod.run;
|
|
717
|
+
inst._zod.parse = (payload, ctx) => {
|
|
718
|
+
if (single) return first(payload, ctx);
|
|
719
|
+
let async = false;
|
|
720
|
+
const results = [];
|
|
721
|
+
for (const option of def.options) {
|
|
722
|
+
const result = option._zod.run({
|
|
723
|
+
value: payload.value,
|
|
724
|
+
issues: []
|
|
725
|
+
}, ctx);
|
|
726
|
+
if (result instanceof Promise) {
|
|
727
|
+
results.push(result);
|
|
728
|
+
async = true;
|
|
729
|
+
} else {
|
|
730
|
+
if (result.issues.length === 0) return result;
|
|
731
|
+
results.push(result);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
if (!async) return handleUnionResults(results, payload, inst, ctx);
|
|
735
|
+
return Promise.all(results).then((results) => {
|
|
736
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
737
|
+
});
|
|
738
|
+
};
|
|
739
|
+
});
|
|
740
|
+
const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
741
|
+
def.inclusive = false;
|
|
742
|
+
$ZodUnion.init(inst, def);
|
|
743
|
+
const _super = inst._zod.parse;
|
|
744
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
745
|
+
const propValues = {};
|
|
746
|
+
for (const option of def.options) {
|
|
747
|
+
const pv = option._zod.propValues;
|
|
748
|
+
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
749
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
750
|
+
if (!propValues[k]) propValues[k] = /* @__PURE__ */ new Set();
|
|
751
|
+
for (const val of v) propValues[k].add(val);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return propValues;
|
|
755
|
+
});
|
|
756
|
+
const disc = cached(() => {
|
|
757
|
+
const opts = def.options;
|
|
758
|
+
const map = /* @__PURE__ */ new Map();
|
|
759
|
+
for (const o of opts) {
|
|
760
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
761
|
+
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
762
|
+
for (const v of values) {
|
|
763
|
+
if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
764
|
+
map.set(v, o);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return map;
|
|
768
|
+
});
|
|
769
|
+
inst._zod.parse = (payload, ctx) => {
|
|
770
|
+
const input = payload.value;
|
|
771
|
+
if (!isObject(input)) {
|
|
772
|
+
payload.issues.push({
|
|
773
|
+
code: "invalid_type",
|
|
774
|
+
expected: "object",
|
|
775
|
+
input,
|
|
776
|
+
inst
|
|
777
|
+
});
|
|
778
|
+
return payload;
|
|
779
|
+
}
|
|
780
|
+
const opt = disc.value.get(input?.[def.discriminator]);
|
|
781
|
+
if (opt) return opt._zod.run(payload, ctx);
|
|
782
|
+
if (def.unionFallback) return _super(payload, ctx);
|
|
783
|
+
payload.issues.push({
|
|
784
|
+
code: "invalid_union",
|
|
785
|
+
errors: [],
|
|
786
|
+
note: "No matching discriminator",
|
|
787
|
+
discriminator: def.discriminator,
|
|
788
|
+
input,
|
|
789
|
+
path: [def.discriminator],
|
|
790
|
+
inst
|
|
791
|
+
});
|
|
792
|
+
return payload;
|
|
793
|
+
};
|
|
794
|
+
});
|
|
795
|
+
const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
796
|
+
$ZodType.init(inst, def);
|
|
797
|
+
inst._zod.parse = (payload, ctx) => {
|
|
798
|
+
const input = payload.value;
|
|
799
|
+
if (!isPlainObject(input)) {
|
|
800
|
+
payload.issues.push({
|
|
801
|
+
expected: "record",
|
|
802
|
+
code: "invalid_type",
|
|
803
|
+
input,
|
|
804
|
+
inst
|
|
805
|
+
});
|
|
806
|
+
return payload;
|
|
807
|
+
}
|
|
808
|
+
const proms = [];
|
|
809
|
+
const values = def.keyType._zod.values;
|
|
810
|
+
if (values) {
|
|
811
|
+
payload.value = {};
|
|
812
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
813
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
814
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
815
|
+
const result = def.valueType._zod.run({
|
|
816
|
+
value: input[key],
|
|
817
|
+
issues: []
|
|
818
|
+
}, ctx);
|
|
819
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
820
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
821
|
+
payload.value[key] = result.value;
|
|
822
|
+
}));
|
|
823
|
+
else {
|
|
824
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
825
|
+
payload.value[key] = result.value;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
let unrecognized;
|
|
829
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
830
|
+
unrecognized = unrecognized ?? [];
|
|
831
|
+
unrecognized.push(key);
|
|
832
|
+
}
|
|
833
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
834
|
+
code: "unrecognized_keys",
|
|
835
|
+
input,
|
|
836
|
+
inst,
|
|
837
|
+
keys: unrecognized
|
|
838
|
+
});
|
|
839
|
+
} else {
|
|
840
|
+
payload.value = {};
|
|
841
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
842
|
+
if (key === "__proto__") continue;
|
|
843
|
+
let keyResult = def.keyType._zod.run({
|
|
844
|
+
value: key,
|
|
845
|
+
issues: []
|
|
846
|
+
}, ctx);
|
|
847
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
848
|
+
if (typeof key === "string" && number$2.test(key) && keyResult.issues.length) {
|
|
849
|
+
const retryResult = def.keyType._zod.run({
|
|
850
|
+
value: Number(key),
|
|
851
|
+
issues: []
|
|
852
|
+
}, ctx);
|
|
853
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
854
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
855
|
+
}
|
|
856
|
+
if (keyResult.issues.length) {
|
|
857
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
858
|
+
else payload.issues.push({
|
|
859
|
+
code: "invalid_key",
|
|
860
|
+
origin: "record",
|
|
861
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
862
|
+
input: key,
|
|
863
|
+
path: [key],
|
|
864
|
+
inst
|
|
865
|
+
});
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
const result = def.valueType._zod.run({
|
|
869
|
+
value: input[key],
|
|
870
|
+
issues: []
|
|
871
|
+
}, ctx);
|
|
872
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
873
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
874
|
+
payload.value[keyResult.value] = result.value;
|
|
875
|
+
}));
|
|
876
|
+
else {
|
|
877
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
878
|
+
payload.value[keyResult.value] = result.value;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
883
|
+
return payload;
|
|
884
|
+
};
|
|
885
|
+
});
|
|
886
|
+
const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
887
|
+
$ZodType.init(inst, def);
|
|
888
|
+
const values = getEnumValues(def.entries);
|
|
889
|
+
const valuesSet = new Set(values);
|
|
890
|
+
inst._zod.values = valuesSet;
|
|
891
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
892
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
893
|
+
const input = payload.value;
|
|
894
|
+
if (valuesSet.has(input)) return payload;
|
|
895
|
+
payload.issues.push({
|
|
896
|
+
code: "invalid_value",
|
|
897
|
+
values,
|
|
898
|
+
input,
|
|
899
|
+
inst
|
|
900
|
+
});
|
|
901
|
+
return payload;
|
|
902
|
+
};
|
|
903
|
+
});
|
|
904
|
+
const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
905
|
+
$ZodType.init(inst, def);
|
|
906
|
+
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
907
|
+
const values = new Set(def.values);
|
|
908
|
+
inst._zod.values = values;
|
|
909
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
910
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
911
|
+
const input = payload.value;
|
|
912
|
+
if (values.has(input)) return payload;
|
|
913
|
+
payload.issues.push({
|
|
914
|
+
code: "invalid_value",
|
|
915
|
+
values: def.values,
|
|
916
|
+
input,
|
|
917
|
+
inst
|
|
918
|
+
});
|
|
919
|
+
return payload;
|
|
920
|
+
};
|
|
921
|
+
});
|
|
922
|
+
const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
|
|
923
|
+
$ZodType.init(inst, def);
|
|
924
|
+
inst._zod.parse = (payload, ctx) => {
|
|
925
|
+
if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
|
|
926
|
+
const _out = def.transform(payload.value, payload);
|
|
927
|
+
if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
|
|
928
|
+
payload.value = output;
|
|
929
|
+
return payload;
|
|
930
|
+
});
|
|
931
|
+
if (_out instanceof Promise) throw new $ZodAsyncError();
|
|
932
|
+
payload.value = _out;
|
|
933
|
+
return payload;
|
|
934
|
+
};
|
|
935
|
+
});
|
|
936
|
+
function handleOptionalResult(result, input) {
|
|
937
|
+
if (result.issues.length && input === void 0) return {
|
|
938
|
+
issues: [],
|
|
939
|
+
value: void 0
|
|
940
|
+
};
|
|
941
|
+
return result;
|
|
942
|
+
}
|
|
943
|
+
const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
944
|
+
$ZodType.init(inst, def);
|
|
945
|
+
inst._zod.optin = "optional";
|
|
946
|
+
inst._zod.optout = "optional";
|
|
947
|
+
defineLazy(inst._zod, "values", () => {
|
|
948
|
+
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
949
|
+
});
|
|
950
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
951
|
+
const pattern = def.innerType._zod.pattern;
|
|
952
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
953
|
+
});
|
|
954
|
+
inst._zod.parse = (payload, ctx) => {
|
|
955
|
+
if (def.innerType._zod.optin === "optional") {
|
|
956
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
957
|
+
if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
|
|
958
|
+
return handleOptionalResult(result, payload.value);
|
|
959
|
+
}
|
|
960
|
+
if (payload.value === void 0) return payload;
|
|
961
|
+
return def.innerType._zod.run(payload, ctx);
|
|
962
|
+
};
|
|
963
|
+
});
|
|
964
|
+
const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
965
|
+
$ZodType.init(inst, def);
|
|
966
|
+
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
967
|
+
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
968
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
969
|
+
const pattern = def.innerType._zod.pattern;
|
|
970
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
971
|
+
});
|
|
972
|
+
defineLazy(inst._zod, "values", () => {
|
|
973
|
+
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
|
|
974
|
+
});
|
|
975
|
+
inst._zod.parse = (payload, ctx) => {
|
|
976
|
+
if (payload.value === null) return payload;
|
|
977
|
+
return def.innerType._zod.run(payload, ctx);
|
|
978
|
+
};
|
|
979
|
+
});
|
|
980
|
+
const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
981
|
+
$ZodType.init(inst, def);
|
|
982
|
+
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
983
|
+
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
984
|
+
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
985
|
+
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
986
|
+
inst._zod.parse = (payload, ctx) => {
|
|
987
|
+
if (ctx.direction === "backward") {
|
|
988
|
+
const right = def.out._zod.run(payload, ctx);
|
|
989
|
+
if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
990
|
+
return handlePipeResult(right, def.in, ctx);
|
|
991
|
+
}
|
|
992
|
+
const left = def.in._zod.run(payload, ctx);
|
|
993
|
+
if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
994
|
+
return handlePipeResult(left, def.out, ctx);
|
|
995
|
+
};
|
|
996
|
+
});
|
|
997
|
+
function handlePipeResult(left, next, ctx) {
|
|
998
|
+
if (left.issues.length) {
|
|
999
|
+
left.aborted = true;
|
|
1000
|
+
return left;
|
|
1001
|
+
}
|
|
1002
|
+
return next._zod.run({
|
|
1003
|
+
value: left.value,
|
|
1004
|
+
issues: left.issues
|
|
1005
|
+
}, ctx);
|
|
1006
|
+
}
|
|
1007
|
+
const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
1008
|
+
$ZodCheck.init(inst, def);
|
|
1009
|
+
$ZodType.init(inst, def);
|
|
1010
|
+
inst._zod.parse = (payload, _) => {
|
|
1011
|
+
return payload;
|
|
1012
|
+
};
|
|
1013
|
+
inst._zod.check = (payload) => {
|
|
1014
|
+
const input = payload.value;
|
|
1015
|
+
const r = def.fn(input);
|
|
1016
|
+
if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
1017
|
+
handleRefineResult(r, payload, input, inst);
|
|
1018
|
+
};
|
|
1019
|
+
});
|
|
1020
|
+
function handleRefineResult(result, payload, input, inst) {
|
|
1021
|
+
if (!result) {
|
|
1022
|
+
const _iss = {
|
|
1023
|
+
code: "custom",
|
|
1024
|
+
input,
|
|
1025
|
+
inst,
|
|
1026
|
+
path: [...inst._zod.def.path ?? []],
|
|
1027
|
+
continue: !inst._zod.def.abort
|
|
1028
|
+
};
|
|
1029
|
+
if (inst._zod.def.params) _iss.params = inst._zod.def.params;
|
|
1030
|
+
payload.issues.push(issue(_iss));
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
|
|
1035
|
+
var _a;
|
|
1036
|
+
var $ZodRegistry = class {
|
|
1037
|
+
constructor() {
|
|
1038
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
1039
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
1040
|
+
}
|
|
1041
|
+
add(schema, ..._meta) {
|
|
1042
|
+
const meta = _meta[0];
|
|
1043
|
+
this._map.set(schema, meta);
|
|
1044
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
|
|
1045
|
+
return this;
|
|
1046
|
+
}
|
|
1047
|
+
clear() {
|
|
1048
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
1049
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
1050
|
+
return this;
|
|
1051
|
+
}
|
|
1052
|
+
remove(schema) {
|
|
1053
|
+
const meta = this._map.get(schema);
|
|
1054
|
+
if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
|
|
1055
|
+
this._map.delete(schema);
|
|
1056
|
+
return this;
|
|
1057
|
+
}
|
|
1058
|
+
get(schema) {
|
|
1059
|
+
const p = schema._zod.parent;
|
|
1060
|
+
if (p) {
|
|
1061
|
+
const pm = { ...this.get(p) ?? {} };
|
|
1062
|
+
delete pm.id;
|
|
1063
|
+
const f = {
|
|
1064
|
+
...pm,
|
|
1065
|
+
...this._map.get(schema)
|
|
1066
|
+
};
|
|
1067
|
+
return Object.keys(f).length ? f : void 0;
|
|
1068
|
+
}
|
|
1069
|
+
return this._map.get(schema);
|
|
1070
|
+
}
|
|
1071
|
+
has(schema) {
|
|
1072
|
+
return this._map.has(schema);
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
function registry() {
|
|
1076
|
+
return new $ZodRegistry();
|
|
1077
|
+
}
|
|
1078
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
1079
|
+
globalThis.__zod_globalRegistry;
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
1082
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1083
|
+
function _string(Class, params) {
|
|
1084
|
+
return new Class({
|
|
1085
|
+
type: "string",
|
|
1086
|
+
...normalizeParams(params)
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1090
|
+
function _number(Class, params) {
|
|
1091
|
+
return new Class({
|
|
1092
|
+
type: "number",
|
|
1093
|
+
checks: [],
|
|
1094
|
+
...normalizeParams(params)
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1098
|
+
function _boolean(Class, params) {
|
|
1099
|
+
return new Class({
|
|
1100
|
+
type: "boolean",
|
|
1101
|
+
...normalizeParams(params)
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1105
|
+
function _any(Class) {
|
|
1106
|
+
return new Class({ type: "any" });
|
|
1107
|
+
}
|
|
1108
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1109
|
+
function _unknown(Class) {
|
|
1110
|
+
return new Class({ type: "unknown" });
|
|
1111
|
+
}
|
|
1112
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1113
|
+
function _void$1(Class, params) {
|
|
1114
|
+
return new Class({
|
|
1115
|
+
type: "void",
|
|
1116
|
+
...normalizeParams(params)
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1120
|
+
function _minLength(minimum, params) {
|
|
1121
|
+
return new $ZodCheckMinLength({
|
|
1122
|
+
check: "min_length",
|
|
1123
|
+
...normalizeParams(params),
|
|
1124
|
+
minimum
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1128
|
+
function _regex(pattern, params) {
|
|
1129
|
+
return new $ZodCheckRegex({
|
|
1130
|
+
check: "string_format",
|
|
1131
|
+
format: "regex",
|
|
1132
|
+
...normalizeParams(params),
|
|
1133
|
+
pattern
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1137
|
+
function _custom(Class, fn, _params) {
|
|
1138
|
+
const norm = normalizeParams(_params);
|
|
1139
|
+
norm.abort ?? (norm.abort = true);
|
|
1140
|
+
return new Class({
|
|
1141
|
+
type: "custom",
|
|
1142
|
+
check: "custom",
|
|
1143
|
+
fn,
|
|
1144
|
+
...norm
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js
|
|
1149
|
+
const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
1150
|
+
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1151
|
+
$ZodType.init(inst, def);
|
|
1152
|
+
inst.def = def;
|
|
1153
|
+
inst.type = def.type;
|
|
1154
|
+
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
1155
|
+
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
1156
|
+
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
1157
|
+
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
1158
|
+
inst.check = (...checks) => {
|
|
1159
|
+
return inst.clone({
|
|
1160
|
+
...def,
|
|
1161
|
+
checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
1162
|
+
check: ch,
|
|
1163
|
+
def: { check: "custom" },
|
|
1164
|
+
onattach: []
|
|
1165
|
+
} } : ch)]
|
|
1166
|
+
}, { parent: true });
|
|
1167
|
+
};
|
|
1168
|
+
inst.with = inst.check;
|
|
1169
|
+
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
1170
|
+
inst.brand = () => inst;
|
|
1171
|
+
inst.register = ((reg, meta) => {
|
|
1172
|
+
reg.add(inst, meta);
|
|
1173
|
+
return inst;
|
|
1174
|
+
});
|
|
1175
|
+
inst.apply = (fn) => fn(inst);
|
|
1176
|
+
});
|
|
1177
|
+
const ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
1178
|
+
$ZodString.init(inst, def);
|
|
1179
|
+
ZodMiniType.init(inst, def);
|
|
1180
|
+
});
|
|
1181
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1182
|
+
function string(params) {
|
|
1183
|
+
return /* @__PURE__ */ _string(ZodMiniString, params);
|
|
1184
|
+
}
|
|
1185
|
+
const ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
1186
|
+
$ZodNumber.init(inst, def);
|
|
1187
|
+
ZodMiniType.init(inst, def);
|
|
1188
|
+
});
|
|
1189
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1190
|
+
function number$1(params) {
|
|
1191
|
+
return /* @__PURE__ */ _number(ZodMiniNumber, params);
|
|
1192
|
+
}
|
|
1193
|
+
const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
1194
|
+
$ZodBoolean.init(inst, def);
|
|
1195
|
+
ZodMiniType.init(inst, def);
|
|
1196
|
+
});
|
|
1197
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1198
|
+
function boolean(params) {
|
|
1199
|
+
return /* @__PURE__ */ _boolean(ZodMiniBoolean, params);
|
|
1200
|
+
}
|
|
1201
|
+
const ZodMiniAny = /* @__PURE__ */ $constructor("ZodMiniAny", (inst, def) => {
|
|
1202
|
+
$ZodAny.init(inst, def);
|
|
1203
|
+
ZodMiniType.init(inst, def);
|
|
1204
|
+
});
|
|
1205
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1206
|
+
function any() {
|
|
1207
|
+
return /* @__PURE__ */ _any(ZodMiniAny);
|
|
1208
|
+
}
|
|
1209
|
+
const ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
1210
|
+
$ZodUnknown.init(inst, def);
|
|
1211
|
+
ZodMiniType.init(inst, def);
|
|
1212
|
+
});
|
|
1213
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1214
|
+
function unknown() {
|
|
1215
|
+
return /* @__PURE__ */ _unknown(ZodMiniUnknown);
|
|
1216
|
+
}
|
|
1217
|
+
const ZodMiniVoid = /* @__PURE__ */ $constructor("ZodMiniVoid", (inst, def) => {
|
|
1218
|
+
$ZodVoid.init(inst, def);
|
|
1219
|
+
ZodMiniType.init(inst, def);
|
|
1220
|
+
});
|
|
1221
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1222
|
+
function _void(params) {
|
|
1223
|
+
return /* @__PURE__ */ _void$1(ZodMiniVoid, params);
|
|
1224
|
+
}
|
|
1225
|
+
const ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
1226
|
+
$ZodArray.init(inst, def);
|
|
1227
|
+
ZodMiniType.init(inst, def);
|
|
1228
|
+
});
|
|
1229
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1230
|
+
function array(element, params) {
|
|
1231
|
+
return new ZodMiniArray({
|
|
1232
|
+
type: "array",
|
|
1233
|
+
element,
|
|
1234
|
+
...normalizeParams(params)
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
1238
|
+
$ZodObject.init(inst, def);
|
|
1239
|
+
ZodMiniType.init(inst, def);
|
|
1240
|
+
defineLazy(inst, "shape", () => def.shape);
|
|
1241
|
+
});
|
|
1242
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1243
|
+
function object(shape, params) {
|
|
1244
|
+
return new ZodMiniObject({
|
|
1245
|
+
type: "object",
|
|
1246
|
+
shape: shape ?? {},
|
|
1247
|
+
...normalizeParams(params)
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
const ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
1251
|
+
$ZodUnion.init(inst, def);
|
|
1252
|
+
ZodMiniType.init(inst, def);
|
|
1253
|
+
});
|
|
1254
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1255
|
+
function union(options, params) {
|
|
1256
|
+
return new ZodMiniUnion({
|
|
1257
|
+
type: "union",
|
|
1258
|
+
options,
|
|
1259
|
+
...normalizeParams(params)
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
const ZodMiniDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
|
1263
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
1264
|
+
ZodMiniType.init(inst, def);
|
|
1265
|
+
});
|
|
1266
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1267
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
1268
|
+
return new ZodMiniDiscriminatedUnion({
|
|
1269
|
+
type: "union",
|
|
1270
|
+
options,
|
|
1271
|
+
discriminator,
|
|
1272
|
+
...normalizeParams(params)
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
const ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
1276
|
+
$ZodRecord.init(inst, def);
|
|
1277
|
+
ZodMiniType.init(inst, def);
|
|
1278
|
+
});
|
|
1279
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1280
|
+
function record(keyType, valueType, params) {
|
|
1281
|
+
return new ZodMiniRecord({
|
|
1282
|
+
type: "record",
|
|
1283
|
+
keyType,
|
|
1284
|
+
valueType,
|
|
1285
|
+
...normalizeParams(params)
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
const ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
1289
|
+
$ZodEnum.init(inst, def);
|
|
1290
|
+
ZodMiniType.init(inst, def);
|
|
1291
|
+
inst.options = Object.values(def.entries);
|
|
1292
|
+
});
|
|
1293
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1294
|
+
function _enum(values, params) {
|
|
1295
|
+
return new ZodMiniEnum({
|
|
1296
|
+
type: "enum",
|
|
1297
|
+
entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
|
|
1298
|
+
...normalizeParams(params)
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
1302
|
+
$ZodLiteral.init(inst, def);
|
|
1303
|
+
ZodMiniType.init(inst, def);
|
|
1304
|
+
});
|
|
1305
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1306
|
+
function literal(value, params) {
|
|
1307
|
+
return new ZodMiniLiteral({
|
|
1308
|
+
type: "literal",
|
|
1309
|
+
values: Array.isArray(value) ? value : [value],
|
|
1310
|
+
...normalizeParams(params)
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
const ZodMiniTransform = /* @__PURE__ */ $constructor("ZodMiniTransform", (inst, def) => {
|
|
1314
|
+
$ZodTransform.init(inst, def);
|
|
1315
|
+
ZodMiniType.init(inst, def);
|
|
1316
|
+
});
|
|
1317
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1318
|
+
function transform(fn) {
|
|
1319
|
+
return new ZodMiniTransform({
|
|
1320
|
+
type: "transform",
|
|
1321
|
+
transform: fn
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
1325
|
+
$ZodOptional.init(inst, def);
|
|
1326
|
+
ZodMiniType.init(inst, def);
|
|
1327
|
+
});
|
|
1328
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1329
|
+
function optional(innerType) {
|
|
1330
|
+
return new ZodMiniOptional({
|
|
1331
|
+
type: "optional",
|
|
1332
|
+
innerType
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
const ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
1336
|
+
$ZodNullable.init(inst, def);
|
|
1337
|
+
ZodMiniType.init(inst, def);
|
|
1338
|
+
});
|
|
1339
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1340
|
+
function nullable(innerType) {
|
|
1341
|
+
return new ZodMiniNullable({
|
|
1342
|
+
type: "nullable",
|
|
1343
|
+
innerType
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
const ZodMiniPipe = /* @__PURE__ */ $constructor("ZodMiniPipe", (inst, def) => {
|
|
1347
|
+
$ZodPipe.init(inst, def);
|
|
1348
|
+
ZodMiniType.init(inst, def);
|
|
1349
|
+
});
|
|
1350
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1351
|
+
function pipe(in_, out) {
|
|
1352
|
+
return new ZodMiniPipe({
|
|
1353
|
+
type: "pipe",
|
|
1354
|
+
in: in_,
|
|
1355
|
+
out
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
const ZodMiniCustom = /* @__PURE__ */ $constructor("ZodMiniCustom", (inst, def) => {
|
|
1359
|
+
$ZodCustom.init(inst, def);
|
|
1360
|
+
ZodMiniType.init(inst, def);
|
|
1361
|
+
});
|
|
1362
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1363
|
+
function custom(fn, _params) {
|
|
1364
|
+
return /* @__PURE__ */ _custom(ZodMiniCustom, fn ?? (() => true), _params);
|
|
1365
|
+
}
|
|
1366
|
+
//#endregion
|
|
3
1367
|
//#region ../pieces-framework/dist/markdown-property-Df2l6_y_.js
|
|
4
|
-
const BasePropertySchema =
|
|
5
|
-
displayName:
|
|
6
|
-
description:
|
|
7
|
-
advanced:
|
|
8
|
-
width:
|
|
9
|
-
icon:
|
|
10
|
-
placeholder:
|
|
11
|
-
});
|
|
12
|
-
const TPropertyValue = (_T, propertyType) =>
|
|
13
|
-
type:
|
|
14
|
-
required:
|
|
15
|
-
defaultValue:
|
|
1368
|
+
const BasePropertySchema = /* @__PURE__ */ object({
|
|
1369
|
+
displayName: /* @__PURE__ */ string(),
|
|
1370
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1371
|
+
advanced: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1372
|
+
width: /* @__PURE__ */ optional(/* @__PURE__ */ _enum(["half", "full"])),
|
|
1373
|
+
icon: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1374
|
+
placeholder: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
1375
|
+
});
|
|
1376
|
+
const TPropertyValue = (_T, propertyType) => /* @__PURE__ */ object({
|
|
1377
|
+
type: /* @__PURE__ */ literal(propertyType),
|
|
1378
|
+
required: /* @__PURE__ */ boolean(),
|
|
1379
|
+
defaultValue: /* @__PURE__ */ optional(/* @__PURE__ */ any())
|
|
16
1380
|
});
|
|
17
1381
|
let PropertyType = /* @__PURE__ */ function(PropertyType) {
|
|
18
1382
|
PropertyType["SHORT_TEXT"] = "SHORT_TEXT";
|
|
@@ -41,72 +1405,70 @@ let PropertyType = /* @__PURE__ */ function(PropertyType) {
|
|
|
41
1405
|
PropertyType["COLOR"] = "COLOR";
|
|
42
1406
|
return PropertyType;
|
|
43
1407
|
}({});
|
|
44
|
-
const ShortTextProperty =
|
|
1408
|
+
const ShortTextProperty = /* @__PURE__ */ object({
|
|
45
1409
|
...BasePropertySchema.shape,
|
|
46
|
-
...TPropertyValue(
|
|
1410
|
+
...TPropertyValue(/* @__PURE__ */ string(), PropertyType.SHORT_TEXT).shape
|
|
47
1411
|
});
|
|
48
|
-
const LongTextProperty =
|
|
1412
|
+
const LongTextProperty = /* @__PURE__ */ object({
|
|
49
1413
|
...BasePropertySchema.shape,
|
|
50
|
-
...TPropertyValue(
|
|
51
|
-
});
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
options: z.array(DropdownOption)
|
|
1414
|
+
...TPropertyValue(/* @__PURE__ */ string(), PropertyType.LONG_TEXT).shape
|
|
1415
|
+
});
|
|
1416
|
+
const DropdownState = /* @__PURE__ */ object({
|
|
1417
|
+
disabled: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1418
|
+
placeholder: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1419
|
+
options: /* @__PURE__ */ array(/* @__PURE__ */ object({
|
|
1420
|
+
label: /* @__PURE__ */ string(),
|
|
1421
|
+
value: /* @__PURE__ */ unknown(),
|
|
1422
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1423
|
+
icon: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
1424
|
+
}))
|
|
62
1425
|
});
|
|
63
|
-
const StaticDropdownDisplay =
|
|
64
|
-
const StaticDropdownProperty =
|
|
1426
|
+
const StaticDropdownDisplay = /* @__PURE__ */ _enum(["cards"]);
|
|
1427
|
+
const StaticDropdownProperty = /* @__PURE__ */ object({
|
|
65
1428
|
...BasePropertySchema.shape,
|
|
66
1429
|
options: DropdownState,
|
|
67
|
-
display:
|
|
68
|
-
...TPropertyValue(
|
|
1430
|
+
display: /* @__PURE__ */ optional(StaticDropdownDisplay),
|
|
1431
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.STATIC_DROPDOWN).shape
|
|
69
1432
|
});
|
|
70
|
-
const StaticMultiSelectDropdownProperty =
|
|
1433
|
+
const StaticMultiSelectDropdownProperty = /* @__PURE__ */ object({
|
|
71
1434
|
...BasePropertySchema.shape,
|
|
72
1435
|
options: DropdownState,
|
|
73
|
-
...TPropertyValue(
|
|
1436
|
+
...TPropertyValue(/* @__PURE__ */ array(/* @__PURE__ */ unknown()), PropertyType.STATIC_MULTI_SELECT_DROPDOWN).shape
|
|
74
1437
|
});
|
|
75
|
-
const CheckboxProperty =
|
|
1438
|
+
const CheckboxProperty = /* @__PURE__ */ object({
|
|
76
1439
|
...BasePropertySchema.shape,
|
|
77
|
-
reveals:
|
|
78
|
-
...TPropertyValue(
|
|
1440
|
+
reveals: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
1441
|
+
...TPropertyValue(/* @__PURE__ */ boolean(), PropertyType.CHECKBOX).shape
|
|
79
1442
|
});
|
|
80
|
-
const NumberProperty =
|
|
1443
|
+
const NumberProperty = /* @__PURE__ */ object({
|
|
81
1444
|
...BasePropertySchema.shape,
|
|
82
|
-
display:
|
|
83
|
-
min:
|
|
84
|
-
max:
|
|
85
|
-
step:
|
|
86
|
-
...TPropertyValue(
|
|
1445
|
+
display: /* @__PURE__ */ optional(/* @__PURE__ */ _enum(["stepper"])),
|
|
1446
|
+
min: /* @__PURE__ */ optional(/* @__PURE__ */ number$1()),
|
|
1447
|
+
max: /* @__PURE__ */ optional(/* @__PURE__ */ number$1()),
|
|
1448
|
+
step: /* @__PURE__ */ optional(/* @__PURE__ */ number$1()),
|
|
1449
|
+
...TPropertyValue(/* @__PURE__ */ number$1(), PropertyType.NUMBER).shape
|
|
87
1450
|
});
|
|
88
|
-
const FileProperty =
|
|
1451
|
+
const FileProperty = /* @__PURE__ */ object({
|
|
89
1452
|
...BasePropertySchema.shape,
|
|
90
|
-
streaming:
|
|
91
|
-
...TPropertyValue(
|
|
92
|
-
});
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
before: z.optional(z.string())
|
|
1453
|
+
streaming: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1454
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.FILE).shape
|
|
1455
|
+
});
|
|
1456
|
+
const DateRangeValue = /* @__PURE__ */ object({
|
|
1457
|
+
preset: /* @__PURE__ */ optional(/* @__PURE__ */ _enum([
|
|
1458
|
+
"any_time",
|
|
1459
|
+
"last_24_hours",
|
|
1460
|
+
"last_7_days",
|
|
1461
|
+
"last_30_days",
|
|
1462
|
+
"last_90_days",
|
|
1463
|
+
"this_month",
|
|
1464
|
+
"custom"
|
|
1465
|
+
])),
|
|
1466
|
+
after: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1467
|
+
before: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
106
1468
|
});
|
|
107
|
-
const DateRangeProperty =
|
|
1469
|
+
const DateRangeProperty = /* @__PURE__ */ object({
|
|
108
1470
|
...BasePropertySchema.shape,
|
|
109
|
-
display:
|
|
1471
|
+
display: /* @__PURE__ */ optional(/* @__PURE__ */ _enum(["dropdown"])),
|
|
110
1472
|
...TPropertyValue(DateRangeValue, PropertyType.DATE_RANGE).shape
|
|
111
1473
|
});
|
|
112
1474
|
let MarkdownVariant = /* @__PURE__ */ function(MarkdownVariant) {
|
|
@@ -119,21 +1481,21 @@ let MarkdownVariant = /* @__PURE__ */ function(MarkdownVariant) {
|
|
|
119
1481
|
function isNil(value) {
|
|
120
1482
|
return value === null || value === void 0;
|
|
121
1483
|
}
|
|
122
|
-
const MarkDownProperty =
|
|
1484
|
+
const MarkDownProperty = /* @__PURE__ */ object({
|
|
123
1485
|
...BasePropertySchema.shape,
|
|
124
|
-
...TPropertyValue(
|
|
125
|
-
variant:
|
|
1486
|
+
...TPropertyValue(/* @__PURE__ */ _void(), PropertyType.MARKDOWN).shape,
|
|
1487
|
+
variant: /* @__PURE__ */ optional(/* @__PURE__ */ _enum(MarkdownVariant))
|
|
126
1488
|
});
|
|
127
1489
|
//#endregion
|
|
128
1490
|
//#region ../pieces-framework/dist/input-COuhC1I-.js
|
|
129
|
-
const ErrorHandlingOptionsParam =
|
|
130
|
-
retryOnFailure:
|
|
131
|
-
defaultValue:
|
|
132
|
-
hide:
|
|
1491
|
+
const ErrorHandlingOptionsParam = /* @__PURE__ */ object({
|
|
1492
|
+
retryOnFailure: /* @__PURE__ */ object({
|
|
1493
|
+
defaultValue: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1494
|
+
hide: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
133
1495
|
}),
|
|
134
|
-
continueOnFailure:
|
|
135
|
-
defaultValue:
|
|
136
|
-
hide:
|
|
1496
|
+
continueOnFailure: /* @__PURE__ */ object({
|
|
1497
|
+
defaultValue: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1498
|
+
hide: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
137
1499
|
})
|
|
138
1500
|
});
|
|
139
1501
|
var IAction = class {
|
|
@@ -159,29 +1521,29 @@ const createAction = (params) => {
|
|
|
159
1521
|
retryOnFailure: { defaultValue: false }
|
|
160
1522
|
}, params.outputSchema, params.audience, params.aiMetadata, params.classification);
|
|
161
1523
|
};
|
|
162
|
-
const DropdownProperty =
|
|
1524
|
+
const DropdownProperty = /* @__PURE__ */ object({
|
|
163
1525
|
...BasePropertySchema.shape,
|
|
164
|
-
...TPropertyValue(
|
|
165
|
-
refreshers:
|
|
1526
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.DROPDOWN).shape,
|
|
1527
|
+
refreshers: /* @__PURE__ */ array(/* @__PURE__ */ string())
|
|
166
1528
|
});
|
|
167
|
-
const MultiSelectDropdownProperty =
|
|
1529
|
+
const MultiSelectDropdownProperty = /* @__PURE__ */ object({
|
|
168
1530
|
...BasePropertySchema.shape,
|
|
169
|
-
...TPropertyValue(
|
|
170
|
-
refreshers:
|
|
1531
|
+
...TPropertyValue(/* @__PURE__ */ array(/* @__PURE__ */ unknown()), PropertyType.MULTI_SELECT_DROPDOWN).shape,
|
|
1532
|
+
refreshers: /* @__PURE__ */ array(/* @__PURE__ */ string())
|
|
171
1533
|
});
|
|
172
|
-
const JsonProperty =
|
|
1534
|
+
const JsonProperty = /* @__PURE__ */ object({
|
|
173
1535
|
...BasePropertySchema.shape,
|
|
174
|
-
...TPropertyValue(
|
|
1536
|
+
...TPropertyValue(/* @__PURE__ */ union([/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown())]), PropertyType.JSON).shape
|
|
175
1537
|
});
|
|
176
|
-
const ColorProperty =
|
|
1538
|
+
const ColorProperty = /* @__PURE__ */ object({
|
|
177
1539
|
...BasePropertySchema.shape,
|
|
178
|
-
...TPropertyValue(
|
|
1540
|
+
...TPropertyValue(/* @__PURE__ */ string(), PropertyType.COLOR).shape
|
|
179
1541
|
});
|
|
180
|
-
const DateTimeProperty =
|
|
1542
|
+
const DateTimeProperty = /* @__PURE__ */ object({
|
|
181
1543
|
...BasePropertySchema.shape,
|
|
182
|
-
...TPropertyValue(
|
|
1544
|
+
...TPropertyValue(/* @__PURE__ */ string(), PropertyType.DATE_TIME).shape
|
|
183
1545
|
});
|
|
184
|
-
const ArraySubProps =
|
|
1546
|
+
const ArraySubProps = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
|
|
185
1547
|
ShortTextProperty,
|
|
186
1548
|
LongTextProperty,
|
|
187
1549
|
StaticDropdownProperty,
|
|
@@ -194,42 +1556,28 @@ const ArraySubProps = z.record(z.string(), z.union([
|
|
|
194
1556
|
ColorProperty,
|
|
195
1557
|
DateTimeProperty
|
|
196
1558
|
]));
|
|
197
|
-
const ArrayProperty =
|
|
1559
|
+
const ArrayProperty = /* @__PURE__ */ object({
|
|
198
1560
|
...BasePropertySchema.shape,
|
|
199
|
-
properties:
|
|
200
|
-
...TPropertyValue(
|
|
1561
|
+
properties: /* @__PURE__ */ optional(ArraySubProps),
|
|
1562
|
+
...TPropertyValue(/* @__PURE__ */ array(/* @__PURE__ */ unknown()), PropertyType.ARRAY).shape
|
|
201
1563
|
});
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
StaticDropdownProperty,
|
|
205
|
-
JsonProperty,
|
|
206
|
-
ArrayProperty,
|
|
207
|
-
StaticMultiSelectDropdownProperty
|
|
208
|
-
]);
|
|
209
|
-
z.record(z.string(), DynamicProp);
|
|
210
|
-
const DynamicProperties = z.object({
|
|
211
|
-
refreshers: z.array(z.string()),
|
|
212
|
-
...BasePropertySchema.shape,
|
|
213
|
-
...TPropertyValue(z.unknown(), PropertyType.DYNAMIC).shape
|
|
214
|
-
});
|
|
215
|
-
const ObjectProperty = z.object({
|
|
216
|
-
...BasePropertySchema.shape,
|
|
217
|
-
...TPropertyValue(z.record(z.string(), z.unknown()), PropertyType.OBJECT).shape
|
|
218
|
-
});
|
|
219
|
-
const RichTextProperty = z.object({
|
|
1564
|
+
const DynamicProperties = /* @__PURE__ */ object({
|
|
1565
|
+
refreshers: /* @__PURE__ */ array(/* @__PURE__ */ string()),
|
|
220
1566
|
...BasePropertySchema.shape,
|
|
221
|
-
|
|
222
|
-
...TPropertyValue(z.string(), PropertyType.RICH_TEXT).shape
|
|
1567
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.DYNAMIC).shape
|
|
223
1568
|
});
|
|
224
|
-
const
|
|
1569
|
+
const ObjectProperty = /* @__PURE__ */ object({
|
|
225
1570
|
...BasePropertySchema.shape,
|
|
226
|
-
...TPropertyValue(
|
|
227
|
-
code: z.string()
|
|
1571
|
+
...TPropertyValue(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown()), PropertyType.OBJECT).shape
|
|
228
1572
|
});
|
|
229
|
-
const InputProperty =
|
|
1573
|
+
const InputProperty = /* @__PURE__ */ union([
|
|
230
1574
|
ShortTextProperty,
|
|
231
1575
|
LongTextProperty,
|
|
232
|
-
|
|
1576
|
+
/* @__PURE__ */ object({
|
|
1577
|
+
...BasePropertySchema.shape,
|
|
1578
|
+
formatProperty: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1579
|
+
...TPropertyValue(/* @__PURE__ */ string(), PropertyType.RICH_TEXT).shape
|
|
1580
|
+
}),
|
|
233
1581
|
MarkDownProperty,
|
|
234
1582
|
CheckboxProperty,
|
|
235
1583
|
StaticDropdownProperty,
|
|
@@ -244,7 +1592,11 @@ const InputProperty = z.union([
|
|
|
244
1592
|
DateTimeProperty,
|
|
245
1593
|
DateRangeProperty,
|
|
246
1594
|
FileProperty,
|
|
247
|
-
|
|
1595
|
+
/* @__PURE__ */ object({
|
|
1596
|
+
...BasePropertySchema.shape,
|
|
1597
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.CUSTOM).shape,
|
|
1598
|
+
code: /* @__PURE__ */ string()
|
|
1599
|
+
}),
|
|
248
1600
|
ColorProperty
|
|
249
1601
|
]);
|
|
250
1602
|
const Property = {
|
|
@@ -421,41 +1773,37 @@ let WebhookHandshakeStrategy = /* @__PURE__ */ function(WebhookHandshakeStrategy
|
|
|
421
1773
|
WebhookHandshakeStrategy["HEAD_REQUEST"] = "HEAD_REQUEST";
|
|
422
1774
|
return WebhookHandshakeStrategy;
|
|
423
1775
|
}({});
|
|
424
|
-
z.object({
|
|
425
|
-
strategy: z.enum(WebhookHandshakeStrategy),
|
|
426
|
-
paramName: z.optional(z.string())
|
|
427
|
-
});
|
|
428
1776
|
let TriggerTestStrategy = /* @__PURE__ */ function(TriggerTestStrategy) {
|
|
429
1777
|
TriggerTestStrategy["SIMULATION"] = "SIMULATION";
|
|
430
1778
|
TriggerTestStrategy["TEST_FUNCTION"] = "TEST_FUNCTION";
|
|
431
1779
|
return TriggerTestStrategy;
|
|
432
1780
|
}({});
|
|
433
|
-
const BasePieceAuthSchema =
|
|
434
|
-
displayName:
|
|
435
|
-
description:
|
|
436
|
-
hasConnectionIdentifier:
|
|
1781
|
+
const BasePieceAuthSchema = /* @__PURE__ */ object({
|
|
1782
|
+
displayName: /* @__PURE__ */ string(),
|
|
1783
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1784
|
+
hasConnectionIdentifier: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
437
1785
|
});
|
|
438
|
-
const BasicAuthPropertyValue =
|
|
439
|
-
username:
|
|
440
|
-
password:
|
|
1786
|
+
const BasicAuthPropertyValue = /* @__PURE__ */ object({
|
|
1787
|
+
username: /* @__PURE__ */ string(),
|
|
1788
|
+
password: /* @__PURE__ */ string()
|
|
441
1789
|
});
|
|
442
|
-
const BasicAuthProperty =
|
|
1790
|
+
const BasicAuthProperty = /* @__PURE__ */ object({
|
|
443
1791
|
...BasePieceAuthSchema.shape,
|
|
444
|
-
username:
|
|
445
|
-
displayName:
|
|
446
|
-
description:
|
|
1792
|
+
username: /* @__PURE__ */ object({
|
|
1793
|
+
displayName: /* @__PURE__ */ string(),
|
|
1794
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
447
1795
|
}),
|
|
448
|
-
password:
|
|
449
|
-
displayName:
|
|
450
|
-
description:
|
|
1796
|
+
password: /* @__PURE__ */ object({
|
|
1797
|
+
displayName: /* @__PURE__ */ string(),
|
|
1798
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
451
1799
|
}),
|
|
452
1800
|
...TPropertyValue(BasicAuthPropertyValue, PropertyType.BASIC_AUTH).shape
|
|
453
1801
|
});
|
|
454
|
-
const SecretTextProperty =
|
|
1802
|
+
const SecretTextProperty = /* @__PURE__ */ object({
|
|
455
1803
|
...BasePieceAuthSchema.shape,
|
|
456
|
-
...TPropertyValue(
|
|
1804
|
+
...TPropertyValue(/* @__PURE__ */ object({ auth: /* @__PURE__ */ string() }), PropertyType.SECRET_TEXT).shape
|
|
457
1805
|
});
|
|
458
|
-
const CustomAuthProps =
|
|
1806
|
+
const CustomAuthProps = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
|
|
459
1807
|
ShortTextProperty,
|
|
460
1808
|
LongTextProperty,
|
|
461
1809
|
SecretTextProperty,
|
|
@@ -465,12 +1813,12 @@ const CustomAuthProps = z.record(z.string(), z.union([
|
|
|
465
1813
|
MarkDownProperty,
|
|
466
1814
|
StaticMultiSelectDropdownProperty
|
|
467
1815
|
]));
|
|
468
|
-
const CustomAuthProperty =
|
|
1816
|
+
const CustomAuthProperty = /* @__PURE__ */ object({
|
|
469
1817
|
...BasePieceAuthSchema.shape,
|
|
470
1818
|
props: CustomAuthProps,
|
|
471
|
-
...TPropertyValue(
|
|
1819
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.CUSTOM_AUTH).shape
|
|
472
1820
|
});
|
|
473
|
-
const OIDCAuthProps =
|
|
1821
|
+
const OIDCAuthProps = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
|
|
474
1822
|
ShortTextProperty,
|
|
475
1823
|
LongTextProperty,
|
|
476
1824
|
SecretTextProperty,
|
|
@@ -480,54 +1828,53 @@ const OIDCAuthProps = z.record(z.string(), z.union([
|
|
|
480
1828
|
StaticMultiSelectDropdownProperty,
|
|
481
1829
|
MarkDownProperty
|
|
482
1830
|
]));
|
|
483
|
-
const OIDCProperty =
|
|
1831
|
+
const OIDCProperty = /* @__PURE__ */ object({
|
|
484
1832
|
...BasePieceAuthSchema.shape,
|
|
485
1833
|
props: OIDCAuthProps,
|
|
486
|
-
...TPropertyValue(
|
|
1834
|
+
...TPropertyValue(/* @__PURE__ */ unknown(), PropertyType.OIDC).shape
|
|
487
1835
|
});
|
|
488
1836
|
let OAuth2AuthorizationMethod = /* @__PURE__ */ function(OAuth2AuthorizationMethod) {
|
|
489
1837
|
OAuth2AuthorizationMethod["HEADER"] = "HEADER";
|
|
490
1838
|
OAuth2AuthorizationMethod["BODY"] = "BODY";
|
|
491
1839
|
return OAuth2AuthorizationMethod;
|
|
492
1840
|
}({});
|
|
493
|
-
const OAuthProp =
|
|
1841
|
+
const OAuthProp = /* @__PURE__ */ union([
|
|
494
1842
|
ShortTextProperty,
|
|
495
1843
|
SecretTextProperty,
|
|
496
1844
|
StaticDropdownProperty
|
|
497
1845
|
]);
|
|
498
|
-
const OAuth2Props =
|
|
499
|
-
const OAuth2ExtraProps =
|
|
500
|
-
props:
|
|
501
|
-
authUrl:
|
|
502
|
-
tokenUrl:
|
|
503
|
-
scope:
|
|
504
|
-
prompt:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
1846
|
+
const OAuth2Props = /* @__PURE__ */ record(/* @__PURE__ */ string(), OAuthProp);
|
|
1847
|
+
const OAuth2ExtraProps = /* @__PURE__ */ object({
|
|
1848
|
+
props: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), OAuthProp)),
|
|
1849
|
+
authUrl: /* @__PURE__ */ string(),
|
|
1850
|
+
tokenUrl: /* @__PURE__ */ string(),
|
|
1851
|
+
scope: /* @__PURE__ */ array(/* @__PURE__ */ string()),
|
|
1852
|
+
prompt: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
1853
|
+
/* @__PURE__ */ literal("none"),
|
|
1854
|
+
/* @__PURE__ */ literal("consent"),
|
|
1855
|
+
/* @__PURE__ */ literal("login"),
|
|
1856
|
+
/* @__PURE__ */ literal("omit")
|
|
509
1857
|
])),
|
|
510
|
-
pkce:
|
|
511
|
-
pkceMethod:
|
|
512
|
-
authorizationMethod:
|
|
513
|
-
grantType:
|
|
514
|
-
extra:
|
|
515
|
-
});
|
|
516
|
-
const OAuth2PropertyValue =
|
|
517
|
-
access_token:
|
|
518
|
-
props:
|
|
519
|
-
data:
|
|
520
|
-
});
|
|
521
|
-
const
|
|
522
|
-
...BasePieceAuthSchema.shape,
|
|
523
|
-
...OAuth2ExtraProps.shape,
|
|
524
|
-
...TPropertyValue(OAuth2PropertyValue, PropertyType.OAUTH2).shape
|
|
525
|
-
});
|
|
526
|
-
const PieceAuthProperty = z.union([
|
|
1858
|
+
pkce: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1859
|
+
pkceMethod: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("plain"), /* @__PURE__ */ literal("S256")])),
|
|
1860
|
+
authorizationMethod: /* @__PURE__ */ optional(/* @__PURE__ */ _enum(OAuth2AuthorizationMethod)),
|
|
1861
|
+
grantType: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ _enum(OAuth2GrantType), /* @__PURE__ */ literal(BOTH_CLIENT_CREDENTIALS_AND_AUTHORIZATION_CODE)])),
|
|
1862
|
+
extra: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string()))
|
|
1863
|
+
});
|
|
1864
|
+
const OAuth2PropertyValue = /* @__PURE__ */ object({
|
|
1865
|
+
access_token: /* @__PURE__ */ string(),
|
|
1866
|
+
props: /* @__PURE__ */ optional(OAuth2Props),
|
|
1867
|
+
data: /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ any())
|
|
1868
|
+
});
|
|
1869
|
+
const PieceAuthProperty = /* @__PURE__ */ union([
|
|
527
1870
|
BasicAuthProperty,
|
|
528
1871
|
CustomAuthProperty,
|
|
529
1872
|
OIDCProperty,
|
|
530
|
-
|
|
1873
|
+
/* @__PURE__ */ object({
|
|
1874
|
+
...BasePieceAuthSchema.shape,
|
|
1875
|
+
...OAuth2ExtraProps.shape,
|
|
1876
|
+
...TPropertyValue(OAuth2PropertyValue, PropertyType.OAUTH2).shape
|
|
1877
|
+
}),
|
|
531
1878
|
SecretTextProperty
|
|
532
1879
|
]);
|
|
533
1880
|
AppConnectionType.OAUTH2, PropertyType.OAUTH2, AppConnectionType.CLOUD_OAUTH2, PropertyType.OAUTH2, AppConnectionType.PLATFORM_OAUTH2, PropertyType.OAUTH2, AppConnectionType.BASIC_AUTH, PropertyType.BASIC_AUTH, AppConnectionType.CUSTOM_AUTH, PropertyType.CUSTOM_AUTH, AppConnectionType.OIDC, PropertyType.OIDC, AppConnectionType.SECRET_TEXT, PropertyType.SECRET_TEXT, AppConnectionType.NO_AUTH;
|
|
@@ -610,48 +1957,23 @@ let PauseType = /* @__PURE__ */ function(PauseType) {
|
|
|
610
1957
|
PauseType["WEBHOOK"] = "WEBHOOK";
|
|
611
1958
|
return PauseType;
|
|
612
1959
|
}({});
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
StreamStepProgress["NONE"] = "NONE";
|
|
616
|
-
return StreamStepProgress;
|
|
617
|
-
}({});
|
|
618
|
-
const RespondResponse = z.object({
|
|
619
|
-
status: z.optional(z.number()),
|
|
620
|
-
body: z.optional(z.unknown()),
|
|
621
|
-
headers: z.optional(z.record(z.string(), z.string()))
|
|
622
|
-
});
|
|
623
|
-
const DelayPauseMetadata = z.object({
|
|
624
|
-
type: z.literal(PauseType.DELAY),
|
|
625
|
-
resumeDateTime: z.string(),
|
|
626
|
-
requestIdToReply: z.optional(z.string()),
|
|
627
|
-
handlerId: z.optional(z.string()),
|
|
628
|
-
streamStepProgress: z.optional(z.enum(StreamStepProgress))
|
|
629
|
-
});
|
|
630
|
-
const WebhookPauseMetadata = z.object({
|
|
631
|
-
type: z.literal(PauseType.WEBHOOK),
|
|
632
|
-
requestId: z.string(),
|
|
633
|
-
requestIdToReply: z.optional(z.string()),
|
|
634
|
-
response: RespondResponse,
|
|
635
|
-
handlerId: z.optional(z.string()),
|
|
636
|
-
streamStepProgress: z.optional(z.enum(StreamStepProgress))
|
|
637
|
-
});
|
|
638
|
-
z.union([DelayPauseMetadata, WebhookPauseMetadata]);
|
|
1960
|
+
PauseType.DELAY;
|
|
1961
|
+
PauseType.WEBHOOK;
|
|
639
1962
|
const ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
640
1963
|
const ID_LENGTH = 21;
|
|
641
|
-
|
|
1964
|
+
(/* @__PURE__ */ string()).check(/* @__PURE__ */ _regex(new RegExp(`^[0-9a-zA-Z]{${ID_LENGTH}}$`)));
|
|
642
1965
|
customAlphabet(ALPHABET, ID_LENGTH);
|
|
643
|
-
const DateOrString =
|
|
1966
|
+
const DateOrString = /* @__PURE__ */ pipe(/* @__PURE__ */ transform((val) => val instanceof Date ? val.toISOString() : val), /* @__PURE__ */ string());
|
|
644
1967
|
const BaseModelSchema = {
|
|
645
|
-
id:
|
|
1968
|
+
id: /* @__PURE__ */ string(),
|
|
646
1969
|
created: DateOrString,
|
|
647
1970
|
updated: DateOrString
|
|
648
1971
|
};
|
|
649
|
-
const Nullable = (schema) =>
|
|
1972
|
+
const Nullable = (schema) => /* @__PURE__ */ optional(/* @__PURE__ */ nullable(schema));
|
|
650
1973
|
function NullableEnum(enumObj) {
|
|
651
|
-
return
|
|
1974
|
+
return /* @__PURE__ */ optional(/* @__PURE__ */ nullable(/* @__PURE__ */ _enum(enumObj)));
|
|
652
1975
|
}
|
|
653
|
-
|
|
654
|
-
const OptionalArrayFromQuery = (schema) => z.pipe(z.transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : void 0), z.optional(z.array(schema)));
|
|
1976
|
+
const OptionalArrayFromQuery = (schema) => /* @__PURE__ */ pipe(/* @__PURE__ */ transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : void 0), /* @__PURE__ */ optional(/* @__PURE__ */ array(schema)));
|
|
655
1977
|
let AIProviderName = /* @__PURE__ */ function(AIProviderName) {
|
|
656
1978
|
AIProviderName["OPENAI"] = "openai";
|
|
657
1979
|
AIProviderName["OPENROUTER"] = "openrouter";
|
|
@@ -679,23 +2001,6 @@ let AgentToolType = /* @__PURE__ */ function(AgentToolType) {
|
|
|
679
2001
|
AgentToolType["KNOWLEDGE_BASE"] = "KNOWLEDGE_BASE";
|
|
680
2002
|
return AgentToolType;
|
|
681
2003
|
}({});
|
|
682
|
-
let FieldControlMode = /* @__PURE__ */ function(FieldControlMode) {
|
|
683
|
-
FieldControlMode["AGENT_DECIDE"] = "agent-decide";
|
|
684
|
-
FieldControlMode["CHOOSE_YOURSELF"] = "choose-yourself";
|
|
685
|
-
FieldControlMode["LEAVE_EMPTY"] = "leave-empty";
|
|
686
|
-
return FieldControlMode;
|
|
687
|
-
}({});
|
|
688
|
-
let KnowledgeBaseSourceType = /* @__PURE__ */ function(KnowledgeBaseSourceType) {
|
|
689
|
-
KnowledgeBaseSourceType["FILE"] = "FILE";
|
|
690
|
-
KnowledgeBaseSourceType["TABLE"] = "TABLE";
|
|
691
|
-
return KnowledgeBaseSourceType;
|
|
692
|
-
}({});
|
|
693
|
-
let McpProtocol = /* @__PURE__ */ function(McpProtocol) {
|
|
694
|
-
McpProtocol["SSE"] = "sse";
|
|
695
|
-
McpProtocol["STREAMABLE_HTTP"] = "streamable-http";
|
|
696
|
-
McpProtocol["SIMPLE_HTTP"] = "http";
|
|
697
|
-
return McpProtocol;
|
|
698
|
-
}({});
|
|
699
2004
|
let McpAuthType = /* @__PURE__ */ function(McpAuthType) {
|
|
700
2005
|
McpAuthType["NONE"] = "none";
|
|
701
2006
|
McpAuthType["ACCESS_TOKEN"] = "access_token";
|
|
@@ -703,12 +2008,6 @@ let McpAuthType = /* @__PURE__ */ function(McpAuthType) {
|
|
|
703
2008
|
McpAuthType["HEADERS"] = "headers";
|
|
704
2009
|
return McpAuthType;
|
|
705
2010
|
}({});
|
|
706
|
-
let AgentOutputFieldType = /* @__PURE__ */ function(AgentOutputFieldType) {
|
|
707
|
-
AgentOutputFieldType["TEXT"] = "text";
|
|
708
|
-
AgentOutputFieldType["NUMBER"] = "number";
|
|
709
|
-
AgentOutputFieldType["BOOLEAN"] = "boolean";
|
|
710
|
-
return AgentOutputFieldType;
|
|
711
|
-
}({});
|
|
712
2011
|
let ContentBlockType = /* @__PURE__ */ function(ContentBlockType) {
|
|
713
2012
|
ContentBlockType["MARKDOWN"] = "MARKDOWN";
|
|
714
2013
|
ContentBlockType["TOOL_CALL"] = "TOOL_CALL";
|
|
@@ -727,238 +2026,25 @@ let ToolCallType = /* @__PURE__ */ function(ToolCallType) {
|
|
|
727
2026
|
ToolCallType["UNKNOWN"] = "UNKNOWN";
|
|
728
2027
|
return ToolCallType;
|
|
729
2028
|
}({});
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
const PredefinedInputsStructure = z.object({
|
|
735
|
-
auth: z.optional(z.string()),
|
|
736
|
-
fields: z.record(z.string(), PredefinedInputField)
|
|
737
|
-
});
|
|
738
|
-
const AgentPieceToolMetadata = z.object({
|
|
739
|
-
pieceName: z.string(),
|
|
740
|
-
pieceVersion: z.string(),
|
|
741
|
-
actionName: z.string(),
|
|
742
|
-
predefinedInput: z.optional(PredefinedInputsStructure)
|
|
743
|
-
});
|
|
744
|
-
const AgentPieceTool = z.object({
|
|
745
|
-
type: z.literal(AgentToolType.PIECE),
|
|
746
|
-
toolName: z.string().check(z.minLength(1)),
|
|
747
|
-
pieceMetadata: AgentPieceToolMetadata
|
|
748
|
-
});
|
|
749
|
-
const McpAuthNone = z.object({ type: z.literal(McpAuthType.NONE) });
|
|
750
|
-
const McpAuthAccessToken = z.object({
|
|
751
|
-
type: z.literal(McpAuthType.ACCESS_TOKEN),
|
|
752
|
-
accessToken: z.string()
|
|
753
|
-
});
|
|
754
|
-
const McpAuthApiKey = z.object({
|
|
755
|
-
type: z.literal(McpAuthType.API_KEY),
|
|
756
|
-
apiKey: z.string(),
|
|
757
|
-
apiKeyHeader: z.string()
|
|
758
|
-
});
|
|
759
|
-
const McpAuthHeaders = z.object({
|
|
760
|
-
type: z.literal(McpAuthType.HEADERS),
|
|
761
|
-
headers: z.record(z.string(), z.string())
|
|
762
|
-
});
|
|
763
|
-
const McpAuthConfig = z.discriminatedUnion("type", [
|
|
764
|
-
McpAuthNone,
|
|
765
|
-
McpAuthAccessToken,
|
|
766
|
-
McpAuthApiKey,
|
|
767
|
-
McpAuthHeaders
|
|
768
|
-
]);
|
|
769
|
-
const AgentFlowTool = z.object({
|
|
770
|
-
type: z.literal(AgentToolType.FLOW),
|
|
771
|
-
toolName: z.string().check(z.minLength(1)),
|
|
772
|
-
externalFlowId: z.string(),
|
|
773
|
-
flowDisplayName: z.optional(z.string())
|
|
774
|
-
});
|
|
775
|
-
const AgentMcpTool = z.object({
|
|
776
|
-
type: z.literal(AgentToolType.MCP),
|
|
777
|
-
toolName: z.string().check(z.minLength(1)),
|
|
778
|
-
serverUrl: z.url(),
|
|
779
|
-
protocol: z.enum(McpProtocol),
|
|
780
|
-
auth: McpAuthConfig
|
|
781
|
-
});
|
|
782
|
-
const AgentKnowledgeBaseTool = z.object({
|
|
783
|
-
type: z.literal(AgentToolType.KNOWLEDGE_BASE),
|
|
784
|
-
toolName: z.string().check(z.minLength(1)),
|
|
785
|
-
sourceType: z.enum(KnowledgeBaseSourceType),
|
|
786
|
-
sourceId: z.string(),
|
|
787
|
-
sourceName: z.string()
|
|
788
|
-
});
|
|
789
|
-
z.discriminatedUnion("type", [
|
|
790
|
-
AgentPieceTool,
|
|
791
|
-
AgentFlowTool,
|
|
792
|
-
AgentMcpTool,
|
|
793
|
-
AgentKnowledgeBaseTool
|
|
794
|
-
]);
|
|
795
|
-
z.object({
|
|
796
|
-
displayName: z.string(),
|
|
797
|
-
description: z.optional(z.string()),
|
|
798
|
-
type: z.enum(AgentOutputFieldType)
|
|
799
|
-
});
|
|
800
|
-
const MarkdownContentBlock = z.object({
|
|
801
|
-
type: z.literal(ContentBlockType.MARKDOWN),
|
|
802
|
-
markdown: z.string()
|
|
803
|
-
});
|
|
2029
|
+
AgentToolType.PIECE, (/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1));
|
|
2030
|
+
McpAuthType.NONE, McpAuthType.ACCESS_TOKEN, McpAuthType.API_KEY, McpAuthType.HEADERS;
|
|
2031
|
+
AgentToolType.FLOW, (/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1)), AgentToolType.MCP, (/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1)), AgentToolType.KNOWLEDGE_BASE, (/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1));
|
|
2032
|
+
ContentBlockType.MARKDOWN;
|
|
804
2033
|
const toolCallBaseShape = {
|
|
805
|
-
type:
|
|
806
|
-
input: Nullable(
|
|
807
|
-
output:
|
|
808
|
-
toolName:
|
|
809
|
-
status:
|
|
810
|
-
toolCallId:
|
|
811
|
-
startTime:
|
|
812
|
-
endTime:
|
|
2034
|
+
type: /* @__PURE__ */ literal(ContentBlockType.TOOL_CALL),
|
|
2035
|
+
input: Nullable(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown())),
|
|
2036
|
+
output: /* @__PURE__ */ optional(/* @__PURE__ */ unknown()),
|
|
2037
|
+
toolName: /* @__PURE__ */ string(),
|
|
2038
|
+
status: /* @__PURE__ */ _enum(ToolCallStatus),
|
|
2039
|
+
toolCallId: /* @__PURE__ */ string(),
|
|
2040
|
+
startTime: /* @__PURE__ */ string(),
|
|
2041
|
+
endTime: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
813
2042
|
};
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
pieceName: z.string(),
|
|
820
|
-
pieceVersion: z.string(),
|
|
821
|
-
actionName: z.string()
|
|
822
|
-
}),
|
|
823
|
-
z.object({
|
|
824
|
-
...toolCallBaseShape,
|
|
825
|
-
toolCallType: z.literal(ToolCallType.FLOW),
|
|
826
|
-
displayName: z.string(),
|
|
827
|
-
externalFlowId: z.string()
|
|
828
|
-
}),
|
|
829
|
-
z.object({
|
|
830
|
-
...toolCallBaseShape,
|
|
831
|
-
toolCallType: z.literal(ToolCallType.MCP),
|
|
832
|
-
displayName: z.string(),
|
|
833
|
-
serverUrl: z.string()
|
|
834
|
-
}),
|
|
835
|
-
z.object({
|
|
836
|
-
...toolCallBaseShape,
|
|
837
|
-
toolCallType: z.literal(ToolCallType.KNOWLEDGE_BASE),
|
|
838
|
-
displayName: z.string(),
|
|
839
|
-
sourceType: z.string()
|
|
840
|
-
}),
|
|
841
|
-
z.object({
|
|
842
|
-
...toolCallBaseShape,
|
|
843
|
-
toolCallType: z.literal(ToolCallType.UNKNOWN),
|
|
844
|
-
displayName: z.string()
|
|
845
|
-
})
|
|
846
|
-
]);
|
|
847
|
-
z.union([MarkdownContentBlock, ToolCallContentBlock]);
|
|
848
|
-
let AIProviderModelType = /* @__PURE__ */ function(AIProviderModelType) {
|
|
849
|
-
AIProviderModelType["IMAGE"] = "image";
|
|
850
|
-
AIProviderModelType["TEXT"] = "text";
|
|
851
|
-
return AIProviderModelType;
|
|
852
|
-
}({});
|
|
853
|
-
const BaseAIProviderAuthConfig = z.object({ apiKey: z.string() });
|
|
854
|
-
const AnthropicProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
855
|
-
const ActivePiecesProviderAuthConfig = z.object({
|
|
856
|
-
apiKey: z.string(),
|
|
857
|
-
apiKeyHash: z.string()
|
|
858
|
-
});
|
|
859
|
-
const OpenAICompatibleProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
860
|
-
const CloudflareGatewayProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
861
|
-
const AzureProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
862
|
-
const GoogleProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
863
|
-
const OpenAIProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
864
|
-
const OpenRouterProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
865
|
-
const MistralProviderAuthConfig = BaseAIProviderAuthConfig;
|
|
866
|
-
const VertexProviderAuthConfig = z.object({ serviceAccountJson: z.string().check(z.minLength(1)) });
|
|
867
|
-
const BedrockProviderAuthConfig = z.object({
|
|
868
|
-
accessKeyId: z.string().check(z.minLength(1)),
|
|
869
|
-
secretAccessKey: z.string().check(z.minLength(1))
|
|
870
|
-
});
|
|
871
|
-
const AnthropicProviderConfig = z.object({});
|
|
872
|
-
const ActivePiecesProviderConfig = z.object({});
|
|
873
|
-
const GoogleProviderConfig = z.object({});
|
|
874
|
-
const OpenAIProviderConfig = z.object({});
|
|
875
|
-
const OpenRouterProviderConfig = z.object({});
|
|
876
|
-
const MistralProviderConfig = z.object({});
|
|
877
|
-
const ProviderModelConfig = z.object({
|
|
878
|
-
modelId: z.string(),
|
|
879
|
-
modelName: z.string(),
|
|
880
|
-
modelType: z.enum(AIProviderModelType)
|
|
881
|
-
});
|
|
882
|
-
const OpenAICompatibleProviderConfig = z.object({
|
|
883
|
-
apiKeyHeader: z.string(),
|
|
884
|
-
baseUrl: z.string(),
|
|
885
|
-
models: z.array(ProviderModelConfig),
|
|
886
|
-
defaultHeaders: z.optional(z.record(z.string(), z.string())),
|
|
887
|
-
apiStyle: z.optional(z.enum(["chat", "responses"]))
|
|
888
|
-
});
|
|
889
|
-
const CloudflareGatewayProviderConfig = z.object({
|
|
890
|
-
accountId: z.string(),
|
|
891
|
-
gatewayId: z.string(),
|
|
892
|
-
models: z.array(ProviderModelConfig),
|
|
893
|
-
vertexProject: z.optional(z.string()),
|
|
894
|
-
vertexRegion: z.optional(z.string())
|
|
895
|
-
});
|
|
896
|
-
const AzureProviderConfig = z.object({
|
|
897
|
-
resourceName: z.string(),
|
|
898
|
-
apiVersion: z.pipe(z.transform((v) => typeof v === "string" && v.trim().length === 0 ? void 0 : v), z.optional(z.string()))
|
|
899
|
-
});
|
|
900
|
-
const BedrockProviderConfig = z.object({ region: z.string().check(z.minLength(1)) });
|
|
901
|
-
const VertexProviderConfig = z.object({
|
|
902
|
-
project: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),
|
|
903
|
-
region: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),
|
|
904
|
-
models: z.array(ProviderModelConfig)
|
|
905
|
-
});
|
|
906
|
-
const OpenAiCompatibleVendorConfig = z.object({});
|
|
907
|
-
const AIProviderAuthConfig = z.union([
|
|
908
|
-
AnthropicProviderAuthConfig,
|
|
909
|
-
AzureProviderAuthConfig,
|
|
910
|
-
GoogleProviderAuthConfig,
|
|
911
|
-
OpenAIProviderAuthConfig,
|
|
912
|
-
OpenRouterProviderAuthConfig,
|
|
913
|
-
CloudflareGatewayProviderAuthConfig,
|
|
914
|
-
OpenAICompatibleProviderAuthConfig,
|
|
915
|
-
ActivePiecesProviderAuthConfig,
|
|
916
|
-
BedrockProviderAuthConfig,
|
|
917
|
-
VertexProviderAuthConfig,
|
|
918
|
-
MistralProviderAuthConfig
|
|
919
|
-
]);
|
|
920
|
-
const AIProviderConfig = z.union([
|
|
921
|
-
OpenAICompatibleProviderConfig,
|
|
922
|
-
CloudflareGatewayProviderConfig,
|
|
923
|
-
AzureProviderConfig,
|
|
924
|
-
VertexProviderConfig,
|
|
925
|
-
BedrockProviderConfig,
|
|
926
|
-
AnthropicProviderConfig,
|
|
927
|
-
GoogleProviderConfig,
|
|
928
|
-
OpenAIProviderConfig,
|
|
929
|
-
OpenRouterProviderConfig,
|
|
930
|
-
ActivePiecesProviderConfig,
|
|
931
|
-
MistralProviderConfig,
|
|
932
|
-
OpenAiCompatibleVendorConfig
|
|
933
|
-
]);
|
|
934
|
-
z.object({
|
|
935
|
-
id: z.string(),
|
|
936
|
-
name: z.string(),
|
|
937
|
-
type: z.enum(AIProviderModelType)
|
|
938
|
-
});
|
|
939
|
-
z.object({
|
|
940
|
-
id: z.string(),
|
|
941
|
-
name: z.string(),
|
|
942
|
-
provider: z.enum(AIProviderName),
|
|
943
|
-
config: AIProviderConfig,
|
|
944
|
-
enabledForChat: z.boolean()
|
|
945
|
-
});
|
|
946
|
-
z.object({
|
|
947
|
-
provider: z.enum(AIProviderName),
|
|
948
|
-
name: z.string(),
|
|
949
|
-
enabledForChat: z.boolean(),
|
|
950
|
-
keys: z.array(z.object({
|
|
951
|
-
id: z.string(),
|
|
952
|
-
name: z.string()
|
|
953
|
-
}))
|
|
954
|
-
});
|
|
955
|
-
z.object({
|
|
956
|
-
provider: z.enum(AIProviderName),
|
|
957
|
-
configId: z.string(),
|
|
958
|
-
config: AIProviderConfig,
|
|
959
|
-
auth: AIProviderAuthConfig,
|
|
960
|
-
platformId: z.string()
|
|
961
|
-
});
|
|
2043
|
+
({ ...toolCallBaseShape }), ToolCallType.PIECE, { ...toolCallBaseShape }, ToolCallType.FLOW, { ...toolCallBaseShape }, ToolCallType.MCP, { ...toolCallBaseShape }, ToolCallType.KNOWLEDGE_BASE, { ...toolCallBaseShape }, ToolCallType.UNKNOWN;
|
|
2044
|
+
(/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1));
|
|
2045
|
+
(/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1)), (/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1));
|
|
2046
|
+
(/* @__PURE__ */ string()).check(/* @__PURE__ */ _minLength(1));
|
|
2047
|
+
(/* @__PURE__ */ string()).check(/* @__PURE__ */ _regex(/^[a-z0-9][a-z0-9-]{0,62}$/)), (/* @__PURE__ */ string()).check(/* @__PURE__ */ _regex(/^[a-z0-9][a-z0-9-]{0,62}$/));
|
|
962
2048
|
AIProviderName.OPENAI, AIProviderName.ANTHROPIC, AIProviderName.GOOGLE, AIProviderName.GOOGLE;
|
|
963
2049
|
const OPENAI_CHAT_MODELS = [
|
|
964
2050
|
"gpt-5.5",
|
|
@@ -1050,35 +2136,12 @@ function buildProviderCapabilities(provider) {
|
|
|
1050
2136
|
};
|
|
1051
2137
|
}
|
|
1052
2138
|
AIProviderName.OPENAI, buildProviderCapabilities(AIProviderName.OPENAI), AIProviderName.ANTHROPIC, buildProviderCapabilities(AIProviderName.ANTHROPIC), AIProviderName.OPENROUTER, buildProviderCapabilities(AIProviderName.OPENROUTER), AIProviderName.AZURE, buildProviderCapabilities(AIProviderName.AZURE), AIProviderName.GOOGLE, buildProviderCapabilities(AIProviderName.GOOGLE), AIProviderName.CLOUDFLARE_GATEWAY, buildProviderCapabilities(AIProviderName.CLOUDFLARE_GATEWAY), AIProviderName.CUSTOM, buildProviderCapabilities(AIProviderName.CUSTOM), AIProviderName.BEDROCK, buildProviderCapabilities(AIProviderName.BEDROCK), AIProviderName.VERTEX, buildProviderCapabilities(AIProviderName.VERTEX), AIProviderName.MISTRAL, buildProviderCapabilities(AIProviderName.MISTRAL), AIProviderName.ACTIVEPIECES, buildProviderCapabilities(AIProviderName.ACTIVEPIECES), AIProviderName.XAI, buildProviderCapabilities(AIProviderName.XAI), AIProviderName.DEEPSEEK, buildProviderCapabilities(AIProviderName.DEEPSEEK), AIProviderName.ZAI, buildProviderCapabilities(AIProviderName.ZAI), AIProviderName.QWEN, buildProviderCapabilities(AIProviderName.QWEN), AIProviderName.MINIMAX, buildProviderCapabilities(AIProviderName.MINIMAX), AIProviderName.MOONSHOT, buildProviderCapabilities(AIProviderName.MOONSHOT);
|
|
1053
|
-
const FileResponseInterfaceV1 = z.object({
|
|
1054
|
-
base64Url: z.string(),
|
|
1055
|
-
fileName: z.string(),
|
|
1056
|
-
extension: z.optional(z.string())
|
|
1057
|
-
});
|
|
1058
|
-
const FileResponseInterfaceV2 = z.object({
|
|
1059
|
-
mimeType: z.string(),
|
|
1060
|
-
url: z.string(),
|
|
1061
|
-
fileName: z.optional(z.string())
|
|
1062
|
-
});
|
|
1063
|
-
const FileResponseInterface = z.union([FileResponseInterfaceV1, FileResponseInterfaceV2]);
|
|
1064
2139
|
let HumanInputFormResultTypes = /* @__PURE__ */ function(HumanInputFormResultTypes) {
|
|
1065
2140
|
HumanInputFormResultTypes["FILE"] = "file";
|
|
1066
2141
|
HumanInputFormResultTypes["MARKDOWN"] = "markdown";
|
|
1067
2142
|
return HumanInputFormResultTypes;
|
|
1068
2143
|
}({});
|
|
1069
|
-
|
|
1070
|
-
type: z.literal(HumanInputFormResultTypes.FILE),
|
|
1071
|
-
value: FileResponseInterface
|
|
1072
|
-
}), z.object({
|
|
1073
|
-
type: z.literal(HumanInputFormResultTypes.MARKDOWN),
|
|
1074
|
-
value: z.string(),
|
|
1075
|
-
files: z.optional(z.array(FileResponseInterface))
|
|
1076
|
-
})]);
|
|
1077
|
-
z.object({
|
|
1078
|
-
sessionId: z.string(),
|
|
1079
|
-
message: z.string(),
|
|
1080
|
-
files: z.optional(z.array(z.string()))
|
|
1081
|
-
});
|
|
2144
|
+
HumanInputFormResultTypes.FILE, HumanInputFormResultTypes.MARKDOWN;
|
|
1082
2145
|
let FieldType = /* @__PURE__ */ function(FieldType) {
|
|
1083
2146
|
FieldType["TEXT"] = "TEXT";
|
|
1084
2147
|
FieldType["NUMBER"] = "NUMBER";
|
|
@@ -1097,12 +2160,6 @@ let TableAutomationStatus = /* @__PURE__ */ function(TableAutomationStatus) {
|
|
|
1097
2160
|
TableAutomationStatus["DISABLED"] = "DISABLED";
|
|
1098
2161
|
return TableAutomationStatus;
|
|
1099
2162
|
}({});
|
|
1100
|
-
let TableWebhookEventType = /* @__PURE__ */ function(TableWebhookEventType) {
|
|
1101
|
-
TableWebhookEventType["RECORD_CREATED"] = "RECORD_CREATED";
|
|
1102
|
-
TableWebhookEventType["RECORD_UPDATED"] = "RECORD_UPDATED";
|
|
1103
|
-
TableWebhookEventType["RECORD_DELETED"] = "RECORD_DELETED";
|
|
1104
|
-
return TableWebhookEventType;
|
|
1105
|
-
}({});
|
|
1106
2163
|
let FilterOperator = /* @__PURE__ */ function(FilterOperator) {
|
|
1107
2164
|
FilterOperator["EQ"] = "eq";
|
|
1108
2165
|
FilterOperator["NEQ"] = "neq";
|
|
@@ -1115,85 +2172,13 @@ let FilterOperator = /* @__PURE__ */ function(FilterOperator) {
|
|
|
1115
2172
|
FilterOperator["NOT_EXISTS"] = "not_exists";
|
|
1116
2173
|
return FilterOperator;
|
|
1117
2174
|
}({});
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
data: z.object({ options: z.array(z.object({ value: z.string() })) })
|
|
1126
|
-
}), z.object({
|
|
1127
|
-
...BaseModelSchema,
|
|
1128
|
-
name: z.string(),
|
|
1129
|
-
externalId: z.string(),
|
|
1130
|
-
type: z.union([
|
|
1131
|
-
z.literal(FieldType.TEXT),
|
|
1132
|
-
z.literal(FieldType.NUMBER),
|
|
1133
|
-
z.literal(FieldType.DATE),
|
|
1134
|
-
z.literal(FieldType.DATETIME)
|
|
1135
|
-
]),
|
|
1136
|
-
tableId: z.string(),
|
|
1137
|
-
projectId: z.string()
|
|
1138
|
-
})]);
|
|
1139
|
-
z.object({
|
|
1140
|
-
...BaseModelSchema,
|
|
1141
|
-
name: z.string(),
|
|
1142
|
-
folderId: Nullable(z.string()),
|
|
1143
|
-
projectId: z.string(),
|
|
1144
|
-
externalId: z.string(),
|
|
1145
|
-
status: NullableEnum(TableAutomationStatus),
|
|
1146
|
-
trigger: NullableEnum(TableAutomationTrigger)
|
|
1147
|
-
});
|
|
1148
|
-
z.object({
|
|
1149
|
-
...BaseModelSchema,
|
|
1150
|
-
tableId: z.string(),
|
|
1151
|
-
projectId: z.string(),
|
|
1152
|
-
cells: z.record(z.string(), z.object({
|
|
1153
|
-
updated: z.string(),
|
|
1154
|
-
created: z.string(),
|
|
1155
|
-
value: z.unknown(),
|
|
1156
|
-
fieldName: z.string()
|
|
1157
|
-
}))
|
|
1158
|
-
});
|
|
1159
|
-
z.object({
|
|
1160
|
-
events: z.array(z.enum(TableWebhookEventType)),
|
|
1161
|
-
webhookUrl: z.string(),
|
|
1162
|
-
flowId: z.string()
|
|
1163
|
-
});
|
|
1164
|
-
z.object({
|
|
1165
|
-
fields: z.array(z.object({
|
|
1166
|
-
id: z.string(),
|
|
1167
|
-
name: z.string()
|
|
1168
|
-
})),
|
|
1169
|
-
rows: z.array(z.record(z.string(), z.string())),
|
|
1170
|
-
name: z.string()
|
|
1171
|
-
});
|
|
1172
|
-
z.object({
|
|
1173
|
-
projectId: z.string(),
|
|
1174
|
-
limit: z.optional(z.coerce.number()),
|
|
1175
|
-
cursor: z.optional(z.string()),
|
|
1176
|
-
name: z.optional(z.string()),
|
|
1177
|
-
externalIds: OptionalArrayFromQuery(z.string()),
|
|
1178
|
-
folderId: z.optional(z.string()),
|
|
1179
|
-
folderIds: OptionalArrayFromQuery(z.string())
|
|
1180
|
-
});
|
|
1181
|
-
z.object({
|
|
1182
|
-
records: z.array(z.array(z.object({
|
|
1183
|
-
fieldId: z.string(),
|
|
1184
|
-
value: coerceToString()
|
|
1185
|
-
}))),
|
|
1186
|
-
tableId: z.string()
|
|
1187
|
-
});
|
|
1188
|
-
z.object({
|
|
1189
|
-
cells: z.optional(z.array(z.object({
|
|
1190
|
-
fieldId: z.string(),
|
|
1191
|
-
value: coerceToString()
|
|
1192
|
-
}))),
|
|
1193
|
-
tableId: z.string(),
|
|
1194
|
-
agentUpdate: z.optional(z.boolean())
|
|
1195
|
-
});
|
|
1196
|
-
const Filter = z.discriminatedUnion("operator", [
|
|
2175
|
+
({ ...BaseModelSchema }), FieldType.STATIC_DROPDOWN, { ...BaseModelSchema }, FieldType.TEXT, FieldType.NUMBER, FieldType.DATE, FieldType.DATETIME;
|
|
2176
|
+
({ ...BaseModelSchema }), Nullable(/* @__PURE__ */ string()), NullableEnum(TableAutomationStatus), NullableEnum(TableAutomationTrigger);
|
|
2177
|
+
({ ...BaseModelSchema });
|
|
2178
|
+
OptionalArrayFromQuery(/* @__PURE__ */ string()), OptionalArrayFromQuery(/* @__PURE__ */ string());
|
|
2179
|
+
coerceToString();
|
|
2180
|
+
coerceToString();
|
|
2181
|
+
OptionalArrayFromQuery(/* @__PURE__ */ discriminatedUnion("operator", [
|
|
1197
2182
|
valueFilter(FilterOperator.EQ),
|
|
1198
2183
|
valueFilter(FilterOperator.NEQ),
|
|
1199
2184
|
valueFilter(FilterOperator.GT),
|
|
@@ -1203,70 +2188,34 @@ const Filter = z.discriminatedUnion("operator", [
|
|
|
1203
2188
|
valueFilter(FilterOperator.CO),
|
|
1204
2189
|
existenceFilter(FilterOperator.EXISTS),
|
|
1205
2190
|
existenceFilter(FilterOperator.NOT_EXISTS)
|
|
1206
|
-
]);
|
|
1207
|
-
z.object({
|
|
1208
|
-
tableId: z.string(),
|
|
1209
|
-
limit: z.optional(z.coerce.number()),
|
|
1210
|
-
cursor: z.optional(z.string()),
|
|
1211
|
-
filters: OptionalArrayFromQuery(Filter)
|
|
1212
|
-
});
|
|
2191
|
+
]));
|
|
1213
2192
|
function coerceToString() {
|
|
1214
|
-
return
|
|
2193
|
+
return /* @__PURE__ */ pipe(/* @__PURE__ */ transform((v) => v === null || v === void 0 ? v : String(v)), /* @__PURE__ */ nullable(/* @__PURE__ */ string()));
|
|
1215
2194
|
}
|
|
1216
2195
|
function valueFilter(op) {
|
|
1217
|
-
return
|
|
1218
|
-
fieldId:
|
|
1219
|
-
operator:
|
|
1220
|
-
value:
|
|
2196
|
+
return /* @__PURE__ */ object({
|
|
2197
|
+
fieldId: /* @__PURE__ */ string(),
|
|
2198
|
+
operator: /* @__PURE__ */ literal(op),
|
|
2199
|
+
value: /* @__PURE__ */ string()
|
|
1221
2200
|
});
|
|
1222
2201
|
}
|
|
1223
2202
|
function existenceFilter(op) {
|
|
1224
|
-
return
|
|
1225
|
-
fieldId:
|
|
1226
|
-
operator:
|
|
2203
|
+
return /* @__PURE__ */ object({
|
|
2204
|
+
fieldId: /* @__PURE__ */ string(),
|
|
2205
|
+
operator: /* @__PURE__ */ literal(op)
|
|
1227
2206
|
});
|
|
1228
2207
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
body: z.optional(z.unknown()),
|
|
1232
|
-
headers: z.optional(z.record(z.string(), z.string()))
|
|
1233
|
-
});
|
|
1234
|
-
z.object({
|
|
1235
|
-
...BaseModelSchema,
|
|
1236
|
-
deleted: Nullable(DateOrString),
|
|
1237
|
-
ownerId: z.string(),
|
|
1238
|
-
displayName: z.string(),
|
|
1239
|
-
platformId: z.string(),
|
|
1240
|
-
externalId: Nullable(z.string())
|
|
1241
|
-
});
|
|
1242
|
-
const McpProperty = z.object({
|
|
1243
|
-
name: z.string(),
|
|
1244
|
-
description: z.optional(z.string()),
|
|
1245
|
-
type: z.string(),
|
|
1246
|
-
required: z.boolean()
|
|
1247
|
-
});
|
|
1248
|
-
z.object({
|
|
1249
|
-
pieceName: z.string(),
|
|
1250
|
-
triggerName: z.string(),
|
|
1251
|
-
input: z.object({
|
|
1252
|
-
toolName: z.string(),
|
|
1253
|
-
toolDescription: z.string(),
|
|
1254
|
-
inputSchema: z.array(McpProperty),
|
|
1255
|
-
returnsResponse: z.boolean()
|
|
1256
|
-
})
|
|
1257
|
-
});
|
|
1258
|
-
const PieceProperty = z.union([InputProperty, PieceAuthProperty]);
|
|
1259
|
-
const PiecePropertyMap = z.record(z.string(), PieceProperty);
|
|
1260
|
-
z.record(z.string(), InputProperty);
|
|
2208
|
+
({ ...BaseModelSchema }), Nullable(DateOrString), Nullable(/* @__PURE__ */ string());
|
|
2209
|
+
const PiecePropertyMap = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([InputProperty, PieceAuthProperty]));
|
|
1261
2210
|
let WebhookRenewStrategy = /* @__PURE__ */ function(WebhookRenewStrategy) {
|
|
1262
2211
|
WebhookRenewStrategy["CRON"] = "CRON";
|
|
1263
2212
|
WebhookRenewStrategy["NONE"] = "NONE";
|
|
1264
2213
|
return WebhookRenewStrategy;
|
|
1265
2214
|
}({});
|
|
1266
|
-
const WebhookRenewConfiguration =
|
|
1267
|
-
strategy:
|
|
1268
|
-
cronExpression:
|
|
1269
|
-
}),
|
|
2215
|
+
const WebhookRenewConfiguration = /* @__PURE__ */ union([/* @__PURE__ */ object({
|
|
2216
|
+
strategy: /* @__PURE__ */ literal(WebhookRenewStrategy.CRON),
|
|
2217
|
+
cronExpression: /* @__PURE__ */ string()
|
|
2218
|
+
}), /* @__PURE__ */ object({ strategy: /* @__PURE__ */ literal(WebhookRenewStrategy.NONE) })]);
|
|
1270
2219
|
var ITrigger = class {
|
|
1271
2220
|
constructor(name, displayName, description, requireAuth, props, type, handshakeConfiguration, onHandshake, renewConfiguration, onRenew, onEnable, onDisable, onStart, run, test, sampleData, testStrategy, outputSchema, aiMetadata, classification, propertyGroups) {
|
|
1272
2221
|
this.name = name;
|
|
@@ -1380,114 +2329,108 @@ function isSemverLessThan(a, b) {
|
|
|
1380
2329
|
if (a2 !== b2) return a2 < b2;
|
|
1381
2330
|
return a3 < b3;
|
|
1382
2331
|
}
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
const Audience = z.enum([
|
|
2332
|
+
const PieceBase = /* @__PURE__ */ object({
|
|
2333
|
+
id: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2334
|
+
name: /* @__PURE__ */ string(),
|
|
2335
|
+
displayName: /* @__PURE__ */ string(),
|
|
2336
|
+
logoUrl: /* @__PURE__ */ string(),
|
|
2337
|
+
description: /* @__PURE__ */ string(),
|
|
2338
|
+
authors: /* @__PURE__ */ array(/* @__PURE__ */ string()),
|
|
2339
|
+
platformId: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2340
|
+
directoryPath: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2341
|
+
auth: /* @__PURE__ */ optional(/* @__PURE__ */ union([PieceAuthProperty, /* @__PURE__ */ array(PieceAuthProperty)])),
|
|
2342
|
+
version: /* @__PURE__ */ string(),
|
|
2343
|
+
categories: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ _enum(PieceCategory))),
|
|
2344
|
+
minimumSupportedRelease: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2345
|
+
maximumSupportedRelease: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2346
|
+
deprecated: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2347
|
+
i18n: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())))
|
|
2348
|
+
});
|
|
2349
|
+
const Audience = /* @__PURE__ */ _enum([
|
|
1402
2350
|
"human",
|
|
1403
2351
|
"ai",
|
|
1404
2352
|
"both"
|
|
1405
2353
|
]);
|
|
1406
|
-
const AiMetadata =
|
|
1407
|
-
description:
|
|
1408
|
-
idempotent:
|
|
2354
|
+
const AiMetadata = /* @__PURE__ */ object({
|
|
2355
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2356
|
+
idempotent: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
1409
2357
|
});
|
|
1410
|
-
const ActionClassification =
|
|
2358
|
+
const ActionClassification = /* @__PURE__ */ _enum([
|
|
1411
2359
|
"READ",
|
|
1412
2360
|
"SEARCH",
|
|
1413
2361
|
"WRITE",
|
|
1414
2362
|
"DESTRUCTIVE"
|
|
1415
2363
|
]);
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
description: z.string(),
|
|
2364
|
+
const PropertyGroup = /* @__PURE__ */ object({
|
|
2365
|
+
key: /* @__PURE__ */ string(),
|
|
2366
|
+
display: /* @__PURE__ */ _enum([
|
|
2367
|
+
"tabs",
|
|
2368
|
+
"section",
|
|
2369
|
+
"summary",
|
|
2370
|
+
"builder",
|
|
2371
|
+
"footer"
|
|
2372
|
+
]),
|
|
2373
|
+
label: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2374
|
+
description: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2375
|
+
icon: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2376
|
+
props: /* @__PURE__ */ array(/* @__PURE__ */ string())
|
|
2377
|
+
});
|
|
2378
|
+
const ActionBase = /* @__PURE__ */ object({
|
|
2379
|
+
name: /* @__PURE__ */ string(),
|
|
2380
|
+
displayName: /* @__PURE__ */ string(),
|
|
2381
|
+
description: /* @__PURE__ */ string(),
|
|
1435
2382
|
props: PiecePropertyMap,
|
|
1436
|
-
propertyGroups:
|
|
1437
|
-
requireAuth:
|
|
1438
|
-
errorHandlingOptions:
|
|
1439
|
-
outputSchema:
|
|
1440
|
-
audience:
|
|
1441
|
-
aiMetadata:
|
|
1442
|
-
classification:
|
|
1443
|
-
});
|
|
1444
|
-
const TriggerBase =
|
|
1445
|
-
name:
|
|
1446
|
-
displayName:
|
|
1447
|
-
description:
|
|
2383
|
+
propertyGroups: /* @__PURE__ */ optional(/* @__PURE__ */ array(PropertyGroup)),
|
|
2384
|
+
requireAuth: /* @__PURE__ */ boolean(),
|
|
2385
|
+
errorHandlingOptions: /* @__PURE__ */ optional(ErrorHandlingOptionsParam),
|
|
2386
|
+
outputSchema: /* @__PURE__ */ optional(/* @__PURE__ */ custom()),
|
|
2387
|
+
audience: /* @__PURE__ */ optional(Audience),
|
|
2388
|
+
aiMetadata: /* @__PURE__ */ optional(AiMetadata),
|
|
2389
|
+
classification: /* @__PURE__ */ optional(ActionClassification)
|
|
2390
|
+
});
|
|
2391
|
+
const TriggerBase = /* @__PURE__ */ object({
|
|
2392
|
+
name: /* @__PURE__ */ string(),
|
|
2393
|
+
displayName: /* @__PURE__ */ string(),
|
|
2394
|
+
description: /* @__PURE__ */ string(),
|
|
1448
2395
|
props: PiecePropertyMap,
|
|
1449
|
-
propertyGroups:
|
|
1450
|
-
errorHandlingOptions:
|
|
1451
|
-
type:
|
|
1452
|
-
sampleData:
|
|
1453
|
-
handshakeConfiguration:
|
|
1454
|
-
renewConfiguration:
|
|
1455
|
-
testStrategy:
|
|
1456
|
-
outputSchema:
|
|
1457
|
-
aiMetadata:
|
|
1458
|
-
classification:
|
|
1459
|
-
});
|
|
1460
|
-
const PieceMetadata =
|
|
2396
|
+
propertyGroups: /* @__PURE__ */ optional(/* @__PURE__ */ array(PropertyGroup)),
|
|
2397
|
+
errorHandlingOptions: /* @__PURE__ */ optional(ErrorHandlingOptionsParam),
|
|
2398
|
+
type: /* @__PURE__ */ _enum(TriggerStrategy),
|
|
2399
|
+
sampleData: /* @__PURE__ */ unknown(),
|
|
2400
|
+
handshakeConfiguration: /* @__PURE__ */ optional(/* @__PURE__ */ custom()),
|
|
2401
|
+
renewConfiguration: /* @__PURE__ */ optional(WebhookRenewConfiguration),
|
|
2402
|
+
testStrategy: /* @__PURE__ */ _enum(TriggerTestStrategy),
|
|
2403
|
+
outputSchema: /* @__PURE__ */ optional(/* @__PURE__ */ custom()),
|
|
2404
|
+
aiMetadata: /* @__PURE__ */ optional(AiMetadata),
|
|
2405
|
+
classification: /* @__PURE__ */ optional(ActionClassification)
|
|
2406
|
+
});
|
|
2407
|
+
const PieceMetadata = /* @__PURE__ */ object({
|
|
1461
2408
|
...PieceBase.shape,
|
|
1462
|
-
actions:
|
|
1463
|
-
triggers:
|
|
2409
|
+
actions: /* @__PURE__ */ record(/* @__PURE__ */ string(), ActionBase),
|
|
2410
|
+
triggers: /* @__PURE__ */ record(/* @__PURE__ */ string(), TriggerBase)
|
|
1464
2411
|
});
|
|
1465
|
-
const PieceMetadataSummary =
|
|
2412
|
+
const PieceMetadataSummary = /* @__PURE__ */ object({
|
|
1466
2413
|
...PieceBase.shape,
|
|
1467
|
-
actions:
|
|
1468
|
-
triggers:
|
|
1469
|
-
suggestedActions:
|
|
1470
|
-
suggestedTriggers:
|
|
1471
|
-
});
|
|
1472
|
-
const PiecePackageMetadata =
|
|
1473
|
-
projectUsage:
|
|
1474
|
-
pieceType:
|
|
1475
|
-
packageType:
|
|
1476
|
-
platformId:
|
|
1477
|
-
archiveId:
|
|
1478
|
-
});
|
|
1479
|
-
|
|
2414
|
+
actions: /* @__PURE__ */ number$1(),
|
|
2415
|
+
triggers: /* @__PURE__ */ number$1(),
|
|
2416
|
+
suggestedActions: /* @__PURE__ */ optional(/* @__PURE__ */ array(ActionBase)),
|
|
2417
|
+
suggestedTriggers: /* @__PURE__ */ optional(/* @__PURE__ */ array(TriggerBase))
|
|
2418
|
+
});
|
|
2419
|
+
const PiecePackageMetadata = /* @__PURE__ */ object({
|
|
2420
|
+
projectUsage: /* @__PURE__ */ number$1(),
|
|
2421
|
+
pieceType: /* @__PURE__ */ _enum(PieceType),
|
|
2422
|
+
packageType: /* @__PURE__ */ _enum(PackageType),
|
|
2423
|
+
platformId: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2424
|
+
archiveId: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
2425
|
+
});
|
|
2426
|
+
({
|
|
1480
2427
|
...PieceMetadata.shape,
|
|
1481
2428
|
...PiecePackageMetadata.shape
|
|
1482
2429
|
});
|
|
1483
|
-
|
|
2430
|
+
({
|
|
1484
2431
|
...PieceMetadataSummary.shape,
|
|
1485
2432
|
...PiecePackageMetadata.shape
|
|
1486
2433
|
});
|
|
1487
|
-
z.object({
|
|
1488
|
-
name: z.string(),
|
|
1489
|
-
version: z.string()
|
|
1490
|
-
});
|
|
1491
2434
|
function reactorOf(ctx) {
|
|
1492
2435
|
const reactor = ctx !== null && typeof ctx === "object" ? ctx.reactor : void 0;
|
|
1493
2436
|
if (!reactor) throw new Error("ctx.reactor is not available: this piece is not running on a Powerhouse reactor");
|