@forklaunch/validator 0.7.5 → 0.7.6

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,10 +1,9 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-bwuhfE1y.mjs';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-xFskiFwY.mjs';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
6
6
  import 'zod';
7
- import 'zod/v3';
8
7
 
9
8
  /**
10
9
  * Creates a union type string from an array of string literals.
@@ -1,10 +1,9 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-bwuhfE1y.js';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-xFskiFwY.js';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
6
6
  import 'zod';
7
- import 'zod/v3';
8
7
 
9
8
  /**
10
9
  * Creates a union type string from an array of string literals.
package/lib/index.d.mts CHANGED
@@ -1,11 +1,10 @@
1
- import { P as ParseError } from './schema.types-bwuhfE1y.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-bwuhfE1y.mjs';
1
+ import { P as ParseError } from './schema.types-xFskiFwY.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-xFskiFwY.mjs';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
6
6
  import '@sinclair/typebox/compiler';
7
7
  import 'zod';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Pretty print parsing errors.
package/lib/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { P as ParseError } from './schema.types-bwuhfE1y.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-bwuhfE1y.js';
1
+ import { P as ParseError } from './schema.types-xFskiFwY.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-xFskiFwY.js';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
6
6
  import '@sinclair/typebox/compiler';
7
7
  import 'zod';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Pretty print parsing errors.
@@ -2,8 +2,7 @@ import { Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TTransform, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TAny, TUnknown, TNever, TKind, TObject, StaticDecode } from '@sinclair/typebox';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodLiteral as ZodLiteral$1, ZodType as ZodType$1, ZodNever, z as z$1, ZodRawShape as ZodRawShape$1, ZodObject as ZodObject$2, ZodArray as ZodArray$1 } from 'zod';
6
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z } from 'zod/v3';
5
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod';
7
6
 
8
7
  /**
9
8
  * This module provides a TypeScript-based schema definition using the TypeBox library.
@@ -366,23 +365,23 @@ type ZodCatchall = ZodTypeAny;
366
365
  *
367
366
  * @template T - The type to check and possibly convert to an array schema.
368
367
  */
369
- type ZodOuterArray<T> = T extends ZodObject<ZodObjectShape> ? ZodArray$1<T> : ZodNever;
368
+ type ZodOuterArray<T> = T extends ZodObject<ZodObjectShape> ? ZodArray<T> : ZodNever;
370
369
  /**
371
370
  * Represents the shape of a Zod object schema.
372
371
  */
373
- type ZodObjectShape = ZodRawShape$1;
372
+ type ZodObjectShape = ZodRawShape;
374
373
  /**
375
374
  * Represents a Zod object schema type. If the type T is a Zod object shape, it will return the original ZodObject type of T. Otherwise, it returns ZodNever.
376
375
  *
377
376
  * @template T - The type to check and possibly convert to a Zod object schema.
378
377
  */
379
- type ZodObject<T> = T extends ZodObjectShape ? ZodObject$2<T> : ZodNever;
378
+ type ZodObject<T> = T extends ZodObjectShape ? ZodObject$1<T> : ZodNever;
380
379
  /**
381
380
  * Translates a Zod schema type T to its static type if T extends ZodCatchall. Otherwise, it returns ZodNever.
382
381
  *
383
382
  * @template T - The Zod schema type to translate.
384
383
  */
385
- type ZodSchemaTranslate<T> = T extends ZodCatchall ? z$1.infer<T> : ZodNever;
384
+ type ZodSchemaTranslate<T> = T extends ZodCatchall ? z.infer<T> : ZodNever;
386
385
  /**
387
386
  * Represents an unboxed Zod object schema where each key can have an idiomatic schema.
388
387
  */
@@ -439,7 +438,7 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
439
438
  * @template T - The Zod schema type to resolve.
440
439
  * @template Depth - The current depth of the resolution.
441
440
  */
442
- type ZodResolve<T, Depth extends number = 0> = Depth extends 28 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral$1<T> : T extends ZodType$1 ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
441
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 28 ? 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<{
443
442
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
444
443
  }> extends infer R ? R : ZodNever : ZodNever;
445
444
  /**
@@ -753,4 +752,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
753
752
  */
754
753
  type KeyTypes = string | number;
755
754
 
756
- export { type AnySchemaValidator as A, type ZodRecordKey as B, 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 TCatchall as f, type TOuterArray as g, type TObjectShape as h, type SafeTObject as i, type TSchemaTranslate as j, type UnboxedTObjectSchema as k, type TIdiomaticSchema as l, type TUnionTupleContainer as m, type UnionTupleTResolve as n, type TResolve as o, type ZodCatchall as p, type ZodOuterArray as q, type ZodObjectShape as r, type ZodSchemaTranslate as s, type UnboxedZodObjectSchema as t, type ZodIdiomaticSchema as u, type ZodTupleContainer as v, type TupleZodResolve as w, type ZodUnionContainer as x, type UnionZodResolve as y, type ZodResolve as z };
755
+ export { type AnySchemaValidator as A, type TResolve as B, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TupleZodResolve 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 ZodCatchall as f, type ZodOuterArray as g, type ZodObjectShape as h, type ZodSchemaTranslate as i, type UnboxedZodObjectSchema as j, type ZodIdiomaticSchema as k, type ZodTupleContainer as l, type ZodUnionContainer as m, type UnionZodResolve as n, type ZodResolve as o, type ZodRecordKey as p, TypeboxSchemaValidator as q, type TCatchall as r, type TOuterArray as s, type TObjectShape as t, type SafeTObject as u, type TSchemaTranslate as v, type UnboxedTObjectSchema as w, type TIdiomaticSchema as x, type TUnionTupleContainer as y, type UnionTupleTResolve as z };
@@ -2,8 +2,7 @@ import { Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TFunction, TRecord, TPromise, TSchema, TString, TTransform, TNumber, TBoolean, TNull, TBigInt, TDate, TSymbol, TVoid, TUndefined, TAny, TUnknown, TNever, TKind, TObject, StaticDecode } from '@sinclair/typebox';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodLiteral as ZodLiteral$1, ZodType as ZodType$1, ZodNever, z as z$1, ZodRawShape as ZodRawShape$1, ZodObject as ZodObject$2, ZodArray as ZodArray$1 } from 'zod';
6
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z } from 'zod/v3';
5
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodFunction, ZodTuple, ZodRecord, ZodPromise, ZodType, z, ZodUnknown, ZodPipeline, ZodTypeAny, ZodEffects, ZodNever } from 'zod';
7
6
 
8
7
  /**
9
8
  * This module provides a TypeScript-based schema definition using the TypeBox library.
@@ -366,23 +365,23 @@ type ZodCatchall = ZodTypeAny;
366
365
  *
367
366
  * @template T - The type to check and possibly convert to an array schema.
368
367
  */
369
- type ZodOuterArray<T> = T extends ZodObject<ZodObjectShape> ? ZodArray$1<T> : ZodNever;
368
+ type ZodOuterArray<T> = T extends ZodObject<ZodObjectShape> ? ZodArray<T> : ZodNever;
370
369
  /**
371
370
  * Represents the shape of a Zod object schema.
372
371
  */
373
- type ZodObjectShape = ZodRawShape$1;
372
+ type ZodObjectShape = ZodRawShape;
374
373
  /**
375
374
  * Represents a Zod object schema type. If the type T is a Zod object shape, it will return the original ZodObject type of T. Otherwise, it returns ZodNever.
376
375
  *
377
376
  * @template T - The type to check and possibly convert to a Zod object schema.
378
377
  */
379
- type ZodObject<T> = T extends ZodObjectShape ? ZodObject$2<T> : ZodNever;
378
+ type ZodObject<T> = T extends ZodObjectShape ? ZodObject$1<T> : ZodNever;
380
379
  /**
381
380
  * Translates a Zod schema type T to its static type if T extends ZodCatchall. Otherwise, it returns ZodNever.
382
381
  *
383
382
  * @template T - The Zod schema type to translate.
384
383
  */
385
- type ZodSchemaTranslate<T> = T extends ZodCatchall ? z$1.infer<T> : ZodNever;
384
+ type ZodSchemaTranslate<T> = T extends ZodCatchall ? z.infer<T> : ZodNever;
386
385
  /**
387
386
  * Represents an unboxed Zod object schema where each key can have an idiomatic schema.
388
387
  */
@@ -439,7 +438,7 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
439
438
  * @template T - The Zod schema type to resolve.
440
439
  * @template Depth - The current depth of the resolution.
441
440
  */
442
- type ZodResolve<T, Depth extends number = 0> = Depth extends 28 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral$1<T> : T extends ZodType$1 ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
441
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 28 ? 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<{
443
442
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
444
443
  }> extends infer R ? R : ZodNever : ZodNever;
445
444
  /**
@@ -753,4 +752,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
753
752
  */
754
753
  type KeyTypes = string | number;
755
754
 
756
- export { type AnySchemaValidator as A, type ZodRecordKey as B, 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 TCatchall as f, type TOuterArray as g, type TObjectShape as h, type SafeTObject as i, type TSchemaTranslate as j, type UnboxedTObjectSchema as k, type TIdiomaticSchema as l, type TUnionTupleContainer as m, type UnionTupleTResolve as n, type TResolve as o, type ZodCatchall as p, type ZodOuterArray as q, type ZodObjectShape as r, type ZodSchemaTranslate as s, type UnboxedZodObjectSchema as t, type ZodIdiomaticSchema as u, type ZodTupleContainer as v, type TupleZodResolve as w, type ZodUnionContainer as x, type UnionZodResolve as y, type ZodResolve as z };
755
+ export { type AnySchemaValidator as A, type TResolve as B, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TupleZodResolve 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 ZodCatchall as f, type ZodOuterArray as g, type ZodObjectShape as h, type ZodSchemaTranslate as i, type UnboxedZodObjectSchema as j, type ZodIdiomaticSchema as k, type ZodTupleContainer as l, type ZodUnionContainer as m, type UnionZodResolve as n, type ZodResolve as o, type ZodRecordKey as p, TypeboxSchemaValidator as q, type TCatchall as r, type TOuterArray as s, type TObjectShape as t, type SafeTObject as u, type TSchemaTranslate as v, type UnboxedTObjectSchema as w, type TIdiomaticSchema as x, type TUnionTupleContainer as y, type UnionTupleTResolve as z };
@@ -1,11 +1,10 @@
1
1
  export * from '@sinclair/typebox';
2
- import { T as TypeboxSchemaValidator } from '../../schema.types-bwuhfE1y.mjs';
3
- export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-bwuhfE1y.mjs';
2
+ import { q as TypeboxSchemaValidator } from '../../schema.types-xFskiFwY.mjs';
3
+ export { u as SafeTObject, r as TCatchall, x as TIdiomaticSchema, t as TObjectShape, s as TOuterArray, B as TResolve, v as TSchemaTranslate, y as TUnionTupleContainer, w as UnboxedTObjectSchema, z as UnionTupleTResolve } from '../../schema.types-xFskiFwY.mjs';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox/compiler';
7
7
  import 'zod';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Factory function for creating a TypeboxSchemaValidator instance.
@@ -1,11 +1,10 @@
1
1
  export * from '@sinclair/typebox';
2
- import { T as TypeboxSchemaValidator } from '../../schema.types-bwuhfE1y.js';
3
- export { i as SafeTObject, f as TCatchall, l as TIdiomaticSchema, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-bwuhfE1y.js';
2
+ import { q as TypeboxSchemaValidator } from '../../schema.types-xFskiFwY.js';
3
+ export { u as SafeTObject, r as TCatchall, x as TIdiomaticSchema, t as TObjectShape, s as TOuterArray, B as TResolve, v as TSchemaTranslate, y as TUnionTupleContainer, w as UnboxedTObjectSchema, z as UnionTupleTResolve } from '../../schema.types-xFskiFwY.js';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox/compiler';
7
7
  import 'zod';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Factory function for creating a TypeboxSchemaValidator instance.
@@ -1,11 +1,10 @@
1
1
  export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod';
2
- import { Z as ZodSchemaValidator } from '../../schema.types-bwuhfE1y.mjs';
3
- export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-bwuhfE1y.mjs';
2
+ import { Z as ZodSchemaValidator } from '../../schema.types-xFskiFwY.mjs';
3
+ export { T as TupleZodResolve, j as UnboxedZodObjectSchema, n as UnionZodResolve, f as ZodCatchall, k as ZodIdiomaticSchema, h as ZodObjectShape, g as ZodOuterArray, p as ZodRecordKey, o as ZodResolve, i as ZodSchemaTranslate, l as ZodTupleContainer, m as ZodUnionContainer } from '../../schema.types-xFskiFwY.mjs';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox';
7
7
  import '@sinclair/typebox/compiler';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Factory function for creating a ZodSchemaValidator instance.
@@ -1,11 +1,10 @@
1
1
  export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod';
2
- import { Z as ZodSchemaValidator } from '../../schema.types-bwuhfE1y.js';
3
- export { w as TupleZodResolve, t as UnboxedZodObjectSchema, y as UnionZodResolve, p as ZodCatchall, u as ZodIdiomaticSchema, r as ZodObjectShape, q as ZodOuterArray, B as ZodRecordKey, z as ZodResolve, s as ZodSchemaTranslate, v as ZodTupleContainer, x as ZodUnionContainer } from '../../schema.types-bwuhfE1y.js';
2
+ import { Z as ZodSchemaValidator } from '../../schema.types-xFskiFwY.js';
3
+ export { T as TupleZodResolve, j as UnboxedZodObjectSchema, n as UnionZodResolve, f as ZodCatchall, k as ZodIdiomaticSchema, h as ZodObjectShape, g as ZodOuterArray, p as ZodRecordKey, o as ZodResolve, i as ZodSchemaTranslate, l as ZodTupleContainer, m as ZodUnionContainer } from '../../schema.types-xFskiFwY.js';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox';
7
7
  import '@sinclair/typebox/compiler';
8
- import 'zod/v3';
9
8
 
10
9
  /**
11
10
  * Factory function for creating a ZodSchemaValidator instance.
@@ -59,45 +59,45 @@ module.exports = __toCommonJS(zod_exports);
59
59
 
60
60
  // src/zod/zodSchemaValidator.ts
61
61
  var import_zod_openapi = require("@anatine/zod-openapi");
62
- var import_v3 = require("zod/v3");
63
- (0, import_zod_openapi.extendZodWithOpenApi)(import_v3.z);
62
+ var import_zod = require("zod");
63
+ (0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
64
64
  var ZodSchemaValidator = class {
65
65
  _Type = "Zod";
66
66
  _SchemaCatchall;
67
67
  _ValidSchemaObject;
68
- string = import_v3.z.string().openapi({
68
+ string = import_zod.z.string().openapi({
69
69
  title: "String",
70
70
  example: "a string"
71
71
  });
72
- uuid = import_v3.z.string().uuid().openapi({
72
+ uuid = import_zod.z.string().uuid().openapi({
73
73
  title: "UUID",
74
74
  format: "uuid",
75
75
  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}$",
76
76
  example: "a8b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
77
77
  });
78
- email = import_v3.z.string().email().openapi({
78
+ email = import_zod.z.string().email().openapi({
79
79
  title: "Email",
80
80
  format: "email",
81
81
  pattern: `(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])`,
82
82
  example: "a@b.com"
83
83
  });
84
- uri = import_v3.z.string().url().openapi({
84
+ uri = import_zod.z.string().url().openapi({
85
85
  title: "URI",
86
86
  format: "uri",
87
87
  pattern: "^[a-zA-Z][a-zA-Z\\d+-.]*:[^\\s]*$",
88
88
  example: "https://forklaunch.com"
89
89
  });
90
- number = import_v3.z.preprocess((value) => {
90
+ number = import_zod.z.preprocess((value) => {
91
91
  try {
92
92
  return Number(value);
93
93
  } catch {
94
94
  return value;
95
95
  }
96
- }, import_v3.z.number()).openapi({
96
+ }, import_zod.z.number()).openapi({
97
97
  title: "Number",
98
98
  example: 123
99
99
  });
100
- bigint = import_v3.z.preprocess((value) => {
100
+ bigint = import_zod.z.preprocess((value) => {
101
101
  try {
102
102
  if (value instanceof Date) {
103
103
  return BigInt(value.getTime());
@@ -114,23 +114,23 @@ var ZodSchemaValidator = class {
114
114
  } catch {
115
115
  return value;
116
116
  }
117
- }, import_v3.z.bigint()).openapi({
117
+ }, import_zod.z.bigint()).openapi({
118
118
  title: "BigInt",
119
119
  type: "integer",
120
120
  format: "int64",
121
121
  example: 123n
122
122
  });
123
- boolean = import_v3.z.preprocess((val) => {
123
+ boolean = import_zod.z.preprocess((val) => {
124
124
  if (typeof val === "string") {
125
125
  if (val.toLowerCase() === "true") return true;
126
126
  if (val.toLowerCase() === "false") return false;
127
127
  }
128
128
  return val;
129
- }, import_v3.z.boolean()).openapi({
129
+ }, import_zod.z.boolean()).openapi({
130
130
  title: "Boolean",
131
131
  example: true
132
132
  });
133
- date = import_v3.z.preprocess((value) => {
133
+ date = import_zod.z.preprocess((value) => {
134
134
  try {
135
135
  switch (typeof value) {
136
136
  case "string":
@@ -143,58 +143,58 @@ var ZodSchemaValidator = class {
143
143
  } catch {
144
144
  return value;
145
145
  }
146
- }, import_v3.z.date()).openapi({
146
+ }, import_zod.z.date()).openapi({
147
147
  title: "Date",
148
148
  type: "string",
149
149
  format: "date-time",
150
150
  example: "2025-05-16T21:13:04.123Z"
151
151
  });
152
- symbol = import_v3.z.symbol().openapi({
152
+ symbol = import_zod.z.symbol().openapi({
153
153
  title: "Symbol",
154
154
  example: Symbol("symbol")
155
155
  });
156
- nullish = import_v3.z.union([import_v3.z.void(), import_v3.z.null(), import_v3.z.undefined()]).openapi({
156
+ nullish = import_zod.z.union([import_zod.z.void(), import_zod.z.null(), import_zod.z.undefined()]).openapi({
157
157
  title: "Nullish",
158
158
  type: "null",
159
159
  example: null
160
160
  });
161
- void = import_v3.z.void().openapi({
161
+ void = import_zod.z.void().openapi({
162
162
  title: "Void",
163
163
  type: "null",
164
164
  example: void 0
165
165
  });
166
- null = import_v3.z.null().openapi({
166
+ null = import_zod.z.null().openapi({
167
167
  title: "Null",
168
168
  type: "null",
169
169
  example: null
170
170
  });
171
- undefined = import_v3.z.undefined().openapi({
171
+ undefined = import_zod.z.undefined().openapi({
172
172
  title: "Undefined",
173
173
  type: "null",
174
174
  example: void 0
175
175
  });
176
- any = import_v3.z.any().openapi({
176
+ any = import_zod.z.any().openapi({
177
177
  title: "Any",
178
178
  type: "object",
179
179
  example: "any"
180
180
  });
181
- unknown = import_v3.z.unknown().openapi({
181
+ unknown = import_zod.z.unknown().openapi({
182
182
  title: "Unknown",
183
183
  type: "object",
184
184
  example: "unknown"
185
185
  });
186
- never = import_v3.z.never().openapi({
186
+ never = import_zod.z.never().openapi({
187
187
  title: "Never",
188
188
  type: "null",
189
189
  example: "never"
190
190
  });
191
- binary = import_v3.z.string().transform((v) => new TextEncoder().encode(v)).openapi({
191
+ binary = import_zod.z.string().transform((v) => new TextEncoder().encode(v)).openapi({
192
192
  title: "Binary",
193
193
  type: "string",
194
194
  format: "binary",
195
195
  example: "a utf-8 encodable string"
196
196
  });
197
- file = import_v3.z.string().transform((val) => {
197
+ file = import_zod.z.string().transform((val) => {
198
198
  return new Blob([val]);
199
199
  }).openapi({
200
200
  title: "File",
@@ -219,20 +219,20 @@ var ZodSchemaValidator = class {
219
219
  */
220
220
  schemify(schema) {
221
221
  if (typeof schema === "string" || typeof schema === "number" || typeof schema === "boolean") {
222
- return import_v3.z.literal(schema);
222
+ return import_zod.z.literal(schema);
223
223
  }
224
- if (schema instanceof import_v3.ZodType) {
224
+ if (schema instanceof import_zod.ZodType) {
225
225
  return schema;
226
226
  }
227
227
  const newSchema = {};
228
228
  Object.getOwnPropertyNames(schema).forEach((key) => {
229
- if (schema[key] instanceof import_v3.ZodType) {
229
+ if (schema[key] instanceof import_zod.ZodType) {
230
230
  newSchema[key] = schema[key];
231
231
  } else {
232
232
  newSchema[key] = this.schemify(schema[key]);
233
233
  }
234
234
  });
235
- return import_v3.z.object(newSchema);
235
+ return import_zod.z.object(newSchema);
236
236
  }
237
237
  /**
238
238
  * Make a schema optional.
@@ -259,7 +259,7 @@ var ZodSchemaValidator = class {
259
259
  */
260
260
  union(schemas) {
261
261
  const resolvedSchemas = schemas.map((schema) => this.schemify(schema));
262
- return import_v3.z.union(
262
+ return import_zod.z.union(
263
263
  resolvedSchemas
264
264
  );
265
265
  }
@@ -269,7 +269,7 @@ var ZodSchemaValidator = class {
269
269
  * @returns {ZodLiteral<ZodResolve<T>>} The literal schema.
270
270
  */
271
271
  literal(value) {
272
- return import_v3.z.literal(value);
272
+ return import_zod.z.literal(value);
273
273
  }
274
274
  /**
275
275
  * Create an enum schema.
@@ -290,7 +290,7 @@ var ZodSchemaValidator = class {
290
290
  function_(args, returnType) {
291
291
  const schemaArgs = args.map((schema) => this.schemify(schema));
292
292
  const schemaReturnType = this.schemify(returnType);
293
- return import_v3.z.function(import_v3.z.tuple(schemaArgs), schemaReturnType);
293
+ return import_zod.z.function(import_zod.z.tuple(schemaArgs), schemaReturnType);
294
294
  }
295
295
  /**
296
296
  * Create a record schema.
@@ -301,7 +301,7 @@ var ZodSchemaValidator = class {
301
301
  record(key, value) {
302
302
  const keySchema = this.schemify(key);
303
303
  const valueSchema = this.schemify(value);
304
- return import_v3.z.record(keySchema, valueSchema);
304
+ return import_zod.z.record(keySchema, valueSchema);
305
305
  }
306
306
  /**
307
307
  * Create a promise schema.
@@ -309,7 +309,7 @@ var ZodSchemaValidator = class {
309
309
  * @returns {ZodPromise<ZodResolve<T>>} The promise schema.
310
310
  */
311
311
  promise(schema) {
312
- return import_v3.z.promise(this.schemify(schema));
312
+ return import_zod.z.promise(this.schemify(schema));
313
313
  }
314
314
  /**
315
315
  * Checks if a value is a Zod schema.
@@ -317,7 +317,7 @@ var ZodSchemaValidator = class {
317
317
  * @returns {boolean} True if the value is a Zod schema.
318
318
  */
319
319
  isSchema(value) {
320
- return value instanceof import_v3.ZodType;
320
+ return value instanceof import_zod.ZodType;
321
321
  }
322
322
  /**
323
323
  * Checks if a value is an instance of a Zod schema.
@@ -3,7 +3,7 @@ import { extendZodWithOpenApi, generateSchema } from "@anatine/zod-openapi";
3
3
  import {
4
4
  z,
5
5
  ZodType
6
- } from "zod/v3";
6
+ } from "zod";
7
7
  extendZodWithOpenApi(z);
8
8
  var ZodSchemaValidator = class {
9
9
  _Type = "Zod";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/validator",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Schema validator for ForkLaunch components.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -61,13 +61,13 @@
61
61
  "@anatine/zod-openapi": "^2.2.8",
62
62
  "@sinclair/typebox": "^0.34.37",
63
63
  "zod": "^3.25.76",
64
- "@forklaunch/common": "0.4.3"
64
+ "@forklaunch/common": "0.4.4"
65
65
  },
66
66
  "devDependencies": {
67
- "@eslint/js": "^9.30.1",
67
+ "@eslint/js": "^9.31.0",
68
68
  "@types/jest": "^30.0.0",
69
- "@types/node": "^24.0.12",
70
- "@typescript/native-preview": "7.0.0-dev.20250709.1",
69
+ "@types/node": "^24.0.13",
70
+ "@typescript/native-preview": "7.0.0-dev.20250712.1",
71
71
  "@vitest/coverage-v8": "^3.2.4",
72
72
  "eslint-config-prettier": "^10.1.5",
73
73
  "eslint-plugin-prettier": "^5.5.1",