@semaphore-protocol/cli 3.10.1 → 3.11.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/README.md CHANGED
@@ -40,7 +40,7 @@
40
40
  🔎 Issues
41
41
  </a>
42
42
  <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
43
- <a href="https://semaphore.appliedzkp.org/discord">
43
+ <a href="https://semaphore.pse.dev/discord">
44
44
  🗣️ Chat &amp; Support
45
45
  </a>
46
46
  </h4>
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @module @semaphore-protocol/cli
5
- * @version 3.10.1
5
+ * @version 3.11.1
6
6
  * @file A command line tool to set up your Semaphore project and get group data.
7
7
  * @copyright Ethereum Foundation 2022
8
8
  * @license MIT
@@ -233,8 +233,10 @@ program
233
233
  return;
234
234
  }
235
235
  const groupIds = await getGroupIds(network);
236
- if (groupIds === null)
236
+ if (groupIds === null) {
237
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
237
238
  return;
239
+ }
238
240
  const content = `${chalk.bold("Groups")} (${groupIds.length}): \n${groupIds
239
241
  .map((id) => ` - ${id}`)
240
242
  .join("\n")}`;
@@ -256,8 +258,10 @@ program
256
258
  }
257
259
  if (!groupId) {
258
260
  const groupIds = await getGroupIds(network);
259
- if (groupIds === null)
261
+ if (groupIds === null) {
262
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
260
263
  return;
264
+ }
261
265
  groupId = await getGroupId(groupIds);
262
266
  }
263
267
  let group;
@@ -281,6 +285,10 @@ program
281
285
  return;
282
286
  }
283
287
  }
288
+ if (!group) {
289
+ console.info(`\n ${logSymbols.error}`, "error: the group does not exist\n");
290
+ return;
291
+ }
284
292
  let content = ` ${chalk.bold("Id")}: ${group.id}\n`;
285
293
  content += ` ${chalk.bold("Admin")}: ${group.admin}\n`;
286
294
  content += ` ${chalk.bold("Merkle tree")}:\n`;
@@ -306,8 +314,10 @@ program
306
314
  }
307
315
  if (!groupId) {
308
316
  const groupIds = await getGroupIds(network);
309
- if (groupIds === null)
317
+ if (groupIds === null) {
318
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
310
319
  return;
320
+ }
311
321
  groupId = await getGroupId(groupIds);
312
322
  }
313
323
  let groupMembers;
@@ -356,8 +366,10 @@ program
356
366
  }
357
367
  if (!groupId) {
358
368
  const groupIds = await getGroupIds(network);
359
- if (groupIds === null)
369
+ if (groupIds === null) {
370
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
360
371
  return;
372
+ }
361
373
  groupId = await getGroupId(groupIds);
362
374
  }
363
375
  let verifiedProofs;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semaphore-protocol/cli",
3
3
  "type": "module",
4
- "version": "3.10.1",
4
+ "version": "3.11.1",
5
5
  "description": "A command line tool to set up your Semaphore project and get group data.",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "typedoc": "^0.22.11"
44
44
  },
45
45
  "dependencies": {
46
- "@semaphore-protocol/data": "3.10.1",
46
+ "@semaphore-protocol/data": "3.11.1",
47
47
  "axios": "^1.3.2",
48
48
  "boxen": "^7.0.1",
49
49
  "chalk": "^5.1.2",
package/src/index.ts CHANGED
@@ -132,7 +132,10 @@ program
132
132
 
133
133
  const groupIds = await getGroupIds(network)
134
134
 
135
- if (groupIds === null) return
135
+ if (groupIds === null) {
136
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
137
+ return
138
+ }
136
139
 
137
140
  const content = `${chalk.bold("Groups")} (${groupIds.length}): \n${groupIds
138
141
  .map((id: any) => ` - ${id}`)
@@ -160,7 +163,10 @@ program
160
163
  if (!groupId) {
161
164
  const groupIds = await getGroupIds(network)
162
165
 
163
- if (groupIds === null) return
166
+ if (groupIds === null) {
167
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
168
+ return
169
+ }
164
170
 
165
171
  groupId = await getGroupId(groupIds)
166
172
  }
@@ -193,6 +199,11 @@ program
193
199
  }
194
200
  }
195
201
 
202
+ if (!group) {
203
+ console.info(`\n ${logSymbols.error}`, "error: the group does not exist\n")
204
+ return
205
+ }
206
+
196
207
  let content = ` ${chalk.bold("Id")}: ${group.id}\n`
197
208
  content += ` ${chalk.bold("Admin")}: ${group.admin}\n`
198
209
  content += ` ${chalk.bold("Merkle tree")}:\n`
@@ -223,7 +234,10 @@ program
223
234
  if (!groupId) {
224
235
  const groupIds = await getGroupIds(network)
225
236
 
226
- if (groupIds === null) return
237
+ if (groupIds === null) {
238
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
239
+ return
240
+ }
227
241
 
228
242
  groupId = await getGroupId(groupIds)
229
243
  }
@@ -286,7 +300,10 @@ program
286
300
  if (!groupId) {
287
301
  const groupIds = await getGroupIds(network)
288
302
 
289
- if (groupIds === null) return
303
+ if (groupIds === null) {
304
+ console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
305
+ return
306
+ }
290
307
 
291
308
  groupId = await getGroupId(groupIds)
292
309
  }