body:'Cannot terminate an already completed upload',
},
ERR_LOCK_TIMEOUT:{
status_code: 500,
body:'failed to acquire lock before timeout',
},
INVALID_CONTENT_TYPE:{
status_code: 403,
body:'Content-Type header required\n',
},
FILE_NOT_FOUND:{
status_code: 404,
body:'The file for this url was not found\n',
},
INVALID_OFFSET:{
status_code: 409,
body:'Upload-Offset conflict\n',
},
FILE_NO_LONGER_EXISTS:{
status_code: 410,
body:'The file for this url no longer exists\n',
},
ERR_SIZE_EXCEEDED:{
status_code: 413,
body:"upload's size exceeded\n",
},
ERR_MAX_SIZE_EXCEEDED:{
status_code: 413,
body:'Maximum size exceeded\n',
},
INVALID_LENGTH:{
status_code: 400,
body:'Upload-Length or Upload-Defer-Length header required\n',
},
INVALID_METADATA:{
status_code: 400,
body:'Upload-Metadata is invalid. It MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique',
},
UNKNOWN_ERROR:{
status_code: 500,
body:'Something went wrong with that request\n',
},
FILE_WRITE_ERROR:{
status_code: 500,
body:'Something went wrong receiving the file\n',
},
UNSUPPORTED_CONCATENATION_EXTENSION:{
status_code: 501,
body:'Concatenation extension is not (yet) supported. Disable parallel uploads in the tus client.\n',
},
UNSUPPORTED_CREATION_DEFER_LENGTH_EXTENSION:{
status_code: 501,
body:'creation-defer-length extension is not (yet) supported.\n',
},
UNSUPPORTED_EXPIRATION_EXTENSION:{
status_code: 501,
body:'expiration extension is not (yet) supported.\n',
},
}asconst
// 定义TUS协议中的事件类型
exportconstPOST_CREATE='POST_CREATE'asconst
/** @deprecated this is almost the same as POST_FINISH, use POST_RECEIVE_V2 instead */