@tsed/schema 7.0.0-beta.1 → 7.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest.config.js +4 -4
- package/lib/cjs/components/schemaMapper.js +1 -3
- package/lib/cjs/components/schemaMapper.js.map +1 -1
- package/lib/cjs/constants/httpStatusMessages.js +12 -96
- package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
- package/lib/cjs/decorators/common/description.js.map +1 -1
- package/lib/cjs/decorators/common/enum.js +1 -20
- package/lib/cjs/decorators/common/enum.js.map +1 -1
- package/lib/cjs/decorators/common/ignore.js.map +1 -1
- package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -1
- package/lib/cjs/decorators/common/recordOf.js +63 -0
- package/lib/cjs/decorators/common/recordOf.js.map +1 -0
- package/lib/cjs/decorators/operations/acceptMime.js +28 -0
- package/lib/cjs/decorators/operations/acceptMime.js.map +1 -0
- package/lib/cjs/decorators/operations/in.js +6 -4
- package/lib/cjs/decorators/operations/in.js.map +1 -1
- package/lib/cjs/decorators/operations/view.js +31 -0
- package/lib/cjs/decorators/operations/view.js.map +1 -0
- package/lib/cjs/domain/DecoratorContext.js.map +1 -1
- package/lib/cjs/domain/JsonClassStore.js +1 -1
- package/lib/cjs/domain/JsonMap.js.map +1 -1
- package/lib/cjs/domain/JsonMethodStore.js +66 -24
- package/lib/cjs/domain/JsonMethodStore.js.map +1 -1
- package/lib/cjs/domain/JsonOperation.js +11 -26
- package/lib/cjs/domain/JsonOperation.js.map +1 -1
- package/lib/cjs/domain/JsonOperationRoute.js +4 -0
- package/lib/cjs/domain/JsonOperationRoute.js.map +1 -1
- package/lib/cjs/domain/JsonParameter.js +36 -74
- package/lib/cjs/domain/JsonParameter.js.map +1 -1
- package/lib/cjs/domain/JsonParameterStore.js +14 -5
- package/lib/cjs/domain/JsonParameterStore.js.map +1 -1
- package/lib/cjs/domain/JsonPropertyStore.js +6 -2
- package/lib/cjs/domain/JsonPropertyStore.js.map +1 -1
- package/lib/cjs/domain/JsonResponse.js +1 -11
- package/lib/cjs/domain/JsonResponse.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +47 -54
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/domain/SpecTypes.js +0 -3
- package/lib/cjs/domain/SpecTypes.js.map +1 -1
- package/lib/cjs/index.js +149 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/utils/from.js +9 -8
- package/lib/cjs/utils/from.js.map +1 -1
- package/lib/cjs/utils/generateSpec.js +55 -0
- package/lib/cjs/utils/generateSpec.js.map +1 -0
- package/lib/cjs/utils/generics.js.map +1 -1
- package/lib/cjs/utils/getJsonSchema.js +11 -1
- package/lib/cjs/utils/getJsonSchema.js.map +1 -1
- package/lib/cjs/utils/getJsonType.js +1 -1
- package/lib/cjs/utils/getJsonType.js.map +1 -1
- package/lib/cjs/utils/getOperationsRoutes.js +2 -1
- package/lib/cjs/utils/getOperationsRoutes.js.map +1 -1
- package/lib/cjs/utils/getSpec.js +58 -43
- package/lib/cjs/utils/getSpec.js.map +1 -1
- package/lib/cjs/utils/getSpecType.js +21 -0
- package/lib/cjs/utils/getSpecType.js.map +1 -0
- package/lib/cjs/utils/mapNullableType.js +1 -6
- package/lib/cjs/utils/mapNullableType.js.map +1 -1
- package/lib/cjs/utils/mapOpenSpec.js +41 -0
- package/lib/cjs/utils/mapOpenSpec.js.map +1 -0
- package/lib/cjs/utils/mapOpenSpec2.js +34 -0
- package/lib/cjs/utils/mapOpenSpec2.js.map +1 -0
- package/lib/cjs/utils/mapOpenSpec3.js +26 -0
- package/lib/cjs/utils/mapOpenSpec3.js.map +1 -0
- package/lib/cjs/utils/mapOpenSpecInfo.js +21 -0
- package/lib/cjs/utils/mapOpenSpecInfo.js.map +1 -0
- package/lib/cjs/utils/matchGroups.js +1 -1
- package/lib/cjs/utils/matchGroups.js.map +1 -1
- package/lib/cjs/utils/mergeOperation.js +1 -0
- package/lib/cjs/utils/mergeOperation.js.map +1 -1
- package/lib/cjs/utils/ref.js +0 -8
- package/lib/cjs/utils/ref.js.map +1 -1
- package/lib/cjs/utils/serializeEnumValues.js +26 -0
- package/lib/cjs/utils/serializeEnumValues.js.map +1 -0
- package/lib/esm/components/anyMapper.js +4 -4
- package/lib/esm/components/classMapper.js +4 -4
- package/lib/esm/components/genericsMapper.js +4 -4
- package/lib/esm/components/inheritedClassMapper.js +2 -2
- package/lib/esm/components/itemMapper.js +1 -1
- package/lib/esm/components/lazyRefMapper.js +3 -3
- package/lib/esm/components/mapMapper.js +2 -2
- package/lib/esm/components/objectMapper.js +3 -3
- package/lib/esm/components/ofMapper.js +1 -1
- package/lib/esm/components/propertiesMapper.js +1 -1
- package/lib/esm/components/schemaMapper.js +7 -9
- package/lib/esm/components/schemaMapper.js.map +1 -1
- package/lib/esm/constants/httpStatusMessages.js +11 -96
- package/lib/esm/constants/httpStatusMessages.js.map +1 -1
- package/lib/esm/decorators/class/children.js +1 -1
- package/lib/esm/decorators/collections/collectionContains.js +1 -1
- package/lib/esm/decorators/collections/collectionOf.js +1 -1
- 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/additionalProperties.js +1 -1
- package/lib/esm/decorators/common/allOf.js +1 -1
- package/lib/esm/decorators/common/allow.js +2 -2
- package/lib/esm/decorators/common/any.js +1 -1
- package/lib/esm/decorators/common/anyOf.js +1 -1
- package/lib/esm/decorators/common/const.js +1 -1
- package/lib/esm/decorators/common/customKey.js +1 -1
- package/lib/esm/decorators/common/default.js +1 -1
- package/lib/esm/decorators/common/description.js +1 -1
- package/lib/esm/decorators/common/description.js.map +1 -1
- package/lib/esm/decorators/common/enum.js +2 -21
- package/lib/esm/decorators/common/enum.js.map +1 -1
- package/lib/esm/decorators/common/example.js +1 -1
- package/lib/esm/decorators/common/examples.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 +2 -2
- package/lib/esm/decorators/common/forwardGroups.js +1 -1
- package/lib/esm/decorators/common/groups.js +2 -2
- package/lib/esm/decorators/common/ignore.js +1 -1
- package/lib/esm/decorators/common/ignore.js.map +1 -1
- package/lib/esm/decorators/common/integer.js +1 -1
- package/lib/esm/decorators/common/jsonEntityFn.js +1 -1
- package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -1
- 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/oneOf.js +1 -1
- package/lib/esm/decorators/common/optional.js +1 -1
- package/lib/esm/decorators/common/pattern.js +1 -1
- package/lib/esm/decorators/common/property.js +1 -1
- package/lib/esm/decorators/common/readOnly.js +1 -1
- package/lib/esm/decorators/common/recordOf.js +59 -0
- package/lib/esm/decorators/common/recordOf.js.map +1 -0
- package/lib/esm/decorators/common/required.js +2 -2
- package/lib/esm/decorators/common/requiredGroups.js +2 -2
- package/lib/esm/decorators/common/schema.js +1 -1
- package/lib/esm/decorators/common/title.js +1 -1
- package/lib/esm/decorators/common/writeOnly.js +1 -1
- package/lib/esm/decorators/config/jsonEntityComponent.js +1 -1
- package/lib/esm/decorators/generics/genericOf.js +2 -2
- package/lib/esm/decorators/generics/generics.js +1 -1
- package/lib/esm/decorators/operations/acceptMime.js +24 -0
- package/lib/esm/decorators/operations/acceptMime.js.map +1 -0
- package/lib/esm/decorators/operations/consumes.js +1 -1
- package/lib/esm/decorators/operations/contentType.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 +3 -1
- package/lib/esm/decorators/operations/in.js.map +1 -1
- package/lib/esm/decorators/operations/inFile.js +5 -5
- package/lib/esm/decorators/operations/location.js +1 -1
- package/lib/esm/decorators/operations/operationId.js +1 -1
- package/lib/esm/decorators/operations/operationPath.js +1 -1
- package/lib/esm/decorators/operations/partial.js +1 -1
- package/lib/esm/decorators/operations/path.js +1 -1
- package/lib/esm/decorators/operations/produces.js +1 -1
- package/lib/esm/decorators/operations/redirect.js +2 -2
- package/lib/esm/decorators/operations/returns.js +8 -8
- package/lib/esm/decorators/operations/route.js +3 -3
- package/lib/esm/decorators/operations/security.js +1 -1
- package/lib/esm/decorators/operations/status.js +1 -1
- package/lib/esm/decorators/operations/summary.js +1 -1
- package/lib/esm/decorators/operations/tags.js +1 -1
- package/lib/esm/decorators/operations/view.js +27 -0
- package/lib/esm/decorators/operations/view.js.map +1 -0
- package/lib/esm/domain/DecoratorContext.js +1 -1
- package/lib/esm/domain/DecoratorContext.js.map +1 -1
- package/lib/esm/domain/JsonClassStore.js +3 -3
- package/lib/esm/domain/JsonLazyRef.js +2 -2
- package/lib/esm/domain/JsonMap.js +1 -1
- package/lib/esm/domain/JsonMap.js.map +1 -1
- package/lib/esm/domain/JsonMethodStore.js +68 -26
- package/lib/esm/domain/JsonMethodStore.js.map +1 -1
- package/lib/esm/domain/JsonOperation.js +10 -25
- package/lib/esm/domain/JsonOperation.js.map +1 -1
- package/lib/esm/domain/JsonOperationPathsMap.js +1 -1
- package/lib/esm/domain/JsonOperationRoute.js +5 -1
- package/lib/esm/domain/JsonOperationRoute.js.map +1 -1
- package/lib/esm/domain/JsonParameter.js +40 -78
- package/lib/esm/domain/JsonParameter.js.map +1 -1
- package/lib/esm/domain/JsonParameterStore.js +17 -8
- package/lib/esm/domain/JsonParameterStore.js.map +1 -1
- package/lib/esm/domain/JsonPropertyStore.js +7 -3
- package/lib/esm/domain/JsonPropertyStore.js.map +1 -1
- package/lib/esm/domain/JsonRequestBody.js +2 -2
- package/lib/esm/domain/JsonResponse.js +4 -14
- package/lib/esm/domain/JsonResponse.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +9 -16
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/domain/SpecTypes.js +0 -3
- package/lib/esm/domain/SpecTypes.js.map +1 -1
- package/lib/esm/index.js +149 -20
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/from.js +5 -4
- package/lib/esm/utils/from.js.map +1 -1
- package/lib/esm/utils/generateSpec.js +50 -0
- package/lib/esm/utils/generateSpec.js.map +1 -0
- package/lib/esm/utils/generics.js.map +1 -1
- package/lib/esm/utils/getInheritedStores.js +1 -1
- package/lib/esm/utils/getJsonEntityStore.js +5 -5
- package/lib/esm/utils/getJsonSchema.js +14 -4
- package/lib/esm/utils/getJsonSchema.js.map +1 -1
- package/lib/esm/utils/getJsonType.js +2 -2
- package/lib/esm/utils/getJsonType.js.map +1 -1
- package/lib/esm/utils/getOperationsRoutes.js +5 -4
- package/lib/esm/utils/getOperationsRoutes.js.map +1 -1
- package/lib/esm/utils/getOperationsStores.js +4 -4
- package/lib/esm/utils/getPropertiesStores.js +3 -3
- package/lib/esm/utils/getRequiredProperties.js +1 -1
- package/lib/esm/utils/getSpec.js +65 -50
- package/lib/esm/utils/getSpec.js.map +1 -1
- package/lib/esm/utils/getSpecType.js +16 -0
- package/lib/esm/utils/getSpecType.js.map +1 -0
- package/lib/esm/utils/mapNullableType.js +2 -7
- package/lib/esm/utils/mapNullableType.js.map +1 -1
- package/lib/esm/utils/mapOpenSpec.js +37 -0
- package/lib/esm/utils/mapOpenSpec.js.map +1 -0
- package/lib/esm/utils/mapOpenSpec2.js +30 -0
- package/lib/esm/utils/mapOpenSpec2.js.map +1 -0
- package/lib/esm/utils/mapOpenSpec3.js +22 -0
- package/lib/esm/utils/mapOpenSpec3.js.map +1 -0
- package/lib/esm/utils/mapOpenSpecInfo.js +17 -0
- package/lib/esm/utils/mapOpenSpecInfo.js.map +1 -0
- package/lib/esm/utils/mapRouteOptions.js +1 -1
- package/lib/esm/utils/mergeOperation.js +4 -3
- package/lib/esm/utils/mergeOperation.js.map +1 -1
- package/lib/esm/utils/ref.js +1 -9
- package/lib/esm/utils/ref.js.map +1 -1
- package/lib/esm/utils/serializeEnumValues.js +21 -0
- package/lib/esm/utils/serializeEnumValues.js.map +1 -0
- package/lib/esm/utils/toJsonMapCollection.js +1 -1
- package/lib/types/constants/httpStatusMessages.d.ts +2 -263
- package/lib/types/decorators/common/ignore.d.ts +1 -1
- package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
- package/lib/types/decorators/common/recordOf.d.ts +46 -0
- package/lib/types/decorators/operations/acceptMime.d.ts +19 -0
- package/lib/types/decorators/operations/in.d.ts +1 -1
- package/lib/types/decorators/operations/view.d.ts +23 -0
- package/lib/types/domain/JsonMap.d.ts +1 -1
- package/lib/types/domain/JsonMethodStore.d.ts +51 -2
- package/lib/types/domain/JsonOperation.d.ts +2 -1
- package/lib/types/domain/JsonOperationRoute.d.ts +5 -3
- package/lib/types/domain/JsonParameter.d.ts +2 -1
- package/lib/types/domain/JsonParameterStore.d.ts +23 -1
- package/lib/types/domain/JsonPropertyStore.d.ts +7 -0
- package/lib/types/domain/JsonResponse.d.ts +2 -1
- package/lib/types/domain/JsonSchema.d.ts +2 -2
- package/lib/types/domain/SpecTypes.d.ts +0 -3
- package/lib/types/index.d.ts +142 -13
- package/lib/types/utils/generateSpec.d.ts +16 -0
- package/lib/types/utils/generics.d.ts +1 -1
- package/lib/types/utils/getJsonSchema.d.ts +12 -2
- package/lib/types/utils/getOperationsRoutes.d.ts +2 -2
- package/lib/types/utils/getSpec.d.ts +6 -25
- package/lib/types/utils/getSpecType.d.ts +12 -0
- package/lib/types/utils/mapNullableType.d.ts +1 -1
- package/lib/types/utils/mapOpenSpec.d.ts +10 -0
- package/lib/types/utils/mapOpenSpec2.d.ts +9 -0
- package/lib/types/utils/mapOpenSpec3.d.ts +8 -0
- package/lib/types/utils/mapOpenSpecInfo.d.ts +6 -0
- package/lib/types/utils/serializeEnumValues.d.ts +5 -0
- package/package.json +30 -15
- package/readme.md +1 -0
- package/tsconfig.compile.esm.json +2 -12
- package/benchmark/cold-start.js +0 -17
- package/lib/cjs/components/index.js +0 -15
- package/lib/cjs/components/index.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -77
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -20
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -8
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/esm/components/index.js +0 -12
- package/lib/esm/components/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -74
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -17
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -5
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/types/components/index.d.ts +0 -11
- package/lib/types/decorators/index.d.ts +0 -68
- package/lib/types/domain/index.d.ts +0 -16
- package/lib/types/interfaces/index.d.ts +0 -4
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "./JsonEntityStore";
|
|
2
|
+
import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore";
|
|
3
3
|
import type { JsonMethodStore } from "./JsonMethodStore";
|
|
4
4
|
import { JsonParameter } from "./JsonParameter";
|
|
5
5
|
import { JsonSchema } from "./JsonSchema";
|
|
6
|
+
export interface JsonParameterStoreOptions extends JsonEntityStoreOptions {
|
|
7
|
+
dataPath?: string;
|
|
8
|
+
paramType?: string;
|
|
9
|
+
expression?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PipeMethods<T = any, R = any> {
|
|
12
|
+
transform(value: T, metadata: JsonParameterStore): R;
|
|
13
|
+
}
|
|
6
14
|
export declare class JsonParameterStore extends JsonEntityStore {
|
|
15
|
+
paramType: string;
|
|
16
|
+
expression: string;
|
|
17
|
+
dataPath: string;
|
|
18
|
+
/**
|
|
19
|
+
* Define pipes can be called by the framework to transform input parameter
|
|
20
|
+
*/
|
|
21
|
+
pipes: Type<PipeMethods>[];
|
|
7
22
|
/**
|
|
8
23
|
* Ref to JsonParameter when the decorated object is a parameter.
|
|
9
24
|
*/
|
|
10
25
|
readonly parameter: JsonParameter;
|
|
11
26
|
readonly parent: JsonMethodStore;
|
|
27
|
+
constructor(options: JsonParameterStoreOptions);
|
|
12
28
|
get nestedGenerics(): Type<any>[][];
|
|
13
29
|
set nestedGenerics(nestedGenerics: Type<any>[][]);
|
|
14
30
|
/**
|
|
@@ -19,6 +35,7 @@ export declare class JsonParameterStore extends JsonEntityStore {
|
|
|
19
35
|
set required(value: boolean);
|
|
20
36
|
get allowedRequiredValues(): any[];
|
|
21
37
|
static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
|
|
38
|
+
static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
|
|
22
39
|
/**
|
|
23
40
|
* Check precondition between value, required and allowedRequiredValues to know if the entity is required.
|
|
24
41
|
* @param value
|
|
@@ -28,3 +45,8 @@ export declare class JsonParameterStore extends JsonEntityStore {
|
|
|
28
45
|
protected getSchema(type: any): JsonSchema;
|
|
29
46
|
protected build(): void;
|
|
30
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* @alias JsonParameterStore
|
|
50
|
+
*/
|
|
51
|
+
export declare type ParamMetadata = JsonParameterStore;
|
|
52
|
+
export declare const ParamMetadata: typeof JsonParameterStore;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
1
2
|
import { JsonEntityStore } from "./JsonEntityStore";
|
|
2
3
|
import type { JsonClassStore } from "./JsonClassStore";
|
|
3
4
|
export declare class JsonPropertyStore extends JsonEntityStore {
|
|
@@ -20,4 +21,10 @@ export declare class JsonPropertyStore extends JsonEntityStore {
|
|
|
20
21
|
*/
|
|
21
22
|
isRequired(value: any): boolean;
|
|
22
23
|
protected build(): void;
|
|
24
|
+
static get(target: Type<any>, propertyKey: string | symbol): JsonPropertyStore;
|
|
23
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @alias JsonPropertyStore
|
|
28
|
+
*/
|
|
29
|
+
export declare type PropertyMetadata = JsonPropertyStore;
|
|
30
|
+
export declare const PropertyMetadata: typeof JsonPropertyStore;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OS3MediaType, OS3Response } from "@tsed/openspec";
|
|
2
|
-
import { JsonHeader
|
|
2
|
+
import { JsonHeader } from "../interfaces/JsonOpenSpec";
|
|
3
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
4
|
import { JsonMap } from "./JsonMap";
|
|
4
5
|
import { JsonSchema } from "./JsonSchema";
|
|
5
6
|
export declare type JsonResponseOptions = OS3Response<JsonSchema, string | JsonHeader>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hooks, Type, ValueOf } from "@tsed/core";
|
|
2
2
|
import type { JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version } from "json-schema";
|
|
3
|
-
import { JsonSchemaOptions } from "../interfaces";
|
|
3
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
4
4
|
import { IgnoreCallback } from "../interfaces/IgnoreCallback";
|
|
5
5
|
import { NestedGenerics } from "../utils/generics";
|
|
6
6
|
import { AliasMap, AliasType } from "./JsonAliasMap";
|
|
@@ -218,7 +218,7 @@ export declare class JsonSchema extends Map<string, any> implements NestedGeneri
|
|
|
218
218
|
*
|
|
219
219
|
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
|
|
220
220
|
*/
|
|
221
|
-
enum(enumValues:
|
|
221
|
+
enum(...enumValues: any[]): this;
|
|
222
222
|
/**
|
|
223
223
|
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
|
|
224
224
|
*/
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,20 +1,149 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./components/anyMapper";
|
|
5
|
+
export * from "./components/classMapper";
|
|
6
|
+
export * from "./components/genericsMapper";
|
|
7
|
+
export * from "./components/inheritedClassMapper";
|
|
8
|
+
export * from "./components/itemMapper";
|
|
9
|
+
export * from "./components/lazyRefMapper";
|
|
10
|
+
export * from "./components/mapMapper";
|
|
11
|
+
export * from "./components/objectMapper";
|
|
12
|
+
export * from "./components/ofMapper";
|
|
13
|
+
export * from "./components/propertiesMapper";
|
|
14
|
+
export * from "./components/schemaMapper";
|
|
2
15
|
export * from "./constants/httpMethods";
|
|
16
|
+
export * from "./constants/httpStatusMessages";
|
|
17
|
+
export * from "./decorators/class/children";
|
|
18
|
+
export * from "./decorators/collections/collectionContains";
|
|
19
|
+
export * from "./decorators/collections/collectionOf";
|
|
20
|
+
export * from "./decorators/collections/maxItems";
|
|
21
|
+
export * from "./decorators/collections/maxProperties";
|
|
22
|
+
export * from "./decorators/collections/minItems";
|
|
23
|
+
export * from "./decorators/collections/minProperties";
|
|
24
|
+
export * from "./decorators/collections/uniqueItems";
|
|
25
|
+
export * from "./decorators/common/additionalProperties";
|
|
26
|
+
export * from "./decorators/common/allOf";
|
|
27
|
+
export * from "./decorators/common/allow";
|
|
28
|
+
export * from "./decorators/common/any";
|
|
29
|
+
export * from "./decorators/common/anyOf";
|
|
30
|
+
export * from "./decorators/common/const";
|
|
31
|
+
export * from "./decorators/common/customKey";
|
|
32
|
+
export * from "./decorators/common/default";
|
|
33
|
+
export * from "./decorators/common/description";
|
|
34
|
+
export * from "./decorators/common/enum";
|
|
35
|
+
export * from "./decorators/common/example";
|
|
36
|
+
export * from "./decorators/common/examples";
|
|
37
|
+
export * from "./decorators/common/exclusiveMaximum";
|
|
38
|
+
export * from "./decorators/common/exclusiveMinimum";
|
|
39
|
+
export * from "./decorators/common/format";
|
|
40
|
+
export * from "./decorators/common/forwardGroups";
|
|
41
|
+
export * from "./decorators/common/groups";
|
|
42
|
+
export * from "./decorators/common/hidden";
|
|
43
|
+
export * from "./decorators/common/ignore";
|
|
44
|
+
export * from "./decorators/common/integer";
|
|
45
|
+
export * from "./decorators/common/jsonEntityFn";
|
|
46
|
+
export * from "./decorators/common/maxLength";
|
|
47
|
+
export * from "./decorators/common/maximum";
|
|
48
|
+
export * from "./decorators/common/minLength";
|
|
49
|
+
export * from "./decorators/common/minimum";
|
|
50
|
+
export * from "./decorators/common/multipleOf";
|
|
51
|
+
export * from "./decorators/common/name";
|
|
52
|
+
export * from "./decorators/common/nullable";
|
|
53
|
+
export * from "./decorators/common/oneOf";
|
|
54
|
+
export * from "./decorators/common/optional";
|
|
55
|
+
export * from "./decorators/common/pattern";
|
|
56
|
+
export * from "./decorators/common/property";
|
|
57
|
+
export * from "./decorators/common/readOnly";
|
|
58
|
+
export * from "./decorators/common/recordOf";
|
|
59
|
+
export * from "./decorators/common/required";
|
|
60
|
+
export * from "./decorators/common/requiredGroups";
|
|
61
|
+
export * from "./decorators/common/schema";
|
|
62
|
+
export * from "./decorators/common/title";
|
|
63
|
+
export * from "./decorators/common/writeOnly";
|
|
64
|
+
export * from "./decorators/config/jsonEntityComponent";
|
|
65
|
+
export * from "./decorators/generics/genericOf";
|
|
66
|
+
export * from "./decorators/generics/generics";
|
|
67
|
+
export * from "./decorators/operations/acceptMime";
|
|
68
|
+
export * from "./decorators/operations/consumes";
|
|
69
|
+
export * from "./decorators/operations/contentType";
|
|
70
|
+
export * from "./decorators/operations/deprecated";
|
|
71
|
+
export * from "./decorators/operations/header";
|
|
72
|
+
export * from "./decorators/operations/in";
|
|
73
|
+
export * from "./decorators/operations/inFile";
|
|
74
|
+
export * from "./decorators/operations/location";
|
|
75
|
+
export * from "./decorators/operations/operationId";
|
|
76
|
+
export * from "./decorators/operations/operationPath";
|
|
77
|
+
export * from "./decorators/operations/partial";
|
|
78
|
+
export * from "./decorators/operations/path";
|
|
79
|
+
export * from "./decorators/operations/produces";
|
|
80
|
+
export * from "./decorators/operations/redirect";
|
|
81
|
+
export * from "./decorators/operations/returns";
|
|
82
|
+
export * from "./decorators/operations/route";
|
|
83
|
+
export * from "./decorators/operations/security";
|
|
84
|
+
export * from "./decorators/operations/status";
|
|
85
|
+
export * from "./decorators/operations/summary";
|
|
86
|
+
export * from "./decorators/operations/tags";
|
|
87
|
+
export * from "./decorators/operations/view";
|
|
88
|
+
export * from "./domain/DecoratorContext";
|
|
89
|
+
export * from "./domain/JsonAliasMap";
|
|
90
|
+
export * from "./domain/JsonClassStore";
|
|
91
|
+
export * from "./domain/JsonEntityStore";
|
|
92
|
+
export * from "./domain/JsonFormatTypes";
|
|
93
|
+
export * from "./domain/JsonLazyRef";
|
|
94
|
+
export * from "./domain/JsonMap";
|
|
95
|
+
export * from "./domain/JsonMethodStore";
|
|
96
|
+
export * from "./domain/JsonOperation";
|
|
97
|
+
export * from "./domain/JsonOperationPathsMap";
|
|
98
|
+
export * from "./domain/JsonOperationRoute";
|
|
99
|
+
export * from "./domain/JsonParameter";
|
|
100
|
+
export * from "./domain/JsonParameterStore";
|
|
101
|
+
export * from "./domain/JsonParameterTypes";
|
|
102
|
+
export * from "./domain/JsonPropertyStore";
|
|
103
|
+
export * from "./domain/JsonRequestBody";
|
|
104
|
+
export * from "./domain/JsonResponse";
|
|
105
|
+
export * from "./domain/JsonSchema";
|
|
106
|
+
export * from "./domain/SpecTypes";
|
|
107
|
+
export * from "./hooks/alterIgnore";
|
|
108
|
+
export * from "./hooks/alterOneOf";
|
|
109
|
+
export * from "./hooks/alterRequiredGroups";
|
|
110
|
+
export * from "./interfaces/IgnoreCallback";
|
|
111
|
+
export * from "./interfaces/JsonHookContext";
|
|
112
|
+
export * from "./interfaces/JsonOpenSpec";
|
|
113
|
+
export * from "./interfaces/JsonSchemaOptions";
|
|
114
|
+
export * from "./registries/JsonSchemaMapperContainer";
|
|
115
|
+
export * from "./utils/buildPath";
|
|
116
|
+
export * from "./utils/concatParameters";
|
|
117
|
+
export * from "./utils/concatPath";
|
|
118
|
+
export * from "./utils/defineStatusModel";
|
|
119
|
+
export * from "./utils/from";
|
|
120
|
+
export * from "./utils/generateSpec";
|
|
121
|
+
export * from "./utils/generics";
|
|
122
|
+
export * from "./utils/getComputedType";
|
|
123
|
+
export * from "./utils/getInheritedStores";
|
|
124
|
+
export * from "./utils/getJsonEntityStore";
|
|
125
|
+
export * from "./utils/getJsonPathParameters";
|
|
3
126
|
export * from "./utils/getJsonSchema";
|
|
4
127
|
export * from "./utils/getJsonType";
|
|
5
|
-
export * from "./utils/getPropertiesStores";
|
|
6
|
-
export * from "./utils/getOperationsStores";
|
|
7
128
|
export * from "./utils/getOperationsRoutes";
|
|
129
|
+
export * from "./utils/getOperationsStores";
|
|
130
|
+
export * from "./utils/getPropertiesStores";
|
|
131
|
+
export * from "./utils/getRequiredProperties";
|
|
8
132
|
export * from "./utils/getSpec";
|
|
9
|
-
export * from "./utils/
|
|
10
|
-
export * from "./utils/
|
|
133
|
+
export * from "./utils/getSpecType";
|
|
134
|
+
export * from "./utils/isSuccessStatus";
|
|
11
135
|
export * from "./utils/mapHeaders";
|
|
136
|
+
export * from "./utils/mapNullableType";
|
|
137
|
+
export * from "./utils/mapOpenSpec";
|
|
138
|
+
export * from "./utils/mapOpenSpec2";
|
|
139
|
+
export * from "./utils/mapOpenSpec3";
|
|
140
|
+
export * from "./utils/mapOpenSpecInfo";
|
|
141
|
+
export * from "./utils/mapRouteOptions";
|
|
12
142
|
export * from "./utils/matchGroups";
|
|
13
|
-
export * from "./utils/
|
|
14
|
-
export * from "./utils/
|
|
15
|
-
export * from "./utils/
|
|
16
|
-
export * from "./utils/
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./
|
|
19
|
-
export * from "./
|
|
20
|
-
export * from "./decorators";
|
|
143
|
+
export * from "./utils/mergeOperation";
|
|
144
|
+
export * from "./utils/mergeSpec";
|
|
145
|
+
export * from "./utils/operationIdFormatter";
|
|
146
|
+
export * from "./utils/ref";
|
|
147
|
+
export * from "./utils/serializeEnumValues";
|
|
148
|
+
export * from "./utils/toJsonMapCollection";
|
|
149
|
+
export * from "./utils/toJsonRegex";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
import { JsonTokenOptions, SpecSerializerOptions } from "./getSpec";
|
|
3
|
+
export interface GenerateSpecOptions extends Omit<SpecSerializerOptions, "specType"> {
|
|
4
|
+
tokens: JsonTokenOptions;
|
|
5
|
+
version?: string;
|
|
6
|
+
acceptMimes?: string;
|
|
7
|
+
specPath?: string;
|
|
8
|
+
specVersion?: string;
|
|
9
|
+
spec?: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate OpenAPI spec from multiple sources (models, files, conf)
|
|
13
|
+
* @param tokens
|
|
14
|
+
* @param options
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateSpec({ tokens, ...options }: GenerateSpecOptions): Promise<OpenSpec2 | OpenSpec3>;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import "../
|
|
3
|
-
import
|
|
2
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
|
+
import "../components/anyMapper";
|
|
4
|
+
import "../components/classMapper";
|
|
5
|
+
import "../components/genericsMapper";
|
|
6
|
+
import "../components/inheritedClassMapper";
|
|
7
|
+
import "../components/itemMapper";
|
|
8
|
+
import "../components/lazyRefMapper";
|
|
9
|
+
import "../components/mapMapper";
|
|
10
|
+
import "../components/objectMapper";
|
|
11
|
+
import "../components/ofMapper";
|
|
12
|
+
import "../components/propertiesMapper";
|
|
13
|
+
import "../components/schemaMapper";
|
|
4
14
|
export declare function getJsonSchema(model: Type<any> | any, options?: JsonSchemaOptions): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
+
import { JsonMethodStore } from "../domain/JsonMethodStore";
|
|
2
3
|
import { JsonOperationRoute } from "../domain/JsonOperationRoute";
|
|
3
|
-
import { JsonEntityStore } from "../domain/JsonEntityStore";
|
|
4
4
|
export interface GetOperationsRoutesOptions {
|
|
5
5
|
withChildren?: boolean;
|
|
6
6
|
basePath?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function getOperationsRoutes<Entity extends
|
|
8
|
+
export declare function getOperationsRoutes<Entity extends JsonMethodStore = JsonMethodStore>(token: Type<any> | any, options?: GetOperationsRoutesOptions): JsonOperationRoute<Entity>[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { OpenSpec3 } from "@tsed/openspec";
|
|
3
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
4
|
+
export declare type JsonTokenOptions = ({
|
|
5
|
+
token: Type<any>;
|
|
6
|
+
} & Partial<SpecSerializerOptions>)[];
|
|
5
7
|
export interface SpecSerializerOptions extends JsonSchemaOptions {
|
|
6
|
-
specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
7
8
|
/**
|
|
8
9
|
* Paths
|
|
9
10
|
*/
|
|
@@ -21,29 +22,9 @@ export interface SpecSerializerOptions extends JsonSchemaOptions {
|
|
|
21
22
|
*/
|
|
22
23
|
operationIdPattern?: string;
|
|
23
24
|
}
|
|
24
|
-
export interface OS3SpecSerializerOptions extends SpecSerializerOptions {
|
|
25
|
-
/**
|
|
26
|
-
* Define Spec types level
|
|
27
|
-
*/
|
|
28
|
-
specType: SpecTypes.OPENAPI;
|
|
29
|
-
}
|
|
30
|
-
export interface OS2SpecSerializerOptions extends SpecSerializerOptions {
|
|
31
|
-
/**
|
|
32
|
-
* Define Spec types level
|
|
33
|
-
*/
|
|
34
|
-
specType: SpecTypes.SWAGGER;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Return the swagger or open spec for the given class.
|
|
38
|
-
* @param model
|
|
39
|
-
* @param options
|
|
40
|
-
*/
|
|
41
|
-
export declare function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;
|
|
42
|
-
export declare function getSpec(model: Type<any>): Partial<OpenSpec2>;
|
|
43
|
-
export declare function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;
|
|
44
25
|
/**
|
|
45
26
|
* Return the swagger or open spec for the given class.
|
|
46
27
|
* @param model
|
|
47
28
|
* @param options
|
|
48
29
|
*/
|
|
49
|
-
export declare function getSpec(model: Type<any
|
|
30
|
+
export declare function getSpec(model: Type<any> | JsonTokenOptions, options?: SpecSerializerOptions): Partial<OpenSpec3>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
import { SpecTypes } from "../domain/SpecTypes";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
* @param version
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSpecType(version: string): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
8
|
+
/**
|
|
9
|
+
* @ignore
|
|
10
|
+
* @param spec
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSpecTypeFromSpec(spec: Partial<OpenSpec2 | OpenSpec3>): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { JsonSchema } from "../domain/JsonSchema";
|
|
2
2
|
import type { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
|
|
3
|
-
export declare function mapNullableType(obj: any, schema: JsonSchema, options: JsonSchemaOptions): any;
|
|
3
|
+
export declare function mapNullableType(obj: any, schema: JsonSchema | null, options: JsonSchemaOptions): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
* @param spec
|
|
5
|
+
* @param fileSpec
|
|
6
|
+
* @param version
|
|
7
|
+
* @param acceptMimes
|
|
8
|
+
* @param specVersion
|
|
9
|
+
*/
|
|
10
|
+
export declare function mapOpenSpec(spec: any, { fileSpec, acceptMimes, specVersion, version }: any): Partial<OpenSpec2 | OpenSpec3>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSpec2 } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
* @param spec
|
|
5
|
+
* @param version
|
|
6
|
+
* @param specVersion
|
|
7
|
+
* @param acceptMimes
|
|
8
|
+
*/
|
|
9
|
+
export declare function mapOpenSpec2(spec: Partial<OpenSpec2>, { version, specVersion, acceptMimes }: any): Partial<OpenSpec2>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.4",
|
|
4
4
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,10 +14,12 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
+
"clean": "rm -rf lib",
|
|
18
|
+
"build": "yarn clean && yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
17
19
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
20
|
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
19
|
-
"
|
|
21
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
22
|
+
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
|
|
20
23
|
},
|
|
21
24
|
"keywords": [
|
|
22
25
|
"TypeScript",
|
|
@@ -29,30 +32,42 @@
|
|
|
29
32
|
"tsed"
|
|
30
33
|
],
|
|
31
34
|
"dependencies": {
|
|
32
|
-
"@tsed/
|
|
33
|
-
"
|
|
35
|
+
"@tsed/openspec": "7.0.0-beta.4",
|
|
36
|
+
"api-spec-converter": "2.12.0",
|
|
34
37
|
"camel-case": "4.1.2",
|
|
38
|
+
"fs-extra": "^10.0.1",
|
|
35
39
|
"json-schema": "0.4.0",
|
|
36
|
-
"micromatch": "4.0.
|
|
40
|
+
"micromatch": "4.0.5",
|
|
37
41
|
"pascal-case": "3.1.2",
|
|
38
|
-
"
|
|
42
|
+
"statuses": ">=2.0.1",
|
|
43
|
+
"tslib": "2.3.1"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
|
-
"@apidevtools/swagger-parser": "10.0.
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@types/
|
|
45
|
-
"
|
|
46
|
+
"@apidevtools/swagger-parser": "10.0.3",
|
|
47
|
+
"@tsed/core": "7.0.0-beta.4",
|
|
48
|
+
"@tsed/openspec": "7.0.0-beta.4",
|
|
49
|
+
"@types/fs-extra": "9.0.13",
|
|
50
|
+
"@types/json-schema": "7.0.11",
|
|
51
|
+
"@types/micromatch": "4.0.2",
|
|
52
|
+
"@types/statuses": "2.0.0"
|
|
46
53
|
},
|
|
47
54
|
"peerDependencies": {
|
|
48
|
-
"@tsed/core": "^7.0.0-beta.
|
|
49
|
-
"@tsed/openspec": "^7.0.0-beta.
|
|
55
|
+
"@tsed/core": "^7.0.0-beta.4",
|
|
56
|
+
"@tsed/openspec": "^7.0.0-beta.4"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@tsed/openspec": {
|
|
60
|
+
"optional": false
|
|
61
|
+
},
|
|
62
|
+
"@tsed/core": {
|
|
63
|
+
"optional": false
|
|
64
|
+
}
|
|
50
65
|
},
|
|
51
66
|
"repository": "https://github.com/tsedio/tsed",
|
|
52
67
|
"bugs": {
|
|
53
68
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
54
69
|
},
|
|
55
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
70
|
+
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/schema",
|
|
56
71
|
"author": "Romain Lenzotti",
|
|
57
72
|
"license": "MIT"
|
|
58
73
|
}
|
package/readme.md
CHANGED
|
@@ -44,6 +44,7 @@ npm install --save @tsed/schema
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Contributors
|
|
47
|
+
|
|
47
48
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html)
|
|
48
49
|
|
|
49
50
|
<a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"include": ["src"],
|
|
12
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
13
|
}
|
package/benchmark/cold-start.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function printMemory(event) {
|
|
2
|
-
const used = process.memoryUsage();
|
|
3
|
-
const obj = {event};
|
|
4
|
-
|
|
5
|
-
for (let key in used) {
|
|
6
|
-
// console.log(`${key} ${} MB`);
|
|
7
|
-
obj[key] = Math.round((used[key] / 1024 / 1024) * 100) / 100;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
obj.timestamp = Date.now();
|
|
11
|
-
|
|
12
|
-
console.log(JSON.stringify(obj));
|
|
13
|
-
}
|
|
14
|
-
console.time("benchmark");
|
|
15
|
-
require("@tsed/schema");
|
|
16
|
-
console.timeEnd("benchmark");
|
|
17
|
-
printMemory();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./anyMapper"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./classMapper"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./genericsMapper"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./inheritedClassMapper"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./itemMapper"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./lazyRefMapper"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./mapMapper"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./objectMapper"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./schemaMapper"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./ofMapper"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./propertiesMapper"), exports);
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,2DAA4B;AAC5B,6DAA8B;AAC9B,gEAAiC;AACjC,sEAAuC;AACvC,4DAA6B;AAC7B,+DAAgC;AAChC,2DAA4B;AAC5B,8DAA+B;AAC/B,8DAA+B;AAC/B,0DAA2B;AAC3B,kEAAmC","sourcesContent":["export * from \"./anyMapper\";\nexport * from \"./classMapper\";\nexport * from \"./genericsMapper\";\nexport * from \"./inheritedClassMapper\";\nexport * from \"./itemMapper\";\nexport * from \"./lazyRefMapper\";\nexport * from \"./mapMapper\";\nexport * from \"./objectMapper\";\nexport * from \"./schemaMapper\";\nexport * from \"./ofMapper\";\nexport * from \"./propertiesMapper\";\n"]}
|