@tsed/schema 8.33.0 → 8.35.0
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/esm/compat.js +8 -0
- package/lib/esm/components/index.js +37 -27
- package/lib/esm/components/{default → mappers/default}/anyMapper.js +5 -5
- package/lib/esm/components/{default → mappers/default}/classMapper.js +5 -5
- package/lib/esm/components/{default → mappers/default}/discriminatorMappingMapper.js +3 -3
- package/lib/esm/components/{default → mappers/default}/enumsMapper.js +2 -2
- package/lib/esm/components/{default → mappers/default}/genericsMapper.js +7 -6
- package/lib/esm/components/{default → mappers/default}/inheritedClassMapper.js +3 -3
- package/lib/esm/components/{default → mappers/default}/lazyRefMapper.js +3 -3
- package/lib/esm/components/{default → mappers/default}/mapMapper.js +2 -2
- package/lib/esm/components/{default → mappers/default}/nextMapper.js +16 -16
- package/lib/esm/components/{default → mappers/default}/nullableMapper.js +3 -3
- package/lib/esm/components/{default → mappers/default}/objectMapper.js +4 -4
- package/lib/esm/components/mappers/default/ofMapper.js +9 -0
- package/lib/esm/components/{default → mappers/default}/requiredMapper.js +3 -3
- package/lib/esm/components/{default → mappers/default}/schemaMapper.js +11 -6
- package/lib/esm/components/mappers/open-spec/discriminatorMappingMapper.js +8 -0
- package/lib/esm/components/mappers/open-spec/enumsMapper.js +12 -0
- package/lib/esm/components/{open-spec → mappers/open-spec}/generate.js +3 -4
- package/lib/esm/components/{open-spec → mappers/open-spec}/nullableMapper.js +3 -4
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationInFilesMapper.js +2 -2
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationInParameterMapper.js +3 -3
- package/lib/esm/components/mappers/open-spec/operationInParametersMapper.js +5 -0
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationInQueryMapper.js +3 -3
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationMapper.js +4 -4
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationMediaMapper.js +2 -2
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationRequestBodyMapper.js +4 -4
- package/lib/esm/components/{open-spec → mappers/open-spec}/operationResponseMapper.js +2 -2
- package/lib/esm/components/{open-spec → mappers/open-spec}/pathsMapper.js +10 -10
- package/lib/esm/{domain → components/stores}/JsonClassStore.js +8 -13
- package/lib/esm/{domain → components/stores}/JsonMethodStore.js +33 -28
- package/lib/esm/{domain → components/stores}/JsonParameterStore.js +14 -18
- package/lib/esm/{domain → components/stores}/JsonPropertyStore.js +15 -18
- package/lib/esm/components/types/arrayType.js +15 -0
- package/lib/esm/components/types/classType.js +8 -0
- package/lib/esm/components/types/genericType.js +8 -0
- package/lib/esm/components/types/mapType.js +15 -0
- package/lib/esm/components/types/primitiveType.js +21 -0
- package/lib/esm/components/types/setType.js +12 -0
- package/lib/esm/decorators/class/discriminatorValue.js +1 -1
- package/lib/esm/decorators/collections/collectionOf.js +2 -2
- package/lib/esm/decorators/collections/maxItems.js +1 -1
- package/lib/esm/decorators/collections/maxProperties.js +1 -1
- package/lib/esm/decorators/collections/minItems.js +1 -1
- package/lib/esm/decorators/collections/minProperties.js +1 -1
- package/lib/esm/decorators/collections/uniqueItems.js +1 -1
- package/lib/esm/decorators/common/defaultMsg.js +1 -1
- package/lib/esm/decorators/common/discriminatorKey.js +1 -1
- package/lib/esm/decorators/common/enum.js +1 -1
- package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
- package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
- package/lib/esm/decorators/common/format.js +1 -1
- package/lib/esm/decorators/common/jsonEntityFn.js +2 -2
- package/lib/esm/decorators/common/maxLength.js +1 -1
- package/lib/esm/decorators/common/maximum.js +1 -1
- package/lib/esm/decorators/common/minLength.js +1 -1
- package/lib/esm/decorators/common/minimum.js +1 -1
- package/lib/esm/decorators/common/multipleOf.js +1 -1
- package/lib/esm/decorators/common/name.js +1 -1
- package/lib/esm/decorators/common/nullable.js +2 -2
- package/lib/esm/decorators/common/pattern.js +1 -1
- package/lib/esm/decorators/common/required.js +1 -1
- package/lib/esm/decorators/common/requiredGroups.js +1 -1
- package/lib/esm/decorators/common/typeError.js +1 -1
- package/lib/esm/decorators/config/jsonEntityComponent.js +3 -2
- package/lib/esm/decorators/generics/genericOf.js +2 -2
- package/lib/esm/decorators/generics/generics.js +2 -3
- package/lib/esm/decorators/operations/consumes.js +1 -1
- package/lib/esm/decorators/operations/deprecated.js +1 -1
- package/lib/esm/decorators/operations/header.js +1 -1
- package/lib/esm/decorators/operations/in.js +5 -6
- package/lib/esm/decorators/operations/inFile.js +2 -2
- package/lib/esm/decorators/operations/operation.js +1 -1
- package/lib/esm/decorators/operations/produces.js +1 -1
- package/lib/esm/decorators/operations/publish.js +1 -1
- package/lib/esm/decorators/operations/returns.js +4 -4
- package/lib/esm/decorators/operations/route.js +1 -1
- package/lib/esm/decorators/operations/security.js +1 -1
- package/lib/esm/decorators/operations/subscribe.js +1 -1
- package/lib/esm/decorators/operations/tags.js +1 -1
- package/lib/esm/domain/DecoratorContext.js +2 -2
- package/lib/esm/domain/JsonEntityStore.js +7 -41
- package/lib/esm/domain/JsonLazyRef.js +1 -1
- package/lib/esm/domain/JsonMap.js +1 -1
- package/lib/esm/domain/JsonOperation.js +1 -1
- package/lib/esm/domain/JsonParameter.js +3 -3
- package/lib/esm/domain/JsonRequestBody.js +1 -1
- package/lib/esm/domain/JsonResponse.js +2 -2
- package/lib/esm/domain/JsonSchema.js +94 -131
- package/lib/esm/domain/index.js +26 -0
- package/lib/esm/{utils/getJsonSchema.js → fn/compile.js} +20 -7
- package/lib/esm/fn/enums.js +1 -1
- package/lib/esm/fn/from.js +32 -9
- package/lib/esm/fn/generic.js +9 -0
- package/lib/esm/fn/index.js +25 -4
- package/lib/esm/fn/lazyRef.js +3 -3
- package/lib/esm/fn/oas/compileSpec.js +9 -0
- package/lib/esm/{utils → fn/oas}/generateSpec.js +2 -2
- package/lib/esm/{utils → fn/oas}/getSpec.js +4 -4
- package/lib/esm/{utils → fn/oas}/getSpecType.js +1 -1
- package/lib/esm/{utils → fn/oas}/mapOpenSpec.js +1 -1
- package/lib/esm/hooks/alterOneOf.js +1 -1
- package/lib/esm/index.js +59 -48
- package/lib/esm/registries/JsonEntitiesContainer.js +38 -0
- package/lib/esm/registries/JsonSchemaMapperContainer.js +10 -1
- package/lib/esm/registries/JsonTypesContainer.js +18 -0
- package/lib/esm/utils/generics.js +15 -2
- package/lib/esm/utils/getInheritedStores.js +1 -1
- package/lib/esm/utils/getJsonType.js +2 -2
- package/lib/esm/utils/getOperationsRoutes.js +3 -3
- package/lib/esm/utils/getOperationsStores.js +4 -4
- package/lib/esm/utils/getPropertiesStores.js +2 -2
- package/lib/esm/utils/ref.js +2 -2
- package/lib/types/compat.d.ts +17 -0
- package/lib/types/components/index.d.ts +37 -27
- package/lib/types/components/{default → mappers/default}/anyMapper.d.ts +1 -1
- package/lib/types/components/mappers/default/classMapper.d.ts +3 -0
- package/lib/types/components/{default → mappers/default}/discriminatorMappingMapper.d.ts +2 -2
- package/lib/types/components/mappers/default/enumsMapper.d.ts +3 -0
- package/lib/types/components/{default → mappers/default}/genericsMapper.d.ts +2 -2
- package/lib/types/components/{default → mappers/default}/inheritedClassMapper.d.ts +1 -1
- package/lib/types/components/mappers/default/lazyRefMapper.d.ts +3 -0
- package/lib/types/components/{default → mappers/default}/mapMapper.d.ts +1 -1
- package/lib/types/components/{default → mappers/default}/nextMapper.d.ts +2 -2
- package/lib/types/components/{default → mappers/default}/nullableMapper.d.ts +1 -1
- package/lib/types/components/{default → mappers/default}/objectMapper.d.ts +1 -1
- package/lib/types/components/mappers/default/ofMapper.d.ts +3 -0
- package/lib/types/components/mappers/default/requiredMapper.d.ts +3 -0
- package/lib/types/components/mappers/default/schemaMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/enumsMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/generate.d.ts +1 -0
- package/lib/types/components/mappers/open-spec/nullableMapper.d.ts +3 -0
- package/lib/types/components/{open-spec → mappers/open-spec}/operationInParameterMapper.d.ts +3 -3
- package/lib/types/components/mappers/open-spec/operationInParametersMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/operationMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/operationMediaMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/operationRequestBodyMapper.d.ts +3 -0
- package/lib/types/components/mappers/open-spec/operationResponseMapper.d.ts +3 -0
- package/lib/types/components/{open-spec → mappers/open-spec}/pathsMapper.d.ts +1 -1
- package/lib/types/{domain → components/stores}/JsonClassStore.d.ts +4 -4
- package/lib/types/{domain → components/stores}/JsonMethodStore.d.ts +33 -19
- package/lib/types/{domain → components/stores}/JsonParameterStore.d.ts +9 -5
- package/lib/types/{domain → components/stores}/JsonPropertyStore.d.ts +7 -4
- package/lib/types/components/types/arrayType.d.ts +2 -0
- package/lib/types/components/types/classType.d.ts +2 -0
- package/lib/types/components/types/genericType.d.ts +2 -0
- package/lib/types/components/types/mapType.d.ts +2 -0
- package/lib/types/components/types/primitiveType.d.ts +2 -0
- package/lib/types/components/types/setType.d.ts +2 -0
- package/lib/types/decorators/common/any.d.ts +1 -1
- package/lib/types/decorators/common/examples.d.ts +1 -1
- package/lib/types/decorators/common/format.d.ts +1 -1
- package/lib/types/decorators/common/ignore.d.ts +1 -1
- package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
- package/lib/types/decorators/config/jsonEntityComponent.d.ts +2 -1
- package/lib/types/decorators/generics/genericOf.d.ts +1 -1
- package/lib/types/decorators/operations/header.d.ts +1 -1
- package/lib/types/decorators/operations/in.d.ts +1 -2
- package/lib/types/decorators/operations/location.d.ts +1 -1
- package/lib/types/decorators/operations/redirect.d.ts +1 -1
- package/lib/types/decorators/operations/returns.d.ts +3 -3
- package/lib/types/decorators/operations/status.d.ts +1 -1
- package/lib/types/domain/Generics.d.ts +6 -0
- package/lib/types/domain/JsonEntityStore.d.ts +8 -19
- package/lib/types/domain/JsonLazyRef.d.ts +1 -1
- package/lib/types/domain/JsonMap.d.ts +1 -1
- package/lib/types/domain/JsonMedia.d.ts +1 -1
- package/lib/types/domain/JsonOperation.d.ts +2 -2
- package/lib/types/domain/JsonOperationRoute.d.ts +3 -3
- package/lib/types/domain/JsonParameter.d.ts +3 -3
- package/lib/types/domain/JsonRequestBody.d.ts +1 -1
- package/lib/types/domain/JsonResponse.d.ts +1 -1
- package/lib/types/domain/JsonSchema.d.ts +28 -22
- package/lib/types/{interfaces → domain}/JsonSchemaOptions.d.ts +14 -6
- package/lib/types/domain/__fixtures__/inspectOperationsPaths.d.ts +1 -1
- package/lib/types/domain/index.d.ts +26 -0
- package/lib/types/domain/types.d.ts +1 -1
- package/lib/types/fn/any.d.ts +1 -1
- package/lib/types/fn/boolean.d.ts +1 -1
- package/lib/types/{utils → fn}/compile.d.ts +10 -3
- package/lib/types/fn/date.d.ts +3 -3
- package/lib/types/fn/email.d.ts +1 -1
- package/lib/types/fn/from.d.ts +31 -3
- package/lib/types/fn/generic.d.ts +10 -0
- package/lib/types/fn/index.d.ts +24 -3
- package/lib/types/fn/integer.d.ts +1 -1
- package/lib/types/fn/lazyRef.d.ts +1 -1
- package/lib/types/fn/number.d.ts +1 -1
- package/lib/types/fn/oas/compileSpec.d.ts +6 -0
- package/lib/types/{utils → fn/oas}/getSpec.d.ts +1 -1
- package/lib/types/{utils → fn/oas}/getSpecType.d.ts +1 -1
- package/lib/types/{utils → fn/oas}/transformToOS2.d.ts +1 -1
- package/lib/types/fn/object.d.ts +1 -1
- package/lib/types/fn/string.d.ts +1 -1
- package/lib/types/fn/uri.d.ts +1 -1
- package/lib/types/fn/url.d.ts +1 -1
- package/lib/types/hooks/alterOneOf.d.ts +1 -1
- package/lib/types/hooks/alterRequiredGroups.d.ts +1 -1
- package/lib/types/index.d.ts +59 -48
- package/lib/types/{utils/getJsonEntityStore.d.ts → registries/JsonEntitiesContainer.d.ts} +5 -10
- package/lib/types/registries/JsonSchemaMapperContainer.d.ts +7 -1
- package/lib/types/registries/JsonTypesContainer.d.ts +15 -0
- package/lib/types/registries/{enumRegistries.d.ts → enumRegistry.d.ts} +1 -1
- package/lib/types/utils/generics.d.ts +13 -5
- package/lib/types/utils/getInheritedStores.d.ts +1 -1
- package/lib/types/utils/getOperationsRoutes.d.ts +3 -3
- package/lib/types/utils/getOperationsStores.d.ts +1 -1
- package/lib/types/utils/getPropertiesStores.d.ts +1 -1
- package/lib/types/utils/mapHeaders.d.ts +1 -1
- package/lib/types/utils/operationIdFormatter.d.ts +1 -1
- package/lib/types/utils/ref.d.ts +1 -1
- package/lib/types/utils/removeHiddenOperation.d.ts +1 -1
- package/lib/types/utils/toJsonMapCollection.d.ts +1 -1
- package/package.json +19 -19
- package/vitest.setup.ts +6 -0
- package/lib/esm/components/default/ofMapper.js +0 -9
- package/lib/esm/components/open-spec/discriminatorMappingMapper.js +0 -6
- package/lib/esm/components/open-spec/enumsMapper.js +0 -14
- package/lib/esm/components/open-spec/operationInParametersMapper.js +0 -5
- package/lib/esm/utils/compile.js +0 -13
- package/lib/esm/utils/getJsonEntityStore.js +0 -13
- package/lib/types/components/default/classMapper.d.ts +0 -3
- package/lib/types/components/default/enumsMapper.d.ts +0 -3
- package/lib/types/components/default/lazyRefMapper.d.ts +0 -3
- package/lib/types/components/default/ofMapper.d.ts +0 -3
- package/lib/types/components/default/requiredMapper.d.ts +0 -3
- package/lib/types/components/default/schemaMapper.d.ts +0 -3
- package/lib/types/components/open-spec/enumsMapper.d.ts +0 -3
- package/lib/types/components/open-spec/nullableMapper.d.ts +0 -3
- package/lib/types/components/open-spec/operationInParametersMapper.d.ts +0 -3
- package/lib/types/components/open-spec/operationMapper.d.ts +0 -3
- package/lib/types/components/open-spec/operationMediaMapper.d.ts +0 -3
- package/lib/types/components/open-spec/operationRequestBodyMapper.d.ts +0 -3
- package/lib/types/components/open-spec/operationResponseMapper.d.ts +0 -3
- package/lib/types/utils/getJsonSchema.d.ts +0 -6
- package/lib/esm/{interfaces/IgnoreCallback.js → domain/Generics.js} +0 -0
- package/lib/esm/{interfaces/JsonHookContext.js → domain/IgnoreCallback.js} +0 -0
- package/lib/esm/{interfaces/JsonOpenSpec.js → domain/JsonHookContext.js} +0 -0
- package/lib/esm/{interfaces/JsonSchemaOptions.js → domain/JsonOpenSpec.js} +0 -0
- package/lib/{types/components/open-spec/discriminatorMappingMapper.d.ts → esm/domain/JsonSchemaOptions.js} +0 -0
- package/lib/esm/{utils → fn/oas}/mapOpenSpec2.js +0 -0
- package/lib/esm/{utils → fn/oas}/mapOpenSpec3.js +0 -0
- package/lib/esm/{utils → fn/oas}/mapOpenSpecInfo.js +0 -0
- package/lib/esm/{utils → fn/oas}/mergeSpec.js +0 -0
- package/lib/esm/{utils → fn/oas}/transformToOS2.js +0 -0
- package/lib/esm/registries/{enumRegistries.js → enumRegistry.js} +0 -0
- package/lib/types/components/{open-spec/generate.d.ts → mappers/open-spec/discriminatorMappingMapper.d.ts} +0 -0
- package/lib/types/components/{open-spec → mappers/open-spec}/operationInFilesMapper.d.ts +0 -0
- package/lib/types/components/{open-spec → mappers/open-spec}/operationInQueryMapper.d.ts +0 -0
- package/lib/types/{interfaces → domain}/IgnoreCallback.d.ts +0 -0
- package/lib/types/{interfaces → domain}/JsonHookContext.d.ts +0 -0
- package/lib/types/{interfaces → domain}/JsonOpenSpec.d.ts +0 -0
- package/lib/types/{utils → fn/oas}/generateSpec.d.ts +1 -1
- /package/lib/types/{utils → fn/oas}/mapOpenSpec.d.ts +0 -0
- /package/lib/types/{utils → fn/oas}/mapOpenSpec2.d.ts +0 -0
- /package/lib/types/{utils → fn/oas}/mapOpenSpec3.d.ts +0 -0
- /package/lib/types/{utils → fn/oas}/mapOpenSpecInfo.d.ts +0 -0
- /package/lib/types/{utils → fn/oas}/mergeSpec.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonEntityStore } from "
|
|
1
|
+
import { JsonEntityStore } from "../../domain/index.js";
|
|
2
2
|
import type { JsonMethodStore } from "./JsonMethodStore.js";
|
|
3
3
|
import type { JsonPropertyStore } from "./JsonPropertyStore.js";
|
|
4
4
|
/**
|
|
@@ -21,10 +21,10 @@ import type { JsonPropertyStore } from "./JsonPropertyStore.js";
|
|
|
21
21
|
*
|
|
22
22
|
* ```typescript
|
|
23
23
|
* // Get class store
|
|
24
|
-
* const classStore =
|
|
24
|
+
* const classStore = s.store(MyClass);
|
|
25
25
|
*
|
|
26
26
|
* // Access class schema
|
|
27
|
-
* const schema =
|
|
27
|
+
* const schema = s.get(MyClass);
|
|
28
28
|
*
|
|
29
29
|
* // Get all properties
|
|
30
30
|
* const properties = classStore.children;
|
|
@@ -83,5 +83,5 @@ export declare class JsonClassStore extends JsonEntityStore {
|
|
|
83
83
|
readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore>;
|
|
84
84
|
get path(): string;
|
|
85
85
|
set path(path: string);
|
|
86
|
-
|
|
86
|
+
build(): void;
|
|
87
87
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { JsonOperation } from "
|
|
5
|
-
import {
|
|
6
|
-
import { JsonSchema } from "
|
|
2
|
+
import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
|
|
3
|
+
import type { JsonClassStore } from "./JsonClassStore.js";
|
|
4
|
+
import { JsonOperation } from "../../domain/JsonOperation.js";
|
|
5
|
+
import type { JsonParameterStore } from "./JsonParameterStore.js";
|
|
6
|
+
import { JsonSchema } from "../../domain/JsonSchema.js";
|
|
7
7
|
/**
|
|
8
8
|
* Configuration options for view rendering.
|
|
9
9
|
*
|
|
@@ -41,7 +41,7 @@ export interface JsonRedirectOptions {
|
|
|
41
41
|
*
|
|
42
42
|
* ```typescript
|
|
43
43
|
* // Get method store
|
|
44
|
-
* const methodStore =
|
|
44
|
+
* const methodStore = getJsonEntityStore(MyController, "myMethod");
|
|
45
45
|
*
|
|
46
46
|
* // Access operation for OpenAPI
|
|
47
47
|
* const operation = methodStore.operation;
|
|
@@ -98,18 +98,11 @@ export declare class JsonMethodStore extends JsonEntityStore {
|
|
|
98
98
|
get acceptMimes(): string[];
|
|
99
99
|
set acceptMimes(mimes: string[]);
|
|
100
100
|
get parameters(): JsonParameterStore[];
|
|
101
|
-
get operationPaths(): Map<string, import("
|
|
101
|
+
get operationPaths(): Map<string, import("../../domain/JsonOperation.js").JsonMethodPath>;
|
|
102
102
|
get collectionType(): Type<any>;
|
|
103
103
|
set collectionType(type: Type<any>);
|
|
104
104
|
get isCollection(): boolean;
|
|
105
105
|
get schema(): JsonSchema;
|
|
106
|
-
/**
|
|
107
|
-
* Get an endpoint.
|
|
108
|
-
* @param target
|
|
109
|
-
* @param propertyKey
|
|
110
|
-
* @param descriptor
|
|
111
|
-
*/
|
|
112
|
-
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
|
|
113
106
|
/**
|
|
114
107
|
* TODO must be located on JsonOperation level directly
|
|
115
108
|
* @param status
|
|
@@ -123,13 +116,13 @@ export declare class JsonMethodStore extends JsonEntityStore {
|
|
|
123
116
|
/**
|
|
124
117
|
* Append middlewares to the beforeMiddlewares list.
|
|
125
118
|
* @param args
|
|
126
|
-
* @returns {
|
|
119
|
+
* @returns {JsonMethodStore}
|
|
127
120
|
*/
|
|
128
121
|
before(args: Function[]): this;
|
|
129
122
|
/**
|
|
130
123
|
* Append middlewares to the afterMiddlewares list.
|
|
131
124
|
* @param args
|
|
132
|
-
* @returns {
|
|
125
|
+
* @returns {JsonMethodStore}
|
|
133
126
|
*/
|
|
134
127
|
after(args: Function[]): this;
|
|
135
128
|
/**
|
|
@@ -145,12 +138,12 @@ export declare class JsonMethodStore extends JsonEntityStore {
|
|
|
145
138
|
*/
|
|
146
139
|
get<T = any>(key: any): T;
|
|
147
140
|
getParamTypes(): Record<string, boolean>;
|
|
148
|
-
|
|
141
|
+
build(): void;
|
|
149
142
|
}
|
|
150
143
|
/**
|
|
151
|
-
*
|
|
144
|
+
* JsonMethodStore contains metadata about a controller and his method.
|
|
152
145
|
* Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
|
|
153
|
-
*
|
|
146
|
+
* JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
|
|
154
147
|
*
|
|
155
148
|
* Example :
|
|
156
149
|
*
|
|
@@ -165,6 +158,27 @@ export declare class JsonMethodStore extends JsonEntityStore {
|
|
|
165
158
|
*```
|
|
166
159
|
*
|
|
167
160
|
* @alias JsonMethodStore
|
|
161
|
+
* @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
|
|
168
162
|
*/
|
|
169
163
|
export type EndpointMetadata = JsonMethodStore;
|
|
164
|
+
/**
|
|
165
|
+
* JsonMethodStore contains metadata about a controller and his method.
|
|
166
|
+
* Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
|
|
167
|
+
* JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
|
|
168
|
+
*
|
|
169
|
+
* Example :
|
|
170
|
+
*
|
|
171
|
+
*```ts
|
|
172
|
+
* @Controller("/my-path")
|
|
173
|
+
* provide MyClass {
|
|
174
|
+
*
|
|
175
|
+
* @Get("/")
|
|
176
|
+
* @Authenticated()
|
|
177
|
+
* public myMethod(){}
|
|
178
|
+
* }
|
|
179
|
+
*```
|
|
180
|
+
*
|
|
181
|
+
* @alias JsonMethodStore
|
|
182
|
+
* @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
|
|
183
|
+
*/
|
|
170
184
|
export declare const EndpointMetadata: typeof JsonMethodStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore, JsonEntityStoreOptions } from "
|
|
2
|
+
import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
|
|
3
3
|
import type { JsonMethodStore } from "./JsonMethodStore.js";
|
|
4
|
-
import { JsonParameter } from "
|
|
4
|
+
import { JsonParameter } from "../../domain/JsonParameter.js";
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for creating a JsonParameterStore.
|
|
7
7
|
*
|
|
@@ -128,19 +128,23 @@ export declare class JsonParameterStore extends JsonEntityStore {
|
|
|
128
128
|
get required(): boolean;
|
|
129
129
|
set required(value: boolean);
|
|
130
130
|
get allowedRequiredValues(): any[];
|
|
131
|
-
get schema(): import("
|
|
131
|
+
get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
|
|
132
132
|
static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
|
|
133
|
-
static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
|
|
134
133
|
/**
|
|
135
134
|
* Check precondition between value, required and allowedRequiredValues to know if the entity is required.
|
|
136
135
|
* @param value
|
|
137
136
|
* @returns {boolean}
|
|
138
137
|
*/
|
|
139
138
|
isRequired(value: any): boolean;
|
|
140
|
-
|
|
139
|
+
build(): void;
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
143
142
|
* @alias JsonParameterStore
|
|
143
|
+
* @deprecated
|
|
144
144
|
*/
|
|
145
145
|
export type ParamMetadata = JsonParameterStore;
|
|
146
|
+
/**
|
|
147
|
+
* @alias JsonParameterStore
|
|
148
|
+
* @deprecated
|
|
149
|
+
*/
|
|
146
150
|
export declare const ParamMetadata: typeof JsonParameterStore;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
1
|
import type { JsonClassStore } from "./JsonClassStore.js";
|
|
3
|
-
import { JsonEntityStore } from "
|
|
2
|
+
import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
|
|
4
3
|
/**
|
|
5
4
|
* Store for property metadata and schema information.
|
|
6
5
|
*
|
|
@@ -47,11 +46,15 @@ import { JsonEntityStore } from "./JsonEntityStore.js";
|
|
|
47
46
|
*/
|
|
48
47
|
export declare class JsonPropertyStore extends JsonEntityStore {
|
|
49
48
|
readonly parent: JsonClassStore;
|
|
50
|
-
|
|
51
|
-
protected build(): void;
|
|
49
|
+
build(): void;
|
|
52
50
|
}
|
|
53
51
|
/**
|
|
54
52
|
* @alias JsonPropertyStore
|
|
53
|
+
* @deprecated
|
|
55
54
|
*/
|
|
56
55
|
export type PropertyMetadata = JsonPropertyStore;
|
|
56
|
+
/**
|
|
57
|
+
* @alias JsonPropertyStore
|
|
58
|
+
* @deprecated
|
|
59
|
+
*/
|
|
57
60
|
export declare const PropertyMetadata: typeof JsonPropertyStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DecoratorParameters } from "@tsed/core";
|
|
2
|
-
import type { JsonEntityStore } from "../../domain/
|
|
2
|
+
import type { JsonEntityStore } from "../../domain/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
|
|
5
5
|
*
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DecoratorTypes, Type } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "../../domain/
|
|
2
|
+
import { JsonEntityStore } from "../../domain/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Declare a new JsonEntityStore class for a specific decorator type.
|
|
5
5
|
*
|
|
6
6
|
* @ignore
|
|
7
7
|
* @param type
|
|
8
8
|
* @decorator
|
|
9
|
+
* @deprecated
|
|
9
10
|
*/
|
|
10
11
|
export declare function JsonEntityComponent(type: DecoratorTypes): (target: Type<JsonEntityStore>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonHeader, JsonHeaders } from "../../
|
|
1
|
+
import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
|
|
2
2
|
/**
|
|
3
3
|
* Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter.
|
|
4
4
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonParameterTypes } from "../../domain/
|
|
3
|
-
import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
|
|
2
|
+
import { JsonParameterTypes, JsonSchema, JsonSchemaObject } from "../../domain/index.js";
|
|
4
3
|
export interface InChainedDecorators {
|
|
5
4
|
<T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
|
|
6
5
|
(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonHeader } from "../../
|
|
1
|
+
import { JsonHeader } from "../../domain/JsonOpenSpec.js";
|
|
2
2
|
/**
|
|
3
3
|
* Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code . If not specified, status defaults to “302 “Found”.
|
|
4
4
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { JsonSchema, JsonSchemaObject } from "../../domain/index.js";
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
3
|
+
import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
|
|
4
|
+
import { GenericValue } from "../../domain/Generics.js";
|
|
2
5
|
import { OS3Example } from "@tsed/openspec";
|
|
3
|
-
import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
|
|
4
|
-
import { JsonHeader, JsonHeaders } from "../../interfaces/JsonOpenSpec.js";
|
|
5
|
-
import { GenericValue } from "../../utils/generics.js";
|
|
6
6
|
export interface ReturnsChainedDecorators {
|
|
7
7
|
<T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
|
|
8
8
|
(target: Function): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JsonSchema } from "./JsonSchema.js";
|
|
2
|
+
import { Type } from "@tsed/core";
|
|
3
|
+
export type GenericValue = Type<any> | JsonSchema | String | Number | Boolean | Object | Date;
|
|
4
|
+
export type GenericsMap = Record<string, [GenericValue] | [GenericValue, GenericsMap]>;
|
|
5
|
+
export type GenericInputValue = GenericValue | [GenericValue, GenericInput];
|
|
6
|
+
export type GenericInput = Record<string, GenericInputValue>;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { DecoratorTypes, Store, Type } from "@tsed/core";
|
|
2
|
-
import type { JsonClassStore } from "
|
|
3
|
-
import type { JsonMethodStore } from "
|
|
4
|
-
import type { JsonParameterStore } from "
|
|
5
|
-
import type { JsonPropertyStore } from "
|
|
2
|
+
import type { JsonClassStore } from "../components/stores/JsonClassStore.js";
|
|
3
|
+
import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
|
|
4
|
+
import type { JsonParameterStore } from "../components/stores/JsonParameterStore.js";
|
|
5
|
+
import type { JsonPropertyStore } from "../components/stores/JsonPropertyStore.js";
|
|
6
6
|
import type { JsonSchema } from "./JsonSchema.js";
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export declare const JsonEntitiesContainer: Map<DecoratorTypes, Type<JsonEntityStore>>;
|
|
11
7
|
/**
|
|
12
8
|
* Configuration options for creating a JsonEntityStore.
|
|
13
9
|
*
|
|
@@ -54,13 +50,13 @@ export interface JsonEntityStoreOptions {
|
|
|
54
50
|
*
|
|
55
51
|
* ```typescript
|
|
56
52
|
* // Get store for a class
|
|
57
|
-
* const classStore =
|
|
53
|
+
* const classStore = getJsonEntityStore(MyClass);
|
|
58
54
|
*
|
|
59
55
|
* // Get store for a property
|
|
60
|
-
* const propStore =
|
|
56
|
+
* const propStore = getJsonEntityStore(MyClass, "propertyName");
|
|
61
57
|
*
|
|
62
58
|
* // Get store for a method parameter
|
|
63
|
-
* const paramStore =
|
|
59
|
+
* const paramStore = getJsonEntityStore(MyClass, "methodName", 0);
|
|
64
60
|
* ```
|
|
65
61
|
*
|
|
66
62
|
* ### Architecture
|
|
@@ -146,13 +142,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
|
|
|
146
142
|
get isDiscriminatorChild(): boolean;
|
|
147
143
|
get path(): string;
|
|
148
144
|
set path(path: string);
|
|
149
|
-
static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
|
|
150
|
-
static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
|
|
151
|
-
static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
|
|
152
|
-
static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
|
|
153
|
-
static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
|
|
154
|
-
static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
|
|
155
|
-
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: any): JsonEntityStore;
|
|
156
145
|
isGetterOnly(): boolean | undefined;
|
|
157
146
|
get<T = any>(key: string, defaultValue?: any): T;
|
|
158
147
|
set(key: string, value?: any): Store;
|
|
@@ -162,6 +151,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
|
|
|
162
151
|
is(input: DecoratorTypes.PROP): this is JsonPropertyStore;
|
|
163
152
|
is(input: DecoratorTypes.METHOD): this is JsonMethodStore;
|
|
164
153
|
is(input: DecoratorTypes.PARAM): this is JsonParameterStore;
|
|
165
|
-
|
|
154
|
+
abstract build(): void;
|
|
166
155
|
protected buildType(type: any): void;
|
|
167
156
|
}
|
|
@@ -37,6 +37,6 @@ export declare class JsonLazyRef {
|
|
|
37
37
|
readonly isLazyRef = true;
|
|
38
38
|
constructor(getType: () => Type<any>);
|
|
39
39
|
get target(): Type<any>;
|
|
40
|
-
get schema(): import("
|
|
40
|
+
get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
|
|
41
41
|
get name(): string;
|
|
42
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OS3MediaType } from "@tsed/openspec";
|
|
2
1
|
import { JsonMap } from "./JsonMap.js";
|
|
3
2
|
import { JsonSchema } from "./JsonSchema.js";
|
|
3
|
+
import { OS3MediaType } from "@tsed/openspec";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a media type definition for HTTP request or response bodies.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenSpecSecurity, OpenSpecTag
|
|
2
|
-
import { JsonHeader } from "
|
|
1
|
+
import { OS3Operation, OpenSpecSecurity, OpenSpecTag } from "@tsed/openspec";
|
|
2
|
+
import { JsonHeader } from "./JsonOpenSpec.js";
|
|
3
3
|
import { JsonMap } from "./JsonMap.js";
|
|
4
4
|
import { JsonParameter } from "./JsonParameter.js";
|
|
5
5
|
import { JsonResponse } from "./JsonResponse.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonMethodStore } from "./JsonMethodStore.js";
|
|
3
1
|
import { JsonMethodPath, JsonOperation } from "./JsonOperation.js";
|
|
2
|
+
import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
|
|
3
|
+
import { Type } from "@tsed/core";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a fully resolved HTTP route combining controller and method metadata.
|
|
6
6
|
*
|
|
@@ -69,7 +69,7 @@ export declare class JsonOperationRoute<Entity extends JsonMethodStore = JsonMet
|
|
|
69
69
|
get name(): string;
|
|
70
70
|
get className(): string;
|
|
71
71
|
get methodClassName(): string;
|
|
72
|
-
get parameters(): import("
|
|
72
|
+
get parameters(): import("@tsed/schema").JsonParameterStore[];
|
|
73
73
|
get propertyKey(): string;
|
|
74
74
|
get propertyName(): string;
|
|
75
75
|
get store(): import("@tsed/core").Store;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
1
|
+
import { OS3Example, OS3Parameter, OpenSpecHash, OpenSpecRef } from "@tsed/openspec";
|
|
3
2
|
import { JsonMap } from "./JsonMap.js";
|
|
4
3
|
import { JsonSchema } from "./JsonSchema.js";
|
|
4
|
+
import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
|
|
5
5
|
/**
|
|
6
6
|
* Represents an HTTP operation parameter for OpenAPI specifications.
|
|
7
7
|
*
|
|
@@ -25,7 +25,7 @@ import { JsonSchema } from "./JsonSchema.js";
|
|
|
25
25
|
* .in("path")
|
|
26
26
|
* .required(true)
|
|
27
27
|
* .description("The user identifier")
|
|
28
|
-
* .schema(
|
|
28
|
+
* .schema(s.string());
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* ### Key Features
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OS3MediaType, OS3Response } from "@tsed/openspec";
|
|
2
|
-
import { JsonHeader } from "
|
|
2
|
+
import { JsonHeader } from "./JsonOpenSpec.js";
|
|
3
3
|
import { JsonMap } from "./JsonMap.js";
|
|
4
4
|
import { JsonMedia } from "./JsonMedia.js";
|
|
5
5
|
import { JsonSchema } from "./JsonSchema.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Type, ValueOf } from "@tsed/core";
|
|
2
|
-
import { Hooks } from "@tsed/hooks";
|
|
3
|
-
import type { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version } from "json-schema";
|
|
4
|
-
import { VendorKeys } from "../constants/VendorKeys.js";
|
|
5
|
-
import { IgnoreCallback } from "../interfaces/IgnoreCallback.js";
|
|
6
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
7
|
-
import { type GenericsMap, GenericValue } from "../utils/generics.js";
|
|
8
1
|
import { AliasMap, AliasType } from "./JsonAliasMap.js";
|
|
2
|
+
import type { GenericValue, GenericsMap } from "./Generics.js";
|
|
3
|
+
import type { Infer, PropsToShape, SchemaKey, SchemaMerge, SchemaOmit, SchemaPartial, SchemaPick, UnionToIntersection } from "./types.js";
|
|
4
|
+
import type { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version } from "json-schema";
|
|
5
|
+
import { Type, ValueOf } from "@tsed/core";
|
|
9
6
|
import { Discriminator } from "./JsonDiscriminator.js";
|
|
7
|
+
import { Hooks } from "@tsed/hooks";
|
|
8
|
+
import { IgnoreCallback } from "./IgnoreCallback.js";
|
|
10
9
|
import { JsonFormatTypes } from "./JsonFormatTypes.js";
|
|
11
10
|
import { JsonLazyRef } from "./JsonLazyRef.js";
|
|
12
|
-
import
|
|
11
|
+
import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
|
|
12
|
+
import { VendorKeys } from "../constants/VendorKeys.js";
|
|
13
13
|
/**
|
|
14
14
|
* Extended JSON Schema object supporting TypeScript types and Ts.ED enhancements.
|
|
15
15
|
*
|
|
@@ -72,7 +72,7 @@ export type AnyJsonSchema<T = any> = JsonSchemaObject | JSONSchema7 | JsonSchema
|
|
|
72
72
|
* email: string;
|
|
73
73
|
* }
|
|
74
74
|
*
|
|
75
|
-
* const userSchema =
|
|
75
|
+
* const userSchema = s.from(User);
|
|
76
76
|
*
|
|
77
77
|
* // Generate JSON Schema output
|
|
78
78
|
* const jsonSchema = userSchema.toJSON();
|
|
@@ -223,22 +223,22 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
223
223
|
*
|
|
224
224
|
* ```typescript
|
|
225
225
|
* // From a class
|
|
226
|
-
* const schema1 =
|
|
226
|
+
* const schema1 = s.from(User);
|
|
227
227
|
*
|
|
228
228
|
* // From a primitive
|
|
229
|
-
* const schema2 =
|
|
229
|
+
* const schema2 = s.from(String);
|
|
230
230
|
*
|
|
231
231
|
* // From a schema object
|
|
232
|
-
* const schema3 =
|
|
232
|
+
* const schema3 = s.string().minLength(1);
|
|
233
233
|
*
|
|
234
234
|
* // From existing schema (no-op)
|
|
235
|
-
* const schema4 =
|
|
235
|
+
* const schema4 = s.from(schema1);
|
|
236
236
|
* ```
|
|
237
237
|
*
|
|
238
238
|
* @param item - The input to convert to a JsonSchema
|
|
239
239
|
* @returns A JsonSchema instance representing the input
|
|
240
|
+
* @deprecated
|
|
240
241
|
*/
|
|
241
|
-
static from(item: Partial<JsonSchemaObject> | Type<any> | JsonSchema | undefined): JsonSchema<JSONSchema7Type>;
|
|
242
242
|
static add<Keys extends keyof JsonSchema>(property: Keys, method: JsonSchema[Keys]): typeof JsonSchema;
|
|
243
243
|
/**
|
|
244
244
|
* Check if the schema has a property.
|
|
@@ -354,12 +354,16 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
354
354
|
* ```typescript
|
|
355
355
|
* // For Paginated<User>
|
|
356
356
|
* schema.genericOf([User]);
|
|
357
|
+
* schema.genericOf(User);
|
|
358
|
+
* schema.genericOf({T: [User]});
|
|
357
359
|
* ```
|
|
358
360
|
*
|
|
359
|
-
* @param generics -
|
|
361
|
+
* @param generics - Generic bindings to apply
|
|
360
362
|
* @returns This schema instance for method chaining
|
|
361
363
|
*/
|
|
362
|
-
genericOf(
|
|
364
|
+
genericOf(generics: GenericsMap): this;
|
|
365
|
+
genericOf(generic: GenericValue): this;
|
|
366
|
+
genericOf(...generics: Array<GenericValue[] | GenericValue>): this;
|
|
363
367
|
/**
|
|
364
368
|
* Mark this schema as nullable or non-nullable.
|
|
365
369
|
*
|
|
@@ -565,7 +569,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
565
569
|
* Set the items' schema for array/set collections
|
|
566
570
|
* @param items The schema for array/set items
|
|
567
571
|
*/
|
|
568
|
-
items<I = JSONSchema7Type>(items: JsonSchema<I> | AnyJsonSchema | AnyJsonSchema[]): JsonSchema<T extends Array<any> ? I[] : T extends Set<any> ? Set<I> : I>;
|
|
572
|
+
items<I = JSONSchema7Type>(items: JsonSchema<I> | AnyJsonSchema | AnyJsonSchema[], init?: boolean): JsonSchema<T extends Array<any> ? I[] : T extends Set<any> ? Set<I> : I>;
|
|
569
573
|
$comment(comment: string): this;
|
|
570
574
|
/**
|
|
571
575
|
* Must be a non-negative integer.
|
|
@@ -646,7 +650,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
646
650
|
* The default value is an empty schema that allows any value for additional properties.
|
|
647
651
|
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
|
|
648
652
|
*/
|
|
649
|
-
additionalProperties<V>(additionalProperties: boolean | AnyJsonSchema | JsonSchema<V
|
|
653
|
+
additionalProperties<V>(additionalProperties: boolean | AnyJsonSchema | JsonSchema<V>, init?: boolean): JsonSchema<Map<string, V>>;
|
|
650
654
|
/**
|
|
651
655
|
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
|
|
652
656
|
* If specified, the value MUST be a schema or a boolean.
|
|
@@ -787,7 +791,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
787
791
|
toObject(options?: JsonSchemaOptions): any;
|
|
788
792
|
toJSON(options?: JsonSchemaOptions): any;
|
|
789
793
|
assign(obj: Partial<JSONSchema7> | JsonSchema | Record<string, unknown>): this;
|
|
790
|
-
set(key: string, value: any): this;
|
|
794
|
+
set(key: string, value: any, force?: boolean): this;
|
|
791
795
|
/**
|
|
792
796
|
* Return the JSON type as string
|
|
793
797
|
*/
|
|
@@ -812,11 +816,13 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
|
|
|
812
816
|
getRefSchema(): JsonSchema<JSONSchema7Type> | undefined;
|
|
813
817
|
propertyKey(s: string): this;
|
|
814
818
|
getPropertyKey(): string | symbol | undefined;
|
|
815
|
-
target(target: any):
|
|
819
|
+
target(target: any): this;
|
|
816
820
|
isRequiredValue(property: string, value: any): boolean;
|
|
821
|
+
toCollection(): this;
|
|
822
|
+
unsetType(): this;
|
|
817
823
|
protected setManyOf(keyword: "oneOf" | "anyOf" | "allOf", value: (AnyJsonSchema | null)[]): this | undefined;
|
|
818
|
-
protected
|
|
819
|
-
protected
|
|
824
|
+
protected toSchema(item: any[]): JsonSchema[];
|
|
825
|
+
protected toSchema(item: any): JsonSchema;
|
|
820
826
|
protected mapGenerics(jsonSchema: unknown, generics: GenericValue[][]): GenericsMap;
|
|
821
827
|
protected mapProperties(properties: Record<string, any>): any;
|
|
822
828
|
}
|