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.
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
@@ -28,7 +28,7 @@ import {
28
28
  getCurrentTrace,
29
29
  reseedFromRegistry,
30
30
  seedFromRegistry
31
- } from "./chunk-53RMN23L.js";
31
+ } from "./chunk-JMZSZD22.js";
32
32
  import "./chunk-EGWJYCNT.js";
33
33
  import {
34
34
  BITFAB_PROGRESS_PREFIX,
@@ -37,7 +37,7 @@ import {
37
37
  ReplayError,
38
38
  reportReplayProgress,
39
39
  serializeReplayResult
40
- } from "./chunk-JKVR5436.js";
40
+ } from "./chunk-HIWCN36R.js";
41
41
  import {
42
42
  BitfabError,
43
43
  DEFAULT_SERVICE_URL,
@@ -45,7 +45,7 @@ import {
45
45
  MixedTracingError,
46
46
  __version__,
47
47
  flushTraces
48
- } from "./chunk-RZC7MYVZ.js";
48
+ } from "./chunk-I6HABUAU.js";
49
49
  import "./chunk-VCRFFCLY.js";
50
50
  export {
51
51
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.53.4";
100
+ __version__ = "0.53.5";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -5548,14 +5548,24 @@ var DatasetsClient = class {
5548
5548
  }
5549
5549
  /**
5550
5550
  * List datasets, scoped to one trace function when `traceFunctionKey` is
5551
- * given and organization-wide otherwise.
5551
+ * given and organization-wide otherwise. Fetches all pages automatically.
5552
5552
  */
5553
5553
  async list(params = {}) {
5554
- const query = params.traceFunctionKey === void 0 ? "" : `?traceFunctionKey=${encodeURIComponent(params.traceFunctionKey)}`;
5555
- const response = await this.httpClient.get(
5556
- `/api/sdk/datasets${query}`
5557
- );
5558
- return response.datasets;
5554
+ const datasets = [];
5555
+ let cursor;
5556
+ do {
5557
+ const query = new URLSearchParams({ limit: "100" });
5558
+ if (params.traceFunctionKey !== void 0) {
5559
+ query.set("traceFunctionKey", params.traceFunctionKey);
5560
+ }
5561
+ if (cursor !== void 0) {
5562
+ query.set("cursor", cursor);
5563
+ }
5564
+ const response = await this.httpClient.get(`/api/sdk/datasets?${query}`);
5565
+ datasets.push(...response.datasets);
5566
+ cursor = response.nextCursor ?? void 0;
5567
+ } while (cursor !== void 0);
5568
+ return datasets;
5559
5569
  }
5560
5570
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
5561
5571
  async get(datasetId) {
@@ -5564,11 +5574,18 @@ var DatasetsClient = class {
5564
5574
  );
5565
5575
  return response.dataset;
5566
5576
  }
5567
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
5577
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
5568
5578
  async listTraces(datasetId) {
5569
- return this.httpClient.get(
5570
- datasetPath(datasetId, "/traces")
5571
- );
5579
+ const traceIds = [];
5580
+ const query = new URLSearchParams({ limit: "100" });
5581
+ for (; ; ) {
5582
+ const page = await this.httpClient.get(`${datasetPath(datasetId, "/traces")}?${query}`);
5583
+ traceIds.push(...page.traceIds);
5584
+ if (page.nextCursor === void 0 || page.nextCursor === null) {
5585
+ return { datasetId: page.datasetId, traceIds };
5586
+ }
5587
+ query.set("cursor", page.nextCursor);
5588
+ }
5572
5589
  }
5573
5590
  /**
5574
5591
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the