@bitfab/sdk 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-JF56DBPP.js → chunk-4LMLPCYL.js} +2 -2
- package/dist/{chunk-JF56DBPP.js.map → chunk-4LMLPCYL.js.map} +1 -1
- package/dist/{chunk-O3XSV52U.js → chunk-GJWKOJGJ.js} +3 -3
- package/dist/{chunk-X6AIRJJX.js → chunk-L4SB4W3Z.js} +44 -11
- package/dist/chunk-L4SB4W3Z.js.map +1 -0
- package/dist/{chunk-OIIMVPTH.js → chunk-LMKQBRSP.js} +2 -2
- package/dist/{chunk-OIIMVPTH.js.map → chunk-LMKQBRSP.js.map} +1 -1
- package/dist/{chunk-27WMHYUI.js → chunk-M2AEKEZE.js} +2 -2
- package/dist/{http-I5VDJLSJ.js → http-3WCRPXRQ.js} +2 -2
- package/dist/{http-RGNLMMZQ.js → http-JPJBWD5Z.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-KILXEBEG.js → replay-2JBBAJUG.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-X6AIRJJX.js.map +0 -1
- /package/dist/{chunk-O3XSV52U.js.map → chunk-GJWKOJGJ.js.map} +0 -0
- /package/dist/{chunk-27WMHYUI.js.map → chunk-M2AEKEZE.js.map} +0 -0
- /package/dist/{http-I5VDJLSJ.js.map → http-3WCRPXRQ.js.map} +0 -0
- /package/dist/{http-RGNLMMZQ.js.map → http-JPJBWD5Z.js.map} +0 -0
- /package/dist/{replay-KILXEBEG.js.map → replay-2JBBAJUG.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
replayContextReady,
|
|
7
7
|
runWithReplayContext,
|
|
8
8
|
warnOnce
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4LMLPCYL.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-M2AEKEZE.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LMKQBRSP.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-3WCRPXRQ.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4LMLPCYL.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-JPJBWD5Z.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ var __version__, __packageName__;
|
|
|
42
42
|
var init_version_generated = __esm({
|
|
43
43
|
"src/version.generated.ts"() {
|
|
44
44
|
"use strict";
|
|
45
|
-
__version__ = "0.54.
|
|
45
|
+
__version__ = "0.54.8";
|
|
46
46
|
__packageName__ = "@bitfab/sdk";
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -7893,6 +7893,30 @@ function readEnv2(name) {
|
|
|
7893
7893
|
}
|
|
7894
7894
|
return void 0;
|
|
7895
7895
|
}
|
|
7896
|
+
var CAPTURE_ENABLED_ENV = "BITFAB_CAPTURE_ENABLED";
|
|
7897
|
+
var TRUE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes"]);
|
|
7898
|
+
var FALSE_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no"]);
|
|
7899
|
+
function readBooleanEnv(name) {
|
|
7900
|
+
const raw = readEnv2(name);
|
|
7901
|
+
if (raw === void 0) {
|
|
7902
|
+
return void 0;
|
|
7903
|
+
}
|
|
7904
|
+
const value = raw.trim().toLowerCase();
|
|
7905
|
+
if (value === "") {
|
|
7906
|
+
return void 0;
|
|
7907
|
+
}
|
|
7908
|
+
if (TRUE_ENV_VALUES.has(value)) {
|
|
7909
|
+
return true;
|
|
7910
|
+
}
|
|
7911
|
+
if (FALSE_ENV_VALUES.has(value)) {
|
|
7912
|
+
return false;
|
|
7913
|
+
}
|
|
7914
|
+
warnOnce(
|
|
7915
|
+
`unrecognized-boolean-env:${name}`,
|
|
7916
|
+
`${name}="${raw}" is not 0 or 1; ignoring it.`
|
|
7917
|
+
);
|
|
7918
|
+
return void 0;
|
|
7919
|
+
}
|
|
7896
7920
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
7897
7921
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
7898
7922
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
@@ -7947,7 +7971,7 @@ var Bitfab = class {
|
|
|
7947
7971
|
"Bitfab({ enabled }) is deprecated; pass captureEnabled instead."
|
|
7948
7972
|
);
|
|
7949
7973
|
}
|
|
7950
|
-
this.
|
|
7974
|
+
this.captureConfiguredInCode = config.captureEnabled === void 0 && config.enabled === void 0 ? void 0 : (config.captureEnabled ?? true) && (config.enabled ?? true);
|
|
7951
7975
|
this.strict = config.strict ?? false;
|
|
7952
7976
|
this.bamlClient = config.bamlClient ?? null;
|
|
7953
7977
|
if (config.dbSnapshot) {
|
|
@@ -8401,7 +8425,7 @@ var Bitfab = class {
|
|
|
8401
8425
|
"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`."
|
|
8402
8426
|
);
|
|
8403
8427
|
}
|
|
8404
|
-
if (this.
|
|
8428
|
+
if (this.isCaptureConfigured() && !this.apiKeyWarned) {
|
|
8405
8429
|
this.apiKeyWarned = true;
|
|
8406
8430
|
console.warn(
|
|
8407
8431
|
"Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
|
|
@@ -8409,20 +8433,29 @@ var Bitfab = class {
|
|
|
8409
8433
|
}
|
|
8410
8434
|
return void 0;
|
|
8411
8435
|
}
|
|
8436
|
+
isCaptureConfigured() {
|
|
8437
|
+
if (this.captureConfiguredInCode !== void 0) {
|
|
8438
|
+
return this.captureConfiguredInCode;
|
|
8439
|
+
}
|
|
8440
|
+
if (this.captureConfiguredFromEnv === void 0) {
|
|
8441
|
+
this.captureConfiguredFromEnv = readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true;
|
|
8442
|
+
}
|
|
8443
|
+
return this.captureConfiguredFromEnv;
|
|
8444
|
+
}
|
|
8412
8445
|
isCaptureEnabled() {
|
|
8413
|
-
if (!this.
|
|
8446
|
+
if (!this.isCaptureConfigured()) {
|
|
8414
8447
|
return false;
|
|
8415
8448
|
}
|
|
8416
8449
|
return this.resolveApiKey() !== void 0;
|
|
8417
8450
|
}
|
|
8418
8451
|
shouldRecord() {
|
|
8419
|
-
if (!this.
|
|
8452
|
+
if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) {
|
|
8420
8453
|
return false;
|
|
8421
8454
|
}
|
|
8422
8455
|
return this.resolveApiKey() !== void 0;
|
|
8423
8456
|
}
|
|
8424
8457
|
prepareFrameworkIntegration() {
|
|
8425
|
-
if (this.
|
|
8458
|
+
if (this.isCaptureConfigured() && this.strict) {
|
|
8426
8459
|
this.resolveApiKey();
|
|
8427
8460
|
}
|
|
8428
8461
|
}
|