@aws-cdk/toolkit-lib 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build-info.json +2 -2
- package/db.json.gz +0 -0
- package/lib/actions/bootstrap/index.d.ts +9 -0
- package/lib/actions/bootstrap/index.js +1 -1
- package/lib/api/aws-cdk.d.ts +2 -2
- package/lib/api/aws-cdk.js +1976 -1885
- package/lib/api/aws-cdk.js.map +4 -4
- package/lib/api/cloud-assembly/private/context-aware-source.js +2 -2
- package/lib/api/cloud-assembly/private/prepare-source.d.ts +1 -1
- package/lib/api/cloud-assembly/private/prepare-source.js +4 -4
- package/lib/api/shared-private.js +40 -5
- package/lib/api/shared-private.js.map +2 -2
- package/lib/api/shared-public.d.ts +217 -14
- package/lib/api/shared-public.js +29 -7
- package/lib/api/shared-public.js.map +4 -4
- package/lib/private/util.js +37 -1
- package/lib/private/util.js.map +3 -3
- package/lib/toolkit/toolkit.d.ts +2 -2
- package/lib/toolkit/toolkit.js +14 -2
- package/package.json +17 -17
|
@@ -876,24 +876,77 @@ interface CcApiContextQuery extends ContextLookupRoleOptions {
|
|
|
876
876
|
*/
|
|
877
877
|
readonly typeName: string;
|
|
878
878
|
/**
|
|
879
|
-
*
|
|
880
|
-
*
|
|
881
|
-
*
|
|
882
|
-
*
|
|
879
|
+
* Identifier of the resource to look up using `GetResource`.
|
|
880
|
+
*
|
|
881
|
+
* Specifying exactIdentifier will return exactly one result, or throw an error.
|
|
882
|
+
*
|
|
883
|
+
*
|
|
884
|
+
* @default - Either exactIdentifier or propertyMatch should be specified.
|
|
883
885
|
*/
|
|
884
886
|
readonly exactIdentifier?: string;
|
|
885
887
|
/**
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
+
* Returns any resources matching these properties, using `ListResources`.
|
|
889
|
+
*
|
|
888
890
|
* Specifying propertyMatch will return 0 or more results.
|
|
889
|
-
*
|
|
890
|
-
*
|
|
891
|
+
*
|
|
892
|
+
* ## Notes on property completeness
|
|
893
|
+
*
|
|
894
|
+
* CloudControl API's `ListResources` may return fewer properties than
|
|
895
|
+
* `GetResource` would, depending on the resource implementation.
|
|
896
|
+
*
|
|
897
|
+
* The resources that `propertyMatch` matches against will *only ever* be the
|
|
898
|
+
* properties returned by the `ListResources` call.
|
|
899
|
+
*
|
|
900
|
+
* @default - Either exactIdentifier or propertyMatch should be specified.
|
|
891
901
|
*/
|
|
892
902
|
readonly propertyMatch?: Record<string, unknown>;
|
|
893
903
|
/**
|
|
894
904
|
* This is a set of properties returned from CC API that we want to return from ContextQuery.
|
|
905
|
+
*
|
|
906
|
+
* If any properties listed here are absent from the target resource, an error will be thrown.
|
|
907
|
+
*
|
|
908
|
+
* The returned object will always include the key `Identifier` with the CC-API returned
|
|
909
|
+
* field `Identifier`.
|
|
910
|
+
*
|
|
911
|
+
* ## Notes on property completeness
|
|
912
|
+
*
|
|
913
|
+
* CloudControl API's `ListResources` may return fewer properties than
|
|
914
|
+
* `GetResource` would, depending on the resource implementation.
|
|
915
|
+
*
|
|
916
|
+
* The returned properties here are *currently* selected from the response
|
|
917
|
+
* object that CloudControl API returns to the CDK CLI.
|
|
918
|
+
*
|
|
919
|
+
* However, if we find there is need to do so, we may decide to change this
|
|
920
|
+
* behavior in the future: we might change it to perform an additional
|
|
921
|
+
* `GetResource` call for resources matched by `propertyMatch`.
|
|
895
922
|
*/
|
|
896
923
|
readonly propertiesToReturn: string[];
|
|
924
|
+
/**
|
|
925
|
+
* The value to return if the resource was not found and `ignoreErrorOnMissingContext` is true.
|
|
926
|
+
*
|
|
927
|
+
* If supplied, `dummyValue` should be an array of objects.
|
|
928
|
+
*
|
|
929
|
+
* `dummyValue` does not have to have elements, and it may have objects with
|
|
930
|
+
* different properties than the properties in `propertiesToReturn`, but it
|
|
931
|
+
* will be easiest for downstream code if the `dummyValue` conforms to
|
|
932
|
+
* the expected response shape.
|
|
933
|
+
*
|
|
934
|
+
* @default - No dummy value available
|
|
935
|
+
*/
|
|
936
|
+
readonly dummyValue?: any;
|
|
937
|
+
/**
|
|
938
|
+
* Ignore an error and return the `dummyValue` instead if the resource was not found.
|
|
939
|
+
*
|
|
940
|
+
* - In case of an `exactIdentifier` lookup, return the `dummyValue` if the resource with
|
|
941
|
+
* that identifier was not found.
|
|
942
|
+
* - In case of a `propertyMatch` lookup, this setting currently does not have any effect,
|
|
943
|
+
* as `propertyMatch` queries can legally return 0 resources.
|
|
944
|
+
*
|
|
945
|
+
* if `ignoreErrorOnMissingContext` is set, `dummyValue` should be set and be an array.
|
|
946
|
+
*
|
|
947
|
+
* @default false
|
|
948
|
+
*/
|
|
949
|
+
readonly ignoreErrorOnMissingContext?: boolean;
|
|
897
950
|
}
|
|
898
951
|
interface PluginContextQuery {
|
|
899
952
|
/**
|
|
@@ -2075,6 +2128,12 @@ export interface ConfirmationRequest {
|
|
|
2075
2128
|
*/
|
|
2076
2129
|
readonly concurrency?: number;
|
|
2077
2130
|
}
|
|
2131
|
+
export interface ContextProviderMessageSource {
|
|
2132
|
+
/**
|
|
2133
|
+
* The name of the context provider sending the message
|
|
2134
|
+
*/
|
|
2135
|
+
readonly provider: string;
|
|
2136
|
+
}
|
|
2078
2137
|
export interface StackDeployProgress {
|
|
2079
2138
|
/**
|
|
2080
2139
|
* The total number of stacks being deployed
|
|
@@ -2467,6 +2526,13 @@ export interface AffectedResource {
|
|
|
2467
2526
|
* A physical name is not always available, e.g. new resources will not have one until after the deployment
|
|
2468
2527
|
*/
|
|
2469
2528
|
readonly physicalName?: string;
|
|
2529
|
+
/**
|
|
2530
|
+
* Resource metadata attached to the logical id from the cloud assembly
|
|
2531
|
+
*
|
|
2532
|
+
* This is only present if the resource is present in the current Cloud Assembly,
|
|
2533
|
+
* i.e. resource deletions will not have metadata.
|
|
2534
|
+
*/
|
|
2535
|
+
readonly metadata?: ResourceMetadata;
|
|
2470
2536
|
}
|
|
2471
2537
|
/**
|
|
2472
2538
|
* Represents a change in a resource
|
|
@@ -2488,6 +2554,13 @@ export interface ResourceChange {
|
|
|
2488
2554
|
* The changes made to the resource properties
|
|
2489
2555
|
*/
|
|
2490
2556
|
readonly propertyUpdates: Record<string, PropertyDifference<unknown>>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Resource metadata attached to the logical id from the cloud assembly
|
|
2559
|
+
*
|
|
2560
|
+
* This is only present if the resource is present in the current Cloud Assembly,
|
|
2561
|
+
* i.e. resource deletions will not have metadata.
|
|
2562
|
+
*/
|
|
2563
|
+
readonly metadata?: ResourceMetadata;
|
|
2491
2564
|
}
|
|
2492
2565
|
/**
|
|
2493
2566
|
* A change that can be hotswapped
|
|
@@ -2497,11 +2570,118 @@ export interface HotswappableChange {
|
|
|
2497
2570
|
* The resource change that is causing the hotswap.
|
|
2498
2571
|
*/
|
|
2499
2572
|
readonly cause: ResourceChange;
|
|
2573
|
+
/**
|
|
2574
|
+
* A list of resources that are being hotswapped as part of the change
|
|
2575
|
+
*/
|
|
2576
|
+
readonly resources: AffectedResource[];
|
|
2577
|
+
}
|
|
2578
|
+
export declare enum NonHotswappableReason {
|
|
2579
|
+
/**
|
|
2580
|
+
* Tags are not hotswappable
|
|
2581
|
+
*/
|
|
2582
|
+
TAGS = "tags",
|
|
2583
|
+
/**
|
|
2584
|
+
* Changed resource properties are not hotswappable on this resource type
|
|
2585
|
+
*/
|
|
2586
|
+
PROPERTIES = "properties",
|
|
2587
|
+
/**
|
|
2588
|
+
* A stack output has changed
|
|
2589
|
+
*/
|
|
2590
|
+
OUTPUT = "output",
|
|
2591
|
+
/**
|
|
2592
|
+
* A dependant resource is not hotswappable
|
|
2593
|
+
*/
|
|
2594
|
+
DEPENDENCY_UNSUPPORTED = "dependency-unsupported",
|
|
2595
|
+
/**
|
|
2596
|
+
* The resource type is not hotswappable
|
|
2597
|
+
*/
|
|
2598
|
+
RESOURCE_UNSUPPORTED = "resource-unsupported",
|
|
2599
|
+
/**
|
|
2600
|
+
* The resource is created in the deployment
|
|
2601
|
+
*/
|
|
2602
|
+
RESOURCE_CREATION = "resource-creation",
|
|
2603
|
+
/**
|
|
2604
|
+
* The resource is removed in the deployment
|
|
2605
|
+
*/
|
|
2606
|
+
RESOURCE_DELETION = "resource-deletion",
|
|
2607
|
+
/**
|
|
2608
|
+
* The resource identified by the logical id has its type changed
|
|
2609
|
+
*/
|
|
2610
|
+
RESOURCE_TYPE_CHANGED = "resource-type-changed",
|
|
2611
|
+
/**
|
|
2612
|
+
* The nested stack is created in the deployment
|
|
2613
|
+
*/
|
|
2614
|
+
NESTED_STACK_CREATION = "nested-stack-creation"
|
|
2615
|
+
}
|
|
2616
|
+
export interface RejectionSubject {
|
|
2617
|
+
/**
|
|
2618
|
+
* The type of the rejection subject, e.g. Resource or Output
|
|
2619
|
+
*/
|
|
2620
|
+
readonly type: string;
|
|
2621
|
+
/**
|
|
2622
|
+
* The logical ID of the change that is not hotswappable
|
|
2623
|
+
*/
|
|
2624
|
+
readonly logicalId: string;
|
|
2625
|
+
/**
|
|
2626
|
+
* Resource metadata attached to the logical id from the cloud assembly
|
|
2627
|
+
*
|
|
2628
|
+
* This is only present if the resource is present in the current Cloud Assembly,
|
|
2629
|
+
* i.e. resource deletions will not have metadata.
|
|
2630
|
+
*/
|
|
2631
|
+
readonly metadata?: ResourceMetadata;
|
|
2632
|
+
}
|
|
2633
|
+
export interface ResourceSubject extends RejectionSubject {
|
|
2634
|
+
/**
|
|
2635
|
+
* A rejected resource
|
|
2636
|
+
*/
|
|
2637
|
+
readonly type: "Resource";
|
|
2638
|
+
/**
|
|
2639
|
+
* The type of the rejected resource
|
|
2640
|
+
*/
|
|
2641
|
+
readonly resourceType: string;
|
|
2642
|
+
/**
|
|
2643
|
+
* The list of properties that are cause for the rejection
|
|
2644
|
+
*/
|
|
2645
|
+
readonly rejectedProperties?: string[];
|
|
2646
|
+
}
|
|
2647
|
+
export interface OutputSubject extends RejectionSubject {
|
|
2648
|
+
/**
|
|
2649
|
+
* A rejected output
|
|
2650
|
+
*/
|
|
2651
|
+
readonly type: "Output";
|
|
2652
|
+
}
|
|
2653
|
+
/**
|
|
2654
|
+
* A change that can not be hotswapped
|
|
2655
|
+
*/
|
|
2656
|
+
export interface NonHotswappableChange {
|
|
2657
|
+
/**
|
|
2658
|
+
* The subject of the change that was rejected
|
|
2659
|
+
*/
|
|
2660
|
+
readonly subject: ResourceSubject | OutputSubject;
|
|
2661
|
+
/**
|
|
2662
|
+
* Why was this change was deemed non-hotswappable
|
|
2663
|
+
*/
|
|
2664
|
+
readonly reason: NonHotswappableReason;
|
|
2665
|
+
/**
|
|
2666
|
+
* Tells the user exactly why this change was deemed non-hotswappable and what its logical ID is.
|
|
2667
|
+
* If not specified, `displayReason` default to state that the properties listed in `rejectedChanges` are not hotswappable.
|
|
2668
|
+
*/
|
|
2669
|
+
readonly description: string;
|
|
2670
|
+
}
|
|
2671
|
+
export interface HotswapDeploymentAttempt {
|
|
2672
|
+
/**
|
|
2673
|
+
* The stack that's currently being deployed
|
|
2674
|
+
*/
|
|
2675
|
+
readonly stack: cxapi.CloudFormationStackArtifact;
|
|
2676
|
+
/**
|
|
2677
|
+
* The mode the hotswap deployment was initiated with.
|
|
2678
|
+
*/
|
|
2679
|
+
readonly mode: "hotswap-only" | "fall-back";
|
|
2500
2680
|
}
|
|
2501
2681
|
/**
|
|
2502
2682
|
* Information about a hotswap deployment
|
|
2503
2683
|
*/
|
|
2504
|
-
export interface
|
|
2684
|
+
export interface HotswapDeploymentDetails {
|
|
2505
2685
|
/**
|
|
2506
2686
|
* The stack that's currently being deployed
|
|
2507
2687
|
*/
|
|
@@ -2510,6 +2690,25 @@ export interface HotswapDeployment {
|
|
|
2510
2690
|
* The mode the hotswap deployment was initiated with.
|
|
2511
2691
|
*/
|
|
2512
2692
|
readonly mode: "hotswap-only" | "fall-back";
|
|
2693
|
+
/**
|
|
2694
|
+
* The changes that were deemed hotswappable
|
|
2695
|
+
*/
|
|
2696
|
+
readonly hotswappableChanges: HotswappableChange[];
|
|
2697
|
+
/**
|
|
2698
|
+
* The changes that were deemed not hotswappable
|
|
2699
|
+
*/
|
|
2700
|
+
readonly nonHotswappableChanges: NonHotswappableChange[];
|
|
2701
|
+
}
|
|
2702
|
+
/**
|
|
2703
|
+
* The result of an attempted hotswap deployment
|
|
2704
|
+
*/
|
|
2705
|
+
export interface HotswapResult extends Duration, HotswapDeploymentDetails {
|
|
2706
|
+
/**
|
|
2707
|
+
* Whether hotswapping happened or not.
|
|
2708
|
+
*
|
|
2709
|
+
* `false` indicates that the deployment could not be hotswapped and full deployment may be attempted as fallback.
|
|
2710
|
+
*/
|
|
2711
|
+
readonly hotswapped: boolean;
|
|
2513
2712
|
}
|
|
2514
2713
|
/**
|
|
2515
2714
|
* Represents a general toolkit error in the AWS CDK Toolkit.
|
|
@@ -2531,6 +2730,10 @@ export declare class ToolkitError extends Error {
|
|
|
2531
2730
|
* Determines if a given error is an instance of AssemblyError.
|
|
2532
2731
|
*/
|
|
2533
2732
|
static isContextProviderError(x: any): x is ContextProviderError;
|
|
2733
|
+
/**
|
|
2734
|
+
* An AssemblyError with an original error as cause
|
|
2735
|
+
*/
|
|
2736
|
+
static withCause(message: string, error: unknown): ToolkitError;
|
|
2534
2737
|
/**
|
|
2535
2738
|
* The type of the error, defaults to "toolkit".
|
|
2536
2739
|
*/
|
|
@@ -2539,7 +2742,11 @@ export declare class ToolkitError extends Error {
|
|
|
2539
2742
|
* Denotes the source of the error as the toolkit.
|
|
2540
2743
|
*/
|
|
2541
2744
|
readonly source: "toolkit" | "user";
|
|
2542
|
-
|
|
2745
|
+
/**
|
|
2746
|
+
* The specific original cause of the error, if available
|
|
2747
|
+
*/
|
|
2748
|
+
readonly cause?: unknown;
|
|
2749
|
+
constructor(message: string, type?: string, cause?: unknown);
|
|
2543
2750
|
}
|
|
2544
2751
|
/**
|
|
2545
2752
|
* Represents an authentication-specific error in the AWS CDK Toolkit.
|
|
@@ -2576,10 +2783,6 @@ export declare class AssemblyError extends ToolkitError {
|
|
|
2576
2783
|
* Absence indicates synthesis didn't fully complete.
|
|
2577
2784
|
*/
|
|
2578
2785
|
readonly stacks?: cxapi.CloudFormationStackArtifact[];
|
|
2579
|
-
/**
|
|
2580
|
-
* The specific original cause of the error, if available
|
|
2581
|
-
*/
|
|
2582
|
-
readonly cause?: unknown;
|
|
2583
2786
|
private constructor();
|
|
2584
2787
|
}
|
|
2585
2788
|
/**
|
package/lib/api/shared-public.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(shared_public_exports, {
|
|
|
24
24
|
AuthenticationError: () => AuthenticationError,
|
|
25
25
|
ContextProviderError: () => ContextProviderError,
|
|
26
26
|
ExpandStackSelection: () => ExpandStackSelection,
|
|
27
|
+
NonHotswappableReason: () => NonHotswappableReason,
|
|
27
28
|
PermissionChangeType: () => PermissionChangeType,
|
|
28
29
|
RequireApproval: () => RequireApproval,
|
|
29
30
|
StackSelectionStrategy: () => StackSelectionStrategy,
|
|
@@ -56,6 +57,20 @@ var PermissionChangeType = /* @__PURE__ */ ((PermissionChangeType2) => {
|
|
|
56
57
|
return PermissionChangeType2;
|
|
57
58
|
})(PermissionChangeType || {});
|
|
58
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
|
+
|
|
59
74
|
// ../tmp-toolkit-helpers/src/api/toolkit-error.ts
|
|
60
75
|
var TOOLKIT_ERROR_SYMBOL = Symbol.for("@aws-cdk/toolkit-lib.ToolkitError");
|
|
61
76
|
var AUTHENTICATION_ERROR_SYMBOL = Symbol.for("@aws-cdk/toolkit-lib.AuthenticationError");
|
|
@@ -86,6 +101,12 @@ var ToolkitError = class _ToolkitError extends Error {
|
|
|
86
101
|
static isContextProviderError(x) {
|
|
87
102
|
return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;
|
|
88
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* An AssemblyError with an original error as cause
|
|
106
|
+
*/
|
|
107
|
+
static withCause(message, error) {
|
|
108
|
+
return new _ToolkitError(message, "toolkit", error);
|
|
109
|
+
}
|
|
89
110
|
/**
|
|
90
111
|
* The type of the error, defaults to "toolkit".
|
|
91
112
|
*/
|
|
@@ -94,13 +115,18 @@ var ToolkitError = class _ToolkitError extends Error {
|
|
|
94
115
|
* Denotes the source of the error as the toolkit.
|
|
95
116
|
*/
|
|
96
117
|
source;
|
|
97
|
-
|
|
118
|
+
/**
|
|
119
|
+
* The specific original cause of the error, if available
|
|
120
|
+
*/
|
|
121
|
+
cause;
|
|
122
|
+
constructor(message, type = "toolkit", cause) {
|
|
98
123
|
super(message);
|
|
99
124
|
Object.setPrototypeOf(this, _ToolkitError.prototype);
|
|
100
125
|
Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });
|
|
101
126
|
this.name = new.target.name;
|
|
102
127
|
this.type = type;
|
|
103
128
|
this.source = "toolkit";
|
|
129
|
+
this.cause = cause;
|
|
104
130
|
}
|
|
105
131
|
};
|
|
106
132
|
var AuthenticationError = class _AuthenticationError extends ToolkitError {
|
|
@@ -138,16 +164,11 @@ var AssemblyError = class _AssemblyError extends ToolkitError {
|
|
|
138
164
|
* Absence indicates synthesis didn't fully complete.
|
|
139
165
|
*/
|
|
140
166
|
stacks;
|
|
141
|
-
/**
|
|
142
|
-
* The specific original cause of the error, if available
|
|
143
|
-
*/
|
|
144
|
-
cause;
|
|
145
167
|
constructor(message, stacks, cause) {
|
|
146
|
-
super(message, "assembly");
|
|
168
|
+
super(message, "assembly", cause);
|
|
147
169
|
Object.setPrototypeOf(this, _AssemblyError.prototype);
|
|
148
170
|
Object.defineProperty(this, ASSEMBLY_ERROR_SYMBOL, { value: true });
|
|
149
171
|
this.stacks = stacks;
|
|
150
|
-
this.cause = cause;
|
|
151
172
|
}
|
|
152
173
|
};
|
|
153
174
|
var ContextProviderError = class _ContextProviderError extends ToolkitError {
|
|
@@ -175,6 +196,7 @@ var RequireApproval = /* @__PURE__ */ ((RequireApproval2) => {
|
|
|
175
196
|
AuthenticationError,
|
|
176
197
|
ContextProviderError,
|
|
177
198
|
ExpandStackSelection,
|
|
199
|
+
NonHotswappableReason,
|
|
178
200
|
PermissionChangeType,
|
|
179
201
|
RequireApproval,
|
|
180
202
|
StackSelectionStrategy,
|
|
@@ -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", "../../../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;;;
|
|
6
|
-
"names": ["StackSelectionStrategy", "ExpandStackSelection", "PermissionChangeType", "RequireApproval"]
|
|
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": "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",
|
|
6
|
+
"names": ["StackSelectionStrategy", "ExpandStackSelection", "PermissionChangeType", "NonHotswappableReason", "RequireApproval"]
|
|
7
7
|
}
|
package/lib/private/util.js
CHANGED
|
@@ -55,6 +55,7 @@ __export(util_exports, {
|
|
|
55
55
|
isEmpty: () => isEmpty,
|
|
56
56
|
isObject: () => isObject,
|
|
57
57
|
loadStructuredFile: () => loadStructuredFile,
|
|
58
|
+
lowerCaseFirstCharacter: () => lowerCaseFirstCharacter,
|
|
58
59
|
makeObject: () => makeObject,
|
|
59
60
|
mapObject: () => mapObject,
|
|
60
61
|
maxResourceTypeLength: () => maxResourceTypeLength,
|
|
@@ -71,6 +72,7 @@ __export(util_exports, {
|
|
|
71
72
|
splitBySize: () => splitBySize,
|
|
72
73
|
stackEventHasErrorMessage: () => stackEventHasErrorMessage,
|
|
73
74
|
toYAML: () => toYAML,
|
|
75
|
+
transformObjectKeys: () => transformObjectKeys,
|
|
74
76
|
validateSnsTopicArn: () => validateSnsTopicArn,
|
|
75
77
|
zipDirectory: () => zipDirectory
|
|
76
78
|
});
|
|
@@ -276,6 +278,12 @@ var ToolkitError = class _ToolkitError extends Error {
|
|
|
276
278
|
static isContextProviderError(x) {
|
|
277
279
|
return this.isToolkitError(x) && CONTEXT_PROVIDER_ERROR_SYMBOL in x;
|
|
278
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* An AssemblyError with an original error as cause
|
|
283
|
+
*/
|
|
284
|
+
static withCause(message, error2) {
|
|
285
|
+
return new _ToolkitError(message, "toolkit", error2);
|
|
286
|
+
}
|
|
279
287
|
/**
|
|
280
288
|
* The type of the error, defaults to "toolkit".
|
|
281
289
|
*/
|
|
@@ -284,13 +292,18 @@ var ToolkitError = class _ToolkitError extends Error {
|
|
|
284
292
|
* Denotes the source of the error as the toolkit.
|
|
285
293
|
*/
|
|
286
294
|
source;
|
|
287
|
-
|
|
295
|
+
/**
|
|
296
|
+
* The specific original cause of the error, if available
|
|
297
|
+
*/
|
|
298
|
+
cause;
|
|
299
|
+
constructor(message, type = "toolkit", cause) {
|
|
288
300
|
super(message);
|
|
289
301
|
Object.setPrototypeOf(this, _ToolkitError.prototype);
|
|
290
302
|
Object.defineProperty(this, TOOLKIT_ERROR_SYMBOL, { value: true });
|
|
291
303
|
this.name = new.target.name;
|
|
292
304
|
this.type = type;
|
|
293
305
|
this.source = "toolkit";
|
|
306
|
+
this.cause = cause;
|
|
294
307
|
}
|
|
295
308
|
};
|
|
296
309
|
|
|
@@ -490,6 +503,24 @@ function splitBySize(data, maxSizeBytes) {
|
|
|
490
503
|
];
|
|
491
504
|
}
|
|
492
505
|
}
|
|
506
|
+
function transformObjectKeys(val, transform, exclude = {}) {
|
|
507
|
+
if (val == null || typeof val !== "object") {
|
|
508
|
+
return val;
|
|
509
|
+
}
|
|
510
|
+
if (Array.isArray(val)) {
|
|
511
|
+
return val.map((input) => transformObjectKeys(input, transform, exclude));
|
|
512
|
+
}
|
|
513
|
+
const ret = {};
|
|
514
|
+
for (const [k, v] of Object.entries(val)) {
|
|
515
|
+
const childExclude = exclude[k];
|
|
516
|
+
if (childExclude === true) {
|
|
517
|
+
ret[transform(k)] = v;
|
|
518
|
+
} else {
|
|
519
|
+
ret[transform(k)] = transformObjectKeys(v, transform, childExclude);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return ret;
|
|
523
|
+
}
|
|
493
524
|
|
|
494
525
|
// ../tmp-toolkit-helpers/src/util/parallel.ts
|
|
495
526
|
async function parallelPromises(n, promises) {
|
|
@@ -645,6 +676,9 @@ function roundPercentage(num) {
|
|
|
645
676
|
function millisecondsToSeconds(num) {
|
|
646
677
|
return num / 1e3;
|
|
647
678
|
}
|
|
679
|
+
function lowerCaseFirstCharacter(str) {
|
|
680
|
+
return str.length > 0 ? `${str[0].toLowerCase()}${str.slice(1)}` : str;
|
|
681
|
+
}
|
|
648
682
|
|
|
649
683
|
// ../tmp-toolkit-helpers/src/util/type-brands.ts
|
|
650
684
|
function createBranded(value) {
|
|
@@ -708,6 +742,7 @@ function rangeFromSemver(ver, targetType) {
|
|
|
708
742
|
isEmpty,
|
|
709
743
|
isObject,
|
|
710
744
|
loadStructuredFile,
|
|
745
|
+
lowerCaseFirstCharacter,
|
|
711
746
|
makeObject,
|
|
712
747
|
mapObject,
|
|
713
748
|
maxResourceTypeLength,
|
|
@@ -724,6 +759,7 @@ function rangeFromSemver(ver, targetType) {
|
|
|
724
759
|
splitBySize,
|
|
725
760
|
stackEventHasErrorMessage,
|
|
726
761
|
toYAML,
|
|
762
|
+
transformObjectKeys,
|
|
727
763
|
validateSnsTopicArn,
|
|
728
764
|
zipDirectory
|
|
729
765
|
});
|