bitfab 0.33.4 → 0.33.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
@@ -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.5";
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.5";
1986
1987
 
1987
1988
  /**
1988
1989
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -23,12 +23,12 @@ import {
23
23
  getCurrentReplayBranch,
24
24
  getCurrentSpan,
25
25
  getCurrentTrace
26
- } from "./chunk-OMW6EFXC.js";
26
+ } from "./chunk-LRWH3H5T.js";
27
27
  import {
28
28
  BITFAB_PROGRESS_PREFIX,
29
29
  BitfabError,
30
30
  reportReplayProgress
31
- } from "./chunk-HWQB73HK.js";
31
+ } from "./chunk-DPV6PBWE.js";
32
32
  export {
33
33
  BITFAB_PROGRESS_PREFIX,
34
34
  Bitfab,
package/dist/node.cjs CHANGED
@@ -558,8 +558,11 @@ __export(replay_exports, {
558
558
  replay: () => replay,
559
559
  reportReplayProgress: () => reportReplayProgress
560
560
  });
561
+ function dbBranchEnabled(dbBranch) {
562
+ return dbBranch !== void 0 && dbBranch !== false;
563
+ }
561
564
  function resolveDbBranchSettings(dbBranch) {
562
- if (!dbBranch) {
565
+ if (!dbBranch || dbBranch === true) {
563
566
  return void 0;
564
567
  }
565
568
  const { minCu, maxCu, warmupSql } = dbBranch;
@@ -828,7 +831,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
828
831
  options?.name,
829
832
  codeChangeDescription,
830
833
  codeChangeFiles,
831
- options?.dbBranch !== void 0,
834
+ dbBranchEnabled(options?.dbBranch),
832
835
  // includeDbBranchLease
833
836
  options?.experimentGroupId,
834
837
  options?.datasetId,
@@ -851,7 +854,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
851
854
  mockStrategy,
852
855
  resolvedOverrides,
853
856
  replayedTraceIds[index],
854
- options?.dbBranch !== void 0,
857
+ dbBranchEnabled(options?.dbBranch),
855
858
  resolveDbBranchSettings(options?.dbBranch),
856
859
  options?.adaptInputs
857
860
  )
@@ -1028,7 +1031,7 @@ registerAsyncLocalStorageClass(
1028
1031
  );
1029
1032
 
1030
1033
  // src/version.generated.ts
1031
- var __version__ = "0.33.4";
1034
+ var __version__ = "0.33.5";
1032
1035
 
1033
1036
  // src/constants.ts
1034
1037
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";