@replohq/canopy-sdk 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_vendor/replo-utils/lib/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/product.d.ts +6 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +3 -2
- 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 +1 -1
- package/_vendor/schemas/registry.d.ts +42 -72
- package/_vendor/schemas/selectMode.mjs +3 -2
- package/{chunk-AG47B4AR.mjs → chunk-5OCDBBJK.mjs} +37 -13
- 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/hooks/use-client-value.js.map +2 -2
- package/loaders/product-loader-args.d.ts +21 -0
- package/loaders/product-loader-args.js +17 -0
- package/loaders/product-loader-args.js.map +7 -0
- package/loaders/product-loader.d.ts +3 -4
- package/loaders/product-loader.js +14 -17
- package/loaders/product-loader.js.map +2 -2
- package/package.json +1 -1
|
@@ -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';
|
|
@@ -176,6 +176,12 @@ export declare const fullCollectionSchema: z.ZodObject<{
|
|
|
176
176
|
width: z.ZodNullable<z.ZodNumber>;
|
|
177
177
|
height: z.ZodNullable<z.ZodNumber>;
|
|
178
178
|
}, z.core.$strip>>;
|
|
179
|
+
metafields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
180
|
+
key: z.ZodString;
|
|
181
|
+
namespace: z.ZodString;
|
|
182
|
+
type: z.ZodString;
|
|
183
|
+
value: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
179
185
|
}, z.core.$strip>;
|
|
180
186
|
export declare const paginatedProductsSchema: z.ZodObject<{
|
|
181
187
|
products: z.ZodArray<z.ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { priceSchema, metafieldSchema, imageSchema, selectedOptionSchema, mediaSchema, productOptionSchema, productSchema } from '../../../../../chunk-
|
|
1
|
+
import { priceSchema, metafieldSchema, imageSchema, selectedOptionSchema, mediaSchema, productOptionSchema, productSchema } from '../../../../../chunk-5OCDBBJK.mjs';
|
|
2
2
|
import { sellingPlanGroupSchema } from '../../../../../chunk-4TZVNC3W.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -37,7 +37,8 @@ var fullCollectionSchema = z.object({
|
|
|
37
37
|
handle: z.string(),
|
|
38
38
|
title: z.string(),
|
|
39
39
|
descriptionHtml: z.string().nullable(),
|
|
40
|
-
image: imageSchema.nullable()
|
|
40
|
+
image: imageSchema.nullable(),
|
|
41
|
+
metafields: z.array(metafieldSchema).optional()
|
|
41
42
|
});
|
|
42
43
|
var paginatedProductsSchema = z.object({
|
|
43
44
|
products: z.array(productSchema),
|
|
@@ -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-
|
|
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-5OCDBBJK.mjs';
|
|
2
2
|
import '../../chunk-4TZVNC3W.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
|
|
@@ -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
55
|
defaultVariantId: z.string().nullable().optional(),
|
|
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([])
|
|
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,
|
|
@@ -346,6 +340,27 @@ var collectionSchema = z.object({
|
|
|
346
340
|
descriptionHtml: z.string().nullable().optional(),
|
|
347
341
|
image: imageSchema.nullable().optional()
|
|
348
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().nullable().optional(),
|
|
355
|
+
// Shopify discount union type: DiscountCodeBasic, DiscountCodeBxgy,
|
|
356
|
+
// DiscountCodeFreeShipping, or DiscountCodeApp.
|
|
357
|
+
discountType: z.string().optional(),
|
|
358
|
+
startsAt: z.string().nullable().optional(),
|
|
359
|
+
endsAt: z.string().nullable().optional(),
|
|
360
|
+
usageLimit: z.number().nullable().optional(),
|
|
361
|
+
usageCount: z.number().optional(),
|
|
362
|
+
appliesOncePerCustomer: z.boolean().optional()
|
|
363
|
+
});
|
|
349
364
|
var assetSchema = z.object({
|
|
350
365
|
id: z.string(),
|
|
351
366
|
name: z.string().optional(),
|
|
@@ -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() {
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type MetafieldIdentifier = {
|
|
2
|
+
namespace: string;
|
|
3
|
+
key: string;
|
|
4
|
+
};
|
|
5
|
+
export type ProductLoaderArgs = {
|
|
6
|
+
handle?: string;
|
|
7
|
+
productId?: string;
|
|
8
|
+
productMetafieldIdentifiers?: MetafieldIdentifier[];
|
|
9
|
+
variantMetafieldIdentifiers?: MetafieldIdentifier[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Builds the single object used as BOTH the React Query key and the loader
|
|
13
|
+
* payload. They must stay identical: `PrefetchedLoaders` seeds the cache under
|
|
14
|
+
* `[loaderKey, args]`, so an arg sent to the loader but missing from the key
|
|
15
|
+
* (or vice versa) silently misses the prefetch — the client refetches without
|
|
16
|
+
* it and the page renders incomplete data instead of erroring.
|
|
17
|
+
*
|
|
18
|
+
* Keys left `undefined` drop out of React Query's key hash, so omitting a field
|
|
19
|
+
* here hashes the same as a prefetch that never passed it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildProductLoaderArgs({ handle, productId, productMetafieldIdentifiers, variantMetafieldIdentifiers, }: ProductLoaderArgs): ProductLoaderArgs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function buildProductLoaderArgs({
|
|
2
|
+
handle,
|
|
3
|
+
productId,
|
|
4
|
+
productMetafieldIdentifiers,
|
|
5
|
+
variantMetafieldIdentifiers
|
|
6
|
+
}) {
|
|
7
|
+
return {
|
|
8
|
+
handle,
|
|
9
|
+
productId,
|
|
10
|
+
productMetafieldIdentifiers,
|
|
11
|
+
variantMetafieldIdentifiers
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
buildProductLoaderArgs
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=product-loader-args.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../loaders/product-loader-args.ts"],
|
|
4
|
+
"sourcesContent": ["export type MetafieldIdentifier = {\n namespace: string;\n key: string;\n};\n\nexport type ProductLoaderArgs = {\n handle?: string;\n productId?: string;\n productMetafieldIdentifiers?: MetafieldIdentifier[];\n variantMetafieldIdentifiers?: MetafieldIdentifier[];\n};\n\n/**\n * Builds the single object used as BOTH the React Query key and the loader\n * payload. They must stay identical: `PrefetchedLoaders` seeds the cache under\n * `[loaderKey, args]`, so an arg sent to the loader but missing from the key\n * (or vice versa) silently misses the prefetch \u2014 the client refetches without\n * it and the page renders incomplete data instead of erroring.\n *\n * Keys left `undefined` drop out of React Query's key hash, so omitting a field\n * here hashes the same as a prefetch that never passed it.\n */\nexport function buildProductLoaderArgs({\n handle,\n productId,\n productMetafieldIdentifiers,\n variantMetafieldIdentifiers,\n}: ProductLoaderArgs): ProductLoaderArgs {\n return {\n handle,\n productId,\n productMetafieldIdentifiers,\n variantMetafieldIdentifiers,\n };\n}\n"],
|
|
5
|
+
"mappings": "AAsBO,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyC;AACvC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { FullProduct } from "../_vendor/schemas/agentTools/customIntegrations/loaders/product";
|
|
3
|
-
type
|
|
3
|
+
import type { ProductLoaderArgs } from "./product-loader-args";
|
|
4
|
+
type ProductLoaderProps = ProductLoaderArgs & {
|
|
4
5
|
loaderKey: string;
|
|
5
|
-
handle?: string;
|
|
6
|
-
productId?: string;
|
|
7
6
|
children: (data: FullProduct) => ReactNode;
|
|
8
7
|
fallback?: ReactNode;
|
|
9
8
|
};
|
|
10
|
-
export declare function ProductLoader({ loaderKey, handle, productId, children, fallback, }: ProductLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ProductLoader({ loaderKey, handle, productId, productMetafieldIdentifiers, variantMetafieldIdentifiers, children, fallback, }: ProductLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
@@ -5,19 +5,16 @@ import { useSuspenseQuery } from "@tanstack/react-query";
|
|
|
5
5
|
import { fullProductSchema } from "../_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs";
|
|
6
6
|
import { invokeLoader } from "./invoke-loader";
|
|
7
7
|
import { LoaderErrorBoundary } from "./loader-error-boundary";
|
|
8
|
+
import { buildProductLoaderArgs } from "./product-loader-args";
|
|
8
9
|
function ProductLoaderInner({
|
|
9
10
|
loaderKey,
|
|
10
|
-
|
|
11
|
-
productId,
|
|
11
|
+
args,
|
|
12
12
|
children
|
|
13
13
|
}) {
|
|
14
14
|
const queryResult = useSuspenseQuery({
|
|
15
|
-
queryKey: [loaderKey,
|
|
15
|
+
queryKey: [loaderKey, args],
|
|
16
16
|
queryFn: async () => {
|
|
17
|
-
const loadedData = await invokeLoader({
|
|
18
|
-
loaderKey,
|
|
19
|
-
args: { handle, productId }
|
|
20
|
-
});
|
|
17
|
+
const loadedData = await invokeLoader({ loaderKey, args });
|
|
21
18
|
return fullProductSchema.parse(loadedData);
|
|
22
19
|
}
|
|
23
20
|
});
|
|
@@ -27,23 +24,23 @@ function ProductLoader({
|
|
|
27
24
|
loaderKey,
|
|
28
25
|
handle,
|
|
29
26
|
productId,
|
|
27
|
+
productMetafieldIdentifiers,
|
|
28
|
+
variantMetafieldIdentifiers,
|
|
30
29
|
children,
|
|
31
30
|
fallback
|
|
32
31
|
}) {
|
|
32
|
+
const args = buildProductLoaderArgs({
|
|
33
|
+
handle,
|
|
34
|
+
productId,
|
|
35
|
+
productMetafieldIdentifiers,
|
|
36
|
+
variantMetafieldIdentifiers
|
|
37
|
+
});
|
|
33
38
|
return /* @__PURE__ */ jsx(
|
|
34
39
|
LoaderErrorBoundary,
|
|
35
40
|
{
|
|
36
41
|
fallback: fallback ?? null,
|
|
37
|
-
resetKey: `${loaderKey}:${
|
|
38
|
-
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(
|
|
39
|
-
ProductLoaderInner,
|
|
40
|
-
{
|
|
41
|
-
loaderKey,
|
|
42
|
-
handle,
|
|
43
|
-
productId,
|
|
44
|
-
children
|
|
45
|
-
}
|
|
46
|
-
) })
|
|
42
|
+
resetKey: `${loaderKey}:${JSON.stringify(args)}`,
|
|
43
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: fallback ?? null, children: /* @__PURE__ */ jsx(ProductLoaderInner, { loaderKey, args, children }) })
|
|
47
44
|
}
|
|
48
45
|
);
|
|
49
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../loaders/product-loader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { FullProduct } from \"schemas/agentTools/customIntegrations/loaders/product\";\n\nimport { Suspense } from \"react\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { fullProductSchema } from \"schemas/agentTools/customIntegrations/loaders/product\";\n\nimport { invokeLoader } from \"./invoke-loader\";\nimport { LoaderErrorBoundary } from \"./loader-error-boundary\";\n\ntype ProductLoaderProps = {\n loaderKey: string;\n
|
|
5
|
-
"mappings": ";AAsCS;
|
|
4
|
+
"sourcesContent": ["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport type { FullProduct } from \"schemas/agentTools/customIntegrations/loaders/product\";\nimport type { ProductLoaderArgs } from \"./product-loader-args\";\n\nimport { Suspense } from \"react\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { fullProductSchema } from \"schemas/agentTools/customIntegrations/loaders/product\";\n\nimport { invokeLoader } from \"./invoke-loader\";\nimport { LoaderErrorBoundary } from \"./loader-error-boundary\";\nimport { buildProductLoaderArgs } from \"./product-loader-args\";\n\ntype ProductLoaderProps = ProductLoaderArgs & {\n loaderKey: string;\n children: (data: FullProduct) => ReactNode;\n fallback?: ReactNode;\n};\n\nfunction ProductLoaderInner({\n loaderKey,\n args,\n children,\n}: {\n loaderKey: string;\n args: ProductLoaderArgs;\n children: (data: FullProduct) => ReactNode;\n}) {\n const queryResult = useSuspenseQuery({\n queryKey: [loaderKey, args],\n queryFn: async () => {\n const loadedData = await invokeLoader({ loaderKey, args });\n return fullProductSchema.parse(loadedData);\n },\n });\n\n return <>{children(queryResult.data)}</>;\n}\n\nexport function ProductLoader({\n loaderKey,\n handle,\n productId,\n productMetafieldIdentifiers,\n variantMetafieldIdentifiers,\n children,\n fallback,\n}: ProductLoaderProps) {\n const args = buildProductLoaderArgs({\n handle,\n productId,\n productMetafieldIdentifiers,\n variantMetafieldIdentifiers,\n });\n\n return (\n <LoaderErrorBoundary\n fallback={fallback ?? null}\n resetKey={`${loaderKey}:${JSON.stringify(args)}`}\n >\n <Suspense fallback={fallback ?? null}>\n <ProductLoaderInner loaderKey={loaderKey} args={args}>\n {children}\n </ProductLoaderInner>\n </Suspense>\n </LoaderErrorBoundary>\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAsCS;AAhCT,SAAS,gBAAgB;AAEzB,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAElC,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AAQvC,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,cAAc,iBAAiB;AAAA,IACnC,UAAU,CAAC,WAAW,IAAI;AAAA,IAC1B,SAAS,YAAY;AACnB,YAAM,aAAa,MAAM,aAAa,EAAE,WAAW,KAAK,CAAC;AACzD,aAAO,kBAAkB,MAAM,UAAU;AAAA,IAC3C;AAAA,EACF,CAAC;AAED,SAAO,gCAAG,mBAAS,YAAY,IAAI,GAAE;AACvC;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,OAAO,uBAAuB;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,YAAY;AAAA,MACtB,UAAU,GAAG,SAAS,IAAI,KAAK,UAAU,IAAI,CAAC;AAAA,MAE9C,8BAAC,YAAS,UAAU,YAAY,MAC9B,8BAAC,sBAAmB,WAAsB,MACvC,UACH,GACF;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED