@debugbundle/cli 1.18.0 → 1.18.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
@@ -1,5 +1,13 @@
1
1
  # @debugbundle/cli
2
2
 
3
+ In a connected workspace, `debugbundle incidents` and `--source cloud` default
4
+ their cloud requests to the connection's `cloud_project_id`. `--project-id <id>`
5
+ overrides that default. All cloud pages retain the selected project; local
6
+ evidence keeps its existing selection. An unusable connected project returns
7
+ `invalid_local_connection_config` before a list request: pass the intended
8
+ `--project-id` or repair the connection. Account-wide reads remain supported
9
+ outside a connected workspace.
10
+
3
11
  Command-line interface for DebugBundle.
4
12
 
5
13
  Notification preferences support account and project scopes, personal email or shared
package/dist/main.cjs CHANGED
@@ -61852,7 +61852,8 @@ function parseLocalConnection(candidate) {
61852
61852
  throw createReadError(400, "invalid_local_connection_config");
61853
61853
  }
61854
61854
  return {
61855
- mode: candidate["mode"]
61855
+ mode: candidate["mode"],
61856
+ ...candidate["cloud_project_id"] === void 0 ? {} : { cloud_project_id: candidate["cloud_project_id"] }
61856
61857
  };
61857
61858
  }
61858
61859
  function parseLocalIncident(candidate) {
@@ -61987,6 +61988,19 @@ async function readLocalConnectionConfig(dependencies) {
61987
61988
  throw error62;
61988
61989
  }
61989
61990
  }
61991
+ var IncidentProjectIdSchema = external_exports.string().trim().min(1);
61992
+ async function resolveCloudIncidentProjectId(projectId, dependencies) {
61993
+ if (projectId !== void 0) {
61994
+ const parsed2 = IncidentProjectIdSchema.safeParse(projectId);
61995
+ if (!parsed2.success) throw createReadError(400, "invalid_project_id");
61996
+ return parsed2.data;
61997
+ }
61998
+ const connection = await readLocalConnectionConfig(dependencies);
61999
+ if (connection?.mode !== "connected") return void 0;
62000
+ const parsed = IncidentProjectIdSchema.safeParse(connection.cloud_project_id);
62001
+ if (!parsed.success) throw createReadError(400, "invalid_local_connection_config");
62002
+ return parsed.data;
62003
+ }
61990
62004
  async function readLocalState(dependencies) {
61991
62005
  const rootDirectory = getWorkspaceRoot(dependencies);
61992
62006
  try {
@@ -70151,10 +70165,11 @@ async function mapCombinedIncidentListResult(input3, api, dependencies) {
70151
70165
  },
70152
70166
  dependencies
70153
70167
  );
70168
+ const cloudProjectId = await resolveCloudIncidentProjectId(input3.projectId, dependencies);
70154
70169
  const cloudIncidents = await listAllCloudIncidents(
70155
70170
  {
70156
70171
  bearerToken: input3.bearerToken,
70157
- ...input3.projectId === void 0 ? {} : { projectId: input3.projectId },
70172
+ ...cloudProjectId === void 0 ? {} : { projectId: cloudProjectId },
70158
70173
  ...input3.environment === void 0 ? {} : { environment: input3.environment },
70159
70174
  ...input3.service === void 0 ? {} : { service: input3.service },
70160
70175
  ...input3.status === void 0 ? {} : { status: input3.status },
@@ -70288,12 +70303,15 @@ async function listIncidentsWithAuthCommand(input3, dependencies) {
70288
70303
  return runAuthenticatedCliCommand(input3, {
70289
70304
  createApi: createAuthenticatedRetrievalApi,
70290
70305
  dependencies,
70291
- runCommand: (authState, api) => {
70306
+ runCommand: async (authState, api) => {
70292
70307
  const commandInput = {
70293
70308
  bearerToken: authState.bearer_token
70294
70309
  };
70295
- if (input3.projectId !== void 0) {
70296
- commandInput.projectId = input3.projectId;
70310
+ try {
70311
+ const projectId = await resolveCloudIncidentProjectId(input3.projectId, dependencies);
70312
+ if (projectId !== void 0) commandInput.projectId = projectId;
70313
+ } catch (error62) {
70314
+ return mapErrorToResult(error62);
70297
70315
  }
70298
70316
  if (input3.environment !== void 0) {
70299
70317
  commandInput.environment = input3.environment;
@@ -81188,7 +81206,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
81188
81206
  // package.json
81189
81207
  var package_default = {
81190
81208
  name: "@debugbundle/cli",
81191
- version: "1.18.0",
81209
+ version: "1.18.1",
81192
81210
  private: false,
81193
81211
  description: "Command-line interface for DebugBundle",
81194
81212
  license: "Apache-2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugbundle/cli",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "private": false,
5
5
  "description": "Command-line interface for DebugBundle",
6
6
  "license": "Apache-2.0",