@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.
@@ -22876,6 +22876,20 @@ async function queryDevicesData(e) {
22876
22876
  }
22877
22877
  })).json()).items;
22878
22878
  }
22879
+ async function disableDevice(e) {
22880
+ if (!Authentication.token)
22881
+ throw new Error("Not authenticated");
22882
+ return await (await fetch(
22883
+ `${FORMANT_API_URL}/v1/admin/devices/${e}/disable`,
22884
+ {
22885
+ method: "POST",
22886
+ headers: {
22887
+ "Content-Type": "application/json",
22888
+ Authorization: "Bearer " + Authentication.token
22889
+ }
22890
+ }
22891
+ )).json();
22892
+ }
22879
22893
  class Device extends BaseDevice {
22880
22894
  constructor(t, n, r, o) {
22881
22895
  super(), this.id = t, this.name = n, this.organizationId = r, this.tags = o;
@@ -23204,7 +23218,7 @@ class Device extends BaseDevice {
23204
23218
  return t.scope.deviceIds = [this.id], await createShareLink(t, n);
23205
23219
  }
23206
23220
  }
23207
- be(Device, "createDevice", createDevice), be(Device, "patchDevice", patchDevice), be(Device, "getDevicesData", getDevicesData), be(Device, "queryDevicesData", queryDevicesData);
23221
+ be(Device, "createDevice", createDevice), be(Device, "patchDevice", patchDevice), be(Device, "getDevicesData", getDevicesData), be(Device, "queryDevicesData", queryDevicesData), be(Device, "disableDevice", disableDevice);
23208
23222
  class PeerDevice extends BaseDevice {
23209
23223
  constructor(n) {
23210
23224
  super();
@@ -23807,6 +23821,26 @@ class KeyValue {
23807
23821
  throw n;
23808
23822
  }
23809
23823
  }
23824
+ static async query(t) {
23825
+ try {
23826
+ const n = await fetch(
23827
+ FORMANT_API_URL + "/v1/admin/key-value/query",
23828
+ {
23829
+ method: "POST",
23830
+ body: JSON.stringify({ keys: t }),
23831
+ headers: {
23832
+ "Content-Type": "application/json",
23833
+ Authorization: "Bearer " + Authentication.token
23834
+ }
23835
+ }
23836
+ );
23837
+ if (!n.ok)
23838
+ throw new Error("Unable to handle request");
23839
+ return (await n.json()).items;
23840
+ } catch (n) {
23841
+ throw n;
23842
+ }
23843
+ }
23810
23844
  }
23811
23845
  function stringToArrayBuffer(e) {
23812
23846
  return Uint8Array.from(base64Exports.decode(e), (t) => t.charCodeAt(0));
@@ -24104,7 +24138,7 @@ const accessLevels = ["viewer", "operator", "administrator"], viewer = "viewer",
24104
24138
  "operational",
24105
24139
  "offline",
24106
24140
  "error"
24107
- ], interventionTypes = ["selection", "labeling", "teleop"], severities = ["info", "warning", "error", "critical"], videoMimeTypes = ["video/mp4"];
24141
+ ], interventionTypes = ["selection", "labeling", "teleop"], severities = ["info", "warning", "error", "critical"], videoMimeTypes = ["video/mp4"], timeout = (e) => new Promise((t) => setTimeout(t, e * 1e3));
24108
24142
  try {
24109
24143
  const e = typeof window < "u" && window.location ? new URLSearchParams(window.location.search) : new URLSearchParams(""), t = e.get("device");
24110
24144
  t && Fleet.setDefaultDevice(t);
@@ -24149,6 +24183,7 @@ export {
24149
24183
  interventionTypes,
24150
24184
  operator,
24151
24185
  severities,
24186
+ timeout,
24152
24187
  vailableAggregationIntervals,
24153
24188
  videoMimeTypes,
24154
24189
  viewer