@forklaunch/implementation-worker-bullmq 0.3.1 → 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.
@@ -0,0 +1,1744 @@
1
+ 'use strict';
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
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
+ };
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if ((from && typeof from === 'object') || typeof from === 'function') {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, {
25
+ get: () => from[key],
26
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
+ });
28
+ }
29
+ return to;
30
+ };
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);
46
+
47
+ // ../../../node_modules/.pnpm/ts-deepmerge@6.2.1/node_modules/ts-deepmerge/cjs/index.js
48
+ var require_cjs = __commonJS({
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 });
54
+ var isObject = (obj) => {
55
+ if (typeof obj === 'object' && obj !== null) {
56
+ if (typeof Object.getPrototypeOf === 'function') {
57
+ const prototype = Object.getPrototypeOf(obj);
58
+ return prototype === Object.prototype || prototype === null;
59
+ }
60
+ return Object.prototype.toString.call(obj) === '[object Object]';
61
+ }
62
+ return false;
63
+ };
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
+ );
70
+ }
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
+ }, {});
94
+ var defaultOptions = {
95
+ allowUndefinedOverrides: true,
96
+ mergeArrays: true,
97
+ uniqueArrayItems: true
98
+ };
99
+ merge.options = defaultOptions;
100
+ merge.withOptions = (options, ...objects) => {
101
+ merge.options = Object.assign(Object.assign({}, defaultOptions), options);
102
+ const result = merge(...objects);
103
+ merge.options = defaultOptions;
104
+ return result;
105
+ };
106
+ exports2.default = merge;
107
+ }
108
+ });
109
+
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
111
+ var require_zod_openapi = __commonJS({
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 });
117
+ exports2.generateSchema = exports2.extendApi = void 0;
118
+ var ts_deepmerge_1 = require_cjs();
119
+ var zod_1 = require('zod');
120
+ function extendApi(schema, schemaObject = {}) {
121
+ const This = schema.constructor;
122
+ const newSchema = new This(schema._def);
123
+ newSchema.metaOpenApi = Object.assign(
124
+ {},
125
+ schema.metaOpenApi || {},
126
+ schemaObject
127
+ );
128
+ return newSchema;
129
+ }
130
+ exports2.extendApi = extendApi;
131
+ function iterateZodObject({
132
+ zodRef,
133
+ useOutput,
134
+ hideDefinitions,
135
+ openApiVersion
136
+ }) {
137
+ const reduced = Object.keys(zodRef.shape)
138
+ .filter(
139
+ (key) =>
140
+ (hideDefinitions === null || hideDefinitions === void 0
141
+ ? void 0
142
+ : hideDefinitions.includes(key)) === false
143
+ )
144
+ .reduce(
145
+ (carry, key) =>
146
+ Object.assign(Object.assign({}, carry), {
147
+ [key]: generateSchema2(
148
+ zodRef.shape[key],
149
+ useOutput,
150
+ openApiVersion
151
+ )
152
+ }),
153
+ {}
154
+ );
155
+ return reduced;
156
+ }
157
+ function typeFormat(type3, openApiVersion) {
158
+ return openApiVersion === '3.0' ? type3 : [type3];
159
+ }
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';
172
+ if (useOutput && zodRef._def.effect) {
173
+ const effect =
174
+ zodRef._def.effect.type === 'transform' ? zodRef._def.effect : null;
175
+ if (effect && 'transform' in effect) {
176
+ try {
177
+ const type3 = Array.isArray(input.type)
178
+ ? input.type[0]
179
+ : input.type;
180
+ output = typeof effect.transform(
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,
194
+ { addIssue: () => void 0, path: [] }
195
+ // TODO: Discover if context is necessary here
196
+ );
197
+ } catch (e) {}
198
+ }
199
+ }
200
+ const outputType = output;
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
+ );
218
+ }
219
+ function parseString({ zodRef, schemas, openApiVersion }) {
220
+ const baseSchema = {
221
+ type: typeFormat('string', openApiVersion)
222
+ };
223
+ const { checks = [] } = zodRef._def;
224
+ checks.forEach((item) => {
225
+ switch (item.kind) {
226
+ case 'email':
227
+ baseSchema.format = 'email';
228
+ break;
229
+ case 'uuid':
230
+ baseSchema.format = 'uuid';
231
+ break;
232
+ case 'cuid':
233
+ baseSchema.format = 'cuid';
234
+ break;
235
+ case 'url':
236
+ baseSchema.format = 'uri';
237
+ break;
238
+ case 'datetime':
239
+ baseSchema.format = 'date-time';
240
+ break;
241
+ case 'length':
242
+ baseSchema.minLength = item.value;
243
+ baseSchema.maxLength = item.value;
244
+ break;
245
+ case 'max':
246
+ baseSchema.maxLength = item.value;
247
+ break;
248
+ case 'min':
249
+ baseSchema.minLength = item.value;
250
+ break;
251
+ case 'regex':
252
+ baseSchema.pattern = item.regex.source;
253
+ break;
254
+ }
255
+ });
256
+ return (0, ts_deepmerge_1.default)(
257
+ baseSchema,
258
+ zodRef.description ? { description: zodRef.description } : {},
259
+ ...schemas
260
+ );
261
+ }
262
+ function parseNumber({ zodRef, schemas, openApiVersion }) {
263
+ const baseSchema = {
264
+ type: typeFormat('number', openApiVersion)
265
+ };
266
+ const { checks = [] } = zodRef._def;
267
+ checks.forEach((item) => {
268
+ switch (item.kind) {
269
+ case 'max':
270
+ if (item.inclusive || openApiVersion === '3.0') {
271
+ baseSchema.maximum = item.value;
272
+ }
273
+ if (!item.inclusive) {
274
+ if (openApiVersion === '3.0') {
275
+ baseSchema.exclusiveMaximum = true;
276
+ } else {
277
+ baseSchema.exclusiveMaximum = item.value;
278
+ }
279
+ }
280
+ break;
281
+ case 'min':
282
+ if (item.inclusive || openApiVersion === '3.0') {
283
+ baseSchema.minimum = item.value;
284
+ }
285
+ if (!item.inclusive) {
286
+ if (openApiVersion === '3.0') {
287
+ baseSchema.exclusiveMinimum = true;
288
+ } else {
289
+ baseSchema.exclusiveMinimum = item.value;
290
+ }
291
+ }
292
+ break;
293
+ case 'int':
294
+ baseSchema.type = typeFormat('integer', openApiVersion);
295
+ break;
296
+ case 'multipleOf':
297
+ baseSchema.multipleOf = item.value;
298
+ break;
299
+ }
300
+ });
301
+ return (0, ts_deepmerge_1.default)(
302
+ baseSchema,
303
+ zodRef.description ? { description: zodRef.description } : {},
304
+ ...schemas
305
+ );
306
+ }
307
+ function getExcludedDefinitionsFromSchema(schemas) {
308
+ const excludedDefinitions = [];
309
+ for (const schema of schemas) {
310
+ if (Array.isArray(schema.hideDefinitions)) {
311
+ excludedDefinitions.push(...schema.hideDefinitions);
312
+ }
313
+ }
314
+ return excludedDefinitions;
315
+ }
316
+ function parseObject({
317
+ zodRef,
318
+ schemas,
319
+ useOutput,
320
+ hideDefinitions,
321
+ openApiVersion
322
+ }) {
323
+ var _a;
324
+ let additionalProperties;
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')
339
+ additionalProperties = true;
340
+ else if (zodRef._def.unknownKeys === 'strict')
341
+ additionalProperties = false;
342
+ additionalProperties =
343
+ additionalProperties != null ? { additionalProperties } : {};
344
+ const requiredProperties = Object.keys(zodRef.shape).filter((key) => {
345
+ const item = zodRef.shape[key];
346
+ return (
347
+ !(
348
+ item.isOptional() ||
349
+ item instanceof zod_1.z.ZodDefault ||
350
+ item._def.typeName === 'ZodDefault'
351
+ ) &&
352
+ !(
353
+ item instanceof zod_1.z.ZodNever ||
354
+ item._def.typeName === 'ZodDefault'
355
+ )
356
+ );
357
+ });
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
+ );
385
+ }
386
+ function parseRecord({ zodRef, schemas, useOutput, openApiVersion }) {
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
+ );
402
+ }
403
+ function parseBigInt({ zodRef, schemas, openApiVersion }) {
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
+ );
412
+ }
413
+ function parseBoolean({ zodRef, schemas, openApiVersion }) {
414
+ return (0, ts_deepmerge_1.default)(
415
+ { type: typeFormat('boolean', openApiVersion) },
416
+ zodRef.description ? { description: zodRef.description } : {},
417
+ ...schemas
418
+ );
419
+ }
420
+ function parseDate({ zodRef, schemas, openApiVersion }) {
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
+ );
429
+ }
430
+ function parseNull({ zodRef, schemas, openApiVersion }) {
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
+ );
441
+ }
442
+ function parseOptional({ schemas, zodRef, useOutput, openApiVersion }) {
443
+ return (0, ts_deepmerge_1.default)(
444
+ generateSchema2(zodRef.unwrap(), useOutput, openApiVersion),
445
+ zodRef.description ? { description: zodRef.description } : {},
446
+ ...schemas
447
+ );
448
+ }
449
+ function parseNullable({ schemas, zodRef, useOutput, openApiVersion }) {
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
+ );
463
+ }
464
+ function parseDefault({ schemas, zodRef, useOutput, openApiVersion }) {
465
+ return (0, ts_deepmerge_1.default)(
466
+ Object.assign(
467
+ { default: zodRef._def.defaultValue() },
468
+ generateSchema2(zodRef._def.innerType, useOutput, openApiVersion)
469
+ ),
470
+ zodRef.description ? { description: zodRef.description } : {},
471
+ ...schemas
472
+ );
473
+ }
474
+ function parseArray({ schemas, zodRef, useOutput, openApiVersion }) {
475
+ const constraints = {};
476
+ if (zodRef._def.exactLength != null) {
477
+ constraints.minItems = zodRef._def.exactLength.value;
478
+ constraints.maxItems = zodRef._def.exactLength.value;
479
+ }
480
+ if (zodRef._def.minLength != null)
481
+ constraints.minItems = zodRef._def.minLength.value;
482
+ if (zodRef._def.maxLength != null)
483
+ constraints.maxItems = zodRef._def.maxLength.value;
484
+ return (0, ts_deepmerge_1.default)(
485
+ Object.assign(
486
+ {
487
+ type: typeFormat('array', openApiVersion),
488
+ items: generateSchema2(zodRef.element, useOutput, openApiVersion)
489
+ },
490
+ constraints
491
+ ),
492
+ zodRef.description ? { description: zodRef.description } : {},
493
+ ...schemas
494
+ );
495
+ }
496
+ function parseLiteral({ schemas, zodRef, openApiVersion }) {
497
+ const type3 = typeof zodRef._def.value;
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
+ );
506
+ }
507
+ function parseEnum({ schemas, zodRef, openApiVersion }) {
508
+ const type3 = typeof Object.values(zodRef._def.values)[0];
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
+ );
517
+ }
518
+ function parseIntersection({ schemas, zodRef, useOutput, openApiVersion }) {
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
+ );
529
+ }
530
+ function parseUnion({ schemas, zodRef, useOutput, openApiVersion }) {
531
+ const contents = zodRef._def.options;
532
+ if (
533
+ contents.reduce(
534
+ (prev, content) => prev && content._def.typeName === 'ZodLiteral',
535
+ true
536
+ )
537
+ ) {
538
+ const literals = contents;
539
+ const type3 = literals.reduce(
540
+ (prev, content) =>
541
+ !prev || prev === typeof content._def.value
542
+ ? typeof content._def.value
543
+ : null,
544
+ null
545
+ );
546
+ if (type3) {
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
+ );
555
+ }
556
+ }
557
+ const oneOfContents =
558
+ openApiVersion === '3.0'
559
+ ? contents.filter((content) => content._def.typeName !== 'ZodNull')
560
+ : contents;
561
+ const contentsHasNull = contents.length != oneOfContents.length;
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
+ );
572
+ }
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
+ )
587
+ },
588
+ zodRef.description ? { description: zodRef.description } : {},
589
+ ...schemas
590
+ );
591
+ }
592
+ function parseNever({ zodRef, schemas }) {
593
+ return (0, ts_deepmerge_1.default)(
594
+ { readOnly: true },
595
+ zodRef.description ? { description: zodRef.description } : {},
596
+ ...schemas
597
+ );
598
+ }
599
+ function parseBranded({ schemas, zodRef, useOutput, openApiVersion }) {
600
+ return (0, ts_deepmerge_1.default)(
601
+ generateSchema2(zodRef._def.type, useOutput, openApiVersion),
602
+ ...schemas
603
+ );
604
+ }
605
+ function catchAllParser({ zodRef, schemas }) {
606
+ return (0, ts_deepmerge_1.default)(
607
+ zodRef.description ? { description: zodRef.description } : {},
608
+ ...schemas
609
+ );
610
+ }
611
+ function parsePipeline({ schemas, zodRef, useOutput, openApiVersion }) {
612
+ return (0, ts_deepmerge_1.default)(
613
+ generateSchema2(
614
+ useOutput ? zodRef._def.out : zodRef._def.in,
615
+ useOutput,
616
+ openApiVersion
617
+ ),
618
+ ...schemas
619
+ );
620
+ }
621
+ function parseReadonly({ zodRef, useOutput, schemas, openApiVersion }) {
622
+ return (0, ts_deepmerge_1.default)(
623
+ generateSchema2(zodRef._def.innerType, useOutput, openApiVersion),
624
+ zodRef.description ? { description: zodRef.description } : {},
625
+ ...schemas
626
+ );
627
+ }
628
+ var workerMap = {
629
+ ZodObject: parseObject,
630
+ ZodRecord: parseRecord,
631
+ ZodString: parseString,
632
+ ZodNumber: parseNumber,
633
+ ZodBigInt: parseBigInt,
634
+ ZodBoolean: parseBoolean,
635
+ ZodDate: parseDate,
636
+ ZodNull: parseNull,
637
+ ZodOptional: parseOptional,
638
+ ZodNullable: parseNullable,
639
+ ZodDefault: parseDefault,
640
+ ZodArray: parseArray,
641
+ ZodLiteral: parseLiteral,
642
+ ZodEnum: parseEnum,
643
+ ZodNativeEnum: parseEnum,
644
+ ZodTransformer: parseTransformation,
645
+ ZodEffects: parseTransformation,
646
+ ZodIntersection: parseIntersection,
647
+ ZodUnion: parseUnion,
648
+ ZodDiscriminatedUnion: parseDiscriminatedUnion,
649
+ ZodNever: parseNever,
650
+ ZodBranded: parseBranded,
651
+ // TODO Transform the rest to schemas
652
+ ZodUndefined: catchAllParser,
653
+ // TODO: `prefixItems` is allowed in OpenAPI 3.1 which can be used to create tuples
654
+ ZodTuple: catchAllParser,
655
+ ZodMap: catchAllParser,
656
+ ZodFunction: catchAllParser,
657
+ ZodLazy: catchAllParser,
658
+ ZodPromise: catchAllParser,
659
+ ZodAny: catchAllParser,
660
+ ZodUnknown: catchAllParser,
661
+ ZodVoid: catchAllParser,
662
+ ZodPipeline: parsePipeline,
663
+ ZodReadonly: parseReadonly
664
+ };
665
+ function generateSchema2(
666
+ zodRef,
667
+ useOutput = false,
668
+ openApiVersion = '3.1'
669
+ ) {
670
+ const { metaOpenApi = {} } = zodRef;
671
+ const schemas = [
672
+ ...(Array.isArray(metaOpenApi) ? metaOpenApi : [metaOpenApi])
673
+ ];
674
+ try {
675
+ const typeName = zodRef._def.typeName;
676
+ if (typeName in workerMap) {
677
+ return workerMap[typeName]({
678
+ zodRef,
679
+ schemas,
680
+ useOutput,
681
+ openApiVersion
682
+ });
683
+ }
684
+ return catchAllParser({ zodRef, schemas, openApiVersion });
685
+ } catch (err) {
686
+ console.error(err);
687
+ return catchAllParser({ zodRef, schemas, openApiVersion });
688
+ }
689
+ }
690
+ exports2.generateSchema = generateSchema2;
691
+ }
692
+ });
693
+
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
695
+ var require_zod_extensions = __commonJS({
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 });
701
+ exports2.extendZodWithOpenApi = void 0;
702
+ var zod_openapi_1 = require_zod_openapi();
703
+ function extendZodWithOpenApi2(zod, forceOverride = false) {
704
+ if (
705
+ !forceOverride &&
706
+ typeof zod.ZodSchema.prototype.openapi !== 'undefined'
707
+ ) {
708
+ return;
709
+ }
710
+ zod.ZodSchema.prototype.openapi = function (metadata) {
711
+ return (0, zod_openapi_1.extendApi)(this, metadata);
712
+ };
713
+ }
714
+ exports2.extendZodWithOpenApi = extendZodWithOpenApi2;
715
+ }
716
+ });
717
+
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
719
+ var require_src = __commonJS({
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 });
760
+ __exportStar(require_zod_openapi(), exports2);
761
+ __exportStar(require_zod_extensions(), exports2);
762
+ }
763
+ });
764
+
765
+ // domain/schemas/index.ts
766
+ var schemas_exports = {};
767
+ __export(schemas_exports, {
768
+ BullMqWorkerSchemas: () => BullMqWorkerSchemas
769
+ });
770
+ module.exports = __toCommonJS(schemas_exports);
771
+
772
+ // domain/schemas/bullMqWorker.schema.ts
773
+ var import_internal = require('@forklaunch/internal');
774
+
775
+ // ../../../node_modules/.pnpm/@forklaunch+common@0.3.14/node_modules/@forklaunch/common/lib/index.mjs
776
+ var InMemoryFile = class extends File {
777
+ constructor(content, name, { type: type3, endings, lastModified }) {
778
+ super([Buffer.from(content)], name, {
779
+ type: type3,
780
+ endings,
781
+ lastModified
782
+ });
783
+ this.content = content;
784
+ }
785
+ };
786
+
787
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.6.16_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
788
+ var import_typebox = require('@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
+ );
796
+ (0, import_errors.SetErrorFunction)((params) => {
797
+ switch (params.errorType) {
798
+ case import_errors.ValueErrorType.Union:
799
+ case import_errors.ValueErrorType.Array:
800
+ case import_errors.ValueErrorType.String:
801
+ case import_errors.ValueErrorType.Number:
802
+ return params.schema.errorType
803
+ ? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? 's' : ''}`
804
+ : (0, import_errors.DefaultErrorFunction)(params);
805
+ default:
806
+ return (0, import_errors.DefaultErrorFunction)(params);
807
+ }
808
+ });
809
+ var TypeboxSchemaValidator = class {
810
+ _Type = 'TypeBox';
811
+ _SchemaCatchall;
812
+ _ValidSchemaObject;
813
+ string = import_typebox.Type.String({
814
+ example: 'a string',
815
+ title: 'String'
816
+ });
817
+ uuid = import_typebox.Type.String({
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'
823
+ });
824
+ email = import_typebox.Type.String({
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])+)])`,
826
+ errorType: 'email',
827
+ example: 'a@b.com',
828
+ title: 'Email'
829
+ });
830
+ uri = import_typebox.Type.String({
831
+ pattern: '^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$',
832
+ errorType: 'uri',
833
+ example: 'https://forklaunch.com',
834
+ title: 'URI'
835
+ });
836
+ number = import_typebox.Type.Transform(
837
+ import_typebox.Type.Union(
838
+ [
839
+ import_typebox.Type.Number(),
840
+ import_typebox.Type.String({ pattern: '^[0-9]+$' }),
841
+ import_typebox.Type.Boolean(),
842
+ import_typebox.Type.Null(),
843
+ import_typebox.Type.BigInt(),
844
+ import_typebox.Type.Date()
845
+ ],
846
+ {
847
+ errorType: 'number-like',
848
+ example: 123,
849
+ title: 'Number'
850
+ }
851
+ )
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
+ }
861
+ }
862
+ return value;
863
+ })
864
+ .Encode(Number);
865
+ bigint = import_typebox.Type.Transform(
866
+ import_typebox.Type.Union(
867
+ [
868
+ import_typebox.Type.BigInt(),
869
+ import_typebox.Type.Number(),
870
+ import_typebox.Type.String({ pattern: '^[0-9]+n?$' }),
871
+ import_typebox.Type.Boolean(),
872
+ import_typebox.Type.Date()
873
+ ],
874
+ {
875
+ errorType: 'BigInt-like',
876
+ example: 123n,
877
+ title: 'BigInt'
878
+ }
879
+ )
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');
890
+ }
891
+ }
892
+ return value;
893
+ })
894
+ .Encode(BigInt);
895
+ boolean = import_typebox.Type.Transform(
896
+ import_typebox.Type.Union(
897
+ [
898
+ import_typebox.Type.Boolean(),
899
+ import_typebox.Type.String({
900
+ pattern: '^(t|T)(r|R)(u|U)(e|E)$|^(f|F)(a|A)(l|L)(s|S)(e|E)$'
901
+ })
902
+ ],
903
+ {
904
+ errorType: 'boolean-like',
905
+ example: true,
906
+ title: 'Boolean'
907
+ }
908
+ )
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);
919
+ date = import_typebox.Type.Transform(
920
+ import_typebox.Type.Union(
921
+ [
922
+ import_typebox.Type.String({
923
+ pattern:
924
+ '^\\d{4}(-\\d{2}){0,2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,3})?)?(Z|([+-]\\d{2}:\\d{2}))?)?$|^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$|^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$|^\\d+$'
925
+ }),
926
+ import_typebox.Type.Number(),
927
+ import_typebox.Type.Date()
928
+ ],
929
+ {
930
+ errorType: 'date',
931
+ example: '2025-05-16T21:13:04.123Z',
932
+ title: 'Date'
933
+ }
934
+ )
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());
943
+ symbol = import_typebox.Type.Symbol({
944
+ title: 'Symbol'
945
+ });
946
+ nullish = import_typebox.Type.Union(
947
+ [
948
+ import_typebox.Type.Void(),
949
+ import_typebox.Type.Null(),
950
+ import_typebox.Type.Undefined()
951
+ ],
952
+ {
953
+ errorType: 'nullish',
954
+ type: 'null',
955
+ example: 'null',
956
+ title: 'Nullish'
957
+ }
958
+ );
959
+ void = import_typebox.Type.Void({
960
+ type: 'null',
961
+ example: 'void',
962
+ title: 'Void'
963
+ });
964
+ null = import_typebox.Type.Null({
965
+ type: 'null',
966
+ example: 'null',
967
+ title: 'Null'
968
+ });
969
+ undefined = import_typebox.Type.Undefined({
970
+ type: 'null',
971
+ example: 'undefined',
972
+ title: 'Undefined'
973
+ });
974
+ any = import_typebox.Type.Any({
975
+ type: 'object',
976
+ example: 'any',
977
+ title: 'Any'
978
+ });
979
+ unknown = import_typebox.Type.Unknown({
980
+ type: 'object',
981
+ example: 'unknown',
982
+ title: 'Unknown'
983
+ });
984
+ never = import_typebox.Type.Never({
985
+ type: 'null',
986
+ example: 'never',
987
+ title: 'Never'
988
+ });
989
+ binary = import_typebox.Type.Transform(
990
+ import_typebox.Type.String({
991
+ errorType: 'binary',
992
+ format: 'binary',
993
+ example: 'a utf-8 encodable string',
994
+ title: 'Binary'
995
+ })
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
+ });
1004
+ file = import_typebox.Type.Transform(
1005
+ import_typebox.Type.String({
1006
+ errorType: 'binary',
1007
+ format: 'binary',
1008
+ example: 'a utf-8 encodable string',
1009
+ title: 'File'
1010
+ })
1011
+ )
1012
+ .Decode(
1013
+ (value) => (name, type22) =>
1014
+ new InMemoryFile(value, name, { type: type22 })
1015
+ )
1016
+ .Encode((value) => value('name', 'type').content);
1017
+ type = () => this.any;
1018
+ /**
1019
+ * Extracts the error type of a schema for error messages.
1020
+ *
1021
+ * @param {TCatchall} schema - A schema that contains some type information.
1022
+ * @returns The type of the schema for error messages.
1023
+ */
1024
+ errorType(schema) {
1025
+ if (
1026
+ import_typebox.KindGuard.IsSchema(schema) &&
1027
+ Object.hasOwn(schema, 'errorType')
1028
+ ) {
1029
+ return schema.errorType;
1030
+ } else if (import_typebox.KindGuard.IsLiteral(schema)) {
1031
+ return schema.const;
1032
+ }
1033
+ return schema[import_typebox.Kind].toLowerCase();
1034
+ }
1035
+ /**
1036
+ * Compiles schema if this exists, for optimal performance.
1037
+ *
1038
+ * @param {TObject<TProperties>} schema - The schema to compile.
1039
+ * @returns {TypeCheck<T>} - The compiled schema.
1040
+ */
1041
+ compile(schema) {
1042
+ return import_compiler.TypeCompiler.Compile(schema);
1043
+ }
1044
+ /**
1045
+ * Convert a schema to a TypeBox schema.
1046
+ * @param {TIdiomaticSchema} schema - The schema to convert.
1047
+ * @returns {TResolve<T>} The resolved schema.
1048
+ */
1049
+ schemify(schema) {
1050
+ if (
1051
+ import_typebox.KindGuard.IsSchema(schema) ||
1052
+ schema instanceof import_compiler.TypeCheck
1053
+ ) {
1054
+ return schema;
1055
+ }
1056
+ if (
1057
+ typeof schema === 'string' ||
1058
+ typeof schema === 'number' ||
1059
+ typeof schema === 'boolean'
1060
+ ) {
1061
+ return import_typebox.Type.Literal(schema);
1062
+ }
1063
+ const newSchema = {};
1064
+ Object.getOwnPropertyNames(schema).forEach((key) => {
1065
+ if (import_typebox.KindGuard.IsSchema(schema[key])) {
1066
+ newSchema[key] = schema[key];
1067
+ } else {
1068
+ const schemified = this.schemify(schema[key]);
1069
+ newSchema[key] = schemified;
1070
+ }
1071
+ });
1072
+ return import_typebox.Type.Object(newSchema);
1073
+ }
1074
+ /**
1075
+ * Make a schema optional.
1076
+ * @param {TIdiomaticSchema} schema - The schema to make optional.
1077
+ * @returns {TOptional<TResolve<T>>} The optional schema.
1078
+ */
1079
+ optional(schema) {
1080
+ const schemified = this.schemify(schema);
1081
+ return import_typebox.Type.Optional(schemified);
1082
+ }
1083
+ /**
1084
+ * Create an array schema.
1085
+ * @param {TIdiomaticSchema} schema - The schema to use for array items.
1086
+ * @returns {TArray<TResolve<T>>} The array schema.
1087
+ */
1088
+ array(schema) {
1089
+ const schemified = this.schemify(schema);
1090
+ return import_typebox.Type.Array(schemified, {
1091
+ errorType: `array of ${this.errorType(schemified)}`
1092
+ });
1093
+ }
1094
+ /**
1095
+ * Create a union schema.
1096
+ * @param {TUnionTupleContainer} schemas - The schemas to union.
1097
+ * @returns {TUnion<UnionTupleTResolve<T>>} The union schema.
1098
+ *
1099
+ * WARNING: If "nullish" or TUndefined is included in the union, the key will still be expected.
1100
+ * This is a limitation of TypeBox. Consider using "optional" instead.
1101
+ */
1102
+ union(schemas) {
1103
+ const unionTypes = schemas.map((schema) => {
1104
+ return this.schemify(schema);
1105
+ });
1106
+ return import_typebox.Type.Union(unionTypes, {
1107
+ errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(', ')}`,
1108
+ errorSuffix: true
1109
+ });
1110
+ }
1111
+ /**
1112
+ * Create a literal schema.
1113
+ * @param {LiteralSchema} value - The literal value.
1114
+ * @returns {TLiteral<T>} The literal schema.
1115
+ */
1116
+ literal(value) {
1117
+ return import_typebox.Type.Literal(value, {
1118
+ errorType: value
1119
+ });
1120
+ }
1121
+ /**
1122
+ * Create an enum schema.
1123
+ * @param {Record<string, LiteralSchema>} schemaEnum - The enum schema.
1124
+ * @returns {TUnion<UnionTupleTResolve<T[]>>} The enum schema.
1125
+ */
1126
+ enum_(schemaEnum) {
1127
+ return this.union(
1128
+ Object.values(schemaEnum).map((value) => this.literal(value))
1129
+ );
1130
+ }
1131
+ /**
1132
+ * Create a function schema.
1133
+ * @param {TSchema[]} args - The arguments of the function.
1134
+ * @param {TAny} returnType - The return type of the function.
1135
+ * @returns {TFunction<Args, ReturnType>} The function schema.
1136
+ */
1137
+ function_(args, returnType) {
1138
+ const schemaArgs = args.map((schema) => {
1139
+ return this.schemify(schema);
1140
+ });
1141
+ const schemaReturnType = this.schemify(returnType);
1142
+ return import_typebox.Type.Function(schemaArgs, schemaReturnType);
1143
+ }
1144
+ /**
1145
+ * Create a record schema.
1146
+ * @param {TIdiomaticSchema} key - The key schema.
1147
+ * @param {TIdiomaticSchema} value - The value schema.
1148
+ * @returns {TRecord<TResolve<Key>, TResolve<Value>>} The record schema.
1149
+ */
1150
+ record(key, value) {
1151
+ const keySchema = this.schemify(key);
1152
+ const valueSchema = this.schemify(value);
1153
+ return import_typebox.Type.Record(keySchema, valueSchema);
1154
+ }
1155
+ /**
1156
+ * Create a promise schema.
1157
+ * @param {TIdiomaticSchema} schema - The schema to use for the promise.
1158
+ * @returns {TPromise<TResolve<T>>} The promise schema.
1159
+ */
1160
+ promise(schema) {
1161
+ return import_typebox.Type.Promise(this.schemify(schema));
1162
+ }
1163
+ /**
1164
+ * Check if a value is a TypeBox object schema.
1165
+ * @param {unknown} value - The value to check.
1166
+ * @returns {boolean} True if the value is a TypeBox object schema.
1167
+ */
1168
+ isSchema(value) {
1169
+ return import_typebox.KindGuard.IsSchema(value);
1170
+ }
1171
+ /**
1172
+ * Check if a value is an instance of a TypeBox schema.
1173
+ * @param {object} value - The value to check.
1174
+ * @param {TCatchall} type - The schema to check against.
1175
+ * @returns {boolean} True if the value is an instance of the schema.
1176
+ */
1177
+ isInstanceOf(value, type22) {
1178
+ return (
1179
+ typeof value === 'object' &&
1180
+ value != null &&
1181
+ import_typebox.Kind in value &&
1182
+ value[import_typebox.Kind] === type22[import_typebox.Kind]
1183
+ );
1184
+ }
1185
+ /**
1186
+ * Validate a value against a schema.
1187
+ *
1188
+ * @param {TSchema} schema - The schema to validate against.
1189
+ * @param {unknown} value - The value to validate.
1190
+ * @returns {boolean} True if valid, otherwise false.
1191
+ */
1192
+ validate(schema, value) {
1193
+ if (schema instanceof import_compiler.TypeCheck) {
1194
+ return schema.Check(value);
1195
+ } else {
1196
+ const schemified = this.schemify(schema);
1197
+ return import_value.Value.Check(schemified, value);
1198
+ }
1199
+ }
1200
+ /**
1201
+ * Parse a value against a schema.
1202
+ *
1203
+ * @param {TSchema} schema - The schema to validate against.
1204
+ * @param {unknown} value - The value to validate.
1205
+ * @returns {ParseResult<TResolve<T>>} The parsing result.
1206
+ */
1207
+ parse(schema, value) {
1208
+ let errors = [];
1209
+ let conversion;
1210
+ if (schema instanceof import_compiler.TypeCheck) {
1211
+ if (schema.Check(value)) {
1212
+ conversion = schema.Decode(value);
1213
+ } else {
1214
+ errors = Array.from(schema.Errors(value));
1215
+ }
1216
+ } else {
1217
+ const schemified = this.schemify(schema);
1218
+ if (import_value.Value.Check(schemified, value)) {
1219
+ conversion = import_value.Value.Decode(schemified, value);
1220
+ } else {
1221
+ errors = Array.from(import_value.Value.Errors(schemified, value));
1222
+ }
1223
+ }
1224
+ return errors != null && errors.length === 0
1225
+ ? {
1226
+ ok: true,
1227
+ value: conversion
1228
+ }
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
+ };
1256
+ }
1257
+ /**
1258
+ * Convert a schema to an OpenAPI schema object.
1259
+ * @param {TIdiomaticSchema | TCatchall} schema - The schema to convert.
1260
+ * @returns {SchemaObject} The OpenAPI schema object.
1261
+ */
1262
+ openapi(schema) {
1263
+ let schemified = this.schemify(schema);
1264
+ if (import_typebox.KindGuard.IsDate(schemified)) {
1265
+ schemified = import_typebox.Type.String({
1266
+ format: 'date-time'
1267
+ });
1268
+ }
1269
+ const newSchema = Object.assign({}, schemified);
1270
+ if (Object.hasOwn(newSchema, 'properties')) {
1271
+ if (newSchema.properties) {
1272
+ Object.entries({ ...schemified.properties }).forEach(([key, value]) => {
1273
+ if (
1274
+ import_typebox.KindGuard.IsSchema(value) &&
1275
+ newSchema.properties
1276
+ ) {
1277
+ newSchema.properties[key] = this.openapi(value);
1278
+ }
1279
+ });
1280
+ }
1281
+ }
1282
+ if (Object.hasOwn(newSchema, 'items')) {
1283
+ newSchema.items = this.openapi(newSchema.items);
1284
+ }
1285
+ if (Array.isArray(newSchema.anyOf)) {
1286
+ newSchema.anyOf = newSchema.anyOf.map((item) => this.openapi(item));
1287
+ }
1288
+ if (Array.isArray(newSchema.oneOf)) {
1289
+ newSchema.oneOf = newSchema.oneOf.map((item) => this.openapi(item));
1290
+ }
1291
+ if ('errorType' in newSchema) {
1292
+ delete newSchema['errorType'];
1293
+ }
1294
+ return newSchema;
1295
+ }
1296
+ };
1297
+ var SchemaValidator = () => new TypeboxSchemaValidator();
1298
+ var StaticSchemaValidator = SchemaValidator();
1299
+ var string = StaticSchemaValidator.string;
1300
+ var uuid = StaticSchemaValidator.uuid;
1301
+ var uri = StaticSchemaValidator.uri;
1302
+ var email = StaticSchemaValidator.email;
1303
+ var number = StaticSchemaValidator.number;
1304
+ var bigint = StaticSchemaValidator.bigint;
1305
+ var boolean = StaticSchemaValidator.boolean;
1306
+ var date = StaticSchemaValidator.date;
1307
+ var symbol = StaticSchemaValidator.symbol;
1308
+ var nullish = StaticSchemaValidator.nullish;
1309
+ var void_ = StaticSchemaValidator.void;
1310
+ var null_ = StaticSchemaValidator.null;
1311
+ var undefined_ = StaticSchemaValidator.undefined;
1312
+ var any = StaticSchemaValidator.any;
1313
+ var unknown = StaticSchemaValidator.unknown;
1314
+ var never = StaticSchemaValidator.never;
1315
+ var binary = StaticSchemaValidator.binary;
1316
+ var file = StaticSchemaValidator.file;
1317
+ var type = StaticSchemaValidator.type;
1318
+ var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator);
1319
+ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator);
1320
+ var array = StaticSchemaValidator.array.bind(StaticSchemaValidator);
1321
+ var union = StaticSchemaValidator.union.bind(StaticSchemaValidator);
1322
+ var literal = StaticSchemaValidator.literal.bind(StaticSchemaValidator);
1323
+ var enum_ = StaticSchemaValidator.enum_.bind(StaticSchemaValidator);
1324
+ var function_ = StaticSchemaValidator.function_.bind(StaticSchemaValidator);
1325
+ var record = StaticSchemaValidator.record.bind(StaticSchemaValidator);
1326
+ var promise = StaticSchemaValidator.promise.bind(StaticSchemaValidator);
1327
+ var isSchema = StaticSchemaValidator.isSchema.bind(StaticSchemaValidator);
1328
+ var validate = StaticSchemaValidator.validate.bind(StaticSchemaValidator);
1329
+ var parse = StaticSchemaValidator.parse.bind(StaticSchemaValidator);
1330
+ var openapi = StaticSchemaValidator.openapi.bind(StaticSchemaValidator);
1331
+
1332
+ // domain/schemas/typebox/bullMqWorker.schema.ts
1333
+ var BullMqWorkerOptionsSchema = {
1334
+ queueOptions: type(),
1335
+ backoffType: union([literal('exponential'), literal('fixed')]),
1336
+ retries: number,
1337
+ interval: number
1338
+ };
1339
+
1340
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.6.16_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
1341
+ var import_zod_openapi = __toESM(require_src(), 1);
1342
+ var import_zod = require('zod');
1343
+ (0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
1344
+ var ZodSchemaValidator = class {
1345
+ _Type = 'Zod';
1346
+ _SchemaCatchall;
1347
+ _ValidSchemaObject;
1348
+ string = import_zod.z.string().openapi({
1349
+ title: 'String',
1350
+ example: 'a string'
1351
+ });
1352
+ uuid = import_zod.z.string().uuid().openapi({
1353
+ title: 'UUID',
1354
+ format: 'uuid',
1355
+ pattern:
1356
+ '^[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}$',
1357
+ example: 'a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6'
1358
+ });
1359
+ email = import_zod.z.string().email().openapi({
1360
+ title: 'Email',
1361
+ format: 'email',
1362
+ 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])+)])`,
1363
+ example: 'a@b.com'
1364
+ });
1365
+ uri = import_zod.z.string().url().openapi({
1366
+ title: 'URI',
1367
+ format: 'uri',
1368
+ pattern: '^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$',
1369
+ example: 'https://forklaunch.com'
1370
+ });
1371
+ number = import_zod.z
1372
+ .preprocess((value) => {
1373
+ try {
1374
+ return Number(value);
1375
+ } catch {
1376
+ return value;
1377
+ }
1378
+ }, import_zod.z.number())
1379
+ .openapi({
1380
+ title: 'Number',
1381
+ example: 123
1382
+ });
1383
+ bigint = import_zod.z
1384
+ .preprocess((value) => {
1385
+ try {
1386
+ if (value instanceof Date) {
1387
+ return BigInt(value.getTime());
1388
+ }
1389
+ switch (typeof value) {
1390
+ case 'number':
1391
+ case 'string':
1392
+ return BigInt(value);
1393
+ case 'boolean':
1394
+ return BigInt(value ? 1 : 0);
1395
+ default:
1396
+ return value;
1397
+ }
1398
+ } catch {
1399
+ return value;
1400
+ }
1401
+ }, import_zod.z.bigint())
1402
+ .openapi({
1403
+ title: 'BigInt',
1404
+ type: 'integer',
1405
+ format: 'int64',
1406
+ example: 123n
1407
+ });
1408
+ boolean = import_zod.z
1409
+ .preprocess((val) => {
1410
+ if (typeof val === 'string') {
1411
+ if (val.toLowerCase() === 'true') return true;
1412
+ if (val.toLowerCase() === 'false') return false;
1413
+ }
1414
+ return val;
1415
+ }, import_zod.z.boolean())
1416
+ .openapi({
1417
+ title: 'Boolean',
1418
+ example: true
1419
+ });
1420
+ date = import_zod.z
1421
+ .preprocess((value) => {
1422
+ try {
1423
+ switch (typeof value) {
1424
+ case 'string':
1425
+ return new Date(value);
1426
+ case 'number':
1427
+ return new Date(value);
1428
+ default:
1429
+ return value;
1430
+ }
1431
+ } catch {
1432
+ return value;
1433
+ }
1434
+ }, import_zod.z.date())
1435
+ .openapi({
1436
+ title: 'Date',
1437
+ type: 'string',
1438
+ format: 'date-time',
1439
+ example: '2025-05-16T21:13:04.123Z'
1440
+ });
1441
+ symbol = import_zod.z.symbol().openapi({
1442
+ title: 'Symbol',
1443
+ example: Symbol('symbol')
1444
+ });
1445
+ nullish = import_zod.z
1446
+ .union([import_zod.z.void(), import_zod.z.null(), import_zod.z.undefined()])
1447
+ .openapi({
1448
+ title: 'Nullish',
1449
+ type: 'null',
1450
+ example: null
1451
+ });
1452
+ void = import_zod.z.void().openapi({
1453
+ title: 'Void',
1454
+ type: 'null',
1455
+ example: void 0
1456
+ });
1457
+ null = import_zod.z.null().openapi({
1458
+ title: 'Null',
1459
+ type: 'null',
1460
+ example: null
1461
+ });
1462
+ undefined = import_zod.z.undefined().openapi({
1463
+ title: 'Undefined',
1464
+ type: 'null',
1465
+ example: void 0
1466
+ });
1467
+ any = import_zod.z.any().openapi({
1468
+ title: 'Any',
1469
+ type: 'object',
1470
+ example: 'any'
1471
+ });
1472
+ unknown = import_zod.z.unknown().openapi({
1473
+ title: 'Unknown',
1474
+ type: 'object',
1475
+ example: 'unknown'
1476
+ });
1477
+ never = import_zod.z.never().openapi({
1478
+ title: 'Never',
1479
+ type: 'null',
1480
+ example: 'never'
1481
+ });
1482
+ binary = import_zod.z
1483
+ .string()
1484
+ .transform((v) => new TextEncoder().encode(v))
1485
+ .openapi({
1486
+ title: 'Binary',
1487
+ type: 'string',
1488
+ format: 'binary',
1489
+ example: 'a utf-8 encodable string'
1490
+ });
1491
+ file = import_zod.z
1492
+ .string()
1493
+ .transform((val) => {
1494
+ return (name, type22) =>
1495
+ new File([val], name, {
1496
+ type: type22,
1497
+ lastModified: Date.now()
1498
+ });
1499
+ })
1500
+ .openapi({
1501
+ title: 'File',
1502
+ type: 'string',
1503
+ format: 'binary',
1504
+ example: 'a utf-8 encodable string'
1505
+ });
1506
+ type = () => this.any;
1507
+ /**
1508
+ * Compiles schema if this exists, for optimal performance.
1509
+ *
1510
+ * @param {ZodObject<ZodRawShape>} schema - The schema to compile.
1511
+ * @returns {ZodResolve<T>} - The compiled schema.
1512
+ */
1513
+ compile(schema) {
1514
+ return schema;
1515
+ }
1516
+ /**
1517
+ * Convert a schema to a Zod schema.
1518
+ * @param {ZodIdiomaticSchema} schema - The schema to convert.
1519
+ * @returns {ZodResolve<T>} The resolved schema.
1520
+ */
1521
+ schemify(schema) {
1522
+ if (
1523
+ typeof schema === 'string' ||
1524
+ typeof schema === 'number' ||
1525
+ typeof schema === 'boolean'
1526
+ ) {
1527
+ return import_zod.z.literal(schema);
1528
+ }
1529
+ if (schema instanceof import_zod.ZodType) {
1530
+ return schema;
1531
+ }
1532
+ const newSchema = {};
1533
+ Object.getOwnPropertyNames(schema).forEach((key) => {
1534
+ if (schema[key] instanceof import_zod.ZodType) {
1535
+ newSchema[key] = schema[key];
1536
+ } else {
1537
+ newSchema[key] = this.schemify(schema[key]);
1538
+ }
1539
+ });
1540
+ return import_zod.z.object(newSchema);
1541
+ }
1542
+ /**
1543
+ * Make a schema optional.
1544
+ * @param {ZodIdiomaticSchema} schema - The schema to make optional.
1545
+ * @returns {ZodOptional<ZodResolve<T>>} The optional schema.
1546
+ */
1547
+ optional(schema) {
1548
+ const resolvedSchema = this.schemify(schema);
1549
+ return resolvedSchema.optional();
1550
+ }
1551
+ /**
1552
+ * Create an array schema.
1553
+ * @param {ZodIdiomaticSchema} schema - The schema to use for array items.
1554
+ * @returns {ZodArray<ZodResolve<T>>} The array schema.
1555
+ */
1556
+ array(schema) {
1557
+ const resolvedSchema = this.schemify(schema);
1558
+ return resolvedSchema.array();
1559
+ }
1560
+ /**
1561
+ * Create a union schema.
1562
+ * @param {ZodUnionContainer} schemas - The schemas to union.
1563
+ * @returns {ZodUnion<UnionZodResolve<T>>} The union schema.
1564
+ */
1565
+ union(schemas) {
1566
+ const resolvedSchemas = schemas.map((schema) => this.schemify(schema));
1567
+ return import_zod.z.union(resolvedSchemas);
1568
+ }
1569
+ /**
1570
+ * Create a literal schema.
1571
+ * @param {LiteralSchema} value - The literal value.
1572
+ * @returns {ZodLiteral<ZodResolve<T>>} The literal schema.
1573
+ */
1574
+ literal(value) {
1575
+ return import_zod.z.literal(value);
1576
+ }
1577
+ /**
1578
+ * Create an enum schema.
1579
+ * @param {Record<string, LiteralSchema>} schemaEnum - The enum schema.
1580
+ * @returns {ZodUnion<UnionZodResolve<[T, T, ...T[]]>>} The enum schema.
1581
+ */
1582
+ enum_(schemaEnum) {
1583
+ return this.union(Object.values(schemaEnum));
1584
+ }
1585
+ /**
1586
+ * Create a function schema.
1587
+ * @param {ZodTuple} args - The arguments of the function.
1588
+ * @param {ZodAny} returnType - The return type of the function.
1589
+ * @returns {ZodFunction<Args, ReturnType>} The function schema.
1590
+ */
1591
+ function_(args, returnType) {
1592
+ const schemaArgs = args.map((schema) => this.schemify(schema));
1593
+ const schemaReturnType = this.schemify(returnType);
1594
+ return import_zod.z.function(
1595
+ import_zod.z.tuple(schemaArgs),
1596
+ schemaReturnType
1597
+ );
1598
+ }
1599
+ /**
1600
+ * Create a record schema.
1601
+ * @param {ZodIdiomaticSchema} key - The key schema.
1602
+ * @param {ZodIdiomaticSchema} value - The value schema.
1603
+ * @returns {ZodRecord<ZodResolve<Key>, ZodResolve<Value>>} The record schema.
1604
+ */
1605
+ record(key, value) {
1606
+ const keySchema = this.schemify(key);
1607
+ const valueSchema = this.schemify(value);
1608
+ return import_zod.z.record(keySchema, valueSchema);
1609
+ }
1610
+ /**
1611
+ * Create a promise schema.
1612
+ * @param {ZodIdiomaticSchema} schema - The schema to use for the promise.
1613
+ * @returns {ZodPromise<ZodResolve<T>>} The promise schema.
1614
+ */
1615
+ promise(schema) {
1616
+ return import_zod.z.promise(this.schemify(schema));
1617
+ }
1618
+ /**
1619
+ * Checks if a value is a Zod schema.
1620
+ * @param {unknown} value - The value to check.
1621
+ * @returns {boolean} True if the value is a Zod schema.
1622
+ */
1623
+ isSchema(value) {
1624
+ return value instanceof import_zod.ZodType;
1625
+ }
1626
+ /**
1627
+ * Checks if a value is an instance of a Zod schema.
1628
+ * @param {object} value - The value to check.
1629
+ * @param {ZodType} type - The schema to check against.
1630
+ * @returns {boolean} True if the value is an instance of the schema.
1631
+ */
1632
+ isInstanceOf(value, type22) {
1633
+ return this.isSchema(value) && type22._def.typeName === value._def.typeName;
1634
+ }
1635
+ /**
1636
+ * Validate a value against a schema.
1637
+ * @param {ZodCatchall} schema - The schema to validate against.
1638
+ * @param {unknown} value - The value to validate.
1639
+ * @returns {boolean} True if valid, otherwise false.
1640
+ */
1641
+ validate(schema, value) {
1642
+ const resolvedSchema = this.schemify(schema);
1643
+ return resolvedSchema.safeParse(value).success;
1644
+ }
1645
+ /**
1646
+ * Parses a value to a schema validation.
1647
+ *
1648
+ * @param {ZodCatchall} schema - The schema to validate against.
1649
+ * @param {unknown} value - The value to validate.
1650
+ * @returns {ParseResult} - The discrimintated parsed value if successful, the error if unsuccessful.
1651
+ */
1652
+ parse(schema, value) {
1653
+ const resolvedSchema = this.schemify(schema);
1654
+ const result = resolvedSchema.safeParse(value);
1655
+ return result.success
1656
+ ? { ok: true, value: result.data }
1657
+ : {
1658
+ ok: false,
1659
+ errors: result.error.errors.flatMap((error) => {
1660
+ switch (error.code) {
1661
+ case 'invalid_union':
1662
+ return error.unionErrors.flatMap((unionError, idx) =>
1663
+ unionError.errors.map((e) => ({
1664
+ path: [
1665
+ `Union Schema Variant ${idx}`,
1666
+ ...error.path.map((p) => p.toString()),
1667
+ ...e.path.map((p) => p.toString())
1668
+ ],
1669
+ message: e.message
1670
+ }))
1671
+ );
1672
+ default:
1673
+ return [
1674
+ {
1675
+ path: error.path.map((p) => p.toString()),
1676
+ message: error.message
1677
+ }
1678
+ ];
1679
+ }
1680
+ })
1681
+ };
1682
+ }
1683
+ /**
1684
+ * Convert a schema to an OpenAPI schema object.
1685
+ * @param {ZodIdiomaticSchema} schema - The schema to convert.
1686
+ * @returns {SchemaObject} The OpenAPI schema object.
1687
+ */
1688
+ openapi(schema) {
1689
+ return (0, import_zod_openapi.generateSchema)(this.schemify(schema));
1690
+ }
1691
+ };
1692
+ var SchemaValidator2 = () => new ZodSchemaValidator();
1693
+ var StaticSchemaValidator2 = SchemaValidator2();
1694
+ var string2 = StaticSchemaValidator2.string;
1695
+ var uuid2 = StaticSchemaValidator2.uuid;
1696
+ var email2 = StaticSchemaValidator2.email;
1697
+ var uri2 = StaticSchemaValidator2.uri;
1698
+ var number2 = StaticSchemaValidator2.number;
1699
+ var bigint2 = StaticSchemaValidator2.bigint;
1700
+ var boolean2 = StaticSchemaValidator2.boolean;
1701
+ var date2 = StaticSchemaValidator2.date;
1702
+ var symbol2 = StaticSchemaValidator2.symbol;
1703
+ var nullish2 = StaticSchemaValidator2.nullish;
1704
+ var void_2 = StaticSchemaValidator2.void;
1705
+ var null_2 = StaticSchemaValidator2.null;
1706
+ var undefined_2 = StaticSchemaValidator2.undefined;
1707
+ var any2 = StaticSchemaValidator2.any;
1708
+ var unknown2 = StaticSchemaValidator2.unknown;
1709
+ var never2 = StaticSchemaValidator2.never;
1710
+ var binary2 = StaticSchemaValidator2.binary;
1711
+ var file2 = StaticSchemaValidator2.file;
1712
+ var type2 = StaticSchemaValidator2.type;
1713
+ var schemify2 = StaticSchemaValidator2.schemify.bind(StaticSchemaValidator2);
1714
+ var optional2 = StaticSchemaValidator2.optional.bind(StaticSchemaValidator2);
1715
+ var array2 = StaticSchemaValidator2.array.bind(StaticSchemaValidator2);
1716
+ var union2 = StaticSchemaValidator2.union.bind(StaticSchemaValidator2);
1717
+ var literal2 = StaticSchemaValidator2.literal.bind(StaticSchemaValidator2);
1718
+ var enum_2 = StaticSchemaValidator2.enum_.bind(StaticSchemaValidator2);
1719
+ var function_2 = StaticSchemaValidator2.function_.bind(StaticSchemaValidator2);
1720
+ var record2 = StaticSchemaValidator2.record.bind(StaticSchemaValidator2);
1721
+ var promise2 = StaticSchemaValidator2.promise.bind(StaticSchemaValidator2);
1722
+ var isSchema2 = StaticSchemaValidator2.isSchema.bind(StaticSchemaValidator2);
1723
+ var validate2 = StaticSchemaValidator2.validate.bind(StaticSchemaValidator2);
1724
+ var parse2 = StaticSchemaValidator2.parse.bind(StaticSchemaValidator2);
1725
+ var openapi2 = StaticSchemaValidator2.openapi.bind(StaticSchemaValidator2);
1726
+
1727
+ // domain/schemas/zod/bullMqWorker.schema.ts
1728
+ var BullMqWorkerOptionsSchema2 = {
1729
+ queueOptions: type2(),
1730
+ backoffType: union2([literal2('exponential'), literal2('fixed')]),
1731
+ retries: number2,
1732
+ interval: number2
1733
+ };
1734
+
1735
+ // domain/schemas/bullMqWorker.schema.ts
1736
+ var BullMqWorkerSchemas = (0, import_internal.serviceSchemaResolver)(
1737
+ () => BullMqWorkerOptionsSchema,
1738
+ () => BullMqWorkerOptionsSchema2
1739
+ );
1740
+ // Annotate the CommonJS export names for ESM import in node:
1741
+ 0 &&
1742
+ (module.exports = {
1743
+ BullMqWorkerSchemas
1744
+ });