@quadnix/octo 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.type.d.ts +121 -26
- package/dist/app.type.js +71 -1
- package/dist/app.type.js.map +1 -1
- package/dist/decorators/action.decorator.d.ts +4 -5
- package/dist/decorators/action.decorator.js +42 -41
- package/dist/decorators/action.decorator.js.map +1 -1
- package/dist/decorators/anchor.decorator.d.ts +2 -2
- package/dist/decorators/anchor.decorator.js +16 -11
- package/dist/decorators/anchor.decorator.js.map +1 -1
- package/dist/decorators/enable-hook.decorator.js +2 -2
- package/dist/decorators/enable-hook.decorator.js.map +1 -1
- package/dist/decorators/event-source.decorator.d.ts +1 -1
- package/dist/decorators/event-source.decorator.js +7 -2
- package/dist/decorators/event-source.decorator.js.map +1 -1
- package/dist/decorators/factory.decorator.d.ts +14 -2
- package/dist/decorators/factory.decorator.js +12 -3
- package/dist/decorators/factory.decorator.js.map +1 -1
- package/dist/decorators/model.decorator.d.ts +3 -2
- package/dist/decorators/model.decorator.js +24 -11
- package/dist/decorators/model.decorator.js.map +1 -1
- package/dist/decorators/module.decorator.d.ts +4 -75
- package/dist/decorators/module.decorator.js +18 -58
- package/dist/decorators/module.decorator.js.map +1 -1
- package/dist/decorators/on-event.decorator.d.ts +1 -1
- package/dist/decorators/on-event.decorator.js +7 -2
- package/dist/decorators/on-event.decorator.js.map +1 -1
- package/dist/decorators/overlay.decorator.d.ts +3 -2
- package/dist/decorators/overlay.decorator.js +23 -11
- package/dist/decorators/overlay.decorator.js.map +1 -1
- package/dist/decorators/resource.decorator.d.ts +3 -2
- package/dist/decorators/resource.decorator.js +23 -11
- package/dist/decorators/resource.decorator.js.map +1 -1
- package/dist/decorators/validate.decorator.d.ts +4 -4
- package/dist/decorators/validate.decorator.js +16 -2
- package/dist/decorators/validate.decorator.js.map +1 -1
- package/dist/errors/container.error.d.ts +11 -0
- package/dist/errors/container.error.js +20 -0
- package/dist/errors/container.error.js.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.js +7 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/input.error.d.ts +11 -0
- package/dist/errors/input.error.js +21 -0
- package/dist/errors/input.error.js.map +1 -0
- package/dist/errors/module.error.d.ts +4 -0
- package/dist/errors/module.error.js +8 -0
- package/dist/errors/module.error.js.map +1 -0
- package/dist/errors/node.error.d.ts +36 -0
- package/dist/errors/node.error.js +60 -0
- package/dist/errors/node.error.js.map +1 -0
- package/dist/errors/schema.error.d.ts +4 -0
- package/dist/errors/schema.error.js +8 -0
- package/dist/errors/schema.error.js.map +1 -0
- package/dist/errors/transaction.error.d.ts +35 -0
- package/dist/errors/transaction.error.js +58 -0
- package/dist/errors/transaction.error.js.map +1 -0
- package/dist/events/action.event.d.ts +13 -0
- package/dist/events/action.event.js +11 -0
- package/dist/events/action.event.js.map +1 -0
- package/dist/events/event.model.d.ts +6 -12
- package/dist/events/event.model.js +5 -11
- package/dist/events/event.model.js.map +1 -1
- package/dist/events/hook/commit.hook.event.d.ts +25 -0
- package/dist/events/hook/commit.hook.event.js +26 -0
- package/dist/events/hook/commit.hook.event.js.map +1 -0
- package/dist/events/hook/hook.event.d.ts +9 -0
- package/dist/events/hook/hook.event.js +10 -0
- package/dist/events/hook/hook.event.js.map +1 -0
- package/dist/events/hook/index.d.ts +4 -0
- package/dist/events/hook/index.js +5 -0
- package/dist/events/hook/index.js.map +1 -0
- package/dist/events/hook/model.hook.event.d.ts +25 -0
- package/dist/events/hook/model.hook.event.js +26 -0
- package/dist/events/hook/model.hook.event.js.map +1 -0
- package/dist/events/hook/resource.hook.event.d.ts +25 -0
- package/dist/events/hook/resource.hook.event.js +26 -0
- package/dist/events/hook/resource.hook.event.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +8 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/module.event.d.ts +1 -6
- package/dist/events/module.event.js +0 -5
- package/dist/events/module.event.js.map +1 -1
- package/dist/events/registration.event.d.ts +9 -51
- package/dist/events/registration.event.js +16 -64
- package/dist/events/registration.event.js.map +1 -1
- package/dist/events/serialization.event.d.ts +24 -37
- package/dist/events/serialization.event.js +49 -33
- package/dist/events/serialization.event.js.map +1 -1
- package/dist/events/transaction.event.d.ts +45 -26
- package/dist/events/transaction.event.js +43 -25
- package/dist/events/transaction.event.js.map +1 -1
- package/dist/functions/container/container.d.ts +54 -9
- package/dist/functions/container/container.js +106 -19
- package/dist/functions/container/container.js.map +1 -1
- package/dist/functions/container/test-container.d.ts +9 -13
- package/dist/functions/container/test-container.js +33 -38
- package/dist/functions/container/test-container.js.map +1 -1
- package/dist/functions/dependency/dependency.js +4 -3
- package/dist/functions/dependency/dependency.js.map +1 -1
- package/dist/functions/diff/diff-metadata.d.ts +3 -5
- package/dist/functions/diff/diff-metadata.js +3 -2
- package/dist/functions/diff/diff-metadata.js.map +1 -1
- package/dist/functions/diff/diff.d.ts +10 -5
- package/dist/functions/diff/diff.js +5 -4
- package/dist/functions/diff/diff.js.map +1 -1
- package/dist/functions/diff/diff.utility.d.ts +2 -2
- package/dist/functions/diff/diff.utility.js +23 -2
- package/dist/functions/diff/diff.utility.js.map +1 -1
- package/dist/functions/hook/commit.hook.d.ts +14 -3
- package/dist/functions/hook/commit.hook.js +16 -16
- package/dist/functions/hook/commit.hook.js.map +1 -1
- package/dist/functions/hook/hook.interface.d.ts +7 -6
- package/dist/functions/hook/model-action.hook.d.ts +17 -5
- package/dist/functions/hook/model-action.hook.js +20 -39
- package/dist/functions/hook/model-action.hook.js.map +1 -1
- package/dist/functions/hook/resource-action.hook.d.ts +17 -5
- package/dist/functions/hook/resource-action.hook.js +18 -18
- package/dist/functions/hook/resource-action.hook.js.map +1 -1
- package/dist/functions/node/node-action.abstract.d.ts +7 -0
- package/dist/functions/node/node-action.abstract.js +20 -0
- package/dist/functions/node/node-action.abstract.js.map +1 -0
- package/dist/functions/node/node.abstract.d.ts +18 -9
- package/dist/functions/node/node.abstract.js +99 -32
- package/dist/functions/node/node.abstract.js.map +1 -1
- package/dist/functions/node/node.interface.d.ts +18 -18
- package/dist/functions/schema/schema.d.ts +4 -0
- package/dist/functions/schema/schema.js +38 -0
- package/dist/functions/schema/schema.js.map +1 -0
- package/dist/index.d.ts +31 -32
- package/dist/index.js +29 -12
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +29 -15
- package/dist/main.js +62 -50
- package/dist/main.js.map +1 -1
- package/dist/models/account/account.model.d.ts +23 -0
- package/dist/models/account/account.model.js +67 -0
- package/dist/models/account/account.model.js.map +1 -0
- package/dist/models/account/account.schema.d.ts +7 -0
- package/dist/models/account/account.schema.js +12 -0
- package/dist/models/account/account.schema.js.map +1 -0
- package/dist/models/app/app.model.d.ts +6 -13
- package/dist/models/app/app.model.js +24 -26
- package/dist/models/app/app.model.js.map +1 -1
- package/dist/models/app/app.schema.d.ts +3 -0
- package/dist/models/app/app.schema.js +21 -0
- package/dist/models/app/app.schema.js.map +1 -0
- package/dist/models/deployment/deployment.model.d.ts +6 -11
- package/dist/models/deployment/deployment.model.js +8 -10
- package/dist/models/deployment/deployment.model.js.map +1 -1
- package/dist/models/deployment/deployment.schema.d.ts +7 -0
- package/dist/models/deployment/deployment.schema.js +25 -0
- package/dist/models/deployment/deployment.schema.js.map +1 -0
- package/dist/models/environment/environment.model.d.ts +5 -13
- package/dist/models/environment/environment.model.js +7 -21
- package/dist/models/environment/environment.model.js.map +1 -1
- package/dist/models/environment/environment.schema.d.ts +13 -0
- package/dist/models/environment/environment.schema.js +38 -0
- package/dist/models/environment/environment.schema.js.map +1 -0
- package/dist/models/execution/execution.model.d.ts +6 -12
- package/dist/models/execution/execution.model.js +15 -24
- package/dist/models/execution/execution.model.js.map +1 -1
- package/dist/models/execution/execution.schema.d.ts +14 -0
- package/dist/models/execution/execution.schema.js +34 -0
- package/dist/models/execution/execution.schema.js.map +1 -0
- package/dist/models/filesystem/filesystem.model.d.ts +10 -0
- package/dist/models/filesystem/filesystem.model.js +43 -0
- package/dist/models/filesystem/filesystem.model.js.map +1 -0
- package/dist/models/filesystem/filesystem.schema.d.ts +3 -0
- package/dist/models/filesystem/filesystem.schema.js +21 -0
- package/dist/models/filesystem/filesystem.schema.js.map +1 -0
- package/dist/models/image/image.model.d.ts +7 -39
- package/dist/models/image/image.model.js +14 -26
- package/dist/models/image/image.model.js.map +1 -1
- package/dist/models/image/image.schema.d.ts +9 -0
- package/dist/models/image/image.schema.js +31 -0
- package/dist/models/image/image.schema.js.map +1 -0
- package/dist/models/model-action.interface.d.ts +3 -13
- package/dist/models/model.abstract.d.ts +25 -13
- package/dist/models/model.abstract.js +176 -13
- package/dist/models/model.abstract.js.map +1 -1
- package/dist/models/model.interface.d.ts +12 -6
- package/dist/models/pipeline/pipeline.model.d.ts +5 -6
- package/dist/models/pipeline/pipeline.model.js +7 -9
- package/dist/models/pipeline/pipeline.model.js.map +1 -1
- package/dist/models/pipeline/pipeline.schema.d.ts +4 -0
- package/dist/models/pipeline/pipeline.schema.js +22 -0
- package/dist/models/pipeline/pipeline.schema.js.map +1 -0
- package/dist/models/region/region.model.d.ts +8 -7
- package/dist/models/region/region.model.js +22 -11
- package/dist/models/region/region.model.js.map +1 -1
- package/dist/models/region/region.schema.d.ts +3 -0
- package/dist/models/region/region.schema.js +21 -0
- package/dist/models/region/region.schema.js.map +1 -0
- package/dist/models/server/server.model.d.ts +5 -9
- package/dist/models/server/server.model.js +10 -10
- package/dist/models/server/server.model.js.map +1 -1
- package/dist/models/server/server.schema.d.ts +6 -0
- package/dist/models/server/server.schema.js +24 -0
- package/dist/models/server/server.schema.js.map +1 -0
- package/dist/models/service/service.model.d.ts +4 -8
- package/dist/models/service/service.model.js +12 -12
- package/dist/models/service/service.model.js.map +1 -1
- package/dist/models/service/service.schema.d.ts +6 -0
- package/dist/models/service/service.schema.js +24 -0
- package/dist/models/service/service.schema.js.map +1 -0
- package/dist/models/subnet/subnet.model.d.ts +8 -32
- package/dist/models/subnet/subnet.model.js +11 -33
- package/dist/models/subnet/subnet.model.js.map +1 -1
- package/dist/models/subnet/subnet.schema.d.ts +33 -0
- package/dist/models/subnet/subnet.schema.js +48 -0
- package/dist/models/subnet/subnet.schema.js.map +1 -0
- package/dist/modules/module.abstract.d.ts +21 -0
- package/dist/modules/module.abstract.js +14 -0
- package/dist/modules/module.abstract.js.map +1 -0
- package/dist/modules/module.container.d.ts +32 -18
- package/dist/modules/module.container.js +134 -81
- package/dist/modules/module.container.js.map +1 -1
- package/dist/modules/module.interface.d.ts +15 -2
- package/dist/modules/test-module.container.d.ts +33 -15
- package/dist/modules/test-module.container.js +257 -26
- package/dist/modules/test-module.container.js.map +1 -1
- package/dist/overlays/anchor.abstract.d.ts +13 -8
- package/dist/overlays/anchor.abstract.js.map +1 -1
- package/dist/overlays/anchor.interface.d.ts +5 -8
- package/dist/overlays/anchor.schema.d.ts +8 -0
- package/dist/overlays/anchor.schema.js +9 -0
- package/dist/overlays/anchor.schema.js.map +1 -0
- package/dist/overlays/overlay-data.repository.d.ts +3 -4
- package/dist/overlays/overlay-data.repository.js +14 -10
- package/dist/overlays/overlay-data.repository.js.map +1 -1
- package/dist/overlays/overlay.abstract.d.ts +12 -13
- package/dist/overlays/overlay.abstract.js +16 -8
- package/dist/overlays/overlay.abstract.js.map +1 -1
- package/dist/overlays/overlay.interface.d.ts +3 -7
- package/dist/overlays/overlay.schema.d.ts +8 -0
- package/dist/overlays/overlay.schema.js +9 -0
- package/dist/overlays/overlay.schema.js.map +1 -0
- package/dist/resources/resource-action.interface.d.ts +4 -3
- package/dist/resources/resource-data.repository.d.ts +2 -3
- package/dist/resources/resource-data.repository.js +58 -82
- package/dist/resources/resource-data.repository.js.map +1 -1
- package/dist/resources/resource.abstract.d.ts +50 -27
- package/dist/resources/resource.abstract.js +230 -57
- package/dist/resources/resource.abstract.js.map +1 -1
- package/dist/resources/resource.interface.d.ts +39 -8
- package/dist/resources/resource.schema.d.ts +14 -0
- package/dist/resources/resource.schema.js +11 -0
- package/dist/resources/resource.schema.js.map +1 -0
- package/dist/services/capture/capture.service.d.ts +6 -6
- package/dist/services/capture/capture.service.js +8 -5
- package/dist/services/capture/capture.service.js.map +1 -1
- package/dist/services/event/event.service.d.ts +3 -4
- package/dist/services/event/event.service.js +7 -9
- package/dist/services/event/event.service.js.map +1 -1
- package/dist/services/input/input.service.d.ts +62 -6
- package/dist/services/input/input.service.js +290 -14
- package/dist/services/input/input.service.js.map +1 -1
- package/dist/services/schema-translation/schema-translation.service.d.ts +13 -0
- package/dist/services/schema-translation/schema-translation.service.js +42 -0
- package/dist/services/schema-translation/schema-translation.service.js.map +1 -0
- package/dist/services/serialization/model/model-serialization.service.d.ts +1 -4
- package/dist/services/serialization/model/model-serialization.service.js +36 -25
- package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.d.ts +1 -1
- package/dist/services/serialization/resource/resource-serialization.service.js +58 -80
- package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
- package/dist/services/state-management/local.state-provider.d.ts +0 -1
- package/dist/services/state-management/local.state-provider.js +5 -7
- package/dist/services/state-management/local.state-provider.js.map +1 -1
- package/dist/services/state-management/state-management.service.d.ts +2 -3
- package/dist/services/state-management/state-management.service.js +19 -8
- package/dist/services/state-management/state-management.service.js.map +1 -1
- package/dist/services/state-management/state-provider.interface.d.ts +0 -1
- package/dist/services/state-management/test.state-provider.d.ts +0 -1
- package/dist/services/state-management/test.state-provider.js +2 -1
- package/dist/services/state-management/test.state-provider.js.map +1 -1
- package/dist/services/transaction/transaction.service.d.ts +16 -11
- package/dist/services/transaction/transaction.service.js +197 -66
- package/dist/services/transaction/transaction.service.js.map +1 -1
- package/dist/services/validation/validation.service.d.ts +2 -3
- package/dist/services/validation/validation.service.js +27 -12
- package/dist/services/validation/validation.service.js.map +1 -1
- package/dist/utilities/node/node.utility.d.ts +4 -0
- package/dist/utilities/node/node.utility.js +22 -0
- package/dist/utilities/node/node.utility.js.map +1 -0
- package/dist/utilities/object/object.utility.d.ts +3 -0
- package/dist/utilities/object/object.utility.js +33 -0
- package/dist/utilities/object/object.utility.js.map +1 -1
- package/dist/utilities/test-helpers/test-classes.d.ts +57 -0
- package/dist/utilities/test-helpers/test-classes.js +76 -0
- package/dist/utilities/test-helpers/test-classes.js.map +1 -0
- package/dist/utilities/test-helpers/test-models.d.ts +41 -0
- package/dist/utilities/test-helpers/test-models.js +224 -0
- package/dist/utilities/test-helpers/test-models.js.map +1 -0
- package/dist/utilities/test-helpers/test-overlays.d.ts +10 -0
- package/dist/utilities/test-helpers/test-overlays.js +53 -0
- package/dist/utilities/test-helpers/test-overlays.js.map +1 -0
- package/dist/utilities/test-helpers/test-resources.d.ts +22 -0
- package/dist/utilities/test-helpers/test-resources.js +162 -0
- package/dist/utilities/test-helpers/test-resources.js.map +1 -0
- package/dist/utilities/validation/validation.utility.d.ts +31 -3
- package/dist/utilities/validation/validation.utility.js +121 -2
- package/dist/utilities/validation/validation.utility.js.map +1 -1
- package/package.json +6 -6
- package/dist/events/error.event.d.ts +0 -35
- package/dist/events/error.event.js +0 -36
- package/dist/events/error.event.js.map +0 -1
- package/dist/events/hook.event.d.ts +0 -194
- package/dist/events/hook.event.js +0 -195
- package/dist/events/hook.event.js.map +0 -1
- package/dist/models/app/app.interface.d.ts +0 -9
- package/dist/models/app/app.interface.js +0 -2
- package/dist/models/app/app.interface.js.map +0 -1
- package/dist/models/deployment/deployment.interface.d.ts +0 -9
- package/dist/models/deployment/deployment.interface.js +0 -2
- package/dist/models/deployment/deployment.interface.js.map +0 -1
- package/dist/models/environment/environment.interface.d.ts +0 -12
- package/dist/models/environment/environment.interface.js +0 -2
- package/dist/models/environment/environment.interface.js.map +0 -1
- package/dist/models/execution/execution.interface.d.ts +0 -14
- package/dist/models/execution/execution.interface.js +0 -2
- package/dist/models/execution/execution.interface.js.map +0 -1
- package/dist/models/image/image.interface.d.ts +0 -12
- package/dist/models/image/image.interface.js +0 -2
- package/dist/models/image/image.interface.js.map +0 -1
- package/dist/models/pipeline/pipeline.interface.d.ts +0 -10
- package/dist/models/pipeline/pipeline.interface.js +0 -2
- package/dist/models/pipeline/pipeline.interface.js.map +0 -1
- package/dist/models/region/region.interface.d.ts +0 -9
- package/dist/models/region/region.interface.js +0 -2
- package/dist/models/region/region.interface.js.map +0 -1
- package/dist/models/server/server.interface.d.ts +0 -9
- package/dist/models/server/server.interface.js +0 -2
- package/dist/models/server/server.interface.js.map +0 -1
- package/dist/models/service/service.interface.d.ts +0 -9
- package/dist/models/service/service.interface.js +0 -2
- package/dist/models/service/service.interface.js.map +0 -1
- package/dist/models/subnet/subnet.interface.d.ts +0 -13
- package/dist/models/subnet/subnet.interface.js +0 -2
- package/dist/models/subnet/subnet.interface.js.map +0 -1
- package/dist/overlays/overlay.service.d.ts +0 -17
- package/dist/overlays/overlay.service.js +0 -41
- package/dist/overlays/overlay.service.js.map +0 -1
- package/dist/resources/shared-resource.abstract.d.ts +0 -13
- package/dist/resources/shared-resource.abstract.js +0 -47
- package/dist/resources/shared-resource.abstract.js.map +0 -1
|
@@ -10,8 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var Server_1;
|
|
11
11
|
import { strict as assert } from 'assert';
|
|
12
12
|
import { Model } from '../../decorators/model.decorator.js';
|
|
13
|
-
import {
|
|
13
|
+
import { ModelError } from '../../errors/index.js';
|
|
14
|
+
import { Deployment } from '../deployment/deployment.model.js';
|
|
14
15
|
import { AModel } from '../model.abstract.js';
|
|
16
|
+
import { ServerSchema } from './server.schema.js';
|
|
15
17
|
/**
|
|
16
18
|
* A Server model is a representation of the logical microservice.
|
|
17
19
|
* E.g. frontend, backend, database, payment-service, etc.
|
|
@@ -26,7 +28,6 @@ import { AModel } from '../model.abstract.js';
|
|
|
26
28
|
let Server = Server_1 = class Server extends AModel {
|
|
27
29
|
constructor(serverKey) {
|
|
28
30
|
super();
|
|
29
|
-
this.NODE_NAME = 'server';
|
|
30
31
|
this.serverKey = serverKey;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
@@ -39,14 +40,17 @@ let Server = Server_1 = class Server extends AModel {
|
|
|
39
40
|
// Check for duplicates.
|
|
40
41
|
const deployments = childrenDependencies['deployment'].map((d) => d.to);
|
|
41
42
|
if (deployments.find((d) => d.deploymentTag === deployment.deploymentTag)) {
|
|
42
|
-
throw new
|
|
43
|
+
throw new ModelError('Deployment already exists!', this);
|
|
43
44
|
}
|
|
44
45
|
this.addChild('serverKey', deployment, 'deploymentTag');
|
|
45
46
|
}
|
|
46
47
|
setContext() {
|
|
47
48
|
const parents = this.getParents();
|
|
48
|
-
const app = parents['app'][0]
|
|
49
|
-
|
|
49
|
+
const app = parents['app']?.[0]?.to;
|
|
50
|
+
if (!app) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return [`${this.constructor.NODE_NAME}=${this.serverKey}`, app.getContext()].join(',');
|
|
50
54
|
}
|
|
51
55
|
synth() {
|
|
52
56
|
return {
|
|
@@ -58,12 +62,8 @@ let Server = Server_1 = class Server extends AModel {
|
|
|
58
62
|
return new Server_1(server.serverKey);
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
|
-
__decorate([
|
|
62
|
-
Validate({ options: { maxLength: 64, minLength: 2, regex: /^[a-zA-Z][\w-]*[a-zA-Z0-9]$/ } }),
|
|
63
|
-
__metadata("design:type", String)
|
|
64
|
-
], Server.prototype, "serverKey", void 0);
|
|
65
65
|
Server = Server_1 = __decorate([
|
|
66
|
-
Model(),
|
|
66
|
+
Model('@octo', 'server', ServerSchema),
|
|
67
67
|
__metadata("design:paramtypes", [String])
|
|
68
68
|
], Server);
|
|
69
69
|
export { Server };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.model.js","sourceRoot":"","sources":["../../../src/models/server/server.model.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,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,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;IAEQ,UAAU;QACjB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,GAAI,IAAI,CAAC,WAA6B,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5G,CAAC;IAEQ,KAAK;QACZ,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,CAAU,KAAK,CAAC,OAAO,CAC3B,MAAoB,EACpB,kBAA8D;QAE9D,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAE7B,OAAO,IAAI,QAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AA9CY,MAAM;IADlB,KAAK,CAAS,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC;;GAClC,MAAM,CA8ClB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Validate } from '../../decorators/validate.decorator.js';
|
|
11
|
+
import { Schema } from '../../functions/schema/schema.js';
|
|
12
|
+
export class ServerSchema {
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* The name of the server.
|
|
16
|
+
*/
|
|
17
|
+
this.serverKey = Schema();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
Validate({ options: { maxLength: 64, minLength: 2, regex: /^[a-zA-Z][\w-]*[a-zA-Z0-9]$/ } }),
|
|
22
|
+
__metadata("design:type", Object)
|
|
23
|
+
], ServerSchema.prototype, "serverKey", void 0);
|
|
24
|
+
//# sourceMappingURL=server.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.schema.js","sourceRoot":"","sources":["../../../src/models/server/server.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,MAAM,OAAO,YAAY;IAAzB;QACE;;WAEG;QAEH,cAAS,GAAG,MAAM,EAAU,CAAC;IAC/B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;+CAChE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AModel } from '../model.abstract.js';
|
|
2
|
-
import
|
|
2
|
+
import { ServiceSchema } from './service.schema.js';
|
|
3
3
|
/**
|
|
4
4
|
* A Service model can be any third-party service that your application relies on.
|
|
5
5
|
* What separates them from Server is that Services are hosted and managed outside of your infrastructure.
|
|
@@ -12,13 +12,9 @@ import type { IService } from './service.interface.js';
|
|
|
12
12
|
* @group Models
|
|
13
13
|
* @see Definition of [Default Models](/docs/fundamentals/models#default-models).
|
|
14
14
|
*/
|
|
15
|
-
export declare class Service extends AModel<
|
|
16
|
-
readonly NODE_NAME: string;
|
|
17
|
-
/**
|
|
18
|
-
* The ID of the service.
|
|
19
|
-
*/
|
|
15
|
+
export declare class Service extends AModel<ServiceSchema, Service> {
|
|
20
16
|
readonly serviceId: string;
|
|
21
17
|
constructor(serviceId: string);
|
|
22
|
-
setContext(): string;
|
|
23
|
-
synth():
|
|
18
|
+
setContext(): string | undefined;
|
|
19
|
+
synth(): ServiceSchema;
|
|
24
20
|
}
|
|
@@ -7,9 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
var Service_1;
|
|
10
11
|
import { Model } from '../../decorators/model.decorator.js';
|
|
11
|
-
import {
|
|
12
|
+
import { ModelError } from '../../errors/index.js';
|
|
12
13
|
import { AModel } from '../model.abstract.js';
|
|
14
|
+
import { ServiceSchema } from './service.schema.js';
|
|
13
15
|
/**
|
|
14
16
|
* A Service model can be any third-party service that your application relies on.
|
|
15
17
|
* What separates them from Server is that Services are hosted and managed outside of your infrastructure.
|
|
@@ -22,27 +24,25 @@ import { AModel } from '../model.abstract.js';
|
|
|
22
24
|
* @group Models
|
|
23
25
|
* @see Definition of [Default Models](/docs/fundamentals/models#default-models).
|
|
24
26
|
*/
|
|
25
|
-
let Service = class Service extends AModel {
|
|
27
|
+
let Service = Service_1 = class Service extends AModel {
|
|
26
28
|
constructor(serviceId) {
|
|
27
29
|
super();
|
|
28
|
-
this.NODE_NAME = 'service';
|
|
29
30
|
this.serviceId = serviceId;
|
|
30
31
|
}
|
|
31
32
|
setContext() {
|
|
32
33
|
const parents = this.getParents();
|
|
33
|
-
const app = parents['app'][0]
|
|
34
|
-
|
|
34
|
+
const app = parents['app']?.[0]?.to;
|
|
35
|
+
if (!app) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return [`${this.constructor.NODE_NAME}=${this.serviceId}`, app.getContext()].join(',');
|
|
35
39
|
}
|
|
36
40
|
synth() {
|
|
37
|
-
throw new
|
|
41
|
+
throw new ModelError('Method not implemented! Use subclass', this);
|
|
38
42
|
}
|
|
39
43
|
};
|
|
40
|
-
__decorate([
|
|
41
|
-
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], Service.prototype, "serviceId", void 0);
|
|
44
|
-
Service = __decorate([
|
|
45
|
-
Model(),
|
|
44
|
+
Service = Service_1 = __decorate([
|
|
45
|
+
Model('@octo', 'service', ServiceSchema),
|
|
46
46
|
__metadata("design:paramtypes", [String])
|
|
47
47
|
], Service);
|
|
48
48
|
export { Service };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.model.js","sourceRoot":"","sources":["../../../src/models/service/service.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.model.js","sourceRoot":"","sources":["../../../src/models/service/service.model.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;GAWG;AAEI,IAAM,OAAO,eAAb,MAAM,OAAQ,SAAQ,MAA8B;IAGzD,YAAY,SAAiB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEQ,UAAU;QACjB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,GAAI,IAAI,CAAC,WAA8B,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7G,CAAC;IAEQ,KAAK;QACZ,MAAM,IAAI,UAAU,CAAC,sCAAsC,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AApBY,OAAO;IADnB,KAAK,CAAU,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC;;GACrC,OAAO,CAoBnB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Validate } from '../../decorators/validate.decorator.js';
|
|
11
|
+
import { Schema } from '../../functions/schema/schema.js';
|
|
12
|
+
export class ServiceSchema {
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the service.
|
|
16
|
+
*/
|
|
17
|
+
this.serviceId = Schema();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
Validate({ options: { maxLength: 128, minLength: 2, regex: /^[a-zA-Z0-9][\w.-]*[a-zA-Z0-9]$/ } }),
|
|
22
|
+
__metadata("design:type", Object)
|
|
23
|
+
], ServiceSchema.prototype, "serviceId", void 0);
|
|
24
|
+
//# sourceMappingURL=service.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.schema.js","sourceRoot":"","sources":["../../../src/models/service/service.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,MAAM,OAAO,aAAa;IAA1B;QACE;;WAEG;QAEH,cAAS,GAAG,MAAM,EAAU,CAAC;IAC/B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE,CAAC;;gDACrE"}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import type { UnknownModel } from '../../app.type.js';
|
|
2
2
|
import { AModel } from '../model.abstract.js';
|
|
3
|
-
import { Region } from '../region/region.model.js';
|
|
4
|
-
import
|
|
5
|
-
/**
|
|
6
|
-
* The type of subnet.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum SubnetType {
|
|
9
|
-
/**
|
|
10
|
-
* A public subnet is open to the internet,
|
|
11
|
-
* i.e. an {@link Execution} within this subnet can be accessed from the internet.
|
|
12
|
-
* Other than access from the internet, any other access needs to be explicitly allowed.
|
|
13
|
-
*/
|
|
14
|
-
PUBLIC = "public",
|
|
15
|
-
/**
|
|
16
|
-
* A private subnet has limited access to anything outside of this subnet, including access from the internet.
|
|
17
|
-
* Access to this subnet needs to be explicitly allowed.
|
|
18
|
-
*/
|
|
19
|
-
PRIVATE = "private"
|
|
20
|
-
}
|
|
3
|
+
import type { Region } from '../region/region.model.js';
|
|
4
|
+
import { SubnetSchema, SubnetType } from './subnet.schema.js';
|
|
21
5
|
/**
|
|
22
6
|
* A Subnet model is the logical sub-division of the region, e.g. a public and a private subnet.
|
|
23
7
|
* A subnet is often used to isolate parts of your infrastructure with access gates in the front.
|
|
@@ -31,17 +15,9 @@ export declare enum SubnetType {
|
|
|
31
15
|
* @group Models
|
|
32
16
|
* @see Definition of [Default Models](/docs/fundamentals/models#default-models).
|
|
33
17
|
*/
|
|
34
|
-
export declare class Subnet extends AModel<
|
|
35
|
-
readonly NODE_NAME: string;
|
|
18
|
+
export declare class Subnet extends AModel<SubnetSchema, Subnet> {
|
|
36
19
|
private options;
|
|
37
|
-
/**
|
|
38
|
-
* The ID of the subnet.
|
|
39
|
-
* - Format is `{regionId}-{subnetName}`
|
|
40
|
-
*/
|
|
41
20
|
readonly subnetId: string;
|
|
42
|
-
/**
|
|
43
|
-
* The name of the subnet.
|
|
44
|
-
*/
|
|
45
21
|
readonly subnetName: string;
|
|
46
22
|
constructor(region: Region, name: string);
|
|
47
23
|
/**
|
|
@@ -56,13 +32,13 @@ export declare class Subnet extends AModel<ISubnet, Subnet> {
|
|
|
56
32
|
set disableSubnetIntraNetwork(disableSubnetIntraNetwork: boolean);
|
|
57
33
|
get subnetType(): SubnetType;
|
|
58
34
|
set subnetType(subnetType: SubnetType);
|
|
59
|
-
setContext(): string;
|
|
60
|
-
synth():
|
|
61
|
-
static unSynth(subnet:
|
|
35
|
+
setContext(): string | undefined;
|
|
36
|
+
synth(): SubnetSchema;
|
|
37
|
+
static unSynth(subnet: SubnetSchema, deReferenceContext: (context: string) => Promise<UnknownModel>): Promise<Subnet>;
|
|
62
38
|
/**
|
|
63
39
|
* To update the networking rules of this subnet to allow or deny connectivity from another subnet.
|
|
64
|
-
* The networking rules are
|
|
65
|
-
* i.e. if subnet A can connect to subnet B, then subnet B
|
|
40
|
+
* The networking rules are uni-directional,
|
|
41
|
+
* i.e. if subnet A can connect to subnet B, then subnet B doesn't automatically connect to subnet A.
|
|
66
42
|
*
|
|
67
43
|
* @param subnet The other subnet.
|
|
68
44
|
* @param allowConnections Set to `true` to allow this and the other subnet to connect.
|
|
@@ -9,27 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
var Subnet_1;
|
|
11
11
|
import { Model } from '../../decorators/model.decorator.js';
|
|
12
|
-
import { Validate } from '../../decorators/validate.decorator.js';
|
|
13
12
|
import { DiffAction } from '../../functions/diff/diff.js';
|
|
14
13
|
import { AModel } from '../model.abstract.js';
|
|
15
|
-
import {
|
|
16
|
-
/**
|
|
17
|
-
* The type of subnet.
|
|
18
|
-
*/
|
|
19
|
-
export var SubnetType;
|
|
20
|
-
(function (SubnetType) {
|
|
21
|
-
/**
|
|
22
|
-
* A public subnet is open to the internet,
|
|
23
|
-
* i.e. an {@link Execution} within this subnet can be accessed from the internet.
|
|
24
|
-
* Other than access from the internet, any other access needs to be explicitly allowed.
|
|
25
|
-
*/
|
|
26
|
-
SubnetType["PUBLIC"] = "public";
|
|
27
|
-
/**
|
|
28
|
-
* A private subnet has limited access to anything outside of this subnet, including access from the internet.
|
|
29
|
-
* Access to this subnet needs to be explicitly allowed.
|
|
30
|
-
*/
|
|
31
|
-
SubnetType["PRIVATE"] = "private";
|
|
32
|
-
})(SubnetType || (SubnetType = {}));
|
|
14
|
+
import { SubnetSchema, SubnetType } from './subnet.schema.js';
|
|
33
15
|
/**
|
|
34
16
|
* A Subnet model is the logical sub-division of the region, e.g. a public and a private subnet.
|
|
35
17
|
* A subnet is often used to isolate parts of your infrastructure with access gates in the front.
|
|
@@ -46,7 +28,6 @@ export var SubnetType;
|
|
|
46
28
|
let Subnet = Subnet_1 = class Subnet extends AModel {
|
|
47
29
|
constructor(region, name) {
|
|
48
30
|
super();
|
|
49
|
-
this.NODE_NAME = 'subnet';
|
|
50
31
|
this.options = {
|
|
51
32
|
disableSubnetIntraNetwork: false,
|
|
52
33
|
subnetType: SubnetType.PRIVATE,
|
|
@@ -76,8 +57,11 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
|
|
|
76
57
|
}
|
|
77
58
|
setContext() {
|
|
78
59
|
const parents = this.getParents();
|
|
79
|
-
const region = parents['region'][0]
|
|
80
|
-
|
|
60
|
+
const region = parents['region']?.[0]?.to;
|
|
61
|
+
if (!region) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
return [`${this.constructor.NODE_NAME}=${this.subnetId}`, region.getContext()].join(',');
|
|
81
65
|
}
|
|
82
66
|
synth() {
|
|
83
67
|
const parents = this.getParents();
|
|
@@ -98,8 +82,8 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
|
|
|
98
82
|
}
|
|
99
83
|
/**
|
|
100
84
|
* To update the networking rules of this subnet to allow or deny connectivity from another subnet.
|
|
101
|
-
* The networking rules are
|
|
102
|
-
* i.e. if subnet A can connect to subnet B, then subnet B
|
|
85
|
+
* The networking rules are uni-directional,
|
|
86
|
+
* i.e. if subnet A can connect to subnet B, then subnet B doesn't automatically connect to subnet A.
|
|
103
87
|
*
|
|
104
88
|
* @param subnet The other subnet.
|
|
105
89
|
* @param allowConnections Set to `true` to allow this and the other subnet to connect.
|
|
@@ -111,24 +95,18 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
|
|
|
111
95
|
siblingDependencies['subnet'] = [];
|
|
112
96
|
const subnets = siblingDependencies['subnet'].map((d) => d.to);
|
|
113
97
|
if (allowConnections && !subnets.find((s) => s.subnetId === subnet.subnetId)) {
|
|
114
|
-
const { thisToThatDependency
|
|
98
|
+
const { thisToThatDependency } = this.addRelationship(subnet);
|
|
115
99
|
thisToThatDependency.addBehavior('sibling', DiffAction.ADD, 'subnetId', DiffAction.ADD);
|
|
116
100
|
thisToThatDependency.addBehavior('sibling', DiffAction.ADD, 'subnetId', DiffAction.UPDATE);
|
|
117
|
-
thatToThisDependency.addBehavior('sibling', DiffAction.ADD, 'subnetId', DiffAction.ADD);
|
|
118
|
-
thatToThisDependency.addBehavior('sibling', DiffAction.ADD, 'subnetId', DiffAction.UPDATE);
|
|
119
101
|
}
|
|
120
102
|
else if (!allowConnections && subnets.find((s) => s.subnetId === subnet.subnetId)) {
|
|
121
103
|
this.removeRelationship(subnet);
|
|
122
104
|
}
|
|
123
105
|
}
|
|
124
106
|
};
|
|
125
|
-
__decorate([
|
|
126
|
-
Validate({ options: { maxLength: 32, minLength: 2, regex: /^[a-zA-Z][\w-]*[a-zA-Z0-9]$/ } }),
|
|
127
|
-
__metadata("design:type", String)
|
|
128
|
-
], Subnet.prototype, "subnetName", void 0);
|
|
129
107
|
Subnet = Subnet_1 = __decorate([
|
|
130
|
-
Model(),
|
|
131
|
-
__metadata("design:paramtypes", [
|
|
108
|
+
Model('@octo', 'subnet', SubnetSchema),
|
|
109
|
+
__metadata("design:paramtypes", [Function, String])
|
|
132
110
|
], Subnet);
|
|
133
111
|
export { Subnet };
|
|
134
112
|
//# sourceMappingURL=subnet.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subnet.model.js","sourceRoot":"","sources":["../../../src/models/subnet/subnet.model.ts"],"names":[],"mappings":";;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"subnet.model.js","sourceRoot":"","sources":["../../../src/models/subnet/subnet.model.ts"],"names":[],"mappings":";;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;;;;;;GAYG;AAEI,IAAM,MAAM,cAAZ,M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,CAAC,EAAE,CAAC;YACrF,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC9D,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACxF,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAC7F,CAAC;aAAM,IAAI,CAAC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5F,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF,CAAA;AAhGY,MAAM;IADlB,KAAK,CAAS,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC;;GAClC,MAAM,CAgGlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IModelReference } from '../model.interface.js';
|
|
2
|
+
/**
|
|
3
|
+
* The type of subnet.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SubnetType {
|
|
6
|
+
/**
|
|
7
|
+
* A public subnet is open to the internet,
|
|
8
|
+
* i.e. an {@link Execution} within this subnet can be accessed from the internet.
|
|
9
|
+
* Other than access from the internet, any other access needs to be explicitly allowed.
|
|
10
|
+
*/
|
|
11
|
+
PUBLIC = "public",
|
|
12
|
+
/**
|
|
13
|
+
* A private subnet has limited access to anything outside of this subnet, including access from the internet.
|
|
14
|
+
* Access to this subnet needs to be explicitly allowed.
|
|
15
|
+
*/
|
|
16
|
+
PRIVATE = "private"
|
|
17
|
+
}
|
|
18
|
+
export declare class SubnetSchema {
|
|
19
|
+
options: {
|
|
20
|
+
disableSubnetIntraNetwork: boolean;
|
|
21
|
+
subnetType: SubnetType;
|
|
22
|
+
};
|
|
23
|
+
region: IModelReference;
|
|
24
|
+
/**
|
|
25
|
+
* The ID of the subnet.
|
|
26
|
+
* - Format is `{regionId}-{subnetName}`
|
|
27
|
+
*/
|
|
28
|
+
subnetId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The name of the subnet.
|
|
31
|
+
*/
|
|
32
|
+
subnetName: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Validate } from '../../decorators/validate.decorator.js';
|
|
11
|
+
import { Schema } from '../../functions/schema/schema.js';
|
|
12
|
+
/**
|
|
13
|
+
* The type of subnet.
|
|
14
|
+
*/
|
|
15
|
+
export var SubnetType;
|
|
16
|
+
(function (SubnetType) {
|
|
17
|
+
/**
|
|
18
|
+
* A public subnet is open to the internet,
|
|
19
|
+
* i.e. an {@link Execution} within this subnet can be accessed from the internet.
|
|
20
|
+
* Other than access from the internet, any other access needs to be explicitly allowed.
|
|
21
|
+
*/
|
|
22
|
+
SubnetType["PUBLIC"] = "public";
|
|
23
|
+
/**
|
|
24
|
+
* A private subnet has limited access to anything outside of this subnet, including access from the internet.
|
|
25
|
+
* Access to this subnet needs to be explicitly allowed.
|
|
26
|
+
*/
|
|
27
|
+
SubnetType["PRIVATE"] = "private";
|
|
28
|
+
})(SubnetType || (SubnetType = {}));
|
|
29
|
+
export class SubnetSchema {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.options = Schema();
|
|
32
|
+
this.region = Schema();
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the subnet.
|
|
35
|
+
* - Format is `{regionId}-{subnetName}`
|
|
36
|
+
*/
|
|
37
|
+
this.subnetId = Schema();
|
|
38
|
+
/**
|
|
39
|
+
* The name of the subnet.
|
|
40
|
+
*/
|
|
41
|
+
this.subnetName = Schema();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
__decorate([
|
|
45
|
+
Validate({ options: { maxLength: 32, minLength: 2, regex: /^[a-zA-Z][\w-]*[a-zA-Z0-9]$/ } }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], SubnetSchema.prototype, "subnetName", void 0);
|
|
48
|
+
//# sourceMappingURL=subnet.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subnet.schema.js","sourceRoot":"","sources":["../../../src/models/subnet/subnet.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAN,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB;;;;OAIG;IACH,+BAAiB,CAAA;IAEjB;;;OAGG;IACH,iCAAmB,CAAA;AACrB,CAAC,EAbW,UAAU,KAAV,UAAU,QAarB;AAED,MAAM,OAAO,YAAY;IAAzB;QACE,YAAO,GAAG,MAAM,EAAkE,CAAC;QAEnF,WAAM,GAAG,MAAM,EAAmB,CAAC;QAEnC;;;WAGG;QACH,aAAQ,GAAG,MAAM,EAAU,CAAC;QAE5B;;WAEG;QAEH,eAAU,GAAG,MAAM,EAAU,CAAC;IAChC,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;gDAC/D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ModuleSchema, UnknownModel } from '../app.type.js';
|
|
2
|
+
import type { CommitHook } from '../functions/hook/commit.hook.js';
|
|
3
|
+
import type { ModelActionHook } from '../functions/hook/model-action.hook.js';
|
|
4
|
+
import type { ResourceActionHook } from '../functions/hook/resource-action.hook.js';
|
|
5
|
+
import type { IModule } from './module.interface.js';
|
|
6
|
+
export declare abstract class AModule<S, T extends UnknownModel> implements IModule<S, T> {
|
|
7
|
+
static readonly MODULE_PACKAGE: string;
|
|
8
|
+
static readonly MODULE_SCHEMA: ModuleSchema<AModule<any, any>>;
|
|
9
|
+
readonly moduleId: string;
|
|
10
|
+
constructor(moduleId: string);
|
|
11
|
+
abstract onInit(inputs: S): Promise<T | UnknownModel[]>;
|
|
12
|
+
registerHooks(): {
|
|
13
|
+
postCommitHooks?: Parameters<CommitHook['collectHooks']>[0]['postHooks'];
|
|
14
|
+
postModelActionHooks?: Parameters<ModelActionHook['collectHooks']>[0]['postHooks'];
|
|
15
|
+
postResourceActionHooks?: Parameters<ResourceActionHook['collectHooks']>[0]['postHooks'];
|
|
16
|
+
preCommitHooks?: Parameters<CommitHook['collectHooks']>[0]['preHooks'];
|
|
17
|
+
preModelActionHooks?: Parameters<ModelActionHook['collectHooks']>[0]['preHooks'];
|
|
18
|
+
preResourceActionHooks?: Parameters<ResourceActionHook['collectHooks']>[0]['preHooks'];
|
|
19
|
+
};
|
|
20
|
+
registerMetadata(inputs: S): Promise<Record<string, unknown>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { strict as assert } from 'assert';
|
|
2
|
+
export class AModule {
|
|
3
|
+
constructor(moduleId) {
|
|
4
|
+
this.moduleId = moduleId;
|
|
5
|
+
}
|
|
6
|
+
registerHooks() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
async registerMetadata(inputs) {
|
|
10
|
+
assert(!!inputs);
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=module.abstract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.abstract.js","sourceRoot":"","sources":["../../src/modules/module.abstract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAO1C,MAAM,OAAgB,OAAO;IAO3B,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAID,aAAa;QAQX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,MAAS;QAC9B,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
import { Constructable } from '../app.type.js';
|
|
2
|
-
import { type IModuleOptions } from '../decorators/module.decorator.js';
|
|
1
|
+
import type { Constructable, ModuleSchemaInputs, UnknownModule } from '../app.type.js';
|
|
3
2
|
import { CommitHook } from '../functions/hook/commit.hook.js';
|
|
4
3
|
import { ModelActionHook } from '../functions/hook/model-action.hook.js';
|
|
5
4
|
import { ResourceActionHook } from '../functions/hook/resource-action.hook.js';
|
|
6
|
-
import {
|
|
5
|
+
import { OverlayDataRepository } from '../overlays/overlay-data.repository.js';
|
|
6
|
+
import { EventService } from '../services/event/event.service.js';
|
|
7
|
+
import { InputService } from '../services/input/input.service.js';
|
|
8
|
+
type ModuleOptions = {
|
|
9
|
+
packageName: string;
|
|
10
|
+
};
|
|
7
11
|
export declare class ModuleContainer {
|
|
8
|
-
private readonly
|
|
9
|
-
private readonly
|
|
10
|
-
private readonly
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
private readonly eventService;
|
|
13
|
+
private readonly inputService;
|
|
14
|
+
private readonly overlayDataRepository;
|
|
15
|
+
private modules;
|
|
16
|
+
constructor(eventService: EventService, inputService: InputService, overlayDataRepository: OverlayDataRepository);
|
|
17
|
+
apply(): Promise<{
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
getMetadata(module: Constructable<UnknownModule> | string): ModuleContainer['modules'][0] | undefined;
|
|
21
|
+
getMetadataIndex(module: Constructable<UnknownModule> | string): number;
|
|
22
|
+
getModuleInstanceInputKeys(moduleId: string): string[];
|
|
23
|
+
load<M extends UnknownModule>(module: Constructable<M> | string, moduleId: string, inputs: ModuleSchemaInputs<M>): void;
|
|
24
|
+
order(modules: (Constructable<UnknownModule> | string)[]): void;
|
|
25
|
+
register(module: Constructable<UnknownModule>, properties: ModuleOptions): void;
|
|
26
|
+
registerHooks({ postCommitHooks, postModelActionHooks, postResourceActionHooks, preCommitHooks, preModelActionHooks, preResourceActionHooks, }?: {
|
|
27
|
+
postCommitHooks?: Parameters<CommitHook['collectHooks']>[0]['postHooks'];
|
|
28
|
+
postModelActionHooks?: Parameters<ModelActionHook['collectHooks']>[0]['postHooks'];
|
|
29
|
+
postResourceActionHooks?: Parameters<ResourceActionHook['collectHooks']>[0]['postHooks'];
|
|
30
|
+
preCommitHooks?: Parameters<CommitHook['collectHooks']>[0]['preHooks'];
|
|
31
|
+
preModelActionHooks?: Parameters<ModelActionHook['collectHooks']>[0]['preHooks'];
|
|
32
|
+
preResourceActionHooks?: Parameters<ResourceActionHook['collectHooks']>[0]['preHooks'];
|
|
33
|
+
}): void;
|
|
20
34
|
reset(): void;
|
|
21
|
-
|
|
22
|
-
unload(module: Constructable<IModule<unknown>>): void;
|
|
35
|
+
unload(module: Constructable<UnknownModule>): void;
|
|
23
36
|
}
|
|
24
37
|
export declare class ModuleContainerFactory {
|
|
25
38
|
private static instance;
|
|
26
|
-
static create(): Promise<ModuleContainer>;
|
|
39
|
+
static create(forceNew?: boolean): Promise<ModuleContainer>;
|
|
27
40
|
}
|
|
41
|
+
export {};
|