@bitfab/sdk 0.38.1 → 0.38.3
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/autoTrace.cjs +187 -0
- package/dist/autoTrace.cjs.map +1 -0
- package/dist/autoTrace.d.cts +39 -0
- package/dist/autoTrace.d.ts +39 -0
- package/dist/autoTrace.js +20 -0
- package/dist/chunk-GFBQ2AMO.js +129 -0
- package/dist/chunk-GFBQ2AMO.js.map +1 -0
- package/dist/chunk-H6LZRFMN.js +59 -0
- package/dist/chunk-H6LZRFMN.js.map +1 -0
- package/dist/{chunk-WD4AO3BK.js → chunk-RJPHMJWO.js} +243 -24
- package/dist/chunk-RJPHMJWO.js.map +1 -0
- package/dist/{chunk-MGA7ROIK.js → chunk-WX6AEFCP.js} +18 -58
- package/dist/chunk-WX6AEFCP.js.map +1 -0
- package/dist/index.cjs +315 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -4
- package/dist/index.d.ts +94 -4
- package/dist/index.js +6 -2
- package/dist/node.cjs +315 -16
- 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 +9 -4
- package/dist/node.js.map +1 -1
- package/dist/{replay-WSFDZ2UV.js → replay-FAO7D7CG.js} +3 -2
- package/dist/replay-FAO7D7CG.js.map +1 -0
- package/dist/replayCli.js +620 -0
- package/dist/replayCli.js.map +1 -0
- package/package.json +16 -2
- package/dist/chunk-MGA7ROIK.js.map +0 -1
- package/dist/chunk-WD4AO3BK.js.map +0 -1
- /package/dist/{replay-WSFDZ2UV.js.map → autoTrace.js.map} +0 -0
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
1
|
+
import {
|
|
2
|
+
asyncStorageReady,
|
|
3
|
+
createAsyncLocalStorage
|
|
4
|
+
} from "./chunk-H6LZRFMN.js";
|
|
8
5
|
|
|
9
6
|
// src/codeChange.ts
|
|
10
7
|
var MAX_FILES = 60;
|
|
@@ -314,52 +311,12 @@ function encodeRequestBody(body) {
|
|
|
314
311
|
}
|
|
315
312
|
|
|
316
313
|
// src/version.generated.ts
|
|
317
|
-
var __version__ = "0.38.
|
|
314
|
+
var __version__ = "0.38.3";
|
|
318
315
|
var __packageName__ = "@bitfab/sdk";
|
|
319
316
|
|
|
320
317
|
// src/constants.ts
|
|
321
318
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
322
319
|
|
|
323
|
-
// src/asyncStorage.ts
|
|
324
|
-
var AsyncLocalStorageClass = null;
|
|
325
|
-
var initDone = false;
|
|
326
|
-
function registerAsyncLocalStorageClass(cls) {
|
|
327
|
-
if (!AsyncLocalStorageClass) {
|
|
328
|
-
AsyncLocalStorageClass = cls;
|
|
329
|
-
}
|
|
330
|
-
initDone = true;
|
|
331
|
-
}
|
|
332
|
-
function assertAsyncStorageRegistered() {
|
|
333
|
-
if (!AsyncLocalStorageClass) {
|
|
334
|
-
console.warn(
|
|
335
|
-
"Bitfab: AsyncLocalStorage not available - nested span context will not propagate."
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
var asyncStorageReady = (typeof process !== "undefined" && process.versions?.node ? (
|
|
340
|
-
// The join trick hides "node:async_hooks" from static analysis so
|
|
341
|
-
// bundlers that ban Node.js built-ins don't fail at build time.
|
|
342
|
-
// webpackIgnore tells webpack/turbopack to emit a native import()
|
|
343
|
-
// so Node.js can resolve the module at runtime.
|
|
344
|
-
import(
|
|
345
|
-
/* webpackIgnore: true */
|
|
346
|
-
["node", "async_hooks"].join(":")
|
|
347
|
-
).then(
|
|
348
|
-
(mod) => {
|
|
349
|
-
registerAsyncLocalStorageClass(mod.AsyncLocalStorage);
|
|
350
|
-
}
|
|
351
|
-
).catch(() => {
|
|
352
|
-
})
|
|
353
|
-
) : Promise.resolve()).then(() => {
|
|
354
|
-
initDone = true;
|
|
355
|
-
});
|
|
356
|
-
function isAsyncStorageInitDone() {
|
|
357
|
-
return initDone;
|
|
358
|
-
}
|
|
359
|
-
function createAsyncLocalStorage() {
|
|
360
|
-
return AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
320
|
// src/replayContext.ts
|
|
364
321
|
var replayContextStorage = null;
|
|
365
322
|
var REPLAY_CONTEXT_STORAGE_SYMBOL = /* @__PURE__ */ Symbol.for("bitfab.replayContextStorage");
|
|
@@ -683,7 +640,7 @@ var MAX_REQUEST_BYTES_ENV = "BITFAB_OTEL_MAX_REQUEST_BYTES";
|
|
|
683
640
|
var EXPORT_CONCURRENCY_ENV = "BITFAB_OTEL_EXPORT_CONCURRENCY";
|
|
684
641
|
var MAX_QUEUE_SIZE = 8192;
|
|
685
642
|
var DIRECT_MAX_EXPORT_BATCH_SIZE = 512;
|
|
686
|
-
var DIRECT_MAX_REQUEST_BATCH_SIZE =
|
|
643
|
+
var DIRECT_MAX_REQUEST_BATCH_SIZE = 128;
|
|
687
644
|
var DEFAULT_EXPORT_CONCURRENCY = 32;
|
|
688
645
|
var MAX_EXPORT_CONCURRENCY = 64;
|
|
689
646
|
var SCHEDULE_DELAY_MILLIS = 5e3;
|
|
@@ -1782,6 +1739,12 @@ var HttpClient = class {
|
|
|
1782
1739
|
async lookupFunction(name) {
|
|
1783
1740
|
return this.request("/api/sdk/functions/lookup", { name });
|
|
1784
1741
|
}
|
|
1742
|
+
async getAutoTracePolicy(traceFunctionKey, protocol) {
|
|
1743
|
+
return this.request("/api/sdk/auto-trace/policy", {
|
|
1744
|
+
traceFunctionKey,
|
|
1745
|
+
protocol
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1785
1748
|
async getTraceSpan(traceId, lookup) {
|
|
1786
1749
|
const searchParams = new URLSearchParams();
|
|
1787
1750
|
if (lookup.id !== void 0) {
|
|
@@ -2658,6 +2621,11 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
2658
2621
|
);
|
|
2659
2622
|
}
|
|
2660
2623
|
}
|
|
2624
|
+
if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
|
|
2625
|
+
throw new BitfabError(
|
|
2626
|
+
"traceIds and datasetId select different replay sources and cannot be used together."
|
|
2627
|
+
);
|
|
2628
|
+
}
|
|
2661
2629
|
if (options?.limit !== void 0 && options?.traceIds !== void 0) {
|
|
2662
2630
|
try {
|
|
2663
2631
|
console.warn(
|
|
@@ -2933,17 +2901,9 @@ async function writeReplayResultFile(result) {
|
|
|
2933
2901
|
}
|
|
2934
2902
|
|
|
2935
2903
|
export {
|
|
2936
|
-
__privateGet,
|
|
2937
|
-
__privateAdd,
|
|
2938
|
-
__privateSet,
|
|
2939
2904
|
__version__,
|
|
2940
2905
|
DEFAULT_SERVICE_URL,
|
|
2941
2906
|
BitfabError,
|
|
2942
|
-
registerAsyncLocalStorageClass,
|
|
2943
|
-
assertAsyncStorageRegistered,
|
|
2944
|
-
asyncStorageReady,
|
|
2945
|
-
isAsyncStorageInitDone,
|
|
2946
|
-
createAsyncLocalStorage,
|
|
2947
2907
|
getReplayContext,
|
|
2948
2908
|
warnOnce,
|
|
2949
2909
|
flushTraces,
|
|
@@ -2963,4 +2923,4 @@ export {
|
|
|
2963
2923
|
sleepForReplayPersistence,
|
|
2964
2924
|
replay
|
|
2965
2925
|
};
|
|
2966
|
-
//# sourceMappingURL=chunk-
|
|
2926
|
+
//# sourceMappingURL=chunk-WX6AEFCP.js.map
|