@calimero-network/mero-js 2.0.0 → 2.0.1

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/index.mjs CHANGED
@@ -910,7 +910,16 @@ var AdminApiClient = class {
910
910
  return unwrap(await this.httpClient.delete(`/admin-api/groups/${groupId}`));
911
911
  }
912
912
  async listGroupMembers(groupId) {
913
- return this.httpClient.get(`/admin-api/groups/${groupId}/members`);
913
+ const response = await this.httpClient.get(
914
+ `/admin-api/groups/${groupId}/members`
915
+ );
916
+ if (!Array.isArray(response?.members)) {
917
+ const safeId = String(groupId).replace(/[\r\n\t\s]/g, "").slice(0, 64);
918
+ throw new Error(
919
+ `Invalid listGroupMembers response for group ${safeId}: missing or non-array \`members\` field`
920
+ );
921
+ }
922
+ return response;
914
923
  }
915
924
  async listGroupContexts(groupId) {
916
925
  return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/contexts`));