@rockster/core 0.0.2 → 0.1.0
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/access/access.module.d.ts +11 -0
- package/access/access.module.js +56 -0
- package/access/access.module.js.map +1 -0
- package/access/constants.d.ts +2 -0
- package/access/constants.js +6 -0
- package/access/constants.js.map +1 -0
- package/access/controllers/controllers.d.ts +7 -0
- package/access/controllers/controllers.js +18 -0
- package/access/controllers/controllers.js.map +1 -0
- package/access/controllers/scope-access-profile.controller.d.ts +17 -0
- package/access/controllers/scope-access-profile.controller.js +111 -0
- package/access/controllers/scope-access-profile.controller.js.map +1 -0
- package/access/controllers/scope-group-user.controller.d.ts +20 -0
- package/access/controllers/scope-group-user.controller.js +132 -0
- package/access/controllers/scope-group-user.controller.js.map +1 -0
- package/access/controllers/scope-group.controller.d.ts +22 -0
- package/access/controllers/scope-group.controller.js +177 -0
- package/access/controllers/scope-group.controller.js.map +1 -0
- package/access/controllers/scope-key.controller.d.ts +7 -0
- package/access/controllers/scope-key.controller.js +45 -0
- package/access/controllers/scope-key.controller.js.map +1 -0
- package/access/controllers/scope-owner.controller.d.ts +9 -0
- package/access/controllers/scope-owner.controller.js +80 -0
- package/access/controllers/scope-owner.controller.js.map +1 -0
- package/access/controllers/scope-user.controller.d.ts +14 -0
- package/access/controllers/scope-user.controller.js +109 -0
- package/access/controllers/scope-user.controller.js.map +1 -0
- package/access/decorators/context-params.decorator.d.ts +2 -0
- package/access/decorators/context-params.decorator.js +13 -0
- package/access/decorators/context-params.decorator.js.map +1 -0
- package/access/decorators/index.d.ts +2 -0
- package/access/decorators/index.js +19 -0
- package/access/decorators/index.js.map +1 -0
- package/access/decorators/scope-context-id-resolver.decorator.d.ts +10 -0
- package/access/decorators/scope-context-id-resolver.decorator.js +22 -0
- package/access/decorators/scope-context-id-resolver.decorator.js.map +1 -0
- package/access/entities/entities.d.ts +8 -0
- package/access/entities/entities.js +22 -0
- package/access/entities/entities.js.map +1 -0
- package/access/entities/index.d.ts +7 -0
- package/access/entities/index.js +24 -0
- package/access/entities/index.js.map +1 -0
- package/access/entities/scope-access-profile-key.d.ts +6 -0
- package/access/entities/scope-access-profile-key.js +40 -0
- package/access/entities/scope-access-profile-key.js.map +1 -0
- package/access/entities/scope-access-profile.d.ts +6 -0
- package/access/entities/scope-access-profile.js +37 -0
- package/access/entities/scope-access-profile.js.map +1 -0
- package/access/entities/scope-access.d.ts +9 -0
- package/access/entities/scope-access.js +58 -0
- package/access/entities/scope-access.js.map +1 -0
- package/access/entities/scope-group-user.d.ts +7 -0
- package/access/entities/scope-group-user.js +47 -0
- package/access/entities/scope-group-user.js.map +1 -0
- package/access/entities/scope-group.d.ts +12 -0
- package/access/entities/scope-group.js +72 -0
- package/access/entities/scope-group.js.map +1 -0
- package/access/entities/scope-key.d.ts +5 -0
- package/access/entities/scope-key.js +35 -0
- package/access/entities/scope-key.js.map +1 -0
- package/access/entities/scope-owner.d.ts +7 -0
- package/access/entities/scope-owner.js +45 -0
- package/access/entities/scope-owner.js.map +1 -0
- package/access/env.d.ts +10 -0
- package/access/env.js +10 -0
- package/access/env.js.map +1 -0
- package/access/functions/assert-context-admin-access.d.ts +15 -0
- package/access/functions/assert-context-admin-access.js +62 -0
- package/access/functions/assert-context-admin-access.js.map +1 -0
- package/access/functions/assert-master-or-owner.d.ts +9 -0
- package/access/functions/assert-master-or-owner.js +40 -0
- package/access/functions/assert-master-or-owner.js.map +1 -0
- package/access/functions/assert-scope-action-access.d.ts +32 -0
- package/access/functions/assert-scope-action-access.js +189 -0
- package/access/functions/assert-scope-action-access.js.map +1 -0
- package/access/functions/build-scope-resolver-initial-data.d.ts +4 -0
- package/access/functions/build-scope-resolver-initial-data.js +17 -0
- package/access/functions/build-scope-resolver-initial-data.js.map +1 -0
- package/access/functions/describe-action-scope.d.ts +9 -0
- package/access/functions/describe-action-scope.js +27 -0
- package/access/functions/describe-action-scope.js.map +1 -0
- package/access/functions/get-context-id-service.d.ts +1 -0
- package/access/functions/get-context-id-service.js +8 -0
- package/access/functions/get-context-id-service.js.map +1 -0
- package/access/functions/get-is-owner.d.ts +1 -0
- package/access/functions/get-is-owner.js +8 -0
- package/access/functions/get-is-owner.js.map +1 -0
- package/access/functions/get-user-keys.d.ts +2 -0
- package/access/functions/get-user-keys.js +10 -0
- package/access/functions/get-user-keys.js.map +1 -0
- package/access/functions/index.d.ts +8 -0
- package/access/functions/index.js +25 -0
- package/access/functions/index.js.map +1 -0
- package/access/functions/init-scope-service-executors.d.ts +3 -0
- package/access/functions/init-scope-service-executors.js +38 -0
- package/access/functions/init-scope-service-executors.js.map +1 -0
- package/access/functions/normalize-scope-keys.d.ts +4 -0
- package/access/functions/normalize-scope-keys.js +17 -0
- package/access/functions/normalize-scope-keys.js.map +1 -0
- package/access/functions/register-scope.d.ts +19 -0
- package/access/functions/register-scope.js +94 -0
- package/access/functions/register-scope.js.map +1 -0
- package/access/functions/resolve-scope-context-id.d.ts +9 -0
- package/access/functions/resolve-scope-context-id.js +71 -0
- package/access/functions/resolve-scope-context-id.js.map +1 -0
- package/access/functions/warn-if-public.d.ts +12 -0
- package/access/functions/warn-if-public.js +20 -0
- package/access/functions/warn-if-public.js.map +1 -0
- package/access/index.d.ts +7 -0
- package/access/index.js +24 -0
- package/access/index.js.map +1 -0
- package/access/interfaces/index.d.ts +3 -0
- package/access/interfaces/index.js +20 -0
- package/access/interfaces/index.js.map +1 -0
- package/access/interfaces/resolve-scope-context-id.d.ts +21 -0
- package/access/interfaces/resolve-scope-context-id.js +3 -0
- package/access/interfaces/resolve-scope-context-id.js.map +1 -0
- package/access/interfaces/scope-service-registry.d.ts +21 -0
- package/access/interfaces/scope-service-registry.js +3 -0
- package/access/interfaces/scope-service-registry.js.map +1 -0
- package/access/interfaces/scope-service.d.ts +11 -0
- package/{database/interfaces/protector.js → access/interfaces/scope-service.js} +1 -1
- package/access/interfaces/scope-service.js.map +1 -0
- package/access/models/scope-access-profile-keys-update.d.ts +5 -0
- package/access/models/scope-access-profile-keys-update.js +27 -0
- package/access/models/scope-access-profile-keys-update.js.map +1 -0
- package/access/models/scope-context.d.ts +4 -0
- package/access/models/scope-context.js +27 -0
- package/access/models/scope-context.js.map +1 -0
- package/access/models/scope-group-apply-access-profile.d.ts +6 -0
- package/access/models/scope-group-apply-access-profile.js +32 -0
- package/access/models/scope-group-apply-access-profile.js.map +1 -0
- package/access/models/scope-keys-update.d.ts +7 -0
- package/access/models/scope-keys-update.js +38 -0
- package/access/models/scope-keys-update.js.map +1 -0
- package/access/models/scope-owner.d.ts +5 -0
- package/access/models/scope-owner.js +32 -0
- package/access/models/scope-owner.js.map +1 -0
- package/access/models/scope-user-mapped.d.ts +9 -0
- package/access/models/scope-user-mapped.js +48 -0
- package/access/models/scope-user-mapped.js.map +1 -0
- package/access/models/scope-user.d.ts +9 -0
- package/access/models/scope-user.js +51 -0
- package/access/models/scope-user.js.map +1 -0
- package/access/queries/scope-access-profile.query.d.ts +1 -0
- package/access/queries/scope-access-profile.query.js +10 -0
- package/access/queries/scope-access-profile.query.js.map +1 -0
- package/access/queries/scope-group-user.query.d.ts +1 -0
- package/access/queries/scope-group-user.query.js +26 -0
- package/access/queries/scope-group-user.query.js.map +1 -0
- package/access/queries/scope-group.query.d.ts +1 -0
- package/access/queries/scope-group.query.js +19 -0
- package/access/queries/scope-group.query.js.map +1 -0
- package/access/services/index.d.ts +7 -0
- package/access/services/index.js +24 -0
- package/access/services/index.js.map +1 -0
- package/access/services/scope-access-profile.service.d.ts +13 -0
- package/access/services/scope-access-profile.service.js +75 -0
- package/access/services/scope-access-profile.service.js.map +1 -0
- package/access/services/scope-access.service.d.ts +11 -0
- package/access/services/scope-access.service.js +89 -0
- package/access/services/scope-access.service.js.map +1 -0
- package/access/services/scope-group-user.service.d.ts +8 -0
- package/access/services/scope-group-user.service.js +49 -0
- package/access/services/scope-group-user.service.js.map +1 -0
- package/access/services/scope-group.service.d.ts +17 -0
- package/access/services/scope-group.service.js +75 -0
- package/access/services/scope-group.service.js.map +1 -0
- package/access/services/scope-key.service.d.ts +9 -0
- package/access/services/scope-key.service.js +52 -0
- package/access/services/scope-key.service.js.map +1 -0
- package/access/services/scope-owner.service.d.ts +10 -0
- package/access/services/scope-owner.service.js +60 -0
- package/access/services/scope-owner.service.js.map +1 -0
- package/access/services/scope-service.d.ts +10 -0
- package/access/services/scope-service.js +52 -0
- package/access/services/scope-service.js.map +1 -0
- package/command/functions/execute-post.js +5 -7
- package/command/functions/execute-post.js.map +1 -1
- package/command/services/post-action-builder.js +21 -17
- package/command/services/post-action-builder.js.map +1 -1
- package/command/services/remove-action-builder.js +32 -22
- package/command/services/remove-action-builder.js.map +1 -1
- package/common/entities/base-entity.js +2 -0
- package/common/entities/base-entity.js.map +1 -1
- package/common/interfaces/enum/object-type.d.ts +2 -1
- package/common/interfaces/enum/object-type.js +1 -0
- package/common/interfaces/enum/object-type.js.map +1 -1
- package/controllers/constants/controller-transaction.d.ts +2 -0
- package/controllers/constants/controller-transaction.js +6 -0
- package/controllers/constants/controller-transaction.js.map +1 -0
- package/controllers/controller.controller.d.ts +1 -1
- package/controllers/controller.controller.js +4 -4
- package/controllers/controller.controller.js.map +1 -1
- package/controllers/decorators/controller.decorator.js +8 -0
- package/controllers/decorators/controller.decorator.js.map +1 -1
- package/controllers/decorators/index.d.ts +1 -0
- package/controllers/decorators/index.js +1 -0
- package/controllers/decorators/index.js.map +1 -1
- package/controllers/decorators/transaction.decorator.d.ts +7 -0
- package/controllers/decorators/transaction.decorator.js +23 -0
- package/controllers/decorators/transaction.decorator.js.map +1 -0
- package/controllers/interfaces/controller-object.d.ts +1 -0
- package/controllers/interfaces/controller-options.d.ts +1 -0
- package/controllers/interfaces/controller-property.d.ts +9 -0
- package/controllers/services/default-action-builder.js +14 -0
- package/controllers/services/default-action-builder.js.map +1 -1
- package/controllers/services/restful-action-builder.js +25 -1
- package/controllers/services/restful-action-builder.js.map +1 -1
- package/core/contexts/request-context.d.ts +5 -0
- package/core/contexts/request-context.js +6 -0
- package/core/contexts/request-context.js.map +1 -0
- package/core/core.controller.d.ts +1 -0
- package/core/core.controller.js +15 -2
- package/core/core.controller.js.map +1 -1
- package/core/functions/create-interceptor.js +2 -2
- package/core/functions/create-interceptor.js.map +1 -1
- package/core/functions/resolve-action-transactional.d.ts +3 -0
- package/core/functions/resolve-action-transactional.js +10 -0
- package/core/functions/resolve-action-transactional.js.map +1 -0
- package/core/interfaces/action-def.d.ts +2 -5
- package/core/interfaces/action-docs.d.ts +15 -0
- package/core/interfaces/action-handle.d.ts +5 -0
- package/core/interfaces/action-handle.js +3 -0
- package/core/interfaces/action-handle.js.map +1 -0
- package/core/interfaces/core-options.d.ts +1 -0
- package/core/interfaces/interceptor.d.ts +1 -1
- package/core/interfaces/object.d.ts +3 -2
- package/core/interfaces/request-context.d.ts +7 -2
- package/core/services/request-executor.d.ts +8 -0
- package/core/services/request-executor.js +88 -0
- package/core/services/request-executor.js.map +1 -1
- package/core/services/request-router.js +5 -4
- package/core/services/request-router.js.map +1 -1
- package/database/database.controller.d.ts +1 -3
- package/database/database.controller.js +1 -5
- package/database/database.controller.js.map +1 -1
- package/database/decorators/entity.decorator.d.ts +3 -1
- package/database/decorators/entity.decorator.js +14 -5
- package/database/decorators/entity.decorator.js.map +1 -1
- package/database/decorators/external-column.decorator.d.ts +17 -0
- package/database/decorators/external-column.decorator.js +30 -0
- package/database/decorators/external-column.decorator.js.map +1 -0
- package/database/decorators/index.d.ts +1 -0
- package/database/decorators/index.js +1 -0
- package/database/decorators/index.js.map +1 -1
- package/database/decorators/protect-entity.decorator.d.ts +1 -0
- package/database/decorators/protect-entity.decorator.js +2 -3
- package/database/decorators/protect-entity.decorator.js.map +1 -1
- package/database/decorators/protected-entity.decorator.d.ts +1 -0
- package/database/decorators/protected-entity.decorator.js +2 -16
- package/database/decorators/protected-entity.decorator.js.map +1 -1
- package/database/decorators/relation.decorator.d.ts +2 -2
- package/database/decorators/relation.decorator.js.map +1 -1
- package/database/extensions/select-query-builder.d.ts +1 -5
- package/database/extensions/select-query-builder.js.map +1 -1
- package/database/functions/find-relation.d.ts +2 -1
- package/database/functions/find-relation.js +3 -3
- package/database/functions/find-relation.js.map +1 -1
- package/database/functions/generate-entity-id.d.ts +2 -0
- package/database/functions/{generate-id.js → generate-entity-id.js} +3 -3
- package/database/functions/generate-entity-id.js.map +1 -0
- package/database/functions/get-relations.d.ts +1 -1
- package/database/functions/inject-repository-handle.js +4 -3
- package/database/functions/inject-repository-handle.js.map +1 -1
- package/database/functions/use-transaction.d.ts +1 -0
- package/database/functions/use-transaction.js +2 -6
- package/database/functions/use-transaction.js.map +1 -1
- package/database/interfaces/entity-dto-object.d.ts +7 -0
- package/database/interfaces/entity-dto-object.js +3 -0
- package/database/interfaces/entity-dto-object.js.map +1 -0
- package/database/interfaces/entity-object.d.ts +0 -6
- package/database/interfaces/entity-property.d.ts +12 -0
- package/database/interfaces/index.d.ts +0 -1
- package/database/interfaces/index.js +0 -1
- package/database/interfaces/index.js.map +1 -1
- package/database/interfaces/path.d.ts +6 -2
- package/database/interfaces/repository.d.ts +8 -8
- package/database/interfaces/virtual-select.d.ts +4 -0
- package/database/interfaces/virtual-select.js +3 -0
- package/database/interfaces/virtual-select.js.map +1 -0
- package/database/services/repository.service.d.ts +1 -1
- package/database/services/repository.service.js +3 -6
- package/database/services/repository.service.js.map +1 -1
- package/docs/docs.module.js +3 -1
- package/docs/docs.module.js.map +1 -1
- package/docs/migrations/1747584000000-CreateDocsTables.d.ts +5 -0
- package/docs/migrations/1747584000000-CreateDocsTables.js +90 -0
- package/docs/migrations/1747584000000-CreateDocsTables.js.map +1 -0
- package/docs/migrations/migrations.d.ts +2 -0
- package/docs/migrations/migrations.js +8 -0
- package/docs/migrations/migrations.js.map +1 -0
- package/docs/queries/docs-controller-action.query.d.ts +1 -1
- package/docs/queries/docs-controller.query.d.ts +1 -1
- package/docs/queries/docs-model.query.d.ts +1 -1
- package/docs/queries/docs-model.query.js +1 -1
- package/docs/queries/docs-model.query.js.map +1 -1
- package/docs/queries/docs-version.query.d.ts +1 -1
- package/docs/services/docs-version.service.js +6 -3
- package/docs/services/docs-version.service.js.map +1 -1
- package/forms/queries/form.query.d.ts +1 -1
- package/forms/queries/property.query.d.ts +1 -1
- package/global.d.ts +2 -0
- package/global.js +2 -1
- package/global.js.map +1 -1
- package/http/http.controller.d.ts +2 -0
- package/http/http.controller.js +3 -2
- package/http/http.controller.js.map +1 -1
- package/index.d.ts +5 -2
- package/index.js +4 -7
- package/index.js.map +1 -1
- package/jobs/jobs.controller.d.ts +2 -0
- package/jobs/jobs.controller.js +22 -16
- package/jobs/jobs.controller.js.map +1 -1
- package/package.json +70 -69
- package/query/functions/add-join.js +8 -16
- package/query/functions/add-join.js.map +1 -1
- package/query/functions/collect-external-column-owners.d.ts +10 -0
- package/query/functions/collect-external-column-owners.js +100 -0
- package/query/functions/collect-external-column-owners.js.map +1 -0
- package/query/functions/create-query-builder.js +47 -28
- package/query/functions/create-query-builder.js.map +1 -1
- package/query/functions/create-query-cache-hash.d.ts +16 -0
- package/query/functions/create-query-cache-hash.js +70 -0
- package/query/functions/create-query-cache-hash.js.map +1 -0
- package/query/functions/create-query.d.ts +8 -3
- package/query/functions/create-query.js +12 -9
- package/query/functions/create-query.js.map +1 -1
- package/query/functions/describe-query-filter.js +3 -2
- package/query/functions/describe-query-filter.js.map +1 -1
- package/query/functions/execute-query.js +89 -9
- package/query/functions/execute-query.js.map +1 -1
- package/query/functions/expand-select-with-external-dependencies.d.ts +9 -0
- package/query/functions/expand-select-with-external-dependencies.js +34 -0
- package/query/functions/expand-select-with-external-dependencies.js.map +1 -0
- package/query/functions/external-column-owner-path.d.ts +5 -0
- package/query/functions/external-column-owner-path.js +18 -0
- package/query/functions/external-column-owner-path.js.map +1 -0
- package/query/functions/get-entity-object-class.d.ts +2 -0
- package/query/functions/get-entity-object-class.js +12 -0
- package/query/functions/get-entity-object-class.js.map +1 -0
- package/query/functions/get-native-select.js +3 -0
- package/query/functions/get-native-select.js.map +1 -1
- package/query/functions/load-properties.d.ts +20 -2
- package/query/functions/load-properties.js +190 -40
- package/query/functions/load-properties.js.map +1 -1
- package/query/functions/map-query-property-to-column-name.js +1 -1
- package/query/functions/map-query-property-to-column-name.js.map +1 -1
- package/query/functions/query-structure-cache.d.ts +24 -0
- package/query/functions/query-structure-cache.js +66 -0
- package/query/functions/query-structure-cache.js.map +1 -0
- package/query/interfaces/query.d.ts +44 -1
- package/query/services/query-action-builder.d.ts +4 -1
- package/query/services/query-action-builder.js +26 -12
- package/query/services/query-action-builder.js.map +1 -1
- package/remote-logs/dtos/index.d.ts +2 -0
- package/remote-logs/dtos/index.js +19 -0
- package/remote-logs/dtos/index.js.map +1 -0
- package/remote-logs/dtos/remote-log-hooks.dto.d.ts +72 -0
- package/remote-logs/dtos/remote-log-hooks.dto.js +280 -0
- package/remote-logs/dtos/remote-log-hooks.dto.js.map +1 -0
- package/remote-logs/dtos/remote-log-search.dto.d.ts +34 -0
- package/remote-logs/dtos/remote-log-search.dto.js +146 -0
- package/remote-logs/dtos/remote-log-search.dto.js.map +1 -0
- package/remote-logs/environment.d.ts +4 -0
- package/remote-logs/environment.js +5 -0
- package/remote-logs/environment.js.map +1 -0
- package/remote-logs/index.d.ts +3 -0
- package/remote-logs/index.js +20 -0
- package/remote-logs/index.js.map +1 -0
- package/remote-logs/interfaces/index.d.ts +1 -0
- package/remote-logs/interfaces/index.js +18 -0
- package/remote-logs/interfaces/index.js.map +1 -0
- package/remote-logs/interfaces/remote-logs-module-options.d.ts +8 -0
- package/remote-logs/interfaces/remote-logs-module-options.js +3 -0
- package/remote-logs/interfaces/remote-logs-module-options.js.map +1 -0
- package/remote-logs/remote-logs-hooks.controller.d.ts +60 -0
- package/remote-logs/remote-logs-hooks.controller.js +331 -0
- package/remote-logs/remote-logs-hooks.controller.js.map +1 -0
- package/remote-logs/remote-logs.controller.d.ts +8 -0
- package/remote-logs/remote-logs.controller.js +41 -0
- package/remote-logs/remote-logs.controller.js.map +1 -0
- package/remote-logs/remote-logs.module.d.ts +12 -0
- package/remote-logs/remote-logs.module.js +107 -0
- package/remote-logs/remote-logs.module.js.map +1 -0
- package/remote-logs/services/opensearch.service.d.ts +13 -0
- package/remote-logs/services/opensearch.service.js +167 -0
- package/remote-logs/services/opensearch.service.js.map +1 -0
- package/security/auth.controller.js +4 -4
- package/security/auth.controller.js.map +1 -1
- package/security/env.js.map +1 -1
- package/security/functions/add-protected.d.ts +2 -2
- package/security/functions/add-protected.js +8 -5
- package/security/functions/add-protected.js.map +1 -1
- package/security/functions/create-authentication-interceptor.d.ts +44 -0
- package/security/functions/create-authentication-interceptor.js +114 -0
- package/security/functions/create-authentication-interceptor.js.map +1 -0
- package/security/functions/find-auth-context.d.ts +1 -2
- package/security/functions/find-auth-context.js +6 -11
- package/security/functions/find-auth-context.js.map +1 -1
- package/security/index.d.ts +1 -0
- package/security/index.js +1 -0
- package/security/index.js.map +1 -1
- package/security/interfaces/authorization-schema.d.ts +3 -1
- package/security/requests/security.request.js +1 -1
- package/security/requests/security.request.js.map +1 -1
- package/security/services/authorization.service.d.ts +5 -3
- package/security/services/authorization.service.js +56 -37
- package/security/services/authorization.service.js.map +1 -1
- package/storage/services/routes.service.js +1 -1
- package/storage/services/routes.service.js.map +1 -1
- package/tasks/constants.d.ts +3 -0
- package/tasks/constants.js +2 -1
- package/tasks/constants.js.map +1 -1
- package/tasks/controllers/task.controller.d.ts +3 -2
- package/tasks/controllers/task.controller.js +11 -40
- package/tasks/controllers/task.controller.js.map +1 -1
- package/tasks/decorators/index.d.ts +1 -0
- package/tasks/decorators/index.js +1 -0
- package/tasks/decorators/index.js.map +1 -1
- package/tasks/decorators/task-payload.decorator.d.ts +1 -0
- package/tasks/decorators/task-payload.decorator.js +12 -0
- package/tasks/decorators/task-payload.decorator.js.map +1 -0
- package/tasks/decorators/task.decorator.js +6 -2
- package/tasks/decorators/task.decorator.js.map +1 -1
- package/tasks/functions/compile-all-task-post-hooks.d.ts +1 -0
- package/tasks/functions/compile-all-task-post-hooks.js +27 -0
- package/tasks/functions/compile-all-task-post-hooks.js.map +1 -0
- package/tasks/functions/compile-task-hook-handle.d.ts +6 -0
- package/tasks/functions/compile-task-hook-handle.js +67 -0
- package/tasks/functions/compile-task-hook-handle.js.map +1 -0
- package/tasks/functions/create-task-hook.d.ts +9 -0
- package/tasks/functions/create-task-hook.js +13 -0
- package/tasks/functions/create-task-hook.js.map +1 -0
- package/tasks/functions/{create-task-message-receptor.d.ts → create-task-message-post.d.ts} +1 -1
- package/tasks/functions/{create-task-message-receptor.js → create-task-message-post.js} +10 -3
- package/tasks/functions/create-task-message-post.js.map +1 -0
- package/tasks/functions/register-task-post-hook-interceptors.d.ts +3 -0
- package/tasks/functions/register-task-post-hook-interceptors.js +86 -0
- package/tasks/functions/register-task-post-hook-interceptors.js.map +1 -0
- package/tasks/functions/run-task-post-hooks.d.ts +11 -0
- package/tasks/functions/run-task-post-hooks.js +18 -0
- package/tasks/functions/run-task-post-hooks.js.map +1 -0
- package/tasks/functions/task-message-operations.d.ts +18 -0
- package/tasks/functions/task-message-operations.js +100 -0
- package/tasks/functions/task-message-operations.js.map +1 -0
- package/tasks/functions/validate-task-payload.d.ts +2 -0
- package/tasks/functions/validate-task-payload.js +19 -0
- package/tasks/functions/validate-task-payload.js.map +1 -0
- package/tasks/hook-constants.d.ts +2 -0
- package/tasks/hook-constants.js +6 -0
- package/tasks/hook-constants.js.map +1 -0
- package/tasks/index.d.ts +3 -0
- package/tasks/index.js +3 -0
- package/tasks/index.js.map +1 -1
- package/tasks/interfaces/compiled-task-post-hooks.d.ts +17 -0
- package/tasks/interfaces/compiled-task-post-hooks.js +3 -0
- package/tasks/interfaces/compiled-task-post-hooks.js.map +1 -0
- package/tasks/interfaces/index.d.ts +3 -0
- package/tasks/interfaces/index.js +3 -0
- package/tasks/interfaces/index.js.map +1 -1
- package/tasks/interfaces/task-hook.d.ts +16 -0
- package/tasks/interfaces/task-hook.js +8 -0
- package/tasks/interfaces/task-hook.js.map +1 -0
- package/tasks/interfaces/task-object.d.ts +6 -2
- package/tasks/interfaces/task-post-hook.d.ts +2 -0
- package/tasks/interfaces/task-post-hook.js +3 -0
- package/tasks/interfaces/task-post-hook.js.map +1 -0
- package/tasks/interfaces/task-post-intercept.d.ts +1 -8
- package/tasks/interfaces/task-runner.d.ts +2 -1
- package/tasks/interfaces/task-settings.d.ts +7 -0
- package/tasks/services/task-runner.service.d.ts +24 -3
- package/tasks/services/task-runner.service.js +68 -28
- package/tasks/services/task-runner.service.js.map +1 -1
- package/translations/controllers/translation.controller.js +12 -9
- package/translations/controllers/translation.controller.js.map +1 -1
- package/translations/functions/create-translation-values.js +2 -5
- package/translations/functions/create-translation-values.js.map +1 -1
- package/translations/migrations/1723760669185-CreateTranslationTables.js +3 -3
- package/translations/migrations/1723760669185-CreateTranslationTables.js.map +1 -1
- package/translations/queries/translation-config.query.d.ts +1 -1
- package/translations/queries/translation-values.query.d.ts +1 -1
- package/translations/queries/translation-values.query.js +1 -1
- package/translations/queries/translation-values.query.js.map +1 -1
- package/translations/translations.controller.d.ts +1 -1
- package/translations/translations.controller.js +4 -4
- package/translations/translations.controller.js.map +1 -1
- package/database/functions/generate-id.d.ts +0 -2
- package/database/functions/generate-id.js.map +0 -1
- package/database/functions/use-protector.d.ts +0 -2
- package/database/functions/use-protector.js +0 -11
- package/database/functions/use-protector.js.map +0 -1
- package/database/interfaces/protector.d.ts +0 -51
- package/database/interfaces/protector.js.map +0 -1
- package/database/services/protect-builder.d.ts +0 -59
- package/database/services/protect-builder.js +0 -524
- package/database/services/protect-builder.js.map +0 -1
- package/security/functions/add-protect.d.ts +0 -2
- package/security/functions/add-protect.js +0 -11
- package/security/functions/add-protect.js.map +0 -1
- package/tasks/functions/create-task-message-receptor.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { GetTypeCallback } from "@rockster/common";
|
|
2
|
+
import { TaskPostHook } from "./task-post-hook";
|
|
3
|
+
import { TaskPostIntercept } from "./task-post-intercept";
|
|
2
4
|
export interface ITaskSettings<T> {
|
|
3
5
|
/**Executor for any message */
|
|
4
6
|
input: GetTypeCallback;
|
|
@@ -12,4 +14,9 @@ export interface ITaskSettings<T> {
|
|
|
12
14
|
retentionDays?: number;
|
|
13
15
|
/**limit: 100. Indicates how many messages the runner will recieve to proccess*/
|
|
14
16
|
messagesLimit?: number;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `postHooks` instead.
|
|
19
|
+
*/
|
|
20
|
+
postInterceptors?: TaskPostIntercept[];
|
|
21
|
+
postHooks?: TaskPostHook[];
|
|
15
22
|
}
|
|
@@ -9,15 +9,36 @@ type TaskRunner = {
|
|
|
9
9
|
runner: ITaskRunner<any>;
|
|
10
10
|
repository: Repository<ITaskMessage>;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Worker-side task dispatcher: claims pending rows with `SKIP LOCKED`, runs runners concurrently
|
|
14
|
+
* up to {@link TaskRunnerService.maxConcurrentTaskMessages}, without blocking the poll interval on
|
|
15
|
+
* long-running `onRun` handlers.
|
|
16
|
+
*/
|
|
12
17
|
export declare class TaskRunnerService {
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Max concurrent task **messages** being executed at once (per worker thread / process).
|
|
20
|
+
* Tune here if workloads need more / less parallelism.
|
|
21
|
+
*/
|
|
22
|
+
static readonly maxConcurrentTaskMessages = 50;
|
|
23
|
+
/** @deprecated Reserved for future graceful shutdown hooks; not read by the runner today. */
|
|
14
24
|
private static done;
|
|
15
25
|
tasks: TaskRunner[];
|
|
26
|
+
/** Messages currently in `onRun` or DB update after run (best-effort counter). */
|
|
27
|
+
private inFlightCount;
|
|
28
|
+
/** Serializes {@link fillPool} so two ticks cannot claim overlapping capacity. */
|
|
29
|
+
private drainChain;
|
|
16
30
|
activeTimer(): void;
|
|
17
31
|
constructor();
|
|
32
|
+
/** How many task messages are executing right now (0 … {@link maxConcurrentTaskMessages}). */
|
|
33
|
+
getConcurrentInFlight(): number;
|
|
18
34
|
startRunner(object: ObjectNote<ITaskObject>): Promise<void>;
|
|
19
|
-
protected
|
|
20
|
-
|
|
35
|
+
protected scheduleFillPool(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Claims pending messages up to remaining global capacity and **starts** them without awaiting
|
|
38
|
+
* completion (each execution decrements {@link inFlightCount} in `finally`).
|
|
39
|
+
*/
|
|
40
|
+
protected fillPool(): Promise<void>;
|
|
41
|
+
protected executeTaskMessage(task: TaskRunner, message: TaskMessage<any>): Promise<void>;
|
|
21
42
|
protected mapMessage(row: any): TaskMessage<any>;
|
|
22
43
|
}
|
|
23
44
|
export {};
|
|
@@ -15,13 +15,28 @@ const get_pending_task_script_1 = require("../functions/get-pending-task-script"
|
|
|
15
15
|
const use_repository_1 = require("../../database/functions/use-repository");
|
|
16
16
|
const tasks_1 = require("@rockster/common/tasks");
|
|
17
17
|
const class_injector_1 = require("@rockster/class-injector");
|
|
18
|
+
/**
|
|
19
|
+
* Worker-side task dispatcher: claims pending rows with `SKIP LOCKED`, runs runners concurrently
|
|
20
|
+
* up to {@link TaskRunnerService.maxConcurrentTaskMessages}, without blocking the poll interval on
|
|
21
|
+
* long-running `onRun` handlers.
|
|
22
|
+
*/
|
|
18
23
|
let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
|
|
19
24
|
activeTimer() {
|
|
20
25
|
TaskRunnerService_1.done = true;
|
|
21
26
|
}
|
|
22
27
|
constructor() {
|
|
23
28
|
this.tasks = [];
|
|
24
|
-
|
|
29
|
+
/** Messages currently in `onRun` or DB update after run (best-effort counter). */
|
|
30
|
+
this.inFlightCount = 0;
|
|
31
|
+
/** Serializes {@link fillPool} so two ticks cannot claim overlapping capacity. */
|
|
32
|
+
this.drainChain = Promise.resolve();
|
|
33
|
+
setInterval(() => {
|
|
34
|
+
this.scheduleFillPool();
|
|
35
|
+
}, 500);
|
|
36
|
+
}
|
|
37
|
+
/** How many task messages are executing right now (0 … {@link maxConcurrentTaskMessages}). */
|
|
38
|
+
getConcurrentInFlight() {
|
|
39
|
+
return this.inFlightCount;
|
|
25
40
|
}
|
|
26
41
|
async startRunner(object) {
|
|
27
42
|
const runner = await (0, class_injector_1.createInstance)(object.objectClass);
|
|
@@ -29,57 +44,77 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
|
|
|
29
44
|
this.tasks.push({
|
|
30
45
|
object: object,
|
|
31
46
|
runner: runner,
|
|
32
|
-
repository: repository
|
|
47
|
+
repository: repository,
|
|
33
48
|
});
|
|
34
49
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
scheduleFillPool() {
|
|
51
|
+
this.drainChain = this.drainChain
|
|
52
|
+
.then(() => this.fillPool())
|
|
53
|
+
.catch(() => {
|
|
54
|
+
// Swallow: next interval will retry; avoid breaking the chain.
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Claims pending messages up to remaining global capacity and **starts** them without awaiting
|
|
59
|
+
* completion (each execution decrements {@link inFlightCount} in `finally`).
|
|
60
|
+
*/
|
|
61
|
+
async fillPool() {
|
|
62
|
+
const max = TaskRunnerService_1.maxConcurrentTaskMessages;
|
|
63
|
+
for (const task of this.tasks) {
|
|
64
|
+
while (this.inFlightCount < max) {
|
|
65
|
+
const room = max - this.inFlightCount;
|
|
66
|
+
const query = (0, get_pending_task_script_1.getPendingTaskScript)(task.object.naming, core.workerId, room);
|
|
67
|
+
const rows = (await task.repository.query(query))[0];
|
|
68
|
+
const rawMessages = Array.isArray(rows) ? rows : [];
|
|
69
|
+
if (rawMessages.length === 0) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
for (const row of rawMessages) {
|
|
73
|
+
const message = this.mapMessage(row);
|
|
74
|
+
this.inFlightCount++;
|
|
75
|
+
void this.executeTaskMessage(task, message).finally(() => {
|
|
76
|
+
this.inFlightCount--;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
44
79
|
}
|
|
45
|
-
TaskRunnerService_1.running = false;
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
TaskRunnerService_1.running = false;
|
|
49
80
|
}
|
|
50
81
|
}
|
|
51
|
-
async
|
|
82
|
+
async executeTaskMessage(task, message) {
|
|
52
83
|
const stopwatch = getTimer();
|
|
53
84
|
try {
|
|
54
85
|
stopwatch.start();
|
|
55
|
-
await task
|
|
56
|
-
|
|
57
|
-
.onRun({
|
|
58
|
-
message: message.payload
|
|
86
|
+
await task.runner.onRun({
|
|
87
|
+
message: message,
|
|
59
88
|
});
|
|
60
89
|
await task.repository.update({
|
|
61
90
|
id: message.id,
|
|
62
|
-
partitionId: message.partitionId
|
|
91
|
+
partitionId: message.partitionId,
|
|
63
92
|
}, {
|
|
64
93
|
status: tasks_1.TaskMessageStatus.completed,
|
|
65
94
|
lastModifiedAt: new Date(),
|
|
66
|
-
runtimeMs: stopwatch.stop()
|
|
95
|
+
runtimeMs: stopwatch.stop(),
|
|
96
|
+
payload: message.payload,
|
|
67
97
|
});
|
|
68
98
|
}
|
|
69
99
|
catch (error) {
|
|
70
100
|
const taskError = error;
|
|
71
|
-
|
|
72
|
-
|
|
101
|
+
const { message: errorDetail } = getErrorInfos(error);
|
|
102
|
+
taskError.infos = errorDetail;
|
|
103
|
+
if (errorDetail?.trim()) {
|
|
104
|
+
taskError.message = errorDetail.trim().split("\n")[0].trim();
|
|
105
|
+
}
|
|
106
|
+
const isExpose = error.constructor.name !== "Error";
|
|
73
107
|
await task.repository.update({
|
|
74
108
|
id: message.id,
|
|
75
|
-
partitionId: message.partitionId
|
|
109
|
+
partitionId: message.partitionId,
|
|
76
110
|
}, {
|
|
77
111
|
status: tasks_1.TaskMessageStatus.failed,
|
|
78
112
|
lastModifiedAt: new Date(),
|
|
79
113
|
attempts: message.attempts + 1,
|
|
80
114
|
runtimeMs: stopwatch.stop(),
|
|
81
115
|
internalError: taskError,
|
|
82
|
-
error: isExpose ? taskError : null
|
|
116
|
+
error: isExpose ? taskError : null,
|
|
117
|
+
payload: message.payload,
|
|
83
118
|
});
|
|
84
119
|
}
|
|
85
120
|
}
|
|
@@ -94,12 +129,17 @@ let TaskRunnerService = TaskRunnerService_1 = class TaskRunnerService {
|
|
|
94
129
|
error: row.error,
|
|
95
130
|
internalError: row.internal_error,
|
|
96
131
|
payload: row.payload,
|
|
97
|
-
runtimeMs: row.runtime_ms
|
|
132
|
+
runtimeMs: row.runtime_ms,
|
|
98
133
|
};
|
|
99
134
|
}
|
|
100
135
|
};
|
|
101
136
|
exports.TaskRunnerService = TaskRunnerService;
|
|
102
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Max concurrent task **messages** being executed at once (per worker thread / process).
|
|
139
|
+
* Tune here if workloads need more / less parallelism.
|
|
140
|
+
*/
|
|
141
|
+
TaskRunnerService.maxConcurrentTaskMessages = 50;
|
|
142
|
+
/** @deprecated Reserved for future graceful shutdown hooks; not read by the runner today. */
|
|
103
143
|
TaskRunnerService.done = false;
|
|
104
144
|
exports.TaskRunnerService = TaskRunnerService = TaskRunnerService_1 = __decorate([
|
|
105
145
|
(0, class_injector_1.Injectable)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-runner.service.js","sourceRoot":"./","sources":["tasks/services/task-runner.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,kFAA4E;AAE5E,4EAAwE;AACxE,kDAIgC;AAChC,6DAGkC;
|
|
1
|
+
{"version":3,"file":"task-runner.service.js","sourceRoot":"./","sources":["tasks/services/task-runner.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,kFAA4E;AAE5E,4EAAwE;AACxE,kDAIgC;AAChC,6DAGkC;AASlC;;;;GAIG;AAEI,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAkB3B,WAAW;QACR,mBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACjC,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AC,QAAQ;YACtB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,aAAa,EAAE,GAAG,CAAC,cAAc;YACjC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC;IACL,CAAC;;AA/IS,8CAAiB;AAC3B;;;GAGG;AACoB,2CAAyB,GAAG,EAAE,AAAL,CAAM;AAEtD,6FAA6F;AAC9E,sBAAI,GAAG,KAAK,AAAR,CAAS;4BARlB,iBAAiB;IAD7B,IAAA,2BAAU,GAAE;;GACA,iBAAiB,CAgJ7B"}
|
|
@@ -23,8 +23,11 @@ const get_values_request_1 = require("../models/get-values.request");
|
|
|
23
23
|
const get_values_response_1 = require("../models/get-values.response");
|
|
24
24
|
const translations_service_1 = require("../services/translations.service");
|
|
25
25
|
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
26
|
-
const
|
|
27
|
-
const
|
|
26
|
+
const controller_decorator_1 = require("../../controllers/decorators/controller.decorator");
|
|
27
|
+
const post_action_decorator_1 = require("../../command/decorators/post-action.decorator");
|
|
28
|
+
const post_content_decorator_1 = require("../../command/decorators/post-content.decorator");
|
|
29
|
+
const action_content_decorator_1 = require("../../controllers/decorators/actions/action-content.decorator");
|
|
30
|
+
const action_decorator_1 = require("../../controllers/decorators/actions/action.decorator");
|
|
28
31
|
let TranslationController = class TranslationController {
|
|
29
32
|
constructor(translationsService) {
|
|
30
33
|
this.translationsService = translationsService;
|
|
@@ -52,19 +55,19 @@ let TranslationController = class TranslationController {
|
|
|
52
55
|
};
|
|
53
56
|
exports.TranslationController = TranslationController;
|
|
54
57
|
__decorate([
|
|
55
|
-
(0,
|
|
58
|
+
(0, post_action_decorator_1.PostAction)({
|
|
56
59
|
type: () => translation_config_entity_1.TranslationConfig
|
|
57
60
|
}),
|
|
58
|
-
__param(0, (0,
|
|
61
|
+
__param(0, (0, post_content_decorator_1.PostContent)()),
|
|
59
62
|
__metadata("design:type", Function),
|
|
60
63
|
__metadata("design:paramtypes", [Object]),
|
|
61
64
|
__metadata("design:returntype", Promise)
|
|
62
65
|
], TranslationController.prototype, "postConfig", null);
|
|
63
66
|
__decorate([
|
|
64
|
-
(0,
|
|
67
|
+
(0, post_action_decorator_1.PostAction)({
|
|
65
68
|
type: () => translation_values_entity_1.TranslationValues
|
|
66
69
|
}),
|
|
67
|
-
__param(0, (0,
|
|
70
|
+
__param(0, (0, post_content_decorator_1.PostContent)()),
|
|
68
71
|
__metadata("design:type", Function),
|
|
69
72
|
__metadata("design:paramtypes", [Object]),
|
|
70
73
|
__metadata("design:returntype", Promise)
|
|
@@ -84,17 +87,17 @@ __decorate([
|
|
|
84
87
|
__metadata("design:returntype", Promise)
|
|
85
88
|
], TranslationController.prototype, "queryValues", null);
|
|
86
89
|
__decorate([
|
|
87
|
-
(0,
|
|
90
|
+
(0, action_decorator_1.Action)({
|
|
88
91
|
response: () => get_values_response_1.GetValuesResponse,
|
|
89
92
|
public: true
|
|
90
93
|
}),
|
|
91
|
-
__param(0, (0,
|
|
94
|
+
__param(0, (0, action_content_decorator_1.ActionContent)()),
|
|
92
95
|
__metadata("design:type", Function),
|
|
93
96
|
__metadata("design:paramtypes", [get_values_request_1.GetValuesRequest]),
|
|
94
97
|
__metadata("design:returntype", Promise)
|
|
95
98
|
], TranslationController.prototype, "getValues", null);
|
|
96
99
|
exports.TranslationController = TranslationController = __decorate([
|
|
97
|
-
(0,
|
|
100
|
+
(0, controller_decorator_1.Controller)(),
|
|
98
101
|
__metadata("design:paramtypes", [translations_service_1.TranslationsService])
|
|
99
102
|
], TranslationController);
|
|
100
103
|
//# sourceMappingURL=translation.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.controller.js","sourceRoot":"./","sources":["translations/controllers/translation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,qFAA0E;AAC1E,uEAAmE;
|
|
1
|
+
{"version":3,"file":"translation.controller.js","sourceRoot":"./","sources":["translations/contro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AA;;;;uDAGhB;AAKK;IAHL,IAAA,kCAAU,EAAC;QACT,IAAI,EAAE,GAAG,EAAE,CAAC,6CAAiB;KAC/B,CAAC;IAEE,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;uDAGhB;AAGK;IADL,IAAA,iDAAsB,GAAE;IAErB,WAAA,IAAA,yBAAY,GAAE,CAAA;;;;wDAGjB;AAGK;IADL,IAAA,iDAAsB,GAAE;IAErB,WAAA,IAAA,yBAAY,GAAE,CAAA;;;;wDAGjB;AAMK;IAJL,IAAA,yBAAM,EAAC;QACL,QAAQ,EAAE,GAAG,EAAE,CAAC,uCAAiB;QACjC,MAAM,EAAE,IAAI;KACd,CAAC;IAEE,WAAA,IAAA,wCAAa,GAAE,CAAA;;qCAAU,qCAAgB;;sDAY5C;gCAvDS,qBAAqB;IADjC,IAAA,iCAAU,GAAE;qCAIiC,0CAAmB;GAHpD,qBAAqB,CAwDjC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createTranslationValues = void 0;
|
|
7
4
|
const transaction_context_1 = require("../../database/contexts/transaction-context");
|
|
8
|
-
const
|
|
5
|
+
const generate_entity_id_1 = require("../../database/functions/generate-entity-id");
|
|
9
6
|
const use_repository_1 = require("../../database/functions/use-repository");
|
|
10
7
|
const translation_values_entity_1 = require("../entities/translation-values.entity");
|
|
11
8
|
const check_can_use_1 = require("./check-can-use");
|
|
@@ -16,7 +13,7 @@ const createTranslationValues = async (values) => {
|
|
|
16
13
|
const repository = entityManager
|
|
17
14
|
? entityManager.getRepository(translation_values_entity_1.TranslationValues)
|
|
18
15
|
: (0, use_repository_1.useRepository)(translation_values_entity_1.TranslationValues);
|
|
19
|
-
(0,
|
|
16
|
+
values.id = (0, generate_entity_id_1.generateEntityId)(translation_values_entity_1.TranslationValues, values);
|
|
20
17
|
return repository.save(values);
|
|
21
18
|
};
|
|
22
19
|
exports.createTranslationValues = createTranslationValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-translation-values.js","sourceRoot":"./","sources":["translations/functions/create-translation-values.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-translation-values.js","sourceRoot":"./","sources":["translations/functions/create-translation-values.ts"],"names":[],"mappings":";;;AAAA,qFAAsF;AACtF,oFAA+E;AAC/E,4EAAwE;AACxE,qFAA0E;AAE1E,mDAA8C;AAEvC,MAAM,uBAAuB,GAAG,KAAK,EACzC,MAAsC,EACvC,EAAE;IACD,IAAA,2BAAW,GAAE,CAAC;IACd,MAAM,kBAAkB,GAAG,6CAAuB,CAAC,QAAQ,EAAE,CAAC;IAC9D,MAAM,aAAa,GAAG,kBAAkB,EAAE,aAAa,CAAC;IACxD,MAAM,UAAU,GAAG,aAAa;QAC7B,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,6CAAiB,CAAC;QAChD,CAAC,CAAC,IAAA,8BAAa,EAAC,6CAAiB,CAAC,CAAC;IACrC,MAA6B,CAAC,EAAE,GAAG,IAAA,qCAAgB,EAAC,6CAAiB,EAAE,MAAM,CAAC,CAAC;IAChF,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,CAAA;AAXY,QAAA,uBAAuB,2BAWnC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateTranslationTables1723760669185 = void 0;
|
|
4
|
-
const
|
|
4
|
+
const execute_if_not_exists_table_1 = require("../../database/functions/execute-if-not-exists-table");
|
|
5
5
|
class CreateTranslationTables1723760669185 {
|
|
6
6
|
async up(queryRunner) {
|
|
7
|
-
await (0,
|
|
7
|
+
await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)('translation_config', queryRunner, async () => {
|
|
8
8
|
await queryRunner.query(`
|
|
9
9
|
create table translation_config
|
|
10
10
|
(
|
|
@@ -20,7 +20,7 @@ class CreateTranslationTables1723760669185 {
|
|
|
20
20
|
on translation_config (reference_id);
|
|
21
21
|
`);
|
|
22
22
|
});
|
|
23
|
-
await (0,
|
|
23
|
+
await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)('translation_values', queryRunner, async () => {
|
|
24
24
|
await queryRunner.query(`
|
|
25
25
|
create table translation_values
|
|
26
26
|
(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1723760669185-CreateTranslationTables.js","sourceRoot":"./","sources":["translations/migrations/1723760669185-CreateTranslationTables.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"1723760669185-CreateTranslationTables.js","sourceRoot":"./","sources":["translations/migrations/1723760669185-CreateTranslationTables.ts"],"names":[],"mappings":";;;AACA,sGAA+F;AAE/F,MAAa,oCAAoC;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACrC,MAAM,IAAA,qDAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;aAavB,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;QACN,MAAM,IAAA,qDAAuB,EAC1B,oBAAoB,EACpB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;aAWvB,CAAC,CAAC;QACN,CAAC,CACH,CAAA;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpE,MAAM,WAAW,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACvE,CAAC;CACH;AA9CD,oFA8CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TranslationConfigQuery:
|
|
1
|
+
export declare const TranslationConfigQuery: import("../../query/functions/create-query").QueryDecoratorFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TranslationValuesQuery:
|
|
1
|
+
export declare const TranslationValuesQuery: import("../../query/functions/create-query").QueryDecoratorFactory;
|
|
@@ -8,7 +8,7 @@ exports.TranslationValuesQuery = (0, create_query_1.createQuery)({
|
|
|
8
8
|
alias: 'translationValues',
|
|
9
9
|
target: () => translation_values_entity_1.TranslationValues,
|
|
10
10
|
paths: {
|
|
11
|
-
translationConfig: (0, create_query_1.
|
|
11
|
+
translationConfig: (0, create_query_1.joinOne)({
|
|
12
12
|
alias: 'translationConfig',
|
|
13
13
|
target: () => translation_config_entity_1.TranslationConfig
|
|
14
14
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-values.query.js","sourceRoot":"./","sources":["translations/queries/translation-values.query.ts"],"names":[],"mappings":";;;AAAA,qEAG4C;AAC5C,qFAA0E;AAC1E,qFAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,0BAAW,EAAC;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;IAC/B,KAAK,EAAE;QACJ,iBAAiB,EAAE,IAAA,
|
|
1
|
+
{"version":3,"file":"translation-values.query.js","sourceRoot":"./","sources":["translations/queries/translation-values.query.ts"],"names":[],"mappings":";;;AAAA,qEAG4C;AAC5C,qFAA0E;AAC1E,qFAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,0BAAW,EAAC;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;IAC/B,KAAK,EAAE;QACJ,iBAAiB,EAAE,IAAA,sBAAO,EAAC;YACxB,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,6CAAiB;SACjC,CAAC;KACJ;CACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DatabaseController } from "../database";
|
|
2
1
|
import { Logger } from "@rockster/logger";
|
|
2
|
+
import { DatabaseController } from "../database/database.controller";
|
|
3
3
|
export declare class TranslationsController {
|
|
4
4
|
protected databaseController: DatabaseController;
|
|
5
5
|
protected logger: Logger;
|
|
@@ -11,14 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TranslationsController = void 0;
|
|
13
13
|
const class_injector_1 = require("@rockster/class-injector");
|
|
14
|
-
const database_1 = require("../database");
|
|
15
14
|
const logger_1 = require("@rockster/logger");
|
|
16
15
|
const translation_config_entity_1 = require("./entities/translation-config.entity");
|
|
17
16
|
const translation_values_entity_1 = require("./entities/translation-values.entity");
|
|
18
17
|
const translation_controller_1 = require("./controllers/translation.controller");
|
|
19
18
|
const _1723760669185_CreateTranslationTables_1 = require("./migrations/1723760669185-CreateTranslationTables");
|
|
20
19
|
const env_1 = require("./env");
|
|
21
|
-
const
|
|
20
|
+
const database_controller_1 = require("../database/database.controller");
|
|
21
|
+
const module_controller_1 = require("../module/module.controller");
|
|
22
22
|
let TranslationsController = class TranslationsController {
|
|
23
23
|
constructor(databaseController) {
|
|
24
24
|
this.databaseController = databaseController;
|
|
@@ -42,7 +42,7 @@ let TranslationsController = class TranslationsController {
|
|
|
42
42
|
await this
|
|
43
43
|
.databaseController
|
|
44
44
|
.addMigrations([_1723760669185_CreateTranslationTables_1.CreateTranslationTables1723760669185]);
|
|
45
|
-
await
|
|
45
|
+
await module_controller_1.ModuleController
|
|
46
46
|
.instance
|
|
47
47
|
.loadRequests([translation_controller_1.TranslationController]);
|
|
48
48
|
this.logger.log('Enabled');
|
|
@@ -51,6 +51,6 @@ let TranslationsController = class TranslationsController {
|
|
|
51
51
|
exports.TranslationsController = TranslationsController;
|
|
52
52
|
exports.TranslationsController = TranslationsController = __decorate([
|
|
53
53
|
(0, class_injector_1.Injectable)(),
|
|
54
|
-
__metadata("design:paramtypes", [
|
|
54
|
+
__metadata("design:paramtypes", [database_controller_1.DatabaseController])
|
|
55
55
|
], TranslationsController);
|
|
56
56
|
//# sourceMappingURL=translations.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.controller.js","sourceRoot":"./","sources":["translations/translations.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"translations.controller.js","sourceRoot":"./","sources":["translations/translations.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,6CAA0C;AAC1C,oFAAyE;AACzE,oFAAyE;AACzE,iFAA6E;AAC7E,+GAA0G;AAC1G,+BAA4B;AAC5B,yEAAqE;AACrE,mEAA+D;AAGxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIhC,YACa,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAHzC,WAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,CAAC;IAI3C,CAAC;IAEJ,KAAK,CAAC,KAAK;QAER,MAAM,OAAO,GAAG,IAAI;aAChB,OAAO;aACP,YAAY,CAAA;QAEhB,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAEnC,SAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QACpB,SAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,SAAG,CAAC,QAAQ,CAAC;QAEhD,MAAM,IAAI;aACN,kBAAkB;aAClB,KAAK,CAAC;YACJ,6CAAiB;YACjB,6CAAiB;SACnB,CAAC,CAAC;QAEN,MAAM,IAAI;aACN,kBAAkB;aAClB,aAAa,CAAC,CAAC,6EAAoC,CAAC,CAAC,CAAC;QAE1D,MAAM,oCAAgB;aAClB,QAAQ;aACR,YAAY,CAAC,CAAC,8CAAqB,CAAC,CAAC,CAAC;QAE1C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;CACH,CAAA;AApCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,2BAAU,GAAE;qCAMuB,wCAAkB;GALzC,sBAAsB,CAoClC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-id.js","sourceRoot":"./","sources":["database/functions/generate-id.ts"],"names":[],"mappings":";;AAGA,6BAYC;AAfD,uDAAkD;AAGlD,SAAwB,UAAU,CAAI,MAAuB,EAAE,IAAQ;IACpE,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,MAAM,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAEpC,IAAI,CAAC,IAAI;QACN,OAAO,OAAO,CAAC;IAElB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;IAC1C,CAAC;IAED,OAAO,OAAO,CAAC;AAClB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useProtector = void 0;
|
|
4
|
-
const useProtector = (target) => {
|
|
5
|
-
const object = core
|
|
6
|
-
.storage
|
|
7
|
-
.findObject(target);
|
|
8
|
-
return object.protector;
|
|
9
|
-
};
|
|
10
|
-
exports.useProtector = useProtector;
|
|
11
|
-
//# sourceMappingURL=use-protector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-protector.js","sourceRoot":"./","sources":["database/functions/use-protector.ts"],"names":[],"mappings":";;;AAIO,MAAM,YAAY,GAAG,CAAC,MAAoB,EAAE,EAAE;IAClD,MAAM,MAAM,GAAG,IAAI;SACf,OAAO;SACP,UAAU,CAAC,MAAM,CACO,CAAC;IAC7B,OAAO,MAAM,CAAC,SAAS,CAAC;AAC3B,CAAC,CAAA;AANY,QAAA,YAAY,gBAMxB"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Dictionary, Instantiable } from "@rockster/common";
|
|
2
|
-
import { EntityManager, SelectQueryBuilder } from "typeorm";
|
|
3
|
-
export type IsAuthorizedHandle = {
|
|
4
|
-
(args: {
|
|
5
|
-
userId: string;
|
|
6
|
-
keys: string[];
|
|
7
|
-
contextId?: string;
|
|
8
|
-
entityManager?: EntityManager;
|
|
9
|
-
context?: string;
|
|
10
|
-
}): Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
export type GetUserPermissionsHandle = {
|
|
13
|
-
(args: {
|
|
14
|
-
userId: string;
|
|
15
|
-
targetUserId: string;
|
|
16
|
-
contextId: string;
|
|
17
|
-
entityManager?: EntityManager;
|
|
18
|
-
context: string;
|
|
19
|
-
}): Promise<string[]>;
|
|
20
|
-
};
|
|
21
|
-
export type SetUserPermissionsHandle = {
|
|
22
|
-
(args: {
|
|
23
|
-
userId: string;
|
|
24
|
-
targetUserId: string;
|
|
25
|
-
contextId: string;
|
|
26
|
-
entityManager?: EntityManager;
|
|
27
|
-
context: string;
|
|
28
|
-
accessKeys: string[];
|
|
29
|
-
}): Promise<void>;
|
|
30
|
-
};
|
|
31
|
-
export type Protector = {
|
|
32
|
-
target: Instantiable;
|
|
33
|
-
rootCondition?: (args: {
|
|
34
|
-
rootAlias: string;
|
|
35
|
-
queryBuilder: SelectQueryBuilder<any>;
|
|
36
|
-
userId: string;
|
|
37
|
-
contextParams: Dictionary<any>;
|
|
38
|
-
}) => SelectQueryBuilder<any>;
|
|
39
|
-
relationCondition?: (args: {
|
|
40
|
-
userId: string;
|
|
41
|
-
contextParams: Dictionary<any>;
|
|
42
|
-
alias: string;
|
|
43
|
-
rootPath: Instantiable;
|
|
44
|
-
}) => string;
|
|
45
|
-
canRemove?: (userId: string, entityId: string, entityManager?: EntityManager) => Promise<void>;
|
|
46
|
-
canModify?: <Entity>(userId: string, value: Entity, entityManager?: EntityManager) => Promise<void>;
|
|
47
|
-
canCreate?: <Entity>(userId: string, value: Entity, entityManager?: EntityManager) => Promise<void>;
|
|
48
|
-
isAuthorized?: IsAuthorizedHandle;
|
|
49
|
-
getUserPermissions?: GetUserPermissionsHandle;
|
|
50
|
-
setUserPermissions?: SetUserPermissionsHandle;
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protector.js","sourceRoot":"./","sources":["database/interfaces/protector.ts"],"names":[],"mappings":""}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ObjectNote, PropertyNote } from "@rockster/class-memory";
|
|
2
|
-
import { IEntityObject, IEntityProperty } from "../interfaces";
|
|
3
|
-
import { Dictionary, Instantiable } from "@rockster/common";
|
|
4
|
-
import { IProtectedEntityOptions } from "..";
|
|
5
|
-
import { EntityManager } from "typeorm";
|
|
6
|
-
import { GetUserPermissionsHandle, SetUserPermissionsHandle } from "../interfaces/protector";
|
|
7
|
-
type ProtectedData = {
|
|
8
|
-
object: ObjectNote<IEntityObject>;
|
|
9
|
-
context?: PropertyNote<IEntityProperty>;
|
|
10
|
-
options?: IProtectedEntityOptions;
|
|
11
|
-
isContext: boolean;
|
|
12
|
-
};
|
|
13
|
-
type ProtectorData = {
|
|
14
|
-
object: ObjectNote<IEntityObject>;
|
|
15
|
-
target: PropertyNote<IEntityProperty>;
|
|
16
|
-
context?: PropertyNote<IEntityProperty>;
|
|
17
|
-
key?: PropertyNote<IEntityProperty>;
|
|
18
|
-
};
|
|
19
|
-
export declare class ProtectBuilder {
|
|
20
|
-
build(object: ObjectNote<IEntityObject>): Promise<void>;
|
|
21
|
-
protected buildProtectorConfig(object: ObjectNote<IEntityObject>): void;
|
|
22
|
-
protected getRepository(target: Instantiable, entityManager?: EntityManager): import("typeorm").Repository<any>;
|
|
23
|
-
protected createQueryBuilder({ authKeys, data, protectorData, userId, displayContext, entityManager, protectedData }: {
|
|
24
|
-
protectorData: ProtectorData;
|
|
25
|
-
userId: string;
|
|
26
|
-
data: any;
|
|
27
|
-
authKeys: string[];
|
|
28
|
-
displayContext?: string;
|
|
29
|
-
entityManager?: EntityManager;
|
|
30
|
-
protectedData?: ProtectedData;
|
|
31
|
-
}): import("typeorm").SelectQueryBuilder<any>;
|
|
32
|
-
protected buildFilterKeys(protectorAlias: string, protectorKey: string, keys: string[]): string;
|
|
33
|
-
protected getQueryContextAndKeyCondition(protectorData: ProtectorData, protectedData: ProtectedData, protectorAlias: string, alias: string, contextParams: Dictionary<any>, rootPath?: Instantiable): {
|
|
34
|
-
context: string;
|
|
35
|
-
key: string;
|
|
36
|
-
};
|
|
37
|
-
protected buildProtectedConfig(object: ObjectNote<IEntityObject>): void;
|
|
38
|
-
protected getSetUserPermissions(data: ProtectorData): SetUserPermissionsHandle;
|
|
39
|
-
protected getGetUserPermissions(data: ProtectorData): GetUserPermissionsHandle;
|
|
40
|
-
protected getAuthContextFilter(targetUserId: string, data: ProtectorData, contextId: string): {
|
|
41
|
-
where: {
|
|
42
|
-
[x: string]: string;
|
|
43
|
-
};
|
|
44
|
-
keyProperty: PropertyNote<IEntityProperty>;
|
|
45
|
-
contextProperty: PropertyNote<IEntityProperty>;
|
|
46
|
-
targetProperty: PropertyNote<IEntityProperty>;
|
|
47
|
-
};
|
|
48
|
-
protected checkIsAuthorized({ data, userId, entityManager, keys, context, contextId }: {
|
|
49
|
-
data: ProtectorData;
|
|
50
|
-
entityManager?: EntityManager;
|
|
51
|
-
keys: string[];
|
|
52
|
-
context: string;
|
|
53
|
-
contextId: string;
|
|
54
|
-
userId: string;
|
|
55
|
-
}): Promise<void>;
|
|
56
|
-
protected getProtectedData(protector: ProtectorData, object: ObjectNote<IEntityObject>): ProtectedData;
|
|
57
|
-
protected getProtectorData(protector: Instantiable): ProtectorData;
|
|
58
|
-
}
|
|
59
|
-
export {};
|