@bitfab/sdk 0.65.6 → 0.65.7
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/{http-lnqCEnB1.js → http-BaLzqv9W.js} +15 -6
- package/dist/http-BaLzqv9W.js.map +1 -0
- package/dist/{index-CFOLQ1IF.d.cts → index-qVS-HeqB.d.cts} +2 -1
- package/dist/{index-CFOLQ1IF.d.ts → index-qVS-HeqB.d.ts} +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/registryCommand-Di8x0YoJ.js.map +1 -1
- package/dist/{src-BungStQw.js → src-BblbvWfU.js} +11 -5
- package/dist/{src-BungStQw.js.map → src-BblbvWfU.js.map} +1 -1
- package/dist/{src-FFSCRXpz.cjs → src-DgkDt32g.cjs} +22 -7
- package/dist/src-DgkDt32g.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/http-lnqCEnB1.js.map +0 -1
- package/dist/src-FFSCRXpz.cjs.map +0 -1
|
@@ -58,7 +58,7 @@ var CategoriesClient = class {
|
|
|
58
58
|
const AssertionCategoriesClient = CategoriesClient;
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/version.generated.ts
|
|
61
|
-
const __version__ = "0.65.
|
|
61
|
+
const __version__ = "0.65.7";
|
|
62
62
|
const __packageName__ = "@bitfab/sdk";
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/constants.ts
|
|
@@ -832,6 +832,7 @@ var SimulationPlan = class {
|
|
|
832
832
|
this.rootWaitOver = false;
|
|
833
833
|
this.held = [];
|
|
834
834
|
this.stopped = false;
|
|
835
|
+
this.readStarted = false;
|
|
835
836
|
this.loaded = new Promise((resolve) => {
|
|
836
837
|
this.resolveLoaded = resolve;
|
|
837
838
|
});
|
|
@@ -842,8 +843,16 @@ var SimulationPlan = class {
|
|
|
842
843
|
disabled() {
|
|
843
844
|
return !this.enabled || simulationPlanEnvDisabled();
|
|
844
845
|
}
|
|
846
|
+
idle() {
|
|
847
|
+
return !this.readStarted && this.source.canRead?.() === false;
|
|
848
|
+
}
|
|
845
849
|
refresh() {
|
|
850
|
+
if (this.idle()) return;
|
|
851
|
+
this.read();
|
|
852
|
+
}
|
|
853
|
+
read() {
|
|
846
854
|
if (this.stopped || this.disabled()) return;
|
|
855
|
+
this.readStarted = true;
|
|
847
856
|
this.policyRefresh.run(() => this.source.getSimulationPlan(), (body) => {
|
|
848
857
|
const parsed = parseSimulationPlan(body);
|
|
849
858
|
if (parsed === null) this.scheduleRetry("sim-plan-unreadable", "the sim plan response was not understood");
|
|
@@ -888,7 +897,7 @@ var SimulationPlan = class {
|
|
|
888
897
|
}
|
|
889
898
|
waitForFirstRead() {
|
|
890
899
|
this.refresh();
|
|
891
|
-
if (this.rootWaitOver || this.disabled() || !this.holdingForFirstRead()) return;
|
|
900
|
+
if (this.rootWaitOver || this.disabled() || this.idle() || !this.holdingForFirstRead()) return;
|
|
892
901
|
if (this.rootWait === void 0) {
|
|
893
902
|
this.rootWait = new Promise((resolve) => {
|
|
894
903
|
this.resolveRootWait = resolve;
|
|
@@ -904,11 +913,11 @@ var SimulationPlan = class {
|
|
|
904
913
|
return !this.disabled() && this.contentOffByKey === void 0 && this.firstReadOver;
|
|
905
914
|
}
|
|
906
915
|
firstLoad() {
|
|
907
|
-
if (this.contentOffByKey !== void 0 || this.stopped || this.disabled()) return;
|
|
916
|
+
if (this.contentOffByKey !== void 0 || this.stopped || this.disabled() || this.idle()) return;
|
|
908
917
|
return this.loaded;
|
|
909
918
|
}
|
|
910
919
|
send(payload, traceFunctionKey, submit, drop) {
|
|
911
|
-
this.
|
|
920
|
+
this.read();
|
|
912
921
|
if (this.disabled() || traceFunctionKey === void 0 || spanNameOf(payload) === void 0 || recordedByFramework(payload)) {
|
|
913
922
|
submit(payload);
|
|
914
923
|
return;
|
|
@@ -926,7 +935,7 @@ var SimulationPlan = class {
|
|
|
926
935
|
this.submitEntry(entry);
|
|
927
936
|
}
|
|
928
937
|
sendTrace(payload, submit) {
|
|
929
|
-
this.
|
|
938
|
+
this.read();
|
|
930
939
|
if (this.disabled() || !this.holdingForFirstRead() || !this.holdsSpanOfTrace(traceIdOf(payload))) {
|
|
931
940
|
submit(payload);
|
|
932
941
|
return;
|
|
@@ -6881,7 +6890,10 @@ var Bitfab = class {
|
|
|
6881
6890
|
serviceUrl: this.serviceUrl,
|
|
6882
6891
|
timeout: this.timeout
|
|
6883
6892
|
});
|
|
6884
|
-
this.simulationPlan = new SimulationPlan(
|
|
6893
|
+
this.simulationPlan = new SimulationPlan({
|
|
6894
|
+
getSimulationPlan: () => this.httpClient.getSimulationPlan(),
|
|
6895
|
+
canRead: () => this.canReadSimulationPlan()
|
|
6896
|
+
}, config.simulationPlan ?? true);
|
|
6885
6897
|
this.httpClient.externalSpanTransform = (payload, submit, drop) => this.applySimulationPlan(payload, submit, drop);
|
|
6886
6898
|
this.httpClient.externalTraceTransform = (payload, submit) => this.simulationPlan.sendTrace(payload, submit);
|
|
6887
6899
|
this.httpClient.releaseHeldExternalSpans = (timeoutMs) => this.simulationPlan.release(timeoutMs);
|
|
@@ -7153,6 +7165,9 @@ var Bitfab = class {
|
|
|
7153
7165
|
if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) return false;
|
|
7154
7166
|
return this.resolveApiKey() !== void 0;
|
|
7155
7167
|
}
|
|
7168
|
+
canReadSimulationPlan() {
|
|
7169
|
+
return ((this.captureConfiguredInCode ?? this.captureConfiguredFromEnv ?? readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true) || getReplayContext() !== null || inSeedScope()) && this.findApiKey(true) !== void 0;
|
|
7170
|
+
}
|
|
7156
7171
|
prepareFrameworkIntegration() {
|
|
7157
7172
|
if (this.isCaptureConfigured() && this.strict) this.resolveApiKey();
|
|
7158
7173
|
}
|
|
@@ -8435,4 +8450,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
|
|
|
8435
8450
|
}
|
|
8436
8451
|
});
|
|
8437
8452
|
|
|
8438
|
-
//# sourceMappingURL=src-
|
|
8453
|
+
//# sourceMappingURL=src-DgkDt32g.cjs.map
|