This commit is contained in:
parent
fa2be029a2
commit
724d70e58b
3339 changed files with 1075535 additions and 0 deletions
47
frontend/node_modules/tus-js-client/lib/node/index.js
generated
vendored
Normal file
47
frontend/node_modules/tus-js-client/lib/node/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import DetailedError from '../error.js'
|
||||
import { enableDebugLog } from '../logger.js'
|
||||
import NoopUrlStorage from '../noopUrlStorage.js'
|
||||
import BaseUpload from '../upload.js'
|
||||
|
||||
import FileReader from './fileReader.js'
|
||||
import fingerprint from './fileSignature.js'
|
||||
import DefaultHttpStack from './httpStack.js'
|
||||
import StreamSource from './sources/StreamSource.js'
|
||||
import { FileUrlStorage, canStoreURLs } from './urlStorage.js'
|
||||
|
||||
const defaultOptions = {
|
||||
...BaseUpload.defaultOptions,
|
||||
httpStack: new DefaultHttpStack(),
|
||||
fileReader: new FileReader(),
|
||||
urlStorage: new NoopUrlStorage(),
|
||||
fingerprint,
|
||||
}
|
||||
|
||||
class Upload extends BaseUpload {
|
||||
constructor(file = null, options = {}) {
|
||||
options = { ...defaultOptions, ...options }
|
||||
super(file, options)
|
||||
}
|
||||
|
||||
static terminate(url, options = {}) {
|
||||
options = { ...defaultOptions, ...options }
|
||||
return BaseUpload.terminate(url, options)
|
||||
}
|
||||
}
|
||||
|
||||
// The Node.js environment does not have restrictions which may cause
|
||||
// tus-js-client not to function.
|
||||
const isSupported = true
|
||||
|
||||
export {
|
||||
Upload,
|
||||
defaultOptions,
|
||||
isSupported,
|
||||
// Make FileUrlStorage module available as it will not be set by default.
|
||||
FileUrlStorage,
|
||||
canStoreURLs,
|
||||
enableDebugLog,
|
||||
DefaultHttpStack,
|
||||
DetailedError,
|
||||
StreamSource,
|
||||
}
|
||||
Reference in a new issue