@burn0/burn0 0.2.1 → 0.2.3
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/{chunk-KKYHE4ZV.mjs → chunk-H3A5NM5C.mjs} +9 -4
- package/dist/cli/index.js +3 -14
- package/dist/index.js +8 -3
- package/dist/index.mjs +1 -1
- package/dist/register.js +8 -3
- package/dist/register.mjs +1 -1
- package/package.json +1 -1
|
@@ -560,7 +560,7 @@ var FREE_SERVICES = /* @__PURE__ */ new Set([
|
|
|
560
560
|
"slack-api",
|
|
561
561
|
"discord-api"
|
|
562
562
|
]);
|
|
563
|
-
|
|
563
|
+
function loadCachedPricing() {
|
|
564
564
|
try {
|
|
565
565
|
const cachePath = path2.join(process.cwd(), CACHE_FILE);
|
|
566
566
|
if (fs2.existsSync(cachePath)) {
|
|
@@ -568,11 +568,15 @@ async function fetchPricing(apiUrl, fetchFn) {
|
|
|
568
568
|
const cached = JSON.parse(raw);
|
|
569
569
|
if (Date.now() - cached.cached_at < CACHE_TTL_MS) {
|
|
570
570
|
pricingData = cached;
|
|
571
|
-
return;
|
|
571
|
+
return true;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
} catch {
|
|
575
575
|
}
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
async function fetchPricing(apiUrl, fetchFn) {
|
|
579
|
+
if (pricingData) return;
|
|
576
580
|
try {
|
|
577
581
|
const response = await fetchFn(`${apiUrl}/v1/pricing`, {
|
|
578
582
|
headers: { "Accept": "application/json" }
|
|
@@ -755,11 +759,12 @@ function createTicker(init) {
|
|
|
755
759
|
}
|
|
756
760
|
|
|
757
761
|
// src/index.ts
|
|
758
|
-
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://
|
|
762
|
+
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://burn0-server-production.up.railway.app";
|
|
759
763
|
var apiKey = getApiKey();
|
|
760
764
|
var mode = detectMode({ isTTY: isTTY(), apiKey });
|
|
761
765
|
var { track, startSpan, enrichEvent } = createTracker();
|
|
762
766
|
var originalFetch2 = globalThis.fetch;
|
|
767
|
+
loadCachedPricing();
|
|
763
768
|
if (mode !== "test-disabled" && mode !== "prod-local") {
|
|
764
769
|
fetchPricing(BURN0_API_URL, originalFetch2).catch(() => {
|
|
765
770
|
});
|
|
@@ -841,4 +846,4 @@ export {
|
|
|
841
846
|
startSpan,
|
|
842
847
|
restore
|
|
843
848
|
};
|
|
844
|
-
//# sourceMappingURL=chunk-
|
|
849
|
+
//# sourceMappingURL=chunk-H3A5NM5C.mjs.map
|
package/dist/cli/index.js
CHANGED
|
@@ -18174,7 +18174,7 @@ async function _runInit() {
|
|
|
18174
18174
|
});
|
|
18175
18175
|
if (apiKey) {
|
|
18176
18176
|
try {
|
|
18177
|
-
const apiUrl = process.env.BURN0_API_URL ?? "https://
|
|
18177
|
+
const apiUrl = process.env.BURN0_API_URL ?? "https://burn0-server-production.up.railway.app";
|
|
18178
18178
|
const res = await fetch(`${apiUrl}/v1/projects/config`, {
|
|
18179
18179
|
method: "POST",
|
|
18180
18180
|
headers: {
|
|
@@ -18380,18 +18380,7 @@ var init_local = __esm({
|
|
|
18380
18380
|
|
|
18381
18381
|
// src/transport/local-pricing.ts
|
|
18382
18382
|
async function fetchPricing(apiUrl, fetchFn) {
|
|
18383
|
-
|
|
18384
|
-
const cachePath = import_node_path8.default.join(process.cwd(), CACHE_FILE);
|
|
18385
|
-
if (import_node_fs7.default.existsSync(cachePath)) {
|
|
18386
|
-
const raw = import_node_fs7.default.readFileSync(cachePath, "utf-8");
|
|
18387
|
-
const cached = JSON.parse(raw);
|
|
18388
|
-
if (Date.now() - cached.cached_at < CACHE_TTL_MS) {
|
|
18389
|
-
pricingData = cached;
|
|
18390
|
-
return;
|
|
18391
|
-
}
|
|
18392
|
-
}
|
|
18393
|
-
} catch {
|
|
18394
|
-
}
|
|
18383
|
+
if (pricingData) return;
|
|
18395
18384
|
try {
|
|
18396
18385
|
const response = await fetchFn(`${apiUrl}/v1/pricing`, {
|
|
18397
18386
|
headers: { "Accept": "application/json" }
|
|
@@ -18668,7 +18657,7 @@ var init_report = __esm({
|
|
|
18668
18657
|
init_local();
|
|
18669
18658
|
init_local_pricing();
|
|
18670
18659
|
init_env();
|
|
18671
|
-
BURN0_API_URL = process.env.BURN0_API_URL ?? "https://
|
|
18660
|
+
BURN0_API_URL = process.env.BURN0_API_URL ?? "https://burn0-server-production.up.railway.app";
|
|
18672
18661
|
}
|
|
18673
18662
|
});
|
|
18674
18663
|
|
package/dist/index.js
CHANGED
|
@@ -621,7 +621,7 @@ var FREE_SERVICES = /* @__PURE__ */ new Set([
|
|
|
621
621
|
"slack-api",
|
|
622
622
|
"discord-api"
|
|
623
623
|
]);
|
|
624
|
-
|
|
624
|
+
function loadCachedPricing() {
|
|
625
625
|
try {
|
|
626
626
|
const cachePath = import_node_path2.default.join(process.cwd(), CACHE_FILE);
|
|
627
627
|
if (import_node_fs2.default.existsSync(cachePath)) {
|
|
@@ -629,11 +629,15 @@ async function fetchPricing(apiUrl, fetchFn) {
|
|
|
629
629
|
const cached = JSON.parse(raw);
|
|
630
630
|
if (Date.now() - cached.cached_at < CACHE_TTL_MS) {
|
|
631
631
|
pricingData = cached;
|
|
632
|
-
return;
|
|
632
|
+
return true;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
} catch {
|
|
636
636
|
}
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
async function fetchPricing(apiUrl, fetchFn) {
|
|
640
|
+
if (pricingData) return;
|
|
637
641
|
try {
|
|
638
642
|
const response = await fetchFn(`${apiUrl}/v1/pricing`, {
|
|
639
643
|
headers: { "Accept": "application/json" }
|
|
@@ -816,11 +820,12 @@ function createTicker(init) {
|
|
|
816
820
|
}
|
|
817
821
|
|
|
818
822
|
// src/index.ts
|
|
819
|
-
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://
|
|
823
|
+
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://burn0-server-production.up.railway.app";
|
|
820
824
|
var apiKey = getApiKey();
|
|
821
825
|
var mode = detectMode({ isTTY: isTTY(), apiKey });
|
|
822
826
|
var { track, startSpan, enrichEvent } = createTracker();
|
|
823
827
|
var originalFetch2 = globalThis.fetch;
|
|
828
|
+
loadCachedPricing();
|
|
824
829
|
if (mode !== "test-disabled" && mode !== "prod-local") {
|
|
825
830
|
fetchPricing(BURN0_API_URL, originalFetch2).catch(() => {
|
|
826
831
|
});
|
package/dist/index.mjs
CHANGED
package/dist/register.js
CHANGED
|
@@ -607,7 +607,7 @@ var FREE_SERVICES = /* @__PURE__ */ new Set([
|
|
|
607
607
|
"slack-api",
|
|
608
608
|
"discord-api"
|
|
609
609
|
]);
|
|
610
|
-
|
|
610
|
+
function loadCachedPricing() {
|
|
611
611
|
try {
|
|
612
612
|
const cachePath = import_node_path2.default.join(process.cwd(), CACHE_FILE);
|
|
613
613
|
if (import_node_fs2.default.existsSync(cachePath)) {
|
|
@@ -615,11 +615,15 @@ async function fetchPricing(apiUrl, fetchFn) {
|
|
|
615
615
|
const cached = JSON.parse(raw);
|
|
616
616
|
if (Date.now() - cached.cached_at < CACHE_TTL_MS) {
|
|
617
617
|
pricingData = cached;
|
|
618
|
-
return;
|
|
618
|
+
return true;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
} catch {
|
|
622
622
|
}
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
async function fetchPricing(apiUrl, fetchFn) {
|
|
626
|
+
if (pricingData) return;
|
|
623
627
|
try {
|
|
624
628
|
const response = await fetchFn(`${apiUrl}/v1/pricing`, {
|
|
625
629
|
headers: { "Accept": "application/json" }
|
|
@@ -802,11 +806,12 @@ function createTicker(init) {
|
|
|
802
806
|
}
|
|
803
807
|
|
|
804
808
|
// src/index.ts
|
|
805
|
-
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://
|
|
809
|
+
var BURN0_API_URL = process.env.BURN0_API_URL ?? "https://burn0-server-production.up.railway.app";
|
|
806
810
|
var apiKey = getApiKey();
|
|
807
811
|
var mode = detectMode({ isTTY: isTTY(), apiKey });
|
|
808
812
|
var { track, startSpan, enrichEvent } = createTracker();
|
|
809
813
|
var originalFetch2 = globalThis.fetch;
|
|
814
|
+
loadCachedPricing();
|
|
810
815
|
if (mode !== "test-disabled" && mode !== "prod-local") {
|
|
811
816
|
fetchPricing(BURN0_API_URL, originalFetch2).catch(() => {
|
|
812
817
|
});
|
package/dist/register.mjs
CHANGED