@bitfab/sdk 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.
package/dist/index.d.cts CHANGED
@@ -1259,12 +1259,12 @@ declare class DatasetsClient {
1259
1259
  save(params: SaveDatasetParams): Promise<SaveDatasetResult>;
1260
1260
  /**
1261
1261
  * List datasets, scoped to one trace function when `traceFunctionKey` is
1262
- * given and organization-wide otherwise.
1262
+ * given and organization-wide otherwise. Fetches all pages automatically.
1263
1263
  */
1264
1264
  list(params?: ListDatasetsParams): Promise<Dataset[]>;
1265
1265
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
1266
1266
  get(datasetId: string): Promise<Dataset>;
1267
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
1267
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
1268
1268
  listTraces(datasetId: string): Promise<DatasetTraceIds>;
1269
1269
  /**
1270
1270
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the
@@ -3344,7 +3344,7 @@ interface CommitRef {
3344
3344
  /**
3345
3345
  * SDK version from package.json (injected at build time)
3346
3346
  */
3347
- declare const __version__ = "0.53.4";
3347
+ declare const __version__ = "0.53.5";
3348
3348
 
3349
3349
  /**
3350
3350
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -1259,12 +1259,12 @@ declare class DatasetsClient {
1259
1259
  save(params: SaveDatasetParams): Promise<SaveDatasetResult>;
1260
1260
  /**
1261
1261
  * List datasets, scoped to one trace function when `traceFunctionKey` is
1262
- * given and organization-wide otherwise.
1262
+ * given and organization-wide otherwise. Fetches all pages automatically.
1263
1263
  */
1264
1264
  list(params?: ListDatasetsParams): Promise<Dataset[]>;
1265
1265
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
1266
1266
  get(datasetId: string): Promise<Dataset>;
1267
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
1267
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
1268
1268
  listTraces(datasetId: string): Promise<DatasetTraceIds>;
1269
1269
  /**
1270
1270
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the
@@ -3344,7 +3344,7 @@ interface CommitRef {
3344
3344
  /**
3345
3345
  * SDK version from package.json (injected at build time)
3346
3346
  */
3347
- declare const __version__ = "0.53.4";
3347
+ declare const __version__ = "0.53.5";
3348
3348
 
3349
3349
  /**
3350
3350
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  getCurrentTrace,
20
20
  reseedFromRegistry,
21
21
  seedFromRegistry
22
- } from "./chunk-WQOA3SFF.js";
22
+ } from "./chunk-Q7IB5VFZ.js";
23
23
  import "./chunk-EGWJYCNT.js";
24
24
  import {
25
25
  BITFAB_PROGRESS_PREFIX,
@@ -28,7 +28,7 @@ import {
28
28
  ReplayError,
29
29
  reportReplayProgress,
30
30
  serializeReplayResult
31
- } from "./chunk-BZML7OQD.js";
31
+ } from "./chunk-PAL7VIWM.js";
32
32
  import {
33
33
  BitfabError,
34
34
  DEFAULT_SERVICE_URL,
@@ -36,7 +36,7 @@ import {
36
36
  MixedTracingError,
37
37
  __version__,
38
38
  flushTraces
39
- } from "./chunk-KTBWJLIN.js";
39
+ } from "./chunk-BOXLWX73.js";
40
40
  import "./chunk-VCRFFCLY.js";
41
41
  export {
42
42
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.53.4";
91
+ __version__ = "0.53.5";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -5539,14 +5539,24 @@ var DatasetsClient = class {
5539
5539
  }
5540
5540
  /**
5541
5541
  * List datasets, scoped to one trace function when `traceFunctionKey` is
5542
- * given and organization-wide otherwise.
5542
+ * given and organization-wide otherwise. Fetches all pages automatically.
5543
5543
  */
5544
5544
  async list(params = {}) {
5545
- const query = params.traceFunctionKey === void 0 ? "" : `?traceFunctionKey=${encodeURIComponent(params.traceFunctionKey)}`;
5546
- const response = await this.httpClient.get(
5547
- `/api/sdk/datasets${query}`
5548
- );
5549
- return response.datasets;
5545
+ const datasets = [];
5546
+ let cursor;
5547
+ do {
5548
+ const query = new URLSearchParams({ limit: "100" });
5549
+ if (params.traceFunctionKey !== void 0) {
5550
+ query.set("traceFunctionKey", params.traceFunctionKey);
5551
+ }
5552
+ if (cursor !== void 0) {
5553
+ query.set("cursor", cursor);
5554
+ }
5555
+ const response = await this.httpClient.get(`/api/sdk/datasets?${query}`);
5556
+ datasets.push(...response.datasets);
5557
+ cursor = response.nextCursor ?? void 0;
5558
+ } while (cursor !== void 0);
5559
+ return datasets;
5550
5560
  }
5551
5561
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
5552
5562
  async get(datasetId) {
@@ -5555,11 +5565,18 @@ var DatasetsClient = class {
5555
5565
  );
5556
5566
  return response.dataset;
5557
5567
  }
5558
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
5568
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
5559
5569
  async listTraces(datasetId) {
5560
- return this.httpClient.get(
5561
- datasetPath(datasetId, "/traces")
5562
- );
5570
+ const traceIds = [];
5571
+ const query = new URLSearchParams({ limit: "100" });
5572
+ for (; ; ) {
5573
+ const page = await this.httpClient.get(`${datasetPath(datasetId, "/traces")}?${query}`);
5574
+ traceIds.push(...page.traceIds);
5575
+ if (page.nextCursor === void 0 || page.nextCursor === null) {
5576
+ return { datasetId: page.datasetId, traceIds };
5577
+ }
5578
+ query.set("cursor", page.nextCursor);
5579
+ }
5563
5580
  }
5564
5581
  /**
5565
5582
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the