@forklaunch/validator 0.5.4 → 0.6.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.
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-DyZIpu-x.mjs';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-MvSNOCj2.mjs';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
@@ -32,7 +32,7 @@ type SerializeStringArray<T extends string[]> = T extends [
32
32
  * A mock implementation of SchemaValidator for testing purposes.
33
33
  * This validator represents schemas as strings and provides simple string-based operations.
34
34
  */
35
- declare class MockSchemaValidator implements SchemaValidator<(<T extends string>(schema: T) => T), <T extends string>(schema: T) => T, <T extends string>(schema: T) => `optional ${T}`, <T extends string>(schema: T) => `array ${T}`, <T extends readonly string[]>(schemas: T) => RecursiveUnion<T>, <T extends LiteralSchema>(schema: T) => `literal ${T}`, <T extends LiteralSchema>(schemaEnum: Record<string, T>) => `enum ${T}`, <Args extends string[], ReturnType extends string>(args: Args, returnType: ReturnType) => `function(${SerializeStringArray<Args>}) => ${ReturnType}`, <Key extends string, Value extends string>(key: Key, value: Value) => `{${Key}: ${Value}}`, <T extends string>(schema: T) => `Promise<${T}>`, (value: unknown) => value is string, <T extends string>(schema: T, value: string) => boolean, <T extends string>(schema: T, value: string) => ParseResult<T>, <T extends string>(schema: T) => SchemaObject> {
35
+ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>(schema: T) => T), <T extends string>(schema: T) => T, <T extends string>(schema: T) => `optional ${T}`, <T extends string>(schema: T) => `array ${T}`, <T extends readonly string[]>(schemas: T) => RecursiveUnion<T>, <T extends LiteralSchema>(schema: T) => `literal ${T}`, <T extends LiteralSchema>(schemaEnum: Record<string, T>) => `enum ${T}`, <Args extends string[], ReturnType extends string>(args: Args, returnType: ReturnType) => `function(${SerializeStringArray<Args>}) => ${ReturnType}`, <Key extends string, Value extends string>(key: Key, value: Value) => `{${Key}: ${Value}}`, <T extends string>(schema: T) => `Promise<${T}>`, (value: unknown) => value is string, <T extends string>(value: unknown, type: T) => value is T, <T extends string>(schema: T, value: string) => boolean, <T extends string>(schema: T, value: string) => ParseResult<T>, <T extends string>(schema: T) => SchemaObject> {
36
36
  _Type: "Mock";
37
37
  _SchemaCatchall: string;
38
38
  _ValidSchemaObject: string;
@@ -49,6 +49,8 @@ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>
49
49
  any: string;
50
50
  unknown: string;
51
51
  never: string;
52
+ binary: string;
53
+ file: string;
52
54
  /**
53
55
  * Compiles a schema string.
54
56
  *
@@ -128,6 +130,14 @@ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>
128
130
  * @returns {boolean} True if the value is a string
129
131
  */
130
132
  isSchema(value: unknown): value is string;
133
+ /**
134
+ * Checks if a value is an instance of a schema string.
135
+ *
136
+ * @param {unknown} value - The value to check
137
+ * @param {string} type - The schema string to check against
138
+ * @returns {boolean} True if the value is an instance of the schema string
139
+ */
140
+ isInstanceOf<T extends string>(value: unknown, type: T): value is T;
131
141
  /**
132
142
  * Validates a value against a schema string.
133
143
  *
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-DyZIpu-x.js';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-MvSNOCj2.js';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
@@ -32,7 +32,7 @@ type SerializeStringArray<T extends string[]> = T extends [
32
32
  * A mock implementation of SchemaValidator for testing purposes.
33
33
  * This validator represents schemas as strings and provides simple string-based operations.
34
34
  */
35
- declare class MockSchemaValidator implements SchemaValidator<(<T extends string>(schema: T) => T), <T extends string>(schema: T) => T, <T extends string>(schema: T) => `optional ${T}`, <T extends string>(schema: T) => `array ${T}`, <T extends readonly string[]>(schemas: T) => RecursiveUnion<T>, <T extends LiteralSchema>(schema: T) => `literal ${T}`, <T extends LiteralSchema>(schemaEnum: Record<string, T>) => `enum ${T}`, <Args extends string[], ReturnType extends string>(args: Args, returnType: ReturnType) => `function(${SerializeStringArray<Args>}) => ${ReturnType}`, <Key extends string, Value extends string>(key: Key, value: Value) => `{${Key}: ${Value}}`, <T extends string>(schema: T) => `Promise<${T}>`, (value: unknown) => value is string, <T extends string>(schema: T, value: string) => boolean, <T extends string>(schema: T, value: string) => ParseResult<T>, <T extends string>(schema: T) => SchemaObject> {
35
+ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>(schema: T) => T), <T extends string>(schema: T) => T, <T extends string>(schema: T) => `optional ${T}`, <T extends string>(schema: T) => `array ${T}`, <T extends readonly string[]>(schemas: T) => RecursiveUnion<T>, <T extends LiteralSchema>(schema: T) => `literal ${T}`, <T extends LiteralSchema>(schemaEnum: Record<string, T>) => `enum ${T}`, <Args extends string[], ReturnType extends string>(args: Args, returnType: ReturnType) => `function(${SerializeStringArray<Args>}) => ${ReturnType}`, <Key extends string, Value extends string>(key: Key, value: Value) => `{${Key}: ${Value}}`, <T extends string>(schema: T) => `Promise<${T}>`, (value: unknown) => value is string, <T extends string>(value: unknown, type: T) => value is T, <T extends string>(schema: T, value: string) => boolean, <T extends string>(schema: T, value: string) => ParseResult<T>, <T extends string>(schema: T) => SchemaObject> {
36
36
  _Type: "Mock";
37
37
  _SchemaCatchall: string;
38
38
  _ValidSchemaObject: string;
@@ -49,6 +49,8 @@ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>
49
49
  any: string;
50
50
  unknown: string;
51
51
  never: string;
52
+ binary: string;
53
+ file: string;
52
54
  /**
53
55
  * Compiles a schema string.
54
56
  *
@@ -128,6 +130,14 @@ declare class MockSchemaValidator implements SchemaValidator<(<T extends string>
128
130
  * @returns {boolean} True if the value is a string
129
131
  */
130
132
  isSchema(value: unknown): value is string;
133
+ /**
134
+ * Checks if a value is an instance of a schema string.
135
+ *
136
+ * @param {unknown} value - The value to check
137
+ * @param {string} type - The schema string to check against
138
+ * @returns {boolean} True if the value is an instance of the schema string
139
+ */
140
+ isInstanceOf<T extends string>(value: unknown, type: T): value is T;
131
141
  /**
132
142
  * Validates a value against a schema string.
133
143
  *
@@ -45,6 +45,7 @@ __export(mockSchemaValidator_exports, {
45
45
  validate: () => validate
46
46
  });
47
47
  module.exports = __toCommonJS(mockSchemaValidator_exports);
48
+ var import_common = require("@forklaunch/common");
48
49
  var MockSchemaValidator = class {
49
50
  _Type = "Mock";
50
51
  _SchemaCatchall;
@@ -62,6 +63,8 @@ var MockSchemaValidator = class {
62
63
  any = "any";
63
64
  unknown = "unknown";
64
65
  never = "never";
66
+ binary = "binary";
67
+ file = "file";
65
68
  /**
66
69
  * Compiles a schema string.
67
70
  *
@@ -133,7 +136,9 @@ var MockSchemaValidator = class {
133
136
  * @returns {`function(${SerializeStringArray<Args>}) => ${ReturnType}`} The schema string prefixed with 'function'
134
137
  */
135
138
  function_(args, returnType) {
136
- return `function(${args.join(", ")}) => ${returnType}`;
139
+ return `function(${args.join(
140
+ ", "
141
+ )}) => ${returnType}`;
137
142
  }
138
143
  /**
139
144
  * Creates a record schema string.
@@ -163,6 +168,16 @@ var MockSchemaValidator = class {
163
168
  isSchema(value) {
164
169
  return typeof value === "string";
165
170
  }
171
+ /**
172
+ * Checks if a value is an instance of a schema string.
173
+ *
174
+ * @param {unknown} value - The value to check
175
+ * @param {string} type - The schema string to check against
176
+ * @returns {boolean} True if the value is an instance of the schema string
177
+ */
178
+ isInstanceOf(value, type) {
179
+ return typeof type === "string" && value === type;
180
+ }
166
181
  /**
167
182
  * Validates a value against a schema string.
168
183
  *
@@ -181,7 +196,7 @@ var MockSchemaValidator = class {
181
196
  * @returns {ParseResult<T>} Success if the schema and value strings match, error otherwise
182
197
  */
183
198
  parse(schema, value) {
184
- return JSON.stringify(schema) === JSON.stringify(value) ? {
199
+ return (0, import_common.safeStringify)(schema) === (0, import_common.safeStringify)(value) ? {
185
200
  ok: true,
186
201
  value: schema
187
202
  } : {
@@ -1,4 +1,5 @@
1
1
  // __test__/utils/mockSchemaValidator.ts
2
+ import { safeStringify } from "@forklaunch/common";
2
3
  var MockSchemaValidator = class {
3
4
  _Type = "Mock";
4
5
  _SchemaCatchall;
@@ -16,6 +17,8 @@ var MockSchemaValidator = class {
16
17
  any = "any";
17
18
  unknown = "unknown";
18
19
  never = "never";
20
+ binary = "binary";
21
+ file = "file";
19
22
  /**
20
23
  * Compiles a schema string.
21
24
  *
@@ -87,7 +90,9 @@ var MockSchemaValidator = class {
87
90
  * @returns {`function(${SerializeStringArray<Args>}) => ${ReturnType}`} The schema string prefixed with 'function'
88
91
  */
89
92
  function_(args, returnType) {
90
- return `function(${args.join(", ")}) => ${returnType}`;
93
+ return `function(${args.join(
94
+ ", "
95
+ )}) => ${returnType}`;
91
96
  }
92
97
  /**
93
98
  * Creates a record schema string.
@@ -117,6 +122,16 @@ var MockSchemaValidator = class {
117
122
  isSchema(value) {
118
123
  return typeof value === "string";
119
124
  }
125
+ /**
126
+ * Checks if a value is an instance of a schema string.
127
+ *
128
+ * @param {unknown} value - The value to check
129
+ * @param {string} type - The schema string to check against
130
+ * @returns {boolean} True if the value is an instance of the schema string
131
+ */
132
+ isInstanceOf(value, type) {
133
+ return typeof type === "string" && value === type;
134
+ }
120
135
  /**
121
136
  * Validates a value against a schema string.
122
137
  *
@@ -135,7 +150,7 @@ var MockSchemaValidator = class {
135
150
  * @returns {ParseResult<T>} Success if the schema and value strings match, error otherwise
136
151
  */
137
152
  parse(schema, value) {
138
- return JSON.stringify(schema) === JSON.stringify(value) ? {
153
+ return safeStringify(schema) === safeStringify(value) ? {
139
154
  ok: true,
140
155
  value: schema
141
156
  } : {
package/lib/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-DyZIpu-x.mjs';
2
- export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-DyZIpu-x.mjs';
1
+ import { P as ParseError } from './schema.types-MvSNOCj2.mjs';
2
+ export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-MvSNOCj2.mjs';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-DyZIpu-x.js';
2
- export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-DyZIpu-x.js';
1
+ import { P as ParseError } from './schema.types-MvSNOCj2.js';
2
+ export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-MvSNOCj2.js';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
@@ -1,9 +1,9 @@
1
- import { Prettify } from '@forklaunch/common';
1
+ import { MimeType, Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import * as _sinclair_typebox from '@sinclair/typebox';
4
4
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TUnknown, TKind, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
5
5
  import { TypeCheck } from '@sinclair/typebox/compiler';
6
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodNumber, ZodBigInt, ZodDate, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
6
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod';
7
7
 
8
8
  /**
9
9
  * Class representing a TypeBox schema definition.
@@ -13,18 +13,18 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
13
13
  {
14
14
  [K in keyof T]: TLiteral<T[K]>;
15
15
  }[keyof T]
16
- ]>, <Args extends TUnionTupleContainer, ReturnType extends TIdiomaticSchema>(args: [...Args], returnType: ReturnType) => TFunction<UnionTupleTResolve<Args>, TResolve<ReturnType>>, <Key extends TIdiomaticSchema, Value extends TIdiomaticSchema>(key: Key, value: Value) => TRecord<TResolve<Key>, TResolve<Value>>, <T extends TIdiomaticSchema>(schema: T) => TPromise<TResolve<T>>, (value: unknown) => value is TSchema, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => boolean, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => ParseResult<TResolve<T>>, <T extends TIdiomaticSchema | TCatchall>(schema: T) => SchemaObject> {
16
+ ]>, <Args extends TUnionTupleContainer, ReturnType extends TIdiomaticSchema>(args: [...Args], returnType: ReturnType) => TFunction<UnionTupleTResolve<Args>, TResolve<ReturnType>>, <Key extends TIdiomaticSchema, Value extends TIdiomaticSchema>(key: Key, value: Value) => TRecord<TResolve<Key>, TResolve<Value>>, <T extends TIdiomaticSchema>(schema: T) => TPromise<TResolve<T>>, (value: unknown) => value is TSchema, <T extends TCatchall>(value: object, type: T) => value is T, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => boolean, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => ParseResult<TSchemaTranslate<TResolve<T>>>, <T extends TIdiomaticSchema | TCatchall>(schema: T) => SchemaObject> {
17
17
  _Type: "TypeBox";
18
18
  _SchemaCatchall: TCatchall;
19
19
  _ValidSchemaObject: TObject<TProperties> | TArray<TObject<TProperties>>;
20
20
  string: _sinclair_typebox.TString;
21
21
  uuid: _sinclair_typebox.TString;
22
- uri: _sinclair_typebox.TString;
23
22
  email: _sinclair_typebox.TString;
24
- number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
23
+ uri: _sinclair_typebox.TString;
24
+ number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
25
25
  bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
26
26
  boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
27
- date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
27
+ date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TNumber, _sinclair_typebox.TDate]>, Date>;
28
28
  symbol: _sinclair_typebox.TSymbol;
29
29
  nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
30
30
  void: _sinclair_typebox.TVoid;
@@ -33,6 +33,8 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
33
33
  any: _sinclair_typebox.TAny;
34
34
  unknown: _sinclair_typebox.TUnknown;
35
35
  never: _sinclair_typebox.TNever;
36
+ binary: _sinclair_typebox.TTransform<_sinclair_typebox.TString, Buffer<ArrayBuffer>>;
37
+ file: (name: string, type: MimeType) => _sinclair_typebox.TTransform<_sinclair_typebox.TString, File>;
36
38
  /**
37
39
  * Extracts the error type of a schema for error messages.
38
40
  *
@@ -116,6 +118,13 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
116
118
  * @returns {boolean} True if the value is a TypeBox object schema.
117
119
  */
118
120
  isSchema(value: unknown): value is TSchema;
121
+ /**
122
+ * Check if a value is an instance of a TypeBox schema.
123
+ * @param {object} value - The value to check.
124
+ * @param {TCatchall} type - The schema to check against.
125
+ * @returns {boolean} True if the value is an instance of the schema.
126
+ */
127
+ isInstanceOf<T extends TCatchall>(value: unknown, type: T): value is T;
119
128
  /**
120
129
  * Validate a value against a schema.
121
130
  *
@@ -131,7 +140,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
131
140
  * @param {unknown} value - The value to validate.
132
141
  * @returns {ParseResult<TResolve<T>>} The parsing result.
133
142
  */
134
- parse<T extends TIdiomaticSchema | TCatchall>(schema: T | TypeCheck<TResolve<T>>, value: unknown): ParseResult<TResolve<T>>;
143
+ parse<T extends TIdiomaticSchema | TCatchall>(schema: T | TypeCheck<TResolve<T>>, value: unknown): ParseResult<TSchemaTranslate<TResolve<T>>>;
135
144
  /**
136
145
  * Convert a schema to an OpenAPI schema object.
137
146
  * @param {TIdiomaticSchema | TCatchall} schema - The schema to convert.
@@ -214,7 +223,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
214
223
  {
215
224
  [K in keyof T]: ZodLiteral<T[K]>;
216
225
  }[keyof T]
217
- ]>, <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => ZodFunction<ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>, <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>, <T extends ZodIdiomaticSchema>(schema: T) => ZodPromise<ZodResolve<T>>, (value: unknown) => value is ZodType, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodResolve<T>>, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => SchemaObject> {
226
+ ]>, <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => ZodFunction<ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>, <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>, <T extends ZodIdiomaticSchema>(schema: T) => ZodPromise<ZodResolve<T>>, (value: unknown) => value is ZodType, <T extends ZodType>(value: object, type: T) => value is T, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodSchemaTranslate<ZodResolve<T>>>, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => SchemaObject> {
218
227
  _Type: "Zod";
219
228
  _SchemaCatchall: ZodType;
220
229
  _ValidSchemaObject: ZodObject$1<ZodRawShape> | ZodArray<ZodObject$1<ZodRawShape>>;
@@ -222,10 +231,10 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
222
231
  uuid: z.ZodString;
223
232
  email: z.ZodString;
224
233
  uri: z.ZodString;
225
- number: ZodNumber;
226
- bigint: ZodBigInt;
234
+ number: z.ZodEffects<z.ZodNumber, number, unknown>;
235
+ bigint: z.ZodEffects<z.ZodBigInt, bigint, unknown>;
227
236
  boolean: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
228
- date: ZodDate;
237
+ date: z.ZodEffects<z.ZodDate, Date, unknown>;
229
238
  symbol: z.ZodSymbol;
230
239
  nullish: z.ZodUnion<[z.ZodVoid, z.ZodNull, z.ZodUndefined]>;
231
240
  void: z.ZodVoid;
@@ -234,6 +243,8 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
234
243
  any: z.ZodAny;
235
244
  unknown: z.ZodUnknown;
236
245
  never: z.ZodNever;
246
+ binary: z.ZodEffects<z.ZodString, Buffer<ArrayBuffer>, string>;
247
+ file: (name: string, type: MimeType) => z.ZodEffects<z.ZodString, File, string>;
237
248
  /**
238
249
  * Compiles schema if this exists, for optimal performance.
239
250
  *
@@ -307,6 +318,13 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
307
318
  * @returns {boolean} True if the value is a Zod schema.
308
319
  */
309
320
  isSchema(value: unknown): value is ZodType;
321
+ /**
322
+ * Checks if a value is an instance of a Zod schema.
323
+ * @param {object} value - The value to check.
324
+ * @param {ZodType} type - The schema to check against.
325
+ * @returns {boolean} True if the value is an instance of the schema.
326
+ */
327
+ isInstanceOf<T extends ZodType>(value: unknown, type: T): value is T;
310
328
  /**
311
329
  * Validate a value against a schema.
312
330
  * @param {ZodCatchall} schema - The schema to validate against.
@@ -321,7 +339,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
321
339
  * @param {unknown} value - The value to validate.
322
340
  * @returns {ParseResult} - The discrimintated parsed value if successful, the error if unsuccessful.
323
341
  */
324
- parse<T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown): ParseResult<ZodResolve<T>>;
342
+ parse<T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown): ParseResult<ZodSchemaTranslate<ZodResolve<T>>>;
325
343
  /**
326
344
  * Convert a schema to an OpenAPI schema object.
327
345
  * @param {ZodIdiomaticSchema} schema - The schema to convert.
@@ -412,7 +430,7 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
412
430
  * @template T - The Zod schema type to resolve.
413
431
  * @template Depth - The current depth of the resolution.
414
432
  */
415
- type ZodResolve<T, Depth extends number = 0> = Depth extends 29 ? ZodUnknown : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
433
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 29 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
416
434
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
417
435
  }> extends infer R ? R : ZodNever : ZodNever;
418
436
  /**
@@ -452,7 +470,7 @@ type ParseResult<T> = {
452
470
  * @template ParseFunction - The function type for parsing a value against a schema.
453
471
  * @template OpenAPIFunction - The function type for converting a schema into an OpenAPI schema object.
454
472
  */
455
- interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, SchematicFunction = <T>(schema: T) => unknown, OptionalFunction = <T>(schema: T) => unknown, ArrayFunction = <T>(schema: T) => unknown, UnionFunction = <T>(schemas: T[]) => unknown, LiteralFunction = <T extends LiteralSchema>(schema: T) => unknown, EnumFunction = <T extends LiteralSchema>(schemaEnum: Record<string, T>) => unknown, FunctionFunction = <Args, ReturnType>(args: Args, returnType: ReturnType) => unknown, RecordFunction = <Key, Value>(key: Key, value: Value) => unknown, PromiseFunction = <T>(schema: T) => unknown, SchemaGuardFunction = <T>(value: unknown) => value is T, ValidationFunction = <T>(schema: T, value: unknown) => boolean, ParseFunction = <T>(schema: T, value: unknown) => ParseResult<SchemaResolve<T>>, OpenAPIFunction = <T>(schema: T) => SchemaObject> {
473
+ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, SchematicFunction = <T>(schema: T) => unknown, OptionalFunction = <T>(schema: T) => unknown, ArrayFunction = <T>(schema: T) => unknown, UnionFunction = <T>(schemas: T[]) => unknown, LiteralFunction = <T extends LiteralSchema>(schema: T) => unknown, EnumFunction = <T extends LiteralSchema>(schemaEnum: Record<string, T>) => unknown, FunctionFunction = <Args, ReturnType>(args: Args, returnType: ReturnType) => unknown, RecordFunction = <Key, Value>(key: Key, value: Value) => unknown, PromiseFunction = <T>(schema: T) => unknown, SchemaGuardFunction = <T>(value: unknown) => value is T, InstanceOfFunction = <T>(value: unknown, type: T) => value is T, ValidationFunction = <T>(schema: T, value: unknown) => boolean, ParseFunction = <T>(schema: T, value: unknown) => ParseResult<SchemaResolve<T>>, OpenAPIFunction = <T>(schema: T) => SchemaObject> {
456
474
  /**
457
475
  * The type of the schema validator.
458
476
  */
@@ -517,6 +535,14 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
517
535
  * Validator for never type.
518
536
  */
519
537
  never: unknown;
538
+ /**
539
+ * Validator for binary type
540
+ */
541
+ binary: unknown;
542
+ /**
543
+ * Validator for file type
544
+ */
545
+ file: unknown;
520
546
  /**
521
547
  * Compiles schema if this exists, for optimal performance.
522
548
  *
@@ -596,6 +622,14 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
596
622
  * @returns {boolean} - Whether the value is a schema.
597
623
  */
598
624
  isSchema: SchemaGuardFunction;
625
+ /**
626
+ * Checks if a value is an instance of a schema.
627
+ *
628
+ * @param {object} value - The value to check.
629
+ * @param {TCatchall} type - The schema to check against.
630
+ * @returns {boolean} - Whether the value is an instance of the schema.
631
+ */
632
+ isInstanceOf: InstanceOfFunction;
599
633
  /**
600
634
  * Validates a value against a schema.
601
635
  *
@@ -623,7 +657,7 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
623
657
  /**
624
658
  * Type representing any schema validator.
625
659
  */
626
- type AnySchemaValidator = SchemaValidator<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> & {
660
+ type AnySchemaValidator = SchemaValidator<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> & {
627
661
  /**
628
662
  * The type of the schema resolver.
629
663
  */
@@ -702,4 +736,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
702
736
  */
703
737
  type KeyTypes = string | number;
704
738
 
705
- export { type AnySchemaValidator as A, type ZodSchemaTranslate as B, type UnboxedZodObjectSchema as C, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, TypeboxSchemaValidator as T, type UnboxedObjectSchema as U, ZodSchemaValidator as Z, type ParseResult as a, type SchemaResolve as b, type SchemaTranslate as c, type Schema as d, type Increment as e, type TIdiomaticSchema as f, type TResolve as g, type TUnionTupleContainer as h, type UnionTupleTResolve as i, type TCatchall as j, type TOuterArray as k, type TObjectShape as l, type TObject as m, type TSchemaTranslate as n, type UnboxedTObjectSchema as o, type ZodIdiomaticSchema as p, type ZodResolve as q, type ZodUnionContainer as r, type UnionZodResolve as s, type ZodTupleContainer as t, type TupleZodResolve as u, type ZodRecordKey as v, type ZodCatchall as w, type ZodOuterArray as x, type ZodObjectShape as y, type ZodObject as z };
739
+ export { type AnySchemaValidator as A, type ZodObject as B, type UnboxedZodObjectSchema as C, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, TypeboxSchemaValidator as T, type UnboxedObjectSchema as U, ZodSchemaValidator as Z, type ParseResult as a, type SchemaResolve as b, type SchemaTranslate as c, type Schema as d, type Increment as e, type TIdiomaticSchema as f, type TResolve as g, type TUnionTupleContainer as h, type UnionTupleTResolve as i, type TCatchall as j, type TSchemaTranslate as k, type TOuterArray as l, type TObjectShape as m, type TObject as n, type UnboxedTObjectSchema as o, type ZodIdiomaticSchema as p, type ZodResolve as q, type ZodUnionContainer as r, type UnionZodResolve as s, type ZodTupleContainer as t, type TupleZodResolve as u, type ZodRecordKey as v, type ZodCatchall as w, type ZodSchemaTranslate as x, type ZodOuterArray as y, type ZodObjectShape as z };
@@ -1,9 +1,9 @@
1
- import { Prettify } from '@forklaunch/common';
1
+ import { MimeType, Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import * as _sinclair_typebox from '@sinclair/typebox';
4
4
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TUnknown, TKind, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
5
5
  import { TypeCheck } from '@sinclair/typebox/compiler';
6
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodNumber, ZodBigInt, ZodDate, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
6
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod';
7
7
 
8
8
  /**
9
9
  * Class representing a TypeBox schema definition.
@@ -13,18 +13,18 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
13
13
  {
14
14
  [K in keyof T]: TLiteral<T[K]>;
15
15
  }[keyof T]
16
- ]>, <Args extends TUnionTupleContainer, ReturnType extends TIdiomaticSchema>(args: [...Args], returnType: ReturnType) => TFunction<UnionTupleTResolve<Args>, TResolve<ReturnType>>, <Key extends TIdiomaticSchema, Value extends TIdiomaticSchema>(key: Key, value: Value) => TRecord<TResolve<Key>, TResolve<Value>>, <T extends TIdiomaticSchema>(schema: T) => TPromise<TResolve<T>>, (value: unknown) => value is TSchema, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => boolean, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => ParseResult<TResolve<T>>, <T extends TIdiomaticSchema | TCatchall>(schema: T) => SchemaObject> {
16
+ ]>, <Args extends TUnionTupleContainer, ReturnType extends TIdiomaticSchema>(args: [...Args], returnType: ReturnType) => TFunction<UnionTupleTResolve<Args>, TResolve<ReturnType>>, <Key extends TIdiomaticSchema, Value extends TIdiomaticSchema>(key: Key, value: Value) => TRecord<TResolve<Key>, TResolve<Value>>, <T extends TIdiomaticSchema>(schema: T) => TPromise<TResolve<T>>, (value: unknown) => value is TSchema, <T extends TCatchall>(value: object, type: T) => value is T, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => boolean, <T extends TIdiomaticSchema | TCatchall>(schema: T, value: unknown) => ParseResult<TSchemaTranslate<TResolve<T>>>, <T extends TIdiomaticSchema | TCatchall>(schema: T) => SchemaObject> {
17
17
  _Type: "TypeBox";
18
18
  _SchemaCatchall: TCatchall;
19
19
  _ValidSchemaObject: TObject<TProperties> | TArray<TObject<TProperties>>;
20
20
  string: _sinclair_typebox.TString;
21
21
  uuid: _sinclair_typebox.TString;
22
- uri: _sinclair_typebox.TString;
23
22
  email: _sinclair_typebox.TString;
24
- number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
23
+ uri: _sinclair_typebox.TString;
24
+ number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TBigInt, _sinclair_typebox.TDate]>, number>;
25
25
  bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
26
26
  boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
27
- date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
27
+ date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TNumber, _sinclair_typebox.TDate]>, Date>;
28
28
  symbol: _sinclair_typebox.TSymbol;
29
29
  nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
30
30
  void: _sinclair_typebox.TVoid;
@@ -33,6 +33,8 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
33
33
  any: _sinclair_typebox.TAny;
34
34
  unknown: _sinclair_typebox.TUnknown;
35
35
  never: _sinclair_typebox.TNever;
36
+ binary: _sinclair_typebox.TTransform<_sinclair_typebox.TString, Buffer<ArrayBuffer>>;
37
+ file: (name: string, type: MimeType) => _sinclair_typebox.TTransform<_sinclair_typebox.TString, File>;
36
38
  /**
37
39
  * Extracts the error type of a schema for error messages.
38
40
  *
@@ -116,6 +118,13 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
116
118
  * @returns {boolean} True if the value is a TypeBox object schema.
117
119
  */
118
120
  isSchema(value: unknown): value is TSchema;
121
+ /**
122
+ * Check if a value is an instance of a TypeBox schema.
123
+ * @param {object} value - The value to check.
124
+ * @param {TCatchall} type - The schema to check against.
125
+ * @returns {boolean} True if the value is an instance of the schema.
126
+ */
127
+ isInstanceOf<T extends TCatchall>(value: unknown, type: T): value is T;
119
128
  /**
120
129
  * Validate a value against a schema.
121
130
  *
@@ -131,7 +140,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator<(<T extends TObj
131
140
  * @param {unknown} value - The value to validate.
132
141
  * @returns {ParseResult<TResolve<T>>} The parsing result.
133
142
  */
134
- parse<T extends TIdiomaticSchema | TCatchall>(schema: T | TypeCheck<TResolve<T>>, value: unknown): ParseResult<TResolve<T>>;
143
+ parse<T extends TIdiomaticSchema | TCatchall>(schema: T | TypeCheck<TResolve<T>>, value: unknown): ParseResult<TSchemaTranslate<TResolve<T>>>;
135
144
  /**
136
145
  * Convert a schema to an OpenAPI schema object.
137
146
  * @param {TIdiomaticSchema | TCatchall} schema - The schema to convert.
@@ -214,7 +223,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
214
223
  {
215
224
  [K in keyof T]: ZodLiteral<T[K]>;
216
225
  }[keyof T]
217
- ]>, <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => ZodFunction<ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>, <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>, <T extends ZodIdiomaticSchema>(schema: T) => ZodPromise<ZodResolve<T>>, (value: unknown) => value is ZodType, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodResolve<T>>, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => SchemaObject> {
226
+ ]>, <Args extends ZodTupleContainer, ReturnType extends ZodIdiomaticSchema>(args: Args, returnType: ReturnType) => ZodFunction<ZodTuple<TupleZodResolve<Args>, null>, ZodResolve<ReturnType>>, <Key extends ZodIdiomaticSchema, Value extends ZodIdiomaticSchema>(key: Key, value: Value) => ZodRecord<ZodRecordKey<Key>, ZodResolve<Value>>, <T extends ZodIdiomaticSchema>(schema: T) => ZodPromise<ZodResolve<T>>, (value: unknown) => value is ZodType, <T extends ZodType>(value: object, type: T) => value is T, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => boolean, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown) => ParseResult<ZodSchemaTranslate<ZodResolve<T>>>, <T extends ZodIdiomaticSchema | ZodCatchall>(schema: T) => SchemaObject> {
218
227
  _Type: "Zod";
219
228
  _SchemaCatchall: ZodType;
220
229
  _ValidSchemaObject: ZodObject$1<ZodRawShape> | ZodArray<ZodObject$1<ZodRawShape>>;
@@ -222,10 +231,10 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
222
231
  uuid: z.ZodString;
223
232
  email: z.ZodString;
224
233
  uri: z.ZodString;
225
- number: ZodNumber;
226
- bigint: ZodBigInt;
234
+ number: z.ZodEffects<z.ZodNumber, number, unknown>;
235
+ bigint: z.ZodEffects<z.ZodBigInt, bigint, unknown>;
227
236
  boolean: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
228
- date: ZodDate;
237
+ date: z.ZodEffects<z.ZodDate, Date, unknown>;
229
238
  symbol: z.ZodSymbol;
230
239
  nullish: z.ZodUnion<[z.ZodVoid, z.ZodNull, z.ZodUndefined]>;
231
240
  void: z.ZodVoid;
@@ -234,6 +243,8 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
234
243
  any: z.ZodAny;
235
244
  unknown: z.ZodUnknown;
236
245
  never: z.ZodNever;
246
+ binary: z.ZodEffects<z.ZodString, Buffer<ArrayBuffer>, string>;
247
+ file: (name: string, type: MimeType) => z.ZodEffects<z.ZodString, File, string>;
237
248
  /**
238
249
  * Compiles schema if this exists, for optimal performance.
239
250
  *
@@ -307,6 +318,13 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
307
318
  * @returns {boolean} True if the value is a Zod schema.
308
319
  */
309
320
  isSchema(value: unknown): value is ZodType;
321
+ /**
322
+ * Checks if a value is an instance of a Zod schema.
323
+ * @param {object} value - The value to check.
324
+ * @param {ZodType} type - The schema to check against.
325
+ * @returns {boolean} True if the value is an instance of the schema.
326
+ */
327
+ isInstanceOf<T extends ZodType>(value: unknown, type: T): value is T;
310
328
  /**
311
329
  * Validate a value against a schema.
312
330
  * @param {ZodCatchall} schema - The schema to validate against.
@@ -321,7 +339,7 @@ declare class ZodSchemaValidator implements SchemaValidator<(<T extends ZodObjec
321
339
  * @param {unknown} value - The value to validate.
322
340
  * @returns {ParseResult} - The discrimintated parsed value if successful, the error if unsuccessful.
323
341
  */
324
- parse<T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown): ParseResult<ZodResolve<T>>;
342
+ parse<T extends ZodIdiomaticSchema | ZodCatchall>(schema: T, value: unknown): ParseResult<ZodSchemaTranslate<ZodResolve<T>>>;
325
343
  /**
326
344
  * Convert a schema to an OpenAPI schema object.
327
345
  * @param {ZodIdiomaticSchema} schema - The schema to convert.
@@ -412,7 +430,7 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
412
430
  * @template T - The Zod schema type to resolve.
413
431
  * @template Depth - The current depth of the resolution.
414
432
  */
415
- type ZodResolve<T, Depth extends number = 0> = Depth extends 29 ? ZodUnknown : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
433
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 29 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
416
434
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
417
435
  }> extends infer R ? R : ZodNever : ZodNever;
418
436
  /**
@@ -452,7 +470,7 @@ type ParseResult<T> = {
452
470
  * @template ParseFunction - The function type for parsing a value against a schema.
453
471
  * @template OpenAPIFunction - The function type for converting a schema into an OpenAPI schema object.
454
472
  */
455
- interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, SchematicFunction = <T>(schema: T) => unknown, OptionalFunction = <T>(schema: T) => unknown, ArrayFunction = <T>(schema: T) => unknown, UnionFunction = <T>(schemas: T[]) => unknown, LiteralFunction = <T extends LiteralSchema>(schema: T) => unknown, EnumFunction = <T extends LiteralSchema>(schemaEnum: Record<string, T>) => unknown, FunctionFunction = <Args, ReturnType>(args: Args, returnType: ReturnType) => unknown, RecordFunction = <Key, Value>(key: Key, value: Value) => unknown, PromiseFunction = <T>(schema: T) => unknown, SchemaGuardFunction = <T>(value: unknown) => value is T, ValidationFunction = <T>(schema: T, value: unknown) => boolean, ParseFunction = <T>(schema: T, value: unknown) => ParseResult<SchemaResolve<T>>, OpenAPIFunction = <T>(schema: T) => SchemaObject> {
473
+ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, SchematicFunction = <T>(schema: T) => unknown, OptionalFunction = <T>(schema: T) => unknown, ArrayFunction = <T>(schema: T) => unknown, UnionFunction = <T>(schemas: T[]) => unknown, LiteralFunction = <T extends LiteralSchema>(schema: T) => unknown, EnumFunction = <T extends LiteralSchema>(schemaEnum: Record<string, T>) => unknown, FunctionFunction = <Args, ReturnType>(args: Args, returnType: ReturnType) => unknown, RecordFunction = <Key, Value>(key: Key, value: Value) => unknown, PromiseFunction = <T>(schema: T) => unknown, SchemaGuardFunction = <T>(value: unknown) => value is T, InstanceOfFunction = <T>(value: unknown, type: T) => value is T, ValidationFunction = <T>(schema: T, value: unknown) => boolean, ParseFunction = <T>(schema: T, value: unknown) => ParseResult<SchemaResolve<T>>, OpenAPIFunction = <T>(schema: T) => SchemaObject> {
456
474
  /**
457
475
  * The type of the schema validator.
458
476
  */
@@ -517,6 +535,14 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
517
535
  * Validator for never type.
518
536
  */
519
537
  never: unknown;
538
+ /**
539
+ * Validator for binary type
540
+ */
541
+ binary: unknown;
542
+ /**
543
+ * Validator for file type
544
+ */
545
+ file: unknown;
520
546
  /**
521
547
  * Compiles schema if this exists, for optimal performance.
522
548
  *
@@ -596,6 +622,14 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
596
622
  * @returns {boolean} - Whether the value is a schema.
597
623
  */
598
624
  isSchema: SchemaGuardFunction;
625
+ /**
626
+ * Checks if a value is an instance of a schema.
627
+ *
628
+ * @param {object} value - The value to check.
629
+ * @param {TCatchall} type - The schema to check against.
630
+ * @returns {boolean} - Whether the value is an instance of the schema.
631
+ */
632
+ isInstanceOf: InstanceOfFunction;
599
633
  /**
600
634
  * Validates a value against a schema.
601
635
  *
@@ -623,7 +657,7 @@ interface SchemaValidator<CompilationFunction = <T>(schema: T) => unknown, Schem
623
657
  /**
624
658
  * Type representing any schema validator.
625
659
  */
626
- type AnySchemaValidator = SchemaValidator<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> & {
660
+ type AnySchemaValidator = SchemaValidator<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown> & {
627
661
  /**
628
662
  * The type of the schema resolver.
629
663
  */
@@ -702,4 +736,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
702
736
  */
703
737
  type KeyTypes = string | number;
704
738
 
705
- export { type AnySchemaValidator as A, type ZodSchemaTranslate as B, type UnboxedZodObjectSchema as C, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, TypeboxSchemaValidator as T, type UnboxedObjectSchema as U, ZodSchemaValidator as Z, type ParseResult as a, type SchemaResolve as b, type SchemaTranslate as c, type Schema as d, type Increment as e, type TIdiomaticSchema as f, type TResolve as g, type TUnionTupleContainer as h, type UnionTupleTResolve as i, type TCatchall as j, type TOuterArray as k, type TObjectShape as l, type TObject as m, type TSchemaTranslate as n, type UnboxedTObjectSchema as o, type ZodIdiomaticSchema as p, type ZodResolve as q, type ZodUnionContainer as r, type UnionZodResolve as s, type ZodTupleContainer as t, type TupleZodResolve as u, type ZodRecordKey as v, type ZodCatchall as w, type ZodOuterArray as x, type ZodObjectShape as y, type ZodObject as z };
739
+ export { type AnySchemaValidator as A, type ZodObject as B, type UnboxedZodObjectSchema as C, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, TypeboxSchemaValidator as T, type UnboxedObjectSchema as U, ZodSchemaValidator as Z, type ParseResult as a, type SchemaResolve as b, type SchemaTranslate as c, type Schema as d, type Increment as e, type TIdiomaticSchema as f, type TResolve as g, type TUnionTupleContainer as h, type UnionTupleTResolve as i, type TCatchall as j, type TSchemaTranslate as k, type TOuterArray as l, type TObjectShape as m, type TObject as n, type UnboxedTObjectSchema as o, type ZodIdiomaticSchema as p, type ZodResolve as q, type ZodUnionContainer as r, type UnionZodResolve as s, type ZodTupleContainer as t, type TupleZodResolve as u, type ZodRecordKey as v, type ZodCatchall as w, type ZodSchemaTranslate as x, type ZodOuterArray as y, type ZodObjectShape as z };