From b408c346f8e3c723889ab62b6b5fbdbeb6c9e9df Mon Sep 17 00:00:00 2001 From: r350178982 <32759763+r350178982@users.noreply.github.com> Date: Thu, 5 Jan 2023 12:01:33 +0800 Subject: [PATCH] Update dtable-web-api.js --- src/dtable-web-api.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/dtable-web-api.js b/src/dtable-web-api.js index 4dab86cf..da00ab7b 100644 --- a/src/dtable-web-api.js +++ b/src/dtable-web-api.js @@ -2988,6 +2988,40 @@ class DTableWebAPI { return this._sendPostRequest(url, params, {headers: {'Content-Type': 'application/json'}}); } + listAutoArchiveTasks(dtableUuid) { + let url = this.server + '/api/v2.1/dtables/' + dtableUuid + '/auto-archive-tasks/'; + return this.req.get(url); + } + + addAutoArchiveTask(dtableUuid, table_id, view_id, run_condition, details) { + let url = this.server + '/api/v2.1/dtables/' + dtableUuid + '/auto-archive-tasks/'; + let data = { + 'table_id': table_id, + 'view_id': view_id, + 'run_condition': run_condition, + 'details': details + }; + return this._sendPostRequest(url, data, {headers: {'Content-Type': 'application/json'}}); + } + + updateAutoArchiveTask(dtableUuid, task_id, table_id, view_id, run_condition, details) { + let url = this.server + '/api/v2.1/dtables/' + dtableUuid + '/auto-archive-tasks/' + task_id + '/'; + let data = { + 'table_id': table_id, + 'view_id': view_id, + 'run_condition': run_condition, + 'details': details + }; + return this.req.put(url, data, {headers: {'Content-Type': 'application/json'}}); + } + + + deleteAutoArchiveTask(dtableUuid, task_id) { + let url = this.server + '/api/v2.1/dtables/' + dtableUuid + '/auto-archive-tasks/' + task_id + '/'; + return this.req.delete(url); + } + + // org admin api orgAdminUpdateOrgInfo(newOrgName) { let url = this.server + '/api/v2.1/org/admin/info/';