@pitcher/cli-scripts 2.6.0 → 2.6.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.
@@ -67,14 +67,15 @@ export async function runGroupsAddUser(opts, deps = {}) {
67
67
  }
68
68
  export async function runGroupsListUsers(opts, deps = {}) {
69
69
  try {
70
+ if (!opts.groupId)
71
+ throw createCliError('VALIDATION', '--group-id is required for groups list-users');
70
72
  assertIntFlags(opts);
71
73
  const client = clientFor(opts, deps);
72
74
  const params = { ...listPageParams(opts) };
73
75
  // The list filterset is content_distribution_group_id (NOT the bare relation
74
76
  // name) — an unknown param is silently ignored by DjangoFilterBackend and the
75
77
  // endpoint returns every visible membership in the org.
76
- if (opts.groupId)
77
- params.content_distribution_group_id = opts.groupId;
78
+ params.content_distribution_group_id = opts.groupId;
78
79
  const res = await client.get(GROUP_MEMBERS, { params });
79
80
  return ok({ results: res.data.results, pagination: listPaginationEcho(opts, res.data) });
80
81
  }
@@ -114,7 +115,7 @@ export function createGroupsCommand() {
114
115
  emitEnvelope(await runGroupsAddUser({ ...options, quiet: globals.quiet }), globals);
115
116
  });
116
117
  withAuthFlags(cmd.command('list-users'))
117
- .option('--group-id <id>', 'Group whose members to list')
118
+ .option('--group-id <id>', 'Group whose members to list (required)')
118
119
  .option('--page <n>', 'Page number', (v) => parseInt(v, 10))
119
120
  .option('--page-size <n>', 'Page size (max 500)', (v) => parseInt(v, 10))
120
121
  .action(async (options, command) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pitcher/cli-scripts",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "The Pitcher CLI for various tasks in its ecosystem.",
5
5
  "author": "Pitcher AG",
6
6
  "license": "MIT",