@forklaunch/implementation-worker-kafka 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -8,15 +8,22 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
11
+ if ((from && typeof from === 'object') || typeof from === 'function') {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
15
18
  }
16
19
  return to;
17
20
  };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var __reExport = (target, mod, secondTarget) => (
22
+ __copyProps(target, mod, 'default'),
23
+ secondTarget && __copyProps(secondTarget, mod, 'default')
24
+ );
25
+ var __toCommonJS = (mod) =>
26
+ __copyProps(__defProp({}, '__esModule', { value: true }), mod);
20
27
 
21
28
  // domain/schemas/index.ts
22
29
  var schemas_exports = {};
@@ -26,9 +33,9 @@ __export(schemas_exports, {
26
33
  module.exports = __toCommonJS(schemas_exports);
27
34
 
28
35
  // domain/schemas/kafka.schema.ts
29
- var import_internal = require("@forklaunch/internal");
36
+ var import_internal = require('@forklaunch/internal');
30
37
 
31
- // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.5/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
38
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.7/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
32
39
  var typebox_exports = {};
33
40
  __export(typebox_exports, {
34
41
  SchemaValidator: () => SchemaValidator,
@@ -66,9 +73,9 @@ __export(typebox_exports, {
66
73
  validate: () => validate,
67
74
  void_: () => void_
68
75
  });
69
- __reExport(typebox_exports, require("@sinclair/typebox"));
76
+ __reExport(typebox_exports, require('@sinclair/typebox'));
70
77
 
71
- // ../../../node_modules/.pnpm/@forklaunch+common@0.6.5/node_modules/@forklaunch/common/lib/index.mjs
78
+ // ../../../node_modules/.pnpm/@forklaunch+common@0.6.7/node_modules/@forklaunch/common/lib/index.mjs
72
79
  var InMemoryBlob = class extends Blob {
73
80
  constructor(content) {
74
81
  super([content]);
@@ -76,212 +83,235 @@ var InMemoryBlob = class extends Blob {
76
83
  }
77
84
  };
78
85
 
79
- // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.5/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
80
- var import_typebox = require("@sinclair/typebox");
81
- var import_compiler = require("@sinclair/typebox/compiler");
82
- var import_errors = require("@sinclair/typebox/errors");
83
- var import_value = require("@sinclair/typebox/value");
84
- import_typebox.FormatRegistry.Set("binary", (value) => typeof value === "string");
86
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.7/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
87
+ var import_typebox = require('@sinclair/typebox');
88
+ var import_compiler = require('@sinclair/typebox/compiler');
89
+ var import_errors = require('@sinclair/typebox/errors');
90
+ var import_value = require('@sinclair/typebox/value');
91
+ import_typebox.FormatRegistry.Set(
92
+ 'binary',
93
+ (value) => typeof value === 'string'
94
+ );
85
95
  (0, import_errors.SetErrorFunction)((params) => {
86
96
  switch (params.errorType) {
87
97
  case import_errors.ValueErrorType.Union:
88
98
  case import_errors.ValueErrorType.Array:
89
99
  case import_errors.ValueErrorType.String:
90
100
  case import_errors.ValueErrorType.Number:
91
- return params.schema.errorType ? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? "s" : ""}` : (0, import_errors.DefaultErrorFunction)(params);
101
+ return params.schema.errorType
102
+ ? `Expected ${params.schema.errorType} value${params.schema.errorSuffix ? 's' : ''}`
103
+ : (0, import_errors.DefaultErrorFunction)(params);
92
104
  default:
93
105
  return (0, import_errors.DefaultErrorFunction)(params);
94
106
  }
95
107
  });
96
108
  var TypeboxSchemaValidator = class {
97
- _Type = "TypeBox";
109
+ _Type = 'TypeBox';
98
110
  _SchemaCatchall;
99
111
  _ValidSchemaObject;
100
112
  string = import_typebox.Type.String({
101
- example: "a string",
102
- title: "String"
113
+ example: 'a string',
114
+ title: 'String'
103
115
  });
104
116
  uuid = import_typebox.Type.String({
105
- 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}$",
106
- errorType: "uuid",
107
- example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
108
- title: "UUID"
117
+ pattern:
118
+ '^[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}$',
119
+ errorType: 'uuid',
120
+ example: 'a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6',
121
+ title: 'UUID'
109
122
  });
110
123
  email = import_typebox.Type.String({
111
- pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
112
- errorType: "email",
113
- example: "a@b.com",
114
- title: "Email"
124
+ pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
125
+ errorType: 'email',
126
+ example: 'a@b.com',
127
+ title: 'Email'
115
128
  });
116
129
  uri = import_typebox.Type.String({
117
- pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
118
- errorType: "uri",
119
- example: "https://forklaunch.com",
120
- title: "URI"
130
+ pattern: '^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$',
131
+ errorType: 'uri',
132
+ example: 'https://forklaunch.com',
133
+ title: 'URI'
121
134
  });
122
135
  number = import_typebox.Type.Transform(
123
136
  import_typebox.Type.Union(
124
137
  [
125
138
  import_typebox.Type.Number(),
126
- import_typebox.Type.String({ pattern: "^[0-9]+$" }),
139
+ import_typebox.Type.String({ pattern: '^[0-9]+$' }),
127
140
  import_typebox.Type.Boolean(),
128
141
  import_typebox.Type.Null(),
129
142
  import_typebox.Type.BigInt(),
130
143
  import_typebox.Type.Date()
131
144
  ],
132
145
  {
133
- errorType: "number-like",
146
+ errorType: 'number-like',
134
147
  example: 123,
135
- title: "Number"
148
+ title: 'Number'
136
149
  }
137
150
  )
138
- ).Decode((value) => {
139
- if (typeof value !== "number") {
140
- const num = Number(value);
141
- if (isNaN(num)) {
142
- throw new Error("Invalid number");
143
- } else {
144
- return num;
151
+ )
152
+ .Decode((value) => {
153
+ if (typeof value !== 'number') {
154
+ const num = Number(value);
155
+ if (isNaN(num)) {
156
+ throw new Error('Invalid number');
157
+ } else {
158
+ return num;
159
+ }
145
160
  }
146
- }
147
- return value;
148
- }).Encode(Number);
161
+ return value;
162
+ })
163
+ .Encode(Number);
149
164
  bigint = import_typebox.Type.Transform(
150
165
  import_typebox.Type.Union(
151
166
  [
152
167
  import_typebox.Type.BigInt(),
153
168
  import_typebox.Type.Number(),
154
- import_typebox.Type.String({ pattern: "^[0-9]+n?$" }),
169
+ import_typebox.Type.String({ pattern: '^[0-9]+n?$' }),
155
170
  import_typebox.Type.Boolean(),
156
171
  import_typebox.Type.Date()
157
172
  ],
158
173
  {
159
- errorType: "BigInt-like",
174
+ errorType: 'BigInt-like',
160
175
  example: 123n,
161
- title: "BigInt"
176
+ title: 'BigInt'
162
177
  }
163
178
  )
164
- ).Decode((value) => {
165
- if (typeof value !== "bigint") {
166
- try {
167
- if (value instanceof Date) {
168
- return BigInt(value.getTime());
179
+ )
180
+ .Decode((value) => {
181
+ if (typeof value !== 'bigint') {
182
+ try {
183
+ if (value instanceof Date) {
184
+ return BigInt(value.getTime());
185
+ }
186
+ return BigInt(value);
187
+ } catch {
188
+ throw new Error('Invalid bigint');
169
189
  }
170
- return BigInt(value);
171
- } catch {
172
- throw new Error("Invalid bigint");
173
190
  }
174
- }
175
- return value;
176
- }).Encode(BigInt);
191
+ return value;
192
+ })
193
+ .Encode(BigInt);
177
194
  boolean = import_typebox.Type.Transform(
178
195
  import_typebox.Type.Union(
179
196
  [
180
197
  import_typebox.Type.Boolean(),
181
198
  import_typebox.Type.String({
182
- pattern: "^(t|T)(r|R)(u|U)(e|E)$|^(f|F)(a|A)(l|L)(s|S)(e|E)$"
199
+ pattern: '^(t|T)(r|R)(u|U)(e|E)$|^(f|F)(a|A)(l|L)(s|S)(e|E)$'
183
200
  })
184
201
  ],
185
202
  {
186
- errorType: "boolean-like",
203
+ errorType: 'boolean-like',
187
204
  example: true,
188
- title: "Boolean"
205
+ title: 'Boolean'
189
206
  }
190
207
  )
191
- ).Decode((value) => {
192
- if (typeof value === "string") {
193
- if (value.toLowerCase() === "true") return true;
194
- return false;
195
- } else {
196
- return value;
197
- }
198
- }).Encode(Boolean);
208
+ )
209
+ .Decode((value) => {
210
+ if (typeof value === 'string') {
211
+ if (value.toLowerCase() === 'true') return true;
212
+ return false;
213
+ } else {
214
+ return value;
215
+ }
216
+ })
217
+ .Encode(Boolean);
199
218
  date = import_typebox.Type.Transform(
200
219
  import_typebox.Type.Union(
201
220
  [
202
221
  import_typebox.Type.String({
203
- 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+$"
222
+ pattern:
223
+ '^\\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+$'
204
224
  }),
205
225
  import_typebox.Type.Number(),
206
226
  import_typebox.Type.Date()
207
227
  ],
208
228
  {
209
- errorType: "date",
210
- example: "2025-05-16T21:13:04.123Z",
211
- title: "Date"
229
+ errorType: 'date',
230
+ example: '2025-05-16T21:13:04.123Z',
231
+ title: 'Date'
212
232
  }
213
233
  )
214
- ).Decode((value) => {
215
- if (value === null || typeof value === "boolean") {
216
- return /* @__PURE__ */ new Date(value ? 1 : 0);
217
- }
218
- return new Date(value);
219
- }).Encode((value) => new Date(value).toISOString());
234
+ )
235
+ .Decode((value) => {
236
+ if (value === null || typeof value === 'boolean') {
237
+ return /* @__PURE__ */ new Date(value ? 1 : 0);
238
+ }
239
+ return new Date(value);
240
+ })
241
+ .Encode((value) => new Date(value).toISOString());
220
242
  symbol = import_typebox.Type.Symbol({
221
- title: "Symbol"
243
+ title: 'Symbol'
222
244
  });
223
245
  nullish = import_typebox.Type.Union(
224
- [import_typebox.Type.Void(), import_typebox.Type.Null(), import_typebox.Type.Undefined()],
246
+ [
247
+ import_typebox.Type.Void(),
248
+ import_typebox.Type.Null(),
249
+ import_typebox.Type.Undefined()
250
+ ],
225
251
  {
226
- errorType: "nullish",
227
- type: "null",
228
- example: "null",
229
- title: "Nullish"
252
+ errorType: 'nullish',
253
+ type: 'null',
254
+ example: 'null',
255
+ title: 'Nullish'
230
256
  }
231
257
  );
232
258
  void = import_typebox.Type.Void({
233
- type: "null",
234
- example: "void",
235
- title: "Void"
259
+ type: 'null',
260
+ example: 'void',
261
+ title: 'Void'
236
262
  });
237
263
  null = import_typebox.Type.Null({
238
- type: "null",
239
- example: "null",
240
- title: "Null"
264
+ type: 'null',
265
+ example: 'null',
266
+ title: 'Null'
241
267
  });
242
268
  undefined = import_typebox.Type.Undefined({
243
- type: "null",
244
- example: "undefined",
245
- title: "Undefined"
269
+ type: 'null',
270
+ example: 'undefined',
271
+ title: 'Undefined'
246
272
  });
247
273
  any = import_typebox.Type.Any({
248
- type: "object",
249
- example: "any",
250
- title: "Any"
274
+ type: 'object',
275
+ example: 'any',
276
+ title: 'Any'
251
277
  });
252
278
  unknown = import_typebox.Type.Unknown({
253
- type: "object",
254
- example: "unknown",
255
- title: "Unknown"
279
+ type: 'object',
280
+ example: 'unknown',
281
+ title: 'Unknown'
256
282
  });
257
283
  never = import_typebox.Type.Never({
258
- type: "null",
259
- example: "never",
260
- title: "Never"
284
+ type: 'null',
285
+ example: 'never',
286
+ title: 'Never'
261
287
  });
262
288
  binary = import_typebox.Type.Transform(
263
289
  import_typebox.Type.String({
264
- errorType: "binary",
265
- format: "binary",
266
- example: "a base-64 encodable string",
267
- title: "Binary"
290
+ errorType: 'binary',
291
+ format: 'binary',
292
+ example: 'a base-64 encodable string',
293
+ title: 'Binary'
268
294
  })
269
- ).Decode((value) => new Uint8Array(Buffer.from(value, "base64"))).Encode((value) => {
270
- if (value instanceof Buffer) {
271
- return String.fromCharCode(...new Uint8Array(value));
272
- }
273
- return "";
274
- });
295
+ )
296
+ .Decode((value) => new Uint8Array(Buffer.from(value, 'base64')))
297
+ .Encode((value) => {
298
+ if (value instanceof Buffer) {
299
+ return String.fromCharCode(...new Uint8Array(value));
300
+ }
301
+ return '';
302
+ });
275
303
  file = import_typebox.Type.Transform(
276
304
  import_typebox.Type.Unsafe({
277
- errorType: "binary",
278
- format: "binary",
279
- example: "a raw buffer or file stream",
280
- title: "File"
305
+ errorType: 'binary',
306
+ format: 'binary',
307
+ example: 'a raw buffer or file stream',
308
+ title: 'File'
309
+ })
310
+ )
311
+ .Decode((value) => {
312
+ return new InMemoryBlob(value);
281
313
  })
282
- ).Decode((value) => {
283
- return new InMemoryBlob(value);
284
- }).Encode((value) => value.content);
314
+ .Encode((value) => value.content);
285
315
  type = () => this.any;
286
316
  /**
287
317
  * Extracts the error type of a schema for error messages.
@@ -290,7 +320,10 @@ var TypeboxSchemaValidator = class {
290
320
  * @returns The type of the schema for error messages.
291
321
  */
292
322
  errorType(schema) {
293
- if (import_typebox.KindGuard.IsSchema(schema) && Object.hasOwn(schema, "errorType")) {
323
+ if (
324
+ import_typebox.KindGuard.IsSchema(schema) &&
325
+ Object.hasOwn(schema, 'errorType')
326
+ ) {
294
327
  return schema.errorType;
295
328
  } else if (import_typebox.KindGuard.IsLiteral(schema)) {
296
329
  return schema.const;
@@ -312,10 +345,17 @@ var TypeboxSchemaValidator = class {
312
345
  * @returns {TResolve<T>} The resolved schema.
313
346
  */
314
347
  schemify(schema) {
315
- if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
348
+ if (
349
+ typeof schema === 'string' ||
350
+ typeof schema === 'number' ||
351
+ typeof schema === 'boolean'
352
+ ) {
316
353
  return import_typebox.Type.Literal(schema);
317
354
  }
318
- if (import_typebox.KindGuard.IsSchema(schema) || schema instanceof import_compiler.TypeCheck) {
355
+ if (
356
+ import_typebox.KindGuard.IsSchema(schema) ||
357
+ schema instanceof import_compiler.TypeCheck
358
+ ) {
319
359
  return schema;
320
360
  }
321
361
  const newSchema = {};
@@ -362,7 +402,7 @@ var TypeboxSchemaValidator = class {
362
402
  return this.schemify(schema);
363
403
  });
364
404
  return import_typebox.Type.Union(unionTypes, {
365
- errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(", ")}`,
405
+ errorType: `any of ${unionTypes.map((s) => this.errorType(s)).join(', ')}`,
366
406
  errorSuffix: true
367
407
  });
368
408
  }
@@ -433,7 +473,12 @@ var TypeboxSchemaValidator = class {
433
473
  * @returns {boolean} True if the value is an instance of the schema.
434
474
  */
435
475
  isInstanceOf(value, type22) {
436
- return typeof value === "object" && value != null && import_typebox.Kind in value && value[import_typebox.Kind] === type22[import_typebox.Kind];
476
+ return (
477
+ typeof value === 'object' &&
478
+ value != null &&
479
+ import_typebox.Kind in value &&
480
+ value[import_typebox.Kind] === type22[import_typebox.Kind]
481
+ );
437
482
  }
438
483
  /**
439
484
  * Validate a value against a schema.
@@ -468,7 +513,7 @@ var TypeboxSchemaValidator = class {
468
513
  }
469
514
  } else {
470
515
  const schemified = this.schemify(schema);
471
- if (schemified[import_typebox.Kind] === "Unsafe") {
516
+ if (schemified[import_typebox.Kind] === 'Unsafe') {
472
517
  try {
473
518
  if (value instanceof Buffer) {
474
519
  conversion = new InMemoryBlob(value);
@@ -477,7 +522,7 @@ var TypeboxSchemaValidator = class {
477
522
  {
478
523
  type: import_errors.ValueErrorType.String,
479
524
  schema: schemified,
480
- path: "",
525
+ path: '',
481
526
  message: `Invalid file type: expected Buffer or string, got ${typeof value}`,
482
527
  value,
483
528
  errors: []
@@ -489,8 +534,8 @@ var TypeboxSchemaValidator = class {
489
534
  {
490
535
  type: import_errors.ValueErrorType.String,
491
536
  schema: schemified,
492
- path: "",
493
- message: err instanceof Error ? err.message : "Invalid file type",
537
+ path: '',
538
+ message: err instanceof Error ? err.message : 'Invalid file type',
494
539
  value,
495
540
  errors: []
496
541
  }
@@ -504,33 +549,38 @@ var TypeboxSchemaValidator = class {
504
549
  }
505
550
  }
506
551
  }
507
- return errors != null && errors.length === 0 ? {
508
- ok: true,
509
- value: conversion
510
- } : {
511
- ok: false,
512
- errors: errors.flatMap((error) => {
513
- if (error.type === import_errors.ValueErrorType.Union && error.schema.errorType.includes("any of")) {
514
- return error.errors.flatMap(
515
- (e, idx) => Array.from(e).map((e2) => ({
516
- path: [
517
- `Union Schema Variant ${idx}`,
518
- ...error.path.split("/").slice(1),
519
- ...e2.path.split("/").slice(1)
520
- ],
521
- message: e2.message
522
- }))
523
- );
524
- } else {
525
- return [
526
- {
527
- path: error.path.split("/").slice(1),
528
- message: error.message
529
- }
530
- ];
552
+ return errors != null && errors.length === 0
553
+ ? {
554
+ ok: true,
555
+ value: conversion
531
556
  }
532
- })
533
- };
557
+ : {
558
+ ok: false,
559
+ errors: errors.flatMap((error) => {
560
+ if (
561
+ error.type === import_errors.ValueErrorType.Union &&
562
+ error.schema.errorType.includes('any of')
563
+ ) {
564
+ return error.errors.flatMap((e, idx) =>
565
+ Array.from(e).map((e2) => ({
566
+ path: [
567
+ `Union Schema Variant ${idx}`,
568
+ ...error.path.split('/').slice(1),
569
+ ...e2.path.split('/').slice(1)
570
+ ],
571
+ message: e2.message
572
+ }))
573
+ );
574
+ } else {
575
+ return [
576
+ {
577
+ path: error.path.split('/').slice(1),
578
+ message: error.message
579
+ }
580
+ ];
581
+ }
582
+ })
583
+ };
534
584
  }
535
585
  /**
536
586
  * Convert a schema to an OpenAPI schema object.
@@ -541,34 +591,33 @@ var TypeboxSchemaValidator = class {
541
591
  let schemified = this.schemify(schema);
542
592
  if (import_typebox.KindGuard.IsDate(schemified)) {
543
593
  schemified = import_typebox.Type.String({
544
- format: "date-time"
594
+ format: 'date-time'
545
595
  });
546
596
  }
547
597
  const newSchema = Object.assign({}, schemified);
548
- if (Object.hasOwn(newSchema, "properties")) {
598
+ if (Object.hasOwn(newSchema, 'properties')) {
549
599
  if (newSchema.properties) {
550
600
  Object.entries({ ...schemified.properties }).forEach(([key, value]) => {
551
- if (import_typebox.KindGuard.IsSchema(value) && newSchema.properties) {
601
+ if (
602
+ import_typebox.KindGuard.IsSchema(value) &&
603
+ newSchema.properties
604
+ ) {
552
605
  newSchema.properties[key] = this.openapi(value);
553
606
  }
554
607
  });
555
608
  }
556
609
  }
557
- if (Object.hasOwn(newSchema, "items")) {
610
+ if (Object.hasOwn(newSchema, 'items')) {
558
611
  newSchema.items = this.openapi(newSchema.items);
559
612
  }
560
613
  if (Array.isArray(newSchema.anyOf)) {
561
- newSchema.anyOf = newSchema.anyOf.map(
562
- (item) => this.openapi(item)
563
- );
614
+ newSchema.anyOf = newSchema.anyOf.map((item) => this.openapi(item));
564
615
  }
565
616
  if (Array.isArray(newSchema.oneOf)) {
566
- newSchema.oneOf = newSchema.oneOf.map(
567
- (item) => this.openapi(item)
568
- );
617
+ newSchema.oneOf = newSchema.oneOf.map((item) => this.openapi(item));
569
618
  }
570
- if ("errorType" in newSchema) {
571
- delete newSchema["errorType"];
619
+ if ('errorType' in newSchema) {
620
+ delete newSchema['errorType'];
572
621
  }
573
622
  return newSchema;
574
623
  }
@@ -618,43 +667,55 @@ var KafkaWorkerOptionsSchema = {
618
667
  peekCount: number
619
668
  };
620
669
 
621
- // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.5/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
622
- var import_v3 = require("zod/v3");
670
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.7/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
671
+ var import_v3 = require('zod/v3');
623
672
 
624
673
  // ../../../node_modules/.pnpm/ts-deepmerge@7.0.3/node_modules/ts-deepmerge/esm/index.js
625
674
  var isObject = (obj) => {
626
- if (typeof obj === "object" && obj !== null) {
627
- if (typeof Object.getPrototypeOf === "function") {
675
+ if (typeof obj === 'object' && obj !== null) {
676
+ if (typeof Object.getPrototypeOf === 'function') {
628
677
  const prototype = Object.getPrototypeOf(obj);
629
678
  return prototype === Object.prototype || prototype === null;
630
679
  }
631
- return Object.prototype.toString.call(obj) === "[object Object]";
680
+ return Object.prototype.toString.call(obj) === '[object Object]';
632
681
  }
633
682
  return false;
634
683
  };
635
- var merge = (...objects) => objects.reduce((result, current) => {
636
- if (current === void 0) {
637
- return result;
638
- }
639
- if (Array.isArray(current)) {
640
- throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
641
- }
642
- Object.keys(current).forEach((key) => {
643
- if (["__proto__", "constructor", "prototype"].includes(key)) {
644
- return;
684
+ var merge = (...objects) =>
685
+ objects.reduce((result, current) => {
686
+ if (current === void 0) {
687
+ return result;
645
688
  }
646
- if (Array.isArray(result[key]) && Array.isArray(current[key])) {
647
- result[key] = merge.options.mergeArrays ? merge.options.uniqueArrayItems ? Array.from(new Set(result[key].concat(current[key]))) : [...result[key], ...current[key]] : current[key];
648
- } else if (isObject(result[key]) && isObject(current[key])) {
649
- result[key] = merge(result[key], current[key]);
650
- } else if (!isObject(result[key]) && isObject(current[key])) {
651
- result[key] = merge(current[key], void 0);
652
- } else {
653
- result[key] = current[key] === void 0 ? merge.options.allowUndefinedOverrides ? current[key] : result[key] : current[key];
689
+ if (Array.isArray(current)) {
690
+ throw new TypeError(
691
+ 'Arguments provided to ts-deepmerge must be objects, not arrays.'
692
+ );
654
693
  }
655
- });
656
- return result;
657
- }, {});
694
+ Object.keys(current).forEach((key) => {
695
+ if (['__proto__', 'constructor', 'prototype'].includes(key)) {
696
+ return;
697
+ }
698
+ if (Array.isArray(result[key]) && Array.isArray(current[key])) {
699
+ result[key] = merge.options.mergeArrays
700
+ ? merge.options.uniqueArrayItems
701
+ ? Array.from(new Set(result[key].concat(current[key])))
702
+ : [...result[key], ...current[key]]
703
+ : current[key];
704
+ } else if (isObject(result[key]) && isObject(current[key])) {
705
+ result[key] = merge(result[key], current[key]);
706
+ } else if (!isObject(result[key]) && isObject(current[key])) {
707
+ result[key] = merge(current[key], void 0);
708
+ } else {
709
+ result[key] =
710
+ current[key] === void 0
711
+ ? merge.options.allowUndefinedOverrides
712
+ ? current[key]
713
+ : result[key]
714
+ : current[key];
715
+ }
716
+ });
717
+ return result;
718
+ }, {});
658
719
  var defaultOptions = {
659
720
  allowUndefinedOverrides: true,
660
721
  mergeArrays: true,
@@ -668,8 +729,8 @@ merge.withOptions = (options, ...objects) => {
668
729
  return result;
669
730
  };
670
731
 
671
- // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.5/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
672
- var import_v32 = require("zod/v3");
732
+ // ../../../node_modules/.pnpm/@forklaunch+validator@0.10.7/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
733
+ var import_v32 = require('zod/v3');
673
734
  function extendApi(schema, schemaObject = {}) {
674
735
  const This = schema.constructor;
675
736
  const newSchema = new This(schema._def);
@@ -686,89 +747,96 @@ function iterateZodObject({
686
747
  hideDefinitions,
687
748
  openApiVersion
688
749
  }) {
689
- const reduced = Object.keys(zodRef.shape).filter((key) => hideDefinitions?.includes(key) === false).reduce(
690
- (carry, key) => ({
691
- ...carry,
692
- [key]: generateSchema(zodRef.shape[key], useOutput, openApiVersion)
693
- }),
694
- {}
695
- );
750
+ const reduced = Object.keys(zodRef.shape)
751
+ .filter((key) => hideDefinitions?.includes(key) === false)
752
+ .reduce(
753
+ (carry, key) => ({
754
+ ...carry,
755
+ [key]: generateSchema(zodRef.shape[key], useOutput, openApiVersion)
756
+ }),
757
+ {}
758
+ );
696
759
  return reduced;
697
760
  }
698
761
  function typeFormat(type22, openApiVersion) {
699
- return openApiVersion === "3.0" ? type22 : [type22];
762
+ return openApiVersion === '3.0' ? type22 : [type22];
700
763
  }
701
- function parseTransformation({
702
- zodRef,
703
- schemas,
704
- useOutput,
705
- openApiVersion
706
- }) {
764
+ function parseTransformation({ zodRef, schemas, useOutput, openApiVersion }) {
707
765
  const input = generateSchema(zodRef._def.schema, useOutput, openApiVersion);
708
- let output = "undefined";
766
+ let output = 'undefined';
709
767
  if (useOutput && zodRef._def.effect) {
710
- const effect = zodRef._def.effect.type === "transform" ? zodRef._def.effect : null;
711
- if (effect && "transform" in effect) {
768
+ const effect =
769
+ zodRef._def.effect.type === 'transform' ? zodRef._def.effect : null;
770
+ if (effect && 'transform' in effect) {
712
771
  try {
713
772
  const type22 = Array.isArray(input.type) ? input.type[0] : input.type;
714
773
  output = typeof effect.transform(
715
- ["integer", "number"].includes(`${type22}`) ? 0 : "string" === type22 ? "" : "boolean" === type22 ? false : "object" === type22 ? {} : "null" === type22 ? null : "array" === type22 ? [] : void 0,
774
+ ['integer', 'number'].includes(`${type22}`)
775
+ ? 0
776
+ : 'string' === type22
777
+ ? ''
778
+ : 'boolean' === type22
779
+ ? false
780
+ : 'object' === type22
781
+ ? {}
782
+ : 'null' === type22
783
+ ? null
784
+ : 'array' === type22
785
+ ? []
786
+ : void 0,
716
787
  { addIssue: () => void 0, path: [] }
717
788
  // TODO: Discover if context is necessary here
718
789
  );
719
- } catch {
720
- }
790
+ } catch {}
721
791
  }
722
792
  }
723
793
  const outputType = output;
724
794
  return merge(
725
795
  {
726
- ...zodRef.description ? { description: zodRef.description } : {},
796
+ ...(zodRef.description ? { description: zodRef.description } : {}),
727
797
  ...input,
728
- ...["number", "string", "boolean", "null"].includes(output) ? {
729
- type: typeFormat(outputType, openApiVersion)
730
- } : {}
798
+ ...(['number', 'string', 'boolean', 'null'].includes(output)
799
+ ? {
800
+ type: typeFormat(outputType, openApiVersion)
801
+ }
802
+ : {})
731
803
  },
732
804
  ...schemas
733
805
  );
734
806
  }
735
- function parseString({
736
- zodRef,
737
- schemas,
738
- openApiVersion
739
- }) {
807
+ function parseString({ zodRef, schemas, openApiVersion }) {
740
808
  const baseSchema = {
741
- type: typeFormat("string", openApiVersion)
809
+ type: typeFormat('string', openApiVersion)
742
810
  };
743
811
  const { checks = [] } = zodRef._def;
744
812
  checks.forEach((item) => {
745
813
  switch (item.kind) {
746
- case "email":
747
- baseSchema.format = "email";
814
+ case 'email':
815
+ baseSchema.format = 'email';
748
816
  break;
749
- case "uuid":
750
- baseSchema.format = "uuid";
817
+ case 'uuid':
818
+ baseSchema.format = 'uuid';
751
819
  break;
752
- case "cuid":
753
- baseSchema.format = "cuid";
820
+ case 'cuid':
821
+ baseSchema.format = 'cuid';
754
822
  break;
755
- case "url":
756
- baseSchema.format = "uri";
823
+ case 'url':
824
+ baseSchema.format = 'uri';
757
825
  break;
758
- case "datetime":
759
- baseSchema.format = "date-time";
826
+ case 'datetime':
827
+ baseSchema.format = 'date-time';
760
828
  break;
761
- case "length":
829
+ case 'length':
762
830
  baseSchema.minLength = item.value;
763
831
  baseSchema.maxLength = item.value;
764
832
  break;
765
- case "max":
833
+ case 'max':
766
834
  baseSchema.maxLength = item.value;
767
835
  break;
768
- case "min":
836
+ case 'min':
769
837
  baseSchema.minLength = item.value;
770
838
  break;
771
- case "regex":
839
+ case 'regex':
772
840
  baseSchema.pattern = item.regex.source;
773
841
  break;
774
842
  }
@@ -779,45 +847,41 @@ function parseString({
779
847
  ...schemas
780
848
  );
781
849
  }
782
- function parseNumber({
783
- zodRef,
784
- schemas,
785
- openApiVersion
786
- }) {
850
+ function parseNumber({ zodRef, schemas, openApiVersion }) {
787
851
  const baseSchema = {
788
- type: typeFormat("number", openApiVersion)
852
+ type: typeFormat('number', openApiVersion)
789
853
  };
790
854
  const { checks = [] } = zodRef._def;
791
855
  checks.forEach((item) => {
792
856
  switch (item.kind) {
793
- case "max":
794
- if (item.inclusive || openApiVersion === "3.0") {
857
+ case 'max':
858
+ if (item.inclusive || openApiVersion === '3.0') {
795
859
  baseSchema.maximum = item.value;
796
860
  }
797
861
  if (!item.inclusive) {
798
- if (openApiVersion === "3.0") {
862
+ if (openApiVersion === '3.0') {
799
863
  baseSchema.exclusiveMaximum = true;
800
864
  } else {
801
865
  baseSchema.exclusiveMaximum = item.value;
802
866
  }
803
867
  }
804
868
  break;
805
- case "min":
806
- if (item.inclusive || openApiVersion === "3.0") {
869
+ case 'min':
870
+ if (item.inclusive || openApiVersion === '3.0') {
807
871
  baseSchema.minimum = item.value;
808
872
  }
809
873
  if (!item.inclusive) {
810
- if (openApiVersion === "3.0") {
874
+ if (openApiVersion === '3.0') {
811
875
  baseSchema.exclusiveMinimum = true;
812
876
  } else {
813
877
  baseSchema.exclusiveMinimum = item.value;
814
878
  }
815
879
  }
816
880
  break;
817
- case "int":
818
- baseSchema.type = typeFormat("integer", openApiVersion);
881
+ case 'int':
882
+ baseSchema.type = typeFormat('integer', openApiVersion);
819
883
  break;
820
- case "multipleOf":
884
+ case 'multipleOf':
821
885
  baseSchema.multipleOf = item.value;
822
886
  break;
823
887
  }
@@ -845,26 +909,41 @@ function parseObject({
845
909
  openApiVersion
846
910
  }) {
847
911
  let additionalProperties;
848
- if (!(zodRef._def.catchall instanceof import_v32.z.ZodNever || zodRef._def.catchall?._def.typeName === "ZodNever"))
912
+ if (
913
+ !(
914
+ zodRef._def.catchall instanceof import_v32.z.ZodNever ||
915
+ zodRef._def.catchall?._def.typeName === 'ZodNever'
916
+ )
917
+ )
849
918
  additionalProperties = generateSchema(
850
919
  zodRef._def.catchall,
851
920
  useOutput,
852
921
  openApiVersion
853
922
  );
854
- else if (zodRef._def.unknownKeys === "passthrough")
923
+ else if (zodRef._def.unknownKeys === 'passthrough')
855
924
  additionalProperties = true;
856
- else if (zodRef._def.unknownKeys === "strict") additionalProperties = false;
857
- additionalProperties = additionalProperties != null ? { additionalProperties } : {};
858
- const requiredProperties = Object.keys(
859
- zodRef.shape
860
- ).filter((key) => {
925
+ else if (zodRef._def.unknownKeys === 'strict') additionalProperties = false;
926
+ additionalProperties =
927
+ additionalProperties != null ? { additionalProperties } : {};
928
+ const requiredProperties = Object.keys(zodRef.shape).filter((key) => {
861
929
  const item = zodRef.shape[key];
862
- return !(item.isOptional() || item instanceof import_v32.z.ZodDefault || item._def.typeName === "ZodDefault") && !(item instanceof import_v32.z.ZodNever || item._def.typeName === "ZodDefault");
930
+ return (
931
+ !(
932
+ item.isOptional() ||
933
+ item instanceof import_v32.z.ZodDefault ||
934
+ item._def.typeName === 'ZodDefault'
935
+ ) &&
936
+ !(
937
+ item instanceof import_v32.z.ZodNever ||
938
+ item._def.typeName === 'ZodDefault'
939
+ )
940
+ );
863
941
  });
864
- const required = requiredProperties.length > 0 ? { required: requiredProperties } : {};
942
+ const required =
943
+ requiredProperties.length > 0 ? { required: requiredProperties } : {};
865
944
  return merge(
866
945
  {
867
- type: typeFormat("object", openApiVersion),
946
+ type: typeFormat('object', openApiVersion),
868
947
  properties: iterateZodObject({
869
948
  zodRef,
870
949
  schemas,
@@ -876,110 +955,83 @@ function parseObject({
876
955
  ...additionalProperties,
877
956
  ...hideDefinitions
878
957
  },
879
- zodRef.description ? { description: zodRef.description, hideDefinitions } : {},
958
+ zodRef.description
959
+ ? { description: zodRef.description, hideDefinitions }
960
+ : {},
880
961
  ...schemas
881
962
  );
882
963
  }
883
- function parseRecord({
884
- zodRef,
885
- schemas,
886
- useOutput,
887
- openApiVersion
888
- }) {
964
+ function parseRecord({ zodRef, schemas, useOutput, openApiVersion }) {
889
965
  return merge(
890
966
  {
891
- type: typeFormat("object", openApiVersion),
892
- additionalProperties: zodRef._def.valueType instanceof import_v32.z.ZodUnknown ? {} : generateSchema(zodRef._def.valueType, useOutput, openApiVersion)
967
+ type: typeFormat('object', openApiVersion),
968
+ additionalProperties:
969
+ zodRef._def.valueType instanceof import_v32.z.ZodUnknown
970
+ ? {}
971
+ : generateSchema(zodRef._def.valueType, useOutput, openApiVersion)
893
972
  },
894
973
  zodRef.description ? { description: zodRef.description } : {},
895
974
  ...schemas
896
975
  );
897
976
  }
898
- function parseBigInt({
899
- zodRef,
900
- schemas,
901
- openApiVersion
902
- }) {
977
+ function parseBigInt({ zodRef, schemas, openApiVersion }) {
903
978
  return merge(
904
979
  {
905
- type: typeFormat("integer", openApiVersion),
906
- format: "int64"
980
+ type: typeFormat('integer', openApiVersion),
981
+ format: 'int64'
907
982
  },
908
983
  zodRef.description ? { description: zodRef.description } : {},
909
984
  ...schemas
910
985
  );
911
986
  }
912
- function parseBoolean({
913
- zodRef,
914
- schemas,
915
- openApiVersion
916
- }) {
987
+ function parseBoolean({ zodRef, schemas, openApiVersion }) {
917
988
  return merge(
918
- { type: typeFormat("boolean", openApiVersion) },
989
+ { type: typeFormat('boolean', openApiVersion) },
919
990
  zodRef.description ? { description: zodRef.description } : {},
920
991
  ...schemas
921
992
  );
922
993
  }
923
- function parseDate({
924
- zodRef,
925
- schemas,
926
- openApiVersion
927
- }) {
994
+ function parseDate({ zodRef, schemas, openApiVersion }) {
928
995
  return merge(
929
996
  {
930
- type: typeFormat("string", openApiVersion),
931
- format: "date-time"
997
+ type: typeFormat('string', openApiVersion),
998
+ format: 'date-time'
932
999
  },
933
1000
  zodRef.description ? { description: zodRef.description } : {},
934
1001
  ...schemas
935
1002
  );
936
1003
  }
937
- function parseNull({
938
- zodRef,
939
- schemas,
940
- openApiVersion
941
- }) {
1004
+ function parseNull({ zodRef, schemas, openApiVersion }) {
942
1005
  return merge(
943
- openApiVersion === "3.0" ? { type: "null" } : {
944
- type: ["string", "null"],
945
- enum: ["null"]
946
- },
1006
+ openApiVersion === '3.0'
1007
+ ? { type: 'null' }
1008
+ : {
1009
+ type: ['string', 'null'],
1010
+ enum: ['null']
1011
+ },
947
1012
  zodRef.description ? { description: zodRef.description } : {},
948
1013
  ...schemas
949
1014
  );
950
1015
  }
951
- function parseOptional({
952
- schemas,
953
- zodRef,
954
- useOutput,
955
- openApiVersion
956
- }) {
1016
+ function parseOptional({ schemas, zodRef, useOutput, openApiVersion }) {
957
1017
  return merge(
958
1018
  generateSchema(zodRef.unwrap(), useOutput, openApiVersion),
959
1019
  zodRef.description ? { description: zodRef.description } : {},
960
1020
  ...schemas
961
1021
  );
962
1022
  }
963
- function parseNullable({
964
- schemas,
965
- zodRef,
966
- useOutput,
967
- openApiVersion
968
- }) {
1023
+ function parseNullable({ schemas, zodRef, useOutput, openApiVersion }) {
969
1024
  const schema = generateSchema(zodRef.unwrap(), useOutput, openApiVersion);
970
1025
  return merge(
971
1026
  schema,
972
- openApiVersion === "3.0" ? { nullable: true } : { type: typeFormat("null", openApiVersion) },
1027
+ openApiVersion === '3.0'
1028
+ ? { nullable: true }
1029
+ : { type: typeFormat('null', openApiVersion) },
973
1030
  zodRef.description ? { description: zodRef.description } : {},
974
1031
  ...schemas
975
1032
  );
976
1033
  }
977
- function parseDefault({
978
- schemas,
979
- zodRef,
980
- useOutput,
981
- openApiVersion
982
- }) {
1034
+ function parseDefault({ schemas, zodRef, useOutput, openApiVersion }) {
983
1035
  return merge(
984
1036
  {
985
1037
  default: zodRef._def.defaultValue(),
@@ -989,12 +1041,7 @@ function parseDefault({
989
1041
  ...schemas
990
1042
  );
991
1043
  }
992
- function parseArray({
993
- schemas,
994
- zodRef,
995
- useOutput,
996
- openApiVersion
997
- }) {
1044
+ function parseArray({ schemas, zodRef, useOutput, openApiVersion }) {
998
1045
  const constraints = {};
999
1046
  if (zodRef._def.exactLength != null) {
1000
1047
  constraints.minItems = zodRef._def.exactLength.value;
@@ -1006,7 +1053,7 @@ function parseArray({
1006
1053
  constraints.maxItems = zodRef._def.maxLength.value;
1007
1054
  return merge(
1008
1055
  {
1009
- type: typeFormat("array", openApiVersion),
1056
+ type: typeFormat('array', openApiVersion),
1010
1057
  items: generateSchema(zodRef.element, useOutput, openApiVersion),
1011
1058
  ...constraints
1012
1059
  },
@@ -1014,11 +1061,7 @@ function parseArray({
1014
1061
  ...schemas
1015
1062
  );
1016
1063
  }
1017
- function parseLiteral({
1018
- schemas,
1019
- zodRef,
1020
- openApiVersion
1021
- }) {
1064
+ function parseLiteral({ schemas, zodRef, openApiVersion }) {
1022
1065
  const type22 = typeof zodRef._def.value;
1023
1066
  return merge(
1024
1067
  {
@@ -1029,11 +1072,7 @@ function parseLiteral({
1029
1072
  ...schemas
1030
1073
  );
1031
1074
  }
1032
- function parseEnum({
1033
- schemas,
1034
- zodRef,
1035
- openApiVersion
1036
- }) {
1075
+ function parseEnum({ schemas, zodRef, openApiVersion }) {
1037
1076
  const type22 = typeof Object.values(zodRef._def.values)[0];
1038
1077
  return merge(
1039
1078
  {
@@ -1044,12 +1083,7 @@ function parseEnum({
1044
1083
  ...schemas
1045
1084
  );
1046
1085
  }
1047
- function parseIntersection({
1048
- schemas,
1049
- zodRef,
1050
- useOutput,
1051
- openApiVersion
1052
- }) {
1086
+ function parseIntersection({ schemas, zodRef, useOutput, openApiVersion }) {
1053
1087
  return merge(
1054
1088
  {
1055
1089
  allOf: [
@@ -1061,20 +1095,20 @@ function parseIntersection({
1061
1095
  ...schemas
1062
1096
  );
1063
1097
  }
1064
- function parseUnion({
1065
- schemas,
1066
- zodRef,
1067
- useOutput,
1068
- openApiVersion
1069
- }) {
1098
+ function parseUnion({ schemas, zodRef, useOutput, openApiVersion }) {
1070
1099
  const contents = zodRef._def.options;
1071
- if (contents.reduce(
1072
- (prev, content) => prev && content._def.typeName === "ZodLiteral",
1073
- true
1074
- )) {
1100
+ if (
1101
+ contents.reduce(
1102
+ (prev, content) => prev && content._def.typeName === 'ZodLiteral',
1103
+ true
1104
+ )
1105
+ ) {
1075
1106
  const literals = contents;
1076
1107
  const type22 = literals.reduce(
1077
- (prev, content) => !prev || prev === typeof content._def.value ? typeof content._def.value : null,
1108
+ (prev, content) =>
1109
+ !prev || prev === typeof content._def.value
1110
+ ? typeof content._def.value
1111
+ : null,
1078
1112
  null
1079
1113
  );
1080
1114
  if (type22) {
@@ -1088,12 +1122,15 @@ function parseUnion({
1088
1122
  );
1089
1123
  }
1090
1124
  }
1091
- const oneOfContents = openApiVersion === "3.0" ? contents.filter((content) => content._def.typeName !== "ZodNull") : contents;
1125
+ const oneOfContents =
1126
+ openApiVersion === '3.0'
1127
+ ? contents.filter((content) => content._def.typeName !== 'ZodNull')
1128
+ : contents;
1092
1129
  const contentsHasNull = contents.length != oneOfContents.length;
1093
1130
  return merge(
1094
1131
  {
1095
- oneOf: oneOfContents.map(
1096
- (schema) => generateSchema(schema, useOutput, openApiVersion)
1132
+ oneOf: oneOfContents.map((schema) =>
1133
+ generateSchema(schema, useOutput, openApiVersion)
1097
1134
  )
1098
1135
  },
1099
1136
  contentsHasNull ? { nullable: true } : {},
@@ -1112,50 +1149,34 @@ function parseDiscriminatedUnion({
1112
1149
  discriminator: {
1113
1150
  propertyName: zodRef._def.discriminator
1114
1151
  },
1115
- oneOf: Array.from(
1116
- zodRef._def.options.values()
1117
- ).map((schema) => generateSchema(schema, useOutput, openApiVersion))
1152
+ oneOf: Array.from(zodRef._def.options.values()).map((schema) =>
1153
+ generateSchema(schema, useOutput, openApiVersion)
1154
+ )
1118
1155
  },
1119
1156
  zodRef.description ? { description: zodRef.description } : {},
1120
1157
  ...schemas
1121
1158
  );
1122
1159
  }
1123
- function parseNever({
1124
- zodRef,
1125
- schemas
1126
- }) {
1160
+ function parseNever({ zodRef, schemas }) {
1127
1161
  return merge(
1128
1162
  { readOnly: true },
1129
1163
  zodRef.description ? { description: zodRef.description } : {},
1130
1164
  ...schemas
1131
1165
  );
1132
1166
  }
1133
- function parseBranded({
1134
- schemas,
1135
- zodRef,
1136
- useOutput,
1137
- openApiVersion
1138
- }) {
1167
+ function parseBranded({ schemas, zodRef, useOutput, openApiVersion }) {
1139
1168
  return merge(
1140
1169
  generateSchema(zodRef._def.type, useOutput, openApiVersion),
1141
1170
  ...schemas
1142
1171
  );
1143
1172
  }
1144
- function catchAllParser({
1145
- zodRef,
1146
- schemas
1147
- }) {
1173
+ function catchAllParser({ zodRef, schemas }) {
1148
1174
  return merge(
1149
1175
  zodRef.description ? { description: zodRef.description } : {},
1150
1176
  ...schemas
1151
1177
  );
1152
1178
  }
1153
- function parsePipeline({
1154
- schemas,
1155
- zodRef,
1156
- useOutput,
1157
- openApiVersion
1158
- }) {
1179
+ function parsePipeline({ schemas, zodRef, useOutput, openApiVersion }) {
1159
1180
  return merge(
1160
1181
  generateSchema(
1161
1182
  useOutput ? zodRef._def.out : zodRef._def.in,
@@ -1165,12 +1186,7 @@ function parsePipeline({
1165
1186
  ...schemas
1166
1187
  );
1167
1188
  }
1168
- function parseReadonly({
1169
- zodRef,
1170
- useOutput,
1171
- schemas,
1172
- openApiVersion
1173
- }) {
1189
+ function parseReadonly({ zodRef, useOutput, schemas, openApiVersion }) {
1174
1190
  return merge(
1175
1191
  generateSchema(zodRef._def.innerType, useOutput, openApiVersion),
1176
1192
  zodRef.description ? { description: zodRef.description } : {},
@@ -1214,10 +1230,10 @@ var workerMap = {
1214
1230
  ZodPipeline: parsePipeline,
1215
1231
  ZodReadonly: parseReadonly
1216
1232
  };
1217
- function generateSchema(zodRef, useOutput = false, openApiVersion = "3.1") {
1233
+ function generateSchema(zodRef, useOutput = false, openApiVersion = '3.1') {
1218
1234
  const { metaOpenApi = {} } = zodRef;
1219
1235
  const schemas = [
1220
- ...Array.isArray(metaOpenApi) ? metaOpenApi : [metaOpenApi]
1236
+ ...(Array.isArray(metaOpenApi) ? metaOpenApi : [metaOpenApi])
1221
1237
  ];
1222
1238
  try {
1223
1239
  const typeName = zodRef._def.typeName;
@@ -1236,155 +1252,175 @@ function generateSchema(zodRef, useOutput = false, openApiVersion = "3.1") {
1236
1252
  }
1237
1253
  }
1238
1254
  function extendZodWithOpenApi(zod, forceOverride = false) {
1239
- if (!forceOverride && typeof zod.ZodSchema.prototype.openapi !== "undefined") {
1255
+ if (
1256
+ !forceOverride &&
1257
+ typeof zod.ZodSchema.prototype.openapi !== 'undefined'
1258
+ ) {
1240
1259
  return;
1241
1260
  }
1242
- zod.ZodSchema.prototype.openapi = function(metadata) {
1261
+ zod.ZodSchema.prototype.openapi = function (metadata) {
1243
1262
  return extendApi(this, metadata);
1244
1263
  };
1245
1264
  }
1246
1265
  extendZodWithOpenApi(import_v3.z);
1247
1266
  var ZodSchemaValidator = class {
1248
- _Type = "Zod";
1267
+ _Type = 'Zod';
1249
1268
  _SchemaCatchall;
1250
1269
  _ValidSchemaObject;
1251
1270
  string = import_v3.z.string().openapi({
1252
- title: "String",
1253
- example: "a string"
1271
+ title: 'String',
1272
+ example: 'a string'
1254
1273
  });
1255
1274
  uuid = import_v3.z.string().uuid().openapi({
1256
- title: "UUID",
1257
- format: "uuid",
1258
- 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}$",
1259
- example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
1275
+ title: 'UUID',
1276
+ format: 'uuid',
1277
+ pattern:
1278
+ '^[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}$',
1279
+ example: 'a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6'
1260
1280
  });
1261
1281
  email = import_v3.z.string().email().openapi({
1262
- title: "Email",
1263
- format: "email",
1264
- pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
1265
- example: "a@b.com"
1282
+ title: 'Email',
1283
+ format: 'email',
1284
+ pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
1285
+ example: 'a@b.com'
1266
1286
  });
1267
1287
  uri = import_v3.z.string().url().openapi({
1268
- title: "URI",
1269
- format: "uri",
1270
- pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
1271
- example: "https://forklaunch.com"
1272
- });
1273
- number = import_v3.z.preprocess((value) => {
1274
- try {
1275
- return Number(value);
1276
- } catch {
1277
- return value;
1278
- }
1279
- }, import_v3.z.number()).openapi({
1280
- title: "Number",
1281
- example: 123
1288
+ title: 'URI',
1289
+ format: 'uri',
1290
+ pattern: '^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$',
1291
+ example: 'https://forklaunch.com'
1282
1292
  });
1283
- bigint = import_v3.z.preprocess((value) => {
1284
- try {
1285
- if (value instanceof Date) {
1286
- return BigInt(value.getTime());
1293
+ number = import_v3.z
1294
+ .preprocess((value) => {
1295
+ try {
1296
+ return Number(value);
1297
+ } catch {
1298
+ return value;
1287
1299
  }
1288
- switch (typeof value) {
1289
- case "number":
1290
- case "string":
1291
- return BigInt(value);
1292
- case "boolean":
1293
- return BigInt(value ? 1 : 0);
1294
- default:
1295
- return value;
1300
+ }, import_v3.z.number())
1301
+ .openapi({
1302
+ title: 'Number',
1303
+ example: 123
1304
+ });
1305
+ bigint = import_v3.z
1306
+ .preprocess((value) => {
1307
+ try {
1308
+ if (value instanceof Date) {
1309
+ return BigInt(value.getTime());
1310
+ }
1311
+ switch (typeof value) {
1312
+ case 'number':
1313
+ case 'string':
1314
+ return BigInt(value);
1315
+ case 'boolean':
1316
+ return BigInt(value ? 1 : 0);
1317
+ default:
1318
+ return value;
1319
+ }
1320
+ } catch {
1321
+ return value;
1296
1322
  }
1297
- } catch {
1298
- return value;
1299
- }
1300
- }, import_v3.z.bigint()).openapi({
1301
- title: "BigInt",
1302
- type: "integer",
1303
- format: "int64",
1304
- example: 123n
1305
- });
1306
- boolean = import_v3.z.preprocess((val) => {
1307
- if (typeof val === "string") {
1308
- if (val.toLowerCase() === "true") return true;
1309
- if (val.toLowerCase() === "false") return false;
1310
- }
1311
- return val;
1312
- }, import_v3.z.boolean()).openapi({
1313
- title: "Boolean",
1314
- example: true
1315
- });
1316
- date = import_v3.z.preprocess((value) => {
1317
- try {
1318
- switch (typeof value) {
1319
- case "string":
1320
- return new Date(value);
1321
- case "number":
1322
- return new Date(value);
1323
- default:
1324
- return value;
1323
+ }, import_v3.z.bigint())
1324
+ .openapi({
1325
+ title: 'BigInt',
1326
+ type: 'integer',
1327
+ format: 'int64',
1328
+ example: 123n
1329
+ });
1330
+ boolean = import_v3.z
1331
+ .preprocess((val) => {
1332
+ if (typeof val === 'string') {
1333
+ if (val.toLowerCase() === 'true') return true;
1334
+ if (val.toLowerCase() === 'false') return false;
1325
1335
  }
1326
- } catch {
1327
- return value;
1328
- }
1329
- }, import_v3.z.date()).openapi({
1330
- title: "Date",
1331
- type: "string",
1332
- format: "date-time",
1333
- example: "2025-05-16T21:13:04.123Z"
1334
- });
1336
+ return val;
1337
+ }, import_v3.z.boolean())
1338
+ .openapi({
1339
+ title: 'Boolean',
1340
+ example: true
1341
+ });
1342
+ date = import_v3.z
1343
+ .preprocess((value) => {
1344
+ try {
1345
+ switch (typeof value) {
1346
+ case 'string':
1347
+ return new Date(value);
1348
+ case 'number':
1349
+ return new Date(value);
1350
+ default:
1351
+ return value;
1352
+ }
1353
+ } catch {
1354
+ return value;
1355
+ }
1356
+ }, import_v3.z.date())
1357
+ .openapi({
1358
+ title: 'Date',
1359
+ type: 'string',
1360
+ format: 'date-time',
1361
+ example: '2025-05-16T21:13:04.123Z'
1362
+ });
1335
1363
  symbol = import_v3.z.symbol().openapi({
1336
- title: "Symbol",
1337
- example: Symbol("symbol")
1338
- });
1339
- nullish = import_v3.z.union([import_v3.z.void(), import_v3.z.null(), import_v3.z.undefined()]).openapi({
1340
- title: "Nullish",
1341
- type: "null",
1342
- example: null
1364
+ title: 'Symbol',
1365
+ example: Symbol('symbol')
1343
1366
  });
1367
+ nullish = import_v3.z
1368
+ .union([import_v3.z.void(), import_v3.z.null(), import_v3.z.undefined()])
1369
+ .openapi({
1370
+ title: 'Nullish',
1371
+ type: 'null',
1372
+ example: null
1373
+ });
1344
1374
  void = import_v3.z.void().openapi({
1345
- title: "Void",
1346
- type: "null",
1375
+ title: 'Void',
1376
+ type: 'null',
1347
1377
  example: void 0
1348
1378
  });
1349
1379
  null = import_v3.z.null().openapi({
1350
- title: "Null",
1351
- type: "null",
1380
+ title: 'Null',
1381
+ type: 'null',
1352
1382
  example: null
1353
1383
  });
1354
1384
  undefined = import_v3.z.undefined().openapi({
1355
- title: "Undefined",
1356
- type: "null",
1385
+ title: 'Undefined',
1386
+ type: 'null',
1357
1387
  example: void 0
1358
1388
  });
1359
1389
  any = import_v3.z.any().openapi({
1360
- title: "Any",
1361
- type: "object",
1362
- example: "any"
1390
+ title: 'Any',
1391
+ type: 'object',
1392
+ example: 'any'
1363
1393
  });
1364
1394
  unknown = import_v3.z.unknown().openapi({
1365
- title: "Unknown",
1366
- type: "object",
1367
- example: "unknown"
1395
+ title: 'Unknown',
1396
+ type: 'object',
1397
+ example: 'unknown'
1368
1398
  });
1369
1399
  never = import_v3.z.never().openapi({
1370
- title: "Never",
1371
- type: "null",
1372
- example: "never"
1373
- });
1374
- binary = import_v3.z.string().transform((val) => new Uint8Array(Buffer.from(val, "base64"))).openapi({
1375
- title: "Binary",
1376
- type: "string",
1377
- format: "binary",
1378
- example: "a base-64 encodable string"
1379
- });
1380
- file = import_v3.z.instanceof(Buffer).transform((val) => {
1381
- return new Blob([val]);
1382
- }).openapi({
1383
- title: "File",
1384
- type: "string",
1385
- format: "binary",
1386
- example: "a base-64 encodable blob or file"
1400
+ title: 'Never',
1401
+ type: 'null',
1402
+ example: 'never'
1387
1403
  });
1404
+ binary = import_v3.z
1405
+ .string()
1406
+ .transform((val) => new Uint8Array(Buffer.from(val, 'base64')))
1407
+ .openapi({
1408
+ title: 'Binary',
1409
+ type: 'string',
1410
+ format: 'binary',
1411
+ example: 'a base-64 encodable string'
1412
+ });
1413
+ file = import_v3.z
1414
+ .instanceof(Buffer)
1415
+ .transform((val) => {
1416
+ return new Blob([val]);
1417
+ })
1418
+ .openapi({
1419
+ title: 'File',
1420
+ type: 'string',
1421
+ format: 'binary',
1422
+ example: 'a base-64 encodable blob or file'
1423
+ });
1388
1424
  type = () => this.any;
1389
1425
  /**
1390
1426
  * Compiles schema if this exists, for optimal performance.
@@ -1401,7 +1437,11 @@ var ZodSchemaValidator = class {
1401
1437
  * @returns {ZodResolve<T>} The resolved schema.
1402
1438
  */
1403
1439
  schemify(schema) {
1404
- if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
1440
+ if (
1441
+ typeof schema === 'string' ||
1442
+ typeof schema === 'number' ||
1443
+ typeof schema === 'boolean'
1444
+ ) {
1405
1445
  return import_v3.z.literal(schema);
1406
1446
  }
1407
1447
  if (schema instanceof import_v3.ZodType) {
@@ -1442,9 +1482,7 @@ var ZodSchemaValidator = class {
1442
1482
  */
1443
1483
  union(schemas) {
1444
1484
  const resolvedSchemas = schemas.map((schema) => this.schemify(schema));
1445
- return import_v3.z.union(
1446
- resolvedSchemas
1447
- );
1485
+ return import_v3.z.union(resolvedSchemas);
1448
1486
  }
1449
1487
  /**
1450
1488
  * Create a literal schema.
@@ -1460,9 +1498,7 @@ var ZodSchemaValidator = class {
1460
1498
  * @returns {ZodUnion<UnionZodResolve<[T, T, ...T[]]>>} The enum schema.
1461
1499
  */
1462
1500
  enum_(schemaEnum) {
1463
- return this.union(
1464
- Object.values(schemaEnum)
1465
- );
1501
+ return this.union(Object.values(schemaEnum));
1466
1502
  }
1467
1503
  /**
1468
1504
  * Create a function schema.
@@ -1473,7 +1509,10 @@ var ZodSchemaValidator = class {
1473
1509
  function_(args, returnType) {
1474
1510
  const schemaArgs = args.map((schema) => this.schemify(schema));
1475
1511
  const schemaReturnType = this.schemify(returnType);
1476
- return import_v3.z.function(import_v3.z.tuple(schemaArgs), schemaReturnType);
1512
+ return import_v3.z.function(
1513
+ import_v3.z.tuple(schemaArgs),
1514
+ schemaReturnType
1515
+ );
1477
1516
  }
1478
1517
  /**
1479
1518
  * Create a record schema.
@@ -1531,31 +1570,33 @@ var ZodSchemaValidator = class {
1531
1570
  parse(schema, value) {
1532
1571
  const resolvedSchema = this.schemify(schema);
1533
1572
  const result = resolvedSchema.safeParse(value);
1534
- return result.success ? { ok: true, value: result.data } : {
1535
- ok: false,
1536
- errors: result.error.errors.flatMap((error) => {
1537
- switch (error.code) {
1538
- case "invalid_union":
1539
- return error.unionErrors.flatMap(
1540
- (unionError, idx) => unionError.errors.map((e) => ({
1541
- path: [
1542
- `Union Schema Variant ${idx}`,
1543
- ...error.path.map((p) => p.toString()),
1544
- ...e.path.map((p) => p.toString())
1545
- ],
1546
- message: e.message
1547
- }))
1548
- );
1549
- default:
1550
- return [
1551
- {
1552
- path: error.path.map((p) => p.toString()),
1553
- message: error.message
1554
- }
1555
- ];
1556
- }
1557
- })
1558
- };
1573
+ return result.success
1574
+ ? { ok: true, value: result.data }
1575
+ : {
1576
+ ok: false,
1577
+ errors: result.error.errors.flatMap((error) => {
1578
+ switch (error.code) {
1579
+ case 'invalid_union':
1580
+ return error.unionErrors.flatMap((unionError, idx) =>
1581
+ unionError.errors.map((e) => ({
1582
+ path: [
1583
+ `Union Schema Variant ${idx}`,
1584
+ ...error.path.map((p) => p.toString()),
1585
+ ...e.path.map((p) => p.toString())
1586
+ ],
1587
+ message: e.message
1588
+ }))
1589
+ );
1590
+ default:
1591
+ return [
1592
+ {
1593
+ path: error.path.map((p) => p.toString()),
1594
+ message: error.message
1595
+ }
1596
+ ];
1597
+ }
1598
+ })
1599
+ };
1559
1600
  }
1560
1601
  /**
1561
1602
  * Convert a schema to an OpenAPI schema object.
@@ -1617,6 +1658,7 @@ var KafkaWorkerSchemas = (0, import_internal.serviceSchemaResolver)(
1617
1658
  () => KafkaWorkerOptionsSchema2
1618
1659
  );
1619
1660
  // Annotate the CommonJS export names for ESM import in node:
1620
- 0 && (module.exports = {
1621
- KafkaWorkerSchemas
1622
- });
1661
+ 0 &&
1662
+ (module.exports = {
1663
+ KafkaWorkerSchemas
1664
+ });