@forklaunch/validator 1.1.7 → 1.2.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.
- package/lib/__test__/utils/mockSchemaValidator.d.mts +1 -1
- package/lib/__test__/utils/mockSchemaValidator.d.ts +1 -1
- package/lib/index.d.mts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/{schema.types-DA-RijFU.d.mts → schema.types-CwnyfHOA.d.mts} +36 -5
- package/lib/{schema.types-DA-RijFU.d.ts → schema.types-CwnyfHOA.d.ts} +36 -5
- package/lib/src/typebox/index.d.mts +2 -2
- package/lib/src/typebox/index.d.ts +2 -2
- package/lib/src/zod/index.d.mts +2 -2
- package/lib/src/zod/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
2
|
-
import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-
|
|
2
|
+
import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-CwnyfHOA.mjs';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import '@sinclair/typebox/compiler';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
2
|
-
import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-
|
|
2
|
+
import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-CwnyfHOA.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import '@sinclair/typebox/compiler';
|
package/lib/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ParseError } from './schema.types-
|
|
2
|
-
export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-
|
|
1
|
+
import { P as ParseError } from './schema.types-CwnyfHOA.mjs';
|
|
2
|
+
export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-CwnyfHOA.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-
|
|
2
|
-
export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-
|
|
1
|
+
import { P as ParseError } from './schema.types-CwnyfHOA.js';
|
|
2
|
+
export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-CwnyfHOA.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import 'openapi3-ts/oas31';
|
|
5
5
|
import '@sinclair/typebox';
|
|
@@ -211,7 +211,7 @@ type UnionTupleTResolve<T extends TUnionTupleContainer, Acc extends TIdiomaticSc
|
|
|
211
211
|
* @template T - The schema type to resolve.
|
|
212
212
|
* @template Depth - The current depth of the resolution.
|
|
213
213
|
*/
|
|
214
|
-
type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends
|
|
214
|
+
type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends TSchema ? T : T extends TKind ? T : T extends LiteralSchema ? TLiteral<T> : T extends UnboxedTObjectSchema ? SafeTObject<{
|
|
215
215
|
[K in keyof T]: TResolve<T[K], Increment<Depth>>;
|
|
216
216
|
}> extends infer R ? R : TNever : T extends TypeCheck<infer Type> ? TResolve<Type, Increment<Depth>> : TNever;
|
|
217
217
|
|
|
@@ -438,9 +438,9 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
|
|
|
438
438
|
* @template T - The Zod schema type to resolve.
|
|
439
439
|
* @template Depth - The current depth of the resolution.
|
|
440
440
|
*/
|
|
441
|
-
type ZodResolve<T, Depth extends number = 0> = Depth extends
|
|
441
|
+
type ZodResolve<T, Depth extends number = 0> = Depth extends 15 ? ZodUnknown : T extends ZodType ? T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T : T extends LiteralSchema ? ZodLiteral<T> : T extends UnboxedZodObjectSchema ? ZodObject<{
|
|
442
442
|
[K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
|
|
443
|
-
}>
|
|
443
|
+
}> : ZodNever;
|
|
444
444
|
/**
|
|
445
445
|
* Represents the key type of a Zod record schema.
|
|
446
446
|
*
|
|
@@ -746,11 +746,42 @@ type LiteralSchema = string | number | boolean;
|
|
|
746
746
|
*/
|
|
747
747
|
type IdiomaticSchema<SV extends AnySchemaValidator> = LiteralSchema | SV['_SchemaCatchall'] | UnboxedObjectSchema<SV>;
|
|
748
748
|
/**
|
|
749
|
-
*
|
|
749
|
+
* Tuple-based lookup for incrementing a number type by one. O(1) indexed access
|
|
750
|
+
* instead of O(n) conditional chain.
|
|
751
|
+
*/
|
|
752
|
+
type IncrementMap = [
|
|
753
|
+
1,
|
|
754
|
+
2,
|
|
755
|
+
3,
|
|
756
|
+
4,
|
|
757
|
+
5,
|
|
758
|
+
6,
|
|
759
|
+
7,
|
|
760
|
+
8,
|
|
761
|
+
9,
|
|
762
|
+
10,
|
|
763
|
+
11,
|
|
764
|
+
12,
|
|
765
|
+
13,
|
|
766
|
+
14,
|
|
767
|
+
15,
|
|
768
|
+
16,
|
|
769
|
+
17,
|
|
770
|
+
18,
|
|
771
|
+
19,
|
|
772
|
+
20,
|
|
773
|
+
21,
|
|
774
|
+
22,
|
|
775
|
+
23,
|
|
776
|
+
24,
|
|
777
|
+
25
|
|
778
|
+
];
|
|
779
|
+
/**
|
|
780
|
+
* Increments a number type by one, with support up to 24.
|
|
750
781
|
*
|
|
751
782
|
* @template T - The number type to increment.
|
|
752
783
|
*/
|
|
753
|
-
type Increment<T extends number> = T extends
|
|
784
|
+
type Increment<T extends number> = T extends keyof IncrementMap ? IncrementMap[T] : 25;
|
|
754
785
|
/**
|
|
755
786
|
* Represents key types that can be used in the schema.
|
|
756
787
|
*/
|
|
@@ -211,7 +211,7 @@ type UnionTupleTResolve<T extends TUnionTupleContainer, Acc extends TIdiomaticSc
|
|
|
211
211
|
* @template T - The schema type to resolve.
|
|
212
212
|
* @template Depth - The current depth of the resolution.
|
|
213
213
|
*/
|
|
214
|
-
type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends
|
|
214
|
+
type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends TSchema ? T : T extends TKind ? T : T extends LiteralSchema ? TLiteral<T> : T extends UnboxedTObjectSchema ? SafeTObject<{
|
|
215
215
|
[K in keyof T]: TResolve<T[K], Increment<Depth>>;
|
|
216
216
|
}> extends infer R ? R : TNever : T extends TypeCheck<infer Type> ? TResolve<Type, Increment<Depth>> : TNever;
|
|
217
217
|
|
|
@@ -438,9 +438,9 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
|
|
|
438
438
|
* @template T - The Zod schema type to resolve.
|
|
439
439
|
* @template Depth - The current depth of the resolution.
|
|
440
440
|
*/
|
|
441
|
-
type ZodResolve<T, Depth extends number = 0> = Depth extends
|
|
441
|
+
type ZodResolve<T, Depth extends number = 0> = Depth extends 15 ? ZodUnknown : T extends ZodType ? T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T : T extends LiteralSchema ? ZodLiteral<T> : T extends UnboxedZodObjectSchema ? ZodObject<{
|
|
442
442
|
[K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
|
|
443
|
-
}>
|
|
443
|
+
}> : ZodNever;
|
|
444
444
|
/**
|
|
445
445
|
* Represents the key type of a Zod record schema.
|
|
446
446
|
*
|
|
@@ -746,11 +746,42 @@ type LiteralSchema = string | number | boolean;
|
|
|
746
746
|
*/
|
|
747
747
|
type IdiomaticSchema<SV extends AnySchemaValidator> = LiteralSchema | SV['_SchemaCatchall'] | UnboxedObjectSchema<SV>;
|
|
748
748
|
/**
|
|
749
|
-
*
|
|
749
|
+
* Tuple-based lookup for incrementing a number type by one. O(1) indexed access
|
|
750
|
+
* instead of O(n) conditional chain.
|
|
751
|
+
*/
|
|
752
|
+
type IncrementMap = [
|
|
753
|
+
1,
|
|
754
|
+
2,
|
|
755
|
+
3,
|
|
756
|
+
4,
|
|
757
|
+
5,
|
|
758
|
+
6,
|
|
759
|
+
7,
|
|
760
|
+
8,
|
|
761
|
+
9,
|
|
762
|
+
10,
|
|
763
|
+
11,
|
|
764
|
+
12,
|
|
765
|
+
13,
|
|
766
|
+
14,
|
|
767
|
+
15,
|
|
768
|
+
16,
|
|
769
|
+
17,
|
|
770
|
+
18,
|
|
771
|
+
19,
|
|
772
|
+
20,
|
|
773
|
+
21,
|
|
774
|
+
22,
|
|
775
|
+
23,
|
|
776
|
+
24,
|
|
777
|
+
25
|
|
778
|
+
];
|
|
779
|
+
/**
|
|
780
|
+
* Increments a number type by one, with support up to 24.
|
|
750
781
|
*
|
|
751
782
|
* @template T - The number type to increment.
|
|
752
783
|
*/
|
|
753
|
-
type Increment<T extends number> = T extends
|
|
784
|
+
type Increment<T extends number> = T extends keyof IncrementMap ? IncrementMap[T] : 25;
|
|
754
785
|
/**
|
|
755
786
|
* Represents key types that can be used in the schema.
|
|
756
787
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@sinclair/typebox';
|
|
2
|
-
import { T as TypeboxSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-
|
|
2
|
+
import { T as TypeboxSchemaValidator } from '../../schema.types-CwnyfHOA.mjs';
|
|
3
|
+
export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-CwnyfHOA.mjs';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox/compiler';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@sinclair/typebox';
|
|
2
|
-
import { T as TypeboxSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-
|
|
2
|
+
import { T as TypeboxSchemaValidator } from '../../schema.types-CwnyfHOA.js';
|
|
3
|
+
export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-CwnyfHOA.js';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox/compiler';
|
package/lib/src/zod/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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/v3';
|
|
2
|
-
import { Z as ZodSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator } from '../../schema.types-CwnyfHOA.mjs';
|
|
3
|
+
export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-CwnyfHOA.mjs';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox';
|
package/lib/src/zod/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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/v3';
|
|
2
|
-
import { Z as ZodSchemaValidator } from '../../schema.types-
|
|
3
|
-
export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator } from '../../schema.types-CwnyfHOA.js';
|
|
3
|
+
export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-CwnyfHOA.js';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import 'openapi3-ts/oas31';
|
|
6
6
|
import '@sinclair/typebox';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/validator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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
|
"@sinclair/typebox": "^0.34.48",
|
|
62
62
|
"ts-deepmerge": "^7.0.3",
|
|
63
63
|
"zod": "^4.3.6",
|
|
64
|
-
"@forklaunch/common": "1.
|
|
64
|
+
"@forklaunch/common": "1.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^10.0.1",
|
|
68
68
|
"@types/jest": "^30.0.0",
|
|
69
69
|
"@types/node": "^25.5.0",
|
|
70
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
70
|
+
"@typescript/native-preview": "7.0.0-dev.20260320.1",
|
|
71
71
|
"@vitest/coverage-v8": "^4.1.1",
|
|
72
72
|
"eslint-config-prettier": "^10.1.8",
|
|
73
73
|
"eslint-plugin-prettier": "^5.5.5",
|