|
@@ -409,8 +409,7 @@ export default class AwsS3Multipart<
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // TODO: make this a private method in the next major
|
|
|
- assertHost(method: string): void {
|
|
|
+ #assertHost(method: string): void {
|
|
|
if (!this.opts.companionUrl) {
|
|
|
throw new Error(
|
|
|
`Expected a \`companionUrl\` option containing a Companion address, or if you are not using Companion, a custom \`${method}\` implementation.`,
|
|
@@ -422,7 +421,7 @@ export default class AwsS3Multipart<
|
|
|
file: UppyFile<M, B>,
|
|
|
signal?: AbortSignal,
|
|
|
): Promise<UploadResult> {
|
|
|
- this.assertHost('createMultipartUpload')
|
|
|
+ this.#assertHost('createMultipartUpload')
|
|
|
throwIfAborted(signal)
|
|
|
|
|
|
const allowedMetaFields = getAllowedMetaFields(
|
|
@@ -450,7 +449,7 @@ export default class AwsS3Multipart<
|
|
|
oldSignal?: AbortSignal,
|
|
|
): Promise<AwsS3Part[]> {
|
|
|
signal ??= oldSignal // eslint-disable-line no-param-reassign
|
|
|
- this.assertHost('listParts')
|
|
|
+ this.#assertHost('listParts')
|
|
|
throwIfAborted(signal)
|
|
|
|
|
|
const filename = encodeURIComponent(key)
|
|
@@ -467,7 +466,7 @@ export default class AwsS3Multipart<
|
|
|
oldSignal?: AbortSignal,
|
|
|
): Promise<B> {
|
|
|
signal ??= oldSignal // eslint-disable-line no-param-reassign
|
|
|
- this.assertHost('completeMultipartUpload')
|
|
|
+ this.#assertHost('completeMultipartUpload')
|
|
|
throwIfAborted(signal)
|
|
|
|
|
|
const filename = encodeURIComponent(key)
|
|
@@ -489,7 +488,7 @@ export default class AwsS3Multipart<
|
|
|
if (this.#cachedTemporaryCredentials == null) {
|
|
|
// We do not await it just yet, so concurrent calls do not try to override it:
|
|
|
if (this.opts.getTemporarySecurityCredentials === true) {
|
|
|
- this.assertHost('getTemporarySecurityCredentials')
|
|
|
+ this.#assertHost('getTemporarySecurityCredentials')
|
|
|
this.#cachedTemporaryCredentials = this.#client
|
|
|
.get<AwsS3STSResponse>('s3/sts', options)
|
|
|
.then(assertServerError)
|
|
@@ -552,7 +551,7 @@ export default class AwsS3Multipart<
|
|
|
file: UppyFile<M, B>,
|
|
|
{ uploadId, key, partNumber, signal }: SignPartOptions,
|
|
|
): Promise<AwsS3UploadParameters> {
|
|
|
- this.assertHost('signPart')
|
|
|
+ this.#assertHost('signPart')
|
|
|
throwIfAborted(signal)
|
|
|
|
|
|
if (uploadId == null || key == null || partNumber == null) {
|
|
@@ -575,7 +574,7 @@ export default class AwsS3Multipart<
|
|
|
{ key, uploadId, signal }: UploadResultWithSignal,
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
): Promise<void> {
|
|
|
- this.assertHost('abortMultipartUpload')
|
|
|
+ this.#assertHost('abortMultipartUpload')
|
|
|
|
|
|
const filename = encodeURIComponent(key)
|
|
|
const uploadIdEnc = encodeURIComponent(uploadId)
|