@quadnix/octo 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.type.d.ts +124 -27
- package/dist/app.type.js +77 -7
- package/dist/app.type.js.map +1 -1
- package/dist/decorators/action.decorator.d.ts +7 -8
- package/dist/decorators/action.decorator.js +45 -44
- package/dist/decorators/action.decorator.js.map +1 -1
- package/dist/decorators/anchor.decorator.d.ts +2 -2
- package/dist/decorators/anchor.decorator.js +16 -11
- package/dist/decorators/anchor.decorator.js.map +1 -1
- package/dist/decorators/enable-hook.decorator.js +2 -2
- package/dist/decorators/enable-hook.decorator.js.map +1 -1
- package/dist/decorators/event-source.decorator.d.ts +1 -1
- package/dist/decorators/event-source.decorator.js +7 -2
- package/dist/decorators/event-source.decorator.js.map +1 -1
- package/dist/decorators/factory.decorator.d.ts +32 -1
- package/dist/decorators/factory.decorator.js +35 -3
- package/dist/decorators/factory.decorator.js.map +1 -1
- package/dist/decorators/model.decorator.d.ts +3 -2
- package/dist/decorators/model.decorator.js +24 -11
- package/dist/decorators/model.decorator.js.map +1 -1
- package/dist/decorators/module.decorator.d.ts +4 -71
- package/dist/decorators/module.decorator.js +18 -58
- package/dist/decorators/module.decorator.js.map +1 -1
- package/dist/decorators/on-event.decorator.d.ts +1 -1
- package/dist/decorators/on-event.decorator.js +7 -2
- package/dist/decorators/on-event.decorator.js.map +1 -1
- package/dist/decorators/overlay.decorator.d.ts +3 -2
- package/dist/decorators/overlay.decorator.js +23 -11
- package/dist/decorators/overlay.decorator.js.map +1 -1
- package/dist/decorators/resource.decorator.d.ts +3 -2
- package/dist/decorators/resource.decorator.js +23 -11
- package/dist/decorators/resource.decorator.js.map +1 -1
- package/dist/decorators/validate.decorator.d.ts +4 -4
- package/dist/decorators/validate.decorator.js +16 -2
- package/dist/decorators/validate.decorator.js.map +1 -1
- package/dist/errors/container.error.d.ts +11 -0
- package/dist/errors/container.error.js +20 -0
- package/dist/errors/container.error.js.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.js +7 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/input.error.d.ts +11 -0
- package/dist/errors/input.error.js +21 -0
- package/dist/errors/input.error.js.map +1 -0
- package/dist/errors/module.error.d.ts +4 -0
- package/dist/errors/module.error.js +8 -0
- package/dist/errors/module.error.js.map +1 -0
- package/dist/errors/node.error.d.ts +36 -0
- package/dist/errors/node.error.js +60 -0
- package/dist/errors/node.error.js.map +1 -0
- package/dist/errors/schema.error.d.ts +4 -0
- package/dist/errors/schema.error.js +8 -0
- package/dist/errors/schema.error.js.map +1 -0
- package/dist/errors/transaction.error.d.ts +35 -0
- package/dist/errors/transaction.error.js +58 -0
- package/dist/errors/transaction.error.js.map +1 -0
- package/dist/events/action.event.d.ts +13 -0
- package/dist/events/action.event.js +11 -0
- package/dist/events/action.event.js.map +1 -0
- package/dist/events/event.model.d.ts +6 -12
- package/dist/events/event.model.js +5 -11
- package/dist/events/event.model.js.map +1 -1
- package/dist/events/hook/commit.hook.event.d.ts +25 -0
- package/dist/events/hook/commit.hook.event.js +26 -0
- package/dist/events/hook/commit.hook.event.js.map +1 -0
- package/dist/events/hook/hook.event.d.ts +9 -0
- package/dist/events/hook/hook.event.js +10 -0
- package/dist/events/hook/hook.event.js.map +1 -0
- package/dist/events/hook/index.d.ts +4 -0
- package/dist/events/hook/index.js +5 -0
- package/dist/events/hook/index.js.map +1 -0
- package/dist/events/hook/model.hook.event.d.ts +25 -0
- package/dist/events/hook/model.hook.event.js +26 -0
- package/dist/events/hook/model.hook.event.js.map +1 -0
- package/dist/events/hook/resource.hook.event.d.ts +25 -0
- package/dist/events/hook/resource.hook.event.js +26 -0
- package/dist/events/hook/resource.hook.event.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +8 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/module.event.d.ts +1 -6
- package/dist/events/module.event.js +0 -5
- package/dist/events/module.event.js.map +1 -1
- package/dist/events/registration.event.d.ts +9 -51
- package/dist/events/registration.event.js +16 -64
- package/dist/events/registration.event.js.map +1 -1
- package/dist/events/serialization.event.d.ts +24 -37
- package/dist/events/serialization.event.js +49 -33
- package/dist/events/serialization.event.js.map +1 -1
- package/dist/events/transaction.event.d.ts +45 -26
- package/dist/events/transaction.event.js +43 -25
- package/dist/events/transaction.event.js.map +1 -1
- package/dist/{decorators → functions/container}/container.d.ts +45 -31
- package/dist/{decorators → functions/container}/container.js +90 -58
- package/dist/functions/container/container.js.map +1 -0
- package/dist/{decorators → functions/container}/test-container.d.ts +5 -13
- package/dist/{decorators → functions/container}/test-container.js +31 -43
- package/dist/functions/container/test-container.js.map +1 -0
- package/dist/functions/dependency/dependency.d.ts +6 -6
- package/dist/functions/dependency/dependency.js +4 -3
- package/dist/functions/dependency/dependency.js.map +1 -1
- package/dist/functions/diff/diff-metadata.d.ts +4 -6
- package/dist/functions/diff/diff-metadata.js +4 -3
- package/dist/functions/diff/diff-metadata.js.map +1 -1
- package/dist/functions/diff/diff.d.ts +12 -7
- package/dist/functions/diff/diff.js +9 -12
- package/dist/functions/diff/diff.js.map +1 -1
- package/dist/functions/diff/diff.utility.d.ts +24 -24
- package/dist/functions/diff/diff.utility.js +46 -25
- package/dist/functions/diff/diff.utility.js.map +1 -1
- package/dist/functions/hook/commit.hook.d.ts +14 -3
- package/dist/functions/hook/commit.hook.js +16 -16
- package/dist/functions/hook/commit.hook.js.map +1 -1
- package/dist/functions/hook/hook.interface.d.ts +7 -6
- package/dist/functions/hook/model-action.hook.d.ts +17 -5
- package/dist/functions/hook/model-action.hook.js +20 -39
- package/dist/functions/hook/model-action.hook.js.map +1 -1
- package/dist/functions/hook/resource-action.hook.d.ts +17 -5
- package/dist/functions/hook/resource-action.hook.js +18 -18
- package/dist/functions/hook/resource-action.hook.js.map +1 -1
- package/dist/functions/node/node-action.abstract.d.ts +7 -0
- package/dist/functions/node/node-action.abstract.js +20 -0
- package/dist/functions/node/node-action.abstract.js.map +1 -0
- package/dist/functions/node/node.abstract.d.ts +93 -0
- package/dist/functions/node/node.abstract.js +342 -0
- package/dist/functions/node/node.abstract.js.map +1 -0
- package/dist/functions/node/node.interface.d.ts +176 -0
- package/dist/functions/node/node.interface.js +2 -0
- package/dist/functions/node/node.interface.js.map +1 -0
- package/dist/functions/schema/schema.d.ts +4 -0
- package/dist/functions/schema/schema.js +38 -0
- package/dist/functions/schema/schema.js.map +1 -0
- package/dist/index.d.ts +31 -33
- package/dist/index.js +32 -16
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +34 -22
- package/dist/main.js +92 -53
- package/dist/main.js.map +1 -1
- package/dist/models/account/account.model.d.ts +23 -0
- package/dist/models/account/account.model.js +67 -0
- package/dist/models/account/account.model.js.map +1 -0
- package/dist/models/account/account.schema.d.ts +7 -0
- package/dist/models/account/account.schema.js +12 -0
- package/dist/models/account/account.schema.js.map +1 -0
- package/dist/models/app/app.model.d.ts +6 -15
- package/dist/models/app/app.model.js +26 -31
- package/dist/models/app/app.model.js.map +1 -1
- package/dist/models/app/app.schema.d.ts +3 -0
- package/dist/models/app/app.schema.js +21 -0
- package/dist/models/app/app.schema.js.map +1 -0
- package/dist/models/deployment/deployment.model.d.ts +6 -13
- package/dist/models/deployment/deployment.model.js +11 -16
- package/dist/models/deployment/deployment.model.js.map +1 -1
- package/dist/models/deployment/deployment.schema.d.ts +7 -0
- package/dist/models/deployment/deployment.schema.js +25 -0
- package/dist/models/deployment/deployment.schema.js.map +1 -0
- package/dist/models/environment/environment.model.d.ts +5 -15
- package/dist/models/environment/environment.model.js +10 -28
- package/dist/models/environment/environment.model.js.map +1 -1
- package/dist/models/environment/environment.schema.d.ts +13 -0
- package/dist/models/environment/environment.schema.js +38 -0
- package/dist/models/environment/environment.schema.js.map +1 -0
- package/dist/models/execution/execution.model.d.ts +6 -14
- package/dist/models/execution/execution.model.js +15 -28
- package/dist/models/execution/execution.model.js.map +1 -1
- package/dist/models/execution/execution.schema.d.ts +14 -0
- package/dist/models/execution/execution.schema.js +34 -0
- package/dist/models/execution/execution.schema.js.map +1 -0
- package/dist/models/filesystem/filesystem.model.d.ts +10 -0
- package/dist/models/filesystem/filesystem.model.js +43 -0
- package/dist/models/filesystem/filesystem.model.js.map +1 -0
- package/dist/models/filesystem/filesystem.schema.d.ts +3 -0
- package/dist/models/filesystem/filesystem.schema.js +21 -0
- package/dist/models/filesystem/filesystem.schema.js.map +1 -0
- package/dist/models/image/image.model.d.ts +7 -41
- package/dist/models/image/image.model.js +17 -32
- package/dist/models/image/image.model.js.map +1 -1
- package/dist/models/image/image.schema.d.ts +9 -0
- package/dist/models/image/image.schema.js +31 -0
- package/dist/models/image/image.schema.js.map +1 -0
- package/dist/models/model-action.interface.d.ts +5 -19
- package/dist/models/model.abstract.d.ts +28 -316
- package/dist/models/model.abstract.js +180 -557
- package/dist/models/model.abstract.js.map +1 -1
- package/dist/models/model.interface.d.ts +42 -21
- package/dist/models/pipeline/pipeline.model.d.ts +5 -8
- package/dist/models/pipeline/pipeline.model.js +10 -16
- package/dist/models/pipeline/pipeline.model.js.map +1 -1
- package/dist/models/pipeline/pipeline.schema.d.ts +4 -0
- package/dist/models/pipeline/pipeline.schema.js +22 -0
- package/dist/models/pipeline/pipeline.schema.js.map +1 -0
- package/dist/models/region/region.model.d.ts +8 -9
- package/dist/models/region/region.model.js +25 -17
- package/dist/models/region/region.model.js.map +1 -1
- package/dist/models/region/region.schema.d.ts +3 -0
- package/dist/models/region/region.schema.js +21 -0
- package/dist/models/region/region.schema.js.map +1 -0
- package/dist/models/server/server.model.d.ts +5 -11
- package/dist/models/server/server.model.js +13 -16
- package/dist/models/server/server.model.js.map +1 -1
- package/dist/models/server/server.schema.d.ts +6 -0
- package/dist/models/server/server.schema.js +24 -0
- package/dist/models/server/server.schema.js.map +1 -0
- package/dist/models/service/service.model.d.ts +4 -10
- package/dist/models/service/service.model.js +12 -16
- package/dist/models/service/service.model.js.map +1 -1
- package/dist/models/service/service.schema.d.ts +6 -0
- package/dist/models/service/service.schema.js +24 -0
- package/dist/models/service/service.schema.js.map +1 -0
- package/dist/models/subnet/subnet.model.d.ts +10 -35
- package/dist/models/subnet/subnet.model.js +16 -47
- package/dist/models/subnet/subnet.model.js.map +1 -1
- package/dist/models/subnet/subnet.schema.d.ts +33 -0
- package/dist/models/subnet/subnet.schema.js +48 -0
- package/dist/models/subnet/subnet.schema.js.map +1 -0
- package/dist/modules/module.abstract.d.ts +21 -0
- package/dist/modules/module.abstract.js +14 -0
- package/dist/modules/module.abstract.js.map +1 -0
- package/dist/modules/module.container.d.ts +32 -18
- package/dist/modules/module.container.js +134 -81
- package/dist/modules/module.container.js.map +1 -1
- package/dist/modules/module.interface.d.ts +15 -2
- package/dist/modules/test-module.container.d.ts +33 -15
- package/dist/modules/test-module.container.js +264 -35
- package/dist/modules/test-module.container.js.map +1 -1
- package/dist/overlays/anchor.abstract.d.ts +13 -8
- package/dist/overlays/anchor.abstract.js.map +1 -1
- package/dist/overlays/anchor.interface.d.ts +5 -8
- package/dist/overlays/anchor.schema.d.ts +8 -0
- package/dist/overlays/anchor.schema.js +9 -0
- package/dist/overlays/anchor.schema.js.map +1 -0
- package/dist/overlays/overlay-data.repository.d.ts +3 -6
- package/dist/overlays/overlay-data.repository.js +17 -38
- package/dist/overlays/overlay-data.repository.js.map +1 -1
- package/dist/overlays/overlay.abstract.d.ts +15 -17
- package/dist/overlays/overlay.abstract.js +30 -44
- package/dist/overlays/overlay.abstract.js.map +1 -1
- package/dist/overlays/overlay.interface.d.ts +3 -7
- package/dist/overlays/overlay.schema.d.ts +8 -0
- package/dist/overlays/overlay.schema.js +9 -0
- package/dist/overlays/overlay.schema.js.map +1 -0
- package/dist/resources/resource-action.interface.d.ts +4 -3
- package/dist/resources/resource-data.repository.d.ts +16 -7
- package/dist/resources/resource-data.repository.js +118 -42
- package/dist/resources/resource-data.repository.js.map +1 -1
- package/dist/resources/resource.abstract.d.ts +56 -16
- package/dist/resources/resource.abstract.js +326 -19
- package/dist/resources/resource.abstract.js.map +1 -1
- package/dist/resources/resource.interface.d.ts +39 -8
- package/dist/resources/resource.schema.d.ts +14 -0
- package/dist/resources/resource.schema.js +11 -0
- package/dist/resources/resource.schema.js.map +1 -0
- package/dist/services/capture/capture.service.d.ts +6 -7
- package/dist/services/capture/capture.service.js +8 -5
- package/dist/services/capture/capture.service.js.map +1 -1
- package/dist/services/event/event.service.d.ts +3 -4
- package/dist/services/event/event.service.js +7 -9
- package/dist/services/event/event.service.js.map +1 -1
- package/dist/services/input/input.service.d.ts +62 -6
- package/dist/services/input/input.service.js +290 -14
- package/dist/services/input/input.service.js.map +1 -1
- package/dist/services/schema-translation/schema-translation.service.d.ts +13 -0
- package/dist/services/schema-translation/schema-translation.service.js +42 -0
- package/dist/services/schema-translation/schema-translation.service.js.map +1 -0
- package/dist/services/serialization/model/model-serialization.service.d.ts +1 -4
- package/dist/services/serialization/model/model-serialization.service.js +37 -33
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.d.ts +5 -5
- package/dist/services/serialization/resource/resource-serialization.service.js +71 -96
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/state-management/local.state-provider.d.ts +0 -1
- package/dist/services/state-management/local.state-provider.js +5 -7
- package/dist/services/state-management/local.state-provider.js.map +1 -1
- package/dist/services/state-management/state-management.service.d.ts +2 -3
- package/dist/services/state-management/state-management.service.js +19 -9
- package/dist/services/state-management/state-management.service.js.map +1 -1
- package/dist/services/state-management/state-provider.interface.d.ts +0 -1
- package/dist/services/state-management/test.state-provider.d.ts +0 -1
- package/dist/services/state-management/test.state-provider.js +2 -1
- package/dist/services/state-management/test.state-provider.js.map +1 -1
- package/dist/services/transaction/transaction.service.d.ts +18 -14
- package/dist/services/transaction/transaction.service.js +261 -132
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/dist/services/validation/validation.service.d.ts +2 -3
- package/dist/services/validation/validation.service.js +27 -12
- package/dist/services/validation/validation.service.js.map +1 -1
- package/dist/utilities/node/node.utility.d.ts +4 -0
- package/dist/utilities/node/node.utility.js +22 -0
- package/dist/utilities/node/node.utility.js.map +1 -0
- package/dist/utilities/object/object.utility.d.ts +3 -0
- package/dist/utilities/object/object.utility.js +33 -0
- package/dist/utilities/object/object.utility.js.map +1 -1
- package/dist/utilities/test-helpers/test-classes.d.ts +57 -0
- package/dist/utilities/test-helpers/test-classes.js +76 -0
- package/dist/utilities/test-helpers/test-classes.js.map +1 -0
- package/dist/utilities/test-helpers/test-models.d.ts +41 -0
- package/dist/utilities/test-helpers/test-models.js +224 -0
- package/dist/utilities/test-helpers/test-models.js.map +1 -0
- package/dist/utilities/test-helpers/test-overlays.d.ts +10 -0
- package/dist/utilities/test-helpers/test-overlays.js +53 -0
- package/dist/utilities/test-helpers/test-overlays.js.map +1 -0
- package/dist/utilities/test-helpers/test-resources.d.ts +22 -0
- package/dist/utilities/test-helpers/test-resources.js +162 -0
- package/dist/utilities/test-helpers/test-resources.js.map +1 -0
- package/dist/utilities/validation/validation.utility.d.ts +31 -3
- package/dist/utilities/validation/validation.utility.js +121 -2
- package/dist/utilities/validation/validation.utility.js.map +1 -1
- package/package.json +6 -6
- package/dist/decorators/container.js.map +0 -1
- package/dist/decorators/test-container.js.map +0 -1
- package/dist/events/error.event.d.ts +0 -35
- package/dist/events/error.event.js +0 -36
- package/dist/events/error.event.js.map +0 -1
- package/dist/events/hook.event.d.ts +0 -194
- package/dist/events/hook.event.js +0 -195
- package/dist/events/hook.event.js.map +0 -1
- package/dist/models/app/app.interface.d.ts +0 -9
- package/dist/models/app/app.interface.js +0 -2
- package/dist/models/app/app.interface.js.map +0 -1
- package/dist/models/deployment/deployment.interface.d.ts +0 -9
- package/dist/models/deployment/deployment.interface.js +0 -2
- package/dist/models/deployment/deployment.interface.js.map +0 -1
- package/dist/models/environment/environment.interface.d.ts +0 -12
- package/dist/models/environment/environment.interface.js +0 -2
- package/dist/models/environment/environment.interface.js.map +0 -1
- package/dist/models/execution/execution.interface.d.ts +0 -14
- package/dist/models/execution/execution.interface.js +0 -2
- package/dist/models/execution/execution.interface.js.map +0 -1
- package/dist/models/image/image.interface.d.ts +0 -12
- package/dist/models/image/image.interface.js +0 -2
- package/dist/models/image/image.interface.js.map +0 -1
- package/dist/models/pipeline/pipeline.interface.d.ts +0 -10
- package/dist/models/pipeline/pipeline.interface.js +0 -2
- package/dist/models/pipeline/pipeline.interface.js.map +0 -1
- package/dist/models/region/region.interface.d.ts +0 -9
- package/dist/models/region/region.interface.js +0 -2
- package/dist/models/region/region.interface.js.map +0 -1
- package/dist/models/server/server.interface.d.ts +0 -9
- package/dist/models/server/server.interface.js +0 -2
- package/dist/models/server/server.interface.js.map +0 -1
- package/dist/models/service/service.interface.d.ts +0 -9
- package/dist/models/service/service.interface.js +0 -2
- package/dist/models/service/service.interface.js.map +0 -1
- package/dist/models/subnet/subnet.interface.d.ts +0 -13
- package/dist/models/subnet/subnet.interface.js +0 -2
- package/dist/models/subnet/subnet.interface.js.map +0 -1
- package/dist/overlays/overlay.service.d.ts +0 -18
- package/dist/overlays/overlay.service.js +0 -45
- package/dist/overlays/overlay.service.js.map +0 -1
- package/dist/resources/shared-resource.abstract.d.ts +0 -13
- package/dist/resources/shared-resource.abstract.js +0 -47
- package/dist/resources/shared-resource.abstract.js.map +0 -1
|
@@ -1,13 +1,69 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UnknownModel, UnknownModule, UnknownOverlay, UnknownResource } from '../../app.type.js';
|
|
2
|
+
import { OverlayDataRepository } from '../../overlays/overlay-data.repository.js';
|
|
2
3
|
import { ResourceDataRepository } from '../../resources/resource-data.repository.js';
|
|
3
4
|
export declare class InputService {
|
|
5
|
+
private readonly overlayDataRepository;
|
|
4
6
|
private readonly resourceDataRepository;
|
|
5
|
-
private
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
private inputs;
|
|
8
|
+
private metadata;
|
|
9
|
+
private models;
|
|
10
|
+
private modules;
|
|
11
|
+
private overlays;
|
|
12
|
+
private resources;
|
|
13
|
+
private tags;
|
|
14
|
+
constructor(overlayDataRepository: OverlayDataRepository, resourceDataRepository: ResourceDataRepository);
|
|
15
|
+
getAllNodeKeys(moduleId: string): string[];
|
|
16
|
+
getMetadataKeys(moduleId: string): string[];
|
|
17
|
+
getModule<M extends UnknownModule>(moduleId: string): M | undefined;
|
|
18
|
+
getModuleIdFromModel(model: UnknownModel): string;
|
|
19
|
+
getModuleIdFromOverlay(overlay: UnknownOverlay): string;
|
|
20
|
+
getModuleIdFromResource(resource: UnknownResource): string;
|
|
21
|
+
getModuleResources(moduleId: string): UnknownResource[];
|
|
22
|
+
/**
|
|
23
|
+
* Registers the inputs passed to an instance of module.
|
|
24
|
+
* It maps the input key provided to the module with the input value.
|
|
25
|
+
* The value can be a direct value, or can be a reference "${{var}}" to
|
|
26
|
+
* another input, module, overlay, or resource.
|
|
27
|
+
*/
|
|
28
|
+
registerInput(moduleId: string, key: string, value: unknown): void;
|
|
29
|
+
registerMetadata(moduleId: string, key: string, value: unknown): void;
|
|
30
|
+
/**
|
|
31
|
+
* Registers the model generated by an instance of module.
|
|
32
|
+
* The key is a reference to the model generated by the module, and maps directly to the model instance.
|
|
33
|
+
*/
|
|
34
|
+
registerModel(moduleId: string, model: UnknownModel): void;
|
|
35
|
+
registerModule(moduleId: string, module: UnknownModule): void;
|
|
36
|
+
/**
|
|
37
|
+
* Registers the overlay generated by an instance of module.
|
|
38
|
+
* The key is a reference to the overlay generated by the module, and maps to the overlay context.
|
|
39
|
+
*/
|
|
40
|
+
registerOverlay(moduleId: string, overlay: UnknownOverlay): void;
|
|
41
|
+
/**
|
|
42
|
+
* Registers the resource generated by an instance of module.
|
|
43
|
+
* The key is a reference to the resource generated by the module, and maps to the resource context.
|
|
44
|
+
*/
|
|
45
|
+
registerResource(moduleId: string, resource: UnknownResource): void;
|
|
46
|
+
registerTag(scope: true | {
|
|
47
|
+
moduleId: string;
|
|
48
|
+
} | {
|
|
49
|
+
moduleId: string;
|
|
50
|
+
resourceContext: string;
|
|
51
|
+
}, tags: {
|
|
52
|
+
[key: string]: string;
|
|
53
|
+
}): void;
|
|
54
|
+
resolve(key: string): unknown | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Given an input key, returns the resolved input key.
|
|
57
|
+
* An input key is resolved when the value is not a pointer to another input.
|
|
58
|
+
* Otherwise, an input key could be referencing another input, module, overlay, or resource.
|
|
59
|
+
* E.g. module.input.key = ${{another_module.input.key}}
|
|
60
|
+
* This method traverses the value of the input key recursively until it is resolved.
|
|
61
|
+
*/
|
|
62
|
+
private resolveInputKey;
|
|
63
|
+
private resolveInputValue;
|
|
64
|
+
private resolveObjectPath;
|
|
9
65
|
}
|
|
10
66
|
export declare class InputServiceFactory {
|
|
11
67
|
private static instance;
|
|
12
|
-
static create(): Promise<InputService>;
|
|
68
|
+
static create(forceNew?: boolean): Promise<InputService>;
|
|
13
69
|
}
|
|
@@ -4,34 +4,310 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Container } from '../../decorators/container.js';
|
|
8
7
|
import { Factory } from '../../decorators/factory.decorator.js';
|
|
8
|
+
import { InputRegistrationError, InputResolutionError } from '../../errors/index.js';
|
|
9
|
+
import { Container } from '../../functions/container/container.js';
|
|
10
|
+
import { OverlayDataRepository } from '../../overlays/overlay-data.repository.js';
|
|
9
11
|
import { ResourceDataRepository } from '../../resources/resource-data.repository.js';
|
|
12
|
+
import { ObjectUtility } from '../../utilities/object/object.utility.js';
|
|
10
13
|
export class InputService {
|
|
11
|
-
constructor(resourceDataRepository) {
|
|
14
|
+
constructor(overlayDataRepository, resourceDataRepository) {
|
|
15
|
+
this.overlayDataRepository = overlayDataRepository;
|
|
12
16
|
this.resourceDataRepository = resourceDataRepository;
|
|
13
17
|
this.inputs = {};
|
|
18
|
+
this.metadata = {};
|
|
19
|
+
this.models = {};
|
|
20
|
+
this.modules = {};
|
|
21
|
+
this.overlays = {};
|
|
22
|
+
this.resources = {};
|
|
23
|
+
this.tags = {
|
|
24
|
+
_global: {},
|
|
25
|
+
};
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
getAllNodeKeys(moduleId) {
|
|
28
|
+
const keys = [];
|
|
29
|
+
for (const key of Object.keys(this.models)) {
|
|
30
|
+
if (key.startsWith(`${moduleId}.model`)) {
|
|
31
|
+
keys.push(key);
|
|
32
|
+
}
|
|
19
33
|
}
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
for (const key of Object.keys(this.overlays)) {
|
|
35
|
+
if (key.startsWith(`${moduleId}.overlay`)) {
|
|
36
|
+
keys.push(key);
|
|
37
|
+
}
|
|
22
38
|
}
|
|
39
|
+
for (const key of Object.keys(this.resources)) {
|
|
40
|
+
if (key.startsWith(`${moduleId}.resource`)) {
|
|
41
|
+
keys.push(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return keys;
|
|
45
|
+
}
|
|
46
|
+
getMetadataKeys(moduleId) {
|
|
47
|
+
return Object.keys(this.metadata).filter((key) => key.startsWith(`${moduleId}.metadata`));
|
|
48
|
+
}
|
|
49
|
+
getModule(moduleId) {
|
|
50
|
+
const moduleKey = `${moduleId}.module`;
|
|
51
|
+
return this.modules[moduleKey];
|
|
52
|
+
}
|
|
53
|
+
getModuleIdFromModel(model) {
|
|
54
|
+
const modelContext = model.getContext();
|
|
55
|
+
const [key] = Object.entries(this.models).find(([, m]) => m.getContext() === modelContext);
|
|
56
|
+
return key.split('.')[0];
|
|
57
|
+
}
|
|
58
|
+
getModuleIdFromOverlay(overlay) {
|
|
59
|
+
const overlayContext = overlay.getContext();
|
|
60
|
+
const [key] = Object.entries(this.overlays).find(([, o]) => o === overlayContext);
|
|
61
|
+
return key.split('.')[0];
|
|
62
|
+
}
|
|
63
|
+
getModuleIdFromResource(resource) {
|
|
64
|
+
const context = resource.getContext();
|
|
65
|
+
const [key] = Object.entries(this.resources).find(([, r]) => r === context);
|
|
66
|
+
return key.split('.')[0];
|
|
67
|
+
}
|
|
68
|
+
getModuleResources(moduleId) {
|
|
69
|
+
const resourceKeys = [];
|
|
70
|
+
for (const key of Object.keys(this.resources)) {
|
|
71
|
+
if (key.startsWith(`${moduleId}.resource`)) {
|
|
72
|
+
resourceKeys.push(this.resources[key]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return resourceKeys.map((r) => this.resourceDataRepository.getNewResourceByContext(r));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Registers the inputs passed to an instance of module.
|
|
79
|
+
* It maps the input key provided to the module with the input value.
|
|
80
|
+
* The value can be a direct value, or can be a reference "${{var}}" to
|
|
81
|
+
* another input, module, overlay, or resource.
|
|
82
|
+
*/
|
|
83
|
+
registerInput(moduleId, key, value) {
|
|
84
|
+
const inputKey = `${moduleId}.input.${key}`;
|
|
85
|
+
if (this.inputs.hasOwnProperty(inputKey)) {
|
|
86
|
+
throw new InputRegistrationError('Input has already been registered!', inputKey);
|
|
87
|
+
}
|
|
88
|
+
this.inputs[inputKey] = value;
|
|
23
89
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
90
|
+
registerMetadata(moduleId, key, value) {
|
|
91
|
+
const metadataKey = `${moduleId}.metadata.${key}`;
|
|
92
|
+
if (this.metadata.hasOwnProperty(metadataKey)) {
|
|
93
|
+
throw new InputRegistrationError('Metadata has already been registered!', metadataKey);
|
|
27
94
|
}
|
|
95
|
+
this.metadata[metadataKey] = value;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Registers the model generated by an instance of module.
|
|
99
|
+
* The key is a reference to the model generated by the module, and maps directly to the model instance.
|
|
100
|
+
*/
|
|
101
|
+
registerModel(moduleId, model) {
|
|
102
|
+
const modelKey = `${moduleId}.model.${model.constructor.NODE_NAME}`;
|
|
103
|
+
if (this.models.hasOwnProperty(modelKey)) {
|
|
104
|
+
throw new InputRegistrationError('Model has already been registered!', modelKey);
|
|
105
|
+
}
|
|
106
|
+
this.models[modelKey] = model;
|
|
107
|
+
}
|
|
108
|
+
registerModule(moduleId, module) {
|
|
109
|
+
const moduleKey = `${moduleId}.module`;
|
|
110
|
+
if (this.modules.hasOwnProperty(moduleKey)) {
|
|
111
|
+
throw new InputRegistrationError('Module has already been registered!', moduleKey);
|
|
112
|
+
}
|
|
113
|
+
this.modules[moduleKey] = module;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Registers the overlay generated by an instance of module.
|
|
117
|
+
* The key is a reference to the overlay generated by the module, and maps to the overlay context.
|
|
118
|
+
*/
|
|
119
|
+
registerOverlay(moduleId, overlay) {
|
|
120
|
+
const overlayKey = `${moduleId}.overlay.${overlay.overlayId}`;
|
|
121
|
+
if (this.overlays.hasOwnProperty(overlayKey)) {
|
|
122
|
+
throw new InputRegistrationError('Overlay has already been registered!', overlayKey);
|
|
123
|
+
}
|
|
124
|
+
this.overlays[overlayKey] = overlay.getContext();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Registers the resource generated by an instance of module.
|
|
128
|
+
* The key is a reference to the resource generated by the module, and maps to the resource context.
|
|
129
|
+
*/
|
|
130
|
+
registerResource(moduleId, resource) {
|
|
131
|
+
const resourceKey = `${moduleId}.resource.${resource.resourceId}`;
|
|
132
|
+
if (this.resources.hasOwnProperty(resourceKey)) {
|
|
133
|
+
throw new InputRegistrationError('Resource has already been registered!', resourceKey);
|
|
134
|
+
}
|
|
135
|
+
this.resources[resourceKey] = resource.getContext();
|
|
136
|
+
}
|
|
137
|
+
registerTag(scope, tags) {
|
|
138
|
+
const hasResourceContext = (scope) => {
|
|
139
|
+
return scope.hasOwnProperty('resourceContext');
|
|
140
|
+
};
|
|
141
|
+
const moduleId = scope === true ? '_global' : scope.moduleId;
|
|
142
|
+
if (!moduleId) {
|
|
143
|
+
throw new InputRegistrationError('Module not found!', 'undefined');
|
|
144
|
+
}
|
|
145
|
+
if (moduleId !== '_global' && !this.getModule(moduleId)) {
|
|
146
|
+
throw new InputRegistrationError('Module not found!', moduleId);
|
|
147
|
+
}
|
|
148
|
+
if (hasResourceContext(scope)) {
|
|
149
|
+
const moduleResourceContexts = this.getModuleResources(moduleId).map((r) => r.getContext());
|
|
150
|
+
if (!moduleResourceContexts.includes(scope.resourceContext)) {
|
|
151
|
+
throw new InputRegistrationError('Resource not found!', scope.resourceContext);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (!this.tags.hasOwnProperty(moduleId)) {
|
|
155
|
+
this.tags[moduleId] = {};
|
|
156
|
+
}
|
|
157
|
+
let scopedTagContainer = this.tags[moduleId];
|
|
158
|
+
if (hasResourceContext(scope)) {
|
|
159
|
+
if (!scopedTagContainer.hasOwnProperty(scope.resourceContext)) {
|
|
160
|
+
scopedTagContainer[scope.resourceContext] = {};
|
|
161
|
+
}
|
|
162
|
+
scopedTagContainer = scopedTagContainer[scope.resourceContext];
|
|
163
|
+
}
|
|
164
|
+
for (const [key, value] of Object.entries(tags)) {
|
|
165
|
+
if (scopedTagContainer.hasOwnProperty(key)) {
|
|
166
|
+
throw new InputRegistrationError('Tag has already been registered!', key);
|
|
167
|
+
}
|
|
168
|
+
scopedTagContainer[key] = value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
resolve(key) {
|
|
172
|
+
if (!['metadata', 'tag'].includes(key.split('.')[1])) {
|
|
173
|
+
key = this.resolveInputKey(key);
|
|
174
|
+
}
|
|
175
|
+
const keyParts = key.split('.');
|
|
176
|
+
switch (keyParts[1]) {
|
|
177
|
+
case 'input': {
|
|
178
|
+
const input = this.inputs[key];
|
|
179
|
+
if (typeof input === 'object' && input !== null) {
|
|
180
|
+
ObjectUtility.onEveryNestedKey(input, (parent, currentKey, currentValue) => {
|
|
181
|
+
parent[currentKey] = this.resolveInputValue(currentValue);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return input;
|
|
185
|
+
}
|
|
186
|
+
case 'metadata': {
|
|
187
|
+
return this.metadata[key];
|
|
188
|
+
}
|
|
189
|
+
case 'model': {
|
|
190
|
+
const model = this.models[keyParts.slice(0, 3).join('.')];
|
|
191
|
+
if (!model) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
return this.resolveObjectPath(model, keyParts.slice(3).join('.'));
|
|
195
|
+
}
|
|
196
|
+
case 'overlay': {
|
|
197
|
+
const overlayContext = this.overlays[keyParts.slice(0, 3).join('.')];
|
|
198
|
+
const overlay = this.overlayDataRepository.getByContext(overlayContext);
|
|
199
|
+
if (!overlay) {
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
return this.resolveObjectPath(overlay, keyParts.slice(3).join('.'));
|
|
203
|
+
}
|
|
204
|
+
case 'resource': {
|
|
205
|
+
const resourceContext = this.resources[keyParts.slice(0, 3).join('.')];
|
|
206
|
+
const resource = this.resourceDataRepository.getNewResourceByContext(resourceContext);
|
|
207
|
+
if (!resource) {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
return this.resolveObjectPath(resource, keyParts.slice(3).join('.'));
|
|
211
|
+
}
|
|
212
|
+
case 'tag': {
|
|
213
|
+
const moduleId = keyParts[0];
|
|
214
|
+
const resourceContext = keyParts[2];
|
|
215
|
+
const moduleTags = Object.keys(this.tags[moduleId] || {})
|
|
216
|
+
.filter((t) => typeof this.tags[moduleId][t] === 'string')
|
|
217
|
+
.reduce((accumulator, current) => {
|
|
218
|
+
accumulator[current] = this.tags[moduleId][current];
|
|
219
|
+
return accumulator;
|
|
220
|
+
}, {});
|
|
221
|
+
const resourceTags = resourceContext && typeof this.tags[moduleId]?.[resourceContext] === 'object'
|
|
222
|
+
? this.tags[moduleId][resourceContext]
|
|
223
|
+
: {};
|
|
224
|
+
const resourceOverriddenTags = {
|
|
225
|
+
...(this.tags['_global'] || {}),
|
|
226
|
+
...moduleTags,
|
|
227
|
+
...resourceTags,
|
|
228
|
+
};
|
|
229
|
+
ObjectUtility.onEveryNestedKey(resourceOverriddenTags, (parent, currentKey, currentValue) => {
|
|
230
|
+
parent[currentKey] = this.resolveInputValue(currentValue);
|
|
231
|
+
});
|
|
232
|
+
for (const [key, value] of Object.entries(resourceOverriddenTags)) {
|
|
233
|
+
if (value === undefined) {
|
|
234
|
+
throw new InputResolutionError('Tag value is undefined!', key);
|
|
235
|
+
}
|
|
236
|
+
else if (typeof value !== 'string') {
|
|
237
|
+
throw new InputResolutionError('Tag value is not a string!', key);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return resourceOverriddenTags;
|
|
241
|
+
}
|
|
242
|
+
default:
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Given an input key, returns the resolved input key.
|
|
248
|
+
* An input key is resolved when the value is not a pointer to another input.
|
|
249
|
+
* Otherwise, an input key could be referencing another input, module, overlay, or resource.
|
|
250
|
+
* E.g. module.input.key = ${{another_module.input.key}}
|
|
251
|
+
* This method traverses the value of the input key recursively until it is resolved.
|
|
252
|
+
*/
|
|
253
|
+
resolveInputKey(inputKey, maxRecursion = 15, originalInputKey) {
|
|
254
|
+
if (maxRecursion === 0) {
|
|
255
|
+
throw new InputResolutionError('Input could not be resolved!', originalInputKey || inputKey);
|
|
256
|
+
}
|
|
257
|
+
const value = this.inputs[inputKey];
|
|
258
|
+
// If an input key is not found, or is not a string, it is either undefined, or is a non-input value.
|
|
259
|
+
// In this case, the value is resolved and the current input key is returned.
|
|
260
|
+
if (!value || typeof value !== 'string') {
|
|
261
|
+
return inputKey;
|
|
262
|
+
}
|
|
263
|
+
// An input key without the ${{var}} pattern is already resolved.
|
|
264
|
+
const pattern = value.match(/^\$\{\{(.+)}}$/);
|
|
265
|
+
if (!pattern) {
|
|
266
|
+
return inputKey;
|
|
267
|
+
}
|
|
268
|
+
return this.resolveInputKey(pattern[1].trim(), maxRecursion - 1, originalInputKey || inputKey);
|
|
269
|
+
}
|
|
270
|
+
resolveInputValue(inputValue, maxRecursion = 15, originalInputValue) {
|
|
271
|
+
if (maxRecursion === 0) {
|
|
272
|
+
throw new InputResolutionError('Input could not be resolved!', (originalInputValue || inputValue));
|
|
273
|
+
}
|
|
274
|
+
// If an input value is not found, or is not a string, it is either undefined, or is a non-input value.
|
|
275
|
+
// In this case, the value is resolved and that current input value is returned.
|
|
276
|
+
if (!inputValue || typeof inputValue !== 'string') {
|
|
277
|
+
return inputValue;
|
|
278
|
+
}
|
|
279
|
+
// An input value without the ${{var}} pattern is already resolved.
|
|
280
|
+
const pattern = inputValue.match(/^\$\{\{(.+)}}$/);
|
|
281
|
+
if (!pattern) {
|
|
282
|
+
return inputValue;
|
|
283
|
+
}
|
|
284
|
+
return this.resolveInputValue(this.resolve(pattern[1].trim()), maxRecursion - 1, originalInputValue || inputValue);
|
|
285
|
+
}
|
|
286
|
+
// https://stackoverflow.com/a/69459511/1834562
|
|
287
|
+
resolveObjectPath(subject, path) {
|
|
288
|
+
if (!path.length) {
|
|
289
|
+
return subject;
|
|
290
|
+
}
|
|
291
|
+
return path.split('.').reduce((obj, key) => obj && obj[key], subject);
|
|
28
292
|
}
|
|
29
293
|
}
|
|
30
294
|
let InputServiceFactory = class InputServiceFactory {
|
|
31
|
-
static async create() {
|
|
32
|
-
const
|
|
295
|
+
static async create(forceNew = false) {
|
|
296
|
+
const overlayDataRepository = await Container.getInstance().get(OverlayDataRepository);
|
|
297
|
+
const resourceDataRepository = await Container.getInstance().get(ResourceDataRepository);
|
|
33
298
|
if (!this.instance) {
|
|
34
|
-
this.instance = new InputService(resourceDataRepository);
|
|
299
|
+
this.instance = new InputService(overlayDataRepository, resourceDataRepository);
|
|
300
|
+
}
|
|
301
|
+
if (forceNew) {
|
|
302
|
+
this.instance['inputs'] = {};
|
|
303
|
+
this.instance['metadata'] = {};
|
|
304
|
+
this.instance['models'] = {};
|
|
305
|
+
this.instance['modules'] = {};
|
|
306
|
+
this.instance['overlays'] = {};
|
|
307
|
+
this.instance['resources'] = {};
|
|
308
|
+
this.instance['tags'] = {
|
|
309
|
+
_global: {},
|
|
310
|
+
};
|
|
35
311
|
}
|
|
36
312
|
return this.instance;
|
|
37
313
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.service.js","sourceRoot":"","sources":["../../../src/services/input/input.service.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,MAAM,OAAO,YAAY;IAGvB,YAA6B,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAF1D,WAAM,GAAiB,EAAE,CAAC;IAEmC,CAAC;IAE/E,QAAQ,CAAC,IAAY;QACnB,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,UAAU,CAAE,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAoB;QACjC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF;AAGM,IAAM,mBAAmB,GAAzB,MAAM,m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AAqB,CAAC,CAAC;QACvF,MAAM,sBAAsB,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEzF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;QAClF,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YAC9B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;YAChC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;gBACtB,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AAzBY,mBAAmB;IAD/B,OAAO,CAAe,YAAY,CAAC;GACvB,mBAAmB,CAyB/B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Constructable } from '../../app.type.js';
|
|
2
|
+
export declare class SchemaTranslationService {
|
|
3
|
+
private readonly translations;
|
|
4
|
+
getTranslatedSchema<S1, S2>(from: Constructable<S1>): {
|
|
5
|
+
schema: Constructable<S2>;
|
|
6
|
+
translator: (synth: S2) => S1;
|
|
7
|
+
} | undefined;
|
|
8
|
+
registerSchemaTranslation<S1, S2>(from: Constructable<S1>, to: Constructable<S2>, translator: (synth: S2) => S1): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class SchemaTranslationServiceFactory {
|
|
11
|
+
private static instance;
|
|
12
|
+
static create(): Promise<SchemaTranslationService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Factory } from '../../decorators/factory.decorator.js';
|
|
8
|
+
export class SchemaTranslationService {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.translations = new Map();
|
|
11
|
+
}
|
|
12
|
+
getTranslatedSchema(from) {
|
|
13
|
+
if (!this.translations.has(from)) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const translation = this.translations.get(from);
|
|
17
|
+
const translationKey = translation.keys().next();
|
|
18
|
+
return {
|
|
19
|
+
schema: translationKey.value,
|
|
20
|
+
translator: translation.get(translationKey.value),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
registerSchemaTranslation(from, to, translator) {
|
|
24
|
+
if (!this.translations.has(from)) {
|
|
25
|
+
this.translations.set(from, new Map());
|
|
26
|
+
}
|
|
27
|
+
this.translations.get(from).set(to, translator);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
let SchemaTranslationServiceFactory = class SchemaTranslationServiceFactory {
|
|
31
|
+
static async create() {
|
|
32
|
+
if (!this.instance) {
|
|
33
|
+
this.instance = new SchemaTranslationService();
|
|
34
|
+
}
|
|
35
|
+
return this.instance;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
SchemaTranslationServiceFactory = __decorate([
|
|
39
|
+
Factory(SchemaTranslationService)
|
|
40
|
+
], SchemaTranslationServiceFactory);
|
|
41
|
+
export { SchemaTranslationServiceFactory };
|
|
42
|
+
//# sourceMappingURL=schema-translation.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-translation.service.js","sourceRoot":"","sources":["../../../src/services/schema-translation/schema-translation.service.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEhE,MAAM,OAAO,wBAAwB;IAArC;QACmB,iBAAY,GAC3B,IAAI,GAAG,EAAE,CAAC;IA2Bd,CAAC;IAzBC,mBAAmB,CACjB,IAAuB;QAEvB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QACjD,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QACjD,OAAO;YACL,MAAM,EAAE,cAAc,CAAC,KAAK;YAC5B,UAAU,EAAE,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAA+B;SAChF,CAAC;IACJ,CAAC;IAED,yBAAyB,CACvB,IAAuB,EACvB,EAAqB,EACrB,UAA6B;QAE7B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;CACF;AAGM,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAG1C,MAAM,CAAC,KAAK,CAAC,MAAM;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AATY,+BAA+B;IAD3C,OAAO,CAA2B,wBAAwB,CAAC;GAC/C,+BAA+B,CAS3C"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type ModelSerializedOutput, type UnknownModel } from '../../../app.type.js';
|
|
2
|
-
import { OverlayDataRepository } from '../../../overlays/overlay-data.repository.js';
|
|
3
2
|
export declare class ModelSerializationService {
|
|
4
|
-
private readonly overlayDataRepository;
|
|
5
3
|
private MODEL_DESERIALIZATION_TIMEOUT_IN_MS;
|
|
6
4
|
private readonly classMapping;
|
|
7
|
-
constructor(overlayDataRepository: OverlayDataRepository);
|
|
8
5
|
private _deserialize;
|
|
9
6
|
deserialize(serializedOutput: ModelSerializedOutput, { freeze }?: {
|
|
10
7
|
freeze?: boolean;
|
|
@@ -15,5 +12,5 @@ export declare class ModelSerializationService {
|
|
|
15
12
|
}
|
|
16
13
|
export declare class ModelSerializationServiceFactory {
|
|
17
14
|
private static instance;
|
|
18
|
-
static create(
|
|
15
|
+
static create(): Promise<ModelSerializationService>;
|
|
19
16
|
}
|
|
@@ -7,20 +7,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { Container } from '../../../decorators/container.js';
|
|
10
|
+
import { NodeType, } from '../../../app.type.js';
|
|
12
11
|
import { EventSource } from '../../../decorators/event-source.decorator.js';
|
|
13
12
|
import { Factory } from '../../../decorators/factory.decorator.js';
|
|
14
|
-
import { AnchorRegistrationEvent, ModelRegistrationEvent, OverlayRegistrationEvent, } from '../../../events/
|
|
15
|
-
import {
|
|
13
|
+
import { AnchorRegistrationEvent, ModelDeserializedEvent, ModelRegistrationEvent, ModelSerializedEvent, OverlayRegistrationEvent, } from '../../../events/index.js';
|
|
14
|
+
import { Container } from '../../../functions/container/container.js';
|
|
16
15
|
import { Dependency } from '../../../functions/dependency/dependency.js';
|
|
17
16
|
import { OverlayDataRepository } from '../../../overlays/overlay-data.repository.js';
|
|
18
17
|
import { ObjectUtility } from '../../../utilities/object/object.utility.js';
|
|
19
|
-
import { EventService } from '../../event/event.service.js';
|
|
20
18
|
export class ModelSerializationService {
|
|
21
|
-
constructor(
|
|
22
|
-
this.
|
|
23
|
-
this.MODEL_DESERIALIZATION_TIMEOUT_IN_MS = 5000;
|
|
19
|
+
constructor() {
|
|
20
|
+
this.MODEL_DESERIALIZATION_TIMEOUT_IN_MS = 3000;
|
|
24
21
|
this.classMapping = {};
|
|
25
22
|
}
|
|
26
23
|
async _deserialize(serializedOutput, freeze) {
|
|
@@ -100,16 +97,15 @@ export class ModelSerializationService {
|
|
|
100
97
|
return { overlays, root };
|
|
101
98
|
}
|
|
102
99
|
async deserialize(serializedOutput, { freeze = true } = {}) {
|
|
103
|
-
const newOverlays = this.overlayDataRepository.getByProperties();
|
|
104
100
|
const { overlays: oldOverlays, root } = await this._deserialize(serializedOutput, freeze);
|
|
105
101
|
// Refresh the overlay data repository.
|
|
106
|
-
await Container.get(OverlayDataRepository, {
|
|
107
|
-
args: [true, oldOverlays, newOverlays],
|
|
108
|
-
});
|
|
109
|
-
EventService.getInstance().emit(new ModelDeserializedEvent());
|
|
102
|
+
await Container.getInstance().get(OverlayDataRepository, { args: [true, oldOverlays] });
|
|
110
103
|
return root;
|
|
111
104
|
}
|
|
112
105
|
registerClass(className, deserializationClass) {
|
|
106
|
+
if (this.classMapping[className]) {
|
|
107
|
+
throw new Error(`Class "${className}" is already registered!`);
|
|
108
|
+
}
|
|
113
109
|
this.classMapping[className] = deserializationClass;
|
|
114
110
|
}
|
|
115
111
|
async serialize(root) {
|
|
@@ -119,13 +115,6 @@ export class ModelSerializationService {
|
|
|
119
115
|
const models = {};
|
|
120
116
|
const overlays = [];
|
|
121
117
|
for (const model of boundary) {
|
|
122
|
-
// Skip serializing models marked as deleted.
|
|
123
|
-
if (model.isMarkedDeleted()) {
|
|
124
|
-
if (model.MODEL_TYPE === ModelType.OVERLAY) {
|
|
125
|
-
this.overlayDataRepository.remove(model);
|
|
126
|
-
}
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
118
|
for (const d of model.getDependencies()) {
|
|
130
119
|
// Skip dependencies that are not part of boundary.
|
|
131
120
|
if (!boundary.some((m) => m.getContext() === d.from.getContext()) ||
|
|
@@ -134,26 +123,40 @@ export class ModelSerializationService {
|
|
|
134
123
|
}
|
|
135
124
|
dependencies.push(d.synth());
|
|
136
125
|
}
|
|
137
|
-
if (model.
|
|
126
|
+
if (model.constructor.NODE_TYPE === NodeType.MODEL) {
|
|
138
127
|
const context = model.getContext();
|
|
139
128
|
if (!models[context]) {
|
|
140
|
-
models[context] = {
|
|
129
|
+
models[context] = {
|
|
130
|
+
className: `${model.constructor.NODE_PACKAGE}/${model.constructor.name}`,
|
|
131
|
+
model: model.synth(),
|
|
132
|
+
};
|
|
141
133
|
}
|
|
142
134
|
for (const a of model.getAnchors()) {
|
|
143
|
-
anchors.push({
|
|
135
|
+
anchors.push({
|
|
136
|
+
...a.synth(),
|
|
137
|
+
className: `${a.constructor.NODE_PACKAGE}/${a.constructor.name}`,
|
|
138
|
+
});
|
|
144
139
|
}
|
|
145
140
|
}
|
|
146
|
-
else if (model.
|
|
147
|
-
overlays.push({
|
|
141
|
+
else if (model.constructor.NODE_TYPE === NodeType.OVERLAY) {
|
|
142
|
+
overlays.push({
|
|
143
|
+
className: `${model.constructor.NODE_PACKAGE}/${model.constructor.name}`,
|
|
144
|
+
overlay: model.synth(),
|
|
145
|
+
});
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
|
-
EventService.getInstance().emit(new ModelSerializedEvent());
|
|
151
148
|
return { anchors, dependencies, models, overlays };
|
|
152
149
|
}
|
|
153
150
|
setModelDeserializationTimeout(timeoutInMs) {
|
|
154
151
|
this.MODEL_DESERIALIZATION_TIMEOUT_IN_MS = timeoutInMs;
|
|
155
152
|
}
|
|
156
153
|
}
|
|
154
|
+
__decorate([
|
|
155
|
+
EventSource(ModelDeserializedEvent),
|
|
156
|
+
__metadata("design:type", Function),
|
|
157
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
158
|
+
__metadata("design:returntype", Promise)
|
|
159
|
+
], ModelSerializationService.prototype, "deserialize", null);
|
|
157
160
|
__decorate([
|
|
158
161
|
EventSource(AnchorRegistrationEvent),
|
|
159
162
|
EventSource(ModelRegistrationEvent),
|
|
@@ -162,15 +165,16 @@ __decorate([
|
|
|
162
165
|
__metadata("design:paramtypes", [String, Object]),
|
|
163
166
|
__metadata("design:returntype", void 0)
|
|
164
167
|
], ModelSerializationService.prototype, "registerClass", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
EventSource(ModelSerializedEvent),
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", [Object]),
|
|
172
|
+
__metadata("design:returntype", Promise)
|
|
173
|
+
], ModelSerializationService.prototype, "serialize", null);
|
|
165
174
|
let ModelSerializationServiceFactory = class ModelSerializationServiceFactory {
|
|
166
|
-
static async create(
|
|
167
|
-
const overlayDataRepository = await Container.get(OverlayDataRepository);
|
|
175
|
+
static async create() {
|
|
168
176
|
if (!this.instance) {
|
|
169
|
-
this.instance = new ModelSerializationService(
|
|
170
|
-
}
|
|
171
|
-
if (forceNew) {
|
|
172
|
-
const newInstance = new ModelSerializationService(overlayDataRepository);
|
|
173
|
-
Object.keys(this.instance).forEach((key) => (this.instance[key] = newInstance[key]));
|
|
177
|
+
this.instance = new ModelSerializationService();
|
|
174
178
|
}
|
|
175
179
|
return this.instance;
|
|
176
180
|
}
|