@proveanything/smartlinks 1.9.7 → 1.9.9

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.7 | Generated: 2026-03-28T16:08:57.403Z
3
+ Version: 1.9.9 | Generated: 2026-03-29T11:21:20.234Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -576,8 +576,7 @@ const usageStats = await app.records.aggregate(collectionId, appId, {
576
576
 
577
577
  ## Public Create Policies
578
578
 
579
- Control who can create objects on **public endpoints** using Firestore-based policies at:
580
- `sites/{collectionId}/apps/{appId}.publicCreate`
579
+ Control who can create objects on **public endpoints** by setting a `publicCreate` policy on your app's config. This is a `publicCreate` field inside your app config object (identified by `appId` within your collection).
581
580
 
582
581
  ### Policy Structure
583
582
 
@@ -901,7 +900,7 @@ For high-volume queries, consider:
901
900
  - Filter by `status`, `recordType`, or `category` to reduce result sets
902
901
  - Use `limit` and `offset` for pagination (max 500 per page)
903
902
  - Use aggregations instead of fetching all records and counting client-side
904
- - Index commonly filtered fields in Firestore if you add custom indexes
903
+ - Index commonly filtered fields if you add custom indexes
905
904
 
906
905
  ### Status Conventions
907
906
 
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.7 | Generated: 2026-03-28T16:08:57.403Z
3
+ Version: 1.9.9 | Generated: 2026-03-29T11:21:20.234Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -576,8 +576,7 @@ const usageStats = await app.records.aggregate(collectionId, appId, {
576
576
 
577
577
  ## Public Create Policies
578
578
 
579
- Control who can create objects on **public endpoints** using Firestore-based policies at:
580
- `sites/{collectionId}/apps/{appId}.publicCreate`
579
+ Control who can create objects on **public endpoints** by setting a `publicCreate` policy on your app's config. This is a `publicCreate` field inside your app config object (identified by `appId` within your collection).
581
580
 
582
581
  ### Policy Structure
583
582
 
@@ -901,7 +900,7 @@ For high-volume queries, consider:
901
900
  - Filter by `status`, `recordType`, or `category` to reduce result sets
902
901
  - Use `limit` and `offset` for pagination (max 500 per page)
903
902
  - Use aggregations instead of fetching all records and counting client-side
904
- - Index commonly filtered fields in Firestore if you add custom indexes
903
+ - Index commonly filtered fields if you add custom indexes
905
904
 
906
905
  ### Status Conventions
907
906
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",