bitfab 0.33.3 → 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/{chunk-HWQB73HK.js → chunk-DPV6PBWE.js} +7 -4
- package/dist/chunk-DPV6PBWE.js.map +1 -0
- package/dist/{chunk-NIFTE3J4.js → chunk-LRWH3H5T.js} +36 -4
- package/dist/{chunk-NIFTE3J4.js.map → chunk-LRWH3H5T.js.map} +1 -1
- package/dist/index.cjs +39 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -9
- package/dist/index.d.ts +24 -9
- package/dist/index.js +2 -2
- package/dist/node.cjs +39 -4
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-4Y23OZYE.js → replay-SRQI4QMY.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-HWQB73HK.js.map +0 -1
- /package/dist/{replay-4Y23OZYE.js.map → replay-SRQI4QMY.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -551,8 +551,11 @@ __export(replay_exports, {
|
|
|
551
551
|
replay: () => replay,
|
|
552
552
|
reportReplayProgress: () => reportReplayProgress
|
|
553
553
|
});
|
|
554
|
+
function dbBranchEnabled(dbBranch) {
|
|
555
|
+
return dbBranch !== void 0 && dbBranch !== false;
|
|
556
|
+
}
|
|
554
557
|
function resolveDbBranchSettings(dbBranch) {
|
|
555
|
-
if (!dbBranch) {
|
|
558
|
+
if (!dbBranch || dbBranch === true) {
|
|
556
559
|
return void 0;
|
|
557
560
|
}
|
|
558
561
|
const { minCu, maxCu, warmupSql } = dbBranch;
|
|
@@ -821,7 +824,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
821
824
|
options?.name,
|
|
822
825
|
codeChangeDescription,
|
|
823
826
|
codeChangeFiles,
|
|
824
|
-
options?.dbBranch
|
|
827
|
+
dbBranchEnabled(options?.dbBranch),
|
|
825
828
|
// includeDbBranchLease
|
|
826
829
|
options?.experimentGroupId,
|
|
827
830
|
options?.datasetId,
|
|
@@ -844,7 +847,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
844
847
|
mockStrategy,
|
|
845
848
|
resolvedOverrides,
|
|
846
849
|
replayedTraceIds[index],
|
|
847
|
-
options?.dbBranch
|
|
850
|
+
dbBranchEnabled(options?.dbBranch),
|
|
848
851
|
resolveDbBranchSettings(options?.dbBranch),
|
|
849
852
|
options?.adaptInputs
|
|
850
853
|
)
|
|
@@ -1014,7 +1017,7 @@ __export(index_exports, {
|
|
|
1014
1017
|
module.exports = __toCommonJS(index_exports);
|
|
1015
1018
|
|
|
1016
1019
|
// src/version.generated.ts
|
|
1017
|
-
var __version__ = "0.33.
|
|
1020
|
+
var __version__ = "0.33.5";
|
|
1018
1021
|
|
|
1019
1022
|
// src/constants.ts
|
|
1020
1023
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -4313,6 +4316,38 @@ var Bitfab = class {
|
|
|
4313
4316
|
() => wrappedFn.apply(this, args)
|
|
4314
4317
|
);
|
|
4315
4318
|
}
|
|
4319
|
+
const captureWhen = options.captureWhen === void 0 ? "always" : options.captureWhen;
|
|
4320
|
+
const resolvedCaptureWhen = captureWhen === "always" || captureWhen === "nested" ? captureWhen : "always";
|
|
4321
|
+
if (resolvedCaptureWhen !== captureWhen) {
|
|
4322
|
+
let invalidValue;
|
|
4323
|
+
try {
|
|
4324
|
+
invalidValue = String(captureWhen);
|
|
4325
|
+
} catch {
|
|
4326
|
+
invalidValue = "<unprintable>";
|
|
4327
|
+
}
|
|
4328
|
+
warnOnce(
|
|
4329
|
+
`invalid-capture-when:${traceFunctionKey}`,
|
|
4330
|
+
`unknown captureWhen value "${invalidValue}"; defaulting to "always". Valid values: "always", "nested".`
|
|
4331
|
+
);
|
|
4332
|
+
}
|
|
4333
|
+
if (resolvedCaptureWhen === "nested") {
|
|
4334
|
+
let hasParent = false;
|
|
4335
|
+
try {
|
|
4336
|
+
hasParent = getSpanStack().length > 0;
|
|
4337
|
+
} catch (setupError) {
|
|
4338
|
+
if (getReplayContext()) {
|
|
4339
|
+
throw setupError;
|
|
4340
|
+
}
|
|
4341
|
+
warnOnce(
|
|
4342
|
+
`withSpan-setup:${traceFunctionKey}`,
|
|
4343
|
+
`tracing setup failed for "${traceFunctionKey}"; running it untraced. The function still runs and returns normally; no span is recorded.`
|
|
4344
|
+
);
|
|
4345
|
+
return fn.apply(this, args);
|
|
4346
|
+
}
|
|
4347
|
+
if (!hasParent) {
|
|
4348
|
+
return fn.apply(this, args);
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4316
4351
|
let newStack;
|
|
4317
4352
|
let executeWithContext;
|
|
4318
4353
|
let registeredTraceId;
|