@fjall/deploy-core 0.89.5 → 0.89.6
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 +50 -21
- package/README.md +25 -0
- package/dist/.minified +1 -0
- package/dist/src/__test-utils__/awsMockHelpers.d.ts +20 -0
- package/dist/src/__test-utils__/awsMockHelpers.js +1 -0
- package/dist/src/__test-utils__/index.d.ts +1 -0
- package/dist/src/__test-utils__/index.js +1 -0
- package/dist/src/aws/AwsProvider.js +0 -1
- package/dist/src/aws/SimpleAwsProvider.js +1 -70
- package/dist/src/aws/index.d.ts +4 -2
- package/dist/src/aws/index.js +1 -3
- package/dist/src/aws/organisations/accounts.js +10 -10
- package/dist/src/aws/organisations/backup.js +4 -2
- package/dist/src/aws/organisations/costAllocation.js +4 -2
- package/dist/src/aws/organisations/delegatedAdmin.d.ts +9 -0
- package/dist/src/aws/organisations/delegatedAdmin.js +43 -0
- package/dist/src/aws/organisations/identityCentre.d.ts +1 -1
- package/dist/src/aws/organisations/identityCentre.js +6 -2
- package/dist/src/aws/organisations/index.d.ts +4 -3
- package/dist/src/aws/organisations/index.js +1 -12
- package/dist/src/aws/organisations/ipam.js +4 -2
- package/dist/src/aws/organisations/organisation.js +27 -18
- package/dist/src/aws/organisations/organisationalUnits.d.ts +26 -6
- package/dist/src/aws/organisations/organisationalUnits.js +149 -35
- package/dist/src/aws/organisations/policies.js +4 -3
- package/dist/src/aws/organisations/ram.js +6 -2
- package/dist/src/aws/organisations/serviceAccess.js +12 -6
- package/dist/src/aws/organisations/trustedAccess.js +6 -2
- package/dist/src/aws/organisations/types.d.ts +23 -1
- package/dist/src/aws/organisations/types.js +1 -16
- package/dist/src/aws/utils/__tests__/cloudformationTestHelpers.d.ts +6 -0
- package/dist/src/aws/utils/__tests__/cloudformationTestHelpers.js +1 -0
- package/dist/src/aws/utils/cloudformationEventHelpers.d.ts +48 -0
- package/dist/src/aws/utils/cloudformationEventHelpers.js +1 -0
- package/dist/src/aws/utils/cloudformationEventTypes.d.ts +45 -0
- package/dist/src/aws/utils/cloudformationEventTypes.js +1 -0
- package/dist/src/aws/utils/cloudformationEvents.d.ts +8 -54
- package/dist/src/aws/utils/cloudformationEvents.js +1 -596
- package/dist/src/aws/utils/index.d.ts +5 -0
- package/dist/src/aws/utils/index.js +1 -0
- package/dist/src/aws/utils/stackStatus.js +1 -90
- package/dist/src/events/index.d.ts +13 -0
- package/dist/src/events/index.js +1 -0
- package/dist/src/index.d.ts +34 -17
- package/dist/src/index.js +41 -21
- package/dist/src/orchestration/__tests__/cascadeTestHelpers.d.ts +12 -0
- package/dist/src/orchestration/__tests__/cascadeTestHelpers.js +78 -0
- package/dist/src/orchestration/activeDeploymentGuard.d.ts +10 -0
- package/dist/src/orchestration/activeDeploymentGuard.js +39 -0
- package/dist/src/orchestration/applicationDeploy.js +46 -229
- package/dist/src/orchestration/applicationDeployHelpers.d.ts +39 -0
- package/dist/src/orchestration/applicationDeployHelpers.js +223 -0
- package/dist/src/orchestration/applicationDestroy.d.ts +14 -0
- package/dist/src/orchestration/applicationDestroy.js +131 -0
- package/dist/src/orchestration/builders/dockerBuilder.d.ts +17 -0
- package/dist/src/orchestration/builders/dockerBuilder.js +98 -0
- package/dist/src/orchestration/builders/frameworkRegistry.d.ts +23 -0
- package/dist/src/orchestration/builders/frameworkRegistry.js +1 -0
- package/dist/src/orchestration/builders/index.d.ts +4 -0
- package/dist/src/orchestration/builders/index.js +1 -0
- package/dist/src/orchestration/builders/openNextBuilder.d.ts +21 -0
- package/dist/src/orchestration/builders/openNextBuilder.js +144 -0
- package/dist/src/orchestration/cascadeDestroyHelpers.d.ts +30 -0
- package/dist/src/orchestration/cascadeDestroyHelpers.js +1 -0
- package/dist/src/orchestration/cascadeHelpers.d.ts +46 -0
- package/dist/src/orchestration/cascadeHelpers.js +160 -0
- package/dist/src/orchestration/contextHelpers.d.ts +46 -2
- package/dist/src/orchestration/contextHelpers.js +93 -1
- package/dist/src/orchestration/destroy.d.ts +13 -0
- package/dist/src/orchestration/destroy.js +67 -0
- package/dist/src/orchestration/detectionPipeline.d.ts +2 -11
- package/dist/src/orchestration/detectionPipeline.js +29 -10
- package/dist/src/orchestration/dockerBuildHelper.d.ts +10 -0
- package/dist/src/orchestration/dockerBuildHelper.js +49 -0
- package/dist/src/orchestration/dockerInterface.d.ts +4 -2
- package/dist/src/orchestration/index.d.ts +8 -1
- package/dist/src/orchestration/index.js +1 -3
- package/dist/src/orchestration/manifestSecretParser.d.ts +11 -0
- package/dist/src/orchestration/manifestSecretParser.js +1 -0
- package/dist/src/orchestration/openNextBuild.d.ts +28 -0
- package/dist/src/orchestration/openNextBuild.js +243 -0
- package/dist/src/orchestration/organisationDeploy.js +110 -233
- package/dist/src/orchestration/organisationDestroy.d.ts +24 -0
- package/dist/src/orchestration/organisationDestroy.js +189 -0
- package/dist/src/orchestration/organisationSetup.d.ts +6 -4
- package/dist/src/orchestration/organisationSetup.js +28 -8
- package/dist/src/orchestration/resolveOperation.js +68 -6
- package/dist/src/orchestration/serviceFactory.d.ts +4 -0
- package/dist/src/orchestration/serviceFactory.js +1 -16
- package/dist/src/orchestration/spawnHelpers.d.ts +47 -0
- package/dist/src/orchestration/spawnHelpers.js +1 -0
- package/dist/src/orchestration/stackCleanup.d.ts +39 -0
- package/dist/src/orchestration/stackCleanup.js +1 -0
- package/dist/src/orchestration/welcomeImageHelper.d.ts +15 -0
- package/dist/src/orchestration/welcomeImageHelper.js +64 -0
- package/dist/src/services/application/ApplicationStackService.d.ts +21 -30
- package/dist/src/services/application/ApplicationStackService.js +16 -234
- package/dist/src/services/application/applicationStackHelpers.d.ts +46 -0
- package/dist/src/services/application/applicationStackHelpers.js +248 -0
- package/dist/src/services/application/index.d.ts +1 -0
- package/dist/src/services/application/index.js +1 -1
- package/dist/src/services/index.d.ts +6 -0
- package/dist/src/services/index.js +1 -0
- package/dist/src/services/infrastructure/CdkArgumentBuilder.js +1 -67
- package/dist/src/services/infrastructure/CdkCommandRunner.d.ts +10 -2
- package/dist/src/services/infrastructure/CdkCommandRunner.js +18 -15
- package/dist/src/services/infrastructure/CdkErrorFormatter.js +16 -194
- package/dist/src/services/infrastructure/CdkEventMonitoring.js +1 -41
- package/dist/src/services/infrastructure/CdkOutputAnalyser.js +1 -1
- package/dist/src/services/infrastructure/CdkOutputParser.js +2 -33
- package/dist/src/services/infrastructure/CdkProcessManager.d.ts +5 -0
- package/dist/src/services/infrastructure/CdkProcessManager.js +81 -47
- package/dist/src/services/infrastructure/CdkService.d.ts +7 -53
- package/dist/src/services/infrastructure/CdkService.js +41 -83
- package/dist/src/services/infrastructure/CdkServiceTypes.d.ts +50 -0
- package/dist/src/services/infrastructure/CdkServiceTypes.js +0 -0
- package/dist/src/services/infrastructure/CloudFormationService.js +9 -10
- package/dist/src/services/infrastructure/ICdkProcessManager.d.ts +27 -0
- package/dist/src/services/infrastructure/ICdkProcessManager.js +1 -0
- package/dist/src/services/infrastructure/__tests__/cloudFormationTestHelpers.d.ts +9 -0
- package/dist/src/services/infrastructure/__tests__/cloudFormationTestHelpers.js +1 -0
- package/dist/src/services/infrastructure/cdkServiceHelpers.d.ts +9 -0
- package/dist/src/services/infrastructure/cdkServiceHelpers.js +1 -0
- package/dist/src/services/infrastructure/constructMapEnrichment.d.ts +7 -0
- package/dist/src/services/infrastructure/constructMapEnrichment.js +1 -0
- package/dist/src/services/infrastructure/index.d.ts +3 -1
- package/dist/src/services/infrastructure/index.js +1 -7
- package/dist/src/services/supporting/TemplateHashService.js +1 -1
- package/dist/src/services/supporting/helpers.js +1 -81
- package/dist/src/services/supporting/index.js +1 -3
- package/dist/src/steps/index.d.ts +1 -0
- package/dist/src/steps/index.js +1 -0
- package/dist/src/steps/stepRegistry.d.ts +71 -0
- package/dist/src/steps/stepRegistry.js +505 -0
- package/dist/src/types/FjallState.js +1 -118
- package/dist/src/types/ProgressEvent.js +1 -48
- package/dist/src/types/application/ApplicationServiceTypes.js +1 -30
- package/dist/src/types/application/index.js +1 -1
- package/dist/src/types/callbacks.d.ts +76 -4
- package/dist/src/types/callbacks.js +0 -1
- package/dist/src/types/constants.d.ts +2 -0
- package/dist/src/types/constants.js +1 -6
- package/dist/src/types/credentials.js +0 -1
- package/dist/src/types/deployment/DeploymentServiceTypes.d.ts +5 -2
- package/dist/src/types/deployment/DeploymentServiceTypes.js +1 -1
- package/dist/src/types/deployment/DeploymentTypes.js +0 -1
- package/dist/src/types/deployment/cloudformation.js +0 -1
- package/dist/src/types/deployment/index.d.ts +3 -1
- package/dist/src/types/deployment/index.js +1 -1
- package/dist/src/types/deployment/parallel.js +1 -10
- package/dist/src/types/deploymentEventSchema.d.ts +158 -0
- package/dist/src/types/deploymentEventSchema.js +1 -0
- package/dist/src/types/detection.d.ts +22 -0
- package/dist/src/types/detection.js +1 -0
- package/dist/src/types/entitlements.d.ts +31 -0
- package/dist/src/types/entitlements.js +0 -0
- package/dist/src/types/errors/CdkError.js +1 -20
- package/dist/src/types/errors/ServiceError.d.ts +2 -1
- package/dist/src/types/errors/ServiceError.js +1 -119
- package/dist/src/types/errors/index.d.ts +2 -0
- package/dist/src/types/errors/index.js +1 -0
- package/dist/src/types/events.d.ts +3 -9
- package/dist/src/types/events.js +0 -5
- package/dist/src/types/frameworkBuilder.d.ts +96 -0
- package/dist/src/types/frameworkBuilder.js +8 -0
- package/dist/src/types/index.d.ts +19 -4
- package/dist/src/types/index.js +1 -9
- package/dist/src/types/operations.d.ts +3 -2
- package/dist/src/types/operations.js +1 -285
- package/dist/src/types/orgConfig.d.ts +2 -10
- package/dist/src/types/orgConfig.js +0 -11
- package/dist/src/types/params.d.ts +60 -1
- package/dist/src/types/patternDetection.d.ts +14 -16
- package/dist/src/types/patternDetection.js +14 -18
- package/dist/src/types/patternTypes.d.ts +19 -0
- package/dist/src/types/patternTypes.js +1 -0
- package/dist/src/types/stepDefinitions.d.ts +163 -0
- package/dist/src/types/stepDefinitions.js +98 -0
- package/dist/src/types/validation.js +0 -1
- package/dist/src/util/dockerfileDetection.d.ts +5 -0
- package/dist/src/util/dockerfileDetection.js +1 -0
- package/dist/src/util/index.d.ts +4 -3
- package/dist/src/util/index.js +1 -3
- package/dist/src/util/sequencedCallbacks.d.ts +44 -0
- package/dist/src/util/sequencedCallbacks.js +1 -0
- package/package.json +49 -8
- package/dist/src/aws/utils/CloudFormationFailureAnalyser.d.ts +0 -32
- package/dist/src/aws/utils/CloudFormationFailureAnalyser.js +0 -228
- package/dist/src/aws/utils/errors.d.ts +0 -26
- package/dist/src/aws/utils/errors.js +0 -59
- package/dist/src/util/fsHelpers.d.ts +0 -4
- package/dist/src/util/fsHelpers.js +0 -16
- package/dist/src/util/securityHelpers.d.ts +0 -31
- package/dist/src/util/securityHelpers.js +0 -124
- package/dist/src/util/singleton.d.ts +0 -2
- package/dist/src/util/singleton.js +0 -9
- package/dist/src/util/sleep.d.ts +0 -4
- package/dist/src/util/sleep.js +0 -4
|
@@ -1,90 +1 @@
|
|
|
1
|
-
|
|
2
|
-
CREATE_IN_PROGRESS: {
|
|
3
|
-
safeToRedeploy: "No",
|
|
4
|
-
description: "Stack is busy with creation"
|
|
5
|
-
},
|
|
6
|
-
CREATE_COMPLETE: {
|
|
7
|
-
safeToRedeploy: "Yes",
|
|
8
|
-
description: "Stack was successfully created"
|
|
9
|
-
},
|
|
10
|
-
CREATE_FAILED: {
|
|
11
|
-
safeToRedeploy: "Maybe",
|
|
12
|
-
description: "Stack creation failed - fix issues before redeploying"
|
|
13
|
-
},
|
|
14
|
-
DELETE_IN_PROGRESS: {
|
|
15
|
-
safeToRedeploy: "No",
|
|
16
|
-
description: "Stack is busy with deletion"
|
|
17
|
-
},
|
|
18
|
-
DELETE_COMPLETE: {
|
|
19
|
-
safeToRedeploy: "Yes",
|
|
20
|
-
description: "Stack was successfully deleted"
|
|
21
|
-
},
|
|
22
|
-
DELETE_FAILED: {
|
|
23
|
-
safeToRedeploy: "Maybe",
|
|
24
|
-
description: "Stack deletion failed - investigate before redeploying"
|
|
25
|
-
},
|
|
26
|
-
ROLLBACK_IN_PROGRESS: {
|
|
27
|
-
safeToRedeploy: "No",
|
|
28
|
-
description: "Stack is rolling back due to failure"
|
|
29
|
-
},
|
|
30
|
-
ROLLBACK_COMPLETE: {
|
|
31
|
-
safeToRedeploy: "Yes",
|
|
32
|
-
description: "Stack rolled back due to failure - fix issues before redeploying"
|
|
33
|
-
},
|
|
34
|
-
ROLLBACK_FAILED: {
|
|
35
|
-
safeToRedeploy: "No",
|
|
36
|
-
description: "Rollback failed - manual intervention needed"
|
|
37
|
-
},
|
|
38
|
-
UPDATE_IN_PROGRESS: {
|
|
39
|
-
safeToRedeploy: "No",
|
|
40
|
-
description: "Stack update is in progress"
|
|
41
|
-
},
|
|
42
|
-
UPDATE_COMPLETE: {
|
|
43
|
-
safeToRedeploy: "Yes",
|
|
44
|
-
description: "Stack update completed successfully"
|
|
45
|
-
},
|
|
46
|
-
UPDATE_FAILED: {
|
|
47
|
-
safeToRedeploy: "Maybe",
|
|
48
|
-
description: "Stack update failed - fix issues before redeploying"
|
|
49
|
-
},
|
|
50
|
-
UPDATE_ROLLBACK_IN_PROGRESS: {
|
|
51
|
-
safeToRedeploy: "No",
|
|
52
|
-
description: "Stack is rolling back an update"
|
|
53
|
-
},
|
|
54
|
-
UPDATE_ROLLBACK_COMPLETE: {
|
|
55
|
-
safeToRedeploy: "Yes",
|
|
56
|
-
description: "Stack update rolled back successfully"
|
|
57
|
-
},
|
|
58
|
-
UPDATE_ROLLBACK_FAILED: {
|
|
59
|
-
safeToRedeploy: "No",
|
|
60
|
-
description: "Update rollback failed - manual fix needed"
|
|
61
|
-
},
|
|
62
|
-
IMPORT_IN_PROGRESS: {
|
|
63
|
-
safeToRedeploy: "No",
|
|
64
|
-
description: "Resource import in progress"
|
|
65
|
-
},
|
|
66
|
-
IMPORT_COMPLETE: {
|
|
67
|
-
safeToRedeploy: "Yes",
|
|
68
|
-
description: "Resource import completed successfully"
|
|
69
|
-
},
|
|
70
|
-
IMPORT_ROLLBACK_IN_PROGRESS: {
|
|
71
|
-
safeToRedeploy: "No",
|
|
72
|
-
description: "Import rollback in progress"
|
|
73
|
-
},
|
|
74
|
-
IMPORT_ROLLBACK_COMPLETE: {
|
|
75
|
-
safeToRedeploy: "Yes",
|
|
76
|
-
description: "Import rollback completed"
|
|
77
|
-
},
|
|
78
|
-
IMPORT_ROLLBACK_FAILED: {
|
|
79
|
-
safeToRedeploy: "No",
|
|
80
|
-
description: "Import rollback failed - manual fix needed"
|
|
81
|
-
},
|
|
82
|
-
REVIEW_IN_PROGRESS: {
|
|
83
|
-
safeToRedeploy: "Yes",
|
|
84
|
-
description: "Stack is in review mode"
|
|
85
|
-
},
|
|
86
|
-
UNKNOWN: {
|
|
87
|
-
safeToRedeploy: "Maybe",
|
|
88
|
-
description: "Unknown stack status"
|
|
89
|
-
}
|
|
90
|
-
};
|
|
1
|
+
const e={CREATE_IN_PROGRESS:{safeToRedeploy:"No",description:"Stack is busy with creation"},CREATE_COMPLETE:{safeToRedeploy:"Yes",description:"Stack was successfully created"},CREATE_FAILED:{safeToRedeploy:"Maybe",description:"Stack creation failed - fix issues before redeploying"},DELETE_IN_PROGRESS:{safeToRedeploy:"No",description:"Stack is busy with deletion"},DELETE_COMPLETE:{safeToRedeploy:"Yes",description:"Stack was successfully deleted"},DELETE_FAILED:{safeToRedeploy:"Maybe",description:"Stack deletion failed - investigate before redeploying"},ROLLBACK_IN_PROGRESS:{safeToRedeploy:"No",description:"Stack is rolling back due to failure"},ROLLBACK_COMPLETE:{safeToRedeploy:"Yes",description:"Stack rolled back due to failure - fix issues before redeploying"},ROLLBACK_FAILED:{safeToRedeploy:"No",description:"Rollback failed - manual intervention needed"},UPDATE_IN_PROGRESS:{safeToRedeploy:"No",description:"Stack update is in progress"},UPDATE_COMPLETE:{safeToRedeploy:"Yes",description:"Stack update completed successfully"},UPDATE_FAILED:{safeToRedeploy:"Maybe",description:"Stack update failed - fix issues before redeploying"},UPDATE_ROLLBACK_IN_PROGRESS:{safeToRedeploy:"No",description:"Stack is rolling back an update"},UPDATE_ROLLBACK_COMPLETE:{safeToRedeploy:"Yes",description:"Stack update rolled back successfully"},UPDATE_ROLLBACK_FAILED:{safeToRedeploy:"No",description:"Update rollback failed - manual fix needed"},IMPORT_IN_PROGRESS:{safeToRedeploy:"No",description:"Resource import in progress"},IMPORT_COMPLETE:{safeToRedeploy:"Yes",description:"Resource import completed successfully"},IMPORT_ROLLBACK_IN_PROGRESS:{safeToRedeploy:"No",description:"Import rollback in progress"},IMPORT_ROLLBACK_COMPLETE:{safeToRedeploy:"Yes",description:"Import rollback completed"},IMPORT_ROLLBACK_FAILED:{safeToRedeploy:"No",description:"Import rollback failed - manual fix needed"},REVIEW_IN_PROGRESS:{safeToRedeploy:"Yes",description:"Stack is in review mode"},UNKNOWN:{safeToRedeploy:"Maybe",description:"Unknown stack status"}};export{e as stackStatusMap};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe deployment event exports.
|
|
3
|
+
*
|
|
4
|
+
* This subpath (`@fjall/deploy-core/events`) is guaranteed to contain NO
|
|
5
|
+
* Node-only imports (fs, child_process, AWS SDK). It is safe to import
|
|
6
|
+
* from client-side webapp code.
|
|
7
|
+
*
|
|
8
|
+
* The canonical schema and constants live in ../types/deploymentEventSchema.ts.
|
|
9
|
+
* This barrel re-exports only the browser-safe subset.
|
|
10
|
+
*/
|
|
11
|
+
export { DeploymentEventSchema, DEPLOYMENT_EVENT_TYPES, DEPLOYMENT_EVENT_RESOURCE_CATEGORIES, CASCADE_PHASES, CASCADE_ACCOUNT_STATUSES } from "../types/deploymentEventSchema.js";
|
|
12
|
+
export type { DeploymentEvent, DeploymentEventType, DeploymentEventResourceCategory, DeploymentEventCascadePhase, DeploymentEventCascadeAccountStatus } from "../types/deploymentEventSchema.js";
|
|
13
|
+
export { toCascadePhase } from "../types/deploymentEventSchema.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DeploymentEventSchema as C,DEPLOYMENT_EVENT_TYPES as T,DEPLOYMENT_EVENT_RESOURCE_CATEGORIES as e,CASCADE_PHASES as A,CASCADE_ACCOUNT_STATUSES as _}from"../types/deploymentEventSchema.js";import{toCascadePhase as t}from"../types/deploymentEventSchema.js";export{_ as CASCADE_ACCOUNT_STATUSES,A as CASCADE_PHASES,e as DEPLOYMENT_EVENT_RESOURCE_CATEGORIES,T as DEPLOYMENT_EVENT_TYPES,C as DeploymentEventSchema,t as toCascadePhase};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,25 +11,42 @@
|
|
|
11
11
|
* responsibility. deploy-core receives credentials and a working
|
|
12
12
|
* directory; it never reads credential files or writes to the terminal.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export { DeploymentEventSchema, DEPLOYMENT_EVENT_TYPES, DEPLOYMENT_EVENT_RESOURCE_CATEGORIES, CASCADE_PHASES, CASCADE_ACCOUNT_STATUSES } from "./types/index.js";
|
|
15
|
+
export type { DeploymentEvent, DeploymentEventType, DeploymentEventResourceCategory, DeploymentEventCascadePhase, DeploymentEventCascadeAccountStatus } from "./types/index.js";
|
|
16
|
+
export type { AwsCredentials, DeployIdentity, DeployCallbacks, StepCompleteStatus, ProgressEvent, ProgressEventType, ResourceEvent, AwsAuthResult, CascadeDeploymentResult, CascadePhase, ApiClientInterface, EntitlementsData, DeployParams, DeployOptions, DeploymentType, DeployResult, DestroyParams, DestroyOptions, DestroyResult, OrgConfig, ProviderAccount, SSOSession, Entitlements } from "./types/index.js";
|
|
15
17
|
export type { AwsProvider, AwsProviderCredentials, AwsSdkClientConstructor } from "./aws/index.js";
|
|
16
18
|
export { SimpleAwsProvider } from "./aws/index.js";
|
|
17
|
-
export { ensureOrganisationExists, describeOrganisation, enablePolicyTypes, enableServiceAccess, enableRamSharing, activateTrustedAccess, enableIpamDelegatedAdmin, updateBackupGlobalSettings, listAccounts, findAccount, createAccount, ensureOrganisationalUnitsExist, placeAccountsInOUs, activateCostAllocationTags, checkIdentityCentreStatus } from "./aws/index.js";
|
|
18
|
-
export type { OrgDetails, OUMap, AccountPlacementResult, AccountInfo, IdentityCentreStatus, BackupGlobalSettings, CostAllocationTag, CreateAccountResult } from "./aws/index.js";
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
19
|
+
export { ensureOrganisationExists, describeOrganisation, enablePolicyTypes, enableServiceAccess, enableRamSharing, activateTrustedAccess, enableIpamDelegatedAdmin, updateBackupGlobalSettings, listAccounts, findAccount, createAccount, ensureOrganisationalUnitsExist, placeAccountsInOUs, buildAccountToOUMap, activateCostAllocationTags, checkIdentityCentreStatus, extractErrorName, isOULeaf, registerSecurityDelegates, SECURITY_SERVICE_PRINCIPALS } from "./aws/index.js";
|
|
20
|
+
export type { OrgDetails, OUMap, OUTree, AccountPlacementResult, AccountInfo, IdentityCentreStatus, BackupGlobalSettings, CostAllocationTag, CreateAccountResult } from "./aws/index.js";
|
|
21
|
+
export { STEP_IDS, STEP_NAMES, INFRASTRUCTURE_STEP_NAMES, INFRA_STEP_NAME } from "./types/index.js";
|
|
22
|
+
export type { StepId, InfrastructureStepName, StepDefinition, StepDeploymentType, Operation, StepContext } from "./types/index.js";
|
|
23
|
+
export type { DeploymentContext, StepOutput, ApplicationDeploymentContext, CallerIdentity, StackOutput, StackOutputsRecord, ValidationResult, DetectionResult, ProgressCallbacks, ApplicationStack, OrganisationType, DeploymentOperation, ApplicationOperation, OrganisationOperation, DeployOrderOptions, ParallelDeployGroupKey, ParallelDestroyGroupKey, OpenNextPattern, AppResourceFlags, ParallelDeploymentResult, ParallelDeployGroup, ParallelOperation, ParallelOperationType, ParallelOperationState, ApplicationErrorType, StackDeploymentData, StackDeploymentOptions, ApplicationDeploymentData, ApplicationDestructionData, FjallStateFile, TemplateHashEntry } from "./types/index.js";
|
|
24
|
+
export { ProgressReporter, APPLICATION_STACKS, ORGANISATION_TYPES, APPLICATION_DEPLOY_ORDER, APPLICATION_DESTROY_ORDER, OPENNEXT_DEPLOY_ORDER, OPENNEXT_DESTROY_ORDER, PARALLEL_DEPLOY_GROUPS, PARALLEL_DESTROY_GROUPS, OPENNEXT_PARALLEL_GROUPS, PARALLEL_OPERATION_TYPES, isApplicationOperation, isOrganisationOperation, getParallelDeployGroups, getParallelDestroyGroups, getApplicationDeployOrder, getApplicationDestroyOrder, getApplicationStackName, getOrganisationStackName, isApplicationStack, getApplicationStepName, getApplicationStepId, toPascalCase, isOpenNextPattern, OPENNEXT_PATTERNS, deriveResourcesFromManifestStacks, STACK_NOT_FOUND_PATTERN, STACK_FAILED_STATE_PATTERN, CDK_NO_STACKS_MATCH, INFRASTRUCTURE_FILENAME, ApplicationError, wrapApplicationError, FjallStateFileSchema, readStateFile, writeStateFile, createEmptyState, deleteStateFile, updateTemplateHash, getStateFilePath, stubCallerIdentity } from "./types/index.js";
|
|
25
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
26
|
+
export { detectPattern } from "./types/index.js";
|
|
27
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
28
|
+
export { detectPayloadPattern } from "./types/index.js";
|
|
29
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
30
|
+
export { detectDatabase } from "./types/index.js";
|
|
31
|
+
export { CloudFormationEventMonitor } from "./aws/index.js";
|
|
32
|
+
export type { AwsClientLike, EventLogWriter, EventFailureAnalyser, EventLogWriterFactory, EventMonitorDeps } from "./aws/index.js";
|
|
33
|
+
export { CdkService, CdkArgumentBuilder, CdkProcessManager, CdkEventMonitor, startStackMonitoring, DEFAULT_DEPLOY_TIMEOUT_MS, isCdkError, formatInfrastructureError, hasCdkDifferences, parseDiffOutput, CloudFormationService, CloudFormationError, TemplateHashService, TemplateHashError, type TemplateComparisonResult, CdkContextBuilder, emitProgress, PROGRESS_MESSAGES, parseBuildPhase, buildStepContextBuildConfig, convertCloudFormationOutputsToRecord, type CloudFormationOutput, ApplicationStackService } from "./services/index.js";
|
|
34
|
+
export type { CdkContext, CdkOptions, CdkOutput, CheckDifferencesResult, CdkServiceOptions, ICdkProcessManager, DiffDetails, CloudFormationCallbacks } from "./services/index.js";
|
|
35
|
+
export { CdkError } from "./types/errors/index.js";
|
|
36
|
+
export { type ServiceErrorDetails, type ServiceError, BaseServiceError, ValidationError, AuthError, AwsError, DeploymentError, NetworkError, FileSystemError, ConfigError, toServiceError } from "./types/errors/index.js";
|
|
37
|
+
export { filterDangerousEnvVars, maskSensitiveOutput, parseShellArgs, sleep } from "@fjall/util";
|
|
38
|
+
export { hasDockerfile } from "./util/dockerfileDetection.js";
|
|
39
|
+
export { createSequencedCallbacks } from "./util/sequencedCallbacks.js";
|
|
40
|
+
export type { CallbackMetadata, SequencedCallbackEvent, SequencedCallbacksResult } from "./util/sequencedCallbacks.js";
|
|
41
|
+
export { fileExists } from "@fjall/util/fsHelpers";
|
|
32
42
|
export { type Result, success, failure, isSuccess, isFailure } from "@fjall/generator";
|
|
33
43
|
export { deploy } from "./orchestration/index.js";
|
|
44
|
+
export { destroy } from "./orchestration/index.js";
|
|
45
|
+
export { partitionAccounts } from "./orchestration/index.js";
|
|
46
|
+
export { runOpenNextBuild } from "./orchestration/index.js";
|
|
34
47
|
export { runOrganisationSetup } from "./orchestration/index.js";
|
|
35
|
-
export type { OrgSetupPhase, OrgSetupCallbacks, OrgSetupConfig, OrgSetupResult, DockerProvider, DockerBuildParams, DockerBuildResult, ECRInitParams, ECRInitResult, TagImagesParams, TagImagesResult, DomainDeployProvider, DomainConfig, DomainDeployResult, DeployServices
|
|
48
|
+
export type { OrgSetupPhase, OrgSetupCallbacks, OrgSetupConfig, OrgSetupResult, DockerProvider, DockerProgressCallback, DockerBuildParams, DockerBuildResult, ECRInitParams, ECRInitResult, TagImagesParams, TagImagesResult, DomainDeployProvider, DomainConfig, DomainDeployResult, DeployServices } from "./orchestration/index.js";
|
|
49
|
+
export type { FrameworkBuilder, FrameworkDetection, BuildPlan, BuildCommand, BuildCallbacks, DetectionContext, BuildOptions } from "./types/index.js";
|
|
50
|
+
export { FrameworkRegistry, type ResolvedBuilder } from "./orchestration/index.js";
|
|
51
|
+
export { openNextBuilder, dockerBuilder } from "./orchestration/index.js";
|
|
52
|
+
export { StepRegistry, getDestroyStepId } from "./steps/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -11,35 +11,55 @@
|
|
|
11
11
|
* responsibility. deploy-core receives credentials and a working
|
|
12
12
|
* directory; it never reads credential files or writes to the terminal.
|
|
13
13
|
*/
|
|
14
|
+
// Deployment event schema (canonical source for CLI + webapp)
|
|
15
|
+
export { DeploymentEventSchema, DEPLOYMENT_EVENT_TYPES, DEPLOYMENT_EVENT_RESOURCE_CATEGORIES, CASCADE_PHASES, CASCADE_ACCOUNT_STATUSES } from "./types/index.js";
|
|
14
16
|
export { SimpleAwsProvider } from "./aws/index.js";
|
|
15
17
|
// Organisation setup primitives
|
|
16
|
-
export { ensureOrganisationExists, describeOrganisation, enablePolicyTypes, enableServiceAccess, enableRamSharing, activateTrustedAccess, enableIpamDelegatedAdmin, updateBackupGlobalSettings, listAccounts, findAccount, createAccount, ensureOrganisationalUnitsExist, placeAccountsInOUs, activateCostAllocationTags, checkIdentityCentreStatus } from "./aws/index.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
export { ensureOrganisationExists, describeOrganisation, enablePolicyTypes, enableServiceAccess, enableRamSharing, activateTrustedAccess, enableIpamDelegatedAdmin, updateBackupGlobalSettings, listAccounts, findAccount, createAccount, ensureOrganisationalUnitsExist, placeAccountsInOUs, buildAccountToOUMap, activateCostAllocationTags, checkIdentityCentreStatus, extractErrorName, isOULeaf, registerSecurityDelegates, SECURITY_SERVICE_PRINCIPALS } from "./aws/index.js";
|
|
19
|
+
// Step definitions (canonical source for CLI + webapp)
|
|
20
|
+
export { STEP_IDS, STEP_NAMES, INFRASTRUCTURE_STEP_NAMES, INFRA_STEP_NAME } from "./types/index.js";
|
|
21
|
+
export { ProgressReporter, APPLICATION_STACKS, ORGANISATION_TYPES, APPLICATION_DEPLOY_ORDER, APPLICATION_DESTROY_ORDER, OPENNEXT_DEPLOY_ORDER, OPENNEXT_DESTROY_ORDER, PARALLEL_DEPLOY_GROUPS, PARALLEL_DESTROY_GROUPS, OPENNEXT_PARALLEL_GROUPS, PARALLEL_OPERATION_TYPES, isApplicationOperation, isOrganisationOperation, getParallelDeployGroups, getParallelDestroyGroups, getApplicationDeployOrder, getApplicationDestroyOrder, getApplicationStackName, getOrganisationStackName, isApplicationStack, getApplicationStepName, getApplicationStepId, toPascalCase,
|
|
22
|
+
// Pattern detection (browser-safe pure predicates)
|
|
23
|
+
isOpenNextPattern, OPENNEXT_PATTERNS,
|
|
24
|
+
// Pattern detection (Node fs-based)
|
|
25
|
+
deriveResourcesFromManifestStacks,
|
|
20
26
|
// Constants
|
|
21
|
-
STACK_NOT_FOUND_PATTERN, CDK_NO_STACKS_MATCH, INFRASTRUCTURE_FILENAME,
|
|
27
|
+
STACK_NOT_FOUND_PATTERN, STACK_FAILED_STATE_PATTERN, CDK_NO_STACKS_MATCH, INFRASTRUCTURE_FILENAME,
|
|
22
28
|
// Application errors
|
|
23
29
|
ApplicationError, wrapApplicationError,
|
|
24
30
|
// State management
|
|
25
|
-
FjallStateFileSchema, readStateFile, writeStateFile, createEmptyState, deleteStateFile, updateTemplateHash, getStateFilePath
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
|
|
33
|
-
export {
|
|
31
|
+
FjallStateFileSchema, readStateFile, writeStateFile, createEmptyState, deleteStateFile, updateTemplateHash, getStateFilePath,
|
|
32
|
+
// Caller identity helper
|
|
33
|
+
stubCallerIdentity } from "./types/index.js";
|
|
34
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
35
|
+
export { detectPattern } from "./types/index.js";
|
|
36
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
37
|
+
export { detectPayloadPattern } from "./types/index.js";
|
|
38
|
+
/** @deprecated Use FrameworkRegistry.resolve() instead */
|
|
39
|
+
export { detectDatabase } from "./types/index.js";
|
|
40
|
+
// CloudFormation event monitoring
|
|
41
|
+
export { CloudFormationEventMonitor } from "./aws/index.js";
|
|
42
|
+
// Services (infrastructure, supporting, application)
|
|
43
|
+
export { CdkService, CdkArgumentBuilder, CdkProcessManager, CdkEventMonitor, startStackMonitoring, DEFAULT_DEPLOY_TIMEOUT_MS, isCdkError, formatInfrastructureError, hasCdkDifferences, parseDiffOutput, CloudFormationService, CloudFormationError, TemplateHashService, TemplateHashError, CdkContextBuilder, emitProgress, PROGRESS_MESSAGES, parseBuildPhase, buildStepContextBuildConfig, convertCloudFormationOutputsToRecord, ApplicationStackService } from "./services/index.js";
|
|
34
44
|
// Error types
|
|
35
|
-
export { CdkError } from "./types/errors/
|
|
36
|
-
export { BaseServiceError } from "./types/errors/
|
|
37
|
-
// Utilities
|
|
38
|
-
export { filterDangerousEnvVars, maskSensitiveOutput, parseShellArgs } from "
|
|
39
|
-
|
|
40
|
-
export {
|
|
45
|
+
export { CdkError } from "./types/errors/index.js";
|
|
46
|
+
export { BaseServiceError, ValidationError, AuthError, AwsError, DeploymentError, NetworkError, FileSystemError, ConfigError, toServiceError } from "./types/errors/index.js";
|
|
47
|
+
// Utilities (re-exported from @fjall/util)
|
|
48
|
+
export { filterDangerousEnvVars, maskSensitiveOutput, parseShellArgs, sleep } from "@fjall/util";
|
|
49
|
+
// Dockerfile detection
|
|
50
|
+
export { hasDockerfile } from "./util/dockerfileDetection.js";
|
|
51
|
+
// Sequenced callbacks wrapper
|
|
52
|
+
export { createSequencedCallbacks } from "./util/sequencedCallbacks.js";
|
|
53
|
+
export { fileExists } from "@fjall/util/fsHelpers";
|
|
41
54
|
// Re-export Result from generator for convenience
|
|
42
55
|
export { success, failure, isSuccess, isFailure } from "@fjall/generator";
|
|
43
|
-
// Orchestration — primary entry
|
|
56
|
+
// Orchestration — primary entry points
|
|
44
57
|
export { deploy } from "./orchestration/index.js";
|
|
58
|
+
export { destroy } from "./orchestration/index.js";
|
|
59
|
+
export { partitionAccounts } from "./orchestration/index.js";
|
|
60
|
+
export { runOpenNextBuild } from "./orchestration/index.js";
|
|
45
61
|
export { runOrganisationSetup } from "./orchestration/index.js";
|
|
62
|
+
export { FrameworkRegistry } from "./orchestration/index.js";
|
|
63
|
+
export { openNextBuilder, dockerBuilder } from "./orchestration/index.js";
|
|
64
|
+
// Step registry (filtering & step management)
|
|
65
|
+
export { StepRegistry, getDestroyStepId } from "./steps/index.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DeployCallbacks } from "../../types/callbacks.js";
|
|
2
|
+
import type { OrganisationOperation } from "../../types/operations.js";
|
|
3
|
+
import type { DeployServices } from "../serviceFactory.js";
|
|
4
|
+
export declare const TEST_REGION = "eu-west-1";
|
|
5
|
+
export declare const TEST_ACCOUNT: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function createOrgOperation(): OrganisationOperation;
|
|
11
|
+
export declare function createBaseMockCallbacks(): DeployCallbacks;
|
|
12
|
+
export declare function createMockServices(overrides?: Partial<DeployServices>): DeployServices;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
import { success } from "@fjall/generator";
|
|
3
|
+
export const TEST_REGION = "eu-west-1";
|
|
4
|
+
export const TEST_ACCOUNT = {
|
|
5
|
+
id: "222222222222",
|
|
6
|
+
name: "platform",
|
|
7
|
+
environment: "platform"
|
|
8
|
+
};
|
|
9
|
+
export function createOrgOperation() {
|
|
10
|
+
return {
|
|
11
|
+
kind: "organisation",
|
|
12
|
+
type: "organisation",
|
|
13
|
+
target: "organisation",
|
|
14
|
+
path: "/tmp/test/fjall/organisation"
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function createBaseMockCallbacks() {
|
|
18
|
+
return {
|
|
19
|
+
onLog: vi.fn(),
|
|
20
|
+
onError: vi.fn(),
|
|
21
|
+
onOutput: vi.fn(),
|
|
22
|
+
onStepStart: vi.fn(),
|
|
23
|
+
onStepComplete: vi.fn(),
|
|
24
|
+
onCascadeStart: vi.fn(),
|
|
25
|
+
onCascadePhaseStart: vi.fn(),
|
|
26
|
+
onCascadeAccountStart: vi.fn(),
|
|
27
|
+
onCascadeAccountPhaseChange: vi.fn(),
|
|
28
|
+
onCascadeAccountResourceProgress: vi.fn(),
|
|
29
|
+
onCascadeAccountComplete: vi.fn(),
|
|
30
|
+
onCascadeComplete: vi.fn(),
|
|
31
|
+
onResourceProgress: vi.fn(),
|
|
32
|
+
onCdkOutput: vi.fn()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function createMockServices(overrides) {
|
|
36
|
+
return {
|
|
37
|
+
awsProvider: {
|
|
38
|
+
getRegion: vi.fn().mockReturnValue(TEST_REGION),
|
|
39
|
+
getAccountId: vi.fn().mockReturnValue("111111111111"),
|
|
40
|
+
exportToEnv: vi.fn(),
|
|
41
|
+
getClient: vi.fn(),
|
|
42
|
+
getCredentials: vi.fn().mockReturnValue({
|
|
43
|
+
accessKeyId: "AKIA_TEST",
|
|
44
|
+
secretAccessKey: "secret_test",
|
|
45
|
+
sessionToken: "token_test"
|
|
46
|
+
}),
|
|
47
|
+
assumeRole: vi.fn().mockResolvedValue({
|
|
48
|
+
accessKeyId: "AKIA_ASSUMED",
|
|
49
|
+
secretAccessKey: "secret_assumed",
|
|
50
|
+
sessionToken: "token_assumed"
|
|
51
|
+
}),
|
|
52
|
+
...overrides?.awsProvider
|
|
53
|
+
},
|
|
54
|
+
cdkService: {
|
|
55
|
+
runCdkSynth: vi.fn().mockResolvedValue(success(undefined)),
|
|
56
|
+
runCdkBootstrap: vi.fn().mockResolvedValue(success(undefined)),
|
|
57
|
+
runCdkDeploy: vi.fn().mockResolvedValue(success(undefined)),
|
|
58
|
+
runCdkDestroy: vi.fn().mockResolvedValue(success(undefined)),
|
|
59
|
+
...overrides?.cdkService
|
|
60
|
+
},
|
|
61
|
+
cfnService: {
|
|
62
|
+
getStackOutputs: vi.fn().mockResolvedValue(success([])),
|
|
63
|
+
stackExists: vi.fn().mockResolvedValue(true),
|
|
64
|
+
...overrides?.cfnService
|
|
65
|
+
},
|
|
66
|
+
stackService: {
|
|
67
|
+
...overrides?.stackService
|
|
68
|
+
},
|
|
69
|
+
hashService: {
|
|
70
|
+
...overrides?.hashService
|
|
71
|
+
},
|
|
72
|
+
frameworkRegistry: {
|
|
73
|
+
resolve: vi.fn().mockReturnValue(null),
|
|
74
|
+
...overrides?.frameworkRegistry
|
|
75
|
+
},
|
|
76
|
+
dispose: vi.fn()
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Result } from "@fjall/generator";
|
|
2
|
+
import type { CloudFormationService } from "../services/infrastructure/CloudFormationService.js";
|
|
3
|
+
/**
|
|
4
|
+
* Pre-flight check: query CloudFormation for each stack and reject
|
|
5
|
+
* if any are currently in an IN_PROGRESS or otherwise unsafe state.
|
|
6
|
+
*
|
|
7
|
+
* Uses the canonical stackStatusMap to determine whether a status
|
|
8
|
+
* is blocking — specifically `safeToRedeploy === "No"`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkActiveDeployments(stackNames: string[], cfnService: CloudFormationService): Promise<Result<void>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { success, failure } from "@fjall/generator";
|
|
2
|
+
import { stackStatusMap } from "../aws/utils/stackStatus.js";
|
|
3
|
+
/**
|
|
4
|
+
* Pre-flight check: query CloudFormation for each stack and reject
|
|
5
|
+
* if any are currently in an IN_PROGRESS or otherwise unsafe state.
|
|
6
|
+
*
|
|
7
|
+
* Uses the canonical stackStatusMap to determine whether a status
|
|
8
|
+
* is blocking — specifically `safeToRedeploy === "No"`.
|
|
9
|
+
*/
|
|
10
|
+
export async function checkActiveDeployments(stackNames, cfnService) {
|
|
11
|
+
if (stackNames.length === 0) {
|
|
12
|
+
return success(undefined);
|
|
13
|
+
}
|
|
14
|
+
const statusResults = await Promise.all(stackNames.map(async (name) => {
|
|
15
|
+
const result = await cfnService.getStackStatus(name);
|
|
16
|
+
return { name, result };
|
|
17
|
+
}));
|
|
18
|
+
const busyStacks = [];
|
|
19
|
+
for (const { name, result } of statusResults) {
|
|
20
|
+
if (!result.success) {
|
|
21
|
+
return failure(result.error);
|
|
22
|
+
}
|
|
23
|
+
const stackStatus = result.data;
|
|
24
|
+
if (stackStatus === null || stackStatus.status === "DOES_NOT_EXIST") {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const mapped = stackStatusMap[stackStatus.status];
|
|
28
|
+
if (mapped?.safeToRedeploy === "No") {
|
|
29
|
+
busyStacks.push({ name, status: stackStatus.status });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (busyStacks.length > 0) {
|
|
33
|
+
const details = busyStacks
|
|
34
|
+
.map((s) => ` ${s.name}: ${s.status}`)
|
|
35
|
+
.join("\n");
|
|
36
|
+
return failure(new Error(`Cannot proceed while stacks are busy:\n${details}\n\nWait for the in-progress operation to complete, or use --force to override.`));
|
|
37
|
+
}
|
|
38
|
+
return success(undefined);
|
|
39
|
+
}
|