mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Update export CSV and Excel endpoints
Summary: The endpoints for exporting CSV and Excel are now under /api/docs/:docId/ and are forwarded to a doc worker for export. The Share Menu has been updated to use the new endpoints. Test Plan: No new tests. Existing tests that verify endpoints work correctly. Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3007
This commit is contained in:
@@ -347,6 +347,8 @@ export interface DocAPI {
|
||||
// is HEAD, the result will contain a copy of any rows added or updated.
|
||||
compareVersion(leftHash: string, rightHash: string): Promise<DocStateComparison>;
|
||||
getDownloadUrl(template?: boolean): string;
|
||||
getGenerateXlsxUrl(): string;
|
||||
getGenerateCsvUrl(): string;
|
||||
/**
|
||||
* Exports current document to the Google Drive as a spreadsheet file. To invoke this method, first
|
||||
* acquire "code" via Google Auth Endpoint (see ShareMenu.ts for an example).
|
||||
@@ -790,6 +792,14 @@ export class DocAPIImpl extends BaseAPI implements DocAPI {
|
||||
return this._url + `/download?template=${Number(template)}`;
|
||||
}
|
||||
|
||||
public getGenerateXlsxUrl() {
|
||||
return this._url + '/gen-xlsx';
|
||||
}
|
||||
|
||||
public getGenerateCsvUrl() {
|
||||
return this._url + '/gen-csv';
|
||||
}
|
||||
|
||||
public async sendToDrive(code: string, title: string): Promise<{url: string}> {
|
||||
const url = new URL(`${this._url}/send-to-drive`);
|
||||
url.searchParams.append('title', title);
|
||||
|
||||
Reference in New Issue
Block a user