@replohq/sdk 1.9.0 → 1.9.1
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/_vendor/replo-utils/lib/json.mjs +5 -2
- package/_vendor/replo-utils/lib/misc.mjs +3 -2
- package/_vendor/replo-utils/lib/object.mjs +5 -0
- package/_vendor/schemas/contentEntry.mjs +3 -1
- package/_vendor/schemas/contentManifest.mjs +6 -3
- package/_vendor/schemas/money.mjs +3 -2
- package/_vendor/schemas/routing/locale.d.ts +1 -1
- package/_vendor/schemas/routing/locale.mjs +3 -2
- package/_vendor/schemas/routing/rules.mjs +3 -2
- package/analytics/sinks/converge-event-mapper.js +4 -10
- package/cart/buy-now-action.d.ts +0 -2
- package/cart/buy-now-action.js +0 -1
- package/cart/cart-actions.d.ts +1 -5
- package/cart/cart-actions.js +5 -21
- package/cart/cart-loader.d.ts +1 -4
- package/cart/cart-loader.js +2 -5
- package/cart/cart-provider.d.ts +1 -3
- package/cart/cart-provider.js +14 -34
- package/cart/cart-schema.d.ts +0 -3
- package/cart/cart-schema.js +1 -2
- package/cart/cart-types.d.ts +0 -12
- package/cart/gateways/cart-gateway.d.ts +2 -10
- package/cart/gateways/cookie-cart-gateway.d.ts +2 -10
- package/cart/gateways/cookie-cart-gateway.js +1 -8
- package/cart/gateways/resolver-cart-gateway.js +2 -25
- package/cart/hooks/use-buy-now.js +1 -4
- package/chunk-ACQS4AG5.mjs +592 -0
- package/{chunk-VKO7P3ED.mjs → chunk-C37TXOGI.mjs} +3 -10
- package/chunk-EUIVDITZ.mjs +15 -0
- package/{chunk-7OPH5UFQ.mjs → chunk-GZWV5XKV.mjs} +4 -5
- package/chunk-SSBIMQES.mjs +755 -0
- package/chunk-VVB7BEDE.mjs +84 -0
- package/chunk-ZKAX2FW3.mjs +703 -0
- package/gateways/canopy-api.d.ts +0 -6
- package/gateways/canopy-api.js +1 -8
- package/lib/buildMetadata.js +3 -3
- package/loaders/collection-loader-args.d.ts +1 -2
- package/loaders/collection-products-loader-args.d.ts +1 -2
- package/loaders/product-loader-args.d.ts +1 -2
- package/package.json +4 -8
- package/providers/replo-provider.d.ts +1 -5
- package/providers/replo-provider.js +2 -5
- package/_vendor/schemas/generated/storefrontCountryCode.d.ts +0 -10
- package/cart/cart-country-context.d.ts +0 -2
- package/cart/cart-country-context.js +0 -6
- package/chunk-AL3F36PH.mjs +0 -1392
- package/chunk-GV5FY7ZZ.mjs +0 -78
- package/loaders/markets.d.ts +0 -1
- package/loaders/markets.js +0 -0
package/gateways/canopy-api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Cart } from "../cart/cart-schema";
|
|
2
|
-
import type { StorefrontCountryCode } from "../loaders/markets";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { CanopyError } from "../lib/canopy-error";
|
|
5
4
|
type CanopyApiGatewayErrorConfig = {
|
|
@@ -72,7 +71,6 @@ declare class CanopyApiGateway {
|
|
|
72
71
|
sellingPlanId?: string | null;
|
|
73
72
|
}[];
|
|
74
73
|
discountCodes?: string[];
|
|
75
|
-
country?: StorefrontCountryCode;
|
|
76
74
|
}): Promise<Cart>;
|
|
77
75
|
cartAddLines({ cartId, lines, }: {
|
|
78
76
|
cartId: string;
|
|
@@ -106,10 +104,6 @@ declare class CanopyApiGateway {
|
|
|
106
104
|
cartId: string;
|
|
107
105
|
discountCodes: string[];
|
|
108
106
|
}): Promise<Cart>;
|
|
109
|
-
cartUpdateBuyerIdentity({ cartId, country, }: {
|
|
110
|
-
cartId: string;
|
|
111
|
-
country: StorefrontCountryCode;
|
|
112
|
-
}): Promise<Cart>;
|
|
113
107
|
}
|
|
114
108
|
export declare function getCanopyApiGateway(): Promise<CanopyApiGateway>;
|
|
115
109
|
export {};
|
package/gateways/canopy-api.js
CHANGED
|
@@ -194,8 +194,7 @@ If you're running locally, make sure the canopy-api cloudflare worker is running
|
|
|
194
194
|
async cartCreate(options) {
|
|
195
195
|
return this._cartPost("/create", {
|
|
196
196
|
lines: options?.lines,
|
|
197
|
-
discountCodes: options?.discountCodes
|
|
198
|
-
country: options?.country
|
|
197
|
+
discountCodes: options?.discountCodes
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
async cartAddLines({
|
|
@@ -222,12 +221,6 @@ If you're running locally, make sure the canopy-api cloudflare worker is running
|
|
|
222
221
|
}) {
|
|
223
222
|
return this._cartPost("/update-discount-codes", { cartId, discountCodes });
|
|
224
223
|
}
|
|
225
|
-
async cartUpdateBuyerIdentity({
|
|
226
|
-
cartId,
|
|
227
|
-
country
|
|
228
|
-
}) {
|
|
229
|
-
return this._cartPost("/update-buyer-identity", { cartId, country });
|
|
230
|
-
}
|
|
231
224
|
}
|
|
232
225
|
async function getCanopyApiGateway() {
|
|
233
226
|
return CanopyApiGateway.setup();
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "dadbeffde02243998e85250ba4b2a21565c0b804",
|
|
6
|
+
"builtAt": "2026-09-17T18:18:44.111Z"
|
|
7
7
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { StorefrontCountryCode } from "./markets";
|
|
2
1
|
export type CollectionLoaderArgs = {
|
|
3
2
|
handle?: string;
|
|
4
3
|
collectionGid?: string;
|
|
5
4
|
language?: string;
|
|
6
|
-
country?:
|
|
5
|
+
country?: string;
|
|
7
6
|
};
|
|
8
7
|
/**
|
|
9
8
|
* Builds the single object used as BOTH the React Query key and the loader
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { StorefrontCountryCode } from "./markets";
|
|
2
1
|
export type CollectionProductsLoaderArgs = {
|
|
3
2
|
collectionGid: string;
|
|
4
3
|
first?: number;
|
|
5
4
|
after?: string;
|
|
6
5
|
language?: string;
|
|
7
|
-
country?:
|
|
6
|
+
country?: string;
|
|
8
7
|
};
|
|
9
8
|
/**
|
|
10
9
|
* Builds the single object used as BOTH the React Query key and the loader
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { StorefrontCountryCode } from "./markets";
|
|
2
1
|
export type MetafieldIdentifier = {
|
|
3
2
|
namespace: string;
|
|
4
3
|
key: string;
|
|
@@ -9,7 +8,7 @@ export type ProductLoaderArgs = {
|
|
|
9
8
|
productMetafieldIdentifiers?: MetafieldIdentifier[];
|
|
10
9
|
variantMetafieldIdentifiers?: MetafieldIdentifier[];
|
|
11
10
|
language?: string;
|
|
12
|
-
country?:
|
|
11
|
+
country?: string;
|
|
13
12
|
};
|
|
14
13
|
/**
|
|
15
14
|
* Builds the single object used as BOTH the React Query key and the loader
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.9.
|
|
6
|
+
"version": "1.9.1",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "dadbeffde02243998e85250ba4b2a21565c0b804",
|
|
9
|
+
"builtAt": "2026-09-17T18:18:44.111Z"
|
|
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",
|
|
@@ -213,10 +213,6 @@
|
|
|
213
213
|
"types": "./loaders/collection-products-loader-args.d.ts",
|
|
214
214
|
"default": "./loaders/collection-products-loader-args.js"
|
|
215
215
|
},
|
|
216
|
-
"./loaders/markets": {
|
|
217
|
-
"types": "./loaders/markets.d.ts",
|
|
218
|
-
"default": "./loaders/markets.js"
|
|
219
|
-
},
|
|
220
216
|
"./orders/order-status": {
|
|
221
217
|
"types": "./orders/order-status.d.ts",
|
|
222
218
|
"default": "./orders/order-status.js"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Markets } from "../loaders/markets";
|
|
2
1
|
/**
|
|
3
2
|
* Root provider for a Replo site. Mount it once in `app/layout.tsx`, wrapping
|
|
4
3
|
* the whole app. It sets up the React Query client every data loader reads
|
|
@@ -18,7 +17,4 @@ import type { Markets } from "../loaders/markets";
|
|
|
18
17
|
* }
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
|
-
export declare function ReploProvider({ children
|
|
22
|
-
/** Nested so Shopify and later Replo-product markets do not share one `country`. */
|
|
23
|
-
markets?: Markets;
|
|
24
|
-
}>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
20
|
+
export declare function ReploProvider({ children }: React.PropsWithChildren): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -6,10 +6,7 @@ import { getCheckoutProvider } from "../lib/integration-utils";
|
|
|
6
6
|
import { LoaderErrorDetailsProvider } from "../loaders/loader-error-boundary";
|
|
7
7
|
import { shouldShowLoaderErrorDetails } from "../loaders/loader-error-details";
|
|
8
8
|
import { QueryProvider } from "./query-provider";
|
|
9
|
-
async function ReploProvider({
|
|
10
|
-
children,
|
|
11
|
-
markets
|
|
12
|
-
}) {
|
|
9
|
+
async function ReploProvider({ children }) {
|
|
13
10
|
let checkoutProvider = "none";
|
|
14
11
|
try {
|
|
15
12
|
checkoutProvider = await getCheckoutProvider();
|
|
@@ -18,7 +15,7 @@ async function ReploProvider({
|
|
|
18
15
|
}
|
|
19
16
|
return /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsx(LoaderErrorDetailsProvider, { enabled: shouldShowLoaderErrorDetails(), children: /* @__PURE__ */ jsxs(AnalyticsProvider, { checkoutProvider, children: [
|
|
20
17
|
/* @__PURE__ */ jsx(ReploFirstPartyPixel, {}),
|
|
21
|
-
/* @__PURE__ */ jsx(CartLoader, {
|
|
18
|
+
/* @__PURE__ */ jsx(CartLoader, { children })
|
|
22
19
|
] }) }) });
|
|
23
20
|
}
|
|
24
21
|
export {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type StorefrontCountryCode = "AC" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AN" | "AO" | "AR" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MK" | "ML" | "MM" | "MN" | "MO" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PS" | "PT" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TA" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW" | "ZZ";
|
|
2
|
-
export type ShopifyMarket = {
|
|
3
|
-
country?: StorefrontCountryCode;
|
|
4
|
-
};
|
|
5
|
-
export type Markets = {
|
|
6
|
-
shopify?: Partial<ShopifyMarket>;
|
|
7
|
-
};
|
|
8
|
-
export type CartBuyerIdentity = {
|
|
9
|
-
country: StorefrontCountryCode;
|
|
10
|
-
};
|