@replohq/sdk 1.9.4 → 1.10.0
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/README.md +7 -0
- package/_vendor/schemas/loaderKeys.mjs +1 -0
- package/analytics/utils/analytics-utils.js +6 -0
- package/cart/buy-now-action.js +5 -0
- package/cart/cart-schema.d.ts +79 -0
- package/cart/cart-schema.js +11 -1
- package/cart/hooks/use-buy-now.d.ts +5 -1
- package/cart/hooks/use-buy-now.js +1 -1
- package/cart/utils/cart-utils.js +2 -1
- package/cart/utils/cookie-cart-persistence.js +25 -7
- package/consent/consent-action.d.ts +11 -0
- package/consent/consent-action.js +6 -14
- package/lib/buildMetadata.js +3 -3
- package/loaders/kaching-bundles-loader.d.ts +23 -0
- package/loaders/kaching-bundles-loader.js +75 -0
- package/loaders/loader-keys.d.ts +1 -0
- package/loaders/loader-keys.js +1 -0
- package/loaders/loader-schemas.d.ts +4 -0
- package/loaders/loader-schemas.js +4 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -41,6 +41,13 @@ export default function RootLayout({ children }: React.PropsWithChildren) {
|
|
|
41
41
|
`ReploProvider` is an async Server Component. Components that use SDK hooks or
|
|
42
42
|
loaders must render beneath it.
|
|
43
43
|
|
|
44
|
+
## Buy now checkout
|
|
45
|
+
|
|
46
|
+
Use `useBuyNow` from `@replohq/sdk/cart/hooks/use-buy-now` to send a shopper
|
|
47
|
+
directly to checkout. Shopify checkout applies selling plans and discount codes.
|
|
48
|
+
Stripe checkout ignores both, logs a server warning when either is supplied,
|
|
49
|
+
and still creates the checkout session.
|
|
50
|
+
|
|
44
51
|
## Data loaders
|
|
45
52
|
|
|
46
53
|
Data loaders retrieve data from integrations configured for the Replo project.
|
|
@@ -6,6 +6,7 @@ var DATA_LOADER_KEYS = {
|
|
|
6
6
|
SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products",
|
|
7
7
|
SHOPIFY_METAOBJECT: "shopify_storefront.metaobject",
|
|
8
8
|
SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects",
|
|
9
|
+
SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles",
|
|
9
10
|
REPLO_PRODUCT: "replo_products.product",
|
|
10
11
|
OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews",
|
|
11
12
|
OKENDO_PRODUCT_REVIEW_AGGREGATE: "okendo.product_review_aggregate",
|
|
@@ -53,6 +53,9 @@ function createAnalyticsQueue({
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
if (isReady()) {
|
|
56
|
+
if (queue.length > 0) {
|
|
57
|
+
flush();
|
|
58
|
+
}
|
|
56
59
|
send(payload);
|
|
57
60
|
} else {
|
|
58
61
|
queue.push(payload);
|
|
@@ -124,6 +127,9 @@ function createMethodQueue(checkInstanceReady, options) {
|
|
|
124
127
|
}
|
|
125
128
|
const instance = checkInstanceReady();
|
|
126
129
|
if (instance) {
|
|
130
|
+
if (queue.length > 0) {
|
|
131
|
+
flush();
|
|
132
|
+
}
|
|
127
133
|
const methodFunction = instance[method];
|
|
128
134
|
if (typeof methodFunction === "function") {
|
|
129
135
|
void methodFunction.apply(instance, args);
|
package/cart/buy-now-action.js
CHANGED
|
@@ -48,6 +48,11 @@ async function buyNowWithRecoveryAction(input) {
|
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
if (checkoutProvider === "stripe") {
|
|
51
|
+
if (discountCodes.length > 0 || lineItems.some((lineItem) => Boolean(lineItem.sellingPlanId))) {
|
|
52
|
+
console.warn(
|
|
53
|
+
"[Replo] Stripe buy now does not support selling plans or discount codes; those options were ignored."
|
|
54
|
+
);
|
|
55
|
+
}
|
|
51
56
|
const env = await getEnv();
|
|
52
57
|
const temporaryCartId = input.checkoutAttemptId ?? uuidv4();
|
|
53
58
|
const body = {
|
package/cart/cart-schema.d.ts
CHANGED
|
@@ -78,4 +78,83 @@ export declare const cartSchema: z.ZodObject<{
|
|
|
78
78
|
country: z.ZodNullable<z.ZodString>;
|
|
79
79
|
}, z.core.$strip>>;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
|
+
export declare const clientCartSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
cost: z.ZodObject<{
|
|
84
|
+
subtotalAmount: z.ZodNumber;
|
|
85
|
+
totalAmount: z.ZodNumber;
|
|
86
|
+
currencyCode: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
89
|
+
discountCodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
code: z.ZodString;
|
|
91
|
+
applicable: z.ZodBoolean;
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
discountAllocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
discountedAmount: z.ZodNumber;
|
|
95
|
+
title: z.ZodNullable<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
97
|
+
buyerIdentity: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
country: z.ZodNullable<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
quantity: z.ZodNumber;
|
|
103
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
104
|
+
key: z.ZodString;
|
|
105
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
sellingPlanAllocation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
108
|
+
sellingPlan: z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
description: z.ZodNullable<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
priceAdjustments: z.ZodArray<z.ZodObject<{
|
|
114
|
+
compareAtPrice: z.ZodObject<{
|
|
115
|
+
amount: z.ZodNumber;
|
|
116
|
+
currencyCode: z.ZodString;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
perDeliveryPrice: z.ZodObject<{
|
|
119
|
+
amount: z.ZodNumber;
|
|
120
|
+
currencyCode: z.ZodString;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
price: z.ZodObject<{
|
|
123
|
+
amount: z.ZodNumber;
|
|
124
|
+
currencyCode: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
unitPrice: z.ZodNullable<z.ZodObject<{
|
|
127
|
+
amount: z.ZodNumber;
|
|
128
|
+
currencyCode: z.ZodString;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
checkoutChargeAmount: z.ZodObject<{
|
|
132
|
+
amount: z.ZodNumber;
|
|
133
|
+
currencyCode: z.ZodString;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
remainingBalanceChargeAmount: z.ZodObject<{
|
|
136
|
+
amount: z.ZodNumber;
|
|
137
|
+
currencyCode: z.ZodString;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
}, z.core.$strip>>>;
|
|
140
|
+
merchandise: z.ZodNullable<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
title: z.ZodString;
|
|
143
|
+
price: z.ZodNumber;
|
|
144
|
+
compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
145
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
146
|
+
url: z.ZodString;
|
|
147
|
+
altText: z.ZodNullable<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
selectedOptions: z.ZodArray<z.ZodObject<{
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
value: z.ZodString;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
product: z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
title: z.ZodString;
|
|
156
|
+
}, z.core.$loose>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
}, z.core.$strip>;
|
|
81
160
|
export type Cart = z.infer<typeof cartSchema>;
|
package/cart/cart-schema.js
CHANGED
|
@@ -69,6 +69,16 @@ const cartSchema = z.object({
|
|
|
69
69
|
discountAllocations: z.array(cartDiscountAllocationSchema).optional(),
|
|
70
70
|
buyerIdentity: z.object({ country: z.string().nullable() }).optional()
|
|
71
71
|
});
|
|
72
|
+
const clientCartSchema = cartSchema.extend({
|
|
73
|
+
lines: z.array(
|
|
74
|
+
cartLineSchema.extend({
|
|
75
|
+
merchandise: cartLineMerchandiseSchema.extend({
|
|
76
|
+
product: cartLineMerchandiseSchema.shape.product.loose()
|
|
77
|
+
}).nullable()
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
});
|
|
72
81
|
export {
|
|
73
|
-
cartSchema
|
|
82
|
+
cartSchema,
|
|
83
|
+
clientCartSchema
|
|
74
84
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CartLineAttribute } from "../cart-types";
|
|
1
2
|
/**
|
|
2
3
|
* What a `buyNow` call did. Out of stock is an expected storefront outcome
|
|
3
4
|
* (a buyer can race the last unit), so it rides the return value rather than
|
|
@@ -17,11 +18,14 @@ export interface VariantBuyNowInfo {
|
|
|
17
18
|
variantId: string;
|
|
18
19
|
quantity?: number;
|
|
19
20
|
sellingPlanId?: string | null;
|
|
21
|
+
/** Custom line item properties (appear on the order). */
|
|
22
|
+
properties?: CartLineAttribute[];
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* React hook that returns a `buyNow` function for express checkout flows.
|
|
23
26
|
* Handles creating the cart/checkout session server-side and redirecting
|
|
24
|
-
* the browser to checkout.
|
|
27
|
+
* the browser to checkout. Stripe checkout ignores selling plans and discount
|
|
28
|
+
* codes, logging a server-side warning when either is supplied.
|
|
25
29
|
*
|
|
26
30
|
* @example
|
|
27
31
|
*
|
|
@@ -32,7 +32,7 @@ function useBuyNow() {
|
|
|
32
32
|
variantId: variant.variantId,
|
|
33
33
|
quantity: variant.quantity ?? 1,
|
|
34
34
|
sellingPlanId: variant.sellingPlanId ?? null,
|
|
35
|
-
properties: []
|
|
35
|
+
properties: variant.properties ?? []
|
|
36
36
|
})),
|
|
37
37
|
discountCodes: options?.discountCodes ?? [],
|
|
38
38
|
pageUrl: window.location.href
|
package/cart/utils/cart-utils.js
CHANGED
|
@@ -66,7 +66,8 @@ function calculateCartTotals({
|
|
|
66
66
|
}) {
|
|
67
67
|
const lineItemSubtotal = calculateLineItemsSubtotal(lineItems);
|
|
68
68
|
const compareAtSubtotal = lineItems.reduce((sum, item) => {
|
|
69
|
-
|
|
69
|
+
const { compareAtPrice, finalPrice } = getCartLinePricing(item);
|
|
70
|
+
return sum + Math.max(compareAtPrice, finalPrice) * item.quantity;
|
|
70
71
|
}, 0);
|
|
71
72
|
const total = cart?.cost.totalAmount ?? lineItemSubtotal;
|
|
72
73
|
const discountAmount = (cart?.discountAllocations ?? []).reduce(
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { cookies } from "next/headers";
|
|
3
|
+
import { parseJsonOrNull } from "../../_vendor/replo-utils/lib/json.mjs";
|
|
4
|
+
import { CanopyError } from "../../lib/canopy-error";
|
|
5
|
+
import { clientCartSchema } from "../cart-schema";
|
|
3
6
|
import { getCartCookieOptions } from "../gateways/cart-constants";
|
|
4
7
|
import { recalculateCartCost } from "./cart-utils";
|
|
8
|
+
const MAX_CART_COOKIE_SIZE_BYTES = 3900;
|
|
9
|
+
class CartCookieSizeError extends CanopyError {
|
|
10
|
+
}
|
|
5
11
|
async function saveCartToCookie(cart, cookieName) {
|
|
12
|
+
const serializedCart = JSON.stringify(cart);
|
|
13
|
+
const serializedSizeBytes = encodeURIComponent(serializedCart).length;
|
|
14
|
+
if (serializedSizeBytes > MAX_CART_COOKIE_SIZE_BYTES) {
|
|
15
|
+
throw new CartCookieSizeError({
|
|
16
|
+
message: `[Replo] ${cookieName} exceeds the browser cookie size limit; cart changes were not persisted.`,
|
|
17
|
+
additionalData: {
|
|
18
|
+
cookieName,
|
|
19
|
+
serializedSizeBytes,
|
|
20
|
+
maxSizeBytes: MAX_CART_COOKIE_SIZE_BYTES
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
6
24
|
const cookieStore = await cookies();
|
|
7
|
-
cookieStore.set(cookieName,
|
|
25
|
+
cookieStore.set(cookieName, serializedCart, getCartCookieOptions());
|
|
8
26
|
}
|
|
9
27
|
async function loadCartFromCookie(cookieName) {
|
|
10
28
|
const cookieStore = await cookies();
|
|
@@ -12,13 +30,13 @@ async function loadCartFromCookie(cookieName) {
|
|
|
12
30
|
if (!cartCookie?.value) {
|
|
13
31
|
return null;
|
|
14
32
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
console.warn("Failed to parse cart cookie:", error);
|
|
19
|
-
await clearCartCookie(cookieName);
|
|
20
|
-
return null;
|
|
33
|
+
const result = clientCartSchema.safeParse(parseJsonOrNull(cartCookie.value));
|
|
34
|
+
if (result.success) {
|
|
35
|
+
return result.data;
|
|
21
36
|
}
|
|
37
|
+
console.warn("Failed to parse cart cookie:", result.error);
|
|
38
|
+
await clearCartCookie(cookieName);
|
|
39
|
+
return null;
|
|
22
40
|
}
|
|
23
41
|
async function clearCartCookie(cookieName) {
|
|
24
42
|
const cookieStore = await cookies();
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { ConsentAction } from "../_vendor/schemas/generated/consent";
|
|
2
2
|
import type { ConsentCategories } from "./cookie";
|
|
3
|
+
/**
|
|
4
|
+
* Pure mapping from a consent decision (previous state vs the resulting state)
|
|
5
|
+
* to the legal-record `action` written to the proof-of-consent audit log.
|
|
6
|
+
*
|
|
7
|
+
* Only non-necessary categories matter (`necessary` is always granted). The
|
|
8
|
+
* mapping is:
|
|
9
|
+
* - first decision (`decidedAt === null`), some category granted -> "accept"
|
|
10
|
+
* - first decision, nothing granted -> "reject"
|
|
11
|
+
* - later decision moving from some consent to none -> "withdraw"
|
|
12
|
+
* - any other later change -> "update"
|
|
13
|
+
*/
|
|
3
14
|
export declare function deriveConsentAction({ previous, next, }: {
|
|
4
15
|
previous: {
|
|
5
16
|
decidedAt: number | null;
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"sale_of_data"
|
|
6
|
-
];
|
|
1
|
+
import { OPTIONAL_CONSENT_CATEGORIES } from "./consent-platform";
|
|
2
|
+
function hasAnyGranted(categories) {
|
|
3
|
+
return OPTIONAL_CONSENT_CATEGORIES.some((category) => categories[category]);
|
|
4
|
+
}
|
|
7
5
|
function deriveConsentAction({
|
|
8
6
|
previous,
|
|
9
7
|
next
|
|
10
8
|
}) {
|
|
11
|
-
const anyGranted = NON_NECESSARY_CATEGORIES.some(
|
|
12
|
-
(category) => next[category]
|
|
13
|
-
);
|
|
14
9
|
if (previous.decidedAt === null) {
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
if (!anyGranted) {
|
|
18
|
-
return "withdraw";
|
|
10
|
+
return hasAnyGranted(next) ? "accept" : "reject";
|
|
19
11
|
}
|
|
20
|
-
return "update";
|
|
12
|
+
return hasAnyGranted(previous.categories) && !hasAnyGranted(next) ? "withdraw" : "update";
|
|
21
13
|
}
|
|
22
14
|
export {
|
|
23
15
|
deriveConsentAction
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-09-
|
|
5
|
+
"commit": "24c482167732242f8a358ac9f85c39183293880a",
|
|
6
|
+
"builtAt": "2026-09-18T23:32:34.853Z"
|
|
7
7
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { AddToCartItem } from "../cart/hooks/use-add-to-cart";
|
|
3
|
+
type KachingBundlesLoaderProps = {
|
|
4
|
+
loaderKey: string;
|
|
5
|
+
productId: string;
|
|
6
|
+
dealBlockId?: string;
|
|
7
|
+
country?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
selectedVariantId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Rendered under Kaching's widget with the shopper's current pick. The lines
|
|
12
|
+
* are ready for `addToCart` and carry the Kaching line attributes that
|
|
13
|
+
* Checkout uses to apply the discount; they are empty until the shopper picks.
|
|
14
|
+
*/
|
|
15
|
+
children: (bundle: {
|
|
16
|
+
lines: AddToCartItem[];
|
|
17
|
+
}) => ReactNode;
|
|
18
|
+
fallback?: ReactNode;
|
|
19
|
+
/** Rendered instead of the widget when Kaching has no active deal for this product. */
|
|
20
|
+
noDealFallback?: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export declare function KachingBundlesLoader({ loaderKey, productId, dealBlockId, country, language, selectedVariantId, children, fallback, noDealFallback, }: KachingBundlesLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense, useState } from "react";
|
|
4
|
+
import { KachingBundle } from "@kachingappz/bundles-react";
|
|
5
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
6
|
+
import { invokeLoader } from "./invoke-loader";
|
|
7
|
+
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
|
+
import { shopifyKachingBundlesLoaderOutputSchema } from "./loader-schemas";
|
|
9
|
+
function KachingBundlesLoaderInner({
|
|
10
|
+
loaderKey,
|
|
11
|
+
args,
|
|
12
|
+
selectedVariantId,
|
|
13
|
+
children,
|
|
14
|
+
noDealFallback
|
|
15
|
+
}) {
|
|
16
|
+
const [lines, setLines] = useState([]);
|
|
17
|
+
const { data } = useSuspenseQuery({
|
|
18
|
+
queryKey: [loaderKey, args],
|
|
19
|
+
queryFn: async () => {
|
|
20
|
+
const loadedData = await invokeLoader({ loaderKey, args });
|
|
21
|
+
return shopifyKachingBundlesLoaderOutputSchema.parse(loadedData);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
if (data.bundles === null) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: noDealFallback ?? null });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
KachingBundle,
|
|
30
|
+
{
|
|
31
|
+
data: data.bundles,
|
|
32
|
+
selectedVariantId,
|
|
33
|
+
onLinesChange: (widgetLines) => {
|
|
34
|
+
setLines(
|
|
35
|
+
widgetLines.map((line) => ({
|
|
36
|
+
merchandiseId: line.merchandiseId,
|
|
37
|
+
quantity: line.quantity,
|
|
38
|
+
sellingPlanId: line.sellingPlanId ?? null,
|
|
39
|
+
properties: line.attributes
|
|
40
|
+
}))
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
children({ lines })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
function KachingBundlesLoader({
|
|
49
|
+
loaderKey,
|
|
50
|
+
productId,
|
|
51
|
+
dealBlockId,
|
|
52
|
+
country,
|
|
53
|
+
language,
|
|
54
|
+
selectedVariantId,
|
|
55
|
+
children,
|
|
56
|
+
fallback,
|
|
57
|
+
noDealFallback
|
|
58
|
+
}) {
|
|
59
|
+
const args = { productId, dealBlockId, country, language };
|
|
60
|
+
const instanceKey = `${loaderKey}:${JSON.stringify(args)}`;
|
|
61
|
+
return /* @__PURE__ */ jsx(LoaderErrorBoundary, { fallback: fallback ?? null, resetKey: instanceKey, children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
62
|
+
KachingBundlesLoaderInner,
|
|
63
|
+
{
|
|
64
|
+
loaderKey,
|
|
65
|
+
args,
|
|
66
|
+
selectedVariantId,
|
|
67
|
+
noDealFallback,
|
|
68
|
+
children
|
|
69
|
+
},
|
|
70
|
+
instanceKey
|
|
71
|
+
) }) });
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
KachingBundlesLoader
|
|
75
|
+
};
|
package/loaders/loader-keys.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const DATA_LOADER_KEYS: {
|
|
|
15
15
|
readonly SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products";
|
|
16
16
|
readonly SHOPIFY_METAOBJECT: "shopify_storefront.metaobject";
|
|
17
17
|
readonly SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects";
|
|
18
|
+
readonly SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles";
|
|
18
19
|
readonly REPLO_PRODUCT: "replo_products.product";
|
|
19
20
|
readonly OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews";
|
|
20
21
|
readonly OKENDO_PRODUCT_REVIEW_AGGREGATE: "okendo.product_review_aggregate";
|
package/loaders/loader-keys.js
CHANGED
|
@@ -4,6 +4,7 @@ const DATA_LOADER_KEYS = {
|
|
|
4
4
|
SHOPIFY_COLLECTION_PRODUCTS: "shopify_storefront.collection_products",
|
|
5
5
|
SHOPIFY_METAOBJECT: "shopify_storefront.metaobject",
|
|
6
6
|
SHOPIFY_METAOBJECTS: "shopify_storefront.metaobjects",
|
|
7
|
+
SHOPIFY_KACHING_BUNDLES: "shopify_storefront.kaching_bundles",
|
|
7
8
|
REPLO_PRODUCT: "replo_products.product",
|
|
8
9
|
OKENDO_PRODUCT_REVIEWS: "okendo.product_reviews",
|
|
9
10
|
OKENDO_PRODUCT_REVIEW_AGGREGATE: "okendo.product_review_aggregate",
|
|
@@ -1011,6 +1011,10 @@ export declare const shopifyMetaobjectsLoaderOutputSchema: z.ZodObject<{
|
|
|
1011
1011
|
endCursor: z.ZodNullable<z.ZodString>;
|
|
1012
1012
|
}, z.core.$strip>;
|
|
1013
1013
|
}, z.core.$strip>;
|
|
1014
|
+
export declare const shopifyKachingBundlesLoaderOutputSchema: z.ZodObject<{
|
|
1015
|
+
bundles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1016
|
+
}, z.core.$strip>;
|
|
1017
|
+
export type ShopifyKachingBundlesLoaderOutput = z.infer<typeof shopifyKachingBundlesLoaderOutputSchema>;
|
|
1014
1018
|
export type StorefrontMetaobject = z.infer<typeof storefrontMetaobjectSchema>;
|
|
1015
1019
|
export type ShopifyMetaobjectLoaderOutput = z.infer<typeof shopifyMetaobjectLoaderOutputSchema>;
|
|
1016
1020
|
export type ShopifyMetaobjectsLoaderOutput = z.infer<typeof shopifyMetaobjectsLoaderOutputSchema>;
|
|
@@ -347,6 +347,9 @@ const shopifyMetaobjectsLoaderOutputSchema = z.object({
|
|
|
347
347
|
endCursor: z.string().nullable()
|
|
348
348
|
})
|
|
349
349
|
}).describe("ShopifyMetaobjectsLoaderOutput");
|
|
350
|
+
const shopifyKachingBundlesLoaderOutputSchema = z.object({
|
|
351
|
+
bundles: z.record(z.string(), z.unknown()).nullable()
|
|
352
|
+
}).describe("ShopifyKachingBundles");
|
|
350
353
|
export {
|
|
351
354
|
contentfulAssetObjectSchema,
|
|
352
355
|
contentfulEntriesLoaderOutputSchema,
|
|
@@ -385,6 +388,7 @@ export {
|
|
|
385
388
|
sellingPlanOptionValueSchema,
|
|
386
389
|
sellingPlanPriceAdjustmentSchema,
|
|
387
390
|
sellingPlanSchema,
|
|
391
|
+
shopifyKachingBundlesLoaderOutputSchema,
|
|
388
392
|
shopifyMetaobjectLoaderOutputSchema,
|
|
389
393
|
shopifyMetaobjectsLoaderOutputSchema,
|
|
390
394
|
statsigExperimentLoaderOutputSchema,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.10.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-09-
|
|
8
|
+
"commit": "24c482167732242f8a358ac9f85c39183293880a",
|
|
9
|
+
"builtAt": "2026-09-18T23:32:34.853Z"
|
|
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",
|
|
@@ -117,6 +117,10 @@
|
|
|
117
117
|
"types": "./loaders/judgeme-reviews-loader.d.ts",
|
|
118
118
|
"default": "./loaders/judgeme-reviews-loader.js"
|
|
119
119
|
},
|
|
120
|
+
"./loaders/kaching-bundles-loader": {
|
|
121
|
+
"types": "./loaders/kaching-bundles-loader.d.ts",
|
|
122
|
+
"default": "./loaders/kaching-bundles-loader.js"
|
|
123
|
+
},
|
|
120
124
|
"./loaders/levanta-product-loader": {
|
|
121
125
|
"types": "./loaders/levanta-product-loader.d.ts",
|
|
122
126
|
"default": "./loaders/levanta-product-loader.js"
|
|
@@ -269,6 +273,7 @@
|
|
|
269
273
|
},
|
|
270
274
|
"dependencies": {
|
|
271
275
|
"@formatjs/intl-localematcher": "^0.8.13",
|
|
276
|
+
"@kachingappz/bundles-react": "0.5.3",
|
|
272
277
|
"negotiator": "^1.0.0",
|
|
273
278
|
"react-markdown": "^9.1.0",
|
|
274
279
|
"remark-gfm": "^4.0.1",
|