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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-present Vona
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/common/type.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,QAAQ;IAC7C,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.interface.js","sourceRoot":"","sources":["../../../src/lib/common/type.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DECORATORS_PREFIX = "swagger";
|
|
2
|
+
export declare const DECORATORS: {
|
|
3
|
+
API_OPERATION: string;
|
|
4
|
+
API_RESPONSE: string;
|
|
5
|
+
API_PRODUCES: string;
|
|
6
|
+
API_CONSUMES: string;
|
|
7
|
+
API_TAGS: string;
|
|
8
|
+
API_CALLBACKS: string;
|
|
9
|
+
API_PARAMETERS: string;
|
|
10
|
+
API_HEADERS: string;
|
|
11
|
+
API_MODEL_PROPERTIES: string;
|
|
12
|
+
API_MODEL_PROPERTIES_ARRAY: string;
|
|
13
|
+
API_SECURITY: string;
|
|
14
|
+
API_EXCLUDE_ENDPOINT: string;
|
|
15
|
+
API_EXCLUDE_CONTROLLER: string;
|
|
16
|
+
API_EXTRA_MODELS: string;
|
|
17
|
+
API_EXTENSION: string;
|
|
18
|
+
API_SCHEMA: string;
|
|
19
|
+
API_DEFAULT_GETTER: string;
|
|
20
|
+
API_LINK: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const DECORATORS_PREFIX = 'swagger';
|
|
2
|
+
export const DECORATORS = {
|
|
3
|
+
API_OPERATION: `${DECORATORS_PREFIX}/apiOperation`,
|
|
4
|
+
API_RESPONSE: `${DECORATORS_PREFIX}/apiResponse`,
|
|
5
|
+
API_PRODUCES: `${DECORATORS_PREFIX}/apiProduces`,
|
|
6
|
+
API_CONSUMES: `${DECORATORS_PREFIX}/apiConsumes`,
|
|
7
|
+
API_TAGS: `${DECORATORS_PREFIX}/apiUseTags`,
|
|
8
|
+
API_CALLBACKS: `${DECORATORS_PREFIX}/apiCallbacks`,
|
|
9
|
+
API_PARAMETERS: `${DECORATORS_PREFIX}/apiParameters`,
|
|
10
|
+
API_HEADERS: `${DECORATORS_PREFIX}/apiHeaders`,
|
|
11
|
+
API_MODEL_PROPERTIES: `${DECORATORS_PREFIX}/apiModelProperties`,
|
|
12
|
+
API_MODEL_PROPERTIES_ARRAY: `${DECORATORS_PREFIX}/apiModelPropertiesArray`,
|
|
13
|
+
API_SECURITY: `${DECORATORS_PREFIX}/apiSecurity`,
|
|
14
|
+
API_EXCLUDE_ENDPOINT: `${DECORATORS_PREFIX}/apiExcludeEndpoint`,
|
|
15
|
+
API_EXCLUDE_CONTROLLER: `${DECORATORS_PREFIX}/apiExcludeController`,
|
|
16
|
+
API_EXTRA_MODELS: `${DECORATORS_PREFIX}/apiExtraModels`,
|
|
17
|
+
API_EXTENSION: `${DECORATORS_PREFIX}/apiExtension`,
|
|
18
|
+
API_SCHEMA: `${DECORATORS_PREFIX}/apiSchema`,
|
|
19
|
+
API_DEFAULT_GETTER: `${DECORATORS_PREFIX}/apiDefaultGetter`,
|
|
20
|
+
API_LINK: `${DECORATORS_PREFIX}/apiLink`,
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,aAAa,EAAE,GAAG,iBAAiB,eAAe;IAClD,YAAY,EAAE,GAAG,iBAAiB,cAAc;IAChD,YAAY,EAAE,GAAG,iBAAiB,cAAc;IAChD,YAAY,EAAE,GAAG,iBAAiB,cAAc;IAChD,QAAQ,EAAE,GAAG,iBAAiB,aAAa;IAC3C,aAAa,EAAE,GAAG,iBAAiB,eAAe;IAClD,cAAc,EAAE,GAAG,iBAAiB,gBAAgB;IACpD,WAAW,EAAE,GAAG,iBAAiB,aAAa;IAC9C,oBAAoB,EAAE,GAAG,iBAAiB,qBAAqB;IAC/D,0BAA0B,EAAE,GAAG,iBAAiB,0BAA0B;IAC1E,YAAY,EAAE,GAAG,iBAAiB,cAAc;IAChD,oBAAoB,EAAE,GAAG,iBAAiB,qBAAqB;IAC/D,sBAAsB,EAAE,GAAG,iBAAiB,uBAAuB;IACnE,gBAAgB,EAAE,GAAG,iBAAiB,iBAAiB;IACvD,aAAa,EAAE,GAAG,iBAAiB,eAAe;IAClD,UAAU,EAAE,GAAG,iBAAiB,YAAY;IAC5C,kBAAkB,EAAE,GAAG,iBAAiB,mBAAmB;IAC3D,QAAQ,EAAE,GAAG,iBAAiB,UAAU;CACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-basic.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-basic.decorator.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,IAAI,SAAU,oCAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-basic.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-basic.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,UAAU,YAAY,CAAC,IAAI,GAAG,OAAO;IACzC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-bearer.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-bearer.decorator.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,IAAI,SAAW,oCAE5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-bearer.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-bearer.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,IAAI,GAAG,QAAQ;IAC3C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
import { ExamplesObject, ReferenceObject, RequestBodyObject, SchemaObject } from '../interfaces/open-api-spec.interface.js';
|
|
3
|
+
import { SwaggerEnumType } from '../types/swagger-enum.type.js';
|
|
4
|
+
type RequestBodyOptions = Omit<RequestBodyObject, 'content'>;
|
|
5
|
+
interface ApiBodyMetadata extends RequestBodyOptions {
|
|
6
|
+
type?: Type<unknown> | Function | [Function] | string;
|
|
7
|
+
isArray?: boolean;
|
|
8
|
+
enum?: SwaggerEnumType;
|
|
9
|
+
}
|
|
10
|
+
interface ApiBodySchemaHost extends RequestBodyOptions {
|
|
11
|
+
schema: SchemaObject | ReferenceObject;
|
|
12
|
+
examples?: ExamplesObject;
|
|
13
|
+
}
|
|
14
|
+
export type ApiBodyOptions = ApiBodyMetadata | ApiBodySchemaHost;
|
|
15
|
+
export declare function ApiBody(options: ApiBodyOptions): MethodDecorator;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=api-body.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-body.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-body.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,YAAY,EACb,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,KAAK,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AAE7D,UAAU,eAAgB,SAAQ,kBAAkB;IAClD,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,MAAM,EAAE,YAAY,GAAG,eAAe,CAAC;IACvC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAOjE,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,CAehE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { omit } from 'lodash';
|
|
2
|
+
import { addEnumArraySchema, addEnumSchema, isEnumArray, isEnumDefined } from '../utils/enum.utils.js';
|
|
3
|
+
import { createParamDecorator, getTypeIsArrayTuple } from './helpers.js';
|
|
4
|
+
const defaultBodyMetadata = {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
};
|
|
8
|
+
export function ApiBody(options) {
|
|
9
|
+
const [type, isArray] = getTypeIsArrayTuple(options.type, options.isArray);
|
|
10
|
+
const param = {
|
|
11
|
+
in: 'body',
|
|
12
|
+
...omit(options, 'enum'),
|
|
13
|
+
type,
|
|
14
|
+
isArray,
|
|
15
|
+
};
|
|
16
|
+
if (isEnumArray(options)) {
|
|
17
|
+
addEnumArraySchema(param, options);
|
|
18
|
+
}
|
|
19
|
+
else if (isEnumDefined(options)) {
|
|
20
|
+
addEnumSchema(param, options);
|
|
21
|
+
}
|
|
22
|
+
return createParamDecorator(param, defaultBodyMetadata);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=api-body.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-body.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-body.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAQ9B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiBzE,MAAM,mBAAmB,GAAoB;IAC3C,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC7C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,mBAAmB,CAAE,OAA2B,CAAC,IAAI,EAAG,OAA2B,CAAC,OAAO,CAAC,CAAC;IACrH,MAAM,KAAK,GAA0C;QACnD,EAAE,EAAE,MAAM;QACV,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;QACxB,IAAI;QACJ,OAAO;KACR,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;IACD,OAAO,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-callbacks.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-callbacks.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,wBAAgB,YAAY,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,oCAEzE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { createMixedDecorator } from './helpers.js';
|
|
3
|
+
export function ApiCallbacks(...callbackObject) {
|
|
4
|
+
return createMixedDecorator(DECORATORS.API_CALLBACKS, callbackObject);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=api-callbacks.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-callbacks.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-callbacks.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,UAAU,YAAY,CAAC,GAAG,cAA0C;IACxE,OAAO,oBAAoB,CAAC,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-consumes.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-consumes.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 ApiConsumes(...mimeTypes) {
|
|
4
|
+
return createMixedDecorator(DECORATORS.API_CONSUMES, mimeTypes);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=api-consumes.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-consumes.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-consumes.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 @@
|
|
|
1
|
+
{"version":3,"file":"api-cookie.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-cookie.decorator.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,IAAI,SAAW,oCAE5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-cookie.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-cookie.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,IAAI,GAAG,QAAQ;IAC3C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
/**
|
|
3
|
+
* Set the default getter for the given type to the decorated method
|
|
4
|
+
*
|
|
5
|
+
* This is to be used in conjunction with `ApiProperty({link: () => Type})` to generate link objects
|
|
6
|
+
* in the swagger schema
|
|
7
|
+
*
|
|
8
|
+
* ```typescript
|
|
9
|
+
* @Controller('users')
|
|
10
|
+
* class UserController {
|
|
11
|
+
* @Get(':userId')
|
|
12
|
+
* @ApiDefaultGetter(UserGet, 'userId')
|
|
13
|
+
* getUser(@Param('userId') userId: string) {
|
|
14
|
+
* // ...
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param type The type for which the decorated function is the default getter
|
|
20
|
+
* @param parameter Name of the parameter in the route of the getter which corresponds to the id of the type
|
|
21
|
+
*
|
|
22
|
+
* @see [Swagger link objects](https://swagger.io/docs/specification/links/)
|
|
23
|
+
*/
|
|
24
|
+
export declare function ApiDefaultGetter(type: Type<unknown> | Function, parameter: string): MethodDecorator;
|
|
25
|
+
//# sourceMappingURL=api-default-getter.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-default-getter.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-default-getter.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CAYnG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the default getter for the given type to the decorated method
|
|
4
|
+
*
|
|
5
|
+
* This is to be used in conjunction with `ApiProperty({link: () => Type})` to generate link objects
|
|
6
|
+
* in the swagger schema
|
|
7
|
+
*
|
|
8
|
+
* ```typescript
|
|
9
|
+
* @Controller('users')
|
|
10
|
+
* class UserController {
|
|
11
|
+
* @Get(':userId')
|
|
12
|
+
* @ApiDefaultGetter(UserGet, 'userId')
|
|
13
|
+
* getUser(@Param('userId') userId: string) {
|
|
14
|
+
* // ...
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param type The type for which the decorated function is the default getter
|
|
20
|
+
* @param parameter Name of the parameter in the route of the getter which corresponds to the id of the type
|
|
21
|
+
*
|
|
22
|
+
* @see [Swagger link objects](https://swagger.io/docs/specification/links/)
|
|
23
|
+
*/
|
|
24
|
+
export function ApiDefaultGetter(type, parameter) {
|
|
25
|
+
return (prototype, _key, descriptor) => {
|
|
26
|
+
if (type.prototype) {
|
|
27
|
+
Reflect.defineMetadata(DECORATORS.API_DEFAULT_GETTER, { getter: descriptor.value, parameter, prototype }, type.prototype);
|
|
28
|
+
}
|
|
29
|
+
return descriptor;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=api-default-getter.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-default-getter.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-default-getter.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA8B,EAAE,SAAiB;IAChF,OAAO,CAAC,SAAiB,EAAE,IAAqB,EAAE,UAA8B,EAAE,EAAE;QAClF,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,CAAC,cAAc,CACpB,UAAU,CAAC,kBAAkB,EAC7B,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,EAClD,IAAI,CAAC,SAAS,CACf,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-exclude-controller.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-exclude-controller.decorator.ts"],"names":[],"mappings":"AAGA,wBAAgB,oBAAoB,CAAC,OAAO,UAAO,GAAG,cAAc,CAEnE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { createClassDecorator } from './helpers.js';
|
|
3
|
+
export function ApiExcludeController(disable = true) {
|
|
4
|
+
return createClassDecorator(DECORATORS.API_EXCLUDE_CONTROLLER, [disable]);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=api-exclude-controller.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-exclude-controller.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-exclude-controller.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,UAAU,oBAAoB,CAAC,OAAO,GAAG,IAAI;IACjD,OAAO,oBAAoB,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-exclude-endpoint.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-exclude-endpoint.decorator.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,OAAO,UAAO,GAAG,eAAe,CAIlE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { createMethodDecorator } from './helpers.js';
|
|
3
|
+
export function ApiExcludeEndpoint(disable = true) {
|
|
4
|
+
return createMethodDecorator(DECORATORS.API_EXCLUDE_ENDPOINT, {
|
|
5
|
+
disable,
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=api-exclude-endpoint.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-exclude-endpoint.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-exclude-endpoint.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,UAAU,kBAAkB,CAAC,OAAO,GAAG,IAAI;IAC/C,OAAO,qBAAqB,CAAC,UAAU,CAAC,oBAAoB,EAAE;QAC5D,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extension.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-extension.decorator.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,oCAU1E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
import { createMixedDecorator } from './helpers.js';
|
|
3
|
+
import { clone } from 'lodash';
|
|
4
|
+
export function ApiExtension(extensionKey, extensionProperties) {
|
|
5
|
+
if (!extensionKey.startsWith('x-')) {
|
|
6
|
+
throw new Error('Extension key is not prefixed. Please ensure you prefix it with `x-`.');
|
|
7
|
+
}
|
|
8
|
+
const extensionObject = {
|
|
9
|
+
[extensionKey]: clone(extensionProperties),
|
|
10
|
+
};
|
|
11
|
+
return createMixedDecorator(DECORATORS.API_EXTENSION, extensionObject);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=api-extension.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extension.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-extension.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,UAAU,YAAY,CAAC,YAAoB,EAAE,mBAAwB;IACzE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,eAAe,GAAG;QACtB,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;KAC3C,CAAC;IAEF,OAAO,oBAAoB,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extra-models.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-extra-models.decorator.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,YAClC,MAAM,SAAS,MAAM,GAAG,MAAM,eAAe,wBAAwB,GAAG,CAAC,KAAG,GAAG,CAWhG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DECORATORS } from '../constants.js';
|
|
2
|
+
export function ApiExtraModels(...models) {
|
|
3
|
+
return (target, _key, descriptor) => {
|
|
4
|
+
if (descriptor) {
|
|
5
|
+
const extraModels = Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, descriptor.value) || [];
|
|
6
|
+
Reflect.defineMetadata(DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], descriptor.value);
|
|
7
|
+
return descriptor;
|
|
8
|
+
}
|
|
9
|
+
const extraModels = Reflect.getMetadata(DECORATORS.API_EXTRA_MODELS, target) || [];
|
|
10
|
+
Reflect.defineMetadata(DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], target);
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=api-extra-models.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extra-models.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-extra-models.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,cAAc,CAAC,GAAG,MAAkB;IAClD,OAAO,CAAC,MAAc,EAAE,IAAsB,EAAE,UAAyC,EAAO,EAAE;QAChG,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,gBAAgB,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC7F,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YACnG,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACnF,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;QACzF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ParameterObject } from '../interfaces/open-api-spec.interface.js';
|
|
2
|
+
import { SwaggerEnumType } from '../types/swagger-enum.type.js';
|
|
3
|
+
export interface ApiHeaderOptions extends Omit<ParameterObject, 'in'> {
|
|
4
|
+
enum?: SwaggerEnumType;
|
|
5
|
+
}
|
|
6
|
+
export declare function ApiHeader(options: ApiHeaderOptions): MethodDecorator & ClassDecorator;
|
|
7
|
+
export declare const ApiHeaders: (headers: ApiHeaderOptions[]) => MethodDecorator & ClassDecorator;
|
|
8
|
+
//# sourceMappingURL=api-header.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-header.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-header.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAIhE,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC;IACnE,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAMD,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,GAAG,cAAc,CA+BrF;AAED,eAAO,MAAM,UAAU,YAAa,gBAAgB,EAAE,KAAG,eAAe,GAAG,cAI1E,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isNil, isUndefined, negate, pickBy } from 'lodash';
|
|
2
|
+
import { DECORATORS } from '../constants.js';
|
|
3
|
+
import { getEnumType, getEnumValues } from '../utils/enum.utils.js';
|
|
4
|
+
import { createClassDecorator, createParamDecorator } from './helpers.js';
|
|
5
|
+
const defaultHeaderOptions = {
|
|
6
|
+
name: '',
|
|
7
|
+
};
|
|
8
|
+
export function ApiHeader(options) {
|
|
9
|
+
const param = pickBy({
|
|
10
|
+
name: isNil(options.name) ? defaultHeaderOptions.name : options.name,
|
|
11
|
+
in: 'header',
|
|
12
|
+
description: options.description,
|
|
13
|
+
required: options.required,
|
|
14
|
+
examples: options.examples,
|
|
15
|
+
schema: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
...(options.schema || {}),
|
|
18
|
+
},
|
|
19
|
+
}, negate(isUndefined));
|
|
20
|
+
if (options.enum) {
|
|
21
|
+
const enumValues = getEnumValues(options.enum);
|
|
22
|
+
param.schema = {
|
|
23
|
+
...param.schema,
|
|
24
|
+
enum: enumValues,
|
|
25
|
+
type: getEnumType(enumValues),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return (target, key, descriptor) => {
|
|
29
|
+
if (descriptor) {
|
|
30
|
+
return createParamDecorator(param, defaultHeaderOptions)(target, key, descriptor);
|
|
31
|
+
}
|
|
32
|
+
return createClassDecorator(DECORATORS.API_HEADERS, [param])(target);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export const ApiHeaders = (headers) => {
|
|
36
|
+
return (target, key, descriptor) => {
|
|
37
|
+
headers.forEach(options => ApiHeader(options)(target, key, descriptor));
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=api-header.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-header.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-header.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAM1E,MAAM,oBAAoB,GAA8B;IACtD,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,MAAM,KAAK,GAAG,MAAM,CAClB;QACE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI;QACpE,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;SAC1B;KACF,EACD,MAAM,CAAC,WAAW,CAAC,CACpB,CAAC;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/C,KAAK,CAAC,MAAM,GAAG;YACb,GAAG,KAAK,CAAC,MAAM;YACf,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC;SAC9B,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,MAAyB,EAAE,GAAqB,EAAE,UAAyC,EAAO,EAAE;QAC1G,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,MAAM,EAAE,GAAI,EAAE,UAAU,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,oBAAoB,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAkB,CAAC,CAAC;IACnF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAoC,EAAE;IAC1F,OAAO,CAAC,MAAyB,EAAE,GAAqB,EAAE,UAAyC,EAAO,EAAE;QAC1G,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,GAAI,EAAE,UAAW,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-hide-property.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-hide-property.decorator.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,IAAI,iBAAiB,CAEnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-hide-property.decorator.js","sourceRoot":"","sources":["../../../src/lib/decorators/api-hide-property.decorator.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,OAA4B,EAAE,YAA6B,EAAE,EAAE,GAAE,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Type } from 'vona';
|
|
2
|
+
export interface ApiLinkOptions {
|
|
3
|
+
from: Type<unknown> | Function;
|
|
4
|
+
/**
|
|
5
|
+
* Field in the type `from` which is used as a parameter in the decorated route
|
|
6
|
+
*
|
|
7
|
+
* @default 'id'
|
|
8
|
+
*/
|
|
9
|
+
fromField?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Name of the parameter in the decorated route
|
|
12
|
+
*/
|
|
13
|
+
routeParam: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Defines this route as a link between two types
|
|
17
|
+
*
|
|
18
|
+
* Typically used when the link between the types is not present in the `from` type,
|
|
19
|
+
* eg with the following
|
|
20
|
+
*
|
|
21
|
+
* ```typescript
|
|
22
|
+
* class User {
|
|
23
|
+
* @ApiProperty()
|
|
24
|
+
* id: string
|
|
25
|
+
*
|
|
26
|
+
* // no field documentIds: string[]
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* class Document {
|
|
30
|
+
* @ApiProperty()
|
|
31
|
+
* id: string
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* @Controller()
|
|
35
|
+
* class UserController {
|
|
36
|
+
* @Get(':userId/documents')
|
|
37
|
+
* @ApiLink({from: User, fromField: 'id', routeParam: 'userId'})
|
|
38
|
+
* getDocuments(@Param('userId') userId: string)): Promise<Documents[]>
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param type The type for which the decorated function is the default getter
|
|
43
|
+
* @param parameter Name of the parameter in the route of the getter which corresponds to the id of the type
|
|
44
|
+
*
|
|
45
|
+
* @see [Swagger link objects](https://swagger.io/docs/specification/links/)
|
|
46
|
+
*/
|
|
47
|
+
export declare function ApiLink({ from, fromField, routeParam }: ApiLinkOptions): MethodDecorator;
|
|
48
|
+
//# sourceMappingURL=api-link.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-link.decorator.d.ts","sourceRoot":"","sources":["../../../src/lib/decorators/api-link.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,SAAgB,EAAE,UAAU,EAAE,EAAE,cAAc,GAAG,eAAe,CAkB/F"}
|