Skip to content

Commit

Permalink
Implement LargeFileUploadTask
Browse files Browse the repository at this point in the history
  • Loading branch information
muthurathinam-m committed Aug 1, 2018
1 parent acedfc1 commit a72448b
Show file tree
Hide file tree
Showing 21 changed files with 615 additions and 11 deletions.
3 changes: 2 additions & 1 deletion browser-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// make MicrosoftGraph globally accessible
// MicrosoftGraph.api() can be called directly
window.MicrosoftGraph = require('./lib/src/index.js');
window.MicrosoftGraph = require('./lib/src/index.js');
Object.assign(window, require("./lib/src/LargeFileUploadTask.js"));
2 changes: 1 addition & 1 deletion lib/graph-js-sdk-web.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions lib/src/LargeFileUploadTask.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Client } from "./index";
import { Range } from "./Range";
interface LargeFileUploadTaskOptions {
sessionRequestUrl: string;
rangeSize?: number;
maxTries?: number;
}
interface LargeFileUploadSession {
url: string;
expiry: Date;
}
export declare class LargeFileUploadTask {
client: Client;
file: File;
options: LargeFileUploadTaskOptions;
uploadSession: LargeFileUploadSession;
nextRange: Range;
constructor(client: Client, file: File, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions);
static create(client: Client, file: File | Blob, options: LargeFileUploadTaskOptions): Promise<any>;
static createUploadSession(client: Client, requestUrl: string, requestPayload: any): Promise<any>;
private parseRange;
private updateTaskStatus;
getNextRange(): Range;
sliceFile(range: Range): Blob;
upload(): Promise<any>;
uploadSlice(fileSlice: Blob | File, range: Range, totalSize: number): Promise<any>;
cancel(): Promise<any>;
getStatus(): Promise<any>;
resume(): Promise<any>;
commit(requestUrl: string): Promise<any>;
}
export {};
304 changes: 304 additions & 0 deletions lib/src/LargeFileUploadTask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/LargeFileUploadTask.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a72448b

Please sign in to comment.