UNPKG

@gaiot/apis

Version:

aiot apis

92 lines (91 loc) 2.12 kB
var s = (i, t, e) => new Promise((c, n) => { var u = (r) => { try { o(e.next(r)); } catch (a) { n(a); } }, k = (r) => { try { o(e.throw(r)); } catch (a) { n(a); } }, o = (r) => r.done ? c(r.value) : Promise.resolve(r.value).then(u, k); o((e = e.apply(i, t)).next()); }); import l from "axios"; import { BaseApi as p } from "../base/index.mjs"; class y extends p { constructor(t, e) { super(t != null ? t : l.create(), e); } listTasks(t) { return s(this, null, function* () { return this.get("/tasks", t); }); } createTask(t) { return s(this, null, function* () { return this.post("/tasks", t); }); } getTask(t) { return s(this, null, function* () { return this.get(`/tasks/${t}`); }); } updateTask(t, e) { return s(this, null, function* () { return this.patch(`/tasks/${t}`, e); }); } deleteTask(t) { return s(this, null, function* () { return this.delete(`/tasks/${t}`); }); } listTaskFiles(t) { return s(this, null, function* () { return this.get(`/tasks/${t}/files`); }); } uploadTaskFile(t, e) { return s(this, null, function* () { return this.post(`/tasks/${t}/files`, e); }); } listWorkflowExecutions(t) { return s(this, null, function* () { return this.get("/workflows/executions", t); }); } getWorkflowExecution(t) { return s(this, null, function* () { return this.get(`/workflows/executions/${t}`); }); } startWorkflowExecution(t) { return s(this, null, function* () { return this.post("/workflows/executions", t); }); } updateWorkflowExecution(t, e) { return s(this, null, function* () { return this.patch(`/workflows/executions/${t}`, e); }); } cancelWorkflowExecution(t) { return s(this, null, function* () { return this.post(`/workflows/executions/${t}/cancel`, {}); }); } getUploadTicket(t) { return s(this, null, function* () { return this.get("/upload/ticket", t); }); } } export { y as ContralyzeApi };