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