@bitfab/sdk 0.50.0 → 0.51.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.
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-W5P5JAH7.js";
9
+ } from "./chunk-4CLJF2DZ.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-W2YPLY7H.js.map
19
+ //# sourceMappingURL=http-AKFJONE7.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-XZDYNFI5.js";
9
+ } from "./chunk-RGC7IEOI.js";
10
10
  import "./chunk-H6LZRFMN.js";
11
11
  export {
12
12
  BitfabError,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-PFP2EQVE.js.map
20
+ //# sourceMappingURL=http-HLRWCSFF.js.map
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ var __version__, __packageName__;
42
42
  var init_version_generated = __esm({
43
43
  "src/version.generated.ts"() {
44
44
  "use strict";
45
- __version__ = "0.50.0";
45
+ __version__ = "0.51.0";
46
46
  __packageName__ = "@bitfab/sdk";
47
47
  }
48
48
  });
@@ -1847,7 +1847,7 @@ var init_http = __esm({
1847
1847
  * Start a replay session by fetching historical traces.
1848
1848
  * Blocking call - creates a test run and returns lightweight item references.
1849
1849
  */
1850
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1850
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1851
1851
  const payload = { traceFunctionKey };
1852
1852
  if (limit !== void 0) {
1853
1853
  payload.limit = limit;
@@ -1871,8 +1871,12 @@ var init_http = __esm({
1871
1871
  if (experimentGroupId !== void 0) {
1872
1872
  payload.experimentGroupId = experimentGroupId;
1873
1873
  }
1874
- if (datasetId !== void 0) {
1875
- payload.datasetId = datasetId;
1874
+ if (datasetIds !== void 0) {
1875
+ if (datasetIds.length === 1) {
1876
+ payload.datasetId = datasetIds[0];
1877
+ } else {
1878
+ payload.datasetIds = datasetIds;
1879
+ }
1876
1880
  }
1877
1881
  if (graderIds !== void 0) {
1878
1882
  payload.graderIds = graderIds;
@@ -2474,6 +2478,23 @@ function resolveAttempts(attempts) {
2474
2478
  }
2475
2479
  return attempts;
2476
2480
  }
2481
+ function resolveDatasetIds(options) {
2482
+ if (options?.datasetId !== void 0 && options?.datasetIds !== void 0) {
2483
+ throw new BitfabError(
2484
+ "datasetId and datasetIds are the same selector: pass one dataset through datasetId, or several through datasetIds."
2485
+ );
2486
+ }
2487
+ if (options?.datasetId !== void 0) {
2488
+ return [options.datasetId];
2489
+ }
2490
+ if (options?.datasetIds === void 0) {
2491
+ return void 0;
2492
+ }
2493
+ if (options.datasetIds.length === 0) {
2494
+ throw new BitfabError("datasetIds must contain at least one dataset ID.");
2495
+ }
2496
+ return [...new Set(options.datasetIds)];
2497
+ }
2477
2498
  function dbBranchEnabled(dbBranch) {
2478
2499
  return dbBranch !== void 0 && dbBranch !== false;
2479
2500
  }
@@ -2906,9 +2927,10 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2906
2927
  );
2907
2928
  }
2908
2929
  }
2909
- if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
2930
+ const datasetIds = resolveDatasetIds(options);
2931
+ if (options?.traceIds !== void 0 && datasetIds !== void 0) {
2910
2932
  throw new BitfabError(
2911
- "traceIds and datasetId select different replay sources and cannot be used together."
2933
+ "traceIds and datasetIds select different replay sources and cannot be used together."
2912
2934
  );
2913
2935
  }
2914
2936
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
@@ -2950,7 +2972,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2950
2972
  // before it could report its resolved inputs.
2951
2973
  dbBranchEnabled(options?.dbBranch) && options?.dryRun !== true,
2952
2974
  options?.experimentGroupId,
2953
- options?.datasetId,
2975
+ datasetIds,
2954
2976
  options?.graderIds,
2955
2977
  resolveDbBranchSettings(options?.dbBranch),
2956
2978
  attempts,