@debugbundle/cli 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/main.cjs +152 -87
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -16740,6 +16740,16 @@ var STORAGE_SCHEMA_MIGRATIONS = [
16740
16740
  statements: [
16741
16741
  "ALTER TABLE capture_policies ADD COLUMN IF NOT EXISTS immediate_client_error_statuses jsonb"
16742
16742
  ]
16743
+ }),
16744
+ defineStorageSchemaMigration({
16745
+ id: "202605150001_add_user_avatar_columns",
16746
+ description: "Add cached user avatar metadata for GitHub and Gravatar profile images.",
16747
+ statements: [
16748
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_source text",
16749
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_object_key text",
16750
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_content_type text",
16751
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_updated_at timestamptz"
16752
+ ]
16743
16753
  })
16744
16754
  ];
16745
16755
 
@@ -17495,6 +17505,10 @@ var ProjectMetricsSchema = external_exports.object({
17495
17505
  var ProjectRecordSchema = external_exports.object({
17496
17506
  project_id: external_exports.string(),
17497
17507
  organization_id: external_exports.string(),
17508
+ owner_user_id: external_exports.string(),
17509
+ owner_email: external_exports.string().email(),
17510
+ relationship: external_exports.enum(["owned", "shared"]),
17511
+ effective_role: external_exports.enum(["owner", "admin", "member"]),
17498
17512
  name: external_exports.string(),
17499
17513
  slug: external_exports.string(),
17500
17514
  environment_default: external_exports.string(),
@@ -17512,6 +17526,10 @@ var ProjectCreateResponseSchema = external_exports.object({
17512
17526
  var DeletedProjectRecordSchema = external_exports.object({
17513
17527
  project_id: external_exports.string(),
17514
17528
  organization_id: external_exports.string(),
17529
+ owner_user_id: external_exports.string(),
17530
+ owner_email: external_exports.string().email(),
17531
+ relationship: external_exports.enum(["owned", "shared"]),
17532
+ effective_role: external_exports.enum(["owner", "admin", "member"]),
17515
17533
  name: external_exports.string(),
17516
17534
  slug: external_exports.string(),
17517
17535
  environment_default: external_exports.string(),
@@ -18490,8 +18508,7 @@ var BillingSummarySchema = external_exports.object({
18490
18508
  retained_bundle_cap: BillingUsageMetricSchema,
18491
18509
  monthly_remote_activations: BillingUsageMetricSchema,
18492
18510
  monthly_alert_deliveries: BillingUsageMetricSchema
18493
- }).strict(),
18494
- email_verification_required: external_exports.boolean().optional()
18511
+ }).strict()
18495
18512
  }).strict();
18496
18513
  var BillingSummaryResponseSchema = external_exports.object({
18497
18514
  billing: BillingSummarySchema
@@ -25367,12 +25384,12 @@ var CLI_USAGE_LINES = [
25367
25384
  " debugbundle probe activate <project-id> --label-pattern <pattern> [--service <name>] [--environment <name>] [--ttl-seconds <n>] [--trigger-ttl-seconds <n>] [--auth-file <path>] [--json]",
25368
25385
  " debugbundle probe list <project-id> [--auth-file <path>] [--json]",
25369
25386
  " debugbundle probe deactivate <project-id> <activation-id> [--auth-file <path>] [--json]",
25370
- " debugbundle member list [--auth-file <path>] [--json]",
25371
- " debugbundle member invites [--auth-file <path>] [--json]",
25372
- " debugbundle member invite --email <email> --role <owner|admin|member> [--auth-file <path>] [--json]",
25373
- " debugbundle member cancel-invite <invite-id> [--auth-file <path>] [--json]",
25374
- " debugbundle member update-role <user-id> --role <owner|admin|member> [--auth-file <path>] [--json]",
25375
- " debugbundle member remove <user-id> [--auth-file <path>] [--json]"
25387
+ " debugbundle project members list --project-id <id> [--auth-file <path>] [--json]",
25388
+ " debugbundle project members invites --project-id <id> [--auth-file <path>] [--json]",
25389
+ " debugbundle project members invite --project-id <id> --email <email> --role <admin|member> [--auth-file <path>] [--json]",
25390
+ " debugbundle project members cancel-invite <invite-id> --project-id <id> [--auth-file <path>] [--json]",
25391
+ " debugbundle project members update-role <user-id> --project-id <id> --role <admin|member> [--auth-file <path>] [--json]",
25392
+ " debugbundle project members remove <user-id> --project-id <id> [--auth-file <path>] [--json]"
25376
25393
  ];
25377
25394
  function formatUsage() {
25378
25395
  return CLI_USAGE_LINES.join("\n");
@@ -27460,7 +27477,7 @@ function createMemberApi(httpClient) {
27460
27477
  async listMembers(input) {
27461
27478
  const response = await httpClient.request({
27462
27479
  method: "GET",
27463
- path: "/v1/organization/members",
27480
+ path: `/v1/projects/${input.projectId}/members`,
27464
27481
  bearerToken: input.bearerToken
27465
27482
  });
27466
27483
  if (response.status !== 200) {
@@ -27471,7 +27488,7 @@ function createMemberApi(httpClient) {
27471
27488
  async listInvites(input) {
27472
27489
  const response = await httpClient.request({
27473
27490
  method: "GET",
27474
- path: "/v1/organization/members/invites",
27491
+ path: `/v1/projects/${input.projectId}/invites`,
27475
27492
  bearerToken: input.bearerToken
27476
27493
  });
27477
27494
  if (response.status !== 200) {
@@ -27482,7 +27499,7 @@ function createMemberApi(httpClient) {
27482
27499
  async inviteMember(input) {
27483
27500
  const response = await httpClient.request({
27484
27501
  method: "POST",
27485
- path: "/v1/organization/members/invite",
27502
+ path: `/v1/projects/${input.projectId}/invite`,
27486
27503
  bearerToken: input.bearerToken,
27487
27504
  body: { email: input.email, role: input.role }
27488
27505
  });
@@ -27494,7 +27511,7 @@ function createMemberApi(httpClient) {
27494
27511
  async cancelInvite(input) {
27495
27512
  const response = await httpClient.request({
27496
27513
  method: "DELETE",
27497
- path: `/v1/organization/members/invites/${input.inviteId}`,
27514
+ path: `/v1/projects/${input.projectId}/invites/${input.inviteId}`,
27498
27515
  bearerToken: input.bearerToken
27499
27516
  });
27500
27517
  if (response.status !== 200) {
@@ -27505,7 +27522,7 @@ function createMemberApi(httpClient) {
27505
27522
  async updateMemberRole(input) {
27506
27523
  const response = await httpClient.request({
27507
27524
  method: "PATCH",
27508
- path: `/v1/organization/members/${input.userId}`,
27525
+ path: `/v1/projects/${input.projectId}/members/${input.userId}`,
27509
27526
  bearerToken: input.bearerToken,
27510
27527
  body: { role: input.role }
27511
27528
  });
@@ -27517,7 +27534,7 @@ function createMemberApi(httpClient) {
27517
27534
  async removeMember(input) {
27518
27535
  const response = await httpClient.request({
27519
27536
  method: "DELETE",
27520
- path: `/v1/organization/members/${input.userId}`,
27537
+ path: `/v1/projects/${input.projectId}/members/${input.userId}`,
27521
27538
  bearerToken: input.bearerToken
27522
27539
  });
27523
27540
  if (response.status !== 200) {
@@ -27531,7 +27548,7 @@ function formatMembersTable(members) {
27531
27548
  if (members.length === 0) {
27532
27549
  return "No members found.";
27533
27550
  }
27534
- return members.map((m) => `${m.user_id} | ${m.email} | ${m.role} | joined=${m.joined_at}`).join("\n");
27551
+ return members.map((m) => `${m.user_id} | ${m.email} | ${m.role} | type=${m.membership_type ?? "collaborator"} | joined=${m.created_at}`).join("\n");
27535
27552
  }
27536
27553
  function formatInvitesTable(invites) {
27537
27554
  if (invites.length === 0) {
@@ -27559,7 +27576,7 @@ function mapErrorToExitCode12(error) {
27559
27576
  }
27560
27577
  async function listMembersCommand(input, api) {
27561
27578
  try {
27562
- const result = await api.listMembers({ bearerToken: input.bearerToken });
27579
+ const result = await api.listMembers({ bearerToken: input.bearerToken, projectId: input.projectId });
27563
27580
  return {
27564
27581
  exitCode: 0,
27565
27582
  output: input.json ? JSON.stringify(result) : formatMembersTable(result.members)
@@ -27573,7 +27590,7 @@ async function listMembersCommand(input, api) {
27573
27590
  }
27574
27591
  async function listInvitesCommand(input, api) {
27575
27592
  try {
27576
- const result = await api.listInvites({ bearerToken: input.bearerToken });
27593
+ const result = await api.listInvites({ bearerToken: input.bearerToken, projectId: input.projectId });
27577
27594
  return {
27578
27595
  exitCode: 0,
27579
27596
  output: input.json ? JSON.stringify(result) : formatInvitesTable(result.invites)
@@ -27587,7 +27604,12 @@ async function listInvitesCommand(input, api) {
27587
27604
  }
27588
27605
  async function inviteMemberCommand(input, api) {
27589
27606
  try {
27590
- const result = await api.inviteMember({ bearerToken: input.bearerToken, email: input.email, role: input.role });
27607
+ const result = await api.inviteMember({
27608
+ bearerToken: input.bearerToken,
27609
+ projectId: input.projectId,
27610
+ email: input.email,
27611
+ role: input.role
27612
+ });
27591
27613
  return {
27592
27614
  exitCode: 0,
27593
27615
  output: input.json ? JSON.stringify(result) : `Invite sent: ${result.invite.invite_id} \u2192 ${result.invite.email} (${result.invite.role})`
@@ -27601,7 +27623,7 @@ async function inviteMemberCommand(input, api) {
27601
27623
  }
27602
27624
  async function cancelInviteCommand(input, api) {
27603
27625
  try {
27604
- const result = await api.cancelInvite({ bearerToken: input.bearerToken, inviteId: input.inviteId });
27626
+ const result = await api.cancelInvite({ bearerToken: input.bearerToken, projectId: input.projectId, inviteId: input.inviteId });
27605
27627
  return {
27606
27628
  exitCode: 0,
27607
27629
  output: input.json ? JSON.stringify(result) : `Invite cancelled: ${result.invite.invite_id}`
@@ -27615,7 +27637,12 @@ async function cancelInviteCommand(input, api) {
27615
27637
  }
27616
27638
  async function updateMemberRoleCommand(input, api) {
27617
27639
  try {
27618
- const result = await api.updateMemberRole({ bearerToken: input.bearerToken, userId: input.userId, role: input.role });
27640
+ const result = await api.updateMemberRole({
27641
+ bearerToken: input.bearerToken,
27642
+ projectId: input.projectId,
27643
+ userId: input.userId,
27644
+ role: input.role
27645
+ });
27619
27646
  return {
27620
27647
  exitCode: 0,
27621
27648
  output: input.json ? JSON.stringify(result) : `Role updated: ${result.member.user_id} \u2192 ${result.member.role}`
@@ -27629,7 +27656,7 @@ async function updateMemberRoleCommand(input, api) {
27629
27656
  }
27630
27657
  async function removeMemberCommand(input, api) {
27631
27658
  try {
27632
- const result = await api.removeMember({ bearerToken: input.bearerToken, userId: input.userId });
27659
+ const result = await api.removeMember({ bearerToken: input.bearerToken, projectId: input.projectId, userId: input.userId });
27633
27660
  return {
27634
27661
  exitCode: 0,
27635
27662
  output: input.json ? JSON.stringify(result) : `Member removed: ${result.member.user_id}`
@@ -27658,7 +27685,7 @@ async function listMembersWithAuthCommand(input, dependencies) {
27658
27685
  createApi: createAuthenticatedMemberApi,
27659
27686
  dependencies,
27660
27687
  runCommand: (authState, api) => listMembersCommand(
27661
- { bearerToken: authState.bearer_token, ...input.json === void 0 ? {} : { json: input.json } },
27688
+ { bearerToken: authState.bearer_token, projectId: input.projectId, ...input.json === void 0 ? {} : { json: input.json } },
27662
27689
  api
27663
27690
  )
27664
27691
  });
@@ -27668,7 +27695,7 @@ async function listInvitesWithAuthCommand(input, dependencies) {
27668
27695
  createApi: createAuthenticatedMemberApi,
27669
27696
  dependencies,
27670
27697
  runCommand: (authState, api) => listInvitesCommand(
27671
- { bearerToken: authState.bearer_token, ...input.json === void 0 ? {} : { json: input.json } },
27698
+ { bearerToken: authState.bearer_token, projectId: input.projectId, ...input.json === void 0 ? {} : { json: input.json } },
27672
27699
  api
27673
27700
  )
27674
27701
  });
@@ -27678,7 +27705,13 @@ async function inviteMemberWithAuthCommand(input, dependencies) {
27678
27705
  createApi: createAuthenticatedMemberApi,
27679
27706
  dependencies,
27680
27707
  runCommand: (authState, api) => inviteMemberCommand(
27681
- { bearerToken: authState.bearer_token, email: input.email, role: input.role, ...input.json === void 0 ? {} : { json: input.json } },
27708
+ {
27709
+ bearerToken: authState.bearer_token,
27710
+ projectId: input.projectId,
27711
+ email: input.email,
27712
+ role: input.role,
27713
+ ...input.json === void 0 ? {} : { json: input.json }
27714
+ },
27682
27715
  api
27683
27716
  )
27684
27717
  });
@@ -27688,7 +27721,12 @@ async function cancelInviteWithAuthCommand(input, dependencies) {
27688
27721
  createApi: createAuthenticatedMemberApi,
27689
27722
  dependencies,
27690
27723
  runCommand: (authState, api) => cancelInviteCommand(
27691
- { bearerToken: authState.bearer_token, inviteId: input.inviteId, ...input.json === void 0 ? {} : { json: input.json } },
27724
+ {
27725
+ bearerToken: authState.bearer_token,
27726
+ projectId: input.projectId,
27727
+ inviteId: input.inviteId,
27728
+ ...input.json === void 0 ? {} : { json: input.json }
27729
+ },
27692
27730
  api
27693
27731
  )
27694
27732
  });
@@ -27698,7 +27736,13 @@ async function updateMemberRoleWithAuthCommand(input, dependencies) {
27698
27736
  createApi: createAuthenticatedMemberApi,
27699
27737
  dependencies,
27700
27738
  runCommand: (authState, api) => updateMemberRoleCommand(
27701
- { bearerToken: authState.bearer_token, userId: input.userId, role: input.role, ...input.json === void 0 ? {} : { json: input.json } },
27739
+ {
27740
+ bearerToken: authState.bearer_token,
27741
+ projectId: input.projectId,
27742
+ userId: input.userId,
27743
+ role: input.role,
27744
+ ...input.json === void 0 ? {} : { json: input.json }
27745
+ },
27702
27746
  api
27703
27747
  )
27704
27748
  });
@@ -27708,7 +27752,12 @@ async function removeMemberWithAuthCommand(input, dependencies) {
27708
27752
  createApi: createAuthenticatedMemberApi,
27709
27753
  dependencies,
27710
27754
  runCommand: (authState, api) => removeMemberCommand(
27711
- { bearerToken: authState.bearer_token, userId: input.userId, ...input.json === void 0 ? {} : { json: input.json } },
27755
+ {
27756
+ bearerToken: authState.bearer_token,
27757
+ projectId: input.projectId,
27758
+ userId: input.userId,
27759
+ ...input.json === void 0 ? {} : { json: input.json }
27760
+ },
27712
27761
  api
27713
27762
  )
27714
27763
  });
@@ -28532,6 +28581,78 @@ async function handleBillingCommand(parsedArgv, dependencies) {
28532
28581
  }
28533
28582
  async function handleProjectCommand(parsedArgv, dependencies) {
28534
28583
  const action = requirePositional(parsedArgv, 1, "action");
28584
+ if (action === "members") {
28585
+ const membersAction = requirePositional(parsedArgv, 2, "members-action");
28586
+ const projectId = readStringOption(parsedArgv, "project-id");
28587
+ if (projectId === void 0) {
28588
+ throw new CliInputError("Missing required option --project-id.");
28589
+ }
28590
+ if (membersAction === "list") {
28591
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id"]);
28592
+ ensureNoExtraPositionals(parsedArgv, 3);
28593
+ return await (dependencies.listMembersCommand ?? listMembersWithAuthCommand)(
28594
+ appendCommonAuthOptions(parsedArgv, { projectId })
28595
+ );
28596
+ }
28597
+ if (membersAction === "invites") {
28598
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id"]);
28599
+ ensureNoExtraPositionals(parsedArgv, 3);
28600
+ return await (dependencies.listInvitesCommand ?? listInvitesWithAuthCommand)(
28601
+ appendCommonAuthOptions(parsedArgv, { projectId })
28602
+ );
28603
+ }
28604
+ if (membersAction === "invite") {
28605
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "email", "role"]);
28606
+ ensureNoExtraPositionals(parsedArgv, 3);
28607
+ const email = readStringOption(parsedArgv, "email");
28608
+ if (email === void 0) {
28609
+ throw new CliInputError("Missing required option --email.");
28610
+ }
28611
+ const role = readStringOption(parsedArgv, "role");
28612
+ if (role === void 0) {
28613
+ throw new CliInputError("Missing required option --role.");
28614
+ }
28615
+ return await (dependencies.inviteMemberCommand ?? inviteMemberWithAuthCommand)(
28616
+ appendCommonAuthOptions(parsedArgv, { projectId, email, role })
28617
+ );
28618
+ }
28619
+ if (membersAction === "cancel-invite") {
28620
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id"]);
28621
+ ensureNoExtraPositionals(parsedArgv, 4);
28622
+ return await (dependencies.cancelInviteCommand ?? cancelInviteWithAuthCommand)(
28623
+ appendCommonAuthOptions(parsedArgv, {
28624
+ projectId,
28625
+ inviteId: requirePositional(parsedArgv, 3, "invite-id")
28626
+ })
28627
+ );
28628
+ }
28629
+ if (membersAction === "update-role") {
28630
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "role"]);
28631
+ ensureNoExtraPositionals(parsedArgv, 4);
28632
+ const role = readStringOption(parsedArgv, "role");
28633
+ if (role === void 0) {
28634
+ throw new CliInputError("Missing required option --role.");
28635
+ }
28636
+ return await (dependencies.updateMemberRoleCommand ?? updateMemberRoleWithAuthCommand)(
28637
+ appendCommonAuthOptions(parsedArgv, {
28638
+ projectId,
28639
+ userId: requirePositional(parsedArgv, 3, "user-id"),
28640
+ role
28641
+ })
28642
+ );
28643
+ }
28644
+ if (membersAction === "remove") {
28645
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id"]);
28646
+ ensureNoExtraPositionals(parsedArgv, 4);
28647
+ return await (dependencies.removeMemberCommand ?? removeMemberWithAuthCommand)(
28648
+ appendCommonAuthOptions(parsedArgv, {
28649
+ projectId,
28650
+ userId: requirePositional(parsedArgv, 3, "user-id")
28651
+ })
28652
+ );
28653
+ }
28654
+ throw new CliInputError("Unknown project members command.");
28655
+ }
28535
28656
  if (action === "list") {
28536
28657
  expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "limit"]);
28537
28658
  ensureNoExtraPositionals(parsedArgv, 2);
@@ -28825,66 +28946,10 @@ async function handleProbeCommand(parsedArgv, dependencies) {
28825
28946
  }
28826
28947
  throw new CliInputError("Unknown probe command.");
28827
28948
  }
28828
- async function handleMemberCommand(parsedArgv, dependencies) {
28829
- const action = requirePositional(parsedArgv, 1, "action");
28830
- if (action === "list") {
28831
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json"]);
28832
- ensureNoExtraPositionals(parsedArgv, 2);
28833
- return await (dependencies.listMembersCommand ?? listMembersWithAuthCommand)(appendCommonAuthOptions(parsedArgv, {}));
28834
- }
28835
- if (action === "invites") {
28836
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json"]);
28837
- ensureNoExtraPositionals(parsedArgv, 2);
28838
- return await (dependencies.listInvitesCommand ?? listInvitesWithAuthCommand)(appendCommonAuthOptions(parsedArgv, {}));
28839
- }
28840
- if (action === "invite") {
28841
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "email", "role"]);
28842
- ensureNoExtraPositionals(parsedArgv, 2);
28843
- const email = readStringOption(parsedArgv, "email");
28844
- if (email === void 0) {
28845
- throw new CliInputError("Missing required option --email.");
28846
- }
28847
- const role = readStringOption(parsedArgv, "role");
28848
- if (role === void 0) {
28849
- throw new CliInputError("Missing required option --role.");
28850
- }
28851
- return await (dependencies.inviteMemberCommand ?? inviteMemberWithAuthCommand)(
28852
- appendCommonAuthOptions(parsedArgv, { email, role })
28853
- );
28854
- }
28855
- if (action === "cancel-invite") {
28856
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json"]);
28857
- ensureNoExtraPositionals(parsedArgv, 3);
28858
- return await (dependencies.cancelInviteCommand ?? cancelInviteWithAuthCommand)(
28859
- appendCommonAuthOptions(parsedArgv, {
28860
- inviteId: requirePositional(parsedArgv, 2, "invite-id")
28861
- })
28862
- );
28863
- }
28864
- if (action === "update-role") {
28865
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "role"]);
28866
- ensureNoExtraPositionals(parsedArgv, 3);
28867
- const role = readStringOption(parsedArgv, "role");
28868
- if (role === void 0) {
28869
- throw new CliInputError("Missing required option --role.");
28870
- }
28871
- return await (dependencies.updateMemberRoleCommand ?? updateMemberRoleWithAuthCommand)(
28872
- appendCommonAuthOptions(parsedArgv, {
28873
- userId: requirePositional(parsedArgv, 2, "user-id"),
28874
- role
28875
- })
28876
- );
28877
- }
28878
- if (action === "remove") {
28879
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json"]);
28880
- ensureNoExtraPositionals(parsedArgv, 3);
28881
- return await (dependencies.removeMemberCommand ?? removeMemberWithAuthCommand)(
28882
- appendCommonAuthOptions(parsedArgv, {
28883
- userId: requirePositional(parsedArgv, 2, "user-id")
28884
- })
28885
- );
28886
- }
28887
- throw new CliInputError("Unknown member command.");
28949
+ function handleMemberCommand(parsedArgv, dependencies) {
28950
+ void parsedArgv;
28951
+ void dependencies;
28952
+ throw new CliInputError("Use `debugbundle project members ... --project-id <id>` for project collaboration commands.");
28888
28953
  }
28889
28954
  async function handleWebhookCommand(parsedArgv, dependencies) {
28890
28955
  const action = requirePositional(parsedArgv, 1, "action");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugbundle/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "description": "Command-line interface for DebugBundle",
6
6
  "license": "AGPL-3.0-only",