@agentconnect.md/setup 1.41.0-rc.228 → 1.41.0-rc.232
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/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57103,14 +57103,22 @@ var VaultHttp = class {
|
|
|
57103
57103
|
return token;
|
|
57104
57104
|
}
|
|
57105
57105
|
};
|
|
57106
|
-
/**
|
|
57107
|
-
async function
|
|
57108
|
-
let errors = "";
|
|
57106
|
+
/** Vault's `errors[]` strings — empty for a non-JSON or non-Vault body, which is never echoed. */
|
|
57107
|
+
async function readVaultErrors(res) {
|
|
57109
57108
|
try {
|
|
57110
57109
|
const json = await res.json();
|
|
57111
|
-
|
|
57112
|
-
} catch {
|
|
57113
|
-
|
|
57110
|
+
return Array.isArray(json.errors) ? json.errors.filter((e) => typeof e === "string") : [];
|
|
57111
|
+
} catch {
|
|
57112
|
+
return [];
|
|
57113
|
+
}
|
|
57114
|
+
}
|
|
57115
|
+
/** Status + Vault's `errors[]` only — NEVER the request/response payloads. */
|
|
57116
|
+
function formatVaultError(status, errors) {
|
|
57117
|
+
return `HTTP ${status}${errors.length > 0 ? ` (${errors.join("; ")})` : ""}`;
|
|
57118
|
+
}
|
|
57119
|
+
/** {@link readVaultErrors} + {@link formatVaultError} for callers that only need the message. */
|
|
57120
|
+
async function describeVaultError(res) {
|
|
57121
|
+
return formatVaultError(res.status, await readVaultErrors(res));
|
|
57114
57122
|
}
|
|
57115
57123
|
//#endregion
|
|
57116
57124
|
//#region ../control-plane/dist/secrets/vault-transit.js
|