@tsed/schema 7.0.0-alpha.2 → 7.0.0-beta.1
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/benchmark/cold-start.js +17 -0
- package/jest.config.js +14 -0
- package/lib/cjs/components/anyMapper.js +23 -0
- package/lib/cjs/components/anyMapper.js.map +1 -0
- package/lib/cjs/components/classMapper.js +41 -0
- package/lib/cjs/components/classMapper.js.map +1 -0
- package/lib/cjs/components/genericsMapper.js +62 -0
- package/lib/cjs/components/genericsMapper.js.map +1 -0
- package/lib/cjs/components/index.js +15 -0
- package/lib/cjs/components/index.js.map +1 -0
- package/lib/cjs/components/inheritedClassMapper.js +22 -0
- package/lib/cjs/components/inheritedClassMapper.js.map +1 -0
- package/lib/cjs/components/itemMapper.js +10 -0
- package/lib/cjs/components/itemMapper.js.map +1 -0
- package/lib/cjs/components/lazyRefMapper.js +19 -0
- package/lib/cjs/components/lazyRefMapper.js.map +1 -0
- package/lib/cjs/components/mapMapper.js +25 -0
- package/lib/cjs/components/mapMapper.js.map +1 -0
- package/lib/cjs/components/objectMapper.js +31 -0
- package/lib/cjs/components/objectMapper.js.map +1 -0
- package/lib/cjs/components/ofMapper.js +17 -0
- package/lib/cjs/components/ofMapper.js.map +1 -0
- package/lib/cjs/components/propertiesMapper.js +25 -0
- package/lib/cjs/components/propertiesMapper.js.map +1 -0
- package/lib/cjs/components/schemaMapper.js +97 -0
- package/lib/cjs/components/schemaMapper.js.map +1 -0
- package/lib/cjs/constants/httpMethods.js +46 -0
- package/lib/cjs/constants/httpMethods.js.map +1 -0
- package/lib/cjs/constants/httpStatusMessages.js +110 -0
- package/lib/cjs/constants/httpStatusMessages.js.map +1 -0
- package/lib/cjs/decorators/class/children.js +24 -0
- package/lib/cjs/decorators/class/children.js.map +1 -0
- package/lib/cjs/decorators/collections/collectionContains.js +29 -0
- package/lib/cjs/decorators/collections/collectionContains.js.map +1 -0
- package/lib/cjs/decorators/collections/collectionOf.js +103 -0
- package/lib/cjs/decorators/collections/collectionOf.js.map +1 -0
- package/lib/cjs/decorators/collections/maxItems.js +60 -0
- package/lib/cjs/decorators/collections/maxItems.js.map +1 -0
- package/lib/cjs/decorators/collections/maxProperties.js +83 -0
- package/lib/cjs/decorators/collections/maxProperties.js.map +1 -0
- package/lib/cjs/decorators/collections/minItems.js +64 -0
- package/lib/cjs/decorators/collections/minItems.js.map +1 -0
- package/lib/cjs/decorators/collections/minProperties.js +82 -0
- package/lib/cjs/decorators/collections/minProperties.js.map +1 -0
- package/lib/cjs/decorators/collections/uniqueItems.js +60 -0
- package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -0
- package/lib/cjs/decorators/common/additionalProperties.js +20 -0
- package/lib/cjs/decorators/common/additionalProperties.js.map +1 -0
- package/lib/cjs/decorators/common/allOf.js +22 -0
- package/lib/cjs/decorators/common/allOf.js.map +1 -0
- package/lib/cjs/decorators/common/allow.js +47 -0
- package/lib/cjs/decorators/common/allow.js.map +1 -0
- package/lib/cjs/decorators/common/any.js +46 -0
- package/lib/cjs/decorators/common/any.js.map +1 -0
- package/lib/cjs/decorators/common/anyOf.js +26 -0
- package/lib/cjs/decorators/common/anyOf.js.map +1 -0
- package/lib/cjs/decorators/common/const.js +70 -0
- package/lib/cjs/decorators/common/const.js.map +1 -0
- package/lib/cjs/decorators/common/customKey.js +43 -0
- package/lib/cjs/decorators/common/customKey.js.map +1 -0
- package/lib/cjs/decorators/common/default.js +51 -0
- package/lib/cjs/decorators/common/default.js.map +1 -0
- package/lib/cjs/decorators/common/description.js +76 -0
- package/lib/cjs/decorators/common/description.js.map +1 -0
- package/lib/cjs/decorators/common/enum.js +30 -0
- package/lib/cjs/decorators/common/enum.js.map +1 -0
- package/lib/cjs/decorators/common/example.js +21 -0
- package/lib/cjs/decorators/common/example.js.map +1 -0
- package/lib/cjs/decorators/common/examples.js +21 -0
- package/lib/cjs/decorators/common/examples.js.map +1 -0
- package/lib/cjs/decorators/common/exclusiveMaximum.js +77 -0
- package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -0
- package/lib/cjs/decorators/common/exclusiveMinimum.js +77 -0
- package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -0
- package/lib/cjs/decorators/common/format.js +486 -0
- package/lib/cjs/decorators/common/format.js.map +1 -0
- package/lib/cjs/decorators/common/forwardGroups.js +20 -0
- package/lib/cjs/decorators/common/forwardGroups.js.map +1 -0
- package/lib/cjs/decorators/common/groups.js +41 -0
- package/lib/cjs/decorators/common/groups.js.map +1 -0
- package/lib/cjs/decorators/common/hidden.js +40 -0
- package/lib/cjs/decorators/common/hidden.js.map +1 -0
- package/lib/cjs/decorators/common/ignore.js +71 -0
- package/lib/cjs/decorators/common/ignore.js.map +1 -0
- package/lib/cjs/decorators/common/integer.js +71 -0
- package/lib/cjs/decorators/common/integer.js.map +1 -0
- package/lib/cjs/decorators/common/jsonEntityFn.js +32 -0
- package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -0
- package/lib/cjs/decorators/common/maxLength.js +89 -0
- package/lib/cjs/decorators/common/maxLength.js.map +1 -0
- package/lib/cjs/decorators/common/maximum.js +151 -0
- package/lib/cjs/decorators/common/maximum.js.map +1 -0
- package/lib/cjs/decorators/common/minLength.js +90 -0
- package/lib/cjs/decorators/common/minLength.js.map +1 -0
- package/lib/cjs/decorators/common/minimum.js +149 -0
- package/lib/cjs/decorators/common/minimum.js.map +1 -0
- package/lib/cjs/decorators/common/multipleOf.js +81 -0
- package/lib/cjs/decorators/common/multipleOf.js.map +1 -0
- package/lib/cjs/decorators/common/name.js +52 -0
- package/lib/cjs/decorators/common/name.js.map +1 -0
- package/lib/cjs/decorators/common/nullable.js +34 -0
- package/lib/cjs/decorators/common/nullable.js.map +1 -0
- package/lib/cjs/decorators/common/oneOf.js +27 -0
- package/lib/cjs/decorators/common/oneOf.js.map +1 -0
- package/lib/cjs/decorators/common/optional.js +28 -0
- package/lib/cjs/decorators/common/optional.js.map +1 -0
- package/lib/cjs/decorators/common/pattern.js +103 -0
- package/lib/cjs/decorators/common/pattern.js.map +1 -0
- package/lib/cjs/decorators/common/property.js +27 -0
- package/lib/cjs/decorators/common/property.js.map +1 -0
- package/lib/cjs/decorators/common/readOnly.js +21 -0
- package/lib/cjs/decorators/common/readOnly.js.map +1 -0
- package/lib/cjs/decorators/common/required.js +53 -0
- package/lib/cjs/decorators/common/required.js.map +1 -0
- package/lib/cjs/decorators/common/requiredGroups.js +26 -0
- package/lib/cjs/decorators/common/requiredGroups.js.map +1 -0
- package/lib/cjs/decorators/common/schema.js +68 -0
- package/lib/cjs/decorators/common/schema.js.map +1 -0
- package/lib/cjs/decorators/common/title.js +49 -0
- package/lib/cjs/decorators/common/title.js.map +1 -0
- package/lib/cjs/decorators/common/writeOnly.js +21 -0
- package/lib/cjs/decorators/common/writeOnly.js.map +1 -0
- package/lib/cjs/decorators/config/jsonEntityComponent.js +18 -0
- package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -0
- package/lib/cjs/decorators/generics/genericOf.js +99 -0
- package/lib/cjs/decorators/generics/genericOf.js.map +1 -0
- package/lib/cjs/decorators/generics/generics.js +25 -0
- package/lib/cjs/decorators/generics/generics.js.map +1 -0
- package/lib/cjs/decorators/index.js +77 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/cjs/decorators/operations/consumes.js +39 -0
- package/lib/cjs/decorators/operations/consumes.js.map +1 -0
- package/lib/cjs/decorators/operations/contentType.js +28 -0
- package/lib/cjs/decorators/operations/contentType.js.map +1 -0
- package/lib/cjs/decorators/operations/deprecated.js +43 -0
- package/lib/cjs/decorators/operations/deprecated.js.map +1 -0
- package/lib/cjs/decorators/operations/header.js +59 -0
- package/lib/cjs/decorators/operations/header.js.map +1 -0
- package/lib/cjs/decorators/operations/in.js +78 -0
- package/lib/cjs/decorators/operations/in.js.map +1 -0
- package/lib/cjs/decorators/operations/inFile.js +45 -0
- package/lib/cjs/decorators/operations/inFile.js.map +1 -0
- package/lib/cjs/decorators/operations/location.js +29 -0
- package/lib/cjs/decorators/operations/location.js.map +1 -0
- package/lib/cjs/decorators/operations/operationId.js +24 -0
- package/lib/cjs/decorators/operations/operationId.js.map +1 -0
- package/lib/cjs/decorators/operations/operationPath.js +34 -0
- package/lib/cjs/decorators/operations/operationPath.js.map +1 -0
- package/lib/cjs/decorators/operations/partial.js +18 -0
- package/lib/cjs/decorators/operations/partial.js.map +1 -0
- package/lib/cjs/decorators/operations/path.js +29 -0
- package/lib/cjs/decorators/operations/path.js.map +1 -0
- package/lib/cjs/decorators/operations/produces.js +46 -0
- package/lib/cjs/decorators/operations/produces.js.map +1 -0
- package/lib/cjs/decorators/operations/redirect.js +26 -0
- package/lib/cjs/decorators/operations/redirect.js.map +1 -0
- package/lib/cjs/decorators/operations/returns.js +252 -0
- package/lib/cjs/decorators/operations/returns.js.map +1 -0
- package/lib/cjs/decorators/operations/route.js +200 -0
- package/lib/cjs/decorators/operations/route.js.map +1 -0
- package/lib/cjs/decorators/operations/security.js +43 -0
- package/lib/cjs/decorators/operations/security.js.map +1 -0
- package/lib/cjs/decorators/operations/status.js +133 -0
- package/lib/cjs/decorators/operations/status.js.map +1 -0
- package/lib/cjs/decorators/operations/summary.js +34 -0
- package/lib/cjs/decorators/operations/summary.js.map +1 -0
- package/lib/cjs/decorators/operations/tags.js +52 -0
- package/lib/cjs/decorators/operations/tags.js.map +1 -0
- package/lib/cjs/domain/DecoratorContext.js +88 -0
- package/lib/cjs/domain/DecoratorContext.js.map +1 -0
- package/lib/cjs/domain/JsonAliasMap.js +15 -0
- package/lib/cjs/domain/JsonAliasMap.js.map +1 -0
- package/lib/cjs/domain/JsonClassStore.js +37 -0
- package/lib/cjs/domain/JsonClassStore.js.map +1 -0
- package/lib/cjs/domain/JsonEntityStore.js +166 -0
- package/lib/cjs/domain/JsonEntityStore.js.map +1 -0
- package/lib/cjs/domain/JsonFormatTypes.js +22 -0
- package/lib/cjs/domain/JsonFormatTypes.js.map +1 -0
- package/lib/cjs/domain/JsonLazyRef.js +26 -0
- package/lib/cjs/domain/JsonLazyRef.js.map +1 -0
- package/lib/cjs/domain/JsonMap.js +27 -0
- package/lib/cjs/domain/JsonMap.js.map +1 -0
- package/lib/cjs/domain/JsonMethodStore.js +101 -0
- package/lib/cjs/domain/JsonMethodStore.js.map +1 -0
- package/lib/cjs/domain/JsonOperation.js +250 -0
- package/lib/cjs/domain/JsonOperation.js.map +1 -0
- package/lib/cjs/domain/JsonOperationPathsMap.js +29 -0
- package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -0
- package/lib/cjs/domain/JsonOperationRoute.js +56 -0
- package/lib/cjs/domain/JsonOperationRoute.js.map +1 -0
- package/lib/cjs/domain/JsonParameter.js +157 -0
- package/lib/cjs/domain/JsonParameter.js.map +1 -0
- package/lib/cjs/domain/JsonParameterStore.js +90 -0
- package/lib/cjs/domain/JsonParameterStore.js.map +1 -0
- package/lib/cjs/domain/JsonParameterTypes.js +27 -0
- package/lib/cjs/domain/JsonParameterTypes.js.map +1 -0
- package/lib/cjs/domain/JsonPropertyStore.js +68 -0
- package/lib/cjs/domain/JsonPropertyStore.js.map +1 -0
- package/lib/cjs/domain/JsonRequestBody.js +32 -0
- package/lib/cjs/domain/JsonRequestBody.js.map +1 -0
- package/lib/cjs/domain/JsonResponse.js +86 -0
- package/lib/cjs/domain/JsonResponse.js.map +1 -0
- package/lib/cjs/domain/JsonSchema.js +723 -0
- package/lib/cjs/domain/JsonSchema.js.map +1 -0
- package/lib/cjs/domain/SpecTypes.js +13 -0
- package/lib/cjs/domain/SpecTypes.js.map +1 -0
- package/lib/cjs/domain/index.js +20 -0
- package/lib/cjs/domain/index.js.map +1 -0
- package/lib/cjs/hooks/alterIgnore.js +21 -0
- package/lib/cjs/hooks/alterIgnore.js.map +1 -0
- package/lib/cjs/hooks/alterOneOf.js +14 -0
- package/lib/cjs/hooks/alterOneOf.js.map +1 -0
- package/lib/cjs/hooks/alterRequiredGroups.js +15 -0
- package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -0
- package/lib/cjs/index.js +24 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/interfaces/IgnoreCallback.js +3 -0
- package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -0
- package/lib/cjs/interfaces/JsonHookContext.js +3 -0
- package/lib/cjs/interfaces/JsonHookContext.js.map +1 -0
- package/lib/cjs/interfaces/JsonOpenSpec.js +3 -0
- package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -0
- package/lib/cjs/interfaces/JsonSchemaOptions.js +3 -0
- package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -0
- package/lib/cjs/interfaces/index.js +8 -0
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/cjs/registries/JsonSchemaMapperContainer.js +37 -0
- package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -0
- package/lib/cjs/utils/buildPath.js +13 -0
- package/lib/cjs/utils/buildPath.js.map +1 -0
- package/lib/cjs/utils/concatParameters.js +16 -0
- package/lib/cjs/utils/concatParameters.js.map +1 -0
- package/lib/cjs/utils/concatPath.js +8 -0
- package/lib/cjs/utils/concatPath.js.map +1 -0
- package/lib/cjs/utils/defineStatusModel.js +13 -0
- package/lib/cjs/utils/defineStatusModel.js.map +1 -0
- package/lib/cjs/utils/from.js +272 -0
- package/lib/cjs/utils/from.js.map +1 -0
- package/lib/cjs/utils/generics.js +40 -0
- package/lib/cjs/utils/generics.js.map +1 -0
- package/lib/cjs/utils/getComputedType.js +26 -0
- package/lib/cjs/utils/getComputedType.js.map +1 -0
- package/lib/cjs/utils/getInheritedStores.js +23 -0
- package/lib/cjs/utils/getInheritedStores.js.map +1 -0
- package/lib/cjs/utils/getJsonEntityStore.js +18 -0
- package/lib/cjs/utils/getJsonEntityStore.js.map +1 -0
- package/lib/cjs/utils/getJsonPathParameters.js +73 -0
- package/lib/cjs/utils/getJsonPathParameters.js.map +1 -0
- package/lib/cjs/utils/getJsonSchema.js +55 -0
- package/lib/cjs/utils/getJsonSchema.js.map +1 -0
- package/lib/cjs/utils/getJsonType.js +40 -0
- package/lib/cjs/utils/getJsonType.js.map +1 -0
- package/lib/cjs/utils/getOperationsRoutes.js +36 -0
- package/lib/cjs/utils/getOperationsRoutes.js.map +1 -0
- package/lib/cjs/utils/getOperationsStores.js +33 -0
- package/lib/cjs/utils/getOperationsStores.js.map +1 -0
- package/lib/cjs/utils/getPropertiesStores.js +45 -0
- package/lib/cjs/utils/getPropertiesStores.js.map +1 -0
- package/lib/cjs/utils/getRequiredProperties.js +66 -0
- package/lib/cjs/utils/getRequiredProperties.js.map +1 -0
- package/lib/cjs/utils/getSpec.js +87 -0
- package/lib/cjs/utils/getSpec.js.map +1 -0
- package/lib/cjs/utils/isSuccessStatus.js +8 -0
- package/lib/cjs/utils/isSuccessStatus.js.map +1 -0
- package/lib/cjs/utils/mapHeaders.js +29 -0
- package/lib/cjs/utils/mapHeaders.js.map +1 -0
- package/lib/cjs/utils/mapNullableType.js +49 -0
- package/lib/cjs/utils/mapNullableType.js.map +1 -0
- package/lib/cjs/utils/mapRouteOptions.js +26 -0
- package/lib/cjs/utils/mapRouteOptions.js.map +1 -0
- package/lib/cjs/utils/matchGroups.js +23 -0
- package/lib/cjs/utils/matchGroups.js.map +1 -0
- package/lib/cjs/utils/mergeOperation.js +44 -0
- package/lib/cjs/utils/mergeOperation.js.map +1 -0
- package/lib/cjs/utils/mergeSpec.js +46 -0
- package/lib/cjs/utils/mergeSpec.js.map +1 -0
- package/lib/cjs/utils/operationIdFormatter.js +37 -0
- package/lib/cjs/utils/operationIdFormatter.js.map +1 -0
- package/lib/cjs/utils/ref.js +73 -0
- package/lib/cjs/utils/ref.js.map +1 -0
- package/lib/cjs/utils/toJsonMapCollection.js +15 -0
- package/lib/cjs/utils/toJsonMapCollection.js.map +1 -0
- package/lib/cjs/utils/toJsonRegex.js +12 -0
- package/lib/cjs/utils/toJsonRegex.js.map +1 -0
- package/lib/esm/components/anyMapper.js +19 -0
- package/lib/esm/components/anyMapper.js.map +1 -0
- package/lib/esm/components/classMapper.js +37 -0
- package/lib/esm/components/classMapper.js.map +1 -0
- package/lib/esm/components/genericsMapper.js +58 -0
- package/lib/esm/components/genericsMapper.js.map +1 -0
- package/lib/esm/components/index.js +12 -0
- package/lib/esm/components/index.js.map +1 -0
- package/lib/esm/components/inheritedClassMapper.js +18 -0
- package/lib/esm/components/inheritedClassMapper.js.map +1 -0
- package/lib/esm/components/itemMapper.js +6 -0
- package/lib/esm/components/itemMapper.js.map +1 -0
- package/lib/esm/components/lazyRefMapper.js +15 -0
- package/lib/esm/components/lazyRefMapper.js.map +1 -0
- package/lib/esm/components/mapMapper.js +21 -0
- package/lib/esm/components/mapMapper.js.map +1 -0
- package/lib/esm/components/objectMapper.js +27 -0
- package/lib/esm/components/objectMapper.js.map +1 -0
- package/lib/esm/components/ofMapper.js +13 -0
- package/lib/esm/components/ofMapper.js.map +1 -0
- package/lib/esm/components/propertiesMapper.js +21 -0
- package/lib/esm/components/propertiesMapper.js.map +1 -0
- package/lib/esm/components/schemaMapper.js +93 -0
- package/lib/esm/components/schemaMapper.js.map +1 -0
- package/lib/esm/constants/httpMethods.js +43 -0
- package/lib/esm/constants/httpMethods.js.map +1 -0
- package/lib/esm/constants/httpStatusMessages.js +105 -0
- package/lib/esm/constants/httpStatusMessages.js.map +1 -0
- package/lib/esm/decorators/class/children.js +20 -0
- package/lib/esm/decorators/class/children.js.map +1 -0
- package/lib/esm/decorators/collections/collectionContains.js +25 -0
- package/lib/esm/decorators/collections/collectionContains.js.map +1 -0
- package/lib/esm/decorators/collections/collectionOf.js +97 -0
- package/lib/esm/decorators/collections/collectionOf.js.map +1 -0
- package/lib/esm/decorators/collections/maxItems.js +56 -0
- package/lib/esm/decorators/collections/maxItems.js.map +1 -0
- package/lib/esm/decorators/collections/maxProperties.js +79 -0
- package/lib/esm/decorators/collections/maxProperties.js.map +1 -0
- package/lib/esm/decorators/collections/minItems.js +60 -0
- package/lib/esm/decorators/collections/minItems.js.map +1 -0
- package/lib/esm/decorators/collections/minProperties.js +78 -0
- package/lib/esm/decorators/collections/minProperties.js.map +1 -0
- package/lib/esm/decorators/collections/uniqueItems.js +56 -0
- package/lib/esm/decorators/collections/uniqueItems.js.map +1 -0
- package/lib/esm/decorators/common/additionalProperties.js +16 -0
- package/lib/esm/decorators/common/additionalProperties.js.map +1 -0
- package/lib/esm/decorators/common/allOf.js +18 -0
- package/lib/esm/decorators/common/allOf.js.map +1 -0
- package/lib/esm/decorators/common/allow.js +43 -0
- package/lib/esm/decorators/common/allow.js.map +1 -0
- package/lib/esm/decorators/common/any.js +42 -0
- package/lib/esm/decorators/common/any.js.map +1 -0
- package/lib/esm/decorators/common/anyOf.js +22 -0
- package/lib/esm/decorators/common/anyOf.js.map +1 -0
- package/lib/esm/decorators/common/const.js +66 -0
- package/lib/esm/decorators/common/const.js.map +1 -0
- package/lib/esm/decorators/common/customKey.js +38 -0
- package/lib/esm/decorators/common/customKey.js.map +1 -0
- package/lib/esm/decorators/common/default.js +47 -0
- package/lib/esm/decorators/common/default.js.map +1 -0
- package/lib/esm/decorators/common/description.js +72 -0
- package/lib/esm/decorators/common/description.js.map +1 -0
- package/lib/esm/decorators/common/enum.js +26 -0
- package/lib/esm/decorators/common/enum.js.map +1 -0
- package/lib/esm/decorators/common/example.js +17 -0
- package/lib/esm/decorators/common/example.js.map +1 -0
- package/lib/esm/decorators/common/examples.js +17 -0
- package/lib/esm/decorators/common/examples.js.map +1 -0
- package/lib/esm/decorators/common/exclusiveMaximum.js +73 -0
- package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -0
- package/lib/esm/decorators/common/exclusiveMinimum.js +73 -0
- package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -0
- package/lib/esm/decorators/common/format.js +476 -0
- package/lib/esm/decorators/common/format.js.map +1 -0
- package/lib/esm/decorators/common/forwardGroups.js +16 -0
- package/lib/esm/decorators/common/forwardGroups.js.map +1 -0
- package/lib/esm/decorators/common/groups.js +37 -0
- package/lib/esm/decorators/common/groups.js.map +1 -0
- package/lib/esm/decorators/common/hidden.js +36 -0
- package/lib/esm/decorators/common/hidden.js.map +1 -0
- package/lib/esm/decorators/common/ignore.js +67 -0
- package/lib/esm/decorators/common/ignore.js.map +1 -0
- package/lib/esm/decorators/common/integer.js +67 -0
- package/lib/esm/decorators/common/integer.js.map +1 -0
- package/lib/esm/decorators/common/jsonEntityFn.js +28 -0
- package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -0
- package/lib/esm/decorators/common/maxLength.js +85 -0
- package/lib/esm/decorators/common/maxLength.js.map +1 -0
- package/lib/esm/decorators/common/maximum.js +146 -0
- package/lib/esm/decorators/common/maximum.js.map +1 -0
- package/lib/esm/decorators/common/minLength.js +86 -0
- package/lib/esm/decorators/common/minLength.js.map +1 -0
- package/lib/esm/decorators/common/minimum.js +144 -0
- package/lib/esm/decorators/common/minimum.js.map +1 -0
- package/lib/esm/decorators/common/multipleOf.js +77 -0
- package/lib/esm/decorators/common/multipleOf.js.map +1 -0
- package/lib/esm/decorators/common/name.js +48 -0
- package/lib/esm/decorators/common/name.js.map +1 -0
- package/lib/esm/decorators/common/nullable.js +30 -0
- package/lib/esm/decorators/common/nullable.js.map +1 -0
- package/lib/esm/decorators/common/oneOf.js +23 -0
- package/lib/esm/decorators/common/oneOf.js.map +1 -0
- package/lib/esm/decorators/common/optional.js +24 -0
- package/lib/esm/decorators/common/optional.js.map +1 -0
- package/lib/esm/decorators/common/pattern.js +99 -0
- package/lib/esm/decorators/common/pattern.js.map +1 -0
- package/lib/esm/decorators/common/property.js +23 -0
- package/lib/esm/decorators/common/property.js.map +1 -0
- package/lib/esm/decorators/common/readOnly.js +17 -0
- package/lib/esm/decorators/common/readOnly.js.map +1 -0
- package/lib/esm/decorators/common/required.js +49 -0
- package/lib/esm/decorators/common/required.js.map +1 -0
- package/lib/esm/decorators/common/requiredGroups.js +22 -0
- package/lib/esm/decorators/common/requiredGroups.js.map +1 -0
- package/lib/esm/decorators/common/schema.js +63 -0
- package/lib/esm/decorators/common/schema.js.map +1 -0
- package/lib/esm/decorators/common/title.js +45 -0
- package/lib/esm/decorators/common/title.js.map +1 -0
- package/lib/esm/decorators/common/writeOnly.js +17 -0
- package/lib/esm/decorators/common/writeOnly.js.map +1 -0
- package/lib/esm/decorators/config/jsonEntityComponent.js +14 -0
- package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -0
- package/lib/esm/decorators/generics/genericOf.js +95 -0
- package/lib/esm/decorators/generics/genericOf.js.map +1 -0
- package/lib/esm/decorators/generics/generics.js +21 -0
- package/lib/esm/decorators/generics/generics.js.map +1 -0
- package/lib/esm/decorators/index.js +74 -0
- package/lib/esm/decorators/index.js.map +1 -0
- package/lib/esm/decorators/operations/consumes.js +35 -0
- package/lib/esm/decorators/operations/consumes.js.map +1 -0
- package/lib/esm/decorators/operations/contentType.js +24 -0
- package/lib/esm/decorators/operations/contentType.js.map +1 -0
- package/lib/esm/decorators/operations/deprecated.js +39 -0
- package/lib/esm/decorators/operations/deprecated.js.map +1 -0
- package/lib/esm/decorators/operations/header.js +55 -0
- package/lib/esm/decorators/operations/header.js.map +1 -0
- package/lib/esm/decorators/operations/in.js +74 -0
- package/lib/esm/decorators/operations/in.js.map +1 -0
- package/lib/esm/decorators/operations/inFile.js +41 -0
- package/lib/esm/decorators/operations/inFile.js.map +1 -0
- package/lib/esm/decorators/operations/location.js +25 -0
- package/lib/esm/decorators/operations/location.js.map +1 -0
- package/lib/esm/decorators/operations/operationId.js +20 -0
- package/lib/esm/decorators/operations/operationId.js.map +1 -0
- package/lib/esm/decorators/operations/operationPath.js +30 -0
- package/lib/esm/decorators/operations/operationPath.js.map +1 -0
- package/lib/esm/decorators/operations/partial.js +14 -0
- package/lib/esm/decorators/operations/partial.js.map +1 -0
- package/lib/esm/decorators/operations/path.js +25 -0
- package/lib/esm/decorators/operations/path.js.map +1 -0
- package/lib/esm/decorators/operations/produces.js +42 -0
- package/lib/esm/decorators/operations/produces.js.map +1 -0
- package/lib/esm/decorators/operations/redirect.js +22 -0
- package/lib/esm/decorators/operations/redirect.js.map +1 -0
- package/lib/esm/decorators/operations/returns.js +248 -0
- package/lib/esm/decorators/operations/returns.js.map +1 -0
- package/lib/esm/decorators/operations/route.js +188 -0
- package/lib/esm/decorators/operations/route.js.map +1 -0
- package/lib/esm/decorators/operations/security.js +39 -0
- package/lib/esm/decorators/operations/security.js.map +1 -0
- package/lib/esm/decorators/operations/status.js +129 -0
- package/lib/esm/decorators/operations/status.js.map +1 -0
- package/lib/esm/decorators/operations/summary.js +30 -0
- package/lib/esm/decorators/operations/summary.js.map +1 -0
- package/lib/esm/decorators/operations/tags.js +48 -0
- package/lib/esm/decorators/operations/tags.js.map +1 -0
- package/lib/esm/domain/DecoratorContext.js +84 -0
- package/lib/esm/domain/DecoratorContext.js.map +1 -0
- package/lib/esm/domain/JsonAliasMap.js +11 -0
- package/lib/esm/domain/JsonAliasMap.js.map +1 -0
- package/lib/esm/domain/JsonClassStore.js +34 -0
- package/lib/esm/domain/JsonClassStore.js.map +1 -0
- package/lib/esm/domain/JsonEntityStore.js +162 -0
- package/lib/esm/domain/JsonEntityStore.js.map +1 -0
- package/lib/esm/domain/JsonFormatTypes.js +19 -0
- package/lib/esm/domain/JsonFormatTypes.js.map +1 -0
- package/lib/esm/domain/JsonLazyRef.js +22 -0
- package/lib/esm/domain/JsonLazyRef.js.map +1 -0
- package/lib/esm/domain/JsonMap.js +23 -0
- package/lib/esm/domain/JsonMap.js.map +1 -0
- package/lib/esm/domain/JsonMethodStore.js +98 -0
- package/lib/esm/domain/JsonMethodStore.js.map +1 -0
- package/lib/esm/domain/JsonOperation.js +246 -0
- package/lib/esm/domain/JsonOperation.js.map +1 -0
- package/lib/esm/domain/JsonOperationPathsMap.js +25 -0
- package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -0
- package/lib/esm/domain/JsonOperationRoute.js +52 -0
- package/lib/esm/domain/JsonOperationRoute.js.map +1 -0
- package/lib/esm/domain/JsonParameter.js +153 -0
- package/lib/esm/domain/JsonParameter.js.map +1 -0
- package/lib/esm/domain/JsonParameterStore.js +87 -0
- package/lib/esm/domain/JsonParameterStore.js.map +1 -0
- package/lib/esm/domain/JsonParameterTypes.js +22 -0
- package/lib/esm/domain/JsonParameterTypes.js.map +1 -0
- package/lib/esm/domain/JsonPropertyStore.js +65 -0
- package/lib/esm/domain/JsonPropertyStore.js.map +1 -0
- package/lib/esm/domain/JsonRequestBody.js +28 -0
- package/lib/esm/domain/JsonRequestBody.js.map +1 -0
- package/lib/esm/domain/JsonResponse.js +81 -0
- package/lib/esm/domain/JsonResponse.js.map +1 -0
- package/lib/esm/domain/JsonSchema.js +719 -0
- package/lib/esm/domain/JsonSchema.js.map +1 -0
- package/lib/esm/domain/SpecTypes.js +10 -0
- package/lib/esm/domain/SpecTypes.js.map +1 -0
- package/lib/esm/domain/index.js +17 -0
- package/lib/esm/domain/index.js.map +1 -0
- package/lib/esm/hooks/alterIgnore.js +17 -0
- package/lib/esm/hooks/alterIgnore.js.map +1 -0
- package/lib/esm/hooks/alterOneOf.js +10 -0
- package/lib/esm/hooks/alterOneOf.js.map +1 -0
- package/lib/esm/hooks/alterRequiredGroups.js +11 -0
- package/lib/esm/hooks/alterRequiredGroups.js.map +1 -0
- package/lib/esm/index.js +21 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/IgnoreCallback.js +2 -0
- package/lib/esm/interfaces/IgnoreCallback.js.map +1 -0
- package/lib/esm/interfaces/JsonHookContext.js +2 -0
- package/lib/esm/interfaces/JsonHookContext.js.map +1 -0
- package/lib/esm/interfaces/JsonOpenSpec.js +2 -0
- package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -0
- package/lib/esm/interfaces/JsonSchemaOptions.js +2 -0
- package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -0
- package/lib/esm/interfaces/index.js +5 -0
- package/lib/esm/interfaces/index.js.map +1 -0
- package/lib/esm/registries/JsonSchemaMapperContainer.js +30 -0
- package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -0
- package/lib/esm/utils/buildPath.js +9 -0
- package/lib/esm/utils/buildPath.js.map +1 -0
- package/lib/esm/utils/concatParameters.js +12 -0
- package/lib/esm/utils/concatParameters.js.map +1 -0
- package/lib/esm/utils/concatPath.js +4 -0
- package/lib/esm/utils/concatPath.js.map +1 -0
- package/lib/esm/utils/defineStatusModel.js +8 -0
- package/lib/esm/utils/defineStatusModel.js.map +1 -0
- package/lib/esm/utils/from.js +249 -0
- package/lib/esm/utils/from.js.map +1 -0
- package/lib/esm/utils/generics.js +34 -0
- package/lib/esm/utils/generics.js.map +1 -0
- package/lib/esm/utils/getComputedType.js +22 -0
- package/lib/esm/utils/getComputedType.js.map +1 -0
- package/lib/esm/utils/getInheritedStores.js +19 -0
- package/lib/esm/utils/getInheritedStores.js.map +1 -0
- package/lib/esm/utils/getJsonEntityStore.js +14 -0
- package/lib/esm/utils/getJsonEntityStore.js.map +1 -0
- package/lib/esm/utils/getJsonPathParameters.js +69 -0
- package/lib/esm/utils/getJsonPathParameters.js.map +1 -0
- package/lib/esm/utils/getJsonSchema.js +51 -0
- package/lib/esm/utils/getJsonSchema.js.map +1 -0
- package/lib/esm/utils/getJsonType.js +36 -0
- package/lib/esm/utils/getJsonType.js.map +1 -0
- package/lib/esm/utils/getOperationsRoutes.js +32 -0
- package/lib/esm/utils/getOperationsRoutes.js.map +1 -0
- package/lib/esm/utils/getOperationsStores.js +29 -0
- package/lib/esm/utils/getOperationsStores.js.map +1 -0
- package/lib/esm/utils/getPropertiesStores.js +40 -0
- package/lib/esm/utils/getPropertiesStores.js.map +1 -0
- package/lib/esm/utils/getRequiredProperties.js +62 -0
- package/lib/esm/utils/getRequiredProperties.js.map +1 -0
- package/lib/esm/utils/getSpec.js +83 -0
- package/lib/esm/utils/getSpec.js.map +1 -0
- package/lib/esm/utils/isSuccessStatus.js +3 -0
- package/lib/esm/utils/isSuccessStatus.js.map +1 -0
- package/lib/esm/utils/mapHeaders.js +25 -0
- package/lib/esm/utils/mapHeaders.js.map +1 -0
- package/lib/esm/utils/mapNullableType.js +45 -0
- package/lib/esm/utils/mapNullableType.js.map +1 -0
- package/lib/esm/utils/mapRouteOptions.js +22 -0
- package/lib/esm/utils/mapRouteOptions.js.map +1 -0
- package/lib/esm/utils/matchGroups.js +18 -0
- package/lib/esm/utils/matchGroups.js.map +1 -0
- package/lib/esm/utils/mergeOperation.js +40 -0
- package/lib/esm/utils/mergeOperation.js.map +1 -0
- package/lib/esm/utils/mergeSpec.js +42 -0
- package/lib/esm/utils/mergeSpec.js.map +1 -0
- package/lib/esm/utils/operationIdFormatter.js +33 -0
- package/lib/esm/utils/operationIdFormatter.js.map +1 -0
- package/lib/esm/utils/ref.js +67 -0
- package/lib/esm/utils/ref.js.map +1 -0
- package/lib/esm/utils/toJsonMapCollection.js +11 -0
- package/lib/esm/utils/toJsonMapCollection.js.map +1 -0
- package/lib/esm/utils/toJsonRegex.js +8 -0
- package/lib/esm/utils/toJsonRegex.js.map +1 -0
- package/lib/{components → types/components}/anyMapper.d.ts +0 -0
- package/lib/{components → types/components}/classMapper.d.ts +1 -1
- package/lib/{components → types/components}/genericsMapper.d.ts +0 -0
- package/lib/{components → types/components}/index.d.ts +2 -0
- package/lib/{components → types/components}/inheritedClassMapper.d.ts +1 -1
- package/lib/{components → types/components}/itemMapper.d.ts +0 -0
- package/lib/types/components/lazyRefMapper.d.ts +3 -0
- package/lib/{components → types/components}/mapMapper.d.ts +1 -1
- package/lib/{components → types/components}/objectMapper.d.ts +0 -0
- package/lib/types/components/ofMapper.d.ts +3 -0
- package/lib/types/components/propertiesMapper.d.ts +3 -0
- package/lib/{components → types/components}/schemaMapper.d.ts +1 -1
- package/lib/{constants → types/constants}/httpMethods.d.ts +0 -0
- package/lib/types/constants/httpStatusMessages.d.ts +272 -0
- package/lib/types/decorators/class/children.d.ts +11 -0
- package/lib/{decorators → types/decorators}/collections/collectionContains.d.ts +0 -0
- package/lib/{decorators → types/decorators}/collections/collectionOf.d.ts +1 -1
- package/lib/{decorators → types/decorators}/collections/maxItems.d.ts +0 -0
- package/lib/{decorators → types/decorators}/collections/maxProperties.d.ts +0 -0
- package/lib/{decorators → types/decorators}/collections/minItems.d.ts +0 -0
- package/lib/{decorators → types/decorators}/collections/minProperties.d.ts +0 -0
- package/lib/{decorators → types/decorators}/collections/uniqueItems.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/additionalProperties.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/allOf.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/allow.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/any.d.ts +1 -1
- package/lib/{decorators → types/decorators}/common/anyOf.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/const.d.ts +1 -1
- package/lib/{decorators → types/decorators}/common/customKey.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/default.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/description.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/enum.d.ts +1 -1
- package/lib/{decorators → types/decorators}/common/example.d.ts +0 -0
- package/lib/types/decorators/common/examples.d.ts +12 -0
- package/lib/{decorators → types/decorators}/common/exclusiveMaximum.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/exclusiveMinimum.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/format.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/forwardGroups.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/groups.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/hidden.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/ignore.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/integer.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/jsonEntityFn.d.ts +2 -2
- package/lib/{decorators → types/decorators}/common/maxLength.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/maximum.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/minLength.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/minimum.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/multipleOf.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/name.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/nullable.d.ts +1 -1
- package/lib/{decorators → types/decorators}/common/oneOf.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/optional.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/pattern.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/property.d.ts +1 -0
- package/lib/{decorators → types/decorators}/common/readOnly.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/required.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/requiredGroups.d.ts +1 -1
- package/lib/{decorators → types/decorators}/common/schema.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/title.d.ts +0 -0
- package/lib/{decorators → types/decorators}/common/writeOnly.d.ts +0 -0
- package/lib/{decorators → types/decorators}/config/jsonEntityComponent.d.ts +0 -0
- package/lib/{decorators → types/decorators}/generics/genericOf.d.ts +0 -0
- package/lib/{decorators → types/decorators}/generics/generics.d.ts +0 -0
- package/lib/{decorators → types/decorators}/index.d.ts +3 -0
- package/lib/{decorators → types/decorators}/operations/consumes.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/contentType.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/deprecated.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/header.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/in.d.ts +0 -0
- package/lib/types/decorators/operations/inFile.d.ts +25 -0
- package/lib/{decorators → types/decorators}/operations/location.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/operationId.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/operationPath.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/partial.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/path.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/produces.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/redirect.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/returns.d.ts +16 -1
- package/lib/{decorators → types/decorators}/operations/route.d.ts +3 -0
- package/lib/{decorators → types/decorators}/operations/security.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/status.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/summary.d.ts +0 -0
- package/lib/{decorators → types/decorators}/operations/tags.d.ts +0 -0
- package/lib/{domain → types/domain}/DecoratorContext.d.ts +0 -0
- package/lib/{domain → types/domain}/JsonAliasMap.d.ts +0 -0
- package/lib/types/domain/JsonClassStore.d.ts +12 -0
- package/lib/types/domain/JsonEntityStore.d.ts +136 -0
- package/lib/{domain → types/domain}/JsonFormatTypes.d.ts +0 -0
- package/lib/{domain → types/domain}/JsonLazyRef.d.ts +0 -0
- package/lib/{domain → types/domain}/JsonMap.d.ts +0 -0
- package/lib/types/domain/JsonMethodStore.d.ts +40 -0
- package/lib/{domain → types/domain}/JsonOperation.d.ts +1 -0
- package/lib/types/domain/JsonOperationPathsMap.d.ts +7 -0
- package/lib/types/domain/JsonOperationRoute.d.ts +24 -0
- package/lib/{domain → types/domain}/JsonParameter.d.ts +3 -1
- package/lib/types/domain/JsonParameterStore.d.ts +30 -0
- package/lib/{domain → types/domain}/JsonParameterTypes.d.ts +0 -0
- package/lib/types/domain/JsonPropertyStore.d.ts +23 -0
- package/lib/{domain → types/domain}/JsonRequestBody.d.ts +0 -0
- package/lib/{domain → types/domain}/JsonResponse.d.ts +0 -0
- package/lib/{domain → types/domain}/JsonSchema.d.ts +6 -12
- package/lib/{domain → types/domain}/SpecTypes.d.ts +3 -0
- package/lib/{domain → types/domain}/index.d.ts +5 -0
- package/lib/{hooks → types/hooks}/alterIgnore.d.ts +0 -0
- package/lib/types/hooks/alterOneOf.d.ts +3 -0
- package/lib/{hooks → types/hooks}/alterRequiredGroups.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +3 -0
- package/lib/{interfaces → types/interfaces}/IgnoreCallback.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/JsonHookContext.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/JsonOpenSpec.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/JsonSchemaOptions.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
- package/lib/{registries → types/registries}/JsonSchemaMapperContainer.d.ts +3 -2
- package/lib/{utils → types/utils}/buildPath.d.ts +0 -0
- package/lib/{utils → types/utils}/concatParameters.d.ts +0 -0
- package/lib/types/utils/concatPath.d.ts +1 -0
- package/lib/{utils → types/utils}/defineStatusModel.d.ts +0 -0
- package/lib/{utils → types/utils}/from.d.ts +0 -0
- package/lib/{utils → types/utils}/generics.d.ts +0 -0
- package/lib/{utils → types/utils}/getComputedType.d.ts +0 -0
- package/lib/{utils → types/utils}/getInheritedStores.d.ts +2 -2
- package/lib/types/utils/getJsonEntityStore.d.ts +15 -0
- package/lib/{utils → types/utils}/getJsonPathParameters.d.ts +0 -0
- package/lib/types/utils/getJsonSchema.d.ts +4 -0
- package/lib/{utils → types/utils}/getJsonType.d.ts +0 -0
- package/lib/types/utils/getOperationsRoutes.d.ts +8 -0
- package/lib/types/utils/getOperationsStores.d.ts +6 -0
- package/lib/types/utils/getPropertiesStores.d.ts +20 -0
- package/lib/{utils → types/utils}/getRequiredProperties.d.ts +0 -0
- package/lib/{utils → types/utils}/getSpec.d.ts +0 -0
- package/lib/{utils → types/utils}/isSuccessStatus.d.ts +0 -0
- package/lib/{utils → types/utils}/mapHeaders.d.ts +0 -0
- package/lib/{utils → types/utils}/mapNullableType.d.ts +0 -0
- package/lib/{utils → types/utils}/mapRouteOptions.d.ts +1 -1
- package/lib/{utils → types/utils}/matchGroups.d.ts +0 -0
- package/lib/{utils → types/utils}/mergeOperation.d.ts +0 -0
- package/lib/{utils → types/utils}/mergeSpec.d.ts +0 -0
- package/lib/{utils → types/utils}/operationIdFormatter.d.ts +0 -0
- package/lib/types/utils/ref.d.ts +14 -0
- package/lib/{utils → types/utils}/toJsonMapCollection.d.ts +0 -0
- package/lib/{utils → types/utils}/toJsonRegex.d.ts +0 -0
- package/package.json +21 -17
- package/tsconfig.compile.esm.json +23 -0
- package/lib/components/lazyRefMapper.d.ts +0 -19
- package/lib/constants/httpStatusMessages.d.ts +0 -5
- package/lib/domain/JsonEntityStore.d.ts +0 -94
- package/lib/index.js +0 -7894
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -7751
- package/lib/index.modern.js.map +0 -1
- package/lib/registries/JsonEntitiesContainer.d.ts +0 -6
- package/lib/utils/getJsonEntityStore.d.ts +0 -6
- package/lib/utils/getJsonSchema.d.ts +0 -5
- package/lib/utils/getOperationsStores.d.ts +0 -6
- package/lib/utils/getPropertiesStores.d.ts +0 -20
- package/lib/utils/isJsonClass.d.ts +0 -4
- package/lib/utils/mergeSpec.benchmark.d.ts +0 -1
- package/lib/utils/ref.d.ts +0 -46
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Min = exports.Minimum = void 0;
|
|
4
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
5
|
+
/**
|
|
6
|
+
* The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
|
|
7
|
+
*
|
|
8
|
+
* If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.
|
|
9
|
+
*
|
|
10
|
+
* ::: warning
|
|
11
|
+
* This decorator will be removed in v7.
|
|
12
|
+
* For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.
|
|
13
|
+
* :::
|
|
14
|
+
*
|
|
15
|
+
* ## Example
|
|
16
|
+
* ### With primitive type
|
|
17
|
+
*
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class Model {
|
|
20
|
+
* @Minimum(10)
|
|
21
|
+
* property: number;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Will produce:
|
|
26
|
+
*
|
|
27
|
+
* ```json
|
|
28
|
+
* {
|
|
29
|
+
* "type": "object",
|
|
30
|
+
* "properties": {
|
|
31
|
+
* "property": {
|
|
32
|
+
* "type": "number",
|
|
33
|
+
* "minimum": 10
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* ### With array type
|
|
40
|
+
*
|
|
41
|
+
* ```typescript
|
|
42
|
+
* class Model {
|
|
43
|
+
* @Minimum(10)
|
|
44
|
+
* @CollectionOf(Number)
|
|
45
|
+
* property: number[];
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* Will produce:
|
|
50
|
+
*
|
|
51
|
+
* ```json
|
|
52
|
+
* {
|
|
53
|
+
* "type": "object",
|
|
54
|
+
* "properties": {
|
|
55
|
+
* "property": {
|
|
56
|
+
* "type": "array",
|
|
57
|
+
* "items": {
|
|
58
|
+
* "type": "number",
|
|
59
|
+
* "minimum": 10
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @param {number} minimum The minimum value allowed
|
|
67
|
+
* @param {boolean} exclusive
|
|
68
|
+
* @decorator
|
|
69
|
+
* @validation
|
|
70
|
+
* @swagger
|
|
71
|
+
* @schema
|
|
72
|
+
* @input
|
|
73
|
+
*/
|
|
74
|
+
function Minimum(minimum, exclusive = false) {
|
|
75
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
76
|
+
exclusive ? store.itemSchema.exclusiveMinimum(minimum) : store.itemSchema.minimum(minimum);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.Minimum = Minimum;
|
|
80
|
+
/**
|
|
81
|
+
* The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
|
|
82
|
+
*
|
|
83
|
+
* If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.
|
|
84
|
+
*
|
|
85
|
+
* ## Example
|
|
86
|
+
* ### With primitive type
|
|
87
|
+
*
|
|
88
|
+
* ```typescript
|
|
89
|
+
* class Model {
|
|
90
|
+
* @Min(10)
|
|
91
|
+
* property: number;
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* Will produce:
|
|
96
|
+
*
|
|
97
|
+
* ```json
|
|
98
|
+
* {
|
|
99
|
+
* "type": "object",
|
|
100
|
+
* "properties": {
|
|
101
|
+
* "property": {
|
|
102
|
+
* "type": "number",
|
|
103
|
+
* "minimum": 10
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* ### With array type
|
|
110
|
+
*
|
|
111
|
+
* ```typescript
|
|
112
|
+
* class Model {
|
|
113
|
+
* @Min(10)
|
|
114
|
+
* @CollectionOf(Number)
|
|
115
|
+
* property: number[];
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* Will produce:
|
|
120
|
+
*
|
|
121
|
+
* ```json
|
|
122
|
+
* {
|
|
123
|
+
* "type": "object",
|
|
124
|
+
* "properties": {
|
|
125
|
+
* "property": {
|
|
126
|
+
* "type": "array",
|
|
127
|
+
* "items": {
|
|
128
|
+
* "type": "number",
|
|
129
|
+
* "minimum": 10
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @alias Minimum
|
|
137
|
+
* @param minimum The minimum value allowed
|
|
138
|
+
* @param exclusive
|
|
139
|
+
* @decorator
|
|
140
|
+
* @validation
|
|
141
|
+
* @swagger
|
|
142
|
+
* @schema
|
|
143
|
+
* @input
|
|
144
|
+
*/
|
|
145
|
+
function Min(minimum, exclusive = false) {
|
|
146
|
+
return Minimum(minimum, exclusive);
|
|
147
|
+
}
|
|
148
|
+
exports.Min = Min;
|
|
149
|
+
//# sourceMappingURL=minimum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimum.js","sourceRoot":"","sources":["../../../../src/decorators/common/minimum.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,SAAgB,OAAO,CAAC,OAAe,EAAE,YAAqB,KAAK;IACjE,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,SAAgB,GAAG,CAAC,OAAe,EAAE,YAAqB,KAAK;IAC7D,OAAO,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACrC,CAAC;AAFD,kBAEC","sourcesContent":["import {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.\n *\n * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.\n *\n * ::: warning\n * This decorator will be removed in v7.\n * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Minimum(10)\n * property: number;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @Minimum(10)\n * @CollectionOf(Number)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {number} minimum The minimum value allowed\n * @param {boolean} exclusive\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Minimum(minimum: number, exclusive: boolean = false) {\n return JsonEntityFn((store) => {\n exclusive ? store.itemSchema.exclusiveMinimum(minimum) : store.itemSchema.minimum(minimum);\n });\n}\n\n/**\n * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.\n *\n * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Min(10)\n * property: number;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @Min(10)\n * @CollectionOf(Number)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * }\n * ```\n *\n * @alias Minimum\n * @param minimum The minimum value allowed\n * @param exclusive\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Min(minimum: number, exclusive: boolean = false) {\n return Minimum(minimum, exclusive);\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultipleOf = void 0;
|
|
4
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
5
|
+
/**
|
|
6
|
+
* A numeric instance is valid only if division by this keyword's value results in an integer.
|
|
7
|
+
*
|
|
8
|
+
* ::: warning
|
|
9
|
+
* The value of `multipleOf` MUST be a number, strictly greater than 0.
|
|
10
|
+
* :::
|
|
11
|
+
*
|
|
12
|
+
* ::: warning
|
|
13
|
+
* For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.
|
|
14
|
+
* :::
|
|
15
|
+
*
|
|
16
|
+
* ## Example
|
|
17
|
+
* ### With primitive type
|
|
18
|
+
*
|
|
19
|
+
* ```typescript
|
|
20
|
+
* class Model {
|
|
21
|
+
* @MultipleOf(2)
|
|
22
|
+
* property: Number;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ```json
|
|
27
|
+
* {
|
|
28
|
+
* "type": "object",
|
|
29
|
+
* "properties": {
|
|
30
|
+
* "property": {
|
|
31
|
+
* "type": "number",
|
|
32
|
+
* "multipleOf": 2
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ### With array type
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* class Model {
|
|
42
|
+
* @CollectionOf(number)
|
|
43
|
+
* @MultipleOf(2)
|
|
44
|
+
* property: number[];
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Will produce:
|
|
49
|
+
*
|
|
50
|
+
* ```json
|
|
51
|
+
* {
|
|
52
|
+
* "type": "object",
|
|
53
|
+
* "properties": {
|
|
54
|
+
* "property": {
|
|
55
|
+
* "type": "array",
|
|
56
|
+
* "items": {
|
|
57
|
+
* "type": "number",
|
|
58
|
+
* "multipleOf": 2
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param {number} multipleOf The multiple value allowed
|
|
66
|
+
* @decorator
|
|
67
|
+
* @validation
|
|
68
|
+
* @swagger
|
|
69
|
+
* @schema
|
|
70
|
+
* @input
|
|
71
|
+
*/
|
|
72
|
+
function MultipleOf(multipleOf) {
|
|
73
|
+
if (multipleOf <= 0) {
|
|
74
|
+
throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");
|
|
75
|
+
}
|
|
76
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
77
|
+
store.itemSchema.multipleOf(multipleOf);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.MultipleOf = MultipleOf;
|
|
81
|
+
//# sourceMappingURL=multipleOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/multipleOf.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,SAAgB,UAAU,CAAC,UAAkB;IAC3C,IAAI,UAAU,IAAI,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC;AARD,gCAQC","sourcesContent":["import {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * A numeric instance is valid only if division by this keyword's value results in an integer.\n *\n * ::: warning\n * The value of `multipleOf` MUST be a number, strictly greater than 0.\n * :::\n *\n * ::: warning\n * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @MultipleOf(2)\n * property: Number;\n * }\n * ```\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"multipleOf\": 2\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @CollectionOf(number)\n * @MultipleOf(2)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"multipleOf\": 2\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {number} multipleOf The multiple value allowed\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function MultipleOf(multipleOf: number) {\n if (multipleOf <= 0) {\n throw new Error(\"The value of multipleOf MUST be a number, strictly greater than 0.\");\n }\n\n return JsonEntityFn((store) => {\n store.itemSchema.multipleOf(multipleOf);\n });\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Name = void 0;
|
|
4
|
+
const core_1 = require("@tsed/core");
|
|
5
|
+
const jsonEntityFn_1 = require("../common/jsonEntityFn");
|
|
6
|
+
/**
|
|
7
|
+
* Add a name metadata on the decorated element.
|
|
8
|
+
*
|
|
9
|
+
* ## Examples
|
|
10
|
+
* ### On parameters
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* async myMethod(@Name("nameOf") @PathParams("id") id: string): Promise<Model> {
|
|
14
|
+
*
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ### On parameters
|
|
19
|
+
*
|
|
20
|
+
* ```typescript
|
|
21
|
+
* @Name("AliasName")
|
|
22
|
+
* @Controller("/")
|
|
23
|
+
* class ModelCtrl {
|
|
24
|
+
*
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @param name
|
|
29
|
+
* @decorator
|
|
30
|
+
* @validation
|
|
31
|
+
* @swagger
|
|
32
|
+
* @schema
|
|
33
|
+
* @input
|
|
34
|
+
* @classDecorator
|
|
35
|
+
* @operation
|
|
36
|
+
*/
|
|
37
|
+
function Name(name) {
|
|
38
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
|
|
39
|
+
switch ((0, core_1.decoratorTypeOf)(args)) {
|
|
40
|
+
case core_1.DecoratorTypes.CLASS:
|
|
41
|
+
store.schema.name(name);
|
|
42
|
+
break;
|
|
43
|
+
case core_1.DecoratorTypes.PARAM:
|
|
44
|
+
store.parameter.name(name);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
store.parent.schema.addAlias(args[1], name);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.Name = Name;
|
|
52
|
+
//# sourceMappingURL=name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../src/decorators/common/name.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAEhF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,IAAI,CAAC,IAAS;IAC5B,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;QACxE,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,SAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,MAAM;YACR;gBACE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,oBAaC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Add a name metadata on the decorated element.\n *\n * ## Examples\n * ### On parameters\n *\n * ```typescript\n * async myMethod(@Name(\"nameOf\") @PathParams(\"id\") id: string): Promise<Model> {\n *\n * }\n * ```\n *\n * ### On parameters\n *\n * ```typescript\n * @Name(\"AliasName\")\n * @Controller(\"/\")\n * class ModelCtrl {\n *\n * }\n * ```\n *\n * @param name\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @operation\n */\nexport function Name(name: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.CLASS:\n store.schema.name(name);\n break;\n case DecoratorTypes.PARAM:\n store.parameter!.name(name);\n break;\n default:\n store.parent.schema.addAlias(args[1], name);\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Nullable = void 0;
|
|
4
|
+
const core_1 = require("@tsed/core");
|
|
5
|
+
const any_1 = require("./any");
|
|
6
|
+
const property_1 = require("./property");
|
|
7
|
+
/**
|
|
8
|
+
* Set field as nullable.
|
|
9
|
+
*
|
|
10
|
+
* ## Example
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* class Model {
|
|
14
|
+
* @Nullable(Date)
|
|
15
|
+
* property: Date | null;
|
|
16
|
+
*
|
|
17
|
+
* @Nullable(String, Number, Boolean)
|
|
18
|
+
* property: string | number | boolean | null;
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @returns {Function}
|
|
23
|
+
* @decorator
|
|
24
|
+
* @validation
|
|
25
|
+
* @swagger
|
|
26
|
+
* @schema
|
|
27
|
+
* @input
|
|
28
|
+
*/
|
|
29
|
+
function Nullable(type, ...types) {
|
|
30
|
+
types = [type, ...types];
|
|
31
|
+
return (0, core_1.useDecorators)(types.length === 1 && (0, property_1.Property)(types[0]), (0, any_1.Any)(null, ...types));
|
|
32
|
+
}
|
|
33
|
+
exports.Nullable = Nullable;
|
|
34
|
+
//# sourceMappingURL=nullable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../../src/decorators/common/nullable.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAE/C,+BAA0B;AAC1B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,QAAQ,CAAC,IAA2C,EAAE,GAAG,KAAgD;IACvH,KAAK,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IACzB,OAAO,IAAA,oBAAa,EAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAA,SAAG,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAHD,4BAGC","sourcesContent":["import {Type, useDecorators} from \"@tsed/core\";\nimport type {JSONSchema6TypeName} from \"json-schema\";\nimport {Any} from \"./any\";\nimport {Property} from \"./property\";\n\n/**\n * Set field as nullable.\n *\n * ## Example\n *\n * ```typescript\n * class Model {\n * @Nullable(Date)\n * property: Date | null;\n *\n * @Nullable(String, Number, Boolean)\n * property: string | number | boolean | null;\n * }\n * ```\n *\n * @returns {Function}\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Nullable(type: JSONSchema6TypeName | Type<any> | any, ...types: (JSONSchema6TypeName | Type<any> | any)[]) {\n types = [type, ...types];\n return useDecorators(types.length === 1 && Property(types[0]), Any(null, ...types));\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OneOf = void 0;
|
|
4
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
5
|
+
/**
|
|
6
|
+
* See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
|
|
7
|
+
*
|
|
8
|
+
* ::: warning
|
|
9
|
+
* OneOf isn't supported by OS2
|
|
10
|
+
* :::
|
|
11
|
+
*
|
|
12
|
+
* @decorator
|
|
13
|
+
* @validation
|
|
14
|
+
* @swagger
|
|
15
|
+
* @schema
|
|
16
|
+
* @classDecorator
|
|
17
|
+
* @input
|
|
18
|
+
* @param oneOf
|
|
19
|
+
*/
|
|
20
|
+
function OneOf(...oneOf) {
|
|
21
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((entity) => {
|
|
22
|
+
entity.itemSchema.oneOf(oneOf);
|
|
23
|
+
entity.type = Object;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.OneOf = OneOf;
|
|
27
|
+
//# sourceMappingURL=oneOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/oneOf.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAE5C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAsB;IAC7C,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AALD,sBAKC","sourcesContent":["import {AnyJsonSchema} from \"../../domain/JsonSchema\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n *\n * ::: warning\n * OneOf isn't supported by OS2\n * :::\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n * @param oneOf\n */\nexport function OneOf(...oneOf: AnyJsonSchema[]) {\n return JsonEntityFn((entity) => {\n entity.itemSchema.oneOf(oneOf);\n entity.type = Object;\n });\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Optional = void 0;
|
|
4
|
+
const core_1 = require("@tsed/core");
|
|
5
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
6
|
+
/**
|
|
7
|
+
* Add optional annotation on Property or Parameter.
|
|
8
|
+
*
|
|
9
|
+
* @decorator
|
|
10
|
+
* @validation
|
|
11
|
+
* @swagger
|
|
12
|
+
* @schema
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
function Optional() {
|
|
16
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
17
|
+
switch (store.decoratorType) {
|
|
18
|
+
case core_1.DecoratorTypes.PARAM:
|
|
19
|
+
store.required = false;
|
|
20
|
+
break;
|
|
21
|
+
case core_1.DecoratorTypes.PROP:
|
|
22
|
+
store.parentSchema.removeRequired(store.propertyName);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.Optional = Optional;
|
|
28
|
+
//# sourceMappingURL=optional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../../src/decorators/common/optional.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,iDAA4C;AAG5C;;;;;;;;GAQG;AACH,SAAgB,QAAQ;IACtB,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAC/C,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACtB,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBACtD,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,4BAWC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add optional annotation on Property or Parameter.\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Optional() {\n return JsonEntityFn((store) => {\n switch (store.decoratorType) {\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).required = false;\n break;\n case DecoratorTypes.PROP:\n store.parentSchema.removeRequired(store.propertyName);\n break;\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pattern = void 0;
|
|
4
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
5
|
+
/**
|
|
6
|
+
* The pattern and Pattern Properties keywords use regular expressions to express constraints.
|
|
7
|
+
* The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.
|
|
8
|
+
*
|
|
9
|
+
* ::: warning
|
|
10
|
+
* For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.
|
|
11
|
+
* :::
|
|
12
|
+
*
|
|
13
|
+
* A single unicode character (other than the special characters below) matches itself.
|
|
14
|
+
*
|
|
15
|
+
* * `^`: Matches only at the beginning of the string.
|
|
16
|
+
* * `$`: Matches only at the end of the string.
|
|
17
|
+
* * `(...)`: Group a series of regular expressions into a single regular expression.
|
|
18
|
+
* * `|`: Matches either the regular expression preceding or following the | symbol.
|
|
19
|
+
* * `[abc]`: Matches any of the characters inside the square brackets.
|
|
20
|
+
* * `[a-z]`: Matches the range of characters.
|
|
21
|
+
* * `[^abc]`: Matches any character not listed.
|
|
22
|
+
* * `[^a-z]`: Matches any character outside of the range.
|
|
23
|
+
* * `+`: Matches one or more repetitions of the preceding regular expression.
|
|
24
|
+
* * `*`: Matches zero or more repetitions of the preceding regular expression.
|
|
25
|
+
* * `?`: Matches zero or one repetitions of the preceding regular expression.
|
|
26
|
+
* * `+?`, *?`, ??`: The `*`, `+`, and `?` qualifiers are all greedy; they match as much text as possible. Sometimes this behavior isn’t desired and you want to match as few characters as possible.
|
|
27
|
+
* * `{x}`: Match exactly x occurrences of the preceding regular expression.
|
|
28
|
+
* * `{x,y}`: Match at least x and at most y occurrences of the preceding regular expression.
|
|
29
|
+
* * `{x,}`: Match x occurrences or more of the preceding regular expression.
|
|
30
|
+
* * `{x}?`, {x,y}?, {x,}?`: Lazy versions of the above expressions.
|
|
31
|
+
*
|
|
32
|
+
* ## Example
|
|
33
|
+
*
|
|
34
|
+
* ```typescript
|
|
35
|
+
* class Model {
|
|
36
|
+
* @Pattern("^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$")
|
|
37
|
+
* @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
|
|
38
|
+
* property: string;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* ### With primitive type
|
|
43
|
+
*
|
|
44
|
+
* ```typescript
|
|
45
|
+
* class Model {
|
|
46
|
+
* @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
|
|
47
|
+
* property: string;
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ```json
|
|
52
|
+
* {
|
|
53
|
+
* "type": "object",
|
|
54
|
+
* "properties": {
|
|
55
|
+
* "property": {
|
|
56
|
+
* "type": "string",
|
|
57
|
+
* "pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* ### With array type
|
|
64
|
+
*
|
|
65
|
+
* ```typescript
|
|
66
|
+
* class Model {
|
|
67
|
+
* @CollectionOf(string)
|
|
68
|
+
* @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
|
|
69
|
+
* property: string[];
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* Will produce:
|
|
74
|
+
*
|
|
75
|
+
* ```json
|
|
76
|
+
* {
|
|
77
|
+
* "type": "object",
|
|
78
|
+
* "properties": {
|
|
79
|
+
* "property": {
|
|
80
|
+
* "type": "array",
|
|
81
|
+
* "items": {
|
|
82
|
+
* "type": "string",
|
|
83
|
+
* "pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @param {string} pattern
|
|
91
|
+
* @decorator
|
|
92
|
+
* @validation
|
|
93
|
+
* @swagger
|
|
94
|
+
* @schema
|
|
95
|
+
* @input
|
|
96
|
+
*/
|
|
97
|
+
function Pattern(pattern) {
|
|
98
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
99
|
+
store.itemSchema.pattern(pattern);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.Pattern = Pattern;
|
|
103
|
+
//# sourceMappingURL=pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../../src/decorators/common/pattern.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,SAAgB,OAAO,CAAC,OAAwB;IAC9C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * The pattern and Pattern Properties keywords use regular expressions to express constraints.\n * The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.\n *\n * ::: warning\n * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * A single unicode character (other than the special characters below) matches itself.\n *\n * * `^`: Matches only at the beginning of the string.\n * * `$`: Matches only at the end of the string.\n * * `(...)`: Group a series of regular expressions into a single regular expression.\n * * `|`: Matches either the regular expression preceding or following the | symbol.\n * * `[abc]`: Matches any of the characters inside the square brackets.\n * * `[a-z]`: Matches the range of characters.\n * * `[^abc]`: Matches any character not listed.\n * * `[^a-z]`: Matches any character outside of the range.\n * * `+`: Matches one or more repetitions of the preceding regular expression.\n * * `*`: Matches zero or more repetitions of the preceding regular expression.\n * * `?`: Matches zero or one repetitions of the preceding regular expression.\n * * `+?`, *?`, ??`: The `*`, `+`, and `?` qualifiers are all greedy; they match as much text as possible. Sometimes this behavior isn’t desired and you want to match as few characters as possible.\n * * `{x}`: Match exactly x occurrences of the preceding regular expression.\n * * `{x,y}`: Match at least x and at most y occurrences of the preceding regular expression.\n * * `{x,}`: Match x occurrences or more of the preceding regular expression.\n * * `{x}?`, {x,y}?, {x,}?`: Lazy versions of the above expressions.\n *\n * ## Example\n *\n * ```typescript\n * class Model {\n * @Pattern(\"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\")\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string;\n * }\n * ```\n *\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string;\n * }\n * ```\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"string\",\n * \"pattern\": \"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @CollectionOf(string)\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"string\",\n * \"pattern\": \"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {string} pattern\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Pattern(pattern: string | RegExp) {\n return JsonEntityFn((store: JsonEntityStore) => {\n store.itemSchema.pattern(pattern);\n });\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Property = void 0;
|
|
4
|
+
const core_1 = require("@tsed/core");
|
|
5
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
6
|
+
/**
|
|
7
|
+
* Declare a new property on a model.
|
|
8
|
+
*
|
|
9
|
+
* @param type
|
|
10
|
+
* @decorator
|
|
11
|
+
* @validation
|
|
12
|
+
* @swagger
|
|
13
|
+
* @schema
|
|
14
|
+
* @input
|
|
15
|
+
*/
|
|
16
|
+
function Property(type) {
|
|
17
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
18
|
+
if (type) {
|
|
19
|
+
if ((0, core_1.isClass)(type)) {
|
|
20
|
+
store.type = type;
|
|
21
|
+
}
|
|
22
|
+
store.itemSchema.type(type);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.Property = Property;
|
|
27
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../src/decorators/common/property.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AACnC,iDAA4C;AAE5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,IAAI,EAAE;YACR,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;gBACjB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;aACnB;YACD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AATD,4BASC","sourcesContent":["import {isClass} from \"@tsed/core\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Declare a new property on a model.\n *\n * @param type\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Property(type?: any) {\n return JsonEntityFn((store) => {\n if (type) {\n if (isClass(type)) {\n store.type = type;\n }\n store.itemSchema.type(type);\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadOnly = void 0;
|
|
4
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
5
|
+
/**
|
|
6
|
+
* Set the property as readOnly.
|
|
7
|
+
*
|
|
8
|
+
* @returns {Function}
|
|
9
|
+
* @decorator
|
|
10
|
+
* @validation
|
|
11
|
+
* @property
|
|
12
|
+
* @parameter
|
|
13
|
+
* @schema
|
|
14
|
+
*/
|
|
15
|
+
function ReadOnly(readOnly = true) {
|
|
16
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((store) => {
|
|
17
|
+
store.itemSchema.readOnly(readOnly);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.ReadOnly = ReadOnly;
|
|
21
|
+
//# sourceMappingURL=readOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../../src/decorators/common/readOnly.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,WAAoB,IAAI;IAC/C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n/**\n * Set the property as readOnly.\n *\n * @returns {Function}\n * @decorator\n * @validation\n * @property\n * @parameter\n * @schema\n */\nexport function ReadOnly(readOnly: boolean = true) {\n return JsonEntityFn((store: JsonEntityStore) => {\n store.itemSchema.readOnly(readOnly);\n });\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Required = void 0;
|
|
4
|
+
const allow_1 = require("./allow");
|
|
5
|
+
const optional_1 = require("./optional");
|
|
6
|
+
/**
|
|
7
|
+
* Add required annotation on Property or Parameter.
|
|
8
|
+
*
|
|
9
|
+
* The @@Required@@ decorator can be used on two cases.
|
|
10
|
+
*
|
|
11
|
+
* To decorate a parameters:
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* @Post("/")
|
|
15
|
+
* async method(@Required() @BodyParams("field") field: string) {}
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* To decorate a model:
|
|
19
|
+
*
|
|
20
|
+
* ```typescript
|
|
21
|
+
* class Model {
|
|
22
|
+
* @Required()
|
|
23
|
+
* field: string;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* ::: tip
|
|
28
|
+
* Required will throw a BadRequest when the given value is `null`, an empty string or `undefined`.
|
|
29
|
+
* :::
|
|
30
|
+
*
|
|
31
|
+
* ### Allow values
|
|
32
|
+
*
|
|
33
|
+
* In some case, you didn't want trigger a BadRequest when the value is an empty string for example.
|
|
34
|
+
* The decorator `@Allow()`, allow you to configure a value list for which there will be no exception.
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* class Model {
|
|
38
|
+
* @Allow("") // add automatically required flag
|
|
39
|
+
* field: string;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @decorator
|
|
44
|
+
* @validation
|
|
45
|
+
* @swagger
|
|
46
|
+
* @schema
|
|
47
|
+
* @input
|
|
48
|
+
*/
|
|
49
|
+
function Required(required = true, ...allowedRequiredValues) {
|
|
50
|
+
return required ? (0, allow_1.Allow)(...allowedRequiredValues) : (0, optional_1.Optional)();
|
|
51
|
+
}
|
|
52
|
+
exports.Required = Required;
|
|
53
|
+
//# sourceMappingURL=required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../../src/decorators/common/required.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,SAAgB,QAAQ,CAAC,WAAoB,IAAI,EAAE,GAAG,qBAA4B;IAChF,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,aAAK,EAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAQ,GAAE,CAAC;AACjE,CAAC;AAFD,4BAEC","sourcesContent":["import {Allow} from \"./allow\";\nimport {Optional} from \"./optional\";\n\n/**\n * Add required annotation on Property or Parameter.\n *\n * The @@Required@@ decorator can be used on two cases.\n *\n * To decorate a parameters:\n *\n * ```typescript\n * @Post(\"/\")\n * async method(@Required() @BodyParams(\"field\") field: string) {}\n * ```\n *\n * To decorate a model:\n *\n * ```typescript\n * class Model {\n * @Required()\n * field: string;\n * }\n * ```\n *\n * ::: tip\n * Required will throw a BadRequest when the given value is `null`, an empty string or `undefined`.\n * :::\n *\n * ### Allow values\n *\n * In some case, you didn't want trigger a BadRequest when the value is an empty string for example.\n * The decorator `@Allow()`, allow you to configure a value list for which there will be no exception.\n *\n * ```typescript\n * class Model {\n * @Allow(\"\") // add automatically required flag\n * field: string;\n * }\n * ```\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Required(required: boolean = true, ...allowedRequiredValues: any[]) {\n return required ? Allow(...allowedRequiredValues) : Optional();\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequiredGroups = void 0;
|
|
4
|
+
const matchGroups_1 = require("../../utils/matchGroups");
|
|
5
|
+
const jsonEntityFn_1 = require("./jsonEntityFn");
|
|
6
|
+
/**
|
|
7
|
+
* Apply groups validation strategy for required property.
|
|
8
|
+
*
|
|
9
|
+
* @decorator
|
|
10
|
+
* @validation
|
|
11
|
+
* @swagger
|
|
12
|
+
* @schema
|
|
13
|
+
* @input
|
|
14
|
+
*/
|
|
15
|
+
function RequiredGroups(...groups) {
|
|
16
|
+
return (0, jsonEntityFn_1.JsonEntityFn)((entity) => {
|
|
17
|
+
entity.parent.schema.$hooks.on("requiredGroups", (required, givenGroups) => {
|
|
18
|
+
if ((0, matchGroups_1.matchGroups)(groups, givenGroups)) {
|
|
19
|
+
return required.filter((key) => key !== entity.propertyKey);
|
|
20
|
+
}
|
|
21
|
+
return required;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
exports.RequiredGroups = RequiredGroups;
|
|
26
|
+
//# sourceMappingURL=requiredGroups.js.map
|