@tsed/schema 7.34.1 → 7.34.3
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/.barrelsby.json +5 -0
- package/jest.config.js +3 -3
- package/lib/browser/schema.umd.min.js +1 -1
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/anyMapper.js +3 -2
- package/lib/cjs/components/anyMapper.js.map +1 -1
- package/lib/cjs/components/index.js +27 -0
- package/lib/cjs/components/index.js.map +1 -0
- package/lib/cjs/components/lazyRefMapper.js +7 -7
- package/lib/cjs/components/lazyRefMapper.js.map +1 -1
- package/lib/cjs/components/mapMapper.js +1 -1
- package/lib/cjs/components/mapMapper.js.map +1 -1
- package/lib/cjs/components/operationInFilesMapper.js +28 -0
- package/lib/cjs/components/operationInFilesMapper.js.map +1 -0
- package/lib/cjs/components/operationInParameterMapper.js +39 -0
- package/lib/cjs/components/operationInParameterMapper.js.map +1 -0
- package/lib/cjs/components/operationInParametersMapper.js +10 -0
- package/lib/cjs/components/operationInParametersMapper.js.map +1 -0
- package/lib/cjs/components/operationInQueryMapper.js +39 -0
- package/lib/cjs/components/operationInQueryMapper.js.map +1 -0
- package/lib/cjs/components/operationMapper.js +49 -0
- package/lib/cjs/components/operationMapper.js.map +1 -0
- package/lib/cjs/components/operationMediaMapper.js +11 -0
- package/lib/cjs/components/operationMediaMapper.js.map +1 -0
- package/lib/cjs/components/operationRequestBodyMapper.js +57 -0
- package/lib/cjs/components/operationRequestBodyMapper.js.map +1 -0
- package/lib/cjs/components/operationResponseMapper.js +24 -0
- package/lib/cjs/components/operationResponseMapper.js.map +1 -0
- package/lib/cjs/components/pathsMapper.js +90 -0
- package/lib/cjs/components/pathsMapper.js.map +1 -0
- package/lib/cjs/components/schemaMapper.js +35 -5
- package/lib/cjs/components/schemaMapper.js.map +1 -1
- package/lib/cjs/domain/JsonClassStore.js.map +1 -1
- package/lib/cjs/domain/JsonLazyRef.js +0 -4
- package/lib/cjs/domain/JsonLazyRef.js.map +1 -1
- package/lib/cjs/domain/JsonMap.js +2 -1
- package/lib/cjs/domain/JsonMap.js.map +1 -1
- package/lib/cjs/domain/JsonMedia.js +20 -0
- package/lib/cjs/domain/JsonMedia.js.map +1 -0
- package/lib/cjs/domain/JsonMethodStore.js.map +1 -1
- package/lib/cjs/domain/JsonOperation.js +1 -83
- package/lib/cjs/domain/JsonOperation.js.map +1 -1
- package/lib/cjs/domain/JsonOperationPathsMap.js +1 -0
- package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/cjs/domain/JsonParameter.js +3 -72
- package/lib/cjs/domain/JsonParameter.js.map +1 -1
- package/lib/cjs/domain/JsonParameterStore.js.map +1 -1
- package/lib/cjs/domain/JsonPropertyStore.js.map +1 -1
- package/lib/cjs/domain/JsonRequestBody.js +1 -0
- package/lib/cjs/domain/JsonRequestBody.js.map +1 -1
- package/lib/cjs/domain/JsonResponse.js +5 -38
- package/lib/cjs/domain/JsonResponse.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +2 -10
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/index.js +10 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/registries/JsonSchemaMapperContainer.js +5 -1
- package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -1
- package/lib/cjs/utils/getJsonSchema.js +1 -11
- package/lib/cjs/utils/getJsonSchema.js.map +1 -1
- package/lib/cjs/utils/getSpec.js +24 -37
- package/lib/cjs/utils/getSpec.js.map +1 -1
- package/lib/esm/components/anyMapper.js +4 -3
- package/lib/esm/components/anyMapper.js.map +1 -1
- package/lib/esm/components/index.js +24 -0
- package/lib/esm/components/index.js.map +1 -0
- package/lib/esm/components/lazyRefMapper.js +8 -8
- package/lib/esm/components/lazyRefMapper.js.map +1 -1
- package/lib/esm/components/mapMapper.js +1 -1
- package/lib/esm/components/mapMapper.js.map +1 -1
- package/lib/esm/components/operationInFilesMapper.js +24 -0
- package/lib/esm/components/operationInFilesMapper.js.map +1 -0
- package/lib/esm/components/operationInParameterMapper.js +35 -0
- package/lib/esm/components/operationInParameterMapper.js.map +1 -0
- package/lib/esm/components/operationInParametersMapper.js +6 -0
- package/lib/esm/components/operationInParametersMapper.js.map +1 -0
- package/lib/esm/components/operationInQueryMapper.js +35 -0
- package/lib/esm/components/operationInQueryMapper.js.map +1 -0
- package/lib/esm/components/operationMapper.js +45 -0
- package/lib/esm/components/operationMapper.js.map +1 -0
- package/lib/esm/components/operationMediaMapper.js +7 -0
- package/lib/esm/components/operationMediaMapper.js.map +1 -0
- package/lib/esm/components/operationRequestBodyMapper.js +53 -0
- package/lib/esm/components/operationRequestBodyMapper.js.map +1 -0
- package/lib/esm/components/operationResponseMapper.js +20 -0
- package/lib/esm/components/operationResponseMapper.js.map +1 -0
- package/lib/esm/components/pathsMapper.js +86 -0
- package/lib/esm/components/pathsMapper.js.map +1 -0
- package/lib/esm/components/schemaMapper.js +35 -5
- package/lib/esm/components/schemaMapper.js.map +1 -1
- package/lib/esm/domain/JsonClassStore.js.map +1 -1
- package/lib/esm/domain/JsonLazyRef.js +0 -4
- package/lib/esm/domain/JsonLazyRef.js.map +1 -1
- package/lib/esm/domain/JsonMap.js +2 -1
- package/lib/esm/domain/JsonMap.js.map +1 -1
- package/lib/esm/domain/JsonMedia.js +16 -0
- package/lib/esm/domain/JsonMedia.js.map +1 -0
- package/lib/esm/domain/JsonMethodStore.js.map +1 -1
- package/lib/esm/domain/JsonOperation.js +1 -83
- package/lib/esm/domain/JsonOperation.js.map +1 -1
- package/lib/esm/domain/JsonOperationPathsMap.js +1 -0
- package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/esm/domain/JsonParameter.js +4 -73
- package/lib/esm/domain/JsonParameter.js.map +1 -1
- package/lib/esm/domain/JsonParameterStore.js.map +1 -1
- package/lib/esm/domain/JsonPropertyStore.js.map +1 -1
- package/lib/esm/domain/JsonRequestBody.js +1 -0
- package/lib/esm/domain/JsonRequestBody.js.map +1 -1
- package/lib/esm/domain/JsonResponse.js +2 -34
- package/lib/esm/domain/JsonResponse.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +2 -10
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/index.js +10 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/registries/JsonSchemaMapperContainer.js +3 -0
- package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -1
- package/lib/esm/utils/getJsonSchema.js +1 -11
- package/lib/esm/utils/getJsonSchema.js.map +1 -1
- package/lib/esm/utils/getSpec.js +24 -37
- package/lib/esm/utils/getSpec.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/components/index.d.ts +23 -0
- package/lib/types/components/lazyRefMapper.d.ts +1 -1
- package/lib/types/components/mapMapper.d.ts +1 -1
- package/lib/types/components/operationInFilesMapper.d.ts +2 -0
- package/lib/types/components/operationInParameterMapper.d.ts +10 -0
- package/lib/types/components/operationInParametersMapper.d.ts +3 -0
- package/lib/types/components/operationInQueryMapper.d.ts +2 -0
- package/lib/types/components/operationMapper.d.ts +3 -0
- package/lib/types/components/operationMediaMapper.d.ts +3 -0
- package/lib/types/components/operationRequestBodyMapper.d.ts +3 -0
- package/lib/types/components/operationResponseMapper.d.ts +3 -0
- package/lib/types/components/pathsMapper.d.ts +2 -0
- package/lib/types/components/schemaMapper.d.ts +1 -1
- package/lib/types/domain/JsonLazyRef.d.ts +0 -2
- package/lib/types/domain/JsonMap.d.ts +1 -0
- package/lib/types/domain/JsonMedia.d.ts +11 -0
- package/lib/types/domain/JsonOperation.d.ts +1 -2
- package/lib/types/domain/JsonOperationPathsMap.d.ts +1 -0
- package/lib/types/domain/JsonParameter.d.ts +1 -3
- package/lib/types/domain/JsonRequestBody.d.ts +1 -0
- package/lib/types/domain/JsonResponse.d.ts +2 -10
- package/lib/types/domain/JsonSchema.d.ts +1 -0
- package/lib/types/index.d.ts +10 -1
- package/lib/types/registries/JsonSchemaMapperContainer.d.ts +1 -0
- package/lib/types/utils/getJsonSchema.d.ts +1 -11
- package/lib/types/utils/withErrorMsg.d.ts +1 -1
- package/package.json +9 -9
- package/lib/cjs/utils/mergeOperation.js +0 -44
- package/lib/cjs/utils/mergeOperation.js.map +0 -1
- package/lib/esm/utils/mergeOperation.js +0 -40
- package/lib/esm/utils/mergeOperation.js.map +0 -1
- package/lib/types/utils/mergeOperation.d.ts +0 -17
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./anyMapper";
|
|
5
|
+
export * from "./classMapper";
|
|
6
|
+
export * from "./genericsMapper";
|
|
7
|
+
export * from "./inheritedClassMapper";
|
|
8
|
+
export * from "./itemMapper";
|
|
9
|
+
export * from "./lazyRefMapper";
|
|
10
|
+
export * from "./mapMapper";
|
|
11
|
+
export * from "./objectMapper";
|
|
12
|
+
export * from "./ofMapper";
|
|
13
|
+
export * from "./operationInFilesMapper";
|
|
14
|
+
export * from "./operationInParameterMapper";
|
|
15
|
+
export * from "./operationInParametersMapper";
|
|
16
|
+
export * from "./operationInQueryMapper";
|
|
17
|
+
export * from "./operationMapper";
|
|
18
|
+
export * from "./operationMediaMapper";
|
|
19
|
+
export * from "./operationRequestBodyMapper";
|
|
20
|
+
export * from "./operationResponseMapper";
|
|
21
|
+
export * from "./pathsMapper";
|
|
22
|
+
export * from "./propertiesMapper";
|
|
23
|
+
export * from "./schemaMapper";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonLazyRef } from "../domain/JsonLazyRef";
|
|
2
2
|
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
|
-
export declare function lazyRefMapper(
|
|
3
|
+
export declare function lazyRefMapper(jsonLazyRef: JsonLazyRef, options: JsonSchemaOptions): any;
|
|
@@ -6,4 +6,4 @@ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
|
6
6
|
* @param options
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
9
|
-
export declare function mapMapper(input: Map<string, any>, { ignore, ...options }
|
|
9
|
+
export declare function mapMapper(input: Map<string, any>, { ignore, ...options }?: JsonSchemaOptions): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OS3Schema } from "@tsed/openspec";
|
|
2
|
+
import type { JSONSchema6 } from "json-schema";
|
|
3
|
+
import { JsonParameter } from "../domain/JsonParameter";
|
|
4
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
5
|
+
export type JsonParameterOptions = JsonSchemaOptions & {
|
|
6
|
+
jsonParameter: JsonParameter;
|
|
7
|
+
jsonSchema: JSONSchema6;
|
|
8
|
+
oldSchemas: Record<string, OS3Schema>;
|
|
9
|
+
};
|
|
10
|
+
export declare function operationInParameterMapper(jsonParameter: JsonParameter, opts?: JsonSchemaOptions): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonSchema } from "../domain/JsonSchema";
|
|
2
2
|
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
|
-
export declare function schemaMapper(schema: JsonSchema,
|
|
3
|
+
export declare function schemaMapper(schema: JsonSchema, opts: JsonSchemaOptions): any;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
2
|
export declare class JsonLazyRef {
|
|
4
3
|
readonly getType: () => Type<any>;
|
|
5
4
|
readonly isLazyRef = true;
|
|
@@ -7,5 +6,4 @@ export declare class JsonLazyRef {
|
|
|
7
6
|
get target(): Type<any>;
|
|
8
7
|
get schema(): import("./JsonSchema").JsonSchema;
|
|
9
8
|
get name(): string;
|
|
10
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
11
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
2
2
|
export declare class JsonMap<T> extends Map<string, any> {
|
|
3
3
|
[key: string]: any;
|
|
4
|
+
kind: string;
|
|
4
5
|
constructor(obj?: Partial<T>);
|
|
5
6
|
assign(obj?: Partial<T> & any): this;
|
|
6
7
|
toJSON(options?: JsonSchemaOptions): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OS3MediaType } from "@tsed/openspec";
|
|
2
|
+
import { JsonMap } from "./JsonMap";
|
|
3
|
+
import { JsonSchema } from "./JsonSchema";
|
|
4
|
+
export declare class JsonMedia extends JsonMap<OS3MediaType<JsonSchema>> {
|
|
5
|
+
kind: string;
|
|
6
|
+
groups: string[];
|
|
7
|
+
groupsName: string;
|
|
8
|
+
allowedGroups?: Set<string>;
|
|
9
|
+
schema(schema: JsonSchema): this;
|
|
10
|
+
examples(examples: any): this;
|
|
11
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OpenSpecSecurity, OpenSpecTag, OS3Operation } from "@tsed/openspec";
|
|
2
2
|
import { JsonHeader } from "../interfaces/JsonOpenSpec";
|
|
3
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
4
3
|
import { JsonMap } from "./JsonMap";
|
|
5
4
|
import { JsonParameter } from "./JsonParameter";
|
|
6
5
|
import { JsonResponse } from "./JsonResponse";
|
|
@@ -16,6 +15,7 @@ export interface JsonOperationOptions extends OS3Operation<JsonSchema, JsonParam
|
|
|
16
15
|
}
|
|
17
16
|
export declare class JsonOperation extends JsonMap<JsonOperationOptions> {
|
|
18
17
|
#private;
|
|
18
|
+
kind: string;
|
|
19
19
|
readonly operationPaths: Map<string, JsonMethodPath>;
|
|
20
20
|
constructor(obj?: Partial<JsonOperationOptions>);
|
|
21
21
|
get response(): JsonResponse | undefined;
|
|
@@ -47,5 +47,4 @@ export declare class JsonOperation extends JsonMap<JsonOperationOptions> {
|
|
|
47
47
|
produces(produces: string[]): this;
|
|
48
48
|
addProduce(produce: string): void;
|
|
49
49
|
addOperationPath(method: string, path: string | RegExp, options?: any): this;
|
|
50
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
51
50
|
}
|
|
@@ -5,6 +5,7 @@ import { NestedGenerics } from "../utils/generics";
|
|
|
5
5
|
import { JsonMap } from "./JsonMap";
|
|
6
6
|
import { JsonSchema } from "./JsonSchema";
|
|
7
7
|
export declare class JsonParameter extends JsonMap<OS3Parameter<JsonSchema>> implements NestedGenerics {
|
|
8
|
+
kind: string;
|
|
8
9
|
nestedGenerics: Type<any>[][];
|
|
9
10
|
groups: string[];
|
|
10
11
|
groupsName: string;
|
|
@@ -18,7 +19,4 @@ export declare class JsonParameter extends JsonMap<OS3Parameter<JsonSchema>> imp
|
|
|
18
19
|
required(required: boolean): this;
|
|
19
20
|
schema(schema: JsonSchema): this;
|
|
20
21
|
toJSON(options?: JsonSchemaOptions): any;
|
|
21
|
-
private build;
|
|
22
|
-
private getFileSchema;
|
|
23
|
-
private refToParameters;
|
|
24
22
|
}
|
|
@@ -3,6 +3,7 @@ import { JsonMap } from "./JsonMap";
|
|
|
3
3
|
import { JsonSchema } from "./JsonSchema";
|
|
4
4
|
export type JsonRequestBodyOptions = OS3RequestBody<JsonSchema>;
|
|
5
5
|
export declare class JsonRequestBody extends JsonMap<JsonRequestBodyOptions> {
|
|
6
|
+
kind: string;
|
|
6
7
|
constructor(obj?: Partial<JsonRequestBodyOptions>);
|
|
7
8
|
description(description: string): this;
|
|
8
9
|
content(content: OpenSpecHash<OS3MediaType<JsonSchema>>): this;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { OS3MediaType, OS3Response } from "@tsed/openspec";
|
|
2
2
|
import { JsonHeader } from "../interfaces/JsonOpenSpec";
|
|
3
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
4
3
|
import { JsonMap } from "./JsonMap";
|
|
4
|
+
import { JsonMedia } from "./JsonMedia";
|
|
5
5
|
import { JsonSchema } from "./JsonSchema";
|
|
6
6
|
export type JsonResponseOptions = OS3Response<JsonSchema, string | JsonHeader>;
|
|
7
|
-
export declare class JsonMedia extends JsonMap<OS3MediaType<JsonSchema>> {
|
|
8
|
-
groups: string[];
|
|
9
|
-
groupsName: string;
|
|
10
|
-
allowedGroups?: Set<string>;
|
|
11
|
-
schema(schema: JsonSchema): this;
|
|
12
|
-
examples(examples: any): this;
|
|
13
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
14
|
-
}
|
|
15
7
|
export declare class JsonResponse extends JsonMap<JsonResponseOptions> {
|
|
8
|
+
kind: string;
|
|
16
9
|
status: number;
|
|
17
10
|
constructor(obj?: Partial<JsonResponseOptions>);
|
|
18
11
|
description(description: string): this;
|
|
@@ -21,5 +14,4 @@ export declare class JsonResponse extends JsonMap<JsonResponseOptions> {
|
|
|
21
14
|
getContent(): JsonMap<JsonMedia>;
|
|
22
15
|
getMedia(mediaType: string, create?: boolean): JsonMedia;
|
|
23
16
|
addMedia(mediaType: string): this;
|
|
24
|
-
toJSON(options?: JsonSchemaOptions): any;
|
|
25
17
|
}
|
|
@@ -16,6 +16,7 @@ export interface JsonSchemaObject extends JSONSchema6, Record<string, any> {
|
|
|
16
16
|
export type AnyJsonSchema = Partial<JsonSchemaObject> | JsonSchema | JsonLazyRef | any;
|
|
17
17
|
export declare class JsonSchema extends Map<string, any> implements NestedGenerics {
|
|
18
18
|
#private;
|
|
19
|
+
kind: string;
|
|
19
20
|
readonly isJsonSchema = true;
|
|
20
21
|
readonly $hooks: Hooks;
|
|
21
22
|
readonly $required: Set<string>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -10,6 +10,15 @@ export * from "./components/lazyRefMapper";
|
|
|
10
10
|
export * from "./components/mapMapper";
|
|
11
11
|
export * from "./components/objectMapper";
|
|
12
12
|
export * from "./components/ofMapper";
|
|
13
|
+
export * from "./components/operationInFilesMapper";
|
|
14
|
+
export * from "./components/operationInParameterMapper";
|
|
15
|
+
export * from "./components/operationInParametersMapper";
|
|
16
|
+
export * from "./components/operationInQueryMapper";
|
|
17
|
+
export * from "./components/operationMapper";
|
|
18
|
+
export * from "./components/operationMediaMapper";
|
|
19
|
+
export * from "./components/operationRequestBodyMapper";
|
|
20
|
+
export * from "./components/operationResponseMapper";
|
|
21
|
+
export * from "./components/pathsMapper";
|
|
13
22
|
export * from "./components/propertiesMapper";
|
|
14
23
|
export * from "./components/schemaMapper";
|
|
15
24
|
export * from "./constants/httpMethods";
|
|
@@ -98,6 +107,7 @@ export * from "./domain/JsonEntityStore";
|
|
|
98
107
|
export * from "./domain/JsonFormatTypes";
|
|
99
108
|
export * from "./domain/JsonLazyRef";
|
|
100
109
|
export * from "./domain/JsonMap";
|
|
110
|
+
export * from "./domain/JsonMedia";
|
|
101
111
|
export * from "./domain/JsonMethodStore";
|
|
102
112
|
export * from "./domain/JsonOperation";
|
|
103
113
|
export * from "./domain/JsonOperationPathsMap";
|
|
@@ -148,7 +158,6 @@ export * from "./utils/mapOpenSpec3";
|
|
|
148
158
|
export * from "./utils/mapOpenSpecInfo";
|
|
149
159
|
export * from "./utils/mapRouteOptions";
|
|
150
160
|
export * from "./utils/matchGroups";
|
|
151
|
-
export * from "./utils/mergeOperation";
|
|
152
161
|
export * from "./utils/mergeSpec";
|
|
153
162
|
export * from "./utils/operationIdFormatter";
|
|
154
163
|
export * from "./utils/ref";
|
|
@@ -17,3 +17,4 @@ export declare function getJsonSchemaMapper(type: string): JsonSchemaMapper;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function execMapper(type: string, schema: any, options: any, parent?: any): any;
|
|
19
19
|
export declare function hasMapper(type: string): boolean;
|
|
20
|
+
export declare function oneOfMapper(...types: string[]): string;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import "../components
|
|
3
|
-
import "../components/classMapper";
|
|
4
|
-
import "../components/genericsMapper";
|
|
5
|
-
import "../components/inheritedClassMapper";
|
|
6
|
-
import "../components/itemMapper";
|
|
7
|
-
import "../components/lazyRefMapper";
|
|
8
|
-
import "../components/mapMapper";
|
|
9
|
-
import "../components/objectMapper";
|
|
10
|
-
import "../components/ofMapper";
|
|
11
|
-
import "../components/propertiesMapper";
|
|
12
|
-
import "../components/schemaMapper";
|
|
2
|
+
import "../components";
|
|
13
3
|
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
14
4
|
export declare function getJsonSchema(model: Type<any> | any, options?: JsonSchemaOptions): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface ErrorChainedMethods<T> {
|
|
2
|
-
<T>(target: Object, propertyKey
|
|
2
|
+
<T>(target: Object, propertyKey: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<T> | number): any;
|
|
3
3
|
Error(msg: string): this;
|
|
4
4
|
}
|
|
5
5
|
export type ErrorChainedDecorator<Decorator extends (...args: any[]) => any> = (...args: Parameters<Decorator>) => ErrorChainedMethods<Decorator>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "7.34.
|
|
3
|
+
"version": "7.34.3",
|
|
4
4
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"clean": "rm -rf lib",
|
|
20
20
|
"build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser",
|
|
21
21
|
"build:browser": "webpack",
|
|
22
|
-
"barrels": "yarn barrelsby --
|
|
22
|
+
"barrels": "yarn barrelsby --config .barrelsby.json",
|
|
23
23
|
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2 && jest-coverage-thresholds-bumper",
|
|
24
24
|
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json",
|
|
25
25
|
"lint": "eslint '**/*.{ts,js}'",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"tsed"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@tsed/openspec": "7.34.
|
|
39
|
+
"@tsed/openspec": "7.34.3",
|
|
40
40
|
"change-case": "^4.1.2",
|
|
41
41
|
"fs-extra": "^10.0.1",
|
|
42
42
|
"json-schema": "0.4.0",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
49
|
-
"@tsed/core": "7.34.
|
|
50
|
-
"@tsed/eslint": "7.34.
|
|
51
|
-
"@tsed/openspec": "7.34.
|
|
52
|
-
"@tsed/typescript": "7.34.
|
|
49
|
+
"@tsed/core": "7.34.3",
|
|
50
|
+
"@tsed/eslint": "7.34.3",
|
|
51
|
+
"@tsed/openspec": "7.34.3",
|
|
52
|
+
"@tsed/typescript": "7.34.3",
|
|
53
53
|
"@types/fs-extra": "9.0.13",
|
|
54
54
|
"@types/json-schema": "7.0.11",
|
|
55
55
|
"@types/picomatch": "2.3.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"picomatch-browser": "https://github.com/silverwind/picomatch#ee6ebcc5570a8846d81610c11ebb92a9e199b145"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@tsed/core": "^7.34.
|
|
62
|
-
"@tsed/openspec": "^7.34.
|
|
61
|
+
"@tsed/core": "^7.34.3",
|
|
62
|
+
"@tsed/openspec": "^7.34.3"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@tsed/openspec": {
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeOperation = void 0;
|
|
4
|
-
const SpecTypes_1 = require("../domain/SpecTypes");
|
|
5
|
-
const concatParameters_1 = require("./concatParameters");
|
|
6
|
-
const getJsonPathParameters_1 = require("./getJsonPathParameters");
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
function mergeOperation(obj, operation, { rootPath, specType, operationId, defaultTags, tags, path, method }) {
|
|
11
|
-
const pathParameters = (0, getJsonPathParameters_1.getJsonPathParameters)(rootPath, path).map(({ path, parameters }) => {
|
|
12
|
-
path = path ? path : "/";
|
|
13
|
-
// FIXME not on the right place
|
|
14
|
-
if (specType === SpecTypes_1.SpecTypes.OPENAPI) {
|
|
15
|
-
parameters = parameters.map(({ type, ...param }) => {
|
|
16
|
-
return {
|
|
17
|
-
...param,
|
|
18
|
-
schema: {
|
|
19
|
-
type
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return { path, parameters };
|
|
25
|
-
});
|
|
26
|
-
return pathParameters.reduce((obj, { path, parameters }) => {
|
|
27
|
-
parameters = (0, concatParameters_1.concatParameters)(parameters, operation);
|
|
28
|
-
path = path ? path : "/";
|
|
29
|
-
const operationTags = operation.tags?.length ? operation.tags : [defaultTags];
|
|
30
|
-
obj.paths[path] = {
|
|
31
|
-
...obj.paths[path],
|
|
32
|
-
[method.toLowerCase()]: {
|
|
33
|
-
operationId: operation.operationId || operationId(path),
|
|
34
|
-
...operation,
|
|
35
|
-
tags: operationTags.map(({ name }) => name),
|
|
36
|
-
parameters
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
tags.push(...operationTags);
|
|
40
|
-
return obj;
|
|
41
|
-
}, obj);
|
|
42
|
-
}
|
|
43
|
-
exports.mergeOperation = mergeOperation;
|
|
44
|
-
//# sourceMappingURL=mergeOperation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeOperation.js","sourceRoot":"","sources":["../../../src/utils/mergeOperation.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,yDAAoD;AACpD,mEAA8D;AAe9D;;GAEG;AACH,SAAgB,cAAc,CAC5B,GAAQ,EACR,SAAc,EACd,EAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAwB;IAEzF,MAAM,cAAc,GAAG,IAAA,6CAAqB,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,UAAU,EAAC,EAAE,EAAE;QACtF,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QAEzB,+BAA+B;QAC/B,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;YAClC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,GAAG,KAAK,EAAC,EAAE,EAAE;gBAC/C,OAAO;oBACL,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,IAAI;qBACL;iBACF,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,EAAE,EAAE;QACvD,UAAU,GAAG,IAAA,mCAAgB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACrD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QAEzB,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE9E,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;YAChB,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAClB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE;gBACtB,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC;gBACvD,GAAG,SAAS;gBACZ,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAM,EAAE,EAAE,CAAC,IAAI,CAAC;gBAC9C,UAAU;aACX;SACF,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QAE5B,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,GAAG,CAAC,CAAC;AACV,CAAC;AA3CD,wCA2CC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { SpecTypes } from "../domain/SpecTypes.js";
|
|
2
|
-
import { concatParameters } from "./concatParameters.js";
|
|
3
|
-
import { getJsonPathParameters } from "./getJsonPathParameters.js";
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
export function mergeOperation(obj, operation, { rootPath, specType, operationId, defaultTags, tags, path, method }) {
|
|
8
|
-
const pathParameters = getJsonPathParameters(rootPath, path).map(({ path, parameters }) => {
|
|
9
|
-
path = path ? path : "/";
|
|
10
|
-
// FIXME not on the right place
|
|
11
|
-
if (specType === SpecTypes.OPENAPI) {
|
|
12
|
-
parameters = parameters.map(({ type, ...param }) => {
|
|
13
|
-
return {
|
|
14
|
-
...param,
|
|
15
|
-
schema: {
|
|
16
|
-
type
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return { path, parameters };
|
|
22
|
-
});
|
|
23
|
-
return pathParameters.reduce((obj, { path, parameters }) => {
|
|
24
|
-
parameters = concatParameters(parameters, operation);
|
|
25
|
-
path = path ? path : "/";
|
|
26
|
-
const operationTags = operation.tags?.length ? operation.tags : [defaultTags];
|
|
27
|
-
obj.paths[path] = {
|
|
28
|
-
...obj.paths[path],
|
|
29
|
-
[method.toLowerCase()]: {
|
|
30
|
-
operationId: operation.operationId || operationId(path),
|
|
31
|
-
...operation,
|
|
32
|
-
tags: operationTags.map(({ name }) => name),
|
|
33
|
-
parameters
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
tags.push(...operationTags);
|
|
37
|
-
return obj;
|
|
38
|
-
}, obj);
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=mergeOperation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeOperation.js","sourceRoot":"","sources":["../../../src/utils/mergeOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAe9D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,GAAQ,EACR,SAAc,EACd,EAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAwB;IAEzF,MAAM,cAAc,GAAG,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,UAAU,EAAC,EAAE,EAAE;QACtF,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QAEzB,+BAA+B;QAC/B,IAAI,QAAQ,KAAK,SAAS,CAAC,OAAO,EAAE;YAClC,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,GAAG,KAAK,EAAC,EAAE,EAAE;gBAC/C,OAAO;oBACL,GAAG,KAAK;oBACR,MAAM,EAAE;wBACN,IAAI;qBACL;iBACF,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,EAAE,EAAE;QACvD,UAAU,GAAG,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACrD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QAEzB,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE9E,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;YAChB,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAClB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE;gBACtB,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC;gBACvD,GAAG,SAAS;gBACZ,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAM,EAAE,EAAE,CAAC,IAAI,CAAC;gBAC9C,UAAU;aACX;SACF,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QAE5B,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,GAAG,CAAC,CAAC;AACV,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SpecTypes } from "../domain/SpecTypes";
|
|
2
|
-
/**
|
|
3
|
-
* @ignore
|
|
4
|
-
*/
|
|
5
|
-
export interface MergeOperationOptions {
|
|
6
|
-
rootPath: string;
|
|
7
|
-
specType: SpecTypes;
|
|
8
|
-
operationId: (path: string) => string | undefined;
|
|
9
|
-
defaultTags: string[];
|
|
10
|
-
tags: string[];
|
|
11
|
-
path: string;
|
|
12
|
-
method: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @ignore
|
|
16
|
-
*/
|
|
17
|
-
export declare function mergeOperation(obj: any, operation: any, { rootPath, specType, operationId, defaultTags, tags, path, method }: MergeOperationOptions): any;
|