@venizia/ignis 0.0.7-8 → 0.0.7
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 +2757 -28
- package/dist/base/applications/abstract.d.ts.map +1 -1
- package/dist/base/applications/abstract.js +0 -8
- package/dist/base/applications/abstract.js.map +1 -1
- package/dist/base/applications/base.d.ts.map +1 -1
- package/dist/base/applications/base.js +0 -17
- package/dist/base/applications/base.js.map +1 -1
- package/dist/base/applications/types.d.ts.map +1 -1
- package/dist/base/applications/types.js.map +1 -1
- package/dist/base/components/base.d.ts.map +1 -1
- package/dist/base/components/base.js +0 -2
- package/dist/base/components/base.js.map +1 -1
- package/dist/base/controllers/abstract.d.ts +10 -124
- package/dist/base/controllers/abstract.d.ts.map +1 -1
- package/dist/base/controllers/abstract.js +6 -82
- package/dist/base/controllers/abstract.js.map +1 -1
- package/dist/base/controllers/base.d.ts +5 -113
- package/dist/base/controllers/base.d.ts.map +1 -1
- package/dist/base/controllers/base.js +5 -113
- package/dist/base/controllers/base.js.map +1 -1
- package/dist/base/controllers/common/constants.d.ts +1 -16
- package/dist/base/controllers/common/constants.d.ts.map +1 -1
- package/dist/base/controllers/common/constants.js +1 -20
- package/dist/base/controllers/common/constants.js.map +1 -1
- package/dist/base/controllers/common/types.d.ts +16 -167
- package/dist/base/controllers/common/types.d.ts.map +1 -1
- package/dist/base/controllers/common/types.js +1 -4
- package/dist/base/controllers/common/types.js.map +1 -1
- package/dist/base/controllers/factory/controller.d.ts +26 -207
- package/dist/base/controllers/factory/controller.d.ts.map +1 -1
- package/dist/base/controllers/factory/controller.js +13 -140
- package/dist/base/controllers/factory/controller.js.map +1 -1
- package/dist/base/controllers/factory/definition.d.ts +11 -16
- package/dist/base/controllers/factory/definition.d.ts.map +1 -1
- package/dist/base/controllers/factory/definition.js +4 -30
- package/dist/base/controllers/factory/definition.js.map +1 -1
- package/dist/base/datasources/base.d.ts +2 -31
- package/dist/base/datasources/base.d.ts.map +1 -1
- package/dist/base/datasources/base.js +2 -39
- package/dist/base/datasources/base.js.map +1 -1
- package/dist/base/datasources/common/types.d.ts +2 -4
- package/dist/base/datasources/common/types.d.ts.map +1 -1
- package/dist/base/datasources/common/types.js +1 -8
- package/dist/base/datasources/common/types.js.map +1 -1
- package/dist/base/metadata/injectors.d.ts +1 -30
- package/dist/base/metadata/injectors.d.ts.map +1 -1
- package/dist/base/metadata/injectors.js +1 -30
- package/dist/base/metadata/injectors.js.map +1 -1
- package/dist/base/metadata/persistents.d.ts +3 -63
- package/dist/base/metadata/persistents.d.ts.map +1 -1
- package/dist/base/metadata/persistents.js +11 -88
- package/dist/base/metadata/persistents.js.map +1 -1
- package/dist/base/metadata/routes.d.ts +1 -24
- package/dist/base/metadata/routes.d.ts.map +1 -1
- package/dist/base/metadata/routes.js +1 -27
- package/dist/base/metadata/routes.js.map +1 -1
- package/dist/base/middlewares/app-error.middleware.d.ts +1 -10
- package/dist/base/middlewares/app-error.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/app-error.middleware.js +2 -14
- package/dist/base/middlewares/app-error.middleware.js.map +1 -1
- package/dist/base/middlewares/emoji-favicon.middleware.d.ts +1 -7
- package/dist/base/middlewares/emoji-favicon.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/emoji-favicon.middleware.js +1 -7
- package/dist/base/middlewares/emoji-favicon.middleware.js.map +1 -1
- package/dist/base/middlewares/not-found.middleware.d.ts +1 -8
- package/dist/base/middlewares/not-found.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/not-found.middleware.js +1 -8
- package/dist/base/middlewares/not-found.middleware.js.map +1 -1
- package/dist/base/middlewares/request-spy.middleware.d.ts +3 -19
- package/dist/base/middlewares/request-spy.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/request-spy.middleware.js +3 -23
- package/dist/base/middlewares/request-spy.middleware.js.map +1 -1
- package/dist/base/mixins/component.mixin.d.ts.map +1 -1
- package/dist/base/mixins/controller.mixin.d.ts.map +1 -1
- package/dist/base/mixins/repository.mixin.d.ts.map +1 -1
- package/dist/base/mixins/service.mixin.d.ts.map +1 -1
- package/dist/base/models/base.d.ts +4 -21
- package/dist/base/models/base.d.ts.map +1 -1
- package/dist/base/models/base.js +1 -11
- package/dist/base/models/base.js.map +1 -1
- package/dist/base/models/common/types.d.ts.map +1 -1
- package/dist/base/models/common/types.js +0 -2
- package/dist/base/models/common/types.js.map +1 -1
- package/dist/base/models/enrichers/id.enricher.d.ts.map +1 -1
- package/dist/base/models/enrichers/id.enricher.js.map +1 -1
- package/dist/base/models/enrichers/user-audit.enricher.d.ts.map +1 -1
- package/dist/base/models/enrichers/user-audit.enricher.js +1 -6
- package/dist/base/models/enrichers/user-audit.enricher.js.map +1 -1
- package/dist/base/repositories/common/constants.d.ts +5 -59
- package/dist/base/repositories/common/constants.d.ts.map +1 -1
- package/dist/base/repositories/common/constants.js +3 -51
- package/dist/base/repositories/common/constants.js.map +1 -1
- package/dist/base/repositories/common/shared.d.ts +1 -13
- package/dist/base/repositories/common/shared.d.ts.map +1 -1
- package/dist/base/repositories/common/shared.js +2 -19
- package/dist/base/repositories/common/shared.js.map +1 -1
- package/dist/base/repositories/common/types.d.ts +32 -461
- package/dist/base/repositories/common/types.d.ts.map +1 -1
- package/dist/base/repositories/common/types.js +13 -159
- package/dist/base/repositories/common/types.js.map +1 -1
- package/dist/base/repositories/core/abstract.d.ts +10 -204
- package/dist/base/repositories/core/abstract.d.ts.map +1 -1
- package/dist/base/repositories/core/abstract.js +6 -126
- package/dist/base/repositories/core/abstract.js.map +1 -1
- package/dist/base/repositories/core/default-crud.d.ts +1 -36
- package/dist/base/repositories/core/default-crud.d.ts.map +1 -1
- package/dist/base/repositories/core/default-crud.js +1 -36
- package/dist/base/repositories/core/default-crud.js.map +1 -1
- package/dist/base/repositories/core/index.d.ts +1 -0
- package/dist/base/repositories/core/index.d.ts.map +1 -1
- package/dist/base/repositories/core/index.js +1 -0
- package/dist/base/repositories/core/index.js.map +1 -1
- package/dist/base/repositories/core/persistable.d.ts +2 -71
- package/dist/base/repositories/core/persistable.d.ts.map +1 -1
- package/dist/base/repositories/core/persistable.js +2 -100
- package/dist/base/repositories/core/persistable.js.map +1 -1
- package/dist/base/repositories/core/readable.d.ts +12 -127
- package/dist/base/repositories/core/readable.d.ts.map +1 -1
- package/dist/base/repositories/core/readable.js +8 -124
- package/dist/base/repositories/core/readable.js.map +1 -1
- package/dist/base/repositories/core/soft-deletable.d.ts +140 -0
- package/dist/base/repositories/core/soft-deletable.d.ts.map +1 -0
- package/dist/base/repositories/core/soft-deletable.js +99 -0
- package/dist/base/repositories/core/soft-deletable.js.map +1 -0
- package/dist/base/repositories/mixins/default-filter.d.ts +3 -49
- package/dist/base/repositories/mixins/default-filter.d.ts.map +1 -1
- package/dist/base/repositories/mixins/default-filter.js +3 -57
- package/dist/base/repositories/mixins/default-filter.js.map +1 -1
- package/dist/base/repositories/mixins/fields-visibility.d.ts +3 -59
- package/dist/base/repositories/mixins/fields-visibility.d.ts.map +1 -1
- package/dist/base/repositories/mixins/fields-visibility.js +3 -67
- package/dist/base/repositories/mixins/fields-visibility.js.map +1 -1
- package/dist/base/repositories/operators/filter.d.ts +10 -115
- package/dist/base/repositories/operators/filter.d.ts.map +1 -1
- package/dist/base/repositories/operators/filter.js +13 -154
- package/dist/base/repositories/operators/filter.js.map +1 -1
- package/dist/base/repositories/operators/json-utils.d.ts +5 -38
- package/dist/base/repositories/operators/json-utils.d.ts.map +1 -1
- package/dist/base/repositories/operators/json-utils.js +5 -47
- package/dist/base/repositories/operators/json-utils.js.map +1 -1
- package/dist/base/repositories/operators/query.d.ts +3 -56
- package/dist/base/repositories/operators/query.d.ts.map +1 -1
- package/dist/base/repositories/operators/query.js +11 -106
- package/dist/base/repositories/operators/query.js.map +1 -1
- package/dist/base/repositories/operators/relation.d.ts +1 -33
- package/dist/base/repositories/operators/relation.d.ts.map +1 -1
- package/dist/base/repositories/operators/relation.js +1 -36
- package/dist/base/repositories/operators/relation.js.map +1 -1
- package/dist/base/repositories/operators/update.d.ts +7 -72
- package/dist/base/repositories/operators/update.d.ts.map +1 -1
- package/dist/base/repositories/operators/update.js +6 -91
- package/dist/base/repositories/operators/update.js.map +1 -1
- package/dist/base/services/types.d.ts.map +1 -1
- package/dist/common/bindings.d.ts +2 -17
- package/dist/common/bindings.d.ts.map +1 -1
- package/dist/common/bindings.js +2 -14
- package/dist/common/bindings.js.map +1 -1
- package/dist/common/constants.d.ts +1 -3
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +1 -4
- package/dist/common/constants.js.map +1 -1
- package/dist/common/environments.d.ts +1 -4
- package/dist/common/environments.d.ts.map +1 -1
- package/dist/common/environments.js +1 -4
- package/dist/common/environments.js.map +1 -1
- package/dist/common/statuses.d.ts +6 -19
- package/dist/common/statuses.d.ts.map +1 -1
- package/dist/common/statuses.js +6 -27
- package/dist/common/statuses.js.map +1 -1
- package/dist/components/auth/authenticate/common/codecs.d.ts +11 -0
- package/dist/components/auth/authenticate/common/codecs.d.ts.map +1 -0
- package/dist/components/auth/authenticate/common/codecs.js +28 -0
- package/dist/components/auth/authenticate/common/codecs.js.map +1 -0
- package/dist/components/auth/authenticate/common/constants.d.ts +28 -4
- package/dist/components/auth/authenticate/common/constants.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/constants.js +37 -9
- package/dist/components/auth/authenticate/common/constants.js.map +1 -1
- package/dist/components/auth/authenticate/common/index.d.ts +1 -0
- package/dist/components/auth/authenticate/common/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/index.js +1 -0
- package/dist/components/auth/authenticate/common/index.js.map +1 -1
- package/dist/components/auth/authenticate/common/keys.d.ts +1 -0
- package/dist/components/auth/authenticate/common/keys.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/keys.js +1 -0
- package/dist/components/auth/authenticate/common/keys.js.map +1 -1
- package/dist/components/auth/authenticate/common/types.d.ts +56 -34
- package/dist/components/auth/authenticate/common/types.d.ts.map +1 -1
- package/dist/components/auth/authenticate/component.d.ts +3 -16
- package/dist/components/auth/authenticate/component.d.ts.map +1 -1
- package/dist/components/auth/authenticate/component.js +105 -73
- package/dist/components/auth/authenticate/component.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/factory.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/factory.js +2 -2
- package/dist/components/auth/authenticate/controllers/factory.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/index.d.ts +1 -0
- package/dist/components/auth/authenticate/controllers/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/index.js +1 -0
- package/dist/components/auth/authenticate/controllers/index.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/jwks/controller.d.ts +9 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.js +54 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.js.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts +66 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.js +32 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.js.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.d.ts +2 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.js +18 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.js.map +1 -0
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.d.ts.map +1 -1
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.js +0 -2
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.js.map +1 -1
- package/dist/components/auth/authenticate/providers/authentication.provider.d.ts.map +1 -1
- package/dist/components/auth/authenticate/providers/authentication.provider.js +0 -7
- package/dist/components/auth/authenticate/providers/authentication.provider.js.map +1 -1
- package/dist/components/auth/authenticate/services/basic/index.d.ts +2 -0
- package/dist/components/auth/authenticate/services/basic/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/basic/index.js +18 -0
- package/dist/components/auth/authenticate/services/basic/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/basic/service.d.ts +24 -0
- package/dist/components/auth/authenticate/services/basic/service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/{basic-token.service.js → basic/service.js} +7 -45
- package/dist/components/auth/authenticate/services/basic/service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.d.ts +52 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.js +177 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/index.d.ts +4 -0
- package/dist/components/auth/authenticate/services/bearer/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/index.js +20 -0
- package/dist/components/auth/authenticate/services/bearer/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.d.ts +16 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.js +32 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.d.ts +4 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.js +20 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts +46 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js +168 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts +18 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js +73 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts +19 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.js +76 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/index.d.ts +2 -2
- package/dist/components/auth/authenticate/services/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/index.js +2 -2
- package/dist/components/auth/authenticate/services/index.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/basic.strategy.d.ts +1 -22
- package/dist/components/auth/authenticate/strategies/basic.strategy.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/basic.strategy.js +9 -23
- package/dist/components/auth/authenticate/strategies/basic.strategy.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts +2 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.js +2 -1
- package/dist/components/auth/authenticate/strategies/index.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts +21 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.js +68 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwt.strategy.d.ts → jws.strategy.d.ts} +5 -4
- package/dist/components/auth/authenticate/strategies/jws.strategy.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwt.strategy.js → jws.strategy.js} +18 -10
- package/dist/components/auth/authenticate/strategies/jws.strategy.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/strategy-registry.js +0 -5
- package/dist/components/auth/authenticate/strategies/strategy-registry.js.map +1 -1
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts +73 -0
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/base-filtered.js +90 -0
- package/dist/components/auth/authorize/adapters/base-filtered.js.map +1 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.d.ts +40 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.js +99 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.js.map +1 -0
- package/dist/components/auth/authorize/adapters/index.d.ts +3 -0
- package/dist/components/auth/authorize/adapters/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/index.js +19 -0
- package/dist/components/auth/authorize/adapters/index.js.map +1 -0
- package/dist/components/auth/authorize/common/constants.d.ts +37 -4
- package/dist/components/auth/authorize/common/constants.d.ts.map +1 -1
- package/dist/components/auth/authorize/common/constants.js +61 -9
- package/dist/components/auth/authorize/common/constants.js.map +1 -1
- package/dist/components/auth/authorize/common/keys.d.ts +1 -2
- package/dist/components/auth/authorize/common/keys.d.ts.map +1 -1
- package/dist/components/auth/authorize/common/keys.js +3 -2
- package/dist/components/auth/authorize/common/keys.js.map +1 -1
- package/dist/components/auth/authorize/common/types.d.ts +78 -98
- package/dist/components/auth/authorize/common/types.d.ts.map +1 -1
- package/dist/components/auth/authorize/component.d.ts +1 -0
- package/dist/components/auth/authorize/component.d.ts.map +1 -1
- package/dist/components/auth/authorize/component.js +12 -34
- package/dist/components/auth/authorize/component.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts +45 -11
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts.map +1 -1
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js +198 -39
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/enforcer-registry.d.ts +12 -6
- package/dist/components/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -1
- package/dist/components/auth/authorize/enforcers/enforcer-registry.js +30 -14
- package/dist/components/auth/authorize/enforcers/enforcer-registry.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/index.d.ts +0 -1
- package/dist/components/auth/authorize/enforcers/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/enforcers/index.js +0 -1
- package/dist/components/auth/authorize/enforcers/index.js.map +1 -1
- package/dist/components/auth/authorize/index.d.ts +1 -0
- package/dist/components/auth/authorize/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/index.js +1 -0
- package/dist/components/auth/authorize/index.js.map +1 -1
- package/dist/components/auth/authorize/middlewares/authorize.middleware.d.ts.map +1 -1
- package/dist/components/auth/authorize/middlewares/authorize.middleware.js +0 -2
- package/dist/components/auth/authorize/middlewares/authorize.middleware.js.map +1 -1
- package/dist/components/auth/authorize/models/abilities/index.d.ts +3 -0
- package/dist/components/auth/authorize/models/abilities/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/index.js +19 -0
- package/dist/components/auth/authorize/models/abilities/index.js.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.d.ts +14 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.js +23 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.js.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.d.ts +13 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.js +19 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.js.map +1 -0
- package/dist/components/auth/authorize/models/authorization-role.model.d.ts.map +1 -1
- package/dist/components/auth/authorize/models/authorization-role.model.js +0 -1
- package/dist/components/auth/authorize/models/authorization-role.model.js.map +1 -1
- package/dist/components/auth/authorize/models/index.d.ts +1 -0
- package/dist/components/auth/authorize/models/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/models/index.js +1 -0
- package/dist/components/auth/authorize/models/index.js.map +1 -1
- package/dist/components/auth/authorize/providers/authorization.provider.d.ts.map +1 -1
- package/dist/components/auth/authorize/providers/authorization.provider.js +48 -43
- package/dist/components/auth/authorize/providers/authorization.provider.js.map +1 -1
- package/dist/components/auth/base/abstract-auth-registry.d.ts +1 -0
- package/dist/components/auth/base/abstract-auth-registry.d.ts.map +1 -1
- package/dist/components/auth/base/abstract-auth-registry.js +3 -3
- package/dist/components/auth/base/abstract-auth-registry.js.map +1 -1
- package/dist/components/auth/context-variables.d.ts +14 -0
- package/dist/components/auth/context-variables.d.ts.map +1 -0
- package/dist/components/auth/context-variables.js +3 -0
- package/dist/components/auth/context-variables.js.map +1 -0
- package/dist/components/auth/index.d.ts +1 -0
- package/dist/components/auth/index.d.ts.map +1 -1
- package/dist/components/auth/index.js +1 -0
- package/dist/components/auth/index.js.map +1 -1
- package/dist/components/auth/models/entities/index.d.ts +1 -2
- package/dist/components/auth/models/entities/index.d.ts.map +1 -1
- package/dist/components/auth/models/entities/index.js +1 -2
- package/dist/components/auth/models/entities/index.js.map +1 -1
- package/dist/components/auth/models/entities/permission.model.d.ts +0 -1
- package/dist/components/auth/models/entities/permission.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/permission.model.js +0 -2
- package/dist/components/auth/models/entities/permission.model.js.map +1 -1
- package/dist/components/auth/models/entities/policy-definition.model.d.ts +24 -0
- package/dist/components/auth/models/entities/policy-definition.model.d.ts.map +1 -0
- package/dist/components/auth/models/entities/policy-definition.model.js +39 -0
- package/dist/components/auth/models/entities/policy-definition.model.js.map +1 -0
- package/dist/components/auth/models/entities/role.model.d.ts +3 -1
- package/dist/components/auth/models/entities/role.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/role.model.js +4 -2
- package/dist/components/auth/models/entities/role.model.js.map +1 -1
- package/dist/components/auth/models/entities/user.model.d.ts +4 -2
- package/dist/components/auth/models/entities/user.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/user.model.js +5 -4
- package/dist/components/auth/models/entities/user.model.js.map +1 -1
- package/dist/components/health-check/controller.d.ts.map +1 -1
- package/dist/components/health-check/controller.js +0 -1
- package/dist/components/health-check/controller.js.map +1 -1
- package/dist/components/mail/common/types.d.ts +1 -1
- package/dist/components/mail/common/types.d.ts.map +1 -1
- package/dist/components/mail/component.d.ts.map +1 -1
- package/dist/components/mail/component.js +2 -7
- package/dist/components/mail/component.js.map +1 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.d.ts +2 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.js +7 -7
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.d.ts +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.js +3 -3
- package/dist/components/mail/helpers/executors/direct-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.d.ts +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.js +4 -4
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.d.ts +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.js +3 -3
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.js.map +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.d.ts +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.js +3 -3
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.js.map +1 -1
- package/dist/components/mail/providers/mail-queue-executor.provider.d.ts.map +1 -1
- package/dist/components/mail/providers/mail-queue-executor.provider.js +8 -8
- package/dist/components/mail/providers/mail-queue-executor.provider.js.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.d.ts.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.js +6 -6
- package/dist/components/mail/providers/mail-transporter.provider.js.map +1 -1
- package/dist/components/mail/services/mail.service.d.ts +1 -1
- package/dist/components/mail/services/mail.service.d.ts.map +1 -1
- package/dist/components/mail/services/mail.service.js +9 -9
- package/dist/components/mail/services/mail.service.js.map +1 -1
- package/dist/components/mail/services/template.service.d.ts +1 -1
- package/dist/components/mail/services/template.service.d.ts.map +1 -1
- package/dist/components/mail/services/template.service.js +4 -4
- package/dist/components/mail/services/template.service.js.map +1 -1
- package/dist/components/mail/utilities/type.utility.d.ts +1 -1
- package/dist/components/mail/utilities/type.utility.d.ts.map +1 -1
- package/dist/components/socket-io/component.d.ts.map +1 -1
- package/dist/components/socket-io/component.js +0 -4
- package/dist/components/socket-io/component.js.map +1 -1
- package/dist/components/static-asset/common/constants.d.ts +1 -0
- package/dist/components/static-asset/common/constants.d.ts.map +1 -1
- package/dist/components/static-asset/common/constants.js +2 -1
- package/dist/components/static-asset/common/constants.js.map +1 -1
- package/dist/components/static-asset/common/types.d.ts +43 -1
- package/dist/components/static-asset/common/types.d.ts.map +1 -1
- package/dist/components/static-asset/controller/base.definition.d.ts +81 -80
- package/dist/components/static-asset/controller/base.definition.d.ts.map +1 -1
- package/dist/components/static-asset/controller/base.definition.js +1 -2
- package/dist/components/static-asset/controller/base.definition.js.map +1 -1
- package/dist/components/static-asset/controller/factory.d.ts +2 -6
- package/dist/components/static-asset/controller/factory.d.ts.map +1 -1
- package/dist/components/static-asset/controller/factory.js +41 -42
- package/dist/components/static-asset/controller/factory.js.map +1 -1
- package/dist/components/static-asset/models/base.model.d.ts +49 -19
- package/dist/components/static-asset/models/base.model.d.ts.map +1 -1
- package/dist/components/static-asset/models/base.model.js +3 -7
- package/dist/components/static-asset/models/base.model.js.map +1 -1
- package/dist/components/swagger/ui-factory.d.ts.map +1 -1
- package/dist/components/swagger/ui-factory.js +0 -2
- package/dist/components/swagger/ui-factory.js.map +1 -1
- package/dist/components/websocket/component.d.ts.map +1 -1
- package/dist/components/websocket/component.js +0 -3
- package/dist/components/websocket/component.js.map +1 -1
- package/dist/helpers/base-helper.d.ts +2 -0
- package/dist/helpers/base-helper.d.ts.map +1 -0
- package/dist/helpers/base-helper.js +6 -0
- package/dist/helpers/base-helper.js.map +1 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/inversion/common/keys.d.ts.map +1 -1
- package/dist/helpers/inversion/common/keys.js +0 -2
- package/dist/helpers/inversion/common/keys.js.map +1 -1
- package/dist/helpers/inversion/common/types.d.ts +18 -56
- package/dist/helpers/inversion/common/types.d.ts.map +1 -1
- package/dist/helpers/inversion/container.d.ts.map +1 -1
- package/dist/helpers/inversion/container.js +0 -1
- package/dist/helpers/inversion/container.js.map +1 -1
- package/dist/helpers/inversion/index.d.ts +1 -1
- package/dist/helpers/inversion/index.d.ts.map +1 -1
- package/dist/helpers/inversion/index.js +5 -1
- package/dist/helpers/inversion/index.js.map +1 -1
- package/dist/helpers/inversion/mixins/controller.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/controller.mixin.js +0 -3
- package/dist/helpers/inversion/mixins/controller.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/datasource.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/datasource.mixin.js +0 -3
- package/dist/helpers/inversion/mixins/datasource.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/model.mixin.d.ts +29 -1
- package/dist/helpers/inversion/mixins/model.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/model.mixin.js +66 -2
- package/dist/helpers/inversion/mixins/model.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/repository.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/repository.mixin.js +0 -2
- package/dist/helpers/inversion/mixins/repository.mixin.js.map +1 -1
- package/dist/helpers/inversion/registry.d.ts +22 -0
- package/dist/helpers/inversion/registry.d.ts.map +1 -1
- package/dist/utilities/jsx.utility.d.ts +2 -16
- package/dist/utilities/jsx.utility.d.ts.map +1 -1
- package/dist/utilities/jsx.utility.js +2 -16
- package/dist/utilities/jsx.utility.js.map +1 -1
- package/dist/utilities/schema.utility.d.ts.map +1 -1
- package/dist/utilities/schema.utility.js +0 -2
- package/dist/utilities/schema.utility.js.map +1 -1
- package/package.json +97 -71
- package/dist/components/auth/authenticate/services/basic-token.service.d.ts +0 -60
- package/dist/components/auth/authenticate/services/basic-token.service.d.ts.map +0 -1
- package/dist/components/auth/authenticate/services/basic-token.service.js.map +0 -1
- package/dist/components/auth/authenticate/services/jwt-token.service.d.ts +0 -34
- package/dist/components/auth/authenticate/services/jwt-token.service.d.ts.map +0 -1
- package/dist/components/auth/authenticate/services/jwt-token.service.js +0 -218
- package/dist/components/auth/authenticate/services/jwt-token.service.js.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwt.strategy.d.ts.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwt.strategy.js.map +0 -1
- package/dist/components/auth/authorize/enforcers/default.enforcer.d.ts +0 -37
- package/dist/components/auth/authorize/enforcers/default.enforcer.d.ts.map +0 -1
- package/dist/components/auth/authorize/enforcers/default.enforcer.js +0 -125
- package/dist/components/auth/authorize/enforcers/default.enforcer.js.map +0 -1
- package/dist/components/auth/models/entities/permission-mapping.model.d.ts +0 -26
- package/dist/components/auth/models/entities/permission-mapping.model.d.ts.map +0 -1
- package/dist/components/auth/models/entities/permission-mapping.model.js +0 -33
- package/dist/components/auth/models/entities/permission-mapping.model.js.map +0 -1
- package/dist/components/auth/models/entities/user-role.model.d.ts +0 -17
- package/dist/components/auth/models/entities/user-role.model.d.ts.map +0 -1
- package/dist/components/auth/models/entities/user-role.model.js +0 -34
- package/dist/components/auth/models/entities/user-role.model.js.map +0 -1
|
@@ -8,46 +8,8 @@ const registry_1 = require("../../helpers/inversion/registry");
|
|
|
8
8
|
const jsx_utility_1 = require("../../utilities/jsx.utility");
|
|
9
9
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
10
10
|
const ignis_helpers_1 = require("@venizia/ignis-helpers");
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Abstract base class for all controllers in the Ignis framework.
|
|
14
|
-
*
|
|
15
|
-
* Provides core functionality for:
|
|
16
|
-
* - Route registration and configuration
|
|
17
|
-
* - Authentication middleware integration
|
|
18
|
-
* - OpenAPI schema generation
|
|
19
|
-
* - Decorator-based route binding
|
|
20
|
-
*
|
|
21
|
-
* Extend this class (or {@link BaseController}) to create custom controllers.
|
|
22
|
-
*
|
|
23
|
-
* @typeParam RouteEnv - Hono environment type for context variables
|
|
24
|
-
* @typeParam RouteSchema - Combined schema type for all routes
|
|
25
|
-
* @typeParam BasePath - Base path prefix for the router
|
|
26
|
-
* @typeParam ConfigurableOptions - Options passed during configuration
|
|
27
|
-
* @typeParam Definitions - Route definitions map type for strongly-typed method overrides
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* class UserController extends AbstractController {
|
|
32
|
-
* async binding() {
|
|
33
|
-
* this.defineRoute({
|
|
34
|
-
* configs: { path: '/', method: 'get', ... },
|
|
35
|
-
* handler: async (c) => c.json({ users: [] })
|
|
36
|
-
* });
|
|
37
|
-
* }
|
|
38
|
-
*
|
|
39
|
-
* bindRoute(opts) { ... }
|
|
40
|
-
* defineRoute(opts) { ... }
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
11
|
+
/** Abstract base class for all controllers, providing route registration and auth middleware integration. */
|
|
44
12
|
class AbstractController extends ignis_helpers_1.BaseHelper {
|
|
45
|
-
/**
|
|
46
|
-
* Creates a new controller instance.
|
|
47
|
-
*
|
|
48
|
-
* @param opts - Controller configuration options
|
|
49
|
-
* @throws Error if no path is provided via constructor or decorator
|
|
50
|
-
*/
|
|
51
13
|
constructor(opts) {
|
|
52
14
|
super(opts);
|
|
53
15
|
const { isStrict = true } = opts;
|
|
@@ -71,20 +33,11 @@ class AbstractController extends ignis_helpers_1.BaseHelper {
|
|
|
71
33
|
},
|
|
72
34
|
});
|
|
73
35
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Returns the OpenAPIHono router instance for this controller.
|
|
76
|
-
*
|
|
77
|
-
* @returns The configured router with all registered routes
|
|
78
|
-
*/
|
|
36
|
+
/** Returns the OpenAPIHono router instance for this controller. */
|
|
79
37
|
getRouter() {
|
|
80
38
|
return this.router;
|
|
81
39
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Registers routes defined via decorators (e.g., `@get`, `@post`) from the metadata registry.
|
|
84
|
-
*
|
|
85
|
-
* Called automatically during {@link configure}. Iterates through decorator-defined
|
|
86
|
-
* routes and binds them to their handler methods.
|
|
87
|
-
*/
|
|
40
|
+
/** Registers routes defined via decorators (@get, @post, etc.) from the metadata registry. */
|
|
88
41
|
registerRoutesFromRegistry() {
|
|
89
42
|
const routes = registry_1.MetadataRegistry.getInstance().getRoutes({
|
|
90
43
|
target: Object.getPrototypeOf(this),
|
|
@@ -99,15 +52,7 @@ class AbstractController extends ignis_helpers_1.BaseHelper {
|
|
|
99
52
|
});
|
|
100
53
|
}
|
|
101
54
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Configures the controller by binding all routes and registering decorator-based routes.
|
|
104
|
-
*
|
|
105
|
-
* This is the main entry point called by the application during startup.
|
|
106
|
-
* It executes the {@link binding} method and then registers any decorator-defined routes.
|
|
107
|
-
*
|
|
108
|
-
* @param opts - Optional configuration options passed to the controller
|
|
109
|
-
* @returns The configured OpenAPIHono router ready for mounting
|
|
110
|
-
*/
|
|
55
|
+
/** Configures the controller by binding all routes and registering decorator-based routes. */
|
|
111
56
|
async configure(opts) {
|
|
112
57
|
const t = performance.now();
|
|
113
58
|
const logger = this.logger.for(this.configure.name);
|
|
@@ -118,19 +63,7 @@ class AbstractController extends ignis_helpers_1.BaseHelper {
|
|
|
118
63
|
logger.info('DONE | Binding controller | Took: %s (ms)', performance.now() - t);
|
|
119
64
|
return this.router;
|
|
120
65
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Processes route configuration, adding authentication middleware and OpenAPI metadata.
|
|
123
|
-
*
|
|
124
|
-
* Transforms a route config by:
|
|
125
|
-
* - Converting `authenticate.strategies` to OpenAPI security specs
|
|
126
|
-
* - Creating authentication middleware based on strategies and mode
|
|
127
|
-
* - Adding the controller scope to route tags
|
|
128
|
-
* - Merging any existing middleware
|
|
129
|
-
*
|
|
130
|
-
* @typeParam RouteConfig - The route configuration type
|
|
131
|
-
* @param opts - Object containing the route configuration
|
|
132
|
-
* @returns Processed route configuration ready for registration
|
|
133
|
-
*/
|
|
66
|
+
/** Processes route config, injecting auth middleware and OpenAPI security specs. */
|
|
134
67
|
getRouteConfigs(opts) {
|
|
135
68
|
const { configs } = opts;
|
|
136
69
|
const { authenticate = {}, authorize, ...restConfig } = configs;
|
|
@@ -166,16 +99,7 @@ class AbstractController extends ignis_helpers_1.BaseHelper {
|
|
|
166
99
|
security,
|
|
167
100
|
}));
|
|
168
101
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Processes JSX route configuration for server-side rendered HTML responses.
|
|
171
|
-
*
|
|
172
|
-
* Similar to {@link getRouteConfigs} but automatically adds HTML response
|
|
173
|
-
* schema for JSX rendering. Use with {@link BaseController.defineJSXRoute}.
|
|
174
|
-
*
|
|
175
|
-
* @typeParam RouteConfig - The route configuration type
|
|
176
|
-
* @param opts - Object containing the route configuration
|
|
177
|
-
* @returns Processed route configuration with HTML response schema
|
|
178
|
-
*/
|
|
102
|
+
/** Like getRouteConfigs but adds HTML response schema for JSX rendering. */
|
|
179
103
|
getJSXRouteConfigs(opts) {
|
|
180
104
|
const { configs } = opts;
|
|
181
105
|
const { authenticate = {}, authorize, ...restConfig } = configs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/base/controllers/abstract.ts"],"names":[],"mappings":";;;AAAA,+EAAsF;AACtF,gHAAoH;AACpH,uGAAwG;AAExG,2DAAgE;AAChE,yDAAuD;AACvD,mDAAmE;AACnE,0DAA8E;
|
|
1
|
+
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/base/controllers/abstract.ts"],"names":[],"mappings":";;;AAAA,+EAAsF;AACtF,gHAAoH;AACpH,uGAAwG;AAExG,2DAAgE;AAChE,yDAAuD;AACvD,mDAAmE;AACnE,0DAA8E;AAU9E,6GAA6G;AAC7G,MAAsB,kBAOpB,SAAQ,0BAAU;IAQlB,YAAY,IAAwB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QAEjC,2EAA2E;QAC3E,MAAM,iBAAiB,GAAG,2BAAgB,CAAC,WAAW,EAAE,CAAC,qBAAqB,CAAC;YAC7E,MAAM,EAAE,GAAG,CAAC,MAAM;SACnB,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,iBAAiB,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC;QAE1D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAA,wBAAQ,EAAC;gBACb,OAAO,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,+FAA+F;aAC5H,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QAEzB,IAAI,CAAC,MAAM,GAAG,IAAI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, Schema } from 'hono';
|
|
4
4
|
import { AbstractController } from './abstract';
|
|
5
5
|
import { IAuthRouteConfig, IBindRouteOptions, IDefineRouteOptions, TRouteHandler } from './common/types';
|
|
6
|
-
/**
|
|
7
|
-
* Base controller class with default implementations for route binding.
|
|
8
|
-
*
|
|
9
|
-
* Extends {@link AbstractController} with concrete implementations of
|
|
10
|
-
* {@link bindRoute} and {@link defineRoute}. This is the recommended
|
|
11
|
-
* base class for creating custom controllers.
|
|
12
|
-
*
|
|
13
|
-
* @typeParam RouteEnv - Hono environment type for context variables
|
|
14
|
-
* @typeParam RouteSchema - Combined schema type for all routes
|
|
15
|
-
* @typeParam BasePath - Base path prefix for the router
|
|
16
|
-
* @typeParam ConfigurableOptions - Options passed during configuration
|
|
17
|
-
* @typeParam Definitions - Route definitions map type for strongly-typed method overrides
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* class UserController extends BaseController {
|
|
22
|
-
* async binding() {
|
|
23
|
-
* // Define routes using defineRoute
|
|
24
|
-
* this.defineRoute({
|
|
25
|
-
* configs: {
|
|
26
|
-
* path: '/',
|
|
27
|
-
* method: 'get',
|
|
28
|
-
* authenticate: { strategies: ['jwt'] },
|
|
29
|
-
* responses: { 200: jsonResponse({ schema: UserSchema }) }
|
|
30
|
-
* },
|
|
31
|
-
* handler: async (c) => {
|
|
32
|
-
* const users = await this.userService.findAll();
|
|
33
|
-
* return c.json(users);
|
|
34
|
-
* }
|
|
35
|
-
* });
|
|
36
|
-
*
|
|
37
|
-
* // Or use fluent bindRoute pattern
|
|
38
|
-
* this.bindRoute({
|
|
39
|
-
* configs: { path: '/{id}', method: 'get', ... }
|
|
40
|
-
* }).to({
|
|
41
|
-
* handler: (c) => c.json({ id: c.req.param('id') })
|
|
42
|
-
* });
|
|
43
|
-
* }
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
6
|
+
/** Recommended base class for controllers with concrete bindRoute and defineRoute implementations. */
|
|
47
7
|
export declare abstract class BaseController<RouteEnv extends Env = Env, RouteSchema extends Schema = {}, BasePath extends string = '/', ConfigurableOptions extends object = {}, Definitions extends Record<string, IAuthRouteConfig> = Record<string, IAuthRouteConfig>> extends AbstractController<RouteEnv, RouteSchema, BasePath, ConfigurableOptions, Definitions> {
|
|
48
|
-
/**
|
|
49
|
-
* Helper method to cast to Hono OpenAPI Handler
|
|
50
|
-
*/
|
|
8
|
+
/** Casts handler to Hono OpenAPI Handler type. */
|
|
51
9
|
toHonoHandler<ResponseType = unknown>(opts: {
|
|
52
10
|
handler: TRouteHandler<ResponseType, RouteEnv>;
|
|
53
11
|
}): Parameters<OpenAPIHono<RouteEnv>["openapi"]>[1];
|
|
54
|
-
/**
|
|
55
|
-
* Creates a fluent binding for registering a route.
|
|
56
|
-
*
|
|
57
|
-
* Returns an object with a `to()` method for attaching the handler.
|
|
58
|
-
* Useful for conditional binding or when you need access to the binding object.
|
|
59
|
-
*
|
|
60
|
-
* @typeParam RouteConfig - The route configuration type
|
|
61
|
-
* @param opts - Object containing route configuration
|
|
62
|
-
* @returns Binding options with `to()` method
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* const binding = this.bindRoute({ configs: myRouteConfig });
|
|
67
|
-
* binding.to({ handler: myHandler });
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
12
|
+
/** Creates a fluent binding for registering a route (call .to() to attach handler). */
|
|
70
13
|
bindRoute<RouteConfig extends IAuthRouteConfig>(opts: {
|
|
71
14
|
configs: RouteConfig;
|
|
72
15
|
}): IBindRouteOptions<RouteConfig, RouteEnv, RouteSchema, BasePath>;
|
|
73
|
-
/**
|
|
74
|
-
* Defines and registers a route with its handler in a single call.
|
|
75
|
-
*
|
|
76
|
-
* This is the preferred method for registering routes. It automatically:
|
|
77
|
-
* - Processes authentication strategies into middleware
|
|
78
|
-
* - Adds OpenAPI security requirements
|
|
79
|
-
* - Tags the route with the controller scope
|
|
80
|
-
*
|
|
81
|
-
* @typeParam RouteConfig - The route configuration type
|
|
82
|
-
* @param opts - Object containing route config, handler, and optional hook
|
|
83
|
-
* @returns The registered route definition
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```typescript
|
|
87
|
-
* this.defineRoute({
|
|
88
|
-
* configs: {
|
|
89
|
-
* path: '/users',
|
|
90
|
-
* method: 'get',
|
|
91
|
-
* authenticate: { strategies: ['jwt'] },
|
|
92
|
-
* responses: { 200: jsonResponse({ schema: z.array(UserSchema) }) }
|
|
93
|
-
* },
|
|
94
|
-
* handler: async (c) => {
|
|
95
|
-
* const users = await db.select().from(usersTable);
|
|
96
|
-
* return c.json(users, 200);
|
|
97
|
-
* }
|
|
98
|
-
* });
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
16
|
+
/** Defines and registers a route with its handler in a single call. */
|
|
101
17
|
defineRoute<RouteConfig extends IAuthRouteConfig, ResponseType = unknown>(opts: {
|
|
102
18
|
configs: RouteConfig;
|
|
103
19
|
handler: TRouteHandler<ResponseType, RouteEnv>;
|
|
104
20
|
hook?: Hook<any, RouteEnv, string, ValueOrPromise<any>>;
|
|
105
21
|
}): IDefineRouteOptions<RouteConfig, RouteEnv, RouteSchema, BasePath>;
|
|
106
|
-
/**
|
|
107
|
-
* Define a JSX route that renders server-side HTML
|
|
108
|
-
* Scope: [BaseController][defineJSXRoute]
|
|
109
|
-
*
|
|
110
|
-
* JSX routes use Hono's built-in JSX support to render components to HTML.
|
|
111
|
-
* The handler must return c.html() with the JSX component.
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* ```typescript
|
|
115
|
-
* this.defineJSXRoute({
|
|
116
|
-
* configs: {
|
|
117
|
-
* path: '/profile',
|
|
118
|
-
* method: 'get',
|
|
119
|
-
* description: 'User profile page',
|
|
120
|
-
* },
|
|
121
|
-
* handler: (c) => {
|
|
122
|
-
* const user = c.get('user');
|
|
123
|
-
* return c.html(<ProfilePage user={user} />);
|
|
124
|
-
* }
|
|
125
|
-
* });
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* @param opts - Route configuration and handler
|
|
129
|
-
* @returns Route definition
|
|
130
|
-
*/
|
|
22
|
+
/** Defines a JSX route that renders server-side HTML via c.html(). */
|
|
131
23
|
defineJSXRoute<RouteConfig extends IAuthRouteConfig, ResponseType = unknown>(opts: {
|
|
132
24
|
configs: RouteConfig;
|
|
133
25
|
handler: TRouteHandler<ResponseType, RouteEnv>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/base/controllers/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,MAAM,gBAAgB,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/base/controllers/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,MAAM,gBAAgB,CAAC;AAExB,sGAAsG;AACtG,8BAAsB,cAAc,CAClC,QAAQ,SAAS,GAAG,GAAG,GAAG,EAC1B,WAAW,SAAS,MAAM,GAA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,CAAC,CAAC;QAC/C,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;KACzD,GAAG,mBAAmB,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC;CAStE"}
|
|
@@ -2,70 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseController = void 0;
|
|
4
4
|
const abstract_1 = require("./abstract");
|
|
5
|
-
/**
|
|
6
|
-
* Base controller class with default implementations for route binding.
|
|
7
|
-
*
|
|
8
|
-
* Extends {@link AbstractController} with concrete implementations of
|
|
9
|
-
* {@link bindRoute} and {@link defineRoute}. This is the recommended
|
|
10
|
-
* base class for creating custom controllers.
|
|
11
|
-
*
|
|
12
|
-
* @typeParam RouteEnv - Hono environment type for context variables
|
|
13
|
-
* @typeParam RouteSchema - Combined schema type for all routes
|
|
14
|
-
* @typeParam BasePath - Base path prefix for the router
|
|
15
|
-
* @typeParam ConfigurableOptions - Options passed during configuration
|
|
16
|
-
* @typeParam Definitions - Route definitions map type for strongly-typed method overrides
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* class UserController extends BaseController {
|
|
21
|
-
* async binding() {
|
|
22
|
-
* // Define routes using defineRoute
|
|
23
|
-
* this.defineRoute({
|
|
24
|
-
* configs: {
|
|
25
|
-
* path: '/',
|
|
26
|
-
* method: 'get',
|
|
27
|
-
* authenticate: { strategies: ['jwt'] },
|
|
28
|
-
* responses: { 200: jsonResponse({ schema: UserSchema }) }
|
|
29
|
-
* },
|
|
30
|
-
* handler: async (c) => {
|
|
31
|
-
* const users = await this.userService.findAll();
|
|
32
|
-
* return c.json(users);
|
|
33
|
-
* }
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* // Or use fluent bindRoute pattern
|
|
37
|
-
* this.bindRoute({
|
|
38
|
-
* configs: { path: '/{id}', method: 'get', ... }
|
|
39
|
-
* }).to({
|
|
40
|
-
* handler: (c) => c.json({ id: c.req.param('id') })
|
|
41
|
-
* });
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
5
|
+
/** Recommended base class for controllers with concrete bindRoute and defineRoute implementations. */
|
|
46
6
|
class BaseController extends abstract_1.AbstractController {
|
|
47
|
-
/**
|
|
48
|
-
* Helper method to cast to Hono OpenAPI Handler
|
|
49
|
-
*/
|
|
7
|
+
/** Casts handler to Hono OpenAPI Handler type. */
|
|
50
8
|
toHonoHandler(opts) {
|
|
51
9
|
return opts.handler;
|
|
52
10
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Creates a fluent binding for registering a route.
|
|
55
|
-
*
|
|
56
|
-
* Returns an object with a `to()` method for attaching the handler.
|
|
57
|
-
* Useful for conditional binding or when you need access to the binding object.
|
|
58
|
-
*
|
|
59
|
-
* @typeParam RouteConfig - The route configuration type
|
|
60
|
-
* @param opts - Object containing route configuration
|
|
61
|
-
* @returns Binding options with `to()` method
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const binding = this.bindRoute({ configs: myRouteConfig });
|
|
66
|
-
* binding.to({ handler: myHandler });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
11
|
+
/** Creates a fluent binding for registering a route (call .to() to attach handler). */
|
|
69
12
|
bindRoute(opts) {
|
|
70
13
|
const routeConfigs = this.getRouteConfigs({ configs: opts.configs });
|
|
71
14
|
return {
|
|
@@ -78,34 +21,7 @@ class BaseController extends abstract_1.AbstractController {
|
|
|
78
21
|
},
|
|
79
22
|
};
|
|
80
23
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Defines and registers a route with its handler in a single call.
|
|
83
|
-
*
|
|
84
|
-
* This is the preferred method for registering routes. It automatically:
|
|
85
|
-
* - Processes authentication strategies into middleware
|
|
86
|
-
* - Adds OpenAPI security requirements
|
|
87
|
-
* - Tags the route with the controller scope
|
|
88
|
-
*
|
|
89
|
-
* @typeParam RouteConfig - The route configuration type
|
|
90
|
-
* @param opts - Object containing route config, handler, and optional hook
|
|
91
|
-
* @returns The registered route definition
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* ```typescript
|
|
95
|
-
* this.defineRoute({
|
|
96
|
-
* configs: {
|
|
97
|
-
* path: '/users',
|
|
98
|
-
* method: 'get',
|
|
99
|
-
* authenticate: { strategies: ['jwt'] },
|
|
100
|
-
* responses: { 200: jsonResponse({ schema: z.array(UserSchema) }) }
|
|
101
|
-
* },
|
|
102
|
-
* handler: async (c) => {
|
|
103
|
-
* const users = await db.select().from(usersTable);
|
|
104
|
-
* return c.json(users, 200);
|
|
105
|
-
* }
|
|
106
|
-
* });
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
24
|
+
/** Defines and registers a route with its handler in a single call. */
|
|
109
25
|
defineRoute(opts) {
|
|
110
26
|
const routeConfigs = this.getRouteConfigs({ configs: opts.configs });
|
|
111
27
|
return {
|
|
@@ -113,31 +29,7 @@ class BaseController extends abstract_1.AbstractController {
|
|
|
113
29
|
route: this.router.openapi(routeConfigs, this.toHonoHandler({ handler: opts.handler }), opts.hook),
|
|
114
30
|
};
|
|
115
31
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Define a JSX route that renders server-side HTML
|
|
118
|
-
* Scope: [BaseController][defineJSXRoute]
|
|
119
|
-
*
|
|
120
|
-
* JSX routes use Hono's built-in JSX support to render components to HTML.
|
|
121
|
-
* The handler must return c.html() with the JSX component.
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* ```typescript
|
|
125
|
-
* this.defineJSXRoute({
|
|
126
|
-
* configs: {
|
|
127
|
-
* path: '/profile',
|
|
128
|
-
* method: 'get',
|
|
129
|
-
* description: 'User profile page',
|
|
130
|
-
* },
|
|
131
|
-
* handler: (c) => {
|
|
132
|
-
* const user = c.get('user');
|
|
133
|
-
* return c.html(<ProfilePage user={user} />);
|
|
134
|
-
* }
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*
|
|
138
|
-
* @param opts - Route configuration and handler
|
|
139
|
-
* @returns Route definition
|
|
140
|
-
*/
|
|
32
|
+
/** Defines a JSX route that renders server-side HTML via c.html(). */
|
|
141
33
|
defineJSXRoute(opts) {
|
|
142
34
|
const routeConfigs = this.getJSXRouteConfigs({ configs: opts.configs });
|
|
143
35
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/base/controllers/base.ts"],"names":[],"mappings":";;;AAGA,yCAAgD;AAQhD
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/base/controllers/base.ts"],"names":[],"mappings":";;;AAGA,yCAAgD;AAQhD,sGAAsG;AACtG,MAAsB,cAMpB,SAAQ,6BAAqF;IAC7F,kDAAkD;IAClD,aAAa,CAAyB,IAAwD;QAC5F,OAAO,IAAI,CAAC,OAA0D,CAAC;IACzE,CAAC;IAED,uFAAuF;IACvF,SAAS,CAAuC,IAE/C;QACC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAc,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAElF,OAAO;YACL,OAAO,EAAE,YAAY;YACrB,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;gBAClB,OAAO;oBACL,OAAO,EAAE,YAAY;oBACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;iBAC1E,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAED,uEAAuE;IACvE,WAAW,CAA+D,IAIzE;QACC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAc,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAElF,OAAO;YACL,OAAO,EAAE,YAAY;YACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,YAAY,EACZ,IAAI,CAAC,aAAa,CAAe,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAC3D,IAAI,CAAC,IAAI,CACV;SACF,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,cAAc,CAA+D,IAI5E;QACC,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAc,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAErF,OAAO;YACL,OAAO,EAAE,YAAY;YACrB,sEAAsE;YACtE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,OAAc,EAAE,IAAI,CAAC,IAAI,CAAC;SACzE,CAAC;IACJ,CAAC;CACF;AA7DD,wCA6DC"}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi';
|
|
2
2
|
import { TResponseHeaders } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Standard REST API path constants for CRUD controllers.
|
|
5
|
-
*
|
|
6
|
-
* These paths are used by {@link ControllerFactory} to define consistent
|
|
7
|
-
* endpoint patterns across all generated controllers.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // Combined with controller basePath:
|
|
12
|
-
* // basePath: '/users'
|
|
13
|
-
* // GET /users → find all (RestPaths.ROOT)
|
|
14
|
-
* // GET /users/count → count (RestPaths.COUNT)
|
|
15
|
-
* // GET /users/find-one → find one (RestPaths.FIND_ONE)
|
|
16
|
-
* // GET /users/:id → find by id
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
3
|
+
/** Standard REST API path constants for CRUD controllers. */
|
|
19
4
|
export declare class RestPaths {
|
|
20
5
|
static readonly ROOT = "/";
|
|
21
6
|
static readonly COUNT = "/count";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/base/controllers/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/base/controllers/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,6DAA6D;AAC7D,qBAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,CAAC,IAAI,OAAO;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,YAAY;IACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,eAAe;CACxC;AAED,eAAO,MAAM,gBAAgB;;;;iBAkB3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;iBAS3B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;iBAAkD,CAAC;AAErF,eAAO,MAAM,qBAAqB,EAAE,gBAanC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC"}
|
|
@@ -3,31 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.findResponseHeaders = exports.commonResponseHeaders = exports.defaultRequestHeaders = exports.countableHeaders = exports.trackableHeaders = exports.RestPaths = void 0;
|
|
4
4
|
const ignis_helpers_1 = require("@venizia/ignis-helpers");
|
|
5
5
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
6
|
-
/**
|
|
7
|
-
* Standard REST API path constants for CRUD controllers.
|
|
8
|
-
*
|
|
9
|
-
* These paths are used by {@link ControllerFactory} to define consistent
|
|
10
|
-
* endpoint patterns across all generated controllers.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Combined with controller basePath:
|
|
15
|
-
* // basePath: '/users'
|
|
16
|
-
* // GET /users → find all (RestPaths.ROOT)
|
|
17
|
-
* // GET /users/count → count (RestPaths.COUNT)
|
|
18
|
-
* // GET /users/find-one → find one (RestPaths.FIND_ONE)
|
|
19
|
-
* // GET /users/:id → find by id
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
6
|
+
/** Standard REST API path constants for CRUD controllers. */
|
|
22
7
|
class RestPaths {
|
|
23
8
|
static { this.ROOT = '/'; }
|
|
24
9
|
static { this.COUNT = '/count'; }
|
|
25
10
|
static { this.FIND_ONE = '/find-one'; }
|
|
26
11
|
}
|
|
27
12
|
exports.RestPaths = RestPaths;
|
|
28
|
-
// -----------------------------------------------------------------------------
|
|
29
|
-
// Default Headers
|
|
30
|
-
// -----------------------------------------------------------------------------
|
|
31
13
|
exports.trackableHeaders = zod_openapi_1.z.object({
|
|
32
14
|
[ignis_helpers_1.HTTP.Headers.REQUEST_TRACING_ID]: zod_openapi_1.z.string().optional().openapi({
|
|
33
15
|
description: 'Optional request ID',
|
|
@@ -57,7 +39,6 @@ exports.countableHeaders = zod_openapi_1.z.object({
|
|
|
57
39
|
}),
|
|
58
40
|
});
|
|
59
41
|
exports.defaultRequestHeaders = exports.trackableHeaders.extend(exports.countableHeaders.shape);
|
|
60
|
-
// Default response headers (OpenAPI Header Object format)
|
|
61
42
|
exports.commonResponseHeaders = {
|
|
62
43
|
[ignis_helpers_1.HTTP.Headers.REQUEST_TRACING_ID]: {
|
|
63
44
|
description: 'Echo of the request tracing ID',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/base/controllers/common/constants.ts"],"names":[],"mappings":";;;AAAA,0DAA8C;AAC9C,mDAAsC;AAGtC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/base/controllers/common/constants.ts"],"names":[],"mappings":";;;AAAA,0DAA8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