typia 5.1.3 → 5.1.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/executable/TypiaSetupWizard.js +1 -19
- package/lib/executable/TypiaSetupWizard.js.map +1 -1
- package/package.json +1 -1
- package/src/executable/TypiaSetupWizard.ts +1 -16
- package/src/factories/MetadataCollection.ts +277 -277
- package/src/factories/MetadataFactory.ts +238 -238
- package/src/factories/MetadataTypeTagFactory.ts +325 -325
- package/src/factories/internal/metadata/emend_metadata_atomics.ts +41 -41
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +259 -259
- package/src/functional/$HeadersReader.ts +28 -28
- package/src/functional/$ParameterReader.ts +31 -31
- package/src/functional/$QueryReader.ts +56 -56
- package/src/functional/Namespace.ts +142 -142
- package/src/http.ts +1149 -1149
- package/src/json.ts +648 -648
- package/src/misc.ts +651 -651
- package/src/module.ts +657 -657
- package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
- package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -77
- package/src/programmers/http/HttpAssertQueryProgrammer.ts +77 -77
- package/src/programmers/http/HttpHeadersProgrammer.ts +339 -339
- package/src/programmers/http/HttpIsHeadersProgrammer.ts +87 -87
- package/src/programmers/http/HttpIsQueryProgrammer.ts +87 -87
- package/src/programmers/http/HttpParameterProgrammer.ts +104 -104
- package/src/programmers/http/HttpQueryProgrammer.ts +273 -273
- package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -77
- package/src/programmers/http/HttpValidateQueryProgrammer.ts +77 -77
- package/src/programmers/internal/application_boolean.ts +30 -30
- package/src/programmers/internal/application_number.ts +90 -90
- package/src/programmers/internal/application_schema.ts +180 -180
- package/src/programmers/internal/application_string.ts +54 -54
- package/src/programmers/internal/check_array_length.ts +44 -44
- package/src/programmers/internal/check_bigint.ts +48 -48
- package/src/programmers/internal/check_number.ts +108 -108
- package/src/programmers/internal/check_string.ts +48 -48
- package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +882 -882
- package/src/protobuf.ts +887 -887
- package/src/schemas/json/IJsonComponents.ts +34 -34
- package/src/schemas/json/IJsonSchema.ts +112 -112
- package/src/schemas/metadata/IMetadataConstant.ts +25 -25
- package/src/schemas/metadata/IMetadataTypeTag.ts +8 -8
- package/src/schemas/metadata/Metadata.ts +686 -686
- package/src/tags/Default.ts +15 -15
- package/src/tags/Format.ts +30 -30
- package/src/tags/Pattern.ts +9 -9
- package/src/tags/TagBase.ts +68 -68
- package/src/tags/index.ts +14 -14
- package/src/transformers/CallExpressionTransformer.ts +289 -289
- package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +12 -12
- package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +10 -10
- package/src/transformers/features/http/HttpAssertQueryTransformer.ts +10 -10
- package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
- package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
- package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
- package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
- package/src/transformers/features/http/HttpValidateQueryTransformer.ts +10 -10
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { IJsDocTagInfo } from "../metadata/IJsDocTagInfo";
|
|
2
|
-
|
|
3
|
-
import { IJsonSchema } from "./IJsonSchema";
|
|
4
|
-
|
|
5
|
-
export interface IJsonComponents {
|
|
6
|
-
schemas?: Record<string, IJsonComponents.IObject | IJsonComponents.IAlias>;
|
|
7
|
-
}
|
|
8
|
-
export namespace IJsonComponents {
|
|
9
|
-
export interface IObject {
|
|
10
|
-
$id?: string;
|
|
11
|
-
type: "object";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Only when swagger mode.
|
|
15
|
-
*/
|
|
16
|
-
nullable?: boolean;
|
|
17
|
-
|
|
18
|
-
properties: Record<string, IJsonSchema>;
|
|
19
|
-
patternProperties?: Record<string, IJsonSchema>;
|
|
20
|
-
additionalProperties?: IJsonSchema;
|
|
21
|
-
|
|
22
|
-
required?: string[];
|
|
23
|
-
description?: string;
|
|
24
|
-
"x-typia-jsDocTags"?: IJsDocTagInfo[];
|
|
25
|
-
"x-typia-patternProperties"?: Record<string, IJsonSchema>;
|
|
26
|
-
"x-typia-additionalProperties"?: IJsonSchema;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type IAlias = IJsonSchema & IIdentified;
|
|
30
|
-
interface IIdentified {
|
|
31
|
-
$id?: string;
|
|
32
|
-
$recursiveAnchor?: boolean;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
import { IJsDocTagInfo } from "../metadata/IJsDocTagInfo";
|
|
2
|
+
|
|
3
|
+
import { IJsonSchema } from "./IJsonSchema";
|
|
4
|
+
|
|
5
|
+
export interface IJsonComponents {
|
|
6
|
+
schemas?: Record<string, IJsonComponents.IObject | IJsonComponents.IAlias>;
|
|
7
|
+
}
|
|
8
|
+
export namespace IJsonComponents {
|
|
9
|
+
export interface IObject {
|
|
10
|
+
$id?: string;
|
|
11
|
+
type: "object";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Only when swagger mode.
|
|
15
|
+
*/
|
|
16
|
+
nullable?: boolean;
|
|
17
|
+
|
|
18
|
+
properties: Record<string, IJsonSchema>;
|
|
19
|
+
patternProperties?: Record<string, IJsonSchema>;
|
|
20
|
+
additionalProperties?: IJsonSchema;
|
|
21
|
+
|
|
22
|
+
required?: string[];
|
|
23
|
+
description?: string;
|
|
24
|
+
"x-typia-jsDocTags"?: IJsDocTagInfo[];
|
|
25
|
+
"x-typia-patternProperties"?: Record<string, IJsonSchema>;
|
|
26
|
+
"x-typia-additionalProperties"?: IJsonSchema;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type IAlias = IJsonSchema & IIdentified;
|
|
30
|
+
interface IIdentified {
|
|
31
|
+
$id?: string;
|
|
32
|
+
$recursiveAnchor?: boolean;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import { IJsDocTagInfo } from "../metadata/IJsDocTagInfo";
|
|
2
|
-
import { IMetadataTypeTag } from "../metadata/IMetadataTypeTag";
|
|
3
|
-
|
|
4
|
-
import { Atomic } from "../../typings/Atomic";
|
|
5
|
-
|
|
6
|
-
import { Type } from "../../tags/Type";
|
|
7
|
-
|
|
8
|
-
export type IJsonSchema = IJsonSchema.Known | IJsonSchema.IUnknown;
|
|
9
|
-
export namespace IJsonSchema {
|
|
10
|
-
export type Known =
|
|
11
|
-
| IEnumeration<"boolean">
|
|
12
|
-
| IEnumeration<"number">
|
|
13
|
-
| IEnumeration<"string">
|
|
14
|
-
| IBoolean
|
|
15
|
-
| IInteger
|
|
16
|
-
| INumber
|
|
17
|
-
| IString
|
|
18
|
-
| IArray
|
|
19
|
-
| ITuple
|
|
20
|
-
| IOneOf
|
|
21
|
-
| IReference
|
|
22
|
-
| INullOnly;
|
|
23
|
-
|
|
24
|
-
export interface IUnknown extends IAttribute {
|
|
25
|
-
type?: undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* -----------------------------------------------------------
|
|
29
|
-
ATOMICS
|
|
30
|
-
----------------------------------------------------------- */
|
|
31
|
-
export interface IEnumeration<
|
|
32
|
-
Literal extends Exclude<Atomic.Literal, "bigint">,
|
|
33
|
-
> extends Omit<IAtomic<Literal>, "x-typia-typeTags"> {
|
|
34
|
-
enum: Array<Atomic.Mapper[Literal]>;
|
|
35
|
-
}
|
|
36
|
-
export interface IAtomic<Literal extends Exclude<Atomic.Literal, "bigint">>
|
|
37
|
-
extends ISignificant<Literal> {
|
|
38
|
-
default?: Atomic.Mapper[Literal];
|
|
39
|
-
}
|
|
40
|
-
export interface IString extends IAtomic<"string"> {
|
|
41
|
-
minLength?: number & Type<"uint32">;
|
|
42
|
-
maxLength?: number & Type<"uint32">;
|
|
43
|
-
pattern?: string;
|
|
44
|
-
format?: string;
|
|
45
|
-
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
46
|
-
}
|
|
47
|
-
export interface INumber extends IAtomic<"number"> {
|
|
48
|
-
minimum?: number;
|
|
49
|
-
maximum?: number;
|
|
50
|
-
exclusiveMinimum?: boolean;
|
|
51
|
-
exclusiveMaximum?: boolean;
|
|
52
|
-
multipleOf?: number;
|
|
53
|
-
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
54
|
-
}
|
|
55
|
-
export interface IInteger extends IAtomic<"integer"> {
|
|
56
|
-
minimum?: number & Type<"int32">;
|
|
57
|
-
maximum?: number & Type<"int32">;
|
|
58
|
-
exclusiveMinimum?: boolean;
|
|
59
|
-
exclusiveMaximum?: boolean;
|
|
60
|
-
multipleOf?: number & Type<"int32">;
|
|
61
|
-
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
62
|
-
}
|
|
63
|
-
export interface IBoolean extends IAtomic<"boolean"> {
|
|
64
|
-
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* -----------------------------------------------------------
|
|
68
|
-
OBJECTS
|
|
69
|
-
----------------------------------------------------------- */
|
|
70
|
-
export interface IArray extends ISignificant<"array"> {
|
|
71
|
-
items: IJsonSchema;
|
|
72
|
-
minItems?: number & Type<"uint32">;
|
|
73
|
-
maxItems?: number & Type<"uint32">;
|
|
74
|
-
"x-typia-tuple"?: ITuple;
|
|
75
|
-
}
|
|
76
|
-
export interface ITuple extends ISignificant<"array"> {
|
|
77
|
-
items: IJsonSchema[];
|
|
78
|
-
minItems: number & Type<"uint32">;
|
|
79
|
-
maxItems?: number & Type<"uint32">;
|
|
80
|
-
}
|
|
81
|
-
export interface IReference extends IAttribute {
|
|
82
|
-
$ref: string;
|
|
83
|
-
}
|
|
84
|
-
export interface INullOnly extends IAttribute {
|
|
85
|
-
type: "null";
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* -----------------------------------------------------------
|
|
89
|
-
MISCELLANEOUS
|
|
90
|
-
----------------------------------------------------------- */
|
|
91
|
-
export interface IOneOf extends IAttribute {
|
|
92
|
-
oneOf: IJsonSchema[];
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface ISignificant<Literal extends string> extends IAttribute {
|
|
96
|
-
type: Literal;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Only when swagger mode.
|
|
100
|
-
*/
|
|
101
|
-
nullable?: boolean;
|
|
102
|
-
}
|
|
103
|
-
export interface IAttribute {
|
|
104
|
-
deprecated?: boolean;
|
|
105
|
-
title?: string;
|
|
106
|
-
description?: string;
|
|
107
|
-
"x-typia-jsDocTags"?: IJsDocTagInfo[];
|
|
108
|
-
"x-typia-required"?: boolean;
|
|
109
|
-
"x-typia-optional"?: boolean;
|
|
110
|
-
"x-typia-rest"?: boolean;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
1
|
+
import { IJsDocTagInfo } from "../metadata/IJsDocTagInfo";
|
|
2
|
+
import { IMetadataTypeTag } from "../metadata/IMetadataTypeTag";
|
|
3
|
+
|
|
4
|
+
import { Atomic } from "../../typings/Atomic";
|
|
5
|
+
|
|
6
|
+
import { Type } from "../../tags/Type";
|
|
7
|
+
|
|
8
|
+
export type IJsonSchema = IJsonSchema.Known | IJsonSchema.IUnknown;
|
|
9
|
+
export namespace IJsonSchema {
|
|
10
|
+
export type Known =
|
|
11
|
+
| IEnumeration<"boolean">
|
|
12
|
+
| IEnumeration<"number">
|
|
13
|
+
| IEnumeration<"string">
|
|
14
|
+
| IBoolean
|
|
15
|
+
| IInteger
|
|
16
|
+
| INumber
|
|
17
|
+
| IString
|
|
18
|
+
| IArray
|
|
19
|
+
| ITuple
|
|
20
|
+
| IOneOf
|
|
21
|
+
| IReference
|
|
22
|
+
| INullOnly;
|
|
23
|
+
|
|
24
|
+
export interface IUnknown extends IAttribute {
|
|
25
|
+
type?: undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* -----------------------------------------------------------
|
|
29
|
+
ATOMICS
|
|
30
|
+
----------------------------------------------------------- */
|
|
31
|
+
export interface IEnumeration<
|
|
32
|
+
Literal extends Exclude<Atomic.Literal, "bigint">,
|
|
33
|
+
> extends Omit<IAtomic<Literal>, "x-typia-typeTags"> {
|
|
34
|
+
enum: Array<Atomic.Mapper[Literal]>;
|
|
35
|
+
}
|
|
36
|
+
export interface IAtomic<Literal extends Exclude<Atomic.Literal, "bigint">>
|
|
37
|
+
extends ISignificant<Literal> {
|
|
38
|
+
default?: Atomic.Mapper[Literal];
|
|
39
|
+
}
|
|
40
|
+
export interface IString extends IAtomic<"string"> {
|
|
41
|
+
minLength?: number & Type<"uint32">;
|
|
42
|
+
maxLength?: number & Type<"uint32">;
|
|
43
|
+
pattern?: string;
|
|
44
|
+
format?: string;
|
|
45
|
+
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
46
|
+
}
|
|
47
|
+
export interface INumber extends IAtomic<"number"> {
|
|
48
|
+
minimum?: number;
|
|
49
|
+
maximum?: number;
|
|
50
|
+
exclusiveMinimum?: boolean;
|
|
51
|
+
exclusiveMaximum?: boolean;
|
|
52
|
+
multipleOf?: number;
|
|
53
|
+
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
54
|
+
}
|
|
55
|
+
export interface IInteger extends IAtomic<"integer"> {
|
|
56
|
+
minimum?: number & Type<"int32">;
|
|
57
|
+
maximum?: number & Type<"int32">;
|
|
58
|
+
exclusiveMinimum?: boolean;
|
|
59
|
+
exclusiveMaximum?: boolean;
|
|
60
|
+
multipleOf?: number & Type<"int32">;
|
|
61
|
+
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
62
|
+
}
|
|
63
|
+
export interface IBoolean extends IAtomic<"boolean"> {
|
|
64
|
+
"x-typia-typeTags"?: IMetadataTypeTag[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* -----------------------------------------------------------
|
|
68
|
+
OBJECTS
|
|
69
|
+
----------------------------------------------------------- */
|
|
70
|
+
export interface IArray extends ISignificant<"array"> {
|
|
71
|
+
items: IJsonSchema;
|
|
72
|
+
minItems?: number & Type<"uint32">;
|
|
73
|
+
maxItems?: number & Type<"uint32">;
|
|
74
|
+
"x-typia-tuple"?: ITuple;
|
|
75
|
+
}
|
|
76
|
+
export interface ITuple extends ISignificant<"array"> {
|
|
77
|
+
items: IJsonSchema[];
|
|
78
|
+
minItems: number & Type<"uint32">;
|
|
79
|
+
maxItems?: number & Type<"uint32">;
|
|
80
|
+
}
|
|
81
|
+
export interface IReference extends IAttribute {
|
|
82
|
+
$ref: string;
|
|
83
|
+
}
|
|
84
|
+
export interface INullOnly extends IAttribute {
|
|
85
|
+
type: "null";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* -----------------------------------------------------------
|
|
89
|
+
MISCELLANEOUS
|
|
90
|
+
----------------------------------------------------------- */
|
|
91
|
+
export interface IOneOf extends IAttribute {
|
|
92
|
+
oneOf: IJsonSchema[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ISignificant<Literal extends string> extends IAttribute {
|
|
96
|
+
type: Literal;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Only when swagger mode.
|
|
100
|
+
*/
|
|
101
|
+
nullable?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface IAttribute {
|
|
104
|
+
deprecated?: boolean;
|
|
105
|
+
title?: string;
|
|
106
|
+
description?: string;
|
|
107
|
+
"x-typia-jsDocTags"?: IJsDocTagInfo[];
|
|
108
|
+
"x-typia-required"?: boolean;
|
|
109
|
+
"x-typia-optional"?: boolean;
|
|
110
|
+
"x-typia-rest"?: boolean;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Atomic } from "../../typings/Atomic";
|
|
2
|
-
|
|
3
|
-
import { IMetadataTypeTag } from "./IMetadataTypeTag";
|
|
4
|
-
|
|
5
|
-
export type IMetadataConstant =
|
|
6
|
-
| IMetadataConstant.IBase<"boolean", boolean>
|
|
7
|
-
| IMetadataConstant.IBase<"number", number>
|
|
8
|
-
| IMetadataConstant.IBase<"string", string>
|
|
9
|
-
| IMetadataConstant.IBase<"bigint", bigint>;
|
|
10
|
-
export namespace IMetadataConstant {
|
|
11
|
-
export interface IBase<
|
|
12
|
-
Type extends Atomic.Literal,
|
|
13
|
-
Value extends Atomic.Type,
|
|
14
|
-
> {
|
|
15
|
-
type: Type;
|
|
16
|
-
values: Value[];
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
tags?: Type extends "boolean"
|
|
22
|
-
? IMetadataTypeTag[][] | undefined
|
|
23
|
-
: never;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
import { Atomic } from "../../typings/Atomic";
|
|
2
|
+
|
|
3
|
+
import { IMetadataTypeTag } from "./IMetadataTypeTag";
|
|
4
|
+
|
|
5
|
+
export type IMetadataConstant =
|
|
6
|
+
| IMetadataConstant.IBase<"boolean", boolean>
|
|
7
|
+
| IMetadataConstant.IBase<"number", number>
|
|
8
|
+
| IMetadataConstant.IBase<"string", string>
|
|
9
|
+
| IMetadataConstant.IBase<"bigint", bigint>;
|
|
10
|
+
export namespace IMetadataConstant {
|
|
11
|
+
export interface IBase<
|
|
12
|
+
Type extends Atomic.Literal,
|
|
13
|
+
Value extends Atomic.Type,
|
|
14
|
+
> {
|
|
15
|
+
type: Type;
|
|
16
|
+
values: Value[];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
tags?: Type extends "boolean"
|
|
22
|
+
? IMetadataTypeTag[][] | undefined
|
|
23
|
+
: never;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface IMetadataTypeTag {
|
|
2
|
-
target: "boolean" | "bigint" | "number" | "string" | "array";
|
|
3
|
-
name: string;
|
|
4
|
-
kind: string;
|
|
5
|
-
value: any;
|
|
6
|
-
validate: string | undefined;
|
|
7
|
-
exclusive: boolean | string[];
|
|
8
|
-
}
|
|
1
|
+
export interface IMetadataTypeTag {
|
|
2
|
+
target: "boolean" | "bigint" | "number" | "string" | "array";
|
|
3
|
+
name: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
value: any;
|
|
6
|
+
validate: string | undefined;
|
|
7
|
+
exclusive: boolean | string[];
|
|
8
|
+
}
|