@formant/data-sdk 0.0.93 → 0.0.96

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.
@@ -18716,7 +18716,10 @@ class Manipulator {
18716
18716
  __publicField(this, "currentListeners", []);
18717
18717
  __publicField(this, "onRealtimeMessage", (_peerId, message) => {
18718
18718
  if (message.payload.jointState) {
18719
- this.currentListeners.forEach((listener) => listener(message.payload.jointState));
18719
+ this.currentListeners.forEach((listener) => {
18720
+ if (message.payload.jointState)
18721
+ listener(message.payload.jointState);
18722
+ });
18720
18723
  }
18721
18724
  });
18722
18725
  this.device = device;
@@ -19158,7 +19161,7 @@ class Device {
19158
19161
  scrubberTime: (time || new Date()).toISOString(),
19159
19162
  meta: __spreadValues(__spreadValues({}, command.parameterMeta), metadata)
19160
19163
  };
19161
- const result = await fetch(`${FORMANT_API_URL}/v1/admin/commands`, {
19164
+ await fetch(`${FORMANT_API_URL}/v1/admin/commands`, {
19162
19165
  method: "POST",
19163
19166
  body: JSON.stringify({
19164
19167
  commandTemplateId: command.id,
@@ -19173,8 +19176,6 @@ class Device {
19173
19176
  Authorization: "Bearer " + Authentication.token
19174
19177
  }
19175
19178
  });
19176
- const files = await result.json();
19177
- return files.fileUrls;
19178
19179
  }
19179
19180
  async createCustomDataChannel(channelName, rtcConfig) {
19180
19181
  const client = defined(this.rtcClient, "Realtime connection has not been started");
@@ -19761,9 +19762,6 @@ class KeyValue {
19761
19762
  try {
19762
19763
  const result = await fetch(FORMANT_API_URL + `/v1/admin/key-value/${key}`, {
19763
19764
  method: "GET",
19764
- body: JSON.stringify({
19765
- organizationId: defined(Authentication.currentUser).organizationId
19766
- }),
19767
19765
  headers: {
19768
19766
  "Content-Type": "application/json",
19769
19767
  Authorization: "Bearer " + Authentication.token
@@ -19778,6 +19776,41 @@ class KeyValue {
19778
19776
  throw e;
19779
19777
  }
19780
19778
  }
19779
+ static async list() {
19780
+ try {
19781
+ const result = await fetch(FORMANT_API_URL + "/v1/admin/key-value", {
19782
+ method: "GET",
19783
+ headers: {
19784
+ "Content-Type": "application/json",
19785
+ Authorization: "Bearer " + Authentication.token
19786
+ }
19787
+ });
19788
+ const keyValueList = await result.json();
19789
+ if (result.status !== 200) {
19790
+ throw new Error(keyValueList.message);
19791
+ }
19792
+ return keyValueList.items;
19793
+ } catch (e) {
19794
+ throw e;
19795
+ }
19796
+ }
19797
+ static async delete(key) {
19798
+ try {
19799
+ const result = await fetch(FORMANT_API_URL + `/v1/admin/key-value/${key}`, {
19800
+ method: "DELETE",
19801
+ headers: {
19802
+ "Content-Type": "application/json",
19803
+ Authorization: "Bearer " + Authentication.token
19804
+ }
19805
+ });
19806
+ if (!result.ok) {
19807
+ throw new Error("Unable to handle request");
19808
+ }
19809
+ return;
19810
+ } catch (e) {
19811
+ throw e;
19812
+ }
19813
+ }
19781
19814
  }
19782
19815
  const accessLevels = ["viewer", "operator", "administrator"];
19783
19816
  const viewer = "viewer";