@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
|
@@ -23,16 +23,24 @@ let TranslationsService = class TranslationsService {
|
|
|
23
23
|
.createQueryBuilder('translationValues')
|
|
24
24
|
.leftJoinAndMapOne('translationValues.translationConfig', translation_config_entity_1.TranslationConfig, 'translationConfig', `translationValues.translation_config_id = translationConfig.id`)
|
|
25
25
|
.where(`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
translationConfig.reference_id = :referenceId
|
|
27
|
+
AND (
|
|
28
|
+
translationValues.locale = :locale
|
|
29
|
+
OR translationValues.locale = translationConfig.default
|
|
30
|
+
)
|
|
31
|
+
`, {
|
|
32
|
+
referenceId,
|
|
33
|
+
locale
|
|
34
|
+
})
|
|
30
35
|
.getMany();
|
|
31
|
-
const
|
|
36
|
+
const scoped = values.filter((value) => {
|
|
37
|
+
return value.translationConfig?.referenceId === referenceId;
|
|
38
|
+
});
|
|
39
|
+
const _default = scoped
|
|
32
40
|
.find((value) => {
|
|
33
41
|
return value.translationConfig?.default === value.locale;
|
|
34
42
|
}) || { values: {} };
|
|
35
|
-
const _requested =
|
|
43
|
+
const _requested = scoped
|
|
36
44
|
.find((value) => {
|
|
37
45
|
return value.locale === locale;
|
|
38
46
|
}) || { values: {} };
|
|
@@ -41,6 +49,17 @@ let TranslationsService = class TranslationsService {
|
|
|
41
49
|
..._requested.values
|
|
42
50
|
};
|
|
43
51
|
}
|
|
52
|
+
async getReferenceIdForConfig(translationConfigId) {
|
|
53
|
+
const config = await this
|
|
54
|
+
.repository
|
|
55
|
+
.manager
|
|
56
|
+
.getRepository(translation_config_entity_1.TranslationConfig)
|
|
57
|
+
.findOne({
|
|
58
|
+
where: { id: translationConfigId },
|
|
59
|
+
select: ['referenceId']
|
|
60
|
+
});
|
|
61
|
+
return config?.referenceId ?? null;
|
|
62
|
+
}
|
|
44
63
|
};
|
|
45
64
|
exports.TranslationsService = TranslationsService;
|
|
46
65
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.service.js","sourceRoot":"./","sources":["translations/services/translations.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AAEtD,qFAA0E;AAC1E,qFAA0E;AAC1E,6CAAkD;AAClD,qCAGiB;AACjB,uCAGqB;AAGd,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAS7B,KAAK,CAAC,SAAS,CACZ,WAAmB,EACnB,MAAc;QAEd,MAAM,MAAM,GAAG,MAAM,IAAI;aACrB,UAAU;aACV,kBAAkB,CAAC,mBAAmB,CAAC;aACvC,iBAAiB,CACf,qCAAqC,EACrC,6CAAiB,EACjB,mBAAmB,EACnB,gEAAgE,CAClE;aACA,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"translations.service.js","sourceRoot":"./","sources":["translations/services/translations.service.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CAAC;aAChC,OAAO,CAAC;YACN,KAAK,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE;YAClC,MAAM,EAAE,CAAC,aAAa,CAAC;SACzB,CAAC,CAAC;QACN,OAAO,MAAM,EAAE,WAAW,IAAI,IAAI,CAAC;IACtC,CAAC;CACH,CAAA;AAjEY,kDAAmB;AAGnB;IADT,IAAA,2BAAgB,EAAC,GAAG,EAAE,CAAC,6CAAiB,CAAC;8BACpB,oBAAU;uDAAoB;AAG1C;IADT,IAAA,mBAAW,GAAE;;kDACiB;8BANrB,mBAAmB;IAD/B,IAAA,2BAAU,GAAE;GACA,mBAAmB,CAiE/B"}
|
|
@@ -7,5 +7,6 @@ export declare class TranslatorService {
|
|
|
7
7
|
protected cache: CacheClient;
|
|
8
8
|
constructor(translationsService: TranslationsService);
|
|
9
9
|
useValues(referenceId: string, locale: Locale): Promise<TranslatorHandle>;
|
|
10
|
+
invalidateReference(referenceId: string): Promise<void>;
|
|
10
11
|
protected getHandle(values: Dictionary<string>): TranslatorHandle;
|
|
11
12
|
}
|
|
@@ -33,6 +33,12 @@ let TranslatorService = class TranslatorService {
|
|
|
33
33
|
await this.cache.expire(key, env_1.env.cacheTTL);
|
|
34
34
|
return this.getHandle(values);
|
|
35
35
|
}
|
|
36
|
+
async invalidateReference(referenceId) {
|
|
37
|
+
const keys = await this.cache.keys(`translations:${referenceId}:*`);
|
|
38
|
+
for (const key of keys) {
|
|
39
|
+
await this.cache.del(key);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
36
42
|
getHandle(values) {
|
|
37
43
|
return (key, replaces = {}) => {
|
|
38
44
|
let value = values[key] || key;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translator.service.js","sourceRoot":"./","sources":["translations/services/translator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,iEAA6D;AAC7D,uCAGqB;AAOrB,gCAA6B;AAGtB,IAAM,iBAAiB,GAAvB,MAAM,iBAAi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CAAC;CACH,CAAA;
|
|
1
|
+
{"version":3,"file":"translator.service.js","sourceRoot":"./","sources":["translations/services/translator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAsD;AACtD,iEAA6D;AAC7D,uCAGqB;AAOrB,gCAA6B;AAGtB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAK3B,YACa,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAClD,CAAC;IAEJ,KAAK,CAAC,SAAS,CACZ,WAAmB,EACnB,MAAc;QAGd,MAAM,GAAG,GAAG,gBAAgB,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,IAAI;aACrB,KAAK;aACL,GAAG,CAAC,GAAG,CAAC,CAAC;QAEb,IAAI,MAAM,EAAE,CAAC;YACV,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI;aACrB,mBAAmB;aACnB,SAAS,CACP,WAAW,EACX,MAAM,CACR,CAAC;QAGL,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAClD,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,SAAG,CAAC,QAAQ,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAC1C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,WAAW,IAAI,CAAC,CAAC;QACpE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACJ,CAAC;IAES,SAAS,CAAC,MAA0B;QAC3C,OAAO,CAAC,GAAW,EAAE,WAA+B,EAAE,EAAE,EAAE;YACvD,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;YAC/B,MAAM;iBACF,mBAAmB,CAAC,QAAQ,CAAC;iBAC7B,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACN,OAAO,KAAK,CAAC;QAChB,CAAC,CAAA;IACJ,CAAC;CACH,CAAA;AAvDY,8CAAiB;AAGjB;IADT,IAAA,mBAAW,GAAE;;gDACe;4BAHnB,iBAAiB;IAD7B,IAAA,2BAAU,GAAE;qCAOwB,0CAAmB;GAN3C,iBAAiB,CAuD7B"}
|
|
@@ -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,EAAE,SAAS,CAAC;AAC5B,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,60 +0,0 @@
|
|
|
1
|
-
import { ObjectNote, PropertyNote } from "@rockster/class-memory";
|
|
2
|
-
import { Dictionary, Instantiable } from "@rockster/common";
|
|
3
|
-
import { EntityManager } from "typeorm";
|
|
4
|
-
import { GetUserPermissionsHandle, SetUserPermissionsHandle } from "../interfaces/protector";
|
|
5
|
-
import { IProtectedEntityOptions } from "../decorators/protected-entity.decorator";
|
|
6
|
-
import { IEntityObject } from "../interfaces/entity-object";
|
|
7
|
-
import { IEntityProperty } from "../interfaces/entity-property";
|
|
8
|
-
type ProtectedData = {
|
|
9
|
-
object: ObjectNote<IEntityObject>;
|
|
10
|
-
context?: PropertyNote<IEntityProperty>;
|
|
11
|
-
options?: IProtectedEntityOptions;
|
|
12
|
-
isContext: boolean;
|
|
13
|
-
};
|
|
14
|
-
type ProtectorData = {
|
|
15
|
-
object: ObjectNote<IEntityObject>;
|
|
16
|
-
target: PropertyNote<IEntityProperty>;
|
|
17
|
-
context?: PropertyNote<IEntityProperty>;
|
|
18
|
-
key?: PropertyNote<IEntityProperty>;
|
|
19
|
-
};
|
|
20
|
-
export declare class ProtectBuilder {
|
|
21
|
-
build(object: ObjectNote<IEntityObject>): Promise<void>;
|
|
22
|
-
protected buildProtectorConfig(object: ObjectNote<IEntityObject>): void;
|
|
23
|
-
protected getRepository(target: Instantiable, entityManager?: EntityManager): import("typeorm").Repository<any>;
|
|
24
|
-
protected createQueryBuilder({ authKeys, data, protectorData, userId, displayContext, entityManager, protectedData }: {
|
|
25
|
-
protectorData: ProtectorData;
|
|
26
|
-
userId: string;
|
|
27
|
-
data: any;
|
|
28
|
-
authKeys: string[];
|
|
29
|
-
displayContext?: string;
|
|
30
|
-
entityManager?: EntityManager;
|
|
31
|
-
protectedData?: ProtectedData;
|
|
32
|
-
}): import("typeorm").SelectQueryBuilder<any>;
|
|
33
|
-
protected buildFilterKeys(protectorAlias: string, protectorKey: string, keys: string[]): string;
|
|
34
|
-
protected getQueryContextAndKeyCondition(protectorData: ProtectorData, protectedData: ProtectedData, protectorAlias: string, alias: string, contextParams: Dictionary<any>, rootPath?: Instantiable): {
|
|
35
|
-
context: string;
|
|
36
|
-
key: string;
|
|
37
|
-
};
|
|
38
|
-
protected buildProtectedConfig(object: ObjectNote<IEntityObject>): void;
|
|
39
|
-
protected getSetUserPermissions(data: ProtectorData): SetUserPermissionsHandle;
|
|
40
|
-
protected getGetUserPermissions(data: ProtectorData): GetUserPermissionsHandle;
|
|
41
|
-
protected getAuthContextFilter(targetUserId: string, data: ProtectorData, contextId: string): {
|
|
42
|
-
where: {
|
|
43
|
-
[x: string]: string;
|
|
44
|
-
};
|
|
45
|
-
keyProperty: PropertyNote<IEntityProperty>;
|
|
46
|
-
contextProperty: PropertyNote<IEntityProperty>;
|
|
47
|
-
targetProperty: PropertyNote<IEntityProperty>;
|
|
48
|
-
};
|
|
49
|
-
protected checkIsAuthorized({ data, userId, entityManager, keys, context, contextId }: {
|
|
50
|
-
data: ProtectorData;
|
|
51
|
-
entityManager?: EntityManager;
|
|
52
|
-
keys: string[];
|
|
53
|
-
context: string;
|
|
54
|
-
contextId: string;
|
|
55
|
-
userId: string;
|
|
56
|
-
}): Promise<void>;
|
|
57
|
-
protected getProtectedData(protector: ProtectorData, object: ObjectNote<IEntityObject>): ProtectedData;
|
|
58
|
-
protected getProtectorData(protector: Instantiable): ProtectorData;
|
|
59
|
-
}
|
|
60
|
-
export {};
|