@replohq/sdk 1.13.1 → 1.13.2
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.
|
@@ -46,7 +46,7 @@ class CookieBasedCartGateway {
|
|
|
46
46
|
const reconciledCart = await this.reconcile(cart, {
|
|
47
47
|
clampQuantities: false
|
|
48
48
|
});
|
|
49
|
-
if (JSON.stringify(reconciledCart.lines) !== JSON.stringify(cart.lines)) {
|
|
49
|
+
if (JSON.stringify(reconciledCart.lines) !== JSON.stringify(cart.lines) || reconciledCart.cost.currencyCode !== cart.cost.currencyCode) {
|
|
50
50
|
await saveCartToCookie(reconciledCart, this.config.cookieName);
|
|
51
51
|
}
|
|
52
52
|
return reconciledCart;
|
|
@@ -21,9 +21,10 @@ export declare function calculateLineItemsSubtotal(lineItems: CartLine[]): numbe
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function recalculateCartCost(cart: Cart): Cart;
|
|
23
23
|
/**
|
|
24
|
-
* Rewrite a cookie cart with the catalog's current facts: live prices
|
|
25
|
-
* unavailable lines dropped, and — on write paths only —
|
|
26
|
-
* the purchasable remainder. Reads never clamp
|
|
24
|
+
* Rewrite a cookie cart with the catalog's current facts: live prices and
|
|
25
|
+
* currency always, unavailable lines dropped, and — on write paths only —
|
|
26
|
+
* quantities clamped to the purchasable remainder. Reads never clamp
|
|
27
|
+
* (`clampQuantities: false`):
|
|
27
28
|
* a quantity change without messaging is worse than one the mutation or
|
|
28
29
|
* checkout path reports, mirroring Shopify's cart behavior.
|
|
29
30
|
*
|
package/cart/utils/cart-utils.js
CHANGED
|
@@ -58,7 +58,14 @@ function applyCartLineReconciliation(cart, reconciledLines, { clampQuantities })
|
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
const currencyCode = reconciledLines.find((catalogLine) => {
|
|
62
|
+
return catalogLine.status === "purchasable";
|
|
63
|
+
})?.currencyCode ?? cart.cost.currencyCode;
|
|
64
|
+
return recalculateCartCost({
|
|
65
|
+
...cart,
|
|
66
|
+
lines,
|
|
67
|
+
cost: { ...cart.cost, currencyCode }
|
|
68
|
+
});
|
|
62
69
|
}
|
|
63
70
|
function calculateCartTotals({
|
|
64
71
|
lineItems,
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "9717e963b637fc156b2ca32880d1612b38dce67a",
|
|
6
|
+
"builtAt": "2026-09-22T23:53:49.827Z"
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.13.
|
|
6
|
+
"version": "1.13.2",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "9717e963b637fc156b2ca32880d1612b38dce67a",
|
|
9
|
+
"builtAt": "2026-09-22T23:53:49.827Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|