@rockster/core 0.0.4 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/access/access.module.js +3 -7
- package/access/access.module.js.map +1 -1
- 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 +2 -1
- package/access/controllers/controllers.js +3 -1
- package/access/controllers/controllers.js.map +1 -1
- 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 +11 -4
- package/access/controllers/scope-group-user.controller.js +57 -9
- package/access/controllers/scope-group-user.controller.js.map +1 -1
- package/access/controllers/scope-group.controller.d.ts +8 -5
- package/access/controllers/scope-group.controller.js +66 -12
- package/access/controllers/scope-group.controller.js.map +1 -1
- package/access/controllers/scope-owner.controller.d.ts +3 -2
- package/access/controllers/scope-owner.controller.js +18 -4
- package/access/controllers/scope-owner.controller.js.map +1 -1
- package/access/controllers/scope-user.controller.d.ts +2 -2
- package/access/controllers/scope-user.controller.js +19 -5
- package/access/controllers/scope-user.controller.js.map +1 -1
- 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 +3 -1
- package/access/entities/entities.js +4 -0
- package/access/entities/entities.js.map +1 -1
- package/access/entities/index.d.ts +2 -0
- package/access/entities/index.js +2 -0
- package/access/entities/index.js.map +1 -1
- 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-group.d.ts +3 -0
- package/access/entities/scope-group.js +16 -0
- package/access/entities/scope-group.js.map +1 -1
- 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/index.d.ts +5 -0
- package/access/functions/index.js +5 -0
- package/access/functions/index.js.map +1 -1
- 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 +16 -5
- package/access/functions/register-scope.js +57 -45
- package/access/functions/register-scope.js.map +1 -1
- 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 +2 -0
- package/access/index.js +2 -0
- package/access/index.js.map +1 -1
- package/access/interfaces/index.d.ts +1 -0
- package/access/interfaces/index.js +1 -0
- package/access/interfaces/index.js.map +1 -1
- 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 +16 -1
- package/access/interfaces/scope-service.d.ts +6 -7
- 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-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-user-mapped.d.ts +1 -0
- package/access/models/scope-user-mapped.js +6 -0
- package/access/models/scope-user-mapped.js.map +1 -1
- package/access/models/scope-user.js +4 -2
- package/access/models/scope-user.js.map +1 -1
- 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.query.js +9 -2
- package/access/queries/scope-group.query.js.map +1 -1
- package/access/services/index.d.ts +1 -0
- package/access/services/index.js +1 -0
- package/access/services/index.js.map +1 -1
- 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.js +4 -2
- package/access/services/scope-access.service.js.map +1 -1
- package/access/services/scope-group-user.service.js +2 -2
- package/access/services/scope-group-user.service.js.map +1 -1
- package/access/services/scope-group.service.d.ts +10 -0
- package/access/services/scope-group.service.js +38 -1
- package/access/services/scope-group.service.js.map +1 -1
- package/access/services/scope-owner.service.d.ts +3 -0
- package/access/services/scope-owner.service.js +26 -1
- package/access/services/scope-owner.service.js.map +1 -1
- package/command/services/post-action-builder.js +19 -17
- package/command/services/post-action-builder.js.map +1 -1
- package/command/services/remove-action-builder.js +30 -22
- package/command/services/remove-action-builder.js.map +1 -1
- package/controllers/interfaces/controller-property.d.ts +7 -1
- package/controllers/services/default-action-builder.js +12 -30
- 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.js +6 -1
- package/core/core.controller.js.map +1 -1
- package/core/interfaces/action-docs.d.ts +15 -0
- package/core/interfaces/request-context.d.ts +5 -0
- package/core/services/request-router.js +2 -1
- 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/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/functions/inject-repository-handle.js +4 -3
- package/database/functions/inject-repository-handle.js.map +1 -1
- package/database/interfaces/entity-object.d.ts +0 -6
- 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/repository.d.ts +8 -8
- 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/global.d.ts +2 -0
- package/global.js +1 -0
- package/global.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/jobs/jobs.controller.d.ts +2 -0
- package/jobs/jobs.controller.js +20 -16
- package/jobs/jobs.controller.js.map +1 -1
- package/package.json +70 -70
- package/query/functions/add-join.js +2 -13
- package/query/functions/add-join.js.map +1 -1
- package/query/functions/create-query-builder.js +0 -10
- package/query/functions/create-query-builder.js.map +1 -1
- package/query/functions/execute-query.js +34 -0
- package/query/functions/execute-query.js.map +1 -1
- package/query/functions/load-properties.js +73 -5
- package/query/functions/load-properties.js.map +1 -1
- package/query/services/query-action-builder.js +12 -18
- 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/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/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 +3 -0
- 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-post.js +2 -0
- package/tasks/functions/create-task-message-post.js.map +1 -1
- 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 +4 -0
- package/tasks/interfaces/task-post-hook.d.ts +2 -0
- package/{database/interfaces/protector.js → tasks/interfaces/task-post-hook.js} +1 -1
- package/tasks/interfaces/task-post-hook.js.map +1 -0
- package/tasks/interfaces/task-settings.d.ts +5 -0
- package/tasks/services/task-runner.service.d.ts +24 -3
- package/tasks/services/task-runner.service.js +66 -28
- package/tasks/services/task-runner.service.js.map +1 -1
- package/translations/controllers/translation.controller.d.ts +3 -1
- package/translations/controllers/translation.controller.js +17 -3
- package/translations/controllers/translation.controller.js.map +1 -1
- package/translations/services/translations.service.d.ts +1 -0
- package/translations/services/translations.service.js +25 -6
- package/translations/services/translations.service.js.map +1 -1
- package/translations/services/translator.service.d.ts +1 -0
- package/translations/services/translator.service.js +6 -0
- package/translations/services/translator.service.js.map +1 -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 -60
- 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/core/core.controller.js
CHANGED
|
@@ -37,6 +37,7 @@ const global_1 = require("../global");
|
|
|
37
37
|
const worker_threads_1 = require("worker_threads");
|
|
38
38
|
const radash_1 = require("radash");
|
|
39
39
|
const docs_module_1 = require("../docs/docs.module");
|
|
40
|
+
const compile_all_task_post_hooks_1 = require("../tasks/functions/compile-all-task-post-hooks");
|
|
40
41
|
let CoreController = class CoreController {
|
|
41
42
|
constructor(moduleController, databaseController, cacheController, httpController, webSocketController, actionRouter, authController, storageController, jobsController, workersController, nodeControlService, translationsController, formsController) {
|
|
42
43
|
this.moduleController = moduleController;
|
|
@@ -81,11 +82,13 @@ let CoreController = class CoreController {
|
|
|
81
82
|
const interceptor = core.interceptors[property];
|
|
82
83
|
interceptor.instance = await (0, class_injector_1.createInstance)(interceptor.executor);
|
|
83
84
|
}));
|
|
85
|
+
await (0, compile_all_task_post_hooks_1.compileAllTaskPostHooks)();
|
|
84
86
|
// Init storage, translations and forms
|
|
85
87
|
await this.storageController.start();
|
|
86
88
|
await this.translationsController.start();
|
|
87
89
|
await this.formsController.start();
|
|
88
90
|
events.push(...await this.moduleController.load(docs_module_1.DocsModule));
|
|
91
|
+
// Before database init
|
|
89
92
|
// Init dabatase and cache connection
|
|
90
93
|
await this.databaseController.initialize();
|
|
91
94
|
await this.cacheController.initialize();
|
|
@@ -103,7 +106,7 @@ let CoreController = class CoreController {
|
|
|
103
106
|
.active(controller);
|
|
104
107
|
}
|
|
105
108
|
if (core.isAuthRequired && !core.isAuthEnabled) {
|
|
106
|
-
this.logger.throw(new Error('
|
|
109
|
+
this.logger.throw(new Error('Authentication is required but was not activated'));
|
|
107
110
|
}
|
|
108
111
|
// Init jobs
|
|
109
112
|
await this.jobsController.init();
|
|
@@ -112,6 +115,7 @@ let CoreController = class CoreController {
|
|
|
112
115
|
const server = await this.httpController.listen(port);
|
|
113
116
|
// WebSocket service
|
|
114
117
|
if (core.options.router) {
|
|
118
|
+
this.logger.log('WebSocket service is disabled');
|
|
115
119
|
}
|
|
116
120
|
else {
|
|
117
121
|
protocols.push('webSocket');
|
|
@@ -157,6 +161,7 @@ let CoreController = class CoreController {
|
|
|
157
161
|
const executor = interceptor.executor;
|
|
158
162
|
interceptor.instance = await (0, class_injector_1.createInstance)(executor);
|
|
159
163
|
}));
|
|
164
|
+
await (0, compile_all_task_post_hooks_1.compileAllTaskPostHooks)();
|
|
160
165
|
// Config jobs
|
|
161
166
|
await this.jobsController.configJobs();
|
|
162
167
|
// Init dabatase and cache connection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.controller.js","sourceRoot":"./","sources":["core/core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qBAAmB;AACnB,6CAA0C;AAC1C,mEAA+D;AAC/D,yEAAqE;AACrE,6DAAyD;AACzD,gEAA4D;AAG5D,8CAAoD;AAEpD,8DAA0D;AAC1D,8DAA0D;AAC1D,iEAA6D;AAC7D,wCAA+C;AAC/C,6DAAyD;AACzD,sEAAkE;AAClE,wEAAoE;AACpE,sDAA0D;AAC1D,wEAAoE;AACpE,0EAAqE;AACrE,qFAAiF;AACjF,gEAA4D;AAC5D,6DAKkC;AAClC,sCAGmB;AACnB,mDAGwB;AACxB,mCAA+B;AAC/B,qDAAiD;
|
|
1
|
+
{"version":3,"file":"core.controller.js","sourceRoot":"./","sources":["core/core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qBAAmB;AACnB,6CAA0C;AAC1C,mEAA+D;AAC/D,yEAAqE;AACrE,6DAAyD;AACzD,gEAA4D;AAG5D,8CAAoD;AAEpD,8DAA0D;AAC1D,8DAA0D;AAC1D,iEAA6D;AAC7D,wCAA+C;AAC/C,6DAAyD;AACzD,sEAAkE;AAClE,wEAAoE;AACpE,sDAA0D;AAC1D,wEAAoE;AACpE,0EAAqE;AACrE,qFAAiF;AACjF,gEAA4D;AAC5D,6DAKkC;AAClC,sCAGmB;AACnB,mDAGwB;AACxB,mCAA+B;AAC/B,qDAAiD;AACjD,gGAAyF;AAGlF,IAAM,cAAc,GAApB,MAAM,cAAc;IAIxB,YACa,gBAAkC,EAClC,kBAAsC,EACtC,eAAgC,EAChC,cAA8B,EAC9B,mBAAwC,EACxC,YAA2B,EAC3B,cAA8B,EAC9B,iBAAoC,EACpC,cAA8B,EAC9B,iBAAoC,EACpC,kBAAsC,EACtC,sBAA8C,EAC9C,eAAgC;QAZhC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,oBAAe,GAAf,eAAe,CAAiB;QAChC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAgB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,IAAA,yBAAQ,GAAE;IAEP,WAAA,IAAA,uBAAM,EAAC,oBAAW,CAAC,CAAA;IACnB,WAAA,IAAA,uBAAM,EAAC,qBAAY,CAAC,CAAA;;;;0CAuBvB;yBA9CS,cAAc;IAD1B,IAAA,2BAAU,GAAE;qCAMqB,oCAAgB;QACd,wCAAkB;QACrB,kCAAe;QAChB,gCAAc;QACT,gCAAmB;QAC1B,8BAAa;QACX,gCAAc;QACX,2BAAiB;QACpB,gCAAc;QACX,sCAAiB;QAChB,yCAAkB;QACd,gDAAsB;QAC7B,kCAAe;GAjBnC,cAAc,CA6M1B"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { HttpMethod, Instantiable } from "@rockster/common";
|
|
2
2
|
import { DocsControllerActionType } from "@rockster/common/docs";
|
|
3
|
+
/** A scope key required by an action, surfaced in the generated docs/SDK. */
|
|
4
|
+
export interface IActionDocsScopeKey {
|
|
5
|
+
/** Action slot the key guards: default | query | create | modify | remove. */
|
|
6
|
+
slot: string;
|
|
7
|
+
/** Scope context the key belongs to (workspace | account | project | …). */
|
|
8
|
+
contextName: string;
|
|
9
|
+
/** Scope key name (e.g. "vh_registry_read"). */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Scope service resolver used to resolve the context id, when set. */
|
|
12
|
+
resolverHandler?: string;
|
|
13
|
+
}
|
|
3
14
|
export interface IActionDocs {
|
|
4
15
|
type: DocsControllerActionType;
|
|
5
16
|
controller: string;
|
|
@@ -18,6 +29,10 @@ export interface IActionDocs {
|
|
|
18
29
|
httpMethod?: HttpMethod;
|
|
19
30
|
isResponseArray?: boolean;
|
|
20
31
|
isSecure?: boolean;
|
|
32
|
+
/** True when guarded by a special auth strategy (see createAuthenticationInterceptor). */
|
|
33
|
+
authenticated?: boolean;
|
|
34
|
+
/** Scope keys required to call the action (empty = login only). */
|
|
35
|
+
keys?: IActionDocsScopeKey[];
|
|
21
36
|
description?: string;
|
|
22
37
|
exposeGroups?: string[];
|
|
23
38
|
validateGroups?: string[];
|
|
@@ -19,6 +19,11 @@ export interface IRequestContext<Session = CurrentSession> {
|
|
|
19
19
|
isAuthenticated?: boolean;
|
|
20
20
|
session?: Session;
|
|
21
21
|
entityManager?: EntityManager;
|
|
22
|
+
/**
|
|
23
|
+
* Per-request store shared by scope resolvers (and, afterwards, the action
|
|
24
|
+
* handler) so data loaded while resolving authorization is not re-queried.
|
|
25
|
+
*/
|
|
26
|
+
scopeStore?: Map<string, unknown>;
|
|
22
27
|
headers?: IncomingHttpHeaders;
|
|
23
28
|
callbacks: RequestCallbacks;
|
|
24
29
|
onSuccess: OnEndRequest;
|
|
@@ -19,6 +19,7 @@ const database_1 = require("../../database");
|
|
|
19
19
|
const use_auth_1 = require("../../security/functions/use-auth");
|
|
20
20
|
const class_pipe_1 = require("@rockster/class-pipe");
|
|
21
21
|
const common_1 = require("@rockster/common");
|
|
22
|
+
const request_context_1 = require("../contexts/request-context");
|
|
22
23
|
let RequestRouter = class RequestRouter {
|
|
23
24
|
constructor(contextBuilder, requestExecutor) {
|
|
24
25
|
this.contextBuilder = contextBuilder;
|
|
@@ -58,7 +59,7 @@ let RequestRouter = class RequestRouter {
|
|
|
58
59
|
if (req.isWs) {
|
|
59
60
|
requestContext.session = req.session;
|
|
60
61
|
}
|
|
61
|
-
const result = await execute(requestContext);
|
|
62
|
+
const result = await request_context_1.requestContextStore.run(requestContext, () => execute(requestContext));
|
|
62
63
|
res.status(common_1.HttpStatus.ok).json(result);
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-router.js","sourceRoot":"./","sources":["core/services/request-router.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AAEtD,6CAA+C;AAC/C,yDAAqD;AACrD,uDAAmD;AACnD,6CAA0C;AAC1C,6CAAgD;AAChD,gEAA4D;AAC5D,qDAA+C;AAI/C,6CAI0B;
|
|
1
|
+
{"version":3,"file":"request-router.js","sourceRoot":"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AAC,EAAE,CAAC,CAAC,IAAI,CAAC;4BAC5B,OAAO;4BACP,MAAM;yBACR,CAAC,CAAC;oBACN,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACd,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ;4BACxB,mBAAU,CAAC,mBAAmB,CAAC;wBAClC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAChC,CAAC;gBACJ,CAAC,CAAC,CAAC;YACN,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;IACJ,CAAC;CACH,CAAA;AA/GY,sCAAa;wBAAb,aAAa;IADzB,IAAA,2BAAU,GAAE;qCAQmB,gCAAc;QACb,kCAAe;GARnC,aAAa,CA+GzB"}
|
|
@@ -4,18 +4,16 @@ import { ObjectNote } from "@rockster/class-memory";
|
|
|
4
4
|
import { ObjectLoader } from "../core";
|
|
5
5
|
import { IEntityObject } from "./interfaces";
|
|
6
6
|
import { PathsBuilder } from "./services/paths-builder";
|
|
7
|
-
import { ProtectBuilder } from "./services/protect-builder";
|
|
8
7
|
import { JsonbIndexCreator } from "./services/jsonb-index-creator";
|
|
9
8
|
export declare class DatabaseController extends ObjectLoader<IEntityObject> {
|
|
10
9
|
protected pathsBuilder: PathsBuilder;
|
|
11
|
-
protected protectBuilder: ProtectBuilder;
|
|
12
10
|
protected jsonbIndexCreator: JsonbIndexCreator;
|
|
13
11
|
static _objects: ObjectNote<IEntityObject>[];
|
|
14
12
|
static _dataSource: DataSource;
|
|
15
13
|
protected get objects(): ObjectNote<IEntityObject>[];
|
|
16
14
|
get dataSource(): DataSource;
|
|
17
15
|
protected set dataSource(value: DataSource);
|
|
18
|
-
constructor(pathsBuilder: PathsBuilder,
|
|
16
|
+
constructor(pathsBuilder: PathsBuilder, jsonbIndexCreator: JsonbIndexCreator);
|
|
19
17
|
addMigrations(migrations: (string | Function)[]): Promise<void>;
|
|
20
18
|
build(targets: Instantiable[]): Promise<void>;
|
|
21
19
|
initialize(): Promise<void>;
|
|
@@ -17,7 +17,6 @@ const logger_1 = require("@rockster/logger");
|
|
|
17
17
|
const core_1 = require("../core");
|
|
18
18
|
const common_1 = require("../common");
|
|
19
19
|
const paths_builder_1 = require("./services/paths-builder");
|
|
20
|
-
const protect_builder_1 = require("./services/protect-builder");
|
|
21
20
|
const env_1 = require("./env");
|
|
22
21
|
const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
|
|
23
22
|
const jsonb_index_creator_1 = require("./services/jsonb-index-creator");
|
|
@@ -27,10 +26,9 @@ let DatabaseController = DatabaseController_1 = class DatabaseController extends
|
|
|
27
26
|
set dataSource(value) {
|
|
28
27
|
DatabaseController_1._dataSource = value;
|
|
29
28
|
}
|
|
30
|
-
constructor(pathsBuilder,
|
|
29
|
+
constructor(pathsBuilder, jsonbIndexCreator) {
|
|
31
30
|
super();
|
|
32
31
|
this.pathsBuilder = pathsBuilder;
|
|
33
|
-
this.protectBuilder = protectBuilder;
|
|
34
32
|
this.jsonbIndexCreator = jsonbIndexCreator;
|
|
35
33
|
}
|
|
36
34
|
async addMigrations(migrations) {
|
|
@@ -52,7 +50,6 @@ let DatabaseController = DatabaseController_1 = class DatabaseController extends
|
|
|
52
50
|
super.load(this.objects, common_1.ObjectType.entity, targets);
|
|
53
51
|
await this.each(async (object) => {
|
|
54
52
|
await this.pathsBuilder.build(object);
|
|
55
|
-
await this.protectBuilder.build(object);
|
|
56
53
|
});
|
|
57
54
|
}
|
|
58
55
|
async initialize() {
|
|
@@ -86,7 +83,6 @@ DatabaseController._objects = [];
|
|
|
86
83
|
exports.DatabaseController = DatabaseController = DatabaseController_1 = __decorate([
|
|
87
84
|
(0, class_injector_1.Injectable)(),
|
|
88
85
|
__metadata("design:paramtypes", [paths_builder_1.PathsBuilder,
|
|
89
|
-
protect_builder_1.ProtectBuilder,
|
|
90
86
|
jsonb_index_creator_1.JsonbIndexCreator])
|
|
91
87
|
], DatabaseController);
|
|
92
88
|
//# sourceMappingURL=database.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.controller.js","sourceRoot":"./","sources":["database/database.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6DAAsD;AAEtD,qCAAqC;AACrC,6CAA0C;AAE1C,kCAAuC;AAEvC,sCAAuC;AACvC,4DAAwD;
|
|
1
|
+
{"version":3,"file":"database.controller.js","sourceRoot":"./","sources":["database/database.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6DAAsD;AAEtD,qCAAqC;AACrC,6CAA0C;AAE1C,kCAAuC;AAEvC,sCAAuC;AACvC,4DAAwD;AAExD,+BAA4B;AAC5B,yEAAgE;AAChE,wEAAmE;AAG5D,IAAM,kBAAkB,0BAAxB,MAAM,kBAAmB,SAAQ,mBAA2B;IAIhE,IAAc,OAAO,KAAK,OAAO,oBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,IAAI,UAAU,KAAK,OAAO,oBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE3D,IAAc,UAAU,CAAC,KAAK;QAC3B,oBAAkB,CAAC,WAAW,GAAG,KAAK,CAAC;IAC1C,CAAC;IAED,YACa,YAA0B,EAC1B,iBAAoC;QAE9C,KAAK,EAAE,CAAC;QAHE,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;IAGjD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,UAAiC;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;YACtC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG;gBACrB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ;gBACxB,UAAU,EAAE,EAAE;aAChB,CAAA;QACJ,CAAC;QACD,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAC9B,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AAC;QAEN,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACxC,CAAC;;AA1ES,gDAAkB;AAEd,2BAAQ,GAAgC,EAAE,AAAlC,CAAmC;6BAF/C,kBAAkB;IAD9B,IAAA,2BAAU,GAAE;qCAaiB,4BAAY;QACP,uCAAiB;GAbvC,kBAAkB,CA2E9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IEntityOptions } from "..";
|
|
2
2
|
export interface IProtectEntityOptions extends IEntityOptions {
|
|
3
3
|
}
|
|
4
|
+
/** @deprecated Protector removed; use scope keys on controllers instead. */
|
|
4
5
|
export declare const ProtectEntity: (options?: IProtectEntityOptions) => (target: any) => void;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProtectEntity = void 0;
|
|
4
4
|
const entity_decorator_1 = require("../functions/entity-decorator");
|
|
5
|
-
;
|
|
5
|
+
/** @deprecated Protector removed; use scope keys on controllers instead. */
|
|
6
6
|
const ProtectEntity = (options) => {
|
|
7
7
|
return (target) => {
|
|
8
|
-
|
|
9
|
-
object.isProtect = true;
|
|
8
|
+
(0, entity_decorator_1.entityDecorator)(target, options);
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
11
|
exports.ProtectEntity = ProtectEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protect-entity.decorator.js","sourceRoot":"./","sources":["database/decorators/protect-entity.decorator.ts"],"names":[],"mappings":";;;AACA,oEAAgE;
|
|
1
|
+
{"version":3,"file":"protect-entity.decorator.js","sourceRoot":"./","sources":["database/decorators/protect-entity.decorator.ts"],"names":[],"mappings":";;;AACA,oEAAgE;AAIhE,4EAA4E;AACrE,MAAM,aAAa,GAAG,CAAC,OAA+B,EAAE,EAAE;IAC9D,OAAO,CAAC,MAAM,EAAE,EAAE;QACf,IAAA,kCAAe,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
|
|
@@ -5,4 +5,5 @@ export interface IProtectedEntityOptions extends IEntityOptions {
|
|
|
5
5
|
type: GetTypeCallback;
|
|
6
6
|
keys?: IAuthorizationKeys;
|
|
7
7
|
}
|
|
8
|
+
/** @deprecated Protector removed; use scope keys on controllers instead. */
|
|
8
9
|
export declare const ProtectedEntity: (options: IProtectedEntityOptions) => (target: any) => void;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProtectedEntity = void 0;
|
|
4
|
-
const add_protected_1 = require("../../security/functions/add-protected");
|
|
5
4
|
const entity_decorator_1 = require("../functions/entity-decorator");
|
|
6
|
-
;
|
|
5
|
+
/** @deprecated Protector removed; use scope keys on controllers instead. */
|
|
7
6
|
const ProtectedEntity = (options) => {
|
|
8
7
|
return (target) => {
|
|
9
|
-
|
|
10
|
-
object.protected = options;
|
|
11
|
-
if (options.keys?.create) {
|
|
12
|
-
(0, add_protected_1.addProtected)(options.keys.create.protector || options.type, [options.keys.create]);
|
|
13
|
-
}
|
|
14
|
-
if (options.keys?.modify) {
|
|
15
|
-
(0, add_protected_1.addProtected)(options.keys.modify.protector || options.type, [options.keys.modify]);
|
|
16
|
-
}
|
|
17
|
-
if (options.keys?.read) {
|
|
18
|
-
(0, add_protected_1.addProtected)(options.keys.read.protector || options.type, [options.keys.read]);
|
|
19
|
-
}
|
|
20
|
-
if (options.keys?.remove) {
|
|
21
|
-
(0, add_protected_1.addProtected)(options.keys.remove.protector || options.type, [options.keys.remove]);
|
|
22
|
-
}
|
|
8
|
+
(0, entity_decorator_1.entityDecorator)(target, options);
|
|
23
9
|
};
|
|
24
10
|
};
|
|
25
11
|
exports.ProtectedEntity = ProtectedEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-entity.decorator.js","sourceRoot":"./","sources":["database/decorators/protected-entity.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"protected-entity.decorator.js","sourceRoot":"./","sources":["database/decorators/protected-entity.decorator.ts"],"names":[],"mappings":";;;AAGA,oEAAgE;AAOhE,4EAA4E;AACrE,MAAM,eAAe,GAAG,CAC5B,OAAgC,EACjC,EAAE;IACD,OAAO,CAAC,MAAM,EAAE,EAAE;QACf,IAAA,kCAAe,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,eAAe,mBAM1B"}
|
|
@@ -17,12 +17,13 @@ function injectRepositoryHandle(type, target, propertyKey) {
|
|
|
17
17
|
case 'manager':
|
|
18
18
|
return target[property];
|
|
19
19
|
default:
|
|
20
|
-
return (
|
|
20
|
+
return (...args) => {
|
|
21
21
|
const currentStore = transaction_context_1.transactionContextStore.getStore();
|
|
22
22
|
const repository = currentStore?.entityManager
|
|
23
|
-
? currentStore
|
|
23
|
+
? currentStore.entityManager.getRepository(type())
|
|
24
24
|
: target;
|
|
25
|
-
|
|
25
|
+
const method = repository[property];
|
|
26
|
+
return method?.apply(repository, args);
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-repository-handle.js","sourceRoot":"./","sources":["database/functions/inject-repository-handle.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"inject-repository-handle.js","sourceRoot":"./","sources":["database/functions/inject-repository-handle.ts"],"names":[],"mappings":";;AAKA,wDAqCC;AAzCD,qDAAiD;AACjD,yEAA0E;AAG1E,SAAgB,sBAAsB,CACnC,IAAqB,EACrB,MAAM,EACN,WAAmB;IAEnB,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;QACzC,GAAG;YACA,OAAO,IAAI,CAAC,QAAQ,EAAE,UAAU;gBAC7B,CAAC,CAAC,IAAI,KAAK,CAAC,IAAA,8BAAa,EAAC,IAAI,EAAE,CAAC,EAAE;oBAChC,GAAG,EAAE,CAAC,MAAM,EAAE,QAA+B,EAAE,EAAE;wBAC9C,QAAQ,QAAQ,EAAE,CAAC;4BAChB,KAAK,QAAQ,CAAC;4BACd,KAAK,aAAa,CAAC;4BACnB,KAAK,UAAU,CAAC;4BAChB,KAAK,SAAS;gCACX,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;4BAC3B;gCACG,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;oCAC3B,MAAM,YAAY,GAAG,6CAAuB,CAAC,QAAQ,EAAE,CAAC;oCACxD,MAAM,UAAU,GAAG,YAAY,EAAE,aAAa;wCAC3C,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;wCAClD,CAAC,CAAC,MAAM,CAAC;oCACZ,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAEpB,CAAC;oCACf,OAAO,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gCAC1C,CAAC,CAAC;wBACR,CAAC;oBACJ,CAAC;iBACH,CAAC;gBACF,CAAC,CAAC,MAAM,CAAC;QACf,CAAC;QACD,GAAG,CAAC,KAAK;YACN,MAAM,GAAG,KAAK,CAAC;QAClB,CAAC;KACH,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { IProtectedEntityOptions } from "..";
|
|
2
1
|
import { ObjectType } from "../../common";
|
|
3
2
|
import { IObject } from "../../core";
|
|
4
|
-
import { IsAuthorizedHandle, Protector } from "./protector";
|
|
5
3
|
export interface IEntityObject extends IObject {
|
|
6
4
|
type: ObjectType.entity;
|
|
7
5
|
alias: string;
|
|
8
6
|
tableName: string;
|
|
9
7
|
strict?: boolean;
|
|
10
8
|
idProperty: string;
|
|
11
|
-
protected?: IProtectedEntityOptions;
|
|
12
|
-
protector?: Protector;
|
|
13
|
-
isAuthorized?: IsAuthorizedHandle;
|
|
14
|
-
isProtect?: boolean;
|
|
15
9
|
isTaskMessage?: boolean;
|
|
16
10
|
}
|
|
@@ -10,7 +10,6 @@ export * from './execute-callback';
|
|
|
10
10
|
export * from './id-column-def';
|
|
11
11
|
export * from './inverse-alias';
|
|
12
12
|
export * from './path';
|
|
13
|
-
export * from './protector';
|
|
14
13
|
export * from './relation-def';
|
|
15
14
|
export * from './relation-path';
|
|
16
15
|
export * from './relation.options';
|
|
@@ -26,7 +26,6 @@ __exportStar(require("./execute-callback"), exports);
|
|
|
26
26
|
__exportStar(require("./id-column-def"), exports);
|
|
27
27
|
__exportStar(require("./inverse-alias"), exports);
|
|
28
28
|
__exportStar(require("./path"), exports);
|
|
29
|
-
__exportStar(require("./protector"), exports);
|
|
30
29
|
__exportStar(require("./relation-def"), exports);
|
|
31
30
|
__exportStar(require("./relation-path"), exports);
|
|
32
31
|
__exportStar(require("./relation.options"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"./","sources":["database/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,+DAA6C;AAC7C,+CAA6B;AAC7B,uDAAqC;AACrC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,yCAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./","sources":["database/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,+DAA6C;AAC7C,+CAA6B;AAC7B,uDAAqC;AACrC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,yCAAuB;AACvB,iDAA+B;AAC/B,kDAAgC;AAChC,qDAAmC;AACnC,+CAA6B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
1
|
+
import { ObjectLiteral, Repository as TypeOrmRepository } from "typeorm";
|
|
2
|
+
/**
|
|
3
|
+
* Repositório injectável — mesmo contrato que {@link TypeOrmRepository} do TypeORM.
|
|
4
|
+
*
|
|
5
|
+
* O proxy em {@link injectRepositoryHandle} reencaminha as chamadas para o repositório real;
|
|
6
|
+
* os argumentos são os mesmos do TypeORM (`find(options)`, etc.), sem `EntityManager` extra.
|
|
7
|
+
*/
|
|
8
|
+
export type Repository<Entity extends ObjectLiteral> = TypeOrmRepository<Entity>;
|
package/docs/docs.module.js
CHANGED
|
@@ -40,6 +40,7 @@ const entities_1 = require("./entities/entities");
|
|
|
40
40
|
const docs_1 = require("./docs");
|
|
41
41
|
const controllers_1 = require("./controllers/controllers");
|
|
42
42
|
const docs_service_1 = require("./services/docs.service");
|
|
43
|
+
const migrations_1 = require("./migrations/migrations");
|
|
43
44
|
let DocsModule = class DocsModule {
|
|
44
45
|
constructor(docsService) {
|
|
45
46
|
this.docsService = docsService;
|
|
@@ -63,7 +64,8 @@ __decorate([
|
|
|
63
64
|
exports.DocsModule = DocsModule = __decorate([
|
|
64
65
|
(0, module_decorator_1.Module)({
|
|
65
66
|
entities: entities_1.entities,
|
|
66
|
-
controllers: controllers_1.controllers
|
|
67
|
+
controllers: controllers_1.controllers,
|
|
68
|
+
migrations: migrations_1.migrations,
|
|
67
69
|
}),
|
|
68
70
|
__metadata("design:paramtypes", [docs_service_1.DocsService])
|
|
69
71
|
], DocsModule);
|
package/docs/docs.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.module.js","sourceRoot":"./","sources":["docs/docs.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0C;AAC1C,4EAA+D;AAC/D,wFAAkF;AAClF,kDAA+C;AAC/C,iCAA8B;AAC9B,2DAAwD;AACxD,0DAAsD;
|
|
1
|
+
{"version":3,"file":"docs.module.js","sourceRoot":"./","sources":["docs/docs.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0C;AAC1C,4EAA+D;AAC/D,wFAAkF;AAClF,kDAA+C;AAC/C,iCAA8B;AAC9B,2DAAwD;AACxD,0DAAsD;AACtD,wDAAqD;AAO9C,IAAM,UAAU,GAAhB,MAAM,UAAU;IAEpB,YACsB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAC3C,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI;QACP,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,WAAW,GAAG,yBAAa,GAAG,OAAO,CAAC,GAAG,EAAE,eAAe,uCAAC,CAAC;QAClE,WAAI,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QACrC,WAAI,CAAC,OAAO,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;QAC3C,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,mBAAmB,WAAI,CAAC,OAAO,CAAC,IAAI,iBAAiB,WAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACH,CAAA;AAfY,gCAAU;AAOd;IADL,IAAA,4CAAmB,GAAE;;;;sCAQrB;qBAdS,UAAU;IALtB,IAAA,yBAAM,EAAC;QACL,QAAQ,EAAE,mBAAQ;QAClB,WAAW,EAAE,yBAAW;QACxB,UAAU,EAAV,uBAAU;KACZ,CAAC;qCAIoC,0BAAW;GAHpC,UAAU,CAetB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateDocsTables1747584000000 = void 0;
|
|
4
|
+
const execute_if_not_exists_table_1 = require("../../database/functions/execute-if-not-exists-table");
|
|
5
|
+
class CreateDocsTables1747584000000 {
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)("docs_version", queryRunner, async () => {
|
|
8
|
+
await queryRunner.query(`
|
|
9
|
+
create table docs_version
|
|
10
|
+
(
|
|
11
|
+
id varchar not null
|
|
12
|
+
constraint pk_docs_version primary key,
|
|
13
|
+
active boolean default true not null,
|
|
14
|
+
created_at timestamp without time zone default now() not null,
|
|
15
|
+
last_modified_at timestamp without time zone default now() not null,
|
|
16
|
+
version varchar not null,
|
|
17
|
+
name varchar not null,
|
|
18
|
+
package_name varchar not null,
|
|
19
|
+
description varchar,
|
|
20
|
+
deprecated boolean default false not null,
|
|
21
|
+
released boolean default false not null
|
|
22
|
+
);
|
|
23
|
+
`);
|
|
24
|
+
});
|
|
25
|
+
await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)("docs_controller", queryRunner, async () => {
|
|
26
|
+
await queryRunner.query(`
|
|
27
|
+
create table docs_controller
|
|
28
|
+
(
|
|
29
|
+
id varchar not null
|
|
30
|
+
constraint pk_docs_controller primary key,
|
|
31
|
+
active boolean default true not null,
|
|
32
|
+
created_at timestamp without time zone default now() not null,
|
|
33
|
+
last_modified_at timestamp without time zone default now() not null,
|
|
34
|
+
version_id varchar not null
|
|
35
|
+
constraint fk_docs_controller_version_id
|
|
36
|
+
references docs_version (id)
|
|
37
|
+
on delete cascade,
|
|
38
|
+
name varchar not null,
|
|
39
|
+
description varchar,
|
|
40
|
+
deprecated boolean default false not null
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
create index idx_docs_controller_version_id
|
|
44
|
+
on docs_controller (version_id);
|
|
45
|
+
`);
|
|
46
|
+
});
|
|
47
|
+
await (0, execute_if_not_exists_table_1.executeIfNotExistsTable)("docs_controller_action", queryRunner, async () => {
|
|
48
|
+
await queryRunner.query(`
|
|
49
|
+
create table docs_controller_action
|
|
50
|
+
(
|
|
51
|
+
id varchar not null
|
|
52
|
+
constraint pk_docs_controller_action primary key,
|
|
53
|
+
active boolean default true not null,
|
|
54
|
+
created_at timestamp without time zone default now() not null,
|
|
55
|
+
last_modified_at timestamp without time zone default now() not null,
|
|
56
|
+
controller_id varchar not null
|
|
57
|
+
constraint fk_docs_controller_action_controller_id
|
|
58
|
+
references docs_controller (id)
|
|
59
|
+
on delete cascade,
|
|
60
|
+
type varchar not null,
|
|
61
|
+
name varchar not null,
|
|
62
|
+
output_is_array boolean default false not null,
|
|
63
|
+
method varchar,
|
|
64
|
+
description varchar,
|
|
65
|
+
is_public boolean default false not null,
|
|
66
|
+
params_names jsonb,
|
|
67
|
+
query_names jsonb,
|
|
68
|
+
headers_names jsonb,
|
|
69
|
+
deprecated boolean default false not null,
|
|
70
|
+
input varchar,
|
|
71
|
+
output varchar,
|
|
72
|
+
params varchar,
|
|
73
|
+
query varchar,
|
|
74
|
+
headers varchar,
|
|
75
|
+
models jsonb
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
create index idx_docs_controller_action_controller_id
|
|
79
|
+
on docs_controller_action (controller_id);
|
|
80
|
+
`);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async down(queryRunner) {
|
|
84
|
+
await queryRunner.query(`drop table if exists docs_controller_action;`);
|
|
85
|
+
await queryRunner.query(`drop table if exists docs_controller;`);
|
|
86
|
+
await queryRunner.query(`drop table if exists docs_version;`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.CreateDocsTables1747584000000 = CreateDocsTables1747584000000;
|
|
90
|
+
//# sourceMappingURL=1747584000000-CreateDocsTables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1747584000000-CreateDocsTables.js","sourceRoot":"./","sources":["docs/migrations/1747584000000-CreateDocsTables.ts"],"names":[],"mappings":";;;AACA,sGAA+F;AAE/F,MAAa,6BAA6B;IAEhC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACrC,MAAM,IAAA,qDAAuB,EAC1B,cAAc,EACd,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;aAevB,CAAC,CAAC;QACN,CAAC,CACH,CAAC;QAEF,MAAM,IAAA,qDAAuB,EAC1B,iBAAiB,EACjB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;aAmBvB,CAAC,CAAC;QACN,CAAC,CACH,CAAC;QAEF,MAAM,IAAA,qDAAuB,EAC1B,wBAAwB,EACxB,WAAW,EACX,KAAK,IAAI,EAAE;YACR,MAAM,WAAW,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAgCvB,CAAC,CAAC;QACN,CAAC,CACH,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACvC,MAAM,WAAW,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACxE,MAAM,WAAW,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACjE,MAAM,WAAW,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACjE,CAAC;CACH;AAnGD,sEAmGC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrations = void 0;
|
|
4
|
+
const _1747584000000_CreateDocsTables_1 = require("./1747584000000-CreateDocsTables");
|
|
5
|
+
exports.migrations = [
|
|
6
|
+
_1747584000000_CreateDocsTables_1.CreateDocsTables1747584000000,
|
|
7
|
+
];
|
|
8
|
+
//# sourceMappingURL=migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"./","sources":["docs/migrations/migrations.ts"],"names":[],"mappings":";;;AAAA,sFAAiF;AAEpE,QAAA,UAAU,GAAG;IACvB,+DAA6B;CAC/B,CAAC"}
|
package/global.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CacheController } from './cache/cache.controller';
|
|
|
5
5
|
import { WorkerData } from './workers/interfaces';
|
|
6
6
|
import { Dictionary } from '@rockster/common';
|
|
7
7
|
import { ActionDef, CoreOptions, IActionDocs, Interceptor, LocaleService, Object, Property } from './core';
|
|
8
|
+
import { TaskHook } from './tasks/interfaces/task-hook';
|
|
8
9
|
import { Action as ActionDecorator } from './controllers';
|
|
9
10
|
import { PostAction as PostActionDecorator, RemoveAction as RemoveActionDecorator } from './command/decorators';
|
|
10
11
|
import { Controller as RequestDecorator } from './controllers/decorators/controller.decorator';
|
|
@@ -36,6 +37,7 @@ declare global {
|
|
|
36
37
|
restfulActionsDocs: IActionDocs[];
|
|
37
38
|
models: Function[];
|
|
38
39
|
interceptors: Dictionary<Interceptor>;
|
|
40
|
+
taskHooks: Dictionary<TaskHook>;
|
|
39
41
|
isAuthRequired?: boolean;
|
|
40
42
|
isAuthEnabled?: boolean;
|
|
41
43
|
workers?: WorkerData[];
|
package/global.js
CHANGED
package/global.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sourceRoot":"./","sources":["global.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,6CAAiD;AACjD,yDAGgC;
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"./","sources":["global.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,6CAAiD;AACjD,yDAGgC;AAehC,+CAA0D;AAC1D,qDAG8B;AAC9B,wFAA+F;AAC/F,mEAAsE;AACtE,mDAA4C;AAE/B,QAAA,YAA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entity-id';
|
|
|
10
10
|
export * from './database/decorators';
|
|
11
11
|
export * from './database/interfaces';
|
|
12
12
|
export * from './database/exports';
|
|
13
|
-
export * from './database/functions/use-protector';
|
|
14
13
|
export * from './database/functions/execute-if-not-exists-column';
|
|
15
14
|
export * from './database/functions/execute-if-not-exists-table';
|
|
16
15
|
export * from './http/interfaces';
|
|
17
16
|
export * from './security/interfaces';
|
|
18
17
|
export * from './security/functions/create-authorization';
|
|
18
|
+
export * from './security/functions/create-authentication-interceptor';
|
|
19
19
|
export * from './module/decorators';
|
|
20
20
|
export * from './module/interfaces';
|
|
21
21
|
export * from './web-socket/interfaces';
|
|
@@ -44,3 +44,4 @@ export * from './translations/functions/create-translation-values';
|
|
|
44
44
|
export * from './translations/functions/get-translation-config';
|
|
45
45
|
export * from './translations/services/translator.service';
|
|
46
46
|
export * from './forms/services/form.service';
|
|
47
|
+
export * from './remote-logs';
|
package/index.js
CHANGED
|
@@ -26,12 +26,12 @@ __exportStar(require("./database/functions/generate-entity-id"), exports);
|
|
|
26
26
|
__exportStar(require("./database/decorators"), exports);
|
|
27
27
|
__exportStar(require("./database/interfaces"), exports);
|
|
28
28
|
__exportStar(require("./database/exports"), exports);
|
|
29
|
-
__exportStar(require("./database/functions/use-protector"), exports);
|
|
30
29
|
__exportStar(require("./database/functions/execute-if-not-exists-column"), exports);
|
|
31
30
|
__exportStar(require("./database/functions/execute-if-not-exists-table"), exports);
|
|
32
31
|
__exportStar(require("./http/interfaces"), exports);
|
|
33
32
|
__exportStar(require("./security/interfaces"), exports);
|
|
34
33
|
__exportStar(require("./security/functions/create-authorization"), exports);
|
|
34
|
+
__exportStar(require("./security/functions/create-authentication-interceptor"), exports);
|
|
35
35
|
__exportStar(require("./module/decorators"), exports);
|
|
36
36
|
__exportStar(require("./module/interfaces"), exports);
|
|
37
37
|
__exportStar(require("./web-socket/interfaces"), exports);
|
|
@@ -59,4 +59,5 @@ __exportStar(require("./translations/functions/create-translation-values"), expo
|
|
|
59
59
|
__exportStar(require("./translations/functions/get-translation-config"), exports);
|
|
60
60
|
__exportStar(require("./translations/services/translator.service"), exports);
|
|
61
61
|
__exportStar(require("./forms/services/form.service"), exports);
|
|
62
|
+
__exportStar(require("./remote-logs"), exports);
|
|
62
63
|
//# sourceMappingURL=index.js.map
|