@bitfab/sdk 0.33.4 → 0.33.6

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
@@ -752,8 +752,9 @@ type MockStrategy = "none" | "all" | "marked";
752
752
  /**
753
753
  * How the DB-snapshot branch each replay item runs against is sized and warmed.
754
754
  *
755
- * Passing this object at all is what turns database branching on, so `{}` means
756
- * "branch every item, with the mirror project's own defaults".
755
+ * Every field is optional, so this object is only worth passing when you want
756
+ * to override the mirror project's own sizing. To branch with those defaults,
757
+ * pass `dbBranch: true` instead of an empty object.
757
758
  */
758
759
  interface DbBranchOptions {
759
760
  /**
@@ -826,17 +827,17 @@ interface ReplayOptions {
826
827
  mockOverride?: MockOverride | MockOverride[];
827
828
  /**
828
829
  * Run each item against a database branch restored to the state its source
829
- * trace saw. Passing this object at all turns branching on, so `{}` enables
830
- * it with the mirror project's own sizing; the fields tune how each branch is
831
- * sized and warmed. Inside `fn`, read the resolved branch with
832
- * `getCurrentReplayBranch()`.
830
+ * trace saw. Pass `true` to branch with the mirror project's own sizing, or a
831
+ * {@link DbBranchOptions} object to tune how each branch is sized and warmed.
832
+ * `false` and omission leave branching off. Inside `fn`, read the resolved
833
+ * branch with `getCurrentReplayBranch()`.
833
834
  *
834
835
  * Items whose source trace carried no DB snapshot reference get no branch and
835
836
  * run against the live database. An item whose branch was requested but could
836
837
  * not be resolved fails instead of running, so a replay never silently
837
838
  * reports a result that did not use the historical data you asked for.
838
839
  */
839
- dbBranch?: DbBranchOptions;
840
+ dbBranch?: DbBranchOptions | boolean;
840
841
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
841
842
  experimentGroupId?: string;
842
843
  /**
@@ -1982,7 +1983,7 @@ declare class BitfabFunction {
1982
1983
  /**
1983
1984
  * SDK version from package.json (injected at build time)
1984
1985
  */
1985
- declare const __version__ = "0.33.4";
1986
+ declare const __version__ = "0.33.6";
1986
1987
 
1987
1988
  /**
1988
1989
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -752,8 +752,9 @@ type MockStrategy = "none" | "all" | "marked";
752
752
  /**
753
753
  * How the DB-snapshot branch each replay item runs against is sized and warmed.
754
754
  *
755
- * Passing this object at all is what turns database branching on, so `{}` means
756
- * "branch every item, with the mirror project's own defaults".
755
+ * Every field is optional, so this object is only worth passing when you want
756
+ * to override the mirror project's own sizing. To branch with those defaults,
757
+ * pass `dbBranch: true` instead of an empty object.
757
758
  */
758
759
  interface DbBranchOptions {
759
760
  /**
@@ -826,17 +827,17 @@ interface ReplayOptions {
826
827
  mockOverride?: MockOverride | MockOverride[];
827
828
  /**
828
829
  * Run each item against a database branch restored to the state its source
829
- * trace saw. Passing this object at all turns branching on, so `{}` enables
830
- * it with the mirror project's own sizing; the fields tune how each branch is
831
- * sized and warmed. Inside `fn`, read the resolved branch with
832
- * `getCurrentReplayBranch()`.
830
+ * trace saw. Pass `true` to branch with the mirror project's own sizing, or a
831
+ * {@link DbBranchOptions} object to tune how each branch is sized and warmed.
832
+ * `false` and omission leave branching off. Inside `fn`, read the resolved
833
+ * branch with `getCurrentReplayBranch()`.
833
834
  *
834
835
  * Items whose source trace carried no DB snapshot reference get no branch and
835
836
  * run against the live database. An item whose branch was requested but could
836
837
  * not be resolved fails instead of running, so a replay never silently
837
838
  * reports a result that did not use the historical data you asked for.
838
839
  */
839
- dbBranch?: DbBranchOptions;
840
+ dbBranch?: DbBranchOptions | boolean;
840
841
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
841
842
  experimentGroupId?: string;
842
843
  /**
@@ -1982,7 +1983,7 @@ declare class BitfabFunction {
1982
1983
  /**
1983
1984
  * SDK version from package.json (injected at build time)
1984
1985
  */
1985
- declare const __version__ = "0.33.4";
1986
+ declare const __version__ = "0.33.6";
1986
1987
 
1987
1988
  /**
1988
1989
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,12 +14,12 @@ import {
14
14
  getCurrentReplayBranch,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-OMW6EFXC.js";
17
+ } from "./chunk-JANSX65W.js";
18
18
  import {
19
19
  BITFAB_PROGRESS_PREFIX,
20
20
  BitfabError,
21
21
  reportReplayProgress
22
- } from "./chunk-HWQB73HK.js";
22
+ } from "./chunk-DPV6PBWE.js";
23
23
  export {
24
24
  BITFAB_PROGRESS_PREFIX,
25
25
  Bitfab,
package/dist/node.cjs CHANGED
@@ -549,8 +549,11 @@ __export(replay_exports, {
549
549
  replay: () => replay,
550
550
  reportReplayProgress: () => reportReplayProgress
551
551
  });
552
+ function dbBranchEnabled(dbBranch) {
553
+ return dbBranch !== void 0 && dbBranch !== false;
554
+ }
552
555
  function resolveDbBranchSettings(dbBranch) {
553
- if (!dbBranch) {
556
+ if (!dbBranch || dbBranch === true) {
554
557
  return void 0;
555
558
  }
556
559
  const { minCu, maxCu, warmupSql } = dbBranch;
@@ -819,7 +822,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
819
822
  options?.name,
820
823
  codeChangeDescription,
821
824
  codeChangeFiles,
822
- options?.dbBranch !== void 0,
825
+ dbBranchEnabled(options?.dbBranch),
823
826
  // includeDbBranchLease
824
827
  options?.experimentGroupId,
825
828
  options?.datasetId,
@@ -842,7 +845,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
842
845
  mockStrategy,
843
846
  resolvedOverrides,
844
847
  replayedTraceIds[index],
845
- options?.dbBranch !== void 0,
848
+ dbBranchEnabled(options?.dbBranch),
846
849
  resolveDbBranchSettings(options?.dbBranch),
847
850
  options?.adaptInputs
848
851
  )
@@ -1019,7 +1022,7 @@ registerAsyncLocalStorageClass(
1019
1022
  );
1020
1023
 
1021
1024
  // src/version.generated.ts
1022
- var __version__ = "0.33.4";
1025
+ var __version__ = "0.33.6";
1023
1026
 
1024
1027
  // src/constants.ts
1025
1028
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";