@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
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { execFile } from 'node:child_process';
|
|
8
|
+
import { mkdtemp, readdir, rm } from 'node:fs/promises';
|
|
9
|
+
import { tmpdir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { Factory } from '../../decorators/factory.decorator.js';
|
|
12
|
+
import { TerraformCommandError } from '../../errors/index.js';
|
|
13
|
+
import { TerraformCommandFinishedEvent, TerraformCommandStartedEvent } from '../../events/index.js';
|
|
14
|
+
import { Container } from '../../functions/container/container.js';
|
|
15
|
+
import { EventService } from '../../services/event/event.service.js';
|
|
16
|
+
import { TerraformStateService } from '../../services/state-management/terraform-state.service.js';
|
|
17
|
+
import { PROJECT_ROOT_VARIABLE_NAME } from '../../services/terraform/terraform.type.js';
|
|
18
|
+
const DEFAULT_TIMEOUT_IN_MS = 60 * 60 * 1000; // 60 minutes.
|
|
19
|
+
/**
|
|
20
|
+
* The commands that change infrastructure, and so are left unbounded unless the caller asks for a
|
|
21
|
+
* bound. Everything else only reads, where a timeout costs nothing and catches a hang.
|
|
22
|
+
*/
|
|
23
|
+
const MUTATING_COMMANDS = new Set(['apply', 'destroy']);
|
|
24
|
+
const MAX_BUFFER = 256 * 1024 * 1024; // 256 KB.
|
|
25
|
+
/**
|
|
26
|
+
* Octo's single interface to the terraform and terragrunt binaries.
|
|
27
|
+
*
|
|
28
|
+
* {@link Octo.generate} writes module folders; this runs them, and turns their output back into the
|
|
29
|
+
* shapes the other modes expect - `plan(dir, { json: true })` feeds {@link Octo.validate}, and
|
|
30
|
+
* `output(dir, { json: true })` feeds {@link Octo.commit}. Routing every invocation through one class
|
|
31
|
+
* is what keeps flags, timeouts, and event emission consistent.
|
|
32
|
+
*
|
|
33
|
+
* Resolve it from the {@link Container} so that a run's terraform events reach the same listeners as
|
|
34
|
+
* everything else.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const terraform = await Container.getInstance().get(TerraformUtility);
|
|
39
|
+
* const { errors, plans } = await terraform.plan('./infrastructure', { json: true });
|
|
40
|
+
* const report = await octo.validate(app, { errors, plans });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @group Utilities/Terraform
|
|
44
|
+
*/
|
|
45
|
+
export class TerraformUtility {
|
|
46
|
+
/**
|
|
47
|
+
* @param options Overrides for the binaries invoked and the per-command timeout. `terragruntBinary`
|
|
48
|
+
* defaults to `terragrunt`.
|
|
49
|
+
*
|
|
50
|
+
* `timeoutInMs` defaults to 60 minutes for the commands that only read - `plan`, `output`, `show`.
|
|
51
|
+
* `apply` and `destroy` run unbounded unless it is given: a timeout there turns a slow apply into
|
|
52
|
+
* one killed part way through a mutation, and how long a stack legitimately takes is a fact about
|
|
53
|
+
* that stack rather than something a default can know. What bounds them instead is the caller -
|
|
54
|
+
* a CI job's own timeout, or a person at a terminal.
|
|
55
|
+
*/
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this.requestedTimeoutInMs = options.timeoutInMs;
|
|
58
|
+
this.options = {
|
|
59
|
+
terraformBinary: options.terraformBinary,
|
|
60
|
+
terragruntBinary: options.terragruntBinary ?? 'terragrunt',
|
|
61
|
+
timeoutInMs: options.timeoutInMs ?? DEFAULT_TIMEOUT_IN_MS,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Runs `terragrunt run-all apply` over every generated module folder.
|
|
66
|
+
*
|
|
67
|
+
* **This changes real infrastructure**, and runs with `-auto-approve`. Use
|
|
68
|
+
* {@link TerraformUtility.findPlannedDestroys} beforehand if a destroy needs confirming.
|
|
69
|
+
*
|
|
70
|
+
* @param onOutput Called with each chunk terragrunt writes, as it writes it. An apply can run for
|
|
71
|
+
* tens of minutes, and the buffered result only arrives at the end - without this the caller has
|
|
72
|
+
* nothing to show for the whole run. The chunks are also still accumulated into the result.
|
|
73
|
+
*/
|
|
74
|
+
async apply(terragruntDir, { onOutput } = {}) {
|
|
75
|
+
return this.runAll(terragruntDir, 'apply', ['-input=false', '-auto-approve', ...this.consumeArgs()], { onOutput });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Runs `terragrunt run-all destroy` over every generated module folder.
|
|
79
|
+
*
|
|
80
|
+
* **This tears down real infrastructure**, and runs with `-auto-approve`.
|
|
81
|
+
*/
|
|
82
|
+
async destroy(terragruntDir) {
|
|
83
|
+
return this.runAll(terragruntDir, 'destroy', ['-input=false', '-auto-approve', ...this.consumeArgs()]);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Every address a set of plans will destroy, across all folders. A recreate (`create` + `delete`)
|
|
87
|
+
* counts, since the old object is still destroyed.
|
|
88
|
+
*
|
|
89
|
+
* Lets a caller refuse to apply until the destroys have been shown, which {@link apply} cannot do on
|
|
90
|
+
* its own because it runs with `-auto-approve`.
|
|
91
|
+
*/
|
|
92
|
+
findPlannedDestroys(plans) {
|
|
93
|
+
const destroys = [];
|
|
94
|
+
for (const [moduleId, plan] of plans.entries()) {
|
|
95
|
+
for (const resourceChange of plan.resource_changes ?? []) {
|
|
96
|
+
const tfActions = resourceChange.change?.actions ?? [];
|
|
97
|
+
if (resourceChange.mode !== 'data' && tfActions.includes('delete')) {
|
|
98
|
+
destroys.push({ address: resourceChange.address, moduleId, tfActions });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return destroys;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns the immediate sub-directories of `terragruntDir` that look like generated module
|
|
106
|
+
* folders (they contain a `terragrunt.hcl`). Each folder name is the octo `moduleId`.
|
|
107
|
+
*/
|
|
108
|
+
async listModuleFolders(terragruntDir) {
|
|
109
|
+
let entries;
|
|
110
|
+
try {
|
|
111
|
+
entries = await readdir(terragruntDir, { withFileTypes: true });
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
// A generate that produced no resources never creates the directory — that is "no module
|
|
115
|
+
// folders", not an error.
|
|
116
|
+
if (error.code === 'ENOENT') {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
const moduleIds = [];
|
|
122
|
+
for (const entry of entries) {
|
|
123
|
+
if (!entry.isDirectory()) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const folderEntries = await readdir(join(terragruntDir, entry.name));
|
|
127
|
+
if (folderEntries.includes('terragrunt.hcl')) {
|
|
128
|
+
moduleIds.push(entry.name);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return moduleIds.sort();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
async output(terragruntDir, options = {}) {
|
|
137
|
+
if (!options.json) {
|
|
138
|
+
return this.runAll(terragruntDir, 'output', this.consumeArgs());
|
|
139
|
+
}
|
|
140
|
+
const composedArgs = this.consumeArgs();
|
|
141
|
+
return this.withTerraformState(terragruntDir, async (moduleIds) => this.emitAround('output', terragruntDir, async () => {
|
|
142
|
+
const outputs = new Map();
|
|
143
|
+
for (const moduleId of moduleIds) {
|
|
144
|
+
const moduleOutputs = await this.readOutputs(join(terragruntDir, moduleId), composedArgs);
|
|
145
|
+
if (moduleOutputs !== undefined) {
|
|
146
|
+
outputs.set(moduleId, moduleOutputs);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return outputs;
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
async plan(terragruntDir, options = {}) {
|
|
156
|
+
if (!options.json) {
|
|
157
|
+
return this.runAll(terragruntDir, 'plan', ['-input=false', ...this.consumeArgs()]);
|
|
158
|
+
}
|
|
159
|
+
const composedArgs = this.consumeArgs();
|
|
160
|
+
return this.withTerraformState(terragruntDir, async (moduleIds) => this.emitAround('plan', terragruntDir, async () => {
|
|
161
|
+
const errors = new Map();
|
|
162
|
+
const plans = new Map();
|
|
163
|
+
for (const moduleId of moduleIds) {
|
|
164
|
+
const result = await this.readPlan(join(terragruntDir, moduleId), composedArgs);
|
|
165
|
+
if ('plan' in result) {
|
|
166
|
+
plans.set(moduleId, result.plan);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
errors.set(moduleId, result.error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return { errors, plans };
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* To append extra CLI arguments to the *next* command only. Returns `this`, so it chains.
|
|
177
|
+
*/
|
|
178
|
+
setArgsOnce(args) {
|
|
179
|
+
this.onceArgs = args;
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Runs `terragrunt run-all validate` over every generated module folder, checking the generated
|
|
184
|
+
* HCL is well-formed. Unrelated to {@link Octo.validate}, which compares plans against intent.
|
|
185
|
+
*/
|
|
186
|
+
async validate(terragruntDir) {
|
|
187
|
+
return this.runAll(terragruntDir, 'validate', this.consumeArgs());
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* @param onOutput Receives each chunk as the child writes it. `execFile` keeps accumulating into
|
|
191
|
+
* its own buffers regardless, so the resolved result is unchanged whether or not this is passed.
|
|
192
|
+
*/
|
|
193
|
+
execFileAsync(file, args, options, onOutput) {
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
const child = execFile(file, args, options, (error, stdout, stderr) => {
|
|
196
|
+
if (error) {
|
|
197
|
+
reject(Object.assign(error, { stderr: stderr ?? '', stdout: stdout ?? '' }));
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
resolve({ stderr: stderr ?? '', stdout: stdout ?? '' });
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
if (onOutput) {
|
|
204
|
+
child.stdout?.on('data', (chunk) => onOutput(String(chunk), 'stdout'));
|
|
205
|
+
child.stderr?.on('data', (chunk) => onOutput(String(chunk), 'stderr'));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The environment a terragrunt command runs with, carrying the terraform binary override.
|
|
211
|
+
*/
|
|
212
|
+
buildEnv() {
|
|
213
|
+
const env = { ...process.env };
|
|
214
|
+
env.TG_PROVIDER_CACHE ??= '1'; // Enable Terragrunt shared provider cache by default.
|
|
215
|
+
// Resolves the paths a generated folder names relative to the project root. Terragrunt runs
|
|
216
|
+
// terraform from a copy of the folder, so terraform cannot work the root out for itself.
|
|
217
|
+
env[`TF_VAR_${PROJECT_ROOT_VARIABLE_NAME}`] ??= process.cwd();
|
|
218
|
+
if (this.options.terraformBinary) {
|
|
219
|
+
env.TG_TF_PATH = this.options.terraformBinary;
|
|
220
|
+
}
|
|
221
|
+
return env;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Takes the arguments set by {@link TerraformUtility.setArgsOnce}, clearing them.
|
|
225
|
+
*/
|
|
226
|
+
consumeArgs() {
|
|
227
|
+
const args = this.onceArgs ?? [];
|
|
228
|
+
this.onceArgs = undefined;
|
|
229
|
+
return args;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Renders why one folder could not be planned.
|
|
233
|
+
*
|
|
234
|
+
* Terragrunt writes its diagnostics to stderr, which carries the `Error:` block, so that comes
|
|
235
|
+
* first. The wrapped {@link TerraformCommandError} message is the fallback for failures that
|
|
236
|
+
* produce no stderr, such as a malformed `show -json` payload failing at `JSON.parse`.
|
|
237
|
+
*/
|
|
238
|
+
describePlanFailure(error) {
|
|
239
|
+
const e = error;
|
|
240
|
+
return e.stderr?.trim() || e.message?.trim() || String(error);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Publishes the same started/finished pair {@link runAll} does, around a body that drives
|
|
244
|
+
* terragrunt folder by folder instead.
|
|
245
|
+
*
|
|
246
|
+
* The JSON-mode `plan` and `output` take that per-folder path, and it is the slowest step of a
|
|
247
|
+
* `validate` - a full plan runs for tens of seconds - so the log must not fall silent through it.
|
|
248
|
+
*/
|
|
249
|
+
async emitAround(command, terragruntDir, body) {
|
|
250
|
+
const eventService = EventService.getInstance();
|
|
251
|
+
const startedAt = Date.now();
|
|
252
|
+
eventService.emit(new TerraformCommandStartedEvent(command, { command, dir: terragruntDir }));
|
|
253
|
+
try {
|
|
254
|
+
const result = await body();
|
|
255
|
+
eventService.emit(new TerraformCommandFinishedEvent(command, {
|
|
256
|
+
command,
|
|
257
|
+
dir: terragruntDir,
|
|
258
|
+
durationInMs: Date.now() - startedAt,
|
|
259
|
+
exitCode: 0,
|
|
260
|
+
}));
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
eventService.emit(new TerraformCommandFinishedEvent(command, {
|
|
265
|
+
command,
|
|
266
|
+
dir: terragruntDir,
|
|
267
|
+
durationInMs: Date.now() - startedAt,
|
|
268
|
+
exitCode: error?.exitCode ?? -1,
|
|
269
|
+
}));
|
|
270
|
+
throw error;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* The `terragrunt run --all` invocation itself, wrapped in its started/finished pair.
|
|
275
|
+
*/
|
|
276
|
+
async invokeRunAll(terragruntDir, command, commandArgs, { onOutput } = {}) {
|
|
277
|
+
const binary = this.options.terragruntBinary;
|
|
278
|
+
const args = [
|
|
279
|
+
'--non-interactive',
|
|
280
|
+
'--no-color',
|
|
281
|
+
'--working-dir',
|
|
282
|
+
terragruntDir,
|
|
283
|
+
'run',
|
|
284
|
+
'--all',
|
|
285
|
+
'--',
|
|
286
|
+
command,
|
|
287
|
+
...commandArgs,
|
|
288
|
+
];
|
|
289
|
+
const eventService = EventService.getInstance();
|
|
290
|
+
const startedAt = Date.now();
|
|
291
|
+
eventService.emit(new TerraformCommandStartedEvent(command, { command, dir: terragruntDir }));
|
|
292
|
+
try {
|
|
293
|
+
const { stderr, stdout } = await this.execFileAsync(binary, args, {
|
|
294
|
+
env: this.buildEnv(),
|
|
295
|
+
maxBuffer: MAX_BUFFER,
|
|
296
|
+
timeout: MUTATING_COMMANDS.has(command) ? this.requestedTimeoutInMs : this.options.timeoutInMs,
|
|
297
|
+
}, onOutput);
|
|
298
|
+
eventService.emit(new TerraformCommandFinishedEvent(command, {
|
|
299
|
+
command,
|
|
300
|
+
dir: terragruntDir,
|
|
301
|
+
durationInMs: Date.now() - startedAt,
|
|
302
|
+
exitCode: 0,
|
|
303
|
+
}));
|
|
304
|
+
return { args, exitCode: 0, stderr, stdout };
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
const commandError = this.toTerraformCommandError(binary, args, terragruntDir, error);
|
|
308
|
+
eventService.emit(new TerraformCommandFinishedEvent(command, {
|
|
309
|
+
command,
|
|
310
|
+
dir: terragruntDir,
|
|
311
|
+
durationInMs: Date.now() - startedAt,
|
|
312
|
+
exitCode: commandError.exitCode ?? -1,
|
|
313
|
+
}));
|
|
314
|
+
throw commandError;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Runs `terragrunt output -json` in one module folder.
|
|
319
|
+
*
|
|
320
|
+
* A folder whose output fails is reported as `undefined`, not thrown — one bad module folder must not
|
|
321
|
+
* abort every other folder's result.
|
|
322
|
+
*/
|
|
323
|
+
async readOutputs(moduleDir, composedArgs) {
|
|
324
|
+
try {
|
|
325
|
+
const { stdout } = await this.run(moduleDir, ['output', '-json', ...composedArgs]);
|
|
326
|
+
return JSON.parse(stdout);
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Runs `terragrunt plan -out=<planFile>` followed by `terragrunt show -json <planFile>` in one module folder.
|
|
334
|
+
*
|
|
335
|
+
* The plan file is written to an absolute temp path, never inside a terragrunt
|
|
336
|
+
* cache — terragrunt picks a different cache sub-directory per invocation, so a relative plan file
|
|
337
|
+
* written by one command cannot be found by the next.
|
|
338
|
+
*
|
|
339
|
+
* A folder whose plan/show/parse fails is reported as an `error`, not thrown — one bad module folder must not
|
|
340
|
+
* abort every other folder's result. The failure is carried so `validate` can report it verbatim.
|
|
341
|
+
*/
|
|
342
|
+
async readPlan(moduleDir, composedArgs) {
|
|
343
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'octo-tfplan-'));
|
|
344
|
+
const planFile = join(tempDir, 'octo.tfplan');
|
|
345
|
+
try {
|
|
346
|
+
await this.run(moduleDir, ['plan', `-out=${planFile}`, '-input=false', ...composedArgs]);
|
|
347
|
+
const { stdout } = await this.run(moduleDir, ['show', '-json', planFile]);
|
|
348
|
+
return { plan: JSON.parse(stdout) };
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
return { error: this.describePlanFailure(error) };
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
await rm(tempDir, { force: true, recursive: true });
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Runs one terragrunt command in a single module folder (`cwd` = that folder).
|
|
359
|
+
*/
|
|
360
|
+
async run(moduleDir, args) {
|
|
361
|
+
const binary = this.options.terragruntBinary;
|
|
362
|
+
try {
|
|
363
|
+
const { stderr, stdout } = await this.execFileAsync(binary, args, {
|
|
364
|
+
cwd: moduleDir,
|
|
365
|
+
env: this.buildEnv(),
|
|
366
|
+
maxBuffer: MAX_BUFFER,
|
|
367
|
+
timeout: this.options.timeoutInMs,
|
|
368
|
+
});
|
|
369
|
+
return { args, exitCode: 0, stderr, stdout };
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
throw this.toTerraformCommandError(binary, args, moduleDir, error);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Runs `terragrunt run --all -- <command>` across every module folder under `terragruntDir`, with
|
|
377
|
+
* the terraform state of every folder checked out around it.
|
|
378
|
+
*/
|
|
379
|
+
async runAll(terragruntDir, command, commandArgs, { onOutput } = {}) {
|
|
380
|
+
return this.withTerraformState(terragruntDir, () => this.invokeRunAll(terragruntDir, command, commandArgs, { onOutput }));
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Wraps whatever a failed spawn threw into a {@link TerraformCommandError}.
|
|
384
|
+
*/
|
|
385
|
+
toTerraformCommandError(binary, args, dir, error) {
|
|
386
|
+
const e = error;
|
|
387
|
+
const exitCode = typeof e.code === 'number' ? e.code : -1;
|
|
388
|
+
const message = `Failed to run "${binary} ${args.join(' ')}" in "${dir}" (exit ${exitCode}): ${e.stderr || e.message || String(error)}`;
|
|
389
|
+
return new TerraformCommandError(message, args, exitCode, e.stdout ?? '', e.stderr ?? '');
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Checks every module folder's terraform state out of Octo's state provider, runs `body`, and
|
|
393
|
+
* checks it back in.
|
|
394
|
+
*
|
|
395
|
+
* The check-in runs on the way out of a failure as much as a success, because what terraform has
|
|
396
|
+
* already built is real whether or not the command that built it returned cleanly. A timer checks
|
|
397
|
+
* in through the command as well, bounding what a killed runner loses.
|
|
398
|
+
*/
|
|
399
|
+
async withTerraformState(terragruntDir, body) {
|
|
400
|
+
const terraformStateService = await Container.getInstance().get(TerraformStateService);
|
|
401
|
+
const moduleIds = await this.listModuleFolders(terragruntDir);
|
|
402
|
+
await terraformStateService.checkOut(terragruntDir, moduleIds);
|
|
403
|
+
terraformStateService.startPeriodicCheckIn(terragruntDir, moduleIds);
|
|
404
|
+
try {
|
|
405
|
+
return await body(moduleIds);
|
|
406
|
+
}
|
|
407
|
+
finally {
|
|
408
|
+
terraformStateService.stopPeriodicCheckIn();
|
|
409
|
+
await terraformStateService.checkIn(terragruntDir, moduleIds);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* @internal
|
|
415
|
+
*/
|
|
416
|
+
let TerraformUtilityFactory = class TerraformUtilityFactory {
|
|
417
|
+
/**
|
|
418
|
+
* @internal
|
|
419
|
+
*/
|
|
420
|
+
static async create(options = {}, forceNew = false) {
|
|
421
|
+
if (!this.instance) {
|
|
422
|
+
this.instance = new TerraformUtility(options);
|
|
423
|
+
}
|
|
424
|
+
if (forceNew) {
|
|
425
|
+
this.instance = new TerraformUtility(options);
|
|
426
|
+
}
|
|
427
|
+
return this.instance;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
TerraformUtilityFactory = __decorate([
|
|
431
|
+
Factory(TerraformUtility)
|
|
432
|
+
], TerraformUtilityFactory);
|
|
433
|
+
export { TerraformUtilityFactory };
|
|
434
|
+
//# sourceMappingURL=terraform.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraform.utility.js","sourceRoot":"","sources":["../../../src/utilities/terraform/terraform.utility.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAA0C,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,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,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAE9D,MAAM,qBAAqB,CAAC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAC/D,qBAAqB,CAAC,oBAAoB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAErE,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;gBAAS,CAAC;YACT,qBAAqB,CAAC,mBAAmB,EAAE,CAAC;YAC5C,MAAM,qBAAqB,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGlC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CACjB,UAA6D,EAAE,EAC/D,WAAoB,KAAK;QAEzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AApBY,uBAAuB;IADnC,OAAO,CAAmB,gBAAgB,CAAC;GAC/B,uBAAuB,CAoBnC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NodeType, type UnknownAnchor, type UnknownModel, type UnknownResource } from '../../app.type.js';
|
|
2
2
|
import type { Diff } from '../../functions/diff/diff.js';
|
|
3
|
-
import { App } from '../../models/app/app.model.js';
|
|
4
3
|
import { AModel } from '../../models/model.abstract.js';
|
|
5
|
-
import { AModule } from '../../modules/module.abstract.js';
|
|
6
4
|
import { AAnchor } from '../../overlays/anchor.abstract.js';
|
|
7
5
|
import type { BaseAnchorSchema } from '../../overlays/anchor.schema.js';
|
|
8
6
|
import { AOverlay } from '../../overlays/overlay.abstract.js';
|
|
@@ -19,22 +17,11 @@ export declare class TestAction {
|
|
|
19
17
|
*/
|
|
20
18
|
export declare class TestAnchor extends AAnchor<BaseAnchorSchema, UnknownModel> {
|
|
21
19
|
static readonly NODE_PACKAGE: string;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
22
23
|
constructor(anchorId: string, properties: BaseAnchorSchema['properties'], parent: UnknownModel);
|
|
23
24
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export declare class TestAppModuleSchema {
|
|
28
|
-
name: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export declare class TestAppModule extends AModule<TestAppModuleSchema, App> {
|
|
34
|
-
static readonly MODULE_PACKAGE = "@octo";
|
|
35
|
-
static readonly MODULE_SCHEMA: typeof TestAppModuleSchema;
|
|
36
|
-
onInit(inputs: TestAppModuleSchema): Promise<App>;
|
|
37
|
-
}
|
|
38
25
|
/**
|
|
39
26
|
* @internal
|
|
40
27
|
*/
|
|
@@ -43,8 +30,17 @@ export declare class TestModelWithoutUnsynth extends AModel<object, TestModelWit
|
|
|
43
30
|
static readonly NODE_PACKAGE: string;
|
|
44
31
|
static readonly NODE_SCHEMA: {};
|
|
45
32
|
static readonly NODE_TYPE: NodeType;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
46
36
|
diffProperties(): Promise<Diff[]>;
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
47
40
|
setContext(): string;
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
48
44
|
synth(): object;
|
|
49
45
|
}
|
|
50
46
|
/**
|
|
@@ -55,23 +51,11 @@ export declare class TestOverlay extends AOverlay<BaseOverlaySchema, TestOverlay
|
|
|
55
51
|
static readonly NODE_PACKAGE: string;
|
|
56
52
|
static readonly NODE_SCHEMA: {};
|
|
57
53
|
static readonly NODE_TYPE: NodeType;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
58
57
|
constructor(overlayId: BaseOverlaySchema['overlayId'], properties: BaseOverlaySchema['properties'], anchors: UnknownAnchor[]);
|
|
59
58
|
}
|
|
60
|
-
/**
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
export declare class TestOverlayModuleSchema {
|
|
64
|
-
anchorName: string;
|
|
65
|
-
app: App;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export declare class TestOverlayModule extends AModule<TestOverlayModuleSchema, TestOverlay> {
|
|
71
|
-
static readonly MODULE_PACKAGE = "@octo";
|
|
72
|
-
static readonly MODULE_SCHEMA: typeof TestOverlayModuleSchema;
|
|
73
|
-
onInit(inputs: TestOverlayModuleSchema): Promise<TestOverlay>;
|
|
74
|
-
}
|
|
75
59
|
/**
|
|
76
60
|
* @internal
|
|
77
61
|
*/
|
|
@@ -80,5 +64,8 @@ export declare class TestResource extends AResource<BaseResourceSchema, TestReso
|
|
|
80
64
|
static readonly NODE_PACKAGE: string;
|
|
81
65
|
static readonly NODE_SCHEMA: {};
|
|
82
66
|
static readonly NODE_TYPE: NodeType;
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
83
70
|
constructor(resourceId: string, properties?: BaseResourceSchema['properties'], parents?: UnknownResource[]);
|
|
84
71
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { NodeType } from '../../app.type.js';
|
|
2
|
-
import { Schema } from '../../functions/schema/schema.js';
|
|
3
|
-
import { App } from '../../models/app/app.model.js';
|
|
4
2
|
import { AModel } from '../../models/model.abstract.js';
|
|
5
|
-
import { AModule } from '../../modules/module.abstract.js';
|
|
6
3
|
import { AAnchor } from '../../overlays/anchor.abstract.js';
|
|
7
4
|
import { AOverlay } from '../../overlays/overlay.abstract.js';
|
|
8
5
|
import { AResource } from '../../resources/resource.abstract.js';
|
|
@@ -16,28 +13,13 @@ export class TestAction {
|
|
|
16
13
|
*/
|
|
17
14
|
export class TestAnchor extends AAnchor {
|
|
18
15
|
static { this.NODE_PACKAGE = '@octo'; }
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
19
|
constructor(anchorId, properties, parent) {
|
|
20
20
|
super(anchorId, properties, parent);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
export class TestAppModuleSchema {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.name = Schema();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export class TestAppModule extends AModule {
|
|
35
|
-
static { this.MODULE_PACKAGE = '@octo'; }
|
|
36
|
-
static { this.MODULE_SCHEMA = TestAppModuleSchema; }
|
|
37
|
-
async onInit(inputs) {
|
|
38
|
-
return new App(inputs.name);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
23
|
/**
|
|
42
24
|
* @internal
|
|
43
25
|
*/
|
|
@@ -46,12 +28,21 @@ export class TestModelWithoutUnsynth extends AModel {
|
|
|
46
28
|
static { this.NODE_PACKAGE = '@octo'; }
|
|
47
29
|
static { this.NODE_SCHEMA = {}; }
|
|
48
30
|
static { this.NODE_TYPE = NodeType.MODEL; }
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
49
34
|
async diffProperties() {
|
|
50
35
|
return [];
|
|
51
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
52
40
|
setContext() {
|
|
53
41
|
return 'test-model=test';
|
|
54
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
55
46
|
synth() {
|
|
56
47
|
return {};
|
|
57
48
|
}
|
|
@@ -64,30 +55,13 @@ export class TestOverlay extends AOverlay {
|
|
|
64
55
|
static { this.NODE_PACKAGE = '@octo'; }
|
|
65
56
|
static { this.NODE_SCHEMA = {}; }
|
|
66
57
|
static { this.NODE_TYPE = NodeType.OVERLAY; }
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
67
61
|
constructor(overlayId, properties, anchors) {
|
|
68
62
|
super(overlayId, properties, anchors);
|
|
69
63
|
}
|
|
70
64
|
}
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
export class TestOverlayModuleSchema {
|
|
75
|
-
constructor() {
|
|
76
|
-
this.anchorName = Schema();
|
|
77
|
-
this.app = Schema();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
export class TestOverlayModule extends AModule {
|
|
84
|
-
static { this.MODULE_PACKAGE = '@octo'; }
|
|
85
|
-
static { this.MODULE_SCHEMA = TestOverlayModuleSchema; }
|
|
86
|
-
async onInit(inputs) {
|
|
87
|
-
const anchor = inputs.app.getAnchor(inputs.anchorName);
|
|
88
|
-
return new TestOverlay('test-overlay', {}, [anchor]);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
65
|
/**
|
|
92
66
|
* @internal
|
|
93
67
|
*/
|
|
@@ -96,6 +70,9 @@ export class TestResource extends AResource {
|
|
|
96
70
|
static { this.NODE_PACKAGE = '@octo'; }
|
|
97
71
|
static { this.NODE_SCHEMA = {}; }
|
|
98
72
|
static { this.NODE_TYPE = NodeType.RESOURCE; }
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
99
76
|
constructor(resourceId, properties = {}, parents = []) {
|
|
100
77
|
super(resourceId, properties, parents);
|
|
101
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-classes.js","sourceRoot":"","sources":["../../../src/utilities/test-helpers/test-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA+D,MAAM,mBAAmB,CAAC;AAE1G,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"test-classes.js","sourceRoot":"","sources":["../../../src/utilities/test-helpers/test-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA+D,MAAM,mBAAmB,CAAC;AAE1G,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE;;GAEG;AACH,MAAM,OAAO,UAAU;CAAG;AAE1B;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAuC;aAC5C,iBAAY,GAAW,OAAO,CAAC;IAExD;;OAEG;IACH,YAAY,QAAgB,EAAE,UAA0C,EAAE,MAAoB;QAC5F,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;;AAGH;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,MAAuC;aACzD,cAAS,GAAW,YAAY,CAAC;aACjC,iBAAY,GAAW,OAAO,CAAC;aAC/B,gBAAW,GAAG,EAAE,CAAC;aACjB,cAAS,GAAa,QAAQ,CAAC,KAAK,CAAC;IAE9D;;OAEG;IACM,KAAK,CAAC,cAAc;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACM,UAAU;QACjB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACM,KAAK;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;;AAGH;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,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