@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 CHANGED
@@ -57103,14 +57103,22 @@ var VaultHttp = class {
57103
57103
  return token;
57104
57104
  }
57105
57105
  };
57106
- /** Status + Vault's `errors[]` onlyNEVER the request/response payloads. */
57107
- async function describeVaultError(res) {
57108
- let errors = "";
57106
+ /** Vault's `errors[]` stringsempty 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
- if (Array.isArray(json.errors) && json.errors.length > 0) errors = ` (${json.errors.join("; ")})`;
57112
- } catch {}
57113
- return `HTTP ${res.status}${errors}`;
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