UNPKG

@gaiot/apis

Version:

aiot apis

86 lines (85 loc) 2.24 kB
var $ = Object.defineProperty, o = Object.defineProperties; var y = Object.getOwnPropertyDescriptors; var l = Object.getOwnPropertySymbols; var m = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable; var p = (a, t, s) => t in a ? $(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s, h = (a, t) => { for (var s in t || (t = {})) m.call(t, s) && p(a, s, t[s]); if (l) for (var s of l(t)) D.call(t, s) && p(a, s, t[s]); return a; }, c = (a, t) => o(a, y(t)); var n = (a, t, s) => new Promise((i, g) => { var P = (u) => { try { r(s.next(u)); } catch (e) { g(e); } }, d = (u) => { try { r(s.throw(u)); } catch (e) { g(e); } }, r = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(P, d); r((s = s.apply(a, t)).next()); }); import { BaseApi as f } from "../base/index.mjs"; import A from "axios"; class N extends f { constructor(t, s) { super(t != null ? t : A.create(), s); } listPlugin(t) { return n(this, null, function* () { return this.list("/plugins", t); }); } postPlugin(t) { return n(this, null, function* () { return this.post("/plugins", t); }); } getPlugin(t) { return n(this, null, function* () { return this.get(`/plugins/${t}`); }); } updatePlugin(t, s) { return n(this, null, function* () { return this.patch(`/plugins/${t}`, s); }); } listPluginData(t, s) { return n(this, null, function* () { return this.list(`/plugins/${t}/datas`, s); }); } postPluginData(t, s) { return n(this, null, function* () { return this.post(`/plugins/${t}/datas`, s); }); } getPluginData(t, s) { return n(this, null, function* () { return this.get(`/plugins/${t}/datas/${s}`).then((i) => c(h({}, i), { arguments: JSON.parse(i.arguments) })); }); } updatePluginData(t, s, i) { return n(this, null, function* () { return this.patch(`/plugins/${t}/datas/${s}`, i); }); } deletePluginData(t, s) { return n(this, null, function* () { return this.delete(`/plugins/${t}/datas/${s}`); }); } } export { N as PanoramaPluginMgrApi };