@medialane/sdk 0.126.0 → 0.127.0

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.cjs CHANGED
@@ -275,11 +275,12 @@ function deriveErrorCode(status) {
275
275
  return "UNKNOWN";
276
276
  }
277
277
  var MedialaneApiError = class extends Error {
278
- constructor(status, message, retryAfterMs, details) {
278
+ constructor(status, message, retryAfterMs, details, isAuthored = false) {
279
279
  super(message);
280
280
  this.status = status;
281
281
  this.retryAfterMs = retryAfterMs;
282
282
  this.details = details;
283
+ this.isAuthored = isAuthored;
283
284
  this.name = "MedialaneApiError";
284
285
  this.code = deriveErrorCode(status);
285
286
  }
@@ -318,9 +319,13 @@ var ApiClient = class {
318
319
  const text = await response.text().catch(() => response.statusText);
319
320
  let message = text;
320
321
  let details;
322
+ let isAuthored = false;
321
323
  try {
322
324
  const body = JSON.parse(text);
323
- if (body.error) message = body.error;
325
+ if (typeof body.error === "string" && body.error.trim() !== "") {
326
+ message = body.error;
327
+ isAuthored = true;
328
+ }
324
329
  details = body;
325
330
  } catch {
326
331
  }
@@ -328,7 +333,8 @@ var ApiClient = class {
328
333
  response.status,
329
334
  message,
330
335
  parseRetryAfter(response.headers.get("retry-after")),
331
- details
336
+ details,
337
+ isAuthored
332
338
  );
333
339
  }
334
340
  return response;
@@ -896,9 +902,6 @@ var ApiClient = class {
896
902
  }
897
903
  };
898
904
 
899
- // src/types/api.ts
900
- var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
901
-
902
905
  // src/constants.ts
903
906
  var SN = getCoordinates("STARKNET");
904
907
  var STARKNET_MARKETPLACE_721_CONTRACT = SN.marketplace721;
@@ -971,6 +974,17 @@ var SUPPORTED_TOKENS = [
971
974
  ];
972
975
  var DEFAULT_CURRENCY = "USDC";
973
976
 
977
+ // src/wallet/passkey.ts
978
+ var PasskeyCancelledError = class extends Error {
979
+ constructor(message = "Passkey prompt was cancelled.") {
980
+ super(message);
981
+ this.name = "PasskeyCancelledError";
982
+ }
983
+ };
984
+
985
+ // src/types/api.ts
986
+ var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
987
+
974
988
  // src/routes.ts
975
989
  var SUPPORTED_URL_CHAINS = ["STARKNET"];
976
990
  function chainSlug(chain) {
@@ -2033,6 +2047,7 @@ exports.MAX_IPFS_GATEWAY_RESPONSE_BYTES = MAX_IPFS_GATEWAY_RESPONSE_BYTES;
2033
2047
  exports.MedialaneApiError = MedialaneApiError;
2034
2048
  exports.OPEN_LICENSES = OPEN_LICENSES;
2035
2049
  exports.POLICY_REFUSAL_CODES = POLICY_REFUSAL_CODES;
2050
+ exports.PasskeyCancelledError = PasskeyCancelledError;
2036
2051
  exports.RESERVED_TRAITS = RESERVED_TRAITS;
2037
2052
  exports.STARKNET_COLLECTION_1155_CLASS_HASH = STARKNET_COLLECTION_1155_CLASS_HASH;
2038
2053
  exports.STARKNET_COLLECTION_1155_CONTRACT = STARKNET_COLLECTION_1155_CONTRACT;