From d5ff50a1b0447fbe2aedb01de5954da2984dce4a Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Wed, 12 Mar 2025 21:17:14 +0000 Subject: [PATCH] update api --- .../src/file-operations/file-operations.ts | 4 ---- .../file-operations/filesystem-operations.ts | 1 - .../safe-filesystem-operations.ts | 11 ----------- frontend/sync-client/src/services/types.ts | 18 ------------------ frontend/test-client/src/agent/mock-client.ts | 18 ++++-------------- 5 files changed, 4 insertions(+), 48 deletions(-) diff --git a/frontend/sync-client/src/file-operations/file-operations.ts b/frontend/sync-client/src/file-operations/file-operations.ts index ef9dda55..c3584de5 100644 --- a/frontend/sync-client/src/file-operations/file-operations.ts +++ b/frontend/sync-client/src/file-operations/file-operations.ts @@ -49,10 +49,6 @@ export class FileOperations { return this.fs.getFileSize(path); } - public async getModificationTime(path: RelativePath): Promise { - return this.fs.getModificationTime(path); - } - public async exists(path: RelativePath): Promise { return this.fs.exists(path); } diff --git a/frontend/sync-client/src/file-operations/filesystem-operations.ts b/frontend/sync-client/src/file-operations/filesystem-operations.ts index b58d3c23..7c51ec78 100644 --- a/frontend/sync-client/src/file-operations/filesystem-operations.ts +++ b/frontend/sync-client/src/file-operations/filesystem-operations.ts @@ -9,7 +9,6 @@ export interface FileSystemOperations { updater: (currentContent: string) => string ) => Promise; getFileSize: (path: RelativePath) => Promise; - getModificationTime: (path: RelativePath) => Promise; exists: (path: RelativePath) => Promise; createDirectory: (path: RelativePath) => Promise; delete: (path: RelativePath) => Promise; diff --git a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts index f1036073..a2f7d111 100644 --- a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts +++ b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts @@ -69,17 +69,6 @@ export class SafeFileSystemOperations implements FileSystemOperations { ); } - public async getModificationTime(path: RelativePath): Promise { - this.logger.debug(`Getting modification time: ${path}`); - return this.safeOperation( - path, - this.decorateToHoldLock(path, async () => - this.fs.getModificationTime(path) - ), - "getModificationTime" - ); - } - public async exists(path: RelativePath): Promise { this.logger.debug(`Checking if file exists: ${path}`); return this.decorateToHoldLock(path, async () => diff --git a/frontend/sync-client/src/services/types.ts b/frontend/sync-client/src/services/types.ts index c1c4446e..eba3d9f0 100644 --- a/frontend/sync-client/src/services/types.ts +++ b/frontend/sync-client/src/services/types.ts @@ -452,25 +452,17 @@ export interface components { Array_of_uint8: number[]; CreateDocumentVersion: { contentBase64: string; - /** Format: date-time */ - createdDate: string; relativePath: string; }; CreateDocumentVersionMultipart: { content: components["schemas"]["Array_of_uint8"]; - /** Format: date-time */ - created_date: string; relative_path: string; }; DeleteDocumentVersion: { - /** Format: date-time */ - createdDate: string; relativePath: string; }; /** @description Response to an update document request. */ DocumentUpdateResponse: { - /** Format: date-time */ - createdDate: string; /** Format: uuid */ documentId: string; isDeleted: boolean; @@ -484,8 +476,6 @@ export interface components { vaultUpdateId: number; } | { contentBase64: string; - /** Format: date-time */ - createdDate: string; /** Format: uuid */ documentId: string; isDeleted: boolean; @@ -500,8 +490,6 @@ export interface components { }; DocumentVersion: { contentBase64: string; - /** Format: date-time */ - createdDate: string; /** Format: uuid */ documentId: string; isDeleted: boolean; @@ -513,8 +501,6 @@ export interface components { vaultUpdateId: number; }; DocumentVersionWithoutContent: { - /** Format: date-time */ - createdDate: string; /** Format: uuid */ documentId: string; isDeleted: boolean; @@ -586,16 +572,12 @@ export interface components { }; UpdateDocumentVersion: { contentBase64: string; - /** Format: date-time */ - createdDate: string; /** Format: int64 */ parentVersionId: number; relativePath: string; }; UpdateDocumentVersionMultipart: { content: components["schemas"]["Array_of_uint8"]; - /** Format: date-time */ - createdDate: string; /** Format: int64 */ parentVersionId: number; relativePath: string; diff --git a/frontend/test-client/src/agent/mock-client.ts b/frontend/test-client/src/agent/mock-client.ts index e627eb78..ec077778 100644 --- a/frontend/test-client/src/agent/mock-client.ts +++ b/frontend/test-client/src/agent/mock-client.ts @@ -46,13 +46,6 @@ export class MockClient implements FileSystemOperations { return (await this.read(path)).length; } - public async getModificationTime(path: RelativePath): Promise { - if (!this.localFiles.has(path)) { - throw new Error(`File ${path} does not exist`); - } - return new Date(); - } - public async exists(path: RelativePath): Promise { return this.localFiles.has(path); } @@ -68,7 +61,7 @@ export class MockClient implements FileSystemOperations { `Creating file ${path} with content ${new TextDecoder().decode(newContent)}` ); this.localFiles.set(path, newContent); - void this.client.syncer.syncLocallyCreatedFile(path, new Date()); + void this.client.syncer.syncLocallyCreatedFile(path); } public async createDirectory(_path: RelativePath): Promise { @@ -93,8 +86,7 @@ export class MockClient implements FileSystemOperations { ); void this.client.syncer.syncLocallyUpdatedFile({ - relativePath: path, - updateTime: new Date() + relativePath: path }); return newContent; @@ -108,8 +100,7 @@ export class MockClient implements FileSystemOperations { ); void this.client.syncer.syncLocallyUpdatedFile({ - relativePath: path, - updateTime: new Date() + relativePath: path }); } @@ -140,8 +131,7 @@ export class MockClient implements FileSystemOperations { void this.client.syncer.syncLocallyUpdatedFile({ oldPath, - relativePath: newPath, - updateTime: new Date() + relativePath: newPath }); } }