@replohq/canopy-sdk 0.9.0 → 0.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/_vendor/replo-utils/lib/fonts.mjs +106 -1
- package/_vendor/replo-utils/lib/json.mjs +2 -1
- package/_vendor/replo-utils/lib/misc.mjs +3 -2
- package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.mjs +1 -1
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +2 -2
- package/_vendor/schemas/cart.mjs +4 -4
- package/_vendor/schemas/errors.d.ts +10 -0
- package/_vendor/schemas/errors.mjs +14 -42
- package/_vendor/schemas/objectType.d.ts +35 -0
- package/_vendor/schemas/objectType.mjs +2 -2
- package/_vendor/schemas/registry.d.ts +42 -72
- package/_vendor/schemas/selectMode.mjs +3 -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-AG47B4AR.mjs → chunk-A7EUNWRQ.mjs} +56 -32
- package/{chunk-GV5FY7ZZ.mjs → chunk-FNTGY7I5.mjs} +1 -22
- package/chunk-ILGEM42C.mjs +24 -0
- package/chunk-QFYIXADC.mjs +42 -0
- package/{chunk-LALXJRJ6.mjs → chunk-RUJDCFMG.mjs} +2 -1
- package/env.js +2 -2
- package/env.js.map +2 -2
- package/hooks/use-client-value.js.map +2 -2
- 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
|
@@ -1,3 +1,108 @@
|
|
|
1
|
+
import { toString_default } from '../../../chunk-QFYIXADC.mjs';
|
|
2
|
+
import '../../../chunk-FNTGY7I5.mjs';
|
|
3
|
+
|
|
4
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSlice.js
|
|
5
|
+
function baseSlice(array, start, end) {
|
|
6
|
+
var index = -1, length = array.length;
|
|
7
|
+
if (start < 0) {
|
|
8
|
+
start = -start > length ? 0 : length + start;
|
|
9
|
+
}
|
|
10
|
+
end = end > length ? length : end;
|
|
11
|
+
if (end < 0) {
|
|
12
|
+
end += length;
|
|
13
|
+
}
|
|
14
|
+
length = start > end ? 0 : end - start >>> 0;
|
|
15
|
+
start >>>= 0;
|
|
16
|
+
var result = Array(length);
|
|
17
|
+
while (++index < length) {
|
|
18
|
+
result[index] = array[index + start];
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
var baseSlice_default = baseSlice;
|
|
23
|
+
|
|
24
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castSlice.js
|
|
25
|
+
function castSlice(array, start, end) {
|
|
26
|
+
var length = array.length;
|
|
27
|
+
end = end === void 0 ? length : end;
|
|
28
|
+
return !start && end >= length ? array : baseSlice_default(array, start, end);
|
|
29
|
+
}
|
|
30
|
+
var castSlice_default = castSlice;
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasUnicode.js
|
|
33
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
34
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
35
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
36
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
37
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
38
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
39
|
+
var rsZWJ = "\\u200d";
|
|
40
|
+
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
41
|
+
function hasUnicode(string) {
|
|
42
|
+
return reHasUnicode.test(string);
|
|
43
|
+
}
|
|
44
|
+
var hasUnicode_default = hasUnicode;
|
|
45
|
+
|
|
46
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_asciiToArray.js
|
|
47
|
+
function asciiToArray(string) {
|
|
48
|
+
return string.split("");
|
|
49
|
+
}
|
|
50
|
+
var asciiToArray_default = asciiToArray;
|
|
51
|
+
|
|
52
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_unicodeToArray.js
|
|
53
|
+
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
54
|
+
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
55
|
+
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
56
|
+
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
57
|
+
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
58
|
+
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
59
|
+
var rsAstral = "[" + rsAstralRange2 + "]";
|
|
60
|
+
var rsCombo = "[" + rsComboRange2 + "]";
|
|
61
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
62
|
+
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
63
|
+
var rsNonAstral = "[^" + rsAstralRange2 + "]";
|
|
64
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
65
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
66
|
+
var rsZWJ2 = "\\u200d";
|
|
67
|
+
var reOptMod = rsModifier + "?";
|
|
68
|
+
var rsOptVar = "[" + rsVarRange2 + "]?";
|
|
69
|
+
var rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
70
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
71
|
+
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
72
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
73
|
+
function unicodeToArray(string) {
|
|
74
|
+
return string.match(reUnicode) || [];
|
|
75
|
+
}
|
|
76
|
+
var unicodeToArray_default = unicodeToArray;
|
|
77
|
+
|
|
78
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToArray.js
|
|
79
|
+
function stringToArray(string) {
|
|
80
|
+
return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
|
|
81
|
+
}
|
|
82
|
+
var stringToArray_default = stringToArray;
|
|
83
|
+
|
|
84
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createCaseFirst.js
|
|
85
|
+
function createCaseFirst(methodName) {
|
|
86
|
+
return function(string) {
|
|
87
|
+
string = toString_default(string);
|
|
88
|
+
var strSymbols = hasUnicode_default(string) ? stringToArray_default(string) : void 0;
|
|
89
|
+
var chr = strSymbols ? strSymbols[0] : string.charAt(0);
|
|
90
|
+
var trailing = strSymbols ? castSlice_default(strSymbols, 1).join("") : string.slice(1);
|
|
91
|
+
return chr[methodName]() + trailing;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
var createCaseFirst_default = createCaseFirst;
|
|
95
|
+
|
|
96
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/upperFirst.js
|
|
97
|
+
var upperFirst = createCaseFirst_default("toUpperCase");
|
|
98
|
+
var upperFirst_default = upperFirst;
|
|
99
|
+
|
|
100
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/capitalize.js
|
|
101
|
+
function capitalize(string) {
|
|
102
|
+
return upperFirst_default(toString_default(string).toLowerCase());
|
|
103
|
+
}
|
|
104
|
+
var capitalize_default = capitalize;
|
|
105
|
+
|
|
1
106
|
// ../replo-utils/lib/fonts.ts
|
|
2
107
|
function slugifyFontFamily(family) {
|
|
3
108
|
return family.replace(/([a-z])([A-Z])/g, "$1-$2").split(/[\s_-]+/u).map((word) => word.toLowerCase()).join("-");
|
|
@@ -11,7 +116,7 @@ function quoteFontFamily(family) {
|
|
|
11
116
|
function fontNameToVariableName(fontName) {
|
|
12
117
|
const words = fontName.replace(/([a-z])([A-Z])/g, "$1 $2").split(/[\s_-]+/u);
|
|
13
118
|
return words.map((word, index) => {
|
|
14
|
-
return index === 0 ? word.toLowerCase() :
|
|
119
|
+
return index === 0 ? word.toLowerCase() : capitalize_default(word);
|
|
15
120
|
}).join("");
|
|
16
121
|
}
|
|
17
122
|
function buildGoogleFontsCssUrl(family, weights) {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, warning } from '../../../chunk-
|
|
2
|
-
export { isNumber_default as isNumber, isString_default as isString } from '../../../chunk-
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isFunction_default as isFunction, isNotNullish, isNullish, isPrimitive, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, warning } from '../../../chunk-RUJDCFMG.mjs';
|
|
2
|
+
export { isNumber_default as isNumber, isString_default as isString } from '../../../chunk-ILGEM42C.mjs';
|
|
3
|
+
import '../../../chunk-FNTGY7I5.mjs';
|
|
@@ -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({
|
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 };
|
|
@@ -43,6 +43,16 @@ export declare abstract class ReploError extends Error {
|
|
|
43
43
|
id: string;
|
|
44
44
|
constructor(config: ReploErrorConfig);
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Wraps an error so `async-retry` stops immediately instead of scheduling
|
|
48
|
+
* another attempt: the library rejects with any thrown error carrying a truthy
|
|
49
|
+
* `bail` property. Preserves the underlying error's message and keeps it as the
|
|
50
|
+
* cause so callers still surface the real failure.
|
|
51
|
+
*/
|
|
52
|
+
export declare class AsyncRetryBailError extends ReploError {
|
|
53
|
+
readonly bail = true;
|
|
54
|
+
constructor(cause: unknown);
|
|
55
|
+
}
|
|
46
56
|
export type AuthErrorType = "unauthenticated" | "unauthorized" | "notFound";
|
|
47
57
|
export type ReploAuthenticationErrorConfig = {
|
|
48
58
|
message: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isSymbol_default, toString_default } from '../../chunk-QFYIXADC.mjs';
|
|
2
|
+
import { MapCache_default, exhaustiveSwitch, hasOwnProperty, identity_default, baseFor_default, keys_default, Stack_default, isLength_default, isIndex_default, isArguments_default, getTag_default, isBuffer_default, isTypedArray_default, eq_default, Uint8Array_default, getAllKeys_default, baseAssignValue_default } from '../../chunk-RUJDCFMG.mjs';
|
|
3
|
+
import { isObject_default } from '../../chunk-ILGEM42C.mjs';
|
|
4
|
+
import { Symbol_default, isArray_default, isObjectLike_default } from '../../chunk-FNTGY7I5.mjs';
|
|
3
5
|
import { z, ZodError } from 'zod';
|
|
4
6
|
|
|
5
7
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js
|
|
@@ -360,13 +362,6 @@ function baseMatches(source) {
|
|
|
360
362
|
}
|
|
361
363
|
var baseMatches_default = baseMatches;
|
|
362
364
|
|
|
363
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
|
|
364
|
-
var symbolTag2 = "[object Symbol]";
|
|
365
|
-
function isSymbol(value) {
|
|
366
|
-
return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag2;
|
|
367
|
-
}
|
|
368
|
-
var isSymbol_default = isSymbol;
|
|
369
|
-
|
|
370
365
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
|
|
371
366
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
372
367
|
var reIsPlainProp = /^\w*$/;
|
|
@@ -432,38 +427,6 @@ var stringToPath = memoizeCapped_default(function(string) {
|
|
|
432
427
|
});
|
|
433
428
|
var stringToPath_default = stringToPath;
|
|
434
429
|
|
|
435
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
|
|
436
|
-
function arrayMap(array, iteratee) {
|
|
437
|
-
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
438
|
-
while (++index < length) {
|
|
439
|
-
result[index] = iteratee(array[index], index, array);
|
|
440
|
-
}
|
|
441
|
-
return result;
|
|
442
|
-
}
|
|
443
|
-
var arrayMap_default = arrayMap;
|
|
444
|
-
var symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
|
|
445
|
-
var symbolToString = symbolProto2 ? symbolProto2.toString : void 0;
|
|
446
|
-
function baseToString(value) {
|
|
447
|
-
if (typeof value == "string") {
|
|
448
|
-
return value;
|
|
449
|
-
}
|
|
450
|
-
if (isArray_default(value)) {
|
|
451
|
-
return arrayMap_default(value, baseToString) + "";
|
|
452
|
-
}
|
|
453
|
-
if (isSymbol_default(value)) {
|
|
454
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
455
|
-
}
|
|
456
|
-
var result = value + "";
|
|
457
|
-
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
458
|
-
}
|
|
459
|
-
var baseToString_default = baseToString;
|
|
460
|
-
|
|
461
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
|
|
462
|
-
function toString(value) {
|
|
463
|
-
return value == null ? "" : baseToString_default(value);
|
|
464
|
-
}
|
|
465
|
-
var toString_default = toString;
|
|
466
|
-
|
|
467
430
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
|
|
468
431
|
function castPath(value, object) {
|
|
469
432
|
if (isArray_default(value)) {
|
|
@@ -619,6 +582,15 @@ var ReploError = class _ReploError extends Error {
|
|
|
619
582
|
}
|
|
620
583
|
}
|
|
621
584
|
};
|
|
585
|
+
var AsyncRetryBailError = class extends ReploError {
|
|
586
|
+
bail = true;
|
|
587
|
+
constructor(cause) {
|
|
588
|
+
super({
|
|
589
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
590
|
+
cause
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
};
|
|
622
594
|
var ReploAuthenticationError = class extends ReploError {
|
|
623
595
|
type;
|
|
624
596
|
userFacingDetails;
|
|
@@ -957,4 +929,4 @@ var MiniappRpcRemoteError = class extends MiniappRpcError {
|
|
|
957
929
|
var MiniappRpcUnmountedError = class extends MiniappRpcError {
|
|
958
930
|
};
|
|
959
931
|
|
|
960
|
-
export { CUSTOM_ERROR_KEY_TO_PROPS, CloudflareAgentCoordinatorRpcError, DEFAULT_ERROR_MESSAGE_CONFIG, MiniappRpcError, MiniappRpcRemoteError, MiniappRpcTimeoutError, MiniappRpcUnmountedError, ReploAuthenticationError, ReploError, ReploHTTPError, ReploRawHTTPError, ReploValidationError, Uncommon_GloballyMappedError, UnexpectedMutationError, UnexpectedRawGraphqlClientError, addErrorIdIfNeeded, errorUserFacingDetailsMessageSchema, errorUserFacingDetailsSchema, extractErrorId, extractErrorTrackingEventDetails, shouldReportErrorToSentry };
|
|
932
|
+
export { AsyncRetryBailError, CUSTOM_ERROR_KEY_TO_PROPS, CloudflareAgentCoordinatorRpcError, DEFAULT_ERROR_MESSAGE_CONFIG, MiniappRpcError, MiniappRpcRemoteError, MiniappRpcTimeoutError, MiniappRpcUnmountedError, ReploAuthenticationError, ReploError, ReploHTTPError, ReploRawHTTPError, ReploValidationError, Uncommon_GloballyMappedError, UnexpectedMutationError, UnexpectedRawGraphqlClientError, addErrorIdIfNeeded, errorUserFacingDetailsMessageSchema, errorUserFacingDetailsSchema, extractErrorId, extractErrorTrackingEventDetails, shouldReportErrorToSentry };
|
|
@@ -311,6 +311,19 @@ export declare const collectionSchema: z.ZodObject<{
|
|
|
311
311
|
height: z.ZodNullable<z.ZodNumber>;
|
|
312
312
|
}, z.core.$strip>>>;
|
|
313
313
|
}, z.core.$strip>;
|
|
314
|
+
export declare const discountCodeSchema: z.ZodObject<{
|
|
315
|
+
id: z.ZodString;
|
|
316
|
+
codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
317
|
+
title: z.ZodOptional<z.ZodString>;
|
|
318
|
+
status: z.ZodOptional<z.ZodString>;
|
|
319
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
|
+
discountType: z.ZodOptional<z.ZodString>;
|
|
321
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
322
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
usageLimit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
324
|
+
usageCount: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
appliesOncePerCustomer: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
}, z.core.$strip>;
|
|
314
327
|
export declare const assetSchema: z.ZodObject<{
|
|
315
328
|
id: z.ZodString;
|
|
316
329
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -451,6 +464,7 @@ export declare const planSchema: z.ZodObject<{
|
|
|
451
464
|
}, z.core.$strip>;
|
|
452
465
|
export type Product = z.infer<typeof productSchema>;
|
|
453
466
|
export type Collection = z.infer<typeof collectionSchema>;
|
|
467
|
+
export type DiscountCode = z.infer<typeof discountCodeSchema>;
|
|
454
468
|
export type Variant = z.infer<typeof variantSchema>;
|
|
455
469
|
export type Media = z.infer<typeof mediaSchema>;
|
|
456
470
|
export type Metafield = z.infer<typeof metafieldSchema>;
|
|
@@ -647,6 +661,27 @@ declare const OBJECT_TYPE_REGISTRY: {
|
|
|
647
661
|
}, z.core.$strip>;
|
|
648
662
|
mentionable: true;
|
|
649
663
|
};
|
|
664
|
+
discountCode: {
|
|
665
|
+
type: string;
|
|
666
|
+
displayName: string;
|
|
667
|
+
identifiers: {
|
|
668
|
+
primaryId: string;
|
|
669
|
+
};
|
|
670
|
+
canonicalSchema: z.ZodObject<{
|
|
671
|
+
id: z.ZodString;
|
|
672
|
+
codes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
673
|
+
title: z.ZodOptional<z.ZodString>;
|
|
674
|
+
status: z.ZodOptional<z.ZodString>;
|
|
675
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
676
|
+
discountType: z.ZodOptional<z.ZodString>;
|
|
677
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
678
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
679
|
+
usageLimit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
680
|
+
usageCount: z.ZodOptional<z.ZodNumber>;
|
|
681
|
+
appliesOncePerCustomer: z.ZodOptional<z.ZodBoolean>;
|
|
682
|
+
}, z.core.$strip>;
|
|
683
|
+
mentionable: true;
|
|
684
|
+
};
|
|
650
685
|
variant: {
|
|
651
686
|
type: string;
|
|
652
687
|
displayName: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { assetSchema, collectionSchema, customerIoBroadcastSchema, customerIoCampaignSchema, customerIoSegmentSchema, 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';
|
|
@@ -72,20 +72,15 @@ export declare const productRegistryItemMetadataSchema: z.ZodObject<{
|
|
|
72
72
|
provider: z.ZodString;
|
|
73
73
|
providerDisplayName: z.ZodString;
|
|
74
74
|
providerProductId: z.ZodString;
|
|
75
|
-
|
|
76
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
type: z.ZodString;
|
|
77
76
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
78
77
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, z.core.$strict>;
|
|
86
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
87
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
88
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
78
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
79
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
80
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
values: z.ZodArray<z.ZodString>;
|
|
83
|
+
}, z.core.$strict>>>;
|
|
89
84
|
}, z.core.$strict>;
|
|
90
85
|
export declare const genericRegistryItemMetadataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
91
86
|
brandName: z.ZodOptional<z.ZodString>;
|
|
@@ -121,20 +116,15 @@ export declare const genericRegistryItemMetadataSchema: z.ZodUnion<readonly [z.Z
|
|
|
121
116
|
provider: z.ZodString;
|
|
122
117
|
providerDisplayName: z.ZodString;
|
|
123
118
|
providerProductId: z.ZodString;
|
|
124
|
-
|
|
125
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
type: z.ZodString;
|
|
126
120
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
127
121
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, z.core.$strict>;
|
|
135
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
137
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
122
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
124
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
values: z.ZodArray<z.ZodString>;
|
|
127
|
+
}, z.core.$strict>>>;
|
|
138
128
|
}, z.core.$strict>]>;
|
|
139
129
|
export declare const registryItemMetadataSchema: z.ZodObject<{
|
|
140
130
|
id: z.ZodString;
|
|
@@ -183,20 +173,15 @@ export declare const registryItemMetadataSchema: z.ZodObject<{
|
|
|
183
173
|
provider: z.ZodString;
|
|
184
174
|
providerDisplayName: z.ZodString;
|
|
185
175
|
providerProductId: z.ZodString;
|
|
186
|
-
|
|
187
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
176
|
+
type: z.ZodString;
|
|
188
177
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
189
178
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}, z.core.$strict>;
|
|
197
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
198
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
199
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
179
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
180
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
181
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
values: z.ZodArray<z.ZodString>;
|
|
184
|
+
}, z.core.$strict>>>;
|
|
200
185
|
}, z.core.$strict>]>>;
|
|
201
186
|
projectId: z.ZodNullable<z.ZodString>;
|
|
202
187
|
createdBy: z.ZodNullable<z.ZodString>;
|
|
@@ -259,20 +244,15 @@ export declare const registryListItemsResultSchema: z.ZodObject<{
|
|
|
259
244
|
provider: z.ZodString;
|
|
260
245
|
providerDisplayName: z.ZodString;
|
|
261
246
|
providerProductId: z.ZodString;
|
|
262
|
-
|
|
263
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
247
|
+
type: z.ZodString;
|
|
264
248
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
265
249
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}, z.core.$strict>;
|
|
273
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
274
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
275
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
250
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
251
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
252
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
values: z.ZodArray<z.ZodString>;
|
|
255
|
+
}, z.core.$strict>>>;
|
|
276
256
|
}, z.core.$strict>]>>;
|
|
277
257
|
projectId: z.ZodNullable<z.ZodString>;
|
|
278
258
|
createdBy: z.ZodNullable<z.ZodString>;
|
|
@@ -342,20 +322,15 @@ export declare const registryItemDetailSchema: z.ZodObject<{
|
|
|
342
322
|
provider: z.ZodString;
|
|
343
323
|
providerDisplayName: z.ZodString;
|
|
344
324
|
providerProductId: z.ZodString;
|
|
345
|
-
|
|
346
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
type: z.ZodString;
|
|
347
326
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
348
327
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}, z.core.$strict>;
|
|
356
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
357
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
358
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
328
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
329
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
330
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
331
|
+
name: z.ZodString;
|
|
332
|
+
values: z.ZodArray<z.ZodString>;
|
|
333
|
+
}, z.core.$strict>>>;
|
|
359
334
|
}, z.core.$strict>]>>;
|
|
360
335
|
projectId: z.ZodNullable<z.ZodString>;
|
|
361
336
|
createdBy: z.ZodNullable<z.ZodString>;
|
|
@@ -419,20 +394,15 @@ export declare const registryItemPreviewResultSchema: z.ZodObject<{
|
|
|
419
394
|
provider: z.ZodString;
|
|
420
395
|
providerDisplayName: z.ZodString;
|
|
421
396
|
providerProductId: z.ZodString;
|
|
422
|
-
|
|
423
|
-
productTypeName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
397
|
+
type: z.ZodString;
|
|
424
398
|
categoryIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
425
399
|
defaultVariantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}, z.core.$strict>;
|
|
433
|
-
techniques: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
434
|
-
colors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
435
|
-
sizes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
400
|
+
areaCount: z.ZodDefault<z.ZodNumber>;
|
|
401
|
+
methods: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
402
|
+
optionFacets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
403
|
+
name: z.ZodString;
|
|
404
|
+
values: z.ZodArray<z.ZodString>;
|
|
405
|
+
}, z.core.$strict>>>;
|
|
436
406
|
}, z.core.$strict>]>>;
|
|
437
407
|
sourceType: z.ZodNullable<z.ZodString>;
|
|
438
408
|
sourceKey: z.ZodNullable<z.ZodString>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseJsonOrNull } from '../../chunk-VKO7P3ED.mjs';
|
|
2
|
-
import { exhaustiveSwitch } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import { exhaustiveSwitch } from '../../chunk-RUJDCFMG.mjs';
|
|
3
|
+
import '../../chunk-ILGEM42C.mjs';
|
|
4
|
+
import '../../chunk-FNTGY7I5.mjs';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
6
7
|
// ../replo-utils/lib/parse.ts
|
|
@@ -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");
|
|
@@ -50,20 +50,14 @@ var productRegistryItemMetadataSchema = z.object({
|
|
|
50
50
|
provider: z.string(),
|
|
51
51
|
providerDisplayName: z.string(),
|
|
52
52
|
providerProductId: z.string(),
|
|
53
|
-
|
|
54
|
-
productTypeName: z.string().nullable().default(null),
|
|
53
|
+
type: z.string(),
|
|
55
54
|
categoryIds: z.array(z.string()).default([]),
|
|
56
|
-
defaultVariantId: z.string().
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
variantEditing: z.boolean()
|
|
63
|
-
}).strict(),
|
|
64
|
-
techniques: z.array(z.string()).default([]),
|
|
65
|
-
colors: z.array(z.string()).default([]),
|
|
66
|
-
sizes: z.array(z.string()).default([])
|
|
55
|
+
defaultVariantId: z.string().nullish(),
|
|
56
|
+
areaCount: z.number().default(0),
|
|
57
|
+
methods: z.array(z.string()).default([]),
|
|
58
|
+
optionFacets: z.array(
|
|
59
|
+
z.object({ name: z.string(), values: z.array(z.string()) }).strict()
|
|
60
|
+
).default([])
|
|
67
61
|
}).strict().describe("ProductRegistryItemMetadata");
|
|
68
62
|
var genericRegistryItemMetadataSchema = z.union([
|
|
69
63
|
siteRegistryItemMetadataSchema,
|
|
@@ -186,13 +180,13 @@ z.object({
|
|
|
186
180
|
}).describe("RegistryCreateItemOutput");
|
|
187
181
|
z.object({
|
|
188
182
|
name: z.string().min(1),
|
|
189
|
-
description: z.string().
|
|
190
|
-
metadata: z.record(z.string(), z.unknown()).
|
|
183
|
+
description: z.string().nullish(),
|
|
184
|
+
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
191
185
|
visibility: registryItemVisibilitySchema.optional(),
|
|
192
186
|
tags: z.array(z.string()).optional(),
|
|
193
|
-
category: z.string().
|
|
187
|
+
category: z.string().nullish(),
|
|
194
188
|
previewUrls: z.array(z.string()).optional(),
|
|
195
|
-
previewHtml: z.string().
|
|
189
|
+
previewHtml: z.string().nullish(),
|
|
196
190
|
files: registryContentFilesSchema,
|
|
197
191
|
dependencies: z.array(z.string()).optional()
|
|
198
192
|
}).describe("RegistryCatalogUpsertInput");
|
|
@@ -307,21 +301,21 @@ var variantSchema = z.object({
|
|
|
307
301
|
id: z.string(),
|
|
308
302
|
title: z.string().optional(),
|
|
309
303
|
availableForSale: z.boolean().optional(),
|
|
310
|
-
sku: z.string().
|
|
304
|
+
sku: z.string().nullish(),
|
|
311
305
|
selectedOptions: z.array(selectedOptionSchema).optional(),
|
|
312
|
-
image: imageSchema.
|
|
306
|
+
image: imageSchema.nullish(),
|
|
313
307
|
price: priceSchema.optional(),
|
|
314
|
-
compareAtPrice: priceSchema.
|
|
308
|
+
compareAtPrice: priceSchema.nullish(),
|
|
315
309
|
sellingPlanIds: z.array(z.string()).optional()
|
|
316
310
|
});
|
|
317
311
|
var productSchema = z.object({
|
|
318
312
|
id: z.string(),
|
|
319
313
|
handle: z.string().optional(),
|
|
320
314
|
title: z.string().optional(),
|
|
321
|
-
description: z.string().
|
|
322
|
-
descriptionHtml: z.string().
|
|
315
|
+
description: z.string().nullish(),
|
|
316
|
+
descriptionHtml: z.string().nullish(),
|
|
323
317
|
availableForSale: z.boolean().optional(),
|
|
324
|
-
featuredImage: imageSchema.
|
|
318
|
+
featuredImage: imageSchema.nullish(),
|
|
325
319
|
options: z.array(productOptionSchema).optional(),
|
|
326
320
|
variants: z.array(variantSchema).optional(),
|
|
327
321
|
minPrice: priceSchema.optional(),
|
|
@@ -333,8 +327,8 @@ var productSchema = z.object({
|
|
|
333
327
|
compareAtMaxPrice: priceSchema.optional(),
|
|
334
328
|
images: z.array(imageSchema).optional(),
|
|
335
329
|
media: z.array(mediaSchema).optional(),
|
|
336
|
-
vendor: z.string().
|
|
337
|
-
productType: z.string().
|
|
330
|
+
vendor: z.string().nullish(),
|
|
331
|
+
productType: z.string().nullish(),
|
|
338
332
|
tags: z.array(z.string()).optional(),
|
|
339
333
|
sellingPlanGroups: z.array(sellingPlanGroupSchema).optional(),
|
|
340
334
|
metafields: z.array(metafieldSchema).optional()
|
|
@@ -343,8 +337,29 @@ var collectionSchema = z.object({
|
|
|
343
337
|
id: z.string(),
|
|
344
338
|
handle: z.string().optional(),
|
|
345
339
|
title: z.string().optional(),
|
|
346
|
-
descriptionHtml: z.string().
|
|
347
|
-
image: imageSchema.
|
|
340
|
+
descriptionHtml: z.string().nullish(),
|
|
341
|
+
image: imageSchema.nullish()
|
|
342
|
+
});
|
|
343
|
+
var discountCodeSchema = z.object({
|
|
344
|
+
id: z.string(),
|
|
345
|
+
// The redeemable code(s) customers enter at checkout. A single Shopify
|
|
346
|
+
// discount can expose more than one code, so this is an array.
|
|
347
|
+
codes: z.array(z.string()).optional(),
|
|
348
|
+
// The merchant-facing discount name, which is distinct from the code itself.
|
|
349
|
+
title: z.string().optional(),
|
|
350
|
+
// Shopify DiscountStatus: ACTIVE, EXPIRED, or SCHEDULED. Kept as a string so
|
|
351
|
+
// new Shopify statuses do not break parsing.
|
|
352
|
+
status: z.string().optional(),
|
|
353
|
+
// Human-readable explanation of the discount (e.g. "20% off all products").
|
|
354
|
+
summary: z.string().nullish(),
|
|
355
|
+
// Shopify discount union type: DiscountCodeBasic, DiscountCodeBxgy,
|
|
356
|
+
// DiscountCodeFreeShipping, or DiscountCodeApp.
|
|
357
|
+
discountType: z.string().optional(),
|
|
358
|
+
startsAt: z.string().nullish(),
|
|
359
|
+
endsAt: z.string().nullish(),
|
|
360
|
+
usageLimit: z.number().nullish(),
|
|
361
|
+
usageCount: z.number().optional(),
|
|
362
|
+
appliesOncePerCustomer: z.boolean().optional()
|
|
348
363
|
});
|
|
349
364
|
var assetSchema = z.object({
|
|
350
365
|
id: z.string(),
|
|
@@ -412,11 +427,11 @@ var levantaProductSchema = z.object({
|
|
|
412
427
|
commission: z.string().optional().describe(
|
|
413
428
|
'Creator commission rate as a decimal string percentage (e.g. "8.5" meaning 8.5%).'
|
|
414
429
|
),
|
|
415
|
-
imageUrl: z.string().
|
|
416
|
-
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(),
|
|
417
432
|
inStock: z.boolean().optional(),
|
|
418
433
|
marketplace: z.string().optional(),
|
|
419
|
-
affiliateLink: levantaAffiliateLinkSchema.
|
|
434
|
+
affiliateLink: levantaAffiliateLinkSchema.nullish()
|
|
420
435
|
}).describe("LevantaProduct");
|
|
421
436
|
var intelligemsExperienceSchema = z.object({
|
|
422
437
|
id: z.string(),
|
|
@@ -493,6 +508,15 @@ var OBJECT_TYPE_REGISTRY = {
|
|
|
493
508
|
canonicalSchema: collectionSchema,
|
|
494
509
|
mentionable: true
|
|
495
510
|
},
|
|
511
|
+
discountCode: {
|
|
512
|
+
type: "discountCode",
|
|
513
|
+
displayName: "Discount Code",
|
|
514
|
+
identifiers: {
|
|
515
|
+
primaryId: "id"
|
|
516
|
+
},
|
|
517
|
+
canonicalSchema: discountCodeSchema,
|
|
518
|
+
mentionable: true
|
|
519
|
+
},
|
|
496
520
|
variant: {
|
|
497
521
|
type: "variant",
|
|
498
522
|
displayName: "Variant",
|
|
@@ -738,4 +762,4 @@ function transformReploProductToCanonical(product) {
|
|
|
738
762
|
};
|
|
739
763
|
}
|
|
740
764
|
|
|
741
|
-
export { assetSchema, collectionSchema, customerIoBroadcastSchema, customerIoCampaignSchema, customerIoSegmentSchema, 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 };
|
|
765
|
+
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 };
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
|
|
2
|
-
function isObject(value) {
|
|
3
|
-
var type = typeof value;
|
|
4
|
-
return value != null && (type == "object" || type == "function");
|
|
5
|
-
}
|
|
6
|
-
var isObject_default = isObject;
|
|
7
|
-
|
|
8
1
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
|
|
9
2
|
var isArray = Array.isArray;
|
|
10
3
|
var isArray_default = isArray;
|
|
@@ -72,18 +65,4 @@ function isObjectLike(value) {
|
|
|
72
65
|
}
|
|
73
66
|
var isObjectLike_default = isObjectLike;
|
|
74
67
|
|
|
75
|
-
|
|
76
|
-
var numberTag = "[object Number]";
|
|
77
|
-
function isNumber(value) {
|
|
78
|
-
return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag;
|
|
79
|
-
}
|
|
80
|
-
var isNumber_default = isNumber;
|
|
81
|
-
|
|
82
|
-
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js
|
|
83
|
-
var stringTag = "[object String]";
|
|
84
|
-
function isString(value) {
|
|
85
|
-
return typeof value == "string" || !isArray_default(value) && isObjectLike_default(value) && baseGetTag_default(value) == stringTag;
|
|
86
|
-
}
|
|
87
|
-
var isString_default = isString;
|
|
88
|
-
|
|
89
|
-
export { Symbol_default, baseGetTag_default, freeGlobal_default, isArray_default, isNumber_default, isObjectLike_default, isObject_default, isString_default, root_default };
|
|
68
|
+
export { Symbol_default, baseGetTag_default, freeGlobal_default, isArray_default, isObjectLike_default, root_default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isObjectLike_default, baseGetTag_default, isArray_default } from './chunk-FNTGY7I5.mjs';
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
var type = typeof value;
|
|
6
|
+
return value != null && (type == "object" || type == "function");
|
|
7
|
+
}
|
|
8
|
+
var isObject_default = isObject;
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isNumber.js
|
|
11
|
+
var numberTag = "[object Number]";
|
|
12
|
+
function isNumber(value) {
|
|
13
|
+
return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag;
|
|
14
|
+
}
|
|
15
|
+
var isNumber_default = isNumber;
|
|
16
|
+
|
|
17
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js
|
|
18
|
+
var stringTag = "[object String]";
|
|
19
|
+
function isString(value) {
|
|
20
|
+
return typeof value == "string" || !isArray_default(value) && isObjectLike_default(value) && baseGetTag_default(value) == stringTag;
|
|
21
|
+
}
|
|
22
|
+
var isString_default = isString;
|
|
23
|
+
|
|
24
|
+
export { isNumber_default, isObject_default, isString_default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Symbol_default, isObjectLike_default, baseGetTag_default, isArray_default } from './chunk-FNTGY7I5.mjs';
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js
|
|
4
|
+
function arrayMap(array, iteratee) {
|
|
5
|
+
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
6
|
+
while (++index < length) {
|
|
7
|
+
result[index] = iteratee(array[index], index, array);
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
var arrayMap_default = arrayMap;
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js
|
|
14
|
+
var symbolTag = "[object Symbol]";
|
|
15
|
+
function isSymbol(value) {
|
|
16
|
+
return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
|
|
17
|
+
}
|
|
18
|
+
var isSymbol_default = isSymbol;
|
|
19
|
+
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
|
|
20
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
21
|
+
function baseToString(value) {
|
|
22
|
+
if (typeof value == "string") {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (isArray_default(value)) {
|
|
26
|
+
return arrayMap_default(value, baseToString) + "";
|
|
27
|
+
}
|
|
28
|
+
if (isSymbol_default(value)) {
|
|
29
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
30
|
+
}
|
|
31
|
+
var result = value + "";
|
|
32
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
33
|
+
}
|
|
34
|
+
var baseToString_default = baseToString;
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js
|
|
37
|
+
function toString(value) {
|
|
38
|
+
return value == null ? "" : baseToString_default(value);
|
|
39
|
+
}
|
|
40
|
+
var toString_default = toString;
|
|
41
|
+
|
|
42
|
+
export { isSymbol_default, toString_default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isObject_default } from './chunk-ILGEM42C.mjs';
|
|
2
|
+
import { root_default, isObjectLike_default, freeGlobal_default, baseGetTag_default, Symbol_default, isArray_default } from './chunk-FNTGY7I5.mjs';
|
|
2
3
|
|
|
3
4
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js
|
|
4
5
|
function listCacheClear() {
|
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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../hooks/use-client-value.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from \"react\";\n\n/**\n * NOTE (Max, 2025-09-15): This hook is to be used for values that aren't available on the server (such as window.location).\n *\n * This hook will use a dummy value both on the server & on hydration. Then,\n * after hydration, this useEffect will update the value to the actual value.\n *\n * The useEffect doesn't have any dependencies - it's designed to only run once. So if you expect your read() function to return\n * different values through the lifecycle of the component, you should not use this hook.\n */\n\nexport function useClientValue<ValueType>(\n readValue: () => ValueType,\n initialValue: ValueType,\n) {\n const [value, setValue] = React.useState<ValueType>(initialValue);\n\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AAYhB,SAAS,eACd,WACA,cACA;AACA,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,YAAY;AAGhE,QAAM,UAAU,MAAM;AACpB,aAAS,UAAU,CAAC;AAAA,EACtB,GAAG,CAAC,CAAC;
|
|
4
|
+
"sourcesContent": ["import * as React from \"react\";\n\n/**\n * NOTE (Max, 2025-09-15): This hook is to be used for values that aren't available on the server (such as window.location).\n *\n * This hook will use a dummy value both on the server & on hydration. Then,\n * after hydration, this useEffect will update the value to the actual value.\n *\n * The useEffect doesn't have any dependencies - it's designed to only run once. So if you expect your read() function to return\n * different values through the lifecycle of the component, you should not use this hook.\n */\n\nexport function useClientValue<ValueType>(\n readValue: () => ValueType,\n initialValue: ValueType,\n) {\n const [value, setValue] = React.useState<ValueType>(initialValue);\n\n // eslint-disable-next-line replo/no-use-effect -- (Noah, 2026-07-20): Legacy effect - may or may not be necessary\n React.useEffect(() => {\n setValue(readValue());\n }, []);\n return value;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AAYhB,SAAS,eACd,WACA,cACA;AACA,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,YAAY;AAGhE,QAAM,UAAU,MAAM;AACpB,aAAS,UAAU,CAAC;AAAA,EACtB,GAAG,CAAC,CAAC;AACL,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const STRIPE_CART_COOKIE_NAME = "replo_stripe_cart";
|