@quadnix/octo 0.0.30 → 0.1.0
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/LICENSE +661 -0
- package/README.md +25 -3
- package/dist/app.type.d.ts +143 -4
- package/dist/app.type.js +80 -9
- package/dist/app.type.js.map +1 -1
- package/dist/decorators/action.decorator.d.ts +10 -6
- package/dist/decorators/action.decorator.js +19 -6
- package/dist/decorators/action.decorator.js.map +1 -1
- package/dist/decorators/anchor.decorator.d.ts +12 -5
- package/dist/decorators/anchor.decorator.js +12 -5
- package/dist/decorators/anchor.decorator.js.map +1 -1
- package/dist/decorators/enable-hook.decorator.d.ts +1 -1
- package/dist/decorators/enable-hook.decorator.js +1 -1
- package/dist/decorators/factory.decorator.d.ts +18 -34
- package/dist/decorators/factory.decorator.js +18 -34
- package/dist/decorators/factory.decorator.js.map +1 -1
- package/dist/decorators/model.decorator.d.ts +1 -1
- package/dist/decorators/model.decorator.js +1 -1
- package/dist/decorators/module.decorator.d.ts +16 -10
- package/dist/decorators/module.decorator.js +16 -10
- package/dist/decorators/module.decorator.js.map +1 -1
- package/dist/decorators/on-event.decorator.d.ts +5 -0
- package/dist/decorators/on-event.decorator.js +5 -0
- package/dist/decorators/on-event.decorator.js.map +1 -1
- package/dist/decorators/validate.decorator.d.ts +15 -1
- package/dist/decorators/validate.decorator.js +15 -1
- package/dist/decorators/validate.decorator.js.map +1 -1
- package/dist/errors/container.error.d.ts +18 -0
- package/dist/errors/container.error.js +18 -0
- package/dist/errors/container.error.js.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/module.error.d.ts +6 -0
- package/dist/errors/module.error.js +6 -0
- package/dist/errors/module.error.js.map +1 -1
- package/dist/errors/node.error.d.ts +56 -0
- package/dist/errors/node.error.js +56 -0
- package/dist/errors/node.error.js.map +1 -1
- package/dist/errors/schema.error.d.ts +6 -0
- package/dist/errors/schema.error.js +6 -0
- package/dist/errors/schema.error.js.map +1 -1
- package/dist/errors/terraform.error.d.ts +19 -0
- package/dist/errors/terraform.error.js +23 -0
- package/dist/errors/terraform.error.js.map +1 -0
- package/dist/errors/transaction.error.d.ts +61 -0
- package/dist/errors/transaction.error.js +61 -0
- package/dist/errors/transaction.error.js.map +1 -1
- package/dist/events/action.event.d.ts +0 -2
- package/dist/events/action.event.js +0 -2
- package/dist/events/action.event.js.map +1 -1
- package/dist/events/event.model.d.ts +21 -5
- package/dist/events/event.model.js +11 -5
- package/dist/events/event.model.js.map +1 -1
- package/dist/events/hook/commit.hook.event.d.ts +0 -6
- package/dist/events/hook/commit.hook.event.js +0 -6
- package/dist/events/hook/commit.hook.event.js.map +1 -1
- package/dist/events/hook/hook.event.d.ts +0 -2
- package/dist/events/hook/hook.event.js +0 -2
- package/dist/events/hook/hook.event.js.map +1 -1
- package/dist/events/hook/model.hook.event.d.ts +0 -6
- package/dist/events/hook/model.hook.event.js +0 -6
- package/dist/events/hook/model.hook.event.js.map +1 -1
- package/dist/events/hook/resource.hook.event.d.ts +0 -6
- package/dist/events/hook/resource.hook.event.js +0 -6
- package/dist/events/hook/resource.hook.event.js.map +1 -1
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.js +3 -0
- package/dist/events/index.js.map +1 -1
- package/dist/events/mode-result.event.d.ts +57 -0
- package/dist/events/mode-result.event.js +24 -0
- package/dist/events/mode-result.event.js.map +1 -0
- package/dist/events/mode.event.d.ts +57 -0
- package/dist/events/mode.event.js +32 -0
- package/dist/events/mode.event.js.map +1 -0
- package/dist/events/module.event.d.ts +0 -2
- package/dist/events/module.event.js +0 -2
- package/dist/events/module.event.js.map +1 -1
- package/dist/events/registration.event.d.ts +18 -14
- package/dist/events/registration.event.js +18 -14
- package/dist/events/registration.event.js.map +1 -1
- package/dist/events/serialization.event.d.ts +15 -12
- package/dist/events/serialization.event.js +15 -12
- package/dist/events/serialization.event.js.map +1 -1
- package/dist/events/terraform.event.d.ts +42 -0
- package/dist/events/terraform.event.js +31 -0
- package/dist/events/terraform.event.js.map +1 -0
- package/dist/events/transaction.event.d.ts +0 -37
- package/dist/events/transaction.event.js +0 -28
- package/dist/events/transaction.event.js.map +1 -1
- package/dist/functions/container/container.d.ts +54 -13
- package/dist/functions/container/container.js +63 -18
- package/dist/functions/container/container.js.map +1 -1
- package/dist/functions/container/test-container.d.ts +43 -29
- package/dist/functions/container/test-container.js +71 -43
- package/dist/functions/container/test-container.js.map +1 -1
- package/dist/functions/dependency/dependency.d.ts +82 -8
- package/dist/functions/dependency/dependency.js +80 -14
- package/dist/functions/dependency/dependency.js.map +1 -1
- package/dist/functions/diff/aggregate-resource-actions.d.ts +19 -0
- package/dist/functions/diff/aggregate-resource-actions.js +41 -0
- package/dist/functions/diff/aggregate-resource-actions.js.map +1 -0
- package/dist/functions/diff/diff-metadata.d.ts +21 -3
- package/dist/functions/diff/diff-metadata.js +18 -0
- package/dist/functions/diff/diff-metadata.js.map +1 -1
- package/dist/functions/diff/diff.d.ts +55 -1
- package/dist/functions/diff/diff.js +44 -3
- package/dist/functions/diff/diff.js.map +1 -1
- package/dist/functions/diff/diff.utility.d.ts +17 -2
- package/dist/functions/diff/diff.utility.js +53 -38
- package/dist/functions/diff/diff.utility.js.map +1 -1
- package/dist/functions/hook/commit.hook.d.ts +16 -1
- package/dist/functions/hook/commit.hook.js +21 -6
- package/dist/functions/hook/commit.hook.js.map +1 -1
- package/dist/functions/hook/model-action.hook.d.ts +16 -1
- package/dist/functions/hook/model-action.hook.js +21 -6
- package/dist/functions/hook/model-action.hook.js.map +1 -1
- package/dist/functions/hook/resource-action.hook.d.ts +16 -1
- package/dist/functions/hook/resource-action.hook.js +21 -6
- package/dist/functions/hook/resource-action.hook.js.map +1 -1
- package/dist/functions/node/node-action.abstract.d.ts +23 -0
- package/dist/functions/node/node-action.abstract.js +20 -0
- package/dist/functions/node/node-action.abstract.js.map +1 -1
- package/dist/functions/node/node.abstract.d.ts +56 -5
- package/dist/functions/node/node.abstract.js +85 -12
- package/dist/functions/node/node.abstract.js.map +1 -1
- package/dist/functions/node/node.interface.d.ts +1 -0
- package/dist/functions/schema/schema.d.ts +7 -0
- package/dist/functions/schema/schema.js +9 -0
- package/dist/functions/schema/schema.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +244 -14
- package/dist/main.js +361 -72
- package/dist/main.js.map +1 -1
- package/dist/models/account/account.model.d.ts +37 -7
- package/dist/models/account/account.model.js +40 -8
- package/dist/models/account/account.model.js.map +1 -1
- package/dist/models/account/account.schema.d.ts +13 -1
- package/dist/models/account/account.schema.js +12 -0
- package/dist/models/account/account.schema.js.map +1 -1
- package/dist/models/app/app.model.d.ts +16 -1
- package/dist/models/app/app.model.js +19 -4
- 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 +6 -0
- package/dist/models/app/app.schema.js.map +1 -1
- package/dist/models/deployment/deployment.model.d.ts +13 -1
- package/dist/models/deployment/deployment.model.js +16 -4
- package/dist/models/deployment/deployment.model.js.map +1 -1
- package/dist/models/deployment/deployment.schema.d.ts +2 -0
- package/dist/models/deployment/deployment.schema.js +2 -0
- package/dist/models/deployment/deployment.schema.js.map +1 -1
- package/dist/models/environment/environment.model.d.ts +13 -1
- package/dist/models/environment/environment.model.js +20 -8
- package/dist/models/environment/environment.model.js.map +1 -1
- package/dist/models/environment/environment.schema.d.ts +2 -0
- package/dist/models/environment/environment.schema.js +2 -0
- package/dist/models/environment/environment.schema.js.map +1 -1
- package/dist/models/execution/execution.model.d.ts +20 -2
- package/dist/models/execution/execution.model.js +46 -28
- package/dist/models/execution/execution.model.js.map +1 -1
- package/dist/models/execution/execution.schema.d.ts +11 -0
- package/dist/models/execution/execution.schema.js +11 -0
- package/dist/models/execution/execution.schema.js.map +1 -1
- package/dist/models/filesystem/filesystem.model.d.ts +27 -1
- package/dist/models/filesystem/filesystem.model.js +30 -4
- package/dist/models/filesystem/filesystem.model.js.map +1 -1
- package/dist/models/filesystem/filesystem.schema.d.ts +5 -0
- package/dist/models/filesystem/filesystem.schema.js +5 -0
- package/dist/models/filesystem/filesystem.schema.js.map +1 -1
- package/dist/models/image/image.model.d.ts +17 -4
- package/dist/models/image/image.model.js +20 -7
- package/dist/models/image/image.model.js.map +1 -1
- package/dist/models/image/image.schema.d.ts +8 -0
- package/dist/models/image/image.schema.js +8 -0
- package/dist/models/image/image.schema.js.map +1 -1
- package/dist/models/model-action.interface.d.ts +17 -4
- package/dist/models/model.abstract.d.ts +96 -1
- package/dist/models/model.abstract.js +106 -7
- package/dist/models/model.abstract.js.map +1 -1
- package/dist/models/model.interface.d.ts +3 -0
- package/dist/models/pipeline/pipeline.model.d.ts +13 -1
- package/dist/models/pipeline/pipeline.model.js +18 -6
- package/dist/models/pipeline/pipeline.model.js.map +1 -1
- package/dist/models/pipeline/pipeline.schema.d.ts +8 -0
- package/dist/models/pipeline/pipeline.schema.js +8 -0
- package/dist/models/pipeline/pipeline.schema.js.map +1 -1
- package/dist/models/region/region.model.d.ts +16 -1
- package/dist/models/region/region.model.js +19 -4
- 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 +6 -0
- package/dist/models/region/region.schema.js.map +1 -1
- package/dist/models/server/server.model.d.ts +13 -1
- package/dist/models/server/server.model.js +16 -4
- package/dist/models/server/server.model.js.map +1 -1
- package/dist/models/server/server.schema.d.ts +3 -1
- package/dist/models/server/server.schema.js +3 -1
- package/dist/models/server/server.schema.js.map +1 -1
- package/dist/models/service/service.model.d.ts +15 -1
- package/dist/models/service/service.model.js +15 -1
- package/dist/models/service/service.model.js.map +1 -1
- package/dist/models/service/service.schema.d.ts +4 -1
- package/dist/models/service/service.schema.js +4 -1
- package/dist/models/service/service.schema.js.map +1 -1
- package/dist/models/subnet/subnet.model.d.ts +27 -3
- package/dist/models/subnet/subnet.model.js +40 -16
- package/dist/models/subnet/subnet.model.js.map +1 -1
- package/dist/models/subnet/subnet.schema.d.ts +9 -0
- package/dist/models/subnet/subnet.schema.js +9 -0
- package/dist/models/subnet/subnet.schema.js.map +1 -1
- package/dist/modes/apply-transaction.d.ts +23 -0
- package/dist/modes/apply-transaction.js +25 -0
- package/dist/modes/apply-transaction.js.map +1 -0
- package/dist/modes/commit.mode.d.ts +54 -0
- package/dist/modes/commit.mode.js +235 -0
- package/dist/modes/commit.mode.js.map +1 -0
- package/dist/modes/generate.mode.d.ts +29 -0
- package/dist/modes/generate.mode.js +49 -0
- package/dist/modes/generate.mode.js.map +1 -0
- package/dist/modes/run-action.mode.d.ts +30 -0
- package/dist/modes/run-action.mode.js +140 -0
- package/dist/modes/run-action.mode.js.map +1 -0
- package/dist/modes/validate.mode.d.ts +162 -0
- package/dist/modes/validate.mode.js +480 -0
- package/dist/modes/validate.mode.js.map +1 -0
- package/dist/modules/module.abstract.d.ts +51 -0
- package/dist/modules/module.abstract.js +36 -0
- package/dist/modules/module.abstract.js.map +1 -1
- package/dist/modules/module.container.d.ts +36 -0
- package/dist/modules/module.container.js +36 -0
- package/dist/modules/module.container.js.map +1 -1
- package/dist/modules/test-module.container.d.ts +139 -25
- package/dist/modules/test-module.container.js +410 -178
- package/dist/modules/test-module.container.js.map +1 -1
- package/dist/overlays/anchor.abstract.d.ts +32 -1
- package/dist/overlays/anchor.abstract.js +42 -11
- package/dist/overlays/anchor.abstract.js.map +1 -1
- package/dist/overlays/anchor.schema.d.ts +21 -0
- package/dist/overlays/anchor.schema.js +21 -0
- package/dist/overlays/anchor.schema.js.map +1 -1
- package/dist/overlays/overlay-data.repository.d.ts +18 -0
- package/dist/overlays/overlay-data.repository.js +18 -0
- package/dist/overlays/overlay-data.repository.js.map +1 -1
- package/dist/overlays/overlay.abstract.d.ts +56 -1
- package/dist/overlays/overlay.abstract.js +79 -20
- package/dist/overlays/overlay.abstract.js.map +1 -1
- package/dist/overlays/overlay.schema.d.ts +20 -0
- package/dist/overlays/overlay.schema.js +20 -0
- package/dist/overlays/overlay.schema.js.map +1 -1
- package/dist/resources/resource-action.interface.d.ts +26 -2
- package/dist/resources/resource-data.repository.d.ts +63 -1
- package/dist/resources/resource-data.repository.js +94 -4
- package/dist/resources/resource-data.repository.js.map +1 -1
- package/dist/resources/resource.abstract.d.ts +118 -3
- package/dist/resources/resource.abstract.js +166 -33
- package/dist/resources/resource.abstract.js.map +1 -1
- package/dist/resources/resource.schema.d.ts +29 -1
- package/dist/resources/resource.schema.js +28 -0
- package/dist/resources/resource.schema.js.map +1 -1
- package/dist/resources/terraform-resource.abstract.d.ts +44 -0
- package/dist/resources/terraform-resource.abstract.js +45 -0
- package/dist/resources/terraform-resource.abstract.js.map +1 -0
- package/dist/services/event/event.service.d.ts +30 -3
- package/dist/services/event/event.service.js +58 -16
- package/dist/services/event/event.service.js.map +1 -1
- package/dist/services/input/input.service.d.ts +52 -3
- package/dist/services/input/input.service.js +72 -8
- package/dist/services/input/input.service.js.map +1 -1
- package/dist/services/schema-translation/schema-translation.service.d.ts +9 -0
- package/dist/services/schema-translation/schema-translation.service.js +9 -0
- package/dist/services/schema-translation/schema-translation.service.js.map +1 -1
- package/dist/services/serialization/model/model-serialization.service.d.ts +26 -2
- package/dist/services/serialization/model/model-serialization.service.js +110 -62
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.d.ts +33 -4
- package/dist/services/serialization/resource/resource-serialization.service.js +64 -28
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/state-management/file-app-lock.utility.d.ts +43 -0
- package/dist/services/state-management/file-app-lock.utility.js +124 -0
- package/dist/services/state-management/file-app-lock.utility.js.map +1 -0
- package/dist/services/state-management/local-encryption.state-provider.d.ts +53 -2
- package/dist/services/state-management/local-encryption.state-provider.js +75 -49
- package/dist/services/state-management/local-encryption.state-provider.js.map +1 -1
- package/dist/services/state-management/local.state-provider.d.ts +49 -2
- package/dist/services/state-management/local.state-provider.js +70 -49
- package/dist/services/state-management/local.state-provider.js.map +1 -1
- package/dist/services/state-management/state-management.service.d.ts +141 -6
- package/dist/services/state-management/state-management.service.js +149 -4
- package/dist/services/state-management/state-management.service.js.map +1 -1
- package/dist/services/state-management/state-provider.interface.d.ts +55 -1
- package/dist/services/state-management/terraform-state.service.d.ts +76 -0
- package/dist/services/state-management/terraform-state.service.js +154 -0
- package/dist/services/state-management/terraform-state.service.js.map +1 -0
- package/dist/services/state-management/test.state-provider.d.ts +38 -1
- package/dist/services/state-management/test.state-provider.js +52 -21
- package/dist/services/state-management/test.state-provider.js.map +1 -1
- package/dist/services/terraform/terraform.service.d.ts +426 -0
- package/dist/services/terraform/terraform.service.js +995 -0
- package/dist/services/terraform/terraform.service.js.map +1 -0
- package/dist/services/terraform/terraform.type.d.ts +387 -0
- package/dist/services/terraform/terraform.type.js +579 -0
- package/dist/services/terraform/terraform.type.js.map +1 -0
- package/dist/services/transaction/transaction.service.d.ts +86 -10
- package/dist/services/transaction/transaction.service.js +387 -232
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/dist/services/validation/validation.service.d.ts +13 -1
- package/dist/services/validation/validation.service.js +12 -0
- 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/file/file.utility.d.ts +15 -0
- package/dist/utilities/file/file.utility.js +18 -1
- package/dist/utilities/file/file.utility.js.map +1 -1
- package/dist/utilities/hcl/hcl.utility.d.ts +61 -0
- package/dist/utilities/hcl/hcl.utility.js +229 -0
- package/dist/utilities/hcl/hcl.utility.js.map +1 -0
- package/dist/utilities/node/node.utility.d.ts +3 -0
- package/dist/utilities/node/node.utility.js +3 -0
- package/dist/utilities/node/node.utility.js.map +1 -1
- package/dist/utilities/object/object.utility.d.ts +12 -0
- package/dist/utilities/object/object.utility.js +12 -0
- package/dist/utilities/object/object.utility.js.map +1 -1
- package/dist/utilities/project/project.utility.d.ts +28 -0
- package/dist/utilities/project/project.utility.js +35 -0
- package/dist/utilities/project/project.utility.js.map +1 -0
- package/dist/utilities/string/string.utility.d.ts +21 -0
- package/dist/utilities/string/string.utility.js +39 -0
- package/dist/utilities/string/string.utility.js.map +1 -0
- package/dist/utilities/terraform/terraform.utility.d.ts +227 -0
- package/dist/utilities/terraform/terraform.utility.js +434 -0
- package/dist/utilities/terraform/terraform.utility.js.map +1 -0
- package/dist/utilities/test-helpers/test-classes.d.ts +18 -31
- package/dist/utilities/test-helpers/test-classes.js +18 -41
- package/dist/utilities/test-helpers/test-classes.js.map +1 -1
- package/dist/utilities/test-helpers/test-models.js +12 -0
- package/dist/utilities/test-helpers/test-models.js.map +1 -1
- package/dist/utilities/test-helpers/test-modes.d.ts +315 -0
- package/dist/utilities/test-helpers/test-modes.js +463 -0
- package/dist/utilities/test-helpers/test-modes.js.map +1 -0
- package/dist/utilities/test-helpers/test-modules.d.ts +41 -0
- package/dist/utilities/test-helpers/test-modules.js +79 -0
- package/dist/utilities/test-helpers/test-modules.js.map +1 -0
- package/dist/utilities/test-helpers/test-overlays.d.ts +17 -1
- package/dist/utilities/test-helpers/test-overlays.js +49 -5
- package/dist/utilities/test-helpers/test-overlays.js.map +1 -1
- package/dist/utilities/test-helpers/test-resources.d.ts +19 -1
- package/dist/utilities/test-helpers/test-resources.js +61 -3
- package/dist/utilities/test-helpers/test-resources.js.map +1 -1
- package/dist/utilities/validation/validation.utility.d.ts +24 -0
- package/dist/utilities/validation/validation.utility.js +24 -0
- package/dist/utilities/validation/validation.utility.js.map +1 -1
- package/package.json +6 -5
- package/dist/services/capture/capture.service.d.ts +0 -19
- package/dist/services/capture/capture.service.js +0 -43
- package/dist/services/capture/capture.service.js.map +0 -1
- package/dist/utilities/cidr/cidr.utility.d.ts +0 -10
- package/dist/utilities/cidr/cidr.utility.js +0 -51
- package/dist/utilities/cidr/cidr.utility.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Octo
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
https://octo.quadnix.com/
|
|
3
4
|
|
|
4
5
|
The open-source infrastructure management and CICD tool.
|
|
5
6
|
|
|
@@ -8,6 +9,27 @@ The open-source infrastructure management and CICD tool.
|
|
|
8
9
|
> We plan to release version `1.x.x` when it is deemed ready for production use.
|
|
9
10
|
|
|
10
11
|
# Local Setup
|
|
11
|
-
> npm install
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- [Node.js](https://nodejs.org) 22 (LTS). This ships with Corepack, which provisions the
|
|
16
|
+
exact package manager the project expects — you do **not** need to install pnpm yourself.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
This repository is a [pnpm](https://pnpm.io) workspace. Corepack reads the `packageManager`
|
|
21
|
+
field in the root `package.json` and uses the pnpm version pinned there, so everyone (and CI)
|
|
22
|
+
runs the same version.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
# One-time per machine: activate Corepack so the `pnpm` command uses the pinned version.
|
|
26
|
+
corepack enable
|
|
27
|
+
|
|
28
|
+
# Install all workspace dependencies (packages/*).
|
|
29
|
+
pnpm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> **Note:** The documentation site under `apps/octo-docs` is an intentionally separate
|
|
33
|
+
> project — it consumes the published `@quadnix/*` packages from the registry rather than the
|
|
34
|
+
> local source. It is not part of the root workspace and is only installed (with its own
|
|
35
|
+
> `pnpm install`, run from inside that directory) when you are working on the docs.
|
package/dist/app.type.d.ts
CHANGED
|
@@ -13,38 +13,89 @@ import type { AResource } from './resources/resource.abstract.js';
|
|
|
13
13
|
import type { BaseResourceSchema } from './resources/resource.schema.js';
|
|
14
14
|
import type { ValidationUtility } from './utilities/validation/validation.utility.js';
|
|
15
15
|
/**
|
|
16
|
+
* An anchor found by schema, paired with the translation needed to read it as that schema.
|
|
17
|
+
*
|
|
18
|
+
* {@link AModel.getAnchorsMatchingSchema} returns these rather than raw anchors: the anchor you
|
|
19
|
+
* matched may have been declared against a different version of the schema, and this is what keeps
|
|
20
|
+
* that difference out of your module. Read it with `getSchemaInstance()`.
|
|
21
|
+
*
|
|
16
22
|
* @group Types
|
|
17
23
|
*/
|
|
18
24
|
export declare class MatchingAnchor<S extends BaseAnchorSchema> {
|
|
19
25
|
private readonly actual;
|
|
20
26
|
private readonly schemaTranslator?;
|
|
27
|
+
/**
|
|
28
|
+
* @param actual The anchor that was matched.
|
|
29
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
30
|
+
*/
|
|
21
31
|
constructor(actual: AAnchor<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
22
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The anchor itself, with its properties hidden - read those through
|
|
34
|
+
* {@link MatchingAnchor.getSchemaInstance}.
|
|
35
|
+
*/
|
|
23
36
|
getActual(): AAnchor<Omit<S, 'properties'> & {
|
|
24
37
|
properties: Record<never, never>;
|
|
25
38
|
}, any>;
|
|
39
|
+
/**
|
|
40
|
+
* The anchor read as the schema you matched on.
|
|
41
|
+
*/
|
|
26
42
|
getSchemaInstance(): S;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the match went through a schema translation.
|
|
45
|
+
*/
|
|
46
|
+
hasSchemaTranslator(): boolean;
|
|
27
47
|
}
|
|
28
48
|
/**
|
|
49
|
+
* A model found by schema. See {@link MatchingAnchor}.
|
|
50
|
+
*
|
|
29
51
|
* @group Types
|
|
30
52
|
*/
|
|
31
53
|
export declare class MatchingModel<S extends object> {
|
|
32
54
|
private readonly actual;
|
|
33
55
|
private readonly schemaTranslator?;
|
|
56
|
+
/**
|
|
57
|
+
* @param actual The model that was matched.
|
|
58
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
59
|
+
*/
|
|
34
60
|
constructor(actual: AModel<S, any>, schemaTranslator?: ((synth: any) => S) | undefined);
|
|
35
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The model itself, with its schema hidden - read it through
|
|
63
|
+
* {@link MatchingModel.getSchemaInstance}.
|
|
64
|
+
*/
|
|
36
65
|
getActual(): AModel<Record<never, never>, any>;
|
|
66
|
+
/**
|
|
67
|
+
* The model read as the schema you matched on.
|
|
68
|
+
*/
|
|
37
69
|
getSchemaInstance(): S;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the match went through a schema translation.
|
|
72
|
+
*/
|
|
73
|
+
hasSchemaTranslator(): boolean;
|
|
38
74
|
}
|
|
39
75
|
/**
|
|
76
|
+
* A resource found by schema. See {@link MatchingAnchor}.
|
|
77
|
+
*
|
|
78
|
+
* Pass one wherever a resource parent is expected, and the translation is carried into the graph, so
|
|
79
|
+
* the child keeps reading its parent through the schema it was written against.
|
|
80
|
+
*
|
|
40
81
|
* @group Types
|
|
41
82
|
*/
|
|
42
83
|
export declare class MatchingResource<S extends BaseResourceSchema> {
|
|
43
84
|
private readonly actual;
|
|
44
85
|
readonly schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* @param actual The resource that was matched.
|
|
88
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
89
|
+
*/
|
|
45
90
|
constructor(actual: AResource<S, any>, schemaTranslator?: ((synth: BaseResourceSchema) => S) | undefined);
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
46
94
|
addChild(...args: Parameters<AResource<BaseResourceSchema, any>['addChild']>): ReturnType<AResource<BaseResourceSchema, any>['addChild']>;
|
|
47
|
-
|
|
95
|
+
/**
|
|
96
|
+
* The resource itself, with its schema hidden - read it through
|
|
97
|
+
* {@link MatchingResource.getSchemaInstance}.
|
|
98
|
+
*/
|
|
48
99
|
getActual(): AResource<Omit<S, 'properties' | 'response' | 'tags'> & {
|
|
49
100
|
properties: Record<never, never>;
|
|
50
101
|
} & {
|
|
@@ -52,10 +103,21 @@ export declare class MatchingResource<S extends BaseResourceSchema> {
|
|
|
52
103
|
} & {
|
|
53
104
|
tags: Record<never, never>;
|
|
54
105
|
}, any>;
|
|
106
|
+
/**
|
|
107
|
+
* The resource read as the schema you matched on.
|
|
108
|
+
*/
|
|
55
109
|
getSchemaInstance(): S;
|
|
110
|
+
/**
|
|
111
|
+
* The resource read as the schema you matched on, with its `response` typed as fully populated.
|
|
112
|
+
* Only call it from a resource action, where the parent is guaranteed to already exist.
|
|
113
|
+
*/
|
|
56
114
|
getSchemaInstanceInResourceAction(): Omit<S, 'response'> & {
|
|
57
115
|
response: Required<S['response']>;
|
|
58
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Whether the match went through a schema translation.
|
|
119
|
+
*/
|
|
120
|
+
hasSchemaTranslator(): boolean;
|
|
59
121
|
}
|
|
60
122
|
/**
|
|
61
123
|
* @internal
|
|
@@ -92,10 +154,19 @@ export type ValidationTypeOptions = {
|
|
|
92
154
|
[ValidationType.REGEX]: Parameters<typeof ValidationUtility.validateRegex>[1];
|
|
93
155
|
};
|
|
94
156
|
/**
|
|
157
|
+
* Whether a node was registered under the given name, e.g. `region`.
|
|
158
|
+
*
|
|
159
|
+
* Use it to identify a base model without importing the subclass that implements it.
|
|
160
|
+
*
|
|
95
161
|
* @group Types
|
|
96
162
|
*/
|
|
97
163
|
export declare function hasNodeName(node: UnknownNode, nodeName: string): boolean;
|
|
98
164
|
/**
|
|
165
|
+
* Marks a placeholder value that a later step fills in - typically a resource property whose real
|
|
166
|
+
* value is only known once the infrastructure exists.
|
|
167
|
+
*
|
|
168
|
+
* It is a type assertion and nothing more; it emits the string you give it.
|
|
169
|
+
*
|
|
99
170
|
* @group Types
|
|
100
171
|
*/
|
|
101
172
|
export declare function stub<T>(value: string): T;
|
|
@@ -104,6 +175,8 @@ export declare function stub<T>(value: string): T;
|
|
|
104
175
|
*/
|
|
105
176
|
export type ActionInputs = EnhancedModuleSchema<UnknownModule>;
|
|
106
177
|
/**
|
|
178
|
+
* The resources an action declared, keyed by an ID of your choosing.
|
|
179
|
+
*
|
|
107
180
|
* @group Types
|
|
108
181
|
*/
|
|
109
182
|
export type ActionOutputs = {
|
|
@@ -119,6 +192,8 @@ export type ClassOptionalProperties<T> = {
|
|
|
119
192
|
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
120
193
|
}[keyof T];
|
|
121
194
|
/**
|
|
195
|
+
* The `value` of a {@link Diff} on a `properties` field: which property changed, and to what.
|
|
196
|
+
*
|
|
122
197
|
* @group Types
|
|
123
198
|
*/
|
|
124
199
|
export type DiffValueTypePropertyUpdate = {
|
|
@@ -126,6 +201,8 @@ export type DiffValueTypePropertyUpdate = {
|
|
|
126
201
|
value: unknown;
|
|
127
202
|
};
|
|
128
203
|
/**
|
|
204
|
+
* The `value` of a {@link Diff} on a `tags` field, split by what happened to each tag.
|
|
205
|
+
*
|
|
129
206
|
* @group Types
|
|
130
207
|
*/
|
|
131
208
|
export type DiffValueTypeTagUpdate = {
|
|
@@ -147,10 +224,14 @@ export type ObjectKeyValue<T> = {
|
|
|
147
224
|
};
|
|
148
225
|
}[keyof T];
|
|
149
226
|
/**
|
|
227
|
+
* The class of `T`, i.e. what you pass when an API wants a type rather than an instance.
|
|
228
|
+
*
|
|
150
229
|
* @group Types
|
|
151
230
|
*/
|
|
152
231
|
export type Constructable<T> = new (...args: any[]) => T;
|
|
153
232
|
/**
|
|
233
|
+
* The model graph as written to state.
|
|
234
|
+
*
|
|
154
235
|
* @group Types
|
|
155
236
|
*/
|
|
156
237
|
export type ModelSerializedOutput = {
|
|
@@ -165,6 +246,7 @@ export type ModelSerializedOutput = {
|
|
|
165
246
|
[p: string]: {
|
|
166
247
|
className: string;
|
|
167
248
|
model: IUnknownModel;
|
|
249
|
+
moduleId?: string;
|
|
168
250
|
};
|
|
169
251
|
};
|
|
170
252
|
overlays: {
|
|
@@ -173,6 +255,8 @@ export type ModelSerializedOutput = {
|
|
|
173
255
|
}[];
|
|
174
256
|
};
|
|
175
257
|
/**
|
|
258
|
+
* The resource graph as written to state.
|
|
259
|
+
*
|
|
176
260
|
* @group Types
|
|
177
261
|
*/
|
|
178
262
|
export type ResourceSerializedOutput = {
|
|
@@ -180,16 +264,51 @@ export type ResourceSerializedOutput = {
|
|
|
180
264
|
resources: {
|
|
181
265
|
[p: string]: {
|
|
182
266
|
className: string;
|
|
267
|
+
moduleId?: string;
|
|
183
268
|
resource: BaseResourceSchema;
|
|
184
269
|
};
|
|
185
270
|
};
|
|
186
271
|
};
|
|
272
|
+
/**
|
|
273
|
+
* A record of one generated terraform module folder, kept in state so that a later run can tell
|
|
274
|
+
* which folders it owns.
|
|
275
|
+
*
|
|
276
|
+
* @group Types
|
|
277
|
+
*/
|
|
278
|
+
export type TerraformFolderOutput = {
|
|
279
|
+
hasExternalResources: boolean;
|
|
280
|
+
moduleId: string;
|
|
281
|
+
providers: {
|
|
282
|
+
accountId: string;
|
|
283
|
+
blockHcl: string;
|
|
284
|
+
providerType: string;
|
|
285
|
+
regionId: string;
|
|
286
|
+
requiredProvider: {
|
|
287
|
+
minVersion?: string;
|
|
288
|
+
source: string;
|
|
289
|
+
};
|
|
290
|
+
}[];
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* A record of where one octo resource ended up in terraform, kept in state so that a plan entry can
|
|
294
|
+
* be traced back to the resource that produced it.
|
|
295
|
+
*
|
|
296
|
+
* @group Types
|
|
297
|
+
*/
|
|
298
|
+
export type TerraformResourceOutput = {
|
|
299
|
+
moduleId: string;
|
|
300
|
+
resourceContext: string;
|
|
301
|
+
resourceId: string;
|
|
302
|
+
terraformAddresses: string[];
|
|
303
|
+
};
|
|
187
304
|
/**
|
|
188
305
|
* @internal
|
|
189
306
|
*/
|
|
190
307
|
export type TransactionOptions = {
|
|
191
|
-
enableResourceCapture?: boolean;
|
|
192
308
|
enableResourceValidation?: boolean;
|
|
309
|
+
filterResourceDiffsByResourceId?: string;
|
|
310
|
+
generateTerraform?: boolean;
|
|
311
|
+
skipActualResourceUpdate?: boolean;
|
|
193
312
|
yieldModelDiffs?: boolean;
|
|
194
313
|
yieldModelTransaction?: boolean;
|
|
195
314
|
yieldResourceDiffs?: boolean;
|
|
@@ -200,10 +319,17 @@ export type TransactionOptions = {
|
|
|
200
319
|
*/
|
|
201
320
|
export type ModifyInterface<T, R> = Omit<T, keyof R> & R;
|
|
202
321
|
/**
|
|
322
|
+
* The schema of an anchor class.
|
|
323
|
+
*
|
|
203
324
|
* @group Types
|
|
204
325
|
*/
|
|
205
326
|
export type AnchorSchema<T> = T extends AAnchor<infer S, any> ? S : never;
|
|
206
327
|
/**
|
|
328
|
+
* Everything an action knows about the module it belongs to: the inputs it was loaded with, whatever
|
|
329
|
+
* {@link AModule.registerMetadata} derived, and the nodes the module produced.
|
|
330
|
+
*
|
|
331
|
+
* This is the second argument of {@link IModelAction.handle}.
|
|
332
|
+
*
|
|
207
333
|
* @group Types
|
|
208
334
|
*/
|
|
209
335
|
export type EnhancedModuleSchema<T extends UnknownModule> = {
|
|
@@ -215,6 +341,10 @@ export type EnhancedModuleSchema<T extends UnknownModule> = {
|
|
|
215
341
|
overlays: Record<string, UnknownOverlay>;
|
|
216
342
|
resources: Record<string, UnknownResource>;
|
|
217
343
|
};
|
|
344
|
+
/**
|
|
345
|
+
* @internal
|
|
346
|
+
*/
|
|
347
|
+
export type GeneratorYieldType<T extends (...args: any) => AsyncGenerator<any, any, any>> = ReturnType<T> extends AsyncGenerator<infer Y, any, any> ? Y : never;
|
|
218
348
|
/**
|
|
219
349
|
* @internal
|
|
220
350
|
*/
|
|
@@ -224,10 +354,15 @@ export type ModelSchema<T> = T extends AModel<infer S, any> ? S : never;
|
|
|
224
354
|
*/
|
|
225
355
|
export type ModuleOutput<M> = M extends AModule<any, infer T> ? T : never;
|
|
226
356
|
/**
|
|
357
|
+
* The schema of a module class.
|
|
358
|
+
*
|
|
227
359
|
* @group Types
|
|
228
360
|
*/
|
|
229
361
|
export type ModuleSchema<T> = T extends AModule<infer S, any> ? S : never;
|
|
230
362
|
/**
|
|
363
|
+
* A module's schema as the caller supplies it - properties with a default become optional.
|
|
364
|
+
* This is the shape {@link Octo.loadModule} accepts.
|
|
365
|
+
*
|
|
231
366
|
* @group Types
|
|
232
367
|
*/
|
|
233
368
|
export type ModuleSchemaInputs<T> = {
|
|
@@ -240,10 +375,14 @@ export type ModuleSchemaInputs<T> = {
|
|
|
240
375
|
*/
|
|
241
376
|
export type NodeSchema<T> = T extends ANode<infer S, any> ? S : never;
|
|
242
377
|
/**
|
|
378
|
+
* The schema of an overlay class.
|
|
379
|
+
*
|
|
243
380
|
* @group Types
|
|
244
381
|
*/
|
|
245
382
|
export type OverlaySchema<T> = T extends AOverlay<infer S, any> ? S : never;
|
|
246
383
|
/**
|
|
384
|
+
* The schema of a resource class.
|
|
385
|
+
*
|
|
247
386
|
* @group Types
|
|
248
387
|
*/
|
|
249
388
|
export type ResourceSchema<T> = T extends AResource<infer S, any> ? S : never;
|
package/dist/app.type.js
CHANGED
|
@@ -1,48 +1,96 @@
|
|
|
1
1
|
/* Classes */
|
|
2
2
|
/**
|
|
3
|
+
* An anchor found by schema, paired with the translation needed to read it as that schema.
|
|
4
|
+
*
|
|
5
|
+
* {@link AModel.getAnchorsMatchingSchema} returns these rather than raw anchors: the anchor you
|
|
6
|
+
* matched may have been declared against a different version of the schema, and this is what keeps
|
|
7
|
+
* that difference out of your module. Read it with `getSchemaInstance()`.
|
|
8
|
+
*
|
|
3
9
|
* @group Types
|
|
4
10
|
*/
|
|
5
11
|
export class MatchingAnchor {
|
|
12
|
+
/**
|
|
13
|
+
* @param actual The anchor that was matched.
|
|
14
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
15
|
+
*/
|
|
6
16
|
constructor(actual, schemaTranslator) {
|
|
7
17
|
this.actual = actual;
|
|
8
18
|
this.schemaTranslator = schemaTranslator;
|
|
9
19
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The anchor itself, with its properties hidden - read those through
|
|
22
|
+
* {@link MatchingAnchor.getSchemaInstance}.
|
|
23
|
+
*/
|
|
13
24
|
getActual() {
|
|
14
25
|
return this.actual;
|
|
15
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The anchor read as the schema you matched on.
|
|
29
|
+
*/
|
|
16
30
|
getSchemaInstance() {
|
|
17
31
|
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
18
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether the match went through a schema translation.
|
|
35
|
+
*/
|
|
36
|
+
hasSchemaTranslator() {
|
|
37
|
+
return !!this.schemaTranslator;
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
/**
|
|
41
|
+
* A model found by schema. See {@link MatchingAnchor}.
|
|
42
|
+
*
|
|
21
43
|
* @group Types
|
|
22
44
|
*/
|
|
23
45
|
export class MatchingModel {
|
|
46
|
+
/**
|
|
47
|
+
* @param actual The model that was matched.
|
|
48
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
49
|
+
*/
|
|
24
50
|
constructor(actual, schemaTranslator) {
|
|
25
51
|
this.actual = actual;
|
|
26
52
|
this.schemaTranslator = schemaTranslator;
|
|
27
53
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
54
|
+
/**
|
|
55
|
+
* The model itself, with its schema hidden - read it through
|
|
56
|
+
* {@link MatchingModel.getSchemaInstance}.
|
|
57
|
+
*/
|
|
31
58
|
getActual() {
|
|
32
59
|
return this.actual;
|
|
33
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The model read as the schema you matched on.
|
|
63
|
+
*/
|
|
34
64
|
getSchemaInstance() {
|
|
35
65
|
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
36
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether the match went through a schema translation.
|
|
69
|
+
*/
|
|
70
|
+
hasSchemaTranslator() {
|
|
71
|
+
return !!this.schemaTranslator;
|
|
72
|
+
}
|
|
37
73
|
}
|
|
38
74
|
/**
|
|
75
|
+
* A resource found by schema. See {@link MatchingAnchor}.
|
|
76
|
+
*
|
|
77
|
+
* Pass one wherever a resource parent is expected, and the translation is carried into the graph, so
|
|
78
|
+
* the child keeps reading its parent through the schema it was written against.
|
|
79
|
+
*
|
|
39
80
|
* @group Types
|
|
40
81
|
*/
|
|
41
82
|
export class MatchingResource {
|
|
83
|
+
/**
|
|
84
|
+
* @param actual The resource that was matched.
|
|
85
|
+
* @param schemaTranslator Reads `actual` as the matched schema, when the two differ.
|
|
86
|
+
*/
|
|
42
87
|
constructor(actual, schemaTranslator) {
|
|
43
88
|
this.actual = actual;
|
|
44
89
|
this.schemaTranslator = schemaTranslator;
|
|
45
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
46
94
|
addChild(...args) {
|
|
47
95
|
const results = this.actual.addChild(...args);
|
|
48
96
|
if (!(args[1].parents[args[1].parents.length - 1] instanceof MatchingResource) &&
|
|
@@ -52,18 +100,32 @@ export class MatchingResource {
|
|
|
52
100
|
}
|
|
53
101
|
return results;
|
|
54
102
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
103
|
+
/**
|
|
104
|
+
* The resource itself, with its schema hidden - read it through
|
|
105
|
+
* {@link MatchingResource.getSchemaInstance}.
|
|
106
|
+
*/
|
|
58
107
|
getActual() {
|
|
59
108
|
return this.actual;
|
|
60
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* The resource read as the schema you matched on.
|
|
112
|
+
*/
|
|
61
113
|
getSchemaInstance() {
|
|
62
114
|
return this.hasSchemaTranslator() ? this.schemaTranslator(this.actual.synth()) : this.actual.synth();
|
|
63
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* The resource read as the schema you matched on, with its `response` typed as fully populated.
|
|
118
|
+
* Only call it from a resource action, where the parent is guaranteed to already exist.
|
|
119
|
+
*/
|
|
64
120
|
getSchemaInstanceInResourceAction() {
|
|
65
121
|
return this.getSchemaInstance();
|
|
66
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Whether the match went through a schema translation.
|
|
125
|
+
*/
|
|
126
|
+
hasSchemaTranslator() {
|
|
127
|
+
return !!this.schemaTranslator;
|
|
128
|
+
}
|
|
67
129
|
}
|
|
68
130
|
/* Enumerations */
|
|
69
131
|
/**
|
|
@@ -91,12 +153,21 @@ export var ValidationType;
|
|
|
91
153
|
})(ValidationType || (ValidationType = {}));
|
|
92
154
|
/* Functions */
|
|
93
155
|
/**
|
|
156
|
+
* Whether a node was registered under the given name, e.g. `region`.
|
|
157
|
+
*
|
|
158
|
+
* Use it to identify a base model without importing the subclass that implements it.
|
|
159
|
+
*
|
|
94
160
|
* @group Types
|
|
95
161
|
*/
|
|
96
162
|
export function hasNodeName(node, nodeName) {
|
|
97
163
|
return node.constructor.NODE_NAME === nodeName;
|
|
98
164
|
}
|
|
99
165
|
/**
|
|
166
|
+
* Marks a placeholder value that a later step fills in - typically a resource property whose real
|
|
167
|
+
* value is only known once the infrastructure exists.
|
|
168
|
+
*
|
|
169
|
+
* It is a type assertion and nothing more; it emits the string you give it.
|
|
170
|
+
*
|
|
100
171
|
* @group Types
|
|
101
172
|
*/
|
|
102
173
|
export function stub(value) {
|
package/dist/app.type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.type.js","sourceRoot":"","sources":["../src/app.type.ts"],"names":[],"mappings":"AAeA,aAAa;AAEb
|
|
1
|
+
{"version":3,"file":"app.type.js","sourceRoot":"","sources":["../src/app.type.ts"],"names":[],"mappings":"AAeA,aAAa;AAEb;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAc;IACzB;;;OAGG;IACH,YACmB,MAAuB,EACvB,gBAAoC;QADpC,WAAM,GAAN,MAAM,CAAiB;QACvB,qBAAgB,GAA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ED;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,sCAAoB,CAAA;IACpB,0CAAwB,CAAA;IACxB,4CAA0B,CAAA;IAC1B,wCAAsB,CAAA;IACtB,0CAAwB,CAAA;IACxB,0CAAwB,CAAA;IACxB,iCAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AAgBD,eAAe;AAEf;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAiB,EAAE,QAAgB;IAC7D,OAAQ,IAAI,CAAC,WAA4B,CAAC,SAAS,KAAK,QAAQ,CAAC;AACnE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAI,KAAa;IACnC,OAAO,KAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { Constructable, UnknownNode } from '../app.type.js';
|
|
2
2
|
/**
|
|
3
|
-
* An `@Action` is a class decorator to be placed on top of a class that
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* An `@Action` is a class decorator to be placed on top of a class that reacts to a change in the node it is
|
|
4
|
+
* declared for. Octo diffs your infrastructure on every run, and invokes the actions whose node changed.
|
|
5
|
+
*
|
|
6
|
+
* The interface the action implements is determined by the node it is declared for.
|
|
7
|
+
* - An action for a model or an overlay implements {@link IModelAction}, and produces resources.
|
|
8
|
+
* - An action for a resource implements {@link IResourceAction}, and talks to the cloud provider.
|
|
9
|
+
*
|
|
10
|
+
* The decorated class is resolved through the {@link Container}, so it must have a registered {@link Factory}.
|
|
7
11
|
*
|
|
8
12
|
* @example
|
|
9
13
|
* ```ts
|
|
10
|
-
* @Action(
|
|
11
|
-
* export class
|
|
14
|
+
* @Action(MyModel)
|
|
15
|
+
* export class AddMyModelAction implements IModelAction<MyModule> { ... }
|
|
12
16
|
* ```
|
|
13
17
|
* @group Decorators
|
|
14
18
|
* @param forNode The class of node for which this action is being declared.
|
|
@@ -5,25 +5,38 @@ import { AModel } from '../models/model.abstract.js';
|
|
|
5
5
|
import { AOverlay } from '../overlays/overlay.abstract.js';
|
|
6
6
|
import { AResource } from '../resources/resource.abstract.js';
|
|
7
7
|
import { TransactionService } from '../services/transaction/transaction.service.js';
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
8
11
|
function isModel(nodeClass) {
|
|
9
12
|
return nodeClass.prototype instanceof AModel;
|
|
10
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
11
17
|
function isOverlay(nodeClass) {
|
|
12
18
|
return nodeClass.prototype instanceof AOverlay;
|
|
13
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
14
23
|
function isResource(nodeClass) {
|
|
15
24
|
return nodeClass.prototype instanceof AResource;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
|
-
* An `@Action` is a class decorator to be placed on top of a class that
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
27
|
+
* An `@Action` is a class decorator to be placed on top of a class that reacts to a change in the node it is
|
|
28
|
+
* declared for. Octo diffs your infrastructure on every run, and invokes the actions whose node changed.
|
|
29
|
+
*
|
|
30
|
+
* The interface the action implements is determined by the node it is declared for.
|
|
31
|
+
* - An action for a model or an overlay implements {@link IModelAction}, and produces resources.
|
|
32
|
+
* - An action for a resource implements {@link IResourceAction}, and talks to the cloud provider.
|
|
33
|
+
*
|
|
34
|
+
* The decorated class is resolved through the {@link Container}, so it must have a registered {@link Factory}.
|
|
22
35
|
*
|
|
23
36
|
* @example
|
|
24
37
|
* ```ts
|
|
25
|
-
* @Action(
|
|
26
|
-
* export class
|
|
38
|
+
* @Action(MyModel)
|
|
39
|
+
* export class AddMyModelAction implements IModelAction<MyModule> { ... }
|
|
27
40
|
* ```
|
|
28
41
|
* @group Decorators
|
|
29
42
|
* @param forNode The class of node for which this action is being declared.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.decorator.js","sourceRoot":"","sources":["../../src/decorators/action.decorator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,SAAS,OAAO,CAAC,SAAqC;IACpD,OAAO,SAAS,CAAC,SAAS,YAAY,MAAM,CAAC;AAC/C,CAAC;AAED,SAAS,SAAS,CAAC,SAAqC;IACtD,OAAO,SAAS,CAAC,SAAS,YAAY,QAAQ,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,SAAqC;IACvD,OAAO,SAAS,CAAC,SAAS,YAAY,SAAS,CAAC;AAClD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"action.decorator.js","sourceRoot":"","sources":["../../src/decorators/action.decorator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF;;GAEG;AACH,SAAS,OAAO,CAAC,SA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AAM,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"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An `@Anchor` is a class decorator
|
|
3
|
-
* - An anchor must extend the {@link AAnchor} class.
|
|
2
|
+
* An `@Anchor` is a class decorator and must be placed on top of a class representing an anchor.
|
|
3
|
+
* - An anchor must also extend the {@link AAnchor} class.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
|
-
* @Anchor('
|
|
8
|
-
* export class MyAnchor extends AAnchor { ... }
|
|
7
|
+
* @Anchor('@example')
|
|
8
|
+
* export class MyAnchor extends AAnchor<MyAnchorSchema, MyModel> { ... }
|
|
9
9
|
* ```
|
|
10
|
+
*
|
|
10
11
|
* @group Decorators
|
|
12
|
+
*
|
|
13
|
+
* @param packageName - The name of the package under which the anchor is registered.
|
|
14
|
+
* Selecting a unique package name helps avoid collisions between same anchor class names across different libraries.
|
|
15
|
+
* You will reuse the same package name throughout your library for different Octo components you create.
|
|
16
|
+
*
|
|
11
17
|
* @returns The decorated class.
|
|
12
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* @see Definition of [Anchors](/docs/fundamentals/anchors).
|
|
13
20
|
*/
|
|
14
21
|
export declare function Anchor(packageName: string): (constructor: any) => void;
|
|
@@ -3,17 +3,24 @@ import { AAnchor } from '../overlays/anchor.abstract.js';
|
|
|
3
3
|
import { ModelSerializationService } from '../services/serialization/model/model-serialization.service.js';
|
|
4
4
|
import { ValidationUtility } from '../utilities/validation/validation.utility.js';
|
|
5
5
|
/**
|
|
6
|
-
* An `@Anchor` is a class decorator
|
|
7
|
-
* - An anchor must extend the {@link AAnchor} class.
|
|
6
|
+
* An `@Anchor` is a class decorator and must be placed on top of a class representing an anchor.
|
|
7
|
+
* - An anchor must also extend the {@link AAnchor} class.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* @Anchor('
|
|
12
|
-
* export class MyAnchor extends AAnchor { ... }
|
|
11
|
+
* @Anchor('@example')
|
|
12
|
+
* export class MyAnchor extends AAnchor<MyAnchorSchema, MyModel> { ... }
|
|
13
13
|
* ```
|
|
14
|
+
*
|
|
14
15
|
* @group Decorators
|
|
16
|
+
*
|
|
17
|
+
* @param packageName - The name of the package under which the anchor is registered.
|
|
18
|
+
* Selecting a unique package name helps avoid collisions between same anchor class names across different libraries.
|
|
19
|
+
* You will reuse the same package name throughout your library for different Octo components you create.
|
|
20
|
+
*
|
|
15
21
|
* @returns The decorated class.
|
|
16
|
-
*
|
|
22
|
+
*
|
|
23
|
+
* @see Definition of [Anchors](/docs/fundamentals/anchors).
|
|
17
24
|
*/
|
|
18
25
|
export function Anchor(packageName) {
|
|
19
26
|
const container = Container.getInstance();
|
|
@@ -1 +1 @@
|
|
|
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,gEA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ook';
|
|
|
16
16
|
*
|
|
17
17
|
* @returns The decorated method.
|
|
18
18
|
*
|
|
19
|
-
* @see Definition of [Hooks](/docs/
|
|
19
|
+
* @see Definition of [Hooks](/docs/techniques/hooks).
|
|
20
20
|
*/
|
|
21
21
|
export declare function EnableHook(hook: Hook): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
22
22
|
export {};
|