wiki-plugin-shoppe 0.0.41 → 0.0.42
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/package.json +1 -1
- package/server/server.js +9 -1
package/package.json
CHANGED
package/server/server.js
CHANGED
|
@@ -3780,7 +3780,15 @@ async function startServer(params) {
|
|
|
3780
3780
|
body: JSON.stringify({ timestamp: ts, signature: sig, order })
|
|
3781
3781
|
});
|
|
3782
3782
|
triggerTransfer();
|
|
3783
|
-
|
|
3783
|
+
// Return a download URL for digital goods so the Shoppere app can open the content
|
|
3784
|
+
const sanoraUrl = getSanoraUrl();
|
|
3785
|
+
const products = await fetchWithRetry(`${sanoraUrl}/products/${tenant.uuid}`).then(r => r.ok ? r.json() : {});
|
|
3786
|
+
const product = Object.values(products).find(p => p.uuid === productId || p.title === title);
|
|
3787
|
+
let downloadUrl = null;
|
|
3788
|
+
if (product && ['book', 'post', 'video'].includes(product.category)) {
|
|
3789
|
+
downloadUrl = `https://${req.get('host')}/plugin/shoppe/${tenant.uuid}/download/${encodeURIComponent(product.title)}`;
|
|
3790
|
+
}
|
|
3791
|
+
return res.json({ success: true, downloadUrl });
|
|
3784
3792
|
}
|
|
3785
3793
|
|
|
3786
3794
|
// ── Legacy recovery key paths ─────────────────────────────────────────
|