@bitfab/sdk 0.36.1 → 0.36.2
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-6ZBZBR5K.js → chunk-4IY5SZYR.js} +22 -8
- package/dist/chunk-4IY5SZYR.js.map +1 -0
- package/dist/{chunk-HD4DRDRE.js → chunk-XZKYSTWH.js} +3 -3
- package/dist/index.cjs +21 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2 -2
- package/dist/node.cjs +21 -7
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-ZR4KIZIB.js → replay-UGABWDPP.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-6ZBZBR5K.js.map +0 -1
- /package/dist/{chunk-HD4DRDRE.js.map → chunk-XZKYSTWH.js.map} +0 -0
- /package/dist/{replay-ZR4KIZIB.js.map → replay-UGABWDPP.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -457,8 +457,11 @@ declare class HttpClient {
|
|
|
457
457
|
/**
|
|
458
458
|
* Fetch an external span by ID.
|
|
459
459
|
* Blocking GET request.
|
|
460
|
+
* The replay view limits rawData to input/output serialization fields.
|
|
460
461
|
*/
|
|
461
|
-
getExternalSpan(spanId: string
|
|
462
|
+
getExternalSpan(spanId: string, options?: {
|
|
463
|
+
view?: "full" | "replay";
|
|
464
|
+
}): Promise<ExternalSpanResponse>;
|
|
462
465
|
/**
|
|
463
466
|
* Fetch the span tree for a root span.
|
|
464
467
|
* Blocking GET request.
|
|
@@ -466,9 +469,11 @@ declare class HttpClient {
|
|
|
466
469
|
* Pass `includeOutputs: false` for a payload-free tree (structure +
|
|
467
470
|
* `externalSpanId` only), so recorded outputs are fetched lazily per mocked
|
|
468
471
|
* span instead of all up front. Omit it (default eager) for `mock: "all"`.
|
|
472
|
+
* Pass `includeRootOutput: false` when the root was already fetched.
|
|
469
473
|
*/
|
|
470
474
|
getSpanTree(externalSpanId: string, options?: {
|
|
471
475
|
includeOutputs?: boolean;
|
|
476
|
+
includeRootOutput?: boolean;
|
|
472
477
|
}): Promise<SpanTreeResponse>;
|
|
473
478
|
/**
|
|
474
479
|
* Read which of a replay run's traces the server has fully persisted.
|
|
@@ -2348,7 +2353,7 @@ declare class BitfabFunction {
|
|
|
2348
2353
|
/**
|
|
2349
2354
|
* SDK version from package.json (injected at build time)
|
|
2350
2355
|
*/
|
|
2351
|
-
declare const __version__ = "0.36.
|
|
2356
|
+
declare const __version__ = "0.36.2";
|
|
2352
2357
|
|
|
2353
2358
|
/**
|
|
2354
2359
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -457,8 +457,11 @@ declare class HttpClient {
|
|
|
457
457
|
/**
|
|
458
458
|
* Fetch an external span by ID.
|
|
459
459
|
* Blocking GET request.
|
|
460
|
+
* The replay view limits rawData to input/output serialization fields.
|
|
460
461
|
*/
|
|
461
|
-
getExternalSpan(spanId: string
|
|
462
|
+
getExternalSpan(spanId: string, options?: {
|
|
463
|
+
view?: "full" | "replay";
|
|
464
|
+
}): Promise<ExternalSpanResponse>;
|
|
462
465
|
/**
|
|
463
466
|
* Fetch the span tree for a root span.
|
|
464
467
|
* Blocking GET request.
|
|
@@ -466,9 +469,11 @@ declare class HttpClient {
|
|
|
466
469
|
* Pass `includeOutputs: false` for a payload-free tree (structure +
|
|
467
470
|
* `externalSpanId` only), so recorded outputs are fetched lazily per mocked
|
|
468
471
|
* span instead of all up front. Omit it (default eager) for `mock: "all"`.
|
|
472
|
+
* Pass `includeRootOutput: false` when the root was already fetched.
|
|
469
473
|
*/
|
|
470
474
|
getSpanTree(externalSpanId: string, options?: {
|
|
471
475
|
includeOutputs?: boolean;
|
|
476
|
+
includeRootOutput?: boolean;
|
|
472
477
|
}): Promise<SpanTreeResponse>;
|
|
473
478
|
/**
|
|
474
479
|
* Read which of a replay run's traces the server has fully persisted.
|
|
@@ -2348,7 +2353,7 @@ declare class BitfabFunction {
|
|
|
2348
2353
|
/**
|
|
2349
2354
|
* SDK version from package.json (injected at build time)
|
|
2350
2355
|
*/
|
|
2351
|
-
declare const __version__ = "0.36.
|
|
2356
|
+
declare const __version__ = "0.36.2";
|
|
2352
2357
|
|
|
2353
2358
|
/**
|
|
2354
2359
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getCurrentReplayBranch,
|
|
12
12
|
getCurrentSpan,
|
|
13
13
|
getCurrentTrace
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XZKYSTWH.js";
|
|
15
15
|
import {
|
|
16
16
|
BITFAB_PROGRESS_PREFIX,
|
|
17
17
|
BitfabError,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
__version__,
|
|
21
21
|
flushTraces,
|
|
22
22
|
reportReplayProgress
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4IY5SZYR.js";
|
|
24
24
|
export {
|
|
25
25
|
BITFAB_PROGRESS_PREFIX,
|
|
26
26
|
Bitfab,
|
package/dist/node.cjs
CHANGED
|
@@ -88,7 +88,7 @@ var __version__;
|
|
|
88
88
|
var init_version_generated = __esm({
|
|
89
89
|
"src/version.generated.ts"() {
|
|
90
90
|
"use strict";
|
|
91
|
-
__version__ = "0.36.
|
|
91
|
+
__version__ = "0.36.2";
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
@@ -1528,9 +1528,11 @@ var init_http = __esm({
|
|
|
1528
1528
|
/**
|
|
1529
1529
|
* Fetch an external span by ID.
|
|
1530
1530
|
* Blocking GET request.
|
|
1531
|
+
* The replay view limits rawData to input/output serialization fields.
|
|
1531
1532
|
*/
|
|
1532
|
-
async getExternalSpan(spanId) {
|
|
1533
|
-
const
|
|
1533
|
+
async getExternalSpan(spanId, options) {
|
|
1534
|
+
const query = options?.view === "replay" ? "?view=replay" : "";
|
|
1535
|
+
const url = `${this.serviceUrl}/api/sdk/externalSpans/${spanId}${query}`;
|
|
1534
1536
|
const controller = new AbortController();
|
|
1535
1537
|
const timeoutId = setTimeout(() => controller.abort(), 3e4);
|
|
1536
1538
|
try {
|
|
@@ -1568,9 +1570,18 @@ var init_http = __esm({
|
|
|
1568
1570
|
* Pass `includeOutputs: false` for a payload-free tree (structure +
|
|
1569
1571
|
* `externalSpanId` only), so recorded outputs are fetched lazily per mocked
|
|
1570
1572
|
* span instead of all up front. Omit it (default eager) for `mock: "all"`.
|
|
1573
|
+
* Pass `includeRootOutput: false` when the root was already fetched.
|
|
1571
1574
|
*/
|
|
1572
1575
|
async getSpanTree(externalSpanId, options) {
|
|
1573
|
-
const
|
|
1576
|
+
const searchParams = new URLSearchParams();
|
|
1577
|
+
if (options?.includeOutputs === false) {
|
|
1578
|
+
searchParams.set("includeOutputs", "false");
|
|
1579
|
+
}
|
|
1580
|
+
if (options?.includeRootOutput === false) {
|
|
1581
|
+
searchParams.set("includeRootOutput", "false");
|
|
1582
|
+
}
|
|
1583
|
+
const encodedQuery = searchParams.toString();
|
|
1584
|
+
const query = encodedQuery ? `?${encodedQuery}` : "";
|
|
1574
1585
|
const url = `${this.serviceUrl}/api/sdk/replay/spanTree/${externalSpanId}${query}`;
|
|
1575
1586
|
const controller = new AbortController();
|
|
1576
1587
|
const timeoutId = setTimeout(() => controller.abort(), 3e4);
|
|
@@ -2153,7 +2164,9 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
2153
2164
|
`Replay requested a database branch for trace ${originalTraceId} but it could not be resolved (${leaseError.code}): ${leaseError.message}. The function was not run, because replaying it against the live database would produce a result that looks valid but did not use the historical data you asked for.`
|
|
2154
2165
|
);
|
|
2155
2166
|
}
|
|
2156
|
-
const span = await httpClient.getExternalSpan(originalSpanId
|
|
2167
|
+
const span = await httpClient.getExternalSpan(originalSpanId, {
|
|
2168
|
+
view: "replay"
|
|
2169
|
+
});
|
|
2157
2170
|
const spanData = span.rawData?.span_data ?? {};
|
|
2158
2171
|
inputs = deserializeInputs(spanData);
|
|
2159
2172
|
originalOutput = deserializeOutput(spanData);
|
|
@@ -2173,7 +2186,8 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
2173
2186
|
if (needTree) {
|
|
2174
2187
|
try {
|
|
2175
2188
|
const treeResponse = await httpClient.getSpanTree(originalSpanId, {
|
|
2176
|
-
includeOutputs
|
|
2189
|
+
includeOutputs,
|
|
2190
|
+
includeRootOutput: false
|
|
2177
2191
|
});
|
|
2178
2192
|
if (treeResponse.root) {
|
|
2179
2193
|
mockTree = buildMockTree(treeResponse.root);
|
|
@@ -2195,7 +2209,7 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
|
|
|
2195
2209
|
const fetchSpanOutput = mockTree && !includeOutputs ? (externalSpanId) => {
|
|
2196
2210
|
let pending = outputCache.get(externalSpanId);
|
|
2197
2211
|
if (!pending) {
|
|
2198
|
-
pending = httpClient.getExternalSpan(externalSpanId).then(
|
|
2212
|
+
pending = httpClient.getExternalSpan(externalSpanId, { view: "replay" }).then(
|
|
2199
2213
|
(s) => deserializeOutput(
|
|
2200
2214
|
s.rawData?.span_data ?? {}
|
|
2201
2215
|
)
|