@formant/data-sdk 0.0.95 → 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.
@@ -19762,9 +19762,6 @@ class KeyValue {
19762
19762
  try {
19763
19763
  const result = await fetch(FORMANT_API_URL + `/v1/admin/key-value/${key}`, {
19764
19764
  method: "GET",
19765
- body: JSON.stringify({
19766
- organizationId: defined(Authentication.currentUser).organizationId
19767
- }),
19768
19765
  headers: {
19769
19766
  "Content-Type": "application/json",
19770
19767
  Authorization: "Bearer " + Authentication.token
@@ -19779,6 +19776,41 @@ class KeyValue {
19779
19776
  throw e;
19780
19777
  }
19781
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
+ }
19782
19814
  }
19783
19815
  const accessLevels = ["viewer", "operator", "administrator"];
19784
19816
  const viewer = "viewer";