@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
package/dist/app.type.d.ts
CHANGED
|
@@ -1,32 +1,112 @@
|
|
|
1
1
|
import type { IDependency } from './functions/dependency/dependency.js';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { ANode } from './functions/node/node.abstract.js';
|
|
3
|
+
import type { IModelAction } from './models/model-action.interface.js';
|
|
4
4
|
import type { AModel } from './models/model.abstract.js';
|
|
5
5
|
import type { IModel } from './models/model.interface.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { AModule } from './modules/module.abstract.js';
|
|
7
|
+
import type { AAnchor } from './overlays/anchor.abstract.js';
|
|
8
|
+
import type { BaseAnchorSchema } from './overlays/anchor.schema.js';
|
|
9
|
+
import type { AOverlay } from './overlays/overlay.abstract.js';
|
|
10
|
+
import type { BaseOverlaySchema } from './overlays/overlay.schema.js';
|
|
11
|
+
import type { IResourceAction } from './resources/resource-action.interface.js';
|
|
7
12
|
import type { AResource } from './resources/resource.abstract.js';
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
export declare
|
|
13
|
+
import type { BaseResourceSchema } from './resources/resource.schema.js';
|
|
14
|
+
import type { ValidationUtility } from './utilities/validation/validation.utility.js';
|
|
15
|
+
export declare class MatchingAnchor<S extends BaseAnchorSchema> {
|
|
16
|
+
private readonly actual;
|
|
17
|
+
private readonly schemaTranslator?;
|
|
18
|
+
constructor(actual: AAnchor<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
19
|
+
hasSchemaTranslator(): boolean;
|
|
20
|
+
getActual(): AAnchor<Omit<S, 'properties'> & {
|
|
21
|
+
properties: Record<never, never>;
|
|
22
|
+
}, any>;
|
|
23
|
+
getSchemaInstance(): S;
|
|
24
|
+
}
|
|
25
|
+
export declare class MatchingModel<S extends object> {
|
|
26
|
+
private readonly actual;
|
|
27
|
+
private readonly schemaTranslator?;
|
|
28
|
+
constructor(actual: AModel<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
29
|
+
hasSchemaTranslator(): boolean;
|
|
30
|
+
getActual(): AModel<Record<never, never>, any>;
|
|
31
|
+
getSchemaInstance(): S;
|
|
32
|
+
}
|
|
33
|
+
export declare class MatchingResource<S extends BaseResourceSchema> {
|
|
34
|
+
private readonly actual;
|
|
35
|
+
readonly schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined;
|
|
36
|
+
constructor(actual: AResource<S, any>, schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined);
|
|
37
|
+
addChild(...args: Parameters<AResource<BaseResourceSchema, any>['addChild']>): ReturnType<AResource<BaseResourceSchema, any>['addChild']>;
|
|
38
|
+
hasSchemaTranslator(): boolean;
|
|
39
|
+
getActual(): AResource<Omit<S, 'properties' | 'response' | 'tags'> & {
|
|
40
|
+
properties: Record<never, never>;
|
|
41
|
+
} & {
|
|
42
|
+
response: Record<never, never>;
|
|
43
|
+
} & {
|
|
44
|
+
tags: Record<never, never>;
|
|
45
|
+
}, any>;
|
|
46
|
+
getSchemaInstance(): S;
|
|
47
|
+
getSchemaInstanceInResourceAction(): Omit<S, 'response'> & {
|
|
48
|
+
response: Required<S['response']>;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export declare enum NodeType {
|
|
11
52
|
MODEL = "model",
|
|
12
53
|
OVERLAY = "overlay",
|
|
13
|
-
RESOURCE = "resource"
|
|
14
|
-
SHARED_RESOURCE = "shared-resource"
|
|
54
|
+
RESOURCE = "resource"
|
|
15
55
|
}
|
|
16
56
|
export declare enum ValidationType {
|
|
57
|
+
CUSTOM = "custom",
|
|
58
|
+
IS_MODEL = "isModel",
|
|
59
|
+
IS_OVERLAY = "isOverlay",
|
|
60
|
+
IS_RESOURCE = "isResource",
|
|
61
|
+
IS_SCHEMA = "isSchema",
|
|
17
62
|
MAX_LENGTH = "maxLength",
|
|
18
63
|
MIN_LENGTH = "minLength",
|
|
19
64
|
REGEX = "regex"
|
|
20
65
|
}
|
|
21
|
-
export type
|
|
22
|
-
[
|
|
66
|
+
export type ValidationTypeOptions = {
|
|
67
|
+
[ValidationType.CUSTOM]: Parameters<typeof ValidationUtility.validateCustom>[1];
|
|
68
|
+
[ValidationType.IS_MODEL]: Parameters<typeof ValidationUtility.validateIsModel>[1];
|
|
69
|
+
[ValidationType.IS_OVERLAY]: Parameters<typeof ValidationUtility.validateIsOverlay>[1];
|
|
70
|
+
[ValidationType.IS_RESOURCE]: Parameters<typeof ValidationUtility.validateIsResource>[1];
|
|
71
|
+
[ValidationType.IS_SCHEMA]: Parameters<typeof ValidationUtility.validateIsSchema>[1];
|
|
72
|
+
[ValidationType.MAX_LENGTH]: Parameters<typeof ValidationUtility.validateMaxLength>[1];
|
|
73
|
+
[ValidationType.MIN_LENGTH]: Parameters<typeof ValidationUtility.validateMinLength>[1];
|
|
74
|
+
[ValidationType.REGEX]: Parameters<typeof ValidationUtility.validateRegex>[1];
|
|
23
75
|
};
|
|
76
|
+
export declare function hasNodeName(node: UnknownNode, nodeName: string): boolean;
|
|
77
|
+
export declare function stub<T>(value: string): T;
|
|
78
|
+
export type ActionInputs = EnhancedModuleSchema<UnknownModule>;
|
|
24
79
|
export type ActionOutputs = {
|
|
25
80
|
[key: string]: UnknownResource;
|
|
26
81
|
};
|
|
82
|
+
export type ClassRequiredProperties<T> = {
|
|
83
|
+
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
84
|
+
}[keyof T];
|
|
85
|
+
export type ClassOptionalProperties<T> = {
|
|
86
|
+
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
87
|
+
}[keyof T];
|
|
88
|
+
export type DiffValueTypePropertyUpdate = {
|
|
89
|
+
key: string;
|
|
90
|
+
value: unknown;
|
|
91
|
+
};
|
|
92
|
+
export type DiffValueTypeTagUpdate = {
|
|
93
|
+
add: {
|
|
94
|
+
[key: string]: string;
|
|
95
|
+
};
|
|
96
|
+
delete: string[];
|
|
97
|
+
update: {
|
|
98
|
+
[key: string]: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export type ObjectKeyValue<T> = {
|
|
102
|
+
[K in keyof T]: {
|
|
103
|
+
key: K;
|
|
104
|
+
value: T[K];
|
|
105
|
+
};
|
|
106
|
+
}[keyof T];
|
|
27
107
|
export type Constructable<T> = new (...args: any[]) => T;
|
|
28
108
|
export type ModelSerializedOutput = {
|
|
29
|
-
anchors: (
|
|
109
|
+
anchors: (AnchorSchema<UnknownAnchor> & {
|
|
30
110
|
className: string;
|
|
31
111
|
})[];
|
|
32
112
|
dependencies: IDependency[];
|
|
@@ -38,24 +118,15 @@ export type ModelSerializedOutput = {
|
|
|
38
118
|
};
|
|
39
119
|
overlays: {
|
|
40
120
|
className: string;
|
|
41
|
-
overlay:
|
|
121
|
+
overlay: OverlaySchema<UnknownOverlay>;
|
|
42
122
|
}[];
|
|
43
123
|
};
|
|
44
|
-
export type ModifyInterface<T, R> = Omit<T, keyof R> & R;
|
|
45
124
|
export type ResourceSerializedOutput = {
|
|
46
125
|
dependencies: IDependency[];
|
|
47
126
|
resources: {
|
|
48
127
|
[p: string]: {
|
|
49
128
|
className: string;
|
|
50
|
-
|
|
51
|
-
resource: IResource;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
sharedResources: {
|
|
55
|
-
[p: string]: {
|
|
56
|
-
className: string;
|
|
57
|
-
context: string;
|
|
58
|
-
resource: IResource;
|
|
129
|
+
resource: BaseResourceSchema;
|
|
59
130
|
};
|
|
60
131
|
};
|
|
61
132
|
};
|
|
@@ -66,8 +137,34 @@ export type TransactionOptions = {
|
|
|
66
137
|
yieldResourceDiffs?: boolean;
|
|
67
138
|
yieldResourceTransaction?: boolean;
|
|
68
139
|
};
|
|
69
|
-
export type
|
|
70
|
-
export type
|
|
71
|
-
export type
|
|
72
|
-
|
|
73
|
-
|
|
140
|
+
export type ModifyInterface<T, R> = Omit<T, keyof R> & R;
|
|
141
|
+
export type AnchorSchema<T> = T extends AAnchor<infer S, any> ? S : never;
|
|
142
|
+
export type EnhancedModuleSchema<T extends UnknownModule> = {
|
|
143
|
+
inputs: {
|
|
144
|
+
[K in keyof ModuleSchemaInputs<T>]: ModuleSchema<T>[K];
|
|
145
|
+
};
|
|
146
|
+
metadata: Awaited<ReturnType<T['registerMetadata']>>;
|
|
147
|
+
models: Record<string, UnknownModel>;
|
|
148
|
+
overlays: Record<string, UnknownOverlay>;
|
|
149
|
+
resources: Record<string, UnknownResource>;
|
|
150
|
+
};
|
|
151
|
+
export type ModelSchema<T> = T extends AModel<infer S, any> ? S : never;
|
|
152
|
+
export type ModuleOutput<M> = M extends AModule<any, infer T> ? T : never;
|
|
153
|
+
export type ModuleSchema<T> = T extends AModule<infer S, any> ? S : never;
|
|
154
|
+
export type ModuleSchemaInputs<T> = {
|
|
155
|
+
[K in ClassRequiredProperties<ModuleSchema<T>>]: ModuleSchema<T>[K];
|
|
156
|
+
} & {
|
|
157
|
+
[K in ClassOptionalProperties<ModuleSchema<T>>]?: ModuleSchema<T>[K];
|
|
158
|
+
};
|
|
159
|
+
export type NodeSchema<T> = T extends ANode<infer S, any> ? S : never;
|
|
160
|
+
export type OverlaySchema<T> = T extends AOverlay<infer S, any> ? S : never;
|
|
161
|
+
export type ResourceSchema<T> = T extends AResource<infer S, any> ? S : never;
|
|
162
|
+
export type IUnknownModel = IModel<unknown, any>;
|
|
163
|
+
export type IUnknownModelAction = IModelAction<any>;
|
|
164
|
+
export type IUnknownResourceAction = IResourceAction<any>;
|
|
165
|
+
export type UnknownAnchor = AAnchor<BaseAnchorSchema, UnknownModel>;
|
|
166
|
+
export type UnknownModel = AModel<unknown, any>;
|
|
167
|
+
export type UnknownModule = AModule<unknown, any>;
|
|
168
|
+
export type UnknownNode = ANode<unknown, unknown>;
|
|
169
|
+
export type UnknownOverlay = AOverlay<BaseOverlaySchema, any>;
|
|
170
|
+
export type UnknownResource = AResource<any, any>;
|
package/dist/app.type.js
CHANGED
|
@@ -1,14 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/* Classes */
|
|
2
|
+
export class MatchingAnchor {
|
|
3
|
+
constructor(actual, schemaTranslator) {
|
|
4
|
+
this.actual = actual;
|
|
5
|
+
this.schemaTranslator = schemaTranslator;
|
|
6
|
+
}
|
|
7
|
+
hasSchemaTranslator() {
|
|
8
|
+
return !!this.schemaTranslator;
|
|
9
|
+
}
|
|
10
|
+
getActual() {
|
|
11
|
+
return this.actual;
|
|
12
|
+
}
|
|
13
|
+
getSchemaInstance() {
|
|
14
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class MatchingModel {
|
|
18
|
+
constructor(actual, schemaTranslator) {
|
|
19
|
+
this.actual = actual;
|
|
20
|
+
this.schemaTranslator = schemaTranslator;
|
|
21
|
+
}
|
|
22
|
+
hasSchemaTranslator() {
|
|
23
|
+
return !!this.schemaTranslator;
|
|
24
|
+
}
|
|
25
|
+
getActual() {
|
|
26
|
+
return this.actual;
|
|
27
|
+
}
|
|
28
|
+
getSchemaInstance() {
|
|
29
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class MatchingResource {
|
|
33
|
+
constructor(actual, schemaTranslator) {
|
|
34
|
+
this.actual = actual;
|
|
35
|
+
this.schemaTranslator = schemaTranslator;
|
|
36
|
+
}
|
|
37
|
+
addChild(...args) {
|
|
38
|
+
const results = this.actual.addChild(...args);
|
|
39
|
+
if (!(args[1].parents[args[1].parents.length - 1] instanceof MatchingResource) &&
|
|
40
|
+
args[1].parents[args[1].parents.length - 1].resourceId === this.getActual().resourceId) {
|
|
41
|
+
args[1].parents.pop();
|
|
42
|
+
args[1].parents.push(this);
|
|
43
|
+
}
|
|
44
|
+
return results;
|
|
45
|
+
}
|
|
46
|
+
hasSchemaTranslator() {
|
|
47
|
+
return !!this.schemaTranslator;
|
|
48
|
+
}
|
|
49
|
+
getActual() {
|
|
50
|
+
return this.actual;
|
|
51
|
+
}
|
|
52
|
+
getSchemaInstance() {
|
|
53
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
54
|
+
}
|
|
55
|
+
getSchemaInstanceInResourceAction() {
|
|
56
|
+
return this.getSchemaInstance();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/* Enumerations */
|
|
60
|
+
export var NodeType;
|
|
61
|
+
(function (NodeType) {
|
|
62
|
+
NodeType["MODEL"] = "model";
|
|
63
|
+
NodeType["OVERLAY"] = "overlay";
|
|
64
|
+
NodeType["RESOURCE"] = "resource";
|
|
65
|
+
})(NodeType || (NodeType = {}));
|
|
8
66
|
export var ValidationType;
|
|
9
67
|
(function (ValidationType) {
|
|
68
|
+
ValidationType["CUSTOM"] = "custom";
|
|
69
|
+
ValidationType["IS_MODEL"] = "isModel";
|
|
70
|
+
ValidationType["IS_OVERLAY"] = "isOverlay";
|
|
71
|
+
ValidationType["IS_RESOURCE"] = "isResource";
|
|
72
|
+
ValidationType["IS_SCHEMA"] = "isSchema";
|
|
10
73
|
ValidationType["MAX_LENGTH"] = "maxLength";
|
|
11
74
|
ValidationType["MIN_LENGTH"] = "minLength";
|
|
12
75
|
ValidationType["REGEX"] = "regex";
|
|
13
76
|
})(ValidationType || (ValidationType = {}));
|
|
77
|
+
/* Functions */
|
|
78
|
+
export function hasNodeName(node, nodeName) {
|
|
79
|
+
return node.constructor.NODE_NAME === nodeName;
|
|
80
|
+
}
|
|
81
|
+
export function stub(value) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
14
84
|
//# sourceMappingURL=app.type.js.map
|
package/dist/app.type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.type.js","sourceRoot":"","sources":["../src/app.type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.type.js","sourceRoot":"","sources":["../src/app.type.ts"],"names":[],"mappings":"AAeA,aAAa;AACb,MAAM,OAAO,cAAc;IACzB,YACmB,MAAuB,EACvB,gBAAoC;QADpC,WAAM,GAAN,MAAM,CAAiB;QACvB,qBAAgB,GAAhB,gBAAgB,CAAoB;IACpD,CAAC;IAEJ,mBAAmB;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,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}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Constructable, UnknownNode } from '../app.type.js';
|
|
2
2
|
/**
|
|
3
3
|
* An `@Action` is a class decorator to be placed on top of a class that represents an action of one of ModelType.
|
|
4
|
-
* - A
|
|
5
|
-
* - A
|
|
6
|
-
* - A
|
|
7
|
-
* - A ModelType.SHARED_RESOURCE action must implement the {@link IResourceAction} interface.
|
|
4
|
+
* - A NodeType.MODEL action must implement the {@link IModelAction} interface.
|
|
5
|
+
* - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
|
|
6
|
+
* - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
|
|
8
7
|
*
|
|
9
8
|
* @example
|
|
10
9
|
* ```ts
|
|
11
|
-
* @Action(
|
|
10
|
+
* @Action(MyModelClass)
|
|
12
11
|
* export class MyModelAction implements IModelAction { ... }
|
|
13
12
|
* ```
|
|
14
13
|
* @group Decorators
|
|
15
|
-
* @param
|
|
14
|
+
* @param forNode The class of node for which this action is being declared.
|
|
16
15
|
* @returns The decorated class.
|
|
17
16
|
* @see Definition of [Actions](/docs/fundamentals/actions).
|
|
18
17
|
*/
|
|
19
|
-
export declare function Action(
|
|
18
|
+
export declare function Action<T extends UnknownNode>(forNode: Constructable<T>): (constructor: any) => void;
|
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RegistrationErrorEvent } from '../events/error.event.js';
|
|
1
|
+
import { Container } from '../functions/container/container.js';
|
|
3
2
|
import { ModelActionHook } from '../functions/hook/model-action.hook.js';
|
|
4
3
|
import { ResourceActionHook } from '../functions/hook/resource-action.hook.js';
|
|
5
|
-
import {
|
|
4
|
+
import { AModel } from '../models/model.abstract.js';
|
|
5
|
+
import { AOverlay } from '../overlays/overlay.abstract.js';
|
|
6
|
+
import { AResource } from '../resources/resource.abstract.js';
|
|
6
7
|
import { TransactionService } from '../services/transaction/transaction.service.js';
|
|
7
|
-
|
|
8
|
+
function isModel(nodeClass) {
|
|
9
|
+
return nodeClass.prototype instanceof AModel;
|
|
10
|
+
}
|
|
11
|
+
function isOverlay(nodeClass) {
|
|
12
|
+
return nodeClass.prototype instanceof AOverlay;
|
|
13
|
+
}
|
|
14
|
+
function isResource(nodeClass) {
|
|
15
|
+
return nodeClass.prototype instanceof AResource;
|
|
16
|
+
}
|
|
8
17
|
/**
|
|
9
18
|
* An `@Action` is a class decorator to be placed on top of a class that represents an action of one of ModelType.
|
|
10
|
-
* - A
|
|
11
|
-
* - A
|
|
12
|
-
* - A
|
|
13
|
-
* - A ModelType.SHARED_RESOURCE action must implement the {@link IResourceAction} interface.
|
|
19
|
+
* - A NodeType.MODEL action must implement the {@link IModelAction} interface.
|
|
20
|
+
* - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
|
|
21
|
+
* - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
|
|
14
22
|
*
|
|
15
23
|
* @example
|
|
16
24
|
* ```ts
|
|
17
|
-
* @Action(
|
|
25
|
+
* @Action(MyModelClass)
|
|
18
26
|
* export class MyModelAction implements IModelAction { ... }
|
|
19
27
|
* ```
|
|
20
28
|
* @group Decorators
|
|
21
|
-
* @param
|
|
29
|
+
* @param forNode The class of node for which this action is being declared.
|
|
22
30
|
* @returns The decorated class.
|
|
23
31
|
* @see Definition of [Actions](/docs/fundamentals/actions).
|
|
24
32
|
*/
|
|
25
|
-
export function Action(
|
|
33
|
+
export function Action(forNode) {
|
|
34
|
+
const container = Container.getInstance();
|
|
26
35
|
return function (constructor) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
ResourceActionHook.getInstance().registrar(resourceAction);
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
default: {
|
|
55
|
-
throw new Error('ModelType not recognized in @Action decorator!');
|
|
56
|
-
}
|
|
36
|
+
const promise = container.get(TransactionService).then(async (transactionService) => {
|
|
37
|
+
if (isModel(forNode) && !isOverlay(forNode)) {
|
|
38
|
+
// Register model action.
|
|
39
|
+
const modelAction = await container.get(constructor.name);
|
|
40
|
+
transactionService.registerModelActions(forNode, [modelAction]);
|
|
41
|
+
// Wrap model action with hooks.
|
|
42
|
+
ModelActionHook.getInstance().registrar(modelAction);
|
|
43
|
+
}
|
|
44
|
+
else if (isOverlay(forNode)) {
|
|
45
|
+
// Register overlay action.
|
|
46
|
+
const modelAction = await container.get(constructor.name);
|
|
47
|
+
transactionService.registerOverlayActions(forNode, [modelAction]);
|
|
48
|
+
// Wrap overlay action with hooks.
|
|
49
|
+
ModelActionHook.getInstance().registrar(modelAction);
|
|
50
|
+
}
|
|
51
|
+
else if (isResource(forNode)) {
|
|
52
|
+
// Register resource action.
|
|
53
|
+
const resourceAction = await container.get(constructor.name);
|
|
54
|
+
transactionService.registerResourceActions(forNode, [resourceAction]);
|
|
55
|
+
// Wrap resource action with hooks.
|
|
56
|
+
ResourceActionHook.getInstance().registrar(resourceAction);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
throw new Error(`Class "${forNode.name}" is not recognized in @Action decorator!`);
|
|
57
60
|
}
|
|
58
|
-
})
|
|
59
|
-
.catch((error) => {
|
|
60
|
-
EventService.getInstance().emit(new RegistrationErrorEvent(error));
|
|
61
61
|
});
|
|
62
|
+
container.registerStartupUnhandledPromise(promise);
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
//# sourceMappingURL=action.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.decorator.js","sourceRoot":"","sources":["../../src/decorators/action.decorator.ts"],"names":[],"mappings":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,CAAC,CAAC,CAAC;gBAEhE,gCAAgC;gBAChC,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;iBAAM,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9B,2BAA2B;gBAC3B,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,GAAG,CAAsB,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC/E,kBAAkB,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;gBAElE,kCAAkC;gBAClC,eAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;iBAAM,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/B,4BAA4B;gBAC5B,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,GAAG,CAAyB,WAAW,CAAC,IAAI,CAAC,CAAC;gBACrF,kBAAkB,CAAC,uBAAuB,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;gBAEtE,mCAAmC;gBACnC,kBAAkB,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,UAAU,OAAO,CAAC,IAAI,2CAA2C,CAAC,CAAC;YACrF,CAAC;QACH,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
|
-
* @Anchor()
|
|
7
|
+
* @Anchor('my-package')
|
|
8
8
|
* export class MyAnchor extends AAnchor { ... }
|
|
9
9
|
* ```
|
|
10
10
|
* @group Decorators
|
|
11
11
|
* @returns The decorated class.
|
|
12
12
|
* @see Definition of [Anchors](/docs/fundamentals/overlay-and-anchor).
|
|
13
13
|
*/
|
|
14
|
-
export declare function Anchor(): (constructor: any) => void;
|
|
14
|
+
export declare function Anchor(packageName: string): (constructor: any) => void;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Container } from '../functions/container/container.js';
|
|
2
|
+
import { AAnchor } from '../overlays/anchor.abstract.js';
|
|
3
3
|
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ValidationUtility } from '../utilities/validation/validation.utility.js';
|
|
5
5
|
/**
|
|
6
6
|
* An `@Anchor` is a class decorator to be placed on top of a class that represents an anchor.
|
|
7
7
|
* - An anchor must extend the {@link AAnchor} class.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* @Anchor()
|
|
11
|
+
* @Anchor('my-package')
|
|
12
12
|
* export class MyAnchor extends AAnchor { ... }
|
|
13
13
|
* ```
|
|
14
14
|
* @group Decorators
|
|
15
15
|
* @returns The decorated class.
|
|
16
16
|
* @see Definition of [Anchors](/docs/fundamentals/overlay-and-anchor).
|
|
17
17
|
*/
|
|
18
|
-
export function Anchor() {
|
|
18
|
+
export function Anchor(packageName) {
|
|
19
|
+
const container = Container.getInstance();
|
|
19
20
|
return function (constructor) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (!ValidationUtility.validateRegex(packageName, /^[@A-Za-z][\w-]+[A-Za-z]$/)) {
|
|
22
|
+
throw new Error(`Invalid package name: ${packageName}`);
|
|
23
|
+
}
|
|
24
|
+
if (!(constructor.prototype instanceof AAnchor)) {
|
|
25
|
+
throw new Error(`Class "${constructor.name}" must extend the AAnchor class!`);
|
|
26
|
+
}
|
|
27
|
+
constructor.NODE_PACKAGE = packageName;
|
|
28
|
+
const promise = container.get(ModelSerializationService).then((modelSerializationService) => {
|
|
29
|
+
modelSerializationService.registerClass(`${packageName}/${constructor.name}`, constructor);
|
|
26
30
|
});
|
|
31
|
+
container.registerStartupUnhandledPromise(promise);
|
|
27
32
|
};
|
|
28
33
|
}
|
|
29
34
|
//# sourceMappingURL=anchor.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.decorator.js","sourceRoot":"","sources":["../../src/decorators/anchor.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"anchor.decorator.js","sourceRoot":"","sources":["../../src/decorators/anchor.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,MAAM,CAAC,WAAmB;IACxC,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,WAAgB;QAC/B,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,CAAC;YAC/E,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,YAAY,OAAO,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,IAAI,kCAAkC,CAAC,CAAC;QAChF,CAAC;QAED,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC;QAEvC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,yBAAyB,EAAE,EAAE;YAC1F,yBAAyB,CAAC,aAAa,CAAC,GAAG,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -14,13 +14,13 @@ import { CommitHook } from '../functions/hook/commit.hook.js';
|
|
|
14
14
|
* @see Definition of [Hooks](/docs/fundamentals/modules#hooks).
|
|
15
15
|
*/
|
|
16
16
|
export function EnableHook(hook) {
|
|
17
|
-
return function (
|
|
17
|
+
return function (_target, _propertyKey, descriptor) {
|
|
18
18
|
switch (hook) {
|
|
19
19
|
case 'CommitHook':
|
|
20
20
|
CommitHook.getInstance().registrar(descriptor);
|
|
21
21
|
break;
|
|
22
22
|
default:
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error(`Invalid hook "${hook}"!`);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable-hook.decorator.js","sourceRoot":"","sources":["../../src/decorators/enable-hook.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAI9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"enable-hook.decorator.js","sourceRoot":"","sources":["../../src/decorators/enable-hook.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAI9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QACjF,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,YAAY;gBACf,UAAU,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBAC/C,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Constructable } from '../app.type.js';
|
|
2
|
-
import type { Event } from '../events/
|
|
2
|
+
import type { Event } from '../events/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* An `@EventSource` is a method decorator to enable automatic event emission.
|
|
5
5
|
* The `registrar()` method of the Event class is used to decorate the method to auto-emit events.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Container } from '../functions/container/container.js';
|
|
1
2
|
import { EventService } from '../services/event/event.service.js';
|
|
2
3
|
/**
|
|
3
4
|
* An `@EventSource` is a method decorator to enable automatic event emission.
|
|
@@ -15,8 +16,12 @@ import { EventService } from '../services/event/event.service.js';
|
|
|
15
16
|
* @returns The decorated method.
|
|
16
17
|
*/
|
|
17
18
|
export function EventSource(ofType) {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const container = Container.getInstance();
|
|
20
|
+
return function (_target, _propertyKey, descriptor) {
|
|
21
|
+
const promise = container.get(EventService).then((eventService) => {
|
|
22
|
+
ofType.registrar(eventService, descriptor);
|
|
23
|
+
});
|
|
24
|
+
container.registerStartupUnhandledPromise(promise);
|
|
20
25
|
};
|
|
21
26
|
}
|
|
22
27
|
//# sourceMappingURL=event-source.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-source.decorator.js","sourceRoot":"","sources":["../../src/decorators/event-source.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CACzB,MAAqC;IAErC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"event-source.decorator.js","sourceRoot":"","sources":["../../src/decorators/event-source.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CACzB,MAAqC;IAErC,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QACjF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YAC/D,MAAc,CAAC,SAAS,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -12,7 +12,7 @@ import type { Constructable } from '../app.type.js';
|
|
|
12
12
|
* // Factory definition.
|
|
13
13
|
* @Factory<MyService>(MyService, { metadata: { key: 'value' } })
|
|
14
14
|
* export class MyServiceFactory {
|
|
15
|
-
* static async create(arg1, arg2, ...): Promise<MyService> { ... }
|
|
15
|
+
* static async create(arg1, arg2, ...): Promise<MyService> { ... }
|
|
16
16
|
* }
|
|
17
17
|
*
|
|
18
18
|
* // Get instance using default factory.
|
|
@@ -27,6 +27,37 @@ import type { Constructable } from '../app.type.js';
|
|
|
27
27
|
* @group Decorators
|
|
28
28
|
* @param type The type of class that the factory creates.
|
|
29
29
|
* @param options Allows registering multiple factories for the same class that differ by metadata.
|
|
30
|
+
* @remarks
|
|
31
|
+
* If the factory is dependent on other factories, it should not block creation of its instance.
|
|
32
|
+
* ```ts
|
|
33
|
+
* // Correct, since creation of instance is not blocked.
|
|
34
|
+
* // In this case, when multiple code paths are trying to get Container.get(MyService) at the same time,
|
|
35
|
+
* // each of them will `await` for OtherService to get resolved,
|
|
36
|
+
* // and the first to resolve will be able to create the instance, that the rest will re-use.
|
|
37
|
+
* export class MyServiceFactory {
|
|
38
|
+
* private static instance: MyService;
|
|
39
|
+
* static async create(): Promise<MyService> {
|
|
40
|
+
* const otherInstance = await Container.get(OtherService);
|
|
41
|
+
* if (!this.instance) {
|
|
42
|
+
* this.instance = new MyService(otherInstance);
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Wrong, since creation of instance is blocked.
|
|
49
|
+
* // In this case, when multiple code paths are trying to get Container.get(MyService) at the same time,
|
|
50
|
+
* // each of them will get a new instance since during `await` there is race condition.
|
|
51
|
+
* export class MyServiceFactory {
|
|
52
|
+
* private static instance: MyService;
|
|
53
|
+
* static async create(): Promise<MyService> {
|
|
54
|
+
* if (!this.instance) {
|
|
55
|
+
* const otherInstance = await Container.get(OtherService);
|
|
56
|
+
* this.instance = new MyService(otherInstance);
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
30
61
|
* @returns The decorated class.
|
|
31
62
|
*/
|
|
32
63
|
export declare function Factory<T>(type: Constructable<T> | string, options?: {
|