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