@proveanything/smartlinks 1.9.6 → 1.9.8

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,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.9.6 | Generated: 2026-03-28T15:04:22.535Z
3
+ Version: 1.9.8 | Generated: 2026-03-28T16:35:31.687Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/dist/http.js CHANGED
@@ -680,7 +680,7 @@ function ensureProxyListener() {
680
680
  if (window._smartlinksProxyListener)
681
681
  return;
682
682
  window.addEventListener("message", (event) => {
683
- var _a;
683
+ var _a, _b, _c, _d;
684
684
  const msg = event.data;
685
685
  if ((msg === null || msg === void 0 ? void 0 : msg._smartlinksProxyStream) && msg.id) {
686
686
  const pendingStream = proxyStreamPending.get(msg.id);
@@ -706,12 +706,17 @@ function ensureProxyListener() {
706
706
  const pending = proxyPending[msg.id];
707
707
  if (pending) {
708
708
  if (msg.error) {
709
- if (msg.statusCode) {
710
- const errBody = normalizeErrorResponse((_a = msg.errorBody) !== null && _a !== void 0 ? _a : msg.error, msg.statusCode);
711
- pending.reject(new SmartlinksApiError(msg.error, msg.statusCode, errBody));
709
+ // msg.error may be a string or an object (e.g. { message, statusCode, errorCode, ... })
710
+ const errObj = typeof msg.error === 'object' && msg.error !== null ? msg.error : null;
711
+ const statusCode = (_a = msg.statusCode) !== null && _a !== void 0 ? _a : errObj === null || errObj === void 0 ? void 0 : errObj.statusCode;
712
+ const message = (_b = errObj === null || errObj === void 0 ? void 0 : errObj.message) !== null && _b !== void 0 ? _b : (typeof msg.error === 'string' ? msg.error : 'Request failed');
713
+ const errorBody = (_d = (_c = msg.errorBody) !== null && _c !== void 0 ? _c : errObj) !== null && _d !== void 0 ? _d : msg.error;
714
+ if (statusCode) {
715
+ const errBody = normalizeErrorResponse(errorBody, statusCode);
716
+ pending.reject(new SmartlinksApiError(message, statusCode, errBody));
712
717
  }
713
718
  else {
714
- pending.reject(new Error(msg.error));
719
+ pending.reject(new Error(message));
715
720
  }
716
721
  }
717
722
  else {
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.9.6 | Generated: 2026-03-28T15:04:22.535Z
3
+ Version: 1.9.8 | Generated: 2026-03-28T16:35:31.687Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.9.6",
3
+ "version": "1.9.8",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",