@medialane/sdk 0.128.0 → 0.129.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/README.md +34 -0
- package/dist/{errors-De9avg1S.d.ts → errors-DQJIxfVu.d.ts} +1 -2
- package/dist/{errors-CO99guAf.d.cts → errors-Fgqpww_8.d.cts} +1 -2
- package/dist/index.cjs +30 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +29 -11
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +4 -8
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +4 -8
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -248,12 +248,11 @@ function deriveErrorCode(status) {
|
|
|
248
248
|
return "UNKNOWN";
|
|
249
249
|
}
|
|
250
250
|
var MedialaneApiError = class extends Error {
|
|
251
|
-
constructor(status, message, retryAfterMs, details
|
|
251
|
+
constructor(status, message, retryAfterMs, details) {
|
|
252
252
|
super(message);
|
|
253
253
|
this.status = status;
|
|
254
254
|
this.retryAfterMs = retryAfterMs;
|
|
255
255
|
this.details = details;
|
|
256
|
-
this.isAuthored = isAuthored;
|
|
257
256
|
this.name = "MedialaneApiError";
|
|
258
257
|
this.code = deriveErrorCode(status);
|
|
259
258
|
}
|
|
@@ -290,14 +289,12 @@ var ApiClient = class {
|
|
|
290
289
|
});
|
|
291
290
|
if (!response.ok && !allowed(response.status)) {
|
|
292
291
|
const text = await response.text().catch(() => response.statusText);
|
|
293
|
-
let message =
|
|
294
|
-
let details;
|
|
295
|
-
let isAuthored = false;
|
|
292
|
+
let message = `Request failed with status ${response.status}`;
|
|
293
|
+
let details = text;
|
|
296
294
|
try {
|
|
297
295
|
const body = JSON.parse(text);
|
|
298
296
|
if (typeof body.error === "string" && body.error.trim() !== "") {
|
|
299
297
|
message = body.error;
|
|
300
|
-
isAuthored = true;
|
|
301
298
|
}
|
|
302
299
|
details = body;
|
|
303
300
|
} catch {
|
|
@@ -306,8 +303,7 @@ var ApiClient = class {
|
|
|
306
303
|
response.status,
|
|
307
304
|
message,
|
|
308
305
|
parseRetryAfter(response.headers.get("retry-after")),
|
|
309
|
-
details
|
|
310
|
-
isAuthored
|
|
306
|
+
details
|
|
311
307
|
);
|
|
312
308
|
}
|
|
313
309
|
return response;
|