bitfab 0.54.7 → 0.54.8
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/README.md +2 -1
- package/dist/{chunk-GGMFD2ZE.js → chunk-5H3D7J4K.js} +2 -2
- package/dist/{chunk-GGMFD2ZE.js.map → chunk-5H3D7J4K.js.map} +1 -1
- package/dist/{chunk-CRBJE655.js → chunk-5LXZGUKW.js} +3 -3
- package/dist/{chunk-VDQAIWLX.js → chunk-RC3HOMLJ.js} +2 -2
- package/dist/{chunk-VDQAIWLX.js.map → chunk-RC3HOMLJ.js.map} +1 -1
- package/dist/{chunk-ONMN7WXS.js → chunk-RUCVJQBI.js} +2 -2
- package/dist/{chunk-MFMTLYDW.js → chunk-XPCVDQDS.js} +44 -11
- package/dist/chunk-XPCVDQDS.js.map +1 -0
- package/dist/{http-NIVPIUA2.js → http-4JG3XW5X.js} +2 -2
- package/dist/{http-DYGY3K7H.js → http-7PL32JLX.js} +2 -2
- package/dist/index.cjs +39 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/node.cjs +39 -6
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-22RLT3Z4.js → replay-KWBZ2JQV.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-MFMTLYDW.js.map +0 -1
- /package/dist/{chunk-CRBJE655.js.map → chunk-5LXZGUKW.js.map} +0 -0
- /package/dist/{chunk-ONMN7WXS.js.map → chunk-RUCVJQBI.js.map} +0 -0
- /package/dist/{http-DYGY3K7H.js.map → http-4JG3XW5X.js.map} +0 -0
- /package/dist/{http-NIVPIUA2.js.map → http-7PL32JLX.js.map} +0 -0
- /package/dist/{replay-22RLT3Z4.js.map → replay-KWBZ2JQV.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
replayContextReady,
|
|
7
7
|
runWithReplayContext,
|
|
8
8
|
warnOnce
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5H3D7J4K.js";
|
|
10
10
|
import {
|
|
11
11
|
runWithCaptureSuppressed
|
|
12
12
|
} from "./chunk-VCRFFCLY.js";
|
|
@@ -1212,4 +1212,4 @@ export {
|
|
|
1212
1212
|
sleepForReplayPersistence,
|
|
1213
1213
|
replay
|
|
1214
1214
|
};
|
|
1215
|
-
//# sourceMappingURL=chunk-
|
|
1215
|
+
//# sourceMappingURL=chunk-RUCVJQBI.js.map
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
serializeValue,
|
|
19
19
|
toJsonSafe,
|
|
20
20
|
toJsonSafeReport
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RUCVJQBI.js";
|
|
22
22
|
import {
|
|
23
23
|
BitfabError,
|
|
24
24
|
DEFAULT_SERVICE_URL,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
recordCallerTraceMetadata,
|
|
36
36
|
retireTraceMetadata,
|
|
37
37
|
warnOnce
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-5H3D7J4K.js";
|
|
39
39
|
import {
|
|
40
40
|
__privateAdd,
|
|
41
41
|
__privateGet,
|
|
@@ -3395,6 +3395,30 @@ function readEnv2(name) {
|
|
|
3395
3395
|
}
|
|
3396
3396
|
return void 0;
|
|
3397
3397
|
}
|
|
3398
|
+
var CAPTURE_ENABLED_ENV = "BITFAB_CAPTURE_ENABLED";
|
|
3399
|
+
var TRUE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes"]);
|
|
3400
|
+
var FALSE_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no"]);
|
|
3401
|
+
function readBooleanEnv(name) {
|
|
3402
|
+
const raw = readEnv2(name);
|
|
3403
|
+
if (raw === void 0) {
|
|
3404
|
+
return void 0;
|
|
3405
|
+
}
|
|
3406
|
+
const value = raw.trim().toLowerCase();
|
|
3407
|
+
if (value === "") {
|
|
3408
|
+
return void 0;
|
|
3409
|
+
}
|
|
3410
|
+
if (TRUE_ENV_VALUES.has(value)) {
|
|
3411
|
+
return true;
|
|
3412
|
+
}
|
|
3413
|
+
if (FALSE_ENV_VALUES.has(value)) {
|
|
3414
|
+
return false;
|
|
3415
|
+
}
|
|
3416
|
+
warnOnce(
|
|
3417
|
+
`unrecognized-boolean-env:${name}`,
|
|
3418
|
+
`${name}="${raw}" is not 0 or 1; ignoring it.`
|
|
3419
|
+
);
|
|
3420
|
+
return void 0;
|
|
3421
|
+
}
|
|
3398
3422
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
3399
3423
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
3400
3424
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
@@ -3449,7 +3473,7 @@ var Bitfab = class {
|
|
|
3449
3473
|
"Bitfab({ enabled }) is deprecated; pass captureEnabled instead."
|
|
3450
3474
|
);
|
|
3451
3475
|
}
|
|
3452
|
-
this.
|
|
3476
|
+
this.captureConfiguredInCode = config.captureEnabled === void 0 && config.enabled === void 0 ? void 0 : (config.captureEnabled ?? true) && (config.enabled ?? true);
|
|
3453
3477
|
this.strict = config.strict ?? false;
|
|
3454
3478
|
this.bamlClient = config.bamlClient ?? null;
|
|
3455
3479
|
if (config.dbSnapshot) {
|
|
@@ -3903,7 +3927,7 @@ var Bitfab = class {
|
|
|
3903
3927
|
"Bitfab: no API key resolved. Set BITFAB_API_KEY or pass apiKey to new Bitfab(). If a script loads env with dotenv, load it before the module that constructs the client is imported (e.g. `node --env-file=.env script.ts`), or pass `apiKey: () => process.env.BITFAB_API_KEY`."
|
|
3904
3928
|
);
|
|
3905
3929
|
}
|
|
3906
|
-
if (this.
|
|
3930
|
+
if (this.isCaptureConfigured() && !this.apiKeyWarned) {
|
|
3907
3931
|
this.apiKeyWarned = true;
|
|
3908
3932
|
console.warn(
|
|
3909
3933
|
"Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
|
|
@@ -3911,20 +3935,29 @@ var Bitfab = class {
|
|
|
3911
3935
|
}
|
|
3912
3936
|
return void 0;
|
|
3913
3937
|
}
|
|
3938
|
+
isCaptureConfigured() {
|
|
3939
|
+
if (this.captureConfiguredInCode !== void 0) {
|
|
3940
|
+
return this.captureConfiguredInCode;
|
|
3941
|
+
}
|
|
3942
|
+
if (this.captureConfiguredFromEnv === void 0) {
|
|
3943
|
+
this.captureConfiguredFromEnv = readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true;
|
|
3944
|
+
}
|
|
3945
|
+
return this.captureConfiguredFromEnv;
|
|
3946
|
+
}
|
|
3914
3947
|
isCaptureEnabled() {
|
|
3915
|
-
if (!this.
|
|
3948
|
+
if (!this.isCaptureConfigured()) {
|
|
3916
3949
|
return false;
|
|
3917
3950
|
}
|
|
3918
3951
|
return this.resolveApiKey() !== void 0;
|
|
3919
3952
|
}
|
|
3920
3953
|
shouldRecord() {
|
|
3921
|
-
if (!this.
|
|
3954
|
+
if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) {
|
|
3922
3955
|
return false;
|
|
3923
3956
|
}
|
|
3924
3957
|
return this.resolveApiKey() !== void 0;
|
|
3925
3958
|
}
|
|
3926
3959
|
prepareFrameworkIntegration() {
|
|
3927
|
-
if (this.
|
|
3960
|
+
if (this.isCaptureConfigured() && this.strict) {
|
|
3928
3961
|
this.resolveApiKey();
|
|
3929
3962
|
}
|
|
3930
3963
|
}
|
|
@@ -5204,7 +5237,7 @@ var Bitfab = class {
|
|
|
5204
5237
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
5205
5238
|
} finally {
|
|
5206
5239
|
try {
|
|
5207
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
5240
|
+
const { flushTraces: flushTraces2 } = await import("./http-7PL32JLX.js");
|
|
5208
5241
|
await flushTraces2(3e4);
|
|
5209
5242
|
} finally {
|
|
5210
5243
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -5263,7 +5296,7 @@ var Bitfab = class {
|
|
|
5263
5296
|
`Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
|
|
5264
5297
|
);
|
|
5265
5298
|
}
|
|
5266
|
-
const { replay: doReplay } = await import("./replay-
|
|
5299
|
+
const { replay: doReplay } = await import("./replay-KWBZ2JQV.js");
|
|
5267
5300
|
return doReplay(
|
|
5268
5301
|
this.httpClient,
|
|
5269
5302
|
this.serviceUrl,
|
|
@@ -5547,7 +5580,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
5547
5580
|
sessionId: seedCase.sessionId
|
|
5548
5581
|
})
|
|
5549
5582
|
);
|
|
5550
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
5583
|
+
const { flushTraces: flushTraces2 } = await import("./http-7PL32JLX.js");
|
|
5551
5584
|
await flushTraces2(3e4);
|
|
5552
5585
|
return { pipeline, traceFunctionKey, traceIds };
|
|
5553
5586
|
}
|
|
@@ -5585,4 +5618,4 @@ export {
|
|
|
5585
5618
|
reseedFromRegistry,
|
|
5586
5619
|
seedFromRegistry
|
|
5587
5620
|
};
|
|
5588
|
-
//# sourceMappingURL=chunk-
|
|
5621
|
+
//# sourceMappingURL=chunk-XPCVDQDS.js.map
|