@gaiot/apis
Version:
aiot apis
194 lines (193 loc) • 4.58 kB
JavaScript
var s = (c, t, e) => new Promise((r, u) => {
var a = (n) => {
try {
i(e.next(n));
} catch (o) {
u(o);
}
}, g = (n) => {
try {
i(e.throw(n));
} catch (o) {
u(o);
}
}, i = (n) => n.done ? r(n.value) : Promise.resolve(n.value).then(a, g);
i((e = e.apply(c, t)).next());
});
import p from "axios";
import { BaseApi as h } from "../base/index.mjs";
class l extends h {
constructor(t, e) {
super(t != null ? t : p.create(), e);
}
getTenant(t) {
return s(this, null, function* () {
return this.get(`/tenant/${t}`);
});
}
listProduct() {
return s(this, null, function* () {
return this.list("/products");
});
}
listProvinces() {
return s(this, null, function* () {
return this.list("/regions/provinces");
});
}
listCities(t) {
return s(this, null, function* () {
return this.list(`/regions/provinces/${t}/city`);
});
}
listCounties(t, e) {
return s(this, null, function* () {
return this.list(`/regions/provinces/${t}/city/${e}/county`);
});
}
getOrgList(t) {
return s(this, null, function* () {
return this.list("/org", t);
});
}
getUserIdOrgList(t, e) {
return s(this, null, function* () {
return this.list(`/users/${t}/org`, e);
});
}
delOrg(t) {
return s(this, null, function* () {
return this.delete(`/org/${t}`);
});
}
postOrg(t) {
return s(this, null, function* () {
return this.post("/org", t);
});
}
patchOrg(t, e) {
return s(this, null, function* () {
return this.patch(`/org/${t}`, e);
});
}
getUsers(t, e) {
return s(this, null, function* () {
return this.list(`/tenant/${t}/users`, e);
});
}
delUser(t, e) {
return s(this, null, function* () {
return this.delete(`/tenant/${t}/users/${e}`);
});
}
postUser(t, e) {
return s(this, null, function* () {
return this.post(`/tenant/${t}/users`, e);
});
}
patchUser(t, e, r) {
return s(this, null, function* () {
return this.patch(`tenant/${t}/users/${e}`, r);
});
}
getTenantList() {
return s(this, null, function* () {
return this.get("/tenant");
});
}
getUserIdRoles(t) {
return s(this, null, function* () {
return this.get(`/users/${t}/role`);
});
}
getProductCodeRole(t) {
return s(this, null, function* () {
return this.get(`/products/${t}/role`);
});
}
postUserRole(t, e) {
return s(this, null, function* () {
return this.post(`/users/${t}/role`, e);
});
}
patchUserRole(t, e, r) {
return s(this, null, function* () {
return this.patch(`/users/${t}/role/${e}`, r);
});
}
deleteUserRole(t, e) {
return s(this, null, function* () {
return this.delete(`/users/${t}/role/${e}`);
});
}
getUsersIdProductCodeMenu(t, e, r = "web", u) {
return s(this, null, function* () {
return this.get(`/users/${t}/product/${e}/menu?groupCode=${r}`, {
level: u
});
});
}
getUserInfo(t) {
return s(this, null, function* () {
return this.get(`/users/${t}`);
});
}
uipermission(t, e, r = "web") {
return s(this, null, function* () {
return this.get(`/users/${t}/product/${e}/uipermission?groupCode=${r}`);
});
}
getAppInfo(t) {
return s(this, null, function* () {
return this.get(`/products/${t}/apps`);
});
}
getTenantUserInfo(t, e) {
return s(this, null, function* () {
return this.get(`/tenant/${t}/users/${e}`);
});
}
uploadFile(t) {
return s(this, null, function* () {
return this.upload("/upload", t);
});
}
getUserIdProductCodeOrg(t, e) {
return s(this, null, function* () {
return this.get(`/users/${t}/product/${e}/org`);
});
}
getOrg(t) {
return s(this, null, function* () {
return this.get(`/org/${t}`);
});
}
getUploadTicket(t) {
return s(this, null, function* () {
return this.get("/upload/ticket", t);
});
}
putAppInfo(t, e) {
return s(this, null, function* () {
return this.put(`/products/${t}/apps`, e);
});
}
getTenantKeySecret(t) {
return s(this, null, function* () {
return this.get(`/tenant/${t}/key`);
});
}
resetTenantKeySecret(t) {
return s(this, null, function* () {
return this.post(`/tenant/${t}/resetSecret`, void 0);
});
}
getProductsCode(t) {
return s(this, null, function* () {
return this.get(`/products/${t}`);
});
}
}
export {
l as DataApi
};