From 2050abd2a0345e8bbab8d5c5b33990801b61caf7 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:24:58 +0200 Subject: [PATCH 01/10] refactor requests --- src/contents.ts | 60 ++++++++++++++++++++++++++++++++++++++++++---- src/requests.ts | 64 ++++--------------------------------------------- 2 files changed, 60 insertions(+), 64 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index df08cb3..89559f5 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -651,10 +651,23 @@ export class Drive implements Contents.IDrive { newDriveName: string, region: string ): Promise { - data = await createDrive(newDriveName, { + await createDrive(newDriveName, { location: region }); + data = { + name: newDriveName, + path: newDriveName, + last_modified: '', + created: '', + content: [], + format: 'json', + mimetype: '', + size: 0, + writable: true, + type: 'directory' + }; + Contents.validateContentsModel(data); this._fileChanged.emit({ type: 'new', @@ -673,7 +686,20 @@ export class Drive implements Contents.IDrive { * @returns A promise which resolves with the contents model. */ async addPublicDrive(driveUrl: string): Promise { - data = await addPublicDrive(driveUrl); + await addPublicDrive(driveUrl); + + data = { + name: driveUrl, + path: driveUrl, + last_modified: '', + created: '', + content: [], + format: 'json', + mimetype: '', + size: 0, + writable: true, + type: 'directory' + }; Contents.validateContentsModel(data); this._fileChanged.emit({ @@ -693,7 +719,20 @@ export class Drive implements Contents.IDrive { * @returns A promise which resolves with the contents model. */ async excludeDrive(driveName: string): Promise { - data = await excludeDrive(driveName); + await excludeDrive(driveName); + + data = { + name: driveName, + path: driveName, + last_modified: '', + created: '', + content: [], + format: 'json', + mimetype: '', + size: 0, + writable: true, + type: 'directory' + }; Contents.validateContentsModel(data); this._fileChanged.emit({ @@ -713,7 +752,20 @@ export class Drive implements Contents.IDrive { * @returns A promise which resolves with the contents model. */ async includeDrive(driveName: string): Promise { - data = await includeDrive(driveName); + await includeDrive(driveName); + + data = { + name: driveName, + path: driveName, + last_modified: '', + created: '', + content: [], + format: 'json', + mimetype: '', + size: 0, + writable: true, + type: 'directory' + }; Contents.validateContentsModel(data); this._fileChanged.emit({ diff --git a/src/requests.ts b/src/requests.ts index db1b31e..7cf1a20 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -43,23 +43,9 @@ export async function setListingLimit(newLimit: number) { * @returns */ export async function excludeDrive(driveName: string) { - await requestAPI('drives/config', 'POST', { + return await requestAPI('drives/config', 'POST', { exclude_drive_name: driveName }); - - data = { - name: driveName, - path: driveName, - last_modified: '', - created: '', - content: [], - format: 'json', - mimetype: '', - size: 0, - writable: true, - type: 'directory' - }; - return data; } /** @@ -68,23 +54,9 @@ export async function excludeDrive(driveName: string) { * @returns */ export async function includeDrive(driveName: string) { - await requestAPI('drives/config', 'POST', { + return await requestAPI('drives/config', 'POST', { include_drive_name: driveName }); - - data = { - name: driveName, - path: driveName, - last_modified: '', - created: '', - content: [], - format: 'json', - mimetype: '', - size: 0, - writable: true, - type: 'directory' - }; - return data; } /** @@ -572,23 +544,9 @@ export async function createDrive( location: string; } ) { - await requestAPI('drives/' + newDriveName + '/', 'POST', { + return await requestAPI('drives/' + newDriveName + '/', 'POST', { location: options.location }); - - data = { - name: newDriveName, - path: newDriveName, - last_modified: '', - created: '', - content: [], - format: 'json', - mimetype: '', - size: 0, - writable: true, - type: 'directory' - }; - return data; } /** @@ -599,23 +557,9 @@ export async function createDrive( * @returns A promise which resolves with the contents model. */ export async function addPublicDrive(driveUrl: string) { - await requestAPI('drives/' + driveUrl + '/', 'POST', { + return await requestAPI('drives/' + driveUrl + '/', 'POST', { public: true }); - - data = { - name: driveUrl, - path: driveUrl, - last_modified: '', - created: '', - content: [], - format: 'json', - mimetype: '', - size: 0, - writable: true, - type: 'directory' - }; - return data; } namespace Private { From 91d9ff7b5f61fb455d06e7d86d9039afe0ec1070 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:34:37 +0200 Subject: [PATCH 02/10] refactor save request --- src/contents.ts | 18 ++++++++++++++++-- src/requests.ts | 17 +++++------------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 89559f5..b8b697a 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -532,12 +532,26 @@ export class Drive implements Contents.IDrive { ): Promise { if (localPath !== '') { const currentDrive = extractCurrentDrive(localPath, this._drivesList); + const currentPath = formatPath(localPath); - data = await saveObject(currentDrive.name, { - path: formatPath(localPath), + const result = await saveObject(currentDrive.name, { + path: currentPath, param: options, registeredFileTypes: this._registeredFileTypes }); + + data = { + name: currentPath, + path: PathExt.join(currentDrive.name, currentPath), + last_modified: result.response.last_modified, + created: result.response.last_modified, + content: result.response.content, + format: result.fileFormat, + mimetype: result.fileMimeType, + size: result.response.data.size, + writable: true, + type: result.fileType + }; } else { // create new element at root would mean modifying a drive console.warn('Operation not supported.'); diff --git a/src/requests.ts b/src/requests.ts index 7cf1a20..df24273 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -219,19 +219,12 @@ export async function saveObject( } ); - data = { - name: PathExt.basename(options.path), - path: PathExt.join(driveName, options.path), - last_modified: response.data.last_modified, - created: response.data.last_modified, - content: response.data.content, - format: fileFormat as Contents.FileFormat, - mimetype: fileMimeType, - size: response.data.size, - writable: true, - type: fileType + return { + response: response, + fileType: fileType, + fileMimeType: fileMimeType, + fileFormat: fileFormat as Contents.FileFormat }; - return data; } /** From 99de8355a365235e54b2fa81c22d9a5d1f993cec Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:40:29 +0200 Subject: [PATCH 03/10] refactor object creation request --- src/contents.ts | 21 +++++++++++++++++++-- src/requests.ts | 22 ++++++---------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index b8b697a..814c048 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -322,12 +322,29 @@ export class Drive implements Contents.IDrive { if (options.type !== undefined) { // get incremented untitled name const name = this.incrementUntitledName(old_data, options); - data = await createObject(currentDrive.name, { + const currentPath = relativePath + ? PathExt.join(relativePath, name) + : name; + + const result = await createObject(currentDrive.name, { name: name, - path: relativePath, + path: currentPath, type: options.type, registeredFileTypes: this._registeredFileTypes }); + + data = { + name: name, + path: PathExt.join(currentDrive.name, currentPath), + last_modified: result.response.data.last_modified, + created: result.response.data.last_modified, + content: result.response.data.content, + format: result.fileFormat, + mimetype: result.fileMimeType, + size: result.response.data.size, + writable: true, + type: result.fileType + }; } else { console.warn('Type of new element is undefined'); } diff --git a/src/requests.ts b/src/requests.ts index df24273..7e4437b 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -245,11 +245,8 @@ export async function createObject( registeredFileTypes: IRegisteredFileTypes; } ) { - const path = options.path - ? PathExt.join(options.path, options.name) - : options.name; const response = await requestAPI( - 'drives/' + driveName + '/' + path, + 'drives/' + driveName + '/' + options.path, 'POST', { type: options.type @@ -261,19 +258,12 @@ export async function createObject( options.registeredFileTypes ); - data = { - name: options.name, - path: PathExt.join(driveName, path), - last_modified: response.data.last_modified, - created: response.data.last_modified, - content: response.data.content, - format: fileFormat as Contents.FileFormat, - mimetype: fileMimeType, - size: response.data.size, - writable: true, - type: fileType + return { + response: response, + fileType: fileType, + fileMimeType: fileMimeType, + fileFormat: fileFormat as Contents.FileFormat }; - return data; } /** From 0b50cedcad59201e88d6b969b7ccf299535e6d4e Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:51:54 +0200 Subject: [PATCH 04/10] refactor rename request --- src/contents.ts | 15 ++++++++++++++- src/requests.ts | 13 ++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 814c048..02a9a80 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -475,12 +475,25 @@ export class Drive implements Contents.IDrive { } catch (error) { // HEAD request failed for this file name, continue, as name doesn't already exist. } finally { - data = await renameObjects(currentDrive.name, { + const result = await renameObjects(currentDrive.name, { path: relativePath, newPath: newRelativePath, newFileName: newFileName, registeredFileTypes: this._registeredFileTypes }); + + data = { + name: newFileName, + path: PathExt.join(currentDrive.name, result.formattedNewPath!), + last_modified: result.response.data.last_modified, + created: '', + content: PathExt.extname(newFileName) !== '' ? null : [], // TODO: add dir check + format: result.format!, + mimetype: result.mimetype!, + size: result.response.data.size, + writable: true, + type: result.type! + }; } } else { // create new element at root would mean modifying a drive diff --git a/src/requests.ts b/src/requests.ts index 7e4437b..bf4eb1a 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -338,23 +338,18 @@ export async function renameObjects( options.path, formattedNewPath ); - data = { - name: options.newFileName, - path: PathExt.join(driveName, formattedNewPath), - last_modified: renamedObject.data.last_modified, - created: '', - content: PathExt.extname(options.newFileName) !== '' ? null : [], // TODO: add dir check + return { + response: renamedObject, + formattedNewPath: formattedNewPath, format: fileFormat as Contents.FileFormat, mimetype: fileMimeType, - size: renamedObject.data.size, - writable: true, type: fileType }; } catch (error) { // renaming failed if directory didn't exist and was only part of a path } - return data; + return {}; } /** From 36183cae0054d781ede49a823e49e54f2a422b8c Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:53:20 +0200 Subject: [PATCH 05/10] iterate --- src/contents.ts | 12 ++++++------ src/requests.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 02a9a80..03638a0 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -339,11 +339,11 @@ export class Drive implements Contents.IDrive { last_modified: result.response.data.last_modified, created: result.response.data.last_modified, content: result.response.data.content, - format: result.fileFormat, - mimetype: result.fileMimeType, + format: result.format, + mimetype: result.mimetype, size: result.response.data.size, writable: true, - type: result.fileType + type: result.type }; } else { console.warn('Type of new element is undefined'); @@ -576,11 +576,11 @@ export class Drive implements Contents.IDrive { last_modified: result.response.last_modified, created: result.response.last_modified, content: result.response.content, - format: result.fileFormat, - mimetype: result.fileMimeType, + format: result.format, + mimetype: result.mimetype, size: result.response.data.size, writable: true, - type: result.fileType + type: result.type }; } else { // create new element at root would mean modifying a drive diff --git a/src/requests.ts b/src/requests.ts index bf4eb1a..e18d645 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -221,9 +221,9 @@ export async function saveObject( return { response: response, - fileType: fileType, - fileMimeType: fileMimeType, - fileFormat: fileFormat as Contents.FileFormat + type: fileType, + mimetype: fileMimeType, + format: fileFormat as Contents.FileFormat }; } @@ -260,9 +260,9 @@ export async function createObject( return { response: response, - fileType: fileType, - fileMimeType: fileMimeType, - fileFormat: fileFormat as Contents.FileFormat + type: fileType, + mimetype: fileMimeType, + format: fileFormat as Contents.FileFormat }; } From 9994ee37fe054c258b08f06cf57b15324b212205 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 13:56:38 +0200 Subject: [PATCH 06/10] refactor copy objects request --- src/contents.ts | 15 ++++++++++++++- src/requests.ts | 13 ++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 03638a0..18ef667 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -663,13 +663,26 @@ export class Drive implements Contents.IDrive { toDrive.name ); - data = await copyObjects(currentDrive.name, { + const result = await copyObjects(currentDrive.name, { path: relativePath, toPath: toRelativePath, newFileName: newFileName, toDrive: toDrive.name, registeredFileTypes: this._registeredFileTypes }); + + data = { + name: newFileName, + path: PathExt.join(currentDrive.name, result.formattedNewPath!), + last_modified: result.response!.data.last_modified, + created: '', + content: PathExt.extname(newFileName) !== '' ? null : [], // TODO: add dir check + format: result.format! as Contents.FileFormat, + mimetype: result.mimetype!, + size: result.response!.data.size, + writable: true, + type: result.type! + }; } else { // create new element at root would mean modifying a drive console.warn('Operation not supported.'); diff --git a/src/requests.ts b/src/requests.ts index e18d645..b9b004a 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -408,23 +408,18 @@ export async function copyObjects( options.path, formattedNewPath ); - data = { - name: options.newFileName, - path: PathExt.join(options.toDrive, formattedNewPath), - last_modified: copiedObject.data.last_modified, - created: '', - content: PathExt.extname(options.newFileName) !== '' ? null : [], // TODO: add dir check + return { + response: copiedObject, + formattedNewPath: formattedNewPath, format: fileFormat as Contents.FileFormat, mimetype: fileMimeType, - size: copiedObject.data.size, - writable: true, type: fileType }; } catch (error) { // copied failed if directory didn't exist and was only part of a path } - return data; + return {}; } /** From d497e0436d5fec9564e5a1352bef1bdf32a347ce Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 14:11:09 +0200 Subject: [PATCH 07/10] refactor get contents request --- src/contents.ts | 47 ++++++++++++++++++++++++++++++++++++++++++++--- src/requests.ts | 44 ++++++++------------------------------------ 2 files changed, 52 insertions(+), 39 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 18ef667..baf18f1 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -243,10 +243,35 @@ export class Drive implements Contents.IDrive { } } - data = await getContents(currentDrive.name, { - path: formatPath(localPath), + const currentPath = formatPath(localPath); + const result = await getContents(currentDrive.name, { + path: currentPath, registeredFileTypes: this._registeredFileTypes }); + + data = { + name: result.isDir + ? currentPath + ? PathExt.basename(currentPath) + : currentDrive.name + : PathExt.basename(currentPath), + path: PathExt.join( + currentDrive.name, + result.isDir + ? currentPath + ? currentPath + '/' + : '' + : result.response.data.path + ), + last_modified: result.isDir ? '' : result.response.data.last_modified, + created: '', + content: result.isDir ? result.files : result.response.data.content, + format: result.isDir ? 'json' : result.format!, + mimetype: result.isDir ? '' : result.mimetype!, + size: result.isDir ? undefined : result.response.data.size, + writable: true, + type: result.isDir ? 'directory' : result.type! + }; } else { // retriving list of contents from root // in our case: list available drives @@ -314,11 +339,27 @@ export class Drive implements Contents.IDrive { path.indexOf('/') !== -1 ? path.substring(path.indexOf('/') + 1) : ''; // get current list of contents of drive - const old_data = await getContents(currentDrive.name, { + const result = await getContents(currentDrive.name, { path: relativePath, registeredFileTypes: this._registeredFileTypes }); + const old_data: Contents.IModel = { + name: relativePath ? PathExt.basename(relativePath) : currentDrive.name, + path: PathExt.join( + currentDrive.name, + relativePath ? relativePath + '/' : '' + ), + last_modified: '', + created: '', + content: result.files, + format: 'json'!, + mimetype: '', + size: undefined, + writable: true, + type: 'directory' + }; + if (options.type !== undefined) { // get incremented untitled name const name = this.incrementUntitledName(old_data, options); diff --git a/src/requests.ts b/src/requests.ts index b9b004a..74b3e44 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -10,22 +10,6 @@ import { IDriveInfo } from './token'; -/** - * The data contents model. - */ -let data: Contents.IModel = { - name: '', - path: '', - last_modified: '', - created: '', - content: null, - format: null, - mimetype: '', - size: 0, - writable: true, - type: '' -}; - /** * Set new limit for number of objects to be listed inside the DriveBrowser, given any path. * @@ -147,17 +131,10 @@ export async function getContents( } }); - data = { - name: options.path ? PathExt.basename(options.path) : driveName, - path: PathExt.join(driveName, options.path ? options.path + '/' : ''), - last_modified: '', - created: '', - content: Object.values(fileList), - format: 'json', - mimetype: '', - size: undefined, - writable: true, - type: 'directory' + return { + isDir: isDir, + response: response, + files: Object.values(fileList) }; } // getting the contents of a file @@ -167,22 +144,17 @@ export async function getContents( options.registeredFileTypes ); - data = { - name: PathExt.basename(options.path), - path: PathExt.join(driveName, response.data.path), - last_modified: response.data.last_modified, - created: '', - content: response.data.content, + return { + isDir: isDir, + response: response, format: fileFormat as Contents.FileFormat, mimetype: fileMimeType, - size: response.data.size, - writable: true, type: fileType }; } } - return data; + return {}; } /** From 17d6dc03f37b7707cddb624b28a2fea37089dbf3 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 14:25:50 +0200 Subject: [PATCH 08/10] fix save funcitonality --- src/contents.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index baf18f1..c40eca7 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -614,9 +614,9 @@ export class Drive implements Contents.IDrive { data = { name: currentPath, path: PathExt.join(currentDrive.name, currentPath), - last_modified: result.response.last_modified, - created: result.response.last_modified, - content: result.response.content, + last_modified: result.response.data.last_modified as string, + created: result.response.data.last_modified as string, + content: result.response.data.content, format: result.format, mimetype: result.mimetype, size: result.response.data.size, From 1f37f61e8997e71123e6a76894e3c0ee9d73d709 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 22:26:09 +0200 Subject: [PATCH 09/10] fix rename --- src/contents.ts | 8 ++++++-- src/requests.ts | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index c40eca7..99a5a0a 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -526,12 +526,16 @@ export class Drive implements Contents.IDrive { data = { name: newFileName, path: PathExt.join(currentDrive.name, result.formattedNewPath!), - last_modified: result.response.data.last_modified, + last_modified: + result.response.length > 0 + ? result.response.data.last_modified + : '', created: '', content: PathExt.extname(newFileName) !== '' ? null : [], // TODO: add dir check format: result.format!, mimetype: result.mimetype!, - size: result.response.data.size, + size: + result.response.length > 0 ? result.response.data.size : undefined, writable: true, type: result.type! }; diff --git a/src/requests.ts b/src/requests.ts index 74b3e44..d8a52e4 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -303,6 +303,15 @@ export async function renameObjects( }) ); } + + let resp: any = {}; + let result = { + response: resp, + formattedNewPath: formattedNewPath, + format: fileFormat as Contents.FileFormat, + mimetype: fileMimeType, + type: fileType + }; // always rename the object (file or main directory) try { const renamedObject = await Private.renameSingleObject( @@ -310,18 +319,15 @@ export async function renameObjects( options.path, formattedNewPath ); - return { - response: renamedObject, - formattedNewPath: formattedNewPath, - format: fileFormat as Contents.FileFormat, - mimetype: fileMimeType, - type: fileType + resp = { + last_modified: renamedObject.data.last_modified, + size: renamedObject.data.size }; } catch (error) { // renaming failed if directory didn't exist and was only part of a path } - return {}; + return result; } /** From d020aa0e310b59a6a5fd2d71865982c513260a75 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Tue, 5 Aug 2025 22:32:16 +0200 Subject: [PATCH 10/10] remove common data object --- src/contents.ts | 71 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/src/contents.ts b/src/contents.ts index 99a5a0a..f5f4ae8 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -27,19 +27,6 @@ import { includeDrive } from './requests'; -let data: Contents.IModel = { - name: '', - path: '', - last_modified: '', - created: '', - content: [], - format: null, - mimetype: '', - size: 0, - writable: true, - type: '' -}; - export class Drive implements Contents.IDrive { /** * Construct a new drive object. @@ -227,6 +214,8 @@ export class Drive implements Contents.IDrive { localPath: string, options?: Contents.IFetchOptions ): Promise { + let data: Contents.IModel; + if (localPath !== '') { const currentDrive = extractCurrentDrive(localPath, this._drivesList); @@ -329,6 +318,18 @@ export class Drive implements Contents.IDrive { async newUntitled( options: Contents.ICreateOptions = {} ): Promise { + let data: Contents.IModel = { + name: '', + path: '', + last_modified: '', + created: '', + content: [], + format: null, + mimetype: '', + size: 0, + writable: true, + type: '' + }; const path = options.path ?? ''; if (path !== '') { @@ -494,6 +495,18 @@ export class Drive implements Contents.IDrive { newLocalPath: string, options: Contents.ICreateOptions = {} ): Promise { + let data: Contents.IModel = { + name: '', + path: '', + last_modified: '', + created: '', + content: [], + format: null, + mimetype: '', + size: 0, + writable: true, + type: '' + }; if (oldLocalPath !== '') { const currentDrive = extractCurrentDrive(oldLocalPath, this._drivesList); @@ -605,6 +618,18 @@ export class Drive implements Contents.IDrive { localPath: string, options: Partial = {} ): Promise { + let data: Contents.IModel = { + name: '', + path: '', + last_modified: '', + created: '', + content: [], + format: null, + mimetype: '', + size: 0, + writable: true, + type: '' + }; if (localPath !== '') { const currentDrive = extractCurrentDrive(localPath, this._drivesList); const currentPath = formatPath(localPath); @@ -693,6 +718,18 @@ export class Drive implements Contents.IDrive { toDir: string, options: Contents.ICreateOptions = {} ): Promise { + let data: Contents.IModel = { + name: '', + path: '', + last_modified: '', + created: '', + content: [], + format: null, + mimetype: '', + size: 0, + writable: true, + type: '' + }; if (path !== '') { const currentDrive = extractCurrentDrive(path, this._drivesList); const toDrive = extractCurrentDrive(toDir, this._drivesList); @@ -757,7 +794,7 @@ export class Drive implements Contents.IDrive { location: region }); - data = { + const data: Contents.IModel = { name: newDriveName, path: newDriveName, last_modified: '', @@ -790,7 +827,7 @@ export class Drive implements Contents.IDrive { async addPublicDrive(driveUrl: string): Promise { await addPublicDrive(driveUrl); - data = { + const data: Contents.IModel = { name: driveUrl, path: driveUrl, last_modified: '', @@ -823,7 +860,7 @@ export class Drive implements Contents.IDrive { async excludeDrive(driveName: string): Promise { await excludeDrive(driveName); - data = { + const data: Contents.IModel = { name: driveName, path: driveName, last_modified: '', @@ -856,7 +893,7 @@ export class Drive implements Contents.IDrive { async includeDrive(driveName: string): Promise { await includeDrive(driveName); - data = { + const data: Contents.IModel = { name: driveName, path: driveName, last_modified: '',