@didcid/keymaster 0.2.0 → 0.3.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.
@@ -553,9 +553,9 @@ class KeymasterClient {
553
553
  throwError(error);
554
554
  }
555
555
  }
556
- async bindCredential(schema, subject, options) {
556
+ async bindCredential(subject, options) {
557
557
  try {
558
- const response = await axios.post(`${this.API}/credentials/bind`, { schema, subject, options });
558
+ const response = await axios.post(`${this.API}/credentials/bind`, { subject, options });
559
559
  return response.data.credential;
560
560
  }
561
561
  catch (error) {
@@ -825,70 +825,70 @@ class KeymasterClient {
825
825
  throwError(error);
826
826
  }
827
827
  }
828
- async createGroupVault(options = {}) {
828
+ async createVault(options = {}) {
829
829
  try {
830
- const response = await axios.post(`${this.API}/groupVaults`, { options });
830
+ const response = await axios.post(`${this.API}/vaults`, { options });
831
831
  return response.data.did;
832
832
  }
833
833
  catch (error) {
834
834
  throwError(error);
835
835
  }
836
836
  }
837
- async getGroupVault(id, options) {
837
+ async getVault(id, options) {
838
838
  try {
839
839
  if (options) {
840
840
  const queryParams = new URLSearchParams(options);
841
- const response = await axios.get(`${this.API}/groupVaults/${id}?${queryParams.toString()}`);
842
- return response.data.groupVault;
841
+ const response = await axios.get(`${this.API}/vaults/${id}?${queryParams.toString()}`);
842
+ return response.data.vault;
843
843
  }
844
844
  else {
845
- const response = await axios.get(`${this.API}/groupVaults/${id}`);
846
- return response.data.groupVault;
845
+ const response = await axios.get(`${this.API}/vaults/${id}`);
846
+ return response.data.vault;
847
847
  }
848
848
  }
849
849
  catch (error) {
850
850
  throwError(error);
851
851
  }
852
852
  }
853
- async testGroupVault(id, options) {
853
+ async testVault(id, options) {
854
854
  try {
855
- const response = await axios.post(`${this.API}/groupVaults/${id}/test`, { options });
855
+ const response = await axios.post(`${this.API}/vaults/${id}/test`, { options });
856
856
  return response.data.test;
857
857
  }
858
858
  catch (error) {
859
859
  throwError(error);
860
860
  }
861
861
  }
862
- async addGroupVaultMember(vaultId, memberId) {
862
+ async addVaultMember(vaultId, memberId) {
863
863
  try {
864
- const response = await axios.post(`${this.API}/groupVaults/${vaultId}/members`, { memberId });
864
+ const response = await axios.post(`${this.API}/vaults/${vaultId}/members`, { memberId });
865
865
  return response.data.ok;
866
866
  }
867
867
  catch (error) {
868
868
  throwError(error);
869
869
  }
870
870
  }
871
- async removeGroupVaultMember(vaultId, memberId) {
871
+ async removeVaultMember(vaultId, memberId) {
872
872
  try {
873
- const response = await axios.delete(`${this.API}/groupVaults/${vaultId}/members/${memberId}`);
873
+ const response = await axios.delete(`${this.API}/vaults/${vaultId}/members/${memberId}`);
874
874
  return response.data.ok;
875
875
  }
876
876
  catch (error) {
877
877
  throwError(error);
878
878
  }
879
879
  }
880
- async listGroupVaultMembers(vaultId) {
880
+ async listVaultMembers(vaultId) {
881
881
  try {
882
- const response = await axios.get(`${this.API}/groupVaults/${vaultId}/members`);
882
+ const response = await axios.get(`${this.API}/vaults/${vaultId}/members`);
883
883
  return response.data.members;
884
884
  }
885
885
  catch (error) {
886
886
  throwError(error);
887
887
  }
888
888
  }
889
- async addGroupVaultItem(vaultId, name, buffer) {
889
+ async addVaultItem(vaultId, name, buffer) {
890
890
  try {
891
- const response = await axios.post(`${this.API}/groupVaults/${vaultId}/items`, buffer, {
891
+ const response = await axios.post(`${this.API}/vaults/${vaultId}/items`, buffer, {
892
892
  headers: {
893
893
  // eslint-disable-next-line
894
894
  'Content-Type': 'application/octet-stream',
@@ -901,24 +901,24 @@ class KeymasterClient {
901
901
  throwError(error);
902
902
  }
903
903
  }
904
- async removeGroupVaultItem(vaultId, name) {
904
+ async removeVaultItem(vaultId, name) {
905
905
  try {
906
- const response = await axios.delete(`${this.API}/groupVaults/${vaultId}/items/${name}`);
906
+ const response = await axios.delete(`${this.API}/vaults/${vaultId}/items/${name}`);
907
907
  return response.data.ok;
908
908
  }
909
909
  catch (error) {
910
910
  throwError(error);
911
911
  }
912
912
  }
913
- async listGroupVaultItems(vaultId, options) {
913
+ async listVaultItems(vaultId, options) {
914
914
  try {
915
915
  if (options) {
916
916
  const queryParams = new URLSearchParams(options);
917
- const response = await axios.get(`${this.API}/groupVaults/${vaultId}/items?${queryParams.toString()}`);
917
+ const response = await axios.get(`${this.API}/vaults/${vaultId}/items?${queryParams.toString()}`);
918
918
  return response.data.items;
919
919
  }
920
920
  else {
921
- const response = await axios.get(`${this.API}/groupVaults/${vaultId}/items`);
921
+ const response = await axios.get(`${this.API}/vaults/${vaultId}/items`);
922
922
  return response.data.items;
923
923
  }
924
924
  }
@@ -926,9 +926,9 @@ class KeymasterClient {
926
926
  throwError(error);
927
927
  }
928
928
  }
929
- async getGroupVaultItem(vaultId, name, options) {
929
+ async getVaultItem(vaultId, name, options) {
930
930
  try {
931
- let url = `${this.API}/groupVaults/${vaultId}/items/${name}`;
931
+ let url = `${this.API}/vaults/${vaultId}/items/${name}`;
932
932
  if (options) {
933
933
  const queryParams = new URLSearchParams(options);
934
934
  url += `?${queryParams.toString()}`;