bitfab 0.38.0 → 0.38.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/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-LCGQUVKR.js → chunk-JSU2Z2Z7.js} +236 -23
- package/dist/{chunk-LCGQUVKR.js.map → chunk-JSU2Z2Z7.js.map} +1 -1
- package/dist/{chunk-SSNTMROV.js → chunk-QWV7JDLQ.js} +25 -60
- package/dist/chunk-QWV7JDLQ.js.map +1 -0
- package/dist/index.cjs +314 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -2
- package/dist/index.d.ts +56 -2
- package/dist/index.js +4 -2
- package/dist/node.cjs +314 -19
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +7 -4
- package/dist/node.js.map +1 -1
- package/dist/{replay-XWBIMYEE.js → replay-DDAYVRET.js} +3 -2
- package/dist/replay-DDAYVRET.js.map +1 -0
- package/package.json +12 -1
- package/dist/chunk-SSNTMROV.js.map +0 -1
- /package/dist/{replay-XWBIMYEE.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,51 +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.2";
|
|
315
|
+
var __packageName__ = "bitfab";
|
|
318
316
|
|
|
319
317
|
// src/constants.ts
|
|
320
318
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
321
319
|
|
|
322
|
-
// src/asyncStorage.ts
|
|
323
|
-
var AsyncLocalStorageClass = null;
|
|
324
|
-
var initDone = false;
|
|
325
|
-
function registerAsyncLocalStorageClass(cls) {
|
|
326
|
-
if (!AsyncLocalStorageClass) {
|
|
327
|
-
AsyncLocalStorageClass = cls;
|
|
328
|
-
}
|
|
329
|
-
initDone = true;
|
|
330
|
-
}
|
|
331
|
-
function assertAsyncStorageRegistered() {
|
|
332
|
-
if (!AsyncLocalStorageClass) {
|
|
333
|
-
console.warn(
|
|
334
|
-
"Bitfab: AsyncLocalStorage not available - nested span context will not propagate."
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
var asyncStorageReady = (typeof process !== "undefined" && process.versions?.node ? (
|
|
339
|
-
// The join trick hides "node:async_hooks" from static analysis so
|
|
340
|
-
// bundlers that ban Node.js built-ins don't fail at build time.
|
|
341
|
-
// webpackIgnore tells webpack/turbopack to emit a native import()
|
|
342
|
-
// so Node.js can resolve the module at runtime.
|
|
343
|
-
import(
|
|
344
|
-
/* webpackIgnore: true */
|
|
345
|
-
["node", "async_hooks"].join(":")
|
|
346
|
-
).then(
|
|
347
|
-
(mod) => {
|
|
348
|
-
registerAsyncLocalStorageClass(mod.AsyncLocalStorage);
|
|
349
|
-
}
|
|
350
|
-
).catch(() => {
|
|
351
|
-
})
|
|
352
|
-
) : Promise.resolve()).then(() => {
|
|
353
|
-
initDone = true;
|
|
354
|
-
});
|
|
355
|
-
function isAsyncStorageInitDone() {
|
|
356
|
-
return initDone;
|
|
357
|
-
}
|
|
358
|
-
function createAsyncLocalStorage() {
|
|
359
|
-
return AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
320
|
// src/replayContext.ts
|
|
363
321
|
var replayContextStorage = null;
|
|
364
322
|
var REPLAY_CONTEXT_STORAGE_SYMBOL = /* @__PURE__ */ Symbol.for("bitfab.replayContextStorage");
|
|
@@ -682,7 +640,7 @@ var MAX_REQUEST_BYTES_ENV = "BITFAB_OTEL_MAX_REQUEST_BYTES";
|
|
|
682
640
|
var EXPORT_CONCURRENCY_ENV = "BITFAB_OTEL_EXPORT_CONCURRENCY";
|
|
683
641
|
var MAX_QUEUE_SIZE = 8192;
|
|
684
642
|
var DIRECT_MAX_EXPORT_BATCH_SIZE = 512;
|
|
685
|
-
var DIRECT_MAX_REQUEST_BATCH_SIZE =
|
|
643
|
+
var DIRECT_MAX_REQUEST_BATCH_SIZE = 128;
|
|
686
644
|
var DEFAULT_EXPORT_CONCURRENCY = 32;
|
|
687
645
|
var MAX_EXPORT_CONCURRENCY = 64;
|
|
688
646
|
var SCHEDULE_DELAY_MILLIS = 5e3;
|
|
@@ -1781,6 +1739,12 @@ var HttpClient = class {
|
|
|
1781
1739
|
async lookupFunction(name) {
|
|
1782
1740
|
return this.request("/api/sdk/functions/lookup", { name });
|
|
1783
1741
|
}
|
|
1742
|
+
async getAutoTracePolicy(traceFunctionKey, protocol) {
|
|
1743
|
+
return this.request("/api/sdk/auto-trace/policy", {
|
|
1744
|
+
traceFunctionKey,
|
|
1745
|
+
protocol
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1784
1748
|
async getTraceSpan(traceId, lookup) {
|
|
1785
1749
|
const searchParams = new URLSearchParams();
|
|
1786
1750
|
if (lookup.id !== void 0) {
|
|
@@ -1831,7 +1795,12 @@ var HttpClient = class {
|
|
|
1831
1795
|
* the OTLP carrier has no path to carry it.
|
|
1832
1796
|
*/
|
|
1833
1797
|
sendInternalTrace(functionId, payload) {
|
|
1834
|
-
const body = {
|
|
1798
|
+
const body = {
|
|
1799
|
+
...payload,
|
|
1800
|
+
functionId,
|
|
1801
|
+
sdkPackage: __packageName__,
|
|
1802
|
+
sdkVersion: __version__
|
|
1803
|
+
};
|
|
1835
1804
|
this.getTraceTransport()?.submit(
|
|
1836
1805
|
"internal_trace",
|
|
1837
1806
|
body,
|
|
@@ -1860,7 +1829,11 @@ var HttpClient = class {
|
|
|
1860
1829
|
sendExternalTrace(payload) {
|
|
1861
1830
|
this.getTraceTransport()?.submit(
|
|
1862
1831
|
"external_trace",
|
|
1863
|
-
{
|
|
1832
|
+
{
|
|
1833
|
+
...payload,
|
|
1834
|
+
sdkPackage: __packageName__,
|
|
1835
|
+
sdkVersion: __version__
|
|
1836
|
+
},
|
|
1864
1837
|
this.recordedMeta(
|
|
1865
1838
|
"external_trace",
|
|
1866
1839
|
payload,
|
|
@@ -2923,17 +2896,9 @@ async function writeReplayResultFile(result) {
|
|
|
2923
2896
|
}
|
|
2924
2897
|
|
|
2925
2898
|
export {
|
|
2926
|
-
__privateGet,
|
|
2927
|
-
__privateAdd,
|
|
2928
|
-
__privateSet,
|
|
2929
2899
|
__version__,
|
|
2930
2900
|
DEFAULT_SERVICE_URL,
|
|
2931
2901
|
BitfabError,
|
|
2932
|
-
registerAsyncLocalStorageClass,
|
|
2933
|
-
assertAsyncStorageRegistered,
|
|
2934
|
-
asyncStorageReady,
|
|
2935
|
-
isAsyncStorageInitDone,
|
|
2936
|
-
createAsyncLocalStorage,
|
|
2937
2902
|
getReplayContext,
|
|
2938
2903
|
warnOnce,
|
|
2939
2904
|
flushTraces,
|
|
@@ -2953,4 +2918,4 @@ export {
|
|
|
2953
2918
|
sleepForReplayPersistence,
|
|
2954
2919
|
replay
|
|
2955
2920
|
};
|
|
2956
|
-
//# sourceMappingURL=chunk-
|
|
2921
|
+
//# sourceMappingURL=chunk-QWV7JDLQ.js.map
|