@aws-cdk/toolkit-lib 0.1.5 → 0.1.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/build-info.json +2 -2
- package/lib/actions/deploy/index.d.ts +1 -17
- package/lib/actions/deploy/index.js +2 -20
- package/lib/api/aws-cdk.js +548 -267
- package/lib/api/aws-cdk.js.map +4 -4
- package/lib/api/shared-private.js +189 -30
- package/lib/api/shared-private.js.map +4 -4
- package/lib/api/shared-public.d.ts +158 -4
- package/lib/api/shared-public.js +10 -0
- package/lib/api/shared-public.js.map +4 -4
- package/lib/private/util.js +13 -3
- package/lib/private/util.js.map +2 -2
- package/lib/toolkit/toolkit.js +2 -2
- package/package.json +3 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["shared-private.ts", "../../../tmp-toolkit-helpers/src/api/io/private/span.ts", "../../../tmp-toolkit-helpers/src/util/archive.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.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"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport * from '../../../tmp-toolkit-helpers/src/api/io/private';\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 { formatTime } from '../../../util';\nimport type { Duration } from '../payloads/types';\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(first: any, second?: 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 startMsg = second ? first : 'Starting %s ...';\n const startPayload = second ?? first;\n\n await notify(this.definition.start.msg(\n util.format(startMsg, this.definition.name),\n startPayload,\n ));\n\n const timingMsg = '\\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 (msg?: ActionLessMessage<object>): Promise<ElapsedTime> => {\n if (msg) {\n await notify({\n ...msg,\n data: msg.data,\n });\n }\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 endMsg = message ? message : timingMsg;\n await notify(maker.msg(util.format(endMsg, this.definition.name, duration.asSec), {\n duration: duration.asMs,\n }));\n return duration;\n },\n\n end: async (a: any, b?: ForceEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime> => {\n const duration = time();\n const endMsg = b ? a : timingMsg;\n const endPayload = b ?? a;\n\n await notify(this.definition.end.msg(\n util.format(endMsg, this.definition.name, duration.asSec), {\n duration: duration.asMs,\n ...endPayload,\n } as E));\n\n return duration;\n },\n };\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", "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 * 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 constructor(message: string, type: string = 'toolkit') {\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 }\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 /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly');\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n this.cause = cause;\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 * 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", "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 extends object ? T : undefined>('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 { 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 { StackDetailsPayload } from '../payloads/list';\nimport type { CloudWatchLogEvent, CloudWatchLogMonitorControlEvent } from '../payloads/logs-monitor';\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, 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\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\n // 1: Synth\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\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({\n code: 'CDK_TOOLKIT_E3900',\n description: 'Resource import failed',\n }),\n\n // 4: Diff\n\n // 5: Deploy & Watch\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({\n code: 'CDK_TOOLKIT_I5002',\n description: 'Provides time for resource migration',\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\n CDK_TOOLKIT_I5100: make.info<StackDeployProgress>({\n code: 'CDK_TOOLKIT_I5100',\n description: 'Stack deploy progress',\n interface: 'StackDeployProgress',\n }),\n\n // Assets\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\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\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 // Stack Monitor\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\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 // errors\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\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\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 // 9: Bootstrap\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 // Assembly codes\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 // 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 CDK_SDK_I0000: make.trace({\n code: 'CDK_SDK_I0000',\n description: 'An SDK 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\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 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} satisfies Record<string, SpanDefinition<any, any>>;\n"],
|
|
5
|
-
"mappings": ";;;;;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AAAA,IACX,MAAM;AAAA,IACN,OAAO,GAAG;AAAA,IACV,KAAK,GAAG;AAAA,EACV;AAAA,EACA,eAAe;AAAA,IACb,MAAM;AAAA,IACN,OAAO,GAAG;AAAA,IACV,KAAK,GAAG;AAAA,EACV;AACF;",
|
|
6
|
-
"names": ["message"]
|
|
3
|
+
"sources": ["shared-private.ts", "../../../tmp-toolkit-helpers/src/api/io/private/span.ts", "../../../tmp-toolkit-helpers/src/util/archive.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.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/api/io/private/testing/test-io-host.ts", "../../../tmp-toolkit-helpers/src/api/io/private/testing/fake-io-host.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport * from '../../../tmp-toolkit-helpers/src/api/io/private';\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 { formatTime } from '../../../util';\nimport type { Duration } from '../payloads/types';\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", "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 * 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 constructor(message: string, type: string = 'toolkit') {\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 }\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 /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly');\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n this.cause = cause;\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 * 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", "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 { 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 { HotswapDeployment } from '../payloads/hotswap';\nimport type { StackDetailsPayload } from '../payloads/list';\nimport type { CloudWatchLogEvent, CloudWatchLogMonitorControlEvent } from '../payloads/logs-monitor';\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, 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 // 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({\n code: 'CDK_TOOLKIT_E3900',\n description: 'Resource import failed',\n }),\n\n // 4: Diff (4xxx)\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({\n code: 'CDK_TOOLKIT_I5002',\n description: 'Provides time for resource migration',\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<HotswapDeployment>({\n code: 'CDK_TOOLKIT_I5400',\n description: 'Starting a hotswap deployment',\n interface: 'HotswapDeployment',\n }),\n CDK_TOOLKIT_I5410: make.info<Duration>({\n code: 'CDK_TOOLKIT_I5410',\n description: 'Hotswap deployment has ended, a full deployment might still follow if needed',\n interface: 'Duration',\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 // errors\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 // 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 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 // 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 CDK_SDK_I0000: make.trace({\n code: 'CDK_SDK_I0000',\n description: 'An SDK 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\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 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 { RequireApproval } from '../../../require-approval';\nimport type { IIoHost } from '../../io-host';\nimport type { IoMessage, IoMessageLevel, IoRequest } from '../../io-message';\nimport { isMessageRelevantForLevel } from '../level-priority';\n\n/**\n * A test implementation of IIoHost that does nothing but can be spied on.\n *\n * Includes a level to filter out irrelevant messages, defaults to `info`.\n *\n * Optionally set an approval level for code `CDK_TOOLKIT_I5060`.\n *\n * # How to use\n *\n * Configure and reset the `notifySpy` and `requestSpy` members as you would any\n * mock function.\n */\nexport class TestIoHost implements IIoHost {\n public readonly notifySpy: jest.Mock<any, any, any>;\n public readonly requestSpy: jest.Mock<any, any, any>;\n\n public requireDeployApproval = RequireApproval.NEVER;\n\n constructor(public level: IoMessageLevel = 'info') {\n this.notifySpy = jest.fn();\n this.requestSpy = jest.fn();\n }\n\n public async notify(msg: IoMessage<unknown>): Promise<void> {\n if (isMessageRelevantForLevel(msg, this.level)) {\n this.notifySpy(msg);\n }\n }\n\n public async requestResponse<T, U>(msg: IoRequest<T, U>): Promise<U> {\n if (isMessageRelevantForLevel(msg, this.level) && this.needsApproval(msg)) {\n this.requestSpy(msg);\n }\n return msg.defaultResponse;\n }\n\n private needsApproval(msg: IoRequest<any, any>): boolean {\n // Return true if the code is unrelated to approval\n if (!['CDK_TOOLKIT_I5060'].includes(msg.code)) {\n return true;\n }\n\n switch (this.requireDeployApproval) {\n case RequireApproval.NEVER:\n return false;\n case RequireApproval.ANY_CHANGE:\n return true;\n case RequireApproval.BROADENING:\n return msg.data?.permissionChangeType === 'broadening';\n default:\n return true;\n }\n }\n}\n", "import type { IIoHost } from '../../io-host';\nimport type { IoMessage, IoMessageLevel, IoRequest } from '../../io-message';\n\n/**\n * An implementation of `IIoHost` that records messages and lets you assert on what was logged\n *\n * It's like `TestIoHost`, but comes with a predefined implementation for `notify`\n * that appends all messages to an in-memory array, and comes with a helper function\n * `expectMessage()` to test for the existence of a function in that array.\n *\n * Has a public mock for `requestResponse` that you configure like any\n * other mock function.\n *\n * # How to use\n *\n * Either create a new instance of this class for every test, or call `clear()`\n * on it between runs.\n */\nexport class FakeIoHost implements IIoHost {\n public messages: Array<IoMessage<unknown>> = [];\n public requestResponse!: <T, U>(msg: IoRequest<T, U>) => Promise<U>;\n\n constructor() {\n this.clear();\n }\n\n public clear() {\n this.messages.splice(0, this.messages.length);\n this.requestResponse = jest.fn().mockRejectedValue(new Error('requestResponse not mocked'));\n }\n\n public async notify(msg: IoMessage<unknown>): Promise<void> {\n this.messages.push(msg);\n }\n\n public expectMessage(m: { containing: string; level?: IoMessageLevel }) {\n expect(this.messages).toContainEqual(expect.objectContaining({\n ...m.level ? { level: m.level } : undefined,\n // Can be a partial string as well\n message: expect.stringContaining(m.containing),\n }));\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,WAAsB;AACtB,WAAsB;;;ACEtB,WAAsB;AAItB,IAAM,WAAW,QAAQ,UAAU;;;ACLnC,IAAM,uBAAuB,OAAO,IAAI,mCAAmC;AAC3E,IAAM,8BAA8B,OAAO,IAAI,0CAA0C;AACzF,IAAM,wBAAwB,OAAO,IAAI,oCAAoC;AAC7E,IAAM,gCAAgC,OAAO,IAAI,2CAA2C;;;ACmBrF,IAAM,UAAU,MAAM;;;ACxB7B,WAAsB;AAEtB,iBAA4B;AA6B5B,SAAS,uBAAuB,eAAuB,aAAmD;AACxG,SAAO;AAAA,IACL,SAAS,OAAY;AACnB,aAAO,OAAO,UAAU;AAAA,IAC1B;AAAA,IACA,KAAK,IAAI,aAAa;AAAA,IACtB,SAAS,CAAC,MAAqB,YAA+B;AAC5D,YAAM,MAAW,CAAC;AAClB,UAAI,cAAc,OAAO,aAAa,KAAK,aAAa;AAAA,MAEtD,wBAAwB,QAAQ,SAAS,EAAE,UAAU,cAAc,SAAS,CAAC,CAAC;AAChF,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,aAA4C;AAAA,EAChD;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAa;AAAA,EAAU;AAAA,EAAe;AAAA,EAAQ;AAAA,EAChE;AAAA,EAAU;AAAA,EAAS;AAAA,EAAa;AAAA,EAAO;AAAA,EAAU;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AACtE,EAAE,IAAI,UAAQ,uBAA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mD;AACtE,WAAO,KAAK,QAAQ,EAAE,eAAe,OAAO,iBAAiB;AAAA,MAC3D,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI;AAAA;AAAA,MAElC,SAAS,OAAO,iBAAiB,EAAE,UAAU;AAAA,IAC/C,CAAC,CAAC;AAAA,EACJ;AACF;",
|
|
6
|
+
"names": ["message", "util", "message"]
|
|
7
7
|
}
|
|
@@ -2259,6 +2259,16 @@ export interface StackProgress {
|
|
|
2259
2259
|
*/
|
|
2260
2260
|
readonly formatted: string;
|
|
2261
2261
|
}
|
|
2262
|
+
interface ResourceMetadata {
|
|
2263
|
+
/**
|
|
2264
|
+
* The resource's metadata as declared in the cloud assembly
|
|
2265
|
+
*/
|
|
2266
|
+
readonly entry: MetadataEntry;
|
|
2267
|
+
/**
|
|
2268
|
+
* The construct path of the resource
|
|
2269
|
+
*/
|
|
2270
|
+
readonly constructPath: string;
|
|
2271
|
+
}
|
|
2262
2272
|
/**
|
|
2263
2273
|
* Payload when stack monitoring is starting or stopping for a given stack deployment.
|
|
2264
2274
|
*/
|
|
@@ -2298,6 +2308,9 @@ export interface StackActivity {
|
|
|
2298
2308
|
readonly event: StackEvent;
|
|
2299
2309
|
/**
|
|
2300
2310
|
* Additional resource metadata
|
|
2311
|
+
*
|
|
2312
|
+
* This information is only available if the information is available in the current cloud assembly.
|
|
2313
|
+
* I.e. no `metadata` will not be available for resource deletion events.
|
|
2301
2314
|
*/
|
|
2302
2315
|
readonly metadata?: ResourceMetadata;
|
|
2303
2316
|
/**
|
|
@@ -2305,10 +2318,6 @@ export interface StackActivity {
|
|
|
2305
2318
|
*/
|
|
2306
2319
|
readonly progress: StackProgress;
|
|
2307
2320
|
}
|
|
2308
|
-
export interface ResourceMetadata {
|
|
2309
|
-
entry: MetadataEntry;
|
|
2310
|
-
constructPath: string;
|
|
2311
|
-
}
|
|
2312
2321
|
export interface StackSelectionDetails {
|
|
2313
2322
|
/**
|
|
2314
2323
|
* The selected stacks, if any
|
|
@@ -2375,6 +2384,133 @@ export interface CloudWatchLogEvent {
|
|
|
2375
2384
|
*/
|
|
2376
2385
|
readonly timestamp: Date;
|
|
2377
2386
|
}
|
|
2387
|
+
interface IDifference<ValueType> {
|
|
2388
|
+
readonly oldValue: ValueType | undefined;
|
|
2389
|
+
readonly newValue: ValueType | undefined;
|
|
2390
|
+
readonly isDifferent: boolean;
|
|
2391
|
+
readonly isAddition: boolean;
|
|
2392
|
+
readonly isRemoval: boolean;
|
|
2393
|
+
readonly isUpdate: boolean;
|
|
2394
|
+
}
|
|
2395
|
+
declare class Difference<ValueType> implements IDifference<ValueType> {
|
|
2396
|
+
readonly oldValue: ValueType | undefined;
|
|
2397
|
+
readonly newValue: ValueType | undefined;
|
|
2398
|
+
/**
|
|
2399
|
+
* Whether this is an actual different or the values are actually the same
|
|
2400
|
+
*
|
|
2401
|
+
* isDifferent => (isUpdate | isRemoved | isUpdate)
|
|
2402
|
+
*/
|
|
2403
|
+
isDifferent: boolean;
|
|
2404
|
+
/**
|
|
2405
|
+
* @param oldValue the old value, cannot be equal (to the sense of +deepEqual+) to +newValue+.
|
|
2406
|
+
* @param newValue the new value, cannot be equal (to the sense of +deepEqual+) to +oldValue+.
|
|
2407
|
+
*/
|
|
2408
|
+
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined);
|
|
2409
|
+
/** @returns +true+ if the element is new to the template. */
|
|
2410
|
+
get isAddition(): boolean;
|
|
2411
|
+
/** @returns +true+ if the element was removed from the template. */
|
|
2412
|
+
get isRemoval(): boolean;
|
|
2413
|
+
/** @returns +true+ if the element was already in the template and is updated. */
|
|
2414
|
+
get isUpdate(): boolean;
|
|
2415
|
+
}
|
|
2416
|
+
declare class PropertyDifference<ValueType> extends Difference<ValueType> {
|
|
2417
|
+
changeImpact?: ResourceImpact;
|
|
2418
|
+
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined, args: {
|
|
2419
|
+
changeImpact?: ResourceImpact;
|
|
2420
|
+
});
|
|
2421
|
+
}
|
|
2422
|
+
declare enum ResourceImpact {
|
|
2423
|
+
/** The existing physical resource will be updated */
|
|
2424
|
+
WILL_UPDATE = "WILL_UPDATE",
|
|
2425
|
+
/** A new physical resource will be created */
|
|
2426
|
+
WILL_CREATE = "WILL_CREATE",
|
|
2427
|
+
/** The existing physical resource will be replaced */
|
|
2428
|
+
WILL_REPLACE = "WILL_REPLACE",
|
|
2429
|
+
/** The existing physical resource may be replaced */
|
|
2430
|
+
MAY_REPLACE = "MAY_REPLACE",
|
|
2431
|
+
/** The existing physical resource will be destroyed */
|
|
2432
|
+
WILL_DESTROY = "WILL_DESTROY",
|
|
2433
|
+
/** The existing physical resource will be removed from CloudFormation supervision */
|
|
2434
|
+
WILL_ORPHAN = "WILL_ORPHAN",
|
|
2435
|
+
/** The existing physical resource will be added to CloudFormation supervision */
|
|
2436
|
+
WILL_IMPORT = "WILL_IMPORT",
|
|
2437
|
+
/** There is no change in this resource */
|
|
2438
|
+
NO_CHANGE = "NO_CHANGE"
|
|
2439
|
+
}
|
|
2440
|
+
interface Resource {
|
|
2441
|
+
Type: string;
|
|
2442
|
+
Properties?: {
|
|
2443
|
+
[name: string]: any;
|
|
2444
|
+
};
|
|
2445
|
+
[key: string]: any;
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* A resource affected by a change
|
|
2449
|
+
*/
|
|
2450
|
+
export interface AffectedResource {
|
|
2451
|
+
/**
|
|
2452
|
+
* The logical ID of the affected resource in the template
|
|
2453
|
+
*/
|
|
2454
|
+
readonly logicalId: string;
|
|
2455
|
+
/**
|
|
2456
|
+
* The CloudFormation type of the resource
|
|
2457
|
+
* This could be a custom type.
|
|
2458
|
+
*/
|
|
2459
|
+
readonly resourceType: string;
|
|
2460
|
+
/**
|
|
2461
|
+
* The friendly description of the affected resource
|
|
2462
|
+
*/
|
|
2463
|
+
readonly description?: string;
|
|
2464
|
+
/**
|
|
2465
|
+
* The physical name of the resource when deployed.
|
|
2466
|
+
*
|
|
2467
|
+
* A physical name is not always available, e.g. new resources will not have one until after the deployment
|
|
2468
|
+
*/
|
|
2469
|
+
readonly physicalName?: string;
|
|
2470
|
+
}
|
|
2471
|
+
/**
|
|
2472
|
+
* Represents a change in a resource
|
|
2473
|
+
*/
|
|
2474
|
+
export interface ResourceChange {
|
|
2475
|
+
/**
|
|
2476
|
+
* The logical ID of the resource which is being changed
|
|
2477
|
+
*/
|
|
2478
|
+
readonly logicalId: string;
|
|
2479
|
+
/**
|
|
2480
|
+
* The value the resource is being updated from
|
|
2481
|
+
*/
|
|
2482
|
+
readonly oldValue: Resource;
|
|
2483
|
+
/**
|
|
2484
|
+
* The value the resource is being updated to
|
|
2485
|
+
*/
|
|
2486
|
+
readonly newValue: Resource;
|
|
2487
|
+
/**
|
|
2488
|
+
* The changes made to the resource properties
|
|
2489
|
+
*/
|
|
2490
|
+
readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* A change that can be hotswapped
|
|
2494
|
+
*/
|
|
2495
|
+
export interface HotswappableChange {
|
|
2496
|
+
/**
|
|
2497
|
+
* The resource change that is causing the hotswap.
|
|
2498
|
+
*/
|
|
2499
|
+
readonly cause: ResourceChange;
|
|
2500
|
+
}
|
|
2501
|
+
/**
|
|
2502
|
+
* Information about a hotswap deployment
|
|
2503
|
+
*/
|
|
2504
|
+
export interface HotswapDeployment {
|
|
2505
|
+
/**
|
|
2506
|
+
* The stack that's currently being deployed
|
|
2507
|
+
*/
|
|
2508
|
+
readonly stack: cxapi.CloudFormationStackArtifact;
|
|
2509
|
+
/**
|
|
2510
|
+
* The mode the hotswap deployment was initiated with.
|
|
2511
|
+
*/
|
|
2512
|
+
readonly mode: "hotswap-only" | "fall-back";
|
|
2513
|
+
}
|
|
2378
2514
|
/**
|
|
2379
2515
|
* Represents a general toolkit error in the AWS CDK Toolkit.
|
|
2380
2516
|
*/
|
|
@@ -2456,9 +2592,27 @@ export declare class ContextProviderError extends ToolkitError {
|
|
|
2456
2592
|
readonly source = "user";
|
|
2457
2593
|
constructor(message: string);
|
|
2458
2594
|
}
|
|
2595
|
+
/**
|
|
2596
|
+
* @deprecated
|
|
2597
|
+
*/
|
|
2598
|
+
declare enum RequireApproval$1 {
|
|
2599
|
+
/**
|
|
2600
|
+
* Never require any security approvals
|
|
2601
|
+
*/
|
|
2602
|
+
NEVER = "never",
|
|
2603
|
+
/**
|
|
2604
|
+
* Any security changes require an approval
|
|
2605
|
+
*/
|
|
2606
|
+
ANY_CHANGE = "any-change",
|
|
2607
|
+
/**
|
|
2608
|
+
* Require approval only for changes that are access broadening
|
|
2609
|
+
*/
|
|
2610
|
+
BROADENING = "broadening"
|
|
2611
|
+
}
|
|
2459
2612
|
|
|
2460
2613
|
export {
|
|
2461
2614
|
MissingContext$1 as MissingContext,
|
|
2615
|
+
RequireApproval$1 as RequireApproval,
|
|
2462
2616
|
};
|
|
2463
2617
|
|
|
2464
2618
|
export {};
|
package/lib/api/shared-public.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(shared_public_exports, {
|
|
|
25
25
|
ContextProviderError: () => ContextProviderError,
|
|
26
26
|
ExpandStackSelection: () => ExpandStackSelection,
|
|
27
27
|
PermissionChangeType: () => PermissionChangeType,
|
|
28
|
+
RequireApproval: () => RequireApproval,
|
|
28
29
|
StackSelectionStrategy: () => StackSelectionStrategy,
|
|
29
30
|
ToolkitError: () => ToolkitError
|
|
30
31
|
});
|
|
@@ -160,6 +161,14 @@ var ContextProviderError = class _ContextProviderError extends ToolkitError {
|
|
|
160
161
|
Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });
|
|
161
162
|
}
|
|
162
163
|
};
|
|
164
|
+
|
|
165
|
+
// ../tmp-toolkit-helpers/src/api/require-approval.ts
|
|
166
|
+
var RequireApproval = /* @__PURE__ */ ((RequireApproval2) => {
|
|
167
|
+
RequireApproval2["NEVER"] = "never";
|
|
168
|
+
RequireApproval2["ANY_CHANGE"] = "any-change";
|
|
169
|
+
RequireApproval2["BROADENING"] = "broadening";
|
|
170
|
+
return RequireApproval2;
|
|
171
|
+
})(RequireApproval || {});
|
|
163
172
|
// Annotate the CommonJS export names for ESM import in node:
|
|
164
173
|
0 && (module.exports = {
|
|
165
174
|
AssemblyError,
|
|
@@ -167,6 +176,7 @@ var ContextProviderError = class _ContextProviderError extends ToolkitError {
|
|
|
167
176
|
ContextProviderError,
|
|
168
177
|
ExpandStackSelection,
|
|
169
178
|
PermissionChangeType,
|
|
179
|
+
RequireApproval,
|
|
170
180
|
StackSelectionStrategy,
|
|
171
181
|
ToolkitError
|
|
172
182
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["shared-public.ts", "../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts", "../../../tmp-toolkit-helpers/src/api/io/payloads/diff.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport * from '../../../tmp-toolkit-helpers/src/api';\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", "/**\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", "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 * 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 constructor(message: string, type: string = 'toolkit') {\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 }\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 /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly');\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n this.cause = cause;\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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAK,yBAAL,kBAAKA,4BAAL;AAKL,EAAAA,wBAAA,gBAAa;AAKb,EAAAA,wBAAA,mBAAgB;AAMhB,EAAAA,wBAAA,iBAAc;AAOd,EAAAA,wBAAA,mBAAgB;AAMhB,EAAAA,wBAAA,wBAAqB;AAMrB,EAAAA,wBAAA,+BAA4B;AAnClB,SAAAA;AAAA,GAAA;AAyCL,IAAK,uBAAL,kBAAKC,0BAAL;AAIL,EAAAA,sBAAA,UAAO;AAKP,EAAAA,sBAAA,cAAW;AAKX,EAAAA,sBAAA,gBAAa;AAdH,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AAC/B,WAAO,eAAe,MAAM,qBAAoB,SAAS;AACzD,WAAO,eAAe,MAAM,6BAA6B,EAAE,OAAO,KAAK,CAAC;AAAA,EAC1E;AACF;AAOO,IAAM,gBAAN,MAAM,uBAAsB,aAAa;AAAA;AAAA;AAAA;AAAA,EAI9C,OAAc,UAAU,SAAiB,OAA+B;AACtE,WAAO,IAAI,eAAc,SAAS,QAAW,KAAK;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA,EAKA,OAAc,WAAW,SAAiB,QAA6D;AACrG,WAAO,IAAI,eAAc,SAAS,MAAM;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA,EAKgB,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA,EAER,YAAY,SAAiB,QAA8C,OAAiB;AAClG,UAAM,SAAS,UAAU;AACzB,WAAO,eAAe,MAAM,eAAc,SAAS;AACnD,WAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,KAAK,CAAC;AAClE,SAAK,SAAS;AACd,SAAK,QAAQ;AAAA,EACf;AACF;AAKO,IAAM,uBAAN,MAAM,8BAA6B,aAAa;AAAA;AAAA;AAAA;AAAA,EAIrC,SAAS;AAAA,EAEzB,YAAY,SAAiB;AAC3B,UAAM,SAAS,kBAAkB;AACjC,WAAO,eAAe,MAAM,sBAAqB,SAAS;AAC1D,WAAO,eAAe,MAAM,+BAA+B,EAAE,OAAO,KAAK,CAAC;AAAA,EAC5E;AACF;",
|
|
6
|
-
"names": ["StackSelectionStrategy", "ExpandStackSelection", "PermissionChangeType"]
|
|
3
|
+
"sources": ["shared-public.ts", "../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts", "../../../tmp-toolkit-helpers/src/api/io/payloads/diff.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.ts", "../../../tmp-toolkit-helpers/src/api/require-approval.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport * from '../../../tmp-toolkit-helpers/src/api';\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", "/**\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", "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 * 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 constructor(message: string, type: string = 'toolkit') {\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 }\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 /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly');\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n this.cause = cause;\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 * @deprecated\n */\nexport enum RequireApproval {\n /**\n * Never require any security approvals\n */\n NEVER = 'never',\n /**\n * Any security changes require an approval\n */\n ANY_CHANGE = 'any-change',\n /**\n * Require approval only for changes that are access broadening\n */\n BROADENING = 'broadening',\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAK,yBAAL,kBAAKA,4BAAL;AAKL,EAAAA,wBAAA,gBAAa;AAKb,EAAAA,wBAAA,mBAAgB;AAMhB,EAAAA,wBAAA,iBAAc;AAOd,EAAAA,wBAAA,mBAAgB;AAMhB,EAAAA,wBAAA,wBAAqB;AAMrB,EAAAA,wBAAA,+BAA4B;AAnClB,SAAAA;AAAA,GAAA;AAyCL,IAAK,uBAAL,kBAAKC,0BAAL;AAIL,EAAAA,sBAAA,UAAO;AAKP,EAAAA,sBAAA,cAAW;AAKX,EAAAA,sBAAA,gBAAa;AAdH,SAAAA;AAAA,GAAA;;;ACzCL,IAAK,uBAAL,kBAAKC,0BAAL;AAIL,EAAAA,sBAAA,UAAO;AAKP,EAAAA,sBAAA,gBAAa;AAKb,EAAAA,sBAAA,oBAAiB;AAdP,SAAAA;AAAA,GAAA;;;ACDZ,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,OAAc,eAAe,GAA2B;AACtD,WAAO,MAAM,QAAQ,OAAO,MAAO,YAAY,wBAAwB;AAAA,EACzE;AAAA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