@forklaunch/validator 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.
@@ -200,12 +200,15 @@ var TypeboxSchemaValidator = class {
200
200
  symbol = import_typebox.Type.Symbol({
201
201
  title: "Symbol"
202
202
  });
203
- nullish = import_typebox.Type.Union([import_typebox.Type.Void(), import_typebox.Type.Null(), import_typebox.Type.Undefined()], {
204
- errorType: "nullish",
205
- type: "null",
206
- example: "null",
207
- title: "Nullish"
208
- });
203
+ nullish = import_typebox.Type.Union(
204
+ [import_typebox.Type.Void(), import_typebox.Type.Null(), import_typebox.Type.Undefined()],
205
+ {
206
+ errorType: "nullish",
207
+ type: "null",
208
+ example: "null",
209
+ title: "Nullish"
210
+ }
211
+ );
209
212
  void = import_typebox.Type.Void({
210
213
  type: "null",
211
214
  example: "void",
@@ -243,16 +246,22 @@ var TypeboxSchemaValidator = class {
243
246
  example: "a utf-8 encodable string",
244
247
  title: "Binary"
245
248
  })
246
- ).Decode(Buffer.from).Encode((value) => value.toString());
247
- file = (name, type) => import_typebox.Type.Transform(
249
+ ).Decode((value) => new TextEncoder().encode(value)).Encode((value) => {
250
+ if (value instanceof ArrayBuffer) {
251
+ return String.fromCharCode(...new Uint8Array(value));
252
+ }
253
+ return "";
254
+ });
255
+ file = import_typebox.Type.Transform(
248
256
  import_typebox.Type.String({
249
257
  errorType: "binary",
250
258
  format: "binary",
251
- contentMediaType: type,
252
259
  example: "a utf-8 encodable string",
253
260
  title: "File"
254
261
  })
255
- ).Decode((value) => new import_common.InMemoryFile(value, name, { type })).Encode((value) => value.content);
262
+ ).Decode(
263
+ (value) => (name, type) => new import_common.InMemoryFile(value, name, { type })
264
+ ).Encode((value) => value("name", "type").content);
256
265
  /**
257
266
  * Extracts the error type of a schema for error messages.
258
267
  *
@@ -535,35 +544,19 @@ var unknown = StaticSchemaValidator.unknown;
535
544
  var never = StaticSchemaValidator.never;
536
545
  var binary = StaticSchemaValidator.binary;
537
546
  var file = StaticSchemaValidator.file;
538
- var schemify = StaticSchemaValidator.schemify.bind(
539
- StaticSchemaValidator
540
- );
541
- var optional = StaticSchemaValidator.optional.bind(
542
- StaticSchemaValidator
543
- );
547
+ var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator);
548
+ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator);
544
549
  var array = StaticSchemaValidator.array.bind(StaticSchemaValidator);
545
550
  var union = StaticSchemaValidator.union.bind(StaticSchemaValidator);
546
- var literal = StaticSchemaValidator.literal.bind(
547
- StaticSchemaValidator
548
- );
551
+ var literal = StaticSchemaValidator.literal.bind(StaticSchemaValidator);
549
552
  var enum_ = StaticSchemaValidator.enum_.bind(StaticSchemaValidator);
550
- var function_ = StaticSchemaValidator.function_.bind(
551
- StaticSchemaValidator
552
- );
553
+ var function_ = StaticSchemaValidator.function_.bind(StaticSchemaValidator);
553
554
  var record = StaticSchemaValidator.record.bind(StaticSchemaValidator);
554
- var promise = StaticSchemaValidator.promise.bind(
555
- StaticSchemaValidator
556
- );
557
- var isSchema = StaticSchemaValidator.isSchema.bind(
558
- StaticSchemaValidator
559
- );
560
- var validate = StaticSchemaValidator.validate.bind(
561
- StaticSchemaValidator
562
- );
555
+ var promise = StaticSchemaValidator.promise.bind(StaticSchemaValidator);
556
+ var isSchema = StaticSchemaValidator.isSchema.bind(StaticSchemaValidator);
557
+ var validate = StaticSchemaValidator.validate.bind(StaticSchemaValidator);
563
558
  var parse = StaticSchemaValidator.parse.bind(StaticSchemaValidator);
564
- var openapi = StaticSchemaValidator.openapi.bind(
565
- StaticSchemaValidator
566
- );
559
+ var openapi = StaticSchemaValidator.openapi.bind(StaticSchemaValidator);
567
560
  // Annotate the CommonJS export names for ESM import in node:
568
561
  0 && (module.exports = {
569
562
  SchemaValidator,
@@ -152,12 +152,15 @@ var TypeboxSchemaValidator = class {
152
152
  symbol = Type.Symbol({
153
153
  title: "Symbol"
154
154
  });
155
- nullish = Type.Union([Type.Void(), Type.Null(), Type.Undefined()], {
156
- errorType: "nullish",
157
- type: "null",
158
- example: "null",
159
- title: "Nullish"
160
- });
155
+ nullish = Type.Union(
156
+ [Type.Void(), Type.Null(), Type.Undefined()],
157
+ {
158
+ errorType: "nullish",
159
+ type: "null",
160
+ example: "null",
161
+ title: "Nullish"
162
+ }
163
+ );
161
164
  void = Type.Void({
162
165
  type: "null",
163
166
  example: "void",
@@ -195,16 +198,22 @@ var TypeboxSchemaValidator = class {
195
198
  example: "a utf-8 encodable string",
196
199
  title: "Binary"
197
200
  })
198
- ).Decode(Buffer.from).Encode((value) => value.toString());
199
- file = (name, type) => Type.Transform(
201
+ ).Decode((value) => new TextEncoder().encode(value)).Encode((value) => {
202
+ if (value instanceof ArrayBuffer) {
203
+ return String.fromCharCode(...new Uint8Array(value));
204
+ }
205
+ return "";
206
+ });
207
+ file = Type.Transform(
200
208
  Type.String({
201
209
  errorType: "binary",
202
210
  format: "binary",
203
- contentMediaType: type,
204
211
  example: "a utf-8 encodable string",
205
212
  title: "File"
206
213
  })
207
- ).Decode((value) => new InMemoryFile(value, name, { type })).Encode((value) => value.content);
214
+ ).Decode(
215
+ (value) => (name, type) => new InMemoryFile(value, name, { type })
216
+ ).Encode((value) => value("name", "type").content);
208
217
  /**
209
218
  * Extracts the error type of a schema for error messages.
210
219
  *
@@ -487,35 +496,19 @@ var unknown = StaticSchemaValidator.unknown;
487
496
  var never = StaticSchemaValidator.never;
488
497
  var binary = StaticSchemaValidator.binary;
489
498
  var file = StaticSchemaValidator.file;
490
- var schemify = StaticSchemaValidator.schemify.bind(
491
- StaticSchemaValidator
492
- );
493
- var optional = StaticSchemaValidator.optional.bind(
494
- StaticSchemaValidator
495
- );
499
+ var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator);
500
+ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator);
496
501
  var array = StaticSchemaValidator.array.bind(StaticSchemaValidator);
497
502
  var union = StaticSchemaValidator.union.bind(StaticSchemaValidator);
498
- var literal = StaticSchemaValidator.literal.bind(
499
- StaticSchemaValidator
500
- );
503
+ var literal = StaticSchemaValidator.literal.bind(StaticSchemaValidator);
501
504
  var enum_ = StaticSchemaValidator.enum_.bind(StaticSchemaValidator);
502
- var function_ = StaticSchemaValidator.function_.bind(
503
- StaticSchemaValidator
504
- );
505
+ var function_ = StaticSchemaValidator.function_.bind(StaticSchemaValidator);
505
506
  var record = StaticSchemaValidator.record.bind(StaticSchemaValidator);
506
- var promise = StaticSchemaValidator.promise.bind(
507
- StaticSchemaValidator
508
- );
509
- var isSchema = StaticSchemaValidator.isSchema.bind(
510
- StaticSchemaValidator
511
- );
512
- var validate = StaticSchemaValidator.validate.bind(
513
- StaticSchemaValidator
514
- );
507
+ var promise = StaticSchemaValidator.promise.bind(StaticSchemaValidator);
508
+ var isSchema = StaticSchemaValidator.isSchema.bind(StaticSchemaValidator);
509
+ var validate = StaticSchemaValidator.validate.bind(StaticSchemaValidator);
515
510
  var parse = StaticSchemaValidator.parse.bind(StaticSchemaValidator);
516
- var openapi = StaticSchemaValidator.openapi.bind(
517
- StaticSchemaValidator
518
- );
511
+ var openapi = StaticSchemaValidator.openapi.bind(StaticSchemaValidator);
519
512
  export {
520
513
  SchemaValidator,
521
514
  any,
@@ -1,139 +1,140 @@
1
- import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
- import { Z as ZodSchemaValidator, p as ZodIdiomaticSchema, q as ZodResolve, r as ZodUnionContainer, s as UnionZodResolve, L as LiteralSchema, t as ZodTupleContainer, u as TupleZodResolve, v as ZodRecordKey, w as ZodCatchall, a as ParseResult, x as ZodSchemaTranslate } from '../../schema.types-MvSNOCj2.mjs';
3
- export { C as UnboxedZodObjectSchema, B as ZodObject, z as ZodObjectShape, y as ZodOuterArray } from '../../schema.types-MvSNOCj2.mjs';
4
- import * as _forklaunch_common from '@forklaunch/common';
5
- import * as zod from 'zod';
1
+ import { Z as ZodSchemaValidator } from '../../schema.types-Df9EB_Ke.mjs';
2
+ export { x as TupleZodResolve, u as UnboxedZodObjectSchema, z as UnionZodResolve, p as ZodCatchall, v as ZodIdiomaticSchema, s as ZodObject, r as ZodObjectShape, q as ZodOuterArray, C as ZodRecordKey, B as ZodResolve, t as ZodSchemaTranslate, w as ZodTupleContainer, y as ZodUnionContainer } from '../../schema.types-Df9EB_Ke.mjs';
3
+ import '@forklaunch/common';
4
+ import 'openapi3-ts/oas31';
6
5
  import '@sinclair/typebox';
7
6
  import '@sinclair/typebox/compiler';
7
+ import 'zod';
8
8
 
9
9
  /**
10
10
  * Factory function for creating a ZodSchemaValidator instance.
11
11
  * @returns {ZodSchemaValidator} The ZodSchemaValidator instance.
12
12
  */
13
13
  declare const SchemaValidator: () => ZodSchemaValidator;
14
+ declare const StaticSchemaValidator: ZodSchemaValidator;
14
15
  /**
15
16
  * Zod schema definition for string type.
16
17
  */
17
- declare const string: zod.ZodString;
18
+ declare const string: typeof StaticSchemaValidator.string;
18
19
  /**
19
20
  * Zod schema definition for UUID type.
20
21
  */
21
- declare const uuid: zod.ZodString;
22
+ declare const uuid: typeof StaticSchemaValidator.uuid;
22
23
  /**
23
24
  * Zod schema definition for email type.
24
25
  */
25
- declare const email: zod.ZodString;
26
+ declare const email: typeof StaticSchemaValidator.email;
26
27
  /**
27
28
  * Zod schema definition for URI type.
28
29
  */
29
- declare const uri: zod.ZodString;
30
+ declare const uri: typeof StaticSchemaValidator.uri;
30
31
  /**
31
32
  * Zod schema definition for number type.
32
33
  */
33
- declare const number: zod.ZodEffects<zod.ZodNumber, number, unknown>;
34
+ declare const number: typeof StaticSchemaValidator.number;
34
35
  /**
35
36
  * Zod schema definition for bigint type.
36
37
  */
37
- declare const bigint: zod.ZodEffects<zod.ZodBigInt, bigint, unknown>;
38
+ declare const bigint: typeof StaticSchemaValidator.bigint;
38
39
  /**
39
40
  * Zod schema definition for boolean type.
40
41
  */
41
- declare const boolean: zod.ZodEffects<zod.ZodBoolean, boolean, unknown>;
42
+ declare const boolean: typeof StaticSchemaValidator.boolean;
42
43
  /**
43
44
  * Zod schema definition for date type.
44
45
  */
45
- declare const date: zod.ZodEffects<zod.ZodDate, Date, unknown>;
46
+ declare const date: typeof StaticSchemaValidator.date;
46
47
  /**
47
48
  * Zod schema definition for symbol type.
48
49
  */
49
- declare const symbol: zod.ZodSymbol;
50
+ declare const symbol: typeof StaticSchemaValidator.symbol;
50
51
  /**
51
52
  * Zod schema definition for undefined, null, void types.
52
53
  */
53
- declare const nullish: zod.ZodUnion<[zod.ZodVoid, zod.ZodNull, zod.ZodUndefined]>;
54
+ declare const nullish: typeof StaticSchemaValidator.nullish;
54
55
  /**
55
56
  * Zod schema definition for void type.
56
57
  */
57
- declare const void_: zod.ZodVoid;
58
+ declare const void_: typeof StaticSchemaValidator.void;
58
59
  /**
59
60
  * Zod schema definition for null type.
60
61
  */
61
- declare const null_: zod.ZodNull;
62
+ declare const null_: typeof StaticSchemaValidator.null;
62
63
  /**
63
64
  * Zod schema definition for undefined type.
64
65
  */
65
- declare const undefined_: zod.ZodUndefined;
66
+ declare const undefined_: typeof StaticSchemaValidator.undefined;
66
67
  /**
67
68
  * Zod schema definition for any type.
68
69
  */
69
- declare const any: zod.ZodAny;
70
+ declare const any: typeof StaticSchemaValidator.any;
70
71
  /**
71
72
  * Zod schema definition for unknown type.
72
73
  */
73
- declare const unknown: zod.ZodUnknown;
74
+ declare const unknown: typeof StaticSchemaValidator.unknown;
74
75
  /**
75
76
  * Zod schema definition for never type.
76
77
  */
77
- declare const never: zod.ZodNever;
78
+ declare const never: typeof StaticSchemaValidator.never;
78
79
  /**
79
80
  * Zod schema definition for blob type.
80
81
  */
81
- declare const binary: zod.ZodEffects<zod.ZodString, Buffer<ArrayBuffer>, string>;
82
+ declare const binary: typeof StaticSchemaValidator.binary;
82
83
  /**
83
84
  * Zod schema definition for file type.
84
85
  */
85
- declare const file: (name: string, type: _forklaunch_common.MimeType) => zod.ZodEffects<zod.ZodString, File, string>;
86
+ declare const file: typeof StaticSchemaValidator.file;
86
87
  /**
87
88
  * Transforms valid schema into Zod schema.
88
89
  */
89
- declare const schemify: <T extends ZodIdiomaticSchema>(schema: T) => ZodResolve<T>;
90
+ declare const schemify: typeof StaticSchemaValidator.schemify;
90
91
  /**
91
92
  * Makes a valid schema optional.
92
93
  */
93
- declare const optional: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodOptional<ZodResolve<T>>;
94
+ declare const optional: typeof StaticSchemaValidator.optional;
94
95
  /**
95
96
  * Defines an array for a valid schema.
96
97
  */
97
- declare const array: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodArray<ZodResolve<T>>;
98
+ declare const array: typeof StaticSchemaValidator.array;
98
99
  /**
99
100
  * Defines a union for a valid schema.
100
101
  */
101
- declare const union: <T extends ZodUnionContainer>(schemas: T) => zod.ZodUnion<UnionZodResolve<T>>;
102
+ declare const union: typeof StaticSchemaValidator.union;
102
103
  /**
103
104
  * Defines a literal for a valid schema.
104
105
  */
105
- declare const literal: <T extends LiteralSchema>(value: T) => zod.ZodLiteral<T>;
106
+ declare const literal: typeof StaticSchemaValidator.literal;
106
107
  /**
107
108
  * Defines an enum for a valid schema.
108
109
  */
109
- declare const enum_: <T extends Record<string, LiteralSchema>>(schemaEnum: T) => zod.ZodUnion<[{ [K in keyof T]: zod.ZodLiteral<T[K]>; }[keyof T]]>;
110
+ declare const enum_: typeof StaticSchemaValidator.enum_;
110
111
  /**
111
112
  * Defines a function for a valid schema.
112
113
  */
113
- declare const function_: <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => zod.ZodFunction<zod.ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>;
114
+ declare const function_: typeof StaticSchemaValidator.function_;
114
115
  /**
115
116
  * Defines a record for a valid schema.
116
117
  */
117
- declare const record: <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => zod.ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>;
118
+ declare const record: typeof StaticSchemaValidator.record;
118
119
  /**
119
120
  * Defines a promise for a valid schema.
120
121
  */
121
- declare const promise: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodPromise<ZodResolve<T>>;
122
+ declare const promise: typeof StaticSchemaValidator.promise;
122
123
  /**
123
124
  * Checks if a value is a Zod schema.
124
125
  */
125
- declare const isSchema: (value: unknown) => value is zod.ZodSchema;
126
+ declare const isSchema: typeof StaticSchemaValidator.isSchema;
126
127
  /**
127
128
  * Validates a value against a valid schema.
128
129
  */
129
- declare const validate: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean;
130
+ declare const validate: typeof StaticSchemaValidator.validate;
130
131
  /**
131
132
  * Parses a value to be conformant to a particular schema.
132
133
  */
133
- declare const parse: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodSchemaTranslate<ZodResolve<T>>>;
134
+ declare const parse: typeof StaticSchemaValidator.parse;
134
135
  /**
135
136
  * Generates an OpenAPI schema object from a valid schema.
136
137
  */
137
- declare const openapi: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => openapi3_ts_oas31.SchemaObject;
138
+ declare const openapi: typeof StaticSchemaValidator.openapi;
138
139
 
139
- export { SchemaValidator, TupleZodResolve, UnionZodResolve, ZodCatchall, ZodIdiomaticSchema, ZodRecordKey, ZodResolve, ZodSchemaTranslate, ZodSchemaValidator, ZodTupleContainer, ZodUnionContainer, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ };
140
+ export { SchemaValidator, ZodSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ };
@@ -1,139 +1,140 @@
1
- import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
- import { Z as ZodSchemaValidator, p as ZodIdiomaticSchema, q as ZodResolve, r as ZodUnionContainer, s as UnionZodResolve, L as LiteralSchema, t as ZodTupleContainer, u as TupleZodResolve, v as ZodRecordKey, w as ZodCatchall, a as ParseResult, x as ZodSchemaTranslate } from '../../schema.types-MvSNOCj2.js';
3
- export { C as UnboxedZodObjectSchema, B as ZodObject, z as ZodObjectShape, y as ZodOuterArray } from '../../schema.types-MvSNOCj2.js';
4
- import * as _forklaunch_common from '@forklaunch/common';
5
- import * as zod from 'zod';
1
+ import { Z as ZodSchemaValidator } from '../../schema.types-Df9EB_Ke.js';
2
+ export { x as TupleZodResolve, u as UnboxedZodObjectSchema, z as UnionZodResolve, p as ZodCatchall, v as ZodIdiomaticSchema, s as ZodObject, r as ZodObjectShape, q as ZodOuterArray, C as ZodRecordKey, B as ZodResolve, t as ZodSchemaTranslate, w as ZodTupleContainer, y as ZodUnionContainer } from '../../schema.types-Df9EB_Ke.js';
3
+ import '@forklaunch/common';
4
+ import 'openapi3-ts/oas31';
6
5
  import '@sinclair/typebox';
7
6
  import '@sinclair/typebox/compiler';
7
+ import 'zod';
8
8
 
9
9
  /**
10
10
  * Factory function for creating a ZodSchemaValidator instance.
11
11
  * @returns {ZodSchemaValidator} The ZodSchemaValidator instance.
12
12
  */
13
13
  declare const SchemaValidator: () => ZodSchemaValidator;
14
+ declare const StaticSchemaValidator: ZodSchemaValidator;
14
15
  /**
15
16
  * Zod schema definition for string type.
16
17
  */
17
- declare const string: zod.ZodString;
18
+ declare const string: typeof StaticSchemaValidator.string;
18
19
  /**
19
20
  * Zod schema definition for UUID type.
20
21
  */
21
- declare const uuid: zod.ZodString;
22
+ declare const uuid: typeof StaticSchemaValidator.uuid;
22
23
  /**
23
24
  * Zod schema definition for email type.
24
25
  */
25
- declare const email: zod.ZodString;
26
+ declare const email: typeof StaticSchemaValidator.email;
26
27
  /**
27
28
  * Zod schema definition for URI type.
28
29
  */
29
- declare const uri: zod.ZodString;
30
+ declare const uri: typeof StaticSchemaValidator.uri;
30
31
  /**
31
32
  * Zod schema definition for number type.
32
33
  */
33
- declare const number: zod.ZodEffects<zod.ZodNumber, number, unknown>;
34
+ declare const number: typeof StaticSchemaValidator.number;
34
35
  /**
35
36
  * Zod schema definition for bigint type.
36
37
  */
37
- declare const bigint: zod.ZodEffects<zod.ZodBigInt, bigint, unknown>;
38
+ declare const bigint: typeof StaticSchemaValidator.bigint;
38
39
  /**
39
40
  * Zod schema definition for boolean type.
40
41
  */
41
- declare const boolean: zod.ZodEffects<zod.ZodBoolean, boolean, unknown>;
42
+ declare const boolean: typeof StaticSchemaValidator.boolean;
42
43
  /**
43
44
  * Zod schema definition for date type.
44
45
  */
45
- declare const date: zod.ZodEffects<zod.ZodDate, Date, unknown>;
46
+ declare const date: typeof StaticSchemaValidator.date;
46
47
  /**
47
48
  * Zod schema definition for symbol type.
48
49
  */
49
- declare const symbol: zod.ZodSymbol;
50
+ declare const symbol: typeof StaticSchemaValidator.symbol;
50
51
  /**
51
52
  * Zod schema definition for undefined, null, void types.
52
53
  */
53
- declare const nullish: zod.ZodUnion<[zod.ZodVoid, zod.ZodNull, zod.ZodUndefined]>;
54
+ declare const nullish: typeof StaticSchemaValidator.nullish;
54
55
  /**
55
56
  * Zod schema definition for void type.
56
57
  */
57
- declare const void_: zod.ZodVoid;
58
+ declare const void_: typeof StaticSchemaValidator.void;
58
59
  /**
59
60
  * Zod schema definition for null type.
60
61
  */
61
- declare const null_: zod.ZodNull;
62
+ declare const null_: typeof StaticSchemaValidator.null;
62
63
  /**
63
64
  * Zod schema definition for undefined type.
64
65
  */
65
- declare const undefined_: zod.ZodUndefined;
66
+ declare const undefined_: typeof StaticSchemaValidator.undefined;
66
67
  /**
67
68
  * Zod schema definition for any type.
68
69
  */
69
- declare const any: zod.ZodAny;
70
+ declare const any: typeof StaticSchemaValidator.any;
70
71
  /**
71
72
  * Zod schema definition for unknown type.
72
73
  */
73
- declare const unknown: zod.ZodUnknown;
74
+ declare const unknown: typeof StaticSchemaValidator.unknown;
74
75
  /**
75
76
  * Zod schema definition for never type.
76
77
  */
77
- declare const never: zod.ZodNever;
78
+ declare const never: typeof StaticSchemaValidator.never;
78
79
  /**
79
80
  * Zod schema definition for blob type.
80
81
  */
81
- declare const binary: zod.ZodEffects<zod.ZodString, Buffer<ArrayBuffer>, string>;
82
+ declare const binary: typeof StaticSchemaValidator.binary;
82
83
  /**
83
84
  * Zod schema definition for file type.
84
85
  */
85
- declare const file: (name: string, type: _forklaunch_common.MimeType) => zod.ZodEffects<zod.ZodString, File, string>;
86
+ declare const file: typeof StaticSchemaValidator.file;
86
87
  /**
87
88
  * Transforms valid schema into Zod schema.
88
89
  */
89
- declare const schemify: <T extends ZodIdiomaticSchema>(schema: T) => ZodResolve<T>;
90
+ declare const schemify: typeof StaticSchemaValidator.schemify;
90
91
  /**
91
92
  * Makes a valid schema optional.
92
93
  */
93
- declare const optional: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodOptional<ZodResolve<T>>;
94
+ declare const optional: typeof StaticSchemaValidator.optional;
94
95
  /**
95
96
  * Defines an array for a valid schema.
96
97
  */
97
- declare const array: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodArray<ZodResolve<T>>;
98
+ declare const array: typeof StaticSchemaValidator.array;
98
99
  /**
99
100
  * Defines a union for a valid schema.
100
101
  */
101
- declare const union: <T extends ZodUnionContainer>(schemas: T) => zod.ZodUnion<UnionZodResolve<T>>;
102
+ declare const union: typeof StaticSchemaValidator.union;
102
103
  /**
103
104
  * Defines a literal for a valid schema.
104
105
  */
105
- declare const literal: <T extends LiteralSchema>(value: T) => zod.ZodLiteral<T>;
106
+ declare const literal: typeof StaticSchemaValidator.literal;
106
107
  /**
107
108
  * Defines an enum for a valid schema.
108
109
  */
109
- declare const enum_: <T extends Record<string, LiteralSchema>>(schemaEnum: T) => zod.ZodUnion<[{ [K in keyof T]: zod.ZodLiteral<T[K]>; }[keyof T]]>;
110
+ declare const enum_: typeof StaticSchemaValidator.enum_;
110
111
  /**
111
112
  * Defines a function for a valid schema.
112
113
  */
113
- declare const function_: <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => zod.ZodFunction<zod.ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>;
114
+ declare const function_: typeof StaticSchemaValidator.function_;
114
115
  /**
115
116
  * Defines a record for a valid schema.
116
117
  */
117
- declare const record: <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => zod.ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>;
118
+ declare const record: typeof StaticSchemaValidator.record;
118
119
  /**
119
120
  * Defines a promise for a valid schema.
120
121
  */
121
- declare const promise: <T extends ZodIdiomaticSchema>(schema: T) => zod.ZodPromise<ZodResolve<T>>;
122
+ declare const promise: typeof StaticSchemaValidator.promise;
122
123
  /**
123
124
  * Checks if a value is a Zod schema.
124
125
  */
125
- declare const isSchema: (value: unknown) => value is zod.ZodSchema;
126
+ declare const isSchema: typeof StaticSchemaValidator.isSchema;
126
127
  /**
127
128
  * Validates a value against a valid schema.
128
129
  */
129
- declare const validate: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean;
130
+ declare const validate: typeof StaticSchemaValidator.validate;
130
131
  /**
131
132
  * Parses a value to be conformant to a particular schema.
132
133
  */
133
- declare const parse: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodSchemaTranslate<ZodResolve<T>>>;
134
+ declare const parse: typeof StaticSchemaValidator.parse;
134
135
  /**
135
136
  * Generates an OpenAPI schema object from a valid schema.
136
137
  */
137
- declare const openapi: <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => openapi3_ts_oas31.SchemaObject;
138
+ declare const openapi: typeof StaticSchemaValidator.openapi;
138
139
 
139
- export { SchemaValidator, TupleZodResolve, UnionZodResolve, ZodCatchall, ZodIdiomaticSchema, ZodRecordKey, ZodResolve, ZodSchemaTranslate, ZodSchemaValidator, ZodTupleContainer, ZodUnionContainer, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ };
140
+ export { SchemaValidator, ZodSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ };
@@ -186,14 +186,14 @@ var ZodSchemaValidator = class {
186
186
  type: "null",
187
187
  example: "never"
188
188
  });
189
- binary = import_zod.z.string().transform(Buffer.from).openapi({
189
+ binary = import_zod.z.string().transform((v) => new TextEncoder().encode(v)).openapi({
190
190
  title: "Binary",
191
191
  type: "string",
192
192
  format: "binary",
193
193
  example: "a utf-8 encodable string"
194
194
  });
195
- file = (name, type) => import_zod.z.string().transform((val) => {
196
- return new File([val], name, {
195
+ file = import_zod.z.string().transform((val) => {
196
+ return (name, type) => new File([val], name, {
197
197
  type,
198
198
  lastModified: Date.now()
199
199
  });
@@ -201,7 +201,6 @@ var ZodSchemaValidator = class {
201
201
  title: "File",
202
202
  type: "string",
203
203
  format: "binary",
204
- contentMediaType: type,
205
204
  example: "a utf-8 encodable string"
206
205
  });
207
206
  /**
@@ -406,35 +405,19 @@ var unknown = StaticSchemaValidator.unknown;
406
405
  var never = StaticSchemaValidator.never;
407
406
  var binary = StaticSchemaValidator.binary;
408
407
  var file = StaticSchemaValidator.file;
409
- var schemify = StaticSchemaValidator.schemify.bind(
410
- StaticSchemaValidator
411
- );
412
- var optional = StaticSchemaValidator.optional.bind(
413
- StaticSchemaValidator
414
- );
408
+ var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator);
409
+ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator);
415
410
  var array = StaticSchemaValidator.array.bind(StaticSchemaValidator);
416
411
  var union = StaticSchemaValidator.union.bind(StaticSchemaValidator);
417
- var literal = StaticSchemaValidator.literal.bind(
418
- StaticSchemaValidator
419
- );
412
+ var literal = StaticSchemaValidator.literal.bind(StaticSchemaValidator);
420
413
  var enum_ = StaticSchemaValidator.enum_.bind(StaticSchemaValidator);
421
- var function_ = StaticSchemaValidator.function_.bind(
422
- StaticSchemaValidator
423
- );
414
+ var function_ = StaticSchemaValidator.function_.bind(StaticSchemaValidator);
424
415
  var record = StaticSchemaValidator.record.bind(StaticSchemaValidator);
425
- var promise = StaticSchemaValidator.promise.bind(
426
- StaticSchemaValidator
427
- );
428
- var isSchema = StaticSchemaValidator.isSchema.bind(
429
- StaticSchemaValidator
430
- );
431
- var validate = StaticSchemaValidator.validate.bind(
432
- StaticSchemaValidator
433
- );
416
+ var promise = StaticSchemaValidator.promise.bind(StaticSchemaValidator);
417
+ var isSchema = StaticSchemaValidator.isSchema.bind(StaticSchemaValidator);
418
+ var validate = StaticSchemaValidator.validate.bind(StaticSchemaValidator);
434
419
  var parse = StaticSchemaValidator.parse.bind(StaticSchemaValidator);
435
- var openapi = StaticSchemaValidator.openapi.bind(
436
- StaticSchemaValidator
437
- );
420
+ var openapi = StaticSchemaValidator.openapi.bind(StaticSchemaValidator);
438
421
  // Annotate the CommonJS export names for ESM import in node:
439
422
  0 && (module.exports = {
440
423
  SchemaValidator,