@replohq/canopy-sdk 1.3.1 → 1.3.2-beta.pr-24916.3.6f21cf4
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/cart/cart-schema.d.ts +0 -124
- package/cart/cart-schema.js +1 -23
- package/cart/cart-schema.js.map +2 -2
- package/cart/cart-types.d.ts +0 -23
- package/cart/cart-types.js +1 -9
- package/cart/cart-types.js.map +2 -2
- package/package.json +172 -5
package/cart/cart-schema.d.ts
CHANGED
|
@@ -1,108 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const cartLineAttributeSchema: z.ZodObject<{
|
|
3
|
-
key: z.ZodString;
|
|
4
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export declare const cartLineAttributesSchema: z.ZodArray<z.ZodObject<{
|
|
7
|
-
key: z.ZodString;
|
|
8
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
9
|
-
}, z.core.$strip>>;
|
|
10
|
-
export type CartLineAttribute = z.infer<typeof cartLineAttributeSchema>;
|
|
11
|
-
export declare const cartImageSchema: z.ZodObject<{
|
|
12
|
-
url: z.ZodString;
|
|
13
|
-
altText: z.ZodNullable<z.ZodString>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type CartImage = z.infer<typeof cartImageSchema>;
|
|
16
|
-
export declare const cartLineMerchandiseSchema: z.ZodObject<{
|
|
17
|
-
id: z.ZodString;
|
|
18
|
-
product: z.ZodObject<{
|
|
19
|
-
id: z.ZodString;
|
|
20
|
-
title: z.ZodString;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
title: z.ZodString;
|
|
23
|
-
price: z.ZodNumber;
|
|
24
|
-
compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
-
image: z.ZodNullable<z.ZodObject<{
|
|
26
|
-
url: z.ZodString;
|
|
27
|
-
altText: z.ZodNullable<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>>;
|
|
29
|
-
selectedOptions: z.ZodArray<z.ZodObject<{
|
|
30
|
-
name: z.ZodString;
|
|
31
|
-
value: z.ZodString;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
export type CartLineMerchandise = z.infer<typeof cartLineMerchandiseSchema>;
|
|
35
|
-
export declare const cartLineSchema: z.ZodObject<{
|
|
36
|
-
id: z.ZodString;
|
|
37
|
-
quantity: z.ZodNumber;
|
|
38
|
-
merchandise: z.ZodObject<{
|
|
39
|
-
id: z.ZodString;
|
|
40
|
-
product: z.ZodObject<{
|
|
41
|
-
id: z.ZodString;
|
|
42
|
-
title: z.ZodString;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
title: z.ZodString;
|
|
45
|
-
price: z.ZodNumber;
|
|
46
|
-
compareAtPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
-
image: z.ZodNullable<z.ZodObject<{
|
|
48
|
-
url: z.ZodString;
|
|
49
|
-
altText: z.ZodNullable<z.ZodString>;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
selectedOptions: z.ZodArray<z.ZodObject<{
|
|
52
|
-
name: z.ZodString;
|
|
53
|
-
value: z.ZodString;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
}, z.core.$strip>;
|
|
56
|
-
attributes: z.ZodArray<z.ZodObject<{
|
|
57
|
-
key: z.ZodString;
|
|
58
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
59
|
-
}, z.core.$strip>>;
|
|
60
|
-
sellingPlanAllocation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
61
|
-
sellingPlan: z.ZodObject<{
|
|
62
|
-
id: z.ZodString;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
description: z.ZodNullable<z.ZodString>;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
priceAdjustments: z.ZodArray<z.ZodObject<{
|
|
67
|
-
compareAtPrice: z.ZodObject<{
|
|
68
|
-
amount: z.ZodNumber;
|
|
69
|
-
currencyCode: z.ZodString;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
perDeliveryPrice: z.ZodObject<{
|
|
72
|
-
amount: z.ZodNumber;
|
|
73
|
-
currencyCode: z.ZodString;
|
|
74
|
-
}, z.core.$strip>;
|
|
75
|
-
price: z.ZodObject<{
|
|
76
|
-
amount: z.ZodNumber;
|
|
77
|
-
currencyCode: z.ZodString;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
unitPrice: z.ZodNullable<z.ZodObject<{
|
|
80
|
-
amount: z.ZodNumber;
|
|
81
|
-
currencyCode: z.ZodString;
|
|
82
|
-
}, z.core.$strip>>;
|
|
83
|
-
}, z.core.$strip>>;
|
|
84
|
-
checkoutChargeAmount: z.ZodObject<{
|
|
85
|
-
amount: z.ZodNumber;
|
|
86
|
-
currencyCode: z.ZodString;
|
|
87
|
-
}, z.core.$strip>;
|
|
88
|
-
remainingBalanceChargeAmount: z.ZodObject<{
|
|
89
|
-
amount: z.ZodNumber;
|
|
90
|
-
currencyCode: z.ZodString;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
}, z.core.$strip>>>;
|
|
93
|
-
}, z.core.$strip>;
|
|
94
|
-
export type CartLine = z.infer<typeof cartLineSchema>;
|
|
95
|
-
export declare const cartCostSchema: z.ZodObject<{
|
|
96
|
-
subtotalAmount: z.ZodNumber;
|
|
97
|
-
totalAmount: z.ZodNumber;
|
|
98
|
-
currencyCode: z.ZodString;
|
|
99
|
-
}, z.core.$strip>;
|
|
100
|
-
export type CartCost = z.infer<typeof cartCostSchema>;
|
|
101
|
-
export declare const cartDiscountCodeSchema: z.ZodObject<{
|
|
102
|
-
code: z.ZodString;
|
|
103
|
-
applicable: z.ZodBoolean;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
export type CartDiscountCode = z.infer<typeof cartDiscountCodeSchema>;
|
|
106
2
|
export declare const cartSchema: z.ZodObject<{
|
|
107
3
|
id: z.ZodString;
|
|
108
4
|
lines: z.ZodArray<z.ZodObject<{
|
|
@@ -176,23 +72,3 @@ export declare const cartSchema: z.ZodObject<{
|
|
|
176
72
|
}, z.core.$strip>>>;
|
|
177
73
|
}, z.core.$strip>;
|
|
178
74
|
export type Cart = z.infer<typeof cartSchema>;
|
|
179
|
-
export declare const addCartLinesInputSchema: z.ZodObject<{
|
|
180
|
-
merchandiseId: z.ZodString;
|
|
181
|
-
quantity: z.ZodNumber;
|
|
182
|
-
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
183
|
-
key: z.ZodString;
|
|
184
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
185
|
-
}, z.core.$strip>>>;
|
|
186
|
-
sellingPlanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
-
}, z.core.$strip>;
|
|
188
|
-
export type AddCartLineInput = z.infer<typeof addCartLinesInputSchema>;
|
|
189
|
-
export declare const updateCartLineInputSchema: z.ZodObject<{
|
|
190
|
-
lineId: z.ZodString;
|
|
191
|
-
quantity: z.ZodNumber;
|
|
192
|
-
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
193
|
-
key: z.ZodString;
|
|
194
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
195
|
-
}, z.core.$strip>>>;
|
|
196
|
-
sellingPlanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
-
}, z.core.$strip>;
|
|
198
|
-
export type UpdateCartLineInput = z.infer<typeof updateCartLineInputSchema>;
|
package/cart/cart-schema.js
CHANGED
|
@@ -3,7 +3,6 @@ const cartLineAttributeSchema = z.object({
|
|
|
3
3
|
key: z.string(),
|
|
4
4
|
value: z.union([z.string(), z.number(), z.boolean()])
|
|
5
5
|
});
|
|
6
|
-
const cartLineAttributesSchema = z.array(cartLineAttributeSchema);
|
|
7
6
|
const cartImageSchema = z.object({
|
|
8
7
|
url: z.string(),
|
|
9
8
|
altText: z.string().nullable()
|
|
@@ -64,28 +63,7 @@ const cartSchema = z.object({
|
|
|
64
63
|
checkoutUrl: z.string().optional(),
|
|
65
64
|
discountCodes: z.array(cartDiscountCodeSchema).optional()
|
|
66
65
|
});
|
|
67
|
-
const addCartLinesInputSchema = z.object({
|
|
68
|
-
merchandiseId: z.string(),
|
|
69
|
-
quantity: z.number().int().positive(),
|
|
70
|
-
attributes: z.array(cartLineAttributeSchema).optional(),
|
|
71
|
-
sellingPlanId: z.string().nullish()
|
|
72
|
-
});
|
|
73
|
-
const updateCartLineInputSchema = z.object({
|
|
74
|
-
lineId: z.string(),
|
|
75
|
-
quantity: z.number().int().min(0),
|
|
76
|
-
attributes: z.array(cartLineAttributeSchema).optional(),
|
|
77
|
-
sellingPlanId: z.string().nullish()
|
|
78
|
-
});
|
|
79
66
|
export {
|
|
80
|
-
|
|
81
|
-
cartCostSchema,
|
|
82
|
-
cartDiscountCodeSchema,
|
|
83
|
-
cartImageSchema,
|
|
84
|
-
cartLineAttributeSchema,
|
|
85
|
-
cartLineAttributesSchema,
|
|
86
|
-
cartLineMerchandiseSchema,
|
|
87
|
-
cartLineSchema,
|
|
88
|
-
cartSchema,
|
|
89
|
-
updateCartLineInputSchema
|
|
67
|
+
cartSchema
|
|
90
68
|
};
|
|
91
69
|
//# sourceMappingURL=cart-schema.js.map
|
package/cart/cart-schema.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../cart/cart-schema.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from \"zod\";\n\n// NOTE (Ryan, 2026-07-23, REPL-27611): Self-contained copy of the cart wire\n// schema that the canopy-sdk gateway validates on published pages, so nothing\n// shipped to a generated site imports from `schemas`. The backend keeps the\n// canonical copy in `schemas/cart.ts` (its cart services can't depend on\n// canopy-sdk without a cycle); `cart-schema.spec.ts` keeps the two in lockstep.\n// This module is internal wire validation; public types live in `cart/cart-types`.\n\n// ---------------------------------------------------------------------------\n// Cart line attribute\n// ---------------------------------------------------------------------------\n\
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;
|
|
4
|
+
"sourcesContent": ["import { z } from \"zod\";\n\n// NOTE (Ryan, 2026-07-23, REPL-27611): Self-contained copy of the cart wire\n// schema that the canopy-sdk gateway validates on published pages, so nothing\n// shipped to a generated site imports from `schemas`. The backend keeps the\n// canonical copy in `schemas/cart.ts` (its cart services can't depend on\n// canopy-sdk without a cycle); `cart-schema.spec.ts` keeps the two in lockstep.\n// This module is internal wire validation; public types live in `cart/cart-types`.\n\n// ---------------------------------------------------------------------------\n// Cart line attribute\n// ---------------------------------------------------------------------------\n\nconst cartLineAttributeSchema = z.object({\n key: z.string(),\n value: z.union([z.string(), z.number(), z.boolean()]),\n});\n\n// ---------------------------------------------------------------------------\n// Image (cart-scoped; lightweight compared to objectType image)\n// ---------------------------------------------------------------------------\n\nconst cartImageSchema = z.object({\n url: z.string(),\n altText: z.string().nullable(),\n});\n\n// ---------------------------------------------------------------------------\n// Selling plan types\n// ---------------------------------------------------------------------------\n\n// Integer minor units (Stripe convention): 1999 = $19.99 USD. Mirrors\n// amountSchema in schemas/money.ts, which shipped code cannot import.\nconst amountSchema = z.number().int();\nconst amountWithCurrencyCodeSchema = z.object({\n amount: amountSchema,\n currencyCode: z.string(),\n});\n\nconst sellingPlanPriceAdjustmentSchema = z.object({\n compareAtPrice: amountWithCurrencyCodeSchema,\n perDeliveryPrice: amountWithCurrencyCodeSchema,\n price: amountWithCurrencyCodeSchema,\n unitPrice: amountWithCurrencyCodeSchema.nullable(),\n});\n\nconst sellingPlanAllocationSchema = z.object({\n sellingPlan: z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().nullable(),\n }),\n priceAdjustments: z.array(sellingPlanPriceAdjustmentSchema),\n checkoutChargeAmount: amountWithCurrencyCodeSchema,\n remainingBalanceChargeAmount: amountWithCurrencyCodeSchema,\n});\n\n// ---------------------------------------------------------------------------\n// Cart line merchandise\n// ---------------------------------------------------------------------------\n\nconst cartLineMerchandiseSchema = z.object({\n id: z.string(),\n product: z.object({\n id: z.string(),\n title: z.string(),\n }),\n title: z.string(),\n price: amountSchema,\n compareAtPrice: amountSchema.nullish(),\n image: cartImageSchema.nullable(),\n selectedOptions: z.array(z.object({ name: z.string(), value: z.string() })),\n});\n\n// ---------------------------------------------------------------------------\n// Cart line\n// ---------------------------------------------------------------------------\n\nconst cartLineSchema = z.object({\n id: z.string(),\n quantity: z.number(),\n merchandise: cartLineMerchandiseSchema,\n attributes: z.array(cartLineAttributeSchema),\n sellingPlanAllocation: sellingPlanAllocationSchema.nullish(),\n});\n\n// ---------------------------------------------------------------------------\n// Cart cost\n// ---------------------------------------------------------------------------\n\nconst cartCostSchema = z.object({\n subtotalAmount: amountSchema,\n totalAmount: amountSchema,\n currencyCode: z.string(),\n});\n\n// ---------------------------------------------------------------------------\n// Cart discount code\n// ---------------------------------------------------------------------------\n\nconst cartDiscountCodeSchema = z.object({\n code: z.string(),\n applicable: z.boolean(),\n});\n\n// ---------------------------------------------------------------------------\n// Cart (top level)\n// ---------------------------------------------------------------------------\n\nexport const cartSchema = z.object({\n id: z.string(),\n lines: z.array(cartLineSchema),\n cost: cartCostSchema,\n checkoutUrl: z.string().optional(),\n discountCodes: z.array(cartDiscountCodeSchema).optional(),\n});\n\nexport type Cart = z.infer<typeof cartSchema>;\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAalB,MAAM,0BAA0B,EAAE,OAAO;AAAA,EACvC,KAAK,EAAE,OAAO;AAAA,EACd,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC;AAMD,MAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,KAAK,EAAE,OAAO;AAAA,EACd,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAQD,MAAM,eAAe,EAAE,OAAO,EAAE,IAAI;AACpC,MAAM,+BAA+B,EAAE,OAAO;AAAA,EAC5C,QAAQ;AAAA,EACR,cAAc,EAAE,OAAO;AACzB,CAAC;AAED,MAAM,mCAAmC,EAAE,OAAO;AAAA,EAChD,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,WAAW,6BAA6B,SAAS;AACnD,CAAC;AAED,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,aAAa,EAAE,OAAO;AAAA,IACpB,IAAI,EAAE,OAAO;AAAA,IACb,MAAM,EAAE,OAAO;AAAA,IACf,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,CAAC;AAAA,EACD,kBAAkB,EAAE,MAAM,gCAAgC;AAAA,EAC1D,sBAAsB;AAAA,EACtB,8BAA8B;AAChC,CAAC;AAMD,MAAM,4BAA4B,EAAE,OAAO;AAAA,EACzC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS,EAAE,OAAO;AAAA,IAChB,IAAI,EAAE,OAAO;AAAA,IACb,OAAO,EAAE,OAAO;AAAA,EAClB,CAAC;AAAA,EACD,OAAO,EAAE,OAAO;AAAA,EAChB,OAAO;AAAA,EACP,gBAAgB,aAAa,QAAQ;AAAA,EACrC,OAAO,gBAAgB,SAAS;AAAA,EAChC,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5E,CAAC;AAMD,MAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,IAAI,EAAE,OAAO;AAAA,EACb,UAAU,EAAE,OAAO;AAAA,EACnB,aAAa;AAAA,EACb,YAAY,EAAE,MAAM,uBAAuB;AAAA,EAC3C,uBAAuB,4BAA4B,QAAQ;AAC7D,CAAC;AAMD,MAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,cAAc,EAAE,OAAO;AACzB,CAAC;AAMD,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,MAAM,EAAE,OAAO;AAAA,EACf,YAAY,EAAE,QAAQ;AACxB,CAAC;AAMM,MAAM,aAAa,EAAE,OAAO;AAAA,EACjC,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,MAAM,cAAc;AAAA,EAC7B,MAAM;AAAA,EACN,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,eAAe,EAAE,MAAM,sBAAsB,EAAE,SAAS;AAC1D,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/cart/cart-types.d.ts
CHANGED
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
import type { SellingPlanGroup } from "../loaders/loader-schemas";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
export interface CartItem {
|
|
8
|
-
merchandiseId: string;
|
|
9
|
-
quantity: number;
|
|
10
|
-
}
|
|
11
6
|
export interface Image {
|
|
12
7
|
url: string;
|
|
13
8
|
altText: string | null;
|
|
@@ -33,14 +28,6 @@ export interface CartLineAttribute {
|
|
|
33
28
|
key: string;
|
|
34
29
|
value: string | number | boolean;
|
|
35
30
|
}
|
|
36
|
-
export declare const cartLineAttributeSchema: z.ZodObject<{
|
|
37
|
-
key: z.ZodString;
|
|
38
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
export declare const cartLineAttributesSchema: z.ZodArray<z.ZodObject<{
|
|
41
|
-
key: z.ZodString;
|
|
42
|
-
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
31
|
/** Replo attribution property added to cart/buy-now line items for order attribution in Shopify. */
|
|
45
32
|
export declare const REPLO_ATTRIBUTION_PROPERTY: CartLineAttribute;
|
|
46
33
|
export interface SellingPlanPriceAdjustment {
|
|
@@ -77,10 +64,6 @@ export interface SellingPlanAllocation {
|
|
|
77
64
|
currencyCode: string;
|
|
78
65
|
};
|
|
79
66
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Common cart line attribute keys for type safety
|
|
82
|
-
*/
|
|
83
|
-
export type CartLineAttributeKey = "bundleId" | "bundleDiscount" | "isBundleItem" | "isSpecialItem" | "specialInstructions" | string;
|
|
84
67
|
export interface CartLine {
|
|
85
68
|
id: string;
|
|
86
69
|
quantity: number;
|
|
@@ -100,11 +83,6 @@ export interface CartCost {
|
|
|
100
83
|
totalAmount: number;
|
|
101
84
|
currencyCode: string;
|
|
102
85
|
}
|
|
103
|
-
export interface CartWarning {
|
|
104
|
-
code: string;
|
|
105
|
-
message: string;
|
|
106
|
-
target?: string;
|
|
107
|
-
}
|
|
108
86
|
/**
|
|
109
87
|
* Represents a discount code applied to a cart.
|
|
110
88
|
*/
|
|
@@ -127,7 +105,6 @@ export interface Cart {
|
|
|
127
105
|
lines: CartLine[];
|
|
128
106
|
cost: CartCost;
|
|
129
107
|
checkoutUrl?: string;
|
|
130
|
-
warnings?: CartWarning[];
|
|
131
108
|
discountCodes?: CartDiscountCode[];
|
|
132
109
|
}
|
|
133
110
|
export interface CartLinePayload {
|
package/cart/cart-types.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const cartLineAttributeSchema = z.object({
|
|
3
|
-
key: z.string(),
|
|
4
|
-
value: z.union([z.string(), z.number(), z.boolean()])
|
|
5
|
-
});
|
|
6
|
-
const cartLineAttributesSchema = z.array(cartLineAttributeSchema);
|
|
7
1
|
const REPLO_ATTRIBUTION_PROPERTY = {
|
|
8
2
|
key: "_replo",
|
|
9
3
|
value: "true"
|
|
10
4
|
};
|
|
11
5
|
export {
|
|
12
|
-
REPLO_ATTRIBUTION_PROPERTY
|
|
13
|
-
cartLineAttributeSchema,
|
|
14
|
-
cartLineAttributesSchema
|
|
6
|
+
REPLO_ATTRIBUTION_PROPERTY
|
|
15
7
|
};
|
|
16
8
|
//# sourceMappingURL=cart-types.js.map
|
package/cart/cart-types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../cart/cart-types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * TypeScript types for cart data structures. Use these types when working with cart data, but don't import from this module directly in components - use the cart hooks instead.\n * @module\n */\n\nimport type { SellingPlanGroup } from \"../loaders/loader-schemas\";\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * TypeScript types for cart data structures. Use these types when working with cart data, but don't import from this module directly in components - use the cart hooks instead.\n * @module\n */\n\nimport type { SellingPlanGroup } from \"../loaders/loader-schemas\";\n\nexport interface Image {\n url: string;\n altText: string | null;\n}\n\nexport interface CartLineMerchandise {\n id: string;\n product: {\n id: string;\n title: string;\n sellingPlanGroups?: SellingPlanGroup[];\n };\n title: string;\n /** Integer minor units (Stripe convention): 1999 = $19.99 USD */\n price: number;\n compareAtPrice?: number | null;\n image: Image | null;\n selectedOptions: {\n name: string;\n value: string;\n }[];\n}\n\nexport interface CartLineAttribute {\n key: string;\n value: string | number | boolean;\n}\n\n/** Replo attribution property added to cart/buy-now line items for order attribution in Shopify. */\nexport const REPLO_ATTRIBUTION_PROPERTY: CartLineAttribute = {\n key: \"_replo\",\n value: \"true\",\n};\n\nexport interface SellingPlanPriceAdjustment {\n compareAtPrice: {\n amount: number;\n currencyCode: string;\n };\n perDeliveryPrice: {\n amount: number;\n currencyCode: string;\n };\n price: {\n amount: number;\n currencyCode: string;\n };\n unitPrice: {\n amount: number;\n currencyCode: string;\n } | null;\n}\n\nexport interface SellingPlanAllocation {\n sellingPlan: {\n id: string;\n name: string;\n description: string | null;\n };\n priceAdjustments: SellingPlanPriceAdjustment[];\n checkoutChargeAmount: {\n amount: number;\n currencyCode: string;\n };\n remainingBalanceChargeAmount: {\n amount: number;\n currencyCode: string;\n };\n}\n\nexport interface CartLine {\n id: string;\n quantity: number;\n /**\n * Null when this is an optimistic line whose merchandise couldn't be\n * resolved from the query cache or passed explicitly. Consumers should\n * render a skeleton/loading state in that case; the line is replaced\n * with real merchandise once the server roundtrip lands.\n */\n merchandise: CartLineMerchandise | null;\n attributes: CartLineAttribute[];\n sellingPlanAllocation?: SellingPlanAllocation | null;\n}\n\nexport interface CartCost {\n /** Integer minor units (Stripe convention) in currencyCode */\n subtotalAmount: number;\n totalAmount: number;\n currencyCode: string;\n}\n\n/**\n * Represents a discount code applied to a cart.\n */\nexport interface CartDiscountCode {\n /** The discount code string */\n code: string;\n /**\n * Whether the discount code is applicable to the current cart.\n * A code may not be applicable due to:\n * - Cart contents not meeting product/collection eligibility\n * - Minimum purchase amount not met\n * - Code expired or usage limits reached\n * - Customer restrictions\n * - Conflicting discount rules\n */\n applicable: boolean;\n}\n\nexport interface Cart {\n id: string;\n lines: CartLine[];\n cost: CartCost;\n checkoutUrl?: string;\n discountCodes?: CartDiscountCode[];\n}\n\nexport interface CartLinePayload {\n id: string;\n quantity: number;\n merchandise?: CartLineMerchandise;\n properties?: CartLineAttribute[];\n sellingPlanId?: string | null;\n}\n\nexport interface AddToCartPayload {\n lines: CartLinePayload[];\n cartId: string;\n}\n\nexport interface UpdateCartLineItemPayload {\n line: CartLinePayload;\n cartId: string;\n}\n\nexport interface RemoveFromCartPayload {\n lineIds: string[];\n cartId: string;\n}\n\nexport interface UpdateCartDiscountCodesPayload {\n cartId: string;\n discountCodes: string[];\n}\n"],
|
|
5
|
+
"mappings": "AAoCO,MAAM,6BAAgD;AAAA,EAC3D,KAAK;AAAA,EACL,OAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,180 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/canopy-sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2-beta.pr-24916.3.6f21cf4",
|
|
4
4
|
"description": "Replo Canopy SDK — cart, analytics, data loaders, and editor runtime for agent-built Next.js sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
+
"exports": {
|
|
8
|
+
"./providers/replo-provider": {
|
|
9
|
+
"types": "./providers/replo-provider.d.ts",
|
|
10
|
+
"default": "./providers/replo-provider.js"
|
|
11
|
+
},
|
|
12
|
+
"./consent/replo-scripts": {
|
|
13
|
+
"types": "./consent/replo-scripts.d.ts",
|
|
14
|
+
"default": "./consent/replo-scripts.js"
|
|
15
|
+
},
|
|
16
|
+
"./consent/consent-store": {
|
|
17
|
+
"types": "./consent/consent-store.d.ts",
|
|
18
|
+
"default": "./consent/consent-store.js"
|
|
19
|
+
},
|
|
20
|
+
"./consent/types": {
|
|
21
|
+
"types": "./consent/types.d.ts",
|
|
22
|
+
"default": "./consent/types.js"
|
|
23
|
+
},
|
|
24
|
+
"./cart/cart-provider": {
|
|
25
|
+
"types": "./cart/cart-provider.d.ts",
|
|
26
|
+
"default": "./cart/cart-provider.js"
|
|
27
|
+
},
|
|
28
|
+
"./cart/hooks/use-add-to-cart": {
|
|
29
|
+
"types": "./cart/hooks/use-add-to-cart.d.ts",
|
|
30
|
+
"default": "./cart/hooks/use-add-to-cart.js"
|
|
31
|
+
},
|
|
32
|
+
"./cart/hooks/use-buy-now": {
|
|
33
|
+
"types": "./cart/hooks/use-buy-now.d.ts",
|
|
34
|
+
"default": "./cart/hooks/use-buy-now.js"
|
|
35
|
+
},
|
|
36
|
+
"./cart/cart-types": {
|
|
37
|
+
"types": "./cart/cart-types.d.ts",
|
|
38
|
+
"default": "./cart/cart-types.js"
|
|
39
|
+
},
|
|
40
|
+
"./cart/buy-now-action": {
|
|
41
|
+
"types": "./cart/buy-now-action.d.ts",
|
|
42
|
+
"default": "./cart/buy-now-action.js"
|
|
43
|
+
},
|
|
44
|
+
"./cart/utils/cart-utils": {
|
|
45
|
+
"types": "./cart/utils/cart-utils.d.ts",
|
|
46
|
+
"default": "./cart/utils/cart-utils.js"
|
|
47
|
+
},
|
|
48
|
+
"./cart/utils/cookie-cart-persistence": {
|
|
49
|
+
"types": "./cart/utils/cookie-cart-persistence.d.ts",
|
|
50
|
+
"default": "./cart/utils/cookie-cart-persistence.js"
|
|
51
|
+
},
|
|
52
|
+
"./cart/utils/variant-to-cart-line": {
|
|
53
|
+
"types": "./cart/utils/variant-to-cart-line.d.ts",
|
|
54
|
+
"default": "./cart/utils/variant-to-cart-line.js"
|
|
55
|
+
},
|
|
56
|
+
"./cart/gateways/cart-constants": {
|
|
57
|
+
"types": "./cart/gateways/cart-constants.d.ts",
|
|
58
|
+
"default": "./cart/gateways/cart-constants.js"
|
|
59
|
+
},
|
|
60
|
+
"./money": {
|
|
61
|
+
"types": "./money.d.ts",
|
|
62
|
+
"default": "./money.js"
|
|
63
|
+
},
|
|
64
|
+
"./hooks/use-formatted-price": {
|
|
65
|
+
"types": "./hooks/use-formatted-price.d.ts",
|
|
66
|
+
"default": "./hooks/use-formatted-price.js"
|
|
67
|
+
},
|
|
68
|
+
"./analytics/analytics-provider": {
|
|
69
|
+
"types": "./analytics/analytics-provider.d.ts",
|
|
70
|
+
"default": "./analytics/analytics-provider.js"
|
|
71
|
+
},
|
|
72
|
+
"./analytics/hooks/use-product-viewed-analytics": {
|
|
73
|
+
"types": "./analytics/hooks/use-product-viewed-analytics.d.ts",
|
|
74
|
+
"default": "./analytics/hooks/use-product-viewed-analytics.js"
|
|
75
|
+
},
|
|
76
|
+
"./loaders/collection-loader": {
|
|
77
|
+
"types": "./loaders/collection-loader.d.ts",
|
|
78
|
+
"default": "./loaders/collection-loader.js"
|
|
79
|
+
},
|
|
80
|
+
"./loaders/collection-products-loader": {
|
|
81
|
+
"types": "./loaders/collection-products-loader.d.ts",
|
|
82
|
+
"default": "./loaders/collection-products-loader.js"
|
|
83
|
+
},
|
|
84
|
+
"./loaders/contentful-entries-loader": {
|
|
85
|
+
"types": "./loaders/contentful-entries-loader.d.ts",
|
|
86
|
+
"default": "./loaders/contentful-entries-loader.js"
|
|
87
|
+
},
|
|
88
|
+
"./loaders/contentful-entry-loader": {
|
|
89
|
+
"types": "./loaders/contentful-entry-loader.d.ts",
|
|
90
|
+
"default": "./loaders/contentful-entry-loader.js"
|
|
91
|
+
},
|
|
92
|
+
"./loaders/levanta-product-loader": {
|
|
93
|
+
"types": "./loaders/levanta-product-loader.d.ts",
|
|
94
|
+
"default": "./loaders/levanta-product-loader.js"
|
|
95
|
+
},
|
|
96
|
+
"./loaders/okendo-review-aggregate-loader": {
|
|
97
|
+
"types": "./loaders/okendo-review-aggregate-loader.d.ts",
|
|
98
|
+
"default": "./loaders/okendo-review-aggregate-loader.js"
|
|
99
|
+
},
|
|
100
|
+
"./loaders/okendo-reviews-loader": {
|
|
101
|
+
"types": "./loaders/okendo-reviews-loader.d.ts",
|
|
102
|
+
"default": "./loaders/okendo-reviews-loader.js"
|
|
103
|
+
},
|
|
104
|
+
"./loaders/product-loader": {
|
|
105
|
+
"types": "./loaders/product-loader.d.ts",
|
|
106
|
+
"default": "./loaders/product-loader.js"
|
|
107
|
+
},
|
|
108
|
+
"./loaders/rebuy-recommendations-loader": {
|
|
109
|
+
"types": "./loaders/rebuy-recommendations-loader.d.ts",
|
|
110
|
+
"default": "./loaders/rebuy-recommendations-loader.js"
|
|
111
|
+
},
|
|
112
|
+
"./loaders/reviews-io-review-aggregate-loader": {
|
|
113
|
+
"types": "./loaders/reviews-io-review-aggregate-loader.d.ts",
|
|
114
|
+
"default": "./loaders/reviews-io-review-aggregate-loader.js"
|
|
115
|
+
},
|
|
116
|
+
"./loaders/reviews-io-reviews-loader": {
|
|
117
|
+
"types": "./loaders/reviews-io-reviews-loader.d.ts",
|
|
118
|
+
"default": "./loaders/reviews-io-reviews-loader.js"
|
|
119
|
+
},
|
|
120
|
+
"./loaders/smile-earning-rules-loader": {
|
|
121
|
+
"types": "./loaders/smile-earning-rules-loader.d.ts",
|
|
122
|
+
"default": "./loaders/smile-earning-rules-loader.js"
|
|
123
|
+
},
|
|
124
|
+
"./loaders/smile-rewards-loader": {
|
|
125
|
+
"types": "./loaders/smile-rewards-loader.d.ts",
|
|
126
|
+
"default": "./loaders/smile-rewards-loader.js"
|
|
127
|
+
},
|
|
128
|
+
"./loaders/smile-vip-tiers-loader": {
|
|
129
|
+
"types": "./loaders/smile-vip-tiers-loader.d.ts",
|
|
130
|
+
"default": "./loaders/smile-vip-tiers-loader.js"
|
|
131
|
+
},
|
|
132
|
+
"./loaders/statsig-experiment-loader": {
|
|
133
|
+
"types": "./loaders/statsig-experiment-loader.d.ts",
|
|
134
|
+
"default": "./loaders/statsig-experiment-loader.js"
|
|
135
|
+
},
|
|
136
|
+
"./loaders/yotpo-review-aggregate-loader": {
|
|
137
|
+
"types": "./loaders/yotpo-review-aggregate-loader.d.ts",
|
|
138
|
+
"default": "./loaders/yotpo-review-aggregate-loader.js"
|
|
139
|
+
},
|
|
140
|
+
"./loaders/yotpo-reviews-loader": {
|
|
141
|
+
"types": "./loaders/yotpo-reviews-loader.d.ts",
|
|
142
|
+
"default": "./loaders/yotpo-reviews-loader.js"
|
|
143
|
+
},
|
|
144
|
+
"./loaders/prefetch-loaders": {
|
|
145
|
+
"types": "./loaders/prefetch-loaders.d.ts",
|
|
146
|
+
"default": "./loaders/prefetch-loaders.js"
|
|
147
|
+
},
|
|
148
|
+
"./loaders/loader-keys": {
|
|
149
|
+
"types": "./loaders/loader-keys.d.ts",
|
|
150
|
+
"default": "./loaders/loader-keys.js"
|
|
151
|
+
},
|
|
152
|
+
"./loaders/loader-schemas": {
|
|
153
|
+
"types": "./loaders/loader-schemas.d.ts",
|
|
154
|
+
"default": "./loaders/loader-schemas.js"
|
|
155
|
+
},
|
|
156
|
+
"./loaders/product-loader-args": {
|
|
157
|
+
"types": "./loaders/product-loader-args.d.ts",
|
|
158
|
+
"default": "./loaders/product-loader-args.js"
|
|
159
|
+
},
|
|
160
|
+
"./next/config": {
|
|
161
|
+
"types": "./next/config.d.ts",
|
|
162
|
+
"default": "./next/config.js"
|
|
163
|
+
},
|
|
164
|
+
"./next/image-loader": {
|
|
165
|
+
"types": "./next/image-loader.d.ts",
|
|
166
|
+
"default": "./next/image-loader.js"
|
|
167
|
+
},
|
|
168
|
+
"./next/open-next": {
|
|
169
|
+
"types": "./next/open-next.d.ts",
|
|
170
|
+
"default": "./next/open-next.js"
|
|
171
|
+
},
|
|
172
|
+
"./_vendor/schemas/loaderKeys": {
|
|
173
|
+
"types": "./_vendor/schemas/loaderKeys.d.ts",
|
|
174
|
+
"default": "./_vendor/schemas/loaderKeys.mjs"
|
|
175
|
+
},
|
|
176
|
+
"./package.json": "./package.json"
|
|
177
|
+
},
|
|
7
178
|
"dependencies": {
|
|
8
179
|
"@tiptap/core": "^2.25.0",
|
|
9
180
|
"@tiptap/extension-bold": "^2.25.0",
|
|
@@ -27,10 +198,6 @@
|
|
|
27
198
|
"react": ">=18.2.0",
|
|
28
199
|
"react-dom": ">=18.2.0"
|
|
29
200
|
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"registry": "https://registry.npmjs.org/",
|
|
32
|
-
"access": "restricted"
|
|
33
|
-
},
|
|
34
201
|
"engines": {
|
|
35
202
|
"node": "22.x"
|
|
36
203
|
}
|