@proveanything/smartlinks 1.3.39 → 1.3.40
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/docs/API_SUMMARY.md +1 -1
- package/dist/iframeResponder.js +21 -11
- package/docs/API_SUMMARY.md +1 -1
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/iframeResponder.js
CHANGED
|
@@ -526,29 +526,39 @@ export class IframeResponder {
|
|
|
526
526
|
this.sendResponse(event, response);
|
|
527
527
|
}
|
|
528
528
|
getCachedResponse(path) {
|
|
529
|
-
//
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
529
|
+
// App data endpoints should NOT be cached - they need fresh data from API
|
|
530
|
+
// These are the new separated app config endpoints
|
|
531
|
+
if (path.includes('/app/') && (path.includes('/data') || path.match(/\/app\/[^/]+$/))) {
|
|
532
|
+
console.log('[IframeResponder:Parent] 🚫 Not caching app data endpoint:', path);
|
|
533
|
+
return null;
|
|
534
|
+
}
|
|
535
|
+
// Collection request - ONLY match direct collection endpoint, not app config endpoints
|
|
536
|
+
if (this.cache.collection) {
|
|
537
|
+
const collectionMatch = path.match(/^public\/collection\/([^/]+)$/);
|
|
538
|
+
if (collectionMatch && collectionMatch[1] === this.options.collectionId) {
|
|
539
|
+
console.log('[IframeResponder:Parent] 📦 Cache hit: collection');
|
|
533
540
|
return JSON.parse(JSON.stringify(this.cache.collection));
|
|
534
541
|
}
|
|
535
542
|
}
|
|
536
|
-
// Product request
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
543
|
+
// Product request - ONLY match direct product endpoint, not app config endpoints
|
|
544
|
+
if (this.cache.product && this.options.productId) {
|
|
545
|
+
const productMatch = path.match(/^public\/collection\/[^/]+\/product\/([^/]+)$/);
|
|
546
|
+
if (productMatch && productMatch[1] === this.options.productId) {
|
|
547
|
+
console.log('[IframeResponder:Parent] 📦 Cache hit: product');
|
|
540
548
|
return JSON.parse(JSON.stringify(this.cache.product));
|
|
541
549
|
}
|
|
542
550
|
}
|
|
543
551
|
// Proof request
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
552
|
+
if (this.cache.proof && this.options.proofId) {
|
|
553
|
+
const proofMatch = path.match(/^public\/proof\/([^/]+)$/);
|
|
554
|
+
if (proofMatch && proofMatch[1] === this.options.proofId) {
|
|
555
|
+
console.log('[IframeResponder:Parent] 📦 Cache hit: proof');
|
|
547
556
|
return JSON.parse(JSON.stringify(this.cache.proof));
|
|
548
557
|
}
|
|
549
558
|
}
|
|
550
559
|
// Account request
|
|
551
560
|
if (path.includes('/account') && this.cache.user) {
|
|
561
|
+
console.log('[IframeResponder:Parent] 📦 Cache hit: account');
|
|
552
562
|
return JSON.parse(JSON.stringify(Object.assign(Object.assign({}, this.cache.user.accountData), { uid: this.cache.user.uid, email: this.cache.user.email, displayName: this.cache.user.displayName })));
|
|
553
563
|
}
|
|
554
564
|
return null;
|
package/docs/API_SUMMARY.md
CHANGED