@aws-cdk/toolkit-lib 0.1.7 → 0.2.0

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.
Files changed (64) hide show
  1. package/api-extractor.json +36 -0
  2. package/build-info.json +2 -2
  3. package/db.json.gz +0 -0
  4. package/lib/actions/bootstrap/index.d.ts +1 -2
  5. package/lib/actions/bootstrap/index.js +13 -6
  6. package/lib/actions/deploy/index.d.ts +1 -21
  7. package/lib/actions/deploy/index.js +1 -1
  8. package/lib/actions/deploy/private/deploy-options.d.ts +16 -4
  9. package/lib/actions/deploy/private/deploy-options.js +1 -1
  10. package/lib/actions/deploy/private/helpers.d.ts +3 -3
  11. package/lib/actions/deploy/private/helpers.js +5 -5
  12. package/lib/actions/destroy/index.d.ts +0 -6
  13. package/lib/actions/destroy/index.js +1 -1
  14. package/lib/actions/diff/index.d.ts +20 -16
  15. package/lib/actions/diff/index.js +4 -1
  16. package/lib/actions/diff/private/helpers.d.ts +3 -0
  17. package/lib/actions/diff/private/helpers.js +89 -1
  18. package/lib/actions/index.d.ts +1 -0
  19. package/lib/actions/index.js +2 -1
  20. package/lib/actions/watch/index.d.ts +0 -14
  21. package/lib/actions/watch/index.js +1 -1
  22. package/lib/api/cloud-assembly/index.d.ts +1 -1
  23. package/lib/api/cloud-assembly/index.js +4 -2
  24. package/lib/api/cloud-assembly/private/context-aware-source.d.ts +1 -1
  25. package/lib/api/cloud-assembly/private/context-aware-source.js +5 -4
  26. package/lib/api/cloud-assembly/private/exec.js +5 -4
  27. package/lib/api/cloud-assembly/private/prepare-source.d.ts +50 -40
  28. package/lib/api/cloud-assembly/private/prepare-source.js +117 -97
  29. package/lib/api/cloud-assembly/private/source-builder.d.ts +0 -6
  30. package/lib/api/cloud-assembly/private/source-builder.js +14 -13
  31. package/lib/api/cloud-assembly/private/stack-assembly.d.ts +3 -3
  32. package/lib/api/cloud-assembly/private/stack-assembly.js +12 -12
  33. package/lib/api/shared-private.d.ts +4 -0
  34. package/lib/api/shared-private.js +11306 -52
  35. package/lib/api/shared-private.js.map +4 -4
  36. package/lib/api/shared-public.d.ts +259 -1104
  37. package/lib/api/shared-public.js +38 -61
  38. package/lib/api/shared-public.js.map +4 -4
  39. package/lib/index.d.ts +1 -0
  40. package/lib/index.js +3 -1
  41. package/lib/index_bg.wasm +0 -0
  42. package/lib/private/dispose-polyfill.d.ts +1 -0
  43. package/lib/private/dispose-polyfill.js +20 -0
  44. package/lib/private/util.js +35 -14
  45. package/lib/private/util.js.map +4 -4
  46. package/lib/toolkit/index.d.ts +2 -1
  47. package/lib/toolkit/index.js +3 -2
  48. package/lib/toolkit/non-interactive-io-host.d.ts +80 -0
  49. package/lib/toolkit/non-interactive-io-host.js +129 -0
  50. package/lib/toolkit/private/index.d.ts +2 -3
  51. package/lib/toolkit/private/index.js +4 -4
  52. package/lib/toolkit/toolkit.d.ts +44 -24
  53. package/lib/toolkit/toolkit.js +191 -93
  54. package/lib/toolkit/types.d.ts +163 -0
  55. package/lib/toolkit/types.js +3 -0
  56. package/lib/util/promises.d.ts +12 -0
  57. package/lib/util/promises.js +17 -0
  58. package/lib/util/shell-env.d.ts +10 -0
  59. package/lib/util/shell-env.js +19 -0
  60. package/package.json +24 -21
  61. package/tsconfig.dts.json +9 -0
  62. package/lib/api/aws-cdk.d.ts +0 -20
  63. package/lib/api/aws-cdk.js +0 -10917
  64. package/lib/api/aws-cdk.js.map +0 -7
@@ -22,55 +22,14 @@ var shared_public_exports = {};
22
22
  __export(shared_public_exports, {
23
23
  AssemblyError: () => AssemblyError,
24
24
  AuthenticationError: () => AuthenticationError,
25
- ContextProviderError: () => ContextProviderError,
26
25
  ExpandStackSelection: () => ExpandStackSelection,
27
26
  NonHotswappableReason: () => NonHotswappableReason,
28
27
  PermissionChangeType: () => PermissionChangeType,
29
- RequireApproval: () => RequireApproval,
30
28
  StackSelectionStrategy: () => StackSelectionStrategy,
31
29
  ToolkitError: () => ToolkitError
32
30
  });
33
31
  module.exports = __toCommonJS(shared_public_exports);
34
32
 
35
- // ../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts
36
- var StackSelectionStrategy = /* @__PURE__ */ ((StackSelectionStrategy2) => {
37
- StackSelectionStrategy2["ALL_STACKS"] = "all-stacks";
38
- StackSelectionStrategy2["MAIN_ASSEMBLY"] = "main-assembly";
39
- StackSelectionStrategy2["ONLY_SINGLE"] = "only-single";
40
- StackSelectionStrategy2["PATTERN_MATCH"] = "pattern-match";
41
- StackSelectionStrategy2["PATTERN_MUST_MATCH"] = "pattern-must-match";
42
- StackSelectionStrategy2["PATTERN_MUST_MATCH_SINGLE"] = "pattern-must-match-single";
43
- return StackSelectionStrategy2;
44
- })(StackSelectionStrategy || {});
45
- var ExpandStackSelection = /* @__PURE__ */ ((ExpandStackSelection2) => {
46
- ExpandStackSelection2["NONE"] = "none";
47
- ExpandStackSelection2["UPSTREAM"] = "upstream";
48
- ExpandStackSelection2["DOWNSTREAM"] = "downstream";
49
- return ExpandStackSelection2;
50
- })(ExpandStackSelection || {});
51
-
52
- // ../tmp-toolkit-helpers/src/api/io/payloads/diff.ts
53
- var PermissionChangeType = /* @__PURE__ */ ((PermissionChangeType2) => {
54
- PermissionChangeType2["NONE"] = "none";
55
- PermissionChangeType2["BROADENING"] = "broadening";
56
- PermissionChangeType2["NON_BROADENING"] = "non-broadening";
57
- return PermissionChangeType2;
58
- })(PermissionChangeType || {});
59
-
60
- // ../tmp-toolkit-helpers/src/api/io/payloads/hotswap.ts
61
- var NonHotswappableReason = /* @__PURE__ */ ((NonHotswappableReason2) => {
62
- NonHotswappableReason2["TAGS"] = "tags";
63
- NonHotswappableReason2["PROPERTIES"] = "properties";
64
- NonHotswappableReason2["OUTPUT"] = "output";
65
- NonHotswappableReason2["DEPENDENCY_UNSUPPORTED"] = "dependency-unsupported";
66
- NonHotswappableReason2["RESOURCE_UNSUPPORTED"] = "resource-unsupported";
67
- NonHotswappableReason2["RESOURCE_CREATION"] = "resource-creation";
68
- NonHotswappableReason2["RESOURCE_DELETION"] = "resource-deletion";
69
- NonHotswappableReason2["RESOURCE_TYPE_CHANGED"] = "resource-type-changed";
70
- NonHotswappableReason2["NESTED_STACK_CREATION"] = "nested-stack-creation";
71
- return NonHotswappableReason2;
72
- })(NonHotswappableReason || {});
73
-
74
33
  // ../tmp-toolkit-helpers/src/api/toolkit-error.ts
75
34
  var TOOLKIT_ERROR_SYMBOL = Symbol.for("@aws-cdk/toolkit-lib.ToolkitError");
76
35
  var AUTHENTICATION_ERROR_SYMBOL = Symbol.for("@aws-cdk/toolkit-lib.AuthenticationError");
@@ -171,34 +130,52 @@ var AssemblyError = class _AssemblyError extends ToolkitError {
171
130
  this.stacks = stacks;
172
131
  }
173
132
  };
174
- var ContextProviderError = class _ContextProviderError extends ToolkitError {
175
- /**
176
- * Denotes the source of the error as user.
177
- */
178
- source = "user";
179
- constructor(message) {
180
- super(message, "context-provider");
181
- Object.setPrototypeOf(this, _ContextProviderError.prototype);
182
- Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });
183
- }
184
- };
185
133
 
186
- // ../tmp-toolkit-helpers/src/api/require-approval.ts
187
- var RequireApproval = /* @__PURE__ */ ((RequireApproval2) => {
188
- RequireApproval2["NEVER"] = "never";
189
- RequireApproval2["ANY_CHANGE"] = "any-change";
190
- RequireApproval2["BROADENING"] = "broadening";
191
- return RequireApproval2;
192
- })(RequireApproval || {});
134
+ // ../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts
135
+ var StackSelectionStrategy = /* @__PURE__ */ ((StackSelectionStrategy2) => {
136
+ StackSelectionStrategy2["ALL_STACKS"] = "all-stacks";
137
+ StackSelectionStrategy2["MAIN_ASSEMBLY"] = "main-assembly";
138
+ StackSelectionStrategy2["ONLY_SINGLE"] = "only-single";
139
+ StackSelectionStrategy2["PATTERN_MATCH"] = "pattern-match";
140
+ StackSelectionStrategy2["PATTERN_MUST_MATCH"] = "pattern-must-match";
141
+ StackSelectionStrategy2["PATTERN_MUST_MATCH_SINGLE"] = "pattern-must-match-single";
142
+ return StackSelectionStrategy2;
143
+ })(StackSelectionStrategy || {});
144
+ var ExpandStackSelection = /* @__PURE__ */ ((ExpandStackSelection2) => {
145
+ ExpandStackSelection2["NONE"] = "none";
146
+ ExpandStackSelection2["UPSTREAM"] = "upstream";
147
+ ExpandStackSelection2["DOWNSTREAM"] = "downstream";
148
+ return ExpandStackSelection2;
149
+ })(ExpandStackSelection || {});
150
+
151
+ // ../tmp-toolkit-helpers/src/payloads/diff.ts
152
+ var PermissionChangeType = /* @__PURE__ */ ((PermissionChangeType2) => {
153
+ PermissionChangeType2["NONE"] = "none";
154
+ PermissionChangeType2["BROADENING"] = "broadening";
155
+ PermissionChangeType2["NON_BROADENING"] = "non-broadening";
156
+ return PermissionChangeType2;
157
+ })(PermissionChangeType || {});
158
+
159
+ // ../tmp-toolkit-helpers/src/payloads/hotswap.ts
160
+ var NonHotswappableReason = /* @__PURE__ */ ((NonHotswappableReason2) => {
161
+ NonHotswappableReason2["TAGS"] = "tags";
162
+ NonHotswappableReason2["PROPERTIES"] = "properties";
163
+ NonHotswappableReason2["OUTPUT"] = "output";
164
+ NonHotswappableReason2["DEPENDENCY_UNSUPPORTED"] = "dependency-unsupported";
165
+ NonHotswappableReason2["RESOURCE_UNSUPPORTED"] = "resource-unsupported";
166
+ NonHotswappableReason2["RESOURCE_CREATION"] = "resource-creation";
167
+ NonHotswappableReason2["RESOURCE_DELETION"] = "resource-deletion";
168
+ NonHotswappableReason2["RESOURCE_TYPE_CHANGED"] = "resource-type-changed";
169
+ NonHotswappableReason2["NESTED_STACK_CREATION"] = "nested-stack-creation";
170
+ return NonHotswappableReason2;
171
+ })(NonHotswappableReason || {});
193
172
  // Annotate the CommonJS export names for ESM import in node:
194
173
  0 && (module.exports = {
195
174
  AssemblyError,
196
175
  AuthenticationError,
197
- ContextProviderError,
198
176
  ExpandStackSelection,
199
177
  NonHotswappableReason,
200
178
  PermissionChangeType,
201
- RequireApproval,
202
179
  StackSelectionStrategy,
203
180
  ToolkitError
204
181
  });
@@ -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/io/payloads/hotswap.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 { PropertyDifference, Resource } from '@aws-cdk/cloudformation-diff';\nimport type * as cxapi from '@aws-cdk/cx-api';\nimport type { Duration } from './types';\nimport type { ResourceMetadata } from '../../resource-metadata/resource-metadata';\n\n/**\n * A resource affected by a change\n */\nexport interface AffectedResource {\n /**\n * The logical ID of the affected resource in the template\n */\n readonly logicalId: string;\n /**\n * The CloudFormation type of the resource\n * This could be a custom type.\n */\n readonly resourceType: string;\n /**\n * The friendly description of the affected resource\n */\n readonly description?: string;\n /**\n * The physical name of the resource when deployed.\n *\n * A physical name is not always available, e.g. new resources will not have one until after the deployment\n */\n readonly physicalName?: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * Represents a change in a resource\n */\nexport interface ResourceChange {\n /**\n * The logical ID of the resource which is being changed\n */\n readonly logicalId: string;\n /**\n * The value the resource is being updated from\n */\n readonly oldValue: Resource;\n /**\n * The value the resource is being updated to\n */\n readonly newValue: Resource;\n /**\n * The changes made to the resource properties\n */\n readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * A change that can be hotswapped\n */\nexport interface HotswappableChange {\n /**\n * The resource change that is causing the hotswap.\n */\n readonly cause: ResourceChange;\n /**\n * A list of resources that are being hotswapped as part of the change\n */\n readonly resources: AffectedResource[];\n}\n\nexport enum NonHotswappableReason {\n /**\n * Tags are not hotswappable\n */\n TAGS = 'tags',\n /**\n * Changed resource properties are not hotswappable on this resource type\n */\n PROPERTIES = 'properties',\n /**\n * A stack output has changed\n */\n OUTPUT = 'output',\n /**\n * A dependant resource is not hotswappable\n */\n DEPENDENCY_UNSUPPORTED = 'dependency-unsupported',\n /**\n * The resource type is not hotswappable\n */\n RESOURCE_UNSUPPORTED = 'resource-unsupported',\n /**\n * The resource is created in the deployment\n */\n RESOURCE_CREATION = 'resource-creation',\n /**\n * The resource is removed in the deployment\n */\n RESOURCE_DELETION = 'resource-deletion',\n /**\n * The resource identified by the logical id has its type changed\n */\n RESOURCE_TYPE_CHANGED = 'resource-type-changed',\n /**\n * The nested stack is created in the deployment\n */\n NESTED_STACK_CREATION = 'nested-stack-creation',\n}\n\nexport interface RejectionSubject {\n /**\n * The type of the rejection subject, e.g. Resource or Output\n */\n readonly type: string;\n\n /**\n * The logical ID of the change that is not hotswappable\n */\n readonly logicalId: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\nexport interface ResourceSubject extends RejectionSubject {\n /**\n * A rejected resource\n */\n readonly type: 'Resource';\n /**\n * The type of the rejected resource\n */\n readonly resourceType: string;\n /**\n * The list of properties that are cause for the rejection\n */\n readonly rejectedProperties?: string[];\n}\n\nexport interface OutputSubject extends RejectionSubject {\n /**\n * A rejected output\n */\n readonly type: 'Output';\n}\n\n/**\n * A change that can not be hotswapped\n */\nexport interface NonHotswappableChange {\n /**\n * The subject of the change that was rejected\n */\n readonly subject: ResourceSubject | OutputSubject;\n /**\n * Why was this change was deemed non-hotswappable\n */\n readonly reason: NonHotswappableReason;\n /**\n * Tells the user exactly why this change was deemed non-hotswappable and what its logical ID is.\n * If not specified, `displayReason` default to state that the properties listed in `rejectedChanges` are not hotswappable.\n */\n readonly description: string;\n}\n\nexport interface HotswapDeploymentAttempt {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n}\n\n/**\n * Information about a hotswap deployment\n */\nexport interface HotswapDeploymentDetails {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n /**\n * The changes that were deemed hotswappable\n */\n readonly hotswappableChanges: HotswappableChange[];\n /**\n * The changes that were deemed not hotswappable\n */\n readonly nonHotswappableChanges: NonHotswappableChange[];\n}\n\n/**\n * The result of an attempted hotswap deployment\n */\nexport interface HotswapResult extends Duration, HotswapDeploymentDetails {\n /**\n * Whether hotswapping happened or not.\n *\n * `false` indicates that the deployment could not be hotswapped and full deployment may be attempted as fallback.\n */\n readonly hotswapped: boolean;\n}\n", "import type * as cxapi from '@aws-cdk/cx-api';\n\nconst TOOLKIT_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ToolkitError');\nconst AUTHENTICATION_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AuthenticationError');\nconst ASSEMBLY_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AssemblyError');\nconst CONTEXT_PROVIDER_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ContextProviderError');\n\n/**\n * Represents a general toolkit error in the AWS CDK Toolkit.\n */\nexport class ToolkitError extends Error {\n /**\n * Determines if a given error is an instance of ToolkitError.\n */\n public static isToolkitError(x: any): x is ToolkitError {\n return x !== null && typeof(x) === 'object' && TOOLKIT_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AuthenticationError.\n */\n public static isAuthenticationError(x: any): x is AuthenticationError {\n return this.isToolkitError(x) && AUTHENTICATION_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isAssemblyError(x: any): x is AssemblyError {\n return this.isToolkitError(x) && ASSEMBLY_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isContextProviderError(x: any): x is ContextProviderError {\n return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;\n }\n\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): ToolkitError {\n return new ToolkitError(message, 'toolkit', error);\n }\n\n /**\n * The type of the error, defaults to \"toolkit\".\n */\n public readonly type: string;\n\n /**\n * Denotes the source of the error as the toolkit.\n */\n public readonly source: 'toolkit' | 'user';\n\n /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n constructor(message: string, type: string = 'toolkit', cause?: unknown) {\n super(message);\n Object.setPrototypeOf(this, ToolkitError.prototype);\n Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });\n this.name = new.target.name;\n this.type = type;\n this.source = 'toolkit';\n this.cause = cause;\n }\n}\n\n/**\n * Represents an authentication-specific error in the AWS CDK Toolkit.\n */\nexport class AuthenticationError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'authentication');\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n Object.defineProperty(this, AUTHENTICATION_ERROR_SYMBOL, { value: true });\n }\n}\n\n/**\n * Represents an error causes by cloud assembly synthesis\n *\n * This includes errors thrown during app execution, as well as failing annotations.\n */\nexport class AssemblyError extends ToolkitError {\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): AssemblyError {\n return new AssemblyError(message, undefined, error);\n }\n\n /**\n * An AssemblyError with a list of stacks as cause\n */\n public static withStacks(message: string, stacks?: cxapi.CloudFormationStackArtifact[]): AssemblyError {\n return new AssemblyError(message, stacks);\n }\n\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n /**\n * The stacks that caused the error, if available\n *\n * The `messages` property of each `cxapi.CloudFormationStackArtifact` will contain the respective errors.\n * Absence indicates synthesis didn't fully complete.\n */\n public readonly stacks?: cxapi.CloudFormationStackArtifact[];\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly', cause);\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n }\n}\n\n/**\n * Represents an error originating from a Context Provider\n */\nexport class ContextProviderError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'context-provider');\n Object.setPrototypeOf(this, ContextProviderError.prototype);\n Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });\n }\n}\n", "/**\n * @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;AAAA;;;ACGO,IAAK,yBAAL,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SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT;AAAA,EAER,YAAY,SAAiB,QAA8C,OAAiB;AAClG,UAAM,SAAS,YAAY,KAAK;AAChC,WAAO,eAAe,MAAM,eAAc,SAAS;AACnD,WAAO,eAAe,MAAM,uBAAuB,EAAE,OAAO,KAAK,CAAC;AAClE,SAAK,SAAS;AAAA,EAChB;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;;;AC5IO,IAAK,kBAAL,kBAAKC,qBAAL;AAIL,EAAAA,iBAAA,WAAQ;AAIR,EAAAA,iBAAA,gBAAa;AAIb,EAAAA,iBAAA,gBAAa;AAZH,SAAAA;AAAA,GAAA;",
6
- "names": ["StackSelectionStrategy", "ExpandStackSelection", "PermissionChangeType", "NonHotswappableReason", "RequireApproval"]
3
+ "sources": ["shared-public.ts", "../../../tmp-toolkit-helpers/src/api/toolkit-error.ts", "../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector.ts", "../../../tmp-toolkit-helpers/src/payloads/diff.ts", "../../../tmp-toolkit-helpers/src/payloads/hotswap.ts"],
4
+ "sourcesContent": ["/* eslint-disable import/no-restricted-paths */\n\nexport {\n ToolkitError,\n AuthenticationError,\n AssemblyError,\n} from '../../../tmp-toolkit-helpers/src/api/toolkit-error';\n\nexport {\n ExpandStackSelection,\n StackSelectionStrategy,\n StackSelector,\n} from '../../../tmp-toolkit-helpers/src/api/cloud-assembly/stack-selector';\n\nexport type {\n IoMessageLevel,\n IoMessageCode,\n IoMessage,\n IoRequest,\n} from '../../../tmp-toolkit-helpers/src/api/io/io-message';\nexport type { IIoHost } from '../../../tmp-toolkit-helpers/src/api/io/io-host';\nexport type { ToolkitAction } from '../../../tmp-toolkit-helpers/src/api/io/toolkit-action';\n\nexport * from '../../../tmp-toolkit-helpers/src/payloads';\n", "import type * as cxapi from '@aws-cdk/cx-api';\n\nconst TOOLKIT_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ToolkitError');\nconst AUTHENTICATION_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AuthenticationError');\nconst ASSEMBLY_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.AssemblyError');\nconst CONTEXT_PROVIDER_ERROR_SYMBOL = Symbol.for('@aws-cdk/toolkit-lib.ContextProviderError');\n\n/**\n * Represents a general toolkit error in the AWS CDK Toolkit.\n */\nexport class ToolkitError extends Error {\n /**\n * Determines if a given error is an instance of ToolkitError.\n */\n public static isToolkitError(x: any): x is ToolkitError {\n return x !== null && typeof(x) === 'object' && TOOLKIT_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AuthenticationError.\n */\n public static isAuthenticationError(x: any): x is AuthenticationError {\n return this.isToolkitError(x) && AUTHENTICATION_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isAssemblyError(x: any): x is AssemblyError {\n return this.isToolkitError(x) && ASSEMBLY_ERROR_SYMBOL in x;\n }\n\n /**\n * Determines if a given error is an instance of AssemblyError.\n */\n public static isContextProviderError(x: any): x is ContextProviderError {\n return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;\n }\n\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): ToolkitError {\n return new ToolkitError(message, 'toolkit', error);\n }\n\n /**\n * The type of the error, defaults to \"toolkit\".\n */\n public readonly type: string;\n\n /**\n * Denotes the source of the error as the toolkit.\n */\n public readonly source: 'toolkit' | 'user';\n\n /**\n * The specific original cause of the error, if available\n */\n public readonly cause?: unknown;\n\n constructor(message: string, type: string = 'toolkit', cause?: unknown) {\n super(message);\n Object.setPrototypeOf(this, ToolkitError.prototype);\n Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });\n this.name = new.target.name;\n this.type = type;\n this.source = 'toolkit';\n this.cause = cause;\n }\n}\n\n/**\n * Represents an authentication-specific error in the AWS CDK Toolkit.\n */\nexport class AuthenticationError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'authentication');\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n Object.defineProperty(this, AUTHENTICATION_ERROR_SYMBOL, { value: true });\n }\n}\n\n/**\n * Represents an error causes by cloud assembly synthesis\n *\n * This includes errors thrown during app execution, as well as failing annotations.\n */\nexport class AssemblyError extends ToolkitError {\n /**\n * An AssemblyError with an original error as cause\n */\n public static withCause(message: string, error: unknown): AssemblyError {\n return new AssemblyError(message, undefined, error);\n }\n\n /**\n * An AssemblyError with a list of stacks as cause\n */\n public static withStacks(message: string, stacks?: cxapi.CloudFormationStackArtifact[]): AssemblyError {\n return new AssemblyError(message, stacks);\n }\n\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n /**\n * The stacks that caused the error, if available\n *\n * The `messages` property of each `cxapi.CloudFormationStackArtifact` will contain the respective errors.\n * Absence indicates synthesis didn't fully complete.\n */\n public readonly stacks?: cxapi.CloudFormationStackArtifact[];\n\n private constructor(message: string, stacks?: cxapi.CloudFormationStackArtifact[], cause?: unknown) {\n super(message, 'assembly', cause);\n Object.setPrototypeOf(this, AssemblyError.prototype);\n Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });\n this.stacks = stacks;\n }\n}\n\n/**\n * Represents an error originating from a Context Provider\n */\nexport class ContextProviderError extends ToolkitError {\n /**\n * Denotes the source of the error as user.\n */\n public readonly source = 'user';\n\n constructor(message: string) {\n super(message, 'context-provider');\n Object.setPrototypeOf(this, ContextProviderError.prototype);\n Object.defineProperty(this, CONTEXT_PROVIDER_ERROR_SYMBOL, { value: true });\n }\n}\n", "/**\n * Which stacks should be selected from a cloud assembly\n */\nexport enum StackSelectionStrategy {\n /**\n * Returns all stacks in the app regardless of patterns,\n * including stacks inside nested assemblies.\n */\n ALL_STACKS = 'all-stacks',\n\n /**\n * Returns all stacks in the main (top level) assembly only.\n */\n MAIN_ASSEMBLY = 'main-assembly',\n\n /**\n * If the assembly includes a single stack, returns it.\n * Otherwise throws an exception.\n */\n ONLY_SINGLE = 'only-single',\n\n /**\n * Return stacks matched by patterns.\n * If no stacks are found, execution is halted successfully.\n * Most likely you don't want to use this but `StackSelectionStrategy.MUST_MATCH_PATTERN`\n */\n PATTERN_MATCH = 'pattern-match',\n\n /**\n * Return stacks matched by patterns.\n * Throws an exception if the patterns don't match at least one stack in the assembly.\n */\n PATTERN_MUST_MATCH = 'pattern-must-match',\n\n /**\n * Returns if exactly one stack is matched by the pattern(s).\n * Throws an exception if no stack, or more than exactly one stack are matched.\n */\n PATTERN_MUST_MATCH_SINGLE = 'pattern-must-match-single',\n}\n\n/**\n * When selecting stacks, what other stacks to include because of dependencies\n */\nexport enum ExpandStackSelection {\n /**\n * Don't select any extra stacks\n */\n NONE = 'none',\n\n /**\n * Include stacks that this stack depends on\n */\n UPSTREAM = 'upstream',\n\n /**\n * Include stacks that depend on this stack\n */\n DOWNSTREAM = 'downstream',\n\n /**\n * @TODO\n * Include both directions.\n * I.e. stacks that this stack depends on, and stacks that depend on this stack.\n */\n // FULL = 'full',\n}\n\n/**\n * A specification of which stacks should be selected\n */\nexport interface StackSelector {\n /**\n * The behavior if if no selectors are provided.\n */\n strategy: StackSelectionStrategy;\n\n /**\n * A list of patterns to match the stack hierarchical ids\n * Only used with `PATTERN_*` selection strategies.\n */\n patterns?: string[];\n\n /**\n * Expand the selection to upstream/downstream stacks.\n * @default ExpandStackSelection.None only select the specified/matched stacks\n */\n expand?: ExpandStackSelection;\n\n /**\n * By default, we throw an exception if the assembly contains no stacks.\n * Set to `false`, to halt execution for empty assemblies without error.\n *\n * Note that actions can still throw if a stack selection result is empty,\n * but the assembly contains stacks in principle.\n *\n * @default true\n */\n failOnEmpty?: boolean;\n}\n", "import type { Duration } from './types';\n\n/**\n * Different types of permission related changes in a diff\n */\nexport enum PermissionChangeType {\n /**\n * No permission changes\n */\n NONE = 'none',\n\n /**\n * Permissions are broadening\n */\n BROADENING = 'broadening',\n\n /**\n * Permissions are changed but not broadening\n */\n NON_BROADENING = 'non-broadening',\n}\n\n/**\n * Output of the diff command\n */\nexport interface DiffResult extends Duration {\n /**\n * Stack diff formatted as a string\n */\n readonly formattedStackDiff: string;\n\n /**\n * Security diff formatted as a string\n */\n readonly formattedSecurityDiff: string;\n}\n", "import type { PropertyDifference, Resource } from '@aws-cdk/cloudformation-diff';\nimport type * as cxapi from '@aws-cdk/cx-api';\nimport type { Duration } from './types';\nimport type { ResourceMetadata } from '../api/resource-metadata/resource-metadata';\n\n/**\n * A resource affected by a change\n */\nexport interface AffectedResource {\n /**\n * The logical ID of the affected resource in the template\n */\n readonly logicalId: string;\n /**\n * The CloudFormation type of the resource\n * This could be a custom type.\n */\n readonly resourceType: string;\n /**\n * The friendly description of the affected resource\n */\n readonly description?: string;\n /**\n * The physical name of the resource when deployed.\n *\n * A physical name is not always available, e.g. new resources will not have one until after the deployment\n */\n readonly physicalName?: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * Represents a change in a resource\n */\nexport interface ResourceChange {\n /**\n * The logical ID of the resource which is being changed\n */\n readonly logicalId: string;\n /**\n * The value the resource is being updated from\n */\n readonly oldValue: Resource;\n /**\n * The value the resource is being updated to\n */\n readonly newValue: Resource;\n /**\n * The changes made to the resource properties\n */\n readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\n/**\n * A change that can be hotswapped\n */\nexport interface HotswappableChange {\n /**\n * The resource change that is causing the hotswap.\n */\n readonly cause: ResourceChange;\n /**\n * A list of resources that are being hotswapped as part of the change\n */\n readonly resources: AffectedResource[];\n}\n\nexport enum NonHotswappableReason {\n /**\n * Tags are not hotswappable\n */\n TAGS = 'tags',\n /**\n * Changed resource properties are not hotswappable on this resource type\n */\n PROPERTIES = 'properties',\n /**\n * A stack output has changed\n */\n OUTPUT = 'output',\n /**\n * A dependant resource is not hotswappable\n */\n DEPENDENCY_UNSUPPORTED = 'dependency-unsupported',\n /**\n * The resource type is not hotswappable\n */\n RESOURCE_UNSUPPORTED = 'resource-unsupported',\n /**\n * The resource is created in the deployment\n */\n RESOURCE_CREATION = 'resource-creation',\n /**\n * The resource is removed in the deployment\n */\n RESOURCE_DELETION = 'resource-deletion',\n /**\n * The resource identified by the logical id has its type changed\n */\n RESOURCE_TYPE_CHANGED = 'resource-type-changed',\n /**\n * The nested stack is created in the deployment\n */\n NESTED_STACK_CREATION = 'nested-stack-creation',\n}\n\nexport interface RejectionSubject {\n /**\n * The type of the rejection subject, e.g. Resource or Output\n */\n readonly type: string;\n\n /**\n * The logical ID of the change that is not hotswappable\n */\n readonly logicalId: string;\n /**\n * Resource metadata attached to the logical id from the cloud assembly\n *\n * This is only present if the resource is present in the current Cloud Assembly,\n * i.e. resource deletions will not have metadata.\n */\n readonly metadata?: ResourceMetadata;\n}\n\nexport interface ResourceSubject extends RejectionSubject {\n /**\n * A rejected resource\n */\n readonly type: 'Resource';\n /**\n * The type of the rejected resource\n */\n readonly resourceType: string;\n /**\n * The list of properties that are cause for the rejection\n */\n readonly rejectedProperties?: string[];\n}\n\nexport interface OutputSubject extends RejectionSubject {\n /**\n * A rejected output\n */\n readonly type: 'Output';\n}\n\n/**\n * A change that can not be hotswapped\n */\nexport interface NonHotswappableChange {\n /**\n * The subject of the change that was rejected\n */\n readonly subject: ResourceSubject | OutputSubject;\n /**\n * Why was this change was deemed non-hotswappable\n */\n readonly reason: NonHotswappableReason;\n /**\n * Tells the user exactly why this change was deemed non-hotswappable and what its logical ID is.\n * If not specified, `displayReason` default to state that the properties listed in `rejectedChanges` are not hotswappable.\n */\n readonly description: string;\n}\n\nexport interface HotswapDeploymentAttempt {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n}\n\n/**\n * Information about a hotswap deployment\n */\nexport interface HotswapDeploymentDetails {\n /**\n * The stack that's currently being deployed\n */\n readonly stack: cxapi.CloudFormationStackArtifact;\n\n /**\n * The mode the hotswap deployment was initiated with.\n */\n readonly mode: 'hotswap-only' | 'fall-back';\n /**\n * The changes that were deemed hotswappable\n */\n readonly hotswappableChanges: HotswappableChange[];\n /**\n * The changes that were deemed not hotswappable\n */\n readonly nonHotswappableChanges: NonHotswappableChange[];\n}\n\n/**\n * The result of an attempted hotswap deployment\n */\nexport interface HotswapResult extends Duration, HotswapDeploymentDetails {\n /**\n * Whether hotswapping happened or not.\n *\n * `false` indicates that the deployment could not be hotswapped and full deployment may be attempted as fallback.\n */\n readonly hotswapped: boolean;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAM,uBAAuB,OAAO,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,EAC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angeType", "NonHotswappableReason"]
7
7
  }
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @module toolkit-lib
3
3
  */
4
+ import './private/dispose-polyfill';
4
5
  export * from './toolkit';
5
6
  export * from './actions';
6
7
  export * from './api/aws-auth';
package/lib/index.js CHANGED
@@ -17,6 +17,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ // Polyfills first
21
+ require("./private/dispose-polyfill");
20
22
  // The main show
21
23
  __exportStar(require("./toolkit"), exports);
22
24
  __exportStar(require("./actions"), exports);
@@ -25,4 +27,4 @@ __exportStar(require("./api/aws-auth"), exports);
25
27
  __exportStar(require("./api/cloud-assembly"), exports);
26
28
  __exportStar(require("./api/io"), exports);
27
29
  __exportStar(require("./api/shared-public"), exports);
28
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFSCxnQkFBZ0I7QUFDaEIsNENBQTBCO0FBQzFCLDRDQUEwQjtBQUUxQixrQkFBa0I7QUFDbEIsaURBQStCO0FBQy9CLHVEQUFxQztBQUNyQywyQ0FBeUI7QUFDekIsc0RBQW9DIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbW9kdWxlIHRvb2xraXQtbGliXG4gKi9cblxuLy8gVGhlIG1haW4gc2hvd1xuZXhwb3J0ICogZnJvbSAnLi90b29sa2l0JztcbmV4cG9ydCAqIGZyb20gJy4vYWN0aW9ucyc7XG5cbi8vIFN1cHBvcnRpbmcgYWN0c1xuZXhwb3J0ICogZn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1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // This file needs to be imported as one of the first files in the library.
4
+ // It polyfills some symbols that the new JavaScript "Disposable" API introduces.
5
+ //
6
+ // See <https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html>
7
+ //
8
+ // In short, the new proposal is a `using`/`await using` statement, which will automatically
9
+ // call methods named `[Symbol.dispose]` and `[Symbol.asyncDispose]` on objects.
10
+ //
11
+ // TypeScript knows about those symbols, and it will downlevel the `using` syntax to
12
+ // plain JavaScript... but it doesn't define the Symbols themselves! They must exist
13
+ // in the environment, or code defining objects using those Symbol names will fail.
14
+ //
15
+ // MDN doesn't even know that Node 22 has them already; for broadest compatibility,
16
+ // we just polyfill them here. Their value doesn't matter, they just need to exist
17
+ // and be unique symbols.
18
+ Symbol.dispose ??= Symbol('Symbol.dispose');
19
+ Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose');
20
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzcG9zZS1wb2x5ZmlsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImRpc3Bvc2UtcG9seWZpbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwyRUFBMkU7QUFDM0UsaUZBQWlGO0FBQ2pGLEVBQUU7QUFDRix1RkFBdUY7QUFDdkYsRUFBRTtBQUNGLDRGQUE0RjtBQUM1RixnRkFBZ0Y7QUFDaEYsRUFBRTtBQUNGLG9GQUFvRjtBQUNwRixvRkFBb0Y7QUFDcEYsbUZBQW1GO0FBQ25GLEVBQUU7QUFDRixtRkFBbUY7QUFDbkYsa0ZBQWtGO0FBQ2xGLHlCQUF5QjtBQUN4QixNQUFjLENBQUMsT0FBTyxLQUFLLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQ3BELE1BQWMsQ0FBQyxZQUFZLEtBQUssTUFBTSxDQU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lYWR5OyBmb3IgYnJvYWRlc3QgY29tcGF0aWJpbGl0eSxcbi8vIHdlIGp1c3QgcG9seWZpbGwgdGhlbSBoZXJlLiBUaGVpciB2YWx1ZSBkb2Vzbid0IG1hdHRlciwgdGhleSBqdXN0IG5lZWQgdG8gZXhpc3Rcbi8vIGFuZCBiZSB1bmlxdWUgc3ltYm9scy5cbihTeW1ib2wgYXMgYW55KS5kaXNwb3NlID8/PSBTeW1ib2woJ1N5bWJvbC5kaXNwb3NlJyk7XG4oU3ltYm9sIGFzIGFueSkuYXN5bmNEaXNwb3NlID8/PSBTeW1ib2woJ1N5bWJvbC5hc3luY0Rpc3Bvc2UnKTtcbiJdfQ==
@@ -43,6 +43,7 @@ __export(util_exports, {
43
43
  deepSet: () => deepSet,
44
44
  deserialize: () => deserialize,
45
45
  deserializeStructure: () => deserializeStructure,
46
+ displayVersion: () => displayVersion,
46
47
  findJsonValue: () => findJsonValue,
47
48
  flatMap: () => flatMap,
48
49
  flatten: () => flatten,
@@ -52,6 +53,7 @@ __export(util_exports, {
52
53
  getResultObj: () => getResultObj,
53
54
  ifDefined: () => ifDefined,
54
55
  isArray: () => isArray,
56
+ isDeveloperBuild: () => isDeveloperBuild,
55
57
  isEmpty: () => isEmpty,
56
58
  isObject: () => isObject,
57
59
  loadStructuredFile: () => loadStructuredFile,
@@ -74,6 +76,7 @@ __export(util_exports, {
74
76
  toYAML: () => toYAML,
75
77
  transformObjectKeys: () => transformObjectKeys,
76
78
  validateSnsTopicArn: () => validateSnsTopicArn,
79
+ versionNumber: () => versionNumber,
77
80
  zipDirectory: () => zipDirectory
78
81
  });
79
82
  module.exports = __toCommonJS(util_exports);
@@ -350,13 +353,13 @@ function getResultObj(jsonObject, identifier, propertiesToReturn) {
350
353
  Object.assign(propsObj, { ["Identifier"]: identifier });
351
354
  return propsObj;
352
355
  }
353
- function findJsonValue(jsonObject, path3) {
354
- const paths = path3.split(".");
356
+ function findJsonValue(jsonObject, path4) {
357
+ const paths = path4.split(".");
355
358
  let obj = jsonObject;
356
359
  paths.forEach((p) => {
357
360
  obj = obj[p];
358
361
  if (obj === void 0) {
359
- throw new TypeError(`Cannot read field ${path3}. ${p} is not found.`);
362
+ throw new TypeError(`Cannot read field ${path4}. ${p} is not found.`);
360
363
  }
361
364
  });
362
365
  return obj;
@@ -416,21 +419,21 @@ function makeObject(pairs) {
416
419
  }
417
420
  return ret;
418
421
  }
419
- function deepGet(x, path3) {
420
- path3 = path3.slice();
421
- while (path3.length > 0 && isObject(x)) {
422
- const key = path3.shift();
422
+ function deepGet(x, path4) {
423
+ path4 = path4.slice();
424
+ while (path4.length > 0 && isObject(x)) {
425
+ const key = path4.shift();
423
426
  x = x[key];
424
427
  }
425
- return path3.length === 0 ? x : void 0;
428
+ return path4.length === 0 ? x : void 0;
426
429
  }
427
- function deepSet(x, path3, value) {
428
- path3 = path3.slice();
429
- if (path3.length === 0) {
430
+ function deepSet(x, path4, value) {
431
+ path4 = path4.slice();
432
+ if (path4.length === 0) {
430
433
  throw new ToolkitError("Path may not be empty");
431
434
  }
432
- while (path3.length > 1 && isObject(x)) {
433
- const key = path3.shift();
435
+ while (path4.length > 1 && isObject(x)) {
436
+ const key = path4.shift();
434
437
  if (isPrototypePollutingKey(key)) {
435
438
  continue;
436
439
  }
@@ -442,7 +445,7 @@ function deepSet(x, path3, value) {
442
445
  if (!isObject(x)) {
443
446
  throw new ToolkitError(`Expected an object, got '${x}'`);
444
447
  }
445
- const finalKey = path3[0];
448
+ const finalKey = path4[0];
446
449
  if (isPrototypePollutingKey(finalKey)) {
447
450
  return;
448
451
  }
@@ -560,6 +563,21 @@ async function parallelPromises(n, promises) {
560
563
  });
561
564
  }
562
565
 
566
+ // ../tmp-toolkit-helpers/src/util/package-info.ts
567
+ var path3 = __toESM(require("path"));
568
+ function displayVersion() {
569
+ return `${versionNumber()} (build ${commit()})`;
570
+ }
571
+ function isDeveloperBuild() {
572
+ return versionNumber() === "0.0.0";
573
+ }
574
+ function versionNumber() {
575
+ return require(path3.join(bundledPackageRootDir(__dirname), "package.json")).version.replace(/\+[0-9a-f]+$/, "");
576
+ }
577
+ function commit() {
578
+ return require(path3.join(bundledPackageRootDir(__dirname), "build-info.json")).commit;
579
+ }
580
+
563
581
  // ../tmp-toolkit-helpers/src/util/serialize.ts
564
582
  var fs3 = __toESM(require("fs/promises"));
565
583
 
@@ -730,6 +748,7 @@ function rangeFromSemver(ver, targetType) {
730
748
  deepSet,
731
749
  deserialize,
732
750
  deserializeStructure,
751
+ displayVersion,
733
752
  findJsonValue,
734
753
  flatMap,
735
754
  flatten,
@@ -739,6 +758,7 @@ function rangeFromSemver(ver, targetType) {
739
758
  getResultObj,
740
759
  ifDefined,
741
760
  isArray,
761
+ isDeveloperBuild,
742
762
  isEmpty,
743
763
  isObject,
744
764
  loadStructuredFile,
@@ -761,6 +781,7 @@ function rangeFromSemver(ver, targetType) {
761
781
  toYAML,
762
782
  transformObjectKeys,
763
783
  validateSnsTopicArn,
784
+ versionNumber,
764
785
  zipDirectory
765
786
  });
766
787
  //# sourceMappingURL=util.js.map