@bitfab/sdk 0.36.12 → 0.38.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.
@@ -16,7 +16,7 @@ import {
16
16
  toJsonSafe,
17
17
  toJsonSafeReport,
18
18
  warnOnce
19
- } from "./chunk-VUYTATF5.js";
19
+ } from "./chunk-SSNTMROV.js";
20
20
 
21
21
  // src/processorPayload.ts
22
22
  var SERIALIZATION_DEGRADED_STEP = "serialization_degraded";
@@ -2961,7 +2961,8 @@ var Bitfab = class {
2961
2961
  snapshotTimestamp: replayCtx.dbBranchLease.snapshotTimestamp,
2962
2962
  region: replayCtx.dbBranchLease.region,
2963
2963
  originalTraceId: replayCtx.sourceBitfabTraceId,
2964
- accessed: replayCtx.dbSnapshotAccessed === true
2964
+ accessed: replayCtx.dbSnapshotAccessed === true,
2965
+ timings: replayCtx.dbBranchTimings
2965
2966
  }
2966
2967
  }
2967
2968
  });
@@ -3051,7 +3052,12 @@ var Bitfab = class {
3051
3052
  }
3052
3053
  }
3053
3054
  const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
3054
- if (shouldMock && mockSpan) {
3055
+ if (shouldMock && !mockSpan) {
3056
+ throw new BitfabError(
3057
+ `Replay selected span "${traceFunctionKey}:${baseSpanParams.spanName}" for mocking, but recorded occurrence ${callIndex + 1} is unavailable. The real span was not executed.`
3058
+ );
3059
+ }
3060
+ if (shouldMock) {
3055
3061
  const recorded = resolveRecordedOutput();
3056
3062
  if (recorded instanceof Promise) {
3057
3063
  return emitMockAsync(recorded, "recorded");
@@ -3288,7 +3294,13 @@ var Bitfab = class {
3288
3294
  // against servers that predate the rename.
3289
3295
  source_trace_id: params.dbSnapshotUsage.originalTraceId
3290
3296
  },
3291
- accessed: params.dbSnapshotUsage.accessed
3297
+ accessed: params.dbSnapshotUsage.accessed,
3298
+ // Echoed verbatim (camelCase inside) rather than re-cased into this
3299
+ // record's snake_case: it is the server's own object coming back, and
3300
+ // a translation layer here is one more thing to drift.
3301
+ ...params.dbSnapshotUsage.timings && {
3302
+ timings: params.dbSnapshotUsage.timings
3303
+ }
3292
3304
  };
3293
3305
  }
3294
3306
  this.httpClient.sendExternalTrace({
@@ -3383,7 +3395,7 @@ var Bitfab = class {
3383
3395
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
3384
3396
  );
3385
3397
  }
3386
- const { replay: doReplay } = await import("./replay-P35CUNGH.js");
3398
+ const { replay: doReplay } = await import("./replay-XWBIMYEE.js");
3387
3399
  return doReplay(
3388
3400
  this.httpClient,
3389
3401
  this.serviceUrl,
@@ -3621,4 +3633,4 @@ export {
3621
3633
  BitfabFunction,
3622
3634
  finalizers
3623
3635
  };
3624
- //# sourceMappingURL=chunk-OCJSHTJR.js.map
3636
+ //# sourceMappingURL=chunk-LCGQUVKR.js.map