@coinbase/cdp-api-client 0.0.123 → 0.0.125

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.
@@ -1,4 +1,4 @@
1
- const u = {
1
+ const d = {
2
2
  unexpected_error: "unexpected_error",
3
3
  unauthorized: "unauthorized",
4
4
  not_found: "not_found",
@@ -6,12 +6,18 @@ const u = {
6
6
  service_unavailable: "service_unavailable",
7
7
  unknown: "unknown"
8
8
  };
9
- class a extends Error {
9
+ class c extends Error {
10
10
  statusCode;
11
11
  errorType;
12
12
  errorMessage;
13
13
  correlationId;
14
14
  errorLink;
15
+ /**
16
+ * Response headers, lowercase-keyed (e.g. `x-mfa-challenge-id`). Never included in
17
+ * {@link toJSON}. Multi-value headers (e.g. `set-cookie`) come back as arrays; callers
18
+ * must guard with `Array.isArray` before treating a value as a string.
19
+ */
20
+ headers;
15
21
  /**
16
22
  * Constructor for the APIError class
17
23
  *
@@ -21,9 +27,10 @@ class a extends Error {
21
27
  * @param correlationId - The correlation ID
22
28
  * @param errorLink - URL to documentation about this error
23
29
  * @param cause - The cause of the error
30
+ * @param headers - The response headers, lowercase-keyed
24
31
  */
25
- constructor(e, o, n, t, s, i) {
26
- super(n, { cause: i }), this.name = "APIError", this.statusCode = e, this.errorType = o, this.errorMessage = n, t !== void 0 && (this.correlationId = t), s !== void 0 && (this.errorLink = s);
32
+ constructor(e, o, n, s, t, a, i) {
33
+ super(n, { cause: a }), this.name = "APIError", this.statusCode = e, this.errorType = o, this.errorMessage = n, s !== void 0 && (this.correlationId = s), t !== void 0 && (this.errorLink = t), i !== void 0 && (this.headers = i);
27
34
  }
28
35
  /**
29
36
  * Convert the error to a JSON object, excluding undefined properties
@@ -41,7 +48,7 @@ class a extends Error {
41
48
  };
42
49
  }
43
50
  }
44
- class d extends a {
51
+ class l extends c {
45
52
  /**
46
53
  * Constructor for the UnknownApiError class
47
54
  *
@@ -53,7 +60,7 @@ class d extends a {
53
60
  super(0, e, o, void 0, void 0, n), this.name = "UnknownApiError";
54
61
  }
55
62
  }
56
- class l extends Error {
63
+ class h extends Error {
57
64
  /**
58
65
  * Constructor for the UnknownError class
59
66
  *
@@ -67,7 +74,7 @@ class l extends Error {
67
74
  function E(r) {
68
75
  return r !== null && typeof r == "object" && "errorType" in r && typeof r.errorType == "string" && "errorMessage" in r && typeof r.errorMessage == "string";
69
76
  }
70
- class h extends Error {
77
+ class p extends Error {
71
78
  /** Stable discriminator used for cross-package detection. */
72
79
  code = "CDP_REFRESH_TOKEN_UNAVAILABLE";
73
80
  /**
@@ -86,14 +93,14 @@ class h extends Error {
86
93
  super(o ?? `Refresh token unavailable in local storage (${e})`), this.name = "RefreshTokenUnavailableError", this.outcome = e;
87
94
  }
88
95
  }
89
- const p = (r) => typeof r == "object" && r !== null && r.code === "CDP_REFRESH_TOKEN_UNAVAILABLE", c = /user interaction is not allowed/i, T = (r) => r.outcome === "error" && c.test(r.message ?? "");
96
+ const T = (r) => typeof r == "object" && r !== null && r.code === "CDP_REFRESH_TOKEN_UNAVAILABLE", u = /user interaction is not allowed/i, _ = (r) => r.outcome === "error" && u.test(r.message ?? "");
90
97
  export {
91
- a as APIError,
92
- u as HttpErrorType,
93
- h as RefreshTokenUnavailableError,
94
- d as UnknownApiError,
95
- l as UnknownError,
98
+ c as APIError,
99
+ d as HttpErrorType,
100
+ p as RefreshTokenUnavailableError,
101
+ l as UnknownApiError,
102
+ h as UnknownError,
96
103
  E as isOpenAPIError,
97
- p as isRefreshTokenUnavailableError,
98
- T as isTransientTokenReadError
104
+ T as isRefreshTokenUnavailableError,
105
+ _ as isTransientTokenReadError
99
106
  };