@quadnix/octo 0.0.30 → 0.2.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 +117 -8
- package/dist/app.type.d.ts +277 -19
- 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 +4 -6
- package/dist/decorators/model.decorator.js +2 -7
- package/dist/decorators/model.decorator.js.map +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 +7 -2
- package/dist/decorators/on-event.decorator.js +5 -0
- package/dist/decorators/on-event.decorator.js.map +1 -1
- package/dist/decorators/resource.decorator.d.ts +50 -1
- package/dist/decorators/resource.decorator.js +38 -1
- package/dist/decorators/resource.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 +14 -1
- package/dist/errors/schema.error.js +11 -1
- package/dist/errors/schema.error.js.map +1 -1
- package/dist/errors/terraform.error.d.ts +20 -0
- package/dist/errors/terraform.error.js +24 -0
- package/dist/errors/terraform.error.js.map +1 -0
- package/dist/errors/transaction.error.d.ts +93 -2
- package/dist/errors/transaction.error.js +83 -0
- package/dist/errors/transaction.error.js.map +1 -1
- package/dist/events/action.event.d.ts +8 -4
- package/dist/events/action.event.js +2 -4
- package/dist/events/action.event.js.map +1 -1
- package/dist/events/command.event.d.ts +43 -0
- package/dist/events/command.event.js +33 -0
- package/dist/events/command.event.js.map +1 -0
- package/dist/events/event.model.d.ts +26 -8
- package/dist/events/event.model.js +15 -7
- package/dist/events/event.model.js.map +1 -1
- package/dist/events/hook/commit.hook.event.d.ts +1 -7
- 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 +1 -3
- 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 +1 -7
- 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 +1 -7
- 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 +5 -0
- package/dist/events/index.js +5 -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 +61 -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 +7 -5
- package/dist/events/module.event.js +3 -4
- package/dist/events/module.event.js.map +1 -1
- package/dist/events/registration.event.d.ts +19 -15
- package/dist/events/registration.event.js +18 -14
- package/dist/events/registration.event.js.map +1 -1
- package/dist/events/serialization.event.d.ts +16 -13
- package/dist/events/serialization.event.js +15 -12
- package/dist/events/serialization.event.js.map +1 -1
- package/dist/events/state.event.d.ts +102 -0
- package/dist/events/state.event.js +69 -0
- package/dist/events/state.event.js.map +1 -0
- package/dist/events/terraform.event.d.ts +78 -0
- package/dist/events/terraform.event.js +55 -0
- package/dist/events/terraform.event.js.map +1 -0
- package/dist/events/transaction.event.d.ts +3 -40
- package/dist/events/transaction.event.js +1 -29
- package/dist/events/transaction.event.js.map +1 -1
- package/dist/functions/container/container.d.ts +54 -13
- package/dist/functions/container/container.js +64 -19
- 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 +84 -23
- package/dist/functions/dependency/dependency.js +84 -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 +68 -7
- package/dist/functions/diff/diff.js +44 -3
- package/dist/functions/diff/diff.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 -2
- package/dist/functions/node/node-action.abstract.js +22 -8
- 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 +106 -22
- package/dist/functions/node/node.abstract.js.map +1 -1
- package/dist/functions/node/node.interface.d.ts +3 -1
- package/dist/functions/schema/schema.d.ts +7 -0
- package/dist/functions/schema/schema.js +10 -1
- package/dist/functions/schema/schema.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.type.d.ts +5 -0
- package/dist/index.type.js +2 -0
- package/dist/index.type.js.map +1 -0
- package/dist/main.d.ts +245 -14
- package/dist/main.js +377 -72
- package/dist/main.js.map +1 -1
- package/dist/models/account/account.model.d.ts +43 -7
- package/dist/models/account/account.model.js +56 -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 +13 -8
- package/dist/models/app/app.model.js +17 -32
- 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 +6 -0
- package/dist/models/deployment/deployment.schema.js +6 -0
- package/dist/models/deployment/deployment.schema.js.map +1 -1
- package/dist/models/environment/environment.model.d.ts +15 -3
- package/dist/models/environment/environment.model.js +22 -10
- 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 +21 -3
- package/dist/models/execution/execution.model.js +47 -29
- 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 +19 -5
- package/dist/models/image/image.model.js +25 -11
- 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 +107 -8
- 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 +14 -2
- package/dist/models/pipeline/pipeline.model.js +19 -7
- 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 +15 -3
- package/dist/models/server/server.model.js +18 -6
- 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 +37 -6
- package/dist/models/service/service.model.js +65 -11
- package/dist/models/service/service.model.js.map +1 -1
- package/dist/models/service/service.schema.d.ts +48 -1
- package/dist/models/service/service.schema.js +56 -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 +30 -0
- package/dist/modes/generate.mode.js +50 -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 +186 -0
- package/dist/modes/validate.mode.js +558 -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 +43 -1
- package/dist/modules/module.container.js +77 -5
- 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 +383 -199
- 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 +29 -3
- 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 +163 -6
- package/dist/resources/resource.abstract.js +223 -59
- package/dist/resources/resource.abstract.js.map +1 -1
- package/dist/resources/resource.interface.d.ts +0 -2
- package/dist/resources/resource.schema.d.ts +39 -1
- package/dist/resources/resource.schema.js +38 -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 +32 -5
- 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 +82 -5
- package/dist/services/input/input.service.js +143 -12
- 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 +25 -3
- package/dist/services/serialization/model/model-serialization.service.js +113 -62
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.d.ts +36 -6
- package/dist/services/serialization/resource/resource-serialization.service.js +77 -28
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/state-management/local.state-provider.d.ts +67 -4
- package/dist/services/state-management/local.state-provider.js +168 -41
- package/dist/services/state-management/local.state-provider.js.map +1 -1
- package/dist/services/state-management/remote.state-provider.d.ts +216 -0
- package/dist/services/state-management/remote.state-provider.js +645 -0
- package/dist/services/state-management/remote.state-provider.js.map +1 -0
- package/dist/services/state-management/state-management.service.d.ts +195 -17
- package/dist/services/state-management/state-management.service.js +259 -10
- package/dist/services/state-management/state-management.service.js.map +1 -1
- package/dist/services/state-management/state-provider.interface.d.ts +98 -3
- package/dist/services/state-management/state-provider.interface.js +14 -1
- package/dist/services/state-management/state-provider.interface.js.map +1 -1
- package/dist/services/state-management/terraform-state.service.d.ts +99 -0
- package/dist/services/state-management/terraform-state.service.js +197 -0
- package/dist/services/state-management/terraform-state.service.js.map +1 -0
- package/dist/services/state-management/test.state-provider.d.ts +42 -4
- package/dist/services/state-management/test.state-provider.js +77 -25
- package/dist/services/state-management/test.state-provider.js.map +1 -1
- package/dist/services/terraform/terraform.service.d.ts +480 -0
- package/dist/services/terraform/terraform.service.js +1082 -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 +110 -10
- package/dist/services/transaction/transaction.service.js +570 -251
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/dist/services/validation/validation.service.d.ts +15 -3
- 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/{functions → utilities}/diff/diff.utility.d.ts +19 -3
- package/dist/{functions → utilities}/diff/diff.utility.js +57 -41
- package/dist/utilities/diff/diff.utility.js.map +1 -0
- package/dist/utilities/file/file.utility.d.ts +16 -2
- package/dist/utilities/file/file.utility.js +23 -61
- package/dist/utilities/file/file.utility.js.map +1 -1
- package/dist/utilities/hcl/hcl.utility.d.ts +128 -0
- package/dist/utilities/hcl/hcl.utility.js +402 -0
- package/dist/utilities/hcl/hcl.utility.js.map +1 -0
- package/dist/utilities/http/http.utility.d.ts +57 -0
- package/dist/utilities/http/http.utility.js +98 -0
- package/dist/utilities/http/http.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 +41 -0
- package/dist/utilities/string/string.utility.js +65 -0
- package/dist/utilities/string/string.utility.js.map +1 -0
- package/dist/utilities/terraform/terraform.utility.d.ts +276 -0
- package/dist/utilities/terraform/terraform.utility.js +623 -0
- package/dist/utilities/terraform/terraform.utility.js.map +1 -0
- package/dist/utilities/test-helpers/test-classes.d.ts +36 -30
- package/dist/utilities/test-helpers/test-classes.js +38 -39
- package/dist/utilities/test-helpers/test-classes.js.map +1 -1
- package/dist/utilities/test-helpers/test-models.d.ts +8 -1
- package/dist/utilities/test-helpers/test-models.js +37 -12
- 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 +486 -0
- package/dist/utilities/test-helpers/test-modes.js.map +1 -0
- package/dist/utilities/test-helpers/test-modules.d.ts +47 -0
- package/dist/utilities/test-helpers/test-modules.js +85 -0
- package/dist/utilities/test-helpers/test-modules.js.map +1 -0
- package/dist/utilities/test-helpers/test-overlays.d.ts +20 -2
- package/dist/utilities/test-helpers/test-overlays.js +56 -6
- package/dist/utilities/test-helpers/test-overlays.js.map +1 -1
- package/dist/utilities/test-helpers/test-resources.d.ts +23 -3
- package/dist/utilities/test-helpers/test-resources.js +83 -23
- 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 +12 -6
- package/dist/functions/diff/diff.utility.js.map +0 -1
- 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/services/state-management/local-encryption.state-provider.d.ts +0 -20
- package/dist/services/state-management/local-encryption.state-provider.js +0 -90
- package/dist/services/state-management/local-encryption.state-provider.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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { ModelSerializedOutput, ResourceSerializedOutput } from './app.type.js';
|
|
2
|
+
export type { IDependency } from './functions/dependency/dependency.js';
|
|
3
|
+
export type { DiffAction } from './functions/diff/diff.js';
|
|
4
|
+
export type { ServiceType } from './models/service/service.schema.js';
|
|
5
|
+
export type { ExternalResourceStateFile, ModelStateFile, ResourceStateFile, } from './services/state-management/state-management.service.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.type.js","sourceRoot":"","sources":["../src/index.type.ts"],"names":[],"mappings":""}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,47 +1,192 @@
|
|
|
1
|
-
import type { Constructable, ModuleSchemaInputs,
|
|
1
|
+
import type { Constructable, ModuleSchemaInputs, UnknownModule, UnknownResource } from './app.type.js';
|
|
2
2
|
import { Container } from './functions/container/container.js';
|
|
3
3
|
import { App } from './models/app/app.model.js';
|
|
4
|
+
import { type ModelTransactionResult } from './modes/apply-transaction.js';
|
|
5
|
+
import { type TerraformOutputs, commit as runCommit } from './modes/commit.mode.js';
|
|
6
|
+
import { generate as runGenerate } from './modes/generate.mode.js';
|
|
7
|
+
import { runAction as runRunAction } from './modes/run-action.mode.js';
|
|
8
|
+
import { type TerraformPlan, validate as runValidate } from './modes/validate.mode.js';
|
|
4
9
|
import { ModuleContainer } from './modules/module.container.js';
|
|
5
|
-
import { BaseResourceSchema } from './resources/resource.schema.js';
|
|
6
10
|
import { InputService } from './services/input/input.service.js';
|
|
7
11
|
import { SchemaTranslationService } from './services/schema-translation/schema-translation.service.js';
|
|
8
12
|
import type { IStateProvider } from './services/state-management/state-provider.interface.js';
|
|
9
|
-
import {
|
|
13
|
+
import { TerraformService } from './services/terraform/terraform.service.js';
|
|
10
14
|
/**
|
|
15
|
+
* The entry point to Octo.
|
|
16
|
+
*
|
|
17
|
+
* You describe infrastructure by loading modules, and Octo turns that description into terraform,
|
|
18
|
+
* checks what terraform intends to do, and records what it did. That is the lifecycle, and it is
|
|
19
|
+
* always these four steps:
|
|
20
|
+
*
|
|
21
|
+
* 1. {@link Octo.generate} - write the terraform module folders for the infrastructure you described.
|
|
22
|
+
* 2. {@link Octo.validate} - correlate terraform's plans with your intent, and report the difference.
|
|
23
|
+
* 3. `terraform apply` - see {@link TerraformUtility}. Octo does not do this for you.
|
|
24
|
+
* 4. {@link Octo.commit} - record the applied result back into Octo's state.
|
|
25
|
+
*
|
|
26
|
+
* Splitting them is deliberate: nothing is applied until you have seen a report of what would change,
|
|
27
|
+
* and each step is a separate process, so a CI pipeline can gate between them.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const octo = new Octo();
|
|
32
|
+
* await octo.initialize(new LocalStateProvider('./infrastructure'));
|
|
33
|
+
*
|
|
34
|
+
* octo.registerTerraformConfig({ providers: { aws: { source: 'hashicorp/aws' } } });
|
|
35
|
+
* octo.registerTerraformProvider('aws', '1234567890', 'us-east-1');
|
|
36
|
+
*
|
|
37
|
+
* octo.loadModule(SimpleAppModule, 'app-module', { name: 'my-app' });
|
|
38
|
+
* await octo.compose();
|
|
39
|
+
*
|
|
40
|
+
* await octo.generate(octo.getRootModel(), { outputDir: './infrastructure/terraform' });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
11
43
|
* @group Main
|
|
44
|
+
*
|
|
45
|
+
* @see Definition of [Modules](/docs/fundamentals/modules).
|
|
12
46
|
*/
|
|
13
47
|
export declare class Octo {
|
|
14
|
-
private
|
|
15
|
-
private readonly actualResourceStateFileName;
|
|
16
|
-
private readonly oldResourceStateFileName;
|
|
17
|
-
private captureService;
|
|
48
|
+
private eventService;
|
|
18
49
|
private inputService;
|
|
19
50
|
private modelSerializationService;
|
|
20
51
|
private moduleContainer;
|
|
21
52
|
private resourceSerializationService;
|
|
22
53
|
private schemaTranslationService;
|
|
23
54
|
private stateManagementService;
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
55
|
+
private terraformService;
|
|
56
|
+
/**
|
|
57
|
+
* The last step of the lifecycle - records the result of a `terraform apply` back into Octo's state.
|
|
58
|
+
*
|
|
59
|
+
* A terraform apply reports what it created, and part of that is what each octo resource's
|
|
60
|
+
* `response` is made of - ARNs, generated IDs, endpoints. Without this step the next run has no
|
|
61
|
+
* idea any of it exists.
|
|
62
|
+
*
|
|
63
|
+
* **All-or-nothing**: if an expected output is missing, this throws before touching state, so a
|
|
64
|
+
* partial apply never leaves a half-written record behind. Pass `partial` after an apply that
|
|
65
|
+
* failed and the missing outputs become warnings instead, with every resource they belong to left
|
|
66
|
+
* out of the committed graph. Outputs for a folder Octo does not track are ignored, and returned
|
|
67
|
+
* as warnings for you to surface.
|
|
68
|
+
*
|
|
69
|
+
* **Requires the lock**, and does not release it. Taking and releasing the lock belongs to whoever
|
|
70
|
+
* drives the lifecycle - the CLI's `octo commit` releases it once this returns, and keeps it when this
|
|
71
|
+
* throws.
|
|
72
|
+
*
|
|
73
|
+
* @param app The root model, from {@link Octo.getRootModel}.
|
|
74
|
+
* @param options `lockId` is the lock from `octo lock`. `outputs` is
|
|
75
|
+
* `TerraformUtility.output(dir, { json: true })` in full. `partial` records what a failed apply
|
|
76
|
+
* did build.
|
|
77
|
+
* @param transaction The model transaction result.
|
|
78
|
+
* @throws {@link TransactionError} When the app is not locked, or `lockId` is not the lock held.
|
|
79
|
+
*/
|
|
80
|
+
commit(app: App, options: {
|
|
81
|
+
lockId: string;
|
|
82
|
+
outputs: Map<string, TerraformOutputs>;
|
|
83
|
+
partial?: boolean;
|
|
84
|
+
}, transaction?: ModelTransactionResult): Promise<Pick<Awaited<ReturnType<typeof runCommit>>, 'warnings'>>;
|
|
85
|
+
/**
|
|
86
|
+
* Runs every loaded module, in the order {@link Octo.orderModules} set, building the model graph.
|
|
87
|
+
* Call it once, after loading modules and before any lifecycle step.
|
|
88
|
+
*
|
|
89
|
+
* @returns Every model and overlay the modules created, keyed by a unique ID.
|
|
90
|
+
*/
|
|
29
91
|
compose(): Promise<{
|
|
30
92
|
[key: string]: unknown;
|
|
31
93
|
}>;
|
|
94
|
+
/**
|
|
95
|
+
* The first step of the lifecycle - writes the terragrunt module folders for the infrastructure you
|
|
96
|
+
* described, one folder per module, and saves the model state.
|
|
97
|
+
*
|
|
98
|
+
* A new module gets a new folder, and a changed module is rewritten in the folder it already has.
|
|
99
|
+
* A module you *removed* is not deleted: its folder is **emptied**, keeping only the provider
|
|
100
|
+
* blocks, so the next terraform apply destroys the live infrastructure rather than orphaning it.
|
|
101
|
+
* Octo never deletes a folder.
|
|
102
|
+
*
|
|
103
|
+
* @param app The root model, from {@link Octo.getRootModel}.
|
|
104
|
+
* @param options `outputDir` is where the module folders are written.
|
|
105
|
+
* @param transaction The model transaction result.
|
|
106
|
+
*/
|
|
107
|
+
generate(app: App, options: {
|
|
108
|
+
outputDir: string;
|
|
109
|
+
}, transaction?: ModelTransactionResult): ReturnType<typeof runGenerate>;
|
|
110
|
+
/**
|
|
111
|
+
* To fetch a loaded module by its module ID.
|
|
112
|
+
*
|
|
113
|
+
* @returns The module, or `undefined` if no module was loaded under that ID.
|
|
114
|
+
*/
|
|
32
115
|
getModule<M extends UnknownModule>(...args: Parameters<InputService['getModule']>): M | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* To fetch the resources a module produced, by its module ID.
|
|
118
|
+
*/
|
|
33
119
|
getModuleResources(...args: Parameters<InputService['getModuleResources']>): UnknownResource[];
|
|
120
|
+
/**
|
|
121
|
+
* The root of the model graph - the one {@link App} the loaded modules produced. Every lifecycle
|
|
122
|
+
* step takes it. Call after {@link Octo.compose}.
|
|
123
|
+
*
|
|
124
|
+
* @throws If no app model, or more than one distinct app model, was registered.
|
|
125
|
+
*/
|
|
126
|
+
getRootModel(): App;
|
|
127
|
+
/**
|
|
128
|
+
* Boots Octo. Call it once, before anything else.
|
|
129
|
+
*
|
|
130
|
+
* The two optional arguments are how you replace Octo's internals with your own: exclusions run
|
|
131
|
+
* first, so you can unregister a built-in {@link Factory} and then resolve yours in its place.
|
|
132
|
+
*
|
|
133
|
+
* @param stateProvider Where Octo reads and writes its state. See {@link IStateProvider}.
|
|
134
|
+
* @param initializeInContainer Factories to resolve at boot - event listeners, most commonly.
|
|
135
|
+
* @param excludeInContainer Factories to unregister at boot.
|
|
136
|
+
*/
|
|
34
137
|
initialize(stateProvider: IStateProvider, initializeInContainer?: {
|
|
35
|
-
type: Parameters<Container['get']>[0];
|
|
36
138
|
options?: Parameters<Container['get']>[1];
|
|
139
|
+
type: Parameters<Container['get']>[0];
|
|
37
140
|
}[], excludeInContainer?: {
|
|
38
141
|
type: Parameters<Container['unRegisterFactory']>[0];
|
|
39
142
|
}[]): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* To load a module, which {@link Octo.compose} will then run.
|
|
145
|
+
*
|
|
146
|
+
* The same module class can be loaded more than once under different module IDs, and the ID scopes
|
|
147
|
+
* everything that instance produces.
|
|
148
|
+
*
|
|
149
|
+
* @param module The module class, or its registered name.
|
|
150
|
+
* @param moduleId A unique ID for this instance of the module.
|
|
151
|
+
* @param inputs The inputs, matching the module's schema.
|
|
152
|
+
*/
|
|
40
153
|
loadModule<M extends UnknownModule>(module: Constructable<M> | string, moduleId: string, inputs: ModuleSchemaInputs<M>): void;
|
|
154
|
+
/**
|
|
155
|
+
* To set the order {@link Octo.compose} runs modules in, by listing their classes.
|
|
156
|
+
*
|
|
157
|
+
* Order matters because a module resolves what earlier modules produced - a subnet module must run
|
|
158
|
+
* after the region module whose region it attaches to.
|
|
159
|
+
*/
|
|
41
160
|
orderModules(...args: Parameters<ModuleContainer['order']>): ReturnType<ModuleContainer['order']>;
|
|
42
|
-
|
|
161
|
+
/**
|
|
162
|
+
* To register callbacks that run at fixed points of the lifecycle. Use them to inject behavior -
|
|
163
|
+
* an audit trail, an approval gate - without modifying the framework.
|
|
164
|
+
*
|
|
165
|
+
* The hook points, each with its own signature:
|
|
166
|
+
* - `PreCommitHook` / `PostCommitHook` - around the commit.
|
|
167
|
+
* - `PreModelActionHook` / `PostModelActionHook` - around every model action.
|
|
168
|
+
* - `PreResourceActionHook` / `PostResourceActionHook` - around every resource action.
|
|
169
|
+
*
|
|
170
|
+
* @see Techniques for [Hooks](/docs/techniques/hooks).
|
|
171
|
+
*/
|
|
43
172
|
registerHooks(...args: Parameters<ModuleContainer['registerHooks']>): ReturnType<ModuleContainer['registerHooks']>;
|
|
173
|
+
/**
|
|
174
|
+
* To teach Octo how to read one schema as another.
|
|
175
|
+
*
|
|
176
|
+
* Modules find each other by schema, so a module that changes its schema breaks its consumers.
|
|
177
|
+
* A translation is the escape hatch: register the schema you have, the schema your module expects,
|
|
178
|
+
* and a function between them, and the lookup keeps working while you migrate.
|
|
179
|
+
*
|
|
180
|
+
* @see Techniques for [Schema](/docs/techniques/schema).
|
|
181
|
+
*/
|
|
44
182
|
registerSchemaTranslation(...args: Parameters<SchemaTranslationService['registerSchemaTranslation']>): ReturnType<SchemaTranslationService['registerSchemaTranslation']>;
|
|
183
|
+
/**
|
|
184
|
+
* To apply tags to resources in bulk, so that individual modules do not each have to be told about
|
|
185
|
+
* your organization's tagging policy.
|
|
186
|
+
*
|
|
187
|
+
* Each entry's `scope` decides its reach: empty tags every resource of the app, `moduleId` tags
|
|
188
|
+
* every resource of one module, and `resourceContext` tags a single resource.
|
|
189
|
+
*/
|
|
45
190
|
registerTags(args: {
|
|
46
191
|
scope: {
|
|
47
192
|
moduleId?: string;
|
|
@@ -51,7 +196,93 @@ export declare class Octo {
|
|
|
51
196
|
[key: string]: string;
|
|
52
197
|
};
|
|
53
198
|
}[]): void;
|
|
199
|
+
/**
|
|
200
|
+
* To set the minimum terraform version, and the `required_providers` block rendered into every
|
|
201
|
+
* generated module folder.
|
|
202
|
+
*
|
|
203
|
+
* Call it after {@link Octo.initialize}, and before {@link Octo.generate}.
|
|
204
|
+
*/
|
|
205
|
+
registerTerraformConfig(...args: Parameters<TerraformService['addTerraformConfig']>): ReturnType<TerraformService['addTerraformConfig']>;
|
|
206
|
+
/**
|
|
207
|
+
* To register a terraform provider for one deployment target - a provider type, an account, and a
|
|
208
|
+
* region.
|
|
209
|
+
*
|
|
210
|
+
* Resources bind to a provider by `{ accountId, regionId }` alone, so this is the one place a
|
|
211
|
+
* provider type is named. Register one per account/region combination you deploy into.
|
|
212
|
+
*
|
|
213
|
+
* Call it after {@link Octo.initialize}, and before {@link Octo.generate}.
|
|
214
|
+
*/
|
|
215
|
+
registerTerraformProvider(...args: Parameters<TerraformService['addTerraformProvider']>): ReturnType<TerraformService['addTerraformProvider']>;
|
|
216
|
+
/**
|
|
217
|
+
* Runs one resource action for an external resource.
|
|
218
|
+
*
|
|
219
|
+
* Terraform calls back into this mid-apply, through the generated CLI command; it is not a step you
|
|
220
|
+
* run yourself.
|
|
221
|
+
*
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
runAction(app: App, options: {
|
|
225
|
+
inputs?: Record<string, unknown>;
|
|
226
|
+
resourceId: string;
|
|
227
|
+
}): ReturnType<typeof runRunAction>;
|
|
228
|
+
/**
|
|
229
|
+
* The second step of the lifecycle - correlates terraform's plans with your intent, and reports
|
|
230
|
+
* what it finds. This is what you read before deciding whether to apply.
|
|
231
|
+
*
|
|
232
|
+
* The report answers two questions separately:
|
|
233
|
+
* 1. **What will change, and why.** Including terraform changes Octo did not flag directly but can
|
|
234
|
+
* attribute to something it did - a referenced resource whose identity moved, or an address the
|
|
235
|
+
* resource no longer renders.
|
|
236
|
+
* 2. **What changed that your intent does not explain** - drift, i.e. infrastructure modified
|
|
237
|
+
* outside Octo. Read `confidence` first: drift is only reliable when intent itself is unchanged.
|
|
238
|
+
*
|
|
239
|
+
* The report fails only when terraform could not plan a folder Octo generated. Folders Octo does
|
|
240
|
+
* not track are excluded, and noted. So is every external resource a previous run published and no
|
|
241
|
+
* commit has recorded, which is the only step that reads those records back for a user.
|
|
242
|
+
*
|
|
243
|
+
* @param app The root model, from {@link Octo.getRootModel}.
|
|
244
|
+
* @param plans The whole result of `TerraformUtility.plan(dir, { json: true })`. Its `errors` map
|
|
245
|
+
* carries terraform's own message for each folder that failed to plan.
|
|
246
|
+
* @param transaction The model transaction result.
|
|
247
|
+
*/
|
|
248
|
+
validate(app: App, plans: {
|
|
249
|
+
errors?: Map<string, string>;
|
|
250
|
+
plans: Map<string, TerraformPlan>;
|
|
251
|
+
}, transaction?: ModelTransactionResult): ReturnType<typeof runValidate>;
|
|
252
|
+
/**
|
|
253
|
+
* This function persists the model and resource state using {@link IStateProvider}.
|
|
254
|
+
* Then immediately fetches the resource state in memory for the next set of operations.
|
|
255
|
+
*
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
private commitTransaction;
|
|
259
|
+
/**
|
|
260
|
+
* This function deserializes the resource state in memory.
|
|
261
|
+
* It deserializes the actual resource state into actual resources,
|
|
262
|
+
* and the last resource state into old resources.
|
|
263
|
+
*
|
|
264
|
+
* @internal
|
|
265
|
+
*/
|
|
54
266
|
private retrieveResourceState;
|
|
267
|
+
/**
|
|
268
|
+
* Wraps a mode to emit its boundary events, and re-throws whatever the mode threw.
|
|
269
|
+
* The finishing events use `emitAndWait`, so a listener that writes a file completes first.
|
|
270
|
+
*
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
private runMode;
|
|
274
|
+
/**
|
|
275
|
+
* This function persists the in-memory model state.
|
|
276
|
+
*
|
|
277
|
+
* @internal
|
|
278
|
+
*/
|
|
55
279
|
private saveModelState;
|
|
280
|
+
/**
|
|
281
|
+
* This function persists the in-memory resource state.
|
|
282
|
+
* The actual resource state is persisted as actual,
|
|
283
|
+
* and the current resource state is persisted as old.
|
|
284
|
+
*
|
|
285
|
+
* @internal
|
|
286
|
+
*/
|
|
56
287
|
private saveResourceState;
|
|
57
288
|
}
|