@quadnix/octo 0.0.22 → 0.0.24
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 +236 -27
- package/dist/app.type.js +92 -1
- package/dist/app.type.js.map +1 -1
- package/dist/decorators/action.decorator.d.ts +4 -5
- package/dist/decorators/action.decorator.js +42 -41
- 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.d.ts +5 -0
- package/dist/decorators/enable-hook.decorator.js +7 -2
- package/dist/decorators/enable-hook.decorator.js.map +1 -1
- package/dist/decorators/event-source.decorator.d.ts +5 -1
- package/dist/decorators/event-source.decorator.js +5 -1
- package/dist/decorators/event-source.decorator.js.map +1 -1
- package/dist/decorators/factory.decorator.d.ts +14 -2
- package/dist/decorators/factory.decorator.js +12 -3
- package/dist/decorators/factory.decorator.js.map +1 -1
- package/dist/decorators/model.decorator.d.ts +19 -5
- package/dist/decorators/model.decorator.js +40 -14
- package/dist/decorators/model.decorator.js.map +1 -1
- package/dist/decorators/module.decorator.d.ts +4 -75
- 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 +1 -1
- package/dist/decorators/on-event.decorator.js.map +1 -1
- package/dist/decorators/overlay.decorator.d.ts +16 -6
- package/dist/decorators/overlay.decorator.js +36 -15
- package/dist/decorators/overlay.decorator.js.map +1 -1
- package/dist/decorators/resource.decorator.d.ts +17 -6
- package/dist/decorators/resource.decorator.js +37 -15
- package/dist/decorators/resource.decorator.js.map +1 -1
- package/dist/decorators/validate.decorator.d.ts +12 -4
- package/dist/decorators/validate.decorator.js +24 -2
- package/dist/decorators/validate.decorator.js.map +1 -1
- package/dist/errors/container.error.d.ts +20 -0
- package/dist/errors/container.error.js +29 -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 +49 -0
- package/dist/errors/input.error.js +59 -0
- package/dist/errors/input.error.js.map +1 -0
- package/dist/errors/module.error.d.ts +7 -0
- package/dist/errors/module.error.js +11 -0
- package/dist/errors/module.error.js.map +1 -0
- package/dist/errors/node.error.d.ts +63 -0
- package/dist/errors/node.error.js +87 -0
- package/dist/errors/node.error.js.map +1 -0
- package/dist/errors/schema.error.d.ts +7 -0
- package/dist/errors/schema.error.js +11 -0
- package/dist/errors/schema.error.js.map +1 -0
- package/dist/errors/transaction.error.d.ts +56 -0
- package/dist/errors/transaction.error.js +79 -0
- package/dist/errors/transaction.error.js.map +1 -0
- package/dist/events/action.event.d.ts +14 -0
- package/dist/events/action.event.js +12 -0
- package/dist/events/action.event.js.map +1 -0
- package/dist/events/event.model.d.ts +8 -12
- package/dist/events/event.model.js +7 -11
- package/dist/events/event.model.js.map +1 -1
- package/dist/events/hook/commit.hook.event.d.ts +28 -0
- package/dist/events/hook/commit.hook.event.js +29 -0
- package/dist/events/hook/commit.hook.event.js.map +1 -0
- package/dist/events/hook/hook.event.d.ts +10 -0
- package/dist/events/hook/hook.event.js +11 -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 +28 -0
- package/dist/events/hook/model.hook.event.js +29 -0
- package/dist/events/hook/model.hook.event.js.map +1 -0
- package/dist/events/hook/resource.hook.event.d.ts +28 -0
- package/dist/events/hook/resource.hook.event.js +29 -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 +3 -7
- package/dist/events/module.event.js +2 -6
- package/dist/events/module.event.js.map +1 -1
- package/dist/events/registration.event.d.ts +22 -57
- package/dist/events/registration.event.js +29 -70
- package/dist/events/registration.event.js.map +1 -1
- package/dist/events/serialization.event.d.ts +34 -41
- package/dist/events/serialization.event.js +59 -37
- package/dist/events/serialization.event.js.map +1 -1
- package/dist/events/transaction.event.d.ts +72 -29
- package/dist/events/transaction.event.js +63 -27
- package/dist/events/transaction.event.js.map +1 -1
- package/dist/functions/container/container.d.ts +56 -9
- package/dist/functions/container/container.js +108 -19
- package/dist/functions/container/container.js.map +1 -1
- package/dist/functions/container/test-container.d.ts +11 -13
- package/dist/functions/container/test-container.js +35 -38
- package/dist/functions/container/test-container.js.map +1 -1
- package/dist/functions/dependency/dependency.d.ts +9 -0
- package/dist/functions/dependency/dependency.js +10 -3
- package/dist/functions/dependency/dependency.js.map +1 -1
- package/dist/functions/diff/diff-metadata.d.ts +6 -5
- package/dist/functions/diff/diff-metadata.js +6 -2
- package/dist/functions/diff/diff-metadata.js.map +1 -1
- package/dist/functions/diff/diff.d.ts +16 -5
- package/dist/functions/diff/diff.js +11 -4
- package/dist/functions/diff/diff.js.map +1 -1
- package/dist/functions/diff/diff.utility.d.ts +5 -2
- package/dist/functions/diff/diff.utility.js +28 -4
- package/dist/functions/diff/diff.utility.js.map +1 -1
- package/dist/functions/hook/commit.hook.d.ts +17 -3
- package/dist/functions/hook/commit.hook.js +19 -16
- package/dist/functions/hook/commit.hook.js.map +1 -1
- package/dist/functions/hook/hook.interface.d.ts +10 -6
- package/dist/functions/hook/model-action.hook.d.ts +20 -5
- package/dist/functions/hook/model-action.hook.js +23 -39
- package/dist/functions/hook/model-action.hook.js.map +1 -1
- package/dist/functions/hook/resource-action.hook.d.ts +20 -5
- package/dist/functions/hook/resource-action.hook.js +21 -18
- package/dist/functions/hook/resource-action.hook.js.map +1 -1
- package/dist/functions/node/node-action.abstract.d.ts +10 -0
- package/dist/functions/node/node-action.abstract.js +23 -0
- package/dist/functions/node/node-action.abstract.js.map +1 -0
- package/dist/functions/node/node.abstract.d.ts +20 -9
- package/dist/functions/node/node.abstract.js +101 -32
- package/dist/functions/node/node.abstract.js.map +1 -1
- package/dist/functions/node/node.interface.d.ts +22 -18
- package/dist/functions/schema/schema.d.ts +21 -0
- package/dist/functions/schema/schema.js +55 -0
- package/dist/functions/schema/schema.js.map +1 -0
- package/dist/index.d.ts +31 -32
- package/dist/index.js +29 -12
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +32 -15
- package/dist/main.js +65 -50
- package/dist/main.js.map +1 -1
- package/dist/models/account/account.model.d.ts +26 -0
- package/dist/models/account/account.model.js +71 -0
- package/dist/models/account/account.model.js.map +1 -0
- package/dist/models/account/account.schema.d.ts +13 -0
- package/dist/models/account/account.schema.js +18 -0
- package/dist/models/account/account.schema.js.map +1 -0
- package/dist/models/app/app.model.d.ts +9 -14
- package/dist/models/app/app.model.js +27 -27
- package/dist/models/app/app.model.js.map +1 -1
- package/dist/models/app/app.schema.d.ts +6 -0
- package/dist/models/app/app.schema.js +24 -0
- package/dist/models/app/app.schema.js.map +1 -0
- package/dist/models/deployment/deployment.model.d.ts +9 -12
- package/dist/models/deployment/deployment.model.js +11 -11
- package/dist/models/deployment/deployment.model.js.map +1 -1
- package/dist/models/deployment/deployment.schema.d.ts +10 -0
- package/dist/models/deployment/deployment.schema.js +28 -0
- package/dist/models/deployment/deployment.schema.js.map +1 -0
- package/dist/models/environment/environment.model.d.ts +8 -14
- package/dist/models/environment/environment.model.js +10 -22
- package/dist/models/environment/environment.model.js.map +1 -1
- package/dist/models/environment/environment.schema.d.ts +16 -0
- package/dist/models/environment/environment.schema.js +41 -0
- package/dist/models/environment/environment.schema.js.map +1 -0
- package/dist/models/execution/execution.model.d.ts +9 -13
- package/dist/models/execution/execution.model.js +18 -25
- package/dist/models/execution/execution.model.js.map +1 -1
- package/dist/models/execution/execution.schema.d.ts +17 -0
- package/dist/models/execution/execution.schema.js +37 -0
- package/dist/models/execution/execution.schema.js.map +1 -0
- package/dist/models/filesystem/filesystem.model.d.ts +13 -0
- package/dist/models/filesystem/filesystem.model.js +46 -0
- package/dist/models/filesystem/filesystem.model.js.map +1 -0
- package/dist/models/filesystem/filesystem.schema.d.ts +6 -0
- package/dist/models/filesystem/filesystem.schema.js +24 -0
- package/dist/models/filesystem/filesystem.schema.js.map +1 -0
- package/dist/models/image/image.model.d.ts +10 -40
- package/dist/models/image/image.model.js +17 -27
- package/dist/models/image/image.model.js.map +1 -1
- package/dist/models/image/image.schema.d.ts +12 -0
- package/dist/models/image/image.schema.js +34 -0
- package/dist/models/image/image.schema.js.map +1 -0
- package/dist/models/model-action.interface.d.ts +5 -13
- package/dist/models/model.abstract.d.ts +28 -13
- package/dist/models/model.abstract.js +179 -13
- package/dist/models/model.abstract.js.map +1 -1
- package/dist/models/model.interface.d.ts +17 -6
- package/dist/models/pipeline/pipeline.model.d.ts +8 -7
- package/dist/models/pipeline/pipeline.model.js +10 -10
- package/dist/models/pipeline/pipeline.model.js.map +1 -1
- package/dist/models/pipeline/pipeline.schema.d.ts +7 -0
- package/dist/models/pipeline/pipeline.schema.js +25 -0
- package/dist/models/pipeline/pipeline.schema.js.map +1 -0
- package/dist/models/region/region.model.d.ts +11 -8
- package/dist/models/region/region.model.js +25 -12
- package/dist/models/region/region.model.js.map +1 -1
- package/dist/models/region/region.schema.d.ts +6 -0
- package/dist/models/region/region.schema.js +24 -0
- package/dist/models/region/region.schema.js.map +1 -0
- package/dist/models/server/server.model.d.ts +8 -10
- package/dist/models/server/server.model.js +13 -11
- package/dist/models/server/server.model.js.map +1 -1
- package/dist/models/server/server.schema.d.ts +9 -0
- package/dist/models/server/server.schema.js +27 -0
- package/dist/models/server/server.schema.js.map +1 -0
- package/dist/models/service/service.model.d.ts +7 -9
- package/dist/models/service/service.model.js +15 -13
- package/dist/models/service/service.model.js.map +1 -1
- package/dist/models/service/service.schema.d.ts +9 -0
- package/dist/models/service/service.schema.js +27 -0
- package/dist/models/service/service.schema.js.map +1 -0
- package/dist/models/subnet/subnet.model.d.ts +11 -33
- package/dist/models/subnet/subnet.model.js +14 -34
- package/dist/models/subnet/subnet.model.js.map +1 -1
- package/dist/models/subnet/subnet.schema.d.ts +38 -0
- package/dist/models/subnet/subnet.schema.js +53 -0
- package/dist/models/subnet/subnet.schema.js.map +1 -0
- package/dist/modules/module.abstract.d.ts +24 -0
- package/dist/modules/module.abstract.js +17 -0
- package/dist/modules/module.abstract.js.map +1 -0
- package/dist/modules/module.container.d.ts +38 -18
- package/dist/modules/module.container.js +140 -81
- package/dist/modules/module.container.js.map +1 -1
- package/dist/modules/module.interface.d.ts +18 -2
- package/dist/modules/test-module.container.d.ts +39 -15
- package/dist/modules/test-module.container.js +262 -26
- package/dist/modules/test-module.container.js.map +1 -1
- package/dist/overlays/anchor.abstract.d.ts +16 -8
- package/dist/overlays/anchor.abstract.js +4 -1
- package/dist/overlays/anchor.abstract.js.map +1 -1
- package/dist/overlays/anchor.interface.d.ts +8 -8
- package/dist/overlays/anchor.schema.d.ts +14 -0
- package/dist/overlays/anchor.schema.js +12 -0
- package/dist/overlays/anchor.schema.js.map +1 -0
- package/dist/overlays/overlay-data.repository.d.ts +9 -4
- package/dist/overlays/overlay-data.repository.js +20 -10
- package/dist/overlays/overlay-data.repository.js.map +1 -1
- package/dist/overlays/overlay.abstract.d.ts +15 -13
- package/dist/overlays/overlay.abstract.js +22 -8
- package/dist/overlays/overlay.abstract.js.map +1 -1
- package/dist/overlays/overlay.interface.d.ts +6 -7
- package/dist/overlays/overlay.schema.d.ts +11 -0
- package/dist/overlays/overlay.schema.js +12 -0
- package/dist/overlays/overlay.schema.js.map +1 -0
- package/dist/resources/resource-action.interface.d.ts +7 -3
- package/dist/resources/resource-data.repository.d.ts +8 -3
- package/dist/resources/resource-data.repository.js +64 -82
- package/dist/resources/resource-data.repository.js.map +1 -1
- package/dist/resources/resource.abstract.d.ts +53 -27
- package/dist/resources/resource.abstract.js +233 -57
- package/dist/resources/resource.abstract.js.map +1 -1
- package/dist/resources/resource.interface.d.ts +45 -8
- package/dist/resources/resource.schema.d.ts +17 -0
- package/dist/resources/resource.schema.js +14 -0
- package/dist/resources/resource.schema.js.map +1 -0
- package/dist/services/capture/capture.service.d.ts +12 -6
- package/dist/services/capture/capture.service.js +14 -5
- package/dist/services/capture/capture.service.js.map +1 -1
- package/dist/services/event/event.service.d.ts +8 -2
- package/dist/services/event/event.service.js +9 -2
- package/dist/services/event/event.service.js.map +1 -1
- package/dist/services/input/input.service.d.ts +68 -6
- package/dist/services/input/input.service.js +296 -14
- package/dist/services/input/input.service.js.map +1 -1
- package/dist/services/schema-translation/schema-translation.service.d.ts +19 -0
- package/dist/services/schema-translation/schema-translation.service.js +48 -0
- package/dist/services/schema-translation/schema-translation.service.js.map +1 -0
- package/dist/services/serialization/model/model-serialization.service.d.ts +7 -4
- package/dist/services/serialization/model/model-serialization.service.js +65 -33
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.d.ts +7 -1
- package/dist/services/serialization/resource/resource-serialization.service.js +64 -80
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/state-management/local.state-provider.d.ts +3 -1
- package/dist/services/state-management/local.state-provider.js +8 -7
- package/dist/services/state-management/local.state-provider.js.map +1 -1
- package/dist/services/state-management/state-management.service.d.ts +8 -3
- package/dist/services/state-management/state-management.service.js +25 -8
- package/dist/services/state-management/state-management.service.js.map +1 -1
- package/dist/services/state-management/state-provider.interface.d.ts +3 -1
- package/dist/services/state-management/test.state-provider.d.ts +3 -1
- package/dist/services/state-management/test.state-provider.js +5 -1
- package/dist/services/state-management/test.state-provider.js.map +1 -1
- package/dist/services/transaction/transaction.service.d.ts +22 -11
- package/dist/services/transaction/transaction.service.js +215 -66
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/dist/services/validation/validation.service.d.ts +8 -3
- package/dist/services/validation/validation.service.js +33 -12
- package/dist/services/validation/validation.service.js.map +1 -1
- package/dist/utilities/array/array.utility.d.ts +3 -0
- package/dist/utilities/array/array.utility.js +3 -0
- package/dist/utilities/array/array.utility.js.map +1 -1
- package/dist/utilities/cidr/cidr.utility.d.ts +3 -0
- package/dist/utilities/cidr/cidr.utility.js +3 -0
- package/dist/utilities/cidr/cidr.utility.js.map +1 -1
- package/dist/utilities/node/node.utility.d.ts +7 -0
- package/dist/utilities/node/node.utility.js +25 -0
- package/dist/utilities/node/node.utility.js.map +1 -0
- package/dist/utilities/object/object.utility.d.ts +6 -0
- package/dist/utilities/object/object.utility.js +36 -0
- package/dist/utilities/object/object.utility.js.map +1 -1
- package/dist/utilities/test-helpers/test-classes.d.ts +84 -0
- package/dist/utilities/test-helpers/test-classes.js +103 -0
- package/dist/utilities/test-helpers/test-classes.js.map +1 -0
- package/dist/utilities/test-helpers/test-models.d.ts +47 -0
- package/dist/utilities/test-helpers/test-models.js +230 -0
- package/dist/utilities/test-helpers/test-models.js.map +1 -0
- package/dist/utilities/test-helpers/test-overlays.d.ts +13 -0
- package/dist/utilities/test-helpers/test-overlays.js +56 -0
- package/dist/utilities/test-helpers/test-overlays.js.map +1 -0
- package/dist/utilities/test-helpers/test-resources.d.ts +31 -0
- package/dist/utilities/test-helpers/test-resources.js +171 -0
- package/dist/utilities/test-helpers/test-resources.js.map +1 -0
- package/dist/utilities/validation/validation.utility.d.ts +34 -3
- package/dist/utilities/validation/validation.utility.js +124 -2
- package/dist/utilities/validation/validation.utility.js.map +1 -1
- package/package.json +7 -7
- 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 -17
- package/dist/overlays/overlay.service.js +0 -41
- 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,34 +1,164 @@
|
|
|
1
1
|
import type { IDependency } from './functions/dependency/dependency.js';
|
|
2
2
|
import type { ANode } from './functions/node/node.abstract.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { AOverlay } from './overlays/overlay.abstract.js';
|
|
3
|
+
import type { IModelAction } from './models/model-action.interface.js';
|
|
5
4
|
import type { AModel } from './models/model.abstract.js';
|
|
6
|
-
import type { IModel } from './models/model.interface.js';
|
|
7
|
-
import type {
|
|
5
|
+
import type { IModel, IModelReference } from './models/model.interface.js';
|
|
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';
|
|
8
12
|
import type { AResource } from './resources/resource.abstract.js';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
13
|
+
import type { BaseResourceSchema } from './resources/resource.schema.js';
|
|
14
|
+
import type { ValidationUtility } from './utilities/validation/validation.utility.js';
|
|
15
|
+
/**
|
|
16
|
+
* @group Types
|
|
17
|
+
*/
|
|
18
|
+
export declare class MatchingAnchor<S extends BaseAnchorSchema> {
|
|
19
|
+
private readonly actual;
|
|
20
|
+
private readonly schemaTranslator?;
|
|
21
|
+
constructor(actual: AAnchor<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
22
|
+
hasSchemaTranslator(): boolean;
|
|
23
|
+
getActual(): AAnchor<Omit<S, 'properties'> & {
|
|
24
|
+
properties: Record<never, never>;
|
|
25
|
+
}, any>;
|
|
26
|
+
getSchemaInstance(): S;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @group Types
|
|
30
|
+
*/
|
|
31
|
+
export declare class MatchingModel<S extends object> {
|
|
32
|
+
private readonly actual;
|
|
33
|
+
private readonly schemaTranslator?;
|
|
34
|
+
constructor(actual: AModel<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
35
|
+
hasSchemaTranslator(): boolean;
|
|
36
|
+
getActual(): AModel<Record<never, never>, any>;
|
|
37
|
+
getSchemaInstance(): S;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @group Types
|
|
41
|
+
*/
|
|
42
|
+
export declare class MatchingResource<S extends BaseResourceSchema> {
|
|
43
|
+
private readonly actual;
|
|
44
|
+
readonly schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined;
|
|
45
|
+
constructor(actual: AResource<S, any>, schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined);
|
|
46
|
+
addChild(...args: Parameters<AResource<BaseResourceSchema, any>['addChild']>): ReturnType<AResource<BaseResourceSchema, any>['addChild']>;
|
|
47
|
+
hasSchemaTranslator(): boolean;
|
|
48
|
+
getActual(): AResource<Omit<S, 'properties' | 'response' | 'tags'> & {
|
|
49
|
+
properties: Record<never, never>;
|
|
50
|
+
} & {
|
|
51
|
+
response: Record<never, never>;
|
|
52
|
+
} & {
|
|
53
|
+
tags: Record<never, never>;
|
|
54
|
+
}, any>;
|
|
55
|
+
getSchemaInstance(): S;
|
|
56
|
+
getSchemaInstanceInResourceAction(): Omit<S, 'response'> & {
|
|
57
|
+
response: Required<S['response']>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
11
63
|
export declare enum NodeType {
|
|
12
64
|
MODEL = "model",
|
|
13
65
|
OVERLAY = "overlay",
|
|
14
|
-
RESOURCE = "resource"
|
|
15
|
-
SHARED_RESOURCE = "shared-resource"
|
|
66
|
+
RESOURCE = "resource"
|
|
16
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
17
71
|
export declare enum ValidationType {
|
|
72
|
+
CUSTOM = "custom",
|
|
73
|
+
IS_MODEL = "isModel",
|
|
74
|
+
IS_OVERLAY = "isOverlay",
|
|
75
|
+
IS_RESOURCE = "isResource",
|
|
76
|
+
IS_SCHEMA = "isSchema",
|
|
18
77
|
MAX_LENGTH = "maxLength",
|
|
19
78
|
MIN_LENGTH = "minLength",
|
|
20
79
|
REGEX = "regex"
|
|
21
80
|
}
|
|
22
|
-
|
|
23
|
-
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export type ValidationTypeOptions = {
|
|
85
|
+
[ValidationType.CUSTOM]: Parameters<typeof ValidationUtility.validateCustom>[1];
|
|
86
|
+
[ValidationType.IS_MODEL]: Parameters<typeof ValidationUtility.validateIsModel>[1];
|
|
87
|
+
[ValidationType.IS_OVERLAY]: Parameters<typeof ValidationUtility.validateIsOverlay>[1];
|
|
88
|
+
[ValidationType.IS_RESOURCE]: Parameters<typeof ValidationUtility.validateIsResource>[1];
|
|
89
|
+
[ValidationType.IS_SCHEMA]: Parameters<typeof ValidationUtility.validateIsSchema>[1];
|
|
90
|
+
[ValidationType.MAX_LENGTH]: Parameters<typeof ValidationUtility.validateMaxLength>[1];
|
|
91
|
+
[ValidationType.MIN_LENGTH]: Parameters<typeof ValidationUtility.validateMinLength>[1];
|
|
92
|
+
[ValidationType.REGEX]: Parameters<typeof ValidationUtility.validateRegex>[1];
|
|
24
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* @group Types
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasNodeName(node: UnknownNode, nodeName: string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @group Types
|
|
100
|
+
*/
|
|
101
|
+
export declare function stub<T>(value: string): T;
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
export type ActionInputs = EnhancedModuleSchema<UnknownModule>;
|
|
106
|
+
/**
|
|
107
|
+
* @group Types
|
|
108
|
+
*/
|
|
25
109
|
export type ActionOutputs = {
|
|
26
110
|
[key: string]: UnknownResource;
|
|
27
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
export type ClassRequiredProperties<T> = {
|
|
116
|
+
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
117
|
+
}[keyof T];
|
|
118
|
+
export type ClassOptionalProperties<T> = {
|
|
119
|
+
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
120
|
+
}[keyof T];
|
|
121
|
+
/**
|
|
122
|
+
* @group Types
|
|
123
|
+
*/
|
|
124
|
+
export type DiffValueTypePropertyUpdate = {
|
|
125
|
+
key: string;
|
|
126
|
+
value: unknown;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* @group Types
|
|
130
|
+
*/
|
|
131
|
+
export type DiffValueTypeTagUpdate = {
|
|
132
|
+
add: {
|
|
133
|
+
[key: string]: string;
|
|
134
|
+
};
|
|
135
|
+
delete: string[];
|
|
136
|
+
update: {
|
|
137
|
+
[key: string]: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
export type ObjectKeyValue<T> = {
|
|
144
|
+
[K in keyof T]: {
|
|
145
|
+
key: K;
|
|
146
|
+
value: T[K];
|
|
147
|
+
};
|
|
148
|
+
}[keyof T];
|
|
149
|
+
/**
|
|
150
|
+
* @group Types
|
|
151
|
+
*/
|
|
28
152
|
export type Constructable<T> = new (...args: any[]) => T;
|
|
153
|
+
/**
|
|
154
|
+
* @group Types
|
|
155
|
+
*/
|
|
29
156
|
export type ModelSerializedOutput = {
|
|
30
|
-
anchors: (
|
|
157
|
+
anchors: (AnchorSchema<UnknownAnchor> & {
|
|
31
158
|
className: string;
|
|
159
|
+
location: IModelReference & {
|
|
160
|
+
type: NodeType;
|
|
161
|
+
};
|
|
32
162
|
})[];
|
|
33
163
|
dependencies: IDependency[];
|
|
34
164
|
models: {
|
|
@@ -39,27 +169,24 @@ export type ModelSerializedOutput = {
|
|
|
39
169
|
};
|
|
40
170
|
overlays: {
|
|
41
171
|
className: string;
|
|
42
|
-
overlay:
|
|
172
|
+
overlay: OverlaySchema<UnknownOverlay>;
|
|
43
173
|
}[];
|
|
44
174
|
};
|
|
45
|
-
|
|
175
|
+
/**
|
|
176
|
+
* @group Types
|
|
177
|
+
*/
|
|
46
178
|
export type ResourceSerializedOutput = {
|
|
47
179
|
dependencies: IDependency[];
|
|
48
180
|
resources: {
|
|
49
181
|
[p: string]: {
|
|
50
182
|
className: string;
|
|
51
|
-
|
|
52
|
-
resource: IResource;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
sharedResources: {
|
|
56
|
-
[p: string]: {
|
|
57
|
-
className: string;
|
|
58
|
-
context: string;
|
|
59
|
-
resource: IResource;
|
|
183
|
+
resource: BaseResourceSchema;
|
|
60
184
|
};
|
|
61
185
|
};
|
|
62
186
|
};
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
63
190
|
export type TransactionOptions = {
|
|
64
191
|
enableResourceCapture?: boolean;
|
|
65
192
|
yieldModelDiffs?: boolean;
|
|
@@ -67,9 +194,91 @@ export type TransactionOptions = {
|
|
|
67
194
|
yieldResourceDiffs?: boolean;
|
|
68
195
|
yieldResourceTransaction?: boolean;
|
|
69
196
|
};
|
|
70
|
-
|
|
71
|
-
|
|
197
|
+
/**
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
200
|
+
export type ModifyInterface<T, R> = Omit<T, keyof R> & R;
|
|
201
|
+
/**
|
|
202
|
+
* @group Types
|
|
203
|
+
*/
|
|
204
|
+
export type AnchorSchema<T> = T extends AAnchor<infer S, any> ? S : never;
|
|
205
|
+
/**
|
|
206
|
+
* @group Types
|
|
207
|
+
*/
|
|
208
|
+
export type EnhancedModuleSchema<T extends UnknownModule> = {
|
|
209
|
+
inputs: {
|
|
210
|
+
[K in keyof ModuleSchemaInputs<T>]: ModuleSchema<T>[K];
|
|
211
|
+
};
|
|
212
|
+
metadata: Awaited<ReturnType<T['registerMetadata']>>;
|
|
213
|
+
models: Record<string, UnknownModel>;
|
|
214
|
+
overlays: Record<string, UnknownOverlay>;
|
|
215
|
+
resources: Record<string, UnknownResource>;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* @internal
|
|
219
|
+
*/
|
|
220
|
+
export type ModelSchema<T> = T extends AModel<infer S, any> ? S : never;
|
|
221
|
+
/**
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
export type ModuleOutput<M> = M extends AModule<any, infer T> ? T : never;
|
|
225
|
+
/**
|
|
226
|
+
* @group Types
|
|
227
|
+
*/
|
|
228
|
+
export type ModuleSchema<T> = T extends AModule<infer S, any> ? S : never;
|
|
229
|
+
/**
|
|
230
|
+
* @group Types
|
|
231
|
+
*/
|
|
232
|
+
export type ModuleSchemaInputs<T> = {
|
|
233
|
+
[K in ClassRequiredProperties<ModuleSchema<T>>]: ModuleSchema<T>[K];
|
|
234
|
+
} & {
|
|
235
|
+
[K in ClassOptionalProperties<ModuleSchema<T>>]?: ModuleSchema<T>[K];
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
export type NodeSchema<T> = T extends ANode<infer S, any> ? S : never;
|
|
241
|
+
/**
|
|
242
|
+
* @group Types
|
|
243
|
+
*/
|
|
244
|
+
export type OverlaySchema<T> = T extends AOverlay<infer S, any> ? S : never;
|
|
245
|
+
/**
|
|
246
|
+
* @group Types
|
|
247
|
+
*/
|
|
248
|
+
export type ResourceSchema<T> = T extends AResource<infer S, any> ? S : never;
|
|
249
|
+
/**
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
export type IUnknownModel = IModel<unknown, any>;
|
|
253
|
+
/**
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
export type IUnknownModelAction = IModelAction<any>;
|
|
257
|
+
/**
|
|
258
|
+
* @internal
|
|
259
|
+
*/
|
|
260
|
+
export type IUnknownResourceAction = IResourceAction<any>;
|
|
261
|
+
/**
|
|
262
|
+
* @internal
|
|
263
|
+
*/
|
|
264
|
+
export type UnknownAnchor = AAnchor<BaseAnchorSchema, UnknownModel>;
|
|
265
|
+
/**
|
|
266
|
+
* @internal
|
|
267
|
+
*/
|
|
268
|
+
export type UnknownModel = AModel<unknown, any>;
|
|
269
|
+
/**
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
272
|
+
export type UnknownModule = AModule<unknown, any>;
|
|
273
|
+
/**
|
|
274
|
+
* @internal
|
|
275
|
+
*/
|
|
72
276
|
export type UnknownNode = ANode<unknown, unknown>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
277
|
+
/**
|
|
278
|
+
* @internal
|
|
279
|
+
*/
|
|
280
|
+
export type UnknownOverlay = AOverlay<BaseOverlaySchema, any>;
|
|
281
|
+
/**
|
|
282
|
+
* @internal
|
|
283
|
+
*/
|
|
284
|
+
export type UnknownResource = AResource<any, any>;
|
package/dist/app.type.js
CHANGED
|
@@ -1,14 +1,105 @@
|
|
|
1
|
+
/* Classes */
|
|
2
|
+
/**
|
|
3
|
+
* @group Types
|
|
4
|
+
*/
|
|
5
|
+
export class MatchingAnchor {
|
|
6
|
+
constructor(actual, schemaTranslator) {
|
|
7
|
+
this.actual = actual;
|
|
8
|
+
this.schemaTranslator = schemaTranslator;
|
|
9
|
+
}
|
|
10
|
+
hasSchemaTranslator() {
|
|
11
|
+
return !!this.schemaTranslator;
|
|
12
|
+
}
|
|
13
|
+
getActual() {
|
|
14
|
+
return this.actual;
|
|
15
|
+
}
|
|
16
|
+
getSchemaInstance() {
|
|
17
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @group Types
|
|
22
|
+
*/
|
|
23
|
+
export class MatchingModel {
|
|
24
|
+
constructor(actual, schemaTranslator) {
|
|
25
|
+
this.actual = actual;
|
|
26
|
+
this.schemaTranslator = schemaTranslator;
|
|
27
|
+
}
|
|
28
|
+
hasSchemaTranslator() {
|
|
29
|
+
return !!this.schemaTranslator;
|
|
30
|
+
}
|
|
31
|
+
getActual() {
|
|
32
|
+
return this.actual;
|
|
33
|
+
}
|
|
34
|
+
getSchemaInstance() {
|
|
35
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @group Types
|
|
40
|
+
*/
|
|
41
|
+
export class MatchingResource {
|
|
42
|
+
constructor(actual, schemaTranslator) {
|
|
43
|
+
this.actual = actual;
|
|
44
|
+
this.schemaTranslator = schemaTranslator;
|
|
45
|
+
}
|
|
46
|
+
addChild(...args) {
|
|
47
|
+
const results = this.actual.addChild(...args);
|
|
48
|
+
if (!(args[1].parents[args[1].parents.length - 1] instanceof MatchingResource) &&
|
|
49
|
+
args[1].parents[args[1].parents.length - 1].resourceId === this.getActual().resourceId) {
|
|
50
|
+
args[1].parents.pop();
|
|
51
|
+
args[1].parents.push(this);
|
|
52
|
+
}
|
|
53
|
+
return results;
|
|
54
|
+
}
|
|
55
|
+
hasSchemaTranslator() {
|
|
56
|
+
return !!this.schemaTranslator;
|
|
57
|
+
}
|
|
58
|
+
getActual() {
|
|
59
|
+
return this.actual;
|
|
60
|
+
}
|
|
61
|
+
getSchemaInstance() {
|
|
62
|
+
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
63
|
+
}
|
|
64
|
+
getSchemaInstanceInResourceAction() {
|
|
65
|
+
return this.getSchemaInstance();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/* Enumerations */
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
1
72
|
export var NodeType;
|
|
2
73
|
(function (NodeType) {
|
|
3
74
|
NodeType["MODEL"] = "model";
|
|
4
75
|
NodeType["OVERLAY"] = "overlay";
|
|
5
76
|
NodeType["RESOURCE"] = "resource";
|
|
6
|
-
NodeType["SHARED_RESOURCE"] = "shared-resource";
|
|
7
77
|
})(NodeType || (NodeType = {}));
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
8
81
|
export var ValidationType;
|
|
9
82
|
(function (ValidationType) {
|
|
83
|
+
ValidationType["CUSTOM"] = "custom";
|
|
84
|
+
ValidationType["IS_MODEL"] = "isModel";
|
|
85
|
+
ValidationType["IS_OVERLAY"] = "isOverlay";
|
|
86
|
+
ValidationType["IS_RESOURCE"] = "isResource";
|
|
87
|
+
ValidationType["IS_SCHEMA"] = "isSchema";
|
|
10
88
|
ValidationType["MAX_LENGTH"] = "maxLength";
|
|
11
89
|
ValidationType["MIN_LENGTH"] = "minLength";
|
|
12
90
|
ValidationType["REGEX"] = "regex";
|
|
13
91
|
})(ValidationType || (ValidationType = {}));
|
|
92
|
+
/* Functions */
|
|
93
|
+
/**
|
|
94
|
+
* @group Types
|
|
95
|
+
*/
|
|
96
|
+
export function hasNodeName(node, nodeName) {
|
|
97
|
+
return node.constructor.NODE_NAME === nodeName;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @group Types
|
|
101
|
+
*/
|
|
102
|
+
export function stub(value) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
14
105
|
//# 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;AAEb;;GAEG;AACH,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,gBA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AACH,MAAM,UAAU,IAAI,CAAI,KAAa;IACnC,OAAO,KAAU,CAAC;AACpB,CAAC"}
|
|
@@ -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
4
|
* - A NodeType.MODEL action must implement the {@link IModelAction} interface.
|
|
5
5
|
* - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
|
|
6
6
|
* - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
|
|
7
|
-
* - A NodeType.SHARED_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
19
|
* - A NodeType.MODEL action must implement the {@link IModelAction} interface.
|
|
11
20
|
* - A NodeType.OVERLAY action must implement the {@link IModelAction} interface.
|
|
12
21
|
* - A NodeType.RESOURCE action must implement the {@link IResourceAction} interface.
|
|
13
|
-
* - A NodeType.SHARED_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":"
|
|
1
|
+
{"version":3,"file":"action.dec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AAgC;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 { RegistrationErrorEvent } from '../events/error.event.js';
|
|
2
|
-
import { EventService } from '../services/event/event.service.js';
|
|
3
|
-
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
4
1
|
import { Container } from '../functions/container/container.js';
|
|
2
|
+
import { AAnchor } from '../overlays/anchor.abstract.js';
|
|
3
|
+
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
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"}
|
|
@@ -7,10 +7,15 @@ type Hook = 'CommitHook';
|
|
|
7
7
|
* @EnableHook('CommitHook')
|
|
8
8
|
* async commitTransaction(): Promise<void> { ... }
|
|
9
9
|
* ```
|
|
10
|
+
*
|
|
10
11
|
* @group Decorators
|
|
12
|
+
*
|
|
11
13
|
* @internal
|
|
14
|
+
*
|
|
12
15
|
* @param hook The only values supported are `CommitHook`.
|
|
16
|
+
*
|
|
13
17
|
* @returns The decorated method.
|
|
18
|
+
*
|
|
14
19
|
* @see Definition of [Hooks](/docs/fundamentals/modules#hooks).
|
|
15
20
|
*/
|
|
16
21
|
export declare function EnableHook(hook: Hook): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|