@decaf-ts/for-nest 0.11.1 → 0.11.2-refactor.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/README.md +1 -1
- package/dist/for-nest.cjs +2654 -2
- package/dist/for-nest.js +2756 -2
- package/lib/cjs/auth/AuthInterceptor.cjs +90 -0
- package/lib/cjs/auth/DecafAuthHandler.cjs +37 -0
- package/lib/cjs/auth/DecafAuthModule.cjs +56 -0
- package/lib/cjs/auth/constants.cjs +10 -0
- package/lib/cjs/auth/decorators.cjs +28 -0
- package/lib/cjs/auth/index.cjs +23 -0
- package/lib/cjs/bin/cli.cjs +2 -2
- package/lib/cjs/cli-module.cjs +64 -7
- package/lib/cjs/constants.cjs +5 -6
- package/lib/cjs/controllers.cjs +13 -109
- package/lib/cjs/core-module.cjs +8 -8
- package/lib/cjs/decaf-model/DecafModelModule.cjs +23 -4
- package/lib/cjs/decaf-model/FromModelController.cjs +751 -789
- package/lib/cjs/decaf-model/decorators/ApiOperationFromModel.cjs +53 -16
- package/lib/cjs/decaf-model/decorators/ApiParamsFromModel.cjs +2 -2
- package/lib/cjs/decaf-model/decorators/DecafBody.cjs +2 -2
- package/lib/cjs/decaf-model/decorators/DecafParams.cjs +2 -2
- package/lib/cjs/decaf-model/decorators/controller-config.cjs +29 -0
- package/lib/cjs/decaf-model/decorators/decorators.cjs +5 -45
- package/lib/cjs/decaf-model/decorators/expose.cjs +13 -0
- package/lib/cjs/decaf-model/decorators/index.cjs +3 -2
- package/lib/cjs/decaf-model/decorators/types.cjs +2 -2
- package/lib/cjs/decaf-model/decorators/utils.cjs +2 -2
- package/lib/cjs/decaf-model/index.cjs +28 -19
- package/lib/cjs/decaf-model/types.cjs +2 -2
- package/lib/cjs/decaf-model/utils.cjs +2 -2
- package/lib/cjs/decoration.cjs +2 -2
- package/lib/cjs/decorators.cjs +85 -0
- package/lib/cjs/events-module/DecafStreamModule.cjs +2 -2
- package/lib/cjs/events-module/EventsController.cjs +2 -2
- package/lib/cjs/events-module/constant.cjs +2 -2
- package/lib/cjs/events-module/index.cjs +2 -2
- package/lib/cjs/events-module/utils.cjs +2 -2
- package/lib/cjs/factory/NestBootstraper.cjs +2 -2
- package/lib/cjs/factory/errors/cors.cjs +2 -2
- package/lib/cjs/factory/errors/index.cjs +2 -2
- package/lib/cjs/factory/errors/throttling.cjs +2 -2
- package/lib/cjs/factory/exceptions/DecafErrorFilter.cjs +2 -2
- package/lib/cjs/factory/exceptions/decorators.cjs +2 -2
- package/lib/cjs/factory/exceptions/index.cjs +2 -2
- package/lib/cjs/factory/index.cjs +2 -2
- package/lib/cjs/factory/openapi/DtoBuilder.cjs +37 -6
- package/lib/cjs/factory/openapi/SwaggerBuilder.cjs +2 -2
- package/lib/cjs/factory/openapi/SwaggerCustomUI.cjs +2 -2
- package/lib/cjs/factory/openapi/constants.cjs +2 -2
- package/lib/cjs/factory/openapi/index.cjs +2 -2
- package/lib/cjs/index.cjs +8 -7
- package/lib/cjs/interceptors/DecafRequestHandlerInterceptor.cjs +25 -21
- package/lib/cjs/interceptors/index.cjs +3 -4
- package/lib/cjs/module.cjs +5 -2
- package/lib/cjs/overrides/Adapter.cjs +2 -2
- package/lib/cjs/overrides/ModelBuilderExtensions.cjs +2 -2
- package/lib/cjs/overrides/constants.cjs +2 -2
- package/lib/cjs/overrides/decoration.cjs +2 -2
- package/lib/cjs/overrides/helpers.cjs +2 -2
- package/lib/cjs/overrides/index.cjs +3 -2
- package/lib/cjs/overrides/logging.cjs +5 -0
- package/lib/cjs/overrides/overrides.cjs +2 -2
- package/lib/cjs/request/DecafAuthHandler.cjs +5 -39
- package/lib/cjs/request/DecafHandlerExecutor.cjs +2 -2
- package/lib/cjs/request/DecafRequestContext.cjs +11 -20
- package/lib/cjs/request/DecafResponseInterceptor.cjs +3 -3
- package/lib/cjs/request/index.cjs +2 -2
- package/lib/cjs/swagger-types.cjs +2 -2
- package/lib/cjs/types.cjs +2 -2
- package/lib/cjs/utils.cjs +2 -2
- package/lib/cjs/webhooks/DecafWebhookModule.cjs +11 -12
- package/lib/cjs/webhooks/controllers.cjs +10 -10
- package/lib/cjs/webhooks/index.cjs +2 -15
- package/lib/cjs/webhooks/types.cjs +2 -2
- package/lib/esm/auth/AuthInterceptor.js +81 -0
- package/lib/esm/auth/DecafAuthHandler.js +31 -0
- package/lib/esm/auth/DecafAuthModule.js +48 -0
- package/lib/esm/auth/constants.js +6 -0
- package/lib/esm/auth/decorators.js +22 -0
- package/lib/esm/auth/index.js +6 -0
- package/lib/esm/bin/cli.js +1 -1
- package/lib/esm/cli-module.js +63 -6
- package/lib/esm/constants.js +3 -4
- package/lib/esm/controllers.js +13 -109
- package/lib/esm/core-module.js +7 -7
- package/lib/esm/decaf-model/DecafModelModule.js +22 -3
- package/lib/esm/decaf-model/FromModelController.js +753 -791
- package/lib/esm/decaf-model/decorators/ApiOperationFromModel.js +53 -15
- package/lib/esm/decaf-model/decorators/ApiParamsFromModel.js +1 -1
- package/lib/esm/decaf-model/decorators/DecafBody.js +1 -1
- package/lib/esm/decaf-model/decorators/DecafParams.js +1 -1
- package/lib/esm/decaf-model/decorators/controller-config.js +25 -0
- package/lib/esm/decaf-model/decorators/decorators.js +2 -43
- package/lib/esm/decaf-model/decorators/expose.js +9 -0
- package/lib/esm/decaf-model/decorators/index.js +2 -1
- package/lib/esm/decaf-model/decorators/types.js +1 -1
- package/lib/esm/decaf-model/decorators/utils.js +1 -1
- package/lib/esm/decaf-model/index.js +11 -4
- package/lib/esm/decaf-model/types.js +1 -1
- package/lib/esm/decaf-model/utils.js +1 -1
- package/lib/esm/decoration.js +1 -1
- package/lib/esm/decorators.js +79 -0
- package/lib/esm/events-module/DecafStreamModule.js +1 -1
- package/lib/esm/events-module/EventsController.js +1 -1
- package/lib/esm/events-module/constant.js +1 -1
- package/lib/esm/events-module/index.js +1 -1
- package/lib/esm/events-module/utils.js +1 -1
- package/lib/esm/factory/NestBootstraper.js +1 -1
- package/lib/esm/factory/errors/cors.js +1 -1
- package/lib/esm/factory/errors/index.js +1 -1
- package/lib/esm/factory/errors/throttling.js +1 -1
- package/lib/esm/factory/exceptions/DecafErrorFilter.js +1 -1
- package/lib/esm/factory/exceptions/decorators.js +1 -1
- package/lib/esm/factory/exceptions/index.js +1 -1
- package/lib/esm/factory/index.js +1 -1
- package/lib/esm/factory/openapi/DtoBuilder.js +36 -5
- package/lib/esm/factory/openapi/SwaggerBuilder.js +1 -1
- package/lib/esm/factory/openapi/SwaggerCustomUI.js +1 -1
- package/lib/esm/factory/openapi/constants.js +1 -1
- package/lib/esm/factory/openapi/index.js +1 -1
- package/lib/esm/index.js +7 -6
- package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js +25 -21
- package/lib/esm/interceptors/index.js +2 -3
- package/lib/esm/module.js +4 -1
- package/lib/esm/overrides/Adapter.js +1 -1
- package/lib/esm/overrides/ModelBuilderExtensions.js +1 -1
- package/lib/esm/overrides/constants.js +1 -1
- package/lib/esm/overrides/decoration.js +1 -1
- package/lib/esm/overrides/helpers.js +1 -1
- package/lib/esm/overrides/index.js +2 -1
- package/lib/esm/overrides/logging.js +2 -0
- package/lib/esm/overrides/overrides.js +1 -1
- package/lib/esm/request/DecafAuthHandler.js +2 -36
- package/lib/esm/request/DecafHandlerExecutor.js +1 -1
- package/lib/esm/request/DecafRequestContext.js +10 -19
- package/lib/esm/request/DecafResponseInterceptor.js +2 -2
- package/lib/esm/request/index.js +1 -1
- package/lib/esm/swagger-types.js +1 -1
- package/lib/esm/types.js +1 -1
- package/lib/esm/utils.js +1 -1
- package/lib/esm/webhooks/DecafWebhookModule.js +5 -6
- package/lib/esm/webhooks/controllers.js +2 -2
- package/lib/esm/webhooks/index.js +1 -2
- package/lib/esm/webhooks/types.js +1 -1
- package/lib/types/{interceptors → auth}/AuthInterceptor.d.cts +4 -1
- package/lib/types/{interceptors → auth}/AuthInterceptor.d.mts +4 -1
- package/lib/types/auth/DecafAuthHandler.d.cts +22 -0
- package/lib/types/auth/DecafAuthHandler.d.mts +22 -0
- package/lib/types/auth/DecafAuthModule.d.cts +9 -0
- package/lib/types/auth/DecafAuthModule.d.mts +9 -0
- package/lib/types/auth/constants.d.cts +5 -0
- package/lib/types/auth/constants.d.mts +5 -0
- package/lib/types/auth/decorators.d.cts +4 -0
- package/lib/types/auth/decorators.d.mts +4 -0
- package/lib/types/auth/index.d.cts +6 -0
- package/lib/types/auth/index.d.mts +6 -0
- package/lib/types/cli-module.d.cts +1 -4
- package/lib/types/cli-module.d.mts +1 -4
- package/lib/types/constants.d.cts +2 -3
- package/lib/types/constants.d.mts +2 -3
- package/lib/types/controllers.d.cts +7 -12
- package/lib/types/controllers.d.mts +7 -12
- package/lib/types/decaf-model/DecafModelModule.d.cts +1 -0
- package/lib/types/decaf-model/DecafModelModule.d.mts +1 -0
- package/lib/types/decaf-model/FromModelController.d.cts +40 -52
- package/lib/types/decaf-model/FromModelController.d.mts +40 -52
- package/lib/types/decaf-model/decorators/ApiOperationFromModel.d.cts +0 -2
- package/lib/types/decaf-model/decorators/ApiOperationFromModel.d.mts +0 -2
- package/lib/types/decaf-model/decorators/controller-config.d.cts +18 -0
- package/lib/types/decaf-model/decorators/controller-config.d.mts +18 -0
- package/lib/types/decaf-model/decorators/decorators.d.cts +1 -29
- package/lib/types/decaf-model/decorators/decorators.d.mts +1 -29
- package/lib/types/decaf-model/decorators/expose.d.cts +1 -0
- package/lib/types/decaf-model/decorators/expose.d.mts +1 -0
- package/lib/types/decaf-model/decorators/index.d.cts +1 -0
- package/lib/types/decaf-model/decorators/index.d.mts +1 -0
- package/lib/types/decaf-model/decorators/types.d.cts +8 -21
- package/lib/types/decaf-model/decorators/types.d.mts +8 -21
- package/lib/types/decaf-model/index.d.cts +11 -3
- package/lib/types/decaf-model/index.d.mts +11 -3
- package/lib/types/decaf-model/utils.d.cts +2 -1
- package/lib/types/decaf-model/utils.d.mts +2 -1
- package/lib/types/decorators.d.cts +34 -0
- package/lib/types/decorators.d.mts +34 -0
- package/lib/types/factory/openapi/DtoBuilder.d.cts +7 -3
- package/lib/types/factory/openapi/DtoBuilder.d.mts +7 -3
- package/lib/types/index.d.cts +5 -5
- package/lib/types/index.d.mts +5 -5
- package/lib/types/interceptors/DecafRequestHandlerInterceptor.d.cts +1 -2
- package/lib/types/interceptors/DecafRequestHandlerInterceptor.d.mts +1 -2
- package/lib/types/interceptors/index.d.cts +1 -2
- package/lib/types/interceptors/index.d.mts +1 -2
- package/lib/types/overrides/Adapter.d.cts +1 -1
- package/lib/types/overrides/Adapter.d.mts +1 -1
- package/lib/types/overrides/index.d.cts +1 -0
- package/lib/types/overrides/index.d.mts +1 -0
- package/lib/types/overrides/logging.d.cts +1 -0
- package/lib/types/overrides/logging.d.mts +1 -0
- package/lib/types/request/DecafAuthHandler.d.cts +1 -10
- package/lib/types/request/DecafAuthHandler.d.mts +1 -10
- package/lib/types/request/DecafRequestContext.d.cts +4 -5
- package/lib/types/request/DecafRequestContext.d.mts +4 -5
- package/lib/types/types.d.cts +12 -24
- package/lib/types/types.d.mts +12 -24
- package/lib/types/webhooks/controllers.d.cts +1 -1
- package/lib/types/webhooks/controllers.d.mts +1 -1
- package/lib/types/webhooks/index.d.cts +0 -1
- package/lib/types/webhooks/index.d.mts +0 -1
- package/package.json +5 -13
- package/dist/for-nest.cjs.map +0 -1
- package/dist/for-nest.js.map +0 -1
- package/lib/cjs/bin/cli.cjs.map +0 -1
- package/lib/cjs/cli-module.cjs.map +0 -1
- package/lib/cjs/constants.cjs.map +0 -1
- package/lib/cjs/controllers.cjs.map +0 -1
- package/lib/cjs/core-module.cjs.map +0 -1
- package/lib/cjs/decaf-model/DecafModelModule.cjs.map +0 -1
- package/lib/cjs/decaf-model/FromModelController.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/ApiOperationFromModel.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/ApiParamsFromModel.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/DecafBody.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/DecafParams.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/decorators.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/index.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/types.cjs.map +0 -1
- package/lib/cjs/decaf-model/decorators/utils.cjs.map +0 -1
- package/lib/cjs/decaf-model/index.cjs.map +0 -1
- package/lib/cjs/decaf-model/types.cjs.map +0 -1
- package/lib/cjs/decaf-model/utils.cjs.map +0 -1
- package/lib/cjs/decoration.cjs.map +0 -1
- package/lib/cjs/events-module/DecafStreamModule.cjs.map +0 -1
- package/lib/cjs/events-module/EventsController.cjs.map +0 -1
- package/lib/cjs/events-module/constant.cjs.map +0 -1
- package/lib/cjs/events-module/index.cjs.map +0 -1
- package/lib/cjs/events-module/utils.cjs.map +0 -1
- package/lib/cjs/factory/NestBootstraper.cjs.map +0 -1
- package/lib/cjs/factory/errors/cors.cjs.map +0 -1
- package/lib/cjs/factory/errors/index.cjs.map +0 -1
- package/lib/cjs/factory/errors/throttling.cjs.map +0 -1
- package/lib/cjs/factory/exceptions/DecafErrorFilter.cjs.map +0 -1
- package/lib/cjs/factory/exceptions/decorators.cjs.map +0 -1
- package/lib/cjs/factory/exceptions/index.cjs.map +0 -1
- package/lib/cjs/factory/index.cjs.map +0 -1
- package/lib/cjs/factory/openapi/DtoBuilder.cjs.map +0 -1
- package/lib/cjs/factory/openapi/SwaggerBuilder.cjs.map +0 -1
- package/lib/cjs/factory/openapi/SwaggerCustomUI.cjs.map +0 -1
- package/lib/cjs/factory/openapi/constants.cjs.map +0 -1
- package/lib/cjs/factory/openapi/index.cjs.map +0 -1
- package/lib/cjs/index.cjs.map +0 -1
- package/lib/cjs/interceptors/AuthInterceptor.cjs +0 -52
- package/lib/cjs/interceptors/AuthInterceptor.cjs.map +0 -1
- package/lib/cjs/interceptors/DecafRequestHandlerInterceptor.cjs.map +0 -1
- package/lib/cjs/interceptors/context.cjs +0 -18
- package/lib/cjs/interceptors/context.cjs.map +0 -1
- package/lib/cjs/interceptors/index.cjs.map +0 -1
- package/lib/cjs/migrations/index.cjs +0 -35
- package/lib/cjs/migrations/index.cjs.map +0 -1
- package/lib/cjs/migrations/migration-module.cjs +0 -60
- package/lib/cjs/migrations/migration-module.cjs.map +0 -1
- package/lib/cjs/migrations/migration-options.cjs +0 -4
- package/lib/cjs/migrations/migration-options.cjs.map +0 -1
- package/lib/cjs/module.cjs.map +0 -1
- package/lib/cjs/overrides/Adapter.cjs.map +0 -1
- package/lib/cjs/overrides/ModelBuilderExtensions.cjs.map +0 -1
- package/lib/cjs/overrides/constants.cjs.map +0 -1
- package/lib/cjs/overrides/decoration.cjs.map +0 -1
- package/lib/cjs/overrides/helpers.cjs.map +0 -1
- package/lib/cjs/overrides/index.cjs.map +0 -1
- package/lib/cjs/overrides/overrides.cjs.map +0 -1
- package/lib/cjs/ram/RamRequestTransformer.cjs +0 -26
- package/lib/cjs/ram/RamRequestTransformer.cjs.map +0 -1
- package/lib/cjs/ram/index.cjs +0 -19
- package/lib/cjs/ram/index.cjs.map +0 -1
- package/lib/cjs/request/DecafAuthHandler.cjs.map +0 -1
- package/lib/cjs/request/DecafHandlerExecutor.cjs.map +0 -1
- package/lib/cjs/request/DecafRequestContext.cjs.map +0 -1
- package/lib/cjs/request/DecafResponseInterceptor.cjs.map +0 -1
- package/lib/cjs/request/index.cjs.map +0 -1
- package/lib/cjs/swagger-types.cjs.map +0 -1
- package/lib/cjs/types.cjs.map +0 -1
- package/lib/cjs/utils.cjs.map +0 -1
- package/lib/cjs/webhooks/DecafWebhookModule.cjs.map +0 -1
- package/lib/cjs/webhooks/controllers.cjs.map +0 -1
- package/lib/cjs/webhooks/index.cjs.map +0 -1
- package/lib/cjs/webhooks/types.cjs.map +0 -1
- package/lib/esm/bin/cli.js.map +0 -1
- package/lib/esm/cli-module.js.map +0 -1
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/controllers.js.map +0 -1
- package/lib/esm/core-module.js.map +0 -1
- package/lib/esm/decaf-model/DecafModelModule.js.map +0 -1
- package/lib/esm/decaf-model/FromModelController.js.map +0 -1
- package/lib/esm/decaf-model/decorators/ApiOperationFromModel.js.map +0 -1
- package/lib/esm/decaf-model/decorators/ApiParamsFromModel.js.map +0 -1
- package/lib/esm/decaf-model/decorators/DecafBody.js.map +0 -1
- package/lib/esm/decaf-model/decorators/DecafParams.js.map +0 -1
- package/lib/esm/decaf-model/decorators/decorators.js.map +0 -1
- package/lib/esm/decaf-model/decorators/index.js.map +0 -1
- package/lib/esm/decaf-model/decorators/types.js.map +0 -1
- package/lib/esm/decaf-model/decorators/utils.js.map +0 -1
- package/lib/esm/decaf-model/index.js.map +0 -1
- package/lib/esm/decaf-model/types.js.map +0 -1
- package/lib/esm/decaf-model/utils.js.map +0 -1
- package/lib/esm/decoration.js.map +0 -1
- package/lib/esm/events-module/DecafStreamModule.js.map +0 -1
- package/lib/esm/events-module/EventsController.js.map +0 -1
- package/lib/esm/events-module/constant.js.map +0 -1
- package/lib/esm/events-module/index.js.map +0 -1
- package/lib/esm/events-module/utils.js.map +0 -1
- package/lib/esm/factory/NestBootstraper.js.map +0 -1
- package/lib/esm/factory/errors/cors.js.map +0 -1
- package/lib/esm/factory/errors/index.js.map +0 -1
- package/lib/esm/factory/errors/throttling.js.map +0 -1
- package/lib/esm/factory/exceptions/DecafErrorFilter.js.map +0 -1
- package/lib/esm/factory/exceptions/decorators.js.map +0 -1
- package/lib/esm/factory/exceptions/index.js.map +0 -1
- package/lib/esm/factory/index.js.map +0 -1
- package/lib/esm/factory/openapi/DtoBuilder.js.map +0 -1
- package/lib/esm/factory/openapi/SwaggerBuilder.js.map +0 -1
- package/lib/esm/factory/openapi/SwaggerCustomUI.js.map +0 -1
- package/lib/esm/factory/openapi/constants.js.map +0 -1
- package/lib/esm/factory/openapi/index.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/interceptors/AuthInterceptor.js +0 -43
- package/lib/esm/interceptors/AuthInterceptor.js.map +0 -1
- package/lib/esm/interceptors/DecafRequestHandlerInterceptor.js.map +0 -1
- package/lib/esm/interceptors/context.js +0 -12
- package/lib/esm/interceptors/context.js.map +0 -1
- package/lib/esm/interceptors/index.js.map +0 -1
- package/lib/esm/migrations/index.js +0 -18
- package/lib/esm/migrations/index.js.map +0 -1
- package/lib/esm/migrations/migration-module.js +0 -52
- package/lib/esm/migrations/migration-module.js.map +0 -1
- package/lib/esm/migrations/migration-options.js +0 -7
- package/lib/esm/migrations/migration-options.js.map +0 -1
- package/lib/esm/module.js.map +0 -1
- package/lib/esm/overrides/Adapter.js.map +0 -1
- package/lib/esm/overrides/ModelBuilderExtensions.js.map +0 -1
- package/lib/esm/overrides/constants.js.map +0 -1
- package/lib/esm/overrides/decoration.js.map +0 -1
- package/lib/esm/overrides/helpers.js.map +0 -1
- package/lib/esm/overrides/index.js.map +0 -1
- package/lib/esm/overrides/overrides.js.map +0 -1
- package/lib/esm/ram/RamRequestTransformer.js +0 -21
- package/lib/esm/ram/RamRequestTransformer.js.map +0 -1
- package/lib/esm/ram/index.js +0 -2
- package/lib/esm/ram/index.js.map +0 -1
- package/lib/esm/request/DecafAuthHandler.js.map +0 -1
- package/lib/esm/request/DecafHandlerExecutor.js.map +0 -1
- package/lib/esm/request/DecafRequestContext.js.map +0 -1
- package/lib/esm/request/DecafResponseInterceptor.js.map +0 -1
- package/lib/esm/request/index.js.map +0 -1
- package/lib/esm/swagger-types.js.map +0 -1
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/utils.js.map +0 -1
- package/lib/esm/webhooks/DecafWebhookModule.js.map +0 -1
- package/lib/esm/webhooks/controllers.js.map +0 -1
- package/lib/esm/webhooks/index.js.map +0 -1
- package/lib/esm/webhooks/types.js.map +0 -1
- package/lib/types/interceptors/context.d.cts +0 -6
- package/lib/types/interceptors/context.d.mts +0 -6
- package/lib/types/migrations/index.d.cts +0 -17
- package/lib/types/migrations/index.d.mts +0 -17
- package/lib/types/migrations/migration-module.d.cts +0 -15
- package/lib/types/migrations/migration-module.d.mts +0 -15
- package/lib/types/migrations/migration-options.d.cts +0 -11
- package/lib/types/migrations/migration-options.d.mts +0 -11
- package/lib/types/ram/RamRequestTransformer.d.cts +0 -5
- package/lib/types/ram/RamRequestTransformer.d.mts +0 -5
- package/lib/types/ram/index.d.cts +0 -1
- package/lib/types/ram/index.d.mts +0 -1
|
@@ -5,5 +5,6 @@ export declare function getModuleFor(flavour: string): {
|
|
|
5
5
|
new (): {};
|
|
6
6
|
readonly log: import("@decaf-ts/logging").Logger;
|
|
7
7
|
createModelServices<T extends Model<boolean>>(models: ModelConstructor<T>[]): Provider[];
|
|
8
|
+
isExposed(model: ModelConstructor<any>, exposure?: Record<string, boolean | string[]>): boolean;
|
|
8
9
|
forRoot(flavour: string, options?: Partial<DecafModuleOptions>): DynamicModule;
|
|
9
10
|
};
|
|
@@ -1,61 +1,49 @@
|
|
|
1
1
|
import { ModelService, type Repo } from "@decaf-ts/core";
|
|
2
2
|
import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DecafApiProperty } from "./decorators/index.d.cts";
|
|
4
4
|
import { ControllerConstructor } from "./types.d.cts";
|
|
5
5
|
import "../overrides";
|
|
6
|
-
|
|
7
|
-
* @description
|
|
8
|
-
* Factory and utilities for generating dynamic NestJS controllers from Decaf {@link Model} definitions.
|
|
9
|
-
*
|
|
10
|
-
* @summary
|
|
11
|
-
* The `FromModelController` class provides the infrastructure necessary to automatically generate
|
|
12
|
-
* strongly-typed CRUD controllers based on a given {@link ModelConstructor}. It inspects metadata from
|
|
13
|
-
* the model, derives route paths, parameters, and generates a dynamic controller class at runtime with
|
|
14
|
-
* full support for querying, creation, update, and deletion of model entities through a {@link Repo}.
|
|
15
|
-
*
|
|
16
|
-
* @template T The {@link Model} type associated with the generated controller.
|
|
17
|
-
*
|
|
18
|
-
* @param ModelClazz The model class to generate the controller from.
|
|
19
|
-
*
|
|
20
|
-
* @class FromModelController
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* // Given a Decaf Model:
|
|
25
|
-
* class User extends Model<User> {
|
|
26
|
-
* id!: string;
|
|
27
|
-
* name!: string;
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* // Register controller:
|
|
31
|
-
* const UserController = FromModelController.create(User);
|
|
32
|
-
*
|
|
33
|
-
* // NestJS will expose:
|
|
34
|
-
* // POST /user
|
|
35
|
-
* // GET /user/:id
|
|
36
|
-
* // GET /user/query/:method
|
|
37
|
-
* // PUT /user/:id
|
|
38
|
-
* // DELETE /user/:id
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @mermaid
|
|
42
|
-
* sequenceDiagram
|
|
43
|
-
* participant Client
|
|
44
|
-
* participant Controller
|
|
45
|
-
* participant Repo
|
|
46
|
-
* participant DB
|
|
47
|
-
*
|
|
48
|
-
* Client->>Controller: HTTP Request
|
|
49
|
-
* Controller->>Repo: Resolve repository for Model
|
|
50
|
-
* Repo->>DB: Execute DB operation
|
|
51
|
-
* DB-->>Repo: DB Result
|
|
52
|
-
* Repo-->>Controller: Model Instance(s)
|
|
53
|
-
* Controller-->>Client: JSON Response
|
|
54
|
-
*/
|
|
6
|
+
import { type ModelControllerFactoryConfig } from "@decaf-ts/for-http/server";
|
|
55
7
|
export declare class FromModelController {
|
|
56
8
|
private static readonly log;
|
|
57
9
|
static getPersistence<T extends Model<boolean>>(ModelClazz: ModelConstructor<T>): Repo<T> | ModelService<T>;
|
|
58
10
|
static createQueryRoutesFromRepository<T extends Model<boolean>>(persistence: Repo<T> | ModelService<T>, prefix?: string): ControllerConstructor<T>;
|
|
59
|
-
static create<T extends Model<any>>(ModelConstr: ModelConstructor<T>):
|
|
60
|
-
static getRouteParametersFromModel<T extends Model<any>>(ModelClazz: ModelConstructor<T>):
|
|
11
|
+
static create<T extends Model<any>>(ModelConstr: ModelConstructor<T>, moduleConfigOverrides?: Record<string, ModelControllerFactoryConfig>, globalDefaults?: Partial<ModelControllerFactoryConfig>): ControllerConstructor<T>;
|
|
12
|
+
static getRouteParametersFromModel<T extends Model<any>>(ModelClazz: ModelConstructor<T>): {
|
|
13
|
+
path: string;
|
|
14
|
+
description: string;
|
|
15
|
+
apiProperties: DecafApiProperty[];
|
|
16
|
+
getPK: (...params: Array<string | number>) => string;
|
|
17
|
+
};
|
|
18
|
+
private static defineMethod;
|
|
19
|
+
private static applyDecorators;
|
|
20
|
+
private static matchRoute;
|
|
21
|
+
private static createRegistration;
|
|
22
|
+
private static statementMethodName;
|
|
23
|
+
private static statementShortcutParams;
|
|
24
|
+
private static complexQueryParams;
|
|
25
|
+
private static createCreateHandler;
|
|
26
|
+
private static createBulkCreateHandler;
|
|
27
|
+
private static createBulkReadHandler;
|
|
28
|
+
private static createBulkUpdateHandler;
|
|
29
|
+
private static createBulkDeleteHandler;
|
|
30
|
+
private static createReadHandler;
|
|
31
|
+
private static createUpdateHandler;
|
|
32
|
+
private static createDeleteHandler;
|
|
33
|
+
private static createStatementHandler;
|
|
34
|
+
private static createStatementShortcutHandler;
|
|
35
|
+
private static createComplexQueryHandler;
|
|
36
|
+
private static createCustomRouteHandler;
|
|
37
|
+
private static extractQueryArgs;
|
|
38
|
+
private static createCreateDecorators;
|
|
39
|
+
private static bulkCreateDecorators;
|
|
40
|
+
private static bulkReadDecorators;
|
|
41
|
+
private static bulkUpdateDecorators;
|
|
42
|
+
private static bulkDeleteDecorators;
|
|
43
|
+
private static readDecorators;
|
|
44
|
+
private static updateDecorators;
|
|
45
|
+
private static deleteDecorators;
|
|
46
|
+
private static statementDecorators;
|
|
47
|
+
private static statementShortcutDecorators;
|
|
48
|
+
private static getQueryDecorators;
|
|
61
49
|
}
|
|
@@ -1,61 +1,49 @@
|
|
|
1
1
|
import { ModelService, type Repo } from "@decaf-ts/core";
|
|
2
2
|
import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DecafApiProperty } from "./decorators/index.d.mts";
|
|
4
4
|
import { ControllerConstructor } from "./types.d.mts";
|
|
5
5
|
import "../overrides";
|
|
6
|
-
|
|
7
|
-
* @description
|
|
8
|
-
* Factory and utilities for generating dynamic NestJS controllers from Decaf {@link Model} definitions.
|
|
9
|
-
*
|
|
10
|
-
* @summary
|
|
11
|
-
* The `FromModelController` class provides the infrastructure necessary to automatically generate
|
|
12
|
-
* strongly-typed CRUD controllers based on a given {@link ModelConstructor}. It inspects metadata from
|
|
13
|
-
* the model, derives route paths, parameters, and generates a dynamic controller class at runtime with
|
|
14
|
-
* full support for querying, creation, update, and deletion of model entities through a {@link Repo}.
|
|
15
|
-
*
|
|
16
|
-
* @template T The {@link Model} type associated with the generated controller.
|
|
17
|
-
*
|
|
18
|
-
* @param ModelClazz The model class to generate the controller from.
|
|
19
|
-
*
|
|
20
|
-
* @class FromModelController
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* // Given a Decaf Model:
|
|
25
|
-
* class User extends Model<User> {
|
|
26
|
-
* id!: string;
|
|
27
|
-
* name!: string;
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* // Register controller:
|
|
31
|
-
* const UserController = FromModelController.create(User);
|
|
32
|
-
*
|
|
33
|
-
* // NestJS will expose:
|
|
34
|
-
* // POST /user
|
|
35
|
-
* // GET /user/:id
|
|
36
|
-
* // GET /user/query/:method
|
|
37
|
-
* // PUT /user/:id
|
|
38
|
-
* // DELETE /user/:id
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @mermaid
|
|
42
|
-
* sequenceDiagram
|
|
43
|
-
* participant Client
|
|
44
|
-
* participant Controller
|
|
45
|
-
* participant Repo
|
|
46
|
-
* participant DB
|
|
47
|
-
*
|
|
48
|
-
* Client->>Controller: HTTP Request
|
|
49
|
-
* Controller->>Repo: Resolve repository for Model
|
|
50
|
-
* Repo->>DB: Execute DB operation
|
|
51
|
-
* DB-->>Repo: DB Result
|
|
52
|
-
* Repo-->>Controller: Model Instance(s)
|
|
53
|
-
* Controller-->>Client: JSON Response
|
|
54
|
-
*/
|
|
6
|
+
import { type ModelControllerFactoryConfig } from "@decaf-ts/for-http/server";
|
|
55
7
|
export declare class FromModelController {
|
|
56
8
|
private static readonly log;
|
|
57
9
|
static getPersistence<T extends Model<boolean>>(ModelClazz: ModelConstructor<T>): Repo<T> | ModelService<T>;
|
|
58
10
|
static createQueryRoutesFromRepository<T extends Model<boolean>>(persistence: Repo<T> | ModelService<T>, prefix?: string): ControllerConstructor<T>;
|
|
59
|
-
static create<T extends Model<any>>(ModelConstr: ModelConstructor<T>):
|
|
60
|
-
static getRouteParametersFromModel<T extends Model<any>>(ModelClazz: ModelConstructor<T>):
|
|
11
|
+
static create<T extends Model<any>>(ModelConstr: ModelConstructor<T>, moduleConfigOverrides?: Record<string, ModelControllerFactoryConfig>, globalDefaults?: Partial<ModelControllerFactoryConfig>): ControllerConstructor<T>;
|
|
12
|
+
static getRouteParametersFromModel<T extends Model<any>>(ModelClazz: ModelConstructor<T>): {
|
|
13
|
+
path: string;
|
|
14
|
+
description: string;
|
|
15
|
+
apiProperties: DecafApiProperty[];
|
|
16
|
+
getPK: (...params: Array<string | number>) => string;
|
|
17
|
+
};
|
|
18
|
+
private static defineMethod;
|
|
19
|
+
private static applyDecorators;
|
|
20
|
+
private static matchRoute;
|
|
21
|
+
private static createRegistration;
|
|
22
|
+
private static statementMethodName;
|
|
23
|
+
private static statementShortcutParams;
|
|
24
|
+
private static complexQueryParams;
|
|
25
|
+
private static createCreateHandler;
|
|
26
|
+
private static createBulkCreateHandler;
|
|
27
|
+
private static createBulkReadHandler;
|
|
28
|
+
private static createBulkUpdateHandler;
|
|
29
|
+
private static createBulkDeleteHandler;
|
|
30
|
+
private static createReadHandler;
|
|
31
|
+
private static createUpdateHandler;
|
|
32
|
+
private static createDeleteHandler;
|
|
33
|
+
private static createStatementHandler;
|
|
34
|
+
private static createStatementShortcutHandler;
|
|
35
|
+
private static createComplexQueryHandler;
|
|
36
|
+
private static createCustomRouteHandler;
|
|
37
|
+
private static extractQueryArgs;
|
|
38
|
+
private static createCreateDecorators;
|
|
39
|
+
private static bulkCreateDecorators;
|
|
40
|
+
private static bulkReadDecorators;
|
|
41
|
+
private static bulkUpdateDecorators;
|
|
42
|
+
private static bulkDeleteDecorators;
|
|
43
|
+
private static readDecorators;
|
|
44
|
+
private static updateDecorators;
|
|
45
|
+
private static deleteDecorators;
|
|
46
|
+
private static statementDecorators;
|
|
47
|
+
private static statementShortcutDecorators;
|
|
48
|
+
private static getQueryDecorators;
|
|
61
49
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CrudOperations } from "@decaf-ts/db-decorators";
|
|
2
1
|
import { ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
2
|
import { HttpVerbs } from "./types.d.cts";
|
|
4
3
|
/**
|
|
@@ -9,7 +8,6 @@ import { HttpVerbs } from "./types.d.cts";
|
|
|
9
8
|
* @return {boolean} `true` when the operation is explicitly blocked by the model's handler; otherwise `false`.
|
|
10
9
|
* @function isOperationBlocked
|
|
11
10
|
*/
|
|
12
|
-
export declare function isOperationBlocked(ModelConstructor: ModelConstructor<any>, op: CrudOperations): boolean;
|
|
13
11
|
/**
|
|
14
12
|
* @description Conditionally applies an HTTP method decorator for a given model and verb, hiding the endpoint in Swagger (and not registering the route) when the model blocks that CRUD operation.
|
|
15
13
|
* @summary Maps an HTTP verb to its corresponding `CrudOperations` key and Nest HTTP decorator (`@Get`, `@Post`, etc.). It checks `isOperationBlocked(ModelConstructor, crudOp)` and, if blocked, applies only `@ApiExcludeEndpoint()` (Swagger-hidden, no Nest route). If permitted, it applies the appropriate HTTP decorator with the optional `path`.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CrudOperations } from "@decaf-ts/db-decorators";
|
|
2
1
|
import { ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
3
2
|
import { HttpVerbs } from "./types.d.mts";
|
|
4
3
|
/**
|
|
@@ -9,7 +8,6 @@ import { HttpVerbs } from "./types.d.mts";
|
|
|
9
8
|
* @return {boolean} `true` when the operation is explicitly blocked by the model's handler; otherwise `false`.
|
|
10
9
|
* @function isOperationBlocked
|
|
11
10
|
*/
|
|
12
|
-
export declare function isOperationBlocked(ModelConstructor: ModelConstructor<any>, op: CrudOperations): boolean;
|
|
13
11
|
/**
|
|
14
12
|
* @description Conditionally applies an HTTP method decorator for a given model and verb, hiding the endpoint in Swagger (and not registering the route) when the model blocks that CRUD operation.
|
|
15
13
|
* @summary Maps an HTTP verb to its corresponding `CrudOperations` key and Nest HTTP decorator (`@Get`, `@Post`, etc.). It checks `isOperationBlocked(ModelConstructor, crudOp)` and, if blocked, applies only `@ApiExcludeEndpoint()` (Swagger-hidden, no Nest route). If permitted, it applies the appropriate HTTP decorator with the optional `path`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelControllerFactoryConfig } from "@decaf-ts/for-http/server";
|
|
2
|
+
/**
|
|
3
|
+
* Class decorator that attaches a {@link ModelControllerFactoryConfig} to a Model,
|
|
4
|
+
* so `FromModelController.create()` can pass it to `ModelControllerFactory.create()`.
|
|
5
|
+
*
|
|
6
|
+
* The per-model config can be overridden by the module-level `controllerConfig`
|
|
7
|
+
* option in `DecafModuleOptions`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* @controllerConfig({ allowGroupingQueries: true, allowBulkStatement: { create: true, read: true, update: false, delete: true } })
|
|
12
|
+
* @model()
|
|
13
|
+
* class Order extends Model<Order> { ... }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param config - Factory configuration knobs (allowStatementlessQuery, allowGroupingQueries, allowBulkStatement).
|
|
17
|
+
*/
|
|
18
|
+
export declare function controllerConfig(config: ModelControllerFactoryConfig): (target: any) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelControllerFactoryConfig } from "@decaf-ts/for-http/server";
|
|
2
|
+
/**
|
|
3
|
+
* Class decorator that attaches a {@link ModelControllerFactoryConfig} to a Model,
|
|
4
|
+
* so `FromModelController.create()` can pass it to `ModelControllerFactory.create()`.
|
|
5
|
+
*
|
|
6
|
+
* The per-model config can be overridden by the module-level `controllerConfig`
|
|
7
|
+
* option in `DecafModuleOptions`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* @controllerConfig({ allowGroupingQueries: true, allowBulkStatement: { create: true, read: true, update: false, delete: true } })
|
|
12
|
+
* @model()
|
|
13
|
+
* class Order extends Model<Order> { ... }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param config - Factory configuration knobs (allowStatementlessQuery, allowGroupingQueries, allowBulkStatement).
|
|
17
|
+
*/
|
|
18
|
+
export declare function controllerConfig(config: ModelControllerFactoryConfig): (target: any) => any;
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A decorator function that applies authentication and authorization metadata to a NestJS controller or method.
|
|
4
|
-
*
|
|
5
|
-
* @param model - The model name or constructor function for the resource being accessed.
|
|
6
|
-
* If a string is provided, it is used as the resource name.
|
|
7
|
-
* If a constructor function is provided, its name is used as the resource name.
|
|
8
|
-
*
|
|
9
|
-
* @returns - A function that applies the authentication and authorization decorators to the target.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Controller('users')
|
|
14
|
-
* @Auth('User')
|
|
15
|
-
* export class UsersController {
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* @Controller('users')
|
|
23
|
-
* @Auth(User)
|
|
24
|
-
* export class UsersController {
|
|
25
|
-
* // ...
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function Auth(model?: string | Constructor): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
1
|
+
export { Auth } from "../../auth/decorators.d.cts";
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A decorator function that applies authentication and authorization metadata to a NestJS controller or method.
|
|
4
|
-
*
|
|
5
|
-
* @param model - The model name or constructor function for the resource being accessed.
|
|
6
|
-
* If a string is provided, it is used as the resource name.
|
|
7
|
-
* If a constructor function is provided, its name is used as the resource name.
|
|
8
|
-
*
|
|
9
|
-
* @returns - A function that applies the authentication and authorization decorators to the target.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Controller('users')
|
|
14
|
-
* @Auth('User')
|
|
15
|
-
* export class UsersController {
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* @Controller('users')
|
|
23
|
-
* @Auth(User)
|
|
24
|
-
* export class UsersController {
|
|
25
|
-
* // ...
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function Auth(model?: string | Constructor): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
1
|
+
export { Auth } from "../../auth/decorators.d.mts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function expose(...flavours: string[]): (target: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function expose(...flavours: string[]): (target: any) => any;
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type?: any;
|
|
7
|
-
};
|
|
8
|
-
export type DecafModelRoute = {
|
|
9
|
-
path: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
apiProperties: DecafApiProperty[];
|
|
12
|
-
getPK: (...args: Array<string | number>) => string;
|
|
13
|
-
};
|
|
14
|
-
export type DecafParamProps = {
|
|
15
|
-
raw: Record<string, string | number>;
|
|
16
|
-
keysInOrder: Array<string>;
|
|
17
|
-
valuesInOrder: Array<string | number>;
|
|
18
|
-
};
|
|
1
|
+
import type { HttpVerbs as ServerHttpVerbs, ServerApiProperty, ServerModelRoute, ServerParamProps, ServerRouteDecOptions } from "@decaf-ts/for-http/server";
|
|
2
|
+
export type HttpVerbs = ServerHttpVerbs;
|
|
3
|
+
export type DecafApiProperty = ServerApiProperty;
|
|
4
|
+
export type DecafModelRoute = ServerModelRoute;
|
|
5
|
+
export type DecafParamProps = ServerParamProps;
|
|
19
6
|
export interface DecafRouteDecOptions {
|
|
20
|
-
path:
|
|
21
|
-
httpMethod:
|
|
22
|
-
handler:
|
|
7
|
+
path: ServerRouteDecOptions["path"];
|
|
8
|
+
httpMethod: ServerRouteDecOptions["httpMethod"];
|
|
9
|
+
handler: ServerRouteDecOptions["handler"];
|
|
23
10
|
}
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type?: any;
|
|
7
|
-
};
|
|
8
|
-
export type DecafModelRoute = {
|
|
9
|
-
path: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
apiProperties: DecafApiProperty[];
|
|
12
|
-
getPK: (...args: Array<string | number>) => string;
|
|
13
|
-
};
|
|
14
|
-
export type DecafParamProps = {
|
|
15
|
-
raw: Record<string, string | number>;
|
|
16
|
-
keysInOrder: Array<string>;
|
|
17
|
-
valuesInOrder: Array<string | number>;
|
|
18
|
-
};
|
|
1
|
+
import type { HttpVerbs as ServerHttpVerbs, ServerApiProperty, ServerModelRoute, ServerParamProps, ServerRouteDecOptions } from "@decaf-ts/for-http/server";
|
|
2
|
+
export type HttpVerbs = ServerHttpVerbs;
|
|
3
|
+
export type DecafApiProperty = ServerApiProperty;
|
|
4
|
+
export type DecafModelRoute = ServerModelRoute;
|
|
5
|
+
export type DecafParamProps = ServerParamProps;
|
|
19
6
|
export interface DecafRouteDecOptions {
|
|
20
|
-
path:
|
|
21
|
-
httpMethod:
|
|
22
|
-
handler:
|
|
7
|
+
path: ServerRouteDecOptions["path"];
|
|
8
|
+
httpMethod: ServerRouteDecOptions["httpMethod"];
|
|
9
|
+
handler: ServerRouteDecOptions["handler"];
|
|
23
10
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { ApiOperationFromModel, BulkApiOperationFromModel, } from "./decorators/ApiOperationFromModel.d.cts";
|
|
2
|
+
export { ApiParamsFromModel } from "./decorators/ApiParamsFromModel.d.cts";
|
|
3
|
+
export { DecafBody } from "./decorators/DecafBody.d.cts";
|
|
4
|
+
export { DecafParams } from "./decorators/DecafParams.d.cts";
|
|
5
|
+
export type { DecafParamProps } from "./decorators/types.d.cts";
|
|
6
|
+
export { expose } from "./decorators/expose.d.cts";
|
|
7
|
+
export { controllerConfig } from "./decorators/controller-config.d.cts";
|
|
8
|
+
export { Auth } from "./decorators/decorators.d.cts";
|
|
9
|
+
export { applyApiDecorators, createRouteHandler, defineRouteMethod, getApiDecorators, resolvePersistenceMethod, } from "./utils.d.cts";
|
|
10
|
+
export { getModuleFor } from "./DecafModelModule.d.cts";
|
|
11
|
+
export { FromModelController } from "./FromModelController.d.cts";
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { ApiOperationFromModel, BulkApiOperationFromModel, } from "./decorators/ApiOperationFromModel.d.mts";
|
|
2
|
+
export { ApiParamsFromModel } from "./decorators/ApiParamsFromModel.d.mts";
|
|
3
|
+
export { DecafBody } from "./decorators/DecafBody.d.mts";
|
|
4
|
+
export { DecafParams } from "./decorators/DecafParams.d.mts";
|
|
5
|
+
export type { DecafParamProps } from "./decorators/types.d.mts";
|
|
6
|
+
export { expose } from "./decorators/expose.d.mts";
|
|
7
|
+
export { controllerConfig } from "./decorators/controller-config.d.mts";
|
|
8
|
+
export { Auth } from "./decorators/decorators.d.mts";
|
|
9
|
+
export { applyApiDecorators, createRouteHandler, defineRouteMethod, getApiDecorators, resolvePersistenceMethod, } from "./utils.d.mts";
|
|
10
|
+
export { getModuleFor } from "./DecafModelModule.d.mts";
|
|
11
|
+
export { FromModelController } from "./FromModelController.d.mts";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DecoratorBundle } from "./types.d.cts";
|
|
2
|
-
import { type DecafParamProps
|
|
2
|
+
import { type DecafParamProps } from "./decorators/index.d.cts";
|
|
3
|
+
import type { HttpVerbs } from "./decorators/types.d.cts";
|
|
3
4
|
import { DirectionLimitOffset, ModelService, Repo } from "@decaf-ts/core";
|
|
4
5
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
5
6
|
import { DecafModelController } from "../controllers.d.cts";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type DecoratorBundle } from "./types.d.mts";
|
|
2
|
-
import { type DecafParamProps
|
|
2
|
+
import { type DecafParamProps } from "./decorators/index.d.mts";
|
|
3
|
+
import type { HttpVerbs } from "./decorators/types.d.mts";
|
|
3
4
|
import { DirectionLimitOffset, ModelService, Repo } from "@decaf-ts/core";
|
|
4
5
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
5
6
|
import { DecafModelController } from "../controllers.d.mts";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
+
export type DecafFactoryProvider = {
|
|
3
|
+
provide: string;
|
|
4
|
+
useFactory: () => unknown;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @description Drains the providers registered by {@link Service}/{@link Repository} usages.
|
|
8
|
+
* @summary Consumed by {@link DecafCoreModule.forRoot} to wire the tokens that those parameter
|
|
9
|
+
* decorators reference back into Nest's DI container, since a parameter decorator alone cannot
|
|
10
|
+
* supply a provider.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getRegisteredDecafProviders(): DecafFactoryProvider[];
|
|
13
|
+
/**
|
|
14
|
+
* @description Constructor parameter decorator that injects a decaf service.
|
|
15
|
+
* @summary Translates decaf's service resolution APIs into a Nest `@Inject()` call:
|
|
16
|
+
* - `@Service(SomeModel)` injects the `ModelService<SomeModel>` singleton for that model
|
|
17
|
+
* (via {@link ModelService.forModel}).
|
|
18
|
+
* - `@Service(SomeServiceClass)` or `@Service("alias")` injects the matching `@service()`-decorated
|
|
19
|
+
* decaf {@link CoreService} (via {@link CoreService.get}).
|
|
20
|
+
* - `@Service()` infers the parameter's type from emitted constructor metadata and resolves it the
|
|
21
|
+
* same way, provided the parameter is typed as a concrete class (generics like `ModelService<X>`
|
|
22
|
+
* are erased at runtime, so the model-service form always requires an explicit argument).
|
|
23
|
+
* @param key the model class, service class, or alias to resolve. Omit to infer from the parameter type.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Service(key?: string | Constructor<any>): ParameterDecorator;
|
|
26
|
+
/**
|
|
27
|
+
* @description Constructor parameter decorator that injects a decaf {@link CoreRepository} for `model`.
|
|
28
|
+
* @summary Unlike {@link Service}, `model` is always treated as a Model class: the same class passed
|
|
29
|
+
* to `@Service(model)` and `@Repository(model)` resolves to two different injected objects (a
|
|
30
|
+
* `ModelService<M>` vs a `Repository<M>` respectively), via {@link CoreRepository.forModel}.
|
|
31
|
+
* @param model the model class to resolve a repository for.
|
|
32
|
+
* @param flavour optional adapter flavour/alias, forwarded to {@link CoreRepository.forModel}.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Repository(model: Constructor<any>, flavour?: string): ParameterDecorator;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
+
export type DecafFactoryProvider = {
|
|
3
|
+
provide: string;
|
|
4
|
+
useFactory: () => unknown;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @description Drains the providers registered by {@link Service}/{@link Repository} usages.
|
|
8
|
+
* @summary Consumed by {@link DecafCoreModule.forRoot} to wire the tokens that those parameter
|
|
9
|
+
* decorators reference back into Nest's DI container, since a parameter decorator alone cannot
|
|
10
|
+
* supply a provider.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getRegisteredDecafProviders(): DecafFactoryProvider[];
|
|
13
|
+
/**
|
|
14
|
+
* @description Constructor parameter decorator that injects a decaf service.
|
|
15
|
+
* @summary Translates decaf's service resolution APIs into a Nest `@Inject()` call:
|
|
16
|
+
* - `@Service(SomeModel)` injects the `ModelService<SomeModel>` singleton for that model
|
|
17
|
+
* (via {@link ModelService.forModel}).
|
|
18
|
+
* - `@Service(SomeServiceClass)` or `@Service("alias")` injects the matching `@service()`-decorated
|
|
19
|
+
* decaf {@link CoreService} (via {@link CoreService.get}).
|
|
20
|
+
* - `@Service()` infers the parameter's type from emitted constructor metadata and resolves it the
|
|
21
|
+
* same way, provided the parameter is typed as a concrete class (generics like `ModelService<X>`
|
|
22
|
+
* are erased at runtime, so the model-service form always requires an explicit argument).
|
|
23
|
+
* @param key the model class, service class, or alias to resolve. Omit to infer from the parameter type.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Service(key?: string | Constructor<any>): ParameterDecorator;
|
|
26
|
+
/**
|
|
27
|
+
* @description Constructor parameter decorator that injects a decaf {@link CoreRepository} for `model`.
|
|
28
|
+
* @summary Unlike {@link Service}, `model` is always treated as a Model class: the same class passed
|
|
29
|
+
* to `@Service(model)` and `@Repository(model)` resolves to two different injected objects (a
|
|
30
|
+
* `ModelService<M>` vs a `Repository<M>` respectively), via {@link CoreRepository.forModel}.
|
|
31
|
+
* @param model the model class to resolve a repository for.
|
|
32
|
+
* @param flavour optional adapter flavour/alias, forwarded to {@link CoreRepository.forModel}.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Repository(model: Constructor<any>, flavour?: string): ParameterDecorator;
|
|
@@ -14,12 +14,16 @@ import { Model } from "@decaf-ts/decorator-validation";
|
|
|
14
14
|
* • CREATE – included only when the pk is NOT auto-generated
|
|
15
15
|
* (checked via Model.pkProps().generated AND Model.generated()).
|
|
16
16
|
* - Relation properties (@oneToOne, @oneToMany, …):
|
|
17
|
-
* • CREATE – nested as DtoFor(CREATE, RelatedModel).
|
|
17
|
+
* • CREATE – nested as DtoFor(CREATE, RelatedModel). When the relation
|
|
18
|
+
* creates a circular reference (model A → model B → model A),
|
|
19
|
+
* the back-reference uses the related model's PK type
|
|
20
|
+
* (string/integer) instead of the full DTO to break the cycle.
|
|
18
21
|
* • UPDATE – union of DtoFor(UPDATE, RelatedModel) **or** the
|
|
19
22
|
* related model's primary-key type (string / integer),
|
|
20
|
-
* expressed as a Swagger oneOf.
|
|
23
|
+
* expressed as a Swagger oneOf. Circular back-references
|
|
24
|
+
* omit the DTO $ref and only include the PK type.
|
|
21
25
|
*
|
|
22
26
|
* Metadata.properties() now returns ALL properties across the prototype chain,
|
|
23
27
|
* so DTO inheritance is no longer needed; every DTO is a flat class.
|
|
24
28
|
*/
|
|
25
|
-
export declare function DtoFor<M extends Model>(op: OperationKeys, model: Constructor<M
|
|
29
|
+
export declare function DtoFor<M extends Model>(op: OperationKeys, model: Constructor<M>, stack?: Set<Constructor<any>>): Constructor<any>;
|
|
@@ -14,12 +14,16 @@ import { Model } from "@decaf-ts/decorator-validation";
|
|
|
14
14
|
* • CREATE – included only when the pk is NOT auto-generated
|
|
15
15
|
* (checked via Model.pkProps().generated AND Model.generated()).
|
|
16
16
|
* - Relation properties (@oneToOne, @oneToMany, …):
|
|
17
|
-
* • CREATE – nested as DtoFor(CREATE, RelatedModel).
|
|
17
|
+
* • CREATE – nested as DtoFor(CREATE, RelatedModel). When the relation
|
|
18
|
+
* creates a circular reference (model A → model B → model A),
|
|
19
|
+
* the back-reference uses the related model's PK type
|
|
20
|
+
* (string/integer) instead of the full DTO to break the cycle.
|
|
18
21
|
* • UPDATE – union of DtoFor(UPDATE, RelatedModel) **or** the
|
|
19
22
|
* related model's primary-key type (string / integer),
|
|
20
|
-
* expressed as a Swagger oneOf.
|
|
23
|
+
* expressed as a Swagger oneOf. Circular back-references
|
|
24
|
+
* omit the DTO $ref and only include the PK type.
|
|
21
25
|
*
|
|
22
26
|
* Metadata.properties() now returns ALL properties across the prototype chain,
|
|
23
27
|
* so DTO inheritance is no longer needed; every DTO is a flat class.
|
|
24
28
|
*/
|
|
25
|
-
export declare function DtoFor<M extends Model>(op: OperationKeys, model: Constructor<M
|
|
29
|
+
export declare function DtoFor<M extends Model>(op: OperationKeys, model: Constructor<M>, stack?: Set<Constructor<any>>): Constructor<any>;
|
package/lib/types/index.d.cts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import "./decoration";
|
|
23
23
|
export * from "./decoration.d.cts";
|
|
24
24
|
export * from "./decaf-model/index.d.cts";
|
|
25
|
+
export * from "./auth/index.d.cts";
|
|
25
26
|
export * from "./factory/index.d.cts";
|
|
26
27
|
export * from "./interceptors/index.d.cts";
|
|
27
28
|
export * from "./overrides/index.d.cts";
|
|
@@ -30,30 +31,29 @@ export * from "./constants.d.cts";
|
|
|
30
31
|
export * from "./controllers.d.cts";
|
|
31
32
|
export * from "./module.d.cts";
|
|
32
33
|
export * from "./core-module.d.cts";
|
|
33
|
-
export * from "./migrations/index.d.cts";
|
|
34
34
|
export * from "./types.d.cts";
|
|
35
|
+
export * from "./decorators.d.cts";
|
|
35
36
|
export * from "./utils.d.cts";
|
|
36
37
|
export * from "./events-module/index.d.cts";
|
|
37
|
-
export * from "./webhooks/index.d.cts";
|
|
38
38
|
/**
|
|
39
39
|
* Represents the current version of the ts-workspace module.
|
|
40
40
|
* The actual version number is replaced during the build process.
|
|
41
41
|
* @constant
|
|
42
42
|
* @type {string}
|
|
43
43
|
*/
|
|
44
|
-
export declare const VERSION = "0.11.
|
|
44
|
+
export declare const VERSION = "0.11.2-refactor.2";
|
|
45
45
|
/**
|
|
46
46
|
* @description Represents the current commit hash of the module build.
|
|
47
47
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
48
48
|
* the placeholder with the actual commit hash at publish time.
|
|
49
49
|
* @const COMMIT
|
|
50
50
|
*/
|
|
51
|
-
export declare const COMMIT = "
|
|
51
|
+
export declare const COMMIT = "85f1cec";
|
|
52
52
|
/**
|
|
53
53
|
* @description Represents the full version string of the module.
|
|
54
54
|
* @summary Stores the semver version and commit hash for the package.
|
|
55
55
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
56
56
|
* @const FULL_VERSION
|
|
57
57
|
*/
|
|
58
|
-
export declare const FULL_VERSION = "0.11.
|
|
58
|
+
export declare const FULL_VERSION = "0.11.2-refactor.2-85f1cec";
|
|
59
59
|
export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
|