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.
@@ -19,7 +19,7 @@ import {
19
19
  serializeValue,
20
20
  toJsonSafe,
21
21
  toJsonSafeReport
22
- } from "./chunk-JKVR5436.js";
22
+ } from "./chunk-HIWCN36R.js";
23
23
  import {
24
24
  BitfabError,
25
25
  DEFAULT_SERVICE_URL,
@@ -35,7 +35,7 @@ import {
35
35
  recordCallerTraceMetadata,
36
36
  retireTraceMetadata,
37
37
  warnOnce
38
- } from "./chunk-RZC7MYVZ.js";
38
+ } from "./chunk-I6HABUAU.js";
39
39
  import {
40
40
  __privateAdd,
41
41
  __privateGet,
@@ -1290,14 +1290,24 @@ var DatasetsClient = class {
1290
1290
  }
1291
1291
  /**
1292
1292
  * List datasets, scoped to one trace function when `traceFunctionKey` is
1293
- * given and organization-wide otherwise.
1293
+ * given and organization-wide otherwise. Fetches all pages automatically.
1294
1294
  */
1295
1295
  async list(params = {}) {
1296
- const query = params.traceFunctionKey === void 0 ? "" : `?traceFunctionKey=${encodeURIComponent(params.traceFunctionKey)}`;
1297
- const response = await this.httpClient.get(
1298
- `/api/sdk/datasets${query}`
1299
- );
1300
- return response.datasets;
1296
+ const datasets = [];
1297
+ let cursor;
1298
+ do {
1299
+ const query = new URLSearchParams({ limit: "100" });
1300
+ if (params.traceFunctionKey !== void 0) {
1301
+ query.set("traceFunctionKey", params.traceFunctionKey);
1302
+ }
1303
+ if (cursor !== void 0) {
1304
+ query.set("cursor", cursor);
1305
+ }
1306
+ const response = await this.httpClient.get(`/api/sdk/datasets?${query}`);
1307
+ datasets.push(...response.datasets);
1308
+ cursor = response.nextCursor ?? void 0;
1309
+ } while (cursor !== void 0);
1310
+ return datasets;
1301
1311
  }
1302
1312
  /** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
1303
1313
  async get(datasetId) {
@@ -1306,11 +1316,18 @@ var DatasetsClient = class {
1306
1316
  );
1307
1317
  return response.dataset;
1308
1318
  }
1309
- /** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
1319
+ /** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
1310
1320
  async listTraces(datasetId) {
1311
- return this.httpClient.get(
1312
- datasetPath(datasetId, "/traces")
1313
- );
1321
+ const traceIds = [];
1322
+ const query = new URLSearchParams({ limit: "100" });
1323
+ for (; ; ) {
1324
+ const page = await this.httpClient.get(`${datasetPath(datasetId, "/traces")}?${query}`);
1325
+ traceIds.push(...page.traceIds);
1326
+ if (page.nextCursor === void 0 || page.nextCursor === null) {
1327
+ return { datasetId: page.datasetId, traceIds };
1328
+ }
1329
+ query.set("cursor", page.nextCursor);
1330
+ }
1314
1331
  }
1315
1332
  /**
1316
1333
  * Add traces to the dataset (1 to 100 ids per call). Traces outside the
@@ -5059,7 +5076,7 @@ var Bitfab = class {
5059
5076
  await runWithSeedContext({ traceId }, async () => target(...args));
5060
5077
  } finally {
5061
5078
  try {
5062
- const { flushTraces: flushTraces2 } = await import("./http-7WGJNBGI.js");
5079
+ const { flushTraces: flushTraces2 } = await import("./http-VZG3GUGE.js");
5063
5080
  await flushTraces2(3e4);
5064
5081
  } finally {
5065
5082
  unrecorded = activeTraceStates.delete(traceId);
@@ -5118,7 +5135,7 @@ var Bitfab = class {
5118
5135
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
5119
5136
  );
5120
5137
  }
5121
- const { replay: doReplay } = await import("./replay-LRCSZ7IX.js");
5138
+ const { replay: doReplay } = await import("./replay-2PZ7OOTJ.js");
5122
5139
  return doReplay(
5123
5140
  this.httpClient,
5124
5141
  this.serviceUrl,
@@ -5402,7 +5419,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
5402
5419
  sessionId: seedCase.sessionId
5403
5420
  })
5404
5421
  );
5405
- const { flushTraces: flushTraces2 } = await import("./http-7WGJNBGI.js");
5422
+ const { flushTraces: flushTraces2 } = await import("./http-VZG3GUGE.js");
5406
5423
  await flushTraces2(3e4);
5407
5424
  return { pipeline, traceFunctionKey, traceIds };
5408
5425
  }
@@ -5439,4 +5456,4 @@ export {
5439
5456
  reseedFromRegistry,
5440
5457
  seedFromRegistry
5441
5458
  };
5442
- //# sourceMappingURL=chunk-53RMN23L.js.map
5459
+ //# sourceMappingURL=chunk-JMZSZD22.js.map