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