@@ -14,6 +14,12 @@ export interface StackSummary
1414 extends RequiredProps < CloudFormationV3 . StackSummary , 'StackName' | 'CreationTime' | 'StackStatus' > {
1515 DriftInformation : RequiredProps < CloudFormationV3 . StackDriftInformation , 'StackDriftStatus' >
1616}
17+
18+ export type StackResource = RequiredProps < CloudFormationV3 . StackResource , 'ResourceType' >
19+
20+ export interface DescribeStackResourcesOutput extends CloudFormationV3 . DescribeStackResourcesOutput {
21+ StackResources : StackResource [ ]
22+ }
1723export class CloudFormationClient extends ClientWrapper < CloudFormationV3 . CloudFormationClient > {
1824 public constructor ( regionCode : string ) {
1925 super ( regionCode , CloudFormationV3 . CloudFormationClient )
@@ -64,17 +70,18 @@ export class CloudFormationClient extends ClientWrapper<CloudFormationV3.CloudFo
6470 ) . map ( ( s ) => s . filter ( isStackSummary ) )
6571 }
6672
67- public async * listTypes ( ) : AsyncIterableIterator < CloudFormation . TypeSummary > {
68- const client = await this . createSdkClient ( )
69-
70- const request : CloudFormation . ListTypesInput = {
73+ public async * listTypes ( ) : AsyncIterableIterator < CloudFormationV3 . TypeSummary > {
74+ const request : CloudFormationV3 . ListTypesInput = {
7175 DeprecatedStatus : 'LIVE' ,
7276 Type : 'RESOURCE' ,
7377 Visibility : 'PUBLIC' ,
7478 }
7579
7680 do {
77- const response : CloudFormation . ListTypesOutput = await client . listTypes ( request ) . promise ( )
81+ const response : CloudFormationV3 . ListTypesOutput = await this . makeRequest (
82+ CloudFormationV3 . ListTypesCommand ,
83+ request
84+ )
7885
7986 if ( response . TypeSummaries ) {
8087 yield * response . TypeSummaries
@@ -84,14 +91,8 @@ export class CloudFormationClient extends ClientWrapper<CloudFormationV3.CloudFo
8491 } while ( request . NextToken )
8592 }
8693
87- public async describeStackResources ( name : string ) : Promise < CloudFormation . DescribeStackResourcesOutput > {
88- const client = await this . createSdkClient ( )
89-
90- return await client
91- . describeStackResources ( {
92- StackName : name ,
93- } )
94- . promise ( )
94+ public async describeStackResources ( name : string ) : Promise < DescribeStackResourcesOutput > {
95+ return await this . makeRequest ( CloudFormationV3 . DescribeStackResourcesCommand , { StackName : name } )
9596 }
9697
9798 private async createSdkClient ( ) : Promise < CloudFormation > {
0 commit comments