vona-module-a-swagger 5.0.2
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/LICENSE +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/common/index.d.ts +2 -0
- package/dist/lib/common/index.d.ts.map +1 -0
- package/dist/lib/common/index.js +2 -0
- package/dist/lib/common/index.js.map +1 -0
- package/dist/lib/common/type.interface.d.ts +4 -0
- package/dist/lib/common/type.interface.d.ts.map +1 -0
- package/dist/lib/common/type.interface.js +2 -0
- package/dist/lib/common/type.interface.js.map +1 -0
- package/dist/lib/constants.d.ts +22 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +22 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/decorators/api-basic.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-basic.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-basic.decorator.js +5 -0
- package/dist/lib/decorators/api-basic.decorator.js.map +1 -0
- package/dist/lib/decorators/api-bearer.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-bearer.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-bearer.decorator.js +5 -0
- package/dist/lib/decorators/api-bearer.decorator.js.map +1 -0
- package/dist/lib/decorators/api-body.decorator.d.ts +17 -0
- package/dist/lib/decorators/api-body.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-body.decorator.js +24 -0
- package/dist/lib/decorators/api-body.decorator.js.map +1 -0
- package/dist/lib/decorators/api-callbacks.decorator.d.ts +3 -0
- package/dist/lib/decorators/api-callbacks.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-callbacks.decorator.js +6 -0
- package/dist/lib/decorators/api-callbacks.decorator.js.map +1 -0
- package/dist/lib/decorators/api-consumes.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-consumes.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-consumes.decorator.js +6 -0
- package/dist/lib/decorators/api-consumes.decorator.js.map +1 -0
- package/dist/lib/decorators/api-cookie.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-cookie.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-cookie.decorator.js +5 -0
- package/dist/lib/decorators/api-cookie.decorator.js.map +1 -0
- package/dist/lib/decorators/api-default-getter.decorator.d.ts +25 -0
- package/dist/lib/decorators/api-default-getter.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-default-getter.decorator.js +32 -0
- package/dist/lib/decorators/api-default-getter.decorator.js.map +1 -0
- package/dist/lib/decorators/api-exclude-controller.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-exclude-controller.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-exclude-controller.decorator.js +6 -0
- package/dist/lib/decorators/api-exclude-controller.decorator.js.map +1 -0
- package/dist/lib/decorators/api-exclude-endpoint.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-exclude-endpoint.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-exclude-endpoint.decorator.js +8 -0
- package/dist/lib/decorators/api-exclude-endpoint.decorator.js.map +1 -0
- package/dist/lib/decorators/api-extension.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-extension.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-extension.decorator.js +13 -0
- package/dist/lib/decorators/api-extension.decorator.js.map +1 -0
- package/dist/lib/decorators/api-extra-models.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-extra-models.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-extra-models.decorator.js +14 -0
- package/dist/lib/decorators/api-extra-models.decorator.js.map +1 -0
- package/dist/lib/decorators/api-header.decorator.d.ts +8 -0
- package/dist/lib/decorators/api-header.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-header.decorator.js +40 -0
- package/dist/lib/decorators/api-header.decorator.js.map +1 -0
- package/dist/lib/decorators/api-hide-property.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-hide-property.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-hide-property.decorator.js +5 -0
- package/dist/lib/decorators/api-hide-property.decorator.js.map +1 -0
- package/dist/lib/decorators/api-link.decorator.d.ts +48 -0
- package/dist/lib/decorators/api-link.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-link.decorator.js +50 -0
- package/dist/lib/decorators/api-link.decorator.js.map +1 -0
- package/dist/lib/decorators/api-oauth2.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-oauth2.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-oauth2.decorator.js +5 -0
- package/dist/lib/decorators/api-oauth2.decorator.js.map +1 -0
- package/dist/lib/decorators/api-operation.decorator.d.ts +6 -0
- package/dist/lib/decorators/api-operation.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-operation.decorator.js +13 -0
- package/dist/lib/decorators/api-operation.decorator.js.map +1 -0
- package/dist/lib/decorators/api-param.decorator.d.ts +23 -0
- package/dist/lib/decorators/api-param.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-param.decorator.js +19 -0
- package/dist/lib/decorators/api-param.decorator.js.map +1 -0
- package/dist/lib/decorators/api-produces.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-produces.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-produces.decorator.js +6 -0
- package/dist/lib/decorators/api-produces.decorator.js.map +1 -0
- package/dist/lib/decorators/api-property.decorator.d.ts +25 -0
- package/dist/lib/decorators/api-property.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-property.decorator.js +53 -0
- package/dist/lib/decorators/api-property.decorator.js.map +1 -0
- package/dist/lib/decorators/api-query.decorator.d.ts +25 -0
- package/dist/lib/decorators/api-query.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-query.decorator.js +28 -0
- package/dist/lib/decorators/api-query.decorator.js.map +1 -0
- package/dist/lib/decorators/api-response.decorator.d.ts +40 -0
- package/dist/lib/decorators/api-response.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-response.decorator.js +63 -0
- package/dist/lib/decorators/api-response.decorator.js.map +1 -0
- package/dist/lib/decorators/api-schema.decorator.d.ts +9 -0
- package/dist/lib/decorators/api-schema.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-schema.decorator.js +6 -0
- package/dist/lib/decorators/api-schema.decorator.js.map +1 -0
- package/dist/lib/decorators/api-security.decorator.d.ts +3 -0
- package/dist/lib/decorators/api-security.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-security.decorator.js +23 -0
- package/dist/lib/decorators/api-security.decorator.js.map +1 -0
- package/dist/lib/decorators/api-use-tags.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-use-tags.decorator.d.ts.map +1 -0
- package/dist/lib/decorators/api-use-tags.decorator.js +6 -0
- package/dist/lib/decorators/api-use-tags.decorator.js.map +1 -0
- package/dist/lib/decorators/helpers.d.ts +9 -0
- package/dist/lib/decorators/helpers.d.ts.map +1 -0
- package/dist/lib/decorators/helpers.js +120 -0
- package/dist/lib/decorators/helpers.js.map +1 -0
- package/dist/lib/decorators/index.d.ts +25 -0
- package/dist/lib/decorators/index.d.ts.map +1 -0
- package/dist/lib/decorators/index.js +25 -0
- package/dist/lib/decorators/index.js.map +1 -0
- package/dist/lib/document-builder.d.ts +28 -0
- package/dist/lib/document-builder.d.ts.map +1 -0
- package/dist/lib/document-builder.js +167 -0
- package/dist/lib/document-builder.js.map +1 -0
- package/dist/lib/explorers/api-callbacks.explorer.d.ts +3 -0
- package/dist/lib/explorers/api-callbacks.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-callbacks.explorer.js +35 -0
- package/dist/lib/explorers/api-callbacks.explorer.js.map +1 -0
- package/dist/lib/explorers/api-consumes.explorer.d.ts +6 -0
- package/dist/lib/explorers/api-consumes.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-consumes.explorer.js +7 -0
- package/dist/lib/explorers/api-consumes.explorer.js.map +1 -0
- package/dist/lib/explorers/api-exclude-controller.explorer.d.ts +3 -0
- package/dist/lib/explorers/api-exclude-controller.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-exclude-controller.explorer.js +3 -0
- package/dist/lib/explorers/api-exclude-controller.explorer.js.map +1 -0
- package/dist/lib/explorers/api-exclude-endpoint.explorer.d.ts +3 -0
- package/dist/lib/explorers/api-exclude-endpoint.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-exclude-endpoint.explorer.js +3 -0
- package/dist/lib/explorers/api-exclude-endpoint.explorer.js.map +1 -0
- package/dist/lib/explorers/api-extra-models.explorer.d.ts +4 -0
- package/dist/lib/explorers/api-extra-models.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-extra-models.explorer.js +7 -0
- package/dist/lib/explorers/api-extra-models.explorer.js.map +1 -0
- package/dist/lib/explorers/api-headers.explorer.d.ts +8 -0
- package/dist/lib/explorers/api-headers.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-headers.explorer.js +6 -0
- package/dist/lib/explorers/api-headers.explorer.js.map +1 -0
- package/dist/lib/explorers/api-operation.explorer.d.ts +3 -0
- package/dist/lib/explorers/api-operation.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-operation.explorer.js +38 -0
- package/dist/lib/explorers/api-operation.explorer.js.map +1 -0
- package/dist/lib/explorers/api-parameters.explorer.d.ts +6 -0
- package/dist/lib/explorers/api-parameters.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-parameters.explorer.js +44 -0
- package/dist/lib/explorers/api-parameters.explorer.js.map +1 -0
- package/dist/lib/explorers/api-produces.explorer.d.ts +6 -0
- package/dist/lib/explorers/api-produces.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-produces.explorer.js +7 -0
- package/dist/lib/explorers/api-produces.explorer.js.map +1 -0
- package/dist/lib/explorers/api-response.explorer.d.ts +8 -0
- package/dist/lib/explorers/api-response.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-response.explorer.js +77 -0
- package/dist/lib/explorers/api-response.explorer.js.map +1 -0
- package/dist/lib/explorers/api-security.explorer.d.ts +6 -0
- package/dist/lib/explorers/api-security.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-security.explorer.js +9 -0
- package/dist/lib/explorers/api-security.explorer.js.map +1 -0
- package/dist/lib/explorers/api-use-tags.explorer.d.ts +6 -0
- package/dist/lib/explorers/api-use-tags.explorer.d.ts.map +1 -0
- package/dist/lib/explorers/api-use-tags.explorer.js +17 -0
- package/dist/lib/explorers/api-use-tags.explorer.js.map +1 -0
- package/dist/lib/extra/swagger-shim.d.ts +97 -0
- package/dist/lib/extra/swagger-shim.d.ts.map +1 -0
- package/dist/lib/extra/swagger-shim.js +265 -0
- package/dist/lib/extra/swagger-shim.js.map +1 -0
- package/dist/lib/fixtures/document.base.d.ts +3 -0
- package/dist/lib/fixtures/document.base.d.ts.map +1 -0
- package/dist/lib/fixtures/document.base.js +13 -0
- package/dist/lib/fixtures/document.base.js.map +1 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +8 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/interfaces/callback-object.interface.d.ts +13 -0
- package/dist/lib/interfaces/callback-object.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/callback-object.interface.js +2 -0
- package/dist/lib/interfaces/callback-object.interface.js.map +1 -0
- package/dist/lib/interfaces/denormalized-doc-resolvers.interface.d.ts +8 -0
- package/dist/lib/interfaces/denormalized-doc-resolvers.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/denormalized-doc-resolvers.interface.js +2 -0
- package/dist/lib/interfaces/denormalized-doc-resolvers.interface.js.map +1 -0
- package/dist/lib/interfaces/denormalized-doc.interface.d.ts +9 -0
- package/dist/lib/interfaces/denormalized-doc.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/denormalized-doc.interface.js +2 -0
- package/dist/lib/interfaces/denormalized-doc.interface.js.map +1 -0
- package/dist/lib/interfaces/enum-schema-attributes.interface.d.ts +3 -0
- package/dist/lib/interfaces/enum-schema-attributes.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/enum-schema-attributes.interface.js +2 -0
- package/dist/lib/interfaces/enum-schema-attributes.interface.js.map +1 -0
- package/dist/lib/interfaces/index.d.ts +4 -0
- package/dist/lib/interfaces/index.d.ts.map +1 -0
- package/dist/lib/interfaces/index.js +3 -0
- package/dist/lib/interfaces/index.js.map +1 -0
- package/dist/lib/interfaces/module-route.interface.d.ts +3 -0
- package/dist/lib/interfaces/module-route.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/module-route.interface.js +2 -0
- package/dist/lib/interfaces/module-route.interface.js.map +1 -0
- package/dist/lib/interfaces/open-api-spec.interface.d.ts +241 -0
- package/dist/lib/interfaces/open-api-spec.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/open-api-spec.interface.js +6 -0
- package/dist/lib/interfaces/open-api-spec.interface.js.map +1 -0
- package/dist/lib/interfaces/schema-object-metadata.interface.d.ts +24 -0
- package/dist/lib/interfaces/schema-object-metadata.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/schema-object-metadata.interface.js +2 -0
- package/dist/lib/interfaces/schema-object-metadata.interface.js.map +1 -0
- package/dist/lib/interfaces/swagger-custom-options.interface.d.ts +85 -0
- package/dist/lib/interfaces/swagger-custom-options.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/swagger-custom-options.interface.js +2 -0
- package/dist/lib/interfaces/swagger-custom-options.interface.js.map +1 -0
- package/dist/lib/interfaces/swagger-document-options.interface.d.ts +36 -0
- package/dist/lib/interfaces/swagger-document-options.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/swagger-document-options.interface.js +2 -0
- package/dist/lib/interfaces/swagger-document-options.interface.js.map +1 -0
- package/dist/lib/interfaces/swagger-ui-init-options.interface.d.ts +8 -0
- package/dist/lib/interfaces/swagger-ui-init-options.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/swagger-ui-init-options.interface.js +2 -0
- package/dist/lib/interfaces/swagger-ui-init-options.interface.js.map +1 -0
- package/dist/lib/interfaces/swagger-ui-options.interface.d.ts +21 -0
- package/dist/lib/interfaces/swagger-ui-options.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/swagger-ui-options.interface.js +2 -0
- package/dist/lib/interfaces/swagger-ui-options.interface.js.map +1 -0
- package/dist/lib/plugin/compiler-plugin.d.ts +3 -0
- package/dist/lib/plugin/compiler-plugin.d.ts.map +1 -0
- package/dist/lib/plugin/compiler-plugin.js +27 -0
- package/dist/lib/plugin/compiler-plugin.js.map +1 -0
- package/dist/lib/plugin/index.d.ts +3 -0
- package/dist/lib/plugin/index.d.ts.map +1 -0
- package/dist/lib/plugin/index.js +3 -0
- package/dist/lib/plugin/index.js.map +1 -0
- package/dist/lib/plugin/merge-options.d.ts +15 -0
- package/dist/lib/plugin/merge-options.d.ts.map +1 -0
- package/dist/lib/plugin/merge-options.js +35 -0
- package/dist/lib/plugin/merge-options.js.map +1 -0
- package/dist/lib/plugin/metadata-loader.d.ts +8 -0
- package/dist/lib/plugin/metadata-loader.d.ts.map +1 -0
- package/dist/lib/plugin/metadata-loader.js +41 -0
- package/dist/lib/plugin/metadata-loader.js.map +1 -0
- package/dist/lib/plugin/plugin-constants.d.ts +4 -0
- package/dist/lib/plugin/plugin-constants.d.ts.map +1 -0
- package/dist/lib/plugin/plugin-constants.js +4 -0
- package/dist/lib/plugin/plugin-constants.js.map +1 -0
- package/dist/lib/plugin/plugin-debug-logger.d.ts +6 -0
- package/dist/lib/plugin/plugin-debug-logger.d.ts.map +1 -0
- package/dist/lib/plugin/plugin-debug-logger.js +5 -0
- package/dist/lib/plugin/plugin-debug-logger.js.map +1 -0
- package/dist/lib/plugin/utils/ast-utils.d.ts +31 -0
- package/dist/lib/plugin/utils/ast-utils.d.ts.map +1 -0
- package/dist/lib/plugin/utils/ast-utils.js +242 -0
- package/dist/lib/plugin/utils/ast-utils.js.map +1 -0
- package/dist/lib/plugin/utils/external-imports.util.d.ts +4 -0
- package/dist/lib/plugin/utils/external-imports.util.d.ts.map +1 -0
- package/dist/lib/plugin/utils/external-imports.util.js +31 -0
- package/dist/lib/plugin/utils/external-imports.util.js.map +1 -0
- package/dist/lib/plugin/utils/is-filename-matched.util.d.ts +2 -0
- package/dist/lib/plugin/utils/is-filename-matched.util.d.ts.map +1 -0
- package/dist/lib/plugin/utils/is-filename-matched.util.js +2 -0
- package/dist/lib/plugin/utils/is-filename-matched.util.js.map +1 -0
- package/dist/lib/plugin/utils/plugin-utils.d.ts +58 -0
- package/dist/lib/plugin/utils/plugin-utils.d.ts.map +1 -0
- package/dist/lib/plugin/utils/plugin-utils.js +282 -0
- package/dist/lib/plugin/utils/plugin-utils.js.map +1 -0
- package/dist/lib/plugin/utils/type-reference-to-identifier.util.d.ts +8 -0
- package/dist/lib/plugin/utils/type-reference-to-identifier.util.d.ts.map +1 -0
- package/dist/lib/plugin/utils/type-reference-to-identifier.util.js +50 -0
- package/dist/lib/plugin/utils/type-reference-to-identifier.util.js.map +1 -0
- package/dist/lib/plugin/visitors/abstract.visitor.d.ts +5 -0
- package/dist/lib/plugin/visitors/abstract.visitor.d.ts.map +1 -0
- package/dist/lib/plugin/visitors/abstract.visitor.js +20 -0
- package/dist/lib/plugin/visitors/abstract.visitor.js.map +1 -0
- package/dist/lib/plugin/visitors/controller-class.visitor.d.ts +21 -0
- package/dist/lib/plugin/visitors/controller-class.visitor.d.ts.map +1 -0
- package/dist/lib/plugin/visitors/controller-class.visitor.js +266 -0
- package/dist/lib/plugin/visitors/controller-class.visitor.js.map +1 -0
- package/dist/lib/plugin/visitors/model-class.visitor.d.ts +40 -0
- package/dist/lib/plugin/visitors/model-class.visitor.d.ts.map +1 -0
- package/dist/lib/plugin/visitors/model-class.visitor.js +445 -0
- package/dist/lib/plugin/visitors/model-class.visitor.js.map +1 -0
- package/dist/lib/plugin/visitors/readonly.visitor.d.ts +22 -0
- package/dist/lib/plugin/visitors/readonly.visitor.d.ts.map +1 -0
- package/dist/lib/plugin/visitors/readonly.visitor.js +60 -0
- package/dist/lib/plugin/visitors/readonly.visitor.js.map +1 -0
- package/dist/lib/services/constants.d.ts +2 -0
- package/dist/lib/services/constants.d.ts.map +1 -0
- package/dist/lib/services/constants.js +2 -0
- package/dist/lib/services/constants.js.map +1 -0
- package/dist/lib/services/decorators-properties.d.ts +27 -0
- package/dist/lib/services/decorators-properties.d.ts.map +1 -0
- package/dist/lib/services/decorators-properties.js +147 -0
- package/dist/lib/services/decorators-properties.js.map +1 -0
- package/dist/lib/services/mimetype-content-wrapper.d.ts +5 -0
- package/dist/lib/services/mimetype-content-wrapper.d.ts.map +1 -0
- package/dist/lib/services/mimetype-content-wrapper.js +8 -0
- package/dist/lib/services/mimetype-content-wrapper.js.map +1 -0
- package/dist/lib/services/model-properties-accessor.d.ts +7 -0
- package/dist/lib/services/model-properties-accessor.d.ts.map +1 -0
- package/dist/lib/services/model-properties-accessor.js +33 -0
- package/dist/lib/services/model-properties-accessor.js.map +1 -0
- package/dist/lib/services/parameter-metadata-accessor.d.ts +22 -0
- package/dist/lib/services/parameter-metadata-accessor.d.ts.map +1 -0
- package/dist/lib/services/parameter-metadata-accessor.js +38 -0
- package/dist/lib/services/parameter-metadata-accessor.js.map +1 -0
- package/dist/lib/services/parameters-metadata-mapper.d.ts +10 -0
- package/dist/lib/services/parameters-metadata-mapper.d.ts.map +1 -0
- package/dist/lib/services/parameters-metadata-mapper.js +45 -0
- package/dist/lib/services/parameters-metadata-mapper.js.map +1 -0
- package/dist/lib/services/response-object-factory.d.ts +15 -0
- package/dist/lib/services/response-object-factory.d.ts.map +1 -0
- package/dist/lib/services/response-object-factory.js +123 -0
- package/dist/lib/services/response-object-factory.js.map +1 -0
- package/dist/lib/services/response-object-mapper.d.ts +8 -0
- package/dist/lib/services/response-object-mapper.d.ts.map +1 -0
- package/dist/lib/services/response-object-mapper.js +55 -0
- package/dist/lib/services/response-object-mapper.js.map +1 -0
- package/dist/lib/services/schema-object-factory.d.ts +160 -0
- package/dist/lib/services/schema-object-factory.d.ts.map +1 -0
- package/dist/lib/services/schema-object-factory.js +484 -0
- package/dist/lib/services/schema-object-factory.js.map +1 -0
- package/dist/lib/services/swagger-types-mapper.d.ts +19 -0
- package/dist/lib/services/swagger-types-mapper.d.ts.map +1 -0
- package/dist/lib/services/swagger-types-mapper.js +132 -0
- package/dist/lib/services/swagger-types-mapper.js.map +1 -0
- package/dist/lib/storages/global-parameters.storage.d.ts +9 -0
- package/dist/lib/storages/global-parameters.storage.d.ts.map +1 -0
- package/dist/lib/storages/global-parameters.storage.js +23 -0
- package/dist/lib/storages/global-parameters.storage.js.map +1 -0
- package/dist/lib/swagger-transformer.d.ts +8 -0
- package/dist/lib/swagger-transformer.d.ts.map +1 -0
- package/dist/lib/swagger-transformer.js +36 -0
- package/dist/lib/swagger-transformer.js.map +1 -0
- package/dist/lib/swagger-ui/constants.d.ts +4 -0
- package/dist/lib/swagger-ui/constants.d.ts.map +1 -0
- package/dist/lib/swagger-ui/constants.js +130 -0
- package/dist/lib/swagger-ui/constants.js.map +1 -0
- package/dist/lib/swagger-ui/helpers.d.ts +6 -0
- package/dist/lib/swagger-ui/helpers.d.ts.map +1 -0
- package/dist/lib/swagger-ui/helpers.js +17 -0
- package/dist/lib/swagger-ui/helpers.js.map +1 -0
- package/dist/lib/swagger-ui/index.d.ts +2 -0
- package/dist/lib/swagger-ui/index.d.ts.map +1 -0
- package/dist/lib/swagger-ui/index.js +2 -0
- package/dist/lib/swagger-ui/index.js.map +1 -0
- package/dist/lib/swagger-ui/swagger-ui.d.ts +14 -0
- package/dist/lib/swagger-ui/swagger-ui.d.ts.map +1 -0
- package/dist/lib/swagger-ui/swagger-ui.js +64 -0
- package/dist/lib/swagger-ui/swagger-ui.js.map +1 -0
- package/dist/lib/type-helpers/index.d.ts +5 -0
- package/dist/lib/type-helpers/index.d.ts.map +1 -0
- package/dist/lib/type-helpers/index.js +5 -0
- package/dist/lib/type-helpers/index.js.map +1 -0
- package/dist/lib/type-helpers/intersection-type.helper.d.ts +9 -0
- package/dist/lib/type-helpers/intersection-type.helper.d.ts.map +1 -0
- package/dist/lib/type-helpers/intersection-type.helper.js +40 -0
- package/dist/lib/type-helpers/intersection-type.helper.js.map +1 -0
- package/dist/lib/type-helpers/mapped-types.utils.d.ts +3 -0
- package/dist/lib/type-helpers/mapped-types.utils.d.ts.map +1 -0
- package/dist/lib/type-helpers/mapped-types.utils.js +33 -0
- package/dist/lib/type-helpers/mapped-types.utils.js.map +1 -0
- package/dist/lib/type-helpers/omit-type.helper.d.ts +3 -0
- package/dist/lib/type-helpers/omit-type.helper.d.ts.map +1 -0
- package/dist/lib/type-helpers/omit-type.helper.js +38 -0
- package/dist/lib/type-helpers/omit-type.helper.js.map +1 -0
- package/dist/lib/type-helpers/partial-type.helper.d.ts +14 -0
- package/dist/lib/type-helpers/partial-type.helper.d.ts.map +1 -0
- package/dist/lib/type-helpers/partial-type.helper.js +52 -0
- package/dist/lib/type-helpers/partial-type.helper.js.map +1 -0
- package/dist/lib/type-helpers/pick-type.helper.d.ts +3 -0
- package/dist/lib/type-helpers/pick-type.helper.d.ts.map +1 -0
- package/dist/lib/type-helpers/pick-type.helper.js +38 -0
- package/dist/lib/type-helpers/pick-type.helper.js.map +1 -0
- package/dist/lib/types/swagger-enum.type.d.ts +2 -0
- package/dist/lib/types/swagger-enum.type.d.ts.map +1 -0
- package/dist/lib/types/swagger-enum.type.js +2 -0
- package/dist/lib/types/swagger-enum.type.js.map +1 -0
- package/dist/lib/utils/assign-two-levels-deep.d.ts +16 -0
- package/dist/lib/utils/assign-two-levels-deep.d.ts.map +1 -0
- package/dist/lib/utils/assign-two-levels-deep.js +24 -0
- package/dist/lib/utils/assign-two-levels-deep.js.map +1 -0
- package/dist/lib/utils/enum.utils.d.ts +10 -0
- package/dist/lib/utils/enum.utils.d.ts.map +1 -0
- package/dist/lib/utils/enum.utils.js +68 -0
- package/dist/lib/utils/enum.utils.js.map +1 -0
- package/dist/lib/utils/extend-metadata.util.d.ts +3 -0
- package/dist/lib/utils/extend-metadata.util.d.ts.map +1 -0
- package/dist/lib/utils/extend-metadata.util.js +9 -0
- package/dist/lib/utils/extend-metadata.util.js.map +1 -0
- package/dist/lib/utils/get-global-prefix.d.ts +3 -0
- package/dist/lib/utils/get-global-prefix.d.ts.map +1 -0
- package/dist/lib/utils/get-global-prefix.js +5 -0
- package/dist/lib/utils/get-global-prefix.js.map +1 -0
- package/dist/lib/utils/get-schema-path.util.d.ts +5 -0
- package/dist/lib/utils/get-schema-path.util.d.ts.map +1 -0
- package/dist/lib/utils/get-schema-path.util.js +22 -0
- package/dist/lib/utils/get-schema-path.util.js.map +1 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +2 -0
- package/dist/lib/utils/index.js.map +1 -0
- package/dist/lib/utils/is-body-parameter.util.d.ts +3 -0
- package/dist/lib/utils/is-body-parameter.util.d.ts.map +1 -0
- package/dist/lib/utils/is-body-parameter.util.js +4 -0
- package/dist/lib/utils/is-body-parameter.util.js.map +1 -0
- package/dist/lib/utils/is-built-in-type.util.d.ts +3 -0
- package/dist/lib/utils/is-built-in-type.util.d.ts.map +1 -0
- package/dist/lib/utils/is-built-in-type.util.js +6 -0
- package/dist/lib/utils/is-built-in-type.util.js.map +1 -0
- package/dist/lib/utils/is-date-ctor.util.d.ts +3 -0
- package/dist/lib/utils/is-date-ctor.util.d.ts.map +1 -0
- package/dist/lib/utils/is-date-ctor.util.js +4 -0
- package/dist/lib/utils/is-date-ctor.util.js.map +1 -0
- package/dist/lib/utils/merge-and-uniq.util.d.ts +2 -0
- package/dist/lib/utils/merge-and-uniq.util.d.ts.map +1 -0
- package/dist/lib/utils/merge-and-uniq.util.js +5 -0
- package/dist/lib/utils/merge-and-uniq.util.js.map +1 -0
- package/dist/lib/utils/normalize-rel-path.d.ts +2 -0
- package/dist/lib/utils/normalize-rel-path.d.ts.map +1 -0
- package/dist/lib/utils/normalize-rel-path.js +6 -0
- package/dist/lib/utils/normalize-rel-path.js.map +1 -0
- package/dist/lib/utils/remove-undefined-keys.d.ts +6 -0
- package/dist/lib/utils/remove-undefined-keys.d.ts.map +1 -0
- package/dist/lib/utils/remove-undefined-keys.js +9 -0
- package/dist/lib/utils/remove-undefined-keys.js.map +1 -0
- package/dist/lib/utils/resolve-path.util.d.ts +2 -0
- package/dist/lib/utils/resolve-path.util.d.ts.map +1 -0
- package/dist/lib/utils/resolve-path.util.js +5 -0
- package/dist/lib/utils/resolve-path.util.js.map +1 -0
- package/dist/lib/utils/reverse-object-keys.util.d.ts +2 -0
- package/dist/lib/utils/reverse-object-keys.util.d.ts.map +1 -0
- package/dist/lib/utils/reverse-object-keys.util.js +9 -0
- package/dist/lib/utils/reverse-object-keys.util.js.map +1 -0
- package/dist/lib/utils/sort-object-lexicographically.d.ts +6 -0
- package/dist/lib/utils/sort-object-lexicographically.d.ts.map +1 -0
- package/dist/lib/utils/sort-object-lexicographically.js +9 -0
- package/dist/lib/utils/sort-object-lexicographically.js.map +1 -0
- package/dist/lib/utils/strip-last-slash.util.d.ts +2 -0
- package/dist/lib/utils/strip-last-slash.util.d.ts.map +1 -0
- package/dist/lib/utils/strip-last-slash.util.js +4 -0
- package/dist/lib/utils/strip-last-slash.util.js.map +1 -0
- package/dist/lib/utils/validate-global-prefix.util.d.ts +2 -0
- package/dist/lib/utils/validate-global-prefix.util.d.ts.map +1 -0
- package/dist/lib/utils/validate-global-prefix.util.js +4 -0
- package/dist/lib/utils/validate-global-prefix.util.js.map +1 -0
- package/dist/lib/utils/validate-path.util.d.ts +2 -0
- package/dist/lib/utils/validate-path.util.d.ts.map +1 -0
- package/dist/lib/utils/validate-path.util.js +4 -0
- package/dist/lib/utils/validate-path.util.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Defines this route as a link between two types
|
|
4
|
+
*
|
|
5
|
+
* Typically used when the link between the types is not present in the `from` type,
|
|
6
|
+
* eg with the following
|
|
7
|
+
*
|
|
8
|
+
* ```typescript
|
|
9
|
+
* class User {
|
|
10
|
+
* @ApiProperty()
|
|
11
|
+
* id: string
|
|
12
|
+
*
|
|
13
|
+
* // no field documentIds: string[]
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* class Document {
|
|
17
|
+
* @ApiProperty()
|
|
18
|
+
* id: string
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* @Controller()
|
|
22
|
+
* class UserController {
|
|
23
|
+
* @Get(':userId/documents')
|
|
24
|
+
* @ApiLink({from: User, fromField: 'id', routeParam: 'userId'})
|
|
25
|
+
* getDocuments(@Param('userId') userId: string)): Promise<Documents[]>
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param type The type for which the decorated function is the default getter
|
|
30
|
+
* @param parameter Name of the parameter in the route of the getter which corresponds to the id of the type
|
|
31
|
+
*
|
|
32
|
+
* @see [Swagger link objects](https://swagger.io/docs/specification/links/)
|
|
33
|
+
*/
|
|
34
|
+
export function ApiLink({ from, fromField = 'id', routeParam }) {
|
|
35
|
+
return (controllerPrototype, _key, descriptor) => {
|
|
36
|
+
const { prototype } = from;
|
|
37
|
+
if (prototype) {
|
|
38
|
+
const links = Reflect.getMetadata(DECORATORS.API_LINK, prototype) ?? [];
|
|
39
|
+
links.push({
|
|
40
|
+
method: descriptor.value,
|
|
41
|
+
prototype: controllerPrototype,
|
|
42
|
+
field: fromField,
|
|
43
|
+
parameter: routeParam,
|
|
44
|
+
});
|
|
45
|
+
Reflect.defineMetadata(DECORATORS.API_LINK, links, prototype);
|
|
46
|
+
}
|
|
47
|
+
return descriptor;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=api-link.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-link.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-link.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgB7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,UAAU,EAAkB;IAC5E,OAAO,CAAC,mBAA2B,EAAE,IAAqB,EAAE,UAA8B,EAAE,EAAE;QAC5F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC3B,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;YAExE,KAAK,CAAC,IAAI,CAAC;gBACT,MAAM,EAAE,UAAU,CAAC,KAAK;gBACxB,SAAS,EAAE,mBAAmB;gBAC9B,KAAK,EAAE,SAAS;gBAChB,SAAS,EAAE,UAAU;aACtB,CAAC,CAAC;YAEH,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-oauth2.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-oauth2.decorator.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,SAAW,oCAE1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-oauth2.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-oauth2.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,UAAU,SAAS,CAAC,MAAgB,EAAE,IAAI,GAAG,QAAQ;IACzD,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OperationObject } from '../interfaces/open-api-spec.interface.js';
|
|
2
|
+
export type ApiOperationOptions = Partial<OperationObject>;
|
|
3
|
+
export declare function ApiOperation(options: ApiOperationOptions, { overrideExisting }?: {
|
|
4
|
+
overrideExisting: boolean;
|
|
5
|
+
}): MethodDecorator;
|
|
6
|
+
//# sourceMappingURL=api-operation.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-operation.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-operation.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAG3E,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAM3D,wBAAgB,YAAY,CAC1B,OAAO,EAAE,mBAAmB,EAC5B,EAAE,gBAAgB,EAAE;;CAA6B,GAChD,eAAe,CAYjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isUndefined, negate, pickBy } from 'lodash';
|
|
2
|
+
import { DECORATORS } from '../constants.js';
|
|
3
|
+
import { createMethodDecorator } from './helpers.js';
|
|
4
|
+
const defaultOperationOptions = {
|
|
5
|
+
summary: '',
|
|
6
|
+
};
|
|
7
|
+
export function ApiOperation(options, { overrideExisting } = { overrideExisting: true }) {
|
|
8
|
+
return createMethodDecorator(DECORATORS.API_OPERATION, pickBy({
|
|
9
|
+
...defaultOperationOptions,
|
|
10
|
+
...options,
|
|
11
|
+
}, negate(isUndefined)), { overrideExisting });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=api-operation.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-operation.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-operation.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAIrD,MAAM,uBAAuB,GAAwB;IACnD,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,MAAM,UAAU,YAAY,CAC1B,OAA4B,EAC5B,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE;IAEjD,OAAO,qBAAqB,CAC1B,UAAU,CAAC,aAAa,EACxB,MAAM,CACJ;QACE,GAAG,uBAAuB;QAC1B,GAAG,OAAO;KACY,EACxB,MAAM,CAAC,WAAW,CAAC,CACpB,EACD,EAAE,gBAAgB,EAAE,CACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface.js';
|
|
3
|
+
import { ParameterObject, SchemaObject } from '../interfaces/open-api-spec.interface.js';
|
|
4
|
+
import { SwaggerEnumType } from '../types/swagger-enum.type.js';
|
|
5
|
+
type ParameterOptions = Omit<ParameterObject, 'in' | 'schema'>;
|
|
6
|
+
interface ApiParamCommonMetadata extends ParameterOptions {
|
|
7
|
+
type?: Type<unknown> | Function | [Function] | string;
|
|
8
|
+
format?: string;
|
|
9
|
+
enum?: SwaggerEnumType;
|
|
10
|
+
enumName?: string;
|
|
11
|
+
enumSchema?: EnumSchemaAttributes;
|
|
12
|
+
}
|
|
13
|
+
type ApiParamMetadata = ApiParamCommonMetadata | (ApiParamCommonMetadata & {
|
|
14
|
+
enumName: string;
|
|
15
|
+
enumSchema?: EnumSchemaAttributes;
|
|
16
|
+
});
|
|
17
|
+
interface ApiParamSchemaHost extends ParameterOptions {
|
|
18
|
+
schema: SchemaObject;
|
|
19
|
+
}
|
|
20
|
+
export type ApiParamOptions = ApiParamMetadata | ApiParamSchemaHost;
|
|
21
|
+
export declare function ApiParam(options: ApiParamOptions): MethodDecorator & ClassDecorator;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=api-param.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-param.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-param.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,KAAK,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC;AAE/D,UAAU,sBAAuB,SAAQ,gBAAgB;IACvD,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED,KAAK,gBAAgB,GACjB,sBAAsB,GACtB,CAAC,sBAAsB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC,CAAC;AAEP,UAAU,kBAAmB,SAAQ,gBAAgB;IACnD,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAOpE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,cAAc,CAYnF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isNil, omit } from 'lodash';
|
|
2
|
+
import { addEnumSchema, isEnumDefined } from '../utils/enum.utils.js';
|
|
3
|
+
import { createParamDecorator } from './helpers.js';
|
|
4
|
+
const defaultParamOptions = {
|
|
5
|
+
name: '',
|
|
6
|
+
required: true,
|
|
7
|
+
};
|
|
8
|
+
export function ApiParam(options) {
|
|
9
|
+
const param = {
|
|
10
|
+
name: isNil(options.name) ? defaultParamOptions.name : options.name,
|
|
11
|
+
in: 'path',
|
|
12
|
+
...omit(options, 'enum'),
|
|
13
|
+
};
|
|
14
|
+
if (isEnumDefined(options)) {
|
|
15
|
+
addEnumSchema(param, options);
|
|
16
|
+
}
|
|
17
|
+
return createParamDecorator(param, defaultParamOptions);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=api-param.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-param.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-param.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAyBpD,MAAM,mBAAmB,GAAoB;IAC3C,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,OAAwB;IAC/C,MAAM,KAAK,GAA2C;QACpD,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI;QACnE,EAAE,EAAE,MAAM;QACV,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;KACzB,CAAC;IAEF,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-produces.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-produces.decorator.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,oCAEjD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { createMixedDecorator } from './helpers.js';
|
|
3
|
+
export function ApiProduces(...mimeTypes) {
|
|
4
|
+
return createMixedDecorator(DECORATORS.API_PRODUCES, mimeTypes);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=api-produces.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-produces.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-produces.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,UAAU,WAAW,CAAC,GAAG,SAAmB;IAChD,OAAO,oBAAoB,CAAC,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface.js';
|
|
3
|
+
import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface.js';
|
|
4
|
+
export type ApiPropertyCommonOptions = SchemaObjectMetadata & {
|
|
5
|
+
'x-enumNames'?: string[];
|
|
6
|
+
/**
|
|
7
|
+
* Lazy function returning the type for which the decorated property
|
|
8
|
+
* can be used as an id
|
|
9
|
+
*
|
|
10
|
+
* Use together with @ApiDefaultGetter on the getter route of the type
|
|
11
|
+
* to generate OpenAPI link objects
|
|
12
|
+
*
|
|
13
|
+
* @see [Swagger link objects](https://swagger.io/docs/specification/links/)
|
|
14
|
+
*/
|
|
15
|
+
link?: () => Type<unknown> | Function;
|
|
16
|
+
};
|
|
17
|
+
export type ApiPropertyOptions = ApiPropertyCommonOptions | (ApiPropertyCommonOptions & {
|
|
18
|
+
enumName: string;
|
|
19
|
+
enumSchema?: EnumSchemaAttributes;
|
|
20
|
+
});
|
|
21
|
+
export declare function ApiProperty(options?: ApiPropertyOptions): PropertyDecorator;
|
|
22
|
+
export declare function createApiPropertyDecorator(options?: ApiPropertyOptions, overrideExisting?: boolean): PropertyDecorator;
|
|
23
|
+
export declare function ApiPropertyOptional(options?: ApiPropertyOptions): PropertyDecorator;
|
|
24
|
+
export declare function ApiResponseProperty(options?: Pick<ApiPropertyOptions, 'type' | 'example' | 'format' | 'deprecated' | 'enum'>): PropertyDecorator;
|
|
25
|
+
//# sourceMappingURL=api-property.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-property.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-property.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAoB,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAK3G,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG;IAC5D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,CAAC,wBAAwB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC,CAAC;AAWP,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CAE/E;AAED,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,kBAAuB,EAChC,gBAAgB,UAAO,GACtB,iBAAiB,CAmCnB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CAKvF;AAED,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAM,GAC5F,iBAAiB,CAKnB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { getEnumType, getEnumValues } from '../utils/enum.utils.js';
|
|
3
|
+
import { createPropertyDecorator, getTypeIsArrayTuple } from './helpers.js';
|
|
4
|
+
import { Cast } from 'vona';
|
|
5
|
+
const isEnumArray = (opts) => (opts.isArray && 'enum' in opts);
|
|
6
|
+
export function ApiProperty(options = {}) {
|
|
7
|
+
return createApiPropertyDecorator(options);
|
|
8
|
+
}
|
|
9
|
+
export function createApiPropertyDecorator(options = {}, overrideExisting = true) {
|
|
10
|
+
const [type, isArray] = getTypeIsArrayTuple(options.type, options.isArray);
|
|
11
|
+
options = {
|
|
12
|
+
...options,
|
|
13
|
+
type,
|
|
14
|
+
isArray,
|
|
15
|
+
};
|
|
16
|
+
if (isEnumArray(options)) {
|
|
17
|
+
options.type = 'array';
|
|
18
|
+
const enumValues = getEnumValues(options.enum);
|
|
19
|
+
options.items = {
|
|
20
|
+
type: getEnumType(enumValues),
|
|
21
|
+
enum: enumValues,
|
|
22
|
+
};
|
|
23
|
+
delete Cast(options).enum;
|
|
24
|
+
}
|
|
25
|
+
else if ('enum' in options) {
|
|
26
|
+
const enumValues = getEnumValues(options.enum);
|
|
27
|
+
options.enum = enumValues;
|
|
28
|
+
options.type = getEnumType(enumValues);
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(options.type)) {
|
|
31
|
+
options.type = 'array';
|
|
32
|
+
options.items = {
|
|
33
|
+
type: 'array',
|
|
34
|
+
items: {
|
|
35
|
+
type: options.type[0],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return createPropertyDecorator(DECORATORS.API_MODEL_PROPERTIES, options, overrideExisting);
|
|
40
|
+
}
|
|
41
|
+
export function ApiPropertyOptional(options = {}) {
|
|
42
|
+
return ApiProperty({
|
|
43
|
+
...options,
|
|
44
|
+
required: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function ApiResponseProperty(options = {}) {
|
|
48
|
+
return ApiProperty({
|
|
49
|
+
readOnly: true,
|
|
50
|
+
...options,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=api-property.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-property.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-property.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAuB5B,MAAM,WAAW,GAAG,CAClB,IAAwB,EAMxB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,IAAI,CAAY,CAAC;AAEjD,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAC7C,C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AClE,OAAO,WAAW,CAAC;QACjB,GAAG,OAAO;QACV,QAAQ,EAAE,KAAK;KACM,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,UAA2F,EAAE;IAE7F,OAAO,WAAW,CAAC;QACjB,QAAQ,EAAE,IAAI;QACd,GAAG,OAAO;KACW,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface.js';
|
|
3
|
+
import { ParameterObject, ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface.js';
|
|
4
|
+
import { SwaggerEnumType } from '../types/swagger-enum.type.js';
|
|
5
|
+
type ParameterOptions = Omit<ParameterObject, 'in' | 'schema' | 'name'>;
|
|
6
|
+
interface ApiQueryCommonMetadata extends ParameterOptions {
|
|
7
|
+
type?: Type<unknown> | Function | [Function] | string;
|
|
8
|
+
isArray?: boolean;
|
|
9
|
+
enum?: SwaggerEnumType;
|
|
10
|
+
}
|
|
11
|
+
export type ApiQueryMetadata = ApiQueryCommonMetadata | ({
|
|
12
|
+
name: string;
|
|
13
|
+
} & ApiQueryCommonMetadata & Omit<SchemaObject, 'required'>) | ({
|
|
14
|
+
name?: string;
|
|
15
|
+
enumName: string;
|
|
16
|
+
enumSchema?: EnumSchemaAttributes;
|
|
17
|
+
} & ApiQueryCommonMetadata);
|
|
18
|
+
interface ApiQuerySchemaHost extends ParameterOptions {
|
|
19
|
+
name?: string;
|
|
20
|
+
schema: SchemaObject | ReferenceObject;
|
|
21
|
+
}
|
|
22
|
+
export type ApiQueryOptions = ApiQueryMetadata | ApiQuerySchemaHost;
|
|
23
|
+
export declare function ApiQuery(options: ApiQueryOptions): MethodDecorator & ClassDecorator;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=api-query.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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ash';
|
|
2
|
+
import { addEnumArraySchema, addEnumSchema, isEnumArray, isEnumDefined } from '../utils/enum.utils.js';
|
|
3
|
+
import { createParamDecorator, getTypeIsArrayTuple } from './helpers.js';
|
|
4
|
+
const defaultQueryOptions = {
|
|
5
|
+
name: '',
|
|
6
|
+
required: true,
|
|
7
|
+
};
|
|
8
|
+
export function ApiQuery(options) {
|
|
9
|
+
const apiQueryMetadata = options;
|
|
10
|
+
const [type, isArray] = getTypeIsArrayTuple(apiQueryMetadata.type, apiQueryMetadata.isArray);
|
|
11
|
+
const param = {
|
|
12
|
+
name: 'name' in options ? options.name : defaultQueryOptions.name,
|
|
13
|
+
in: 'query',
|
|
14
|
+
...omit(options, 'enum'),
|
|
15
|
+
type,
|
|
16
|
+
};
|
|
17
|
+
if (isEnumArray(options)) {
|
|
18
|
+
addEnumArraySchema(param, options);
|
|
19
|
+
}
|
|
20
|
+
else if (isEnumDefined(options)) {
|
|
21
|
+
addEnumSchema(param, options);
|
|
22
|
+
}
|
|
23
|
+
if (isArray) {
|
|
24
|
+
param.isArray = isArray;
|
|
25
|
+
}
|
|
26
|
+
return createParamDecorator(param, defaultQueryOptions);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=api-query.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-query.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-query.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA0BzE,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,OAAwB;IAC/C,MAAM,gBAAgB,GAAG,OAA2B,CAAC;IACrD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE7F,MAAM,KAAK,GAA2C;QACpD,IAAI,EAAE,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI;QACjE,EAAE,EAAE,OAAO;QACX,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;QACxB,IAAI;KACL,CAAC;IAEF,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,OAAO,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
|
+
import { ReferenceObject, ResponseObject, SchemaObject } from '../interfaces/open-api-spec.interface.js';
|
|
3
|
+
type ApiResponseExampleValue = any;
|
|
4
|
+
export interface ApiResponseExamples {
|
|
5
|
+
summary: string;
|
|
6
|
+
value: ApiResponseExampleValue;
|
|
7
|
+
}
|
|
8
|
+
export interface ApiResponseCommonMetadata extends Omit<ResponseObject, 'description'> {
|
|
9
|
+
status?: number | 'default' | '1XX' | '2XX' | '3XX' | '4XX' | '5XX';
|
|
10
|
+
type?: Type<unknown> | Function | [Function] | string;
|
|
11
|
+
isArray?: boolean;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ApiResponseMetadata = (ApiResponseCommonMetadata & {
|
|
15
|
+
example?: ApiResponseExampleValue;
|
|
16
|
+
}) | (ApiResponseCommonMetadata & {
|
|
17
|
+
examples?: {
|
|
18
|
+
[key: string]: ApiResponseExamples;
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
export interface ApiResponseSchemaHost extends Omit<ResponseObject, 'description'> {
|
|
22
|
+
schema: SchemaObject & Partial<ReferenceObject>;
|
|
23
|
+
status?: number | 'default' | '1XX' | '2XX' | '3XX' | '4XX' | '5XX';
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ApiResponseOptions = ApiResponseMetadata | ApiResponseSchemaHost;
|
|
27
|
+
export type ApiResponseNoStatusOptions = (Omit<ApiResponseCommonMetadata, 'status'> & {
|
|
28
|
+
example?: ApiResponseExampleValue;
|
|
29
|
+
}) | (Omit<ApiResponseCommonMetadata, 'status'> & {
|
|
30
|
+
examples?: {
|
|
31
|
+
[key: string]: ApiResponseExamples;
|
|
32
|
+
};
|
|
33
|
+
}) | Omit<ApiResponseSchemaHost, 'status'>;
|
|
34
|
+
export declare function ApiResponse(options: ApiResponseOptions, { overrideExisting }?: {
|
|
35
|
+
overrideExisting: boolean;
|
|
36
|
+
}): MethodDecorator & ClassDecorator;
|
|
37
|
+
export declare const ApiContinueResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiSwitchingProtocolsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiProcessingResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiEarlyhintsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiOkResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiCreatedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiAcceptedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNonAuthoritativeInformationResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNoContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiResetContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPartialContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiAmbiguousResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMovedPermanentlyResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiFoundResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiSeeOtherResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotModifiedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiTemporaryRedirectResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPermanentRedirectResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiBadRequestResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnauthorizedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPaymentRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiForbiddenResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotFoundResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMethodNotAllowedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotAcceptableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiProxyAuthenticationRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiRequestTimeoutResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiConflictResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiGoneResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiLengthRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPreconditionFailedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPayloadTooLargeResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUriTooLongResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnsupportedMediaTypeResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiRequestedRangeNotSatisfiableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiExpectationFailedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiIAmATeapotResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMisdirectedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnprocessableEntityResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiFailedDependencyResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPreconditionRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiTooManyRequestsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiInternalServerErrorResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotImplementedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiBadGatewayResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiServiceUnavailableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiGatewayTimeoutResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiHttpVersionNotSupportedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator;
|
|
38
|
+
export declare const ApiDefaultResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=api-response.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-response.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-response.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAGzG,KAAK,uBAAuB,GAAG,GAAG,CAAC;AACnC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,uBAAuB,CAAC;CAChC;AAED,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC;IACpF,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpE,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,mBAAmB,GAC3B,CAAC,yBAAyB,GAAG;IAAE,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAAE,CAAC,GACnE,CAAC,yBAAyB,GAAG;IAC3B,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAC;CACnD,CAAC,CAAC;AAEP,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC;IAChF,MAAM,EAAE,YAAY,GAAG,OAAO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0BAA0B,aAzDA,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA0DzF,qBAAqB,aA1DK,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA2DzF,+BAA+B,aA3DL,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA4DzF,uCAAuC,aA5Db,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA6DzF,4BAA4B,aA7DF,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA8DzF,qBAAqB,aA9DK,0BAA0B,KAAK,eAAe,GAAG,cAAc,EA+DzF,sBAAsB,aA/DI,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAgEzF,8BAA8B,aAhEJ,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAiEzF,2BAA2B,aAjED,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAkEzF,+BAA+B,aAlEL,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAmEzF,0BAA0B,aAnEA,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAoEzF,8BAA8B,aApEJ,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAqEzF,yBAAyB,aArEC,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAsEzF,qBAAqB,aAtEK,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAuEzF,6BAA6B,aAvEH,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAwEzF,yBAAyB,aAxEC,0BAA0B,KAAK,eAAe,GAAG,cAAc,EAyEzF,kCAAkC,aAzER,0BAA0B,KAAK,eAAe,GAAG,cA0E/D,CAAC;AAEf,eAAO,MAAM,kBAAkB,aAAa,0BAA0B,qCAIlE,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { HttpStatus } from '@nestjs/common';
|
|
2
|
+
import { omit } from 'lodash';
|
|
3
|
+
import { DECORATORS } from '../constants.js';
|
|
4
|
+
import { getTypeIsArrayTuple } from './helpers.js';
|
|
5
|
+
export function ApiResponse(options, { overrideExisting } = { overrideExisting: true }) {
|
|
6
|
+
const apiResponseMetadata = options;
|
|
7
|
+
const [type, isArray] = getTypeIsArrayTuple(apiResponseMetadata.type, apiResponseMetadata.isArray);
|
|
8
|
+
apiResponseMetadata.type = type;
|
|
9
|
+
apiResponseMetadata.isArray = isArray;
|
|
10
|
+
options.description = options.description ? options.description : '';
|
|
11
|
+
const groupedMetadata = {
|
|
12
|
+
[options.status || 'default']: omit(options, 'status'),
|
|
13
|
+
};
|
|
14
|
+
return (target, _key, descriptor) => {
|
|
15
|
+
if (descriptor) {
|
|
16
|
+
const responses = Reflect.getMetadata(DECORATORS.API_RESPONSE, descriptor.value);
|
|
17
|
+
if (responses && !overrideExisting) {
|
|
18
|
+
return descriptor;
|
|
19
|
+
}
|
|
20
|
+
Reflect.defineMetadata(DECORATORS.API_RESPONSE, {
|
|
21
|
+
...responses,
|
|
22
|
+
...groupedMetadata,
|
|
23
|
+
}, descriptor.value);
|
|
24
|
+
return descriptor;
|
|
25
|
+
}
|
|
26
|
+
const responses = Reflect.getMetadata(DECORATORS.API_RESPONSE, target);
|
|
27
|
+
if (responses && !overrideExisting) {
|
|
28
|
+
return descriptor;
|
|
29
|
+
}
|
|
30
|
+
Reflect.defineMetadata(DECORATORS.API_RESPONSE, {
|
|
31
|
+
...responses,
|
|
32
|
+
...groupedMetadata,
|
|
33
|
+
}, target);
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const decorators = {};
|
|
38
|
+
const statusList = Object.keys(HttpStatus)
|
|
39
|
+
.filter(key => !isNaN(Number(HttpStatus[key])))
|
|
40
|
+
.map(key => {
|
|
41
|
+
const functionName = key
|
|
42
|
+
.split('_')
|
|
43
|
+
.map(strToken => `${strToken[0].toUpperCase()}${strToken.slice(1).toLowerCase()}`)
|
|
44
|
+
.join('');
|
|
45
|
+
return {
|
|
46
|
+
code: Number(HttpStatus[key]),
|
|
47
|
+
functionName: `Api${functionName}Response`,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
statusList.forEach(({ code, functionName }) => {
|
|
51
|
+
decorators[functionName] = function (options = {}) {
|
|
52
|
+
return ApiResponse({
|
|
53
|
+
...options,
|
|
54
|
+
status: code,
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
export const { ApiContinueResponse, ApiSwitchingProtocolsResponse, ApiProcessingResponse, ApiEarlyhintsResponse, ApiOkResponse, ApiCreatedResponse, ApiAcceptedResponse, ApiNonAuthoritativeInformationResponse, ApiNoContentResponse, ApiResetContentResponse, ApiPartialContentResponse, ApiAmbiguousResponse, ApiMovedPermanentlyResponse, ApiFoundResponse, ApiSeeOtherResponse, ApiNotModifiedResponse, ApiTemporaryRedirectResponse, ApiPermanentRedirectResponse, ApiBadRequestResponse, ApiUnauthorizedResponse, ApiPaymentRequiredResponse, ApiForbiddenResponse, ApiNotFoundResponse, ApiMethodNotAllowedResponse, ApiNotAcceptableResponse, ApiProxyAuthenticationRequiredResponse, ApiRequestTimeoutResponse, ApiConflictResponse, ApiGoneResponse, ApiLengthRequiredResponse, ApiPreconditionFailedResponse, ApiPayloadTooLargeResponse, ApiUriTooLongResponse, ApiUnsupportedMediaTypeResponse, ApiRequestedRangeNotSatisfiableResponse, ApiExpectationFailedResponse, ApiIAmATeapotResponse, ApiMisdirectedResponse, ApiUnprocessableEntityResponse, ApiFailedDependencyResponse, ApiPreconditionRequiredResponse, ApiTooManyRequestsResponse, ApiInternalServerErrorResponse, ApiNotImplementedResponse, ApiBadGatewayResponse, ApiServiceUnavailableResponse, ApiGatewayTimeoutResponse, ApiHttpVersionNotSupportedResponse, } = decorators;
|
|
59
|
+
export const ApiDefaultResponse = (options = {}) => ApiResponse({
|
|
60
|
+
...options,
|
|
61
|
+
status: 'default',
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=api-response.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-response.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-response.dec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EAAE,IAAI;SACb,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EACX,mBAAmB,EACnB,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,sCAAsC,EACtC,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,sCAAsC,EACtC,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,EACrB,+BAA+B,EAC/B,uCAAuC,EACvC,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,kCAAkC,GACnC,GAAG,UAAU,CAAC;AAEf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAsC,EAAE,EAAE,EAAE,CAC7E,WAAW,CAAC;IACV,GAAG,OAAO;IACV,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface.js';
|
|
2
|
+
export interface ApiSchemaOptions extends Pick<SchemaObjectMetadata, 'name'> {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the schema.
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ApiSchema(options: ApiSchemaOptions): ClassDecorator;
|
|
9
|
+
//# sourceMappingURL=api-schema.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-schema.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-schema.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAGzF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAEnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-schema.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-schema.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASpD,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,OAAO,oBAAoB,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SecurityRequirementObject } from '../interfaces/open-api-spec.interface.js';
|
|
2
|
+
export declare function ApiSecurity(name: string | SecurityRequirementObject, requirements?: string[]): ClassDecorator & MethodDecorator;
|
|
3
|
+
//# sourceMappingURL=api-security.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-security.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-security.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,GAAG,yBAAyB,EACxC,YAAY,GAAE,MAAM,EAAO,GAC1B,cAAc,GAAG,eAAe,CAmBlC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isString } from 'lodash';
|
|
2
|
+
import { DECORATORS } from '../constants.js';
|
|
3
|
+
import { extendMetadata } from '../utils/extend-metadata.util.js';
|
|
4
|
+
export function ApiSecurity(name, requirements = []) {
|
|
5
|
+
let metadata;
|
|
6
|
+
if (isString(name)) {
|
|
7
|
+
metadata = [{ [name]: requirements }];
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
metadata = [name];
|
|
11
|
+
}
|
|
12
|
+
return (target, _key, descriptor) => {
|
|
13
|
+
if (descriptor) {
|
|
14
|
+
metadata = extendMetadata(metadata, DECORATORS.API_SECURITY, descriptor.value);
|
|
15
|
+
Reflect.defineMetadata(DECORATORS.API_SECURITY, metadata, descriptor.value);
|
|
16
|
+
return descriptor;
|
|
17
|
+
}
|
|
18
|
+
metadata = extendMetadata(metadata, DECORATORS.API_SECURITY, target);
|
|
19
|
+
Reflect.defineMetadata(DECORATORS.API_SECURITY, metadata, target);
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=api-security.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-security.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-security.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,UAAU,WAAW,CACzB,IAAwC,EACxC,eAAyB,EAAE;IAE3B,IAAI,QAAqC,CAAC;IAE1C,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,QAAQ,GAAG,CAAC,EAAE,CAAC,IAAW,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,CAAC,IAAW,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,MAAc,EAAE,IAAsB,EAAE,UAAyC,EAAO,EAAE;QAChG,IAAI,UAAU,EAAE,CAAC;YACf,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YAC/E,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QACrE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-use-tags.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-use-tags.decorator.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,oCAExC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-use-tags.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-use-tags.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,UAAU,OAAO,CAAC,GAAG,IAAc;IACvC,OAAO,oBAAoB,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function createMethodDecorator<T = any>(metakey: string, metadata: T, { overrideExisting }?: {
|
|
2
|
+
overrideExisting: boolean;
|
|
3
|
+
}): MethodDecorator;
|
|
4
|
+
export declare function createClassDecorator<T extends Array<any> = any>(metakey: string, metadata?: T): ClassDecorator;
|
|
5
|
+
export declare function createPropertyDecorator<T extends Record<string, any> = any>(metakey: string, metadata: T, overrideExisting?: boolean): PropertyDecorator;
|
|
6
|
+
export declare function createMixedDecorator<T = any>(metakey: string, metadata: T): MethodDecorator & ClassDecorator;
|
|
7
|
+
export declare function createParamDecorator<T extends Record<string, any> = any>(metadata: T, initial: Partial<T>): MethodDecorator & ClassDecorator;
|
|
8
|
+
export declare function getTypeIsArrayTuple(input: Function | [Function] | undefined | string | Record<string, any>, isArrayFlag?: boolean): [Function | undefined, boolean];
|
|
9
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/helpers.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,GAAG,EAC3C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,EACX,EAAE,gBAAgB,EAAE;;CAA6B,GAChD,eAAe,CAajB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,EAC7D,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,CAAsB,GAC/B,cAAc,CAMhB;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EACzE,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,EACX,gBAAgB,UAAO,GACtB,iBAAiB,CAsCnB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,eAAe,GAAG,cAAc,CAiB5G;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EACtE,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,eAAe,GAAG,cAAc,CAwClC;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvE,WAAW,CAAC,EAAE,OAAO,GACpB,CAAC,QAAQ,GAAG,SAAS,EAAE,OAAO,CAAC,CAUjC"}
|