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
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RC3HOMLJ.js";
|
|
10
10
|
export {
|
|
11
11
|
BitfabError,
|
|
12
12
|
HttpClient,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
parseRetryAfterMs,
|
|
17
17
|
serializePayloadBody
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=http-
|
|
19
|
+
//# sourceMappingURL=http-4JG3XW5X.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5H3D7J4K.js";
|
|
10
10
|
import "./chunk-VCRFFCLY.js";
|
|
11
11
|
export {
|
|
12
12
|
BitfabError,
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
parseRetryAfterMs,
|
|
18
18
|
serializePayloadBody
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=http-
|
|
20
|
+
//# sourceMappingURL=http-7PL32JLX.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var __version__, __packageName__;
|
|
|
51
51
|
var init_version_generated = __esm({
|
|
52
52
|
"src/version.generated.ts"() {
|
|
53
53
|
"use strict";
|
|
54
|
-
__version__ = "0.54.
|
|
54
|
+
__version__ = "0.54.8";
|
|
55
55
|
__packageName__ = "bitfab";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -7902,6 +7902,30 @@ function readEnv2(name) {
|
|
|
7902
7902
|
}
|
|
7903
7903
|
return void 0;
|
|
7904
7904
|
}
|
|
7905
|
+
var CAPTURE_ENABLED_ENV = "BITFAB_CAPTURE_ENABLED";
|
|
7906
|
+
var TRUE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes"]);
|
|
7907
|
+
var FALSE_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no"]);
|
|
7908
|
+
function readBooleanEnv(name) {
|
|
7909
|
+
const raw = readEnv2(name);
|
|
7910
|
+
if (raw === void 0) {
|
|
7911
|
+
return void 0;
|
|
7912
|
+
}
|
|
7913
|
+
const value = raw.trim().toLowerCase();
|
|
7914
|
+
if (value === "") {
|
|
7915
|
+
return void 0;
|
|
7916
|
+
}
|
|
7917
|
+
if (TRUE_ENV_VALUES.has(value)) {
|
|
7918
|
+
return true;
|
|
7919
|
+
}
|
|
7920
|
+
if (FALSE_ENV_VALUES.has(value)) {
|
|
7921
|
+
return false;
|
|
7922
|
+
}
|
|
7923
|
+
warnOnce(
|
|
7924
|
+
`unrecognized-boolean-env:${name}`,
|
|
7925
|
+
`${name}="${raw}" is not 0 or 1; ignoring it.`
|
|
7926
|
+
);
|
|
7927
|
+
return void 0;
|
|
7928
|
+
}
|
|
7905
7929
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
7906
7930
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
7907
7931
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
@@ -7956,7 +7980,7 @@ var Bitfab = class {
|
|
|
7956
7980
|
"Bitfab({ enabled }) is deprecated; pass captureEnabled instead."
|
|
7957
7981
|
);
|
|
7958
7982
|
}
|
|
7959
|
-
this.
|
|
7983
|
+
this.captureConfiguredInCode = config.captureEnabled === void 0 && config.enabled === void 0 ? void 0 : (config.captureEnabled ?? true) && (config.enabled ?? true);
|
|
7960
7984
|
this.strict = config.strict ?? false;
|
|
7961
7985
|
this.bamlClient = config.bamlClient ?? null;
|
|
7962
7986
|
if (config.dbSnapshot) {
|
|
@@ -8410,7 +8434,7 @@ var Bitfab = class {
|
|
|
8410
8434
|
"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`."
|
|
8411
8435
|
);
|
|
8412
8436
|
}
|
|
8413
|
-
if (this.
|
|
8437
|
+
if (this.isCaptureConfigured() && !this.apiKeyWarned) {
|
|
8414
8438
|
this.apiKeyWarned = true;
|
|
8415
8439
|
console.warn(
|
|
8416
8440
|
"Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
|
|
@@ -8418,20 +8442,29 @@ var Bitfab = class {
|
|
|
8418
8442
|
}
|
|
8419
8443
|
return void 0;
|
|
8420
8444
|
}
|
|
8445
|
+
isCaptureConfigured() {
|
|
8446
|
+
if (this.captureConfiguredInCode !== void 0) {
|
|
8447
|
+
return this.captureConfiguredInCode;
|
|
8448
|
+
}
|
|
8449
|
+
if (this.captureConfiguredFromEnv === void 0) {
|
|
8450
|
+
this.captureConfiguredFromEnv = readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true;
|
|
8451
|
+
}
|
|
8452
|
+
return this.captureConfiguredFromEnv;
|
|
8453
|
+
}
|
|
8421
8454
|
isCaptureEnabled() {
|
|
8422
|
-
if (!this.
|
|
8455
|
+
if (!this.isCaptureConfigured()) {
|
|
8423
8456
|
return false;
|
|
8424
8457
|
}
|
|
8425
8458
|
return this.resolveApiKey() !== void 0;
|
|
8426
8459
|
}
|
|
8427
8460
|
shouldRecord() {
|
|
8428
|
-
if (!this.
|
|
8461
|
+
if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) {
|
|
8429
8462
|
return false;
|
|
8430
8463
|
}
|
|
8431
8464
|
return this.resolveApiKey() !== void 0;
|
|
8432
8465
|
}
|
|
8433
8466
|
prepareFrameworkIntegration() {
|
|
8434
|
-
if (this.
|
|
8467
|
+
if (this.isCaptureConfigured() && this.strict) {
|
|
8435
8468
|
this.resolveApiKey();
|
|
8436
8469
|
}
|
|
8437
8470
|
}
|