File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,51 @@ export interface UploadResponse {
3131 filename : string ;
3232}
3333
34+ export interface BeginMultipartUploadPayload {
35+ filename : string ;
36+ content_type : string ;
37+ size : number ;
38+ chunk_size : number ;
39+ }
40+
41+ export interface UploadPart {
42+ url : string ;
43+ chunkSize : number ;
44+ partNumber : number ;
45+ }
46+
47+ export interface BeginMultipartUploadHandlerResponse {
48+ uploadParts : UploadPart [ ] ;
49+ fileKey : string ;
50+ uploadId : string ;
51+ }
52+
53+ export interface CommitMultipartUploadPayload {
54+ fileKey : string ;
55+ uploadId : string ;
56+ filename : string ;
57+ providerCommitData ?: Record < string , any > ;
58+ }
59+
60+ export interface CancelMultipartUploadPayload {
61+ fileKey : string ;
62+ uploadId : string ;
63+ }
64+
3465export interface WebResourceHandler {
3566 handleFile : ( resource : IncomingFile ) => Promise < UploadResponse > ;
3667 removeFile : ( fileReference : string ) => Promise < void > ;
3768 onPreRespond : ( webResource : WebResource ) => Promise < WebResource > ;
69+ multipartUpload ?: {
70+ begin : (
71+ fieldName : string ,
72+ payload : BeginMultipartUploadPayload ,
73+ ) => Promise < BeginMultipartUploadHandlerResponse > ;
74+ commit : ( commitInfo : CommitMultipartUploadPayload ) => Promise < WebResource > ;
75+ cancel : ( cancelInfo : CancelMultipartUploadPayload ) => Promise < void > ;
76+ getMinimumPartSize : ( ) => number ;
77+ getDefaultPartSize : ( ) => number ;
78+ } ;
3879}
3980
4081export class WebResourceError extends TypedError { }
You can’t perform that action at this time.
0 commit comments