@@ -37,6 +37,10 @@ export type Options = {
3737 * Can not be lower than 5MiB or more than 5GiB.
3838 */
3939 minPartSize ?: number
40+ /**
41+ * The maximum number of parts allowed in a multipart upload. Defaults to 10,000.
42+ */
43+ maxMultipartParts ?: number
4044 useTags ?: boolean
4145 maxConcurrentPartUploads ?: number
4246 cache ?: KvStore < MetadataValue >
@@ -97,13 +101,13 @@ export class S3Store extends DataStore {
97101 protected expirationPeriodInMilliseconds = 0
98102 protected useTags = true
99103 protected partUploadSemaphore : Semaphore
100- public maxMultipartParts = 10_000 as const
104+ public maxMultipartParts = 10_000
101105 public minPartSize = 5_242_880 // 5MiB
102106 public maxUploadSize = 5_497_558_138_880 as const // 5TiB
103107
104108 constructor ( options : Options ) {
105109 super ( )
106- const { partSize, minPartSize, s3ClientConfig} = options
110+ const { maxMultipartParts , partSize, minPartSize, s3ClientConfig} = options
107111 const { bucket, ...restS3ClientConfig } = s3ClientConfig
108112 this . extensions = [
109113 'creation' ,
@@ -117,6 +121,9 @@ export class S3Store extends DataStore {
117121 if ( minPartSize ) {
118122 this . minPartSize = minPartSize
119123 }
124+ if ( maxMultipartParts ) {
125+ this . maxMultipartParts = maxMultipartParts
126+ }
120127 this . expirationPeriodInMilliseconds = options . expirationPeriodInMilliseconds ?? 0
121128 this . useTags = options . useTags ?? true
122129 this . cache = options . cache ?? new MemoryKvStore < MetadataValue > ( )
0 commit comments