@nekzus/liop 2.1.0-alpha.8 → 2.1.0-alpha.9
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/bin/agent.js +3 -3
- package/dist/bridge.d.ts +2 -2
- package/dist/bridge.js +1 -1
- package/dist/{chunk-SSURAA3I.js → chunk-E5QBDD5E.js} +3 -3
- package/dist/{chunk-SSURAA3I.js.map → chunk-E5QBDD5E.js.map} +1 -1
- package/dist/chunk-F5YNYL5L.js +14512 -0
- package/dist/chunk-F5YNYL5L.js.map +1 -0
- package/dist/{chunk-GDITQCKD.js → chunk-KHWULRWJ.js} +12 -1205
- package/dist/chunk-KHWULRWJ.js.map +1 -0
- package/dist/{chunk-R5NHKIC3.js → chunk-MCXMS5ZI.js} +3 -3
- package/dist/{chunk-R5NHKIC3.js.map → chunk-MCXMS5ZI.js.map} +1 -1
- package/dist/{chunk-MMYZR7G7.js → chunk-NJRSFFD7.js} +6 -6
- package/dist/chunk-NJRSFFD7.js.map +1 -0
- package/dist/{chunk-PYIGZG6E.js → chunk-YTN3CW26.js} +2 -2
- package/dist/{chunk-PYIGZG6E.js.map → chunk-YTN3CW26.js.map} +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -2
- package/dist/gateway.d.ts +2 -2
- package/dist/{index-Brfvxmdt.d.ts → index-qM8ZH8sC.d.ts} +1 -1
- package/dist/{index-DO97j6hP.d.ts → index-smNq7_Mo.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/mesh.js +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +3 -3
- package/dist/{types-DzEXgi4s.d.ts → types-sKeUxuky.d.ts} +4 -46
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/package.json +21 -22
- package/dist/chunk-GDITQCKD.js.map +0 -1
- package/dist/chunk-HGTKLHOL.js +0 -4045
- package/dist/chunk-HGTKLHOL.js.map +0 -1
- package/dist/chunk-MMYZR7G7.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { external_exports
|
|
1
|
+
import { external_exports } from './chunk-F5YNYL5L.js';
|
|
2
2
|
import { LIOP_SCOPES, authorizeRequest } from './chunk-IJHTRIZC.js';
|
|
3
3
|
import { liopV1, createServerCredentials } from './chunk-RDWCGZ2A.js';
|
|
4
|
-
import { MeshNode } from './chunk-
|
|
4
|
+
import { MeshNode } from './chunk-NJRSFFD7.js';
|
|
5
5
|
import { log } from './chunk-72MNYFR6.js';
|
|
6
6
|
import { Buffer } from 'buffer';
|
|
7
7
|
import crypto2 from 'crypto';
|
|
@@ -15,1200 +15,6 @@ import { Piscina, FixedQueue } from 'piscina';
|
|
|
15
15
|
import * as jose from 'jose';
|
|
16
16
|
import Provider from 'oidc-provider';
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
19
|
-
var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
20
|
-
var defaultOptions = {
|
|
21
|
-
name: void 0,
|
|
22
|
-
$refStrategy: "root",
|
|
23
|
-
basePath: ["#"],
|
|
24
|
-
effectStrategy: "input",
|
|
25
|
-
pipeStrategy: "all",
|
|
26
|
-
dateStrategy: "format:date-time",
|
|
27
|
-
mapStrategy: "entries",
|
|
28
|
-
removeAdditionalStrategy: "passthrough",
|
|
29
|
-
definitionPath: "definitions",
|
|
30
|
-
target: "jsonSchema7",
|
|
31
|
-
strictUnions: false,
|
|
32
|
-
definitions: {},
|
|
33
|
-
errorMessages: false,
|
|
34
|
-
markdownDescription: false,
|
|
35
|
-
patternStrategy: "escape",
|
|
36
|
-
applyRegexFlags: false,
|
|
37
|
-
emailStrategy: "format:email",
|
|
38
|
-
base64Strategy: "contentEncoding:base64",
|
|
39
|
-
nameStrategy: "ref"
|
|
40
|
-
};
|
|
41
|
-
var getDefaultOptions = (options) => ({
|
|
42
|
-
...defaultOptions,
|
|
43
|
-
...options
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
47
|
-
var getRefs = (options) => {
|
|
48
|
-
const _options = getDefaultOptions(options);
|
|
49
|
-
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
50
|
-
return {
|
|
51
|
-
..._options,
|
|
52
|
-
currentPath,
|
|
53
|
-
propertyPath: void 0,
|
|
54
|
-
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
|
|
55
|
-
def._def,
|
|
56
|
-
{
|
|
57
|
-
def: def._def,
|
|
58
|
-
path: [..._options.basePath, _options.definitionPath, name],
|
|
59
|
-
// Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
|
|
60
|
-
jsonSchema: void 0
|
|
61
|
-
}
|
|
62
|
-
]))
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
67
|
-
function addErrorMessage(res, key, errorMessage, refs) {
|
|
68
|
-
if (!refs?.errorMessages)
|
|
69
|
-
return;
|
|
70
|
-
if (errorMessage) {
|
|
71
|
-
res.errorMessage = {
|
|
72
|
-
...res.errorMessage,
|
|
73
|
-
[key]: errorMessage
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
78
|
-
res[key] = value;
|
|
79
|
-
addErrorMessage(res, key, errorMessage, refs);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
83
|
-
function parseAnyDef() {
|
|
84
|
-
return {};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
88
|
-
function parseArrayDef(def, refs) {
|
|
89
|
-
const res = {
|
|
90
|
-
type: "array"
|
|
91
|
-
};
|
|
92
|
-
if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
|
|
93
|
-
res.items = parseDef(def.type._def, {
|
|
94
|
-
...refs,
|
|
95
|
-
currentPath: [...refs.currentPath, "items"]
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if (def.minLength) {
|
|
99
|
-
setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs);
|
|
100
|
-
}
|
|
101
|
-
if (def.maxLength) {
|
|
102
|
-
setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
|
|
103
|
-
}
|
|
104
|
-
if (def.exactLength) {
|
|
105
|
-
setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
|
|
106
|
-
setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
|
|
107
|
-
}
|
|
108
|
-
return res;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
112
|
-
function parseBigintDef(def, refs) {
|
|
113
|
-
const res = {
|
|
114
|
-
type: "integer",
|
|
115
|
-
format: "int64"
|
|
116
|
-
};
|
|
117
|
-
if (!def.checks)
|
|
118
|
-
return res;
|
|
119
|
-
for (const check of def.checks) {
|
|
120
|
-
switch (check.kind) {
|
|
121
|
-
case "min":
|
|
122
|
-
if (refs.target === "jsonSchema7") {
|
|
123
|
-
if (check.inclusive) {
|
|
124
|
-
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
125
|
-
} else {
|
|
126
|
-
setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
if (!check.inclusive) {
|
|
130
|
-
res.exclusiveMinimum = true;
|
|
131
|
-
}
|
|
132
|
-
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
case "max":
|
|
136
|
-
if (refs.target === "jsonSchema7") {
|
|
137
|
-
if (check.inclusive) {
|
|
138
|
-
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
139
|
-
} else {
|
|
140
|
-
setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
|
|
141
|
-
}
|
|
142
|
-
} else {
|
|
143
|
-
if (!check.inclusive) {
|
|
144
|
-
res.exclusiveMaximum = true;
|
|
145
|
-
}
|
|
146
|
-
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
147
|
-
}
|
|
148
|
-
break;
|
|
149
|
-
case "multipleOf":
|
|
150
|
-
setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return res;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
158
|
-
function parseBooleanDef() {
|
|
159
|
-
return {
|
|
160
|
-
type: "boolean"
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
165
|
-
function parseBrandedDef(_def, refs) {
|
|
166
|
-
return parseDef(_def.type._def, refs);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
170
|
-
var parseCatchDef = (def, refs) => {
|
|
171
|
-
return parseDef(def.innerType._def, refs);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
175
|
-
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
176
|
-
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
177
|
-
if (Array.isArray(strategy)) {
|
|
178
|
-
return {
|
|
179
|
-
anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
switch (strategy) {
|
|
183
|
-
case "string":
|
|
184
|
-
case "format:date-time":
|
|
185
|
-
return {
|
|
186
|
-
type: "string",
|
|
187
|
-
format: "date-time"
|
|
188
|
-
};
|
|
189
|
-
case "format:date":
|
|
190
|
-
return {
|
|
191
|
-
type: "string",
|
|
192
|
-
format: "date"
|
|
193
|
-
};
|
|
194
|
-
case "integer":
|
|
195
|
-
return integerDateParser(def, refs);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
var integerDateParser = (def, refs) => {
|
|
199
|
-
const res = {
|
|
200
|
-
type: "integer",
|
|
201
|
-
format: "unix-time"
|
|
202
|
-
};
|
|
203
|
-
if (refs.target === "openApi3") {
|
|
204
|
-
return res;
|
|
205
|
-
}
|
|
206
|
-
for (const check of def.checks) {
|
|
207
|
-
switch (check.kind) {
|
|
208
|
-
case "min":
|
|
209
|
-
setResponseValueAndErrors(
|
|
210
|
-
res,
|
|
211
|
-
"minimum",
|
|
212
|
-
check.value,
|
|
213
|
-
// This is in milliseconds
|
|
214
|
-
check.message,
|
|
215
|
-
refs
|
|
216
|
-
);
|
|
217
|
-
break;
|
|
218
|
-
case "max":
|
|
219
|
-
setResponseValueAndErrors(
|
|
220
|
-
res,
|
|
221
|
-
"maximum",
|
|
222
|
-
check.value,
|
|
223
|
-
// This is in milliseconds
|
|
224
|
-
check.message,
|
|
225
|
-
refs
|
|
226
|
-
);
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return res;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
234
|
-
function parseDefaultDef(_def, refs) {
|
|
235
|
-
return {
|
|
236
|
-
...parseDef(_def.innerType._def, refs),
|
|
237
|
-
default: _def.defaultValue()
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
242
|
-
function parseEffectsDef(_def, refs) {
|
|
243
|
-
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
247
|
-
function parseEnumDef(def) {
|
|
248
|
-
return {
|
|
249
|
-
type: "string",
|
|
250
|
-
enum: Array.from(def.values)
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
255
|
-
var isJsonSchema7AllOfType = (type) => {
|
|
256
|
-
if ("type" in type && type.type === "string")
|
|
257
|
-
return false;
|
|
258
|
-
return "allOf" in type;
|
|
259
|
-
};
|
|
260
|
-
function parseIntersectionDef(def, refs) {
|
|
261
|
-
const allOf = [
|
|
262
|
-
parseDef(def.left._def, {
|
|
263
|
-
...refs,
|
|
264
|
-
currentPath: [...refs.currentPath, "allOf", "0"]
|
|
265
|
-
}),
|
|
266
|
-
parseDef(def.right._def, {
|
|
267
|
-
...refs,
|
|
268
|
-
currentPath: [...refs.currentPath, "allOf", "1"]
|
|
269
|
-
})
|
|
270
|
-
].filter((x) => !!x);
|
|
271
|
-
let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
|
|
272
|
-
const mergedAllOf = [];
|
|
273
|
-
allOf.forEach((schema) => {
|
|
274
|
-
if (isJsonSchema7AllOfType(schema)) {
|
|
275
|
-
mergedAllOf.push(...schema.allOf);
|
|
276
|
-
if (schema.unevaluatedProperties === void 0) {
|
|
277
|
-
unevaluatedProperties = void 0;
|
|
278
|
-
}
|
|
279
|
-
} else {
|
|
280
|
-
let nestedSchema = schema;
|
|
281
|
-
if ("additionalProperties" in schema && schema.additionalProperties === false) {
|
|
282
|
-
const { additionalProperties, ...rest } = schema;
|
|
283
|
-
nestedSchema = rest;
|
|
284
|
-
} else {
|
|
285
|
-
unevaluatedProperties = void 0;
|
|
286
|
-
}
|
|
287
|
-
mergedAllOf.push(nestedSchema);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
return mergedAllOf.length ? {
|
|
291
|
-
allOf: mergedAllOf,
|
|
292
|
-
...unevaluatedProperties
|
|
293
|
-
} : void 0;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
297
|
-
function parseLiteralDef(def, refs) {
|
|
298
|
-
const parsedType = typeof def.value;
|
|
299
|
-
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
300
|
-
return {
|
|
301
|
-
type: Array.isArray(def.value) ? "array" : "object"
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
if (refs.target === "openApi3") {
|
|
305
|
-
return {
|
|
306
|
-
type: parsedType === "bigint" ? "integer" : parsedType,
|
|
307
|
-
enum: [def.value]
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
return {
|
|
311
|
-
type: parsedType === "bigint" ? "integer" : parsedType,
|
|
312
|
-
const: def.value
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
317
|
-
var emojiRegex = void 0;
|
|
318
|
-
var zodPatterns = {
|
|
319
|
-
/**
|
|
320
|
-
* `c` was changed to `[cC]` to replicate /i flag
|
|
321
|
-
*/
|
|
322
|
-
cuid: /^[cC][^\s-]{8,}$/,
|
|
323
|
-
cuid2: /^[0-9a-z]+$/,
|
|
324
|
-
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
325
|
-
/**
|
|
326
|
-
* `a-z` was added to replicate /i flag
|
|
327
|
-
*/
|
|
328
|
-
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
329
|
-
/**
|
|
330
|
-
* Constructed a valid Unicode RegExp
|
|
331
|
-
*
|
|
332
|
-
* Lazily instantiate since this type of regex isn't supported
|
|
333
|
-
* in all envs (e.g. React Native).
|
|
334
|
-
*
|
|
335
|
-
* See:
|
|
336
|
-
* https://github.com/colinhacks/zod/issues/2433
|
|
337
|
-
* Fix in Zod:
|
|
338
|
-
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
339
|
-
*/
|
|
340
|
-
emoji: () => {
|
|
341
|
-
if (emojiRegex === void 0) {
|
|
342
|
-
emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
|
|
343
|
-
}
|
|
344
|
-
return emojiRegex;
|
|
345
|
-
},
|
|
346
|
-
/**
|
|
347
|
-
* Unused
|
|
348
|
-
*/
|
|
349
|
-
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
350
|
-
/**
|
|
351
|
-
* Unused
|
|
352
|
-
*/
|
|
353
|
-
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
354
|
-
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
355
|
-
/**
|
|
356
|
-
* Unused
|
|
357
|
-
*/
|
|
358
|
-
ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
|
|
359
|
-
ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
|
|
360
|
-
base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
361
|
-
base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
362
|
-
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
363
|
-
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
364
|
-
};
|
|
365
|
-
function parseStringDef(def, refs) {
|
|
366
|
-
const res = {
|
|
367
|
-
type: "string"
|
|
368
|
-
};
|
|
369
|
-
if (def.checks) {
|
|
370
|
-
for (const check of def.checks) {
|
|
371
|
-
switch (check.kind) {
|
|
372
|
-
case "min":
|
|
373
|
-
setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
374
|
-
break;
|
|
375
|
-
case "max":
|
|
376
|
-
setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
377
|
-
break;
|
|
378
|
-
case "email":
|
|
379
|
-
switch (refs.emailStrategy) {
|
|
380
|
-
case "format:email":
|
|
381
|
-
addFormat(res, "email", check.message, refs);
|
|
382
|
-
break;
|
|
383
|
-
case "format:idn-email":
|
|
384
|
-
addFormat(res, "idn-email", check.message, refs);
|
|
385
|
-
break;
|
|
386
|
-
case "pattern:zod":
|
|
387
|
-
addPattern(res, zodPatterns.email, check.message, refs);
|
|
388
|
-
break;
|
|
389
|
-
}
|
|
390
|
-
break;
|
|
391
|
-
case "url":
|
|
392
|
-
addFormat(res, "uri", check.message, refs);
|
|
393
|
-
break;
|
|
394
|
-
case "uuid":
|
|
395
|
-
addFormat(res, "uuid", check.message, refs);
|
|
396
|
-
break;
|
|
397
|
-
case "regex":
|
|
398
|
-
addPattern(res, check.regex, check.message, refs);
|
|
399
|
-
break;
|
|
400
|
-
case "cuid":
|
|
401
|
-
addPattern(res, zodPatterns.cuid, check.message, refs);
|
|
402
|
-
break;
|
|
403
|
-
case "cuid2":
|
|
404
|
-
addPattern(res, zodPatterns.cuid2, check.message, refs);
|
|
405
|
-
break;
|
|
406
|
-
case "startsWith":
|
|
407
|
-
addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
|
|
408
|
-
break;
|
|
409
|
-
case "endsWith":
|
|
410
|
-
addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
|
|
411
|
-
break;
|
|
412
|
-
case "datetime":
|
|
413
|
-
addFormat(res, "date-time", check.message, refs);
|
|
414
|
-
break;
|
|
415
|
-
case "date":
|
|
416
|
-
addFormat(res, "date", check.message, refs);
|
|
417
|
-
break;
|
|
418
|
-
case "time":
|
|
419
|
-
addFormat(res, "time", check.message, refs);
|
|
420
|
-
break;
|
|
421
|
-
case "duration":
|
|
422
|
-
addFormat(res, "duration", check.message, refs);
|
|
423
|
-
break;
|
|
424
|
-
case "length":
|
|
425
|
-
setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
426
|
-
setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
427
|
-
break;
|
|
428
|
-
case "includes": {
|
|
429
|
-
addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
|
|
430
|
-
break;
|
|
431
|
-
}
|
|
432
|
-
case "ip": {
|
|
433
|
-
if (check.version !== "v6") {
|
|
434
|
-
addFormat(res, "ipv4", check.message, refs);
|
|
435
|
-
}
|
|
436
|
-
if (check.version !== "v4") {
|
|
437
|
-
addFormat(res, "ipv6", check.message, refs);
|
|
438
|
-
}
|
|
439
|
-
break;
|
|
440
|
-
}
|
|
441
|
-
case "base64url":
|
|
442
|
-
addPattern(res, zodPatterns.base64url, check.message, refs);
|
|
443
|
-
break;
|
|
444
|
-
case "jwt":
|
|
445
|
-
addPattern(res, zodPatterns.jwt, check.message, refs);
|
|
446
|
-
break;
|
|
447
|
-
case "cidr": {
|
|
448
|
-
if (check.version !== "v6") {
|
|
449
|
-
addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
|
|
450
|
-
}
|
|
451
|
-
if (check.version !== "v4") {
|
|
452
|
-
addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
|
|
453
|
-
}
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
case "emoji":
|
|
457
|
-
addPattern(res, zodPatterns.emoji(), check.message, refs);
|
|
458
|
-
break;
|
|
459
|
-
case "ulid": {
|
|
460
|
-
addPattern(res, zodPatterns.ulid, check.message, refs);
|
|
461
|
-
break;
|
|
462
|
-
}
|
|
463
|
-
case "base64": {
|
|
464
|
-
switch (refs.base64Strategy) {
|
|
465
|
-
case "format:binary": {
|
|
466
|
-
addFormat(res, "binary", check.message, refs);
|
|
467
|
-
break;
|
|
468
|
-
}
|
|
469
|
-
case "contentEncoding:base64": {
|
|
470
|
-
setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
case "pattern:zod": {
|
|
474
|
-
addPattern(res, zodPatterns.base64, check.message, refs);
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
break;
|
|
479
|
-
}
|
|
480
|
-
case "nanoid": {
|
|
481
|
-
addPattern(res, zodPatterns.nanoid, check.message, refs);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
return res;
|
|
487
|
-
}
|
|
488
|
-
function escapeLiteralCheckValue(literal2, refs) {
|
|
489
|
-
return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal2) : literal2;
|
|
490
|
-
}
|
|
491
|
-
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
492
|
-
function escapeNonAlphaNumeric(source) {
|
|
493
|
-
let result = "";
|
|
494
|
-
for (let i = 0; i < source.length; i++) {
|
|
495
|
-
if (!ALPHA_NUMERIC.has(source[i])) {
|
|
496
|
-
result += "\\";
|
|
497
|
-
}
|
|
498
|
-
result += source[i];
|
|
499
|
-
}
|
|
500
|
-
return result;
|
|
501
|
-
}
|
|
502
|
-
function addFormat(schema, value, message, refs) {
|
|
503
|
-
if (schema.format || schema.anyOf?.some((x) => x.format)) {
|
|
504
|
-
if (!schema.anyOf) {
|
|
505
|
-
schema.anyOf = [];
|
|
506
|
-
}
|
|
507
|
-
if (schema.format) {
|
|
508
|
-
schema.anyOf.push({
|
|
509
|
-
format: schema.format,
|
|
510
|
-
...schema.errorMessage && refs.errorMessages && {
|
|
511
|
-
errorMessage: { format: schema.errorMessage.format }
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
delete schema.format;
|
|
515
|
-
if (schema.errorMessage) {
|
|
516
|
-
delete schema.errorMessage.format;
|
|
517
|
-
if (Object.keys(schema.errorMessage).length === 0) {
|
|
518
|
-
delete schema.errorMessage;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
schema.anyOf.push({
|
|
523
|
-
format: value,
|
|
524
|
-
...message && refs.errorMessages && { errorMessage: { format: message } }
|
|
525
|
-
});
|
|
526
|
-
} else {
|
|
527
|
-
setResponseValueAndErrors(schema, "format", value, message, refs);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
function addPattern(schema, regex, message, refs) {
|
|
531
|
-
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
532
|
-
if (!schema.allOf) {
|
|
533
|
-
schema.allOf = [];
|
|
534
|
-
}
|
|
535
|
-
if (schema.pattern) {
|
|
536
|
-
schema.allOf.push({
|
|
537
|
-
pattern: schema.pattern,
|
|
538
|
-
...schema.errorMessage && refs.errorMessages && {
|
|
539
|
-
errorMessage: { pattern: schema.errorMessage.pattern }
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
delete schema.pattern;
|
|
543
|
-
if (schema.errorMessage) {
|
|
544
|
-
delete schema.errorMessage.pattern;
|
|
545
|
-
if (Object.keys(schema.errorMessage).length === 0) {
|
|
546
|
-
delete schema.errorMessage;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
schema.allOf.push({
|
|
551
|
-
pattern: stringifyRegExpWithFlags(regex, refs),
|
|
552
|
-
...message && refs.errorMessages && { errorMessage: { pattern: message } }
|
|
553
|
-
});
|
|
554
|
-
} else {
|
|
555
|
-
setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function stringifyRegExpWithFlags(regex, refs) {
|
|
559
|
-
if (!refs.applyRegexFlags || !regex.flags) {
|
|
560
|
-
return regex.source;
|
|
561
|
-
}
|
|
562
|
-
const flags = {
|
|
563
|
-
i: regex.flags.includes("i"),
|
|
564
|
-
m: regex.flags.includes("m"),
|
|
565
|
-
s: regex.flags.includes("s")
|
|
566
|
-
// `.` matches newlines
|
|
567
|
-
};
|
|
568
|
-
const source = flags.i ? regex.source.toLowerCase() : regex.source;
|
|
569
|
-
let pattern = "";
|
|
570
|
-
let isEscaped = false;
|
|
571
|
-
let inCharGroup = false;
|
|
572
|
-
let inCharRange = false;
|
|
573
|
-
for (let i = 0; i < source.length; i++) {
|
|
574
|
-
if (isEscaped) {
|
|
575
|
-
pattern += source[i];
|
|
576
|
-
isEscaped = false;
|
|
577
|
-
continue;
|
|
578
|
-
}
|
|
579
|
-
if (flags.i) {
|
|
580
|
-
if (inCharGroup) {
|
|
581
|
-
if (source[i].match(/[a-z]/)) {
|
|
582
|
-
if (inCharRange) {
|
|
583
|
-
pattern += source[i];
|
|
584
|
-
pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
|
|
585
|
-
inCharRange = false;
|
|
586
|
-
} else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
|
|
587
|
-
pattern += source[i];
|
|
588
|
-
inCharRange = true;
|
|
589
|
-
} else {
|
|
590
|
-
pattern += `${source[i]}${source[i].toUpperCase()}`;
|
|
591
|
-
}
|
|
592
|
-
continue;
|
|
593
|
-
}
|
|
594
|
-
} else if (source[i].match(/[a-z]/)) {
|
|
595
|
-
pattern += `[${source[i]}${source[i].toUpperCase()}]`;
|
|
596
|
-
continue;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
if (flags.m) {
|
|
600
|
-
if (source[i] === "^") {
|
|
601
|
-
pattern += `(^|(?<=[\r
|
|
602
|
-
]))`;
|
|
603
|
-
continue;
|
|
604
|
-
} else if (source[i] === "$") {
|
|
605
|
-
pattern += `($|(?=[\r
|
|
606
|
-
]))`;
|
|
607
|
-
continue;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
if (flags.s && source[i] === ".") {
|
|
611
|
-
pattern += inCharGroup ? `${source[i]}\r
|
|
612
|
-
` : `[${source[i]}\r
|
|
613
|
-
]`;
|
|
614
|
-
continue;
|
|
615
|
-
}
|
|
616
|
-
pattern += source[i];
|
|
617
|
-
if (source[i] === "\\") {
|
|
618
|
-
isEscaped = true;
|
|
619
|
-
} else if (inCharGroup && source[i] === "]") {
|
|
620
|
-
inCharGroup = false;
|
|
621
|
-
} else if (!inCharGroup && source[i] === "[") {
|
|
622
|
-
inCharGroup = true;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
try {
|
|
626
|
-
new RegExp(pattern);
|
|
627
|
-
} catch {
|
|
628
|
-
console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
|
|
629
|
-
return regex.source;
|
|
630
|
-
}
|
|
631
|
-
return pattern;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
635
|
-
function parseRecordDef(def, refs) {
|
|
636
|
-
if (refs.target === "openAi") {
|
|
637
|
-
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
638
|
-
}
|
|
639
|
-
if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
640
|
-
return {
|
|
641
|
-
type: "object",
|
|
642
|
-
required: def.keyType._def.values,
|
|
643
|
-
properties: def.keyType._def.values.reduce((acc, key) => ({
|
|
644
|
-
...acc,
|
|
645
|
-
[key]: parseDef(def.valueType._def, {
|
|
646
|
-
...refs,
|
|
647
|
-
currentPath: [...refs.currentPath, "properties", key]
|
|
648
|
-
}) ?? {}
|
|
649
|
-
}), {}),
|
|
650
|
-
additionalProperties: false
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
const schema = {
|
|
654
|
-
type: "object",
|
|
655
|
-
additionalProperties: parseDef(def.valueType._def, {
|
|
656
|
-
...refs,
|
|
657
|
-
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
658
|
-
}) ?? {}
|
|
659
|
-
};
|
|
660
|
-
if (refs.target === "openApi3") {
|
|
661
|
-
return schema;
|
|
662
|
-
}
|
|
663
|
-
if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
664
|
-
const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
|
|
665
|
-
return {
|
|
666
|
-
...schema,
|
|
667
|
-
propertyNames: keyType
|
|
668
|
-
};
|
|
669
|
-
} else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
670
|
-
return {
|
|
671
|
-
...schema,
|
|
672
|
-
propertyNames: {
|
|
673
|
-
enum: def.keyType._def.values
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
} else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
677
|
-
const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
|
|
678
|
-
return {
|
|
679
|
-
...schema,
|
|
680
|
-
propertyNames: keyType
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
return schema;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
687
|
-
function parseMapDef(def, refs) {
|
|
688
|
-
if (refs.mapStrategy === "record") {
|
|
689
|
-
return parseRecordDef(def, refs);
|
|
690
|
-
}
|
|
691
|
-
const keys = parseDef(def.keyType._def, {
|
|
692
|
-
...refs,
|
|
693
|
-
currentPath: [...refs.currentPath, "items", "items", "0"]
|
|
694
|
-
}) || {};
|
|
695
|
-
const values = parseDef(def.valueType._def, {
|
|
696
|
-
...refs,
|
|
697
|
-
currentPath: [...refs.currentPath, "items", "items", "1"]
|
|
698
|
-
}) || {};
|
|
699
|
-
return {
|
|
700
|
-
type: "array",
|
|
701
|
-
maxItems: 125,
|
|
702
|
-
items: {
|
|
703
|
-
type: "array",
|
|
704
|
-
items: [keys, values],
|
|
705
|
-
minItems: 2,
|
|
706
|
-
maxItems: 2
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
712
|
-
function parseNativeEnumDef(def) {
|
|
713
|
-
const object = def.values;
|
|
714
|
-
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
715
|
-
return typeof object[object[key]] !== "number";
|
|
716
|
-
});
|
|
717
|
-
const actualValues = actualKeys.map((key) => object[key]);
|
|
718
|
-
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
719
|
-
return {
|
|
720
|
-
type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
721
|
-
enum: actualValues
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
726
|
-
function parseNeverDef() {
|
|
727
|
-
return {
|
|
728
|
-
not: {}
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
733
|
-
function parseNullDef(refs) {
|
|
734
|
-
return refs.target === "openApi3" ? {
|
|
735
|
-
enum: ["null"],
|
|
736
|
-
nullable: true
|
|
737
|
-
} : {
|
|
738
|
-
type: "null"
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
743
|
-
var primitiveMappings = {
|
|
744
|
-
ZodString: "string",
|
|
745
|
-
ZodNumber: "number",
|
|
746
|
-
ZodBigInt: "integer",
|
|
747
|
-
ZodBoolean: "boolean",
|
|
748
|
-
ZodNull: "null"
|
|
749
|
-
};
|
|
750
|
-
function parseUnionDef(def, refs) {
|
|
751
|
-
if (refs.target === "openApi3")
|
|
752
|
-
return asAnyOf(def, refs);
|
|
753
|
-
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
754
|
-
if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
|
|
755
|
-
const types2 = options.reduce((types3, x) => {
|
|
756
|
-
const type = primitiveMappings[x._def.typeName];
|
|
757
|
-
return type && !types3.includes(type) ? [...types3, type] : types3;
|
|
758
|
-
}, []);
|
|
759
|
-
return {
|
|
760
|
-
type: types2.length > 1 ? types2 : types2[0]
|
|
761
|
-
};
|
|
762
|
-
} else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
|
|
763
|
-
const types2 = options.reduce((acc, x) => {
|
|
764
|
-
const type = typeof x._def.value;
|
|
765
|
-
switch (type) {
|
|
766
|
-
case "string":
|
|
767
|
-
case "number":
|
|
768
|
-
case "boolean":
|
|
769
|
-
return [...acc, type];
|
|
770
|
-
case "bigint":
|
|
771
|
-
return [...acc, "integer"];
|
|
772
|
-
case "object":
|
|
773
|
-
if (x._def.value === null)
|
|
774
|
-
return [...acc, "null"];
|
|
775
|
-
case "symbol":
|
|
776
|
-
case "undefined":
|
|
777
|
-
case "function":
|
|
778
|
-
default:
|
|
779
|
-
return acc;
|
|
780
|
-
}
|
|
781
|
-
}, []);
|
|
782
|
-
if (types2.length === options.length) {
|
|
783
|
-
const uniqueTypes = types2.filter((x, i, a) => a.indexOf(x) === i);
|
|
784
|
-
return {
|
|
785
|
-
type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
|
|
786
|
-
enum: options.reduce((acc, x) => {
|
|
787
|
-
return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
|
|
788
|
-
}, [])
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
} else if (options.every((x) => x._def.typeName === "ZodEnum")) {
|
|
792
|
-
return {
|
|
793
|
-
type: "string",
|
|
794
|
-
enum: options.reduce((acc, x) => [
|
|
795
|
-
...acc,
|
|
796
|
-
...x._def.values.filter((x2) => !acc.includes(x2))
|
|
797
|
-
], [])
|
|
798
|
-
};
|
|
799
|
-
}
|
|
800
|
-
return asAnyOf(def, refs);
|
|
801
|
-
}
|
|
802
|
-
var asAnyOf = (def, refs) => {
|
|
803
|
-
const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
|
|
804
|
-
...refs,
|
|
805
|
-
currentPath: [...refs.currentPath, "anyOf", `${i}`]
|
|
806
|
-
})).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
|
|
807
|
-
return anyOf.length ? { anyOf } : void 0;
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
811
|
-
function parseNullableDef(def, refs) {
|
|
812
|
-
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
813
|
-
if (refs.target === "openApi3") {
|
|
814
|
-
return {
|
|
815
|
-
type: primitiveMappings[def.innerType._def.typeName],
|
|
816
|
-
nullable: true
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
return {
|
|
820
|
-
type: [
|
|
821
|
-
primitiveMappings[def.innerType._def.typeName],
|
|
822
|
-
"null"
|
|
823
|
-
]
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
if (refs.target === "openApi3") {
|
|
827
|
-
const base3 = parseDef(def.innerType._def, {
|
|
828
|
-
...refs,
|
|
829
|
-
currentPath: [...refs.currentPath]
|
|
830
|
-
});
|
|
831
|
-
if (base3 && "$ref" in base3)
|
|
832
|
-
return { allOf: [base3], nullable: true };
|
|
833
|
-
return base3 && { ...base3, nullable: true };
|
|
834
|
-
}
|
|
835
|
-
const base2 = parseDef(def.innerType._def, {
|
|
836
|
-
...refs,
|
|
837
|
-
currentPath: [...refs.currentPath, "anyOf", "0"]
|
|
838
|
-
});
|
|
839
|
-
return base2 && { anyOf: [base2, { type: "null" }] };
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
843
|
-
function parseNumberDef(def, refs) {
|
|
844
|
-
const res = {
|
|
845
|
-
type: "number"
|
|
846
|
-
};
|
|
847
|
-
if (!def.checks)
|
|
848
|
-
return res;
|
|
849
|
-
for (const check of def.checks) {
|
|
850
|
-
switch (check.kind) {
|
|
851
|
-
case "int":
|
|
852
|
-
res.type = "integer";
|
|
853
|
-
addErrorMessage(res, "type", check.message, refs);
|
|
854
|
-
break;
|
|
855
|
-
case "min":
|
|
856
|
-
if (refs.target === "jsonSchema7") {
|
|
857
|
-
if (check.inclusive) {
|
|
858
|
-
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
859
|
-
} else {
|
|
860
|
-
setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
|
|
861
|
-
}
|
|
862
|
-
} else {
|
|
863
|
-
if (!check.inclusive) {
|
|
864
|
-
res.exclusiveMinimum = true;
|
|
865
|
-
}
|
|
866
|
-
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
867
|
-
}
|
|
868
|
-
break;
|
|
869
|
-
case "max":
|
|
870
|
-
if (refs.target === "jsonSchema7") {
|
|
871
|
-
if (check.inclusive) {
|
|
872
|
-
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
873
|
-
} else {
|
|
874
|
-
setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
|
|
875
|
-
}
|
|
876
|
-
} else {
|
|
877
|
-
if (!check.inclusive) {
|
|
878
|
-
res.exclusiveMaximum = true;
|
|
879
|
-
}
|
|
880
|
-
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
881
|
-
}
|
|
882
|
-
break;
|
|
883
|
-
case "multipleOf":
|
|
884
|
-
setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
|
|
885
|
-
break;
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
return res;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
892
|
-
function decideAdditionalProperties(def, refs) {
|
|
893
|
-
if (refs.removeAdditionalStrategy === "strict") {
|
|
894
|
-
return def.catchall._def.typeName === "ZodNever" ? def.unknownKeys !== "strict" : parseDef(def.catchall._def, {
|
|
895
|
-
...refs,
|
|
896
|
-
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
897
|
-
}) ?? true;
|
|
898
|
-
} else {
|
|
899
|
-
return def.catchall._def.typeName === "ZodNever" ? def.unknownKeys === "passthrough" : parseDef(def.catchall._def, {
|
|
900
|
-
...refs,
|
|
901
|
-
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
902
|
-
}) ?? true;
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
function parseObjectDef(def, refs) {
|
|
906
|
-
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
907
|
-
const result = {
|
|
908
|
-
type: "object",
|
|
909
|
-
...Object.entries(def.shape()).reduce((acc, [propName, propDef]) => {
|
|
910
|
-
if (propDef === void 0 || propDef._def === void 0)
|
|
911
|
-
return acc;
|
|
912
|
-
let propOptional = propDef.isOptional();
|
|
913
|
-
if (propOptional && forceOptionalIntoNullable) {
|
|
914
|
-
if (propDef instanceof ZodOptional) {
|
|
915
|
-
propDef = propDef._def.innerType;
|
|
916
|
-
}
|
|
917
|
-
if (!propDef.isNullable()) {
|
|
918
|
-
propDef = propDef.nullable();
|
|
919
|
-
}
|
|
920
|
-
propOptional = false;
|
|
921
|
-
}
|
|
922
|
-
const parsedDef = parseDef(propDef._def, {
|
|
923
|
-
...refs,
|
|
924
|
-
currentPath: [...refs.currentPath, "properties", propName],
|
|
925
|
-
propertyPath: [...refs.currentPath, "properties", propName]
|
|
926
|
-
});
|
|
927
|
-
if (parsedDef === void 0)
|
|
928
|
-
return acc;
|
|
929
|
-
return {
|
|
930
|
-
properties: { ...acc.properties, [propName]: parsedDef },
|
|
931
|
-
required: propOptional ? acc.required : [...acc.required, propName]
|
|
932
|
-
};
|
|
933
|
-
}, { properties: {}, required: [] }),
|
|
934
|
-
additionalProperties: decideAdditionalProperties(def, refs)
|
|
935
|
-
};
|
|
936
|
-
if (!result.required.length)
|
|
937
|
-
delete result.required;
|
|
938
|
-
return result;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
942
|
-
var parseOptionalDef = (def, refs) => {
|
|
943
|
-
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
944
|
-
return parseDef(def.innerType._def, refs);
|
|
945
|
-
}
|
|
946
|
-
const innerSchema = parseDef(def.innerType._def, {
|
|
947
|
-
...refs,
|
|
948
|
-
currentPath: [...refs.currentPath, "anyOf", "1"]
|
|
949
|
-
});
|
|
950
|
-
return innerSchema ? {
|
|
951
|
-
anyOf: [
|
|
952
|
-
{
|
|
953
|
-
not: {}
|
|
954
|
-
},
|
|
955
|
-
innerSchema
|
|
956
|
-
]
|
|
957
|
-
} : {};
|
|
958
|
-
};
|
|
959
|
-
|
|
960
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
961
|
-
var parsePipelineDef = (def, refs) => {
|
|
962
|
-
if (refs.pipeStrategy === "input") {
|
|
963
|
-
return parseDef(def.in._def, refs);
|
|
964
|
-
} else if (refs.pipeStrategy === "output") {
|
|
965
|
-
return parseDef(def.out._def, refs);
|
|
966
|
-
}
|
|
967
|
-
const a = parseDef(def.in._def, {
|
|
968
|
-
...refs,
|
|
969
|
-
currentPath: [...refs.currentPath, "allOf", "0"]
|
|
970
|
-
});
|
|
971
|
-
const b = parseDef(def.out._def, {
|
|
972
|
-
...refs,
|
|
973
|
-
currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
|
|
974
|
-
});
|
|
975
|
-
return {
|
|
976
|
-
allOf: [a, b].filter((x) => x !== void 0)
|
|
977
|
-
};
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
981
|
-
function parsePromiseDef(def, refs) {
|
|
982
|
-
return parseDef(def.type._def, refs);
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
986
|
-
function parseSetDef(def, refs) {
|
|
987
|
-
const items = parseDef(def.valueType._def, {
|
|
988
|
-
...refs,
|
|
989
|
-
currentPath: [...refs.currentPath, "items"]
|
|
990
|
-
});
|
|
991
|
-
const schema = {
|
|
992
|
-
type: "array",
|
|
993
|
-
uniqueItems: true,
|
|
994
|
-
items
|
|
995
|
-
};
|
|
996
|
-
if (def.minSize) {
|
|
997
|
-
setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
|
|
998
|
-
}
|
|
999
|
-
if (def.maxSize) {
|
|
1000
|
-
setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
|
|
1001
|
-
}
|
|
1002
|
-
return schema;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
1006
|
-
function parseTupleDef(def, refs) {
|
|
1007
|
-
if (def.rest) {
|
|
1008
|
-
return {
|
|
1009
|
-
type: "array",
|
|
1010
|
-
minItems: def.items.length,
|
|
1011
|
-
items: def.items.map((x, i) => parseDef(x._def, {
|
|
1012
|
-
...refs,
|
|
1013
|
-
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
1014
|
-
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
|
|
1015
|
-
additionalItems: parseDef(def.rest._def, {
|
|
1016
|
-
...refs,
|
|
1017
|
-
currentPath: [...refs.currentPath, "additionalItems"]
|
|
1018
|
-
})
|
|
1019
|
-
};
|
|
1020
|
-
} else {
|
|
1021
|
-
return {
|
|
1022
|
-
type: "array",
|
|
1023
|
-
minItems: def.items.length,
|
|
1024
|
-
maxItems: def.items.length,
|
|
1025
|
-
items: def.items.map((x, i) => parseDef(x._def, {
|
|
1026
|
-
...refs,
|
|
1027
|
-
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
1028
|
-
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
|
|
1029
|
-
};
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
1034
|
-
function parseUndefinedDef() {
|
|
1035
|
-
return {
|
|
1036
|
-
not: {}
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
1041
|
-
function parseUnknownDef() {
|
|
1042
|
-
return {};
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
1046
|
-
var parseReadonlyDef = (def, refs) => {
|
|
1047
|
-
return parseDef(def.innerType._def, refs);
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
1051
|
-
function parseDef(def, refs, forceResolution = false) {
|
|
1052
|
-
const seenItem = refs.seen.get(def);
|
|
1053
|
-
if (refs.override) {
|
|
1054
|
-
const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
|
|
1055
|
-
if (overrideResult !== ignoreOverride) {
|
|
1056
|
-
return overrideResult;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
if (seenItem && !forceResolution) {
|
|
1060
|
-
const seenSchema = get$ref(seenItem, refs);
|
|
1061
|
-
if (seenSchema !== void 0) {
|
|
1062
|
-
return seenSchema;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
|
|
1066
|
-
refs.seen.set(def, newItem);
|
|
1067
|
-
const jsonSchema = selectParser(def, def.typeName, refs);
|
|
1068
|
-
if (jsonSchema) {
|
|
1069
|
-
addMeta(def, refs, jsonSchema);
|
|
1070
|
-
}
|
|
1071
|
-
newItem.jsonSchema = jsonSchema;
|
|
1072
|
-
return jsonSchema;
|
|
1073
|
-
}
|
|
1074
|
-
var get$ref = (item, refs) => {
|
|
1075
|
-
switch (refs.$refStrategy) {
|
|
1076
|
-
case "root":
|
|
1077
|
-
return { $ref: item.path.join("/") };
|
|
1078
|
-
case "relative":
|
|
1079
|
-
return { $ref: getRelativePath(refs.currentPath, item.path) };
|
|
1080
|
-
case "none":
|
|
1081
|
-
case "seen": {
|
|
1082
|
-
if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
|
|
1083
|
-
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
|
|
1084
|
-
return {};
|
|
1085
|
-
}
|
|
1086
|
-
return refs.$refStrategy === "seen" ? {} : void 0;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
};
|
|
1090
|
-
var getRelativePath = (pathA, pathB) => {
|
|
1091
|
-
let i = 0;
|
|
1092
|
-
for (; i < pathA.length && i < pathB.length; i++) {
|
|
1093
|
-
if (pathA[i] !== pathB[i])
|
|
1094
|
-
break;
|
|
1095
|
-
}
|
|
1096
|
-
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
1097
|
-
};
|
|
1098
|
-
var selectParser = (def, typeName, refs) => {
|
|
1099
|
-
switch (typeName) {
|
|
1100
|
-
case ZodFirstPartyTypeKind.ZodString:
|
|
1101
|
-
return parseStringDef(def, refs);
|
|
1102
|
-
case ZodFirstPartyTypeKind.ZodNumber:
|
|
1103
|
-
return parseNumberDef(def, refs);
|
|
1104
|
-
case ZodFirstPartyTypeKind.ZodObject:
|
|
1105
|
-
return parseObjectDef(def, refs);
|
|
1106
|
-
case ZodFirstPartyTypeKind.ZodBigInt:
|
|
1107
|
-
return parseBigintDef(def, refs);
|
|
1108
|
-
case ZodFirstPartyTypeKind.ZodBoolean:
|
|
1109
|
-
return parseBooleanDef();
|
|
1110
|
-
case ZodFirstPartyTypeKind.ZodDate:
|
|
1111
|
-
return parseDateDef(def, refs);
|
|
1112
|
-
case ZodFirstPartyTypeKind.ZodUndefined:
|
|
1113
|
-
return parseUndefinedDef();
|
|
1114
|
-
case ZodFirstPartyTypeKind.ZodNull:
|
|
1115
|
-
return parseNullDef(refs);
|
|
1116
|
-
case ZodFirstPartyTypeKind.ZodArray:
|
|
1117
|
-
return parseArrayDef(def, refs);
|
|
1118
|
-
case ZodFirstPartyTypeKind.ZodUnion:
|
|
1119
|
-
case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
1120
|
-
return parseUnionDef(def, refs);
|
|
1121
|
-
case ZodFirstPartyTypeKind.ZodIntersection:
|
|
1122
|
-
return parseIntersectionDef(def, refs);
|
|
1123
|
-
case ZodFirstPartyTypeKind.ZodTuple:
|
|
1124
|
-
return parseTupleDef(def, refs);
|
|
1125
|
-
case ZodFirstPartyTypeKind.ZodRecord:
|
|
1126
|
-
return parseRecordDef(def, refs);
|
|
1127
|
-
case ZodFirstPartyTypeKind.ZodLiteral:
|
|
1128
|
-
return parseLiteralDef(def, refs);
|
|
1129
|
-
case ZodFirstPartyTypeKind.ZodEnum:
|
|
1130
|
-
return parseEnumDef(def);
|
|
1131
|
-
case ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
1132
|
-
return parseNativeEnumDef(def);
|
|
1133
|
-
case ZodFirstPartyTypeKind.ZodNullable:
|
|
1134
|
-
return parseNullableDef(def, refs);
|
|
1135
|
-
case ZodFirstPartyTypeKind.ZodOptional:
|
|
1136
|
-
return parseOptionalDef(def, refs);
|
|
1137
|
-
case ZodFirstPartyTypeKind.ZodMap:
|
|
1138
|
-
return parseMapDef(def, refs);
|
|
1139
|
-
case ZodFirstPartyTypeKind.ZodSet:
|
|
1140
|
-
return parseSetDef(def, refs);
|
|
1141
|
-
case ZodFirstPartyTypeKind.ZodLazy:
|
|
1142
|
-
return parseDef(def.getter()._def, refs);
|
|
1143
|
-
case ZodFirstPartyTypeKind.ZodPromise:
|
|
1144
|
-
return parsePromiseDef(def, refs);
|
|
1145
|
-
case ZodFirstPartyTypeKind.ZodNaN:
|
|
1146
|
-
case ZodFirstPartyTypeKind.ZodNever:
|
|
1147
|
-
return parseNeverDef();
|
|
1148
|
-
case ZodFirstPartyTypeKind.ZodEffects:
|
|
1149
|
-
return parseEffectsDef(def, refs);
|
|
1150
|
-
case ZodFirstPartyTypeKind.ZodAny:
|
|
1151
|
-
return parseAnyDef();
|
|
1152
|
-
case ZodFirstPartyTypeKind.ZodUnknown:
|
|
1153
|
-
return parseUnknownDef();
|
|
1154
|
-
case ZodFirstPartyTypeKind.ZodDefault:
|
|
1155
|
-
return parseDefaultDef(def, refs);
|
|
1156
|
-
case ZodFirstPartyTypeKind.ZodBranded:
|
|
1157
|
-
return parseBrandedDef(def, refs);
|
|
1158
|
-
case ZodFirstPartyTypeKind.ZodReadonly:
|
|
1159
|
-
return parseReadonlyDef(def, refs);
|
|
1160
|
-
case ZodFirstPartyTypeKind.ZodCatch:
|
|
1161
|
-
return parseCatchDef(def, refs);
|
|
1162
|
-
case ZodFirstPartyTypeKind.ZodPipeline:
|
|
1163
|
-
return parsePipelineDef(def, refs);
|
|
1164
|
-
case ZodFirstPartyTypeKind.ZodFunction:
|
|
1165
|
-
case ZodFirstPartyTypeKind.ZodVoid:
|
|
1166
|
-
case ZodFirstPartyTypeKind.ZodSymbol:
|
|
1167
|
-
return void 0;
|
|
1168
|
-
default:
|
|
1169
|
-
return /* @__PURE__ */ ((_) => void 0)();
|
|
1170
|
-
}
|
|
1171
|
-
};
|
|
1172
|
-
var addMeta = (def, refs, jsonSchema) => {
|
|
1173
|
-
if (def.description) {
|
|
1174
|
-
jsonSchema.description = def.description;
|
|
1175
|
-
if (refs.markdownDescription) {
|
|
1176
|
-
jsonSchema.markdownDescription = def.description;
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
return jsonSchema;
|
|
1180
|
-
};
|
|
1181
|
-
|
|
1182
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
1183
|
-
var zodToJsonSchema = (schema, options) => {
|
|
1184
|
-
const refs = getRefs(options);
|
|
1185
|
-
const definitions = void 0;
|
|
1186
|
-
const name = options?.name;
|
|
1187
|
-
const main = parseDef(schema._def, refs , false) ?? {};
|
|
1188
|
-
const combined = name === void 0 ? definitions ? {
|
|
1189
|
-
...main,
|
|
1190
|
-
[refs.definitionPath]: definitions
|
|
1191
|
-
} : main : {
|
|
1192
|
-
$ref: [
|
|
1193
|
-
...refs.$refStrategy === "relative" ? [] : refs.basePath,
|
|
1194
|
-
refs.definitionPath,
|
|
1195
|
-
name
|
|
1196
|
-
].join("/"),
|
|
1197
|
-
[refs.definitionPath]: {
|
|
1198
|
-
...definitions,
|
|
1199
|
-
[name]: main
|
|
1200
|
-
}
|
|
1201
|
-
};
|
|
1202
|
-
if (refs.target === "jsonSchema7") {
|
|
1203
|
-
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
1204
|
-
} else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
|
|
1205
|
-
combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
|
|
1206
|
-
}
|
|
1207
|
-
if (refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type))) {
|
|
1208
|
-
console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
|
|
1209
|
-
}
|
|
1210
|
-
return combined;
|
|
1211
|
-
};
|
|
1212
18
|
var GRPC_CHANNEL_OPTIONS = {
|
|
1213
19
|
"grpc.keepalive_time_ms": 3e4,
|
|
1214
20
|
"grpc.keepalive_timeout_ms": 1e4,
|
|
@@ -1762,7 +568,7 @@ function getLineInfo(input, offset2) {
|
|
|
1762
568
|
cur = nextBreak;
|
|
1763
569
|
}
|
|
1764
570
|
}
|
|
1765
|
-
var
|
|
571
|
+
var defaultOptions = {
|
|
1766
572
|
// `ecmaVersion` indicates the ECMAScript version to parse. Must be
|
|
1767
573
|
// either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
|
|
1768
574
|
// (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
|
|
@@ -1862,8 +668,8 @@ var defaultOptions2 = {
|
|
|
1862
668
|
var warnedAboutEcmaVersion = false;
|
|
1863
669
|
function getOptions(opts) {
|
|
1864
670
|
var options = {};
|
|
1865
|
-
for (var opt in
|
|
1866
|
-
options[opt] = opts && hasOwn(opts, opt) ? opts[opt] :
|
|
671
|
+
for (var opt in defaultOptions) {
|
|
672
|
+
options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];
|
|
1867
673
|
}
|
|
1868
674
|
if (options.ecmaVersion === "latest") {
|
|
1869
675
|
options.ecmaVersion = 1e8;
|
|
@@ -7128,7 +5934,7 @@ var version = "8.16.0";
|
|
|
7128
5934
|
Parser.acorn = {
|
|
7129
5935
|
Parser,
|
|
7130
5936
|
version,
|
|
7131
|
-
defaultOptions
|
|
5937
|
+
defaultOptions,
|
|
7132
5938
|
Position,
|
|
7133
5939
|
SourceLocation,
|
|
7134
5940
|
getLineInfo,
|
|
@@ -7658,7 +6464,7 @@ ${sourceCode}
|
|
|
7658
6464
|
return;
|
|
7659
6465
|
const fn = callback;
|
|
7660
6466
|
const recordParam = fn.params.length > 1 ? fn.params[1] : fn.params[0];
|
|
7661
|
-
if (
|
|
6467
|
+
if (recordParam?.type !== "Identifier") return;
|
|
7662
6468
|
const paramName = recordParam.name;
|
|
7663
6469
|
const fields = this.extractFieldsFromBody(
|
|
7664
6470
|
fn.body,
|
|
@@ -9032,7 +7838,8 @@ var LiopServer = class _LiopServer {
|
|
|
9032
7838
|
return policy.outputSchema;
|
|
9033
7839
|
}
|
|
9034
7840
|
const obj = policy.outputSchema;
|
|
9035
|
-
|
|
7841
|
+
const def = obj.def || obj._def;
|
|
7842
|
+
if (def && def.catchall !== void 0 && !(def.catchall instanceof external_exports.ZodNever)) {
|
|
9036
7843
|
return obj;
|
|
9037
7844
|
}
|
|
9038
7845
|
return obj.strict();
|
|
@@ -9282,7 +8089,7 @@ var LiopServer = class _LiopServer {
|
|
|
9282
8089
|
throw new Error(`Tool already registered: ${name}`);
|
|
9283
8090
|
}
|
|
9284
8091
|
const schema = external_exports.object(shape);
|
|
9285
|
-
const generatedSchema =
|
|
8092
|
+
const generatedSchema = external_exports.toJSONSchema(schema, { target: "draft-07" });
|
|
9286
8093
|
let finalDescription = description;
|
|
9287
8094
|
let finalHandler = handler;
|
|
9288
8095
|
if (shape.payload && shape.payload instanceof external_exports.ZodString) {
|
|
@@ -10462,5 +9269,5 @@ Data structure: ${schemaDigest}. Full schema: resource ${uri}. Guidelines: resou
|
|
|
10462
9269
|
};
|
|
10463
9270
|
|
|
10464
9271
|
export { AUTH_DEFAULTS, JwtValidator, LiopRpcServer, LiopServer, NerScanner, PII_PATTERNS, PII_PRESETS, PiiScanner, createOAuthServer, sanitizeOutput };
|
|
10465
|
-
//# sourceMappingURL=chunk-
|
|
10466
|
-
//# sourceMappingURL=chunk-
|
|
9272
|
+
//# sourceMappingURL=chunk-KHWULRWJ.js.map
|
|
9273
|
+
//# sourceMappingURL=chunk-KHWULRWJ.js.map
|