@senticor/hive 1.88.0 → 1.88.1
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/hive.cjs +39 -9
- package/package.json +1 -1
package/hive.cjs
CHANGED
|
@@ -9677,6 +9677,7 @@ var CliCommandError = class extends Error {
|
|
|
9677
9677
|
remediation;
|
|
9678
9678
|
tenant;
|
|
9679
9679
|
problemType;
|
|
9680
|
+
details;
|
|
9680
9681
|
constructor(symbolicCode, exitCode, message, options) {
|
|
9681
9682
|
super(message, options);
|
|
9682
9683
|
this.name = "CliCommandError";
|
|
@@ -9685,6 +9686,7 @@ var CliCommandError = class extends Error {
|
|
|
9685
9686
|
this.remediation = options?.remediation;
|
|
9686
9687
|
this.tenant = options?.tenant;
|
|
9687
9688
|
this.problemType = options?.problemType;
|
|
9689
|
+
this.details = options?.details;
|
|
9688
9690
|
}
|
|
9689
9691
|
};
|
|
9690
9692
|
function commandError(symbolicCode, exitCode, message, options) {
|
|
@@ -9716,6 +9718,16 @@ function remoteProblemType(data) {
|
|
|
9716
9718
|
const body = data;
|
|
9717
9719
|
return typeof body.type === "string" && typeof body.title === "string" && typeof body.status === "number" ? body.type : void 0;
|
|
9718
9720
|
}
|
|
9721
|
+
function remoteProblemDetails(data) {
|
|
9722
|
+
if (!remoteProblemType(data)) return void 0;
|
|
9723
|
+
const raw = data.details;
|
|
9724
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
9725
|
+
const out = {};
|
|
9726
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
9727
|
+
if (value === null || ["string", "number", "boolean"].includes(typeof value)) out[name] = value;
|
|
9728
|
+
}
|
|
9729
|
+
return Object.keys(out).length ? out : void 0;
|
|
9730
|
+
}
|
|
9719
9731
|
function fieldText(value) {
|
|
9720
9732
|
if (value === null || value === void 0) return "";
|
|
9721
9733
|
if (typeof value === "object") {
|
|
@@ -9760,11 +9772,17 @@ function remoteFailureError(status2, data, action, exitCode = exitCodeForStatus(
|
|
|
9760
9772
|
const remediation = remoteFailureRemediation(data);
|
|
9761
9773
|
const tenant = remoteFailureTenant(data);
|
|
9762
9774
|
const problemType = remoteProblemType(data);
|
|
9775
|
+
const details = remoteProblemDetails(data);
|
|
9763
9776
|
return commandError(
|
|
9764
9777
|
"REMOTE_FAILED",
|
|
9765
9778
|
exitCode,
|
|
9766
9779
|
`${action} failed${status2 ? ` (HTTP ${status2})` : ""}: ${remoteFailureText(data)}${remediation ? ` \u2014 ${remediation}` : ""}`,
|
|
9767
|
-
remediation || tenant || problemType
|
|
9780
|
+
remediation || tenant || problemType || details ? {
|
|
9781
|
+
...remediation ? { remediation } : {},
|
|
9782
|
+
...tenant ? { tenant } : {},
|
|
9783
|
+
...problemType ? { problemType } : {},
|
|
9784
|
+
...details ? { details } : {}
|
|
9785
|
+
} : void 0
|
|
9768
9786
|
);
|
|
9769
9787
|
}
|
|
9770
9788
|
function remoteFailureText(data) {
|
|
@@ -9774,7 +9792,10 @@ function remoteFailureText(data) {
|
|
|
9774
9792
|
const parts = [code, message, ...isProblem ? [] : [fieldText(body?.detail)]].filter(Boolean);
|
|
9775
9793
|
const fields = isProblem ? [] : schemaErrorFields(data);
|
|
9776
9794
|
if (fields.length) parts.push(`(offending field${fields.length > 1 ? "s" : ""}: ${fields.join(", ")})`);
|
|
9777
|
-
|
|
9795
|
+
const text = [...new Set(parts)].join(": ") || "unexpected response";
|
|
9796
|
+
const details = remoteProblemDetails(data);
|
|
9797
|
+
if (!details) return text;
|
|
9798
|
+
return `${text} (${Object.entries(details).map(([name, value]) => `${name}: ${JSON.stringify(value)}`).join(", ")})`;
|
|
9778
9799
|
}
|
|
9779
9800
|
function toStructuredError(err) {
|
|
9780
9801
|
const e = err;
|
|
@@ -9787,7 +9808,8 @@ function toStructuredError(err) {
|
|
|
9787
9808
|
message,
|
|
9788
9809
|
...e?.remediation ? { remediation: e.remediation } : {},
|
|
9789
9810
|
...e?.problemType ? { type: e.problemType } : {},
|
|
9790
|
-
...e?.tenant ? { tenant: e.tenant } : {}
|
|
9811
|
+
...e?.tenant ? { tenant: e.tenant } : {},
|
|
9812
|
+
...e?.details ? { details: e.details } : {}
|
|
9791
9813
|
}
|
|
9792
9814
|
};
|
|
9793
9815
|
}
|
|
@@ -9838,11 +9860,19 @@ function installRemoteFailureExit() {
|
|
|
9838
9860
|
const remediation = remoteFailureRemediation(failure2.body) ?? (failure2.status === 401 ? "Run 'hive login' to authenticate, or set HIVE_TOKEN." : void 0);
|
|
9839
9861
|
const tenant = remoteFailureTenant(failure2.body);
|
|
9840
9862
|
const problemType = remoteProblemType(failure2.body);
|
|
9863
|
+
const details = remoteProblemDetails(failure2.body);
|
|
9841
9864
|
const message = `${failure2.method} ${failure2.path} failed${failure2.status ? ` (HTTP ${failure2.status})` : ""}: ${remoteFailureText(failure2.body)}`;
|
|
9842
9865
|
if (isJsonMode()) {
|
|
9843
9866
|
console.error(JSON.stringify({
|
|
9844
9867
|
ok: false,
|
|
9845
|
-
error: {
|
|
9868
|
+
error: {
|
|
9869
|
+
code: symbolic,
|
|
9870
|
+
message,
|
|
9871
|
+
...problemType ? { type: problemType } : {},
|
|
9872
|
+
...remediation ? { remediation } : {},
|
|
9873
|
+
...tenant ? { tenant } : {},
|
|
9874
|
+
...details ? { details } : {}
|
|
9875
|
+
}
|
|
9846
9876
|
}));
|
|
9847
9877
|
} else {
|
|
9848
9878
|
console.error(`\x1B[31mError:\x1B[0m ${symbolic}: ${message}`);
|
|
@@ -10399,22 +10429,22 @@ var artifactName = injectedString(
|
|
|
10399
10429
|
true ? "hive-cli" : void 0
|
|
10400
10430
|
) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
|
|
10401
10431
|
var packageVersion = injectedString(
|
|
10402
|
-
true ? "1.88.
|
|
10432
|
+
true ? "1.88.1" : void 0
|
|
10403
10433
|
) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
|
|
10404
10434
|
var releaseVersion = injectedString(
|
|
10405
|
-
true ? "1.88.
|
|
10435
|
+
true ? "1.88.1" : void 0
|
|
10406
10436
|
) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
|
|
10407
10437
|
var releaseChannel = injectedString(
|
|
10408
10438
|
true ? "final" : void 0
|
|
10409
10439
|
) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
|
|
10410
10440
|
var buildCommit = injectedString(
|
|
10411
|
-
true ? "
|
|
10441
|
+
true ? "0389229ca319d58530b1a250cc0eaed6c50ab3e2" : void 0
|
|
10412
10442
|
) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
|
|
10413
10443
|
var buildTimestamp = injectedString(
|
|
10414
|
-
true ? "2026-10-
|
|
10444
|
+
true ? "2026-10-30T08:47:32Z" : void 0
|
|
10415
10445
|
) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
|
|
10416
10446
|
var ociRef = injectedString(
|
|
10417
|
-
true ? "registry.onstackit.cloud/senticor/hive-cli:1.88.
|
|
10447
|
+
true ? "registry.onstackit.cloud/senticor/hive-cli:1.88.1" : void 0
|
|
10418
10448
|
) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
|
|
10419
10449
|
var RELEASE_INFO = Object.freeze({
|
|
10420
10450
|
packageVersion,
|