/
command-model.ts
48 lines (41 loc) · 1.31 KB
/
command-model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { CloudFormationStack, StackEvent } from "../aws/cloudformation/model"
import { Variables } from "../common/model"
import { InternalStack, StackPath } from "../stacks/stack"
import { StackGroupPath } from "../stacks/stack-group"
import { CommandStatus } from "../takomo-core/command"
import { Timer } from "../utils/timer"
/**
* Command path.
*/
export type CommandPath = StackGroupPath | StackPath
export type DeploymentOperation = "deploy" | "undeploy"
export const defaultCapabilities = [
"CAPABILITY_IAM",
"CAPABILITY_NAMED_IAM",
"CAPABILITY_AUTO_EXPAND",
]
export interface HookOutputValues {
[hookName: string]: any
}
/**
* A mutable copy of the current command variables during a stack operation.
*/
export interface StackOperationVariables extends Variables {
/**
* Hook output values
*/
readonly hooks: HookOutputValues
}
export interface StackResult {
readonly stack: InternalStack
readonly message: string
readonly status: CommandStatus
readonly events: ReadonlyArray<StackEvent>
readonly success: boolean
readonly timer: Timer
readonly operationType: StackOperationType
readonly stackExistedBeforeOperation: boolean
readonly stackAfterOperation?: CloudFormationStack
readonly error?: Error
}
export type StackOperationType = "CREATE" | "RECREATE" | "UPDATE" | "DELETE"