bitfab 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-WKSZSBRQ.js";
9
+ } from "./chunk-4Z5FCOMO.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-W7XZFZN3.js.map
20
+ //# sourceMappingURL=http-CS565CIX.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-VC3CVN2P.js";
9
+ } from "./chunk-WBV4YW7X.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-UI4FW2QI.js.map
19
+ //# sourceMappingURL=http-RQXNGCUQ.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.50.0";
54
+ __version__ = "0.51.0";
55
55
  __packageName__ = "bitfab";
56
56
  }
57
57
  });
@@ -1856,7 +1856,7 @@ var init_http = __esm({
1856
1856
  * Start a replay session by fetching historical traces.
1857
1857
  * Blocking call - creates a test run and returns lightweight item references.
1858
1858
  */
1859
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1859
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1860
1860
  const payload = { traceFunctionKey };
1861
1861
  if (limit !== void 0) {
1862
1862
  payload.limit = limit;
@@ -1880,8 +1880,12 @@ var init_http = __esm({
1880
1880
  if (experimentGroupId !== void 0) {
1881
1881
  payload.experimentGroupId = experimentGroupId;
1882
1882
  }
1883
- if (datasetId !== void 0) {
1884
- payload.datasetId = datasetId;
1883
+ if (datasetIds !== void 0) {
1884
+ if (datasetIds.length === 1) {
1885
+ payload.datasetId = datasetIds[0];
1886
+ } else {
1887
+ payload.datasetIds = datasetIds;
1888
+ }
1885
1889
  }
1886
1890
  if (graderIds !== void 0) {
1887
1891
  payload.graderIds = graderIds;
@@ -2483,6 +2487,23 @@ function resolveAttempts(attempts) {
2483
2487
  }
2484
2488
  return attempts;
2485
2489
  }
2490
+ function resolveDatasetIds(options) {
2491
+ if (options?.datasetId !== void 0 && options?.datasetIds !== void 0) {
2492
+ throw new BitfabError(
2493
+ "datasetId and datasetIds are the same selector: pass one dataset through datasetId, or several through datasetIds."
2494
+ );
2495
+ }
2496
+ if (options?.datasetId !== void 0) {
2497
+ return [options.datasetId];
2498
+ }
2499
+ if (options?.datasetIds === void 0) {
2500
+ return void 0;
2501
+ }
2502
+ if (options.datasetIds.length === 0) {
2503
+ throw new BitfabError("datasetIds must contain at least one dataset ID.");
2504
+ }
2505
+ return [...new Set(options.datasetIds)];
2506
+ }
2486
2507
  function dbBranchEnabled(dbBranch) {
2487
2508
  return dbBranch !== void 0 && dbBranch !== false;
2488
2509
  }
@@ -2915,9 +2936,10 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2915
2936
  );
2916
2937
  }
2917
2938
  }
2918
- if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
2939
+ const datasetIds = resolveDatasetIds(options);
2940
+ if (options?.traceIds !== void 0 && datasetIds !== void 0) {
2919
2941
  throw new BitfabError(
2920
- "traceIds and datasetId select different replay sources and cannot be used together."
2942
+ "traceIds and datasetIds select different replay sources and cannot be used together."
2921
2943
  );
2922
2944
  }
2923
2945
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
@@ -2959,7 +2981,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2959
2981
  // before it could report its resolved inputs.
2960
2982
  dbBranchEnabled(options?.dbBranch) && options?.dryRun !== true,
2961
2983
  options?.experimentGroupId,
2962
- options?.datasetId,
2984
+ datasetIds,
2963
2985
  options?.graderIds,
2964
2986
  resolveDbBranchSettings(options?.dbBranch),
2965
2987
  attempts,