bitfab 0.15.0 → 0.16.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.
package/dist/index.cjs CHANGED
@@ -227,7 +227,7 @@ function buildMockTree(rootNode) {
227
227
  }
228
228
  return { spans };
229
229
  }
230
- async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy, environment) {
230
+ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy, environment, adaptInputs) {
231
231
  const lease = environment ? serverItem.dbBranchLease : void 0;
232
232
  let inputs = [];
233
233
  let originalOutput;
@@ -240,6 +240,12 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
240
240
  const spanData = span.rawData?.span_data ?? {};
241
241
  inputs = deserializeInputs(spanData);
242
242
  originalOutput = deserializeOutput(spanData);
243
+ if (adaptInputs) {
244
+ inputs = adaptInputs(inputs, {
245
+ traceId: serverItem.traceId,
246
+ sourceSpanId: serverItem.externalSpanId
247
+ });
248
+ }
243
249
  let mockTree;
244
250
  if (mockStrategy === "all" || mockStrategy === "marked") {
245
251
  const treeResponse = await httpClient.getSpanTree(
@@ -350,7 +356,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
350
356
  fn,
351
357
  testRunId,
352
358
  mockStrategy,
353
- options?.environment
359
+ options?.environment,
360
+ options?.adaptInputs
354
361
  )
355
362
  );
356
363
  const resultItems = await mapWithConcurrency(tasks, maxConcurrency);
@@ -431,7 +438,7 @@ __export(index_exports, {
431
438
  module.exports = __toCommonJS(index_exports);
432
439
 
433
440
  // src/version.generated.ts
434
- var __version__ = "0.15.0";
441
+ var __version__ = "0.16.0";
435
442
 
436
443
  // src/constants.ts
437
444
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";