@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/{chunk-YPG3XIG4.js → chunk-53G5GR7B.js} +3 -3
- package/dist/{chunk-YPG3XIG4.js.map → chunk-53G5GR7B.js.map} +1 -1
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -2
- package/dist/index.d.ts +41 -2
- package/dist/index.js +1 -1
- package/dist/node.cjs +10 -3
- 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 +1 -1
- package/dist/{replay-3MQS22GS.js → replay-WIBKB3BK.js} +10 -3
- package/dist/replay-WIBKB3BK.js.map +1 -0
- package/package.json +1 -1
- package/dist/replay-3MQS22GS.js.map +0 -1
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.
|
|
432
|
+
var __version__ = "0.16.0";
|
|
426
433
|
|
|
427
434
|
// src/constants.ts
|
|
428
435
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|