@forklaunch/validator 0.1.3 → 0.1.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/dist/index.d.ts +23 -23
- package/dist/interfaces/schemaValidator.interfaces.d.ts +114 -0
- package/dist/interfaces/schemaValidator.interfaces.js +3 -0
- package/dist/interfaces/schemaValidator.interfaces.js.map +1 -0
- package/dist/tests/typebox/equality.test.js +1 -1
- package/dist/tests/typebox/equality.test.js.map +1 -1
- package/dist/tests/typebox/largeSchema.test.js +1 -1
- package/dist/tests/typebox/largeSchema.test.js.map +1 -1
- package/dist/tests/zod/equality.test.js +1 -1
- package/dist/tests/zod/equality.test.js.map +1 -1
- package/dist/tests/zod/largeSchema.test.js +1 -1
- package/dist/tests/zod/largeSchema.test.js.map +1 -1
- package/dist/typebox/index.d.ts +2 -0
- package/dist/typebox/index.js +19 -0
- package/dist/typebox/index.js.map +1 -0
- package/dist/typebox/typebox.d.ts +148 -0
- package/dist/typebox/typebox.js +194 -0
- package/dist/typebox/typebox.js.map +1 -0
- package/dist/typebox/types/typebox.schema.types.d.ts +63 -0
- package/dist/typebox/types/typebox.schema.types.js +3 -0
- package/dist/typebox/types/typebox.schema.types.js.map +1 -0
- package/dist/typebox.d.ts +25 -25
- package/dist/typebox.js +26 -26
- package/dist/typebox.js.map +1 -1
- package/dist/zod/index.d.ts +2 -0
- package/dist/zod/index.js +19 -0
- package/dist/zod/index.js.map +1 -0
- package/dist/zod/types/zod.schema.types.d.ts +65 -0
- package/dist/zod/types/zod.schema.types.js +3 -0
- package/dist/zod/types/zod.schema.types.js.map +1 -0
- package/dist/zod/zod.d.ts +145 -0
- package/dist/zod/zod.js +192 -0
- package/dist/zod/zod.js.map +1 -0
- package/dist/zod.d.ts +25 -25
- package/dist/zod.js +26 -26
- package/dist/zod.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,78 +6,78 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Prettify } from "@forklaunch/common";
|
|
8
8
|
import { IdiomaticSchema } from "./types/schema.types";
|
|
9
|
-
import { TOuterArray, TCatchall, TObject, TObjectShape, TResolve, TSchemaTranslate } from "./types/typebox.schema.types";
|
|
10
|
-
import { ZodOuterArray, ZodCatchall, ZodObject, ZodObjectShape, ZodResolve, ZodSchemaTranslate } from "./types/zod.schema.types";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { TOuterArray, TCatchall, TObject, TObjectShape, TResolve, TSchemaTranslate } from "./typebox/types/typebox.schema.types";
|
|
10
|
+
import { ZodOuterArray, ZodCatchall, ZodObject, ZodObjectShape, ZodResolve, ZodSchemaTranslate } from "./zod/types/zod.schema.types";
|
|
11
|
+
import { ZodSchemaValidator } from "./zod/zod";
|
|
12
|
+
import { TypeboxSchemaValidator } from "./typebox/typebox";
|
|
13
|
+
import { AnySchemaValidator } from "./interfaces/schemaValidator.interfaces";
|
|
14
14
|
/**
|
|
15
15
|
* Type alias for a schema object shape.
|
|
16
16
|
* Resolves to ZodObjectShape for Zod schemas and TObjectShape for TypeBox schemas.
|
|
17
17
|
*
|
|
18
|
-
* @template
|
|
18
|
+
* @template SV - SchemaValidator type.
|
|
19
19
|
*/
|
|
20
|
-
type SchemaObjectShape<
|
|
20
|
+
type SchemaObjectShape<SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodObjectShape : SV extends TypeboxSchemaValidator ? TObjectShape : never);
|
|
21
21
|
/**
|
|
22
22
|
* Type alias for a schema object.
|
|
23
23
|
* Resolves to ZodObject for Zod schemas and TObject for TypeBox schemas.
|
|
24
24
|
*
|
|
25
25
|
* @template T - Schema object shape.
|
|
26
|
-
* @template
|
|
26
|
+
* @template SV - SchemaValidator type.
|
|
27
27
|
*/
|
|
28
|
-
type SchemaObject<T extends SchemaObjectShape<
|
|
28
|
+
type SchemaObject<T extends SchemaObjectShape<SV>, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodObject<T> : SV extends TypeboxSchemaValidator ? TObject<T> : never);
|
|
29
29
|
/**
|
|
30
30
|
* Type alias for a schema outer array.
|
|
31
31
|
* Resolves to ZodOuterArray for Zod schemas and TOuterArray for TypeBox schemas.
|
|
32
32
|
*
|
|
33
33
|
* @template T - Schema object.
|
|
34
|
-
* @template
|
|
34
|
+
* @template SV - SchemaValidator type.
|
|
35
35
|
*/
|
|
36
|
-
type SchemaOuterArray<T extends SchemaObject<SchemaObjectShape<
|
|
36
|
+
type SchemaOuterArray<T extends SchemaObject<SchemaObjectShape<SV>, SV>, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodOuterArray<T> : SV extends TypeboxSchemaValidator ? TOuterArray<T> : never);
|
|
37
37
|
/**
|
|
38
38
|
* Type alias for resolving a schema.
|
|
39
39
|
* Resolves to ZodResolve for Zod schemas and TResolve for TypeBox schemas.
|
|
40
40
|
*
|
|
41
41
|
* @template T - Schema type.
|
|
42
|
-
* @template
|
|
42
|
+
* @template SV - SchemaValidator type.
|
|
43
43
|
*/
|
|
44
|
-
type SchemaResolve<T,
|
|
44
|
+
type SchemaResolve<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodResolve<T> : SV extends TypeboxSchemaValidator ? TResolve<T> : never);
|
|
45
45
|
/**
|
|
46
46
|
* Type alias for translating a schema.
|
|
47
47
|
* Resolves to ZodSchemaTranslate for Zod schemas and TSchemaTranslate for TypeBox schemas.
|
|
48
48
|
*
|
|
49
49
|
* @template T - Schema type.
|
|
50
|
-
* @template
|
|
50
|
+
* @template SV - SchemaValidator type.
|
|
51
51
|
*/
|
|
52
|
-
type SchemaTranslate<T,
|
|
52
|
+
type SchemaTranslate<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodSchemaTranslate<T> : SV extends TypeboxSchemaValidator ? TSchemaTranslate<T> : never);
|
|
53
53
|
/**
|
|
54
54
|
* Type alias for prettifying a schema translation.
|
|
55
55
|
* Uses the Prettify utility from @forklaunch/common.
|
|
56
56
|
*
|
|
57
57
|
* @template T - Schema type.
|
|
58
|
-
* @template
|
|
58
|
+
* @template SV - SchemaValidator type.
|
|
59
59
|
*/
|
|
60
|
-
type SchemaPrettify<T,
|
|
60
|
+
type SchemaPrettify<T, SV extends AnySchemaValidator> = Prettify<SchemaTranslate<T, SV>>;
|
|
61
61
|
/**
|
|
62
62
|
* Type alias for a schema catchall type.
|
|
63
63
|
* Resolves to ZodCatchall for Zod schemas and TCatchall for TypeBox schemas.
|
|
64
64
|
*
|
|
65
|
-
* @template
|
|
65
|
+
* @template SV - SchemaValidator type.
|
|
66
66
|
*/
|
|
67
|
-
export type SchemaCatchall<
|
|
67
|
+
export type SchemaCatchall<SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodCatchall : SV extends TypeboxSchemaValidator ? TCatchall : never);
|
|
68
68
|
/**
|
|
69
69
|
* Type alias for a valid schema object.
|
|
70
70
|
* Can be a schema object or a schema outer array.
|
|
71
71
|
*
|
|
72
|
-
* @template
|
|
72
|
+
* @template SV - SchemaValidator type.
|
|
73
73
|
*/
|
|
74
|
-
export type ValidSchemaObject<
|
|
74
|
+
export type ValidSchemaObject<SV extends AnySchemaValidator> = SchemaObject<SchemaObjectShape<SV>, SV> | SchemaOuterArray<SchemaObject<SchemaObjectShape<SV>, SV>, SV>;
|
|
75
75
|
/**
|
|
76
76
|
* Type alias for a schema.
|
|
77
77
|
* Applies prettification to the resolved schema.
|
|
78
78
|
*
|
|
79
79
|
* @template T - Valid schema object or idiomatic schema.
|
|
80
|
-
* @template
|
|
80
|
+
* @template SV - SchemaValidator type.
|
|
81
81
|
*/
|
|
82
|
-
export type Schema<T extends ValidSchemaObject<
|
|
82
|
+
export type Schema<T extends ValidSchemaObject<SV> | IdiomaticSchema<SchemaCatchall<SV>>, SV extends AnySchemaValidator> = SchemaPrettify<SchemaResolve<T, SV>, SV>;
|
|
83
83
|
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { SchemaObject } from "openapi3-ts/oas31";
|
|
2
|
+
import { LiteralSchema } from "../types/schema.types";
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing any schema validator.
|
|
5
|
+
* Extends the SchemaValidator interface with any schema types.
|
|
6
|
+
*/
|
|
7
|
+
export interface AnySchemaValidator extends SchemaValidator<any, any, any> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Interface representing a schema validator.
|
|
11
|
+
*
|
|
12
|
+
* @template UnionContainer - The type for union schemas.
|
|
13
|
+
* @template IdiomaticSchema - The type for idiomatic schemas.
|
|
14
|
+
* @template Catchall - The catch-all type for all schemas.
|
|
15
|
+
*/
|
|
16
|
+
export interface SchemaValidator<UnionContainer, IdiomaticSchema, Catchall> {
|
|
17
|
+
/**
|
|
18
|
+
* Validator for string type.
|
|
19
|
+
*/
|
|
20
|
+
string: unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Validator for number type.
|
|
23
|
+
*/
|
|
24
|
+
number: unknown;
|
|
25
|
+
/**
|
|
26
|
+
* Validator for bigint type.
|
|
27
|
+
*/
|
|
28
|
+
bigint: unknown;
|
|
29
|
+
/**
|
|
30
|
+
* Validator for boolean type.
|
|
31
|
+
*/
|
|
32
|
+
boolean: unknown;
|
|
33
|
+
/**
|
|
34
|
+
* Validator for date type.
|
|
35
|
+
*/
|
|
36
|
+
date: unknown;
|
|
37
|
+
/**
|
|
38
|
+
* Validator for symbol type.
|
|
39
|
+
*/
|
|
40
|
+
symbol: unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Validator for empty type.
|
|
43
|
+
*/
|
|
44
|
+
empty: unknown;
|
|
45
|
+
/**
|
|
46
|
+
* Validator for any type.
|
|
47
|
+
*/
|
|
48
|
+
any: unknown;
|
|
49
|
+
/**
|
|
50
|
+
* Validator for unknown type.
|
|
51
|
+
*/
|
|
52
|
+
unknown: unknown;
|
|
53
|
+
/**
|
|
54
|
+
* Validator for never type.
|
|
55
|
+
*/
|
|
56
|
+
never: unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Converts a valid schema input into a schemified form.
|
|
59
|
+
*
|
|
60
|
+
* @template T - The type of the idiomatic schema.
|
|
61
|
+
* @param {T} schema - The schema to schemify.
|
|
62
|
+
* @returns {unknown} - The schemified form of the schema.
|
|
63
|
+
*/
|
|
64
|
+
schemify<T extends IdiomaticSchema>(schema: T): unknown;
|
|
65
|
+
/**
|
|
66
|
+
* Converts a schema into an optional schema.
|
|
67
|
+
*
|
|
68
|
+
* @template T - The type of the idiomatic schema.
|
|
69
|
+
* @param {T} schema - The schema to make optional.
|
|
70
|
+
* @returns {unknown} - The optional form of the schema.
|
|
71
|
+
*/
|
|
72
|
+
optional<T extends IdiomaticSchema>(schema: T): unknown;
|
|
73
|
+
/**
|
|
74
|
+
* Converts a schema into an array schema.
|
|
75
|
+
*
|
|
76
|
+
* @template T - The type of the idiomatic schema.
|
|
77
|
+
* @param {T} schema - The schema to convert into an array.
|
|
78
|
+
* @returns {unknown} - The array form of the schema.
|
|
79
|
+
*/
|
|
80
|
+
array<T extends IdiomaticSchema>(schema: T): unknown;
|
|
81
|
+
/**
|
|
82
|
+
* Converts multiple schemas into a union schema.
|
|
83
|
+
*
|
|
84
|
+
* @template T - The type of the union container.
|
|
85
|
+
* @param {T} schemas - The schemas to unionize.
|
|
86
|
+
* @returns {unknown} - The union form of the schemas.
|
|
87
|
+
*/
|
|
88
|
+
union<T extends UnionContainer>(schemas: T): unknown;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a literal schema from a value.
|
|
91
|
+
*
|
|
92
|
+
* @template T - The type of the literal value.
|
|
93
|
+
* @param {T} value - The literal value.
|
|
94
|
+
* @returns {unknown} - The literal schema.
|
|
95
|
+
*/
|
|
96
|
+
literal<T extends LiteralSchema>(value: T): unknown;
|
|
97
|
+
/**
|
|
98
|
+
* Validates a value against a schema.
|
|
99
|
+
*
|
|
100
|
+
* @template T - The type of the catch-all schema.
|
|
101
|
+
* @param {T} schema - The schema to validate against.
|
|
102
|
+
* @param {unknown} value - The value to validate.
|
|
103
|
+
* @returns {boolean} - Whether the value is valid according to the schema.
|
|
104
|
+
*/
|
|
105
|
+
validate<T extends Catchall>(schema: T, value: unknown): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Converts a schema into an OpenAPI schema object.
|
|
108
|
+
*
|
|
109
|
+
* @template T - The type of the idiomatic schema.
|
|
110
|
+
* @param {T} schema - The schema to convert.
|
|
111
|
+
* @returns {SchemaObject} - The OpenAPI schema object.
|
|
112
|
+
*/
|
|
113
|
+
openapi<T extends IdiomaticSchema>(schema: T): SchemaObject;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaValidator.interfaces.js","sourceRoot":"","sources":["../../interfaces/schemaValidator.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assert = void 0;
|
|
4
|
-
const typebox_1 = require("../../typebox");
|
|
4
|
+
const typebox_1 = require("../../typebox/typebox");
|
|
5
5
|
const one = (0, typebox_1.array)({
|
|
6
6
|
name: {
|
|
7
7
|
j: (0, typebox_1.union)([typebox_1.string, typebox_1.number, typebox_1.date, typebox_1.boolean, typebox_1.bigint, typebox_1.empty, typebox_1.symbol, typebox_1.never]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equality.test.js","sourceRoot":"","sources":["../../../tests/typebox/equality.test.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"equality.test.js","sourceRoot":"","sources":["../../../tests/typebox/equality.test.ts"],"names":[],"mappings":";;;AACA,mDAA6J;AAE7J,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC;IACd,IAAI,EAAE;QACF,CAAC,EAAE,IAAA,eAAK,EAAC,CAAC,gBAAM,EAAE,gBAAM,EAAE,cAAI,EAAE,iBAAO,EAAE,gBAAM,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|
1
|
-
{"version":3,"file":"largeSchema.test.js","sourceRoot":"","sources":["../../../tests/typebox/largeSchema.test.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"largeSchema.test.js","sourceRoot":"","sources":["../../../tests/typebox/largeSchema.test.ts"],"names":[],"mappings":";;AACA,mDAAmJ;AAEnJ,MAAM,OAAO,GAAG;IACZ,CAAC,EAAE;QACC,CAAC,EAAE;YACC,CAAC,EAAE;gBACC,CAAC,EAAE;oBACC,CAAC,EAAE;wBACC,CAAC,EAAE;4BACC,CAAC,EAAE;gCACC,CAAC,EAAE;oCACC,CAAC,EAAE;wCACC,CAAC,EAAC;4CACE,CAAC,EAAE;gDACC,CAAC,EAAE;oDACC,CAAC,EAAE;wDACC,CAAC,EAAE;4DACC,CAAC,EAAE,QAAiB;yDACvB;qDACJ;iDACJ;6CACJ;yCACJ;qCACJ;iCACJ;6BACJ;yBACJ;qBACJ;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAA;AAGD,MAAM,OAAO,GAAG;IACZ,CAAC,EAAE;QACC,CAAC,EAAE,gBAAM;QACT,CAAC,EAAE;YACC,CAAC,EAAE;gBACC,CAAC,EAAE;oBACC,CAAC,EAAE;wBACC,CAAC,EAAE;4BACC,CAAC,EAAE;gCACC,CAAC,EAAE;oCACC,CAAC,EAAE;wCACC,CAAC,EAAC;4CACE,CAAC,EAAE;gDACC,CAAC,EAAE;oDACC,CAAC,EAAE;wDACC,CAAC,EAAE;4DACC,CAAC,EAAE,gBAAM;yDACZ;qDACJ;iDACJ;6CACJ;yCACJ;qCACJ;iCACJ;6BACJ;yBACJ;qBACJ;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAA;AAED,MAAM,SAAS,GAAG,IAAA,eAAK,EAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;AAG3C,MAAM,SAAS,GAAG,IAAA,eAAK,EAAC;IACpB,MAAM,EAAE;QACJ,IAAI,EAAE;YACF,CAAC,EAAE,IAAA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AAC,EAAE,gBAAM;iBACZ;aACJ;SACJ;QACD,gBAAgB,EAAE;YACd,CAAC,EAAE,gBAAM;YACT,CAAC,EAAE,IAAA,eAAK,EAAC,CAAC,gBAAM,EAAE,IAAA,eAAK,EAAC,iBAAO,CAAC,CAAC,CAAC;YAClC,CAAC,EAAE;gBACC,CAAC,EAAE,gBAAM;gBACT,CAAC,EAAE,gBAAM;aACZ;SACJ;KACJ;IACD,IAAI,EAAE;QACF,GAAG,EAAE;YACD,CAAC,EAAE,gBAAM;SACZ;QACD,GAAG,EAAE;YACD,CAAC,EAAE,gBAAM;SACZ;KACJ;IACD,IAAI,EAAE;QACF,CAAC,EAAE,IAAa;QAChB,CAAC,EAAE,KAAc;KACpB;CACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assert = void 0;
|
|
4
|
-
const zod_1 = require("../../zod");
|
|
4
|
+
const zod_1 = require("../../zod/zod");
|
|
5
5
|
const one = (0, zod_1.array)({
|
|
6
6
|
name: {
|
|
7
7
|
j: (0, zod_1.union)([zod_1.string, zod_1.number, zod_1.date, zod_1.boolean, zod_1.bigint, zod_1.empty, zod_1.symbol, zod_1.never]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equality.test.js","sourceRoot":"","sources":["../../../tests/zod/equality.test.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"equality.test.js","sourceRoot":"","sources":["../../../tests/zod/equality.test.ts"],"names":[],"mappings":";;;AACA,uCAAiJ;AAEjJ,MAAM,GAAG,GAAG,IAAA,WAAK,EAAC;IACd,IAAI,EAAE;QACF,CAAC,EAAE,IAAA,WAAK,EAAC,CAAC,YAAM,EAAE,YAAM,EAAE,UAAI,EAAE,aAAO,EAAE,YAAM,EAAE,WAAK,EAAE,YAAM,EAAE,WAAK,CAAC,CAAC;QACvE,CAAC,EA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AAC;YAClC,CAAC,EAAE;gBACC,CAAC,EAAE,YAAM;gBACT,CAAC,EAAE,YAAM;aACZ;SACJ;KACJ;IACD,IAAI,EAAE;QACF,GAAG,EAAE;YACD,CAAC,EAAE,YAAM;SACZ;QACD,GAAG,EAAE;YACD,CAAC,EAAE,YAAM;SACZ;KACJ;IACD,IAAI,EAAE;QACF,CAAC,EAAE,IAAa;QAChB,CAAC,EAAE,KAAc;KACpB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./typebox"), exports);
|
|
18
|
+
__exportStar(require("./types/typebox.schema.types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../typebox/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,+DAA6C"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module provides a TypeScript-based schema definition using the TypeBox library.
|
|
3
|
+
* It includes various types, schema creation, validation, and OpenAPI integration.
|
|
4
|
+
*
|
|
5
|
+
* @module TypeboxSchemaValidator
|
|
6
|
+
*/
|
|
7
|
+
import { TSchema, TArray, TOptional, TUnion, TLiteral } from '@sinclair/typebox';
|
|
8
|
+
import { LiteralSchema } from '../types/schema.types';
|
|
9
|
+
import { SchemaValidator } from '../interfaces/schemaValidator.interfaces';
|
|
10
|
+
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
11
|
+
import { TUnionContainer, TIdiomaticSchema, TResolve, UnionTResolve } from './types/typebox.schema.types';
|
|
12
|
+
/**
|
|
13
|
+
* Class representing a TypeBox schema definition.
|
|
14
|
+
* @implements {SchemaValidator}
|
|
15
|
+
*/
|
|
16
|
+
export declare class TypeboxSchemaValidator implements SchemaValidator<TUnionContainer, TIdiomaticSchema, TSchema> {
|
|
17
|
+
string: import("@sinclair/typebox").TString;
|
|
18
|
+
number: import("@sinclair/typebox").TNumber;
|
|
19
|
+
bigint: import("@sinclair/typebox").TBigInt;
|
|
20
|
+
boolean: import("@sinclair/typebox").TBoolean;
|
|
21
|
+
date: import("@sinclair/typebox").TDate;
|
|
22
|
+
symbol: import("@sinclair/typebox").TSymbol;
|
|
23
|
+
empty: TUnion<[import("@sinclair/typebox").TVoid, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TUndefined]>;
|
|
24
|
+
any: import("@sinclair/typebox").TAny;
|
|
25
|
+
unknown: import("@sinclair/typebox").TUnknown;
|
|
26
|
+
never: import("@sinclair/typebox").TNever;
|
|
27
|
+
/**
|
|
28
|
+
* Convert a schema to a TypeBox schema.
|
|
29
|
+
* @param {TIdiomaticSchema} schema - The schema to convert.
|
|
30
|
+
* @returns {TResolve<T>} The resolved schema.
|
|
31
|
+
*/
|
|
32
|
+
schemify<T extends TIdiomaticSchema>(schema: T): TResolve<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Make a schema optional.
|
|
35
|
+
* @param {TIdiomaticSchema} schema - The schema to make optional.
|
|
36
|
+
* @returns {TOptional<TResolve<T>>} The optional schema.
|
|
37
|
+
*/
|
|
38
|
+
optional<T extends TIdiomaticSchema>(schema: T): TOptional<TResolve<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Create an array schema.
|
|
41
|
+
* @param {TIdiomaticSchema} schema - The schema to use for array items.
|
|
42
|
+
* @returns {TArray<TResolve<T>>} The array schema.
|
|
43
|
+
*/
|
|
44
|
+
array<T extends TIdiomaticSchema>(schema: T): TArray<TResolve<T>>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a union schema.
|
|
47
|
+
* @param {TUnionContainer} schemas - The schemas to union.
|
|
48
|
+
* @returns {TUnion<UnionTResolve<T>>} The union schema.
|
|
49
|
+
*
|
|
50
|
+
* WARNING: If "empty" or TUndefined is included in the union, the key will still be expected.
|
|
51
|
+
* This is a limitation of TypeBox. Consider using "optional" instead.
|
|
52
|
+
*/
|
|
53
|
+
union<T extends TUnionContainer>(schemas: T): TUnion<UnionTResolve<T>>;
|
|
54
|
+
/**
|
|
55
|
+
* Create a literal schema.
|
|
56
|
+
* @param {LiteralSchema} value - The literal value.
|
|
57
|
+
* @returns {TLiteral<T>} The literal schema.
|
|
58
|
+
*/
|
|
59
|
+
literal<T extends LiteralSchema>(value: T): TLiteral<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Validate a value against a schema.
|
|
62
|
+
* @param {TSchema} schema - The schema to validate against.
|
|
63
|
+
* @param {unknown} value - The value to validate.
|
|
64
|
+
* @returns {boolean} True if valid, otherwise false.
|
|
65
|
+
*/
|
|
66
|
+
validate<T extends TSchema>(schema: T, value: unknown): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Convert a schema to an OpenAPI schema object.
|
|
69
|
+
* @param {TIdiomaticSchema | TSchema} schema - The schema to convert.
|
|
70
|
+
* @returns {SchemaObject} The OpenAPI schema object.
|
|
71
|
+
*/
|
|
72
|
+
openapi<T extends TIdiomaticSchema | TSchema>(schema: T): SchemaObject;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Factory function for creating a TypeboxSchemaValidator instance.
|
|
76
|
+
* @returns {TypeboxSchemaValidator} The TypeboxSchemaValidator instance.
|
|
77
|
+
*/
|
|
78
|
+
export declare const TypeboxSchema: () => TypeboxSchemaValidator;
|
|
79
|
+
declare const SchemaValidator: TypeboxSchemaValidator;
|
|
80
|
+
/**
|
|
81
|
+
* TypeBox schema definition for string type.
|
|
82
|
+
*/
|
|
83
|
+
export declare const string: typeof SchemaValidator.string;
|
|
84
|
+
/**
|
|
85
|
+
* TypeBox schema definition for number type.
|
|
86
|
+
*/
|
|
87
|
+
export declare const number: typeof SchemaValidator.number;
|
|
88
|
+
/**
|
|
89
|
+
* TypeBox schema definition for bigint type.
|
|
90
|
+
*/
|
|
91
|
+
export declare const bigint: typeof SchemaValidator.bigint;
|
|
92
|
+
/**
|
|
93
|
+
* TypeBox schema definition for boolean type.
|
|
94
|
+
*/
|
|
95
|
+
export declare const boolean: typeof SchemaValidator.boolean;
|
|
96
|
+
/**
|
|
97
|
+
* TypeBox schema definition for date type.
|
|
98
|
+
*/
|
|
99
|
+
export declare const date: typeof SchemaValidator.date;
|
|
100
|
+
/**
|
|
101
|
+
* TypeBox schema definition for symbol type.
|
|
102
|
+
*/
|
|
103
|
+
export declare const symbol: typeof SchemaValidator.symbol;
|
|
104
|
+
/**
|
|
105
|
+
* TypeBox schema definition for undefined, null, void types.
|
|
106
|
+
*/
|
|
107
|
+
export declare const empty: typeof SchemaValidator.empty;
|
|
108
|
+
/**
|
|
109
|
+
* TypeBox schema definition for any type.
|
|
110
|
+
*/
|
|
111
|
+
export declare const any: typeof SchemaValidator.any;
|
|
112
|
+
/**
|
|
113
|
+
* TypeBox schema definition for unknown type.
|
|
114
|
+
*/
|
|
115
|
+
export declare const unknown: typeof SchemaValidator.unknown;
|
|
116
|
+
/**
|
|
117
|
+
* TypeBox schema definition for never type.
|
|
118
|
+
*/
|
|
119
|
+
export declare const never: typeof SchemaValidator.never;
|
|
120
|
+
/**
|
|
121
|
+
* Transforms valid schema into TypeBox schema.
|
|
122
|
+
*/
|
|
123
|
+
export declare const schemify: typeof SchemaValidator.schemify;
|
|
124
|
+
/**
|
|
125
|
+
* Makes a valid schema optional.
|
|
126
|
+
*/
|
|
127
|
+
export declare const optional: typeof SchemaValidator.optional;
|
|
128
|
+
/**
|
|
129
|
+
* Defines an array for a valid schema.
|
|
130
|
+
*/
|
|
131
|
+
export declare const array: typeof SchemaValidator.array;
|
|
132
|
+
/**
|
|
133
|
+
* Defines a union for a valid schema.
|
|
134
|
+
*/
|
|
135
|
+
export declare const union: typeof SchemaValidator.union;
|
|
136
|
+
/**
|
|
137
|
+
* Defines a literal for a valid schema.
|
|
138
|
+
*/
|
|
139
|
+
export declare const literal: typeof SchemaValidator.literal;
|
|
140
|
+
/**
|
|
141
|
+
* Validates a value against a valid schema.
|
|
142
|
+
*/
|
|
143
|
+
export declare const validate: typeof SchemaValidator.validate;
|
|
144
|
+
/**
|
|
145
|
+
* Generates an OpenAPI schema object from a valid schema.
|
|
146
|
+
*/
|
|
147
|
+
export declare const openapi: typeof SchemaValidator.openapi;
|
|
148
|
+
export {};
|