@glodon-aiot/apis 2.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.git.md +73 -0
- package/README.lib.md +135 -0
- package/dist/es/aecpilot/cosntant.mjs +5 -0
- package/dist/es/aecpilot/index.mjs +510 -0
- package/dist/es/aecpilot/model.mjs +9 -0
- package/dist/es/aecpilotui/index.mjs +607 -0
- package/dist/es/agentcliui/index.mjs +418 -0
- package/dist/es/aishop/index.mjs +97 -0
- package/dist/es/aishop/model.mjs +5 -0
- package/dist/es/auth/index.mjs +52 -0
- package/dist/es/base/index.mjs +158 -0
- package/dist/es/contralyze/index.mjs +91 -0
- package/dist/es/cvforce/index.mjs +431 -0
- package/dist/es/cvforce/model.mjs +12 -0
- package/dist/es/cvforce-datahub/index.mjs +435 -0
- package/dist/es/cvforce-datahub/model.mjs +8 -0
- package/dist/es/cvforce-modelservice/index.mjs +114 -0
- package/dist/es/cvforce-modelservice/model.mjs +4 -0
- package/dist/es/index.mjs +62 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
- package/dist/es/panorama/index.mjs +136 -0
- package/dist/es/panorama/model.mjs +5 -0
- package/dist/es/pluginmgr/index.mjs +85 -0
- package/dist/es/user/index.mjs +193 -0
- package/dist/es/utils/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/utils/fetchEventSource/parse.mjs +97 -0
- package/dist/es/utils/index.mjs +9 -0
- package/dist/lib/index.js +3 -0
- package/dist/src/aecpilot/cosntant.d.ts +8 -0
- package/dist/src/aecpilot/index.d.ts +79 -0
- package/dist/src/aecpilot/model.d.ts +350 -0
- package/dist/src/aecpilotui/index.d.ts +72 -0
- package/dist/src/aecpilotui/model.d.ts +63 -0
- package/dist/src/agentcliui/index.d.ts +72 -0
- package/dist/src/agentcliui/model.d.ts +39 -0
- package/dist/src/aishop/index.d.ts +26 -0
- package/dist/src/aishop/model.d.ts +111 -0
- package/dist/src/auth/index.d.ts +17 -0
- package/dist/src/auth/model.d.ts +24 -0
- package/dist/src/base/index.d.ts +41 -0
- package/dist/src/base/model.d.ts +20 -0
- package/dist/src/contralyze/index.d.ts +24 -0
- package/dist/src/contralyze/model.d.ts +75 -0
- package/dist/src/cvforce/index.d.ts +130 -0
- package/dist/src/cvforce/model.d.ts +519 -0
- package/dist/src/cvforce-datahub/index.d.ts +186 -0
- package/dist/src/cvforce-datahub/model.d.ts +438 -0
- package/dist/src/cvforce-modelservice/index.d.ts +23 -0
- package/dist/src/cvforce-modelservice/model.d.ts +156 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/src/panorama/index.d.ts +42 -0
- package/dist/src/panorama/model.d.ts +263 -0
- package/dist/src/pluginmgr/index.d.ts +28 -0
- package/dist/src/pluginmgr/model.d.ts +48 -0
- package/dist/src/user/index.d.ts +42 -0
- package/dist/src/user/model.d.ts +247 -0
- package/dist/src/utils/fetchEventSource/fetch.d.ts +44 -0
- package/dist/src/utils/fetchEventSource/index.d.ts +1 -0
- package/dist/src/utils/fetchEventSource/parse.d.ts +36 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
var s = (o, t, e) => new Promise((a, n) => {
|
|
2
|
+
var p = (r) => {
|
|
3
|
+
try {
|
|
4
|
+
i(e.next(r));
|
|
5
|
+
} catch (c) {
|
|
6
|
+
n(c);
|
|
7
|
+
}
|
|
8
|
+
}, u = (r) => {
|
|
9
|
+
try {
|
|
10
|
+
i(e.throw(r));
|
|
11
|
+
} catch (c) {
|
|
12
|
+
n(c);
|
|
13
|
+
}
|
|
14
|
+
}, i = (r) => r.done ? a(r.value) : Promise.resolve(r.value).then(p, u);
|
|
15
|
+
i((e = e.apply(o, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import d from "axios";
|
|
18
|
+
import { BaseApi as w } from "../base/index.mjs";
|
|
19
|
+
class k extends w {
|
|
20
|
+
constructor(t, e) {
|
|
21
|
+
super(t != null ? t : d.create(), e);
|
|
22
|
+
}
|
|
23
|
+
static parseApiToken(t) {
|
|
24
|
+
const e = window.atob(t.split(".")[1]);
|
|
25
|
+
return JSON.parse(e);
|
|
26
|
+
}
|
|
27
|
+
static loadApiToken(t, e, a) {
|
|
28
|
+
return s(this, null, function* () {
|
|
29
|
+
return fetch(`${t}${e}/viewtoken/${a}/create_apitoken`, {
|
|
30
|
+
method: "POST"
|
|
31
|
+
}).then((n) => {
|
|
32
|
+
if (n.status !== 200)
|
|
33
|
+
throw console.error(n), Error(JSON.stringify(n));
|
|
34
|
+
return n.json();
|
|
35
|
+
}).then((n) => {
|
|
36
|
+
if (n.code !== 200)
|
|
37
|
+
throw Error(JSON.stringify(n));
|
|
38
|
+
return n.data.apiToken;
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
listRecord(t) {
|
|
43
|
+
return s(this, null, function* () {
|
|
44
|
+
return this.listPaged("/spacetwins", t);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
postRecord(t) {
|
|
48
|
+
return s(this, null, function* () {
|
|
49
|
+
return this.post("/spacetwins", t);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
getRecordOverview(t) {
|
|
53
|
+
return s(this, null, function* () {
|
|
54
|
+
return this.get(`/spacetwins/${t}`);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getRecordViewtoken(t) {
|
|
58
|
+
return s(this, null, function* () {
|
|
59
|
+
return this.get(`/spacetwins/${t}/viewtoken`);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
listScene(t) {
|
|
63
|
+
return s(this, null, function* () {
|
|
64
|
+
return this.list(`/spacetwins/${t}/scenes`);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
getScenesByTimestamp(t, e) {
|
|
68
|
+
return s(this, null, function* () {
|
|
69
|
+
return this.list(`/spacetwins/${t}/scenes_timestamp`, {
|
|
70
|
+
timestamp: e
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
recomputeTrack(t, e) {
|
|
75
|
+
return s(this, null, function* () {
|
|
76
|
+
return this.patch(`/spacetwins/${t}/track`, {
|
|
77
|
+
points: e
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
updateRecordUploadStatus(t, e) {
|
|
82
|
+
return s(this, null, function* () {
|
|
83
|
+
return this.post(`/spacetwins/${t}/update_upload_status`, e);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
getApiToken(t) {
|
|
87
|
+
return s(this, null, function* () {
|
|
88
|
+
return this.post(`/viewtoken/${t}/create_apitoken`, {});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getSpacetwins(t) {
|
|
92
|
+
return s(this, null, function* () {
|
|
93
|
+
return this.listPaged("/spacetwins", t);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
postSpacetwins(t) {
|
|
97
|
+
return s(this, null, function* () {
|
|
98
|
+
return this.post("/spacetwins", t);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
updateInspection(t, e) {
|
|
102
|
+
return s(this, null, function* () {
|
|
103
|
+
return this.patch(`/patrolInspection/${t}`, e);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
getSpacetwinsIdViewtoken(t) {
|
|
107
|
+
return s(this, null, function* () {
|
|
108
|
+
return this.get(`/spacetwins/${t}/viewtoken`);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
postSpacetwinsIdUpdateUploadStatus(t, e) {
|
|
112
|
+
return s(this, null, function* () {
|
|
113
|
+
return this.post(`/spacetwins/${t}/update_upload_status`, e);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
postUploadTicket(t) {
|
|
117
|
+
return s(this, null, function* () {
|
|
118
|
+
return this.post("/upload/ticket", t);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
getDownloadUrl(t) {
|
|
122
|
+
return s(this, null, function* () {
|
|
123
|
+
return this.get(`/download/url?isv=${t.isv}&key=${t.key}`);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
listTrack(t, e) {
|
|
127
|
+
return s(this, null, function* () {
|
|
128
|
+
return this.list(`/spacetwins/${t}/track`, {
|
|
129
|
+
type: e
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
k as PanoramaApi
|
|
136
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var i = /* @__PURE__ */ ((l) => (l.Collecting = "采集中", l.CollectionTimeout = "超时", l.CollectionFinish = "完成", l.WaitUpload = "等待上传", l.Uploading = "上传中", l.UploadFinish = "上传完成", l.UploadFailed = "上传失败", l.WaitMerge = "等待合成", l.CreateMergeTaskFailed = "创建合成任务失败", l.Merging = "合成中", l.MergeFailed = "合成失败", l.MergeFinish = "合成成功", l))(i || {}), e = /* @__PURE__ */ ((l) => (l.Collecting = "采集中", l.CollectionTimeout = "超时", l.CollectionFinish = "完成", l.WaitUpload = "等待上传", l.Uploading = "上传中", l.UploadFinish = "上传完成", l.UploadFailed = "上传失败", l.WaitMerge = "等待合成", l.CreateMergeTaskFailed = "创建合成任务失败", l.Merging = "合成中", l.MergeFailed = "合成失败", l.MergeFinish = "合成成功", l))(e || {});
|
|
2
|
+
export {
|
|
3
|
+
e as ISpacetwinStatus,
|
|
4
|
+
i as RecordStatus
|
|
5
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var $ = Object.defineProperty, o = Object.defineProperties;
|
|
2
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var l = Object.getOwnPropertySymbols;
|
|
4
|
+
var m = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var p = (a, t, s) => t in a ? $(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s, h = (a, t) => {
|
|
6
|
+
for (var s in t || (t = {}))
|
|
7
|
+
m.call(t, s) && p(a, s, t[s]);
|
|
8
|
+
if (l)
|
|
9
|
+
for (var s of l(t))
|
|
10
|
+
D.call(t, s) && p(a, s, t[s]);
|
|
11
|
+
return a;
|
|
12
|
+
}, c = (a, t) => o(a, y(t));
|
|
13
|
+
var n = (a, t, s) => new Promise((i, g) => {
|
|
14
|
+
var P = (u) => {
|
|
15
|
+
try {
|
|
16
|
+
r(s.next(u));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
g(e);
|
|
19
|
+
}
|
|
20
|
+
}, d = (u) => {
|
|
21
|
+
try {
|
|
22
|
+
r(s.throw(u));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
g(e);
|
|
25
|
+
}
|
|
26
|
+
}, r = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(P, d);
|
|
27
|
+
r((s = s.apply(a, t)).next());
|
|
28
|
+
});
|
|
29
|
+
import { BaseApi as f } from "../base/index.mjs";
|
|
30
|
+
import A from "axios";
|
|
31
|
+
class N extends f {
|
|
32
|
+
constructor(t, s) {
|
|
33
|
+
super(t != null ? t : A.create(), s);
|
|
34
|
+
}
|
|
35
|
+
listPlugin(t) {
|
|
36
|
+
return n(this, null, function* () {
|
|
37
|
+
return this.list("/plugins", t);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
postPlugin(t) {
|
|
41
|
+
return n(this, null, function* () {
|
|
42
|
+
return this.post("/plugins", t);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getPlugin(t) {
|
|
46
|
+
return n(this, null, function* () {
|
|
47
|
+
return this.get(`/plugins/${t}`);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
updatePlugin(t, s) {
|
|
51
|
+
return n(this, null, function* () {
|
|
52
|
+
return this.patch(`/plugins/${t}`, s);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
listPluginData(t, s) {
|
|
56
|
+
return n(this, null, function* () {
|
|
57
|
+
return this.list(`/plugins/${t}/datas`, s);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
postPluginData(t, s) {
|
|
61
|
+
return n(this, null, function* () {
|
|
62
|
+
return this.post(`/plugins/${t}/datas`, s);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
getPluginData(t, s) {
|
|
66
|
+
return n(this, null, function* () {
|
|
67
|
+
return this.get(`/plugins/${t}/datas/${s}`).then((i) => c(h({}, i), {
|
|
68
|
+
arguments: JSON.parse(i.arguments)
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
updatePluginData(t, s, i) {
|
|
73
|
+
return n(this, null, function* () {
|
|
74
|
+
return this.patch(`/plugins/${t}/datas/${s}`, i);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
deletePluginData(t, s) {
|
|
78
|
+
return n(this, null, function* () {
|
|
79
|
+
return this.delete(`/plugins/${t}/datas/${s}`);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
N as PanoramaPluginMgrApi
|
|
85
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var s = (c, t, e) => new Promise((r, u) => {
|
|
2
|
+
var a = (n) => {
|
|
3
|
+
try {
|
|
4
|
+
i(e.next(n));
|
|
5
|
+
} catch (o) {
|
|
6
|
+
u(o);
|
|
7
|
+
}
|
|
8
|
+
}, g = (n) => {
|
|
9
|
+
try {
|
|
10
|
+
i(e.throw(n));
|
|
11
|
+
} catch (o) {
|
|
12
|
+
u(o);
|
|
13
|
+
}
|
|
14
|
+
}, i = (n) => n.done ? r(n.value) : Promise.resolve(n.value).then(a, g);
|
|
15
|
+
i((e = e.apply(c, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import p from "axios";
|
|
18
|
+
import { BaseApi as h } from "../base/index.mjs";
|
|
19
|
+
class l extends h {
|
|
20
|
+
constructor(t, e) {
|
|
21
|
+
super(t != null ? t : p.create(), e);
|
|
22
|
+
}
|
|
23
|
+
getTenant(t) {
|
|
24
|
+
return s(this, null, function* () {
|
|
25
|
+
return this.get(`/tenant/${t}`);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
listProduct() {
|
|
29
|
+
return s(this, null, function* () {
|
|
30
|
+
return this.list("/products");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
listProvinces() {
|
|
34
|
+
return s(this, null, function* () {
|
|
35
|
+
return this.list("/regions/provinces");
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
listCities(t) {
|
|
39
|
+
return s(this, null, function* () {
|
|
40
|
+
return this.list(`/regions/provinces/${t}/city`);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
listCounties(t, e) {
|
|
44
|
+
return s(this, null, function* () {
|
|
45
|
+
return this.list(`/regions/provinces/${t}/city/${e}/county`);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
getOrgList(t) {
|
|
49
|
+
return s(this, null, function* () {
|
|
50
|
+
return this.list("/org", t);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
getUserIdOrgList(t, e) {
|
|
54
|
+
return s(this, null, function* () {
|
|
55
|
+
return this.list(`/users/${t}/org`, e);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
delOrg(t) {
|
|
59
|
+
return s(this, null, function* () {
|
|
60
|
+
return this.delete(`/org/${t}`);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
postOrg(t) {
|
|
64
|
+
return s(this, null, function* () {
|
|
65
|
+
return this.post("/org", t);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
patchOrg(t, e) {
|
|
69
|
+
return s(this, null, function* () {
|
|
70
|
+
return this.patch(`/org/${t}`, e);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
getUsers(t, e) {
|
|
74
|
+
return s(this, null, function* () {
|
|
75
|
+
return this.list(`/tenant/${t}/users`, e);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
delUser(t, e) {
|
|
79
|
+
return s(this, null, function* () {
|
|
80
|
+
return this.delete(`/tenant/${t}/users/${e}`);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
postUser(t, e) {
|
|
84
|
+
return s(this, null, function* () {
|
|
85
|
+
return this.post(`/tenant/${t}/users`, e);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
patchUser(t, e, r) {
|
|
89
|
+
return s(this, null, function* () {
|
|
90
|
+
return this.patch(`tenant/${t}/users/${e}`, r);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
getTenantList() {
|
|
94
|
+
return s(this, null, function* () {
|
|
95
|
+
return this.get("/tenant");
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
getUserIdRoles(t) {
|
|
99
|
+
return s(this, null, function* () {
|
|
100
|
+
return this.get(`/users/${t}/role`);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
getProductCodeRole(t) {
|
|
104
|
+
return s(this, null, function* () {
|
|
105
|
+
return this.get(`/products/${t}/role`);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
postUserRole(t, e) {
|
|
109
|
+
return s(this, null, function* () {
|
|
110
|
+
return this.post(`/users/${t}/role`, e);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
patchUserRole(t, e, r) {
|
|
114
|
+
return s(this, null, function* () {
|
|
115
|
+
return this.patch(`/users/${t}/role/${e}`, r);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
deleteUserRole(t, e) {
|
|
119
|
+
return s(this, null, function* () {
|
|
120
|
+
return this.delete(`/users/${t}/role/${e}`);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
getUsersIdProductCodeMenu(t, e, r = "web", u) {
|
|
124
|
+
return s(this, null, function* () {
|
|
125
|
+
return this.get(`/users/${t}/product/${e}/menu?groupCode=${r}`, {
|
|
126
|
+
level: u
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
getUserInfo(t) {
|
|
131
|
+
return s(this, null, function* () {
|
|
132
|
+
return this.get(`/users/${t}`);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
uipermission(t, e, r = "web") {
|
|
136
|
+
return s(this, null, function* () {
|
|
137
|
+
return this.get(`/users/${t}/product/${e}/uipermission?groupCode=${r}`);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
getAppInfo(t) {
|
|
141
|
+
return s(this, null, function* () {
|
|
142
|
+
return this.get(`/products/${t}/apps`);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
getTenantUserInfo(t, e) {
|
|
146
|
+
return s(this, null, function* () {
|
|
147
|
+
return this.get(`/tenant/${t}/users/${e}`);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
uploadFile(t) {
|
|
151
|
+
return s(this, null, function* () {
|
|
152
|
+
return this.upload("/upload", t);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
getUserIdProductCodeOrg(t, e) {
|
|
156
|
+
return s(this, null, function* () {
|
|
157
|
+
return this.get(`/users/${t}/product/${e}/org`);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
getOrg(t) {
|
|
161
|
+
return s(this, null, function* () {
|
|
162
|
+
return this.get(`/org/${t}`);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
getUploadTicket(t) {
|
|
166
|
+
return s(this, null, function* () {
|
|
167
|
+
return this.get("/upload/ticket", t);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
putAppInfo(t, e) {
|
|
171
|
+
return s(this, null, function* () {
|
|
172
|
+
return this.put(`/products/${t}/apps`, e);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
getTenantKeySecret(t) {
|
|
176
|
+
return s(this, null, function* () {
|
|
177
|
+
return this.get(`/tenant/${t}/key`);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
resetTenantKeySecret(t) {
|
|
181
|
+
return s(this, null, function* () {
|
|
182
|
+
return this.post(`/tenant/${t}/resetSecret`, void 0);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
getProductsCode(t) {
|
|
186
|
+
return s(this, null, function* () {
|
|
187
|
+
return this.get(`/products/${t}`);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
l as DataApi
|
|
193
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var W = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var k = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var v = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var I = (t, e, a) => e in t ? W(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a, E = (t, e) => {
|
|
6
|
+
for (var a in e || (e = {}))
|
|
7
|
+
A.call(e, a) && I(t, a, e[a]);
|
|
8
|
+
if (v)
|
|
9
|
+
for (var a of v(e))
|
|
10
|
+
R.call(e, a) && I(t, a, e[a]);
|
|
11
|
+
return t;
|
|
12
|
+
}, $ = (t, e) => j(t, k(e));
|
|
13
|
+
var q = (t, e) => {
|
|
14
|
+
var a = {};
|
|
15
|
+
for (var n in t)
|
|
16
|
+
A.call(t, n) && e.indexOf(n) < 0 && (a[n] = t[n]);
|
|
17
|
+
if (t != null && v)
|
|
18
|
+
for (var n of v(t))
|
|
19
|
+
e.indexOf(n) < 0 && R.call(t, n) && (a[n] = t[n]);
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var B = (t, e, a) => new Promise((n, w) => {
|
|
23
|
+
var o = (r) => {
|
|
24
|
+
try {
|
|
25
|
+
c(a.next(r));
|
|
26
|
+
} catch (d) {
|
|
27
|
+
w(d);
|
|
28
|
+
}
|
|
29
|
+
}, i = (r) => {
|
|
30
|
+
try {
|
|
31
|
+
c(a.throw(r));
|
|
32
|
+
} catch (d) {
|
|
33
|
+
w(d);
|
|
34
|
+
}
|
|
35
|
+
}, c = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(o, i);
|
|
36
|
+
c((a = a.apply(t, e)).next());
|
|
37
|
+
});
|
|
38
|
+
import { getBytes as z, getLines as G, getMessages as H } from "./parse.mjs";
|
|
39
|
+
const g = "text/event-stream", J = 1e3, D = "last-event-id";
|
|
40
|
+
function X(t, N) {
|
|
41
|
+
var u = N, {
|
|
42
|
+
signal: e,
|
|
43
|
+
headers: a,
|
|
44
|
+
onopen: n,
|
|
45
|
+
onmessage: w,
|
|
46
|
+
onclose: o,
|
|
47
|
+
onerror: i,
|
|
48
|
+
openWhenHidden: c,
|
|
49
|
+
fetch: r
|
|
50
|
+
} = u, d = q(u, [
|
|
51
|
+
"signal",
|
|
52
|
+
"headers",
|
|
53
|
+
"onopen",
|
|
54
|
+
"onmessage",
|
|
55
|
+
"onclose",
|
|
56
|
+
"onerror",
|
|
57
|
+
"openWhenHidden",
|
|
58
|
+
"fetch"
|
|
59
|
+
]);
|
|
60
|
+
return new Promise((L, M) => {
|
|
61
|
+
const f = E({}, a);
|
|
62
|
+
f.accept || (f.accept = g);
|
|
63
|
+
let l;
|
|
64
|
+
function C() {
|
|
65
|
+
l.abort(), document.hidden || b();
|
|
66
|
+
}
|
|
67
|
+
c || document.addEventListener("visibilitychange", C);
|
|
68
|
+
let T = J, y = 0;
|
|
69
|
+
function h() {
|
|
70
|
+
document.removeEventListener("visibilitychange", C), window.clearTimeout(y), l.abort();
|
|
71
|
+
}
|
|
72
|
+
e == null || e.addEventListener("abort", () => {
|
|
73
|
+
h(), L();
|
|
74
|
+
});
|
|
75
|
+
const P = r != null ? r : window.fetch, V = n != null ? n : K;
|
|
76
|
+
function b() {
|
|
77
|
+
return B(this, null, function* () {
|
|
78
|
+
var x;
|
|
79
|
+
l = new AbortController();
|
|
80
|
+
try {
|
|
81
|
+
const m = yield P(t, $(E({}, d), {
|
|
82
|
+
headers: f,
|
|
83
|
+
signal: l.signal
|
|
84
|
+
}));
|
|
85
|
+
yield V(m), yield z(m.body, G(H((s) => {
|
|
86
|
+
s ? f[D] = s : delete f[D];
|
|
87
|
+
}, (s) => {
|
|
88
|
+
T = s;
|
|
89
|
+
}, w))), o == null || o(), h(), L();
|
|
90
|
+
} catch (m) {
|
|
91
|
+
if (!l.signal.aborted)
|
|
92
|
+
try {
|
|
93
|
+
const s = (x = i == null ? void 0 : i(m)) != null ? x : T;
|
|
94
|
+
window.clearTimeout(y), y = window.setTimeout(b, s);
|
|
95
|
+
} catch (s) {
|
|
96
|
+
h(), M(s);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
b();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function K(t) {
|
|
105
|
+
const e = t.headers.get("content-type");
|
|
106
|
+
if (!(e != null && e.startsWith(g)))
|
|
107
|
+
throw new Error(`Expected content-type to be ${g}, Actual: ${e}`);
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
g as EventStreamContentType,
|
|
111
|
+
X as fetchEventSource
|
|
112
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var b = (s, t, e) => new Promise((a, c) => {
|
|
2
|
+
var f = (r) => {
|
|
3
|
+
try {
|
|
4
|
+
i(e.next(r));
|
|
5
|
+
} catch (n) {
|
|
6
|
+
c(n);
|
|
7
|
+
}
|
|
8
|
+
}, l = (r) => {
|
|
9
|
+
try {
|
|
10
|
+
i(e.throw(r));
|
|
11
|
+
} catch (n) {
|
|
12
|
+
c(n);
|
|
13
|
+
}
|
|
14
|
+
}, i = (r) => r.done ? a(r.value) : Promise.resolve(r.value).then(f, l);
|
|
15
|
+
i((e = e.apply(s, t)).next());
|
|
16
|
+
});
|
|
17
|
+
function w(s, t) {
|
|
18
|
+
return b(this, null, function* () {
|
|
19
|
+
const e = s.getReader();
|
|
20
|
+
let a;
|
|
21
|
+
for (; !(a = yield e.read()).done; )
|
|
22
|
+
t(a.value);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function g(s) {
|
|
26
|
+
let t, e, a, c = !1, f;
|
|
27
|
+
return function(i) {
|
|
28
|
+
t === void 0 ? (t = i, e = 0, a = -1, f = !1) : t = h(t, i);
|
|
29
|
+
const r = t.length;
|
|
30
|
+
let n = 0;
|
|
31
|
+
for (; e < r; ) {
|
|
32
|
+
c && (t[e] === 10 && (n = ++e), c = !1);
|
|
33
|
+
let o = -1;
|
|
34
|
+
for (; e < r && o === -1; ++e)
|
|
35
|
+
switch (t[e]) {
|
|
36
|
+
case 58:
|
|
37
|
+
a === -1 && (a = e - n);
|
|
38
|
+
break;
|
|
39
|
+
case 13:
|
|
40
|
+
c = !1, e + 4 < r && t[e + 1] === 10 && t[e + 2] !== 13 && t[e - 1] !== 10 && t[e - 2] !== 13 && (f = !0);
|
|
41
|
+
case 10:
|
|
42
|
+
o = e;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
if (o === -1)
|
|
46
|
+
break;
|
|
47
|
+
s(t.subarray(n, o), a, f), n = e, a = -1, f = !1;
|
|
48
|
+
}
|
|
49
|
+
n === r ? t = void 0 : n !== 0 && (t = t.subarray(n), e -= n);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function k(s, t, e) {
|
|
53
|
+
let a = y();
|
|
54
|
+
const c = new TextDecoder();
|
|
55
|
+
return function(l, i, r) {
|
|
56
|
+
if (l.length === 0)
|
|
57
|
+
e == null || e(a), a = y();
|
|
58
|
+
else if (i > 0) {
|
|
59
|
+
const n = c.decode(l.subarray(0, i)), o = i + (l[i + 1] === 32 ? 2 : 1);
|
|
60
|
+
let d = c.decode(l.subarray(o));
|
|
61
|
+
switch (r && (d += `
|
|
62
|
+
`), n) {
|
|
63
|
+
case "data":
|
|
64
|
+
a.data = a.data ? a.data + `
|
|
65
|
+
` + d : d;
|
|
66
|
+
break;
|
|
67
|
+
case "event":
|
|
68
|
+
a.event = d;
|
|
69
|
+
break;
|
|
70
|
+
case "id":
|
|
71
|
+
s(a.id = d);
|
|
72
|
+
break;
|
|
73
|
+
case "retry":
|
|
74
|
+
const u = parseInt(d, 10);
|
|
75
|
+
isNaN(u) || t(a.retry = u);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function h(s, t) {
|
|
82
|
+
const e = new Uint8Array(s.length + t.length);
|
|
83
|
+
return e.set(s), e.set(t, s.length), e;
|
|
84
|
+
}
|
|
85
|
+
function y() {
|
|
86
|
+
return {
|
|
87
|
+
data: "",
|
|
88
|
+
event: "",
|
|
89
|
+
id: "",
|
|
90
|
+
retry: void 0
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
w as getBytes,
|
|
95
|
+
g as getLines,
|
|
96
|
+
k as getMessages
|
|
97
|
+
};
|