@formant/data-sdk 1.6.0 → 1.8.0
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/dist/data-sdk.cjs.js +2 -2
- package/dist/data-sdk.cjs.js.map +1 -1
- package/dist/data-sdk.es.js +140 -105
- package/dist/data-sdk.es.js.map +1 -1
- package/dist/data-sdk.es6.js +37 -2
- package/dist/data-sdk.umd.js +2 -2
- package/dist/types/data-sdk/src/KeyValue.d.ts +3 -2
- package/dist/types/data-sdk/src/api/disableDevice.d.ts +2 -0
- package/dist/types/data-sdk/src/devices/Device.d.ts +2 -0
- package/dist/types/data-sdk/src/main.d.ts +1 -0
- package/package.json +1 -1
package/dist/data-sdk.es.js
CHANGED
|
@@ -364,7 +364,7 @@ function Pe(a) {
|
|
|
364
364
|
};
|
|
365
365
|
return window.addEventListener("message", t), () => window.removeEventListener("message", t);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function je(a) {
|
|
368
368
|
T({ type: "request_devices" });
|
|
369
369
|
const e = (t) => {
|
|
370
370
|
const n = t.data;
|
|
@@ -372,8 +372,8 @@ function Ne(a) {
|
|
|
372
372
|
};
|
|
373
373
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
millisecond:
|
|
375
|
+
const Ne = 1, W = 1e3, G = 60 * W, H = 60 * G, I = 24 * H, Ie = 7 * I, Le = 30 * I, _e = 365 * I, L = {
|
|
376
|
+
millisecond: Ne,
|
|
377
377
|
second: W,
|
|
378
378
|
minute: G,
|
|
379
379
|
hour: H,
|
|
@@ -460,7 +460,7 @@ async function _(a) {
|
|
|
460
460
|
}
|
|
461
461
|
})).json()).items;
|
|
462
462
|
}
|
|
463
|
-
class
|
|
463
|
+
class Be {
|
|
464
464
|
constructor() {
|
|
465
465
|
s(this, "queryStoreCache", new x({
|
|
466
466
|
capacity: 1e4,
|
|
@@ -508,14 +508,14 @@ class Me {
|
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const Me = new Be();
|
|
512
512
|
function qe(a, e, t) {
|
|
513
513
|
const n = (i) => {
|
|
514
514
|
const r = i.data;
|
|
515
515
|
if (r.type === "module_data") {
|
|
516
516
|
const { start: c, end: d } = r.queryRange;
|
|
517
517
|
t(
|
|
518
|
-
|
|
518
|
+
Me.moduleQuery(
|
|
519
519
|
{},
|
|
520
520
|
a,
|
|
521
521
|
e,
|
|
@@ -610,7 +610,7 @@ const q = class {
|
|
|
610
610
|
let y = q;
|
|
611
611
|
s(y, "getCurrentModuleContext", k), // senders
|
|
612
612
|
s(y, "disableAnalyticsBottomBar", ve), s(y, "goToDevice", Te), s(y, "goToTime", Ce), s(y, "refreshAuthToken", V), s(y, "requestModuleData", Se), s(y, "sendChannelData", Ee), s(y, "setModuleDateTimeRange", ke), s(y, "setupModuleMenus", Oe), s(y, "showMessage", Re), // listeners
|
|
613
|
-
s(y, "addAccessTokenRefreshListener", F), s(y, "addChannelDataListener", be), s(y, "addMenuListener", Ae), s(y, "addModuleConfigurationListener", De), s(y, "addModuleDataListener", Pe), s(y, "addOverviewDeviceListener",
|
|
613
|
+
s(y, "addAccessTokenRefreshListener", F), s(y, "addChannelDataListener", be), s(y, "addMenuListener", Ae), s(y, "addModuleConfigurationListener", De), s(y, "addModuleDataListener", Pe), s(y, "addOverviewDeviceListener", je), s(y, "addStreamListener", qe), // bidirectional
|
|
614
614
|
s(y, "getDate", xe), s(y, "prompt", Ue), s(y, "_isOnline", null);
|
|
615
615
|
function f(a, e) {
|
|
616
616
|
if (a !== void 0)
|
|
@@ -622,7 +622,7 @@ const g = {
|
|
|
622
622
|
TELEOP: 1,
|
|
623
623
|
PORT_FORWARD: 2,
|
|
624
624
|
OBSERVE: 3
|
|
625
|
-
},
|
|
625
|
+
}, Ht = {
|
|
626
626
|
...g,
|
|
627
627
|
Unknown: g.UNKNOWN,
|
|
628
628
|
Teleop: g.TELEOP,
|
|
@@ -633,10 +633,10 @@ const g = {
|
|
|
633
633
|
portForward: g.PORT_FORWARD,
|
|
634
634
|
observe: g.OBSERVE
|
|
635
635
|
}, O = Symbol("RtcClientPool.instance");
|
|
636
|
-
var
|
|
637
|
-
class
|
|
636
|
+
var qt;
|
|
637
|
+
class j {
|
|
638
638
|
constructor(e) {
|
|
639
|
-
s(this,
|
|
639
|
+
s(this, qt, null);
|
|
640
640
|
s(this, "createClient");
|
|
641
641
|
s(this, "ttlMs");
|
|
642
642
|
s(this, "proxyHandler");
|
|
@@ -691,40 +691,40 @@ class N {
|
|
|
691
691
|
}, this.ttlMs)), !0) : (console.warn("this instance has already been released!"), !1);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
[g.UNKNOWN]: new
|
|
694
|
+
qt = O;
|
|
695
|
+
const N = async () => f(o.token, "Realtime when user isn't authorized"), R = {
|
|
696
|
+
[g.UNKNOWN]: new j({
|
|
697
697
|
ttlMs: 2500,
|
|
698
698
|
createClient: (a) => new D({
|
|
699
699
|
signalingClient: new P(h),
|
|
700
|
-
getToken:
|
|
700
|
+
getToken: N,
|
|
701
701
|
sessionType: g.UNKNOWN,
|
|
702
702
|
receive: a
|
|
703
703
|
})
|
|
704
704
|
}),
|
|
705
|
-
[g.TELEOP]: new
|
|
705
|
+
[g.TELEOP]: new j({
|
|
706
706
|
ttlMs: 2500,
|
|
707
707
|
createClient: (a) => new D({
|
|
708
708
|
signalingClient: new P(h),
|
|
709
|
-
getToken:
|
|
709
|
+
getToken: N,
|
|
710
710
|
sessionType: g.TELEOP,
|
|
711
711
|
receive: a
|
|
712
712
|
})
|
|
713
713
|
}),
|
|
714
|
-
[g.PORT_FORWARD]: new
|
|
714
|
+
[g.PORT_FORWARD]: new j({
|
|
715
715
|
ttlMs: 2500,
|
|
716
716
|
createClient: (a) => new D({
|
|
717
717
|
signalingClient: new P(h),
|
|
718
|
-
getToken:
|
|
718
|
+
getToken: N,
|
|
719
719
|
sessionType: g.PORT_FORWARD,
|
|
720
720
|
receive: a
|
|
721
721
|
})
|
|
722
722
|
}),
|
|
723
|
-
[g.OBSERVE]: new
|
|
723
|
+
[g.OBSERVE]: new j({
|
|
724
724
|
ttlMs: 2500,
|
|
725
725
|
createClient: (a) => new D({
|
|
726
726
|
signalingClient: new P(h),
|
|
727
|
-
getToken:
|
|
727
|
+
getToken: N,
|
|
728
728
|
sessionType: g.OBSERVE,
|
|
729
729
|
receive: a
|
|
730
730
|
})
|
|
@@ -1259,7 +1259,7 @@ async function Y(a, e) {
|
|
|
1259
1259
|
viewId: n[0].id
|
|
1260
1260
|
})}`;
|
|
1261
1261
|
}
|
|
1262
|
-
const
|
|
1262
|
+
const Kt = [
|
|
1263
1263
|
"day",
|
|
1264
1264
|
"week",
|
|
1265
1265
|
"month",
|
|
@@ -1267,7 +1267,7 @@ const Ht = [
|
|
|
1267
1267
|
"hour",
|
|
1268
1268
|
"minute",
|
|
1269
1269
|
"quarter"
|
|
1270
|
-
],
|
|
1270
|
+
], Qt = [
|
|
1271
1271
|
"interval",
|
|
1272
1272
|
"start",
|
|
1273
1273
|
"end",
|
|
@@ -1295,7 +1295,7 @@ function it(a) {
|
|
|
1295
1295
|
function ot(a) {
|
|
1296
1296
|
return a.count;
|
|
1297
1297
|
}
|
|
1298
|
-
const
|
|
1298
|
+
const Xt = {
|
|
1299
1299
|
min: nt,
|
|
1300
1300
|
max: tt,
|
|
1301
1301
|
"standard deviation": et,
|
|
@@ -1394,7 +1394,7 @@ async function ee(a, e, t, n, i) {
|
|
|
1394
1394
|
})
|
|
1395
1395
|
);
|
|
1396
1396
|
}
|
|
1397
|
-
async function
|
|
1397
|
+
async function B(a, e) {
|
|
1398
1398
|
return (await z({
|
|
1399
1399
|
...a,
|
|
1400
1400
|
eventTypes: ["annotation"]
|
|
@@ -1411,7 +1411,7 @@ async function te(a, e, t) {
|
|
|
1411
1411
|
end: new Date(n)
|
|
1412
1412
|
}), d = c.map((m, w) => {
|
|
1413
1413
|
const v = new Date(m).toISOString(), C = w === c.length - 1 ? new Date(Date.now()).toISOString() : new Date(c[w + 1]);
|
|
1414
|
-
return
|
|
1414
|
+
return B(
|
|
1415
1415
|
{
|
|
1416
1416
|
...a,
|
|
1417
1417
|
start: v,
|
|
@@ -1512,7 +1512,21 @@ async function ht(a) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
})).json()).items;
|
|
1514
1514
|
}
|
|
1515
|
-
|
|
1515
|
+
async function lt(a) {
|
|
1516
|
+
if (!o.token)
|
|
1517
|
+
throw new Error("Not authenticated");
|
|
1518
|
+
return await (await fetch(
|
|
1519
|
+
`${h}/v1/admin/devices/${a}/disable`,
|
|
1520
|
+
{
|
|
1521
|
+
method: "POST",
|
|
1522
|
+
headers: {
|
|
1523
|
+
"Content-Type": "application/json",
|
|
1524
|
+
Authorization: "Bearer " + o.token
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
)).json();
|
|
1528
|
+
}
|
|
1529
|
+
class S extends Q {
|
|
1516
1530
|
constructor(e, t, n, i) {
|
|
1517
1531
|
super(), this.id = e, this.name = t, this.organizationId = n, this.tags = i;
|
|
1518
1532
|
}
|
|
@@ -1821,7 +1835,7 @@ class E extends Q {
|
|
|
1821
1835
|
)).json();
|
|
1822
1836
|
}
|
|
1823
1837
|
async getAnnotationCount(e, t) {
|
|
1824
|
-
return await
|
|
1838
|
+
return await B({ ...e, deviceIds: [this.id] }, t);
|
|
1825
1839
|
}
|
|
1826
1840
|
async getAnnotationCountByIntervals(e, t, n) {
|
|
1827
1841
|
return await te(
|
|
@@ -1840,8 +1854,8 @@ class E extends Q {
|
|
|
1840
1854
|
return e.scope.deviceIds = [this.id], await Y(e, t);
|
|
1841
1855
|
}
|
|
1842
1856
|
}
|
|
1843
|
-
s(
|
|
1844
|
-
class
|
|
1857
|
+
s(S, "createDevice", st), s(S, "patchDevice", ct), s(S, "getDevicesData", dt), s(S, "queryDevicesData", ht), s(S, "disableDevice", lt);
|
|
1858
|
+
class ut extends Q {
|
|
1845
1859
|
constructor(t) {
|
|
1846
1860
|
super();
|
|
1847
1861
|
s(this, "id");
|
|
@@ -1962,7 +1976,7 @@ class lt extends Q {
|
|
|
1962
1976
|
});
|
|
1963
1977
|
}
|
|
1964
1978
|
}
|
|
1965
|
-
async function
|
|
1979
|
+
async function mt(a, e) {
|
|
1966
1980
|
if (!o.token)
|
|
1967
1981
|
throw new Error("Not authenticated");
|
|
1968
1982
|
return await (await fetch(`${h}/v1/admin/devices/${a}`, {
|
|
@@ -1974,7 +1988,7 @@ async function ut(a, e) {
|
|
|
1974
1988
|
}
|
|
1975
1989
|
})).json();
|
|
1976
1990
|
}
|
|
1977
|
-
async function
|
|
1991
|
+
async function ft(a) {
|
|
1978
1992
|
if (!o.token)
|
|
1979
1993
|
throw new Error("Not authenticated");
|
|
1980
1994
|
return (await (await fetch(`${h}/v1/queries/queries`, {
|
|
@@ -1986,7 +2000,7 @@ async function mt(a) {
|
|
|
1986
2000
|
}
|
|
1987
2001
|
})).json()).aggregates;
|
|
1988
2002
|
}
|
|
1989
|
-
async function
|
|
2003
|
+
async function wt(a) {
|
|
1990
2004
|
if (!o.token)
|
|
1991
2005
|
throw new Error("Not authenticated");
|
|
1992
2006
|
await fetch(`${h}/v1/admin/fleets/${a}`, {
|
|
@@ -1997,7 +2011,7 @@ async function ft(a) {
|
|
|
1997
2011
|
}
|
|
1998
2012
|
});
|
|
1999
2013
|
}
|
|
2000
|
-
async function
|
|
2014
|
+
async function pt() {
|
|
2001
2015
|
if (!o.token)
|
|
2002
2016
|
throw new Error("Not authenticated");
|
|
2003
2017
|
return (await (await fetch(
|
|
@@ -2011,7 +2025,7 @@ async function wt() {
|
|
|
2011
2025
|
}
|
|
2012
2026
|
)).json()).items;
|
|
2013
2027
|
}
|
|
2014
|
-
async function
|
|
2028
|
+
async function yt() {
|
|
2015
2029
|
if (!o.token)
|
|
2016
2030
|
throw new Error("Not authenticated");
|
|
2017
2031
|
return (await (await fetch(
|
|
@@ -2025,7 +2039,7 @@ async function pt() {
|
|
|
2025
2039
|
}
|
|
2026
2040
|
)).json()).items;
|
|
2027
2041
|
}
|
|
2028
|
-
async function
|
|
2042
|
+
async function gt(a) {
|
|
2029
2043
|
if (!o.token)
|
|
2030
2044
|
throw new Error("Not authenticated");
|
|
2031
2045
|
return await (await fetch(`${h}/v1/queries/analytics/rows`, {
|
|
@@ -2048,10 +2062,10 @@ async function oe(a) {
|
|
|
2048
2062
|
Authorization: "Bearer " + o.token
|
|
2049
2063
|
}
|
|
2050
2064
|
})).json()).items.map(
|
|
2051
|
-
(n) => new
|
|
2065
|
+
(n) => new S(n.id, n.name, n.organizationId, n.tags)
|
|
2052
2066
|
);
|
|
2053
2067
|
}
|
|
2054
|
-
async function
|
|
2068
|
+
async function vt() {
|
|
2055
2069
|
if (!o.token)
|
|
2056
2070
|
throw new Error("Not authenticated");
|
|
2057
2071
|
let a = new URLSearchParams("");
|
|
@@ -2074,7 +2088,7 @@ async function gt() {
|
|
|
2074
2088
|
type: "default"
|
|
2075
2089
|
});
|
|
2076
2090
|
}
|
|
2077
|
-
async function
|
|
2091
|
+
async function Tt(a) {
|
|
2078
2092
|
if (!o.token)
|
|
2079
2093
|
throw new Error("Not authenticated");
|
|
2080
2094
|
const t = await (await fetch(`${h}/v1/admin/devices/${a}`, {
|
|
@@ -2084,9 +2098,9 @@ async function vt(a) {
|
|
|
2084
2098
|
Authorization: "Bearer " + o.token
|
|
2085
2099
|
}
|
|
2086
2100
|
})).json(), n = t.name;
|
|
2087
|
-
return new
|
|
2101
|
+
return new S(a, n, t.organizationId, t.tags);
|
|
2088
2102
|
}
|
|
2089
|
-
async function
|
|
2103
|
+
async function M() {
|
|
2090
2104
|
if (!o.token)
|
|
2091
2105
|
throw new Error("Not authenticated");
|
|
2092
2106
|
const e = await (await fetch(`${h}/v1/admin/device-details/query`, {
|
|
@@ -2098,7 +2112,7 @@ async function B() {
|
|
|
2098
2112
|
}
|
|
2099
2113
|
})).json();
|
|
2100
2114
|
return e.items, e.items.map(
|
|
2101
|
-
(t) => new
|
|
2115
|
+
(t) => new S(
|
|
2102
2116
|
t.id,
|
|
2103
2117
|
t.name,
|
|
2104
2118
|
t.organizationId,
|
|
@@ -2106,7 +2120,7 @@ async function B() {
|
|
|
2106
2120
|
)
|
|
2107
2121
|
);
|
|
2108
2122
|
}
|
|
2109
|
-
async function
|
|
2123
|
+
async function Ct(a) {
|
|
2110
2124
|
if (!o.token)
|
|
2111
2125
|
throw new Error("Not authenticated");
|
|
2112
2126
|
return (await (await fetch(
|
|
@@ -2120,7 +2134,7 @@ async function Tt(a) {
|
|
|
2120
2134
|
}
|
|
2121
2135
|
)).json()).items;
|
|
2122
2136
|
}
|
|
2123
|
-
async function
|
|
2137
|
+
async function St(a) {
|
|
2124
2138
|
const t = await (await fetch(`${h}/v1/admin/files/query`, {
|
|
2125
2139
|
method: "POST",
|
|
2126
2140
|
body: JSON.stringify({
|
|
@@ -2135,7 +2149,7 @@ async function Ct(a) {
|
|
|
2135
2149
|
throw new Error("File not found");
|
|
2136
2150
|
return t.fileUrls[0];
|
|
2137
2151
|
}
|
|
2138
|
-
async function
|
|
2152
|
+
async function Et(a) {
|
|
2139
2153
|
if (!o.token)
|
|
2140
2154
|
throw new Error("Not authenticated");
|
|
2141
2155
|
return await (await fetch(`${h}/v1/admin/fleets/${a}`, {
|
|
@@ -2146,7 +2160,7 @@ async function St(a) {
|
|
|
2146
2160
|
}
|
|
2147
2161
|
})).json();
|
|
2148
2162
|
}
|
|
2149
|
-
async function
|
|
2163
|
+
async function kt(a) {
|
|
2150
2164
|
if (!o.token)
|
|
2151
2165
|
throw new Error("Not authenticated");
|
|
2152
2166
|
return (await (await fetch(`${h}/v1/admin/fleets/${a}/devices`, {
|
|
@@ -2157,7 +2171,7 @@ async function Et(a) {
|
|
|
2157
2171
|
}
|
|
2158
2172
|
})).json()).items;
|
|
2159
2173
|
}
|
|
2160
|
-
async function
|
|
2174
|
+
async function Ot() {
|
|
2161
2175
|
if (!o.token)
|
|
2162
2176
|
throw new Error("Not authenticated");
|
|
2163
2177
|
return (await (await fetch(
|
|
@@ -2171,7 +2185,7 @@ async function kt() {
|
|
|
2171
2185
|
}
|
|
2172
2186
|
)).json()).items;
|
|
2173
2187
|
}
|
|
2174
|
-
async function
|
|
2188
|
+
async function Rt(...a) {
|
|
2175
2189
|
const e = a.flat().filter((i) => !!i);
|
|
2176
2190
|
return e.length === 0 ? [] : (await (await fetch(
|
|
2177
2191
|
`${h}/v1/queries/stream-current-value`,
|
|
@@ -2187,7 +2201,7 @@ async function Ot(...a) {
|
|
|
2187
2201
|
}
|
|
2188
2202
|
)).json()).items;
|
|
2189
2203
|
}
|
|
2190
|
-
async function
|
|
2204
|
+
async function bt() {
|
|
2191
2205
|
if (!o.token)
|
|
2192
2206
|
throw new Error("Not authenticated");
|
|
2193
2207
|
const t = (await (await fetch(`${h}/v1/queries/online-devices`, {
|
|
@@ -2197,9 +2211,9 @@ async function Rt() {
|
|
|
2197
2211
|
Authorization: "Bearer " + o.token
|
|
2198
2212
|
}
|
|
2199
2213
|
})).json()).items;
|
|
2200
|
-
return (await
|
|
2214
|
+
return (await M()).filter((i) => t.includes(i.id));
|
|
2201
2215
|
}
|
|
2202
|
-
async function
|
|
2216
|
+
async function At() {
|
|
2203
2217
|
if (!o.token)
|
|
2204
2218
|
throw new Error("Not authenticated");
|
|
2205
2219
|
const t = (await (await fetch(`${h}/v1/signaling/peers`, {
|
|
@@ -2211,9 +2225,9 @@ async function bt() {
|
|
|
2211
2225
|
})).json()).items.map(
|
|
2212
2226
|
(i) => i.deviceId
|
|
2213
2227
|
);
|
|
2214
|
-
return (await
|
|
2228
|
+
return (await M()).filter((i) => t.includes(i.id));
|
|
2215
2229
|
}
|
|
2216
|
-
async function
|
|
2230
|
+
async function Dt() {
|
|
2217
2231
|
if (!o.token)
|
|
2218
2232
|
throw new Error("Not authenticated");
|
|
2219
2233
|
return (await (await fetch(`${h}/v1/admin/streams`, {
|
|
@@ -2226,7 +2240,7 @@ async function At() {
|
|
|
2226
2240
|
(t) => t.enabled
|
|
2227
2241
|
);
|
|
2228
2242
|
}
|
|
2229
|
-
async function
|
|
2243
|
+
async function Pt(a) {
|
|
2230
2244
|
if (!o.token)
|
|
2231
2245
|
throw new Error("Not authenticated");
|
|
2232
2246
|
return await (await fetch(
|
|
@@ -2241,7 +2255,7 @@ async function Dt(a) {
|
|
|
2241
2255
|
}
|
|
2242
2256
|
)).json();
|
|
2243
2257
|
}
|
|
2244
|
-
async function
|
|
2258
|
+
async function jt() {
|
|
2245
2259
|
if (!o.token)
|
|
2246
2260
|
throw new Error("Not authenticated");
|
|
2247
2261
|
return (await (await fetch(
|
|
@@ -2266,7 +2280,7 @@ async function Nt() {
|
|
|
2266
2280
|
}
|
|
2267
2281
|
})).json()).items;
|
|
2268
2282
|
}
|
|
2269
|
-
async function
|
|
2283
|
+
async function It(a, e) {
|
|
2270
2284
|
if (!o.token)
|
|
2271
2285
|
throw new Error("Not authenticated");
|
|
2272
2286
|
return await (await fetch(`${h}/v1/admin/fleets/${a}`, {
|
|
@@ -2278,7 +2292,7 @@ async function jt(a, e) {
|
|
|
2278
2292
|
}
|
|
2279
2293
|
})).json();
|
|
2280
2294
|
}
|
|
2281
|
-
async function
|
|
2295
|
+
async function Lt(a) {
|
|
2282
2296
|
if (!o.token)
|
|
2283
2297
|
throw new Error("Not authenticated");
|
|
2284
2298
|
return await (await fetch(
|
|
@@ -2293,7 +2307,7 @@ async function It(a) {
|
|
|
2293
2307
|
}
|
|
2294
2308
|
)).json();
|
|
2295
2309
|
}
|
|
2296
|
-
async function
|
|
2310
|
+
async function _t(a) {
|
|
2297
2311
|
if (!o.token)
|
|
2298
2312
|
throw new Error("Not authenticated");
|
|
2299
2313
|
return await (await fetch(`${h}/v1/admin/views/${a.id}`, {
|
|
@@ -2305,7 +2319,7 @@ async function Lt(a) {
|
|
|
2305
2319
|
}
|
|
2306
2320
|
})).json();
|
|
2307
2321
|
}
|
|
2308
|
-
async function
|
|
2322
|
+
async function $t(a) {
|
|
2309
2323
|
if (!o.token)
|
|
2310
2324
|
throw new Error("Not authenticated");
|
|
2311
2325
|
return await (await fetch(`${h}/v1/queries/analytics`, {
|
|
@@ -2317,7 +2331,7 @@ async function _t(a) {
|
|
|
2317
2331
|
}
|
|
2318
2332
|
})).json();
|
|
2319
2333
|
}
|
|
2320
|
-
async function
|
|
2334
|
+
async function zt(a) {
|
|
2321
2335
|
if (!o.token)
|
|
2322
2336
|
throw new Error("Not authenticated");
|
|
2323
2337
|
return await (await fetch(`${h}/v1/admin/fleets`, {
|
|
@@ -2329,14 +2343,14 @@ async function $t(a) {
|
|
|
2329
2343
|
}
|
|
2330
2344
|
})).json();
|
|
2331
2345
|
}
|
|
2332
|
-
const
|
|
2346
|
+
const E = class {
|
|
2333
2347
|
static async setDefaultDevice(e) {
|
|
2334
|
-
|
|
2348
|
+
E.defaultDeviceId = e;
|
|
2335
2349
|
}
|
|
2336
2350
|
static async getCurrentDevice() {
|
|
2337
2351
|
if (!o.token)
|
|
2338
2352
|
throw new Error("Not authenticated");
|
|
2339
|
-
if (!
|
|
2353
|
+
if (!E.defaultDeviceId)
|
|
2340
2354
|
throw new Error("No known default device");
|
|
2341
2355
|
const n = (await (await fetch(
|
|
2342
2356
|
`${h}/v1/admin/device-details/query`,
|
|
@@ -2348,27 +2362,27 @@ const S = class {
|
|
|
2348
2362
|
}
|
|
2349
2363
|
}
|
|
2350
2364
|
)).json()).items.find(
|
|
2351
|
-
(c) => c.id ===
|
|
2352
|
-
), i = n.name, r = new
|
|
2353
|
-
|
|
2365
|
+
(c) => c.id === E.defaultDeviceId
|
|
2366
|
+
), i = n.name, r = new S(
|
|
2367
|
+
E.defaultDeviceId,
|
|
2354
2368
|
i,
|
|
2355
2369
|
f(o.currentOrganization),
|
|
2356
2370
|
n.tags
|
|
2357
2371
|
);
|
|
2358
|
-
return
|
|
2372
|
+
return E.knownContext.push(new WeakRef(r)), r;
|
|
2359
2373
|
}
|
|
2360
2374
|
static async getPeerDevice(e) {
|
|
2361
|
-
const t = new
|
|
2375
|
+
const t = new ut(e);
|
|
2362
2376
|
return t.id = await t.getDeviceId(), t;
|
|
2363
2377
|
}
|
|
2364
2378
|
static async getDevice(e) {
|
|
2365
|
-
const t = await
|
|
2366
|
-
return
|
|
2379
|
+
const t = await Tt(e);
|
|
2380
|
+
return E.knownContext.push(new WeakRef(t)), t;
|
|
2367
2381
|
}
|
|
2368
2382
|
};
|
|
2369
|
-
let l =
|
|
2370
|
-
s(l, "defaultDeviceId"), s(l, "knownContext", []), s(l, "createFleet",
|
|
2371
|
-
class
|
|
2383
|
+
let l = E;
|
|
2384
|
+
s(l, "defaultDeviceId"), s(l, "knownContext", []), s(l, "createFleet", zt), s(l, "listFleets", Nt), s(l, "getFleet", Et), s(l, "patchFleet", It), s(l, "deleteFleet", wt), s(l, "addDeviceToFleet", mt), s(l, "getFleetDevices", kt), s(l, "aggregateTelemetry", ft), s(l, "createShareLink", Y), s(l, "eventsCounter", ee), s(l, "getAnalyticStreams", pt), s(l, "getAnalyticsModules", yt), s(l, "getAnalyticsRows", gt), s(l, "getAnnotationCount", B), s(l, "getAnnotationCountByIntervals", te), s(l, "getCurrentGroup", vt), s(l, "getDevices", M), s(l, "getEvent", Ct), s(l, "getFileUrl", St), s(l, "getInterventions", Ot), s(l, "getLatestTelemetry", Rt), s(l, "getOnlineDevices", bt), s(l, "getPeers", ie), s(l, "getRealtimeDevices", At), s(l, "getRealtimeSessions", ae), s(l, "getStreams", Dt), s(l, "getTaskReportRows", Pt), s(l, "getTaskReportTables", jt), s(l, "getTelemetry", ne), s(l, "getViews", X), s(l, "patchStream", Lt), s(l, "patchView", _t), s(l, "queryAnalytics", $t), s(l, "queryDevices", oe), s(l, "queryEvents", z), s(l, "queryTelemetry", _);
|
|
2385
|
+
class Yt {
|
|
2372
2386
|
static async set(e, t, n) {
|
|
2373
2387
|
try {
|
|
2374
2388
|
const i = await fetch(h + "/v1/admin/key-value", {
|
|
@@ -2443,8 +2457,28 @@ class Xt {
|
|
|
2443
2457
|
throw t;
|
|
2444
2458
|
}
|
|
2445
2459
|
}
|
|
2460
|
+
static async query(e) {
|
|
2461
|
+
try {
|
|
2462
|
+
const t = await fetch(
|
|
2463
|
+
h + "/v1/admin/key-value/query",
|
|
2464
|
+
{
|
|
2465
|
+
method: "POST",
|
|
2466
|
+
body: JSON.stringify({ keys: e }),
|
|
2467
|
+
headers: {
|
|
2468
|
+
"Content-Type": "application/json",
|
|
2469
|
+
Authorization: "Bearer " + o.token
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
);
|
|
2473
|
+
if (!t.ok)
|
|
2474
|
+
throw new Error("Unable to handle request");
|
|
2475
|
+
return (await t.json()).items;
|
|
2476
|
+
} catch (t) {
|
|
2477
|
+
throw t;
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2446
2480
|
}
|
|
2447
|
-
function
|
|
2481
|
+
function Bt(a) {
|
|
2448
2482
|
return Uint8Array.from(J(a), (e) => e.charCodeAt(0));
|
|
2449
2483
|
}
|
|
2450
2484
|
function U() {
|
|
@@ -2452,7 +2486,7 @@ function U() {
|
|
|
2452
2486
|
return a ? a.includes("Firefox/") ? "Firefox" : a.includes("Edg/") ? "Edge" : a.includes("Chrome/") ? "Chrome" : a.includes("Safari/") ? "Safari" : a.includes("MSIE/") || a.includes("Trident/") ? "IE" : "Other" : "Other";
|
|
2453
2487
|
}
|
|
2454
2488
|
const Mt = "audio-chunk";
|
|
2455
|
-
class
|
|
2489
|
+
class Zt {
|
|
2456
2490
|
constructor(e, t) {
|
|
2457
2491
|
s(this, "muted", !1);
|
|
2458
2492
|
s(this, "hasReceivedData", !1);
|
|
@@ -2471,7 +2505,7 @@ class Yt {
|
|
|
2471
2505
|
const { audioContext: n, muted: i } = this;
|
|
2472
2506
|
if (!n || e.header.stream.streamType !== Mt || i !== !1)
|
|
2473
2507
|
return;
|
|
2474
|
-
const r =
|
|
2508
|
+
const r = Bt(t);
|
|
2475
2509
|
try {
|
|
2476
2510
|
await n.decodeAudioData(
|
|
2477
2511
|
r.buffer,
|
|
@@ -2524,7 +2558,7 @@ class Yt {
|
|
|
2524
2558
|
(async () => await this.device.changeStreamAudioType(t.name, e))();
|
|
2525
2559
|
}
|
|
2526
2560
|
}
|
|
2527
|
-
class
|
|
2561
|
+
class en {
|
|
2528
2562
|
static async listAccounts() {
|
|
2529
2563
|
if (!o.token)
|
|
2530
2564
|
throw new Error("Not authenticated");
|
|
@@ -2597,7 +2631,7 @@ class Zt {
|
|
|
2597
2631
|
)).json();
|
|
2598
2632
|
}
|
|
2599
2633
|
}
|
|
2600
|
-
class
|
|
2634
|
+
class tn {
|
|
2601
2635
|
static async listRoles() {
|
|
2602
2636
|
if (!o.token)
|
|
2603
2637
|
throw new Error("Not authenticated");
|
|
@@ -2656,7 +2690,7 @@ class en {
|
|
|
2656
2690
|
});
|
|
2657
2691
|
}
|
|
2658
2692
|
}
|
|
2659
|
-
class
|
|
2693
|
+
class nn {
|
|
2660
2694
|
static async listUsers() {
|
|
2661
2695
|
if (!o.token)
|
|
2662
2696
|
throw new Error("Not authenticated");
|
|
@@ -2716,14 +2750,14 @@ class tn {
|
|
|
2716
2750
|
});
|
|
2717
2751
|
}
|
|
2718
2752
|
}
|
|
2719
|
-
const
|
|
2753
|
+
const an = ["viewer", "operator", "administrator"], on = "viewer", rn = "operator", sn = "administrator", cn = [
|
|
2720
2754
|
"year",
|
|
2721
2755
|
"month",
|
|
2722
2756
|
"week",
|
|
2723
2757
|
"day",
|
|
2724
2758
|
"hour",
|
|
2725
2759
|
"minute"
|
|
2726
|
-
],
|
|
2760
|
+
], dn = ["tag", "sheet", "user"], hn = [
|
|
2727
2761
|
"triggered-event",
|
|
2728
2762
|
"intervention-request",
|
|
2729
2763
|
"teleop-session-record",
|
|
@@ -2735,12 +2769,12 @@ const nn = ["viewer", "operator", "administrator"], an = "viewer", on = "operato
|
|
|
2735
2769
|
"comment",
|
|
2736
2770
|
"system",
|
|
2737
2771
|
"annotation"
|
|
2738
|
-
],
|
|
2772
|
+
], ln = [
|
|
2739
2773
|
"unknown",
|
|
2740
2774
|
"operational",
|
|
2741
2775
|
"offline",
|
|
2742
2776
|
"error"
|
|
2743
|
-
],
|
|
2777
|
+
], un = ["selection", "labeling", "teleop"], mn = ["info", "warning", "error", "critical"], fn = ["video/mp4"], wn = (a) => new Promise((e) => setTimeout(e, a * 1e3));
|
|
2744
2778
|
try {
|
|
2745
2779
|
const a = typeof window < "u" && window.location ? new URLSearchParams(window.location.search) : new URLSearchParams(""), e = a.get("device");
|
|
2746
2780
|
e && l.setDefaultDevice(e);
|
|
@@ -2749,30 +2783,30 @@ try {
|
|
|
2749
2783
|
} catch {
|
|
2750
2784
|
}
|
|
2751
2785
|
export {
|
|
2752
|
-
|
|
2786
|
+
en as Account,
|
|
2753
2787
|
y as App,
|
|
2754
|
-
|
|
2788
|
+
Zt as AudioPlayer,
|
|
2755
2789
|
o as Authentication,
|
|
2756
2790
|
Ke as BinaryRequestDataChannel,
|
|
2757
2791
|
Fe as CaptureStream,
|
|
2758
2792
|
Ge as DataChannel,
|
|
2759
|
-
|
|
2793
|
+
S as Device,
|
|
2760
2794
|
l as Fleet,
|
|
2761
|
-
|
|
2795
|
+
Yt as KeyValue,
|
|
2762
2796
|
He as Manipulator,
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2797
|
+
ut as PeerDevice,
|
|
2798
|
+
tn as Role,
|
|
2799
|
+
Ht as SessionType,
|
|
2766
2800
|
Qe as TextRequestDataChannel,
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2801
|
+
nn as User,
|
|
2802
|
+
an as accessLevels,
|
|
2803
|
+
sn as administrator,
|
|
2770
2804
|
Z as aggregateByDateFunctions,
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2805
|
+
Xt as aggregateFunctionMap,
|
|
2806
|
+
Qt as aggregateFunctions,
|
|
2807
|
+
cn as aggregateLevels,
|
|
2808
|
+
dn as annotationTypes,
|
|
2809
|
+
hn as eventTypes,
|
|
2776
2810
|
rt as formatTimeFrameText,
|
|
2777
2811
|
at as getAverage,
|
|
2778
2812
|
ot as getCount,
|
|
@@ -2781,12 +2815,13 @@ export {
|
|
|
2781
2815
|
et as getStandardDeviation,
|
|
2782
2816
|
it as getSum,
|
|
2783
2817
|
Ze as getVariance,
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2818
|
+
ln as healthStatuses,
|
|
2819
|
+
un as interventionTypes,
|
|
2820
|
+
rn as operator,
|
|
2821
|
+
mn as severities,
|
|
2822
|
+
wn as timeout,
|
|
2823
|
+
Kt as vailableAggregationIntervals,
|
|
2824
|
+
fn as videoMimeTypes,
|
|
2825
|
+
on as viewer
|
|
2791
2826
|
};
|
|
2792
2827
|
//# sourceMappingURL=data-sdk.es.js.map
|