@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
|
@@ -6,32 +6,18 @@ import { Event } from './event.model.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* The RegistrationEvent class is the superclass for all events in relation to class registration.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* It is not a good practice to create an event from this class directly,
|
|
11
|
-
* but should rather create one from one of the subclasses.
|
|
12
|
-
* This promotes a more accurate classification of events.
|
|
13
|
-
* :::
|
|
9
|
+
* @group Events/Registration
|
|
14
10
|
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const myEvent = new RegistrationEvent('MyClass');
|
|
18
|
-
* EventService.getInstance().emit(myEvent);
|
|
19
|
-
* ```
|
|
20
|
-
* @group Events
|
|
21
11
|
* @returns The Event instance.
|
|
22
12
|
*/
|
|
23
13
|
export class RegistrationEvent extends Event {
|
|
24
14
|
}
|
|
25
15
|
/**
|
|
26
|
-
* This event is emitted when a class with `@Anchor()` decorator is registered.
|
|
16
|
+
* This event is emitted when a class with `@Anchor('my-package')` decorator is registered.
|
|
27
17
|
* It emits the name of the class.
|
|
28
18
|
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
31
|
-
* const myEvent = new AnchorRegistrationEvent('MyClass');
|
|
32
|
-
* EventService.getInstance().emit(myEvent);
|
|
33
|
-
* ```
|
|
34
|
-
* @group Events
|
|
19
|
+
* @group Events/Registration
|
|
20
|
+
*
|
|
35
21
|
* @returns The Event instance.
|
|
36
22
|
*/
|
|
37
23
|
export class AnchorRegistrationEvent extends RegistrationEvent {
|
|
@@ -40,22 +26,17 @@ export class AnchorRegistrationEvent extends RegistrationEvent {
|
|
|
40
26
|
descriptor.value = function (...args) {
|
|
41
27
|
originalMethod.apply(this, args);
|
|
42
28
|
if (args[1].prototype instanceof AAnchor) {
|
|
43
|
-
|
|
44
|
-
eventService.emit(event);
|
|
29
|
+
eventService.emit(new AnchorRegistrationEvent(args[0]));
|
|
45
30
|
}
|
|
46
31
|
};
|
|
47
32
|
}
|
|
48
33
|
}
|
|
49
34
|
/**
|
|
50
|
-
* This event is emitted when a class with `@Action(
|
|
51
|
-
* It emits the name of the class.
|
|
35
|
+
* This event is emitted when a class with `@Action(ModelClass)` decorator is registered.
|
|
36
|
+
* It emits the name of the model class and the name of the action.
|
|
37
|
+
*
|
|
38
|
+
* @group Events/Registration
|
|
52
39
|
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* const myEvent = new ModelActionRegistrationEvent('MyClass');
|
|
56
|
-
* EventService.getInstance().emit(myEvent);
|
|
57
|
-
* ```
|
|
58
|
-
* @group Events
|
|
59
40
|
* @returns The Event instance.
|
|
60
41
|
*/
|
|
61
42
|
export class ModelActionRegistrationEvent extends RegistrationEvent {
|
|
@@ -63,23 +44,18 @@ export class ModelActionRegistrationEvent extends RegistrationEvent {
|
|
|
63
44
|
const originalMethod = descriptor.value;
|
|
64
45
|
descriptor.value = function (...args) {
|
|
65
46
|
originalMethod.apply(this, args);
|
|
66
|
-
for (const action of args[
|
|
67
|
-
|
|
68
|
-
eventService.emit(event);
|
|
47
|
+
for (const action of args[1]) {
|
|
48
|
+
eventService.emit(new ModelActionRegistrationEvent(`${args[0].name}:${action.constructor.name}`));
|
|
69
49
|
}
|
|
70
50
|
};
|
|
71
51
|
}
|
|
72
52
|
}
|
|
73
53
|
/**
|
|
74
|
-
* This event is emitted when a class with `@Model()` decorator is registered.
|
|
54
|
+
* This event is emitted when a class with `@Model('my-package')` decorator is registered.
|
|
75
55
|
* It emits the name of the class.
|
|
76
56
|
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
79
|
-
* const myEvent = new ModelRegistrationEvent('MyClass');
|
|
80
|
-
* EventService.getInstance().emit(myEvent);
|
|
81
|
-
* ```
|
|
82
|
-
* @group Events
|
|
57
|
+
* @group Events/Registration
|
|
58
|
+
*
|
|
83
59
|
* @returns The Event instance.
|
|
84
60
|
*/
|
|
85
61
|
export class ModelRegistrationEvent extends RegistrationEvent {
|
|
@@ -88,22 +64,17 @@ export class ModelRegistrationEvent extends RegistrationEvent {
|
|
|
88
64
|
descriptor.value = function (...args) {
|
|
89
65
|
originalMethod.apply(this, args);
|
|
90
66
|
if (args[1].prototype instanceof AModel) {
|
|
91
|
-
|
|
92
|
-
eventService.emit(event);
|
|
67
|
+
eventService.emit(new ModelRegistrationEvent(args[0]));
|
|
93
68
|
}
|
|
94
69
|
};
|
|
95
70
|
}
|
|
96
71
|
}
|
|
97
72
|
/**
|
|
98
|
-
* This event is emitted when a class with `@Overlay()` decorator is registered.
|
|
73
|
+
* This event is emitted when a class with `@Overlay('my-package')` decorator is registered.
|
|
99
74
|
* It emits the name of the class.
|
|
100
75
|
*
|
|
101
|
-
* @
|
|
102
|
-
*
|
|
103
|
-
* const myEvent = new OverlayRegistrationEvent('MyClass');
|
|
104
|
-
* EventService.getInstance().emit(myEvent);
|
|
105
|
-
* ```
|
|
106
|
-
* @group Events
|
|
76
|
+
* @group Events/Registration
|
|
77
|
+
*
|
|
107
78
|
* @returns The Event instance.
|
|
108
79
|
*/
|
|
109
80
|
export class OverlayRegistrationEvent extends RegistrationEvent {
|
|
@@ -112,23 +83,17 @@ export class OverlayRegistrationEvent extends RegistrationEvent {
|
|
|
112
83
|
descriptor.value = function (...args) {
|
|
113
84
|
originalMethod.apply(this, args);
|
|
114
85
|
if (args[1].prototype instanceof AOverlay) {
|
|
115
|
-
|
|
116
|
-
eventService.emit(event);
|
|
86
|
+
eventService.emit(new OverlayRegistrationEvent(args[0]));
|
|
117
87
|
}
|
|
118
88
|
};
|
|
119
89
|
}
|
|
120
90
|
}
|
|
121
91
|
/**
|
|
122
|
-
* This event is emitted when a class with `@Action(
|
|
123
|
-
*
|
|
124
|
-
*
|
|
92
|
+
* This event is emitted when a class with `@Action(ResourceClass)` decorator is registered.
|
|
93
|
+
* It emits the name of the resource class and the name of the action.
|
|
94
|
+
*
|
|
95
|
+
* @group Events/Registration
|
|
125
96
|
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```ts
|
|
128
|
-
* const myEvent = new ResourceActionRegistrationEvent('MyClass');
|
|
129
|
-
* EventService.getInstance().emit(myEvent);
|
|
130
|
-
* ```
|
|
131
|
-
* @group Events
|
|
132
97
|
* @returns The Event instance.
|
|
133
98
|
*/
|
|
134
99
|
export class ResourceActionRegistrationEvent extends RegistrationEvent {
|
|
@@ -136,23 +101,18 @@ export class ResourceActionRegistrationEvent extends RegistrationEvent {
|
|
|
136
101
|
const originalMethod = descriptor.value;
|
|
137
102
|
descriptor.value = function (...args) {
|
|
138
103
|
originalMethod.apply(this, args);
|
|
139
|
-
for (const action of args[
|
|
140
|
-
|
|
141
|
-
eventService.emit(event);
|
|
104
|
+
for (const action of args[1]) {
|
|
105
|
+
eventService.emit(new ResourceActionRegistrationEvent(`${args[0].name}:${action.constructor.name}`));
|
|
142
106
|
}
|
|
143
107
|
};
|
|
144
108
|
}
|
|
145
109
|
}
|
|
146
110
|
/**
|
|
147
|
-
* This event is emitted when a class with `@Resource()` decorator is registered.
|
|
111
|
+
* This event is emitted when a class with `@Resource('my-package')` decorator is registered.
|
|
148
112
|
* It emits the name of the class.
|
|
149
113
|
*
|
|
150
|
-
* @
|
|
151
|
-
*
|
|
152
|
-
* const myEvent = new ResourceRegistrationEvent('MyClass');
|
|
153
|
-
* EventService.getInstance().emit(myEvent);
|
|
154
|
-
* ```
|
|
155
|
-
* @group Events
|
|
114
|
+
* @group Events/Registration
|
|
115
|
+
*
|
|
156
116
|
* @returns The Event instance.
|
|
157
117
|
*/
|
|
158
118
|
export class ResourceRegistrationEvent extends RegistrationEvent {
|
|
@@ -161,8 +121,7 @@ export class ResourceRegistrationEvent extends RegistrationEvent {
|
|
|
161
121
|
descriptor.value = function (...args) {
|
|
162
122
|
originalMethod.apply(this, args);
|
|
163
123
|
if (args[1].prototype instanceof AResource) {
|
|
164
|
-
|
|
165
|
-
eventService.emit(event);
|
|
124
|
+
eventService.emit(new ResourceRegistrationEvent(args[0]));
|
|
166
125
|
}
|
|
167
126
|
};
|
|
168
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration.event.js","sourceRoot":"","sources":["../../src/events/registration.event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registration.event.js","sourceRoot":"","sources":["../../src/events/registration.event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,OAAO,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,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEjC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7B,YAAY,CAAC,IAAI,CAAC,IAAI,+BAA+B,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACvG,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9D,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAE6C,UAAU,CAAC,KAAK,CAAC;QAElF,UAAU,CAAC,KAAK,GAAG,UACjB,GAAG,IAA+D;YAElE,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEjC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,SAAS,EAAE,CAAC;gBAC3C,YAAY,CAAC,IAAI,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,72 +1,65 @@
|
|
|
1
|
+
import type { ModelSerializedOutput, ResourceSerializedOutput } from '../app.type.js';
|
|
2
|
+
import type { EventService } from '../services/event/event.service.js';
|
|
1
3
|
import { Event } from './event.model.js';
|
|
2
4
|
/**
|
|
3
5
|
* The SerializationEvent class is the superclass for all events in relation to serialization and deserialization.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
* It is not a good practice to create an event from this class directly,
|
|
7
|
-
* but should rather create one from one of the subclasses.
|
|
8
|
-
* This promotes a more accurate classification of events.
|
|
9
|
-
* :::
|
|
7
|
+
* @group Events/Serialization
|
|
10
8
|
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const myEvent = new SerializationEvent();
|
|
14
|
-
* EventService.getInstance().emit(myEvent);
|
|
15
|
-
* ```
|
|
16
|
-
* @group Events
|
|
17
9
|
* @returns The Event instance.
|
|
18
10
|
*/
|
|
19
|
-
export declare class SerializationEvent extends Event<
|
|
11
|
+
export declare class SerializationEvent<T> extends Event<T> {
|
|
20
12
|
}
|
|
21
13
|
/**
|
|
22
14
|
* This event is emitted when models are deserialized from serialized output.
|
|
23
15
|
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
26
|
-
* const myEvent = new ModelDeserializedEvent();
|
|
27
|
-
* EventService.getInstance().emit(myEvent);
|
|
28
|
-
* ```
|
|
29
|
-
* @group Events
|
|
16
|
+
* @group Events/Serialization
|
|
17
|
+
*
|
|
30
18
|
* @returns The Event instance.
|
|
31
19
|
*/
|
|
32
|
-
export declare class ModelDeserializedEvent extends SerializationEvent {
|
|
20
|
+
export declare class ModelDeserializedEvent extends SerializationEvent<ModelSerializedOutput> {
|
|
21
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
33
22
|
}
|
|
34
23
|
/**
|
|
35
24
|
* This event is emitted when models are serialized to an output.
|
|
36
25
|
*
|
|
37
|
-
* @
|
|
38
|
-
*
|
|
39
|
-
* const myEvent = new ModelSerializedEvent();
|
|
40
|
-
* EventService.getInstance().emit(myEvent);
|
|
41
|
-
* ```
|
|
42
|
-
* @group Events
|
|
26
|
+
* @group Events/Serialization
|
|
27
|
+
*
|
|
43
28
|
* @returns The Event instance.
|
|
44
29
|
*/
|
|
45
|
-
export declare class ModelSerializedEvent extends SerializationEvent {
|
|
30
|
+
export declare class ModelSerializedEvent extends SerializationEvent<ModelSerializedOutput> {
|
|
31
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
46
32
|
}
|
|
47
33
|
/**
|
|
48
34
|
* This event is emitted when resources are deserialized from serialized output.
|
|
49
35
|
*
|
|
50
|
-
* @
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
* @group Events/Serialization
|
|
37
|
+
*
|
|
38
|
+
* @returns The Event instance.
|
|
39
|
+
*/
|
|
40
|
+
export declare class ResourceDeserializedEvent extends SerializationEvent<{
|
|
41
|
+
actual: ResourceSerializedOutput;
|
|
42
|
+
old: ResourceSerializedOutput;
|
|
43
|
+
}> {
|
|
44
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* This event is emitted when actual resources are serialized to an output.
|
|
48
|
+
*
|
|
49
|
+
* @group Events/Serialization
|
|
50
|
+
*
|
|
56
51
|
* @returns The Event instance.
|
|
57
52
|
*/
|
|
58
|
-
export declare class
|
|
53
|
+
export declare class ActualResourceSerializedEvent extends SerializationEvent<ResourceSerializedOutput> {
|
|
54
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
59
55
|
}
|
|
60
56
|
/**
|
|
61
|
-
* This event is emitted when resources are serialized to an output.
|
|
57
|
+
* This event is emitted when new resources are serialized to an output.
|
|
58
|
+
*
|
|
59
|
+
* @group Events/Serialization
|
|
62
60
|
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const myEvent = new ResourceSerializedEvent();
|
|
66
|
-
* EventService.getInstance().emit(myEvent);
|
|
67
|
-
* ```
|
|
68
|
-
* @group Events
|
|
69
61
|
* @returns The Event instance.
|
|
70
62
|
*/
|
|
71
|
-
export declare class
|
|
63
|
+
export declare class NewResourceSerializedEvent extends SerializationEvent<ResourceSerializedOutput> {
|
|
64
|
+
static registrar(eventService: EventService, descriptor: PropertyDescriptor): void;
|
|
72
65
|
}
|
|
@@ -2,18 +2,8 @@ import { Event } from './event.model.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* The SerializationEvent class is the superclass for all events in relation to serialization and deserialization.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* It is not a good practice to create an event from this class directly,
|
|
7
|
-
* but should rather create one from one of the subclasses.
|
|
8
|
-
* This promotes a more accurate classification of events.
|
|
9
|
-
* :::
|
|
5
|
+
* @group Events/Serialization
|
|
10
6
|
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const myEvent = new SerializationEvent();
|
|
14
|
-
* EventService.getInstance().emit(myEvent);
|
|
15
|
-
* ```
|
|
16
|
-
* @group Events
|
|
17
7
|
* @returns The Event instance.
|
|
18
8
|
*/
|
|
19
9
|
export class SerializationEvent extends Event {
|
|
@@ -21,53 +11,85 @@ export class SerializationEvent extends Event {
|
|
|
21
11
|
/**
|
|
22
12
|
* This event is emitted when models are deserialized from serialized output.
|
|
23
13
|
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
26
|
-
* const myEvent = new ModelDeserializedEvent();
|
|
27
|
-
* EventService.getInstance().emit(myEvent);
|
|
28
|
-
* ```
|
|
29
|
-
* @group Events
|
|
14
|
+
* @group Events/Serialization
|
|
15
|
+
*
|
|
30
16
|
* @returns The Event instance.
|
|
31
17
|
*/
|
|
32
18
|
export class ModelDeserializedEvent extends SerializationEvent {
|
|
19
|
+
static registrar(eventService, descriptor) {
|
|
20
|
+
const originalMethod = descriptor.value;
|
|
21
|
+
descriptor.value = async function (...args) {
|
|
22
|
+
const result = await originalMethod.apply(this, args);
|
|
23
|
+
eventService.emit(new ModelDeserializedEvent(undefined, args[0]));
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
29
|
* This event is emitted when models are serialized to an output.
|
|
36
30
|
*
|
|
37
|
-
* @
|
|
38
|
-
*
|
|
39
|
-
* const myEvent = new ModelSerializedEvent();
|
|
40
|
-
* EventService.getInstance().emit(myEvent);
|
|
41
|
-
* ```
|
|
42
|
-
* @group Events
|
|
31
|
+
* @group Events/Serialization
|
|
32
|
+
*
|
|
43
33
|
* @returns The Event instance.
|
|
44
34
|
*/
|
|
45
35
|
export class ModelSerializedEvent extends SerializationEvent {
|
|
36
|
+
static registrar(eventService, descriptor) {
|
|
37
|
+
const originalMethod = descriptor.value;
|
|
38
|
+
descriptor.value = async function (...args) {
|
|
39
|
+
const result = await originalMethod.apply(this, args);
|
|
40
|
+
eventService.emit(new ModelSerializedEvent(undefined, result));
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
46
44
|
}
|
|
47
45
|
/**
|
|
48
46
|
* This event is emitted when resources are deserialized from serialized output.
|
|
49
47
|
*
|
|
50
|
-
* @
|
|
51
|
-
*
|
|
52
|
-
* const myEvent = new ResourceDeserializedEvent();
|
|
53
|
-
* EventService.getInstance().emit(myEvent);
|
|
54
|
-
* ```
|
|
55
|
-
* @group Events
|
|
48
|
+
* @group Events/Serialization
|
|
49
|
+
*
|
|
56
50
|
* @returns The Event instance.
|
|
57
51
|
*/
|
|
58
52
|
export class ResourceDeserializedEvent extends SerializationEvent {
|
|
53
|
+
static registrar(eventService, descriptor) {
|
|
54
|
+
const originalMethod = descriptor.value;
|
|
55
|
+
descriptor.value = async function (...args) {
|
|
56
|
+
await originalMethod.apply(this, args);
|
|
57
|
+
eventService.emit(new ResourceDeserializedEvent(undefined, { actual: args[0], old: args[1] }));
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* This event is emitted when actual resources are serialized to an output.
|
|
63
|
+
*
|
|
64
|
+
* @group Events/Serialization
|
|
65
|
+
*
|
|
66
|
+
* @returns The Event instance.
|
|
67
|
+
*/
|
|
68
|
+
export class ActualResourceSerializedEvent extends SerializationEvent {
|
|
69
|
+
static registrar(eventService, descriptor) {
|
|
70
|
+
const originalMethod = descriptor.value;
|
|
71
|
+
descriptor.value = async function (...args) {
|
|
72
|
+
const result = await originalMethod.apply(this, args);
|
|
73
|
+
eventService.emit(new ActualResourceSerializedEvent(undefined, result));
|
|
74
|
+
return result;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
59
77
|
}
|
|
60
78
|
/**
|
|
61
|
-
* This event is emitted when resources are serialized to an output.
|
|
79
|
+
* This event is emitted when new resources are serialized to an output.
|
|
80
|
+
*
|
|
81
|
+
* @group Events/Serialization
|
|
62
82
|
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const myEvent = new ResourceSerializedEvent();
|
|
66
|
-
* EventService.getInstance().emit(myEvent);
|
|
67
|
-
* ```
|
|
68
|
-
* @group Events
|
|
69
83
|
* @returns The Event instance.
|
|
70
84
|
*/
|
|
71
|
-
export class
|
|
85
|
+
export class NewResourceSerializedEvent extends SerializationEvent {
|
|
86
|
+
static registrar(eventService, descriptor) {
|
|
87
|
+
const originalMethod = descriptor.value;
|
|
88
|
+
descriptor.value = async function (...args) {
|
|
89
|
+
const result = await originalMethod.apply(this, args);
|
|
90
|
+
eventService.emit(new NewResourceSerializedEvent(undefined, result));
|
|
91
|
+
return result;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
72
94
|
}
|
|
73
95
|
//# sourceMappingURL=serialization.event.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.event.js","sourceRoot":"","sources":["../../src/events/serialization.event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialization.event.js","sourceRoot":"","sources":["../../src/events/serialization.event.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,OAAO,kBAAsB,SAAQ,KAAQ;CAAG;AAEtD;;;;;;GAMG;AACH,MAAM,OAAO,sBAAuB,SAAQ,kBAAyC;IACnF,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAEwC,UAAU,CAAC,KAAK,CAAC;QAE7E,UAAU,CAAC,KAAK,GAAG,KAAK,WACtB,GAAG,IAA0D;YAE7D,MAAM,MAAM,GAAG,MAAM,cAAc,C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AC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAEwD,UAAU,CAAC,KAAK,CAAC;QAE7F,UAAU,CAAC,KAAK,GAAG,KAAK,WACtB,GAAG,IAA0E;YAE7E,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEtD,YAAY,CAAC,IAAI,CAAC,IAAI,6BAA6B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YAExE,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAA4C;IAC1F,MAAM,CAAU,SAAS,CAAC,YAA0B,EAAE,UAA8B;QAClF,MAAM,cAAc,GAEqD,UAAU,CAAC,KAAK,CAAC;QAE1F,UAAU,CAAC,KAAK,GAAG,KAAK,WACtB,GAAG,IAAuE;YAE1E,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEtD,YAAY,CAAC,IAAI,CAAC,IAAI,0BAA0B,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;YAErE,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,48 +1,91 @@
|
|
|
1
|
+
import type { DiffMetadata } from '../functions/diff/diff-metadata.js';
|
|
1
2
|
import { Event } from './event.model.js';
|
|
2
3
|
/**
|
|
3
4
|
* The TransactionEvent class is the superclass for all events in relation to transactions.
|
|
4
5
|
* A transaction processes actions generated from model and resource diffs.
|
|
5
|
-
* Thus, the events are usually in relation with these actions.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* It is not a good practice to create an event from this class directly,
|
|
9
|
-
* but should rather create one from one of the subclasses.
|
|
10
|
-
* This promotes a more accurate classification of events.
|
|
11
|
-
* :::
|
|
7
|
+
* @group Events/Transaction
|
|
12
8
|
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const myEvent = new TransactionEvent('MyActionName');
|
|
16
|
-
* EventService.getInstance().emit(myEvent);
|
|
17
|
-
* ```
|
|
18
|
-
* @group Events
|
|
19
9
|
* @returns The Event instance.
|
|
20
10
|
*/
|
|
21
|
-
export declare class TransactionEvent extends Event<
|
|
11
|
+
export declare class TransactionEvent<T> extends Event<T> {
|
|
22
12
|
}
|
|
23
13
|
/**
|
|
24
|
-
* This event is emitted when a model action is done executing.
|
|
14
|
+
* This event is emitted when a model action in a transaction is done executing.
|
|
15
|
+
*
|
|
16
|
+
* @group Events/Transaction
|
|
17
|
+
*
|
|
18
|
+
* @returns The Event instance.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ModelActionTransactionEvent extends TransactionEvent<void> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* This event is emitted when transaction prepares a model diff.
|
|
24
|
+
|
|
25
|
+
* @group Events/Transaction
|
|
26
|
+
*
|
|
27
|
+
* @returns The Event instance.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ModelDiffsTransactionEvent extends TransactionEvent<DiffMetadata[][]> {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* This event is emitted when transaction prepares a model transaction.
|
|
33
|
+
|
|
34
|
+
* @group Events/Transaction
|
|
35
|
+
*
|
|
36
|
+
* @returns The Event instance.
|
|
37
|
+
*/
|
|
38
|
+
export declare class ModelTransactionTransactionEvent extends TransactionEvent<DiffMetadata[][]> {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* This event is emitted when a resource action in a transaction is done executing.
|
|
42
|
+
*
|
|
43
|
+
* @group Events/Transaction
|
|
44
|
+
*
|
|
45
|
+
* @returns The Event instance.
|
|
46
|
+
*/
|
|
47
|
+
export declare class ResourceActionCompletedTransactionEvent extends TransactionEvent<DiffMetadata> {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This event is emitted when a resource action in a transaction begins executing.
|
|
51
|
+
*
|
|
52
|
+
* @group Events/Transaction
|
|
53
|
+
*
|
|
54
|
+
* @returns The Event instance.
|
|
55
|
+
*/
|
|
56
|
+
export declare class ResourceActionInitiatedTransactionEvent extends TransactionEvent<DiffMetadata> {
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* This event is emitted when a resource action in a transaction is done executing.
|
|
60
|
+
* It emits a summary of the action.
|
|
61
|
+
*
|
|
62
|
+
* @group Events/Transaction
|
|
63
|
+
*
|
|
64
|
+
* @returns The Event instance.
|
|
65
|
+
*/
|
|
66
|
+
export declare class ResourceActionSummaryTransactionEvent extends TransactionEvent<{
|
|
67
|
+
diff: DiffMetadata;
|
|
68
|
+
values: {
|
|
69
|
+
current: unknown;
|
|
70
|
+
previous: unknown;
|
|
71
|
+
};
|
|
72
|
+
}> {
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* This event is emitted when transaction prepares a resource diff.
|
|
76
|
+
|
|
77
|
+
* @group Events/Transaction
|
|
25
78
|
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const myEvent = new ModelActionTransactionEvent('MyActionName');
|
|
29
|
-
* EventService.getInstance().emit(myEvent);
|
|
30
|
-
* ```
|
|
31
|
-
* @group Events
|
|
32
79
|
* @returns The Event instance.
|
|
33
80
|
*/
|
|
34
|
-
export declare class
|
|
81
|
+
export declare class ResourceDiffsTransactionEvent extends TransactionEvent<[DiffMetadata[][], DiffMetadata[][]]> {
|
|
35
82
|
}
|
|
36
83
|
/**
|
|
37
|
-
* This event is emitted when a resource
|
|
84
|
+
* This event is emitted when transaction prepares a resource transaction.
|
|
85
|
+
|
|
86
|
+
* @group Events/Transaction
|
|
38
87
|
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const myEvent = new ResourceActionTransactionEvent('MyActionName');
|
|
42
|
-
* EventService.getInstance().emit(myEvent);
|
|
43
|
-
* ```
|
|
44
|
-
* @group Events
|
|
45
88
|
* @returns The Event instance.
|
|
46
89
|
*/
|
|
47
|
-
export declare class
|
|
90
|
+
export declare class ResourceTransactionTransactionEvent extends TransactionEvent<[DiffMetadata[][], DiffMetadata[][]]> {
|
|
48
91
|
}
|