🐛 backend: adding editing session key (#525)
This commit is contained in:
committed by
ericlinagora
parent
3de9829bf0
commit
16dbf8077b
@@ -28,6 +28,7 @@ export class DriveFileMockClass {
|
||||
tags: string[];
|
||||
last_modified: number;
|
||||
access_info: MockAccessInformation;
|
||||
editing_session_key: string;
|
||||
creator: string;
|
||||
is_directory: boolean;
|
||||
scope: "personal" | "shared";
|
||||
|
||||
@@ -396,6 +396,29 @@ export default class UserApi {
|
||||
});
|
||||
};
|
||||
|
||||
async beginEditingDocument(
|
||||
driveFileId: string,
|
||||
editorApplicationId: string,
|
||||
): Promise<Response> {
|
||||
return await this.api.post(
|
||||
`${UserApi.DOC_URL}/companies/${this.platform.workspace.company_id}/item/${driveFileId}/editing_session`,
|
||||
{ editorApplicationId },
|
||||
{
|
||||
authorization: `Bearer ${this.jwt}`
|
||||
});
|
||||
}
|
||||
|
||||
async beginEditingDocumentExpectOk(
|
||||
driveFileId: string,
|
||||
editorApplicationId: string,
|
||||
): Promise<string> {
|
||||
const result = await this.beginEditingDocument(driveFileId, editorApplicationId);
|
||||
expect(result.statusCode).toBe(200);
|
||||
const {editingSessionKey} = result.json();
|
||||
expect(editingSessionKey).toBeTruthy();
|
||||
return editingSessionKey;
|
||||
}
|
||||
|
||||
async searchDocument(
|
||||
payload: Record<string, any>
|
||||
) {
|
||||
@@ -459,6 +482,16 @@ export default class UserApi {
|
||||
return doc;
|
||||
};
|
||||
|
||||
async getDocumentByEditingKey(editing_session_key: string) {
|
||||
return await this.platform.app.inject({
|
||||
method: "GET",
|
||||
url: `${UserApi.DOC_URL}/companies/${this.platform.workspace.company_id}/item/editing_session/${encodeURIComponent(editing_session_key)}`,
|
||||
headers: {
|
||||
authorization: `Bearer ${this.jwt}`
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async sharedWithMeDocuments(
|
||||
payload: Record<string, any>
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user