@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.cjs CHANGED
@@ -965,7 +965,16 @@ var AdminApiClient = class {
965
965
  return unwrap(await this.httpClient.delete(`/admin-api/groups/${groupId}`));
966
966
  }
967
967
  async listGroupMembers(groupId) {
968
- return this.httpClient.get(`/admin-api/groups/${groupId}/members`);
968
+ const response = await this.httpClient.get(
969
+ `/admin-api/groups/${groupId}/members`
970
+ );
971
+ if (!Array.isArray(response?.members)) {
972
+ const safeId = String(groupId).replace(/[\r\n\t\s]/g, "").slice(0, 64);
973
+ throw new Error(
974
+ `Invalid listGroupMembers response for group ${safeId}: missing or non-array \`members\` field`
975
+ );
976
+ }
977
+ return response;
969
978
  }
970
979
  async listGroupContexts(groupId) {
971
980
  return unwrap(await this.httpClient.get(`/admin-api/groups/${groupId}/contexts`));