@bugbug-io/cli 14.13.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-H5GEPM6E.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-BN43AMWS.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-BN43AMWS.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-KCQRODEZ.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]="9c1eeb28-b715-561a-bb16-fdf41fafcc76")}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.13.0",
8933
+ version: "14.15.0",
8934
8934
  private: true,
8935
8935
  type: "module",
8936
8936
  main: "dist/index.js",
@@ -56550,7 +56550,8 @@ var ComponentsModule = class {
56550
56550
  /**
56551
56551
  * List all components with optional filtering and pagination
56552
56552
  *
56553
- * @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)
56554
56555
  * @returns Paginated list of components with nested structure
56555
56556
  *
56556
56557
  * @example
@@ -56567,13 +56568,23 @@ var ComponentsModule = class {
56567
56568
  * ```
56568
56569
  */
56569
56570
  list = async (options = {}) => {
56570
- 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;
56571
56580
  return this.#client.get("/components/", {
56572
56581
  queryParams: {
56573
56582
  query: searchQuery,
56574
56583
  cursor,
56575
56584
  page_size: pageSize,
56576
- ordering
56585
+ ordering,
56586
+ folderId,
56587
+ noFolder
56577
56588
  },
56578
56589
  ...requestOptions
56579
56590
  });
@@ -56676,6 +56687,124 @@ var ConfigModule = class {
56676
56687
  };
56677
56688
  };
56678
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
+ };
56679
56808
  var DEFAULT_PAGE_SIZE = 100;
56680
56809
  var getAllPages = async (listPage, options = {}) => {
56681
56810
  const items = [];
@@ -56702,16 +56831,28 @@ var GroupsModule = class {
56702
56831
  *
56703
56832
  * @param options.query - Search query matched against group name.
56704
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).
56705
56836
  * @returns Paginated `GroupsListResponse`.
56706
56837
  */
56707
56838
  list = async (options = {}) => {
56708
- 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;
56709
56848
  return this.#client.get("/groups/", {
56710
56849
  queryParams: {
56711
56850
  query: searchQuery,
56712
56851
  cursor,
56713
56852
  page_size: pageSize,
56714
- ordering
56853
+ ordering,
56854
+ folderId,
56855
+ noFolder
56715
56856
  },
56716
56857
  ...requestOptions
56717
56858
  });
@@ -57683,6 +57824,8 @@ var TestsModule = class {
57683
57824
  * @param options.query - Search query matched against test name.
57684
57825
  * @param options.ordering - Sort key; prefix with `-` for descending.
57685
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).
57686
57829
  * @returns Paginated `TestsListResponse` envelope (validated via Zod).
57687
57830
  * @throws {UnexpectedResponseError} When the server response fails Zod validation.
57688
57831
  */
@@ -57693,6 +57836,8 @@ var TestsModule = class {
57693
57836
  query: searchQuery,
57694
57837
  ordering,
57695
57838
  latestRun,
57839
+ folderId,
57840
+ noFolder,
57696
57841
  ...requestOptions
57697
57842
  } = options;
57698
57843
  return this.#client.get("/tests/", {
@@ -57701,7 +57846,9 @@ var TestsModule = class {
57701
57846
  page_size: pageSize,
57702
57847
  query: searchQuery,
57703
57848
  ordering,
57704
- latestRun
57849
+ latestRun,
57850
+ folderId,
57851
+ noFolder
57705
57852
  },
57706
57853
  ...requestOptions
57707
57854
  });
@@ -58389,7 +58536,7 @@ var readEnvFiles2 = (cwd) => {
58389
58536
  var buildUserAgent2 = (clientType, version) => `BugBug ${clientType.toUpperCase()} ${version}`;
58390
58537
  var package_default2 = {
58391
58538
  name: "@bugbug-io/core",
58392
- version: "14.13.0",
58539
+ version: "14.15.0",
58393
58540
  private: true,
58394
58541
  type: "module",
58395
58542
  main: "dist/index.js",
@@ -58849,7 +58996,7 @@ function parseErrorBody(error3) {
58849
58996
  }
58850
58997
  }
58851
58998
  function extractFieldErrors(body) {
58852
- if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
58999
+ if (!body || typeof body !== "object") return void 0;
58853
59000
  const out = {};
58854
59001
  const walk = (value, path3) => {
58855
59002
  if (value === null || value === void 0) return;
@@ -59609,6 +59756,7 @@ var BugBugSDK = class {
59609
59756
  config;
59610
59757
  groups;
59611
59758
  components;
59759
+ folders;
59612
59760
  steps;
59613
59761
  stepRuns;
59614
59762
  project;
@@ -59629,6 +59777,7 @@ var BugBugSDK = class {
59629
59777
  this.config = new ConfigModule(this.#client);
59630
59778
  this.groups = new GroupsModule(this.#client);
59631
59779
  this.components = new ComponentsModule(this.#client);
59780
+ this.folders = new FoldersModule(this.#client);
59632
59781
  this.steps = new StepsModule(this.#client);
59633
59782
  this.stepRuns = new StepRunsModule(this.#client);
59634
59783
  this.project = new ProjectModule(this.#client);
@@ -65134,5 +65283,5 @@ export {
65134
65283
  formatErrorMessage,
65135
65284
  showError
65136
65285
  };
65137
- //# sourceMappingURL=chunk-H5GEPM6E.js.map
65138
- //# debugId=9c1eeb28-b715-561a-bb16-fdf41fafcc76
65286
+ //# sourceMappingURL=chunk-SZUGTMMJ.js.map
65287
+ //# debugId=f58491ba-632e-52c5-afd0-cdec54d4b5a2
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ import {
66
66
  waitForSuiteRun,
67
67
  waitForTestRun,
68
68
  writeReportXml
69
- } from "./chunk-H5GEPM6E.js";
69
+ } from "./chunk-SZUGTMMJ.js";
70
70
  import "./chunk-XLIBEETK.js";
71
71
  import "./chunk-3PJ4ZE2N.js";
72
72
  import {
@@ -4561,7 +4561,7 @@ program2.exitOverride();
4561
4561
  });
4562
4562
  analytics.trackEvent("cli_session_started");
4563
4563
  if (startupMode.type === "commandline" && await shouldRedirectUnauthenticatedCommandToInit(process.argv, hasUsableSession)) {
4564
- const { startNavigator } = await import("./app-KCQRODEZ.js");
4564
+ const { startNavigator } = await import("./app-UJ7NRJFQ.js");
4565
4565
  await startNavigator({
4566
4566
  initialRoute: "/init",
4567
4567
  initialRouteState: {
@@ -4573,7 +4573,7 @@ program2.exitOverride();
4573
4573
  return;
4574
4574
  }
4575
4575
  if (startupMode.type === "navigator") {
4576
- const { startNavigator } = await import("./app-KCQRODEZ.js");
4576
+ const { startNavigator } = await import("./app-UJ7NRJFQ.js");
4577
4577
  await startNavigator({
4578
4578
  initialRoute: startupMode.route,
4579
4579
  token: config.token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugbug-io/cli",
3
- "version": "14.13.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": {