@forklaunch/implementation-worker-redis 0.2.2 → 0.3.0

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.
Files changed (47) hide show
  1. package/lib/consumers/index.d.mts +19 -0
  2. package/lib/consumers/index.d.ts +19 -2
  3. package/lib/consumers/index.js +71 -1
  4. package/lib/consumers/{redisWorker.consumer.js → index.mjs} +14 -19
  5. package/lib/producers/index.d.mts +15 -0
  6. package/lib/producers/index.d.ts +15 -2
  7. package/lib/producers/index.js +45 -1
  8. package/lib/producers/{redisWorker.producer.js → index.mjs} +7 -6
  9. package/lib/schemas/index.d.mts +18 -0
  10. package/lib/schemas/index.d.ts +18 -2
  11. package/lib/schemas/index.js +1371 -1
  12. package/lib/schemas/index.mjs +1375 -0
  13. package/lib/types/index.d.mts +7 -0
  14. package/lib/types/index.d.ts +7 -2
  15. package/lib/types/index.js +18 -1
  16. package/lib/types/index.mjs +0 -0
  17. package/package.json +6 -5
  18. package/lib/__test__/schemaEquality.test.d.ts +0 -2
  19. package/lib/__test__/schemaEquality.test.d.ts.map +0 -1
  20. package/lib/__test__/schemaEquality.test.js +0 -21
  21. package/lib/consumers/index.d.ts.map +0 -1
  22. package/lib/consumers/redisWorker.consumer.d.ts +0 -31
  23. package/lib/consumers/redisWorker.consumer.d.ts.map +0 -1
  24. package/lib/jest.config.d.ts +0 -4
  25. package/lib/jest.config.d.ts.map +0 -1
  26. package/lib/jest.config.js +0 -19
  27. package/lib/producers/index.d.ts.map +0 -1
  28. package/lib/producers/redisWorker.producer.d.ts +0 -17
  29. package/lib/producers/redisWorker.producer.d.ts.map +0 -1
  30. package/lib/schemas/index.d.ts.map +0 -1
  31. package/lib/schemas/redisWorker.schema.d.ts +0 -64
  32. package/lib/schemas/redisWorker.schema.d.ts.map +0 -1
  33. package/lib/schemas/redisWorker.schema.js +0 -7
  34. package/lib/schemas/typebox/redisWorker.schema.d.ts +0 -42
  35. package/lib/schemas/typebox/redisWorker.schema.d.ts.map +0 -1
  36. package/lib/schemas/typebox/redisWorker.schema.js +0 -6
  37. package/lib/schemas/zod/redisWorker.schema.d.ts +0 -6
  38. package/lib/schemas/zod/redisWorker.schema.d.ts.map +0 -1
  39. package/lib/schemas/zod/redisWorker.schema.js +0 -6
  40. package/lib/tsconfig.tsbuildinfo +0 -1
  41. package/lib/types/index.d.ts.map +0 -1
  42. package/lib/types/redisWorker.types.d.ts +0 -6
  43. package/lib/types/redisWorker.types.d.ts.map +0 -1
  44. package/lib/types/redisWorker.types.js +0 -1
  45. package/lib/vitest.config.d.ts +0 -3
  46. package/lib/vitest.config.d.ts.map +0 -1
  47. package/lib/vitest.config.js +0 -7
@@ -1 +1,1371 @@
1
- export * from './redisWorker.schema';
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) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // ../../../node_modules/.pnpm/ts-deepmerge@6.2.1/node_modules/ts-deepmerge/cjs/index.js
34
+ var require_cjs = __commonJS({
35
+ "../../../node_modules/.pnpm/ts-deepmerge@6.2.1/node_modules/ts-deepmerge/cjs/index.js"(exports2) {
36
+ "use strict";
37
+ Object.defineProperty(exports2, "__esModule", { value: true });
38
+ var isObject = (obj) => {
39
+ if (typeof obj === "object" && obj !== null) {
40
+ if (typeof Object.getPrototypeOf === "function") {
41
+ const prototype = Object.getPrototypeOf(obj);
42
+ return prototype === Object.prototype || prototype === null;
43
+ }
44
+ return Object.prototype.toString.call(obj) === "[object Object]";
45
+ }
46
+ return false;
47
+ };
48
+ var merge = (...objects) => objects.reduce((result, current) => {
49
+ if (Array.isArray(current)) {
50
+ throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
51
+ }
52
+ Object.keys(current).forEach((key) => {
53
+ if (["__proto__", "constructor", "prototype"].includes(key)) {
54
+ return;
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];
62
+ }
63
+ });
64
+ return result;
65
+ }, {});
66
+ var defaultOptions = {
67
+ allowUndefinedOverrides: true,
68
+ mergeArrays: true,
69
+ uniqueArrayItems: true
70
+ };
71
+ merge.options = defaultOptions;
72
+ merge.withOptions = (options, ...objects) => {
73
+ merge.options = Object.assign(Object.assign({}, defaultOptions), options);
74
+ const result = merge(...objects);
75
+ merge.options = defaultOptions;
76
+ return result;
77
+ };
78
+ exports2.default = merge;
79
+ }
80
+ });
81
+
82
+ // ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/lib/zod-openapi.js
83
+ var require_zod_openapi = __commonJS({
84
+ "../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/lib/zod-openapi.js"(exports2) {
85
+ "use strict";
86
+ Object.defineProperty(exports2, "__esModule", { value: true });
87
+ exports2.generateSchema = exports2.extendApi = void 0;
88
+ var ts_deepmerge_1 = require_cjs();
89
+ var zod_1 = require("zod");
90
+ function extendApi(schema, schemaObject = {}) {
91
+ const This = schema.constructor;
92
+ const newSchema = new This(schema._def);
93
+ newSchema.metaOpenApi = Object.assign({}, schema.metaOpenApi || {}, schemaObject);
94
+ return newSchema;
95
+ }
96
+ exports2.extendApi = extendApi;
97
+ function iterateZodObject({ zodRef, useOutput, hideDefinitions, openApiVersion }) {
98
+ const reduced = Object.keys(zodRef.shape).filter((key) => (hideDefinitions === null || hideDefinitions === void 0 ? void 0 : hideDefinitions.includes(key)) === false).reduce((carry, key) => Object.assign(Object.assign({}, carry), { [key]: generateSchema2(zodRef.shape[key], useOutput, openApiVersion) }), {});
99
+ return reduced;
100
+ }
101
+ function typeFormat(type3, openApiVersion) {
102
+ return openApiVersion === "3.0" ? type3 : [type3];
103
+ }
104
+ function parseTransformation({ zodRef, schemas, useOutput, openApiVersion }) {
105
+ const input = generateSchema2(zodRef._def.schema, useOutput, openApiVersion);
106
+ let output = "undefined";
107
+ if (useOutput && zodRef._def.effect) {
108
+ const effect = zodRef._def.effect.type === "transform" ? zodRef._def.effect : null;
109
+ if (effect && "transform" in effect) {
110
+ try {
111
+ const type3 = Array.isArray(input.type) ? input.type[0] : input.type;
112
+ output = typeof effect.transform(
113
+ ["integer", "number"].includes(`${type3}`) ? 0 : "string" === type3 ? "" : "boolean" === type3 ? false : "object" === type3 ? {} : "null" === type3 ? null : "array" === type3 ? [] : void 0,
114
+ { addIssue: () => void 0, path: [] }
115
+ // TODO: Discover if context is necessary here
116
+ );
117
+ } catch (e) {
118
+ }
119
+ }
120
+ }
121
+ const outputType = output;
122
+ return (0, ts_deepmerge_1.default)(Object.assign(Object.assign(Object.assign({}, zodRef.description ? { description: zodRef.description } : {}), input), ["number", "string", "boolean", "null"].includes(output) ? {
123
+ type: typeFormat(outputType, openApiVersion)
124
+ } : {}), ...schemas);
125
+ }
126
+ function parseString({ zodRef, schemas, openApiVersion }) {
127
+ const baseSchema = {
128
+ type: typeFormat("string", openApiVersion)
129
+ };
130
+ const { checks = [] } = zodRef._def;
131
+ checks.forEach((item) => {
132
+ switch (item.kind) {
133
+ case "email":
134
+ baseSchema.format = "email";
135
+ break;
136
+ case "uuid":
137
+ baseSchema.format = "uuid";
138
+ break;
139
+ case "cuid":
140
+ baseSchema.format = "cuid";
141
+ break;
142
+ case "url":
143
+ baseSchema.format = "uri";
144
+ break;
145
+ case "datetime":
146
+ baseSchema.format = "date-time";
147
+ break;
148
+ case "length":
149
+ baseSchema.minLength = item.value;
150
+ baseSchema.maxLength = item.value;
151
+ break;
152
+ case "max":
153
+ baseSchema.maxLength = item.value;
154
+ break;
155
+ case "min":
156
+ baseSchema.minLength = item.value;
157
+ break;
158
+ case "regex":
159
+ baseSchema.pattern = item.regex.source;
160
+ break;
161
+ }
162
+ });
163
+ return (0, ts_deepmerge_1.default)(baseSchema, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
164
+ }
165
+ function parseNumber({ zodRef, schemas, openApiVersion }) {
166
+ const baseSchema = {
167
+ type: typeFormat("number", openApiVersion)
168
+ };
169
+ const { checks = [] } = zodRef._def;
170
+ checks.forEach((item) => {
171
+ switch (item.kind) {
172
+ case "max":
173
+ if (item.inclusive || openApiVersion === "3.0") {
174
+ baseSchema.maximum = item.value;
175
+ }
176
+ if (!item.inclusive) {
177
+ if (openApiVersion === "3.0") {
178
+ baseSchema.exclusiveMaximum = true;
179
+ } else {
180
+ baseSchema.exclusiveMaximum = item.value;
181
+ }
182
+ }
183
+ break;
184
+ case "min":
185
+ if (item.inclusive || openApiVersion === "3.0") {
186
+ baseSchema.minimum = item.value;
187
+ }
188
+ if (!item.inclusive) {
189
+ if (openApiVersion === "3.0") {
190
+ baseSchema.exclusiveMinimum = true;
191
+ } else {
192
+ baseSchema.exclusiveMinimum = item.value;
193
+ }
194
+ }
195
+ break;
196
+ case "int":
197
+ baseSchema.type = typeFormat("integer", openApiVersion);
198
+ break;
199
+ case "multipleOf":
200
+ baseSchema.multipleOf = item.value;
201
+ break;
202
+ }
203
+ });
204
+ return (0, ts_deepmerge_1.default)(baseSchema, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
205
+ }
206
+ function getExcludedDefinitionsFromSchema(schemas) {
207
+ const excludedDefinitions = [];
208
+ for (const schema of schemas) {
209
+ if (Array.isArray(schema.hideDefinitions)) {
210
+ excludedDefinitions.push(...schema.hideDefinitions);
211
+ }
212
+ }
213
+ return excludedDefinitions;
214
+ }
215
+ function parseObject({ zodRef, schemas, useOutput, hideDefinitions, openApiVersion }) {
216
+ var _a;
217
+ let additionalProperties;
218
+ if (!(zodRef._def.catchall instanceof zod_1.z.ZodNever || ((_a = zodRef._def.catchall) === null || _a === void 0 ? void 0 : _a._def.typeName) === "ZodNever"))
219
+ additionalProperties = generateSchema2(zodRef._def.catchall, useOutput, openApiVersion);
220
+ else if (zodRef._def.unknownKeys === "passthrough")
221
+ additionalProperties = true;
222
+ else if (zodRef._def.unknownKeys === "strict")
223
+ additionalProperties = false;
224
+ additionalProperties = additionalProperties != null ? { additionalProperties } : {};
225
+ const requiredProperties = Object.keys(zodRef.shape).filter((key) => {
226
+ const item = zodRef.shape[key];
227
+ return !(item.isOptional() || item instanceof zod_1.z.ZodDefault || item._def.typeName === "ZodDefault") && !(item instanceof zod_1.z.ZodNever || item._def.typeName === "ZodDefault");
228
+ });
229
+ const required = requiredProperties.length > 0 ? { required: requiredProperties } : {};
230
+ return (0, ts_deepmerge_1.default)(Object.assign(Object.assign(Object.assign({ type: typeFormat("object", openApiVersion), properties: iterateZodObject({
231
+ zodRef,
232
+ schemas,
233
+ useOutput,
234
+ hideDefinitions: getExcludedDefinitionsFromSchema(schemas),
235
+ openApiVersion
236
+ }) }, required), additionalProperties), hideDefinitions), zodRef.description ? { description: zodRef.description, hideDefinitions } : {}, ...schemas);
237
+ }
238
+ function parseRecord({ zodRef, schemas, useOutput, openApiVersion }) {
239
+ return (0, ts_deepmerge_1.default)({
240
+ type: typeFormat("object", openApiVersion),
241
+ additionalProperties: zodRef._def.valueType instanceof zod_1.z.ZodUnknown ? {} : generateSchema2(zodRef._def.valueType, useOutput, openApiVersion)
242
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
243
+ }
244
+ function parseBigInt({ zodRef, schemas, openApiVersion }) {
245
+ return (0, ts_deepmerge_1.default)({
246
+ type: typeFormat("integer", openApiVersion),
247
+ format: "int64"
248
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
249
+ }
250
+ function parseBoolean({ zodRef, schemas, openApiVersion }) {
251
+ return (0, ts_deepmerge_1.default)({ type: typeFormat("boolean", openApiVersion) }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
252
+ }
253
+ function parseDate({ zodRef, schemas, openApiVersion }) {
254
+ return (0, ts_deepmerge_1.default)({
255
+ type: typeFormat("string", openApiVersion),
256
+ format: "date-time"
257
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
258
+ }
259
+ function parseNull({ zodRef, schemas, openApiVersion }) {
260
+ return (0, ts_deepmerge_1.default)(openApiVersion === "3.0" ? { type: "null" } : {
261
+ type: ["string", "null"],
262
+ enum: ["null"]
263
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
264
+ }
265
+ function parseOptional({ schemas, zodRef, useOutput, openApiVersion }) {
266
+ return (0, ts_deepmerge_1.default)(generateSchema2(zodRef.unwrap(), useOutput, openApiVersion), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
267
+ }
268
+ function parseNullable({ schemas, zodRef, useOutput, openApiVersion }) {
269
+ const schema = generateSchema2(zodRef.unwrap(), useOutput, openApiVersion);
270
+ return (0, ts_deepmerge_1.default)(schema, openApiVersion === "3.0" ? { nullable: true } : { type: typeFormat("null", openApiVersion) }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
271
+ }
272
+ function parseDefault({ schemas, zodRef, useOutput, openApiVersion }) {
273
+ return (0, ts_deepmerge_1.default)(Object.assign({ default: zodRef._def.defaultValue() }, generateSchema2(zodRef._def.innerType, useOutput, openApiVersion)), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
274
+ }
275
+ function parseArray({ schemas, zodRef, useOutput, openApiVersion }) {
276
+ const constraints = {};
277
+ if (zodRef._def.exactLength != null) {
278
+ constraints.minItems = zodRef._def.exactLength.value;
279
+ constraints.maxItems = zodRef._def.exactLength.value;
280
+ }
281
+ if (zodRef._def.minLength != null)
282
+ constraints.minItems = zodRef._def.minLength.value;
283
+ if (zodRef._def.maxLength != null)
284
+ constraints.maxItems = zodRef._def.maxLength.value;
285
+ return (0, ts_deepmerge_1.default)(Object.assign({ type: typeFormat("array", openApiVersion), items: generateSchema2(zodRef.element, useOutput, openApiVersion) }, constraints), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
286
+ }
287
+ function parseLiteral({ schemas, zodRef, openApiVersion }) {
288
+ const type3 = typeof zodRef._def.value;
289
+ return (0, ts_deepmerge_1.default)({
290
+ type: typeFormat(type3, openApiVersion),
291
+ enum: [zodRef._def.value]
292
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
293
+ }
294
+ function parseEnum({ schemas, zodRef, openApiVersion }) {
295
+ const type3 = typeof Object.values(zodRef._def.values)[0];
296
+ return (0, ts_deepmerge_1.default)({
297
+ type: typeFormat(type3, openApiVersion),
298
+ enum: Object.values(zodRef._def.values)
299
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
300
+ }
301
+ function parseIntersection({ schemas, zodRef, useOutput, openApiVersion }) {
302
+ return (0, ts_deepmerge_1.default)({
303
+ allOf: [
304
+ generateSchema2(zodRef._def.left, useOutput, openApiVersion),
305
+ generateSchema2(zodRef._def.right, useOutput, openApiVersion)
306
+ ]
307
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
308
+ }
309
+ function parseUnion({ schemas, zodRef, useOutput, openApiVersion }) {
310
+ const contents = zodRef._def.options;
311
+ if (contents.reduce((prev, content) => prev && content._def.typeName === "ZodLiteral", true)) {
312
+ const literals = contents;
313
+ const type3 = literals.reduce((prev, content) => !prev || prev === typeof content._def.value ? typeof content._def.value : null, null);
314
+ if (type3) {
315
+ return (0, ts_deepmerge_1.default)({
316
+ type: typeFormat(type3, openApiVersion),
317
+ enum: literals.map((literal3) => literal3._def.value)
318
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
319
+ }
320
+ }
321
+ const oneOfContents = openApiVersion === "3.0" ? contents.filter((content) => content._def.typeName !== "ZodNull") : contents;
322
+ const contentsHasNull = contents.length != oneOfContents.length;
323
+ return (0, ts_deepmerge_1.default)({
324
+ oneOf: oneOfContents.map((schema) => generateSchema2(schema, useOutput, openApiVersion))
325
+ }, contentsHasNull ? { nullable: true } : {}, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
326
+ }
327
+ function parseDiscriminatedUnion({ schemas, zodRef, useOutput, openApiVersion }) {
328
+ return (0, ts_deepmerge_1.default)({
329
+ discriminator: {
330
+ propertyName: zodRef._def.discriminator
331
+ },
332
+ oneOf: Array.from(zodRef._def.options.values()).map((schema) => generateSchema2(schema, useOutput, openApiVersion))
333
+ }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
334
+ }
335
+ function parseNever({ zodRef, schemas }) {
336
+ return (0, ts_deepmerge_1.default)({ readOnly: true }, zodRef.description ? { description: zodRef.description } : {}, ...schemas);
337
+ }
338
+ function parseBranded({ schemas, zodRef, useOutput, openApiVersion }) {
339
+ return (0, ts_deepmerge_1.default)(generateSchema2(zodRef._def.type, useOutput, openApiVersion), ...schemas);
340
+ }
341
+ function catchAllParser({ zodRef, schemas }) {
342
+ return (0, ts_deepmerge_1.default)(zodRef.description ? { description: zodRef.description } : {}, ...schemas);
343
+ }
344
+ function parsePipeline({ schemas, zodRef, useOutput, openApiVersion }) {
345
+ return (0, ts_deepmerge_1.default)(generateSchema2(useOutput ? zodRef._def.out : zodRef._def.in, useOutput, openApiVersion), ...schemas);
346
+ }
347
+ function parseReadonly({ zodRef, useOutput, schemas, openApiVersion }) {
348
+ return (0, ts_deepmerge_1.default)(generateSchema2(zodRef._def.innerType, useOutput, openApiVersion), zodRef.description ? { description: zodRef.description } : {}, ...schemas);
349
+ }
350
+ var workerMap = {
351
+ ZodObject: parseObject,
352
+ ZodRecord: parseRecord,
353
+ ZodString: parseString,
354
+ ZodNumber: parseNumber,
355
+ ZodBigInt: parseBigInt,
356
+ ZodBoolean: parseBoolean,
357
+ ZodDate: parseDate,
358
+ ZodNull: parseNull,
359
+ ZodOptional: parseOptional,
360
+ ZodNullable: parseNullable,
361
+ ZodDefault: parseDefault,
362
+ ZodArray: parseArray,
363
+ ZodLiteral: parseLiteral,
364
+ ZodEnum: parseEnum,
365
+ ZodNativeEnum: parseEnum,
366
+ ZodTransformer: parseTransformation,
367
+ ZodEffects: parseTransformation,
368
+ ZodIntersection: parseIntersection,
369
+ ZodUnion: parseUnion,
370
+ ZodDiscriminatedUnion: parseDiscriminatedUnion,
371
+ ZodNever: parseNever,
372
+ ZodBranded: parseBranded,
373
+ // TODO Transform the rest to schemas
374
+ ZodUndefined: catchAllParser,
375
+ // TODO: `prefixItems` is allowed in OpenAPI 3.1 which can be used to create tuples
376
+ ZodTuple: catchAllParser,
377
+ ZodMap: catchAllParser,
378
+ ZodFunction: catchAllParser,
379
+ ZodLazy: catchAllParser,
380
+ ZodPromise: catchAllParser,
381
+ ZodAny: catchAllParser,
382
+ ZodUnknown: catchAllParser,
383
+ ZodVoid: catchAllParser,
384
+ ZodPipeline: parsePipeline,
385
+ ZodReadonly: parseReadonly
386
+ };
387
+ function generateSchema2(zodRef, useOutput = false, openApiVersion = "3.1") {
388
+ const { metaOpenApi = {} } = zodRef;
389
+ const schemas = [
390
+ ...Array.isArray(metaOpenApi) ? metaOpenApi : [metaOpenApi]
391
+ ];
392
+ try {
393
+ const typeName = zodRef._def.typeName;
394
+ if (typeName in workerMap) {
395
+ return workerMap[typeName]({
396
+ zodRef,
397
+ schemas,
398
+ useOutput,
399
+ openApiVersion
400
+ });
401
+ }
402
+ return catchAllParser({ zodRef, schemas, openApiVersion });
403
+ } catch (err) {
404
+ console.error(err);
405
+ return catchAllParser({ zodRef, schemas, openApiVersion });
406
+ }
407
+ }
408
+ exports2.generateSchema = generateSchema2;
409
+ }
410
+ });
411
+
412
+ // ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/lib/zod-extensions.js
413
+ var require_zod_extensions = __commonJS({
414
+ "../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/lib/zod-extensions.js"(exports2) {
415
+ "use strict";
416
+ Object.defineProperty(exports2, "__esModule", { value: true });
417
+ exports2.extendZodWithOpenApi = void 0;
418
+ var zod_openapi_1 = require_zod_openapi();
419
+ function extendZodWithOpenApi2(zod, forceOverride = false) {
420
+ if (!forceOverride && typeof zod.ZodSchema.prototype.openapi !== "undefined") {
421
+ return;
422
+ }
423
+ zod.ZodSchema.prototype.openapi = function(metadata) {
424
+ return (0, zod_openapi_1.extendApi)(this, metadata);
425
+ };
426
+ }
427
+ exports2.extendZodWithOpenApi = extendZodWithOpenApi2;
428
+ }
429
+ });
430
+
431
+ // ../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/index.js
432
+ var require_src = __commonJS({
433
+ "../../../node_modules/.pnpm/@anatine+zod-openapi@2.2.8_openapi3-ts@4.4.0_zod@3.25.62/node_modules/@anatine/zod-openapi/src/index.js"(exports2) {
434
+ "use strict";
435
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
436
+ if (k2 === void 0) k2 = k;
437
+ var desc = Object.getOwnPropertyDescriptor(m, k);
438
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
439
+ desc = { enumerable: true, get: function() {
440
+ return m[k];
441
+ } };
442
+ }
443
+ Object.defineProperty(o, k2, desc);
444
+ } : function(o, m, k, k2) {
445
+ if (k2 === void 0) k2 = k;
446
+ o[k2] = m[k];
447
+ });
448
+ var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
449
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
450
+ };
451
+ Object.defineProperty(exports2, "__esModule", { value: true });
452
+ __exportStar(require_zod_openapi(), exports2);
453
+ __exportStar(require_zod_extensions(), exports2);
454
+ }
455
+ });
456
+
457
+ // schemas/index.ts
458
+ var schemas_exports = {};
459
+ __export(schemas_exports, {
460
+ RedisWorkerSchemas: () => RedisWorkerSchemas
461
+ });
462
+ module.exports = __toCommonJS(schemas_exports);
463
+
464
+ // schemas/redisWorker.schema.ts
465
+ var import_mappers = require("@forklaunch/core/mappers");
466
+
467
+ // ../../../node_modules/.pnpm/@forklaunch+common@0.3.11/node_modules/@forklaunch/common/lib/index.mjs
468
+ var InMemoryFile = class extends File {
469
+ constructor(content, name, {
470
+ type: type3,
471
+ endings,
472
+ lastModified
473
+ }) {
474
+ super([Buffer.from(content)], name, {
475
+ type: type3,
476
+ endings,
477
+ lastModified
478
+ });
479
+ this.content = content;
480
+ }
481
+ };
482
+
483
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.6.12_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
484
+ var import_typebox = require("@sinclair/typebox");
485
+ var import_compiler = require("@sinclair/typebox/compiler");
486
+ var import_errors = require("@sinclair/typebox/errors");
487
+ var import_value = require("@sinclair/typebox/value");
488
+ import_typebox.FormatRegistry.Set("binary", (value) => typeof value === "string");
489
+ (0, import_errors.SetErrorFunction)((params) => {
490
+ switch (params.errorType) {
491
+ case import_errors.ValueErrorType.Union:
492
+ case import_errors.ValueErrorType.Array:
493
+ case import_errors.ValueErrorType.String:
494
+ case import_errors.ValueErrorType.Number:
495
+ return params.schema.errorType ? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? "s" : ""}` : (0, import_errors.DefaultErrorFunction)(params);
496
+ default:
497
+ return (0, import_errors.DefaultErrorFunction)(params);
498
+ }
499
+ });
500
+ var TypeboxSchemaValidator = class {
501
+ _Type = "TypeBox";
502
+ _SchemaCatchall;
503
+ _ValidSchemaObject;
504
+ string = import_typebox.Type.String({
505
+ example: "a string",
506
+ title: "String"
507
+ });
508
+ uuid = import_typebox.Type.String({
509
+ pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
510
+ errorType: "uuid",
511
+ example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
512
+ title: "UUID"
513
+ });
514
+ email = import_typebox.Type.String({
515
+ pattern: `(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])`,
516
+ errorType: "email",
517
+ example: "a@b.com",
518
+ title: "Email"
519
+ });
520
+ uri = import_typebox.Type.String({
521
+ pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
522
+ errorType: "uri",
523
+ example: "https://forklaunch.com",
524
+ title: "URI"
525
+ });
526
+ number = import_typebox.Type.Transform(
527
+ import_typebox.Type.Union(
528
+ [
529
+ import_typebox.Type.Number(),
530
+ import_typebox.Type.String({ pattern: "^[0-9]+$" }),
531
+ import_typebox.Type.Boolean(),
532
+ import_typebox.Type.Null(),
533
+ import_typebox.Type.BigInt(),
534
+ import_typebox.Type.Date()
535
+ ],
536
+ {
537
+ errorType: "number-like",
538
+ example: 123,
539
+ title: "Number"
540
+ }
541
+ )
542
+ ).Decode((value) => {
543
+ if (typeof value !== "number") {
544
+ const num = Number(value);
545
+ if (isNaN(num)) {
546
+ throw new Error("Invalid number");
547
+ } else {
548
+ return num;
549
+ }
550
+ }
551
+ return value;
552
+ }).Encode(Number);
553
+ bigint = import_typebox.Type.Transform(
554
+ import_typebox.Type.Union(
555
+ [
556
+ import_typebox.Type.BigInt(),
557
+ import_typebox.Type.Number(),
558
+ import_typebox.Type.String({ pattern: "^[0-9]+n?$" }),
559
+ import_typebox.Type.Boolean(),
560
+ import_typebox.Type.Date()
561
+ ],
562
+ {
563
+ errorType: "BigInt-like",
564
+ example: 123n,
565
+ title: "BigInt"
566
+ }
567
+ )
568
+ ).Decode((value) => {
569
+ if (typeof value !== "bigint") {
570
+ try {
571
+ if (value instanceof Date) {
572
+ return BigInt(value.getTime());
573
+ }
574
+ return BigInt(value);
575
+ } catch {
576
+ throw new Error("Invalid bigint");
577
+ }
578
+ }
579
+ return value;
580
+ }).Encode(BigInt);
581
+ boolean = import_typebox.Type.Transform(
582
+ import_typebox.Type.Union(
583
+ [
584
+ import_typebox.Type.Boolean(),
585
+ import_typebox.Type.String({
586
+ pattern: "^(t|T)(r|R)(u|U)(e|E)$|^(f|F)(a|A)(l|L)(s|S)(e|E)$"
587
+ })
588
+ ],
589
+ {
590
+ errorType: "boolean-like",
591
+ example: true,
592
+ title: "Boolean"
593
+ }
594
+ )
595
+ ).Decode((value) => {
596
+ if (typeof value === "string") {
597
+ if (value.toLowerCase() === "true") return true;
598
+ return false;
599
+ } else {
600
+ return value;
601
+ }
602
+ }).Encode(Boolean);
603
+ date = import_typebox.Type.Transform(
604
+ import_typebox.Type.Union(
605
+ [
606
+ import_typebox.Type.String({
607
+ pattern: "^\\d{4}(-\\d{2}){0,2}(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,3})?)?(Z|([+-]\\d{2}:\\d{2}))?)?$|^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$|^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$|^\\d+$"
608
+ }),
609
+ import_typebox.Type.Number(),
610
+ import_typebox.Type.Date()
611
+ ],
612
+ {
613
+ errorType: "date",
614
+ example: "2025-05-16T21:13:04.123Z",
615
+ title: "Date"
616
+ }
617
+ )
618
+ ).Decode((value) => {
619
+ if (value === null || typeof value === "boolean") {
620
+ return /* @__PURE__ */ new Date(value ? 1 : 0);
621
+ }
622
+ return new Date(value);
623
+ }).Encode((value) => new Date(value).toISOString());
624
+ symbol = import_typebox.Type.Symbol({
625
+ title: "Symbol"
626
+ });
627
+ nullish = import_typebox.Type.Union(
628
+ [import_typebox.Type.Void(), import_typebox.Type.Null(), import_typebox.Type.Undefined()],
629
+ {
630
+ errorType: "nullish",
631
+ type: "null",
632
+ example: "null",
633
+ title: "Nullish"
634
+ }
635
+ );
636
+ void = import_typebox.Type.Void({
637
+ type: "null",
638
+ example: "void",
639
+ title: "Void"
640
+ });
641
+ null = import_typebox.Type.Null({
642
+ type: "null",
643
+ example: "null",
644
+ title: "Null"
645
+ });
646
+ undefined = import_typebox.Type.Undefined({
647
+ type: "null",
648
+ example: "undefined",
649
+ title: "Undefined"
650
+ });
651
+ any = import_typebox.Type.Any({
652
+ type: "object",
653
+ example: "any",
654
+ title: "Any"
655
+ });
656
+ unknown = import_typebox.Type.Unknown({
657
+ type: "object",
658
+ example: "unknown",
659
+ title: "Unknown"
660
+ });
661
+ never = import_typebox.Type.Never({
662
+ type: "null",
663
+ example: "never",
664
+ title: "Never"
665
+ });
666
+ binary = import_typebox.Type.Transform(
667
+ import_typebox.Type.String({
668
+ errorType: "binary",
669
+ format: "binary",
670
+ example: "a utf-8 encodable string",
671
+ title: "Binary"
672
+ })
673
+ ).Decode((value) => new TextEncoder().encode(value)).Encode((value) => {
674
+ if (value instanceof ArrayBuffer) {
675
+ return String.fromCharCode(...new Uint8Array(value));
676
+ }
677
+ return "";
678
+ });
679
+ file = import_typebox.Type.Transform(
680
+ import_typebox.Type.String({
681
+ errorType: "binary",
682
+ format: "binary",
683
+ example: "a utf-8 encodable string",
684
+ title: "File"
685
+ })
686
+ ).Decode(
687
+ (value) => (name, type22) => new InMemoryFile(value, name, { type: type22 })
688
+ ).Encode((value) => value("name", "type").content);
689
+ type = () => this.any;
690
+ /**
691
+ * Extracts the error type of a schema for error messages.
692
+ *
693
+ * @param {TCatchall} schema - A schema that contains some type information.
694
+ * @returns The type of the schema for error messages.
695
+ */
696
+ errorType(schema) {
697
+ if (import_typebox.KindGuard.IsSchema(schema) && Object.hasOwn(schema, "errorType")) {
698
+ return schema.errorType;
699
+ } else if (import_typebox.KindGuard.IsLiteral(schema)) {
700
+ return schema.const;
701
+ }
702
+ return schema[import_typebox.Kind].toLowerCase();
703
+ }
704
+ /**
705
+ * Compiles schema if this exists, for optimal performance.
706
+ *
707
+ * @param {TObject<TProperties>} schema - The schema to compile.
708
+ * @returns {TypeCheck<T>} - The compiled schema.
709
+ */
710
+ compile(schema) {
711
+ return import_compiler.TypeCompiler.Compile(schema);
712
+ }
713
+ /**
714
+ * Convert a schema to a TypeBox schema.
715
+ * @param {TIdiomaticSchema} schema - The schema to convert.
716
+ * @returns {TResolve<T>} The resolved schema.
717
+ */
718
+ schemify(schema) {
719
+ if (import_typebox.KindGuard.IsSchema(schema) || schema instanceof import_compiler.TypeCheck) {
720
+ return schema;
721
+ }
722
+ if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
723
+ return import_typebox.Type.Literal(schema);
724
+ }
725
+ const newSchema = {};
726
+ Object.getOwnPropertyNames(schema).forEach((key) => {
727
+ if (import_typebox.KindGuard.IsSchema(schema[key])) {
728
+ newSchema[key] = schema[key];
729
+ } else {
730
+ const schemified = this.schemify(schema[key]);
731
+ newSchema[key] = schemified;
732
+ }
733
+ });
734
+ return import_typebox.Type.Object(newSchema);
735
+ }
736
+ /**
737
+ * Make a schema optional.
738
+ * @param {TIdiomaticSchema} schema - The schema to make optional.
739
+ * @returns {TOptional<TResolve<T>>} The optional schema.
740
+ */
741
+ optional(schema) {
742
+ const schemified = this.schemify(schema);
743
+ return import_typebox.Type.Optional(schemified);
744
+ }
745
+ /**
746
+ * Create an array schema.
747
+ * @param {TIdiomaticSchema} schema - The schema to use for array items.
748
+ * @returns {TArray<TResolve<T>>} The array schema.
749
+ */
750
+ array(schema) {
751
+ const schemified = this.schemify(schema);
752
+ return import_typebox.Type.Array(schemified, {
753
+ errorType: `array of ${this.errorType(schemified)}`
754
+ });
755
+ }
756
+ /**
757
+ * Create a union schema.
758
+ * @param {TUnionTupleContainer} schemas - The schemas to union.
759
+ * @returns {TUnion<UnionTupleTResolve<T>>} The union schema.
760
+ *
761
+ * WARNING: If "nullish" or TUndefined is included in the union, the key will still be expected.
762
+ * This is a limitation of TypeBox. Consider using "optional" instead.
763
+ */
764
+ union(schemas) {
765
+ const unionTypes = schemas.map((schema) => {
766
+ return this.schemify(schema);
767
+ });
768
+ return import_typebox.Type.Union(unionTypes, {
769
+ errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(", ")}`,
770
+ errorSuffix: true
771
+ });
772
+ }
773
+ /**
774
+ * Create a literal schema.
775
+ * @param {LiteralSchema} value - The literal value.
776
+ * @returns {TLiteral<T>} The literal schema.
777
+ */
778
+ literal(value) {
779
+ return import_typebox.Type.Literal(value, {
780
+ errorType: value
781
+ });
782
+ }
783
+ /**
784
+ * Create an enum schema.
785
+ * @param {Record<string, LiteralSchema>} schemaEnum - The enum schema.
786
+ * @returns {TUnion<UnionTupleTResolve<T[]>>} The enum schema.
787
+ */
788
+ enum_(schemaEnum) {
789
+ return this.union(
790
+ Object.values(schemaEnum).map((value) => this.literal(value))
791
+ );
792
+ }
793
+ /**
794
+ * Create a function schema.
795
+ * @param {TSchema[]} args - The arguments of the function.
796
+ * @param {TAny} returnType - The return type of the function.
797
+ * @returns {TFunction<Args, ReturnType>} The function schema.
798
+ */
799
+ function_(args, returnType) {
800
+ const schemaArgs = args.map((schema) => {
801
+ return this.schemify(schema);
802
+ });
803
+ const schemaReturnType = this.schemify(returnType);
804
+ return import_typebox.Type.Function(schemaArgs, schemaReturnType);
805
+ }
806
+ /**
807
+ * Create a record schema.
808
+ * @param {TIdiomaticSchema} key - The key schema.
809
+ * @param {TIdiomaticSchema} value - The value schema.
810
+ * @returns {TRecord<TResolve<Key>, TResolve<Value>>} The record schema.
811
+ */
812
+ record(key, value) {
813
+ const keySchema = this.schemify(key);
814
+ const valueSchema = this.schemify(value);
815
+ return import_typebox.Type.Record(keySchema, valueSchema);
816
+ }
817
+ /**
818
+ * Create a promise schema.
819
+ * @param {TIdiomaticSchema} schema - The schema to use for the promise.
820
+ * @returns {TPromise<TResolve<T>>} The promise schema.
821
+ */
822
+ promise(schema) {
823
+ return import_typebox.Type.Promise(this.schemify(schema));
824
+ }
825
+ /**
826
+ * Check if a value is a TypeBox object schema.
827
+ * @param {unknown} value - The value to check.
828
+ * @returns {boolean} True if the value is a TypeBox object schema.
829
+ */
830
+ isSchema(value) {
831
+ return import_typebox.KindGuard.IsSchema(value);
832
+ }
833
+ /**
834
+ * Check if a value is an instance of a TypeBox schema.
835
+ * @param {object} value - The value to check.
836
+ * @param {TCatchall} type - The schema to check against.
837
+ * @returns {boolean} True if the value is an instance of the schema.
838
+ */
839
+ isInstanceOf(value, type22) {
840
+ return typeof value === "object" && value != null && import_typebox.Kind in value && value[import_typebox.Kind] === type22[import_typebox.Kind];
841
+ }
842
+ /**
843
+ * Validate a value against a schema.
844
+ *
845
+ * @param {TSchema} schema - The schema to validate against.
846
+ * @param {unknown} value - The value to validate.
847
+ * @returns {boolean} True if valid, otherwise false.
848
+ */
849
+ validate(schema, value) {
850
+ if (schema instanceof import_compiler.TypeCheck) {
851
+ return schema.Check(value);
852
+ } else {
853
+ const schemified = this.schemify(schema);
854
+ return import_value.Value.Check(schemified, value);
855
+ }
856
+ }
857
+ /**
858
+ * Parse a value against a schema.
859
+ *
860
+ * @param {TSchema} schema - The schema to validate against.
861
+ * @param {unknown} value - The value to validate.
862
+ * @returns {ParseResult<TResolve<T>>} The parsing result.
863
+ */
864
+ parse(schema, value) {
865
+ let errors = [];
866
+ let conversion;
867
+ if (schema instanceof import_compiler.TypeCheck) {
868
+ if (schema.Check(value)) {
869
+ conversion = schema.Decode(value);
870
+ } else {
871
+ errors = Array.from(schema.Errors(value));
872
+ }
873
+ } else {
874
+ const schemified = this.schemify(schema);
875
+ if (import_value.Value.Check(schemified, value)) {
876
+ conversion = import_value.Value.Decode(schemified, value);
877
+ } else {
878
+ errors = Array.from(import_value.Value.Errors(schemified, value));
879
+ }
880
+ }
881
+ return errors != null && errors.length === 0 ? {
882
+ ok: true,
883
+ value: conversion
884
+ } : {
885
+ ok: false,
886
+ errors: errors.flatMap((error) => {
887
+ if (error.type === import_errors.ValueErrorType.Union && error.schema.errorType.includes("any of")) {
888
+ return error.errors.flatMap(
889
+ (e, idx) => Array.from(e).map((e2) => ({
890
+ path: [
891
+ `Union Schema Variant ${idx}`,
892
+ ...error.path.split("/").slice(1),
893
+ ...e2.path.split("/").slice(1)
894
+ ],
895
+ message: e2.message
896
+ }))
897
+ );
898
+ } else {
899
+ return [
900
+ {
901
+ path: error.path.split("/").slice(1),
902
+ message: error.message
903
+ }
904
+ ];
905
+ }
906
+ })
907
+ };
908
+ }
909
+ /**
910
+ * Convert a schema to an OpenAPI schema object.
911
+ * @param {TIdiomaticSchema | TCatchall} schema - The schema to convert.
912
+ * @returns {SchemaObject} The OpenAPI schema object.
913
+ */
914
+ openapi(schema) {
915
+ let schemified = this.schemify(schema);
916
+ if (import_typebox.KindGuard.IsDate(schemified)) {
917
+ schemified = import_typebox.Type.String({
918
+ format: "date-time"
919
+ });
920
+ }
921
+ const newSchema = Object.assign({}, schemified);
922
+ if (Object.hasOwn(newSchema, "properties")) {
923
+ if (newSchema.properties) {
924
+ Object.entries({ ...schemified.properties }).forEach(([key, value]) => {
925
+ if (import_typebox.KindGuard.IsSchema(value) && newSchema.properties) {
926
+ newSchema.properties[key] = this.openapi(value);
927
+ }
928
+ });
929
+ }
930
+ }
931
+ if (Object.hasOwn(newSchema, "items")) {
932
+ newSchema.items = this.openapi(newSchema.items);
933
+ }
934
+ if (Array.isArray(newSchema.anyOf)) {
935
+ newSchema.anyOf = newSchema.anyOf.map(
936
+ (item) => this.openapi(item)
937
+ );
938
+ }
939
+ if (Array.isArray(newSchema.oneOf)) {
940
+ newSchema.oneOf = newSchema.oneOf.map(
941
+ (item) => this.openapi(item)
942
+ );
943
+ }
944
+ if ("errorType" in newSchema) {
945
+ delete newSchema["errorType"];
946
+ }
947
+ return newSchema;
948
+ }
949
+ };
950
+ var SchemaValidator = () => new TypeboxSchemaValidator();
951
+ var StaticSchemaValidator = SchemaValidator();
952
+ var string = StaticSchemaValidator.string;
953
+ var uuid = StaticSchemaValidator.uuid;
954
+ var uri = StaticSchemaValidator.uri;
955
+ var email = StaticSchemaValidator.email;
956
+ var number = StaticSchemaValidator.number;
957
+ var bigint = StaticSchemaValidator.bigint;
958
+ var boolean = StaticSchemaValidator.boolean;
959
+ var date = StaticSchemaValidator.date;
960
+ var symbol = StaticSchemaValidator.symbol;
961
+ var nullish = StaticSchemaValidator.nullish;
962
+ var void_ = StaticSchemaValidator.void;
963
+ var null_ = StaticSchemaValidator.null;
964
+ var undefined_ = StaticSchemaValidator.undefined;
965
+ var any = StaticSchemaValidator.any;
966
+ var unknown = StaticSchemaValidator.unknown;
967
+ var never = StaticSchemaValidator.never;
968
+ var binary = StaticSchemaValidator.binary;
969
+ var file = StaticSchemaValidator.file;
970
+ var type = StaticSchemaValidator.type;
971
+ var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator);
972
+ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator);
973
+ var array = StaticSchemaValidator.array.bind(StaticSchemaValidator);
974
+ var union = StaticSchemaValidator.union.bind(StaticSchemaValidator);
975
+ var literal = StaticSchemaValidator.literal.bind(StaticSchemaValidator);
976
+ var enum_ = StaticSchemaValidator.enum_.bind(StaticSchemaValidator);
977
+ var function_ = StaticSchemaValidator.function_.bind(StaticSchemaValidator);
978
+ var record = StaticSchemaValidator.record.bind(StaticSchemaValidator);
979
+ var promise = StaticSchemaValidator.promise.bind(StaticSchemaValidator);
980
+ var isSchema = StaticSchemaValidator.isSchema.bind(StaticSchemaValidator);
981
+ var validate = StaticSchemaValidator.validate.bind(StaticSchemaValidator);
982
+ var parse = StaticSchemaValidator.parse.bind(StaticSchemaValidator);
983
+ var openapi = StaticSchemaValidator.openapi.bind(StaticSchemaValidator);
984
+
985
+ // schemas/typebox/redisWorker.schema.ts
986
+ var RedisWorkerOptionsSchema = {
987
+ pageSize: number,
988
+ retries: number,
989
+ interval: number
990
+ };
991
+
992
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.6.12_openapi3-ts@4.4.0/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
993
+ var import_zod_openapi = __toESM(require_src(), 1);
994
+ var import_zod = require("zod");
995
+ (0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
996
+ var ZodSchemaValidator = class {
997
+ _Type = "Zod";
998
+ _SchemaCatchall;
999
+ _ValidSchemaObject;
1000
+ string = import_zod.z.string().openapi({
1001
+ title: "String",
1002
+ example: "a string"
1003
+ });
1004
+ uuid = import_zod.z.string().uuid().openapi({
1005
+ title: "UUID",
1006
+ format: "uuid",
1007
+ pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
1008
+ example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
1009
+ });
1010
+ email = import_zod.z.string().email().openapi({
1011
+ title: "Email",
1012
+ format: "email",
1013
+ pattern: `(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])`,
1014
+ example: "a@b.com"
1015
+ });
1016
+ uri = import_zod.z.string().url().openapi({
1017
+ title: "URI",
1018
+ format: "uri",
1019
+ pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
1020
+ example: "https://forklaunch.com"
1021
+ });
1022
+ number = import_zod.z.preprocess((value) => {
1023
+ try {
1024
+ return Number(value);
1025
+ } catch {
1026
+ return value;
1027
+ }
1028
+ }, import_zod.z.number()).openapi({
1029
+ title: "Number",
1030
+ example: 123
1031
+ });
1032
+ bigint = import_zod.z.preprocess((value) => {
1033
+ try {
1034
+ if (value instanceof Date) {
1035
+ return BigInt(value.getTime());
1036
+ }
1037
+ switch (typeof value) {
1038
+ case "number":
1039
+ case "string":
1040
+ return BigInt(value);
1041
+ case "boolean":
1042
+ return BigInt(value ? 1 : 0);
1043
+ default:
1044
+ return value;
1045
+ }
1046
+ } catch {
1047
+ return value;
1048
+ }
1049
+ }, import_zod.z.bigint()).openapi({
1050
+ title: "BigInt",
1051
+ type: "integer",
1052
+ format: "int64",
1053
+ example: 123n
1054
+ });
1055
+ boolean = import_zod.z.preprocess((val) => {
1056
+ if (typeof val === "string") {
1057
+ if (val.toLowerCase() === "true") return true;
1058
+ if (val.toLowerCase() === "false") return false;
1059
+ }
1060
+ return val;
1061
+ }, import_zod.z.boolean()).openapi({
1062
+ title: "Boolean",
1063
+ example: true
1064
+ });
1065
+ date = import_zod.z.preprocess((value) => {
1066
+ try {
1067
+ switch (typeof value) {
1068
+ case "string":
1069
+ return new Date(value);
1070
+ case "number":
1071
+ return new Date(value);
1072
+ default:
1073
+ return value;
1074
+ }
1075
+ } catch {
1076
+ return value;
1077
+ }
1078
+ }, import_zod.z.date()).openapi({
1079
+ title: "Date",
1080
+ type: "string",
1081
+ format: "date-time",
1082
+ example: "2025-05-16T21:13:04.123Z"
1083
+ });
1084
+ symbol = import_zod.z.symbol().openapi({
1085
+ title: "Symbol",
1086
+ example: Symbol("symbol")
1087
+ });
1088
+ nullish = import_zod.z.union([import_zod.z.void(), import_zod.z.null(), import_zod.z.undefined()]).openapi({
1089
+ title: "Nullish",
1090
+ type: "null",
1091
+ example: null
1092
+ });
1093
+ void = import_zod.z.void().openapi({
1094
+ title: "Void",
1095
+ type: "null",
1096
+ example: void 0
1097
+ });
1098
+ null = import_zod.z.null().openapi({
1099
+ title: "Null",
1100
+ type: "null",
1101
+ example: null
1102
+ });
1103
+ undefined = import_zod.z.undefined().openapi({
1104
+ title: "Undefined",
1105
+ type: "null",
1106
+ example: void 0
1107
+ });
1108
+ any = import_zod.z.any().openapi({
1109
+ title: "Any",
1110
+ type: "object",
1111
+ example: "any"
1112
+ });
1113
+ unknown = import_zod.z.unknown().openapi({
1114
+ title: "Unknown",
1115
+ type: "object",
1116
+ example: "unknown"
1117
+ });
1118
+ never = import_zod.z.never().openapi({
1119
+ title: "Never",
1120
+ type: "null",
1121
+ example: "never"
1122
+ });
1123
+ binary = import_zod.z.string().transform((v) => new TextEncoder().encode(v)).openapi({
1124
+ title: "Binary",
1125
+ type: "string",
1126
+ format: "binary",
1127
+ example: "a utf-8 encodable string"
1128
+ });
1129
+ file = import_zod.z.string().transform((val) => {
1130
+ return (name, type22) => new File([val], name, {
1131
+ type: type22,
1132
+ lastModified: Date.now()
1133
+ });
1134
+ }).openapi({
1135
+ title: "File",
1136
+ type: "string",
1137
+ format: "binary",
1138
+ example: "a utf-8 encodable string"
1139
+ });
1140
+ type = () => this.any;
1141
+ /**
1142
+ * Compiles schema if this exists, for optimal performance.
1143
+ *
1144
+ * @param {ZodObject<ZodRawShape>} schema - The schema to compile.
1145
+ * @returns {ZodResolve<T>} - The compiled schema.
1146
+ */
1147
+ compile(schema) {
1148
+ return schema;
1149
+ }
1150
+ /**
1151
+ * Convert a schema to a Zod schema.
1152
+ * @param {ZodIdiomaticSchema} schema - The schema to convert.
1153
+ * @returns {ZodResolve<T>} The resolved schema.
1154
+ */
1155
+ schemify(schema) {
1156
+ if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
1157
+ return import_zod.z.literal(schema);
1158
+ }
1159
+ if (schema instanceof import_zod.ZodType) {
1160
+ return schema;
1161
+ }
1162
+ const newSchema = {};
1163
+ Object.getOwnPropertyNames(schema).forEach((key) => {
1164
+ if (schema[key] instanceof import_zod.ZodType) {
1165
+ newSchema[key] = schema[key];
1166
+ } else {
1167
+ newSchema[key] = this.schemify(schema[key]);
1168
+ }
1169
+ });
1170
+ return import_zod.z.object(newSchema);
1171
+ }
1172
+ /**
1173
+ * Make a schema optional.
1174
+ * @param {ZodIdiomaticSchema} schema - The schema to make optional.
1175
+ * @returns {ZodOptional<ZodResolve<T>>} The optional schema.
1176
+ */
1177
+ optional(schema) {
1178
+ const resolvedSchema = this.schemify(schema);
1179
+ return resolvedSchema.optional();
1180
+ }
1181
+ /**
1182
+ * Create an array schema.
1183
+ * @param {ZodIdiomaticSchema} schema - The schema to use for array items.
1184
+ * @returns {ZodArray<ZodResolve<T>>} The array schema.
1185
+ */
1186
+ array(schema) {
1187
+ const resolvedSchema = this.schemify(schema);
1188
+ return resolvedSchema.array();
1189
+ }
1190
+ /**
1191
+ * Create a union schema.
1192
+ * @param {ZodUnionContainer} schemas - The schemas to union.
1193
+ * @returns {ZodUnion<UnionZodResolve<T>>} The union schema.
1194
+ */
1195
+ union(schemas) {
1196
+ const resolvedSchemas = schemas.map((schema) => this.schemify(schema));
1197
+ return import_zod.z.union(
1198
+ resolvedSchemas
1199
+ );
1200
+ }
1201
+ /**
1202
+ * Create a literal schema.
1203
+ * @param {LiteralSchema} value - The literal value.
1204
+ * @returns {ZodLiteral<ZodResolve<T>>} The literal schema.
1205
+ */
1206
+ literal(value) {
1207
+ return import_zod.z.literal(value);
1208
+ }
1209
+ /**
1210
+ * Create an enum schema.
1211
+ * @param {Record<string, LiteralSchema>} schemaEnum - The enum schema.
1212
+ * @returns {ZodUnion<UnionZodResolve<[T, T, ...T[]]>>} The enum schema.
1213
+ */
1214
+ enum_(schemaEnum) {
1215
+ return this.union(
1216
+ Object.values(schemaEnum)
1217
+ );
1218
+ }
1219
+ /**
1220
+ * Create a function schema.
1221
+ * @param {ZodTuple} args - The arguments of the function.
1222
+ * @param {ZodAny} returnType - The return type of the function.
1223
+ * @returns {ZodFunction<Args, ReturnType>} The function schema.
1224
+ */
1225
+ function_(args, returnType) {
1226
+ const schemaArgs = args.map((schema) => this.schemify(schema));
1227
+ const schemaReturnType = this.schemify(returnType);
1228
+ return import_zod.z.function(import_zod.z.tuple(schemaArgs), schemaReturnType);
1229
+ }
1230
+ /**
1231
+ * Create a record schema.
1232
+ * @param {ZodIdiomaticSchema} key - The key schema.
1233
+ * @param {ZodIdiomaticSchema} value - The value schema.
1234
+ * @returns {ZodRecord<ZodResolve<Key>, ZodResolve<Value>>} The record schema.
1235
+ */
1236
+ record(key, value) {
1237
+ const keySchema = this.schemify(key);
1238
+ const valueSchema = this.schemify(value);
1239
+ return import_zod.z.record(keySchema, valueSchema);
1240
+ }
1241
+ /**
1242
+ * Create a promise schema.
1243
+ * @param {ZodIdiomaticSchema} schema - The schema to use for the promise.
1244
+ * @returns {ZodPromise<ZodResolve<T>>} The promise schema.
1245
+ */
1246
+ promise(schema) {
1247
+ return import_zod.z.promise(this.schemify(schema));
1248
+ }
1249
+ /**
1250
+ * Checks if a value is a Zod schema.
1251
+ * @param {unknown} value - The value to check.
1252
+ * @returns {boolean} True if the value is a Zod schema.
1253
+ */
1254
+ isSchema(value) {
1255
+ return value instanceof import_zod.ZodType;
1256
+ }
1257
+ /**
1258
+ * Checks if a value is an instance of a Zod schema.
1259
+ * @param {object} value - The value to check.
1260
+ * @param {ZodType} type - The schema to check against.
1261
+ * @returns {boolean} True if the value is an instance of the schema.
1262
+ */
1263
+ isInstanceOf(value, type22) {
1264
+ return this.isSchema(value) && type22._def.typeName === value._def.typeName;
1265
+ }
1266
+ /**
1267
+ * Validate a value against a schema.
1268
+ * @param {ZodCatchall} schema - The schema to validate against.
1269
+ * @param {unknown} value - The value to validate.
1270
+ * @returns {boolean} True if valid, otherwise false.
1271
+ */
1272
+ validate(schema, value) {
1273
+ const resolvedSchema = this.schemify(schema);
1274
+ return resolvedSchema.safeParse(value).success;
1275
+ }
1276
+ /**
1277
+ * Parses a value to a schema validation.
1278
+ *
1279
+ * @param {ZodCatchall} schema - The schema to validate against.
1280
+ * @param {unknown} value - The value to validate.
1281
+ * @returns {ParseResult} - The discrimintated parsed value if successful, the error if unsuccessful.
1282
+ */
1283
+ parse(schema, value) {
1284
+ const resolvedSchema = this.schemify(schema);
1285
+ const result = resolvedSchema.safeParse(value);
1286
+ return result.success ? { ok: true, value: result.data } : {
1287
+ ok: false,
1288
+ errors: result.error.errors.flatMap((error) => {
1289
+ switch (error.code) {
1290
+ case "invalid_union":
1291
+ return error.unionErrors.flatMap(
1292
+ (unionError, idx) => unionError.errors.map((e) => ({
1293
+ path: [
1294
+ `Union Schema Variant ${idx}`,
1295
+ ...error.path.map((p) => p.toString()),
1296
+ ...e.path.map((p) => p.toString())
1297
+ ],
1298
+ message: e.message
1299
+ }))
1300
+ );
1301
+ default:
1302
+ return [
1303
+ {
1304
+ path: error.path.map((p) => p.toString()),
1305
+ message: error.message
1306
+ }
1307
+ ];
1308
+ }
1309
+ })
1310
+ };
1311
+ }
1312
+ /**
1313
+ * Convert a schema to an OpenAPI schema object.
1314
+ * @param {ZodIdiomaticSchema} schema - The schema to convert.
1315
+ * @returns {SchemaObject} The OpenAPI schema object.
1316
+ */
1317
+ openapi(schema) {
1318
+ return (0, import_zod_openapi.generateSchema)(this.schemify(schema));
1319
+ }
1320
+ };
1321
+ var SchemaValidator2 = () => new ZodSchemaValidator();
1322
+ var StaticSchemaValidator2 = SchemaValidator2();
1323
+ var string2 = StaticSchemaValidator2.string;
1324
+ var uuid2 = StaticSchemaValidator2.uuid;
1325
+ var email2 = StaticSchemaValidator2.email;
1326
+ var uri2 = StaticSchemaValidator2.uri;
1327
+ var number2 = StaticSchemaValidator2.number;
1328
+ var bigint2 = StaticSchemaValidator2.bigint;
1329
+ var boolean2 = StaticSchemaValidator2.boolean;
1330
+ var date2 = StaticSchemaValidator2.date;
1331
+ var symbol2 = StaticSchemaValidator2.symbol;
1332
+ var nullish2 = StaticSchemaValidator2.nullish;
1333
+ var void_2 = StaticSchemaValidator2.void;
1334
+ var null_2 = StaticSchemaValidator2.null;
1335
+ var undefined_2 = StaticSchemaValidator2.undefined;
1336
+ var any2 = StaticSchemaValidator2.any;
1337
+ var unknown2 = StaticSchemaValidator2.unknown;
1338
+ var never2 = StaticSchemaValidator2.never;
1339
+ var binary2 = StaticSchemaValidator2.binary;
1340
+ var file2 = StaticSchemaValidator2.file;
1341
+ var type2 = StaticSchemaValidator2.type;
1342
+ var schemify2 = StaticSchemaValidator2.schemify.bind(StaticSchemaValidator2);
1343
+ var optional2 = StaticSchemaValidator2.optional.bind(StaticSchemaValidator2);
1344
+ var array2 = StaticSchemaValidator2.array.bind(StaticSchemaValidator2);
1345
+ var union2 = StaticSchemaValidator2.union.bind(StaticSchemaValidator2);
1346
+ var literal2 = StaticSchemaValidator2.literal.bind(StaticSchemaValidator2);
1347
+ var enum_2 = StaticSchemaValidator2.enum_.bind(StaticSchemaValidator2);
1348
+ var function_2 = StaticSchemaValidator2.function_.bind(StaticSchemaValidator2);
1349
+ var record2 = StaticSchemaValidator2.record.bind(StaticSchemaValidator2);
1350
+ var promise2 = StaticSchemaValidator2.promise.bind(StaticSchemaValidator2);
1351
+ var isSchema2 = StaticSchemaValidator2.isSchema.bind(StaticSchemaValidator2);
1352
+ var validate2 = StaticSchemaValidator2.validate.bind(StaticSchemaValidator2);
1353
+ var parse2 = StaticSchemaValidator2.parse.bind(StaticSchemaValidator2);
1354
+ var openapi2 = StaticSchemaValidator2.openapi.bind(StaticSchemaValidator2);
1355
+
1356
+ // schemas/zod/redisWorker.schema.ts
1357
+ var RedisWorkerOptionsSchema2 = {
1358
+ pageSize: number2,
1359
+ retries: number2,
1360
+ interval: number2
1361
+ };
1362
+
1363
+ // schemas/redisWorker.schema.ts
1364
+ var RedisWorkerSchemas = (0, import_mappers.serviceSchemaResolver)(
1365
+ () => RedisWorkerOptionsSchema,
1366
+ () => RedisWorkerOptionsSchema2
1367
+ );
1368
+ // Annotate the CommonJS export names for ESM import in node:
1369
+ 0 && (module.exports = {
1370
+ RedisWorkerSchemas
1371
+ });