@bugbug-io/cli 14.12.0 → 14.15.0

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.
@@ -62,7 +62,7 @@ import {
62
62
  waitForSuiteRun,
63
63
  waitForTestRun,
64
64
  writeReportXml
65
- } from "./chunk-4F2H22FW.js";
65
+ } from "./chunk-SZUGTMMJ.js";
66
66
  import "./chunk-XLIBEETK.js";
67
67
  import "./chunk-3PJ4ZE2N.js";
68
68
  import {
@@ -11130,5 +11130,5 @@ react-router/dist/development/index.mjs:
11130
11130
  * @license MIT
11131
11131
  *)
11132
11132
  */
11133
- //# sourceMappingURL=NavigatorApp-PUXIO7DO.js.map
11133
+ //# sourceMappingURL=NavigatorApp-P3YEVOAZ.js.map
11134
11134
  //# debugId=9e90a61c-d567-5034-bd9e-55c33ff018a1
@@ -12,7 +12,7 @@ var startNavigator = async (opts = {}) => {
12
12
  const [{ render }, React, { NavigatorApp }] = await Promise.all([
13
13
  import("./render-CSMURV5U.js"),
14
14
  importReact(),
15
- import("./NavigatorApp-PUXIO7DO.js")
15
+ import("./NavigatorApp-P3YEVOAZ.js")
16
16
  ]);
17
17
  const element = React.createElement(
18
18
  NavigatorApp,
@@ -27,5 +27,5 @@ var startNavigator = async (opts = {}) => {
27
27
  export {
28
28
  startNavigator
29
29
  };
30
- //# sourceMappingURL=app-MFBVF6Q2.js.map
30
+ //# sourceMappingURL=app-UJ7NRJFQ.js.map
31
31
  //# debugId=cecc8c80-302a-54e0-a1fb-74d6bb70c0a1
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8675dd77-a641-587c-a627-1283a7335316")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f58491ba-632e-52c5-afd0-cdec54d4b5a2")}catch(e){}}();
3
3
  import { createRequire as __nodeCreateRequire } from 'node:module';
4
4
  const require = __nodeCreateRequire(import.meta.url);
5
5
  import {
@@ -8930,7 +8930,7 @@ var require_main = __commonJS({
8930
8930
  // ../core/package.json
8931
8931
  var package_default = {
8932
8932
  name: "@bugbug-io/core",
8933
- version: "14.12.0",
8933
+ version: "14.15.0",
8934
8934
  private: true,
8935
8935
  type: "module",
8936
8936
  main: "dist/index.js",
@@ -48051,9 +48051,9 @@ var ALLOWED_EVENT_DATA_KEYS = /* @__PURE__ */ new Set([
48051
48051
  "testRunId",
48052
48052
  "toolName"
48053
48053
  ]);
48054
- var buildTelemetryUrl = (apiUrl) => {
48054
+ var buildTelemetryUrl = (apiUrl, path3 = "events") => {
48055
48055
  const normalizedBaseUrl = apiUrl.replace(/\/+$/, "");
48056
- return `${normalizedBaseUrl}/telemetry/events/`;
48056
+ return `${normalizedBaseUrl}/telemetry/${path3}/`;
48057
48057
  };
48058
48058
  var sanitizeEventData = (data) => {
48059
48059
  const result = {};
@@ -48076,6 +48076,15 @@ var createAnalyticsService = (config) => {
48076
48076
  };
48077
48077
  const fetchImpl = configuredFetchImpl ?? globalThis.fetch?.bind(globalThis);
48078
48078
  const isEnabled3 = Boolean(config.telemetryEnabled && config.token && fetchImpl);
48079
+ const postTelemetry = (path3, payload) => fetchImpl?.(buildTelemetryUrl(config.apiUrl, path3), {
48080
+ method: "POST",
48081
+ headers: {
48082
+ Authorization: `Token ${config.token}`,
48083
+ "Content-Type": "application/json",
48084
+ "User-Agent": buildUserAgent(config.source, clientVersion)
48085
+ },
48086
+ body: JSON.stringify(payload)
48087
+ });
48079
48088
  return {
48080
48089
  setup: () => void 0,
48081
48090
  setGlobalEventData: (data) => {
@@ -48099,15 +48108,17 @@ var createAnalyticsService = (config) => {
48099
48108
  ...data
48100
48109
  })
48101
48110
  };
48102
- fetchImpl(buildTelemetryUrl(config.apiUrl), {
48103
- method: "POST",
48104
- headers: {
48105
- Authorization: `Token ${config.token}`,
48106
- "Content-Type": "application/json",
48107
- "User-Agent": buildUserAgent(config.source, clientVersion)
48108
- },
48109
- body: JSON.stringify(payload)
48110
- }).catch(() => void 0);
48111
+ postTelemetry("events", payload)?.catch(() => void 0);
48112
+ },
48113
+ submitFeedback: async (feedback) => {
48114
+ if (!isEnabled3)
48115
+ return false;
48116
+ try {
48117
+ const response = await postTelemetry("feedback", { ...feedback, source: config.source });
48118
+ return Boolean(response?.ok);
48119
+ } catch {
48120
+ return false;
48121
+ }
48111
48122
  },
48112
48123
  clearSession: () => {
48113
48124
  sessionId = "";
@@ -56539,7 +56550,8 @@ var ComponentsModule = class {
56539
56550
  /**
56540
56551
  * List all components with optional filtering and pagination
56541
56552
  *
56542
- * @param options - Query options including search query, page, and page size
56553
+ * @param options - Query options including search query, page, page size, and folder filters
56554
+ * (`folderId` for one folder, `noFolder` for components at the root)
56543
56555
  * @returns Paginated list of components with nested structure
56544
56556
  *
56545
56557
  * @example
@@ -56556,13 +56568,23 @@ var ComponentsModule = class {
56556
56568
  * ```
56557
56569
  */
56558
56570
  list = async (options = {}) => {
56559
- const { query: searchQuery, cursor, pageSize, ordering, ...requestOptions } = options;
56571
+ const {
56572
+ query: searchQuery,
56573
+ cursor,
56574
+ pageSize,
56575
+ ordering,
56576
+ folderId,
56577
+ noFolder,
56578
+ ...requestOptions
56579
+ } = options;
56560
56580
  return this.#client.get("/components/", {
56561
56581
  queryParams: {
56562
56582
  query: searchQuery,
56563
56583
  cursor,
56564
56584
  page_size: pageSize,
56565
- ordering
56585
+ ordering,
56586
+ folderId,
56587
+ noFolder
56566
56588
  },
56567
56589
  ...requestOptions
56568
56590
  });
@@ -56665,6 +56687,124 @@ var ConfigModule = class {
56665
56687
  };
56666
56688
  };
56667
56689
  };
56690
+ var FoldersModule = class {
56691
+ #client;
56692
+ constructor(client) {
56693
+ this.#client = client;
56694
+ }
56695
+ /**
56696
+ * List folders with pagination, filtering, and ordering.
56697
+ *
56698
+ * @param options.kind - Only folders of this kind.
56699
+ * @param options.parentId - Only direct children of this folder.
56700
+ * @param options.query - Search query matched against folder name.
56701
+ * @param options.ordering - Sort key; prefix with `-` for descending.
56702
+ * @returns Paginated `FoldersListResponse`.
56703
+ */
56704
+ list = async (options = {}) => {
56705
+ const {
56706
+ kind,
56707
+ parentId,
56708
+ query: searchQuery,
56709
+ page,
56710
+ pageSize,
56711
+ ordering,
56712
+ ...requestOptions
56713
+ } = options;
56714
+ return this.#client.get("/folders/", {
56715
+ queryParams: {
56716
+ kind,
56717
+ parentId,
56718
+ query: searchQuery,
56719
+ page,
56720
+ page_size: pageSize,
56721
+ ordering
56722
+ },
56723
+ ...requestOptions
56724
+ });
56725
+ };
56726
+ /**
56727
+ * Fetch every folder across all pages.
56728
+ */
56729
+ getAll = async (options = {}) => {
56730
+ const folders = [];
56731
+ const pageSize = options.pageSize ?? 100;
56732
+ let page = 1;
56733
+ while (true) {
56734
+ const response = await this.list({ ...options, pageSize, page });
56735
+ folders.push(...response.results);
56736
+ if (response.results.length === 0 || folders.length >= response.count) return folders;
56737
+ page++;
56738
+ }
56739
+ };
56740
+ /**
56741
+ * Fetch the full nested folder tree for one kind.
56742
+ *
56743
+ * Each node's `contentCount` covers its whole subtree.
56744
+ *
56745
+ * @param kind - `test` or `component`.
56746
+ * @returns Root folders with nested `children`.
56747
+ */
56748
+ getTree = async (kind, options = {}) => {
56749
+ const response = await this.#client.get(
56750
+ "/folders/tree/",
56751
+ {
56752
+ queryParams: { kind },
56753
+ ...options
56754
+ }
56755
+ );
56756
+ return Array.isArray(response) ? response : response.results ?? [];
56757
+ };
56758
+ /**
56759
+ * Fetch a single folder by ID.
56760
+ *
56761
+ * @throws {NotFoundError} When no folder matches `folderId`.
56762
+ */
56763
+ get = async (folderId, options = {}) => this.#client.get("/folders/{id}/", {
56764
+ pathParams: { id: folderId },
56765
+ ...options
56766
+ });
56767
+ /**
56768
+ * Create a folder. Omit `parentId` (or pass `null`) to create it at the root.
56769
+ *
56770
+ * @throws {ValidationError} On invalid name, duplicate sibling name, kind mismatch, or depth limit.
56771
+ * @throws {SubscriptionError} When the plan does not include folders.
56772
+ */
56773
+ create = async (data, options = {}) => this.#client.post("/folders/", {
56774
+ body: data,
56775
+ ...options
56776
+ });
56777
+ /**
56778
+ * Rename and/or move a folder. Pass `parentId: null` to move it to the root.
56779
+ *
56780
+ * @throws {NotFoundError} When the folder does not exist.
56781
+ * @throws {ValidationError} On invalid name, circular move, or depth limit.
56782
+ * @throws {SubscriptionError} When renaming on a plan without folders.
56783
+ */
56784
+ update = async (folderId, data, options = {}) => this.#client.patch("/folders/{id}/", {
56785
+ pathParams: { id: folderId },
56786
+ body: data,
56787
+ ...options
56788
+ });
56789
+ /**
56790
+ * Delete a folder.
56791
+ *
56792
+ * Without `force`, a non-empty folder is rejected. With `force: true`, the
56793
+ * whole subtree and its contained tests/components are deleted.
56794
+ * Move items elsewhere before deleting the folder to preserve them.
56795
+ *
56796
+ * @throws {NotFoundError} When the folder does not exist.
56797
+ * @throws {ValidationError} When the folder is not empty and `force` is not set.
56798
+ */
56799
+ delete = async (folderId, options = {}) => {
56800
+ const { force, ...requestOptions } = options;
56801
+ return this.#client.delete("/folders/{id}/", {
56802
+ pathParams: { id: folderId },
56803
+ queryParams: { force: force ? "true" : void 0 },
56804
+ ...requestOptions
56805
+ });
56806
+ };
56807
+ };
56668
56808
  var DEFAULT_PAGE_SIZE = 100;
56669
56809
  var getAllPages = async (listPage, options = {}) => {
56670
56810
  const items = [];
@@ -56691,16 +56831,28 @@ var GroupsModule = class {
56691
56831
  *
56692
56832
  * @param options.query - Search query matched against group name.
56693
56833
  * @param options.ordering - Sort key; prefix with `-` for descending.
56834
+ * @param options.folderId - Only components directly in this folder.
56835
+ * @param options.noFolder - Only components at the root (not in any folder).
56694
56836
  * @returns Paginated `GroupsListResponse`.
56695
56837
  */
56696
56838
  list = async (options = {}) => {
56697
- const { query: searchQuery, cursor, pageSize, ordering, ...requestOptions } = options;
56839
+ const {
56840
+ query: searchQuery,
56841
+ cursor,
56842
+ pageSize,
56843
+ ordering,
56844
+ folderId,
56845
+ noFolder,
56846
+ ...requestOptions
56847
+ } = options;
56698
56848
  return this.#client.get("/groups/", {
56699
56849
  queryParams: {
56700
56850
  query: searchQuery,
56701
56851
  cursor,
56702
56852
  page_size: pageSize,
56703
- ordering
56853
+ ordering,
56854
+ folderId,
56855
+ noFolder
56704
56856
  },
56705
56857
  ...requestOptions
56706
56858
  });
@@ -57672,6 +57824,8 @@ var TestsModule = class {
57672
57824
  * @param options.query - Search query matched against test name.
57673
57825
  * @param options.ordering - Sort key; prefix with `-` for descending.
57674
57826
  * @param options.latestRun - Include the latest run summary for each test.
57827
+ * @param options.folderId - Only tests directly in this folder.
57828
+ * @param options.noFolder - Only tests at the root (not in any folder).
57675
57829
  * @returns Paginated `TestsListResponse` envelope (validated via Zod).
57676
57830
  * @throws {UnexpectedResponseError} When the server response fails Zod validation.
57677
57831
  */
@@ -57682,6 +57836,8 @@ var TestsModule = class {
57682
57836
  query: searchQuery,
57683
57837
  ordering,
57684
57838
  latestRun,
57839
+ folderId,
57840
+ noFolder,
57685
57841
  ...requestOptions
57686
57842
  } = options;
57687
57843
  return this.#client.get("/tests/", {
@@ -57690,7 +57846,9 @@ var TestsModule = class {
57690
57846
  page_size: pageSize,
57691
57847
  query: searchQuery,
57692
57848
  ordering,
57693
- latestRun
57849
+ latestRun,
57850
+ folderId,
57851
+ noFolder
57694
57852
  },
57695
57853
  ...requestOptions
57696
57854
  });
@@ -58030,6 +58188,51 @@ var TestsModule = class {
58030
58188
  pathParams: { id: runId, artifact_type: artifactType },
58031
58189
  ...options
58032
58190
  });
58191
+ /**
58192
+ * Get the email inbox of a test run with its (optionally filtered) messages.
58193
+ *
58194
+ * @param runId - UUID of the run.
58195
+ * @param options - Inbox filters (`search`, `from`, `unseen`, ...) plus request options.
58196
+ */
58197
+ getRunInbox = async (runId, options = {}) => {
58198
+ const { signal, timeout, headers, ...queryParams } = options;
58199
+ return this.#client.get("/testruns/{id}/inbox/", {
58200
+ pathParams: { id: runId },
58201
+ queryParams,
58202
+ signal,
58203
+ timeout,
58204
+ headers
58205
+ });
58206
+ };
58207
+ /**
58208
+ * Fetch a single inbox message, including its HTML body.
58209
+ *
58210
+ * @throws {NotFoundError} When the message does not exist in the run inbox.
58211
+ */
58212
+ getRunInboxMessage = async (runId, messageId, options = {}) => this.#client.get("/testruns/{id}/inbox/messages/{message_id}/", {
58213
+ pathParams: { id: runId, message_id: messageId },
58214
+ ...options
58215
+ });
58216
+ /**
58217
+ * Delete all messages from a test run inbox.
58218
+ */
58219
+ clearRunInbox = async (runId, options = {}) => {
58220
+ await this.#client.delete("/testruns/{id}/inbox/", {
58221
+ pathParams: { id: runId },
58222
+ ...options
58223
+ });
58224
+ };
58225
+ /**
58226
+ * Delete a single message from a test run inbox.
58227
+ *
58228
+ * @throws {NotFoundError} When the message does not exist in the run inbox.
58229
+ */
58230
+ deleteRunInboxMessage = async (runId, messageId, options = {}) => {
58231
+ await this.#client.delete("/testruns/{id}/inbox/messages/{message_id}/", {
58232
+ pathParams: { id: runId, message_id: messageId },
58233
+ ...options
58234
+ });
58235
+ };
58033
58236
  export(testId, fmt2, options = {}) {
58034
58237
  if (fmt2 === "yaml") {
58035
58238
  return this.#client.getText("/tests/{id}/export/{fmt}/", {
@@ -58333,7 +58536,7 @@ var readEnvFiles2 = (cwd) => {
58333
58536
  var buildUserAgent2 = (clientType, version) => `BugBug ${clientType.toUpperCase()} ${version}`;
58334
58537
  var package_default2 = {
58335
58538
  name: "@bugbug-io/core",
58336
- version: "14.12.0",
58539
+ version: "14.15.0",
58337
58540
  private: true,
58338
58541
  type: "module",
58339
58542
  main: "dist/index.js",
@@ -58793,7 +58996,7 @@ function parseErrorBody(error3) {
58793
58996
  }
58794
58997
  }
58795
58998
  function extractFieldErrors(body) {
58796
- if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
58999
+ if (!body || typeof body !== "object") return void 0;
58797
59000
  const out = {};
58798
59001
  const walk = (value, path3) => {
58799
59002
  if (value === null || value === void 0) return;
@@ -59553,6 +59756,7 @@ var BugBugSDK = class {
59553
59756
  config;
59554
59757
  groups;
59555
59758
  components;
59759
+ folders;
59556
59760
  steps;
59557
59761
  stepRuns;
59558
59762
  project;
@@ -59573,6 +59777,7 @@ var BugBugSDK = class {
59573
59777
  this.config = new ConfigModule(this.#client);
59574
59778
  this.groups = new GroupsModule(this.#client);
59575
59779
  this.components = new ComponentsModule(this.#client);
59780
+ this.folders = new FoldersModule(this.#client);
59576
59781
  this.steps = new StepsModule(this.#client);
59577
59782
  this.stepRuns = new StepRunsModule(this.#client);
59578
59783
  this.project = new ProjectModule(this.#client);
@@ -65078,5 +65283,5 @@ export {
65078
65283
  formatErrorMessage,
65079
65284
  showError
65080
65285
  };
65081
- //# sourceMappingURL=chunk-4F2H22FW.js.map
65082
- //# debugId=8675dd77-a641-587c-a627-1283a7335316
65286
+ //# sourceMappingURL=chunk-SZUGTMMJ.js.map
65287
+ //# debugId=f58491ba-632e-52c5-afd0-cdec54d4b5a2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7dad2c83-efca-56ee-993a-465e4a3a77e6")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6d7999fb-fef8-5334-afcb-dbaf0a606051")}catch(e){}}();
4
4
  import { createRequire as __nodeCreateRequire } from 'node:module';
5
5
  const require = __nodeCreateRequire(import.meta.url);
6
6
  import {
@@ -66,7 +66,7 @@ import {
66
66
  waitForSuiteRun,
67
67
  waitForTestRun,
68
68
  writeReportXml
69
- } from "./chunk-4F2H22FW.js";
69
+ } from "./chunk-SZUGTMMJ.js";
70
70
  import "./chunk-XLIBEETK.js";
71
71
  import "./chunk-3PJ4ZE2N.js";
72
72
  import {
@@ -3183,10 +3183,11 @@ var PLUGINS_CLI_ENV = {
3183
3183
  DO_NOT_TRACK: "1"
3184
3184
  };
3185
3185
  var PLUGINS_CLI_MARKETPLACE = "plugins-cli";
3186
+ var PLUGINS_CLI_PACKAGE = "plugins@1.3.5";
3186
3187
  var buildPluginsCliArgv = (target, source) => [
3187
3188
  "npx",
3188
3189
  "-y",
3189
- "plugins",
3190
+ PLUGINS_CLI_PACKAGE,
3190
3191
  "add",
3191
3192
  source,
3192
3193
  "--target",
@@ -4560,7 +4561,7 @@ program2.exitOverride();
4560
4561
  });
4561
4562
  analytics.trackEvent("cli_session_started");
4562
4563
  if (startupMode.type === "commandline" && await shouldRedirectUnauthenticatedCommandToInit(process.argv, hasUsableSession)) {
4563
- const { startNavigator } = await import("./app-MFBVF6Q2.js");
4564
+ const { startNavigator } = await import("./app-UJ7NRJFQ.js");
4564
4565
  await startNavigator({
4565
4566
  initialRoute: "/init",
4566
4567
  initialRouteState: {
@@ -4572,7 +4573,7 @@ program2.exitOverride();
4572
4573
  return;
4573
4574
  }
4574
4575
  if (startupMode.type === "navigator") {
4575
- const { startNavigator } = await import("./app-MFBVF6Q2.js");
4576
+ const { startNavigator } = await import("./app-UJ7NRJFQ.js");
4576
4577
  await startNavigator({
4577
4578
  initialRoute: startupMode.route,
4578
4579
  token: config.token,
@@ -4609,4 +4610,4 @@ program2.exitOverride();
4609
4610
  }
4610
4611
  })();
4611
4612
  //# sourceMappingURL=index.js.map
4612
- //# debugId=7dad2c83-efca-56ee-993a-465e4a3a77e6
4613
+ //# debugId=6d7999fb-fef8-5334-afcb-dbaf0a606051
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugbug-io/cli",
3
- "version": "14.12.0",
3
+ "version": "14.15.0",
4
4
  "description": "BugBug CLI for test automation, CI workflows, and AI-agent plugin installation",
5
5
  "type": "module",
6
6
  "bin": {