@@ -26,8 +26,8 @@ import type { StackAssembly } from '../api/cloud-assembly/private';
2626import { ALL_STACKS , CloudAssemblySourceBuilder , IdentityCloudAssemblySource } from '../api/cloud-assembly/private' ;
2727import type { IIoHost , IoMessageLevel } from '../api/io' ;
2828import { Timer , CODES , asSdkLogger , withoutColor , withoutEmojis , withTrimmedWhitespace } from '../api/io/private' ;
29- import type { ActionAwareIoHost } from '../api/shared-private' ;
30- import { withAction } from '../api/shared-private' ;
29+ import type { IoHelper } from '../api/shared-private' ;
30+ import { asIoHelper } from '../api/shared-private' ;
3131import type { ToolkitAction } from '../api/shared-public' ;
3232import { ToolkitError } from '../api/shared-public' ;
3333import { obscureTemplate , serializeStructure , validateSnsTopicArn , formatTime , formatErrorMessage } from '../private/util' ;
@@ -130,7 +130,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
130130 if ( ! this . _sdkProvider ) {
131131 this . _sdkProvider = await SdkProvider . withAwsCliCompatibleDefaults ( {
132132 ...this . props . sdkConfig ,
133- logger : asSdkLogger ( withAction ( this . ioHost , action ) ) ,
133+ logger : asSdkLogger ( asIoHelper ( this . ioHost , action ) ) ,
134134 } ) ;
135135 }
136136
@@ -142,7 +142,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
142142 */
143143 protected override async sourceBuilderServices ( ) : Promise < ToolkitServices > {
144144 return {
145- ioHost : withAction ( this . ioHost , 'assembly' ) ,
145+ ioHost : asIoHelper ( this . ioHost , 'assembly' ) ,
146146 sdkProvider : await this . sdkProvider ( 'assembly' ) ,
147147 } ;
148148 }
@@ -151,7 +151,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
151151 * Bootstrap Action
152152 */
153153 public async bootstrap ( environments : BootstrapEnvironments , options : BootstrapOptions ) : Promise < void > {
154- const ioHost = withAction ( this . ioHost , 'bootstrap' ) ;
154+ const ioHost = asIoHelper ( this . ioHost , 'bootstrap' ) ;
155155 const bootstrapEnvironments = await environments . getEnvironments ( ) ;
156156 const source = options . source ?? BootstrapSource . default ( ) ;
157157 const parameters = options . parameters ;
@@ -197,7 +197,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
197197 * Synth Action
198198 */
199199 public async synth ( cx : ICloudAssemblySource , options : SynthOptions = { } ) : Promise < ICloudAssemblySource > {
200- const ioHost = withAction ( this . ioHost , 'synth' ) ;
200+ const ioHost = asIoHelper ( this . ioHost , 'synth' ) ;
201201 const synthTimer = Timer . start ( ) ;
202202 const assembly = await assemblyFromSource ( cx ) ;
203203 const stacks = assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
@@ -242,7 +242,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
242242 * List selected stacks and their dependencies
243243 */
244244 public async list ( cx : ICloudAssemblySource , options : ListOptions = { } ) : Promise < StackDetails [ ] > {
245- const ioHost = withAction ( this . ioHost , 'list' ) ;
245+ const ioHost = asIoHelper ( this . ioHost , 'list' ) ;
246246 const synthTimer = Timer . start ( ) ;
247247 const assembly = await assemblyFromSource ( cx ) ;
248248 const stackCollection = await assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
@@ -269,7 +269,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
269269 * Helper to allow deploy being called as part of the watch action.
270270 */
271271 private async _deploy ( assembly : StackAssembly , action : 'deploy' | 'watch' , options : ExtendedDeployOptions = { } ) {
272- const ioHost = withAction ( this . ioHost , action ) ;
272+ const ioHost = asIoHelper ( this . ioHost , action ) ;
273273 const synthTimer = Timer . start ( ) ;
274274 const stackCollection = assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
275275 await this . validateStacksMetadata ( stackCollection , ioHost ) ;
@@ -571,7 +571,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
571571 */
572572 public async watch ( cx : ICloudAssemblySource , options : WatchOptions ) : Promise < void > {
573573 const assembly = await assemblyFromSource ( cx , false ) ;
574- const ioHost = withAction ( this . ioHost , 'watch' ) ;
574+ const ioHost = asIoHelper ( this . ioHost , 'watch' ) ;
575575 const rootDir = options . watchDir ?? process . cwd ( ) ;
576576
577577 if ( options . include === undefined && options . exclude === undefined ) {
@@ -694,7 +694,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
694694 * Helper to allow rollback being called as part of the deploy or watch action.
695695 */
696696 private async _rollback ( assembly : StackAssembly , action : 'rollback' | 'deploy' | 'watch' , options : RollbackOptions ) : Promise < void > {
697- const ioHost = withAction ( this . ioHost , action ) ;
697+ const ioHost = asIoHelper ( this . ioHost , action ) ;
698698 const synthTimer = Timer . start ( ) ;
699699 const stacks = assembly . selectStacksV2 ( options . stacks ) ;
700700 await this . validateStacksMetadata ( stacks , ioHost ) ;
@@ -752,7 +752,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
752752 * Helper to allow destroy being called as part of the deploy action.
753753 */
754754 private async _destroy ( assembly : StackAssembly , action : 'deploy' | 'destroy' , options : DestroyOptions ) : Promise < void > {
755- const ioHost = withAction ( this . ioHost , action ) ;
755+ const ioHost = asIoHelper ( this . ioHost , action ) ;
756756 const synthTimer = Timer . start ( ) ;
757757 // The stacks will have been ordered for deployment, so reverse them for deletion.
758758 const stacks = await assembly . selectStacksV2 ( options . stacks ) . reversed ( ) ;
@@ -794,7 +794,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
794794 /**
795795 * Validate the stacks for errors and warnings according to the CLI's current settings
796796 */
797- private async validateStacksMetadata ( stacks : StackCollection , ioHost : ActionAwareIoHost ) {
797+ private async validateStacksMetadata ( stacks : StackCollection , ioHost : IoHelper ) {
798798 const builder = ( level : IoMessageLevel ) => {
799799 switch ( level ) {
800800 case 'error' : return CODES . CDK_ASSEMBLY_E9999 ;
0 commit comments