@formant/data-sdk 1.7.0 → 1.9.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.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,
|
|
@@ -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)
|
|
@@ -634,7 +634,7 @@ const g = {
|
|
|
634
634
|
observe: g.OBSERVE
|
|
635
635
|
}, O = Symbol("RtcClientPool.instance");
|
|
636
636
|
var qt;
|
|
637
|
-
class
|
|
637
|
+
class j {
|
|
638
638
|
constructor(e) {
|
|
639
639
|
s(this, qt, null);
|
|
640
640
|
s(this, "createClient");
|
|
@@ -692,39 +692,39 @@ class N {
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
qt = O;
|
|
695
|
-
const
|
|
696
|
-
[g.UNKNOWN]: new
|
|
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
|
})
|
|
@@ -2255,7 +2255,7 @@ async function Pt(a) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
)).json();
|
|
2257
2257
|
}
|
|
2258
|
-
async function
|
|
2258
|
+
async function jt() {
|
|
2259
2259
|
if (!o.token)
|
|
2260
2260
|
throw new Error("Not authenticated");
|
|
2261
2261
|
return (await (await fetch(
|
|
@@ -2269,7 +2269,7 @@ async function Nt() {
|
|
|
2269
2269
|
}
|
|
2270
2270
|
)).json()).items;
|
|
2271
2271
|
}
|
|
2272
|
-
async function
|
|
2272
|
+
async function Nt() {
|
|
2273
2273
|
if (!o.token)
|
|
2274
2274
|
throw new Error("Not authenticated");
|
|
2275
2275
|
return (await (await fetch(`${h}/v1/admin/fleets`, {
|
|
@@ -2381,7 +2381,7 @@ const E = class {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
};
|
|
2383
2383
|
let l = E;
|
|
2384
|
-
s(l, "defaultDeviceId"), s(l, "knownContext", []), s(l, "createFleet", zt), s(l, "listFleets",
|
|
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
2385
|
class Yt {
|
|
2386
2386
|
static async set(e, t, n) {
|
|
2387
2387
|
try {
|
|
@@ -2457,6 +2457,26 @@ class Yt {
|
|
|
2457
2457
|
throw t;
|
|
2458
2458
|
}
|
|
2459
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
|
+
}
|
|
2460
2480
|
}
|
|
2461
2481
|
function Bt(a) {
|
|
2462
2482
|
return Uint8Array.from(J(a), (e) => e.charCodeAt(0));
|