@tsed/schema 6.95.9 → 6.96.2
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/cjs/domain/JsonSchema.js +17 -4
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +17 -4
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/package.json +5 -5
- package/lib/cjs/components/anyMapper.d.ts +0 -2
- package/lib/cjs/components/classMapper.d.ts +0 -3
- package/lib/cjs/components/genericsMapper.d.ts +0 -5
- package/lib/cjs/components/index.d.ts +0 -11
- package/lib/cjs/components/inheritedClassMapper.d.ts +0 -5
- package/lib/cjs/components/itemMapper.d.ts +0 -2
- package/lib/cjs/components/lazyRefMapper.d.ts +0 -3
- package/lib/cjs/components/mapMapper.d.ts +0 -9
- package/lib/cjs/components/objectMapper.d.ts +0 -8
- package/lib/cjs/components/ofMapper.d.ts +0 -3
- package/lib/cjs/components/propertiesMapper.d.ts +0 -3
- package/lib/cjs/components/schemaMapper.d.ts +0 -3
- package/lib/cjs/constants/httpMethods.d.ts +0 -12
- package/lib/cjs/constants/httpStatusMessages.d.ts +0 -272
- package/lib/cjs/decorators/class/children.d.ts +0 -11
- package/lib/cjs/decorators/collections/collectionContains.d.ts +0 -21
- package/lib/cjs/decorators/collections/collectionOf.d.ts +0 -101
- package/lib/cjs/decorators/collections/maxItems.d.ts +0 -47
- package/lib/cjs/decorators/collections/maxProperties.d.ts +0 -70
- package/lib/cjs/decorators/collections/minItems.d.ts +0 -51
- package/lib/cjs/decorators/collections/minProperties.d.ts +0 -69
- package/lib/cjs/decorators/collections/uniqueItems.d.ts +0 -50
- package/lib/cjs/decorators/common/additionalProperties.d.ts +0 -11
- package/lib/cjs/decorators/common/allOf.d.ts +0 -13
- package/lib/cjs/decorators/common/allow.d.ts +0 -28
- package/lib/cjs/decorators/common/any.d.ts +0 -38
- package/lib/cjs/decorators/common/anyOf.d.ts +0 -17
- package/lib/cjs/decorators/common/const.d.ts +0 -61
- package/lib/cjs/decorators/common/customKey.d.ts +0 -26
- package/lib/cjs/decorators/common/default.d.ts +0 -41
- package/lib/cjs/decorators/common/description.d.ts +0 -53
- package/lib/cjs/decorators/common/enum.d.ts +0 -98
- package/lib/cjs/decorators/common/example.d.ts +0 -11
- package/lib/cjs/decorators/common/examples.d.ts +0 -12
- package/lib/cjs/decorators/common/exclusiveMaximum.d.ts +0 -69
- package/lib/cjs/decorators/common/exclusiveMinimum.d.ts +0 -69
- package/lib/cjs/decorators/common/format.d.ts +0 -459
- package/lib/cjs/decorators/common/forwardGroups.d.ts +0 -10
- package/lib/cjs/decorators/common/groups.d.ts +0 -11
- package/lib/cjs/decorators/common/hidden.d.ts +0 -32
- package/lib/cjs/decorators/common/ignore.d.ts +0 -58
- package/lib/cjs/decorators/common/integer.d.ts +0 -61
- package/lib/cjs/decorators/common/jsonEntityFn.d.ts +0 -21
- package/lib/cjs/decorators/common/maxLength.d.ts +0 -76
- package/lib/cjs/decorators/common/maximum.d.ts +0 -138
- package/lib/cjs/decorators/common/minLength.d.ts +0 -77
- package/lib/cjs/decorators/common/minimum.d.ts +0 -136
- package/lib/cjs/decorators/common/multipleOf.d.ts +0 -68
- package/lib/cjs/decorators/common/name.d.ts +0 -32
- package/lib/cjs/decorators/common/nullable.d.ts +0 -25
- package/lib/cjs/decorators/common/oneOf.d.ts +0 -17
- package/lib/cjs/decorators/common/optional.d.ts +0 -10
- package/lib/cjs/decorators/common/pattern.d.ts +0 -93
- package/lib/cjs/decorators/common/property.d.ts +0 -11
- package/lib/cjs/decorators/common/readOnly.d.ts +0 -11
- package/lib/cjs/decorators/common/required.d.ts +0 -44
- package/lib/cjs/decorators/common/requiredGroups.d.ts +0 -10
- package/lib/cjs/decorators/common/schema.d.ts +0 -53
- package/lib/cjs/decorators/common/title.d.ts +0 -39
- package/lib/cjs/decorators/common/writeOnly.d.ts +0 -11
- package/lib/cjs/decorators/config/jsonEntityComponent.d.ts +0 -10
- package/lib/cjs/decorators/generics/genericOf.d.ts +0 -76
- package/lib/cjs/decorators/generics/generics.d.ts +0 -14
- package/lib/cjs/decorators/index.d.ts +0 -68
- package/lib/cjs/decorators/operations/consumes.d.ts +0 -19
- package/lib/cjs/decorators/operations/contentType.d.ts +0 -20
- package/lib/cjs/decorators/operations/deprecated.d.ts +0 -23
- package/lib/cjs/decorators/operations/header.d.ts +0 -49
- package/lib/cjs/decorators/operations/in.d.ts +0 -64
- package/lib/cjs/decorators/operations/inFile.d.ts +0 -25
- package/lib/cjs/decorators/operations/location.d.ts +0 -22
- package/lib/cjs/decorators/operations/operationId.d.ts +0 -10
- package/lib/cjs/decorators/operations/operationPath.d.ts +0 -21
- package/lib/cjs/decorators/operations/partial.d.ts +0 -10
- package/lib/cjs/decorators/operations/path.d.ts +0 -15
- package/lib/cjs/decorators/operations/produces.d.ts +0 -26
- package/lib/cjs/decorators/operations/redirect.d.ts +0 -52
- package/lib/cjs/decorators/operations/returns.d.ts +0 -253
- package/lib/cjs/decorators/operations/route.d.ts +0 -188
- package/lib/cjs/decorators/operations/security.d.ts +0 -23
- package/lib/cjs/decorators/operations/status.d.ts +0 -127
- package/lib/cjs/decorators/operations/summary.d.ts +0 -20
- package/lib/cjs/decorators/operations/tags.d.ts +0 -23
- package/lib/cjs/domain/DecoratorContext.d.ts +0 -28
- package/lib/cjs/domain/JsonAliasMap.d.ts +0 -12
- package/lib/cjs/domain/JsonClassStore.d.ts +0 -12
- package/lib/cjs/domain/JsonEntityStore.d.ts +0 -135
- package/lib/cjs/domain/JsonFormatTypes.d.ts +0 -17
- package/lib/cjs/domain/JsonLazyRef.d.ts +0 -11
- package/lib/cjs/domain/JsonMap.d.ts +0 -7
- package/lib/cjs/domain/JsonMethodStore.d.ts +0 -40
- package/lib/cjs/domain/JsonOperation.d.ts +0 -51
- package/lib/cjs/domain/JsonOperationPathsMap.d.ts +0 -7
- package/lib/cjs/domain/JsonOperationRoute.d.ts +0 -24
- package/lib/cjs/domain/JsonParameter.d.ts +0 -22
- package/lib/cjs/domain/JsonParameterStore.d.ts +0 -30
- package/lib/cjs/domain/JsonParameterTypes.d.ts +0 -16
- package/lib/cjs/domain/JsonPropertyStore.d.ts +0 -23
- package/lib/cjs/domain/JsonRequestBody.d.ts +0 -11
- package/lib/cjs/domain/JsonResponse.d.ts +0 -22
- package/lib/cjs/domain/JsonSchema.d.ts +0 -337
- package/lib/cjs/domain/SpecTypes.d.ts +0 -5
- package/lib/cjs/domain/index.d.ts +0 -16
- package/lib/cjs/hooks/alterIgnore.d.ts +0 -9
- package/lib/cjs/hooks/alterOneOf.d.ts +0 -3
- package/lib/cjs/hooks/alterRequiredGroups.d.ts +0 -6
- package/lib/cjs/index.d.ts +0 -20
- package/lib/cjs/interfaces/IgnoreCallback.d.ts +0 -4
- package/lib/cjs/interfaces/JsonHookContext.d.ts +0 -17
- package/lib/cjs/interfaces/JsonOpenSpec.d.ts +0 -9
- package/lib/cjs/interfaces/JsonSchemaOptions.d.ts +0 -26
- package/lib/cjs/interfaces/index.d.ts +0 -4
- package/lib/cjs/registries/JsonSchemaMapperContainer.d.ts +0 -19
- package/lib/cjs/utils/buildPath.d.ts +0 -6
- package/lib/cjs/utils/concatParameters.d.ts +0 -4
- package/lib/cjs/utils/concatPath.d.ts +0 -1
- package/lib/cjs/utils/defineStatusModel.d.ts +0 -3
- package/lib/cjs/utils/from.d.ts +0 -189
- package/lib/cjs/utils/generics.d.ts +0 -50
- package/lib/cjs/utils/getComputedType.d.ts +0 -5
- package/lib/cjs/utils/getInheritedStores.d.ts +0 -8
- package/lib/cjs/utils/getJsonEntityStore.d.ts +0 -15
- package/lib/cjs/utils/getJsonPathParameters.d.ts +0 -7
- package/lib/cjs/utils/getJsonSchema.d.ts +0 -4
- package/lib/cjs/utils/getJsonType.d.ts +0 -5
- package/lib/cjs/utils/getOperationsRoutes.d.ts +0 -8
- package/lib/cjs/utils/getOperationsStores.d.ts +0 -6
- package/lib/cjs/utils/getPropertiesStores.d.ts +0 -20
- package/lib/cjs/utils/getRequiredProperties.d.ts +0 -6
- package/lib/cjs/utils/getSpec.d.ts +0 -49
- package/lib/cjs/utils/isJsonClass.d.ts +0 -4
- package/lib/cjs/utils/isSuccessStatus.d.ts +0 -2
- package/lib/cjs/utils/mapHeaders.d.ts +0 -9
- package/lib/cjs/utils/mapNullableType.d.ts +0 -3
- package/lib/cjs/utils/mapRouteOptions.d.ts +0 -5
- package/lib/cjs/utils/matchGroups.d.ts +0 -4
- package/lib/cjs/utils/mergeOperation.d.ts +0 -17
- package/lib/cjs/utils/mergeSpec.d.ts +0 -23
- package/lib/cjs/utils/operationIdFormatter.d.ts +0 -4
- package/lib/cjs/utils/ref.d.ts +0 -14
- package/lib/cjs/utils/toJsonMapCollection.d.ts +0 -7
- package/lib/cjs/utils/toJsonRegex.d.ts +0 -5
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DecoratorParameters, DecoratorTypes } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
*/
|
|
6
|
-
export interface DecoratorActionHandler {
|
|
7
|
-
(ctx: Map<string, any>): void;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @ignore
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class DecoratorContext<T = any> extends Map<string, any> {
|
|
13
|
-
readonly methods: string[];
|
|
14
|
-
protected decoratorType: DecoratorTypes;
|
|
15
|
-
protected entity: JsonEntityStore;
|
|
16
|
-
protected actions: DecoratorActionHandler[];
|
|
17
|
-
constructor(opts?: any);
|
|
18
|
-
addAction(cb: DecoratorActionHandler): this;
|
|
19
|
-
build(): T;
|
|
20
|
-
toObject(): any;
|
|
21
|
-
getMergedKey(key: string, defaultValue: any): any;
|
|
22
|
-
protected bind(args: DecoratorParameters, decorator: any): void;
|
|
23
|
-
protected onInit(args: DecoratorParameters, decorator: any): void;
|
|
24
|
-
protected onMapKey(key: string, value: any): void;
|
|
25
|
-
protected runActions(): this;
|
|
26
|
-
protected beforeInit(): void;
|
|
27
|
-
protected afterInit(): void;
|
|
28
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ignore
|
|
3
|
-
*/
|
|
4
|
-
export declare type AliasType = string | number | symbol;
|
|
5
|
-
/**
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
export declare type AliasMap = Map<AliasType, AliasType>;
|
|
9
|
-
/**
|
|
10
|
-
* @ignore
|
|
11
|
-
*/
|
|
12
|
-
export declare function mapAliasedProperties(value: any, alias: AliasMap): any;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { JsonMethodStore } from "./JsonMethodStore";
|
|
2
|
-
import type { JsonPropertyStore } from "./JsonPropertyStore";
|
|
3
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
4
|
-
export declare class JsonClassStore extends JsonEntityStore {
|
|
5
|
-
/**
|
|
6
|
-
* List of children JsonEntityStore (properties or methods or params)
|
|
7
|
-
*/
|
|
8
|
-
readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore>;
|
|
9
|
-
get path(): string;
|
|
10
|
-
set path(path: string);
|
|
11
|
-
protected build(): void;
|
|
12
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { DecoratorTypes, Store, Type } from "@tsed/core";
|
|
2
|
-
import type { JsonSchema } from "./JsonSchema";
|
|
3
|
-
import type { JsonMethodStore } from "./JsonMethodStore";
|
|
4
|
-
import type { JsonClassStore } from "./JsonClassStore";
|
|
5
|
-
import type { JsonPropertyStore } from "./JsonPropertyStore";
|
|
6
|
-
import type { JsonParameterStore } from "./JsonParameterStore";
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export declare const JsonEntitiesContainer: Map<DecoratorTypes, Type<JsonEntityStore>>;
|
|
11
|
-
export interface JsonEntityStoreOptions {
|
|
12
|
-
decoratorType: DecoratorTypes;
|
|
13
|
-
target: Type<any>;
|
|
14
|
-
propertyKey?: string | symbol;
|
|
15
|
-
index?: number;
|
|
16
|
-
descriptor?: any;
|
|
17
|
-
type?: Type<any>;
|
|
18
|
-
collectionType?: Type<any>;
|
|
19
|
-
beforeMiddlewares?: Function[];
|
|
20
|
-
middlewares?: Function[];
|
|
21
|
-
afterMiddlewares?: Function[];
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
}
|
|
24
|
-
export declare abstract class JsonEntityStore implements JsonEntityStoreOptions {
|
|
25
|
-
/**
|
|
26
|
-
* Original property key decorated by the decorator
|
|
27
|
-
*/
|
|
28
|
-
readonly propertyKey: string | symbol;
|
|
29
|
-
/**
|
|
30
|
-
* Alias of the property
|
|
31
|
-
*/
|
|
32
|
-
readonly propertyName: string;
|
|
33
|
-
/**
|
|
34
|
-
* Parameter index
|
|
35
|
-
*/
|
|
36
|
-
readonly index: number;
|
|
37
|
-
/**
|
|
38
|
-
* Method's descriptor
|
|
39
|
-
*/
|
|
40
|
-
readonly descriptor: number;
|
|
41
|
-
/**
|
|
42
|
-
* Decorator type used to declare the JsonSchemaStore.
|
|
43
|
-
*/
|
|
44
|
-
readonly decoratorType: DecoratorTypes;
|
|
45
|
-
/**
|
|
46
|
-
* Type of the collection (Array, Map, Set, etc...)
|
|
47
|
-
*/
|
|
48
|
-
collectionType: Type<any>;
|
|
49
|
-
token: Type<any>;
|
|
50
|
-
readonly store: Store;
|
|
51
|
-
readonly isStore = true;
|
|
52
|
-
readonly parent: JsonEntityStore;
|
|
53
|
-
readonly target: Type<any>;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
protected _type: Type<any>;
|
|
58
|
-
/**
|
|
59
|
-
* Ref to JsonSchema
|
|
60
|
-
*/
|
|
61
|
-
protected _schema: JsonSchema;
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
constructor(options: JsonEntityStoreOptions);
|
|
64
|
-
/**
|
|
65
|
-
* Return the class name of the entity.
|
|
66
|
-
* @returns {string}
|
|
67
|
-
*/
|
|
68
|
-
get targetName(): string;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @returns {boolean}
|
|
72
|
-
*/
|
|
73
|
-
get isCollection(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @returns {boolean}
|
|
77
|
-
*/
|
|
78
|
-
get isArray(): boolean;
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @returns {boolean}
|
|
82
|
-
*/
|
|
83
|
-
get isPrimitive(): boolean;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @returns {boolean}
|
|
87
|
-
*/
|
|
88
|
-
get isDate(): boolean;
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @returns {boolean}
|
|
92
|
-
*/
|
|
93
|
-
get isObject(): boolean;
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
get isClass(): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Return the JsonSchema
|
|
100
|
-
*/
|
|
101
|
-
get schema(): JsonSchema;
|
|
102
|
-
get nestedGenerics(): Type<any>[][];
|
|
103
|
-
set nestedGenerics(nestedGenerics: Type<any>[][]);
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @returns {Type<any>}
|
|
107
|
-
*/
|
|
108
|
-
get type(): Type<any> | any;
|
|
109
|
-
/**
|
|
110
|
-
* Get original type without transformation
|
|
111
|
-
* @param value
|
|
112
|
-
*/
|
|
113
|
-
set type(value: Type<any> | any);
|
|
114
|
-
/**
|
|
115
|
-
* Return the itemSchema computed type. if the type is a function used for recursive model, the function will be called to
|
|
116
|
-
* get the right type.
|
|
117
|
-
*/
|
|
118
|
-
get computedType(): any;
|
|
119
|
-
get itemSchema(): JsonSchema;
|
|
120
|
-
get parentSchema(): JsonSchema;
|
|
121
|
-
/**
|
|
122
|
-
*
|
|
123
|
-
* @param target
|
|
124
|
-
*/
|
|
125
|
-
static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
|
|
126
|
-
static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
|
|
127
|
-
static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
|
|
128
|
-
static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
|
|
129
|
-
static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
|
|
130
|
-
static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
|
|
131
|
-
get<T = any>(key: string, defaultValue?: any): T;
|
|
132
|
-
set(key: string, value?: any): Store;
|
|
133
|
-
protected abstract build(): void;
|
|
134
|
-
protected buildType(type: any): void;
|
|
135
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare enum JsonFormatTypes {
|
|
2
|
-
DATE_TIME = "date-time",
|
|
3
|
-
DATE = "date",
|
|
4
|
-
TIME = "time",
|
|
5
|
-
EMAIL = "email",
|
|
6
|
-
HOSTNAME = "hostname",
|
|
7
|
-
IPV4 = "ipv4",
|
|
8
|
-
IPV6 = "ipv6",
|
|
9
|
-
URI = "uri",
|
|
10
|
-
URL = "url",
|
|
11
|
-
URI_REF = "uri-reference",
|
|
12
|
-
URI_TEMPLATE = "uri-template",
|
|
13
|
-
JSON_POINTER = "json-pointer",
|
|
14
|
-
RELATIVE_JSON_POINTER = "relative-json-pointer",
|
|
15
|
-
UUID = "uuid",
|
|
16
|
-
REGEX = "regex"
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
|
-
export declare class JsonLazyRef {
|
|
4
|
-
readonly getType: () => Type<any>;
|
|
5
|
-
readonly isLazyRef = true;
|
|
6
|
-
constructor(getType: () => Type<any>);
|
|
7
|
-
get target(): Type<any>;
|
|
8
|
-
get schema(): import("./JsonSchema").JsonSchema;
|
|
9
|
-
get name(): string;
|
|
10
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
11
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore";
|
|
2
|
-
import { JsonOperation } from "./JsonOperation";
|
|
3
|
-
import type { JsonParameterStore } from "./JsonParameterStore";
|
|
4
|
-
import type { JsonClassStore } from "./JsonClassStore";
|
|
5
|
-
export declare class JsonMethodStore extends JsonEntityStore {
|
|
6
|
-
readonly parent: JsonClassStore;
|
|
7
|
-
middlewares: any[];
|
|
8
|
-
beforeMiddlewares: any[];
|
|
9
|
-
afterMiddlewares: any[];
|
|
10
|
-
constructor(options: JsonEntityStoreOptions);
|
|
11
|
-
/**
|
|
12
|
-
* Ref to JsonOperation when the decorated object is a method.
|
|
13
|
-
*/
|
|
14
|
-
readonly operation: JsonOperation;
|
|
15
|
-
/**
|
|
16
|
-
* List of children JsonEntityStore (properties or methods or params)
|
|
17
|
-
*/
|
|
18
|
-
readonly children: Map<string | number, JsonParameterStore>;
|
|
19
|
-
get parameters(): JsonParameterStore[];
|
|
20
|
-
get operationPaths(): Map<string, import("./JsonOperation").JsonMethodPath>;
|
|
21
|
-
getResponseOptions(status: number, contentType?: string): undefined | any;
|
|
22
|
-
protected build(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Append middlewares to the beforeMiddlewares list.
|
|
25
|
-
* @param args
|
|
26
|
-
* @returns {EndpointMetadata}
|
|
27
|
-
*/
|
|
28
|
-
before(args: Function[]): this;
|
|
29
|
-
/**
|
|
30
|
-
* Append middlewares to the afterMiddlewares list.
|
|
31
|
-
* @param args
|
|
32
|
-
* @returns {EndpointMetadata}
|
|
33
|
-
*/
|
|
34
|
-
after(args: Function[]): this;
|
|
35
|
-
/**
|
|
36
|
-
* Store all arguments collected via Annotation.
|
|
37
|
-
* @param args
|
|
38
|
-
*/
|
|
39
|
-
use(args: Function[]): this;
|
|
40
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { OpenSpecSecurity, OpenSpecTag, OS3Operation } from "@tsed/openspec";
|
|
2
|
-
import { JsonHeader, JsonSchemaOptions } from "../interfaces";
|
|
3
|
-
import { JsonMap } from "./JsonMap";
|
|
4
|
-
import { JsonParameter } from "./JsonParameter";
|
|
5
|
-
import { JsonResponse } from "./JsonResponse";
|
|
6
|
-
import { JsonSchema } from "./JsonSchema";
|
|
7
|
-
export interface JsonMethodPath {
|
|
8
|
-
path: string | RegExp;
|
|
9
|
-
method: string;
|
|
10
|
-
isFinal?: boolean;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
export interface JsonOperationOptions extends OS3Operation<JsonSchema, JsonParameter, JsonMap<JsonResponse>> {
|
|
14
|
-
consumes: string[];
|
|
15
|
-
produces: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare class JsonOperation extends JsonMap<JsonOperationOptions> {
|
|
18
|
-
#private;
|
|
19
|
-
readonly operationPaths: Map<string, JsonMethodPath>;
|
|
20
|
-
constructor(obj?: Partial<JsonOperationOptions>);
|
|
21
|
-
get response(): JsonResponse | undefined;
|
|
22
|
-
get status(): number;
|
|
23
|
-
tags(tags: OpenSpecTag[]): this;
|
|
24
|
-
addTags(tags: OpenSpecTag[]): this;
|
|
25
|
-
summary(summary: string): this;
|
|
26
|
-
operationId(operationId: string): this;
|
|
27
|
-
responses(responses: JsonMap<any>): this;
|
|
28
|
-
defaultStatus(status: number): this;
|
|
29
|
-
getStatus(): number;
|
|
30
|
-
setRedirection(status?: number): this;
|
|
31
|
-
isRedirection(status?: number): boolean | 0;
|
|
32
|
-
addResponse(statusCode: string | number, response: JsonResponse): this;
|
|
33
|
-
getResponses(): JsonMap<JsonResponse>;
|
|
34
|
-
getResponseOf(status: number | string): JsonResponse;
|
|
35
|
-
ensureResponseOf(status: number | string): JsonResponse;
|
|
36
|
-
getHeadersOf(status: number): Record<string, JsonHeader & {
|
|
37
|
-
example: string;
|
|
38
|
-
}>;
|
|
39
|
-
getContentTypeOf(status: number): any;
|
|
40
|
-
security(security: OpenSpecSecurity): this;
|
|
41
|
-
addSecurityScopes(name: string, scopes: string[]): this;
|
|
42
|
-
description(description: string): this;
|
|
43
|
-
deprecated(deprecated: boolean): this;
|
|
44
|
-
parameters(parameters: JsonParameter[]): this;
|
|
45
|
-
addParameter(index: number, parameter: JsonParameter): void;
|
|
46
|
-
consumes(consumes: string[]): this;
|
|
47
|
-
produces(produces: string[]): this;
|
|
48
|
-
addProduce(produce: string): void;
|
|
49
|
-
addOperationPath(method: string, path: string | RegExp, options?: any): this;
|
|
50
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
51
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JsonMethodPath } from "./JsonOperation";
|
|
2
|
-
export declare class JsonOperationPathsMap extends Map<string, JsonMethodPath> {
|
|
3
|
-
setOperationPath(operationPath: JsonMethodPath): void;
|
|
4
|
-
protected getKey: (method: string, path: any) => string;
|
|
5
|
-
protected updateFinalRouteState(key: string): void;
|
|
6
|
-
protected setFinalRoute(key: string, operationPath: JsonMethodPath): void;
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonMethodPath, JsonOperation } from "./JsonOperation";
|
|
3
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
4
|
-
export declare class JsonOperationRoute<Entity extends JsonEntityStore = JsonEntityStore> {
|
|
5
|
-
readonly token: Type<any>;
|
|
6
|
-
readonly endpoint: Entity;
|
|
7
|
-
readonly operationPath?: JsonMethodPath;
|
|
8
|
-
readonly basePath?: string;
|
|
9
|
-
constructor(options: Partial<JsonOperationRoute>);
|
|
10
|
-
get url(): string;
|
|
11
|
-
get path(): string | RegExp | undefined;
|
|
12
|
-
get fullPath(): string;
|
|
13
|
-
get method(): string;
|
|
14
|
-
get isFinal(): boolean;
|
|
15
|
-
get name(): string;
|
|
16
|
-
get className(): string;
|
|
17
|
-
get methodClassName(): string;
|
|
18
|
-
get parameters(): any;
|
|
19
|
-
get propertyKey(): string;
|
|
20
|
-
get propertyName(): string;
|
|
21
|
-
get store(): import("@tsed/core").Store;
|
|
22
|
-
get operation(): JsonOperation;
|
|
23
|
-
get operationId(): any;
|
|
24
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter } from "@tsed/openspec";
|
|
3
|
-
import { JsonSchemaOptions } from "../interfaces";
|
|
4
|
-
import { NestedGenerics } from "../utils/generics";
|
|
5
|
-
import { JsonMap } from "./JsonMap";
|
|
6
|
-
import { JsonSchema } from "./JsonSchema";
|
|
7
|
-
export declare class JsonParameter extends JsonMap<OS3Parameter<JsonSchema>> implements NestedGenerics {
|
|
8
|
-
nestedGenerics: Type<any>[][];
|
|
9
|
-
groups: string[];
|
|
10
|
-
$schema: JsonSchema;
|
|
11
|
-
expression: string;
|
|
12
|
-
getName(): any;
|
|
13
|
-
name(name: string): this;
|
|
14
|
-
examples(examples: OpenSpecHash<OS3Example | OpenSpecRef>): this;
|
|
15
|
-
description(description: string): this;
|
|
16
|
-
in(inType: string, expression?: string | any): this;
|
|
17
|
-
required(required: boolean): this;
|
|
18
|
-
schema(schema: JsonSchema): this;
|
|
19
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
20
|
-
private build;
|
|
21
|
-
private refToParameters;
|
|
22
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
3
|
-
import type { JsonMethodStore } from "./JsonMethodStore";
|
|
4
|
-
import { JsonParameter } from "./JsonParameter";
|
|
5
|
-
import { JsonSchema } from "./JsonSchema";
|
|
6
|
-
export declare class JsonParameterStore extends JsonEntityStore {
|
|
7
|
-
/**
|
|
8
|
-
* Ref to JsonParameter when the decorated object is a parameter.
|
|
9
|
-
*/
|
|
10
|
-
readonly parameter: JsonParameter;
|
|
11
|
-
readonly parent: JsonMethodStore;
|
|
12
|
-
get nestedGenerics(): Type<any>[][];
|
|
13
|
-
set nestedGenerics(nestedGenerics: Type<any>[][]);
|
|
14
|
-
/**
|
|
15
|
-
* Return the required state.
|
|
16
|
-
* @returns {boolean}
|
|
17
|
-
*/
|
|
18
|
-
get required(): boolean;
|
|
19
|
-
set required(value: boolean);
|
|
20
|
-
get allowedRequiredValues(): any[];
|
|
21
|
-
static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
|
|
22
|
-
/**
|
|
23
|
-
* Check precondition between value, required and allowedRequiredValues to know if the entity is required.
|
|
24
|
-
* @param value
|
|
25
|
-
* @returns {boolean}
|
|
26
|
-
*/
|
|
27
|
-
isRequired(value: any): boolean;
|
|
28
|
-
protected getSchema(type: any): JsonSchema;
|
|
29
|
-
protected build(): void;
|
|
30
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare enum JsonParameterTypes {
|
|
2
|
-
BODY = "body",
|
|
3
|
-
PATH = "path",
|
|
4
|
-
QUERY = "query",
|
|
5
|
-
HEADER = "header",
|
|
6
|
-
COOKIES = "cookie",
|
|
7
|
-
FILES = "files"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @ignore
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatParameterType(type: any): any;
|
|
13
|
-
/**
|
|
14
|
-
* @ignore
|
|
15
|
-
*/
|
|
16
|
-
export declare function isParameterType(type: string): boolean;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
2
|
-
import type { JsonClassStore } from "./JsonClassStore";
|
|
3
|
-
export declare class JsonPropertyStore extends JsonEntityStore {
|
|
4
|
-
readonly parent: JsonClassStore;
|
|
5
|
-
/**
|
|
6
|
-
* Return the required state.
|
|
7
|
-
* @returns {boolean}
|
|
8
|
-
*/
|
|
9
|
-
get required(): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Change the state of the required data.
|
|
12
|
-
* @param value
|
|
13
|
-
*/
|
|
14
|
-
set required(value: boolean);
|
|
15
|
-
get allowedRequiredValues(): any[];
|
|
16
|
-
/**
|
|
17
|
-
* Check precondition between value, required and allowedRequiredValues to know if the entity is required.
|
|
18
|
-
* @param value
|
|
19
|
-
* @returns {boolean}
|
|
20
|
-
*/
|
|
21
|
-
isRequired(value: any): boolean;
|
|
22
|
-
protected build(): void;
|
|
23
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OpenSpecHash, OS3MediaType, OS3RequestBody } from "@tsed/openspec";
|
|
2
|
-
import { JsonMap } from "./JsonMap";
|
|
3
|
-
import { JsonSchema } from "./JsonSchema";
|
|
4
|
-
export declare type JsonRequestBodyOptions = OS3RequestBody<JsonSchema>;
|
|
5
|
-
export declare class JsonRequestBody extends JsonMap<JsonRequestBodyOptions> {
|
|
6
|
-
constructor(obj?: Partial<JsonRequestBodyOptions>);
|
|
7
|
-
description(description: string): this;
|
|
8
|
-
content(content: OpenSpecHash<OS3MediaType<JsonSchema>>): this;
|
|
9
|
-
addContent(mediaType: string, schema: JsonSchema): this;
|
|
10
|
-
required(required: boolean): this;
|
|
11
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { OS3MediaType, OS3Response } from "@tsed/openspec";
|
|
2
|
-
import { JsonHeader, JsonSchemaOptions } from "../interfaces";
|
|
3
|
-
import { JsonMap } from "./JsonMap";
|
|
4
|
-
import { JsonSchema } from "./JsonSchema";
|
|
5
|
-
export declare type JsonResponseOptions = OS3Response<JsonSchema, string | JsonHeader>;
|
|
6
|
-
export declare class JsonMedia extends JsonMap<OS3MediaType<JsonSchema>> {
|
|
7
|
-
groups: string[];
|
|
8
|
-
schema(schema: JsonSchema): this;
|
|
9
|
-
examples(examples: any): this;
|
|
10
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
11
|
-
}
|
|
12
|
-
export declare class JsonResponse extends JsonMap<JsonResponseOptions> {
|
|
13
|
-
status: number;
|
|
14
|
-
constructor(obj?: Partial<JsonResponseOptions>);
|
|
15
|
-
description(description: string): this;
|
|
16
|
-
headers(headers: Record<string, string | JsonHeader>): this;
|
|
17
|
-
content(content: Record<string, OS3MediaType<JsonSchema>>): this;
|
|
18
|
-
getContent(): JsonMap<JsonMedia>;
|
|
19
|
-
getMedia(mediaType: string, create?: boolean): JsonMedia;
|
|
20
|
-
addMedia(mediaType: string): this;
|
|
21
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
22
|
-
}
|