@sylphx/cli 0.14.7 → 0.14.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/CHANGELOG.md +7 -0
- package/dist/main.js +19 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @sylphx/cli
|
|
2
2
|
|
|
3
|
+
## 0.14.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1523](https://github.com/SylphxAI/platform/pull/1523) [`c6297fa`](https://github.com/SylphxAI/platform/commit/c6297fa1fab2a8fa7fd4bb83705ffbea9f17b7d2) Thanks [@shtse8](https://github.com/shtse8)! - Keep deploy log streaming attached across transient SSE disconnects so native
|
|
8
|
+
EventSource reconnect can recover without prematurely failing `sylphx deploy`.
|
|
9
|
+
|
|
3
10
|
## 0.14.7
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -15,7 +15,7 @@ var init_package = __esm({
|
|
|
15
15
|
"package.json"() {
|
|
16
16
|
package_default = {
|
|
17
17
|
name: "@sylphx/cli",
|
|
18
|
-
version: "0.14.
|
|
18
|
+
version: "0.14.8",
|
|
19
19
|
description: "Sylphx Platform CLI \u2014 deploy and manage your applications from the terminal. 63 commands across deployment, logs, env vars, domains, databases, storage, monitoring, self-service (user), admin (users/quotas/audit/invitations/jwt-keys/project-migrate), and more.",
|
|
20
20
|
type: "module",
|
|
21
21
|
homepage: "https://sylphx.com",
|
|
@@ -26768,6 +26768,19 @@ var TERMINAL_GRACE_MS = 500;
|
|
|
26768
26768
|
var LogStreamTransportError = class extends Error {
|
|
26769
26769
|
name = "LogStreamTransportError";
|
|
26770
26770
|
};
|
|
26771
|
+
function statusFromEventSourceError(event) {
|
|
26772
|
+
const raw = event.status ?? event.code;
|
|
26773
|
+
if (typeof raw === "number") return Number.isInteger(raw) ? raw : void 0;
|
|
26774
|
+
if (typeof raw === "string" && /^\d+$/.test(raw)) return Number.parseInt(raw, 10);
|
|
26775
|
+
return void 0;
|
|
26776
|
+
}
|
|
26777
|
+
function isFatalEventSourceError(event) {
|
|
26778
|
+
const status3 = statusFromEventSourceError(event);
|
|
26779
|
+
if (!status3) return false;
|
|
26780
|
+
if (status3 === 204 || status3 === 401 || status3 === 403 || status3 === 404) return true;
|
|
26781
|
+
if (status3 === 408 || status3 === 429) return false;
|
|
26782
|
+
return status3 >= 400 && status3 < 500;
|
|
26783
|
+
}
|
|
26771
26784
|
function streamLogs(url, token, opts = {}) {
|
|
26772
26785
|
return new Promise((resolve2, reject) => {
|
|
26773
26786
|
const headers = {
|
|
@@ -26883,14 +26896,18 @@ function streamLogs(url, token, opts = {}) {
|
|
|
26883
26896
|
}
|
|
26884
26897
|
});
|
|
26885
26898
|
es.addEventListener("error", (event) => {
|
|
26899
|
+
touchIdle();
|
|
26886
26900
|
const errorEvent = event;
|
|
26887
26901
|
const message = errorEvent.message ?? "log stream connection closed unexpectedly";
|
|
26888
26902
|
if (gracefulDone || terminalStatus) {
|
|
26889
26903
|
finishAfterDone();
|
|
26890
|
-
} else {
|
|
26904
|
+
} else if (isFatalEventSourceError(errorEvent)) {
|
|
26891
26905
|
opts.onTransportError?.(message);
|
|
26892
26906
|
console.log(chalk_default.red(` Stream error: ${message}`));
|
|
26893
26907
|
failTransport(message);
|
|
26908
|
+
} else {
|
|
26909
|
+
opts.onTransportError?.(message);
|
|
26910
|
+
console.log(chalk_default.yellow(` Stream reconnecting: ${message}`));
|
|
26894
26911
|
}
|
|
26895
26912
|
});
|
|
26896
26913
|
if (!opts.follow) {
|