@forklaunch/implementation-worker-redis 0.3.3 → 0.3.4
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/lib/consumers/index.d.mts +12 -26
- package/lib/consumers/index.d.ts +12 -26
- package/lib/consumers/index.js +15 -24
- package/lib/consumers/index.mjs +11 -13
- package/lib/domain/schemas/index.d.mts +7 -51
- package/lib/domain/schemas/index.d.ts +7 -51
- package/lib/domain/schemas/index.js +489 -860
- package/lib/domain/schemas/index.mjs +497 -837
- package/lib/domain/types/index.d.mts +3 -3
- package/lib/domain/types/index.d.ts +3 -3
- package/lib/domain/types/index.js +4 -8
- package/lib/eject/domain/schemas/redisWorker.schema.ts +1 -1
- package/lib/producers/index.d.mts +7 -11
- package/lib/producers/index.d.ts +7 -11
- package/lib/producers/index.js +8 -13
- package/lib/producers/index.mjs +4 -2
- package/package.json +1 -1
|
@@ -1,96 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
mod ||
|
|
12
|
-
(0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod),
|
|
13
|
-
mod.exports
|
|
14
|
-
);
|
|
15
|
-
};
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
16
11
|
var __export = (target, all) => {
|
|
17
12
|
for (var name in all)
|
|
18
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
14
|
};
|
|
20
15
|
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
17
|
for (let key of __getOwnPropNames(from))
|
|
23
18
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: () => from[key],
|
|
26
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
27
|
-
});
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
28
20
|
}
|
|
29
21
|
return to;
|
|
30
22
|
};
|
|
31
|
-
var __toESM = (mod, isNodeMode, target) => (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
: target,
|
|
41
|
-
mod
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
var __toCommonJS = (mod) =>
|
|
45
|
-
__copyProps(__defProp({}, '__esModule', { value: true }), mod);
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
32
|
|
|
47
33
|
// ../../../node_modules/.pnpm/ts-deepmerge@6.2.1/node_modules/ts-deepmerge/cjs/index.js
|
|
48
34
|
var require_cjs = __commonJS({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'use strict';
|
|
53
|
-
Object.defineProperty(exports2, '__esModule', { value: true });
|
|
35
|
+
"../../../node_modules/.pnpm/ts-deepmerge@6.2.1/node_modules/ts-deepmerge/cjs/index.js"(exports2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
54
38
|
var isObject = (obj) => {
|
|
55
|
-
if (typeof obj ===
|
|
56
|
-
if (typeof Object.getPrototypeOf ===
|
|
39
|
+
if (typeof obj === "object" && obj !== null) {
|
|
40
|
+
if (typeof Object.getPrototypeOf === "function") {
|
|
57
41
|
const prototype = Object.getPrototypeOf(obj);
|
|
58
42
|
return prototype === Object.prototype || prototype === null;
|
|
59
43
|
}
|
|
60
|
-
return Object.prototype.toString.call(obj) ===
|
|
44
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
61
45
|
}
|
|
62
46
|
return false;
|
|
63
47
|
};
|
|
64
|
-
var merge = (...objects) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
var merge = (...objects) => objects.reduce((result, current) => {
|
|
49
|
+
if (Array.isArray(current)) {
|
|
50
|
+
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
51
|
+
}
|
|
52
|
+
Object.keys(current).forEach((key) => {
|
|
53
|
+
if (["__proto__", "constructor", "prototype"].includes(key)) {
|
|
54
|
+
return;
|
|
70
55
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} else if (isObject(result[key]) && isObject(current[key])) {
|
|
82
|
-
result[key] = merge(result[key], current[key]);
|
|
83
|
-
} else {
|
|
84
|
-
result[key] =
|
|
85
|
-
current[key] === void 0
|
|
86
|
-
? merge.options.allowUndefinedOverrides
|
|
87
|
-
? current[key]
|
|
88
|
-
: result[key]
|
|
89
|
-
: current[key];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
return result;
|
|
93
|
-
}, {});
|
|
56
|
+
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
57
|
+
result[key] = merge.options.mergeArrays ? merge.options.uniqueArrayItems ? Array.from(new Set(result[key].concat(current[key]))) : [...result[key], ...current[key]] : current[key];
|
|
58
|
+
} else if (isObject(result[key]) && isObject(current[key])) {
|
|
59
|
+
result[key] = merge(result[key], current[key]);
|
|
60
|
+
} else {
|
|
61
|
+
result[key] = current[key] === void 0 ? merge.options.allowUndefinedOverrides ? current[key] : result[key] : current[key];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return result;
|
|
65
|
+
}, {});
|
|
94
66
|
var defaultOptions = {
|
|
95
67
|
allowUndefinedOverrides: true,
|
|
96
68
|
mergeArrays: true,
|
|
@@ -109,200 +81,127 @@ var require_cjs = __commonJS({
|
|
|
109
81
|
|
|
110
82
|
// ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/lib/zod-openapi.js
|
|
111
83
|
var require_zod_openapi = __commonJS({
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
'use strict';
|
|
116
|
-
Object.defineProperty(exports2, '__esModule', { value: true });
|
|
84
|
+
"../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/lib/zod-openapi.js"(exports2) {
|
|
85
|
+
"use strict";
|
|
86
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117
87
|
exports2.generateSchema = exports2.extendApi = void 0;
|
|
118
88
|
var ts_deepmerge_1 = require_cjs();
|
|
119
|
-
var zod_1 = require(
|
|
89
|
+
var zod_1 = require("zod");
|
|
120
90
|
function extendApi(schema, schemaObject = {}) {
|
|
121
91
|
const This = schema.constructor;
|
|
122
92
|
const newSchema = new This(schema._def);
|
|
123
|
-
newSchema.metaOpenApi = Object.assign(
|
|
124
|
-
{},
|
|
125
|
-
schema.metaOpenApi || {},
|
|
126
|
-
schemaObject
|
|
127
|
-
);
|
|
93
|
+
newSchema.metaOpenApi = Object.assign({}, schema.metaOpenApi || {}, schemaObject);
|
|
128
94
|
return newSchema;
|
|
129
95
|
}
|
|
130
96
|
exports2.extendApi = extendApi;
|
|
131
|
-
function iterateZodObject({
|
|
132
|
-
zodRef,
|
|
133
|
-
useOutput,
|
|
134
|
-
hideDefinitions,
|
|
135
|
-
openApiVersion
|
|
136
|
-
}) {
|
|
137
|
-
const reduced = Object.keys(zodRef.shape)
|
|
138
|
-
.filter(
|
|
139
|
-
(key) =>
|
|
140
|
-
(hideDefinitions === null || hideDefinitions === void 0
|
|
141
|
-
? void 0
|
|
142
|
-
: hideDefinitions.includes(key)) === false
|
|
143
|
-
)
|
|
144
|
-
.reduce(
|
|
145
|
-
(carry, key) =>
|
|
146
|
-
Object.assign(Object.assign({}, carry), {
|
|
147
|
-
[key]: generateSchema2(
|
|
148
|
-
zodRef.shape[key],
|
|
149
|
-
useOutput,
|
|
150
|
-
openApiVersion
|
|
151
|
-
)
|
|
152
|
-
}),
|
|
153
|
-
{}
|
|
154
|
-
);
|
|
97
|
+
function iterateZodObject({ zodRef, useOutput, hideDefinitions, openApiVersion }) {
|
|
98
|
+
const reduced = Object.keys(zodRef.shape).filter((key) => (hideDefinitions === null || hideDefinitions === void 0 ? void 0 : hideDefinitions.includes(key)) === false).reduce((carry, key) => Object.assign(Object.assign({}, carry), { [key]: generateSchema2(zodRef.shape[key], useOutput, openApiVersion) }), {});
|
|
155
99
|
return reduced;
|
|
156
100
|
}
|
|
157
101
|
function typeFormat(type3, openApiVersion) {
|
|
158
|
-
return openApiVersion ===
|
|
102
|
+
return openApiVersion === "3.0" ? type3 : [type3];
|
|
159
103
|
}
|
|
160
|
-
function parseTransformation({
|
|
161
|
-
zodRef,
|
|
162
|
-
|
|
163
|
-
useOutput,
|
|
164
|
-
openApiVersion
|
|
165
|
-
}) {
|
|
166
|
-
const input = generateSchema2(
|
|
167
|
-
zodRef._def.schema,
|
|
168
|
-
useOutput,
|
|
169
|
-
openApiVersion
|
|
170
|
-
);
|
|
171
|
-
let output = 'undefined';
|
|
104
|
+
function parseTransformation({ zodRef, schemas, useOutput, openApiVersion }) {
|
|
105
|
+
const input = generateSchema2(zodRef._def.schema, useOutput, openApiVersion);
|
|
106
|
+
let output = "undefined";
|
|
172
107
|
if (useOutput && zodRef._def.effect) {
|
|
173
|
-
const effect =
|
|
174
|
-
|
|
175
|
-
if (effect && 'transform' in effect) {
|
|
108
|
+
const effect = zodRef._def.effect.type === "transform" ? zodRef._def.effect : null;
|
|
109
|
+
if (effect && "transform" in effect) {
|
|
176
110
|
try {
|
|
177
|
-
const type3 = Array.isArray(input.type)
|
|
178
|
-
? input.type[0]
|
|
179
|
-
: input.type;
|
|
111
|
+
const type3 = Array.isArray(input.type) ? input.type[0] : input.type;
|
|
180
112
|
output = typeof effect.transform(
|
|
181
|
-
[
|
|
182
|
-
? 0
|
|
183
|
-
: 'string' === type3
|
|
184
|
-
? ''
|
|
185
|
-
: 'boolean' === type3
|
|
186
|
-
? false
|
|
187
|
-
: 'object' === type3
|
|
188
|
-
? {}
|
|
189
|
-
: 'null' === type3
|
|
190
|
-
? null
|
|
191
|
-
: 'array' === type3
|
|
192
|
-
? []
|
|
193
|
-
: void 0,
|
|
113
|
+
["integer", "number"].includes(`${type3}`) ? 0 : "string" === type3 ? "" : "boolean" === type3 ? false : "object" === type3 ? {} : "null" === type3 ? null : "array" === type3 ? [] : void 0,
|
|
194
114
|
{ addIssue: () => void 0, path: [] }
|
|
195
115
|
// TODO: Discover if context is necessary here
|
|
196
116
|
);
|
|
197
|
-
} catch (e) {
|
|
117
|
+
} catch (e) {
|
|
118
|
+
}
|
|
198
119
|
}
|
|
199
120
|
}
|
|
200
121
|
const outputType = output;
|
|
201
|
-
return (0, ts_deepmerge_1.default)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
Object.assign(
|
|
205
|
-
{},
|
|
206
|
-
zodRef.description ? { description: zodRef.description } : {}
|
|
207
|
-
),
|
|
208
|
-
input
|
|
209
|
-
),
|
|
210
|
-
['number', 'string', 'boolean', 'null'].includes(output)
|
|
211
|
-
? {
|
|
212
|
-
type: typeFormat(outputType, openApiVersion)
|
|
213
|
-
}
|
|
214
|
-
: {}
|
|
215
|
-
),
|
|
216
|
-
...schemas
|
|
217
|
-
);
|
|
122
|
+
return (0, ts_deepmerge_1.default)(Object.assign(Object.assign(Object.assign({}, zodRef.description ? { description: zodRef.description } : {}), input), ["number", "string", "boolean", "null"].includes(output) ? {
|
|
123
|
+
type: typeFormat(outputType, openApiVersion)
|
|
124
|
+
} : {}), ...schemas);
|
|
218
125
|
}
|
|
219
126
|
function parseString({ zodRef, schemas, openApiVersion }) {
|
|
220
127
|
const baseSchema = {
|
|
221
|
-
type: typeFormat(
|
|
128
|
+
type: typeFormat("string", openApiVersion)
|
|
222
129
|
};
|
|
223
130
|
const { checks = [] } = zodRef._def;
|
|
224
131
|
checks.forEach((item) => {
|
|
225
132
|
switch (item.kind) {
|
|
226
|
-
case
|
|
227
|
-
baseSchema.format =
|
|
133
|
+
case "email":
|
|
134
|
+
baseSchema.format = "email";
|
|
228
135
|
break;
|
|
229
|
-
case
|
|
230
|
-
baseSchema.format =
|
|
136
|
+
case "uuid":
|
|
137
|
+
baseSchema.format = "uuid";
|
|
231
138
|
break;
|
|
232
|
-
case
|
|
233
|
-
baseSchema.format =
|
|
139
|
+
case "cuid":
|
|
140
|
+
baseSchema.format = "cuid";
|
|
234
141
|
break;
|
|
235
|
-
case
|
|
236
|
-
baseSchema.format =
|
|
142
|
+
case "url":
|
|
143
|
+
baseSchema.format = "uri";
|
|
237
144
|
break;
|
|
238
|
-
case
|
|
239
|
-
baseSchema.format =
|
|
145
|
+
case "datetime":
|
|
146
|
+
baseSchema.format = "date-time";
|
|
240
147
|
break;
|
|
241
|
-
case
|
|
148
|
+
case "length":
|
|
242
149
|
baseSchema.minLength = item.value;
|
|
243
150
|
baseSchema.maxLength = item.value;
|
|
244
151
|
break;
|
|
245
|
-
case
|
|
152
|
+
case "max":
|
|
246
153
|
baseSchema.maxLength = item.value;
|
|
247
154
|
break;
|
|
248
|
-
case
|
|
155
|
+
case "min":
|
|
249
156
|
baseSchema.minLength = item.value;
|
|
250
157
|
break;
|
|
251
|
-
case
|
|
158
|
+
case "regex":
|
|
252
159
|
baseSchema.pattern = item.regex.source;
|
|
253
160
|
break;
|
|
254
161
|
}
|
|
255
162
|
});
|
|
256
|
-
return (0, ts_deepmerge_1.default)(
|
|
257
|
-
baseSchema,
|
|
258
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
259
|
-
...schemas
|
|
260
|
-
);
|
|
163
|
+
return (0, ts_deepmerge_1.default)(baseSchema, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
261
164
|
}
|
|
262
165
|
function parseNumber({ zodRef, schemas, openApiVersion }) {
|
|
263
166
|
const baseSchema = {
|
|
264
|
-
type: typeFormat(
|
|
167
|
+
type: typeFormat("number", openApiVersion)
|
|
265
168
|
};
|
|
266
169
|
const { checks = [] } = zodRef._def;
|
|
267
170
|
checks.forEach((item) => {
|
|
268
171
|
switch (item.kind) {
|
|
269
|
-
case
|
|
270
|
-
if (item.inclusive || openApiVersion ===
|
|
172
|
+
case "max":
|
|
173
|
+
if (item.inclusive || openApiVersion === "3.0") {
|
|
271
174
|
baseSchema.maximum = item.value;
|
|
272
175
|
}
|
|
273
176
|
if (!item.inclusive) {
|
|
274
|
-
if (openApiVersion ===
|
|
177
|
+
if (openApiVersion === "3.0") {
|
|
275
178
|
baseSchema.exclusiveMaximum = true;
|
|
276
179
|
} else {
|
|
277
180
|
baseSchema.exclusiveMaximum = item.value;
|
|
278
181
|
}
|
|
279
182
|
}
|
|
280
183
|
break;
|
|
281
|
-
case
|
|
282
|
-
if (item.inclusive || openApiVersion ===
|
|
184
|
+
case "min":
|
|
185
|
+
if (item.inclusive || openApiVersion === "3.0") {
|
|
283
186
|
baseSchema.minimum = item.value;
|
|
284
187
|
}
|
|
285
188
|
if (!item.inclusive) {
|
|
286
|
-
if (openApiVersion ===
|
|
189
|
+
if (openApiVersion === "3.0") {
|
|
287
190
|
baseSchema.exclusiveMinimum = true;
|
|
288
191
|
} else {
|
|
289
192
|
baseSchema.exclusiveMinimum = item.value;
|
|
290
193
|
}
|
|
291
194
|
}
|
|
292
195
|
break;
|
|
293
|
-
case
|
|
294
|
-
baseSchema.type = typeFormat(
|
|
196
|
+
case "int":
|
|
197
|
+
baseSchema.type = typeFormat("integer", openApiVersion);
|
|
295
198
|
break;
|
|
296
|
-
case
|
|
199
|
+
case "multipleOf":
|
|
297
200
|
baseSchema.multipleOf = item.value;
|
|
298
201
|
break;
|
|
299
202
|
}
|
|
300
203
|
});
|
|
301
|
-
return (0, ts_deepmerge_1.default)(
|
|
302
|
-
baseSchema,
|
|
303
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
304
|
-
...schemas
|
|
305
|
-
);
|
|
204
|
+
return (0, ts_deepmerge_1.default)(baseSchema, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
306
205
|
}
|
|
307
206
|
function getExcludedDefinitionsFromSchema(schemas) {
|
|
308
207
|
const excludedDefinitions = [];
|
|
@@ -313,163 +212,65 @@ var require_zod_openapi = __commonJS({
|
|
|
313
212
|
}
|
|
314
213
|
return excludedDefinitions;
|
|
315
214
|
}
|
|
316
|
-
function parseObject({
|
|
317
|
-
zodRef,
|
|
318
|
-
schemas,
|
|
319
|
-
useOutput,
|
|
320
|
-
hideDefinitions,
|
|
321
|
-
openApiVersion
|
|
322
|
-
}) {
|
|
215
|
+
function parseObject({ zodRef, schemas, useOutput, hideDefinitions, openApiVersion }) {
|
|
323
216
|
var _a;
|
|
324
217
|
let additionalProperties;
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
((_a = zodRef._def.catchall) === null || _a === void 0
|
|
329
|
-
? void 0
|
|
330
|
-
: _a._def.typeName) === 'ZodNever'
|
|
331
|
-
)
|
|
332
|
-
)
|
|
333
|
-
additionalProperties = generateSchema2(
|
|
334
|
-
zodRef._def.catchall,
|
|
335
|
-
useOutput,
|
|
336
|
-
openApiVersion
|
|
337
|
-
);
|
|
338
|
-
else if (zodRef._def.unknownKeys === 'passthrough')
|
|
218
|
+
if (!(zodRef._def.catchall instanceof zod_1.z.ZodNever || ((_a = zodRef._def.catchall) === null || _a === void 0 ? void 0 : _a._def.typeName) === "ZodNever"))
|
|
219
|
+
additionalProperties = generateSchema2(zodRef._def.catchall, useOutput, openApiVersion);
|
|
220
|
+
else if (zodRef._def.unknownKeys === "passthrough")
|
|
339
221
|
additionalProperties = true;
|
|
340
|
-
else if (zodRef._def.unknownKeys ===
|
|
222
|
+
else if (zodRef._def.unknownKeys === "strict")
|
|
341
223
|
additionalProperties = false;
|
|
342
|
-
additionalProperties =
|
|
343
|
-
additionalProperties != null ? { additionalProperties } : {};
|
|
224
|
+
additionalProperties = additionalProperties != null ? { additionalProperties } : {};
|
|
344
225
|
const requiredProperties = Object.keys(zodRef.shape).filter((key) => {
|
|
345
226
|
const item = zodRef.shape[key];
|
|
346
|
-
return (
|
|
347
|
-
!(
|
|
348
|
-
item.isOptional() ||
|
|
349
|
-
item instanceof zod_1.z.ZodDefault ||
|
|
350
|
-
item._def.typeName === 'ZodDefault'
|
|
351
|
-
) &&
|
|
352
|
-
!(
|
|
353
|
-
item instanceof zod_1.z.ZodNever ||
|
|
354
|
-
item._def.typeName === 'ZodDefault'
|
|
355
|
-
)
|
|
356
|
-
);
|
|
227
|
+
return !(item.isOptional() || item instanceof zod_1.z.ZodDefault || item._def.typeName === "ZodDefault") && !(item instanceof zod_1.z.ZodNever || item._def.typeName === "ZodDefault");
|
|
357
228
|
});
|
|
358
|
-
const required =
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
properties: iterateZodObject({
|
|
367
|
-
zodRef,
|
|
368
|
-
schemas,
|
|
369
|
-
useOutput,
|
|
370
|
-
hideDefinitions: getExcludedDefinitionsFromSchema(schemas),
|
|
371
|
-
openApiVersion
|
|
372
|
-
})
|
|
373
|
-
},
|
|
374
|
-
required
|
|
375
|
-
),
|
|
376
|
-
additionalProperties
|
|
377
|
-
),
|
|
378
|
-
hideDefinitions
|
|
379
|
-
),
|
|
380
|
-
zodRef.description
|
|
381
|
-
? { description: zodRef.description, hideDefinitions }
|
|
382
|
-
: {},
|
|
383
|
-
...schemas
|
|
384
|
-
);
|
|
229
|
+
const required = requiredProperties.length > 0 ? { required: requiredProperties } : {};
|
|
230
|
+
return (0, ts_deepmerge_1.default)(Object.assign(Object.assign(Object.assign({ type: typeFormat("object", openApiVersion), properties: iterateZodObject({
|
|
231
|
+
zodRef,
|
|
232
|
+
schemas,
|
|
233
|
+
useOutput,
|
|
234
|
+
hideDefinitions: getExcludedDefinitionsFromSchema(schemas),
|
|
235
|
+
openApiVersion
|
|
236
|
+
}) }, required), additionalProperties), hideDefinitions), zodRef.description ? { description: zodRef.description, hideDefinitions } : {}, ...schemas);
|
|
385
237
|
}
|
|
386
238
|
function parseRecord({ zodRef, schemas, useOutput, openApiVersion }) {
|
|
387
|
-
return (0, ts_deepmerge_1.default)(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
zodRef._def.valueType instanceof zod_1.z.ZodUnknown
|
|
392
|
-
? {}
|
|
393
|
-
: generateSchema2(
|
|
394
|
-
zodRef._def.valueType,
|
|
395
|
-
useOutput,
|
|
396
|
-
openApiVersion
|
|
397
|
-
)
|
|
398
|
-
},
|
|
399
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
400
|
-
...schemas
|
|
401
|
-
);
|
|
239
|
+
return (0, ts_deepmerge_1.default)({
|
|
240
|
+
type: typeFormat("object", openApiVersion),
|
|
241
|
+
additionalProperties: zodRef._def.valueType instanceof zod_1.z.ZodUnknown ? {} : generateSchema2(zodRef._def.valueType, useOutput, openApiVersion)
|
|
242
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
402
243
|
}
|
|
403
244
|
function parseBigInt({ zodRef, schemas, openApiVersion }) {
|
|
404
|
-
return (0, ts_deepmerge_1.default)(
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
410
|
-
...schemas
|
|
411
|
-
);
|
|
245
|
+
return (0, ts_deepmerge_1.default)({
|
|
246
|
+
type: typeFormat("integer", openApiVersion),
|
|
247
|
+
format: "int64"
|
|
248
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
412
249
|
}
|
|
413
250
|
function parseBoolean({ zodRef, schemas, openApiVersion }) {
|
|
414
|
-
return (0, ts_deepmerge_1.default)(
|
|
415
|
-
{ type: typeFormat('boolean', openApiVersion) },
|
|
416
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
417
|
-
...schemas
|
|
418
|
-
);
|
|
251
|
+
return (0, ts_deepmerge_1.default)({ type: typeFormat("boolean", openApiVersion) }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
419
252
|
}
|
|
420
253
|
function parseDate({ zodRef, schemas, openApiVersion }) {
|
|
421
|
-
return (0, ts_deepmerge_1.default)(
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
427
|
-
...schemas
|
|
428
|
-
);
|
|
254
|
+
return (0, ts_deepmerge_1.default)({
|
|
255
|
+
type: typeFormat("string", openApiVersion),
|
|
256
|
+
format: "date-time"
|
|
257
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
429
258
|
}
|
|
430
259
|
function parseNull({ zodRef, schemas, openApiVersion }) {
|
|
431
|
-
return (0, ts_deepmerge_1.default)(
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
type: ['string', 'null'],
|
|
436
|
-
enum: ['null']
|
|
437
|
-
},
|
|
438
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
439
|
-
...schemas
|
|
440
|
-
);
|
|
260
|
+
return (0, ts_deepmerge_1.default)(openApiVersion === "3.0" ? { type: "null" } : {
|
|
261
|
+
type: ["string", "null"],
|
|
262
|
+
enum: ["null"]
|
|
263
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
441
264
|
}
|
|
442
265
|
function parseOptional({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
443
|
-
return (0, ts_deepmerge_1.default)(
|
|
444
|
-
generateSchema2(zodRef.unwrap(), useOutput, openApiVersion),
|
|
445
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
446
|
-
...schemas
|
|
447
|
-
);
|
|
266
|
+
return (0, ts_deepmerge_1.default)(generateSchema2(zodRef.unwrap(), useOutput, openApiVersion), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
448
267
|
}
|
|
449
268
|
function parseNullable({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
450
|
-
const schema = generateSchema2(
|
|
451
|
-
|
|
452
|
-
useOutput,
|
|
453
|
-
openApiVersion
|
|
454
|
-
);
|
|
455
|
-
return (0, ts_deepmerge_1.default)(
|
|
456
|
-
schema,
|
|
457
|
-
openApiVersion === '3.0'
|
|
458
|
-
? { nullable: true }
|
|
459
|
-
: { type: typeFormat('null', openApiVersion) },
|
|
460
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
461
|
-
...schemas
|
|
462
|
-
);
|
|
269
|
+
const schema = generateSchema2(zodRef.unwrap(), useOutput, openApiVersion);
|
|
270
|
+
return (0, ts_deepmerge_1.default)(schema, openApiVersion === "3.0" ? { nullable: true } : { type: typeFormat("null", openApiVersion) }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
463
271
|
}
|
|
464
272
|
function parseDefault({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
465
|
-
return (0, ts_deepmerge_1.default)(
|
|
466
|
-
Object.assign(
|
|
467
|
-
{ default: zodRef._def.defaultValue() },
|
|
468
|
-
generateSchema2(zodRef._def.innerType, useOutput, openApiVersion)
|
|
469
|
-
),
|
|
470
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
471
|
-
...schemas
|
|
472
|
-
);
|
|
273
|
+
return (0, ts_deepmerge_1.default)(Object.assign({ default: zodRef._def.defaultValue() }, generateSchema2(zodRef._def.innerType, useOutput, openApiVersion)), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
473
274
|
}
|
|
474
275
|
function parseArray({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
475
276
|
const constraints = {};
|
|
@@ -481,149 +282,70 @@ var require_zod_openapi = __commonJS({
|
|
|
481
282
|
constraints.minItems = zodRef._def.minLength.value;
|
|
482
283
|
if (zodRef._def.maxLength != null)
|
|
483
284
|
constraints.maxItems = zodRef._def.maxLength.value;
|
|
484
|
-
return (0, ts_deepmerge_1.default)(
|
|
485
|
-
Object.assign(
|
|
486
|
-
{
|
|
487
|
-
type: typeFormat('array', openApiVersion),
|
|
488
|
-
items: generateSchema2(zodRef.element, useOutput, openApiVersion)
|
|
489
|
-
},
|
|
490
|
-
constraints
|
|
491
|
-
),
|
|
492
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
493
|
-
...schemas
|
|
494
|
-
);
|
|
285
|
+
return (0, ts_deepmerge_1.default)(Object.assign({ type: typeFormat("array", openApiVersion), items: generateSchema2(zodRef.element, useOutput, openApiVersion) }, constraints), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
495
286
|
}
|
|
496
287
|
function parseLiteral({ schemas, zodRef, openApiVersion }) {
|
|
497
288
|
const type3 = typeof zodRef._def.value;
|
|
498
|
-
return (0, ts_deepmerge_1.default)(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
},
|
|
503
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
504
|
-
...schemas
|
|
505
|
-
);
|
|
289
|
+
return (0, ts_deepmerge_1.default)({
|
|
290
|
+
type: typeFormat(type3, openApiVersion),
|
|
291
|
+
enum: [zodRef._def.value]
|
|
292
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
506
293
|
}
|
|
507
294
|
function parseEnum({ schemas, zodRef, openApiVersion }) {
|
|
508
295
|
const type3 = typeof Object.values(zodRef._def.values)[0];
|
|
509
|
-
return (0, ts_deepmerge_1.default)(
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
},
|
|
514
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
515
|
-
...schemas
|
|
516
|
-
);
|
|
296
|
+
return (0, ts_deepmerge_1.default)({
|
|
297
|
+
type: typeFormat(type3, openApiVersion),
|
|
298
|
+
enum: Object.values(zodRef._def.values)
|
|
299
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
517
300
|
}
|
|
518
301
|
function parseIntersection({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
519
|
-
return (0, ts_deepmerge_1.default)(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
},
|
|
526
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
527
|
-
...schemas
|
|
528
|
-
);
|
|
302
|
+
return (0, ts_deepmerge_1.default)({
|
|
303
|
+
allOf: [
|
|
304
|
+
generateSchema2(zodRef._def.left, useOutput, openApiVersion),
|
|
305
|
+
generateSchema2(zodRef._def.right, useOutput, openApiVersion)
|
|
306
|
+
]
|
|
307
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
529
308
|
}
|
|
530
309
|
function parseUnion({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
531
310
|
const contents = zodRef._def.options;
|
|
532
|
-
if (
|
|
533
|
-
contents.reduce(
|
|
534
|
-
(prev, content) => prev && content._def.typeName === 'ZodLiteral',
|
|
535
|
-
true
|
|
536
|
-
)
|
|
537
|
-
) {
|
|
311
|
+
if (contents.reduce((prev, content) => prev && content._def.typeName === "ZodLiteral", true)) {
|
|
538
312
|
const literals = contents;
|
|
539
|
-
const type3 = literals.reduce(
|
|
540
|
-
(prev, content) =>
|
|
541
|
-
!prev || prev === typeof content._def.value
|
|
542
|
-
? typeof content._def.value
|
|
543
|
-
: null,
|
|
544
|
-
null
|
|
545
|
-
);
|
|
313
|
+
const type3 = literals.reduce((prev, content) => !prev || prev === typeof content._def.value ? typeof content._def.value : null, null);
|
|
546
314
|
if (type3) {
|
|
547
|
-
return (0, ts_deepmerge_1.default)(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
},
|
|
552
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
553
|
-
...schemas
|
|
554
|
-
);
|
|
315
|
+
return (0, ts_deepmerge_1.default)({
|
|
316
|
+
type: typeFormat(type3, openApiVersion),
|
|
317
|
+
enum: literals.map((literal3) => literal3._def.value)
|
|
318
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
555
319
|
}
|
|
556
320
|
}
|
|
557
|
-
const oneOfContents =
|
|
558
|
-
openApiVersion === '3.0'
|
|
559
|
-
? contents.filter((content) => content._def.typeName !== 'ZodNull')
|
|
560
|
-
: contents;
|
|
321
|
+
const oneOfContents = openApiVersion === "3.0" ? contents.filter((content) => content._def.typeName !== "ZodNull") : contents;
|
|
561
322
|
const contentsHasNull = contents.length != oneOfContents.length;
|
|
562
|
-
return (0, ts_deepmerge_1.default)(
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
generateSchema2(schema, useOutput, openApiVersion)
|
|
566
|
-
)
|
|
567
|
-
},
|
|
568
|
-
contentsHasNull ? { nullable: true } : {},
|
|
569
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
570
|
-
...schemas
|
|
571
|
-
);
|
|
323
|
+
return (0, ts_deepmerge_1.default)({
|
|
324
|
+
oneOf: oneOfContents.map((schema) => generateSchema2(schema, useOutput, openApiVersion))
|
|
325
|
+
}, contentsHasNull ? { nullable: true } : {}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
572
326
|
}
|
|
573
|
-
function parseDiscriminatedUnion({
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
openApiVersion
|
|
578
|
-
}) {
|
|
579
|
-
return (0, ts_deepmerge_1.default)(
|
|
580
|
-
{
|
|
581
|
-
discriminator: {
|
|
582
|
-
propertyName: zodRef._def.discriminator
|
|
583
|
-
},
|
|
584
|
-
oneOf: Array.from(zodRef._def.options.values()).map((schema) =>
|
|
585
|
-
generateSchema2(schema, useOutput, openApiVersion)
|
|
586
|
-
)
|
|
327
|
+
function parseDiscriminatedUnion({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
328
|
+
return (0, ts_deepmerge_1.default)({
|
|
329
|
+
discriminator: {
|
|
330
|
+
propertyName: zodRef._def.discriminator
|
|
587
331
|
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
);
|
|
332
|
+
oneOf: Array.from(zodRef._def.options.values()).map((schema) => generateSchema2(schema, useOutput, openApiVersion))
|
|
333
|
+
}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
591
334
|
}
|
|
592
335
|
function parseNever({ zodRef, schemas }) {
|
|
593
|
-
return (0, ts_deepmerge_1.default)(
|
|
594
|
-
{ readOnly: true },
|
|
595
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
596
|
-
...schemas
|
|
597
|
-
);
|
|
336
|
+
return (0, ts_deepmerge_1.default)({ readOnly: true }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
598
337
|
}
|
|
599
338
|
function parseBranded({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
600
|
-
return (0, ts_deepmerge_1.default)(
|
|
601
|
-
generateSchema2(zodRef._def.type, useOutput, openApiVersion),
|
|
602
|
-
...schemas
|
|
603
|
-
);
|
|
339
|
+
return (0, ts_deepmerge_1.default)(generateSchema2(zodRef._def.type, useOutput, openApiVersion), ...schemas);
|
|
604
340
|
}
|
|
605
341
|
function catchAllParser({ zodRef, schemas }) {
|
|
606
|
-
return (0, ts_deepmerge_1.default)(
|
|
607
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
608
|
-
...schemas
|
|
609
|
-
);
|
|
342
|
+
return (0, ts_deepmerge_1.default)(zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
610
343
|
}
|
|
611
344
|
function parsePipeline({ schemas, zodRef, useOutput, openApiVersion }) {
|
|
612
|
-
return (0, ts_deepmerge_1.default)(
|
|
613
|
-
generateSchema2(
|
|
614
|
-
useOutput ? zodRef._def.out : zodRef._def.in,
|
|
615
|
-
useOutput,
|
|
616
|
-
openApiVersion
|
|
617
|
-
),
|
|
618
|
-
...schemas
|
|
619
|
-
);
|
|
345
|
+
return (0, ts_deepmerge_1.default)(generateSchema2(useOutput ? zodRef._def.out : zodRef._def.in, useOutput, openApiVersion), ...schemas);
|
|
620
346
|
}
|
|
621
347
|
function parseReadonly({ zodRef, useOutput, schemas, openApiVersion }) {
|
|
622
|
-
return (0, ts_deepmerge_1.default)(
|
|
623
|
-
generateSchema2(zodRef._def.innerType, useOutput, openApiVersion),
|
|
624
|
-
zodRef.description ? { description: zodRef.description } : {},
|
|
625
|
-
...schemas
|
|
626
|
-
);
|
|
348
|
+
return (0, ts_deepmerge_1.default)(generateSchema2(zodRef._def.innerType, useOutput, openApiVersion), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
|
|
627
349
|
}
|
|
628
350
|
var workerMap = {
|
|
629
351
|
ZodObject: parseObject,
|
|
@@ -662,14 +384,10 @@ var require_zod_openapi = __commonJS({
|
|
|
662
384
|
ZodPipeline: parsePipeline,
|
|
663
385
|
ZodReadonly: parseReadonly
|
|
664
386
|
};
|
|
665
|
-
function generateSchema2(
|
|
666
|
-
zodRef,
|
|
667
|
-
useOutput = false,
|
|
668
|
-
openApiVersion = '3.1'
|
|
669
|
-
) {
|
|
387
|
+
function generateSchema2(zodRef, useOutput = false, openApiVersion = "3.1") {
|
|
670
388
|
const { metaOpenApi = {} } = zodRef;
|
|
671
389
|
const schemas = [
|
|
672
|
-
...
|
|
390
|
+
...Array.isArray(metaOpenApi) ? metaOpenApi : [metaOpenApi]
|
|
673
391
|
];
|
|
674
392
|
try {
|
|
675
393
|
const typeName = zodRef._def.typeName;
|
|
@@ -693,21 +411,16 @@ var require_zod_openapi = __commonJS({
|
|
|
693
411
|
|
|
694
412
|
// ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/lib/zod-extensions.js
|
|
695
413
|
var require_zod_extensions = __commonJS({
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
'use strict';
|
|
700
|
-
Object.defineProperty(exports2, '__esModule', { value: true });
|
|
414
|
+
"../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/lib/zod-extensions.js"(exports2) {
|
|
415
|
+
"use strict";
|
|
416
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
701
417
|
exports2.extendZodWithOpenApi = void 0;
|
|
702
418
|
var zod_openapi_1 = require_zod_openapi();
|
|
703
419
|
function extendZodWithOpenApi2(zod, forceOverride = false) {
|
|
704
|
-
if (
|
|
705
|
-
!forceOverride &&
|
|
706
|
-
typeof zod.ZodSchema.prototype.openapi !== 'undefined'
|
|
707
|
-
) {
|
|
420
|
+
if (!forceOverride && typeof zod.ZodSchema.prototype.openapi !== "undefined") {
|
|
708
421
|
return;
|
|
709
422
|
}
|
|
710
|
-
zod.ZodSchema.prototype.openapi = function
|
|
423
|
+
zod.ZodSchema.prototype.openapi = function(metadata) {
|
|
711
424
|
return (0, zod_openapi_1.extendApi)(this, metadata);
|
|
712
425
|
};
|
|
713
426
|
}
|
|
@@ -717,46 +430,25 @@ var require_zod_extensions = __commonJS({
|
|
|
717
430
|
|
|
718
431
|
// ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/index.js
|
|
719
432
|
var require_src = __commonJS({
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
(
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
return m[k];
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
Object.defineProperty(o, k2, desc);
|
|
744
|
-
}
|
|
745
|
-
: function (o, m, k, k2) {
|
|
746
|
-
if (k2 === void 0) k2 = k;
|
|
747
|
-
o[k2] = m[k];
|
|
748
|
-
});
|
|
749
|
-
var __exportStar =
|
|
750
|
-
(exports2 && exports2.__exportStar) ||
|
|
751
|
-
function (m, exports3) {
|
|
752
|
-
for (var p in m)
|
|
753
|
-
if (
|
|
754
|
-
p !== 'default' &&
|
|
755
|
-
!Object.prototype.hasOwnProperty.call(exports3, p)
|
|
756
|
-
)
|
|
757
|
-
__createBinding(exports3, m, p);
|
|
758
|
-
};
|
|
759
|
-
Object.defineProperty(exports2, '__esModule', { value: true });
|
|
433
|
+
"../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.67/node_modules/@anatine/zod-openapi/src/index.js"(exports2) {
|
|
434
|
+
"use strict";
|
|
435
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
436
|
+
if (k2 === void 0) k2 = k;
|
|
437
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
438
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
439
|
+
desc = { enumerable: true, get: function() {
|
|
440
|
+
return m[k];
|
|
441
|
+
} };
|
|
442
|
+
}
|
|
443
|
+
Object.defineProperty(o, k2, desc);
|
|
444
|
+
} : function(o, m, k, k2) {
|
|
445
|
+
if (k2 === void 0) k2 = k;
|
|
446
|
+
o[k2] = m[k];
|
|
447
|
+
});
|
|
448
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
449
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
450
|
+
};
|
|
451
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
760
452
|
__exportStar(require_zod_openapi(), exports2);
|
|
761
453
|
__exportStar(require_zod_extensions(), exports2);
|
|
762
454
|
}
|
|
@@ -770,11 +462,15 @@ __export(schemas_exports, {
|
|
|
770
462
|
module.exports = __toCommonJS(schemas_exports);
|
|
771
463
|
|
|
772
464
|
// domain/schemas/redisWorker.schema.ts
|
|
773
|
-
var import_internal = require(
|
|
465
|
+
var import_internal = require("@forklaunch/internal");
|
|
774
466
|
|
|
775
467
|
// ../../../node_modules/.pnpm/@forklaunch+common@0.3.14/node_modules/@forklaunch/common/lib/index.mjs
|
|
776
468
|
var InMemoryFile = class extends File {
|
|
777
|
-
constructor(content, name, {
|
|
469
|
+
constructor(content, name, {
|
|
470
|
+
type: type3,
|
|
471
|
+
endings,
|
|
472
|
+
lastModified
|
|
473
|
+
}) {
|
|
778
474
|
super([Buffer.from(content)], name, {
|
|
779
475
|
type: type3,
|
|
780
476
|
endings,
|
|
@@ -785,235 +481,211 @@ var InMemoryFile = class extends File {
|
|
|
785
481
|
};
|
|
786
482
|
|
|
787
483
|
// ../../../node_modules/.pnpm/@forklaunch+validator@0.6.16_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
788
|
-
var import_typebox = require(
|
|
789
|
-
var import_compiler = require(
|
|
790
|
-
var import_errors = require(
|
|
791
|
-
var import_value = require(
|
|
792
|
-
import_typebox.FormatRegistry.Set(
|
|
793
|
-
'binary',
|
|
794
|
-
(value) => typeof value === 'string'
|
|
795
|
-
);
|
|
484
|
+
var import_typebox = require("@sinclair/typebox");
|
|
485
|
+
var import_compiler = require("@sinclair/typebox/compiler");
|
|
486
|
+
var import_errors = require("@sinclair/typebox/errors");
|
|
487
|
+
var import_value = require("@sinclair/typebox/value");
|
|
488
|
+
import_typebox.FormatRegistry.Set("binary", (value) => typeof value === "string");
|
|
796
489
|
(0, import_errors.SetErrorFunction)((params) => {
|
|
797
490
|
switch (params.errorType) {
|
|
798
491
|
case import_errors.ValueErrorType.Union:
|
|
799
492
|
case import_errors.ValueErrorType.Array:
|
|
800
493
|
case import_errors.ValueErrorType.String:
|
|
801
494
|
case import_errors.ValueErrorType.Number:
|
|
802
|
-
return params.schema.errorType
|
|
803
|
-
? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? 's' : ''}`
|
|
804
|
-
: (0, import_errors.DefaultErrorFunction)(params);
|
|
495
|
+
return params.schema.errorType ? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? "s" : ""}` : (0, import_errors.DefaultErrorFunction)(params);
|
|
805
496
|
default:
|
|
806
497
|
return (0, import_errors.DefaultErrorFunction)(params);
|
|
807
498
|
}
|
|
808
499
|
});
|
|
809
500
|
var TypeboxSchemaValidator = class {
|
|
810
|
-
_Type =
|
|
501
|
+
_Type = "TypeBox";
|
|
811
502
|
_SchemaCatchall;
|
|
812
503
|
_ValidSchemaObject;
|
|
813
504
|
string = import_typebox.Type.String({
|
|
814
|
-
example:
|
|
815
|
-
title:
|
|
505
|
+
example: "a string",
|
|
506
|
+
title: "String"
|
|
816
507
|
});
|
|
817
508
|
uuid = import_typebox.Type.String({
|
|
818
|
-
pattern:
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
title: 'UUID'
|
|
509
|
+
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
|
|
510
|
+
errorType: "uuid",
|
|
511
|
+
example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
|
|
512
|
+
title: "UUID"
|
|
823
513
|
});
|
|
824
514
|
email = import_typebox.Type.String({
|
|
825
515
|
pattern: `(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])`,
|
|
826
|
-
errorType:
|
|
827
|
-
example:
|
|
828
|
-
title:
|
|
516
|
+
errorType: "email",
|
|
517
|
+
example: "a@b.com",
|
|
518
|
+
title: "Email"
|
|
829
519
|
});
|
|
830
520
|
uri = import_typebox.Type.String({
|
|
831
|
-
pattern:
|
|
832
|
-
errorType:
|
|
833
|
-
example:
|
|
834
|
-
title:
|
|
521
|
+
pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
|
|
522
|
+
errorType: "uri",
|
|
523
|
+
example: "https://forklaunch.com",
|
|
524
|
+
title: "URI"
|
|
835
525
|
});
|
|
836
526
|
number = import_typebox.Type.Transform(
|
|
837
527
|
import_typebox.Type.Union(
|
|
838
528
|
[
|
|
839
529
|
import_typebox.Type.Number(),
|
|
840
|
-
import_typebox.Type.String({ pattern:
|
|
530
|
+
import_typebox.Type.String({ pattern: "^[0-9]+$" }),
|
|
841
531
|
import_typebox.Type.Boolean(),
|
|
842
532
|
import_typebox.Type.Null(),
|
|
843
533
|
import_typebox.Type.BigInt(),
|
|
844
534
|
import_typebox.Type.Date()
|
|
845
535
|
],
|
|
846
536
|
{
|
|
847
|
-
errorType:
|
|
537
|
+
errorType: "number-like",
|
|
848
538
|
example: 123,
|
|
849
|
-
title:
|
|
539
|
+
title: "Number"
|
|
850
540
|
}
|
|
851
541
|
)
|
|
852
|
-
)
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
return num;
|
|
860
|
-
}
|
|
542
|
+
).Decode((value) => {
|
|
543
|
+
if (typeof value !== "number") {
|
|
544
|
+
const num = Number(value);
|
|
545
|
+
if (isNaN(num)) {
|
|
546
|
+
throw new Error("Invalid number");
|
|
547
|
+
} else {
|
|
548
|
+
return num;
|
|
861
549
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
550
|
+
}
|
|
551
|
+
return value;
|
|
552
|
+
}).Encode(Number);
|
|
865
553
|
bigint = import_typebox.Type.Transform(
|
|
866
554
|
import_typebox.Type.Union(
|
|
867
555
|
[
|
|
868
556
|
import_typebox.Type.BigInt(),
|
|
869
557
|
import_typebox.Type.Number(),
|
|
870
|
-
import_typebox.Type.String({ pattern:
|
|
558
|
+
import_typebox.Type.String({ pattern: "^[0-9]+n?$" }),
|
|
871
559
|
import_typebox.Type.Boolean(),
|
|
872
560
|
import_typebox.Type.Date()
|
|
873
561
|
],
|
|
874
562
|
{
|
|
875
|
-
errorType:
|
|
563
|
+
errorType: "BigInt-like",
|
|
876
564
|
example: 123n,
|
|
877
|
-
title:
|
|
565
|
+
title: "BigInt"
|
|
878
566
|
}
|
|
879
567
|
)
|
|
880
|
-
)
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
return BigInt(value.getTime());
|
|
886
|
-
}
|
|
887
|
-
return BigInt(value);
|
|
888
|
-
} catch {
|
|
889
|
-
throw new Error('Invalid bigint');
|
|
568
|
+
).Decode((value) => {
|
|
569
|
+
if (typeof value !== "bigint") {
|
|
570
|
+
try {
|
|
571
|
+
if (value instanceof Date) {
|
|
572
|
+
return BigInt(value.getTime());
|
|
890
573
|
}
|
|
574
|
+
return BigInt(value);
|
|
575
|
+
} catch {
|
|
576
|
+
throw new Error("Invalid bigint");
|
|
891
577
|
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
578
|
+
}
|
|
579
|
+
return value;
|
|
580
|
+
}).Encode(BigInt);
|
|
895
581
|
boolean = import_typebox.Type.Transform(
|
|
896
582
|
import_typebox.Type.Union(
|
|
897
583
|
[
|
|
898
584
|
import_typebox.Type.Boolean(),
|
|
899
585
|
import_typebox.Type.String({
|
|
900
|
-
pattern:
|
|
586
|
+
pattern: "^(t|T)(r|R)(u|U)(e|E)$|^(f|F)(a|A)(l|L)(s|S)(e|E)$"
|
|
901
587
|
})
|
|
902
588
|
],
|
|
903
589
|
{
|
|
904
|
-
errorType:
|
|
590
|
+
errorType: "boolean-like",
|
|
905
591
|
example: true,
|
|
906
|
-
title:
|
|
592
|
+
title: "Boolean"
|
|
907
593
|
}
|
|
908
594
|
)
|
|
909
|
-
)
|
|
910
|
-
|
|
911
|
-
if (
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
})
|
|
918
|
-
.Encode(Boolean);
|
|
595
|
+
).Decode((value) => {
|
|
596
|
+
if (typeof value === "string") {
|
|
597
|
+
if (value.toLowerCase() === "true") return true;
|
|
598
|
+
return false;
|
|
599
|
+
} else {
|
|
600
|
+
return value;
|
|
601
|
+
}
|
|
602
|
+
}).Encode(Boolean);
|
|
919
603
|
date = import_typebox.Type.Transform(
|
|
920
604
|
import_typebox.Type.Union(
|
|
921
605
|
[
|
|
922
606
|
import_typebox.Type.String({
|
|
923
|
-
pattern:
|
|
924
|
-
'^\\d{4}(-\\d{2}){0,2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,3})?)?(Z|([+-]\\d{2}:\\d{2}))?)?$|^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$|^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$|^\\d+$'
|
|
607
|
+
pattern: "^\\d{4}(-\\d{2}){0,2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,3})?)?(Z|([+-]\\d{2}:\\d{2}))?)?$|^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$|^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$|^\\d+$"
|
|
925
608
|
}),
|
|
926
609
|
import_typebox.Type.Number(),
|
|
927
610
|
import_typebox.Type.Date()
|
|
928
611
|
],
|
|
929
612
|
{
|
|
930
|
-
errorType:
|
|
931
|
-
example:
|
|
932
|
-
title:
|
|
613
|
+
errorType: "date",
|
|
614
|
+
example: "2025-05-16T21:13:04.123Z",
|
|
615
|
+
title: "Date"
|
|
933
616
|
}
|
|
934
617
|
)
|
|
935
|
-
)
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
})
|
|
942
|
-
.Encode((value) => new Date(value).toISOString());
|
|
618
|
+
).Decode((value) => {
|
|
619
|
+
if (value === null || typeof value === "boolean") {
|
|
620
|
+
return /* @__PURE__ */ new Date(value ? 1 : 0);
|
|
621
|
+
}
|
|
622
|
+
return new Date(value);
|
|
623
|
+
}).Encode((value) => new Date(value).toISOString());
|
|
943
624
|
symbol = import_typebox.Type.Symbol({
|
|
944
|
-
title:
|
|
625
|
+
title: "Symbol"
|
|
945
626
|
});
|
|
946
627
|
nullish = import_typebox.Type.Union(
|
|
947
|
-
[
|
|
948
|
-
import_typebox.Type.Void(),
|
|
949
|
-
import_typebox.Type.Null(),
|
|
950
|
-
import_typebox.Type.Undefined()
|
|
951
|
-
],
|
|
628
|
+
[import_typebox.Type.Void(), import_typebox.Type.Null(), import_typebox.Type.Undefined()],
|
|
952
629
|
{
|
|
953
|
-
errorType:
|
|
954
|
-
type:
|
|
955
|
-
example:
|
|
956
|
-
title:
|
|
630
|
+
errorType: "nullish",
|
|
631
|
+
type: "null",
|
|
632
|
+
example: "null",
|
|
633
|
+
title: "Nullish"
|
|
957
634
|
}
|
|
958
635
|
);
|
|
959
636
|
void = import_typebox.Type.Void({
|
|
960
|
-
type:
|
|
961
|
-
example:
|
|
962
|
-
title:
|
|
637
|
+
type: "null",
|
|
638
|
+
example: "void",
|
|
639
|
+
title: "Void"
|
|
963
640
|
});
|
|
964
641
|
null = import_typebox.Type.Null({
|
|
965
|
-
type:
|
|
966
|
-
example:
|
|
967
|
-
title:
|
|
642
|
+
type: "null",
|
|
643
|
+
example: "null",
|
|
644
|
+
title: "Null"
|
|
968
645
|
});
|
|
969
646
|
undefined = import_typebox.Type.Undefined({
|
|
970
|
-
type:
|
|
971
|
-
example:
|
|
972
|
-
title:
|
|
647
|
+
type: "null",
|
|
648
|
+
example: "undefined",
|
|
649
|
+
title: "Undefined"
|
|
973
650
|
});
|
|
974
651
|
any = import_typebox.Type.Any({
|
|
975
|
-
type:
|
|
976
|
-
example:
|
|
977
|
-
title:
|
|
652
|
+
type: "object",
|
|
653
|
+
example: "any",
|
|
654
|
+
title: "Any"
|
|
978
655
|
});
|
|
979
656
|
unknown = import_typebox.Type.Unknown({
|
|
980
|
-
type:
|
|
981
|
-
example:
|
|
982
|
-
title:
|
|
657
|
+
type: "object",
|
|
658
|
+
example: "unknown",
|
|
659
|
+
title: "Unknown"
|
|
983
660
|
});
|
|
984
661
|
never = import_typebox.Type.Never({
|
|
985
|
-
type:
|
|
986
|
-
example:
|
|
987
|
-
title:
|
|
662
|
+
type: "null",
|
|
663
|
+
example: "never",
|
|
664
|
+
title: "Never"
|
|
988
665
|
});
|
|
989
666
|
binary = import_typebox.Type.Transform(
|
|
990
667
|
import_typebox.Type.String({
|
|
991
|
-
errorType:
|
|
992
|
-
format:
|
|
993
|
-
example:
|
|
994
|
-
title:
|
|
668
|
+
errorType: "binary",
|
|
669
|
+
format: "binary",
|
|
670
|
+
example: "a utf-8 encodable string",
|
|
671
|
+
title: "Binary"
|
|
995
672
|
})
|
|
996
|
-
)
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
return '';
|
|
1003
|
-
});
|
|
673
|
+
).Decode((value) => new TextEncoder().encode(value)).Encode((value) => {
|
|
674
|
+
if (value instanceof ArrayBuffer) {
|
|
675
|
+
return String.fromCharCode(...new Uint8Array(value));
|
|
676
|
+
}
|
|
677
|
+
return "";
|
|
678
|
+
});
|
|
1004
679
|
file = import_typebox.Type.Transform(
|
|
1005
680
|
import_typebox.Type.String({
|
|
1006
|
-
errorType:
|
|
1007
|
-
format:
|
|
1008
|
-
example:
|
|
1009
|
-
title:
|
|
681
|
+
errorType: "binary",
|
|
682
|
+
format: "binary",
|
|
683
|
+
example: "a utf-8 encodable string",
|
|
684
|
+
title: "File"
|
|
1010
685
|
})
|
|
1011
|
-
)
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
new InMemoryFile(value, name, { type: type22 })
|
|
1015
|
-
)
|
|
1016
|
-
.Encode((value) => value('name', 'type').content);
|
|
686
|
+
).Decode(
|
|
687
|
+
(value) => (name, type22) => new InMemoryFile(value, name, { type: type22 })
|
|
688
|
+
).Encode((value) => value("name", "type").content);
|
|
1017
689
|
type = () => this.any;
|
|
1018
690
|
/**
|
|
1019
691
|
* Extracts the error type of a schema for error messages.
|
|
@@ -1022,10 +694,7 @@ var TypeboxSchemaValidator = class {
|
|
|
1022
694
|
* @returns The type of the schema for error messages.
|
|
1023
695
|
*/
|
|
1024
696
|
errorType(schema) {
|
|
1025
|
-
if (
|
|
1026
|
-
import_typebox.KindGuard.IsSchema(schema) &&
|
|
1027
|
-
Object.hasOwn(schema, 'errorType')
|
|
1028
|
-
) {
|
|
697
|
+
if (import_typebox.KindGuard.IsSchema(schema) && Object.hasOwn(schema, "errorType")) {
|
|
1029
698
|
return schema.errorType;
|
|
1030
699
|
} else if (import_typebox.KindGuard.IsLiteral(schema)) {
|
|
1031
700
|
return schema.const;
|
|
@@ -1047,17 +716,10 @@ var TypeboxSchemaValidator = class {
|
|
|
1047
716
|
* @returns {TResolve<T>} The resolved schema.
|
|
1048
717
|
*/
|
|
1049
718
|
schemify(schema) {
|
|
1050
|
-
if (
|
|
1051
|
-
import_typebox.KindGuard.IsSchema(schema) ||
|
|
1052
|
-
schema instanceof import_compiler.TypeCheck
|
|
1053
|
-
) {
|
|
719
|
+
if (import_typebox.KindGuard.IsSchema(schema) || schema instanceof import_compiler.TypeCheck) {
|
|
1054
720
|
return schema;
|
|
1055
721
|
}
|
|
1056
|
-
if (
|
|
1057
|
-
typeof schema === 'string' ||
|
|
1058
|
-
typeof schema === 'number' ||
|
|
1059
|
-
typeof schema === 'boolean'
|
|
1060
|
-
) {
|
|
722
|
+
if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
|
|
1061
723
|
return import_typebox.Type.Literal(schema);
|
|
1062
724
|
}
|
|
1063
725
|
const newSchema = {};
|
|
@@ -1104,7 +766,7 @@ var TypeboxSchemaValidator = class {
|
|
|
1104
766
|
return this.schemify(schema);
|
|
1105
767
|
});
|
|
1106
768
|
return import_typebox.Type.Union(unionTypes, {
|
|
1107
|
-
errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(
|
|
769
|
+
errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(", ")}`,
|
|
1108
770
|
errorSuffix: true
|
|
1109
771
|
});
|
|
1110
772
|
}
|
|
@@ -1175,12 +837,7 @@ var TypeboxSchemaValidator = class {
|
|
|
1175
837
|
* @returns {boolean} True if the value is an instance of the schema.
|
|
1176
838
|
*/
|
|
1177
839
|
isInstanceOf(value, type22) {
|
|
1178
|
-
return
|
|
1179
|
-
typeof value === 'object' &&
|
|
1180
|
-
value != null &&
|
|
1181
|
-
import_typebox.Kind in value &&
|
|
1182
|
-
value[import_typebox.Kind] === type22[import_typebox.Kind]
|
|
1183
|
-
);
|
|
840
|
+
return typeof value === "object" && value != null && import_typebox.Kind in value && value[import_typebox.Kind] === type22[import_typebox.Kind];
|
|
1184
841
|
}
|
|
1185
842
|
/**
|
|
1186
843
|
* Validate a value against a schema.
|
|
@@ -1221,38 +878,33 @@ var TypeboxSchemaValidator = class {
|
|
|
1221
878
|
errors = Array.from(import_value.Value.Errors(schemified, value));
|
|
1222
879
|
}
|
|
1223
880
|
}
|
|
1224
|
-
return errors != null && errors.length === 0
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
: {
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
} else {
|
|
1247
|
-
return [
|
|
1248
|
-
{
|
|
1249
|
-
path: error.path.split('/').slice(1),
|
|
1250
|
-
message: error.message
|
|
1251
|
-
}
|
|
1252
|
-
];
|
|
881
|
+
return errors != null && errors.length === 0 ? {
|
|
882
|
+
ok: true,
|
|
883
|
+
value: conversion
|
|
884
|
+
} : {
|
|
885
|
+
ok: false,
|
|
886
|
+
errors: errors.flatMap((error) => {
|
|
887
|
+
if (error.type === import_errors.ValueErrorType.Union && error.schema.errorType.includes("any of")) {
|
|
888
|
+
return error.errors.flatMap(
|
|
889
|
+
(e, idx) => Array.from(e).map((e2) => ({
|
|
890
|
+
path: [
|
|
891
|
+
`Union Schema Variant ${idx}`,
|
|
892
|
+
...error.path.split("/").slice(1),
|
|
893
|
+
...e2.path.split("/").slice(1)
|
|
894
|
+
],
|
|
895
|
+
message: e2.message
|
|
896
|
+
}))
|
|
897
|
+
);
|
|
898
|
+
} else {
|
|
899
|
+
return [
|
|
900
|
+
{
|
|
901
|
+
path: error.path.split("/").slice(1),
|
|
902
|
+
message: error.message
|
|
1253
903
|
}
|
|
1254
|
-
|
|
1255
|
-
}
|
|
904
|
+
];
|
|
905
|
+
}
|
|
906
|
+
})
|
|
907
|
+
};
|
|
1256
908
|
}
|
|
1257
909
|
/**
|
|
1258
910
|
* Convert a schema to an OpenAPI schema object.
|
|
@@ -1263,33 +915,34 @@ var TypeboxSchemaValidator = class {
|
|
|
1263
915
|
let schemified = this.schemify(schema);
|
|
1264
916
|
if (import_typebox.KindGuard.IsDate(schemified)) {
|
|
1265
917
|
schemified = import_typebox.Type.String({
|
|
1266
|
-
format:
|
|
918
|
+
format: "date-time"
|
|
1267
919
|
});
|
|
1268
920
|
}
|
|
1269
921
|
const newSchema = Object.assign({}, schemified);
|
|
1270
|
-
if (Object.hasOwn(newSchema,
|
|
922
|
+
if (Object.hasOwn(newSchema, "properties")) {
|
|
1271
923
|
if (newSchema.properties) {
|
|
1272
924
|
Object.entries({ ...schemified.properties }).forEach(([key, value]) => {
|
|
1273
|
-
if (
|
|
1274
|
-
import_typebox.KindGuard.IsSchema(value) &&
|
|
1275
|
-
newSchema.properties
|
|
1276
|
-
) {
|
|
925
|
+
if (import_typebox.KindGuard.IsSchema(value) && newSchema.properties) {
|
|
1277
926
|
newSchema.properties[key] = this.openapi(value);
|
|
1278
927
|
}
|
|
1279
928
|
});
|
|
1280
929
|
}
|
|
1281
930
|
}
|
|
1282
|
-
if (Object.hasOwn(newSchema,
|
|
931
|
+
if (Object.hasOwn(newSchema, "items")) {
|
|
1283
932
|
newSchema.items = this.openapi(newSchema.items);
|
|
1284
933
|
}
|
|
1285
934
|
if (Array.isArray(newSchema.anyOf)) {
|
|
1286
|
-
newSchema.anyOf = newSchema.anyOf.map(
|
|
935
|
+
newSchema.anyOf = newSchema.anyOf.map(
|
|
936
|
+
(item) => this.openapi(item)
|
|
937
|
+
);
|
|
1287
938
|
}
|
|
1288
939
|
if (Array.isArray(newSchema.oneOf)) {
|
|
1289
|
-
newSchema.oneOf = newSchema.oneOf.map(
|
|
940
|
+
newSchema.oneOf = newSchema.oneOf.map(
|
|
941
|
+
(item) => this.openapi(item)
|
|
942
|
+
);
|
|
1290
943
|
}
|
|
1291
|
-
if (
|
|
1292
|
-
delete newSchema[
|
|
944
|
+
if ("errorType" in newSchema) {
|
|
945
|
+
delete newSchema["errorType"];
|
|
1293
946
|
}
|
|
1294
947
|
return newSchema;
|
|
1295
948
|
}
|
|
@@ -1338,170 +991,152 @@ var RedisWorkerOptionsSchema = {
|
|
|
1338
991
|
|
|
1339
992
|
// ../../../node_modules/.pnpm/@forklaunch+validator@0.6.16_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
1340
993
|
var import_zod_openapi = __toESM(require_src(), 1);
|
|
1341
|
-
var import_zod = require(
|
|
994
|
+
var import_zod = require("zod");
|
|
1342
995
|
(0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
|
|
1343
996
|
var ZodSchemaValidator = class {
|
|
1344
|
-
_Type =
|
|
997
|
+
_Type = "Zod";
|
|
1345
998
|
_SchemaCatchall;
|
|
1346
999
|
_ValidSchemaObject;
|
|
1347
1000
|
string = import_zod.z.string().openapi({
|
|
1348
|
-
title:
|
|
1349
|
-
example:
|
|
1001
|
+
title: "String",
|
|
1002
|
+
example: "a string"
|
|
1350
1003
|
});
|
|
1351
1004
|
uuid = import_zod.z.string().uuid().openapi({
|
|
1352
|
-
title:
|
|
1353
|
-
format:
|
|
1354
|
-
pattern:
|
|
1355
|
-
|
|
1356
|
-
example: 'a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6'
|
|
1005
|
+
title: "UUID",
|
|
1006
|
+
format: "uuid",
|
|
1007
|
+
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
|
|
1008
|
+
example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
|
|
1357
1009
|
});
|
|
1358
1010
|
email = import_zod.z.string().email().openapi({
|
|
1359
|
-
title:
|
|
1360
|
-
format:
|
|
1011
|
+
title: "Email",
|
|
1012
|
+
format: "email",
|
|
1361
1013
|
pattern: `(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])`,
|
|
1362
|
-
example:
|
|
1014
|
+
example: "a@b.com"
|
|
1363
1015
|
});
|
|
1364
1016
|
uri = import_zod.z.string().url().openapi({
|
|
1365
|
-
title:
|
|
1366
|
-
format:
|
|
1367
|
-
pattern:
|
|
1368
|
-
example:
|
|
1017
|
+
title: "URI",
|
|
1018
|
+
format: "uri",
|
|
1019
|
+
pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
|
|
1020
|
+
example: "https://forklaunch.com"
|
|
1369
1021
|
});
|
|
1370
|
-
number = import_zod.z
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
try {
|
|
1385
|
-
if (value instanceof Date) {
|
|
1386
|
-
return BigInt(value.getTime());
|
|
1387
|
-
}
|
|
1388
|
-
switch (typeof value) {
|
|
1389
|
-
case 'number':
|
|
1390
|
-
case 'string':
|
|
1391
|
-
return BigInt(value);
|
|
1392
|
-
case 'boolean':
|
|
1393
|
-
return BigInt(value ? 1 : 0);
|
|
1394
|
-
default:
|
|
1395
|
-
return value;
|
|
1396
|
-
}
|
|
1397
|
-
} catch {
|
|
1398
|
-
return value;
|
|
1022
|
+
number = import_zod.z.preprocess((value) => {
|
|
1023
|
+
try {
|
|
1024
|
+
return Number(value);
|
|
1025
|
+
} catch {
|
|
1026
|
+
return value;
|
|
1027
|
+
}
|
|
1028
|
+
}, import_zod.z.number()).openapi({
|
|
1029
|
+
title: "Number",
|
|
1030
|
+
example: 123
|
|
1031
|
+
});
|
|
1032
|
+
bigint = import_zod.z.preprocess((value) => {
|
|
1033
|
+
try {
|
|
1034
|
+
if (value instanceof Date) {
|
|
1035
|
+
return BigInt(value.getTime());
|
|
1399
1036
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
.preprocess((val) => {
|
|
1409
|
-
if (typeof val === 'string') {
|
|
1410
|
-
if (val.toLowerCase() === 'true') return true;
|
|
1411
|
-
if (val.toLowerCase() === 'false') return false;
|
|
1037
|
+
switch (typeof value) {
|
|
1038
|
+
case "number":
|
|
1039
|
+
case "string":
|
|
1040
|
+
return BigInt(value);
|
|
1041
|
+
case "boolean":
|
|
1042
|
+
return BigInt(value ? 1 : 0);
|
|
1043
|
+
default:
|
|
1044
|
+
return value;
|
|
1412
1045
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1046
|
+
} catch {
|
|
1047
|
+
return value;
|
|
1048
|
+
}
|
|
1049
|
+
}, import_zod.z.bigint()).openapi({
|
|
1050
|
+
title: "BigInt",
|
|
1051
|
+
type: "integer",
|
|
1052
|
+
format: "int64",
|
|
1053
|
+
example: 123n
|
|
1054
|
+
});
|
|
1055
|
+
boolean = import_zod.z.preprocess((val) => {
|
|
1056
|
+
if (typeof val === "string") {
|
|
1057
|
+
if (val.toLowerCase() === "true") return true;
|
|
1058
|
+
if (val.toLowerCase() === "false") return false;
|
|
1059
|
+
}
|
|
1060
|
+
return val;
|
|
1061
|
+
}, import_zod.z.boolean()).openapi({
|
|
1062
|
+
title: "Boolean",
|
|
1063
|
+
example: true
|
|
1064
|
+
});
|
|
1065
|
+
date = import_zod.z.preprocess((value) => {
|
|
1066
|
+
try {
|
|
1067
|
+
switch (typeof value) {
|
|
1068
|
+
case "string":
|
|
1069
|
+
return new Date(value);
|
|
1070
|
+
case "number":
|
|
1071
|
+
return new Date(value);
|
|
1072
|
+
default:
|
|
1073
|
+
return value;
|
|
1432
1074
|
}
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1075
|
+
} catch {
|
|
1076
|
+
return value;
|
|
1077
|
+
}
|
|
1078
|
+
}, import_zod.z.date()).openapi({
|
|
1079
|
+
title: "Date",
|
|
1080
|
+
type: "string",
|
|
1081
|
+
format: "date-time",
|
|
1082
|
+
example: "2025-05-16T21:13:04.123Z"
|
|
1083
|
+
});
|
|
1440
1084
|
symbol = import_zod.z.symbol().openapi({
|
|
1441
|
-
title:
|
|
1442
|
-
example: Symbol(
|
|
1085
|
+
title: "Symbol",
|
|
1086
|
+
example: Symbol("symbol")
|
|
1087
|
+
});
|
|
1088
|
+
nullish = import_zod.z.union([import_zod.z.void(), import_zod.z.null(), import_zod.z.undefined()]).openapi({
|
|
1089
|
+
title: "Nullish",
|
|
1090
|
+
type: "null",
|
|
1091
|
+
example: null
|
|
1443
1092
|
});
|
|
1444
|
-
nullish = import_zod.z
|
|
1445
|
-
.union([import_zod.z.void(), import_zod.z.null(), import_zod.z.undefined()])
|
|
1446
|
-
.openapi({
|
|
1447
|
-
title: 'Nullish',
|
|
1448
|
-
type: 'null',
|
|
1449
|
-
example: null
|
|
1450
|
-
});
|
|
1451
1093
|
void = import_zod.z.void().openapi({
|
|
1452
|
-
title:
|
|
1453
|
-
type:
|
|
1094
|
+
title: "Void",
|
|
1095
|
+
type: "null",
|
|
1454
1096
|
example: void 0
|
|
1455
1097
|
});
|
|
1456
1098
|
null = import_zod.z.null().openapi({
|
|
1457
|
-
title:
|
|
1458
|
-
type:
|
|
1099
|
+
title: "Null",
|
|
1100
|
+
type: "null",
|
|
1459
1101
|
example: null
|
|
1460
1102
|
});
|
|
1461
1103
|
undefined = import_zod.z.undefined().openapi({
|
|
1462
|
-
title:
|
|
1463
|
-
type:
|
|
1104
|
+
title: "Undefined",
|
|
1105
|
+
type: "null",
|
|
1464
1106
|
example: void 0
|
|
1465
1107
|
});
|
|
1466
1108
|
any = import_zod.z.any().openapi({
|
|
1467
|
-
title:
|
|
1468
|
-
type:
|
|
1469
|
-
example:
|
|
1109
|
+
title: "Any",
|
|
1110
|
+
type: "object",
|
|
1111
|
+
example: "any"
|
|
1470
1112
|
});
|
|
1471
1113
|
unknown = import_zod.z.unknown().openapi({
|
|
1472
|
-
title:
|
|
1473
|
-
type:
|
|
1474
|
-
example:
|
|
1114
|
+
title: "Unknown",
|
|
1115
|
+
type: "object",
|
|
1116
|
+
example: "unknown"
|
|
1475
1117
|
});
|
|
1476
1118
|
never = import_zod.z.never().openapi({
|
|
1477
|
-
title:
|
|
1478
|
-
type:
|
|
1479
|
-
example:
|
|
1119
|
+
title: "Never",
|
|
1120
|
+
type: "null",
|
|
1121
|
+
example: "never"
|
|
1480
1122
|
});
|
|
1481
|
-
binary = import_zod.z
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
.string()
|
|
1492
|
-
.transform((val) => {
|
|
1493
|
-
return (name, type22) =>
|
|
1494
|
-
new File([val], name, {
|
|
1495
|
-
type: type22,
|
|
1496
|
-
lastModified: Date.now()
|
|
1497
|
-
});
|
|
1498
|
-
})
|
|
1499
|
-
.openapi({
|
|
1500
|
-
title: 'File',
|
|
1501
|
-
type: 'string',
|
|
1502
|
-
format: 'binary',
|
|
1503
|
-
example: 'a utf-8 encodable string'
|
|
1123
|
+
binary = import_zod.z.string().transform((v) => new TextEncoder().encode(v)).openapi({
|
|
1124
|
+
title: "Binary",
|
|
1125
|
+
type: "string",
|
|
1126
|
+
format: "binary",
|
|
1127
|
+
example: "a utf-8 encodable string"
|
|
1128
|
+
});
|
|
1129
|
+
file = import_zod.z.string().transform((val) => {
|
|
1130
|
+
return (name, type22) => new File([val], name, {
|
|
1131
|
+
type: type22,
|
|
1132
|
+
lastModified: Date.now()
|
|
1504
1133
|
});
|
|
1134
|
+
}).openapi({
|
|
1135
|
+
title: "File",
|
|
1136
|
+
type: "string",
|
|
1137
|
+
format: "binary",
|
|
1138
|
+
example: "a utf-8 encodable string"
|
|
1139
|
+
});
|
|
1505
1140
|
type = () => this.any;
|
|
1506
1141
|
/**
|
|
1507
1142
|
* Compiles schema if this exists, for optimal performance.
|
|
@@ -1518,11 +1153,7 @@ var ZodSchemaValidator = class {
|
|
|
1518
1153
|
* @returns {ZodResolve<T>} The resolved schema.
|
|
1519
1154
|
*/
|
|
1520
1155
|
schemify(schema) {
|
|
1521
|
-
if (
|
|
1522
|
-
typeof schema === 'string' ||
|
|
1523
|
-
typeof schema === 'number' ||
|
|
1524
|
-
typeof schema === 'boolean'
|
|
1525
|
-
) {
|
|
1156
|
+
if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
|
|
1526
1157
|
return import_zod.z.literal(schema);
|
|
1527
1158
|
}
|
|
1528
1159
|
if (schema instanceof import_zod.ZodType) {
|
|
@@ -1563,7 +1194,9 @@ var ZodSchemaValidator = class {
|
|
|
1563
1194
|
*/
|
|
1564
1195
|
union(schemas) {
|
|
1565
1196
|
const resolvedSchemas = schemas.map((schema) => this.schemify(schema));
|
|
1566
|
-
return import_zod.z.union(
|
|
1197
|
+
return import_zod.z.union(
|
|
1198
|
+
resolvedSchemas
|
|
1199
|
+
);
|
|
1567
1200
|
}
|
|
1568
1201
|
/**
|
|
1569
1202
|
* Create a literal schema.
|
|
@@ -1579,7 +1212,9 @@ var ZodSchemaValidator = class {
|
|
|
1579
1212
|
* @returns {ZodUnion<UnionZodResolve<[T, T, ...T[]]>>} The enum schema.
|
|
1580
1213
|
*/
|
|
1581
1214
|
enum_(schemaEnum) {
|
|
1582
|
-
return this.union(
|
|
1215
|
+
return this.union(
|
|
1216
|
+
Object.values(schemaEnum)
|
|
1217
|
+
);
|
|
1583
1218
|
}
|
|
1584
1219
|
/**
|
|
1585
1220
|
* Create a function schema.
|
|
@@ -1590,10 +1225,7 @@ var ZodSchemaValidator = class {
|
|
|
1590
1225
|
function_(args, returnType) {
|
|
1591
1226
|
const schemaArgs = args.map((schema) => this.schemify(schema));
|
|
1592
1227
|
const schemaReturnType = this.schemify(returnType);
|
|
1593
|
-
return import_zod.z.function(
|
|
1594
|
-
import_zod.z.tuple(schemaArgs),
|
|
1595
|
-
schemaReturnType
|
|
1596
|
-
);
|
|
1228
|
+
return import_zod.z.function(import_zod.z.tuple(schemaArgs), schemaReturnType);
|
|
1597
1229
|
}
|
|
1598
1230
|
/**
|
|
1599
1231
|
* Create a record schema.
|
|
@@ -1651,33 +1283,31 @@ var ZodSchemaValidator = class {
|
|
|
1651
1283
|
parse(schema, value) {
|
|
1652
1284
|
const resolvedSchema = this.schemify(schema);
|
|
1653
1285
|
const result = resolvedSchema.safeParse(value);
|
|
1654
|
-
return result.success
|
|
1655
|
-
|
|
1656
|
-
: {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
})
|
|
1680
|
-
};
|
|
1286
|
+
return result.success ? { ok: true, value: result.data } : {
|
|
1287
|
+
ok: false,
|
|
1288
|
+
errors: result.error.errors.flatMap((error) => {
|
|
1289
|
+
switch (error.code) {
|
|
1290
|
+
case "invalid_union":
|
|
1291
|
+
return error.unionErrors.flatMap(
|
|
1292
|
+
(unionError, idx) => unionError.errors.map((e) => ({
|
|
1293
|
+
path: [
|
|
1294
|
+
`Union Schema Variant ${idx}`,
|
|
1295
|
+
...error.path.map((p) => p.toString()),
|
|
1296
|
+
...e.path.map((p) => p.toString())
|
|
1297
|
+
],
|
|
1298
|
+
message: e.message
|
|
1299
|
+
}))
|
|
1300
|
+
);
|
|
1301
|
+
default:
|
|
1302
|
+
return [
|
|
1303
|
+
{
|
|
1304
|
+
path: error.path.map((p) => p.toString()),
|
|
1305
|
+
message: error.message
|
|
1306
|
+
}
|
|
1307
|
+
];
|
|
1308
|
+
}
|
|
1309
|
+
})
|
|
1310
|
+
};
|
|
1681
1311
|
}
|
|
1682
1312
|
/**
|
|
1683
1313
|
* Convert a schema to an OpenAPI schema object.
|
|
@@ -1736,7 +1366,6 @@ var RedisWorkerSchemas = (0, import_internal.serviceSchemaResolver)(
|
|
|
1736
1366
|
() => RedisWorkerOptionsSchema2
|
|
1737
1367
|
);
|
|
1738
1368
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1739
|
-
0 &&
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
});
|
|
1369
|
+
0 && (module.exports = {
|
|
1370
|
+
RedisWorkerSchemas
|
|
1371
|
+
});
|