Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.i18nInit()
this.hostname = this.opts.companionUrl
if (!this.hostname) {
throw new Error('Companion hostname is required, please consult https://uppy.io/docs/companion')
}
// Bind all event handlers for referencability
this.getMeta = this.getMeta.bind(this)
this.addFile = this.addFile.bind(this)
this.handleRootDrop = this.handleRootDrop.bind(this)
this.handleRootPaste = this.handleRootPaste.bind(this)
this.client = new RequestClient(uppy, {
companionUrl: this.opts.companionUrl,
companionHeaders: this.opts.companionHeaders || this.opts.serverHeaders
})
}
}
const defaultOptions = {
timeout: 30 * 1000,
limit: 0,
getUploadParameters: this.getUploadParameters.bind(this)
}
this.opts = { ...defaultOptions, ...opts }
// i18n
this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
this.i18n = this.translator.translate.bind(this.translator)
this.i18nArray = this.translator.translateArray.bind(this.translator)
this.client = new RequestClient(uppy, opts)
this.prepareUpload = this.prepareUpload.bind(this)
this.requests = new RateLimitedQueue(this.opts.limit)
}
constructor (uppy, opts) {
super(uppy, opts)
this.type = 'uploader'
this.id = 'AwsS3Multipart'
this.title = 'AWS S3 Multipart'
this.client = new RequestClient(uppy, opts)
const defaultOptions = {
timeout: 30 * 1000,
limit: 0,
createMultipartUpload: this.createMultipartUpload.bind(this),
listParts: this.listParts.bind(this),
prepareUploadPart: this.prepareUploadPart.bind(this),
abortMultipartUpload: this.abortMultipartUpload.bind(this),
completeMultipartUpload: this.completeMultipartUpload.bind(this)
}
this.opts = Object.assign({}, defaultOptions, opts)
this.upload = this.upload.bind(this)
if (typeof this.opts.limit === 'number' && this.opts.limit !== 0) {