@forklaunch/validator 0.4.3 → 0.4.5
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-CA4Aof4g.d.mts} +2 -2
- package/lib/{schema.types-Do9dhcdB.d.ts → schema.types-CA4Aof4g.d.ts} +2 -2
- 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 -13
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-CA4Aof4g.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-CA4Aof4g.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-CA4Aof4g.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-CA4Aof4g.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.
|
|
@@ -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.
|
|
@@ -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, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-
|
|
5
|
+
import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.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, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-
|
|
5
|
+
import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.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, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-CA4Aof4g.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, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-
|
|
2
|
+
import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-CA4Aof4g.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-CA4Aof4g.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-CA4Aof4g.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.5",
|
|
4
4
|
"description": "Schema validator for ForkLaunch components.",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -58,24 +58,24 @@
|
|
|
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.28",
|
|
63
|
+
"zod": "^3.24.2",
|
|
64
|
+
"@forklaunch/common": "0.2.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@eslint/js": "^9.
|
|
67
|
+
"@eslint/js": "^9.22.0",
|
|
68
68
|
"@types/jest": "^29.5.14",
|
|
69
|
-
"@vitest/coverage-v8": "^3.0.
|
|
70
|
-
"eslint-config-prettier": "^10.
|
|
71
|
-
"eslint-plugin-prettier": "^5.2.
|
|
72
|
-
"globals": "^
|
|
69
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
70
|
+
"eslint-config-prettier": "^10.1.1",
|
|
71
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
72
|
+
"globals": "^16.0.0",
|
|
73
73
|
"jest": "^29.7.0",
|
|
74
74
|
"openapi3-ts": "^4.4.0",
|
|
75
|
-
"ts-jest": "^29.2.
|
|
75
|
+
"ts-jest": "^29.2.6",
|
|
76
76
|
"ts-node": "^10.9.2",
|
|
77
|
-
"tsup": "^8.
|
|
78
|
-
"typescript-eslint": "^8.
|
|
77
|
+
"tsup": "^8.4.0",
|
|
78
|
+
"typescript-eslint": "^8.26.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",
|