@@ -16,6 +16,7 @@ class BucketUtility {
1616 if ( unauthenticated ) {
1717 this . s3 = new S3Client ( {
1818 ...s3Config ,
19+ maxAttempts : 0 ,
1920 credentials : { accessKeyId : '' , secretAccessKey : '' } ,
2021 forcePathStyle : true ,
2122 signer : { sign : async request => request } ,
@@ -111,6 +112,7 @@ class BucketUtility {
111112 Bucket : bucketName ,
112113 Key : object . Key ,
113114 VersionId : object . VersionId ,
115+ ...( BypassGovernanceRetention && { BypassGovernanceRetention } ) ,
114116 } ) )
115117 . then ( ( ) => object )
116118 )
@@ -120,6 +122,8 @@ class BucketUtility {
120122 this . s3 . send ( new DeleteObjectCommand ( {
121123 Bucket : bucketName ,
122124 Key : object . Key ,
125+ VersionId : object . VersionId ,
126+ ...( BypassGovernanceRetention && { BypassGovernanceRetention } ) ,
123127 } ) )
124128 . then ( ( ) => object )
125129 )
@@ -130,19 +134,23 @@ class BucketUtility {
130134 Bucket : bucketName ,
131135 Key : object . Key ,
132136 VersionId : object . VersionId ,
137+ ...( BypassGovernanceRetention && { BypassGovernanceRetention } ) ,
133138 } ) )
134139 . then ( ( ) => object )
135- ) )
136- ) ) ;
140+ )
141+ )
142+ )
143+ ) ;
137144 }
138145
139146 emptyMany ( bucketNames ) {
140- const promises = bucketNames . map (
141- bucketName => this . empty ( bucketName )
147+ const promises = bucketNames . map (
148+ bucketName => this . empty ( bucketName )
142149 ) ;
143150
144151 return Promise . all ( promises ) ;
145152 }
153+
146154 emptyIfExists ( bucketName ) {
147155 return this . bucketExists ( bucketName ) . then ( exists => {
148156 if ( exists ) {
0 commit comments