diff --git a/pkg/filesystem/onedrive/onedrive.ts b/pkg/filesystem/onedrive/onedrive.ts index 68f8ef1a..aa7ecfda 100644 --- a/pkg/filesystem/onedrive/onedrive.ts +++ b/pkg/filesystem/onedrive/onedrive.ts @@ -66,7 +66,7 @@ export default class OneDriveFileSystem implements FileSystem { parent = `:${parent}:`; } return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot${parent}/children`, + `https://graph.microsoft.com/v1.0/me/drive/special/approot${parent}/children`, { method: "POST", headers: myHeaders, @@ -119,7 +119,7 @@ export default class OneDriveFileSystem implements FileSystem { delete(path: string): Promise { return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${joinPath( + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${joinPath( this.path, path )}`, @@ -143,7 +143,7 @@ export default class OneDriveFileSystem implements FileSystem { path = `:${path}:`; } return this.request( - `https://graph.microsoft.com/v1.0/drive/special/approot${path}/children` + `https://graph.microsoft.com/v1.0/me/drive/special/approot${path}/children` ).then((data) => { const list: File[] = []; data.value.forEach((val: any) => { diff --git a/pkg/filesystem/onedrive/rw.ts b/pkg/filesystem/onedrive/rw.ts index 11a8c39d..4f2029fa 100644 --- a/pkg/filesystem/onedrive/rw.ts +++ b/pkg/filesystem/onedrive/rw.ts @@ -18,7 +18,7 @@ export class OneDriveFileReader implements FileReader { async read(type?: "string" | "blob"): Promise { const data = await this.fs.request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${joinPath( + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${joinPath( this.file.path, this.file.name )}:/content`, @@ -69,7 +69,7 @@ export class OneDriveFileWriter implements FileWriter { myHeaders.append("Content-Type", "application/json"); const uploadUrl = await this.fs .request( - `https://graph.microsoft.com/v1.0/drive/special/approot:${this.path}:/createUploadSession`, + `https://graph.microsoft.com/v1.0/me/drive/special/approot:${this.path}:/createUploadSession`, { method: "POST", headers: myHeaders,