bitfab 0.53.4 → 0.53.5

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.
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-DIYUW2KO.js";
9
+ } from "./chunk-A67P4IPJ.js";
10
10
  export {
11
11
  BitfabError,
12
12
  HttpClient,
@@ -16,4 +16,4 @@ export {
16
16
  parseRetryAfterMs,
17
17
  serializePayloadBody
18
18
  };
19
- //# sourceMappingURL=http-VRS3FQU3.js.map
19
+ //# sourceMappingURL=http-7G364U2F.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-RZC7MYVZ.js";
9
+ } from "./chunk-I6HABUAU.js";
10
10
  import "./chunk-VCRFFCLY.js";
11
11
  export {
12
12
  BitfabError,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-7WGJNBGI.js.map
20
+ //# sourceMappingURL=http-VZG3GUGE.js.map
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ var __version__, __packageName__;
51
51
  var init_version_generated = __esm({
52
52
  "src/version.generated.ts"() {
53
53
  "use strict";
54
- __version__ = "0.53.4";
54
+ __version__ = "0.53.5";
55
55
  __packageName__ = "bitfab";
56
56
  }
57
57
  });
@@ -5534,14 +5534,24 @@ var DatasetsClient = class {
5534
5534
  }
5535
5535
  /**
5536
5536
  * List datasets, scoped to one trace function when `traceFunctionKey` is
5537
- * given and organization-wide otherwise.
5537
+ * given and organization-wide otherwise. Fetches all pages automatically.
5538
5538
  */
5539
5539
  async list(params = {}) {
5540
- const query = params.traceFunctionKey === void 0 ? "" : `?traceFunctionKey=${encodeURIComponent(params.traceFunctionKey)}`;
5541
- const response = await this.httpClient.get(
5542
- `/api/sdk/datasets${query}`
5543
- );
5544
- return response.datasets;
5540
+ const datasets = [];
5541
+ let cursor;
5542
+ do {
5543
+ const query = new URLSearchParams({ limit: "100" });
5544
+ if (params.traceFunctionKey !== void 0) {
5545
+ query.set("traceFunctionKey", params.traceFunctionKey);
5546
+ }
5547
+ if (cursor !== void 0) {
5548
+ query.set("cursor", cursor);
5549
+ }
5550
+ const response = await this.httpClient.get(`/api/sdk/datasets?${query}`);
5551
+ datasets.push(...response.datasets);
5552
+ cursor = response.nextCursor ?? void 0;
5553
+ } while (cursor !== void 0);
5554
+ return datasets;
5545
5555
  }
5546
5556
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
5547
5557
  async get(datasetId) {
@@ -5550,11 +5560,18 @@ var DatasetsClient = class {
5550
5560
  );
5551
5561
  return response.dataset;
5552
5562
  }
5553
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
5563
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
5554
5564
  async listTraces(datasetId) {
5555
- return this.httpClient.get(
5556
- datasetPath(datasetId, "/traces")
5557
- );
5565
+ const traceIds = [];
5566
+ const query = new URLSearchParams({ limit: "100" });
5567
+ for (; ; ) {
5568
+ const page = await this.httpClient.get(`${datasetPath(datasetId, "/traces")}?${query}`);
5569
+ traceIds.push(...page.traceIds);
5570
+ if (page.nextCursor === void 0 || page.nextCursor === null) {
5571
+ return { datasetId: page.datasetId, traceIds };
5572
+ }
5573
+ query.set("cursor", page.nextCursor);
5574
+ }
5558
5575
  }
5559
5576
  /**
5560
5577
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the