@dofe/infra-common 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/base.adapter.d.ts +84 -0
- package/dist/adapters/base.adapter.d.ts.map +1 -0
- package/dist/adapters/base.adapter.js +19 -0
- package/dist/adapters/base.adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +35 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +53 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/common.module.d.ts +7 -0
- package/dist/common.module.d.ts.map +1 -0
- package/dist/common.module.js +26 -0
- package/dist/common.module.js.map +1 -0
- package/dist/config/agentx.config.d.ts +37 -0
- package/dist/config/agentx.config.d.ts.map +1 -0
- package/dist/config/agentx.config.js +81 -0
- package/dist/config/agentx.config.js.map +1 -0
- package/dist/config/configuration.d.ts +55 -0
- package/dist/config/configuration.d.ts.map +1 -0
- package/dist/config/configuration.js +336 -0
- package/dist/config/configuration.js.map +1 -0
- package/dist/config/constant/config.constants.d.ts +48 -0
- package/dist/config/constant/config.constants.d.ts.map +1 -0
- package/dist/config/constant/config.constants.js +86 -0
- package/dist/config/constant/config.constants.js.map +1 -0
- package/dist/config/dto/config.dto.d.ts +222 -0
- package/dist/config/dto/config.dto.d.ts.map +1 -0
- package/dist/config/dto/config.dto.js +42 -0
- package/dist/config/dto/config.dto.js.map +1 -0
- package/dist/config/env-config.service.d.ts +147 -0
- package/dist/config/env-config.service.d.ts.map +1 -0
- package/dist/config/env-config.service.js +296 -0
- package/dist/config/env-config.service.js.map +1 -0
- package/dist/config/features/feature-errors.d.ts +13 -0
- package/dist/config/features/feature-errors.d.ts.map +1 -0
- package/dist/config/features/feature-errors.js +25 -0
- package/dist/config/features/feature-errors.js.map +1 -0
- package/dist/config/features/feature-registry.d.ts +26 -0
- package/dist/config/features/feature-registry.d.ts.map +1 -0
- package/dist/config/features/feature-registry.js +172 -0
- package/dist/config/features/feature-registry.js.map +1 -0
- package/dist/config/features/index.d.ts +4 -0
- package/dist/config/features/index.d.ts.map +1 -0
- package/dist/config/features/index.js +9 -0
- package/dist/config/features/index.js.map +1 -0
- package/dist/config/validation/env.validation.d.ts +132 -0
- package/dist/config/validation/env.validation.d.ts.map +1 -0
- package/dist/config/validation/env.validation.js +304 -0
- package/dist/config/validation/env.validation.js.map +1 -0
- package/dist/config/validation/index.d.ts +21 -0
- package/dist/config/validation/index.d.ts.map +1 -0
- package/dist/config/validation/index.js +119 -0
- package/dist/config/validation/index.js.map +1 -0
- package/dist/config/validation/keys.validation.d.ts +884 -0
- package/dist/config/validation/keys.validation.d.ts.map +1 -0
- package/dist/config/validation/keys.validation.js +506 -0
- package/dist/config/validation/keys.validation.js.map +1 -0
- package/dist/config/validation/yaml.validation.d.ts +765 -0
- package/dist/config/validation/yaml.validation.d.ts.map +1 -0
- package/dist/config/validation/yaml.validation.js +488 -0
- package/dist/config/validation/yaml.validation.js.map +1 -0
- package/dist/config/vendor.config.d.ts +48 -0
- package/dist/config/vendor.config.d.ts.map +1 -0
- package/dist/config/vendor.config.js +136 -0
- package/dist/config/vendor.config.js.map +1 -0
- package/dist/decorators/api-key/api-key.decorator.d.ts +25 -0
- package/dist/decorators/api-key/api-key.decorator.d.ts.map +1 -0
- package/dist/decorators/api-key/api-key.decorator.js +30 -0
- package/dist/decorators/api-key/api-key.decorator.js.map +1 -0
- package/dist/decorators/api-key/index.d.ts +2 -0
- package/dist/decorators/api-key/index.d.ts.map +1 -0
- package/dist/decorators/api-key/index.js +18 -0
- package/dist/decorators/api-key/index.js.map +1 -0
- package/dist/decorators/app-version/app-version.controller.d.ts +30 -0
- package/dist/decorators/app-version/app-version.controller.d.ts.map +1 -0
- package/dist/decorators/app-version/app-version.controller.js +159 -0
- package/dist/decorators/app-version/app-version.controller.js.map +1 -0
- package/dist/decorators/app-version/app-version.interceptor.d.ts +15 -0
- package/dist/decorators/app-version/app-version.interceptor.d.ts.map +1 -0
- package/dist/decorators/app-version/app-version.interceptor.js +42 -0
- package/dist/decorators/app-version/app-version.interceptor.js.map +1 -0
- package/dist/decorators/app-version/app-version.module.d.ts +8 -0
- package/dist/decorators/app-version/app-version.module.d.ts.map +1 -0
- package/dist/decorators/app-version/app-version.module.js +39 -0
- package/dist/decorators/app-version/app-version.module.js.map +1 -0
- package/dist/decorators/app-version/app-version.service.d.ts +88 -0
- package/dist/decorators/app-version/app-version.service.d.ts.map +1 -0
- package/dist/decorators/app-version/app-version.service.js +251 -0
- package/dist/decorators/app-version/app-version.service.js.map +1 -0
- package/dist/decorators/app-version/index.d.ts +8 -0
- package/dist/decorators/app-version/index.d.ts.map +1 -0
- package/dist/decorators/app-version/index.js +15 -0
- package/dist/decorators/app-version/index.js.map +1 -0
- package/dist/decorators/audit-log.decorator.d.ts +41 -0
- package/dist/decorators/audit-log.decorator.d.ts.map +1 -0
- package/dist/decorators/audit-log.decorator.js +19 -0
- package/dist/decorators/audit-log.decorator.js.map +1 -0
- package/dist/decorators/cache/cache.decorator.d.ts +256 -0
- package/dist/decorators/cache/cache.decorator.d.ts.map +1 -0
- package/dist/decorators/cache/cache.decorator.js +339 -0
- package/dist/decorators/cache/cache.decorator.js.map +1 -0
- package/dist/decorators/cache/cache.interceptor.d.ts +43 -0
- package/dist/decorators/cache/cache.interceptor.d.ts.map +1 -0
- package/dist/decorators/cache/cache.interceptor.js +219 -0
- package/dist/decorators/cache/cache.interceptor.js.map +1 -0
- package/dist/decorators/cache/cache.module.d.ts +9 -0
- package/dist/decorators/cache/cache.module.d.ts.map +1 -0
- package/dist/decorators/cache/cache.module.js +36 -0
- package/dist/decorators/cache/cache.module.js.map +1 -0
- package/dist/decorators/cache/index.d.ts +7 -0
- package/dist/decorators/cache/index.d.ts.map +1 -0
- package/dist/decorators/cache/index.js +32 -0
- package/dist/decorators/cache/index.js.map +1 -0
- package/dist/decorators/data-visibility/data-visibility.decorator.d.ts +74 -0
- package/dist/decorators/data-visibility/data-visibility.decorator.d.ts.map +1 -0
- package/dist/decorators/data-visibility/data-visibility.decorator.js +87 -0
- package/dist/decorators/data-visibility/data-visibility.decorator.js.map +1 -0
- package/dist/decorators/data-visibility/index.d.ts +2 -0
- package/dist/decorators/data-visibility/index.d.ts.map +1 -0
- package/dist/decorators/data-visibility/index.js +18 -0
- package/dist/decorators/data-visibility/index.js.map +1 -0
- package/dist/decorators/event/event.decorator.d.ts +152 -0
- package/dist/decorators/event/event.decorator.d.ts.map +1 -0
- package/dist/decorators/event/event.decorator.js +158 -0
- package/dist/decorators/event/event.decorator.js.map +1 -0
- package/dist/decorators/event/event.interceptor.d.ts +23 -0
- package/dist/decorators/event/event.interceptor.d.ts.map +1 -0
- package/dist/decorators/event/event.interceptor.js +140 -0
- package/dist/decorators/event/event.interceptor.js.map +1 -0
- package/dist/decorators/event/event.module.d.ts +9 -0
- package/dist/decorators/event/event.module.d.ts.map +1 -0
- package/dist/decorators/event/event.module.js +59 -0
- package/dist/decorators/event/event.module.js.map +1 -0
- package/dist/decorators/event/handlers/cache-event.handler.d.ts +55 -0
- package/dist/decorators/event/handlers/cache-event.handler.d.ts.map +1 -0
- package/dist/decorators/event/handlers/cache-event.handler.js +159 -0
- package/dist/decorators/event/handlers/cache-event.handler.js.map +1 -0
- package/dist/decorators/event/index.d.ts +8 -0
- package/dist/decorators/event/index.d.ts.map +1 -0
- package/dist/decorators/event/index.js +26 -0
- package/dist/decorators/event/index.js.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.decorator.d.ts +144 -0
- package/dist/decorators/feature-flag/feature-flag.decorator.d.ts.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.decorator.js +135 -0
- package/dist/decorators/feature-flag/feature-flag.decorator.js.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.interceptor.d.ts +30 -0
- package/dist/decorators/feature-flag/feature-flag.interceptor.d.ts.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.interceptor.js +127 -0
- package/dist/decorators/feature-flag/feature-flag.interceptor.js.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.module.d.ts +9 -0
- package/dist/decorators/feature-flag/feature-flag.module.d.ts.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.module.js +39 -0
- package/dist/decorators/feature-flag/feature-flag.module.js.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.service.d.ts +102 -0
- package/dist/decorators/feature-flag/feature-flag.service.d.ts.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.service.js +373 -0
- package/dist/decorators/feature-flag/feature-flag.service.js.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.service.spec.d.ts +2 -0
- package/dist/decorators/feature-flag/feature-flag.service.spec.d.ts.map +1 -0
- package/dist/decorators/feature-flag/feature-flag.service.spec.js +264 -0
- package/dist/decorators/feature-flag/feature-flag.service.spec.js.map +1 -0
- package/dist/decorators/feature-flag/index.d.ts +8 -0
- package/dist/decorators/feature-flag/index.d.ts.map +1 -0
- package/dist/decorators/feature-flag/index.js +23 -0
- package/dist/decorators/feature-flag/index.js.map +1 -0
- package/dist/decorators/rate-limit/dto/rate-limit.dto.d.ts +174 -0
- package/dist/decorators/rate-limit/dto/rate-limit.dto.d.ts.map +1 -0
- package/dist/decorators/rate-limit/dto/rate-limit.dto.js +8 -0
- package/dist/decorators/rate-limit/dto/rate-limit.dto.js.map +1 -0
- package/dist/decorators/rate-limit/index.d.ts +24 -0
- package/dist/decorators/rate-limit/index.d.ts.map +1 -0
- package/dist/decorators/rate-limit/index.js +44 -0
- package/dist/decorators/rate-limit/index.js.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.constants.d.ts +16 -0
- package/dist/decorators/rate-limit/rate-limit.constants.d.ts.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.constants.js +22 -0
- package/dist/decorators/rate-limit/rate-limit.constants.js.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.decorator.d.ts +132 -0
- package/dist/decorators/rate-limit/rate-limit.decorator.d.ts.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.decorator.js +185 -0
- package/dist/decorators/rate-limit/rate-limit.decorator.js.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.exception.d.ts +39 -0
- package/dist/decorators/rate-limit/rate-limit.exception.d.ts.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.exception.js +67 -0
- package/dist/decorators/rate-limit/rate-limit.exception.js.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.module.d.ts +25 -0
- package/dist/decorators/rate-limit/rate-limit.module.d.ts.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.module.js +48 -0
- package/dist/decorators/rate-limit/rate-limit.module.js.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.service.d.ts +102 -0
- package/dist/decorators/rate-limit/rate-limit.service.d.ts.map +1 -0
- package/dist/decorators/rate-limit/rate-limit.service.js +390 -0
- package/dist/decorators/rate-limit/rate-limit.service.js.map +1 -0
- package/dist/decorators/response.decorator.d.ts +10 -0
- package/dist/decorators/response.decorator.d.ts.map +1 -0
- package/dist/decorators/response.decorator.js +58 -0
- package/dist/decorators/response.decorator.js.map +1 -0
- package/dist/decorators/skip-version-check.decorator.d.ts +25 -0
- package/dist/decorators/skip-version-check.decorator.d.ts.map +1 -0
- package/dist/decorators/skip-version-check.decorator.js +31 -0
- package/dist/decorators/skip-version-check.decorator.js.map +1 -0
- package/dist/decorators/tenant/index.d.ts +2 -0
- package/dist/decorators/tenant/index.d.ts.map +1 -0
- package/dist/decorators/tenant/index.js +18 -0
- package/dist/decorators/tenant/index.js.map +1 -0
- package/dist/decorators/tenant/tenant.decorator.d.ts +82 -0
- package/dist/decorators/tenant/tenant.decorator.d.ts.map +1 -0
- package/dist/decorators/tenant/tenant.decorator.js +98 -0
- package/dist/decorators/tenant/tenant.decorator.js.map +1 -0
- package/dist/decorators/transaction/index.d.ts +6 -0
- package/dist/decorators/transaction/index.d.ts.map +1 -0
- package/dist/decorators/transaction/index.js +12 -0
- package/dist/decorators/transaction/index.js.map +1 -0
- package/dist/decorators/transaction/transactional.decorator.d.ts +234 -0
- package/dist/decorators/transaction/transactional.decorator.d.ts.map +1 -0
- package/dist/decorators/transaction/transactional.decorator.js +433 -0
- package/dist/decorators/transaction/transactional.decorator.js.map +1 -0
- package/dist/decorators/ts-rest-controller.decorator.d.ts +38 -0
- package/dist/decorators/ts-rest-controller.decorator.d.ts.map +1 -0
- package/dist/decorators/ts-rest-controller.decorator.js +25 -0
- package/dist/decorators/ts-rest-controller.decorator.js.map +1 -0
- package/dist/decorators/validation.decorator.d.ts +4 -0
- package/dist/decorators/validation.decorator.d.ts.map +1 -0
- package/dist/decorators/validation.decorator.js +121 -0
- package/dist/decorators/validation.decorator.js.map +1 -0
- package/dist/decorators/version/index.d.ts +7 -0
- package/dist/decorators/version/index.d.ts.map +1 -0
- package/dist/decorators/version/index.js +25 -0
- package/dist/decorators/version/index.js.map +1 -0
- package/dist/decorators/version/version.decorator.d.ts +96 -0
- package/dist/decorators/version/version.decorator.d.ts.map +1 -0
- package/dist/decorators/version/version.decorator.js +146 -0
- package/dist/decorators/version/version.decorator.js.map +1 -0
- package/dist/decorators/version/version.interceptor.d.ts +19 -0
- package/dist/decorators/version/version.interceptor.d.ts.map +1 -0
- package/dist/decorators/version/version.interceptor.js +86 -0
- package/dist/decorators/version/version.interceptor.js.map +1 -0
- package/dist/decorators/version/version.module.d.ts +8 -0
- package/dist/decorators/version/version.module.d.ts.map +1 -0
- package/dist/decorators/version/version.module.js +33 -0
- package/dist/decorators/version/version.module.js.map +1 -0
- package/dist/encryption.service.d.ts +15 -0
- package/dist/encryption.service.d.ts.map +1 -0
- package/dist/encryption.service.js +35 -0
- package/dist/encryption.service.js.map +1 -0
- package/dist/enums/action.enum.d.ts +8 -0
- package/dist/enums/action.enum.d.ts.map +1 -0
- package/dist/enums/action.enum.js +12 -0
- package/dist/enums/action.enum.js.map +1 -0
- package/dist/enums/error-codes.d.ts +33 -0
- package/dist/enums/error-codes.d.ts.map +1 -0
- package/dist/enums/error-codes.js +52 -0
- package/dist/enums/error-codes.js.map +1 -0
- package/dist/enums/role.enum.d.ts +5 -0
- package/dist/enums/role.enum.d.ts.map +1 -0
- package/dist/enums/role.enum.js +9 -0
- package/dist/enums/role.enum.js.map +1 -0
- package/dist/filter/exception/api.exception.d.ts +77 -0
- package/dist/filter/exception/api.exception.d.ts.map +1 -0
- package/dist/filter/exception/api.exception.js +151 -0
- package/dist/filter/exception/api.exception.js.map +1 -0
- package/dist/filter/exception/exception.d.ts +8 -0
- package/dist/filter/exception/exception.d.ts.map +1 -0
- package/dist/filter/exception/exception.js +50 -0
- package/dist/filter/exception/exception.js.map +1 -0
- package/dist/filter/exception/http.exception.d.ts +11 -0
- package/dist/filter/exception/http.exception.d.ts.map +1 -0
- package/dist/filter/exception/http.exception.js +152 -0
- package/dist/filter/exception/http.exception.js.map +1 -0
- package/dist/guards/api-key.guard.d.ts +42 -0
- package/dist/guards/api-key.guard.d.ts.map +1 -0
- package/dist/guards/api-key.guard.js +159 -0
- package/dist/guards/api-key.guard.js.map +1 -0
- package/dist/guards/auth.guard.d.ts +39 -0
- package/dist/guards/auth.guard.d.ts.map +1 -0
- package/dist/guards/auth.guard.js +178 -0
- package/dist/guards/auth.guard.js.map +1 -0
- package/dist/guards/data-visibility.guard.d.ts +18 -0
- package/dist/guards/data-visibility.guard.d.ts.map +1 -0
- package/dist/guards/data-visibility.guard.js +84 -0
- package/dist/guards/data-visibility.guard.js.map +1 -0
- package/dist/guards/index.d.ts +7 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +23 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/guards/permission.guard.d.ts +20 -0
- package/dist/guards/permission.guard.d.ts.map +1 -0
- package/dist/guards/permission.guard.js +141 -0
- package/dist/guards/permission.guard.js.map +1 -0
- package/dist/guards/tenant-context.guard.d.ts +12 -0
- package/dist/guards/tenant-context.guard.d.ts.map +1 -0
- package/dist/guards/tenant-context.guard.js +94 -0
- package/dist/guards/tenant-context.guard.js.map +1 -0
- package/dist/guards/version.guard.d.ts +100 -0
- package/dist/guards/version.guard.d.ts.map +1 -0
- package/dist/guards/version.guard.js +233 -0
- package/dist/guards/version.guard.js.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptor/audit/audit-log.interceptor.d.ts +16 -0
- package/dist/interceptor/audit/audit-log.interceptor.d.ts.map +1 -0
- package/dist/interceptor/audit/audit-log.interceptor.js +156 -0
- package/dist/interceptor/audit/audit-log.interceptor.js.map +1 -0
- package/dist/interceptor/audit/index.d.ts +2 -0
- package/dist/interceptor/audit/index.d.ts.map +1 -0
- package/dist/interceptor/audit/index.js +18 -0
- package/dist/interceptor/audit/index.js.map +1 -0
- package/dist/interceptor/mask/index.d.ts +2 -0
- package/dist/interceptor/mask/index.d.ts.map +1 -0
- package/dist/interceptor/mask/index.js +18 -0
- package/dist/interceptor/mask/index.js.map +1 -0
- package/dist/interceptor/mask/mask.interceptor.d.ts +79 -0
- package/dist/interceptor/mask/mask.interceptor.d.ts.map +1 -0
- package/dist/interceptor/mask/mask.interceptor.js +197 -0
- package/dist/interceptor/mask/mask.interceptor.js.map +1 -0
- package/dist/interceptor/rate-limit/no-rate-limit.interceptor.d.ts +6 -0
- package/dist/interceptor/rate-limit/no-rate-limit.interceptor.d.ts.map +1 -0
- package/dist/interceptor/rate-limit/no-rate-limit.interceptor.js +20 -0
- package/dist/interceptor/rate-limit/no-rate-limit.interceptor.js.map +1 -0
- package/dist/interceptor/rate-limit/rate-limit.interceptor.d.ts +45 -0
- package/dist/interceptor/rate-limit/rate-limit.interceptor.d.ts.map +1 -0
- package/dist/interceptor/rate-limit/rate-limit.interceptor.js +193 -0
- package/dist/interceptor/rate-limit/rate-limit.interceptor.js.map +1 -0
- package/dist/interceptor/transform/transform.interceptor.d.ts +37 -0
- package/dist/interceptor/transform/transform.interceptor.d.ts.map +1 -0
- package/dist/interceptor/transform/transform.interceptor.js +72 -0
- package/dist/interceptor/transform/transform.interceptor.js.map +1 -0
- package/dist/interceptor/transform/transform.interceptor.spec.d.ts +2 -0
- package/dist/interceptor/transform/transform.interceptor.spec.d.ts.map +1 -0
- package/dist/interceptor/transform/transform.interceptor.spec.js +9 -0
- package/dist/interceptor/transform/transform.interceptor.spec.js.map +1 -0
- package/dist/interceptor/version/index.d.ts +2 -0
- package/dist/interceptor/version/index.d.ts.map +1 -0
- package/dist/interceptor/version/index.js +18 -0
- package/dist/interceptor/version/index.js.map +1 -0
- package/dist/interceptor/version/version-header.interceptor.d.ts +31 -0
- package/dist/interceptor/version/version-header.interceptor.d.ts.map +1 -0
- package/dist/interceptor/version/version-header.interceptor.js +62 -0
- package/dist/interceptor/version/version-header.interceptor.js.map +1 -0
- package/dist/middleware/request.middleware.d.ts +27 -0
- package/dist/middleware/request.middleware.d.ts.map +1 -0
- package/dist/middleware/request.middleware.js +141 -0
- package/dist/middleware/request.middleware.js.map +1 -0
- package/dist/middleware/tenant-isolation.middleware.d.ts +12 -0
- package/dist/middleware/tenant-isolation.middleware.d.ts.map +1 -0
- package/dist/middleware/tenant-isolation.middleware.js +51 -0
- package/dist/middleware/tenant-isolation.middleware.js.map +1 -0
- package/dist/pipes/transform-root.pipe.d.ts +5 -0
- package/dist/pipes/transform-root.pipe.d.ts.map +1 -0
- package/dist/pipes/transform-root.pipe.js +24 -0
- package/dist/pipes/transform-root.pipe.js.map +1 -0
- package/dist/ts-rest/index.d.ts +36 -0
- package/dist/ts-rest/index.d.ts.map +1 -0
- package/dist/ts-rest/index.js +65 -0
- package/dist/ts-rest/index.js.map +1 -0
- package/dist/ts-rest/response.helper.d.ts +261 -0
- package/dist/ts-rest/response.helper.d.ts.map +1 -0
- package/dist/ts-rest/response.helper.js +372 -0
- package/dist/ts-rest/response.helper.js.map +1 -0
- package/dist/utils/audit-log-helper.util.d.ts +41 -0
- package/dist/utils/audit-log-helper.util.d.ts.map +1 -0
- package/dist/utils/audit-log-helper.util.js +115 -0
- package/dist/utils/audit-log-helper.util.js.map +1 -0
- package/dist/utils/audit-signature.util.d.ts +64 -0
- package/dist/utils/audit-signature.util.d.ts.map +1 -0
- package/dist/utils/audit-signature.util.js +155 -0
- package/dist/utils/audit-signature.util.js.map +1 -0
- package/dist/utils/prisma-error.util.d.ts +160 -0
- package/dist/utils/prisma-error.util.d.ts.map +1 -0
- package/dist/utils/prisma-error.util.js +342 -0
- package/dist/utils/prisma-error.util.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.module.js","sourceRoot":"","sources":["../../../src/decorators/cache/cache.module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;AAEH,2CAAgD;AAChD,uCAA+C;AAC/C,mDAAgD;AAChD,2DAAuD;AAahD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IAXhC,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAW,CAAC;QACtB,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,oCAAgB;aAC3B;SACF;QACD,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,oBAAoB,CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Decorators Module Exports
|
|
3
|
+
*/
|
|
4
|
+
export { Cacheable, CacheEvict, CachePut, CacheOptions, CacheEvictOptions, HierarchicalKeyConfig, defaultKeyGenerator, objectKeyGenerator, compositeKeyGenerator, hierarchicalKeyGenerator, simpleHierarchicalKeyGenerator, userKeyGenerator, spaceKeyGenerator, hashObject, hashParams, CACHE_METADATA_KEY, CACHE_EVICT_METADATA_KEY, CACHE_PUT_METADATA_KEY, } from './cache.decorator';
|
|
5
|
+
export { CacheInterceptor } from './cache.interceptor';
|
|
6
|
+
export { CacheDecoratorModule } from './cache.module';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/cache/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,SAAS,EACT,UAAU,EACV,QAAQ,EAER,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EAErB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EAErB,wBAAwB,EACxB,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EAEjB,UAAU,EACV,UAAU,EAEV,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cache Decorators Module Exports
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CacheDecoratorModule = exports.CacheInterceptor = exports.CACHE_PUT_METADATA_KEY = exports.CACHE_EVICT_METADATA_KEY = exports.CACHE_METADATA_KEY = exports.hashParams = exports.hashObject = exports.spaceKeyGenerator = exports.userKeyGenerator = exports.simpleHierarchicalKeyGenerator = exports.hierarchicalKeyGenerator = exports.compositeKeyGenerator = exports.objectKeyGenerator = exports.defaultKeyGenerator = exports.CachePut = exports.CacheEvict = exports.Cacheable = void 0;
|
|
7
|
+
var cache_decorator_1 = require("./cache.decorator");
|
|
8
|
+
// Decorators
|
|
9
|
+
Object.defineProperty(exports, "Cacheable", { enumerable: true, get: function () { return cache_decorator_1.Cacheable; } });
|
|
10
|
+
Object.defineProperty(exports, "CacheEvict", { enumerable: true, get: function () { return cache_decorator_1.CacheEvict; } });
|
|
11
|
+
Object.defineProperty(exports, "CachePut", { enumerable: true, get: function () { return cache_decorator_1.CachePut; } });
|
|
12
|
+
// Key Generators - Basic
|
|
13
|
+
Object.defineProperty(exports, "defaultKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.defaultKeyGenerator; } });
|
|
14
|
+
Object.defineProperty(exports, "objectKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.objectKeyGenerator; } });
|
|
15
|
+
Object.defineProperty(exports, "compositeKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.compositeKeyGenerator; } });
|
|
16
|
+
// Key Generators - Hierarchical (支持分层缓存)
|
|
17
|
+
Object.defineProperty(exports, "hierarchicalKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.hierarchicalKeyGenerator; } });
|
|
18
|
+
Object.defineProperty(exports, "simpleHierarchicalKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.simpleHierarchicalKeyGenerator; } });
|
|
19
|
+
Object.defineProperty(exports, "userKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.userKeyGenerator; } });
|
|
20
|
+
Object.defineProperty(exports, "spaceKeyGenerator", { enumerable: true, get: function () { return cache_decorator_1.spaceKeyGenerator; } });
|
|
21
|
+
// Hash Utilities
|
|
22
|
+
Object.defineProperty(exports, "hashObject", { enumerable: true, get: function () { return cache_decorator_1.hashObject; } });
|
|
23
|
+
Object.defineProperty(exports, "hashParams", { enumerable: true, get: function () { return cache_decorator_1.hashParams; } });
|
|
24
|
+
// Metadata Keys
|
|
25
|
+
Object.defineProperty(exports, "CACHE_METADATA_KEY", { enumerable: true, get: function () { return cache_decorator_1.CACHE_METADATA_KEY; } });
|
|
26
|
+
Object.defineProperty(exports, "CACHE_EVICT_METADATA_KEY", { enumerable: true, get: function () { return cache_decorator_1.CACHE_EVICT_METADATA_KEY; } });
|
|
27
|
+
Object.defineProperty(exports, "CACHE_PUT_METADATA_KEY", { enumerable: true, get: function () { return cache_decorator_1.CACHE_PUT_METADATA_KEY; } });
|
|
28
|
+
var cache_interceptor_1 = require("./cache.interceptor");
|
|
29
|
+
Object.defineProperty(exports, "CacheInterceptor", { enumerable: true, get: function () { return cache_interceptor_1.CacheInterceptor; } });
|
|
30
|
+
var cache_module_1 = require("./cache.module");
|
|
31
|
+
Object.defineProperty(exports, "CacheDecoratorModule", { enumerable: true, get: function () { return cache_module_1.CacheDecoratorModule; } });
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/cache/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qDAyB2B;AAxBzB,aAAa;AACb,4GAAA,SAAS,OAAA;AACT,6GAAA,UAAU,OAAA;AACV,2GAAA,QAAQ,OAAA;AAKR,yBAAyB;AACzB,sHAAA,mBAAmB,OAAA;AACnB,qHAAA,kBAAkB,OAAA;AAClB,wHAAA,qBAAqB,OAAA;AACrB,yCAAyC;AACzC,2HAAA,wBAAwB,OAAA;AACxB,iIAAA,8BAA8B,OAAA;AAC9B,mHAAA,gBAAgB,OAAA;AAChB,oHAAA,iBAAiB,OAAA;AACjB,iBAAiB;AACjB,6GAAA,UAAU,OAAA;AACV,6GAAA,UAAU,OAAA;AACV,gBAAgB;AAChB,qHAAA,kBAAkB,OAAA;AAClB,2HAAA,wBAAwB,OAAA;AACxB,yHAAA,sBAAsB,OAAA;AAGxB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,+CAAsD;AAA7C,oHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ResourceType, Permission } from '@dofe/infra-contracts';
|
|
2
|
+
/**
|
|
3
|
+
* 数据可见性元数据键
|
|
4
|
+
*/
|
|
5
|
+
export declare const DATA_VISIBILITY_KEY = "data_visibility_resource_type";
|
|
6
|
+
/**
|
|
7
|
+
* 数据可见性装饰器
|
|
8
|
+
*
|
|
9
|
+
* 标记端点需要注入数据可见性范围,自动根据用户角色解析 DataScope
|
|
10
|
+
*
|
|
11
|
+
* @param resourceType 资源类型
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* @DataVisibility('bot')
|
|
16
|
+
* async listBots(@ReqDataScope() scope: DataScope) {
|
|
17
|
+
* // scope 已自动注入
|
|
18
|
+
* return this.botService.list({ ...scope });
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const DataVisibility: (resourceType: ResourceType) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 数据可见性参数装饰器
|
|
25
|
+
*
|
|
26
|
+
* 从请求中提取已解析的数据可见性范围
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* async list(@ReqDataScope() scope: DataScope) {
|
|
31
|
+
* // scope.type: 'tenant' | 'department_tree' | 'department' | 'team' | 'user'
|
|
32
|
+
* // scope.departmentIds, scope.teamIds, scope.userId 根据类型不同而不同
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const ReqDataScope: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
37
|
+
/**
|
|
38
|
+
* 组织权限 API 装饰器
|
|
39
|
+
*
|
|
40
|
+
* 组合认证、租户上下文、权限检查和数据可见性注入
|
|
41
|
+
* 适用于需要基于组织架构进行数据隔离的 API
|
|
42
|
+
*
|
|
43
|
+
* @param permissions 需要的权限
|
|
44
|
+
* @param resourceType 资源类型(用于数据可见性)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* @OrganizationApi(PERMISSION.BOT_READ, 'bot')
|
|
49
|
+
* async listBots(@ReqDataScope() scope: DataScope) {
|
|
50
|
+
* return this.botService.list(scope);
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const OrganizationApi: (permissions: Permission | Permission[], resourceType: ResourceType) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* 安全资源装饰器
|
|
57
|
+
*
|
|
58
|
+
* 组合权限检查和数据可见性注入
|
|
59
|
+
* 等同于设计文档中的 SecureResource
|
|
60
|
+
*
|
|
61
|
+
* @param permissions 需要的权限
|
|
62
|
+
* @param resourceType 资源类型(用于数据可见性)
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* @SecureResource(['bot:delete'], 'bot')
|
|
67
|
+
* async deleteBot(@ReqDataScope() scope: DataScope) {
|
|
68
|
+
* // 先检查权限,再检查数据归属
|
|
69
|
+
* return this.botService.delete(scope);
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare const SecureResource: (permissions: Permission | Permission[], resourceType: ResourceType) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
74
|
+
//# sourceMappingURL=data-visibility.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-visibility.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/data-visibility/data-visibility.decorator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAa,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOjF;;GAEG;AACH,eAAO,MAAM,mBAAmB,kCAAkC,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,GAAI,cAAc,YAAY,gJAItD,CAAC;AAEJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,mDAKxB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,UAAU,GAAG,UAAU,EAAE,EACtC,cAAc,YAAY,gJAczB,CAAC;AAEJ;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,gBAnCZ,UAAU,GAAG,UAAU,EAAE,gBACxB,YAAY,gJAkCiB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecureResource = exports.OrganizationApi = exports.ReqDataScope = exports.DataVisibility = exports.DATA_VISIBILITY_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const infra_contracts_1 = require("@dofe/infra-contracts");
|
|
6
|
+
const guards_1 = require("@/common/guards");
|
|
7
|
+
const tenant_context_guard_1 = require("@/common/guards/tenant-context.guard");
|
|
8
|
+
const permission_guard_1 = require("@/common/guards/permission.guard");
|
|
9
|
+
const data_visibility_guard_1 = require("@/common/guards/data-visibility.guard");
|
|
10
|
+
/**
|
|
11
|
+
* 数据可见性元数据键
|
|
12
|
+
*/
|
|
13
|
+
exports.DATA_VISIBILITY_KEY = 'data_visibility_resource_type';
|
|
14
|
+
/**
|
|
15
|
+
* 数据可见性装饰器
|
|
16
|
+
*
|
|
17
|
+
* 标记端点需要注入数据可见性范围,自动根据用户角色解析 DataScope
|
|
18
|
+
*
|
|
19
|
+
* @param resourceType 资源类型
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* @DataVisibility('bot')
|
|
24
|
+
* async listBots(@ReqDataScope() scope: DataScope) {
|
|
25
|
+
* // scope 已自动注入
|
|
26
|
+
* return this.botService.list({ ...scope });
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const DataVisibility = (resourceType) => (0, common_1.applyDecorators)((0, common_1.SetMetadata)(exports.DATA_VISIBILITY_KEY, resourceType), (0, common_1.UseGuards)(guards_1.AuthGuard, tenant_context_guard_1.TenantContextGuard, data_visibility_guard_1.DataVisibilityGuard));
|
|
31
|
+
exports.DataVisibility = DataVisibility;
|
|
32
|
+
/**
|
|
33
|
+
* 数据可见性参数装饰器
|
|
34
|
+
*
|
|
35
|
+
* 从请求中提取已解析的数据可见性范围
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* async list(@ReqDataScope() scope: DataScope) {
|
|
40
|
+
* // scope.type: 'tenant' | 'department_tree' | 'department' | 'team' | 'user'
|
|
41
|
+
* // scope.departmentIds, scope.teamIds, scope.userId 根据类型不同而不同
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
exports.ReqDataScope = (0, common_1.createParamDecorator)((_data, ctx) => {
|
|
46
|
+
const request = ctx.switchToHttp().getRequest();
|
|
47
|
+
return request.dataScope;
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* 组织权限 API 装饰器
|
|
51
|
+
*
|
|
52
|
+
* 组合认证、租户上下文、权限检查和数据可见性注入
|
|
53
|
+
* 适用于需要基于组织架构进行数据隔离的 API
|
|
54
|
+
*
|
|
55
|
+
* @param permissions 需要的权限
|
|
56
|
+
* @param resourceType 资源类型(用于数据可见性)
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* @OrganizationApi(PERMISSION.BOT_READ, 'bot')
|
|
61
|
+
* async listBots(@ReqDataScope() scope: DataScope) {
|
|
62
|
+
* return this.botService.list(scope);
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
const OrganizationApi = (permissions, resourceType) => (0, common_1.applyDecorators)((0, common_1.SetMetadata)(infra_contracts_1.REQUIRE_PERMISSIONS_KEY, Array.isArray(permissions) ? permissions : [permissions]), (0, common_1.SetMetadata)(exports.DATA_VISIBILITY_KEY, resourceType), (0, common_1.UseGuards)(guards_1.AuthGuard, tenant_context_guard_1.TenantContextGuard, permission_guard_1.PermissionGuard, data_visibility_guard_1.DataVisibilityGuard));
|
|
67
|
+
exports.OrganizationApi = OrganizationApi;
|
|
68
|
+
/**
|
|
69
|
+
* 安全资源装饰器
|
|
70
|
+
*
|
|
71
|
+
* 组合权限检查和数据可见性注入
|
|
72
|
+
* 等同于设计文档中的 SecureResource
|
|
73
|
+
*
|
|
74
|
+
* @param permissions 需要的权限
|
|
75
|
+
* @param resourceType 资源类型(用于数据可见性)
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* @SecureResource(['bot:delete'], 'bot')
|
|
80
|
+
* async deleteBot(@ReqDataScope() scope: DataScope) {
|
|
81
|
+
* // 先检查权限,再检查数据归属
|
|
82
|
+
* return this.botService.delete(scope);
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
exports.SecureResource = exports.OrganizationApi;
|
|
87
|
+
//# sourceMappingURL=data-visibility.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-visibility.decorator.js","sourceRoot":"","sources":["../../../src/decorators/data-visibility/data-visibility.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAMwB;AAExB,2DAAgE;AAChE,4CAA4C;AAC5C,+EAA0E;AAC1E,uEAAmE;AACnE,iFAA4E;AAE5E;;GAEG;AACU,QAAA,mBAAmB,GAAG,+BAA+B,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACI,MAAM,cAAc,GAAG,CAAC,YAA0B,EAAE,EAAE,CAC3D,IAAA,wBAAe,EACb,IAAA,oBAAW,EAAC,2BAAmB,EAAE,YAAY,CAAC,EAC9C,IAAA,kBAAS,EAAC,kBAAS,EAAE,yCAAkB,EAAE,2CAAmB,CAAC,CAC9D,CAAC;AAJS,QAAA,cAAc,kBAIvB;AAEJ;;;;;;;;;;;;GAYG;AACU,QAAA,YAAY,GAAG,IAAA,6BAAoB,EAC9C,CAAC,KAAc,EAAE,GAAqB,EAAyB,EAAE;IAC/D,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,SAAS,CAAC;AAC3B,CAAC,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,eAAe,GAAG,CAC7B,WAAsC,EACtC,YAA0B,EAC1B,EAAE,CACF,IAAA,wBAAe,EACb,IAAA,oBAAW,EACT,yCAAuB,EACvB,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CACzD,EACD,IAAA,oBAAW,EAAC,2BAAmB,EAAE,YAAY,CAAC,EAC9C,IAAA,kBAAS,EACP,kBAAS,EACT,yCAAkB,EAClB,kCAAe,EACf,2CAAmB,CACpB,CACF,CAAC;AAhBS,QAAA,eAAe,mBAgBxB;AAEJ;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,cAAc,GAAG,uBAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/data-visibility/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./data-visibility.decorator"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/data-visibility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Decorators
|
|
3
|
+
*
|
|
4
|
+
* 提供方法级别的事件装饰器,用于解耦业务逻辑。
|
|
5
|
+
* 支持同步和异步事件触发,与 NestJS EventEmitter 深度融合。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // 触发事件 - 方法执行后触发
|
|
10
|
+
* @EmitEvent('user.updated')
|
|
11
|
+
* async updateUser(userId: string, data: any) { ... }
|
|
12
|
+
*
|
|
13
|
+
* // 监听事件
|
|
14
|
+
* @OnEvent('user.updated')
|
|
15
|
+
* async handleUserUpdated(payload: UserUpdatedPayload) { ... }
|
|
16
|
+
*
|
|
17
|
+
* // 条件触发
|
|
18
|
+
* @EmitEvent('user.created', { condition: (result) => result !== null })
|
|
19
|
+
* async createUser(data: any) { ... }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const EMIT_EVENT_METADATA_KEY = "event:emit";
|
|
23
|
+
export declare const EMIT_EVENTS_METADATA_KEY = "event:emit:multiple";
|
|
24
|
+
/**
|
|
25
|
+
* 系统事件名称常量
|
|
26
|
+
* 使用点号分隔的命名约定: domain.action
|
|
27
|
+
*/
|
|
28
|
+
export declare const EventNames: {
|
|
29
|
+
readonly USER: {
|
|
30
|
+
readonly CREATED: "user.created";
|
|
31
|
+
readonly UPDATED: "user.updated";
|
|
32
|
+
readonly DELETED: "user.deleted";
|
|
33
|
+
readonly LOGIN: "user.login";
|
|
34
|
+
readonly LOGOUT: "user.logout";
|
|
35
|
+
readonly PASSWORD_CHANGED: "user.password.changed";
|
|
36
|
+
};
|
|
37
|
+
readonly CACHE: {
|
|
38
|
+
readonly INVALIDATED: "cache.invalidated";
|
|
39
|
+
readonly REFRESHED: "cache.refreshed";
|
|
40
|
+
};
|
|
41
|
+
readonly AUTH: {
|
|
42
|
+
readonly TOKEN_CREATED: "auth.token.created";
|
|
43
|
+
readonly TOKEN_REFRESHED: "auth.token.refreshed";
|
|
44
|
+
readonly TOKEN_REVOKED: "auth.token.revoked";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 事件发射配置选项
|
|
49
|
+
*/
|
|
50
|
+
export interface EmitEventOptions {
|
|
51
|
+
/** 事件名称 */
|
|
52
|
+
eventName: string;
|
|
53
|
+
/**
|
|
54
|
+
* 是否异步触发 (不阻塞方法返回)
|
|
55
|
+
* 默认: true
|
|
56
|
+
*/
|
|
57
|
+
async?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 是否在方法执行前触发
|
|
60
|
+
* 默认: false (方法执行后触发)
|
|
61
|
+
*/
|
|
62
|
+
beforeInvocation?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 条件表达式 - 决定是否触发事件
|
|
65
|
+
* 接收方法返回值,返回 true 则触发
|
|
66
|
+
* 默认: 总是触发
|
|
67
|
+
*/
|
|
68
|
+
condition?: (result: any, args: any[]) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* 自定义 payload 生成器
|
|
71
|
+
* 接收方法参数和返回值,返回事件 payload
|
|
72
|
+
* 默认: { args, result }
|
|
73
|
+
*/
|
|
74
|
+
payloadGenerator?: (args: any[], result: any) => any;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 事件 Payload 基础类型
|
|
78
|
+
*/
|
|
79
|
+
export interface BaseEventPayload<T = any> {
|
|
80
|
+
/** 事件触发时间 */
|
|
81
|
+
timestamp: Date;
|
|
82
|
+
/** 方法参数 */
|
|
83
|
+
args: any[];
|
|
84
|
+
/** 方法返回值 */
|
|
85
|
+
result: T;
|
|
86
|
+
/** 额外上下文 */
|
|
87
|
+
context?: Record<string, any>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @EmitEvent - 方法执行后触发事件
|
|
91
|
+
*
|
|
92
|
+
* @param eventName - 事件名称
|
|
93
|
+
* @param options - 可选配置
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* @EmitEvent(EventNames.USER.UPDATED)
|
|
98
|
+
* async updateUser(userId: string, data: any) {
|
|
99
|
+
* return await this.prisma.userInfo.update({ where: { id: userId }, data });
|
|
100
|
+
* }
|
|
101
|
+
*
|
|
102
|
+
* @EmitEvent(EventNames.USER.CREATED, {
|
|
103
|
+
* condition: (result) => result !== null,
|
|
104
|
+
* payloadGenerator: (args, result) => ({ userId: result.id, email: result.email }),
|
|
105
|
+
* })
|
|
106
|
+
* async createUser(data: CreateUserDto) { ... }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare function EmitEvent(eventName: string, options?: Partial<Omit<EmitEventOptions, 'eventName'>>): MethodDecorator;
|
|
110
|
+
/**
|
|
111
|
+
* @EmitEvents - 方法执行后触发多个事件
|
|
112
|
+
*
|
|
113
|
+
* @param events - 事件配置数组
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* @EmitEvents([
|
|
118
|
+
* { eventName: EventNames.USER.UPDATED },
|
|
119
|
+
* { eventName: EventNames.CACHE.INVALIDATED, payloadGenerator: (args) => ({ key: `user:${args[0]}` }) },
|
|
120
|
+
* ])
|
|
121
|
+
* async updateUser(userId: string, data: any) { ... }
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare function EmitEvents(events: Array<{
|
|
125
|
+
eventName: string;
|
|
126
|
+
options?: Partial<Omit<EmitEventOptions, 'eventName'>>;
|
|
127
|
+
}>): MethodDecorator;
|
|
128
|
+
/**
|
|
129
|
+
* 默认 payload 生成器
|
|
130
|
+
*/
|
|
131
|
+
export declare function defaultPayloadGenerator(args: any[], result: any): BaseEventPayload;
|
|
132
|
+
/**
|
|
133
|
+
* 用户事件 payload 生成器
|
|
134
|
+
*/
|
|
135
|
+
export declare function userEventPayloadGenerator(args: any[], result: any): {
|
|
136
|
+
timestamp: Date;
|
|
137
|
+
userId: any;
|
|
138
|
+
user: any;
|
|
139
|
+
args: any[];
|
|
140
|
+
result: any;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* 缓存失效事件 payload 生成器
|
|
144
|
+
*/
|
|
145
|
+
export declare function cacheInvalidatePayloadGenerator(cacheName: string, keyGenerator?: (...args: any[]) => string): (args: any[], result: any) => {
|
|
146
|
+
timestamp: Date;
|
|
147
|
+
cacheName: string;
|
|
148
|
+
cacheKey: any;
|
|
149
|
+
args: any[];
|
|
150
|
+
result: any;
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=event.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/event/event.decorator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAM9D;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAqBb,CAAC;AAMX;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW;IACX,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC;IAElD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,GAAG;IACvC,aAAa;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW;IACX,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,YAAY;IACZ,MAAM,EAAE,CAAC,CAAC;IACV,YAAY;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,GACrD,eAAe,CASjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;CACxD,CAAC,GACD,eAAe,CASjB;AAMD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,GAAG,EAAE,EACX,MAAM,EAAE,GAAG,GACV,gBAAgB,CAMlB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG;;;;;;EASjE;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,IAEjC,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG;;;;;;EAOjC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Event Decorators
|
|
4
|
+
*
|
|
5
|
+
* 提供方法级别的事件装饰器,用于解耦业务逻辑。
|
|
6
|
+
* 支持同步和异步事件触发,与 NestJS EventEmitter 深度融合。
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // 触发事件 - 方法执行后触发
|
|
11
|
+
* @EmitEvent('user.updated')
|
|
12
|
+
* async updateUser(userId: string, data: any) { ... }
|
|
13
|
+
*
|
|
14
|
+
* // 监听事件
|
|
15
|
+
* @OnEvent('user.updated')
|
|
16
|
+
* async handleUserUpdated(payload: UserUpdatedPayload) { ... }
|
|
17
|
+
*
|
|
18
|
+
* // 条件触发
|
|
19
|
+
* @EmitEvent('user.created', { condition: (result) => result !== null })
|
|
20
|
+
* async createUser(data: any) { ... }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.EventNames = exports.EMIT_EVENTS_METADATA_KEY = exports.EMIT_EVENT_METADATA_KEY = void 0;
|
|
25
|
+
exports.EmitEvent = EmitEvent;
|
|
26
|
+
exports.EmitEvents = EmitEvents;
|
|
27
|
+
exports.defaultPayloadGenerator = defaultPayloadGenerator;
|
|
28
|
+
exports.userEventPayloadGenerator = userEventPayloadGenerator;
|
|
29
|
+
exports.cacheInvalidatePayloadGenerator = cacheInvalidatePayloadGenerator;
|
|
30
|
+
const common_1 = require("@nestjs/common");
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Metadata Keys
|
|
33
|
+
// ============================================================================
|
|
34
|
+
exports.EMIT_EVENT_METADATA_KEY = 'event:emit';
|
|
35
|
+
exports.EMIT_EVENTS_METADATA_KEY = 'event:emit:multiple';
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Event Names (建议统一在此定义)
|
|
38
|
+
// ============================================================================
|
|
39
|
+
/**
|
|
40
|
+
* 系统事件名称常量
|
|
41
|
+
* 使用点号分隔的命名约定: domain.action
|
|
42
|
+
*/
|
|
43
|
+
exports.EventNames = {
|
|
44
|
+
// 用户相关事件
|
|
45
|
+
USER: {
|
|
46
|
+
CREATED: 'user.created',
|
|
47
|
+
UPDATED: 'user.updated',
|
|
48
|
+
DELETED: 'user.deleted',
|
|
49
|
+
LOGIN: 'user.login',
|
|
50
|
+
LOGOUT: 'user.logout',
|
|
51
|
+
PASSWORD_CHANGED: 'user.password.changed',
|
|
52
|
+
},
|
|
53
|
+
// 缓存相关事件
|
|
54
|
+
CACHE: {
|
|
55
|
+
INVALIDATED: 'cache.invalidated',
|
|
56
|
+
REFRESHED: 'cache.refreshed',
|
|
57
|
+
},
|
|
58
|
+
// 认证相关事件
|
|
59
|
+
AUTH: {
|
|
60
|
+
TOKEN_CREATED: 'auth.token.created',
|
|
61
|
+
TOKEN_REFRESHED: 'auth.token.refreshed',
|
|
62
|
+
TOKEN_REVOKED: 'auth.token.revoked',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// Decorators
|
|
67
|
+
// ============================================================================
|
|
68
|
+
/**
|
|
69
|
+
* @EmitEvent - 方法执行后触发事件
|
|
70
|
+
*
|
|
71
|
+
* @param eventName - 事件名称
|
|
72
|
+
* @param options - 可选配置
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* @EmitEvent(EventNames.USER.UPDATED)
|
|
77
|
+
* async updateUser(userId: string, data: any) {
|
|
78
|
+
* return await this.prisma.userInfo.update({ where: { id: userId }, data });
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* @EmitEvent(EventNames.USER.CREATED, {
|
|
82
|
+
* condition: (result) => result !== null,
|
|
83
|
+
* payloadGenerator: (args, result) => ({ userId: result.id, email: result.email }),
|
|
84
|
+
* })
|
|
85
|
+
* async createUser(data: CreateUserDto) { ... }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
function EmitEvent(eventName, options) {
|
|
89
|
+
const eventOptions = {
|
|
90
|
+
eventName,
|
|
91
|
+
async: true,
|
|
92
|
+
beforeInvocation: false,
|
|
93
|
+
...options,
|
|
94
|
+
};
|
|
95
|
+
return (0, common_1.SetMetadata)(exports.EMIT_EVENT_METADATA_KEY, eventOptions);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @EmitEvents - 方法执行后触发多个事件
|
|
99
|
+
*
|
|
100
|
+
* @param events - 事件配置数组
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* @EmitEvents([
|
|
105
|
+
* { eventName: EventNames.USER.UPDATED },
|
|
106
|
+
* { eventName: EventNames.CACHE.INVALIDATED, payloadGenerator: (args) => ({ key: `user:${args[0]}` }) },
|
|
107
|
+
* ])
|
|
108
|
+
* async updateUser(userId: string, data: any) { ... }
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
function EmitEvents(events) {
|
|
112
|
+
const eventConfigs = events.map((e) => ({
|
|
113
|
+
eventName: e.eventName,
|
|
114
|
+
async: true,
|
|
115
|
+
beforeInvocation: false,
|
|
116
|
+
...e.options,
|
|
117
|
+
}));
|
|
118
|
+
return (0, common_1.SetMetadata)(exports.EMIT_EVENTS_METADATA_KEY, eventConfigs);
|
|
119
|
+
}
|
|
120
|
+
// ============================================================================
|
|
121
|
+
// Payload Generators
|
|
122
|
+
// ============================================================================
|
|
123
|
+
/**
|
|
124
|
+
* 默认 payload 生成器
|
|
125
|
+
*/
|
|
126
|
+
function defaultPayloadGenerator(args, result) {
|
|
127
|
+
return {
|
|
128
|
+
timestamp: new Date(),
|
|
129
|
+
args,
|
|
130
|
+
result,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 用户事件 payload 生成器
|
|
135
|
+
*/
|
|
136
|
+
function userEventPayloadGenerator(args, result) {
|
|
137
|
+
const userId = args[0];
|
|
138
|
+
return {
|
|
139
|
+
timestamp: new Date(),
|
|
140
|
+
userId,
|
|
141
|
+
user: result,
|
|
142
|
+
args,
|
|
143
|
+
result,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 缓存失效事件 payload 生成器
|
|
148
|
+
*/
|
|
149
|
+
function cacheInvalidatePayloadGenerator(cacheName, keyGenerator) {
|
|
150
|
+
return (args, result) => ({
|
|
151
|
+
timestamp: new Date(),
|
|
152
|
+
cacheName,
|
|
153
|
+
cacheKey: keyGenerator ? keyGenerator(...args) : args[0],
|
|
154
|
+
args,
|
|
155
|
+
result,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=event.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.decorator.js","sourceRoot":"","sources":["../../../src/decorators/event/event.decorator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAsHH,8BAYC;AAgBD,gCAcC;AASD,0DASC;AAKD,8DASC;AAKD,0EAWC;AA9MD,2CAA6C;AAE7C,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAElE,QAAA,uBAAuB,GAAG,YAAY,CAAC;AACvC,QAAA,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,SAAS;IACT,IAAI,EAAE;QACJ,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,aAAa;QACrB,gBAAgB,EAAE,uBAAuB;KAC1C;IACD,SAAS;IACT,KAAK,EAAE;QACL,WAAW,EAAE,mBAAmB;QAChC,SAAS,EAAE,iBAAiB;KAC7B;IACD,SAAS;IACT,IAAI,EAAE;QACJ,aAAa,EAAE,oBAAoB;QACnC,eAAe,EAAE,sBAAsB;QACvC,aAAa,EAAE,oBAAoB;KACpC;CACO,CAAC;AAsDX,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,SAAS,CACvB,SAAiB,EACjB,OAAsD;IAEtD,MAAM,YAAY,GAAqB;QACrC,SAAS;QACT,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,KAAK;QACvB,GAAG,OAAO;KACX,CAAC;IAEF,OAAO,IAAA,oBAAW,EAAC,+BAAuB,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,UAAU,CACxB,MAGE;IAEF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtC,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK,EAAE,IAAI;QACX,gBAAgB,EAAE,KAAK;QACvB,GAAG,CAAC,CAAC,OAAO;KACb,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAA,oBAAW,EAAC,gCAAwB,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;GAEG;AACH,SAAgB,uBAAuB,CACrC,IAAW,EACX,MAAW;IAEX,OAAO;QACL,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,IAAW,EAAE,MAAW;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO;QACL,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,MAAM;QACN,IAAI,EAAE,MAAM;QACZ,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,+BAA+B,CAC7C,SAAiB,EACjB,YAAyC;IAEzC,OAAO,CAAC,IAAW,EAAE,MAAW,EAAE,EAAE,CAAC,CAAC;QACpC,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,SAAS;QACT,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACxD,IAAI;QACJ,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Interceptor
|
|
3
|
+
*
|
|
4
|
+
* 拦截器实现,处理 @EmitEvent, @EmitEvents 装饰器的事件触发逻辑。
|
|
5
|
+
* 与 NestJS EventEmitter2 深度融合。
|
|
6
|
+
*/
|
|
7
|
+
import { NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
|
|
8
|
+
import { Reflector } from '@nestjs/core';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
11
|
+
import { Logger } from 'winston';
|
|
12
|
+
export declare class EventInterceptor implements NestInterceptor {
|
|
13
|
+
private readonly reflector;
|
|
14
|
+
private readonly eventEmitter;
|
|
15
|
+
private readonly logger;
|
|
16
|
+
constructor(reflector: Reflector, eventEmitter: EventEmitter2, logger: Logger);
|
|
17
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
18
|
+
/**
|
|
19
|
+
* 触发事件
|
|
20
|
+
*/
|
|
21
|
+
private emitEvent;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=event.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.interceptor.d.ts","sourceRoot":"","sources":["../../../src/decorators/event/event.interceptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AASjC,qBACa,gBAAiB,YAAW,eAAe;IAEpD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IACI,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFvC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,aAAa,EACM,MAAM,EAAE,MAAM;IAGlE,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC;IAuDxE;;OAEG;IACH,OAAO,CAAC,SAAS;CA4DlB"}
|