update api
This commit is contained in:
parent
53b9b51f5f
commit
d5ff50a1b0
5 changed files with 4 additions and 48 deletions
|
|
@ -49,10 +49,6 @@ export class FileOperations {
|
|||
return this.fs.getFileSize(path);
|
||||
}
|
||||
|
||||
public async getModificationTime(path: RelativePath): Promise<Date> {
|
||||
return this.fs.getModificationTime(path);
|
||||
}
|
||||
|
||||
public async exists(path: RelativePath): Promise<boolean> {
|
||||
return this.fs.exists(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ export interface FileSystemOperations {
|
|||
updater: (currentContent: string) => string
|
||||
) => Promise<string>;
|
||||
getFileSize: (path: RelativePath) => Promise<number>;
|
||||
getModificationTime: (path: RelativePath) => Promise<Date>;
|
||||
exists: (path: RelativePath) => Promise<boolean>;
|
||||
createDirectory: (path: RelativePath) => Promise<void>;
|
||||
delete: (path: RelativePath) => Promise<void>;
|
||||
|
|
|
|||
|
|
@ -69,17 +69,6 @@ export class SafeFileSystemOperations implements FileSystemOperations {
|
|||
);
|
||||
}
|
||||
|
||||
public async getModificationTime(path: RelativePath): Promise<Date> {
|
||||
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<boolean> {
|
||||
this.logger.debug(`Checking if file exists: ${path}`);
|
||||
return this.decorateToHoldLock(path, async () =>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -46,13 +46,6 @@ export class MockClient implements FileSystemOperations {
|
|||
return (await this.read(path)).length;
|
||||
}
|
||||
|
||||
public async getModificationTime(path: RelativePath): Promise<Date> {
|
||||
if (!this.localFiles.has(path)) {
|
||||
throw new Error(`File ${path} does not exist`);
|
||||
}
|
||||
return new Date();
|
||||
}
|
||||
|
||||
public async exists(path: RelativePath): Promise<boolean> {
|
||||
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<void> {
|
||||
|
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue