@tsed/schema 7.0.0-beta.2 → 7.0.0-beta.20
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/coverage.json +6 -0
- package/jest.config.js +1 -6
- package/lib/cjs/components/lazyRefMapper.js +1 -2
- package/lib/cjs/components/lazyRefMapper.js.map +1 -1
- package/lib/cjs/components/objectMapper.js +1 -1
- package/lib/cjs/components/objectMapper.js.map +1 -1
- package/lib/cjs/components/schemaMapper.js +1 -1
- package/lib/cjs/components/schemaMapper.js.map +1 -1
- package/lib/cjs/constants/httpStatusMessages.js +14 -100
- package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
- package/lib/cjs/decorators/collections/collectionOf.js +3 -4
- package/lib/cjs/decorators/collections/collectionOf.js.map +1 -1
- package/lib/cjs/decorators/common/anyOf.js +4 -0
- package/lib/cjs/decorators/common/anyOf.js.map +1 -1
- package/lib/cjs/decorators/common/description.js +1 -2
- 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/oneOf.js +4 -0
- package/lib/cjs/decorators/common/oneOf.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/redirect.js +1 -2
- package/lib/cjs/decorators/operations/redirect.js.map +1 -1
- package/lib/cjs/decorators/operations/returns.js +43 -21
- package/lib/cjs/decorators/operations/returns.js.map +1 -1
- package/lib/cjs/decorators/operations/route.js +1 -4
- package/lib/cjs/decorators/operations/route.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 +6 -3
- package/lib/cjs/domain/DecoratorContext.js.map +1 -1
- package/lib/cjs/domain/JsonClassStore.js +5 -8
- package/lib/cjs/domain/JsonClassStore.js.map +1 -1
- package/lib/cjs/domain/JsonEntityStore.js +40 -1
- package/lib/cjs/domain/JsonEntityStore.js.map +1 -1
- package/lib/cjs/domain/JsonLazyRef.js +2 -1
- package/lib/cjs/domain/JsonLazyRef.js.map +1 -1
- package/lib/cjs/domain/JsonMap.js.map +1 -1
- package/lib/cjs/domain/JsonMethodStore.js +85 -39
- package/lib/cjs/domain/JsonMethodStore.js.map +1 -1
- package/lib/cjs/domain/JsonOperation.js +15 -34
- package/lib/cjs/domain/JsonOperation.js.map +1 -1
- package/lib/cjs/domain/JsonOperationPathsMap.js +2 -16
- package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/cjs/domain/JsonOperationRoute.js +11 -8
- package/lib/cjs/domain/JsonOperationRoute.js.map +1 -1
- package/lib/cjs/domain/JsonParameter.js +42 -48
- package/lib/cjs/domain/JsonParameter.js.map +1 -1
- package/lib/cjs/domain/JsonParameterStore.js +26 -10
- package/lib/cjs/domain/JsonParameterStore.js.map +1 -1
- package/lib/cjs/domain/JsonPropertyStore.js +7 -6
- package/lib/cjs/domain/JsonPropertyStore.js.map +1 -1
- package/lib/cjs/domain/JsonResponse.js +7 -18
- package/lib/cjs/domain/JsonResponse.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +62 -71
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/domain/SpecTypes.js +1 -0
- package/lib/cjs/domain/SpecTypes.js.map +1 -1
- package/lib/cjs/hooks/alterIgnore.js +2 -3
- package/lib/cjs/hooks/alterIgnore.js.map +1 -1
- package/lib/cjs/hooks/alterRequiredGroups.js +1 -2
- package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -1
- package/lib/cjs/index.js +150 -20
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/utils/concatPath.js +16 -1
- package/lib/cjs/utils/concatPath.js.map +1 -1
- package/lib/cjs/utils/from.js +9 -8
- package/lib/cjs/utils/from.js.map +1 -1
- package/lib/cjs/utils/generateSpec.js +46 -0
- package/lib/cjs/utils/generateSpec.js.map +1 -0
- package/lib/cjs/utils/generics.js.map +1 -1
- package/lib/cjs/utils/getJsonPathParameters.js +20 -6
- package/lib/cjs/utils/getJsonPathParameters.js.map +1 -1
- package/lib/cjs/utils/getJsonSchema.js +12 -3
- 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/getRequiredProperties.js +3 -3
- package/lib/cjs/utils/getRequiredProperties.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 -1
- 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 +2 -2
- package/lib/cjs/utils/mergeOperation.js.map +1 -1
- package/lib/cjs/utils/mergeSpec.js.map +1 -1
- package/lib/cjs/utils/operationIdFormatter.js +3 -3
- package/lib/cjs/utils/operationIdFormatter.js.map +1 -1
- package/lib/cjs/utils/ref.js +2 -2
- 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/cjs/utils/transformToOS2.js +510 -0
- package/lib/cjs/utils/transformToOS2.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 +4 -5
- package/lib/esm/components/lazyRefMapper.js.map +1 -1
- package/lib/esm/components/mapMapper.js +2 -2
- package/lib/esm/components/objectMapper.js +4 -4
- package/lib/esm/components/objectMapper.js.map +1 -1
- package/lib/esm/components/ofMapper.js +1 -1
- package/lib/esm/components/propertiesMapper.js +1 -1
- package/lib/esm/components/schemaMapper.js +7 -7
- package/lib/esm/components/schemaMapper.js.map +1 -1
- package/lib/esm/constants/httpStatusMessages.js +13 -100
- 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 +4 -5
- package/lib/esm/decorators/collections/collectionOf.js.map +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 +5 -1
- package/lib/esm/decorators/common/anyOf.js.map +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 +2 -3
- 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 +5 -1
- package/lib/esm/decorators/common/oneOf.js.map +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 +3 -4
- package/lib/esm/decorators/operations/redirect.js.map +1 -1
- package/lib/esm/decorators/operations/returns.js +51 -29
- package/lib/esm/decorators/operations/returns.js.map +1 -1
- package/lib/esm/decorators/operations/route.js +4 -7
- package/lib/esm/decorators/operations/route.js.map +1 -1
- 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 +6 -3
- package/lib/esm/domain/DecoratorContext.js.map +1 -1
- package/lib/esm/domain/JsonClassStore.js +7 -10
- package/lib/esm/domain/JsonClassStore.js.map +1 -1
- package/lib/esm/domain/JsonEntityStore.js +40 -1
- package/lib/esm/domain/JsonEntityStore.js.map +1 -1
- package/lib/esm/domain/JsonLazyRef.js +4 -3
- package/lib/esm/domain/JsonLazyRef.js.map +1 -1
- package/lib/esm/domain/JsonMap.js +1 -1
- package/lib/esm/domain/JsonMap.js.map +1 -1
- package/lib/esm/domain/JsonMethodStore.js +86 -40
- package/lib/esm/domain/JsonMethodStore.js.map +1 -1
- package/lib/esm/domain/JsonOperation.js +22 -41
- package/lib/esm/domain/JsonOperation.js.map +1 -1
- package/lib/esm/domain/JsonOperationPathsMap.js +3 -17
- package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/esm/domain/JsonOperationRoute.js +12 -9
- package/lib/esm/domain/JsonOperationRoute.js.map +1 -1
- package/lib/esm/domain/JsonParameter.js +46 -52
- package/lib/esm/domain/JsonParameter.js.map +1 -1
- package/lib/esm/domain/JsonParameterStore.js +29 -13
- package/lib/esm/domain/JsonParameterStore.js.map +1 -1
- package/lib/esm/domain/JsonPropertyStore.js +8 -7
- package/lib/esm/domain/JsonPropertyStore.js.map +1 -1
- package/lib/esm/domain/JsonRequestBody.js +2 -2
- package/lib/esm/domain/JsonResponse.js +10 -21
- package/lib/esm/domain/JsonResponse.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +67 -76
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/domain/SpecTypes.js +1 -0
- package/lib/esm/domain/SpecTypes.js.map +1 -1
- package/lib/esm/hooks/alterIgnore.js +2 -3
- package/lib/esm/hooks/alterIgnore.js.map +1 -1
- package/lib/esm/hooks/alterRequiredGroups.js +1 -2
- package/lib/esm/hooks/alterRequiredGroups.js.map +1 -1
- package/lib/esm/index.js +150 -20
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/concatPath.js +16 -1
- package/lib/esm/utils/concatPath.js.map +1 -1
- package/lib/esm/utils/from.js +5 -4
- package/lib/esm/utils/from.js.map +1 -1
- package/lib/esm/utils/generateSpec.js +41 -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/getJsonPathParameters.js +20 -6
- package/lib/esm/utils/getJsonPathParameters.js.map +1 -1
- package/lib/esm/utils/getJsonSchema.js +15 -6
- 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 +4 -4
- package/lib/esm/utils/getRequiredProperties.js.map +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 -2
- 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 +5 -5
- package/lib/esm/utils/mergeOperation.js.map +1 -1
- package/lib/esm/utils/mergeSpec.js.map +1 -1
- package/lib/esm/utils/operationIdFormatter.js +1 -1
- package/lib/esm/utils/operationIdFormatter.js.map +1 -1
- package/lib/esm/utils/ref.js +2 -2
- 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/esm/utils/transformToOS2.js +504 -0
- package/lib/esm/utils/transformToOS2.js.map +1 -0
- package/lib/types/constants/httpStatusMessages.d.ts +2 -263
- package/lib/types/decorators/common/anyOf.d.ts +4 -0
- 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/oneOf.d.ts +4 -0
- 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/returns.d.ts +7 -2
- package/lib/types/decorators/operations/view.d.ts +23 -0
- package/lib/types/domain/JsonEntityStore.d.ts +1 -0
- package/lib/types/domain/JsonMap.d.ts +1 -1
- package/lib/types/domain/JsonMethodStore.d.ts +56 -4
- package/lib/types/domain/JsonOperation.d.ts +2 -2
- package/lib/types/domain/JsonOperationPathsMap.d.ts +0 -2
- package/lib/types/domain/JsonOperationRoute.d.ts +7 -6
- 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 +3 -1
- package/lib/types/domain/JsonSchema.d.ts +2 -2
- package/lib/types/domain/SpecTypes.d.ts +1 -0
- package/lib/types/index.d.ts +143 -13
- package/lib/types/interfaces/JsonSchemaOptions.d.ts +2 -2
- package/lib/types/utils/concatPath.d.ts +1 -1
- 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 +5 -4
- 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/mergeSpec.d.ts +2 -2
- package/lib/types/utils/serializeEnumValues.d.ts +5 -0
- package/lib/types/utils/transformToOS2.d.ts +25 -0
- package/package.json +35 -18
- package/readme.md +4 -2
- package/tsconfig.compile.esm.json +4 -13
- 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
package/lib/cjs/index.js
CHANGED
|
@@ -1,24 +1,154 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
tslib_1.__exportStar(require("./components/anyMapper"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./components/classMapper"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./components/genericsMapper"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./components/inheritedClassMapper"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./components/itemMapper"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./components/lazyRefMapper"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./components/mapMapper"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./components/objectMapper"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./components/ofMapper"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./components/propertiesMapper"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./components/schemaMapper"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./constants/httpMethods"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./constants/httpStatusMessages"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./decorators/class/children"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./decorators/collections/collectionContains"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./decorators/collections/collectionOf"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./decorators/collections/maxItems"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./decorators/collections/maxProperties"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./decorators/collections/minItems"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./decorators/collections/minProperties"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./decorators/collections/uniqueItems"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./decorators/common/additionalProperties"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./decorators/common/allOf"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./decorators/common/allow"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./decorators/common/any"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./decorators/common/anyOf"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./decorators/common/const"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./decorators/common/customKey"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./decorators/common/default"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./decorators/common/description"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./decorators/common/enum"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./decorators/common/example"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./decorators/common/examples"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./decorators/common/exclusiveMaximum"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./decorators/common/exclusiveMinimum"), exports);
|
|
42
|
+
tslib_1.__exportStar(require("./decorators/common/format"), exports);
|
|
43
|
+
tslib_1.__exportStar(require("./decorators/common/forwardGroups"), exports);
|
|
44
|
+
tslib_1.__exportStar(require("./decorators/common/groups"), exports);
|
|
45
|
+
tslib_1.__exportStar(require("./decorators/common/hidden"), exports);
|
|
46
|
+
tslib_1.__exportStar(require("./decorators/common/ignore"), exports);
|
|
47
|
+
tslib_1.__exportStar(require("./decorators/common/integer"), exports);
|
|
48
|
+
tslib_1.__exportStar(require("./decorators/common/jsonEntityFn"), exports);
|
|
49
|
+
tslib_1.__exportStar(require("./decorators/common/maxLength"), exports);
|
|
50
|
+
tslib_1.__exportStar(require("./decorators/common/maximum"), exports);
|
|
51
|
+
tslib_1.__exportStar(require("./decorators/common/minLength"), exports);
|
|
52
|
+
tslib_1.__exportStar(require("./decorators/common/minimum"), exports);
|
|
53
|
+
tslib_1.__exportStar(require("./decorators/common/multipleOf"), exports);
|
|
54
|
+
tslib_1.__exportStar(require("./decorators/common/name"), exports);
|
|
55
|
+
tslib_1.__exportStar(require("./decorators/common/nullable"), exports);
|
|
56
|
+
tslib_1.__exportStar(require("./decorators/common/oneOf"), exports);
|
|
57
|
+
tslib_1.__exportStar(require("./decorators/common/optional"), exports);
|
|
58
|
+
tslib_1.__exportStar(require("./decorators/common/pattern"), exports);
|
|
59
|
+
tslib_1.__exportStar(require("./decorators/common/property"), exports);
|
|
60
|
+
tslib_1.__exportStar(require("./decorators/common/readOnly"), exports);
|
|
61
|
+
tslib_1.__exportStar(require("./decorators/common/recordOf"), exports);
|
|
62
|
+
tslib_1.__exportStar(require("./decorators/common/required"), exports);
|
|
63
|
+
tslib_1.__exportStar(require("./decorators/common/requiredGroups"), exports);
|
|
64
|
+
tslib_1.__exportStar(require("./decorators/common/schema"), exports);
|
|
65
|
+
tslib_1.__exportStar(require("./decorators/common/title"), exports);
|
|
66
|
+
tslib_1.__exportStar(require("./decorators/common/writeOnly"), exports);
|
|
67
|
+
tslib_1.__exportStar(require("./decorators/config/jsonEntityComponent"), exports);
|
|
68
|
+
tslib_1.__exportStar(require("./decorators/generics/genericOf"), exports);
|
|
69
|
+
tslib_1.__exportStar(require("./decorators/generics/generics"), exports);
|
|
70
|
+
tslib_1.__exportStar(require("./decorators/operations/acceptMime"), exports);
|
|
71
|
+
tslib_1.__exportStar(require("./decorators/operations/consumes"), exports);
|
|
72
|
+
tslib_1.__exportStar(require("./decorators/operations/contentType"), exports);
|
|
73
|
+
tslib_1.__exportStar(require("./decorators/operations/deprecated"), exports);
|
|
74
|
+
tslib_1.__exportStar(require("./decorators/operations/header"), exports);
|
|
75
|
+
tslib_1.__exportStar(require("./decorators/operations/in"), exports);
|
|
76
|
+
tslib_1.__exportStar(require("./decorators/operations/inFile"), exports);
|
|
77
|
+
tslib_1.__exportStar(require("./decorators/operations/location"), exports);
|
|
78
|
+
tslib_1.__exportStar(require("./decorators/operations/operationId"), exports);
|
|
79
|
+
tslib_1.__exportStar(require("./decorators/operations/operationPath"), exports);
|
|
80
|
+
tslib_1.__exportStar(require("./decorators/operations/partial"), exports);
|
|
81
|
+
tslib_1.__exportStar(require("./decorators/operations/path"), exports);
|
|
82
|
+
tslib_1.__exportStar(require("./decorators/operations/produces"), exports);
|
|
83
|
+
tslib_1.__exportStar(require("./decorators/operations/redirect"), exports);
|
|
84
|
+
tslib_1.__exportStar(require("./decorators/operations/returns"), exports);
|
|
85
|
+
tslib_1.__exportStar(require("./decorators/operations/route"), exports);
|
|
86
|
+
tslib_1.__exportStar(require("./decorators/operations/security"), exports);
|
|
87
|
+
tslib_1.__exportStar(require("./decorators/operations/status"), exports);
|
|
88
|
+
tslib_1.__exportStar(require("./decorators/operations/summary"), exports);
|
|
89
|
+
tslib_1.__exportStar(require("./decorators/operations/tags"), exports);
|
|
90
|
+
tslib_1.__exportStar(require("./decorators/operations/view"), exports);
|
|
91
|
+
tslib_1.__exportStar(require("./domain/DecoratorContext"), exports);
|
|
92
|
+
tslib_1.__exportStar(require("./domain/JsonAliasMap"), exports);
|
|
93
|
+
tslib_1.__exportStar(require("./domain/JsonClassStore"), exports);
|
|
94
|
+
tslib_1.__exportStar(require("./domain/JsonEntityStore"), exports);
|
|
95
|
+
tslib_1.__exportStar(require("./domain/JsonFormatTypes"), exports);
|
|
96
|
+
tslib_1.__exportStar(require("./domain/JsonLazyRef"), exports);
|
|
97
|
+
tslib_1.__exportStar(require("./domain/JsonMap"), exports);
|
|
98
|
+
tslib_1.__exportStar(require("./domain/JsonMethodStore"), exports);
|
|
99
|
+
tslib_1.__exportStar(require("./domain/JsonOperation"), exports);
|
|
100
|
+
tslib_1.__exportStar(require("./domain/JsonOperationPathsMap"), exports);
|
|
101
|
+
tslib_1.__exportStar(require("./domain/JsonOperationRoute"), exports);
|
|
102
|
+
tslib_1.__exportStar(require("./domain/JsonParameter"), exports);
|
|
103
|
+
tslib_1.__exportStar(require("./domain/JsonParameterStore"), exports);
|
|
104
|
+
tslib_1.__exportStar(require("./domain/JsonParameterTypes"), exports);
|
|
105
|
+
tslib_1.__exportStar(require("./domain/JsonPropertyStore"), exports);
|
|
106
|
+
tslib_1.__exportStar(require("./domain/JsonRequestBody"), exports);
|
|
107
|
+
tslib_1.__exportStar(require("./domain/JsonResponse"), exports);
|
|
108
|
+
tslib_1.__exportStar(require("./domain/JsonSchema"), exports);
|
|
109
|
+
tslib_1.__exportStar(require("./domain/SpecTypes"), exports);
|
|
110
|
+
tslib_1.__exportStar(require("./hooks/alterIgnore"), exports);
|
|
111
|
+
tslib_1.__exportStar(require("./hooks/alterOneOf"), exports);
|
|
112
|
+
tslib_1.__exportStar(require("./hooks/alterRequiredGroups"), exports);
|
|
113
|
+
tslib_1.__exportStar(require("./interfaces/IgnoreCallback"), exports);
|
|
114
|
+
tslib_1.__exportStar(require("./interfaces/JsonHookContext"), exports);
|
|
115
|
+
tslib_1.__exportStar(require("./interfaces/JsonOpenSpec"), exports);
|
|
116
|
+
tslib_1.__exportStar(require("./interfaces/JsonSchemaOptions"), exports);
|
|
117
|
+
tslib_1.__exportStar(require("./registries/JsonSchemaMapperContainer"), exports);
|
|
118
|
+
tslib_1.__exportStar(require("./utils/buildPath"), exports);
|
|
119
|
+
tslib_1.__exportStar(require("./utils/concatParameters"), exports);
|
|
120
|
+
tslib_1.__exportStar(require("./utils/concatPath"), exports);
|
|
121
|
+
tslib_1.__exportStar(require("./utils/defineStatusModel"), exports);
|
|
122
|
+
tslib_1.__exportStar(require("./utils/from"), exports);
|
|
123
|
+
tslib_1.__exportStar(require("./utils/generateSpec"), exports);
|
|
124
|
+
tslib_1.__exportStar(require("./utils/generics"), exports);
|
|
125
|
+
tslib_1.__exportStar(require("./utils/getComputedType"), exports);
|
|
126
|
+
tslib_1.__exportStar(require("./utils/getInheritedStores"), exports);
|
|
127
|
+
tslib_1.__exportStar(require("./utils/getJsonEntityStore"), exports);
|
|
128
|
+
tslib_1.__exportStar(require("./utils/getJsonPathParameters"), exports);
|
|
129
|
+
tslib_1.__exportStar(require("./utils/getJsonSchema"), exports);
|
|
130
|
+
tslib_1.__exportStar(require("./utils/getJsonType"), exports);
|
|
131
|
+
tslib_1.__exportStar(require("./utils/getOperationsRoutes"), exports);
|
|
132
|
+
tslib_1.__exportStar(require("./utils/getOperationsStores"), exports);
|
|
133
|
+
tslib_1.__exportStar(require("./utils/getPropertiesStores"), exports);
|
|
134
|
+
tslib_1.__exportStar(require("./utils/getRequiredProperties"), exports);
|
|
135
|
+
tslib_1.__exportStar(require("./utils/getSpec"), exports);
|
|
136
|
+
tslib_1.__exportStar(require("./utils/getSpecType"), exports);
|
|
137
|
+
tslib_1.__exportStar(require("./utils/isSuccessStatus"), exports);
|
|
138
|
+
tslib_1.__exportStar(require("./utils/mapHeaders"), exports);
|
|
139
|
+
tslib_1.__exportStar(require("./utils/mapNullableType"), exports);
|
|
140
|
+
tslib_1.__exportStar(require("./utils/mapOpenSpec"), exports);
|
|
141
|
+
tslib_1.__exportStar(require("./utils/mapOpenSpec2"), exports);
|
|
142
|
+
tslib_1.__exportStar(require("./utils/mapOpenSpec3"), exports);
|
|
143
|
+
tslib_1.__exportStar(require("./utils/mapOpenSpecInfo"), exports);
|
|
144
|
+
tslib_1.__exportStar(require("./utils/mapRouteOptions"), exports);
|
|
145
|
+
tslib_1.__exportStar(require("./utils/matchGroups"), exports);
|
|
146
|
+
tslib_1.__exportStar(require("./utils/mergeOperation"), exports);
|
|
147
|
+
tslib_1.__exportStar(require("./utils/mergeSpec"), exports);
|
|
148
|
+
tslib_1.__exportStar(require("./utils/operationIdFormatter"), exports);
|
|
149
|
+
tslib_1.__exportStar(require("./utils/ref"), exports);
|
|
150
|
+
tslib_1.__exportStar(require("./utils/serializeEnumValues"), exports);
|
|
151
|
+
tslib_1.__exportStar(require("./utils/toJsonMapCollection"), exports);
|
|
152
|
+
tslib_1.__exportStar(require("./utils/toJsonRegex"), exports);
|
|
153
|
+
tslib_1.__exportStar(require("./utils/transformToOS2"), exports);
|
|
24
154
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAAuC;AACvC,mEAAyC;AACzC,sEAA4C;AAC5C,4EAAkD;AAClD,kEAAwC;AACxC,qEAA2C;AAC3C,iEAAuC;AACvC,oEAA0C;AAC1C,gEAAsC;AACtC,wEAA8C;AAC9C,oEAA0C;AAC1C,kEAAwC;AACxC,yEAA+C;AAC/C,sEAA4C;AAC5C,sFAA4D;AAC5D,gFAAsD;AACtD,4EAAkD;AAClD,iFAAuD;AACvD,4EAAkD;AAClD,iFAAuD;AACvD,+EAAqD;AACrD,mFAAyD;AACzD,oEAA0C;AAC1C,oEAA0C;AAC1C,kEAAwC;AACxC,oEAA0C;AAC1C,oEAA0C;AAC1C,wEAA8C;AAC9C,sEAA4C;AAC5C,0EAAgD;AAChD,mEAAyC;AACzC,sEAA4C;AAC5C,uEAA6C;AAC7C,+EAAqD;AACrD,+EAAqD;AACrD,qEAA2C;AAC3C,4EAAkD;AAClD,qEAA2C;AAC3C,qEAA2C;AAC3C,qEAA2C;AAC3C,sEAA4C;AAC5C,2EAAiD;AACjD,wEAA8C;AAC9C,sEAA4C;AAC5C,wEAA8C;AAC9C,sEAA4C;AAC5C,yEAA+C;AAC/C,mEAAyC;AACzC,uEAA6C;AAC7C,oEAA0C;AAC1C,uEAA6C;AAC7C,sEAA4C;AAC5C,uEAA6C;AAC7C,uEAA6C;AAC7C,uEAA6C;AAC7C,uEAA6C;AAC7C,6E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C,iEAAuC;AACvC,4DAAkC;AAClC,uEAA6C;AAC7C,sDAA4B;AAC5B,sEAA4C;AAC5C,sEAA4C;AAC5C,8DAAoC;AACpC,iEAAuC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/anyMapper\";\nexport * from \"./components/classMapper\";\nexport * from \"./components/genericsMapper\";\nexport * from \"./components/inheritedClassMapper\";\nexport * from \"./components/itemMapper\";\nexport * from \"./components/lazyRefMapper\";\nexport * from \"./components/mapMapper\";\nexport * from \"./components/objectMapper\";\nexport * from \"./components/ofMapper\";\nexport * from \"./components/propertiesMapper\";\nexport * from \"./components/schemaMapper\";\nexport * from \"./constants/httpMethods\";\nexport * from \"./constants/httpStatusMessages\";\nexport * from \"./decorators/class/children\";\nexport * from \"./decorators/collections/collectionContains\";\nexport * from \"./decorators/collections/collectionOf\";\nexport * from \"./decorators/collections/maxItems\";\nexport * from \"./decorators/collections/maxProperties\";\nexport * from \"./decorators/collections/minItems\";\nexport * from \"./decorators/collections/minProperties\";\nexport * from \"./decorators/collections/uniqueItems\";\nexport * from \"./decorators/common/additionalProperties\";\nexport * from \"./decorators/common/allOf\";\nexport * from \"./decorators/common/allow\";\nexport * from \"./decorators/common/any\";\nexport * from \"./decorators/common/anyOf\";\nexport * from \"./decorators/common/const\";\nexport * from \"./decorators/common/customKey\";\nexport * from \"./decorators/common/default\";\nexport * from \"./decorators/common/description\";\nexport * from \"./decorators/common/enum\";\nexport * from \"./decorators/common/example\";\nexport * from \"./decorators/common/examples\";\nexport * from \"./decorators/common/exclusiveMaximum\";\nexport * from \"./decorators/common/exclusiveMinimum\";\nexport * from \"./decorators/common/format\";\nexport * from \"./decorators/common/forwardGroups\";\nexport * from \"./decorators/common/groups\";\nexport * from \"./decorators/common/hidden\";\nexport * from \"./decorators/common/ignore\";\nexport * from \"./decorators/common/integer\";\nexport * from \"./decorators/common/jsonEntityFn\";\nexport * from \"./decorators/common/maxLength\";\nexport * from \"./decorators/common/maximum\";\nexport * from \"./decorators/common/minLength\";\nexport * from \"./decorators/common/minimum\";\nexport * from \"./decorators/common/multipleOf\";\nexport * from \"./decorators/common/name\";\nexport * from \"./decorators/common/nullable\";\nexport * from \"./decorators/common/oneOf\";\nexport * from \"./decorators/common/optional\";\nexport * from \"./decorators/common/pattern\";\nexport * from \"./decorators/common/property\";\nexport * from \"./decorators/common/readOnly\";\nexport * from \"./decorators/common/recordOf\";\nexport * from \"./decorators/common/required\";\nexport * from \"./decorators/common/requiredGroups\";\nexport * from \"./decorators/common/schema\";\nexport * from \"./decorators/common/title\";\nexport * from \"./decorators/common/writeOnly\";\nexport * from \"./decorators/config/jsonEntityComponent\";\nexport * from \"./decorators/generics/genericOf\";\nexport * from \"./decorators/generics/generics\";\nexport * from \"./decorators/operations/acceptMime\";\nexport * from \"./decorators/operations/consumes\";\nexport * from \"./decorators/operations/contentType\";\nexport * from \"./decorators/operations/deprecated\";\nexport * from \"./decorators/operations/header\";\nexport * from \"./decorators/operations/in\";\nexport * from \"./decorators/operations/inFile\";\nexport * from \"./decorators/operations/location\";\nexport * from \"./decorators/operations/operationId\";\nexport * from \"./decorators/operations/operationPath\";\nexport * from \"./decorators/operations/partial\";\nexport * from \"./decorators/operations/path\";\nexport * from \"./decorators/operations/produces\";\nexport * from \"./decorators/operations/redirect\";\nexport * from \"./decorators/operations/returns\";\nexport * from \"./decorators/operations/route\";\nexport * from \"./decorators/operations/security\";\nexport * from \"./decorators/operations/status\";\nexport * from \"./decorators/operations/summary\";\nexport * from \"./decorators/operations/tags\";\nexport * from \"./decorators/operations/view\";\nexport * from \"./domain/DecoratorContext\";\nexport * from \"./domain/JsonAliasMap\";\nexport * from \"./domain/JsonClassStore\";\nexport * from \"./domain/JsonEntityStore\";\nexport * from \"./domain/JsonFormatTypes\";\nexport * from \"./domain/JsonLazyRef\";\nexport * from \"./domain/JsonMap\";\nexport * from \"./domain/JsonMethodStore\";\nexport * from \"./domain/JsonOperation\";\nexport * from \"./domain/JsonOperationPathsMap\";\nexport * from \"./domain/JsonOperationRoute\";\nexport * from \"./domain/JsonParameter\";\nexport * from \"./domain/JsonParameterStore\";\nexport * from \"./domain/JsonParameterTypes\";\nexport * from \"./domain/JsonPropertyStore\";\nexport * from \"./domain/JsonRequestBody\";\nexport * from \"./domain/JsonResponse\";\nexport * from \"./domain/JsonSchema\";\nexport * from \"./domain/SpecTypes\";\nexport * from \"./hooks/alterIgnore\";\nexport * from \"./hooks/alterOneOf\";\nexport * from \"./hooks/alterRequiredGroups\";\nexport * from \"./interfaces/IgnoreCallback\";\nexport * from \"./interfaces/JsonHookContext\";\nexport * from \"./interfaces/JsonOpenSpec\";\nexport * from \"./interfaces/JsonSchemaOptions\";\nexport * from \"./registries/JsonSchemaMapperContainer\";\nexport * from \"./utils/buildPath\";\nexport * from \"./utils/concatParameters\";\nexport * from \"./utils/concatPath\";\nexport * from \"./utils/defineStatusModel\";\nexport * from \"./utils/from\";\nexport * from \"./utils/generateSpec\";\nexport * from \"./utils/generics\";\nexport * from \"./utils/getComputedType\";\nexport * from \"./utils/getInheritedStores\";\nexport * from \"./utils/getJsonEntityStore\";\nexport * from \"./utils/getJsonPathParameters\";\nexport * from \"./utils/getJsonSchema\";\nexport * from \"./utils/getJsonType\";\nexport * from \"./utils/getOperationsRoutes\";\nexport * from \"./utils/getOperationsStores\";\nexport * from \"./utils/getPropertiesStores\";\nexport * from \"./utils/getRequiredProperties\";\nexport * from \"./utils/getSpec\";\nexport * from \"./utils/getSpecType\";\nexport * from \"./utils/isSuccessStatus\";\nexport * from \"./utils/mapHeaders\";\nexport * from \"./utils/mapNullableType\";\nexport * from \"./utils/mapOpenSpec\";\nexport * from \"./utils/mapOpenSpec2\";\nexport * from \"./utils/mapOpenSpec3\";\nexport * from \"./utils/mapOpenSpecInfo\";\nexport * from \"./utils/mapRouteOptions\";\nexport * from \"./utils/matchGroups\";\nexport * from \"./utils/mergeOperation\";\nexport * from \"./utils/mergeSpec\";\nexport * from \"./utils/operationIdFormatter\";\nexport * from \"./utils/ref\";\nexport * from \"./utils/serializeEnumValues\";\nexport * from \"./utils/toJsonMapCollection\";\nexport * from \"./utils/toJsonRegex\";\nexport * from \"./utils/transformToOS2\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaOptions.js","sourceRoot":"","sources":["../../../src/interfaces/JsonSchemaOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {OpenSpecHash, OS3Schema} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\n\nexport interface JsonSchemaOptions {\n /**\n * Map properties with the alias name. By default: false\n */\n useAlias?: boolean;\n /**\n * Reference to Schema Object.\n */\n schemas?: OpenSpecHash<OS3Schema>;\n /**\n * Define Spec types level\n */\n specType?: SpecTypes;\n /**\n * Define a groups restriction to generate the JsonSchema.\n * Set false to disable groups.\n */\n groups?: string[] | false;\n /**\n * Generate custom keys when SpecType is JSON.\n */\n customKeys?: boolean;\n\n [key: string]: any;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"JsonSchemaOptions.js","sourceRoot":"","sources":["../../../src/interfaces/JsonSchemaOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {OpenSpecHash, OS2Schema, OS3Schema} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\n\nexport interface JsonSchemaOptions {\n /**\n * Map properties with the alias name. By default: false\n */\n useAlias?: boolean;\n /**\n * Reference to Schema Object.\n */\n schemas?: OpenSpecHash<OS3Schema | OS2Schema>;\n /**\n * Define Spec types level\n */\n specType?: SpecTypes;\n /**\n * Define a groups restriction to generate the JsonSchema.\n * Set false to disable groups.\n */\n groups?: string[] | false;\n /**\n * Generate custom keys when SpecType is JSON.\n */\n customKeys?: boolean;\n\n [key: string]: any;\n}\n"]}
|
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.concatPath = void 0;
|
|
4
4
|
function concatPath(basePath, path) {
|
|
5
|
-
|
|
5
|
+
if (basePath instanceof RegExp || path instanceof RegExp) {
|
|
6
|
+
if (!basePath) {
|
|
7
|
+
return path;
|
|
8
|
+
}
|
|
9
|
+
if (!path) {
|
|
10
|
+
return basePath;
|
|
11
|
+
}
|
|
12
|
+
const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, "gi");
|
|
13
|
+
const r2 = path instanceof RegExp ? path : new RegExp(path, "gi");
|
|
14
|
+
return new RegExp(r1.source + r2.source, (r1.global ? "g" : "") + (r1.ignoreCase ? "i" : "") + (r1.multiline ? "m" : ""));
|
|
15
|
+
}
|
|
16
|
+
if (basePath && path && basePath.endsWith("/") && path.startsWith("/")) {
|
|
17
|
+
path = path.slice(1);
|
|
18
|
+
}
|
|
19
|
+
const result = (basePath || "") + (path || "");
|
|
20
|
+
return result.endsWith("/") && result.length > 1 ? result.slice(0, -1) : result;
|
|
6
21
|
}
|
|
7
22
|
exports.concatPath = concatPath;
|
|
8
23
|
//# sourceMappingURL=concatPath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,QAAqC,EAAE,IAAiC;IACjG,IAAI,QAAQ,YAAY,MAAM,IAAI,IAAI,YAAY,MAAM,EAAE;QACxD,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAI,CAAC;SACb;QAED,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,QAAQ,CAAC;SACjB;QAED,MAAM,EAAE,GAAG,QAAQ,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9E,MAAM,EAAE,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAElE,OAAO,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC3H;IAED,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACtE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,MAAM,MAAM,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAE/C,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAClF,CAAC;AAvBD,gCAuBC","sourcesContent":["export function concatPath(basePath: string | undefined | RegExp, path: string | undefined | RegExp): any {\n if (basePath instanceof RegExp || path instanceof RegExp) {\n if (!basePath) {\n return path;\n }\n\n if (!path) {\n return basePath;\n }\n\n const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, \"gi\");\n const r2 = path instanceof RegExp ? path : new RegExp(path, \"gi\");\n\n return new RegExp(r1.source + r2.source, (r1.global ? \"g\" : \"\") + (r1.ignoreCase ? \"i\" : \"\") + (r1.multiline ? \"m\" : \"\"));\n }\n\n if (basePath && path && basePath.endsWith(\"/\") && path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n\n const result = (basePath || \"\") + (path || \"\");\n\n return result.endsWith(\"/\") && result.length > 1 ? result.slice(0, -1) : result;\n}\n"]}
|
package/lib/cjs/utils/from.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lazyRef = exports.allOf = exports.oneOf = exports.anyOf = exports.any = exports.object = exports.set = exports.map = exports.array = exports.url = exports.uri = exports.email = exports.time = exports.datetime = exports.date = exports.boolean = exports.string = exports.integer = exports.number = exports.from = void 0;
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
|
-
const
|
|
5
|
+
const JsonEntityStore_1 = require("../domain/JsonEntityStore");
|
|
6
|
+
const JsonFormatTypes_1 = require("../domain/JsonFormatTypes");
|
|
6
7
|
const JsonLazyRef_1 = require("../domain/JsonLazyRef");
|
|
7
8
|
const JsonSchema_1 = require("../domain/JsonSchema");
|
|
8
9
|
const getJsonEntityStore_1 = require("./getJsonEntityStore");
|
|
@@ -83,7 +84,7 @@ exports.boolean = boolean;
|
|
|
83
84
|
* @schemaFunctional
|
|
84
85
|
*/
|
|
85
86
|
function date() {
|
|
86
|
-
return from(Date).format(
|
|
87
|
+
return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.DATE);
|
|
87
88
|
}
|
|
88
89
|
exports.date = date;
|
|
89
90
|
/**
|
|
@@ -94,7 +95,7 @@ exports.date = date;
|
|
|
94
95
|
* @schemaFunctional
|
|
95
96
|
*/
|
|
96
97
|
function datetime() {
|
|
97
|
-
return from(Date).format(
|
|
98
|
+
return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.DATE_TIME);
|
|
98
99
|
}
|
|
99
100
|
exports.datetime = datetime;
|
|
100
101
|
/**
|
|
@@ -105,7 +106,7 @@ exports.datetime = datetime;
|
|
|
105
106
|
* @schemaFunctional
|
|
106
107
|
*/
|
|
107
108
|
function time() {
|
|
108
|
-
return from(Date).format(
|
|
109
|
+
return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.TIME);
|
|
109
110
|
}
|
|
110
111
|
exports.time = time;
|
|
111
112
|
/**
|
|
@@ -116,7 +117,7 @@ exports.time = time;
|
|
|
116
117
|
* @schemaFunctional
|
|
117
118
|
*/
|
|
118
119
|
function email() {
|
|
119
|
-
return from(String).format(
|
|
120
|
+
return from(String).format(JsonFormatTypes_1.JsonFormatTypes.EMAIL);
|
|
120
121
|
}
|
|
121
122
|
exports.email = email;
|
|
122
123
|
/**
|
|
@@ -127,7 +128,7 @@ exports.email = email;
|
|
|
127
128
|
* @schemaFunctional
|
|
128
129
|
*/
|
|
129
130
|
function uri() {
|
|
130
|
-
return from(String).format(
|
|
131
|
+
return from(String).format(JsonFormatTypes_1.JsonFormatTypes.URI);
|
|
131
132
|
}
|
|
132
133
|
exports.uri = uri;
|
|
133
134
|
/**
|
|
@@ -138,7 +139,7 @@ exports.uri = uri;
|
|
|
138
139
|
* @schemaFunctional
|
|
139
140
|
*/
|
|
140
141
|
function url() {
|
|
141
|
-
return from(String).format(
|
|
142
|
+
return from(String).format(JsonFormatTypes_1.JsonFormatTypes.URL);
|
|
142
143
|
}
|
|
143
144
|
exports.url = url;
|
|
144
145
|
/**
|
|
@@ -262,7 +263,7 @@ function lazyRef(cb) {
|
|
|
262
263
|
// solve issue with a self referenced model
|
|
263
264
|
if (cb()) {
|
|
264
265
|
// type is already accessible
|
|
265
|
-
return
|
|
266
|
+
return JsonEntityStore_1.JsonEntityStore.from(cb()).schema;
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
269
|
catch (er) { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from.js","sourceRoot":"","sources":["../../../src/utils/from.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC
|
|
1
|
+
{"version":3,"file":"from.js","s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;AAFD,kBAEC;AAED;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,aAA0C,EAAE;IACjE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;AACH,SAAgB,GAAG,CAAC,GAAG,KAAY;IACjC,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;AAC9B,CAAC;AAFD,kBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,EAAmB;IACzC,IAAI;QACF,2CAA2C;QAC3C,IAAI,EAAE,EAAE,EAAE;YACR,6BAA6B;YAC7B,OAAO,iCAAe,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,MAAa,CAAC;SACjD;KACF;IAAC,OAAO,EAAE,EAAE,GAAE;IAEf,OAAO,IAAI,yBAAW,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAVD,0BAUC","sourcesContent":["import {isClass, Type} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {JsonFormatTypes} from \"../domain/JsonFormatTypes\";\nimport {JsonLazyRef} from \"../domain/JsonLazyRef\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * Create a new model from the given type.\n *\n * ```typescript\n * from(String)\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function from(type: Type<any> = Object) {\n if (isClass(type)) {\n const {schema} = getJsonEntityStore(type);\n\n schema.properties = function properties(obj: {[key: string]: JsonSchema}) {\n Object.entries(obj).forEach(([propertyKey, propSchema]) => {\n getJsonEntityStore(type.prototype, propertyKey).schema.assign(propSchema);\n });\n\n return this;\n };\n\n return schema;\n }\n\n return JsonSchema.from({type});\n}\n\n/**\n * Declare a new number model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function number() {\n return from(Number);\n}\n\n/**\n * Declare a new integer model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function integer() {\n return from(Number).integer();\n}\n\n/**\n * Declare a new string model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function string() {\n return from(String);\n}\n\n/**\n * Declare a new boolean model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function boolean() {\n return from(Boolean);\n}\n\n/**\n * Declare a new string model with `format: date`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function date() {\n return from(Date).format(JsonFormatTypes.DATE);\n}\n\n/**\n * Declare a new string model with `format: datetime`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function datetime() {\n return from(Date).format(JsonFormatTypes.DATE_TIME);\n}\n\n/**\n * Declare a new string model with `format: time`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function time() {\n return from(Date).format(JsonFormatTypes.TIME);\n}\n\n/**\n * Declare a new string model with `format: email`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function email() {\n return from(String).format(JsonFormatTypes.EMAIL);\n}\n\n/**\n * Declare a new string model with `format: uri`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function uri() {\n return from(String).format(JsonFormatTypes.URI);\n}\n\n/**\n * Declare a new string model with `format: url`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function url() {\n return from(String).format(JsonFormatTypes.URL);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"array\"\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function array() {\n return from(Array);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"additionalProperties\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function map() {\n return from(Map).unknown(true);\n}\n\n/**\n * Declare a new array model with `uniqueItems: true`.\n *\n * ```json\n * {\n * \"type\": \"array\",\n * \"uniqueItems\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function set() {\n return from(Array).uniqueItems(true);\n}\n\n/**\n * Declare a new object model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function object(properties: {[key: string]: JsonSchema} = {}) {\n return from(Object).properties(properties);\n}\n\n/**\n * Declare a model with any type (By default: `integer`, `number`, `string`, `boolean`, `array`, `object`, `null`)\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function any(...types: any[]) {\n return from().any(...types);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n * @schemaFunctional\n */\nexport function anyOf(...anyOf: any[]) {\n return from().anyOf(anyOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n */\nexport function oneOf(...oneOf: any[]) {\n return from().oneOf(oneOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n * @schemaFunctional\n */\nexport function allOf(...allOf: any[]) {\n return from().allOf(allOf);\n}\n\n/**\n * Declare a sub schema which will be resolved later. Use this function when you have a circular reference between two schemes.\n *\n * @schemaFunctional\n */\nexport function lazyRef(cb: () => Type<any>) {\n try {\n // solve issue with a self referenced model\n if (cb()) {\n // type is already accessible\n return JsonEntityStore.from(cb()).schema as any;\n }\n } catch (er) {}\n\n return new JsonLazyRef(cb);\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSpec = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
|
+
const core_1 = require("@tsed/core");
|
|
7
|
+
const mapOpenSpec_1 = require("./mapOpenSpec");
|
|
8
|
+
const getSpec_1 = require("./getSpec");
|
|
9
|
+
const getSpecType_1 = require("./getSpecType");
|
|
10
|
+
const mergeSpec_1 = require("./mergeSpec");
|
|
11
|
+
const SpecTypes_1 = require("../domain/SpecTypes");
|
|
12
|
+
const transformToOS2_1 = require("./transformToOS2");
|
|
13
|
+
async function readSpec(path) {
|
|
14
|
+
if (fs_extra_1.default.existsSync(path)) {
|
|
15
|
+
try {
|
|
16
|
+
return await fs_extra_1.default.readJSON(path, { encoding: "utf8" });
|
|
17
|
+
}
|
|
18
|
+
catch (e) { }
|
|
19
|
+
}
|
|
20
|
+
/* istanbul ignore next */
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Generate OpenAPI spec from multiple sources (models, files, conf)
|
|
25
|
+
* @param tokens
|
|
26
|
+
* @param options
|
|
27
|
+
*/
|
|
28
|
+
async function generateSpec({ tokens, ...options }) {
|
|
29
|
+
const { version = "1.0.0", acceptMimes, specPath, specVersion } = options;
|
|
30
|
+
const fileSpec = specPath ? await readSpec(specPath) : {};
|
|
31
|
+
const defaultSpec = (0, mapOpenSpec_1.mapOpenSpec)((0, core_1.getValue)(options, "spec", {}), {
|
|
32
|
+
fileSpec,
|
|
33
|
+
version,
|
|
34
|
+
specVersion,
|
|
35
|
+
acceptMimes
|
|
36
|
+
});
|
|
37
|
+
const specType = (0, getSpecType_1.getSpecTypeFromSpec)(defaultSpec);
|
|
38
|
+
let controllersSpec = (0, getSpec_1.getSpec)(tokens, options);
|
|
39
|
+
const spec = (0, mergeSpec_1.mergeSpec)(defaultSpec, controllersSpec);
|
|
40
|
+
if (specType === SpecTypes_1.SpecTypes.SWAGGER) {
|
|
41
|
+
return (0, transformToOS2_1.transformToOS2)(spec);
|
|
42
|
+
}
|
|
43
|
+
return spec;
|
|
44
|
+
}
|
|
45
|
+
exports.generateSpec = generateSpec;
|
|
46
|
+
//# sourceMappingURL=generateSpec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateSpec.js","sourceRoot":"","sources":["../../../src/utils/generateSpec.ts"],"names":[],"mappings":";;;;AAAA,gEAA0B;AAC1B,qCAAoC;AAEpC,+CAA0C;AAC1C,uCAA2E;AAC3E,+CAAkD;AAClD,2CAAsC;AACtC,mDAA8C;AAC9C,qDAAgD;AAWhD,KAAK,UAAU,QAAQ,CAAC,IAAY;IAClC,IAAI,kBAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACvB,IAAI;YACF,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;SACpD;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;IAED,0BAA0B;IAC1B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,YAAY,CAAC,EAAC,MAAM,EAAE,GAAG,OAAO,EAAsB;IAC1E,MAAM,EAAC,OAAO,GAAG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAC,GAAG,OAAO,CAAC;IACxE,MAAM,QAAQ,GAAmC,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAE1F,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,IAAA,eAAQ,EAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE;QAC7D,QAAQ;QACR,OAAO;QACP,WAAW;QACX,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAA,iCAAmB,EAAC,WAAW,CAAC,CAAC;IAElD,IAAI,eAAe,GAAQ,IAAA,iBAAO,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,IAAI,GAAQ,IAAA,qBAAS,EAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAE1D,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;QAClC,OAAO,IAAA,+BAAc,EAAC,IAAI,CAAQ,CAAC;KACpC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AArBD,oCAqBC","sourcesContent":["import fs from \"fs-extra\";\nimport {getValue} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {mapOpenSpec} from \"./mapOpenSpec\";\nimport {getSpec, JsonTokenOptions, SpecSerializerOptions} from \"./getSpec\";\nimport {getSpecTypeFromSpec} from \"./getSpecType\";\nimport {mergeSpec} from \"./mergeSpec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {transformToOS2} from \"./transformToOS2\";\n\nexport interface GenerateSpecOptions extends Omit<SpecSerializerOptions, \"specType\"> {\n tokens: JsonTokenOptions;\n version?: string;\n acceptMimes?: string;\n specPath?: string;\n specVersion?: string;\n spec?: any;\n}\n\nasync function readSpec(path: string) {\n if (fs.existsSync(path)) {\n try {\n return await fs.readJSON(path, {encoding: \"utf8\"});\n } catch (e) {}\n }\n\n /* istanbul ignore next */\n return {};\n}\n\n/**\n * Generate OpenAPI spec from multiple sources (models, files, conf)\n * @param tokens\n * @param options\n */\nexport async function generateSpec({tokens, ...options}: GenerateSpecOptions): Promise<OpenSpec2 | OpenSpec3> {\n const {version = \"1.0.0\", acceptMimes, specPath, specVersion} = options;\n const fileSpec: Partial<OpenSpec2 | OpenSpec3> = specPath ? await readSpec(specPath) : {};\n\n const defaultSpec = mapOpenSpec(getValue(options, \"spec\", {}), {\n fileSpec,\n version,\n specVersion,\n acceptMimes\n });\n\n const specType = getSpecTypeFromSpec(defaultSpec);\n\n let controllersSpec: any = getSpec(tokens, options);\n const spec: any = mergeSpec(defaultSpec, controllersSpec);\n\n if (specType === SpecTypes.SWAGGER) {\n return transformToOS2(spec) as any;\n }\n\n return spec;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../src/utils/generics.ts"],"names":[],"mappings":";;;AA4CA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,aAAuB,EAAE,YAA4B;IAClF,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAqB,EAAE,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACrI,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAA8C;IAC/E,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;QACjD,MAAM,EAAC,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;QAEtD,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC;SACtD,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,gDAWC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAqB;IAC/C,MAAM,CAAC,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;IAEpD,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,GAAG;KACpB,CAAC;AACJ,CAAC;AAPD,kCAOC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain\";\n\nexport type GenericValue = Type<any> | JsonSchema | any;\n\n/**\n * @ignore\n */\nexport type GenericsMap = Map<string, GenericValue>;\n\n/**\n * @ignore\n */\nexport interface GenericTypes {\n genericTypes: Type<any>[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericLabels {\n genericLabels: string[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface NestedGenerics {\n nestedGenerics: GenericValue[][];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {\n generics: GenericsMap;\n}\n\n/**\n * @ignore\n * @param genericLabels\n * @param genericTypes\n */\nexport function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap {\n return genericLabels.reduce((map: Map<string, any>, item: string, index: number) => map.set(item, genericTypes[index]), new Map());\n}\n\n/**\n * @ignore\n * @param options\n */\nexport function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>) {\n if (options.genericLabels && options.genericTypes) {\n const {genericLabels, genericTypes, ...ops} = options;\n\n return {\n ...ops,\n generics: getGenericsMap(genericLabels, genericTypes)\n };\n }\n\n return options;\n}\n\n/**\n * @ignore\n * @param value\n */\nexport function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes {\n const [genericTypes, ...out] = value.nestedGenerics;\n\n return {\n genericTypes,\n nestedGenerics: out\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../src/utils/generics.ts"],"names":[],"mappings":";;;AA4CA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,aAAuB,EAAE,YAA4B;IAClF,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAqB,EAAE,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACrI,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAA8C;IAC/E,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;QACjD,MAAM,EAAC,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;QAEtD,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC;SACtD,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,gDAWC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAqB;IAC/C,MAAM,CAAC,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;IAEpD,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,GAAG;KACpB,CAAC;AACJ,CAAC;AAPD,kCAOC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\n\nexport type GenericValue = Type<any> | JsonSchema | any;\n\n/**\n * @ignore\n */\nexport type GenericsMap = Map<string, GenericValue>;\n\n/**\n * @ignore\n */\nexport interface GenericTypes {\n genericTypes: Type<any>[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericLabels {\n genericLabels: string[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface NestedGenerics {\n nestedGenerics: GenericValue[][];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {\n generics: GenericsMap;\n}\n\n/**\n * @ignore\n * @param genericLabels\n * @param genericTypes\n */\nexport function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap {\n return genericLabels.reduce((map: Map<string, any>, item: string, index: number) => map.set(item, genericTypes[index]), new Map());\n}\n\n/**\n * @ignore\n * @param options\n */\nexport function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>) {\n if (options.genericLabels && options.genericTypes) {\n const {genericLabels, genericTypes, ...ops} = options;\n\n return {\n ...ops,\n generics: getGenericsMap(genericLabels, genericTypes)\n };\n }\n\n return options;\n}\n\n/**\n * @ignore\n * @param value\n */\nexport function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes {\n const [genericTypes, ...out] = value.nestedGenerics;\n\n return {\n genericTypes,\n nestedGenerics: out\n };\n}\n"]}
|
|
@@ -14,22 +14,36 @@ function getVariable(subpath) {
|
|
|
14
14
|
postfix: splited.length ? `.${splited.join(".")}` : ""
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
function parseUrl(key) {
|
|
18
|
+
let inCapture = 0;
|
|
19
|
+
return key
|
|
20
|
+
.split("")
|
|
21
|
+
.filter((c) => {
|
|
22
|
+
if (c === "(") {
|
|
23
|
+
inCapture++;
|
|
24
|
+
}
|
|
25
|
+
const result = inCapture === 0;
|
|
26
|
+
if (c === ")") {
|
|
27
|
+
inCapture--;
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
})
|
|
31
|
+
.join("")
|
|
32
|
+
.split("/")
|
|
33
|
+
.filter((o) => !!o);
|
|
34
|
+
}
|
|
17
35
|
/**
|
|
18
36
|
* @ignore
|
|
19
37
|
*/
|
|
20
38
|
function getJsonPathParameters(base, path = "") {
|
|
21
39
|
if (path instanceof RegExp) {
|
|
22
|
-
path = path.toString().replace(
|
|
40
|
+
path = path.toString().replace(/^\//g, "").replace(/\/$/g, "").replace(/\\/g, "");
|
|
23
41
|
}
|
|
24
42
|
const params = [];
|
|
25
43
|
const paths = [];
|
|
26
44
|
let isOptional = false;
|
|
27
45
|
let current = "";
|
|
28
|
-
`${base}${path}`
|
|
29
|
-
.replace(/\((.*)\)/gi, "")
|
|
30
|
-
.split("/")
|
|
31
|
-
.filter((o) => !!o)
|
|
32
|
-
.map((key) => {
|
|
46
|
+
parseUrl(`${base}${path}`).map((key) => {
|
|
33
47
|
const subpath = key.replace(":", "").replace("?", "");
|
|
34
48
|
if (key.includes(":")) {
|
|
35
49
|
const optional = key.includes("?");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonPathParameters.js","sourceRoot":"","sources":["../../../src/utils/getJsonPathParameters.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAErC,OAAO;QACL,MAAM,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE;QAC3C,IAAI;QACJ,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC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AAG,WAAW,CAAC,OAAO,CAAC,CAAC;YACrD,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;YAE3C,MAAM,CAAC,IAAI,CAAC;gBACV,EAAE,EAAE,MAAM;gBACV,IAAI;gBACJ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;YAEH,IAAI,QAAQ,IAAI,UAAU,EAAE;gBAC1B,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAa,CAAC;iBACrC,CAAC,CAAC;aACJ;SACF;aAAM;YACL,OAAO,IAAI,IAAI,GAAG,EAAE,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,MAAM;QACjB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC;YACE;gBACE,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,MAAa,CAAC;aACrC;SACF,CAAC;AACR,CAAC;AAvDD,sDAuDC","sourcesContent":["/**\n * @ignore\n */\nfunction getVariable(subpath: string) {\n const [prefix, right] = subpath.split(\"=\");\n const splited = (right || prefix).split(\".\");\n const name = splited.splice(0, 1)[0];\n\n return {\n prefix: right && prefix ? `${prefix}=` : \"\",\n name,\n postfix: splited.length ? `.${splited.join(\".\")}` : \"\"\n };\n}\n\nfunction parseUrl(key: string) {\n let inCapture = 0;\n\n return key\n .split(\"\")\n .filter((c) => {\n if (c === \"(\") {\n inCapture++;\n }\n\n const result = inCapture === 0;\n\n if (c === \")\") {\n inCapture--;\n }\n\n return result;\n })\n .join(\"\")\n .split(\"/\")\n .filter((o) => !!o);\n}\n\n/**\n * @ignore\n */\nexport function getJsonPathParameters(base: string, path: string | RegExp | (string | RegExp)[] = \"\"): {path: string; parameters: any[]}[] {\n if (path instanceof RegExp) {\n path = path.toString().replace(/^\\//g, \"\").replace(/\\/$/g, \"\").replace(/\\\\/g, \"\");\n }\n\n const params: any[] = [];\n const paths: any[] = [];\n let isOptional = false;\n let current = \"\";\n\n parseUrl(`${base}${path}`).map((key) => {\n const subpath = key.replace(\":\", \"\").replace(\"?\", \"\");\n\n if (key.includes(\":\")) {\n const optional = key.includes(\"?\");\n\n // Append previous config\n if (optional && !isOptional) {\n isOptional = true;\n\n paths.push({\n path: current,\n parameters: [].concat(params as any)\n });\n }\n\n const {prefix, name, postfix} = getVariable(subpath);\n current += `/${prefix}{${name}}${postfix}`;\n\n params.push({\n in: \"path\",\n name,\n type: \"string\",\n required: true\n });\n\n if (optional && isOptional) {\n paths.push({\n path: current,\n parameters: [].concat(params as any)\n });\n }\n } else {\n current += `/${key}`;\n }\n });\n\n return paths.length\n ? paths\n : [\n {\n path: current,\n parameters: [].concat(params as any)\n }\n ];\n}\n"]}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getJsonSchema = void 0;
|
|
4
|
-
require("../components");
|
|
4
|
+
require("../components/anyMapper");
|
|
5
|
+
require("../components/classMapper");
|
|
6
|
+
require("../components/genericsMapper");
|
|
7
|
+
require("../components/inheritedClassMapper");
|
|
8
|
+
require("../components/itemMapper");
|
|
9
|
+
require("../components/lazyRefMapper");
|
|
10
|
+
require("../components/mapMapper");
|
|
11
|
+
require("../components/objectMapper");
|
|
12
|
+
require("../components/ofMapper");
|
|
13
|
+
require("../components/propertiesMapper");
|
|
14
|
+
require("../components/schemaMapper");
|
|
5
15
|
const SpecTypes_1 = require("../domain/SpecTypes");
|
|
6
16
|
const JsonSchemaMapperContainer_1 = require("../registries/JsonSchemaMapperContainer");
|
|
7
17
|
const getJsonEntityStore_1 = require("./getJsonEntityStore");
|
|
@@ -32,7 +42,6 @@ function get(entity, options) {
|
|
|
32
42
|
return cache.get(key);
|
|
33
43
|
}
|
|
34
44
|
function getJsonSchema(model, options = {}) {
|
|
35
|
-
var _a;
|
|
36
45
|
const entity = (0, getJsonEntityStore_1.getJsonEntityStore)(model);
|
|
37
46
|
options = {
|
|
38
47
|
endpoint: true,
|
|
@@ -46,7 +55,7 @@ function getJsonSchema(model, options = {}) {
|
|
|
46
55
|
...options,
|
|
47
56
|
genericTypes: entity.nestedGenerics[0],
|
|
48
57
|
nestedGenerics: entity.nestedGenerics,
|
|
49
|
-
groups:
|
|
58
|
+
groups: entity.parameter?.groups
|
|
50
59
|
};
|
|
51
60
|
}
|
|
52
61
|
return get(entity, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/utils/getJsonSchema.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/utils/getJsonSchema.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AACjC,qCAAmC;AACnC,wCAAsC;AACtC,8CAA4C;AAC5C,oCAAkC;AAClC,uCAAqC;AACrC,mCAAiC;AACjC,sCAAoC;AACpC,kCAAgC;AAChC,0CAAwC;AACxC,sCAAoC;AAEpC,mDAA8C;AAE9C,uFAAmE;AACnE,6DAAwD;AAExD;;GAEG;AACH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC;;GAEG;AACH,SAAS,MAAM,CAAC,OAAY;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,GAAG,CAAC,MAAuB,EAAE,OAAY;IAChD,MAAM,KAAK,GAAqB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;IACzE,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACnB,MAAM,MAAM,GAAG,IAAA,sCAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YACvC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;SACtC;QAED,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;KACxB;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAEnC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,SAAgB,aAAa,CAAC,KAAsB,EAAE,UAA6B,EAAE;IACnF,MAAM,MAAM,GAAG,IAAA,uCAAkB,EAAC,KAAK,CAAC,CAAC;IAEzC,OAAO,GAAG;QACR,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;QACV,GAAG,OAAO;QACV,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,qBAAS,CAAC,IAAI;QAC5C,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,IAAI,MAAM,CAAC,aAAa,KAAK,WAAW,EAAE;QACxC,OAAO,GAAG;YACR,GAAG,OAAO;YACV,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;YACtC,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM;SACjC,CAAC;KACH;IAED,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AArBD,sCAqBC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport \"../components/anyMapper\";\nimport \"../components/classMapper\";\nimport \"../components/genericsMapper\";\nimport \"../components/inheritedClassMapper\";\nimport \"../components/itemMapper\";\nimport \"../components/lazyRefMapper\";\nimport \"../components/mapMapper\";\nimport \"../components/objectMapper\";\nimport \"../components/ofMapper\";\nimport \"../components/propertiesMapper\";\nimport \"../components/schemaMapper\";\nimport type {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * @ignore\n */\nconst CACHE_KEY = \"$cache:schemes\";\n\n/**\n * @ignore\n */\nfunction getKey(options: any) {\n return JSON.stringify(options);\n}\n\n/**\n * @ignore\n */\nfunction get(entity: JsonEntityStore, options: any) {\n const cache: Map<string, any> = entity.store.get(CACHE_KEY) || new Map();\n const key = getKey(options);\n\n if (!cache.has(key)) {\n const schema = execMapper(\"schema\", entity.schema, options);\n\n if (Object.keys(options.schemas).length) {\n schema.definitions = options.schemas;\n }\n\n cache.set(key, schema);\n }\n\n entity.store.set(CACHE_KEY, cache);\n\n return cache.get(key);\n}\n\nexport function getJsonSchema(model: Type<any> | any, options: JsonSchemaOptions = {}) {\n const entity = getJsonEntityStore(model);\n\n options = {\n endpoint: true,\n groups: [],\n ...options,\n specType: options.specType || SpecTypes.JSON,\n schemas: {}\n };\n\n if (entity.decoratorType === \"parameter\") {\n options = {\n ...options,\n genericTypes: entity.nestedGenerics[0],\n nestedGenerics: entity.nestedGenerics,\n groups: entity.parameter?.groups\n };\n }\n\n return get(entity, options);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonType.js","sourceRoot":"","sources":["../../../src/utils/getJsonType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getJsonType.js","sourceRoot":"","sources":["../../../src/utils/getJsonType.ts"],"names":[],"mappings":";;;AAAA,qCAA+F;AAE/F;;GAEG;AACU,QAAA,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvG,SAAgB,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,IAAA,kCAA2B,EAAC,KAAK,CAAC,EAAE;QACtC,IAAI,kBAAU,CAAC,OAAO,CAAC,KAAe,CAAC,GAAG,CAAC,CAAC,EAAE;YAC5C,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,KAAK,KAAK,MAAM,EAAE;gBACpB,OAAO,MAAM,CAAC;aACf;YAED,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,IAAA,kBAAW,EAAC,KAAK,CAAC,CAAC;KAC3B;IAED,IAAI,KAAK,KAAK,KAAK,EAAE;QACnB,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,IAAA,cAAO,EAAC,KAAK,CAAC,EAAE;QAClB,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAQ,CAAC;KACtC;IAED,IAAI,KAAK,KAAK,GAAG,EAAE;QACjB,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,IAAA,aAAM,EAAC,KAAK,CAAC,IAAI,IAAA,eAAQ,EAAC,KAAK,CAAC,EAAE;QACpC,OAAO,QAAQ,CAAC;KACjB;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAtCD,kCAsCC","sourcesContent":["import {isArray, isBuffer, isDate, isPrimitiveOrPrimitiveClass, primitiveOf} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport const JSON_TYPES = [\"string\", \"number\", \"integer\", \"boolean\", \"object\", \"array\", \"null\", \"any\"];\n\nexport function getJsonType(value: any): string {\n if (value === null) {\n return \"null\";\n }\n\n if (isPrimitiveOrPrimitiveClass(value)) {\n if (JSON_TYPES.indexOf(value as string) > -1) {\n return value;\n }\n\n if (typeof value === \"string\") {\n if (value === \"file\") {\n return \"file\";\n }\n\n return \"generic\";\n }\n\n return primitiveOf(value);\n }\n\n if (value === Array) {\n return \"array\";\n }\n\n if (isArray(value)) {\n return value.map(getJsonType) as any;\n }\n\n if (value === Set) {\n return \"array\";\n }\n\n if (isDate(value) || isBuffer(value)) {\n return \"string\";\n }\n\n return \"object\";\n}\n"]}
|