@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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonMethodStore } from "../components/index.js";
|
|
2
|
+
import { JsonOperationRoute } from "../domain/index.js";
|
|
2
3
|
import { OperationVerbs } from "../constants/OperationVerbs.js";
|
|
3
|
-
import {
|
|
4
|
-
import { JsonOperationRoute } from "../domain/JsonOperationRoute.js";
|
|
4
|
+
import { Type } from "@tsed/core";
|
|
5
5
|
export interface GetOperationsRoutesOptions {
|
|
6
6
|
withChildren?: boolean;
|
|
7
7
|
basePath?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { JsonPropertyStore } from "../components/index.js";
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
2
|
-
import type { JsonPropertyStore } from "../domain/JsonPropertyStore.js";
|
|
3
3
|
/**
|
|
4
4
|
* Return the list of properties including properties from inherited classes
|
|
5
5
|
* @param target
|
package/lib/types/utils/ref.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSONSchema7 } from "json-schema";
|
|
2
2
|
import type { JsonSchema } from "../domain/JsonSchema.js";
|
|
3
|
-
import { JsonSchemaOptions } from "../
|
|
3
|
+
import { JsonSchemaOptions } from "../domain/JsonSchemaOptions.js";
|
|
4
4
|
export declare function getSchemaFromRef($ref: string | undefined, options: JsonSchemaOptions): JSONSchema7 | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JsonMethodStore } from "../
|
|
1
|
+
import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
|
|
2
2
|
export declare function removeHiddenOperation(operationStore: JsonMethodStore): boolean;
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
+
"version": "8.35.0",
|
|
3
4
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
4
|
-
"
|
|
5
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"JsonSchema",
|
|
7
|
+
"TypeScript",
|
|
8
|
+
"class",
|
|
9
|
+
"classes",
|
|
10
|
+
"decorators",
|
|
11
|
+
"json schema",
|
|
12
|
+
"models",
|
|
13
|
+
"tsed"
|
|
14
|
+
],
|
|
6
15
|
"source": "./src/index.ts",
|
|
16
|
+
"type": "module",
|
|
7
17
|
"main": "./lib/esm/index.js",
|
|
8
18
|
"module": "./lib/esm/index.js",
|
|
9
19
|
"typings": "./lib/types/index.d.ts",
|
|
@@ -23,18 +33,8 @@
|
|
|
23
33
|
"build:ts": "tsc --build tsconfig.esm.json",
|
|
24
34
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
25
35
|
},
|
|
26
|
-
"keywords": [
|
|
27
|
-
"TypeScript",
|
|
28
|
-
"decorators",
|
|
29
|
-
"models",
|
|
30
|
-
"json schema",
|
|
31
|
-
"JsonSchema",
|
|
32
|
-
"class",
|
|
33
|
-
"classes",
|
|
34
|
-
"tsed"
|
|
35
|
-
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tsed/openspec": "8.
|
|
37
|
+
"@tsed/openspec": "8.35.0",
|
|
38
38
|
"change-case": "^5.4.4",
|
|
39
39
|
"json-schema": "0.4.0",
|
|
40
40
|
"picomatch": "4.0.4",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.1.0",
|
|
46
|
-
"@tsed/barrels": "8.
|
|
47
|
-
"@tsed/core": "8.
|
|
48
|
-
"@tsed/hooks": "8.
|
|
49
|
-
"@tsed/openspec": "8.
|
|
50
|
-
"@tsed/typescript": "8.
|
|
46
|
+
"@tsed/barrels": "8.35.0",
|
|
47
|
+
"@tsed/core": "8.35.0",
|
|
48
|
+
"@tsed/hooks": "8.35.0",
|
|
49
|
+
"@tsed/openspec": "8.35.0",
|
|
50
|
+
"@tsed/typescript": "8.35.0",
|
|
51
51
|
"@types/fs-extra": "11.0.4",
|
|
52
52
|
"@types/json-schema": "7.0.15",
|
|
53
53
|
"@types/picomatch": "3.0.2",
|
|
54
54
|
"@types/statuses": "2.0.5",
|
|
55
55
|
"ajv": "^8.17.1",
|
|
56
|
-
"
|
|
56
|
+
"temporal-polyfill": "1.0.1",
|
|
57
57
|
"typescript": "6.0.2",
|
|
58
58
|
"vitest": "4.1.4"
|
|
59
59
|
},
|
package/vitest.setup.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {Temporal} from "temporal-polyfill";
|
|
2
|
+
|
|
3
|
+
// Provide the global `Temporal` on runtimes that don't ship it natively yet (e.g. Node < 24),
|
|
4
|
+
// so the Temporal schema specs run in CI instead of throwing. Native `Temporal` (Node >= 24/26)
|
|
5
|
+
// takes precedence and the polyfill is a no-op there.
|
|
6
|
+
(globalThis as {Temporal?: unknown}).Temporal ??= Temporal;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { execMapper, registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js";
|
|
2
|
-
export function ofMapper(input, options) {
|
|
3
|
-
return input.map((value) => {
|
|
4
|
-
return execMapper("item", [value], options);
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
registerJsonSchemaMapper("anyOf", ofMapper);
|
|
8
|
-
registerJsonSchemaMapper("allOf", ofMapper);
|
|
9
|
-
registerJsonSchemaMapper("oneOf", ofMapper);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SpecTypes } from "../../domain/SpecTypes.js";
|
|
2
|
-
import { registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js";
|
|
3
|
-
import { discriminatorMappingMapper } from "../default/discriminatorMappingMapper.js";
|
|
4
|
-
registerJsonSchemaMapper("discriminatorMapping", discriminatorMappingMapper, SpecTypes.OPENAPI);
|
|
5
|
-
registerJsonSchemaMapper("discriminatorMapping", discriminatorMappingMapper, SpecTypes.SWAGGER);
|
|
6
|
-
registerJsonSchemaMapper("discriminatorMapping", discriminatorMappingMapper, SpecTypes.ASYNCAPI);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SpecTypes } from "../../domain/SpecTypes.js";
|
|
2
|
-
import { registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js";
|
|
3
|
-
import { enumsMapper } from "../default/enumsMapper.js";
|
|
4
|
-
export function wrapEnumsMapper(obj, schema, options) {
|
|
5
|
-
obj = enumsMapper(obj, schema, options);
|
|
6
|
-
if (obj.const) {
|
|
7
|
-
obj.enum = [obj.const];
|
|
8
|
-
delete obj.const;
|
|
9
|
-
}
|
|
10
|
-
return obj;
|
|
11
|
-
}
|
|
12
|
-
registerJsonSchemaMapper("enums", wrapEnumsMapper, SpecTypes.OPENAPI);
|
|
13
|
-
registerJsonSchemaMapper("enums", wrapEnumsMapper, SpecTypes.SWAGGER);
|
|
14
|
-
registerJsonSchemaMapper("enums", wrapEnumsMapper, SpecTypes.ASYNCAPI);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { execMapper, registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js";
|
|
2
|
-
export function operationInParametersMapper(parameters, options) {
|
|
3
|
-
return parameters.flatMap((parameter) => execMapper("operationInParameter", [parameter], options)).filter(Boolean);
|
|
4
|
-
}
|
|
5
|
-
registerJsonSchemaMapper("operationInParameters", operationInParametersMapper);
|
package/lib/esm/utils/compile.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getJsonSchema } from "./getJsonSchema.js";
|
|
2
|
-
/**
|
|
3
|
-
* Compile a class, parameter store, or `JsonSchema` into a plain JSON schema object.
|
|
4
|
-
*
|
|
5
|
-
* This is an alias of `getJsonSchema(...)`.
|
|
6
|
-
*
|
|
7
|
-
* @param model Class, parameter store, or `JsonSchema` to compile.
|
|
8
|
-
* @param options JSON schema generation options.
|
|
9
|
-
* @returns Compiled JSON schema object.
|
|
10
|
-
*/
|
|
11
|
-
export function compile(model, options = {}) {
|
|
12
|
-
return getJsonSchema(model, options);
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DecoratorTypes } from "@tsed/core";
|
|
2
|
-
import { JsonClassStore } from "../domain/JsonClassStore.js";
|
|
3
|
-
import { JsonEntitiesContainer, JsonEntityStore } from "../domain/JsonEntityStore.js";
|
|
4
|
-
import { JsonMethodStore } from "../domain/JsonMethodStore.js";
|
|
5
|
-
import { JsonParameterStore } from "../domain/JsonParameterStore.js";
|
|
6
|
-
import { JsonPropertyStore } from "../domain/JsonPropertyStore.js";
|
|
7
|
-
JsonEntitiesContainer.set(DecoratorTypes.CLASS, JsonClassStore);
|
|
8
|
-
JsonEntitiesContainer.set(DecoratorTypes.PROP, JsonPropertyStore);
|
|
9
|
-
JsonEntitiesContainer.set(DecoratorTypes.PARAM, JsonParameterStore);
|
|
10
|
-
JsonEntitiesContainer.set(DecoratorTypes.METHOD, JsonMethodStore);
|
|
11
|
-
export function getJsonEntityStore(...args) {
|
|
12
|
-
return JsonEntityStore.from(...args);
|
|
13
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { JsonParameter } from "../../domain/JsonParameter.js";
|
|
2
|
-
import { JsonSchemaOptions } from "../../interfaces/JsonSchemaOptions.js";
|
|
3
|
-
export declare function operationRequestBodyMapper(bodyParameters: JsonParameter[], { consumes, ...options }: JsonSchemaOptions): any;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import "../components/index.js";
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import { JsonParameterStore } from "../domain/JsonParameterStore.js";
|
|
4
|
-
import { JsonSchema } from "../domain/JsonSchema.js";
|
|
5
|
-
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
6
|
-
export declare function getJsonSchema(model: Type<any> | JsonParameterStore | JsonSchema, options?: JsonSchemaOptions): any;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
1
|
import { JsonTokenOptions, SpecSerializerOptions } from "./getSpec.js";
|
|
2
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
3
3
|
export interface GenerateSpecOptions extends Omit<SpecSerializerOptions, "specType"> {
|
|
4
4
|
tokens: JsonTokenOptions;
|
|
5
5
|
version?: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|