@replohq/canopy-sdk 0.9.1 → 0.11.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/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.mjs +1 -1
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +2 -2
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.d.ts +37 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs +37 -0
- package/_vendor/schemas/cart.mjs +4 -4
- package/_vendor/schemas/loaderKeys.d.ts +4 -0
- package/_vendor/schemas/loaderKeys.mjs +3 -1
- package/_vendor/schemas/objectType.mjs +2 -2
- package/_vendor/schemas/sellingPlan.mjs +1 -1
- package/cart/cart-actions.js +3 -3
- package/cart/cart-actions.js.map +2 -2
- package/cart/gateways/cart-constants.d.ts +1 -0
- package/cart/gateways/cart-constants.js +5 -0
- package/cart/gateways/cart-constants.js.map +7 -0
- package/cart/gateways/stripe-cart-gateway.js +2 -2
- package/cart/gateways/stripe-cart-gateway.js.map +2 -2
- package/{chunk-4TZVNC3W.mjs → chunk-4XLTENDR.mjs} +1 -1
- package/{chunk-5OCDBBJK.mjs → chunk-A7EUNWRQ.mjs} +23 -23
- package/env.js +2 -2
- package/env.js.map +2 -2
- package/loaders/yotpo-review-aggregate-loader.d.ts +12 -0
- package/loaders/yotpo-review-aggregate-loader.js +50 -0
- package/loaders/yotpo-review-aggregate-loader.js.map +7 -0
- package/loaders/yotpo-reviews-loader.d.ts +14 -0
- package/loaders/yotpo-reviews-loader.js +65 -0
- package/loaders/yotpo-reviews-loader.js.map +7 -0
- package/package.json +1 -1
- package/cart/gateways/stripe-constants.d.ts +0 -1
- package/cart/gateways/stripe-constants.js +0 -5
- package/cart/gateways/stripe-constants.js.map +0 -7
|
@@ -26,7 +26,7 @@ var levantaProductFullSchema = z.object({
|
|
|
26
26
|
var levantaRecordSchema = z.record(z.string(), z.unknown());
|
|
27
27
|
var levantaProductsSearchOutputSchema = z.object({
|
|
28
28
|
products: z.array(levantaProductFullSchema.partial()),
|
|
29
|
-
nextCursor: z.string().
|
|
29
|
+
nextCursor: z.string().nullish()
|
|
30
30
|
});
|
|
31
31
|
var levantaBrandsListOutputSchema = levantaRecordSchema;
|
|
32
32
|
var levantaLinksCreateOutputSchema = levantaRecordSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { priceSchema, metafieldSchema, imageSchema, selectedOptionSchema, mediaSchema, productOptionSchema, productSchema } from '../../../../../chunk-
|
|
2
|
-
import { sellingPlanGroupSchema } from '../../../../../chunk-
|
|
1
|
+
import { priceSchema, metafieldSchema, imageSchema, selectedOptionSchema, mediaSchema, productOptionSchema, productSchema } from '../../../../../chunk-A7EUNWRQ.mjs';
|
|
2
|
+
import { sellingPlanGroupSchema } from '../../../../../chunk-4XLTENDR.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var fullVariantSchema = z.object({
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const yotpoNangoConnectionConfigSchema: z.ZodObject<{
|
|
3
|
+
storeId: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const yotpoProductReviewsLoaderInputSchema: z.ZodObject<{
|
|
6
|
+
productId: z.ZodString;
|
|
7
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const yotpoReviewLoaderItemSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
title: z.ZodNullable<z.ZodString>;
|
|
13
|
+
content: z.ZodNullable<z.ZodString>;
|
|
14
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
15
|
+
createdAt: z.ZodNullable<z.ZodString>;
|
|
16
|
+
verifiedBuyer: z.ZodBoolean;
|
|
17
|
+
reviewerName: z.ZodNullable<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const yotpoProductReviewsLoaderOutputSchema: z.ZodObject<{
|
|
20
|
+
reviews: z.ZodArray<z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
title: z.ZodNullable<z.ZodString>;
|
|
23
|
+
content: z.ZodNullable<z.ZodString>;
|
|
24
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
25
|
+
createdAt: z.ZodNullable<z.ZodString>;
|
|
26
|
+
verifiedBuyer: z.ZodBoolean;
|
|
27
|
+
reviewerName: z.ZodNullable<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const yotpoProductReviewAggregateLoaderInputSchema: z.ZodObject<{
|
|
31
|
+
productId: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const yotpoProductReviewAggregateLoaderOutputSchema: z.ZodObject<{
|
|
34
|
+
averageScore: z.ZodNumber;
|
|
35
|
+
totalReviews: z.ZodNumber;
|
|
36
|
+
starDistribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
37
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// ../schemas/agentTools/customIntegrations/loaders/yotpo.ts
|
|
4
|
+
var yotpoNangoConnectionConfigSchema = z.object({
|
|
5
|
+
storeId: z.string().min(1)
|
|
6
|
+
});
|
|
7
|
+
var yotpoProductReviewsLoaderInputSchema = z.object({
|
|
8
|
+
productId: z.string().describe(
|
|
9
|
+
"Yotpo external product ID for the product (typically the numeric Shopify product ID)."
|
|
10
|
+
),
|
|
11
|
+
perPage: z.number().int().min(1).max(150).optional().describe("Reviews to return (default 10, max 150)."),
|
|
12
|
+
page: z.number().int().min(1).optional().describe("Page number (1-indexed, default 1).")
|
|
13
|
+
});
|
|
14
|
+
var yotpoReviewLoaderItemSchema = z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
title: z.string().nullable(),
|
|
17
|
+
content: z.string().nullable(),
|
|
18
|
+
score: z.number().nullable(),
|
|
19
|
+
createdAt: z.string().nullable(),
|
|
20
|
+
verifiedBuyer: z.boolean(),
|
|
21
|
+
reviewerName: z.string().nullable()
|
|
22
|
+
});
|
|
23
|
+
var yotpoProductReviewsLoaderOutputSchema = z.object({
|
|
24
|
+
reviews: z.array(yotpoReviewLoaderItemSchema)
|
|
25
|
+
});
|
|
26
|
+
var yotpoProductReviewAggregateLoaderInputSchema = z.object({
|
|
27
|
+
productId: z.string().describe(
|
|
28
|
+
"Yotpo external product ID for the product (typically the numeric Shopify product ID)."
|
|
29
|
+
)
|
|
30
|
+
});
|
|
31
|
+
var yotpoProductReviewAggregateLoaderOutputSchema = z.object({
|
|
32
|
+
averageScore: z.number(),
|
|
33
|
+
totalReviews: z.number(),
|
|
34
|
+
starDistribution: z.record(z.string(), z.number())
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { yotpoNangoConnectionConfigSchema, yotpoProductReviewAggregateLoaderInputSchema, yotpoProductReviewAggregateLoaderOutputSchema, yotpoProductReviewsLoaderInputSchema, yotpoProductReviewsLoaderOutputSchema, yotpoReviewLoaderItemSchema };
|
package/_vendor/schemas/cart.mjs
CHANGED
|
@@ -40,7 +40,7 @@ var cartLineMerchandiseSchema = z.object({
|
|
|
40
40
|
}),
|
|
41
41
|
title: z.string(),
|
|
42
42
|
price: z.number(),
|
|
43
|
-
compareAtPrice: z.number().
|
|
43
|
+
compareAtPrice: z.number().nullish(),
|
|
44
44
|
image: cartImageSchema.nullable(),
|
|
45
45
|
selectedOptions: z.array(z.object({ name: z.string(), value: z.string() }))
|
|
46
46
|
});
|
|
@@ -49,7 +49,7 @@ var cartLineSchema = z.object({
|
|
|
49
49
|
quantity: z.number(),
|
|
50
50
|
merchandise: cartLineMerchandiseSchema,
|
|
51
51
|
attributes: z.array(cartLineAttributeSchema),
|
|
52
|
-
sellingPlanAllocation: sellingPlanAllocationSchema.
|
|
52
|
+
sellingPlanAllocation: sellingPlanAllocationSchema.nullish()
|
|
53
53
|
});
|
|
54
54
|
var cartCostSchema = z.object({
|
|
55
55
|
subtotalAmount: z.number(),
|
|
@@ -71,13 +71,13 @@ var addCartLinesInputSchema = z.object({
|
|
|
71
71
|
merchandiseId: z.string(),
|
|
72
72
|
quantity: z.number().int().positive(),
|
|
73
73
|
attributes: z.array(cartLineAttributeSchema).optional(),
|
|
74
|
-
sellingPlanId: z.string().
|
|
74
|
+
sellingPlanId: z.string().nullish()
|
|
75
75
|
});
|
|
76
76
|
var updateCartLineInputSchema = z.object({
|
|
77
77
|
lineId: z.string(),
|
|
78
78
|
quantity: z.number().int().min(0),
|
|
79
79
|
attributes: z.array(cartLineAttributeSchema).optional(),
|
|
80
|
-
sellingPlanId: z.string().
|
|
80
|
+
sellingPlanId: z.string().nullish()
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
export { addCartLinesInputSchema, cartCostSchema, cartDiscountCodeSchema, cartImageSchema, cartLineAttributeSchema, cartLineAttributesSchema, cartLineMerchandiseSchema, cartLineSchema, cartSchema, updateCartLineInputSchema };
|
|
@@ -22,6 +22,8 @@ export declare const DATA_LOADER_KEYS: {
|
|
|
22
22
|
readonly SMILE_IO_VIP_TIERS: "smile_io.vip_tiers";
|
|
23
23
|
readonly SMILE_IO_EARNING_RULES: "smile_io.earning_rules";
|
|
24
24
|
readonly SMILE_IO_REWARDS: "smile_io.rewards";
|
|
25
|
+
readonly YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews";
|
|
26
|
+
readonly YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate";
|
|
25
27
|
};
|
|
26
28
|
export type DataLoaderKey = (typeof DATA_LOADER_KEYS)[keyof typeof DATA_LOADER_KEYS];
|
|
27
29
|
export declare const dataLoaderKeySchema: z.ZodEnum<{
|
|
@@ -36,4 +38,6 @@ export declare const dataLoaderKeySchema: z.ZodEnum<{
|
|
|
36
38
|
"smile_io.vip_tiers": "smile_io.vip_tiers";
|
|
37
39
|
"smile_io.earning_rules": "smile_io.earning_rules";
|
|
38
40
|
"smile_io.rewards": "smile_io.rewards";
|
|
41
|
+
"yotpo.product_reviews": "yotpo.product_reviews";
|
|
42
|
+
"yotpo.product_review_aggregate": "yotpo.product_review_aggregate";
|
|
39
43
|
}>;
|
|
@@ -12,7 +12,9 @@ var DATA_LOADER_KEYS = {
|
|
|
12
12
|
LEVANTA_PRODUCT: "levanta_products.product",
|
|
13
13
|
SMILE_IO_VIP_TIERS: "smile_io.vip_tiers",
|
|
14
14
|
SMILE_IO_EARNING_RULES: "smile_io.earning_rules",
|
|
15
|
-
SMILE_IO_REWARDS: "smile_io.rewards"
|
|
15
|
+
SMILE_IO_REWARDS: "smile_io.rewards",
|
|
16
|
+
YOTPO_PRODUCT_REVIEWS: "yotpo.product_reviews",
|
|
17
|
+
YOTPO_PRODUCT_REVIEW_AGGREGATE: "yotpo.product_review_aggregate"
|
|
16
18
|
};
|
|
17
19
|
var dataLoaderKeySchema = z.enum(Object.values(DATA_LOADER_KEYS));
|
|
18
20
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { assetSchema, collectionSchema, customerIoBroadcastSchema, customerIoCampaignSchema, customerIoSegmentSchema, discountCodeSchema, externalVideoSchema, getObjectTypeDefinition, imageSchema, integrationSchema, intelligemsExperienceSchema, levantaAffiliateLinkSchema, levantaProductSchema, looxReviewSchema, mediaImageSchema, mediaSchema, metafieldSchema, okendoReviewSchema, optionValueSchema, optionValueSwatchSchema, opusClipSchema, opusCollectionSchema, opusProjectSchema, pageSchema, planSchema, previewImageSchema, priceSchema, productOptionSchema, productSchema, registryItemSchema, segmentSourceSchema, selectedOptionSchema, transformReploProductToCanonical, variantSchema, videoSchema, videoSourceSchema, vwoCampaignSchema } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { assetSchema, collectionSchema, customerIoBroadcastSchema, customerIoCampaignSchema, customerIoSegmentSchema, discountCodeSchema, externalVideoSchema, getObjectTypeDefinition, imageSchema, integrationSchema, intelligemsExperienceSchema, levantaAffiliateLinkSchema, levantaProductSchema, looxReviewSchema, mediaImageSchema, mediaSchema, metafieldSchema, okendoReviewSchema, optionValueSchema, optionValueSwatchSchema, opusClipSchema, opusCollectionSchema, opusProjectSchema, pageSchema, planSchema, previewImageSchema, priceSchema, productOptionSchema, productSchema, registryItemSchema, segmentSourceSchema, selectedOptionSchema, transformReploProductToCanonical, variantSchema, videoSchema, videoSourceSchema, vwoCampaignSchema } from '../../chunk-A7EUNWRQ.mjs';
|
|
2
|
+
import '../../chunk-4XLTENDR.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { sellingPlanGroupSchema, sellingPlanOptionValueSchema, sellingPlanPriceAdjustmentSchema, sellingPlanSchema } from '../../chunk-
|
|
1
|
+
export { sellingPlanGroupSchema, sellingPlanOptionValueSchema, sellingPlanPriceAdjustmentSchema, sellingPlanSchema } from '../../chunk-4XLTENDR.mjs';
|
package/cart/cart-actions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { cookies } from "next/headers";
|
|
3
3
|
import { getCheckoutProvider } from "../lib/integration-utils";
|
|
4
|
+
import { REPLO_CART_COOKIE_NAME } from "./gateways/cart-constants";
|
|
4
5
|
import { getCartGateway } from "./gateways/cart-gateway";
|
|
5
|
-
import { STRIPE_CART_COOKIE_NAME } from "./gateways/stripe-constants";
|
|
6
6
|
import {
|
|
7
7
|
loadCartFromCookie,
|
|
8
8
|
saveCartToCookie
|
|
@@ -19,7 +19,7 @@ async function getOrCreateCartAction() {
|
|
|
19
19
|
async function getCartAction() {
|
|
20
20
|
const checkoutProvider = await getCheckoutProvider();
|
|
21
21
|
if (checkoutProvider === "stripe") {
|
|
22
|
-
return await loadCartFromCookie(
|
|
22
|
+
return await loadCartFromCookie(REPLO_CART_COOKIE_NAME);
|
|
23
23
|
}
|
|
24
24
|
const cookieStore = await cookies();
|
|
25
25
|
const existingCartId = cookieStore.get(SHOPIFY_CART_COOKIE_NAME)?.value;
|
|
@@ -45,7 +45,7 @@ async function createCartAction(options) {
|
|
|
45
45
|
if (cart && !skipStoringCart) {
|
|
46
46
|
try {
|
|
47
47
|
if (checkoutProvider === "stripe") {
|
|
48
|
-
await saveCartToCookie(cart,
|
|
48
|
+
await saveCartToCookie(cart, REPLO_CART_COOKIE_NAME);
|
|
49
49
|
} else {
|
|
50
50
|
const cookieStore = await cookies();
|
|
51
51
|
cookieStore.set(SHOPIFY_CART_COOKIE_NAME, cart.id, {
|
package/cart/cart-actions.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../cart/cart-actions.ts"],
|
|
4
|
-
"sourcesContent": ["\"use server\";\n\nimport type {\n AddToCartPayload,\n Cart,\n CartLinePayload,\n RemoveFromCartPayload,\n UpdateCartLineItemPayload,\n} from \"./cart-types\";\n\nimport { cookies } from \"next/headers\";\n\nimport { getCheckoutProvider } from \"../lib/integration-utils\";\nimport {
|
|
5
|
-
"mappings": ";AAUA,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B
|
|
4
|
+
"sourcesContent": ["\"use server\";\n\nimport type {\n AddToCartPayload,\n Cart,\n CartLinePayload,\n RemoveFromCartPayload,\n UpdateCartLineItemPayload,\n} from \"./cart-types\";\n\nimport { cookies } from \"next/headers\";\n\nimport { getCheckoutProvider } from \"../lib/integration-utils\";\nimport { REPLO_CART_COOKIE_NAME } from \"./gateways/cart-constants\";\nimport { getCartGateway } from \"./gateways/cart-gateway\";\nimport {\n loadCartFromCookie,\n saveCartToCookie,\n} from \"./utils/cookie-cart-persistence\";\n\nconst SHOPIFY_CART_COOKIE_NAME = \"replo_cart_id\";\nconst CART_COOKIE_MAX_AGE = 60 * 60 * 24 * 30; // 30 days\n\n/**\n * Gets the existing cart or creates a new one if none exists. This is necessary\n * because we may not have cookies in the server context during initial load.\n *\n * See: https://nextjs.org/docs/app/api-reference/functions/cookies#understanding-cookie-behavior-in-server-components\n *\n * @returns The existing cart or a newly created cart\n */\nexport async function getOrCreateCartAction(): Promise<Cart | null> {\n const existingCart = await getCartAction();\n if (existingCart) {\n return existingCart;\n }\n return await createCartAction();\n}\n\n/**\n * Retrieves the current cart from cookies. Returns null if no cart exists or\n * if the cart has expired/been deleted.\n *\n * @returns The current cart or null if none exists\n */\nexport async function getCartAction(): Promise<Cart | null> {\n const checkoutProvider = await getCheckoutProvider();\n\n if (checkoutProvider === \"stripe\") {\n return await loadCartFromCookie(REPLO_CART_COOKIE_NAME);\n }\n\n const cookieStore = await cookies();\n const existingCartId = cookieStore.get(SHOPIFY_CART_COOKIE_NAME)?.value;\n\n if (!existingCartId) {\n return null;\n }\n\n const cartGateway = await getCartGateway();\n const cart = await cartGateway.getCart(existingCartId);\n\n // If we had a cart ID in the cookie but couldn't fetch the cart,\n // it means the cart is invalid/expired - clear the cookie\n if (!cart) {\n try {\n cookieStore.delete(SHOPIFY_CART_COOKIE_NAME);\n } catch (error) {\n console.warn(\"Failed to delete cart cookie:\", error);\n }\n }\n\n return cart;\n}\n\n/**\n * Creates a new cart with optional initial line items. The cart ID is stored\n * in a cookie for future retrieval.\n *\n * @param options.lines - Optional initial cart line items\n * @param options.skipStoringCart - If true, skips storing the cart in cookies (used for buy-now flows)\n * @param options.discountCodes - Optional discount codes to apply on cart creation\n * @returns The newly created cart\n */\nexport async function createCartAction(options?: {\n lines?: CartLinePayload[];\n skipStoringCart?: boolean;\n discountCodes?: string[];\n}): Promise<Cart | null> {\n const { lines, skipStoringCart = false, discountCodes } = options ?? {};\n const checkoutProvider = await getCheckoutProvider();\n const cartGateway = await getCartGateway();\n const cart = await cartGateway.createCart(lines, discountCodes);\n\n if (cart && !skipStoringCart) {\n // Set the cart ID in a cookie - this works in Server Action context\n try {\n if (checkoutProvider === \"stripe\") {\n await saveCartToCookie(cart, REPLO_CART_COOKIE_NAME);\n } else {\n const cookieStore = await cookies();\n cookieStore.set(SHOPIFY_CART_COOKIE_NAME, cart.id, {\n maxAge: CART_COOKIE_MAX_AGE,\n httpOnly: true,\n secure: process.env.NODE_ENV === \"production\",\n sameSite: \"lax\",\n path: \"/\",\n });\n }\n } catch (cookieError) {\n console.warn(\"Failed to set cart cookie:\", cookieError);\n }\n }\n\n return cart;\n}\n\n/**\n * Adds line items to an existing cart.\n *\n * @param lines - Array of cart line items to add\n * @param cartId - The ID of the cart to add items to\n * @returns The updated cart\n */\nexport async function addToCartAction(\n lines: AddToCartPayload[\"lines\"],\n cartId: string,\n): Promise<Cart | null> {\n const cartGateway = await getCartGateway();\n return await cartGateway.addToCart({ lines, cartId });\n}\n\n/**\n * Updates a cart line item (typically quantity).\n *\n * @param line - The cart line item with updated values\n * @param cartId - The ID of the cart containing the line item\n * @returns The updated cart\n */\nexport async function updateCartLineItemAction(\n line: UpdateCartLineItemPayload[\"line\"],\n cartId: string,\n): Promise<Cart | null> {\n const cartGateway = await getCartGateway();\n return await cartGateway.updateCartLineItem({ line, cartId });\n}\n\n/**\n * Removes one or more line items from the cart.\n *\n * @param lineIds - Array of line item IDs to remove\n * @param cartId - The ID of the cart to remove items from\n * @returns The updated cart\n */\nexport async function removeCartLineItemsAction(\n lineIds: RemoveFromCartPayload[\"lineIds\"],\n cartId: string,\n): Promise<Cart | null> {\n const cartGateway = await getCartGateway();\n return await cartGateway.removeCartLineItems({ lineIds, cartId });\n}\n\n/**\n * Updates discount codes for a cart.\n *\n * @param discountCodes - Array of discount code strings to apply\n * @param cartId - The ID of the cart to update\n * @returns The updated cart\n */\nexport async function updateCartDiscountCodesAction(\n discountCodes: string[],\n cartId: string,\n): Promise<Cart | null> {\n const cartGateway = await getCartGateway();\n return await cartGateway.updateCartDiscountCodes({ discountCodes, cartId });\n}\n"],
|
|
5
|
+
"mappings": ";AAUA,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,MAAM,2BAA2B;AACjC,MAAM,sBAAsB,KAAK,KAAK,KAAK;AAU3C,eAAsB,wBAA8C;AAClE,QAAM,eAAe,MAAM,cAAc;AACzC,MAAI,cAAc;AAChB,WAAO;AAAA,EACT;AACA,SAAO,MAAM,iBAAiB;AAChC;AAQA,eAAsB,gBAAsC;AAC1D,QAAM,mBAAmB,MAAM,oBAAoB;AAEnD,MAAI,qBAAqB,UAAU;AACjC,WAAO,MAAM,mBAAmB,sBAAsB;AAAA,EACxD;AAEA,QAAM,cAAc,MAAM,QAAQ;AAClC,QAAM,iBAAiB,YAAY,IAAI,wBAAwB,GAAG;AAElE,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,OAAO,MAAM,YAAY,QAAQ,cAAc;AAIrD,MAAI,CAAC,MAAM;AACT,QAAI;AACF,kBAAY,OAAO,wBAAwB;AAAA,IAC7C,SAAS,OAAO;AACd,cAAQ,KAAK,iCAAiC,KAAK;AAAA,IACrD;AAAA,EACF;AAEA,SAAO;AACT;AAWA,eAAsB,iBAAiB,SAId;AACvB,QAAM,EAAE,OAAO,kBAAkB,OAAO,cAAc,IAAI,WAAW,CAAC;AACtE,QAAM,mBAAmB,MAAM,oBAAoB;AACnD,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,OAAO,MAAM,YAAY,WAAW,OAAO,aAAa;AAE9D,MAAI,QAAQ,CAAC,iBAAiB;AAE5B,QAAI;AACF,UAAI,qBAAqB,UAAU;AACjC,cAAM,iBAAiB,MAAM,sBAAsB;AAAA,MACrD,OAAO;AACL,cAAM,cAAc,MAAM,QAAQ;AAClC,oBAAY,IAAI,0BAA0B,KAAK,IAAI;AAAA,UACjD,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,QAAQ,QAAQ,IAAI,aAAa;AAAA,UACjC,UAAU;AAAA,UACV,MAAM;AAAA,QACR,CAAC;AAAA,MACH;AAAA,IACF,SAAS,aAAa;AACpB,cAAQ,KAAK,8BAA8B,WAAW;AAAA,IACxD;AAAA,EACF;AAEA,SAAO;AACT;AASA,eAAsB,gBACpB,OACA,QACsB;AACtB,QAAM,cAAc,MAAM,eAAe;AACzC,SAAO,MAAM,YAAY,UAAU,EAAE,OAAO,OAAO,CAAC;AACtD;AASA,eAAsB,yBACpB,MACA,QACsB;AACtB,QAAM,cAAc,MAAM,eAAe;AACzC,SAAO,MAAM,YAAY,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC9D;AASA,eAAsB,0BACpB,SACA,QACsB;AACtB,QAAM,cAAc,MAAM,eAAe;AACzC,SAAO,MAAM,YAAY,oBAAoB,EAAE,SAAS,OAAO,CAAC;AAClE;AASA,eAAsB,8BACpB,eACA,QACsB;AACtB,QAAM,cAAc,MAAM,eAAe;AACzC,SAAO,MAAM,YAAY,wBAAwB,EAAE,eAAe,OAAO,CAAC;AAC5E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REPLO_CART_COOKIE_NAME = "replo_cart";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../cart/gateways/cart-constants.ts"],
|
|
4
|
+
"sourcesContent": ["// NOTE (Max, 2026-07-21): the cookie holds the native Replo cart \u2014 the Stripe and\n// default gateways both use it, so the checkout provider is incidental to the name.\nexport const REPLO_CART_COOKIE_NAME = \"replo_cart\";\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,yBAAyB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use server";
|
|
2
|
+
import { REPLO_CART_COOKIE_NAME } from "./cart-constants";
|
|
2
3
|
import { CookieBasedCartGateway } from "./cookie-cart-gateway";
|
|
3
|
-
import { STRIPE_CART_COOKIE_NAME } from "./stripe-constants";
|
|
4
4
|
function stripeLineMergeFn(existingLines, newLine) {
|
|
5
5
|
return existingLines.findIndex((line) => line.merchandise?.id === newLine.id);
|
|
6
6
|
}
|
|
@@ -12,7 +12,7 @@ function stripeCartIdGenerator() {
|
|
|
12
12
|
}
|
|
13
13
|
class StripeCartGateway extends CookieBasedCartGateway {
|
|
14
14
|
config = {
|
|
15
|
-
cookieName:
|
|
15
|
+
cookieName: REPLO_CART_COOKIE_NAME,
|
|
16
16
|
lineMergeFn: stripeLineMergeFn,
|
|
17
17
|
lineIdGenerator: stripeLineIdGenerator,
|
|
18
18
|
cartIdGenerator: stripeCartIdGenerator,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../cart/gateways/stripe-cart-gateway.ts"],
|
|
4
|
-
"sourcesContent": ["\"use server\";\n\nimport type { CartLine, CartLinePayload } from \"../cart-types\";\n\nimport {
|
|
5
|
-
"mappings": ";AAIA,SAAS,8BAA8B;AACvC,SAAS
|
|
4
|
+
"sourcesContent": ["\"use server\";\n\nimport type { CartLine, CartLinePayload } from \"../cart-types\";\n\nimport { REPLO_CART_COOKIE_NAME } from \"./cart-constants\";\nimport { CookieBasedCartGateway } from \"./cookie-cart-gateway\";\n\n/**\n * Merges lines by merchandise ID only (unlike default which also checks selling plan)\n */\nfunction stripeLineMergeFn(\n existingLines: CartLine[],\n newLine: CartLinePayload,\n): number {\n return existingLines.findIndex((line) => line.merchandise?.id === newLine.id);\n}\n\nfunction stripeLineIdGenerator(): string {\n return crypto.randomUUID();\n}\n\nfunction stripeCartIdGenerator(): string {\n return crypto.randomUUID();\n}\n\nclass StripeCartGateway extends CookieBasedCartGateway {\n protected readonly config = {\n cookieName: REPLO_CART_COOKIE_NAME,\n lineMergeFn: stripeLineMergeFn,\n lineIdGenerator: stripeLineIdGenerator,\n cartIdGenerator: stripeCartIdGenerator,\n gatewayName: \"Stripe\",\n };\n}\n\nexport async function createStripeCartGateway(): Promise<StripeCartGateway> {\n return new StripeCartGateway();\n}\n"],
|
|
5
|
+
"mappings": ";AAIA,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AAKvC,SAAS,kBACP,eACA,SACQ;AACR,SAAO,cAAc,UAAU,CAAC,SAAS,KAAK,aAAa,OAAO,QAAQ,EAAE;AAC9E;AAEA,SAAS,wBAAgC;AACvC,SAAO,OAAO,WAAW;AAC3B;AAEA,SAAS,wBAAgC;AACvC,SAAO,OAAO,WAAW;AAC3B;AAEA,MAAM,0BAA0B,uBAAuB;AAAA,EAClC,SAAS;AAAA,IAC1B,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AACF;AAEA,eAAsB,0BAAsD;AAC1E,SAAO,IAAI,kBAAkB;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ var sellingPlanSchema = z.object({
|
|
|
15
15
|
description: z.string().nullable(),
|
|
16
16
|
optionValues: z.array(sellingPlanOptionValueSchema),
|
|
17
17
|
priceAdjustments: z.array(sellingPlanPriceAdjustmentSchema),
|
|
18
|
-
appId: z.string().
|
|
18
|
+
appId: z.string().nullish(),
|
|
19
19
|
price: z.string().optional(),
|
|
20
20
|
externalId: z.string().nullable()
|
|
21
21
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sellingPlanGroupSchema } from './chunk-
|
|
1
|
+
import { sellingPlanGroupSchema } from './chunk-4XLTENDR.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
var registryItemTypeSchema = z.enum(["site", "page", "section", "skill", "plan", "branding", "product"]).describe("RegistryItemType");
|
|
@@ -52,7 +52,7 @@ var productRegistryItemMetadataSchema = z.object({
|
|
|
52
52
|
providerProductId: z.string(),
|
|
53
53
|
type: z.string(),
|
|
54
54
|
categoryIds: z.array(z.string()).default([]),
|
|
55
|
-
defaultVariantId: z.string().
|
|
55
|
+
defaultVariantId: z.string().nullish(),
|
|
56
56
|
areaCount: z.number().default(0),
|
|
57
57
|
methods: z.array(z.string()).default([]),
|
|
58
58
|
optionFacets: z.array(
|
|
@@ -180,13 +180,13 @@ z.object({
|
|
|
180
180
|
}).describe("RegistryCreateItemOutput");
|
|
181
181
|
z.object({
|
|
182
182
|
name: z.string().min(1),
|
|
183
|
-
description: z.string().
|
|
184
|
-
metadata: z.record(z.string(), z.unknown()).
|
|
183
|
+
description: z.string().nullish(),
|
|
184
|
+
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
185
185
|
visibility: registryItemVisibilitySchema.optional(),
|
|
186
186
|
tags: z.array(z.string()).optional(),
|
|
187
|
-
category: z.string().
|
|
187
|
+
category: z.string().nullish(),
|
|
188
188
|
previewUrls: z.array(z.string()).optional(),
|
|
189
|
-
previewHtml: z.string().
|
|
189
|
+
previewHtml: z.string().nullish(),
|
|
190
190
|
files: registryContentFilesSchema,
|
|
191
191
|
dependencies: z.array(z.string()).optional()
|
|
192
192
|
}).describe("RegistryCatalogUpsertInput");
|
|
@@ -301,21 +301,21 @@ var variantSchema = z.object({
|
|
|
301
301
|
id: z.string(),
|
|
302
302
|
title: z.string().optional(),
|
|
303
303
|
availableForSale: z.boolean().optional(),
|
|
304
|
-
sku: z.string().
|
|
304
|
+
sku: z.string().nullish(),
|
|
305
305
|
selectedOptions: z.array(selectedOptionSchema).optional(),
|
|
306
|
-
image: imageSchema.
|
|
306
|
+
image: imageSchema.nullish(),
|
|
307
307
|
price: priceSchema.optional(),
|
|
308
|
-
compareAtPrice: priceSchema.
|
|
308
|
+
compareAtPrice: priceSchema.nullish(),
|
|
309
309
|
sellingPlanIds: z.array(z.string()).optional()
|
|
310
310
|
});
|
|
311
311
|
var productSchema = z.object({
|
|
312
312
|
id: z.string(),
|
|
313
313
|
handle: z.string().optional(),
|
|
314
314
|
title: z.string().optional(),
|
|
315
|
-
description: z.string().
|
|
316
|
-
descriptionHtml: z.string().
|
|
315
|
+
description: z.string().nullish(),
|
|
316
|
+
descriptionHtml: z.string().nullish(),
|
|
317
317
|
availableForSale: z.boolean().optional(),
|
|
318
|
-
featuredImage: imageSchema.
|
|
318
|
+
featuredImage: imageSchema.nullish(),
|
|
319
319
|
options: z.array(productOptionSchema).optional(),
|
|
320
320
|
variants: z.array(variantSchema).optional(),
|
|
321
321
|
minPrice: priceSchema.optional(),
|
|
@@ -327,8 +327,8 @@ var productSchema = z.object({
|
|
|
327
327
|
compareAtMaxPrice: priceSchema.optional(),
|
|
328
328
|
images: z.array(imageSchema).optional(),
|
|
329
329
|
media: z.array(mediaSchema).optional(),
|
|
330
|
-
vendor: z.string().
|
|
331
|
-
productType: z.string().
|
|
330
|
+
vendor: z.string().nullish(),
|
|
331
|
+
productType: z.string().nullish(),
|
|
332
332
|
tags: z.array(z.string()).optional(),
|
|
333
333
|
sellingPlanGroups: z.array(sellingPlanGroupSchema).optional(),
|
|
334
334
|
metafields: z.array(metafieldSchema).optional()
|
|
@@ -337,8 +337,8 @@ var collectionSchema = z.object({
|
|
|
337
337
|
id: z.string(),
|
|
338
338
|
handle: z.string().optional(),
|
|
339
339
|
title: z.string().optional(),
|
|
340
|
-
descriptionHtml: z.string().
|
|
341
|
-
image: imageSchema.
|
|
340
|
+
descriptionHtml: z.string().nullish(),
|
|
341
|
+
image: imageSchema.nullish()
|
|
342
342
|
});
|
|
343
343
|
var discountCodeSchema = z.object({
|
|
344
344
|
id: z.string(),
|
|
@@ -351,13 +351,13 @@ var discountCodeSchema = z.object({
|
|
|
351
351
|
// new Shopify statuses do not break parsing.
|
|
352
352
|
status: z.string().optional(),
|
|
353
353
|
// Human-readable explanation of the discount (e.g. "20% off all products").
|
|
354
|
-
summary: z.string().
|
|
354
|
+
summary: z.string().nullish(),
|
|
355
355
|
// Shopify discount union type: DiscountCodeBasic, DiscountCodeBxgy,
|
|
356
356
|
// DiscountCodeFreeShipping, or DiscountCodeApp.
|
|
357
357
|
discountType: z.string().optional(),
|
|
358
|
-
startsAt: z.string().
|
|
359
|
-
endsAt: z.string().
|
|
360
|
-
usageLimit: z.number().
|
|
358
|
+
startsAt: z.string().nullish(),
|
|
359
|
+
endsAt: z.string().nullish(),
|
|
360
|
+
usageLimit: z.number().nullish(),
|
|
361
361
|
usageCount: z.number().optional(),
|
|
362
362
|
appliesOncePerCustomer: z.boolean().optional()
|
|
363
363
|
});
|
|
@@ -427,11 +427,11 @@ var levantaProductSchema = z.object({
|
|
|
427
427
|
commission: z.string().optional().describe(
|
|
428
428
|
'Creator commission rate as a decimal string percentage (e.g. "8.5" meaning 8.5%).'
|
|
429
429
|
),
|
|
430
|
-
imageUrl: z.string().
|
|
431
|
-
brand: z.object({ id: z.string(), name: z.string() }).
|
|
430
|
+
imageUrl: z.string().nullish(),
|
|
431
|
+
brand: z.object({ id: z.string(), name: z.string() }).nullish(),
|
|
432
432
|
inStock: z.boolean().optional(),
|
|
433
433
|
marketplace: z.string().optional(),
|
|
434
|
-
affiliateLink: levantaAffiliateLinkSchema.
|
|
434
|
+
affiliateLink: levantaAffiliateLinkSchema.nullish()
|
|
435
435
|
}).describe("LevantaProduct");
|
|
436
436
|
var intelligemsExperienceSchema = z.object({
|
|
437
437
|
id: z.string(),
|
package/env.js
CHANGED
|
@@ -6,8 +6,8 @@ const envSchema = z.object({
|
|
|
6
6
|
ANALYTICS_FIRE_API_URL: z.string().optional(),
|
|
7
7
|
REPLO_ANALYTICS_PIXEL_URL: z.string().optional(),
|
|
8
8
|
SHOPIFY_URL: z.string().optional(),
|
|
9
|
-
SHOPIFY_STOREFRONT_ACCESS_TOKEN: z.string().
|
|
10
|
-
STRIPE_CONNECT_ACCOUNT_ID: z.string().
|
|
9
|
+
SHOPIFY_STOREFRONT_ACCESS_TOKEN: z.string().nullish(),
|
|
10
|
+
STRIPE_CONNECT_ACCOUNT_ID: z.string().nullish(),
|
|
11
11
|
CHECKOUT_PROVIDER: z.enum(["shopify", "stripe", "none"]).optional(),
|
|
12
12
|
REPLO_INTERNAL_REVALIDATE_SECRET: z.string().optional(),
|
|
13
13
|
CART_AUTH_SECRET: z.string().optional()
|
package/env.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../env.ts"],
|
|
4
|
-
"sourcesContent": ["import { getCloudflareContext } from \"@opennextjs/cloudflare\";\nimport { z } from \"zod\";\n\ntype Env = {\n CANOPY_API_HOST: string;\n PROJECT_ID: string;\n\n // Base URL of analytics-fire (e.g. https://data.replo.app). Read server-side by\n // the consent action (`consent/consent-actions.ts`) to forward proof-of-consent\n // records. Optional: absent in environments where the audit pipeline isn't\n // wired (e.g. local dev), where consent recording simply no-ops.\n ANALYTICS_FIRE_API_URL?: string;\n\n // Base URL of the Replo first-party analytics pixel CDN (e.g.\n // https://pixel.replo.app). `<ReploFirstPartyPixel>` loads\n // `${REPLO_ANALYTICS_PIXEL_URL}/latest.js` into the page once analytics consent\n // is granted; the browser fetches it directly. Optional: absent when the pixel\n // isn't configured (e.g. lean local dev), where the pixel simply isn't injected.\n REPLO_ANALYTICS_PIXEL_URL?: string;\n\n // NOTE (Gabe 2025-06-26): If there's no Shopify integration these will be\n // undefined.\n SHOPIFY_URL?: string;\n // NOTE (Gabe 2025-06-26): Even if there's an integration, if we haven't been\n // given elevated scope this may be null.\n SHOPIFY_STOREFRONT_ACCESS_TOKEN?: string | null;\n STRIPE_CONNECT_ACCOUNT_ID?: string | null;\n CHECKOUT_PROVIDER?: \"shopify\" | \"stripe\" | \"none\";\n\n REPLO_INTERNAL_REVALIDATE_SECRET?: string;\n /** Shared secret sent in X-Replo-Resolver-Auth for server-to-server cart calls. */\n CART_AUTH_SECRET?: string;\n};\n\nconst envSchema = z.object({\n CANOPY_API_HOST: z.string().min(1),\n PROJECT_ID: z.uuid(),\n ANALYTICS_FIRE_API_URL: z.string().optional(),\n REPLO_ANALYTICS_PIXEL_URL: z.string().optional(),\n SHOPIFY_URL: z.string().optional(),\n SHOPIFY_STOREFRONT_ACCESS_TOKEN: z.string().
|
|
5
|
-
"mappings": "AAAA,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAiClB,MAAM,YAAY,EAAE,OAAO;AAAA,EACzB,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACjC,YAAY,EAAE,KAAK;AAAA,EACnB,wBAAwB,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5C,2BAA2B,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,iCAAiC,EAAE,OAAO,EAAE,
|
|
4
|
+
"sourcesContent": ["import { getCloudflareContext } from \"@opennextjs/cloudflare\";\nimport { z } from \"zod\";\n\ntype Env = {\n CANOPY_API_HOST: string;\n PROJECT_ID: string;\n\n // Base URL of analytics-fire (e.g. https://data.replo.app). Read server-side by\n // the consent action (`consent/consent-actions.ts`) to forward proof-of-consent\n // records. Optional: absent in environments where the audit pipeline isn't\n // wired (e.g. local dev), where consent recording simply no-ops.\n ANALYTICS_FIRE_API_URL?: string;\n\n // Base URL of the Replo first-party analytics pixel CDN (e.g.\n // https://pixel.replo.app). `<ReploFirstPartyPixel>` loads\n // `${REPLO_ANALYTICS_PIXEL_URL}/latest.js` into the page once analytics consent\n // is granted; the browser fetches it directly. Optional: absent when the pixel\n // isn't configured (e.g. lean local dev), where the pixel simply isn't injected.\n REPLO_ANALYTICS_PIXEL_URL?: string;\n\n // NOTE (Gabe 2025-06-26): If there's no Shopify integration these will be\n // undefined.\n SHOPIFY_URL?: string;\n // NOTE (Gabe 2025-06-26): Even if there's an integration, if we haven't been\n // given elevated scope this may be null.\n SHOPIFY_STOREFRONT_ACCESS_TOKEN?: string | null;\n STRIPE_CONNECT_ACCOUNT_ID?: string | null;\n CHECKOUT_PROVIDER?: \"shopify\" | \"stripe\" | \"none\";\n\n REPLO_INTERNAL_REVALIDATE_SECRET?: string;\n /** Shared secret sent in X-Replo-Resolver-Auth for server-to-server cart calls. */\n CART_AUTH_SECRET?: string;\n};\n\nconst envSchema = z.object({\n CANOPY_API_HOST: z.string().min(1),\n PROJECT_ID: z.uuid(),\n ANALYTICS_FIRE_API_URL: z.string().optional(),\n REPLO_ANALYTICS_PIXEL_URL: z.string().optional(),\n SHOPIFY_URL: z.string().optional(),\n SHOPIFY_STOREFRONT_ACCESS_TOKEN: z.string().nullish(),\n STRIPE_CONNECT_ACCOUNT_ID: z.string().nullish(),\n CHECKOUT_PROVIDER: z.enum([\"shopify\", \"stripe\", \"none\"]).optional(),\n REPLO_INTERNAL_REVALIDATE_SECRET: z.string().optional(),\n CART_AUTH_SECRET: z.string().optional(),\n});\n\nconst fetchCloudflareContext = () => getCloudflareContext({ async: true });\ntype CloudflareContextPromise = ReturnType<typeof fetchCloudflareContext>;\n\ndeclare global {\n var canopyCloudflareContextPromise: CloudflareContextPromise | undefined;\n}\n\n// (Andrew, 2026-07-08, REPL-29048): memoize the in-flight dev init so concurrent cold-start renders share one workerd, not separate ones racing on the same SQLite lock (SQLITE_BUSY).\nconst getSharedCloudflareContext = (): CloudflareContextPromise => {\n if (process.env.NODE_ENV !== \"development\") return fetchCloudflareContext();\n return (globalThis.canopyCloudflareContextPromise ??=\n fetchCloudflareContext().catch((error: unknown) => {\n globalThis.canopyCloudflareContextPromise = undefined; // let the next request retry instead of caching a rejection\n throw error;\n }));\n};\n\nexport const getEnv = async (): Promise<Env> => {\n const { env } = await getSharedCloudflareContext();\n return envSchema.parse(env);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAiClB,MAAM,YAAY,EAAE,OAAO;AAAA,EACzB,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACjC,YAAY,EAAE,KAAK;AAAA,EACnB,wBAAwB,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5C,2BAA2B,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,iCAAiC,EAAE,OAAO,EAAE,QAAQ;AAAA,EACpD,2BAA2B,EAAE,OAAO,EAAE,QAAQ;AAAA,EAC9C,mBAAmB,EAAE,KAAK,CAAC,WAAW,UAAU,MAAM,CAAC,EAAE,SAAS;AAAA,EAClE,kCAAkC,EAAE,OAAO,EAAE,SAAS;AAAA,EACtD,kBAAkB,EAAE,OAAO,EAAE,SAAS;AACxC,CAAC;AAED,MAAM,yBAAyB,MAAM,qBAAqB,EAAE,OAAO,KAAK,CAAC;AAQzE,MAAM,6BAA6B,MAAgC;AACjE,MAAI,QAAQ,IAAI,aAAa,cAAe,QAAO,uBAAuB;AAC1E,SAAQ,WAAW,mCACjB,uBAAuB,EAAE,MAAM,CAAC,UAAmB;AACjD,eAAW,iCAAiC;AAC5C,UAAM;AAAA,EACR,CAAC;AACL;AAEO,MAAM,SAAS,YAA0B;AAC9C,QAAM,EAAE,IAAI,IAAI,MAAM,2BAA2B;AACjD,SAAO,UAAU,MAAM,GAAG;AAC5B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { yotpoProductReviewAggregateLoaderOutputSchema } from "../_vendor/schemas/agentTools/customIntegrations/loaders/yotpo";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
type YotpoReviewAggregateData = z.infer<typeof yotpoProductReviewAggregateLoaderOutputSchema>;
|
|
5
|
+
type YotpoReviewAggregateLoaderProps = {
|
|
6
|
+
loaderKey: string;
|
|
7
|
+
productId: string;
|
|
8
|
+
children: (data: YotpoReviewAggregateData) => ReactNode;
|
|
9
|
+
fallback?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function YotpoReviewAggregateLoader({ loaderKey, productId, children, fallback, }: YotpoReviewAggregateLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
5
|
+
import { yotpoProductReviewAggregateLoaderOutputSchema } from "../_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs";
|
|
6
|
+
import { invokeLoader } from "./invoke-loader";
|
|
7
|
+
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
|
+
function YotpoReviewAggregateLoaderInner({
|
|
9
|
+
loaderKey,
|
|
10
|
+
productId,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
const queryResult = useSuspenseQuery({
|
|
14
|
+
queryKey: [loaderKey, { productId }],
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
const loadedData = await invokeLoader({
|
|
17
|
+
loaderKey,
|
|
18
|
+
args: { productId }
|
|
19
|
+
});
|
|
20
|
+
return yotpoProductReviewAggregateLoaderOutputSchema.parse(loadedData);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
|
|
24
|
+
}
|
|
25
|
+
function YotpoReviewAggregateLoader({
|
|
26
|
+
loaderKey,
|
|
27
|
+
productId,
|
|
28
|
+
children,
|
|
29
|
+
fallback
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
LoaderErrorBoundary,
|
|
33
|
+
{
|
|
34
|
+
fallback: fallback ?? null,
|
|
35
|
+
resetKey: `${loaderKey}:${productId}`,
|
|
36
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
37
|
+
YotpoReviewAggregateLoaderInner,
|
|
38
|
+
{
|
|
39
|
+
loaderKey,
|
|
40
|
+
productId,
|
|
41
|
+
children
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
YotpoReviewAggregateLoader
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=yotpo-review-aggregate-loader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../loaders/yotpo-review-aggregate-loader.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\n\nimport { Suspense } from \"react\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { yotpoProductReviewAggregateLoaderOutputSchema } from \"schemas/agentTools/customIntegrations/loaders/yotpo\";\nimport { z } from \"zod\";\n\nimport { invokeLoader } from \"./invoke-loader\";\nimport { LoaderErrorBoundary } from \"./loader-error-boundary\";\n\ntype YotpoReviewAggregateData = z.infer<\n typeof yotpoProductReviewAggregateLoaderOutputSchema\n>;\n\ntype YotpoReviewAggregateLoaderProps = {\n loaderKey: string;\n productId: string;\n children: (data: YotpoReviewAggregateData) => ReactNode;\n fallback?: ReactNode;\n};\n\nfunction YotpoReviewAggregateLoaderInner({\n loaderKey,\n productId,\n children,\n}: Omit<YotpoReviewAggregateLoaderProps, \"fallback\">) {\n const queryResult = useSuspenseQuery({\n queryKey: [loaderKey, { productId }],\n queryFn: async () => {\n const loadedData = await invokeLoader({\n loaderKey,\n args: { productId },\n });\n return yotpoProductReviewAggregateLoaderOutputSchema.parse(loadedData);\n },\n });\n\n return <>{children(queryResult.data)}</>;\n}\n\nexport function YotpoReviewAggregateLoader({\n loaderKey,\n productId,\n children,\n fallback,\n}: YotpoReviewAggregateLoaderProps) {\n return (\n <LoaderErrorBoundary\n fallback={fallback ?? null}\n resetKey={`${loaderKey}:${productId}`}\n >\n <Suspense fallback={fallback ?? null}>\n <YotpoReviewAggregateLoaderInner\n loaderKey={loaderKey}\n productId={productId}\n >\n {children}\n </YotpoReviewAggregateLoaderInner>\n </Suspense>\n </LoaderErrorBoundary>\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAwCS;AApCT,SAAS,gBAAgB;AAEzB,SAAS,wBAAwB;AACjC,SAAS,qDAAqD;AAG9D,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAapC,SAAS,gCAAgC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACF,GAAsD;AACpD,QAAM,cAAc,iBAAiB;AAAA,IACnC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC;AAAA,IACnC,SAAS,YAAY;AACnB,YAAM,aAAa,MAAM,aAAa;AAAA,QACpC;AAAA,QACA,MAAM,EAAE,UAAU;AAAA,MACpB,CAAC;AACD,aAAO,8CAA8C,MAAM,UAAU;AAAA,IACvE;AAAA,EACF,CAAC;AAED,SAAO,gCAAG,mBAAS,YAAY,IAAI,GAAE;AACvC;AAEO,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoC;AAClC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,YAAY;AAAA,MACtB,UAAU,GAAG,SAAS,IAAI,SAAS;AAAA,MAEnC,8BAAC,YAAS,UAAU,YAAY,MAC9B;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UAEC;AAAA;AAAA,MACH,GACF;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { yotpoProductReviewsLoaderOutputSchema } from "../_vendor/schemas/agentTools/customIntegrations/loaders/yotpo";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
type YotpoReviewsData = z.infer<typeof yotpoProductReviewsLoaderOutputSchema>;
|
|
5
|
+
type YotpoReviewsLoaderProps = {
|
|
6
|
+
loaderKey: string;
|
|
7
|
+
productId: string;
|
|
8
|
+
perPage?: number;
|
|
9
|
+
page?: number;
|
|
10
|
+
children: (data: YotpoReviewsData) => ReactNode;
|
|
11
|
+
fallback?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function YotpoReviewsLoader({ loaderKey, productId, perPage, page, children, fallback, }: YotpoReviewsLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense } from "react";
|
|
4
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
5
|
+
import { yotpoProductReviewsLoaderOutputSchema } from "../_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs";
|
|
6
|
+
import { invokeLoader } from "./invoke-loader";
|
|
7
|
+
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
|
+
function buildReviewsArgs({
|
|
9
|
+
productId,
|
|
10
|
+
perPage,
|
|
11
|
+
page
|
|
12
|
+
}) {
|
|
13
|
+
return {
|
|
14
|
+
productId,
|
|
15
|
+
...perPage !== void 0 ? { perPage } : {},
|
|
16
|
+
...page !== void 0 ? { page } : {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function YotpoReviewsLoaderInner({
|
|
20
|
+
loaderKey,
|
|
21
|
+
productId,
|
|
22
|
+
perPage,
|
|
23
|
+
page,
|
|
24
|
+
children
|
|
25
|
+
}) {
|
|
26
|
+
const args = buildReviewsArgs({ productId, perPage, page });
|
|
27
|
+
const queryResult = useSuspenseQuery({
|
|
28
|
+
queryKey: [loaderKey, args],
|
|
29
|
+
queryFn: async () => {
|
|
30
|
+
const loadedData = await invokeLoader({ loaderKey, args });
|
|
31
|
+
return yotpoProductReviewsLoaderOutputSchema.parse(loadedData);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(queryResult.data) });
|
|
35
|
+
}
|
|
36
|
+
function YotpoReviewsLoader({
|
|
37
|
+
loaderKey,
|
|
38
|
+
productId,
|
|
39
|
+
perPage,
|
|
40
|
+
page,
|
|
41
|
+
children,
|
|
42
|
+
fallback
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
LoaderErrorBoundary,
|
|
46
|
+
{
|
|
47
|
+
fallback: fallback ?? null,
|
|
48
|
+
resetKey: `${loaderKey}:${productId}:${perPage ?? ""}:${page ?? ""}`,
|
|
49
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
50
|
+
YotpoReviewsLoaderInner,
|
|
51
|
+
{
|
|
52
|
+
loaderKey,
|
|
53
|
+
productId,
|
|
54
|
+
perPage,
|
|
55
|
+
page,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
) })
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
YotpoReviewsLoader
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=yotpo-reviews-loader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../loaders/yotpo-reviews-loader.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\n\nimport { Suspense } from \"react\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { yotpoProductReviewsLoaderOutputSchema } from \"schemas/agentTools/customIntegrations/loaders/yotpo\";\nimport { z } from \"zod\";\n\nimport { invokeLoader } from \"./invoke-loader\";\nimport { LoaderErrorBoundary } from \"./loader-error-boundary\";\n\ntype YotpoReviewsData = z.infer<typeof yotpoProductReviewsLoaderOutputSchema>;\n\ntype YotpoReviewsLoaderProps = {\n loaderKey: string;\n productId: string;\n perPage?: number;\n page?: number;\n children: (data: YotpoReviewsData) => ReactNode;\n fallback?: ReactNode;\n};\n\n// NOTE (Noah, 2026-07-21): Only forward pagination args when set so the queryKey\n// and prefetch args match (a prefetch that omits page/perPage must hydrate a\n// component that also omits them). React Query keys are structural, so undefined\n// entries would break the prefetch \u2192 client cache handoff.\nfunction buildReviewsArgs({\n productId,\n perPage,\n page,\n}: {\n productId: string;\n perPage?: number;\n page?: number;\n}) {\n return {\n productId,\n ...(perPage !== undefined ? { perPage } : {}),\n ...(page !== undefined ? { page } : {}),\n };\n}\n\nfunction YotpoReviewsLoaderInner({\n loaderKey,\n productId,\n perPage,\n page,\n children,\n}: Omit<YotpoReviewsLoaderProps, \"fallback\">) {\n const args = buildReviewsArgs({ productId, perPage, page });\n const queryResult = useSuspenseQuery({\n queryKey: [loaderKey, args],\n queryFn: async () => {\n const loadedData = await invokeLoader({ loaderKey, args });\n return yotpoProductReviewsLoaderOutputSchema.parse(loadedData);\n },\n });\n\n return <>{children(queryResult.data)}</>;\n}\n\nexport function YotpoReviewsLoader({\n loaderKey,\n productId,\n perPage,\n page,\n children,\n fallback,\n}: YotpoReviewsLoaderProps) {\n return (\n <LoaderErrorBoundary\n fallback={fallback ?? null}\n resetKey={`${loaderKey}:${productId}:${perPage ?? \"\"}:${page ?? \"\"}`}\n >\n <Suspense fallback={fallback ?? null}>\n <YotpoReviewsLoaderInner\n loaderKey={loaderKey}\n productId={productId}\n perPage={perPage}\n page={page}\n >\n {children}\n </YotpoReviewsLoaderInner>\n </Suspense>\n </LoaderErrorBoundary>\n );\n}\n"],
|
|
5
|
+
"mappings": ";AA4DS;AAxDT,SAAS,gBAAgB;AAEzB,SAAS,wBAAwB;AACjC,SAAS,6CAA6C;AAGtD,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAiBpC,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SAAO;AAAA,IACL;AAAA,IACA,GAAI,YAAY,SAAY,EAAE,QAAQ,IAAI,CAAC;AAAA,IAC3C,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC;AAAA,EACvC;AACF;AAEA,SAAS,wBAAwB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA8C;AAC5C,QAAM,OAAO,iBAAiB,EAAE,WAAW,SAAS,KAAK,CAAC;AAC1D,QAAM,cAAc,iBAAiB;AAAA,IACnC,UAAU,CAAC,WAAW,IAAI;AAAA,IAC1B,SAAS,YAAY;AACnB,YAAM,aAAa,MAAM,aAAa,EAAE,WAAW,KAAK,CAAC;AACzD,aAAO,sCAAsC,MAAM,UAAU;AAAA,IAC/D;AAAA,EACF,CAAC;AAED,SAAO,gCAAG,mBAAS,YAAY,IAAI,GAAE;AACvC;AAEO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,YAAY;AAAA,MACtB,UAAU,GAAG,SAAS,IAAI,SAAS,IAAI,WAAW,EAAE,IAAI,QAAQ,EAAE;AAAA,MAElE,8BAAC,YAAS,UAAU,YAAY,MAC9B;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UAEC;AAAA;AAAA,MACH,GACF;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const STRIPE_CART_COOKIE_NAME = "replo_stripe_cart";
|