@bitfab/sdk 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
@@ -218,7 +218,7 @@ function buildMockTree(rootNode) {
218
218
  }
219
219
  return { spans };
220
220
  }
221
- async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy, environment) {
221
+ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy, environment, adaptInputs) {
222
222
  const lease = environment ? serverItem.dbBranchLease : void 0;
223
223
  let inputs = [];
224
224
  let originalOutput;
@@ -231,6 +231,12 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
231
231
  const spanData = span.rawData?.span_data ?? {};
232
232
  inputs = deserializeInputs(spanData);
233
233
  originalOutput = deserializeOutput(spanData);
234
+ if (adaptInputs) {
235
+ inputs = adaptInputs(inputs, {
236
+ traceId: serverItem.traceId,
237
+ sourceSpanId: serverItem.externalSpanId
238
+ });
239
+ }
234
240
  let mockTree;
235
241
  if (mockStrategy === "all" || mockStrategy === "marked") {
236
242
  const treeResponse = await httpClient.getSpanTree(
@@ -341,7 +347,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
341
347
  fn,
342
348
  testRunId,
343
349
  mockStrategy,
344
- options?.environment
350
+ options?.environment,
351
+ options?.adaptInputs
345
352
  )
346
353
  );
347
354
  const resultItems = await mapWithConcurrency(tasks, maxConcurrency);
@@ -422,7 +429,7 @@ __export(index_exports, {
422
429
  module.exports = __toCommonJS(index_exports);
423
430
 
424
431
  // src/version.generated.ts
425
- var __version__ = "0.15.0";
432
+ var __version__ = "0.16.0";
426
433
 
427
434
  // src/constants.ts
428
435
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";