@aws-cdk/toolkit-lib 0.3.0 → 0.3.2
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/README.md +1 -1
- package/build-info.json +2 -2
- package/db.json.gz +0 -0
- package/lib/api/aws-auth/types.d.ts +79 -1
- package/lib/api/aws-auth/types.js +74 -1
- package/lib/api/cloud-assembly/cached-source.d.ts +1 -0
- package/lib/api/cloud-assembly/cached-source.js +2 -1
- package/lib/api/cloud-assembly/private/borrowed-assembly.d.ts +1 -0
- package/lib/api/cloud-assembly/private/borrowed-assembly.js +2 -1
- package/lib/api/cloud-assembly/private/context-aware-source.js +2 -2
- package/lib/api/cloud-assembly/private/prepare-source.d.ts +1 -0
- package/lib/api/cloud-assembly/private/prepare-source.js +2 -1
- package/lib/api/cloud-assembly/private/source-builder.js +3 -3
- package/lib/api/cloud-assembly/private/stack-assembly.d.ts +1 -0
- package/lib/api/cloud-assembly/private/stack-assembly.js +2 -5
- package/lib/api/shared-private.d.ts +1 -0
- package/lib/api/shared-private.js +99 -49
- package/lib/api/shared-private.js.map +2 -2
- package/lib/api/shared-public.d.ts +162 -0
- package/lib/api/shared-public.js +940 -12
- package/lib/api/shared-public.js.map +4 -4
- package/lib/index_bg.wasm +0 -0
- package/lib/toolkit/private/index.d.ts +2 -1
- package/lib/toolkit/private/index.js +1 -1
- package/lib/toolkit/toolkit.d.ts +17 -0
- package/lib/toolkit/toolkit.js +22 -5
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["shared-public.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.ts", "../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts", "../../../tmp-toolkit-helpers/src/payloads/diff.ts", "../../../tmp-toolkit-helpers/src/payloads/hotswap.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport {\n ToolkitError,\n AuthenticationError,\n AssemblyError,\n} from '../../../tmp-toolkit-helpers/src/api/toolkit-error';\n\nexport {\n ExpandStackSelection,\n StackSelectionStrategy,\n StackSelector,\n} from '../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector';\n\nexport type {\n IoMessageLevel,\n IoMessageCode,\n IoMessage,\n IoRequest,\n} from '../../../tmp-toolkit-helpers/src/api/io/io-message';\nexport type { IIoHost } from '../../../tmp-toolkit-helpers/src/api/io/io-host';\nexport type { ToolkitAction } from '../../../tmp-toolkit-helpers/src/api/io/toolkit-action';\n\nexport * from '../../../tmp-toolkit-helpers/src/payloads';\n", "import type * as cxapi from '@aws-cdk/cx-api';\n\nconst TOOLKIT_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ToolkitError');\nconst AUTHENTICATION_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AuthenticationError');\nconst ASSEMBLY_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AssemblyError');\nconst CONTEXT_PROVIDER_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ContextProviderError');\n\n/**\n * Represents a general toolkit error in the AWS CDK Toolkit.\n */\nexport class ToolkitError extends Error {\n /**\n * Determines if a given error is an instance of ToolkitError.\n */\n public static isToolkitError(x: any): x is ToolkitError {\n return x !== null && typeof(x) === 'object' && TOOLKIT_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AuthenticationError.\n */\n public static isAuthenticationError(x: any): x is AuthenticationError {\n return this.isToolkitError(x) && AUTHENTICATION_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isAssemblyError(x: any): x is AssemblyError {\n return this.isToolkitError(x) && ASSEMBLY_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isContextProviderError(x: any): x is ContextProviderError {\n return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;\n }\n\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): ToolkitError {\n return new ToolkitError(message, 'toolkit', error);\n }\n\n /**\n * The type of the error, defaults to \"toolkit\".\n */\n public readonly type: string;\n\n /**\n * Denotes the source of the error as the toolkit.\n */\n public readonly source: 'toolkit' | 'user';\n\n /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n constructor(message: string, type: string = 'toolkit', cause?: unknown) {\n super(message);\n Object.setPrototypeOf(this, ToolkitError.prototype);\n Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });\n this.name = new.target.name;\n this.type = type;\n this.source = 'toolkit';\n this.cause = cause;\n }\n}\n\n/**\n * Represents an authentication-specific error in the AWS CDK Toolkit.\n */\nexport class AuthenticationError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'authentication');\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n Object.defineProperty(this, AUTHENTICATION_ERROR_SYMBOL, { value: true });\n }\n}\n\n/**\n * Represents an error causes by cloud assembly synthesis\n *\n * This includes errors thrown during app execution, as well as failing annotations.\n */\nexport class AssemblyError extends ToolkitError {\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): AssemblyError {\n return new AssemblyError(message, undefined, error);\n }\n\n /**\n * An AssemblyError with a list of stacks as cause\n */\n public static withStacks(message: string, stacks?: cxapi.CloudFormationStackArtifact[]): AssemblyError {\n return new AssemblyError(message, stacks);\n }\n\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n /**\n * The stacks that caused the error, if available\n *\n * The `messages` property of each `cxapi.CloudFormationStackArtifact` will contain the respective errors.\n * Absence indicates synthesis didn't fully complete.\n */\n public readonly stacks?: cxapi.CloudFormationStackArtifact[];\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly', cause);\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n }\n}\n\n/**\n * Represents an error originating from a Context Provider\n */\nexport class ContextProviderError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'context-provider');\n Object.setPrototypeOf(this, ContextProviderError.prototype);\n Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });\n }\n}\n", "/**\n * Which stacks should be selected from a cloud assembly\n */\nexport enum StackSelectionStrategy {\n /**\n * Returns all stacks in the app regardless of patterns,\n * including stacks inside nested assemblies.\n */\n ALL_STACKS = 'all-stacks',\n\n /**\n * Returns all stacks in the main (top level) assembly only.\n */\n MAIN_ASSEMBLY = 'main-assembly',\n\n /**\n * If the assembly includes a single stack, returns it.\n * Otherwise throws an exception.\n */\n ONLY_SINGLE = 'only-single',\n\n /**\n * Return stacks matched by patterns.\n * If no stacks are found, execution is halted successfully.\n * Most likely you don't want to use this but `StackSelectionStrategy.MUST_MATCH_PATTERN`\n */\n PATTERN_MATCH = 'pattern-match',\n\n /**\n * Return stacks matched by patterns.\n * Throws an exception if the patterns don't match at least one stack in the assembly.\n */\n PATTERN_MUST_MATCH = 'pattern-must-match',\n\n /**\n * Returns if exactly one stack is matched by the pattern(s).\n * Throws an exception if no stack, or more than exactly one stack are matched.\n */\n PATTERN_MUST_MATCH_SINGLE = 'pattern-must-match-single',\n}\n\n/**\n * When selecting stacks, what other stacks to include because of dependencies\n */\nexport enum ExpandStackSelection {\n /**\n * Don't select any extra stacks\n */\n NONE = 'none',\n\n /**\n * Include stacks that this stack depends on\n */\n UPSTREAM = 'upstream',\n\n /**\n * Include stacks that depend on this stack\n */\n DOWNSTREAM = 'downstream',\n\n /**\n * @TODO\n * Include both directions.\n * I.e. stacks that this stack depends on, and stacks that depend on this stack.\n */\n // FULL = 'full',\n}\n\n/**\n * A specification of which stacks should be selected\n */\nexport interface StackSelector {\n /**\n * The behavior if if no selectors are provided.\n */\n strategy: StackSelectionStrategy;\n\n /**\n * A list of patterns to match the stack hierarchical ids\n * Only used with `PATTERN_*` selection strategies.\n */\n patterns?: string[];\n\n /**\n * Expand the selection to upstream/downstream stacks.\n * @default ExpandStackSelection.None only select the specified/matched stacks\n */\n expand?: ExpandStackSelection;\n\n /**\n * By default, we throw an exception if the assembly contains no stacks.\n * Set to `false`, to halt execution for empty assemblies without error.\n *\n * Note that actions can still throw if a stack selection result is empty,\n * but the assembly contains stacks in principle.\n *\n * @default true\n */\n failOnEmpty?: boolean;\n}\n", "import type { Duration } from './types';\n\n/**\n * Different types of permission related changes in a diff\n */\nexport enum PermissionChangeType {\n /**\n * No permission changes\n */\n NONE = 'none',\n\n /**\n * Permissions are broadening\n */\n BROADENING = 'broadening',\n\n /**\n * Permissions are changed but not broadening\n */\n NON_BROADENING = 'non-broadening',\n}\n\n/**\n * Output of the diff command\n */\nexport interface DiffResult extends Duration {\n /**\n * Stack diff formatted as a string\n */\n readonly formattedStackDiff: string;\n\n /**\n * Security diff formatted as a string\n */\n readonly formattedSecurityDiff: string;\n}\n", "import type { PropertyDifference, Resource } from '@aws-cdk/cloudformation-diff';\nimport type * as cxapi from '@aws-cdk/cx-api';\nimport type { Duration } from './types';\nimport type { ResourceMetadata } from '../api/resource-metadata/resource-metadata';\n\n/**\n * A resource affected by a change\n */\nexport interface AffectedResource {\n /**\n * The logical ID of the affected resource in the template\n */\n readonly logicalId: string;\n /**\n * The CloudFormation type of the resource\n * This could be a custom type.\n */\n readonly resourceType: string;\n /**\n * The friendly description of the affected resource\n */\n readonly description?: string;\n /**\n * The physical name of the resource when deployed.\n *\n * A physical name is not always available, e.g. new resources will not have one until after the deployment\n */\n readonly physicalName?: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * Represents a change in a resource\n */\nexport interface ResourceChange {\n /**\n * The logical ID of the resource which is being changed\n */\n readonly logicalId: string;\n /**\n * The value the resource is being updated from\n */\n readonly oldValue: Resource;\n /**\n * The value the resource is being updated to\n */\n readonly newValue: Resource;\n /**\n * The changes made to the resource properties\n */\n readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * A change that can be hotswapped\n */\nexport interface HotswappableChange {\n /**\n * The resource change that is causing the hotswap.\n */\n readonly cause: ResourceChange;\n /**\n * A list of resources that are being hotswapped as part of the change\n */\n readonly resources: AffectedResource[];\n}\n\nexport enum NonHotswappableReason {\n /**\n * Tags are not hotswappable\n */\n TAGS = 'tags',\n /**\n * Changed resource properties are not hotswappable on this resource type\n */\n PROPERTIES = 'properties',\n /**\n * A stack output has changed\n */\n OUTPUT = 'output',\n /**\n * A dependant resource is not hotswappable\n */\n DEPENDENCY_UNSUPPORTED = 'dependency-unsupported',\n /**\n * The resource type is not hotswappable\n */\n RESOURCE_UNSUPPORTED = 'resource-unsupported',\n /**\n * The resource is created in the deployment\n */\n RESOURCE_CREATION = 'resource-creation',\n /**\n * The resource is removed in the deployment\n */\n RESOURCE_DELETION = 'resource-deletion',\n /**\n * The resource identified by the logical id has its type changed\n */\n RESOURCE_TYPE_CHANGED = 'resource-type-changed',\n /**\n * The nested stack is created in the deployment\n */\n NESTED_STACK_CREATION = 'nested-stack-creation',\n}\n\nexport interface RejectionSubject {\n /**\n * The type of the rejection subject, e.g. Resource or Output\n */\n readonly type: string;\n\n /**\n * The logical ID of the change that is not hotswappable\n */\n readonly logicalId: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\nexport interface ResourceSubject extends RejectionSubject {\n /**\n * A rejected resource\n */\n readonly type: 'Resource';\n /**\n * The type of the rejected resource\n */\n readonly resourceType: string;\n /**\n * The list of properties that are cause for the rejection\n */\n readonly rejectedProperties?: string[];\n}\n\nexport interface OutputSubject extends RejectionSubject {\n /**\n * A rejected output\n */\n readonly type: 'Output';\n}\n\n/**\n * A change that can not be hotswapped\n */\nexport interface NonHotswappableChange {\n /**\n * The subject of the change that was rejected\n */\n readonly subject: ResourceSubject | OutputSubject;\n /**\n * Why was this change was deemed non-hotswappable\n */\n readonly reason: NonHotswappableReason;\n /**\n * Tells the user exactly why this change was deemed non-hotswappable and what its logical ID is.\n * If not specified, `displayReason` default to state that the properties listed in `rejectedChanges` are not hotswappable.\n */\n readonly description: string;\n}\n\nexport interface HotswapDeploymentAttempt {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n}\n\n/**\n * Information about a hotswap deployment\n */\nexport interface HotswapDeploymentDetails {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n /**\n * The changes that were deemed hotswappable\n */\n readonly hotswappableChanges: HotswappableChange[];\n /**\n * The changes that were deemed not hotswappable\n */\n readonly nonHotswappableChanges: NonHotswappableChange[];\n}\n\n/**\n * The result of an attempted hotswap deployment\n */\nexport interface HotswapResult extends Duration, HotswapDeploymentDetails {\n /**\n * Whether hotswapping happened or not.\n *\n * `false` indicates that the deployment could not be hotswapped and full deployment may be attempted as fallback.\n */\n readonly hotswapped: boolean;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAM,uBAAuB,OAAO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AAA,gBAAa;AAIb,EAAAA,uBAAA,YAAS;AAIT,EAAAA,uBAAA,4BAAyB;AAIzB,EAAAA,uBAAA,0BAAuB;AAIvB,EAAAA,uBAAA,uBAAoB;AAIpB,EAAAA,uBAAA,uBAAoB;AAIpB,EAAAA,uBAAA,2BAAwB;AAIxB,EAAAA,uBAAA,2BAAwB;AApCd,SAAAA;AAAA,GAAA;",
|
|
6
|
-
"names": ["StackSelectionStrategy", "ExpandStackSelection", "PermissionChangeType", "NonHotswappableReason"]
|
|
3
|
+
"sources": ["shared-public.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.ts", "../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts", "../../../tmp-toolkit-helpers/src/api/plugin/plugin.ts", "../../../tmp-toolkit-helpers/src/api/plugin/context-provider-plugin.ts", "../../../tmp-toolkit-helpers/src/api/io/private/span.ts", "../../../tmp-toolkit-helpers/src/util/archive.ts", "../../../tmp-toolkit-helpers/src/util/types.ts", "../../../tmp-toolkit-helpers/src/util/yaml-cfn.ts", "../../../tmp-toolkit-helpers/src/util/string-manipulation.ts", "../../../tmp-toolkit-helpers/src/util/version-range.ts", "../../../tmp-toolkit-helpers/src/api/io/private/io-helper.ts", "../../../tmp-toolkit-helpers/src/api/io/private/level-priority.ts", "../../../tmp-toolkit-helpers/src/api/io/private/message-maker.ts", "../../../tmp-toolkit-helpers/src/api/io/private/messages.ts", "../../../tmp-toolkit-helpers/src/api/io/private/io-default-messages.ts", "../../../tmp-toolkit-helpers/src/payloads/diff.ts", "../../../tmp-toolkit-helpers/src/payloads/hotswap.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport {\n ToolkitError,\n AuthenticationError,\n AssemblyError,\n} from '../../../tmp-toolkit-helpers/src/api/toolkit-error';\n\nexport {\n ExpandStackSelection,\n StackSelectionStrategy,\n StackSelector,\n} from '../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector';\n\nexport type {\n IoMessageLevel,\n IoMessageCode,\n IoMessage,\n IoRequest,\n} from '../../../tmp-toolkit-helpers/src/api/io/io-message';\nexport type { IIoHost } from '../../../tmp-toolkit-helpers/src/api/io/io-host';\nexport type { ToolkitAction } from '../../../tmp-toolkit-helpers/src/api/io/toolkit-action';\nexport { PluginHost } from '../../../tmp-toolkit-helpers/src/api/plugin/plugin';\n\nexport * from '../../../tmp-toolkit-helpers/src/payloads';\n", "import type * as cxapi from '@aws-cdk/cx-api';\n\nconst TOOLKIT_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ToolkitError');\nconst AUTHENTICATION_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AuthenticationError');\nconst ASSEMBLY_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AssemblyError');\nconst CONTEXT_PROVIDER_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ContextProviderError');\n\n/**\n * Represents a general toolkit error in the AWS CDK Toolkit.\n */\nexport class ToolkitError extends Error {\n /**\n * Determines if a given error is an instance of ToolkitError.\n */\n public static isToolkitError(x: any): x is ToolkitError {\n return x !== null && typeof(x) === 'object' && TOOLKIT_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AuthenticationError.\n */\n public static isAuthenticationError(x: any): x is AuthenticationError {\n return this.isToolkitError(x) && AUTHENTICATION_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isAssemblyError(x: any): x is AssemblyError {\n return this.isToolkitError(x) && ASSEMBLY_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isContextProviderError(x: any): x is ContextProviderError {\n return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;\n }\n\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): ToolkitError {\n return new ToolkitError(message, 'toolkit', error);\n }\n\n /**\n * The type of the error, defaults to \"toolkit\".\n */\n public readonly type: string;\n\n /**\n * Denotes the source of the error as the toolkit.\n */\n public readonly source: 'toolkit' | 'user';\n\n /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n constructor(message: string, type: string = 'toolkit', cause?: unknown) {\n super(message);\n Object.setPrototypeOf(this, ToolkitError.prototype);\n Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });\n this.name = new.target.name;\n this.type = type;\n this.source = 'toolkit';\n this.cause = cause;\n }\n}\n\n/**\n * Represents an authentication-specific error in the AWS CDK Toolkit.\n */\nexport class AuthenticationError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'authentication');\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n Object.defineProperty(this, AUTHENTICATION_ERROR_SYMBOL, { value: true });\n }\n}\n\n/**\n * Represents an error causes by cloud assembly synthesis\n *\n * This includes errors thrown during app execution, as well as failing annotations.\n */\nexport class AssemblyError extends ToolkitError {\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): AssemblyError {\n return new AssemblyError(message, undefined, error);\n }\n\n /**\n * An AssemblyError with a list of stacks as cause\n */\n public static withStacks(message: string, stacks?: cxapi.CloudFormationStackArtifact[]): AssemblyError {\n return new AssemblyError(message, stacks);\n }\n\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n /**\n * The stacks that caused the error, if available\n *\n * The `messages` property of each `cxapi.CloudFormationStackArtifact` will contain the respective errors.\n * Absence indicates synthesis didn't fully complete.\n */\n public readonly stacks?: cxapi.CloudFormationStackArtifact[];\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly', cause);\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n }\n}\n\n/**\n * Represents an error originating from a Context Provider\n */\nexport class ContextProviderError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'context-provider');\n Object.setPrototypeOf(this, ContextProviderError.prototype);\n Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });\n }\n}\n", "/**\n * Which stacks should be selected from a cloud assembly\n */\nexport enum StackSelectionStrategy {\n /**\n * Returns all stacks in the app regardless of patterns,\n * including stacks inside nested assemblies.\n */\n ALL_STACKS = 'all-stacks',\n\n /**\n * Returns all stacks in the main (top level) assembly only.\n */\n MAIN_ASSEMBLY = 'main-assembly',\n\n /**\n * If the assembly includes a single stack, returns it.\n * Otherwise throws an exception.\n */\n ONLY_SINGLE = 'only-single',\n\n /**\n * Return stacks matched by patterns.\n * If no stacks are found, execution is halted successfully.\n * Most likely you don't want to use this but `StackSelectionStrategy.MUST_MATCH_PATTERN`\n */\n PATTERN_MATCH = 'pattern-match',\n\n /**\n * Return stacks matched by patterns.\n * Throws an exception if the patterns don't match at least one stack in the assembly.\n */\n PATTERN_MUST_MATCH = 'pattern-must-match',\n\n /**\n * Returns if exactly one stack is matched by the pattern(s).\n * Throws an exception if no stack, or more than exactly one stack are matched.\n */\n PATTERN_MUST_MATCH_SINGLE = 'pattern-must-match-single',\n}\n\n/**\n * When selecting stacks, what other stacks to include because of dependencies\n */\nexport enum ExpandStackSelection {\n /**\n * Don't select any extra stacks\n */\n NONE = 'none',\n\n /**\n * Include stacks that this stack depends on\n */\n UPSTREAM = 'upstream',\n\n /**\n * Include stacks that depend on this stack\n */\n DOWNSTREAM = 'downstream',\n\n /**\n * @TODO\n * Include both directions.\n * I.e. stacks that this stack depends on, and stacks that depend on this stack.\n */\n // FULL = 'full',\n}\n\n/**\n * A specification of which stacks should be selected\n */\nexport interface StackSelector {\n /**\n * The behavior if if no selectors are provided.\n */\n strategy: StackSelectionStrategy;\n\n /**\n * A list of patterns to match the stack hierarchical ids\n * Only used with `PATTERN_*` selection strategies.\n */\n patterns?: string[];\n\n /**\n * Expand the selection to upstream/downstream stacks.\n * @default ExpandStackSelection.None only select the specified/matched stacks\n */\n expand?: ExpandStackSelection;\n\n /**\n * By default, we throw an exception if the assembly contains no stacks.\n * Set to `false`, to halt execution for empty assemblies without error.\n *\n * Note that actions can still throw if a stack selection result is empty,\n * but the assembly contains stacks in principle.\n *\n * @default true\n */\n failOnEmpty?: boolean;\n}\n", "import { inspect } from 'util';\nimport type { CredentialProviderSource, IPluginHost, Plugin } from '@aws-cdk/cli-plugin-contract';\nimport { type ContextProviderPlugin, isContextProviderPlugin } from './context-provider-plugin';\nimport type { IIoHost } from '../io';\nimport { IoDefaultMessages, IoHelper } from '../private';\nimport { ToolkitError } from '../toolkit-error';\n\nexport let TESTING = false;\n\nexport function markTesting() {\n TESTING = true;\n}\n\n/**\n * Class to manage a plugin collection\n *\n * It provides a `load()` function that loads a JavaScript\n * module from disk, and gives it access to the `IPluginHost` interface\n * to register itself.\n */\nexport class PluginHost implements IPluginHost {\n /**\n * Access the currently registered CredentialProviderSources. New sources can\n * be registered using the +registerCredentialProviderSource+ method.\n */\n public readonly credentialProviderSources = new Array<CredentialProviderSource>();\n\n public readonly contextProviderPlugins: Record<string, ContextProviderPlugin> = {};\n\n public ioHost?: IIoHost;\n\n private readonly alreadyLoaded = new Set<string>();\n\n /**\n * Loads a plug-in into this PluginHost.\n *\n * Will use `require.resolve()` to get the most accurate representation of what\n * code will get loaded in error messages. As such, it will not work in\n * unit tests with Jest virtual modules becauase of <https://github.com/jestjs/jest/issues/9543>.\n *\n * @param moduleSpec the specification (path or name) of the plug-in module to be loaded.\n * @param ioHost the I/O host to use for printing progress information\n */\n public load(moduleSpec: string, ioHost?: IIoHost) {\n try {\n const resolved = require.resolve(moduleSpec);\n if (ioHost) {\n new IoDefaultMessages(IoHelper.fromIoHost(ioHost, 'init')).debug(`Loading plug-in: ${resolved} from ${moduleSpec}`);\n }\n return this._doLoad(resolved);\n } catch (e: any) {\n // according to Node.js docs `MODULE_NOT_FOUND` is the only possible error here\n // @see https://nodejs.org/api/modules.html#requireresolverequest-options\n // Not using `withCause()` here, since the node error contains a \"Require Stack\"\n // as part of the error message that is inherently useless to our users.\n throw new ToolkitError(`Unable to resolve plug-in: Cannot find module '${moduleSpec}': ${e}`);\n }\n }\n\n /**\n * Do the loading given an already-resolved module name\n *\n * @internal\n */\n public _doLoad(resolved: string) {\n try {\n if (this.alreadyLoaded.has(resolved)) {\n return;\n }\n\n /* eslint-disable @typescript-eslint/no-require-imports */\n const plugin = require(resolved);\n /* eslint-enable */\n if (!isPlugin(plugin)) {\n throw new ToolkitError(`Module ${resolved} is not a valid plug-in, or has an unsupported version.`);\n }\n if (plugin.init) {\n plugin.init(this);\n }\n\n this.alreadyLoaded.add(resolved);\n } catch (e: any) {\n throw ToolkitError.withCause(`Unable to load plug-in '${resolved}'`, e);\n }\n\n function isPlugin(x: any): x is Plugin {\n return x != null && x.version === '1';\n }\n }\n\n /**\n * Allows plug-ins to register new CredentialProviderSources.\n *\n * @param source a new CredentialProviderSource to register.\n */\n public registerCredentialProviderSource(source: CredentialProviderSource) {\n // Forward to the right credentials-related plugin host\n this.credentialProviderSources.push(source);\n }\n\n /**\n * (EXPERIMENTAL) Allow plugins to register context providers\n *\n * Context providers are objects with the following method:\n *\n * ```ts\n * getValue(args: {[key: string]: any}): Promise<any>;\n * ```\n *\n * Currently, they cannot reuse the CDK's authentication mechanisms, so they\n * must be prepared to either not make AWS calls or use their own source of\n * AWS credentials.\n *\n * This feature is experimental, and only intended to be used internally at Amazon\n * as a trial.\n *\n * After registering with 'my-plugin-name', the provider must be addressed as follows:\n *\n * ```ts\n * const value = ContextProvider.getValue(this, {\n * providerName: 'plugin',\n * props: {\n * pluginName: 'my-plugin-name',\n * myParameter1: 'xyz',\n * },\n * includeEnvironment: true | false,\n * dummyValue: 'what-to-return-on-the-first-pass',\n * })\n * ```\n *\n * @experimental\n */\n public registerContextProviderAlpha(pluginProviderName: string, provider: ContextProviderPlugin) {\n if (!isContextProviderPlugin(provider)) {\n throw new ToolkitError(`Object you gave me does not look like a ContextProviderPlugin: ${inspect(provider)}`);\n }\n this.contextProviderPlugins[pluginProviderName] = provider;\n }\n}\n", "export interface ContextProviderPlugin {\n getValue(args: {[key: string]: any}): Promise<any>;\n}\n\nexport function isContextProviderPlugin(x: unknown): x is ContextProviderPlugin {\n return typeof x === 'object' && !!x && !!(x as any).getValue;\n}\n", "import * as util from 'node:util';\nimport * as uuid from 'uuid';\nimport type { ActionLessMessage, IoHelper } from './io-helper';\nimport type { IoMessageMaker } from './message-maker';\nimport type { Duration } from '../../../payloads/types';\nimport { formatTime } from '../../../util';\n\nexport interface SpanEnd {\n readonly duration: number;\n}\n\n/**\n * Describes a specific span\n *\n * A span definition is a pair of `IoMessageMaker`s to create a start and end message of the span respectively.\n * It also has a display name, that is used for auto-generated message text when they are not provided.\n */\nexport interface SpanDefinition<S extends object, E extends SpanEnd> {\n readonly name: string;\n readonly start: IoMessageMaker<S>;\n readonly end: IoMessageMaker<E>;\n}\n\n/**\n * Used in conditional types to check if a type (e.g. after omitting fields) is an empty object\n * This is needed because counter-intuitive neither `object` nor `{}` represent that.\n */\ntype EmptyObject = {\n [index: string | number | symbol]: never;\n}\n\n/**\n * Helper type to force a parameter to be not present of the computed type is an empty object\n */\ntype VoidWhenEmpty<T> = T extends EmptyObject ? void : T\n\n/**\n * Helper type to force a parameter to be an empty object if the computed type is an empty object\n * This is weird, but some computed types (e.g. using `Omit`) don't end up enforcing this.\n */\ntype ForceEmpty<T> = T extends EmptyObject ? EmptyObject : T\n\n/**\n * Make some properties optional\n */\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\n/**\n * Ending the span returns the observed duration\n */\ninterface ElapsedTime {\n readonly asMs: number;\n readonly asSec: number;\n}\n\n/**\n * A message span that can be ended and read times from\n */\nexport interface IMessageSpan<E extends SpanEnd> {\n /**\n * Get the time elapsed since the start\n */\n elapsedTime(): Promise<ElapsedTime>;\n /**\n * Sends a simple, generic message with the current timing\n * For more complex intermediate messages, get the `elapsedTime` and use `notify`\n */\n timing(maker: IoMessageMaker<Duration>, message?: string): Promise<ElapsedTime>;\n /**\n * Sends an arbitrary intermediate message as part of the span\n */\n notify(message: ActionLessMessage<unknown>): Promise<void>;\n /**\n * End the span with a payload\n */\n end(payload: VoidWhenEmpty<Omit<E, keyof SpanEnd>>): Promise<ElapsedTime>;\n /**\n * End the span with a payload, overwriting\n */\n end(payload: VoidWhenEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime>;\n /**\n * End the span with a message and payload\n */\n end(message: string, payload: ForceEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime>;\n}\n\n/**\n * Helper class to make spans around blocks of work\n *\n * Blocks are enclosed by a start and end message.\n * All messages of the span share a unique id.\n * The end message contains the time passed between start and end.\n */\nexport class SpanMaker<S extends object, E extends SpanEnd> {\n private readonly definition: SpanDefinition<S, E>;\n private readonly ioHelper: IoHelper;\n\n public constructor(ioHelper: IoHelper, definition: SpanDefinition<S, E>) {\n this.definition = definition;\n this.ioHelper = ioHelper;\n }\n\n /**\n * Starts the span and initially notifies the IoHost\n * @returns a message span\n */\n public async begin(payload: VoidWhenEmpty<S>): Promise<IMessageSpan<E>>;\n public async begin(message: string, payload: S): Promise<IMessageSpan<E>>;\n public async begin(a: any, b?: S): Promise<IMessageSpan<E>> {\n const spanId = uuid.v4();\n const startTime = new Date().getTime();\n\n const notify = (msg: ActionLessMessage<unknown>): Promise<void> => {\n return this.ioHelper.notify(withSpanId(spanId, msg));\n };\n\n const startInput = parseArgs<S>(a, b);\n const startMsg = startInput.message ?? `Starting ${this.definition.name} ...`;\n const startPayload = startInput.payload;\n\n await notify(this.definition.start.msg(\n startMsg,\n startPayload,\n ));\n\n const timingMsgTemplate = '\\n\u2728 %s time: %ds\\n';\n const time = () => {\n const elapsedTime = new Date().getTime() - startTime;\n return {\n asMs: elapsedTime,\n asSec: formatTime(elapsedTime),\n };\n };\n\n return {\n elapsedTime: async (): Promise<ElapsedTime> => {\n return time();\n },\n\n notify: async(msg: ActionLessMessage<unknown>): Promise<void> => {\n await notify(msg);\n },\n\n timing: async(maker: IoMessageMaker<Duration>, message?: string): Promise<ElapsedTime> => {\n const duration = time();\n const timingMsg = message ? message : util.format(timingMsgTemplate, this.definition.name, duration.asSec);\n await notify(maker.msg(timingMsg, {\n duration: duration.asMs,\n }));\n return duration;\n },\n\n end: async (x: any, y?: ForceEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime> => {\n const duration = time();\n\n const endInput = parseArgs<ForceEmpty<Optional<E, keyof SpanEnd>>>(x, y);\n const endMsg = endInput.message ?? util.format(timingMsgTemplate, this.definition.name, duration.asSec);\n const endPayload = endInput.payload;\n\n await notify(this.definition.end.msg(\n endMsg, {\n duration: duration.asMs,\n ...endPayload,\n } as E));\n\n return duration;\n },\n };\n }\n}\n\nfunction parseArgs<S extends object>(first: any, second?: S): { message: string | undefined; payload: S } {\n const firstIsMessage = typeof first === 'string';\n\n // When the first argument is a string or we have a second argument, then the first arg is the message\n const message = (firstIsMessage || second) ? first : undefined;\n\n // When the first argument is a string or we have a second argument,\n // then the second arg is the payload, otherwise the first arg is the payload\n const payload = (firstIsMessage || second) ? second : first;\n\n return {\n message,\n payload,\n };\n}\n\nfunction withSpanId(span: string, message: ActionLessMessage<unknown>): ActionLessMessage<unknown> {\n return {\n ...message,\n span,\n };\n}\n", "import { error } from 'console';\nimport { createWriteStream, promises as fs } from 'fs';\nimport * as path from 'path';\nimport * as glob from 'glob';\nimport { formatErrorMessage } from './format-error';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst archiver = require('archiver');\n\n// Adapted from cdk-assets\nexport async function zipDirectory(directory: string, outputFile: string): Promise<void> {\n // We write to a temporary file and rename at the last moment. This is so that if we are\n // interrupted during this process, we don't leave a half-finished file in the target location.\n const temporaryOutputFile = `${outputFile}.${randomString()}._tmp`;\n await writeZipFile(directory, temporaryOutputFile);\n await moveIntoPlace(temporaryOutputFile, outputFile);\n}\n\nfunction writeZipFile(directory: string, outputFile: string): Promise<void> {\n return new Promise(async (ok, fail) => {\n // The below options are needed to support following symlinks when building zip files:\n // - nodir: This will prevent symlinks themselves from being copied into the zip.\n // - follow: This will follow symlinks and copy the files within.\n const globOptions = {\n dot: true,\n nodir: true,\n follow: true,\n cwd: directory,\n };\n const files = glob.sync('**', globOptions); // The output here is already sorted\n\n const output = createWriteStream(outputFile);\n\n const archive = archiver('zip');\n archive.on('warning', fail);\n archive.on('error', fail);\n\n // archive has been finalized and the output file descriptor has closed, resolve promise\n // this has to be done before calling `finalize` since the events may fire immediately after.\n // see https://www.npmjs.com/package/archiver\n output.once('close', ok);\n\n archive.pipe(output);\n\n // Append files serially to ensure file order\n for (const file of files) {\n const fullPath = path.resolve(directory, file);\n // Exactly 2 promises\n // eslint-disable-next-line @cdklabs/promiseall-no-unbounded-parallelism\n const [data, stat] = await Promise.all([fs.readFile(fullPath), fs.stat(fullPath)]);\n archive.append(data, {\n name: file,\n mode: stat.mode,\n });\n }\n\n await archive.finalize();\n });\n}\n\n/**\n * Rename the file to the target location, taking into account:\n *\n * - That we may see EPERM on Windows while an Antivirus scanner still has the\n * file open, so retry a couple of times.\n * - This same function may be called in parallel and be interrupted at any point.\n */\nasync function moveIntoPlace(source: string, target: string) {\n let delay = 100;\n let attempts = 5;\n while (true) {\n try {\n // 'rename' is guaranteed to overwrite an existing target, as long as it is a file (not a directory)\n await fs.rename(source, target);\n return;\n } catch (e: any) {\n if (e.code !== 'EPERM' || attempts-- <= 0) {\n throw e;\n }\n error(formatErrorMessage(e));\n await sleep(Math.floor(Math.random() * delay));\n delay *= 2;\n }\n }\n}\n\nfunction sleep(ms: number) {\n return new Promise(ok => setTimeout(ok, ms));\n}\n\nfunction randomString() {\n return Math.random().toString(36).replace(/[^a-z0-9]+/g, '');\n}\n", "/**\n * Type of a map mapping strings to some arbitrary type\n *\n * Name is not ideal, but:\n *\n * - Cannot call it Object, that already means something.\n * - Cannot call it Dict or Dictionary, since in other languages\n * those also allow specifying the key type.\n */\nexport type Obj<T> = {[key: string]: T};\n\n/**\n * Return whether the given value is an object\n *\n * Even though arrays technically are objects, we usually want to treat them differently,\n * so we return false in those cases.\n */\nexport function isObject(x: any): x is Obj<any> {\n return x !== null && typeof x === 'object' && !isArray(x);\n}\n\n/**\n * Return whether the given value is an array\n */\nexport const isArray = Array.isArray;\n\n/**\n * Return the value of the first argument if it's not undefined, otherwise the default\n */\nexport function ifDefined<T>(x: T | undefined, def: T): T {\n return typeof x !== 'undefined' ? x : def;\n}\n", "import * as yaml from 'yaml';\nimport type * as yaml_cst from 'yaml/parse-cst';\nimport * as yaml_types from 'yaml/types';\n\n/**\n * Serializes the given data structure into valid YAML.\n *\n * @param obj the data structure to serialize\n * @returns a string containing the YAML representation of {@param obj}\n */\nexport function serialize(obj: any): string {\n const oldFold = yaml_types.strOptions.fold.lineWidth;\n try {\n yaml_types.strOptions.fold.lineWidth = 0;\n return yaml.stringify(obj, { schema: 'yaml-1.1' });\n } finally {\n yaml_types.strOptions.fold.lineWidth = oldFold;\n }\n}\n\n/**\n * Deserialize the YAML into the appropriate data structure.\n *\n * @param str the string containing YAML\n * @returns the data structure the YAML represents\n * (most often in case of CloudFormation, an object)\n */\nexport function deserialize(str: string): any {\n return parseYamlStrWithCfnTags(str);\n}\n\nfunction makeTagForCfnIntrinsic(intrinsicName: string, addFnPrefix: boolean): yaml_types.Schema.CustomTag {\n return {\n identify(value: any) {\n return typeof value === 'string';\n },\n tag: `!${intrinsicName}`,\n resolve: (_doc: yaml.Document, cstNode: yaml_cst.CST.Node) => {\n const ret: any = {};\n ret[addFnPrefix ? `Fn::${intrinsicName}` : intrinsicName] =\n // the +1 is to account for the ! the short form begins with\n parseYamlStrWithCfnTags(cstNode.toString().substring(intrinsicName.length + 1));\n return ret;\n },\n };\n}\n\nconst shortForms: yaml_types.Schema.CustomTag[] = [\n 'Base64', 'Cidr', 'FindInMap', 'GetAZs', 'ImportValue', 'Join', 'Sub',\n 'Select', 'Split', 'Transform', 'And', 'Equals', 'If', 'Not', 'Or', 'GetAtt',\n].map(name => makeTagForCfnIntrinsic(name, true)).concat(\n makeTagForCfnIntrinsic('Ref', false),\n makeTagForCfnIntrinsic('Condition', false),\n);\n\nfunction parseYamlStrWithCfnTags(text: string): any {\n return yaml.parse(text, {\n customTags: shortForms,\n schema: 'core',\n });\n}\n", "/**\n * Pad 's' on the left with 'char' until it is n characters wide\n */\nexport function padLeft(n: number, x: string, char: string = ' '): string {\n return char.repeat(Math.max(0, n - x.length)) + x;\n}\n\n/**\n * Pad 's' on the right with 'char' until it is n characters wide\n */\nexport function padRight(n: number, x: string, char: string = ' '): string {\n return x + char.repeat(Math.max(0, n - x.length));\n}\n\n/**\n * Formats time in milliseconds (which we get from 'Date.getTime()')\n * to a human-readable time; returns time in seconds rounded to 2\n * decimal places.\n */\nexport function formatTime(num: number): number {\n return roundPercentage(millisecondsToSeconds(num));\n}\n\n/**\n * Rounds a decimal number to two decimal points.\n * The function is useful for fractions that need to be outputted as percentages.\n */\nfunction roundPercentage(num: number): number {\n return Math.round(100 * num) / 100;\n}\n\n/**\n * Given a time in milliseconds, return an equivalent amount in seconds.\n */\nfunction millisecondsToSeconds(num: number): number {\n return num / 1000;\n}\n\n/**\n * This function lower cases the first character of the string provided.\n */\nexport function lowerCaseFirstCharacter(str: string): string {\n return str.length > 0 ? `${str[0].toLowerCase()}${str.slice(1)}` : str;\n}\n", "import * as semver from 'semver';\nimport { ToolkitError } from '../api/toolkit-error';\n\n// bracket - https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN401\n// pep - https://www.python.org/dev/peps/pep-0440/#version-specifiers\nexport type RangeType = 'bracket' | 'pep'\n\nexport function rangeFromSemver(ver: string, targetType: RangeType) {\n const re = ver.match(/^([^\\d]*)([\\d.]*)$/);\n if (!re || !semver.valid(re[2])) {\n throw new ToolkitError('not a semver or unsupported range syntax');\n }\n const prefixPart = re[1];\n const verPart = re[2];\n\n switch (targetType) {\n case 'bracket':\n switch (prefixPart) {\n case '':\n // if there's no prefix and the remaining is a valid semver, there's no range specified\n return ver;\n case '^':\n return `[${verPart},${semver.major(verPart)+1}.0.0)`;\n default:\n throw new ToolkitError(`unsupported range syntax - ${prefixPart}`);\n }\n case 'pep':\n switch (prefixPart) {\n case '':\n // if there's no prefix and the remaining is a valid semver, there's no range specified\n return `==${ver}`;\n case '^':\n return `>=${verPart},<${semver.major(verPart)+1}.0.0`;\n default:\n throw new ToolkitError(`unsupported range syntax - ${prefixPart}`);\n }\n }\n}\n", "import type { IIoHost } from '../io-host';\nimport type { IoMessage, IoRequest } from '../io-message';\nimport type { ToolkitAction } from '../toolkit-action';\nimport type { SpanEnd, SpanDefinition } from './span';\nimport { SpanMaker } from './span';\n\nexport type ActionLessMessage<T> = Omit<IoMessage<T>, 'action'>;\nexport type ActionLessRequest<T, U> = Omit<IoRequest<T, U>, 'action'>;\n\n/**\n * A class containing helper tools to interact with IoHost\n */\nexport class IoHelper implements IIoHost {\n public static fromIoHost(ioHost: IIoHost, action: ToolkitAction) {\n return new IoHelper(ioHost, action);\n }\n\n private readonly ioHost: IIoHost;\n private readonly action: ToolkitAction;\n\n private constructor(ioHost: IIoHost, action: ToolkitAction) {\n this.ioHost = ioHost;\n this.action = action;\n }\n\n /**\n * Forward a message to the IoHost, while injection the current action\n */\n public notify(msg: ActionLessMessage<unknown>): Promise<void> {\n return this.ioHost.notify({\n ...msg,\n action: this.action,\n });\n }\n\n /**\n * Forward a request to the IoHost, while injection the current action\n */\n public requestResponse<T, U>(msg: ActionLessRequest<T, U>): Promise<U> {\n return this.ioHost.requestResponse({\n ...msg,\n action: this.action,\n });\n }\n\n /**\n * Create a new marker from a given registry entry\n */\n public span<S extends object, E extends SpanEnd>(definition: SpanDefinition<S, E>) {\n return new SpanMaker(this, definition);\n }\n}\n\n/**\n * Wraps an IoHost and creates an IoHelper from it\n */\nexport function asIoHelper(ioHost: IIoHost, action: ToolkitAction): IoHelper {\n return IoHelper.fromIoHost(ioHost, action);\n}\n", "import type { IoMessageLevel } from '../';\n\n/**\n * Keep this list ordered from most to least verbose.\n * Every level \"includes\" all of the levels below it.\n * This is used to compare levels of messages to determine what should be logged.\n */\nconst levels = [\n 'trace',\n 'debug',\n 'info',\n 'warn',\n 'result',\n 'error',\n] as const;\n\n// compare levels helper\n// helper to convert the array into a map with numbers\nconst orderedLevels: Record<typeof levels[number], number> = Object.fromEntries(Object.entries(levels).map(a => a.reverse()));\nfunction compareFn(a: IoMessageLevel, b: IoMessageLevel): number {\n return orderedLevels[a] - orderedLevels[b];\n}\n\n/**\n * Determines if a message is relevant for the given log level.\n *\n * @param msg The message to compare.\n * @param level The level to compare against.\n * @returns true if the message is relevant for the given level.\n */\nexport function isMessageRelevantForLevel(msg: { level: IoMessageLevel}, level: IoMessageLevel): boolean {\n return compareFn(msg.level, level) >= 0;\n}\n\n", "import type { IoMessage, IoMessageCode, IoMessageLevel } from '../io-message';\nimport type { ActionLessMessage, ActionLessRequest } from './io-helper';\n\n/**\n * Information for each IO Message Code.\n */\ninterface CodeInfo {\n /**\n * The message code.\n */\n readonly code: IoMessageCode;\n\n /**\n * A brief description of the meaning of this IO Message.\n */\n readonly description: string;\n\n /**\n * The name of the payload interface, if applicable.\n * Some Io Messages include a payload, with a specific interface. The name of\n * the interface is specified here so that it can be linked with the message\n * when documentation is generated.\n *\n * The interface _must_ be exposed directly from toolkit-lib, so that it will\n * have a documentation page generated (that can be linked to).\n */\n readonly interface?: string;\n}\n\n/**\n * Information for each IO Message\n */\ninterface MessageInfo extends CodeInfo {\n /**\n * The message level\n */\n readonly level: IoMessageLevel;\n}\n\n/**\n * An interface that can produce messages for a specific code.\n */\nexport interface IoMessageMaker<T> extends MessageInfo {\n /**\n * Create a message for this code, with or without payload.\n */\n msg: [T] extends [AbsentData] ? (message: string) => ActionLessMessage<AbsentData> : (message: string, data: T) => ActionLessMessage<T>;\n\n /**\n * Returns whether the given `IoMessage` instance matches the current message definition\n */\n is(x: IoMessage<unknown>): x is IoMessage<T>;\n}\n\n/**\n * Produce an IoMessageMaker for the provided level and code info.\n */\nfunction message<T = AbsentData>(level: IoMessageLevel, details: CodeInfo): IoMessageMaker<T> {\n const maker = (text: string, data: T) => ({\n time: new Date(),\n level,\n code: details.code,\n message: text,\n data,\n } as ActionLessMessage<T>);\n\n return {\n ...details,\n level,\n msg: maker as any,\n is: (m): m is IoMessage<T> => m.code === details.code,\n };\n}\n\n/**\n * A type that is impossible for a user to replicate\n * This is used to ensure that results always have a proper type generic declared.\n */\ndeclare const privateKey: unique symbol;\nexport type ImpossibleType = {\n readonly [privateKey]: typeof privateKey;\n};\n\n// Create `IoMessageMaker`s for a given level and type check that calls with payload are using the correct interface\ntype CodeInfoMaybeInterface<T> = [T] extends [AbsentData] ? Omit<CodeInfo, 'interface'> : Required<CodeInfo>;\n\n/**\n * The type we use to represent an absent data field\n *\n * This is here to make it easy to change between `undefined`, `void`\n * and `never`.\n *\n * Not a lot of difference between `undefined` and `void`, but `void`\n * reads better.\n */\ntype AbsentData = void;\n\nexport const trace = <T = AbsentData>(details: CodeInfoMaybeInterface<T>) => message<T>('trace', details);\nexport const debug = <T = AbsentData>(details: CodeInfoMaybeInterface<T>) => message<T>('debug', details);\nexport const info = <T = AbsentData>(details: CodeInfoMaybeInterface<T>) => message<T>('info', details);\nexport const warn = <T = AbsentData>(details: CodeInfoMaybeInterface<T>) => message<T>('warn', details);\nexport const error = <T = AbsentData>(details: CodeInfoMaybeInterface<T>) => message<T>('error', details);\nexport const result = <T extends object = ImpossibleType>(details: Required<CodeInfo>) => message<T>('result', details);\n\ninterface RequestInfo<U> extends CodeInfo {\n readonly defaultResponse: U;\n}\n\n/**\n * An interface that can produce requests for a specific code.\n */\nexport interface IoRequestMaker<T, U> extends MessageInfo {\n /**\n * Create a message for this code, with or without payload.\n */\n req: [T] extends [AbsentData] ? (message: string) => ActionLessMessage<AbsentData> : (message: string, data: T) => ActionLessRequest<T, U>;\n}\n\n/**\n * Produce an IoRequestMaker for the provided level and request info.\n */\nfunction request<T = AbsentData, U = ImpossibleType>(level: IoMessageLevel, details: RequestInfo<U>): IoRequestMaker<T, U> {\n const maker = (text: string, data: T) => ({\n time: new Date(),\n level,\n code: details.code,\n message: text,\n data,\n defaultResponse: details.defaultResponse,\n } as ActionLessRequest<T, U>);\n\n return {\n ...details,\n level,\n req: maker as any,\n };\n}\n\n/**\n * A request that is a simple yes/no question, with the expectation that 'yes' is the default.\n */\nexport const confirm = <T extends object = ImpossibleType>(details: Required<Omit<RequestInfo<boolean>, 'defaultResponse'>>) => request<T, boolean>('info', {\n ...details,\n defaultResponse: true,\n});\n", "import type * as cxapi from '@aws-cdk/cx-api';\nimport * as make from './message-maker';\nimport type { SpanDefinition } from './span';\nimport type { DiffResult } from '../../../payloads';\nimport type { BootstrapEnvironmentProgress } from '../../../payloads/bootstrap-environment-progress';\nimport type { MissingContext, UpdatedContext } from '../../../payloads/context';\nimport type { BuildAsset, DeployConfirmationRequest, PublishAsset, StackDeployProgress, SuccessfulDeployStackResult } from '../../../payloads/deploy';\nimport type { StackDestroy, StackDestroyProgress } from '../../../payloads/destroy';\nimport type { HotswapDeploymentDetails, HotswapDeploymentAttempt, HotswappableChange, HotswapResult } from '../../../payloads/hotswap';\nimport type { StackDetailsPayload } from '../../../payloads/list';\nimport type { CloudWatchLogEvent, CloudWatchLogMonitorControlEvent } from '../../../payloads/logs-monitor';\nimport type { RefactorResult } from '../../../payloads/refactor';\nimport type { StackRollbackProgress } from '../../../payloads/rollback';\nimport type { SdkTrace } from '../../../payloads/sdk-trace';\nimport type { StackActivity, StackMonitoringControlEvent } from '../../../payloads/stack-activity';\nimport type { StackSelectionDetails } from '../../../payloads/synth';\nimport type { AssemblyData, ConfirmationRequest, ContextProviderMessageSource, Duration, ErrorPayload, StackAndAssemblyData } from '../../../payloads/types';\nimport type { FileWatchEvent, WatchSettings } from '../../../payloads/watch';\n\n/**\n * We have a rough system by which we assign message codes:\n * - First digit groups messages by action, e.g. synth or deploy\n * - X000-X009 are reserved for timings\n * - X900-X999 are reserved for results\n */\nexport const IO = {\n // Defaults (0000)\n DEFAULT_TOOLKIT_INFO: make.info({\n code: 'CDK_TOOLKIT_I0000',\n description: 'Default info messages emitted from the Toolkit',\n }),\n DEFAULT_TOOLKIT_DEBUG: make.debug({\n code: 'CDK_TOOLKIT_I0000',\n description: 'Default debug messages emitted from the Toolkit',\n }),\n DEFAULT_TOOLKIT_WARN: make.warn({\n code: 'CDK_TOOLKIT_W0000',\n description: 'Default warning messages emitted from the Toolkit',\n }),\n DEFAULT_TOOLKIT_ERROR: make.error({\n code: 'CDK_TOOLKIT_E0000',\n description: 'Default error messages emitted from the Toolkit',\n }),\n DEFAULT_TOOLKIT_TRACE: make.trace({\n code: 'CDK_TOOLKIT_I0000',\n description: 'Default trace messages emitted from the Toolkit',\n }),\n\n // warnings & errors\n CDK_TOOLKIT_W0100: make.warn({\n code: 'CDK_TOOLKIT_W0100',\n description: 'Credential plugin warnings',\n }),\n\n // 1: Synth (1xxx)\n CDK_TOOLKIT_I1000: make.info<Duration>({\n code: 'CDK_TOOLKIT_I1000',\n description: 'Provides synthesis times.',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I1001: make.trace<StackSelectionDetails>({\n code: 'CDK_TOOLKIT_I1001',\n description: 'Cloud Assembly synthesis is starting',\n interface: 'StackSelectionDetails',\n }),\n CDK_TOOLKIT_I1901: make.result<StackAndAssemblyData>({\n code: 'CDK_TOOLKIT_I1901',\n description: 'Provides stack data',\n interface: 'StackAndAssemblyData',\n }),\n CDK_TOOLKIT_I1902: make.result<AssemblyData>({\n code: 'CDK_TOOLKIT_I1902',\n description: 'Successfully deployed stacks',\n interface: 'AssemblyData',\n }),\n\n // 2: List (2xxx)\n CDK_TOOLKIT_I2901: make.result<StackDetailsPayload>({\n code: 'CDK_TOOLKIT_I2901',\n description: 'Provides details on the selected stacks and their dependencies',\n interface: 'StackDetailsPayload',\n }),\n\n // 3: Import & Migrate\n CDK_TOOLKIT_E3900: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E3900',\n description: 'Resource import failed',\n interface: 'ErrorPayload',\n }),\n\n // 4: Diff (4xxx)\n CDK_TOOLKIT_I4000: make.trace<StackSelectionDetails>({\n code: 'CDK_TOOLKIT_I4000',\n description: 'Diff stacks is starting',\n interface: 'StackSelectionDetails',\n }),\n CDK_TOOLKIT_I4001: make.info<DiffResult>({\n code: 'CDK_TOOLKIT_I4001',\n description: 'Output of the diff command',\n interface: 'DiffResult',\n }),\n\n // 5: Deploy & Watch (5xxx)\n CDK_TOOLKIT_I5000: make.info<Duration>({\n code: 'CDK_TOOLKIT_I5000',\n description: 'Provides deployment times',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I5001: make.info<Duration>({\n code: 'CDK_TOOLKIT_I5001',\n description: 'Provides total time in deploy action, including synth and rollback',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I5002: make.info<Duration>({\n code: 'CDK_TOOLKIT_I5002',\n description: 'Provides time for resource migration',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_W5021: make.warn({\n code: 'CDK_TOOLKIT_W5021',\n description: 'Empty non-existent stack, deployment is skipped',\n }),\n CDK_TOOLKIT_W5022: make.warn({\n code: 'CDK_TOOLKIT_W5022',\n description: 'Empty existing stack, stack will be destroyed',\n }),\n CDK_TOOLKIT_I5031: make.info({\n code: 'CDK_TOOLKIT_I5031',\n description: 'Informs about any log groups that are traced as part of the deployment',\n }),\n CDK_TOOLKIT_I5032: make.debug<CloudWatchLogMonitorControlEvent>({\n code: 'CDK_TOOLKIT_I5032',\n description: 'Start monitoring log groups',\n interface: 'CloudWatchLogMonitorControlEvent',\n }),\n CDK_TOOLKIT_I5033: make.info<CloudWatchLogEvent>({\n code: 'CDK_TOOLKIT_I5033',\n description: 'A log event received from Cloud Watch',\n interface: 'CloudWatchLogEvent',\n }),\n CDK_TOOLKIT_I5034: make.debug<CloudWatchLogMonitorControlEvent>({\n code: 'CDK_TOOLKIT_I5034',\n description: 'Stop monitoring log groups',\n interface: 'CloudWatchLogMonitorControlEvent',\n }),\n CDK_TOOLKIT_E5035: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E5035',\n description: 'A log monitoring error',\n interface: 'ErrorPayload',\n }),\n CDK_TOOLKIT_I5050: make.confirm<ConfirmationRequest>({\n code: 'CDK_TOOLKIT_I5050',\n description: 'Confirm rollback during deployment',\n interface: 'ConfirmationRequest',\n }),\n CDK_TOOLKIT_I5060: make.confirm<DeployConfirmationRequest>({\n code: 'CDK_TOOLKIT_I5060',\n description: 'Confirm deploy security sensitive changes',\n interface: 'DeployConfirmationRequest',\n }),\n CDK_TOOLKIT_I5100: make.info<StackDeployProgress>({\n code: 'CDK_TOOLKIT_I5100',\n description: 'Stack deploy progress',\n interface: 'StackDeployProgress',\n }),\n\n // Assets (52xx)\n CDK_TOOLKIT_I5210: make.trace<BuildAsset>({\n code: 'CDK_TOOLKIT_I5210',\n description: 'Started building a specific asset',\n interface: 'BuildAsset',\n }),\n CDK_TOOLKIT_I5211: make.trace<Duration>({\n code: 'CDK_TOOLKIT_I5211',\n description: 'Building the asset has completed',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I5220: make.trace<PublishAsset>({\n code: 'CDK_TOOLKIT_I5220',\n description: 'Started publishing a specific asset',\n interface: 'PublishAsset',\n }),\n CDK_TOOLKIT_I5221: make.trace<Duration>({\n code: 'CDK_TOOLKIT_I5221',\n description: 'Publishing the asset has completed',\n interface: 'Duration',\n }),\n\n // Watch (53xx)\n CDK_TOOLKIT_I5310: make.debug<WatchSettings>({\n code: 'CDK_TOOLKIT_I5310',\n description: 'The computed settings used for file watching',\n interface: 'WatchSettings',\n }),\n CDK_TOOLKIT_I5311: make.info<FileWatchEvent>({\n code: 'CDK_TOOLKIT_I5311',\n description: 'File watching started',\n interface: 'FileWatchEvent',\n }),\n CDK_TOOLKIT_I5312: make.info<FileWatchEvent>({\n code: 'CDK_TOOLKIT_I5312',\n description: 'File event detected, starting deployment',\n interface: 'FileWatchEvent',\n }),\n CDK_TOOLKIT_I5313: make.info<FileWatchEvent>({\n code: 'CDK_TOOLKIT_I5313',\n description: 'File event detected during active deployment, changes are queued',\n interface: 'FileWatchEvent',\n }),\n CDK_TOOLKIT_I5314: make.info({\n code: 'CDK_TOOLKIT_I5314',\n description: 'Initial watch deployment started',\n }),\n CDK_TOOLKIT_I5315: make.info({\n code: 'CDK_TOOLKIT_I5315',\n description: 'Queued watch deployment started',\n }),\n\n // Hotswap (54xx)\n CDK_TOOLKIT_I5400: make.trace<HotswapDeploymentAttempt>({\n code: 'CDK_TOOLKIT_I5400',\n description: 'Attempting a hotswap deployment',\n interface: 'HotswapDeploymentAttempt',\n }),\n CDK_TOOLKIT_I5401: make.trace<HotswapDeploymentDetails>({\n code: 'CDK_TOOLKIT_I5401',\n description: 'Computed details for the hotswap deployment',\n interface: 'HotswapDeploymentDetails',\n }),\n CDK_TOOLKIT_I5402: make.info<HotswappableChange>({\n code: 'CDK_TOOLKIT_I5402',\n description: 'A hotswappable change is processed as part of a hotswap deployment',\n interface: 'HotswappableChange',\n }),\n CDK_TOOLKIT_I5403: make.info<HotswappableChange>({\n code: 'CDK_TOOLKIT_I5403',\n description: 'The hotswappable change has completed processing',\n interface: 'HotswappableChange',\n }),\n CDK_TOOLKIT_I5410: make.info<HotswapResult>({\n code: 'CDK_TOOLKIT_I5410',\n description: 'Hotswap deployment has ended, a full deployment might still follow if needed',\n interface: 'HotswapResult',\n }),\n\n // Stack Monitor (55xx)\n CDK_TOOLKIT_I5501: make.info<StackMonitoringControlEvent>({\n code: 'CDK_TOOLKIT_I5501',\n description: 'Stack Monitoring: Start monitoring of a single stack',\n interface: 'StackMonitoringControlEvent',\n }),\n CDK_TOOLKIT_I5502: make.info<StackActivity>({\n code: 'CDK_TOOLKIT_I5502',\n description: 'Stack Monitoring: Activity event for a single stack',\n interface: 'StackActivity',\n }),\n CDK_TOOLKIT_I5503: make.info<StackMonitoringControlEvent>({\n code: 'CDK_TOOLKIT_I5503',\n description: 'Stack Monitoring: Finished monitoring of a single stack',\n interface: 'StackMonitoringControlEvent',\n }),\n\n // Success (59xx)\n CDK_TOOLKIT_I5900: make.result<SuccessfulDeployStackResult>({\n code: 'CDK_TOOLKIT_I5900',\n description: 'Deployment results on success',\n interface: 'SuccessfulDeployStackResult',\n }),\n CDK_TOOLKIT_I5901: make.info({\n code: 'CDK_TOOLKIT_I5901',\n description: 'Generic deployment success messages',\n }),\n CDK_TOOLKIT_W5400: make.warn({\n code: 'CDK_TOOLKIT_W5400',\n description: 'Hotswap disclosure message',\n }),\n\n CDK_TOOLKIT_E5001: make.error({\n code: 'CDK_TOOLKIT_E5001',\n description: 'No stacks found',\n }),\n CDK_TOOLKIT_E5500: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E5500',\n description: 'Stack Monitoring error',\n interface: 'ErrorPayload',\n }),\n\n // 6: Rollback (6xxx)\n CDK_TOOLKIT_I6000: make.info<Duration>({\n code: 'CDK_TOOLKIT_I6000',\n description: 'Provides rollback times',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I6100: make.info<StackRollbackProgress>({\n code: 'CDK_TOOLKIT_I6100',\n description: 'Stack rollback progress',\n interface: 'StackRollbackProgress',\n }),\n\n CDK_TOOLKIT_E6001: make.error({\n code: 'CDK_TOOLKIT_E6001',\n description: 'No stacks found',\n }),\n CDK_TOOLKIT_E6900: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E6900',\n description: 'Rollback failed',\n interface: 'ErrorPayload',\n }),\n\n // 7: Destroy (7xxx)\n CDK_TOOLKIT_I7000: make.info<Duration>({\n code: 'CDK_TOOLKIT_I7000',\n description: 'Provides destroy times',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I7001: make.trace<Duration>({\n code: 'CDK_TOOLKIT_I7001',\n description: 'Provides destroy time for a single stack',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I7010: make.confirm<ConfirmationRequest>({\n code: 'CDK_TOOLKIT_I7010',\n description: 'Confirm destroy stacks',\n interface: 'ConfirmationRequest',\n }),\n CDK_TOOLKIT_I7100: make.info<StackDestroyProgress>({\n code: 'CDK_TOOLKIT_I7100',\n description: 'Stack destroy progress',\n interface: 'StackDestroyProgress',\n }),\n CDK_TOOLKIT_I7101: make.trace<StackDestroy>({\n code: 'CDK_TOOLKIT_I7101',\n description: 'Start stack destroying',\n interface: 'StackDestroy',\n }),\n\n CDK_TOOLKIT_I7900: make.result<cxapi.CloudFormationStackArtifact>({\n code: 'CDK_TOOLKIT_I7900',\n description: 'Stack deletion succeeded',\n interface: 'cxapi.CloudFormationStackArtifact',\n }),\n\n CDK_TOOLKIT_E7010: make.error({\n code: 'CDK_TOOLKIT_E7010',\n description: 'Action was aborted due to negative confirmation of request',\n }),\n CDK_TOOLKIT_E7900: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E7900',\n description: 'Stack deletion failed',\n interface: 'ErrorPayload',\n }),\n\n // 8. Refactor (8xxx)\n CDK_TOOLKIT_I8900: make.result<RefactorResult>({\n code: 'CDK_TOOLKIT_I8900',\n description: 'Refactor result',\n interface: 'RefactorResult',\n }),\n\n CDK_TOOLKIT_W8010: make.warn({\n code: 'CDK_TOOLKIT_W8010',\n description: 'Refactor execution not yet supported',\n }),\n\n // 9: Bootstrap (9xxx)\n CDK_TOOLKIT_I9000: make.info<Duration>({\n code: 'CDK_TOOLKIT_I9000',\n description: 'Provides bootstrap times',\n interface: 'Duration',\n }),\n CDK_TOOLKIT_I9100: make.info<BootstrapEnvironmentProgress>({\n code: 'CDK_TOOLKIT_I9100',\n description: 'Bootstrap progress',\n interface: 'BootstrapEnvironmentProgress',\n }),\n\n CDK_TOOLKIT_I9900: make.result<{ environment: cxapi.Environment }>({\n code: 'CDK_TOOLKIT_I9900',\n description: 'Bootstrap results on success',\n interface: 'cxapi.Environment',\n }),\n CDK_TOOLKIT_E9900: make.error<ErrorPayload>({\n code: 'CDK_TOOLKIT_E9900',\n description: 'Bootstrap failed',\n interface: 'ErrorPayload',\n }),\n\n // Notices\n CDK_TOOLKIT_I0100: make.info({\n code: 'CDK_TOOLKIT_I0100',\n description: 'Notices decoration (the header or footer of a list of notices)',\n }),\n CDK_TOOLKIT_W0101: make.warn({\n code: 'CDK_TOOLKIT_W0101',\n description: 'A notice that is marked as a warning',\n }),\n CDK_TOOLKIT_E0101: make.error({\n code: 'CDK_TOOLKIT_E0101',\n description: 'A notice that is marked as an error',\n }),\n CDK_TOOLKIT_I0101: make.info({\n code: 'CDK_TOOLKIT_I0101',\n description: 'A notice that is marked as informational',\n }),\n\n // Assembly codes\n DEFAULT_ASSEMBLY_TRACE: make.trace({\n code: 'CDK_ASSEMBLY_I0000',\n description: 'Default trace messages emitted from Cloud Assembly operations',\n }),\n DEFAULT_ASSEMBLY_DEBUG: make.debug({\n code: 'CDK_ASSEMBLY_I0000',\n description: 'Default debug messages emitted from Cloud Assembly operations',\n }),\n DEFAULT_ASSEMBLY_INFO: make.info({\n code: 'CDK_ASSEMBLY_I0000',\n description: 'Default info messages emitted from Cloud Assembly operations',\n }),\n DEFAULT_ASSEMBLY_WARN: make.warn({\n code: 'CDK_ASSEMBLY_W0000',\n description: 'Default warning messages emitted from Cloud Assembly operations',\n }),\n\n CDK_ASSEMBLY_I0010: make.debug({\n code: 'CDK_ASSEMBLY_I0010',\n description: 'Generic environment preparation debug messages',\n }),\n CDK_ASSEMBLY_W0010: make.warn({\n code: 'CDK_ASSEMBLY_W0010',\n description: 'Emitted if the found framework version does not support context overflow',\n }),\n CDK_ASSEMBLY_I0042: make.debug<UpdatedContext>({\n code: 'CDK_ASSEMBLY_I0042',\n description: 'Writing updated context',\n interface: 'UpdatedContext',\n }),\n CDK_ASSEMBLY_I0240: make.debug<MissingContext>({\n code: 'CDK_ASSEMBLY_I0240',\n description: 'Context lookup was stopped as no further progress was made. ',\n interface: 'MissingContext',\n }),\n CDK_ASSEMBLY_I0241: make.debug<MissingContext>({\n code: 'CDK_ASSEMBLY_I0241',\n description: 'Fetching missing context. This is an iterative message that may appear multiple times with different missing keys.',\n interface: 'MissingContext',\n }),\n CDK_ASSEMBLY_I1000: make.debug({\n code: 'CDK_ASSEMBLY_I1000',\n description: 'Cloud assembly output starts',\n }),\n CDK_ASSEMBLY_I1001: make.info({\n code: 'CDK_ASSEMBLY_I1001',\n description: 'Output lines emitted by the cloud assembly to stdout',\n }),\n CDK_ASSEMBLY_E1002: make.error({\n code: 'CDK_ASSEMBLY_E1002',\n description: 'Output lines emitted by the cloud assembly to stderr',\n }),\n CDK_ASSEMBLY_I1003: make.info({\n code: 'CDK_ASSEMBLY_I1003',\n description: 'Cloud assembly output finished',\n }),\n CDK_ASSEMBLY_E1111: make.error<ErrorPayload>({\n code: 'CDK_ASSEMBLY_E1111',\n description: 'Incompatible CDK CLI version. Upgrade needed.',\n interface: 'ErrorPayload',\n }),\n\n CDK_ASSEMBLY_I0150: make.debug<never>({\n code: 'CDK_ASSEMBLY_I0150',\n description: 'Indicates the use of a pre-synthesized cloud assembly directory',\n }),\n\n CDK_ASSEMBLY_I0300: make.info<ContextProviderMessageSource>({\n code: 'CDK_ASSEMBLY_I0300',\n description: 'An info message emitted by a Context Provider',\n interface: 'ContextProviderMessageSource',\n }),\n CDK_ASSEMBLY_I0301: make.debug<ContextProviderMessageSource>({\n code: 'CDK_ASSEMBLY_I0301',\n description: 'A debug message emitted by a Context Provider',\n interface: 'ContextProviderMessageSource',\n }),\n\n // Assembly Annotations\n CDK_ASSEMBLY_I9999: make.info<cxapi.SynthesisMessage>({\n code: 'CDK_ASSEMBLY_I9999',\n description: 'Annotations emitted by the cloud assembly',\n interface: 'cxapi.SynthesisMessage',\n }),\n CDK_ASSEMBLY_W9999: make.warn<cxapi.SynthesisMessage>({\n code: 'CDK_ASSEMBLY_W9999',\n description: 'Warnings emitted by the cloud assembly',\n interface: 'cxapi.SynthesisMessage',\n }),\n CDK_ASSEMBLY_E9999: make.error<cxapi.SynthesisMessage>({\n code: 'CDK_ASSEMBLY_E9999',\n description: 'Errors emitted by the cloud assembly',\n interface: 'cxapi.SynthesisMessage',\n }),\n\n // SDK codes\n DEFAULT_SDK_TRACE: make.trace({\n code: 'CDK_SDK_I0000',\n description: 'An SDK trace message.',\n }),\n DEFAULT_SDK_DEBUG: make.debug({\n code: 'CDK_SDK_I0000',\n description: 'An SDK debug message.',\n }),\n DEFAULT_SDK_WARN: make.warn({\n code: 'CDK_SDK_W0000',\n description: 'An SDK warning message.',\n }),\n CDK_SDK_I0100: make.trace<SdkTrace>({\n code: 'CDK_SDK_I0100',\n description: 'An SDK trace. SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level.',\n interface: 'SdkTrace',\n }),\n};\n\n//////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Payload type of the end message must extend Duration\n */\nexport const SPAN = {\n SYNTH_ASSEMBLY: {\n name: 'Synthesis',\n start: IO.CDK_TOOLKIT_I1001,\n end: IO.CDK_TOOLKIT_I1000,\n },\n DEPLOY_STACK: {\n name: 'Deployment',\n start: IO.CDK_TOOLKIT_I5100,\n end: IO.CDK_TOOLKIT_I5001,\n },\n ROLLBACK_STACK: {\n name: 'Rollback',\n start: IO.CDK_TOOLKIT_I6100,\n end: IO.CDK_TOOLKIT_I6000,\n },\n DIFF_STACK: {\n name: 'Diff',\n start: IO.CDK_TOOLKIT_I4000,\n end: IO.CDK_TOOLKIT_I4001,\n },\n DESTROY_STACK: {\n name: 'Destroy',\n start: IO.CDK_TOOLKIT_I7100,\n end: IO.CDK_TOOLKIT_I7001,\n },\n DESTROY_ACTION: {\n name: 'Destroy',\n start: IO.CDK_TOOLKIT_I7101,\n end: IO.CDK_TOOLKIT_I7000,\n },\n BOOTSTRAP_SINGLE: {\n name: 'Bootstrap',\n start: IO.CDK_TOOLKIT_I9100,\n end: IO.CDK_TOOLKIT_I9000,\n },\n BUILD_ASSET: {\n name: 'Build Asset',\n start: IO.CDK_TOOLKIT_I5210,\n end: IO.CDK_TOOLKIT_I5211,\n },\n PUBLISH_ASSET: {\n name: 'Publish Asset',\n start: IO.CDK_TOOLKIT_I5220,\n end: IO.CDK_TOOLKIT_I5221,\n },\n HOTSWAP: {\n name: 'hotswap-deployment',\n start: IO.CDK_TOOLKIT_I5400,\n end: IO.CDK_TOOLKIT_I5410,\n },\n} satisfies Record<string, SpanDefinition<any, any>>;\n", "import * as util from 'util';\nimport type { ActionLessMessage, ActionLessRequest, IoHelper } from './io-helper';\nimport type { IoMessageMaker } from './message-maker';\nimport { IO } from './messages';\n\n/**\n * Helper class to emit standard log messages to an IoHost\n *\n * It wraps an `IoHelper`, and adds convenience methods to emit default messages\n * for the various log levels.\n */\nexport class IoDefaultMessages {\n constructor(private readonly ioHelper: IoHelper) {\n }\n\n public notify(msg: ActionLessMessage<unknown>): Promise<void> {\n return this.ioHelper.notify(msg);\n }\n\n public requestResponse<T, U>(msg: ActionLessRequest<T, U>): Promise<U> {\n return this.ioHelper.requestResponse(msg);\n }\n\n public error(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_ERROR, input, ...args);\n }\n\n public warn(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_WARN, input, ...args);\n }\n\n public warning(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_WARN, input, ...args);\n }\n\n public info(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_INFO, input, ...args);\n }\n\n public debug(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_DEBUG, input, ...args);\n }\n\n public trace(input: string, ...args: unknown[]) {\n this.emitMessage(IO.DEFAULT_TOOLKIT_TRACE, input, ...args);\n }\n\n public result(input: string, ...args: unknown[]) {\n const message = args.length > 0 ? util.format(input, ...args) : input;\n // This is just the default \"info\" message but with a level of \"result\"\n void this.ioHelper.notify({\n time: new Date(),\n code: IO.DEFAULT_TOOLKIT_INFO.code,\n level: 'result',\n message,\n data: undefined,\n });\n }\n\n private emitMessage(maker: IoMessageMaker<void>, input: string, ...args: unknown[]) {\n // Format message if args are provided\n const message = args.length > 0 ? util.format(input, ...args) : input;\n void this.ioHelper.notify(maker.msg(message));\n }\n}\n", "import type { Duration } from './types';\n\n/**\n * Different types of permission related changes in a diff\n */\nexport enum PermissionChangeType {\n /**\n * No permission changes\n */\n NONE = 'none',\n\n /**\n * Permissions are broadening\n */\n BROADENING = 'broadening',\n\n /**\n * Permissions are changed but not broadening\n */\n NON_BROADENING = 'non-broadening',\n}\n\n/**\n * Output of the diff command\n */\nexport interface DiffResult extends Duration {\n /**\n * Stack diff formatted as a string\n */\n readonly formattedStackDiff: string;\n\n /**\n * Security diff formatted as a string\n */\n readonly formattedSecurityDiff: string;\n}\n", "import type { PropertyDifference, Resource } from '@aws-cdk/cloudformation-diff';\nimport type * as cxapi from '@aws-cdk/cx-api';\nimport type { Duration } from './types';\nimport type { ResourceMetadata } from '../api/resource-metadata/resource-metadata';\n\n/**\n * A resource affected by a change\n */\nexport interface AffectedResource {\n /**\n * The logical ID of the affected resource in the template\n */\n readonly logicalId: string;\n /**\n * The CloudFormation type of the resource\n * This could be a custom type.\n */\n readonly resourceType: string;\n /**\n * The friendly description of the affected resource\n */\n readonly description?: string;\n /**\n * The physical name of the resource when deployed.\n *\n * A physical name is not always available, e.g. new resources will not have one until after the deployment\n */\n readonly physicalName?: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * Represents a change in a resource\n */\nexport interface ResourceChange {\n /**\n * The logical ID of the resource which is being changed\n */\n readonly logicalId: string;\n /**\n * The value the resource is being updated from\n */\n readonly oldValue: Resource;\n /**\n * The value the resource is being updated to\n */\n readonly newValue: Resource;\n /**\n * The changes made to the resource properties\n */\n readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * A change that can be hotswapped\n */\nexport interface HotswappableChange {\n /**\n * The resource change that is causing the hotswap.\n */\n readonly cause: ResourceChange;\n /**\n * A list of resources that are being hotswapped as part of the change\n */\n readonly resources: AffectedResource[];\n}\n\nexport enum NonHotswappableReason {\n /**\n * Tags are not hotswappable\n */\n TAGS = 'tags',\n /**\n * Changed resource properties are not hotswappable on this resource type\n */\n PROPERTIES = 'properties',\n /**\n * A stack output has changed\n */\n OUTPUT = 'output',\n /**\n * A dependant resource is not hotswappable\n */\n DEPENDENCY_UNSUPPORTED = 'dependency-unsupported',\n /**\n * The resource type is not hotswappable\n */\n RESOURCE_UNSUPPORTED = 'resource-unsupported',\n /**\n * The resource is created in the deployment\n */\n RESOURCE_CREATION = 'resource-creation',\n /**\n * The resource is removed in the deployment\n */\n RESOURCE_DELETION = 'resource-deletion',\n /**\n * The resource identified by the logical id has its type changed\n */\n RESOURCE_TYPE_CHANGED = 'resource-type-changed',\n /**\n * The nested stack is created in the deployment\n */\n NESTED_STACK_CREATION = 'nested-stack-creation',\n}\n\nexport interface RejectionSubject {\n /**\n * The type of the rejection subject, e.g. Resource or Output\n */\n readonly type: string;\n\n /**\n * The logical ID of the change that is not hotswappable\n */\n readonly logicalId: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\nexport interface ResourceSubject extends RejectionSubject {\n /**\n * A rejected resource\n */\n readonly type: 'Resource';\n /**\n * The type of the rejected resource\n */\n readonly resourceType: string;\n /**\n * The list of properties that are cause for the rejection\n */\n readonly rejectedProperties?: string[];\n}\n\nexport interface OutputSubject extends RejectionSubject {\n /**\n * A rejected output\n */\n readonly type: 'Output';\n}\n\n/**\n * A change that can not be hotswapped\n */\nexport interface NonHotswappableChange {\n /**\n * The subject of the change that was rejected\n */\n readonly subject: ResourceSubject | OutputSubject;\n /**\n * Why was this change was deemed non-hotswappable\n */\n readonly reason: NonHotswappableReason;\n /**\n * Tells the user exactly why this change was deemed non-hotswappable and what its logical ID is.\n * If not specified, `displayReason` default to state that the properties listed in `rejectedChanges` are not hotswappable.\n */\n readonly description: string;\n}\n\nexport interface HotswapDeploymentAttempt {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n}\n\n/**\n * Information about a hotswap deployment\n */\nexport interface HotswapDeploymentDetails {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n /**\n * The changes that were deemed hotswappable\n */\n readonly hotswappableChanges: HotswappableChange[];\n /**\n * The changes that were deemed not hotswappable\n */\n readonly nonHotswappableChanges: NonHotswappableChange[];\n}\n\n/**\n * The result of an attempted hotswap deployment\n */\nexport interface HotswapResult extends Duration, HotswapDeploymentDetails {\n /**\n * Whether hotswapping happened or not.\n *\n * `false` indicates that the deployment could not be hotswapped and full deployment may be attempted as fallback.\n */\n readonly hotswapped: boolean;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAM,uBAAuB,OAAO,IAAI,mCAAmC;AAC3E,IAAM,8BAA8B,OAAO,IAAI,0CAA0C;AACzF,IAAM,wBAAwB,OAAO,IAAI,oCAAoC;AAC7E,IAAM,gCAAgC,OAAO,IAAI,2CAA2C;AAKrF,IAAM,eAAN,MAAM,sBAAqB,MAAM;AAAA;AAAA;AAAA;AAAA,EAItC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,uBAAA,YAAS;AAIT,EAAAA,uBAAA,4BAAyB;AAIzB,EAAAA,uBAAA,0BAAuB;AAIvB,EAAAA,uBAAA,uBAAoB;AAIpB,EAAAA,uBAAA,uBAAoB;AAIpB,EAAAA,uBAAA,2BAAwB;AAIxB,EAAAA,uBAAA,2BAAwB;AApCd,SAAAA;AAAA,GAAA;",
|
|
6
|
+
"names": ["message", "error", "StackSelectionStrategy", "ExpandStackSelection", "import_util", "message", "util", "message", "PermissionChangeType", "NonHotswappableReason"]
|
|
7
7
|
}
|
package/lib/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ICloudAssemblySource } from '../../api/cloud-assembly';
|
|
2
2
|
import { StackAssembly } from '../../api/cloud-assembly/private';
|
|
3
|
-
import type { SdkProvider, IoHelper } from '../../api/shared-private';
|
|
3
|
+
import type { SdkProvider, IoHelper, PluginHost } from '../../api/shared-private';
|
|
4
4
|
/**
|
|
5
5
|
* Helper struct to pass internal services around.
|
|
6
6
|
*/
|
|
7
7
|
export interface ToolkitServices {
|
|
8
8
|
sdkProvider: SdkProvider;
|
|
9
9
|
ioHelper: IoHelper;
|
|
10
|
+
pluginHost: PluginHost;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Creates a Toolkit internal CloudAssembly from a CloudAssemblySource.
|
|
@@ -22,4 +22,4 @@ async function assemblyFromSource(ioHelper, assemblySource, cache = true) {
|
|
|
22
22
|
}
|
|
23
23
|
return new private_1.StackAssembly(await assemblySource.produce(), ioHelper);
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQXdCQSxnREFXQztBQWpDRCw4REFBaUU7QUFZ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scGVyKTtcbn1cbiJdfQ==
|
package/lib/toolkit/toolkit.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '../private/dispose-polyfill';
|
|
1
2
|
import type { TemplateDiff } from '@aws-cdk/cloudformation-diff';
|
|
2
3
|
import type { DeployResult, DestroyResult, RollbackResult } from './types';
|
|
3
4
|
import type { BootstrapEnvironments, BootstrapOptions, BootstrapResult } from '../actions/bootstrap';
|
|
@@ -15,6 +16,7 @@ import { CachedCloudAssembly } from '../api/cloud-assembly';
|
|
|
15
16
|
import { CloudAssemblySourceBuilder } from '../api/cloud-assembly/private';
|
|
16
17
|
import type { IIoHost } from '../api/io';
|
|
17
18
|
import type { StackDetails } from '../api/shared-public';
|
|
19
|
+
import { PluginHost } from '../api/shared-public';
|
|
18
20
|
export interface ToolkitOptions {
|
|
19
21
|
/**
|
|
20
22
|
* The IoHost implementation, handling the inline interactions between the Toolkit and an integration.
|
|
@@ -51,6 +53,16 @@ export interface ToolkitOptions {
|
|
|
51
53
|
* @default "error"
|
|
52
54
|
*/
|
|
53
55
|
readonly assemblyFailureAt?: 'error' | 'warn' | 'none';
|
|
56
|
+
/**
|
|
57
|
+
* The plugin host to use for loading and querying plugins
|
|
58
|
+
*
|
|
59
|
+
* By default, a unique instance of a plugin managing class will be used.
|
|
60
|
+
*
|
|
61
|
+
* Use `toolkit.pluginHost.load()` to load plugins into the plugin host from disk.
|
|
62
|
+
*
|
|
63
|
+
* @default - A fresh plugin host
|
|
64
|
+
*/
|
|
65
|
+
readonly pluginHost?: PluginHost;
|
|
54
66
|
}
|
|
55
67
|
/**
|
|
56
68
|
* The AWS CDK Programmatic Toolkit
|
|
@@ -65,10 +77,15 @@ export declare class Toolkit extends CloudAssemblySourceBuilder {
|
|
|
65
77
|
* The IoHost of this Toolkit
|
|
66
78
|
*/
|
|
67
79
|
readonly ioHost: IIoHost;
|
|
80
|
+
/**
|
|
81
|
+
* The plugin host for loading and managing plugins
|
|
82
|
+
*/
|
|
83
|
+
readonly pluginHost: PluginHost;
|
|
68
84
|
/**
|
|
69
85
|
* Cache of the internal SDK Provider instance
|
|
70
86
|
*/
|
|
71
87
|
private sdkProviderCache?;
|
|
88
|
+
private baseCredentials;
|
|
72
89
|
constructor(props?: ToolkitOptions);
|
|
73
90
|
/**
|
|
74
91
|
* Bootstrap Action
|