@forklaunch/validator 0.4.2 → 0.4.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.
- package/lib/index.d.mts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/{schema.types-Do9dhcdB.d.mts → schema.types-CAZOYkiO.d.mts} +3 -3
- package/lib/{schema.types-Do9dhcdB.d.ts → schema.types-CAZOYkiO.d.ts} +3 -3
- package/lib/src/typebox/index.d.mts +3 -3
- package/lib/src/typebox/index.d.ts +3 -3
- package/lib/src/typebox/index.js +1 -1
- package/lib/src/typebox/index.mjs +1 -1
- package/lib/src/zod/index.d.mts +1 -1
- package/lib/src/zod/index.d.ts +1 -1
- package/lib/src/zod/index.js +1 -1
- package/lib/src/zod/index.mjs +1 -1
- package/lib/tests/utils/mockSchemaValidator.d.mts +1 -1
- package/lib/tests/utils/mockSchemaValidator.d.ts +1 -1
- package/package.json +13 -12
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, 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-
|
|
1
|
+
import { P as ParseError } from './schema.types-CAZOYkiO.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-CAZOYkiO.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, 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-
|
|
1
|
+
import { P as ParseError } from './schema.types-CAZOYkiO.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-CAZOYkiO.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import 'openapi3-ts/oas31';
|
|
5
5
|
import '@sinclair/typebox';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Prettify } from '@forklaunch/common';
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import {
|
|
3
|
+
import { TUnknown, TLiteral, TSchema, TKind, TProperties, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
|
-
import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z,
|
|
5
|
+
import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Represents a catch-all schema type.
|
|
@@ -473,4 +473,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
|
|
|
473
473
|
*/
|
|
474
474
|
type KeyTypes = string | number;
|
|
475
475
|
|
|
476
|
-
export { type AnySchemaValidator as A, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TObject 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
|
|
476
|
+
export { type AnySchemaValidator as A, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TObject 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 ZodIdiomaticSchema as f, type ZodResolve as g, type ZodUnionContainer as h, type UnionZodResolve as i, type ZodCatchall as j, type TIdiomaticSchema as k, type TResolve as l, type TUnionContainer as m, type UnionTResolve as n };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Prettify } from '@forklaunch/common';
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
|
-
import {
|
|
3
|
+
import { TUnknown, TLiteral, TSchema, TKind, TProperties, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
|
-
import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z,
|
|
5
|
+
import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Represents a catch-all schema type.
|
|
@@ -473,4 +473,4 @@ type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends
|
|
|
473
473
|
*/
|
|
474
474
|
type KeyTypes = string | number;
|
|
475
475
|
|
|
476
|
-
export { type AnySchemaValidator as A, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TObject 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
|
|
476
|
+
export { type AnySchemaValidator as A, type IdiomaticSchema as I, type KeyTypes as K, type LiteralSchema as L, type ParseError as P, type SchemaValidator as S, type TObject 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 ZodIdiomaticSchema as f, type ZodResolve as g, type ZodUnionContainer as h, type UnionZodResolve as i, type ZodCatchall as j, type TIdiomaticSchema as k, type TResolve as l, type TUnionContainer as m, type UnionTResolve as n };
|
|
@@ -2,7 +2,7 @@ import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
3
|
import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
|
-
import { S as SchemaValidator$1, T as TObject,
|
|
5
|
+
import { S as SchemaValidator$1, T as TObject, k as TIdiomaticSchema, l as TResolve, m as TUnionContainer, n as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CAZOYkiO.mjs';
|
|
6
6
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
7
7
|
import { TProperties, TOptional, TArray, TUnion, TLiteral, TSchema, TKind } from '@sinclair/typebox';
|
|
8
8
|
import '@forklaunch/common';
|
|
@@ -22,7 +22,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator$1<(<T extends TO
|
|
|
22
22
|
email: _sinclair_typebox.TString;
|
|
23
23
|
number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
|
|
24
24
|
bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
|
|
25
|
-
boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean
|
|
25
|
+
boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
|
|
26
26
|
date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
|
|
27
27
|
symbol: _sinclair_typebox.TSymbol;
|
|
28
28
|
nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
|
|
@@ -144,7 +144,7 @@ declare const bigint: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_si
|
|
|
144
144
|
/**
|
|
145
145
|
* TypeBox schema definition for boolean type.
|
|
146
146
|
*/
|
|
147
|
-
declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean
|
|
147
|
+
declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
|
|
148
148
|
/**
|
|
149
149
|
* TypeBox schema definition for date type.
|
|
150
150
|
*/
|
|
@@ -2,7 +2,7 @@ import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
|
2
2
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
3
3
|
import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
|
|
4
4
|
import { TypeCheck } from '@sinclair/typebox/compiler';
|
|
5
|
-
import { S as SchemaValidator$1, T as TObject,
|
|
5
|
+
import { S as SchemaValidator$1, T as TObject, k as TIdiomaticSchema, l as TResolve, m as TUnionContainer, n as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CAZOYkiO.js';
|
|
6
6
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
7
7
|
import { TProperties, TOptional, TArray, TUnion, TLiteral, TSchema, TKind } from '@sinclair/typebox';
|
|
8
8
|
import '@forklaunch/common';
|
|
@@ -22,7 +22,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator$1<(<T extends TO
|
|
|
22
22
|
email: _sinclair_typebox.TString;
|
|
23
23
|
number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
|
|
24
24
|
bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
|
|
25
|
-
boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean
|
|
25
|
+
boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
|
|
26
26
|
date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
|
|
27
27
|
symbol: _sinclair_typebox.TSymbol;
|
|
28
28
|
nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
|
|
@@ -144,7 +144,7 @@ declare const bigint: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_si
|
|
|
144
144
|
/**
|
|
145
145
|
* TypeBox schema definition for boolean type.
|
|
146
146
|
*/
|
|
147
|
-
declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean
|
|
147
|
+
declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
|
|
148
148
|
/**
|
|
149
149
|
* TypeBox schema definition for date type.
|
|
150
150
|
*/
|
package/lib/src/typebox/index.js
CHANGED
|
@@ -147,7 +147,7 @@ var TypeboxSchemaValidator = class {
|
|
|
147
147
|
).Decode((value) => {
|
|
148
148
|
if (typeof value === "string") {
|
|
149
149
|
if (value.toLowerCase() === "true") return true;
|
|
150
|
-
|
|
150
|
+
return false;
|
|
151
151
|
} else {
|
|
152
152
|
return value;
|
|
153
153
|
}
|
|
@@ -106,7 +106,7 @@ var TypeboxSchemaValidator = class {
|
|
|
106
106
|
).Decode((value) => {
|
|
107
107
|
if (typeof value === "string") {
|
|
108
108
|
if (value.toLowerCase() === "true") return true;
|
|
109
|
-
|
|
109
|
+
return false;
|
|
110
110
|
} else {
|
|
111
111
|
return value;
|
|
112
112
|
}
|
package/lib/src/zod/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import { Z as ZodSchemaValidator,
|
|
2
|
+
import { Z as ZodSchemaValidator, f as ZodIdiomaticSchema, g as ZodResolve, h as ZodUnionContainer, i as UnionZodResolve, L as LiteralSchema, j as ZodCatchall, a as ParseResult } from '../../schema.types-CAZOYkiO.mjs';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import '@sinclair/typebox';
|
package/lib/src/zod/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
|
|
2
|
-
import { Z as ZodSchemaValidator,
|
|
2
|
+
import { Z as ZodSchemaValidator, f as ZodIdiomaticSchema, g as ZodResolve, h as ZodUnionContainer, i as UnionZodResolve, L as LiteralSchema, j as ZodCatchall, a as ParseResult } from '../../schema.types-CAZOYkiO.js';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import '@forklaunch/common';
|
|
5
5
|
import '@sinclair/typebox';
|
package/lib/src/zod/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var ZodSchemaValidator = class {
|
|
|
75
75
|
boolean = import_zod.z.preprocess((val) => {
|
|
76
76
|
if (typeof val === "string") {
|
|
77
77
|
if (val.toLowerCase() === "true") return true;
|
|
78
|
-
|
|
78
|
+
return false;
|
|
79
79
|
}
|
|
80
80
|
return val;
|
|
81
81
|
}, import_zod.z.boolean());
|
package/lib/src/zod/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var ZodSchemaValidator = class {
|
|
|
29
29
|
boolean = z.preprocess((val) => {
|
|
30
30
|
if (typeof val === "string") {
|
|
31
31
|
if (val.toLowerCase() === "true") return true;
|
|
32
|
-
|
|
32
|
+
return false;
|
|
33
33
|
}
|
|
34
34
|
return val;
|
|
35
35
|
}, z.boolean());
|
|
@@ -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-
|
|
2
|
+
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-CAZOYkiO.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 { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-
|
|
2
|
+
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-CAZOYkiO.js';
|
|
3
3
|
import '@forklaunch/common';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import '@sinclair/typebox/compiler';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/validator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Schema validator for ForkLaunch components.",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -58,27 +58,28 @@
|
|
|
58
58
|
"lib"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@anatine/zod-openapi": "^2.2.
|
|
62
|
-
"@sinclair/typebox": "^0.34.
|
|
63
|
-
"zod": "^3.24.
|
|
64
|
-
"@forklaunch/common": "0.2.
|
|
61
|
+
"@anatine/zod-openapi": "^2.2.7",
|
|
62
|
+
"@sinclair/typebox": "^0.34.25",
|
|
63
|
+
"zod": "^3.24.2",
|
|
64
|
+
"@forklaunch/common": "0.2.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@eslint/js": "^9.
|
|
67
|
+
"@eslint/js": "^9.20.0",
|
|
68
68
|
"@types/jest": "^29.5.14",
|
|
69
|
-
"@vitest/coverage-v8": "^
|
|
70
|
-
"eslint-config-prettier": "^
|
|
71
|
-
"eslint-plugin-prettier": "^5.2.
|
|
72
|
-
"globals": "^15.
|
|
69
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
70
|
+
"eslint-config-prettier": "^10.0.1",
|
|
71
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
72
|
+
"globals": "^15.15.0",
|
|
73
73
|
"jest": "^29.7.0",
|
|
74
74
|
"openapi3-ts": "^4.4.0",
|
|
75
75
|
"ts-jest": "^29.2.5",
|
|
76
76
|
"ts-node": "^10.9.2",
|
|
77
|
-
"tsup": "^8.3.
|
|
78
|
-
"typescript-eslint": "^8.
|
|
77
|
+
"tsup": "^8.3.6",
|
|
78
|
+
"typescript-eslint": "^8.24.0"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsc --noEmit && tsup index.ts src/typebox/index.ts src/zod/index.ts tests/utils/mockSchemaValidator.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean",
|
|
82
|
+
"check": "depcheck",
|
|
82
83
|
"clean": "rm -rf lib pnpm.lock.yaml node_modules",
|
|
83
84
|
"docs": "typedoc --out docs *",
|
|
84
85
|
"format": "prettier --ignore-path=.prettierignore --config .prettierrc '**/*.{ts,tsx,json}' --write",
|