@replohq/canopy-sdk 0.12.0 → 0.13.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/errors.d.ts +83 -0
- package/_vendor/replo-utils/lib/fonts.mjs +2 -40
- package/_vendor/replo-utils/lib/json.mjs +1 -1
- package/_vendor/replo-utils/lib/misc.mjs +2 -2
- package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.d.ts +49 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.mjs +36 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.d.ts +340 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +51 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.d.ts +37 -0
- package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs +37 -0
- package/{cart/cart-schema.js → _vendor/schemas/cart.mjs} +17 -26
- package/_vendor/schemas/designLibrary.d.ts +4 -4
- package/_vendor/schemas/errors.d.ts +438 -0
- package/_vendor/schemas/errors.mjs +932 -0
- package/_vendor/schemas/generated/errors.d.ts +61 -0
- package/_vendor/schemas/generated/selectMode.d.ts +102 -0
- package/{loaders/loader-keys.d.ts → _vendor/schemas/loaderKeys.d.ts} +4 -4
- package/{loaders/loader-keys.js → _vendor/schemas/loaderKeys.mjs} +7 -8
- package/_vendor/schemas/objectType.d.ts +1038 -0
- package/_vendor/schemas/objectType.mjs +2 -0
- package/_vendor/schemas/registry.d.ts +539 -0
- package/_vendor/schemas/sandboxFiles.d.ts +36 -0
- package/_vendor/schemas/savedStyles.d.ts +2 -2
- package/_vendor/schemas/selectMode.d.ts +471 -0
- package/_vendor/schemas/selectMode.mjs +120 -4
- package/_vendor/schemas/sellingPlan.d.ts +60 -0
- package/_vendor/schemas/sellingPlan.mjs +1 -0
- package/cart/buy-now-action.js +3 -3
- package/cart/buy-now-action.js.map +2 -2
- package/cart/cart-provider.js +2 -2
- package/cart/cart-provider.js.map +2 -2
- package/cart/cart-types.d.ts +2 -1
- package/cart/cart-types.js.map +2 -2
- package/cart/hooks/use-add-to-cart.js +1 -1
- package/cart/hooks/use-add-to-cart.js.map +2 -2
- package/cart/hooks/use-buy-now.js +2 -2
- package/cart/hooks/use-buy-now.js.map +2 -2
- package/cart/utils/variant-to-cart-line.d.ts +1 -2
- package/cart/utils/variant-to-cart-line.js.map +1 -1
- package/chunk-4XLTENDR.mjs +33 -0
- package/chunk-A7EUNWRQ.mjs +765 -0
- package/{chunk-ME5W2TJM.mjs → chunk-OCB5XQYL.mjs} +2 -2
- package/chunk-QFYIXADC.mjs +42 -0
- package/editor/LinkInterceptor.js +4 -0
- package/editor/LinkInterceptor.js.map +2 -2
- package/editor/select-mode/EditorSelection.js +74 -1
- package/editor/select-mode/EditorSelection.js.map +2 -2
- package/editor/select-mode/descriptor/elementDescriptor.d.ts +13 -2
- package/editor/select-mode/descriptor/elementDescriptor.js +19 -31
- package/editor/select-mode/descriptor/elementDescriptor.js.map +2 -2
- package/editor/select-mode/descriptor/styleExtraction.d.ts +3 -0
- package/editor/select-mode/descriptor/styleExtraction.js +271 -0
- package/editor/select-mode/descriptor/styleExtraction.js.map +7 -0
- package/editor/select-mode/displayModeStore.d.ts +10 -0
- package/editor/select-mode/displayModeStore.js +47 -0
- package/editor/select-mode/displayModeStore.js.map +7 -0
- package/editor/select-mode/fast-refresh-relay.d.ts +3 -0
- package/editor/select-mode/fast-refresh-relay.js +35 -0
- package/editor/select-mode/fast-refresh-relay.js.map +7 -0
- package/editor/select-mode/fiber.d.ts +17 -0
- package/editor/select-mode/fiber.js +103 -34
- package/editor/select-mode/fiber.js.map +2 -2
- package/editor/select-mode/hooks/useEditModeStateMachine.d.ts +20 -0
- package/editor/select-mode/hooks/useEditModeStateMachine.js +226 -0
- package/editor/select-mode/hooks/useEditModeStateMachine.js.map +7 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.d.ts +20 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.js +284 -0
- package/editor/select-mode/hooks/useOptimisticOverrides.js.map +7 -0
- package/editor/select-mode/hooks/useParentMessaging.d.ts +17 -2
- package/editor/select-mode/hooks/useParentMessaging.js +66 -1
- package/editor/select-mode/hooks/useParentMessaging.js.map +2 -2
- package/editor/select-mode/hooks/useSelectModeController.js +5 -6
- package/editor/select-mode/hooks/useSelectModeController.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionHover.js +16 -1
- package/editor/select-mode/hooks/useSelectionHover.js.map +2 -2
- package/editor/select-mode/hooks/useSelectionInteractions.d.ts +7 -2
- package/editor/select-mode/hooks/useSelectionInteractions.js +57 -18
- package/editor/select-mode/hooks/useSelectionInteractions.js.map +2 -2
- package/editor/select-mode/hooks/useSiblingResolution.d.ts +6 -0
- package/editor/select-mode/hooks/useSiblingResolution.js +59 -0
- package/editor/select-mode/hooks/useSiblingResolution.js.map +7 -0
- package/editor/select-mode/inlineTextMarks.d.ts +6 -0
- package/editor/select-mode/inlineTextMarks.js +25 -0
- package/editor/select-mode/inlineTextMarks.js.map +7 -0
- package/editor/select-mode/interactions/selectionGeometry.js +4 -0
- package/editor/select-mode/interactions/selectionGeometry.js.map +2 -2
- package/editor/select-mode/selectionFrame.d.ts +5 -0
- package/editor/select-mode/selectionFrame.js +25 -1
- package/editor/select-mode/selectionFrame.js.map +2 -2
- package/editor/select-mode/symbolicate.js +32 -10
- package/editor/select-mode/symbolicate.js.map +2 -2
- package/editor/select-mode/tiptapInlineEditor.d.ts +23 -0
- package/editor/select-mode/tiptapInlineEditor.js +120 -0
- package/editor/select-mode/tiptapInlineEditor.js.map +7 -0
- package/gateways/canopy-api.d.ts +3 -3
- package/gateways/canopy-api.js +3 -3
- package/gateways/canopy-api.js.map +2 -2
- package/loaders/collection-loader.d.ts +1 -1
- package/loaders/collection-loader.js +1 -1
- package/loaders/collection-loader.js.map +2 -2
- package/loaders/collection-products-loader.d.ts +1 -1
- package/loaders/collection-products-loader.js +1 -1
- package/loaders/collection-products-loader.js.map +2 -2
- package/loaders/invoke-loader.d.ts +2 -2
- package/loaders/invoke-loader.js +2 -2
- package/loaders/invoke-loader.js.map +2 -2
- package/loaders/levanta-product-loader.d.ts +1 -1
- package/loaders/levanta-product-loader.js +1 -1
- package/loaders/levanta-product-loader.js.map +2 -2
- package/loaders/okendo-reviews-loader.js +1 -1
- package/loaders/okendo-reviews-loader.js.map +2 -2
- package/loaders/prefetch-loaders.d.ts +1 -1
- package/loaders/prefetch-loaders.js.map +1 -1
- package/loaders/product-loader.d.ts +1 -1
- package/loaders/product-loader.js +1 -1
- package/loaders/product-loader.js.map +2 -2
- package/loaders/rebuy-recommendations-loader.js +1 -1
- package/loaders/rebuy-recommendations-loader.js.map +2 -2
- package/loaders/yotpo-review-aggregate-loader.d.ts +1 -1
- package/loaders/yotpo-review-aggregate-loader.js +1 -1
- package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
- package/loaders/yotpo-reviews-loader.d.ts +1 -1
- package/loaders/yotpo-reviews-loader.js +1 -1
- package/loaders/yotpo-reviews-loader.js.map +2 -2
- package/package.json +9 -1
- package/cart/cart-schema.js.map +0 -7
- package/lib/canopy-error.d.ts +0 -25
- package/lib/canopy-error.js +0 -24
- package/lib/canopy-error.js.map +0 -7
- package/loaders/loader-keys.js.map +0 -7
- package/loaders/loader-schemas.d.ts +0 -755
- package/loaders/loader-schemas.js +0 -257
- package/loaders/loader-schemas.js.map +0 -7
- package/{cart/cart-schema.d.ts → _vendor/schemas/cart.d.ts} +0 -0
- package/{chunk-NCKKAFF7.mjs → chunk-ILGEM42C.mjs} +7 -7
|
@@ -0,0 +1,932 @@
|
|
|
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-OCB5XQYL.mjs';
|
|
3
|
+
import { isObject_default } from '../../chunk-ILGEM42C.mjs';
|
|
4
|
+
import { Symbol_default, isArray_default, isObjectLike_default } from '../../chunk-FNTGY7I5.mjs';
|
|
5
|
+
import { z, ZodError } from 'zod';
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js
|
|
8
|
+
function baseForOwn(object, iteratee) {
|
|
9
|
+
return object && baseFor_default(object, iteratee, keys_default);
|
|
10
|
+
}
|
|
11
|
+
var baseForOwn_default = baseForOwn;
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js
|
|
14
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
15
|
+
function setCacheAdd(value) {
|
|
16
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
var setCacheAdd_default = setCacheAdd;
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js
|
|
22
|
+
function setCacheHas(value) {
|
|
23
|
+
return this.__data__.has(value);
|
|
24
|
+
}
|
|
25
|
+
var setCacheHas_default = setCacheHas;
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js
|
|
28
|
+
function SetCache(values) {
|
|
29
|
+
var index = -1, length = values == null ? 0 : values.length;
|
|
30
|
+
this.__data__ = new MapCache_default();
|
|
31
|
+
while (++index < length) {
|
|
32
|
+
this.add(values[index]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default;
|
|
36
|
+
SetCache.prototype.has = setCacheHas_default;
|
|
37
|
+
var SetCache_default = SetCache;
|
|
38
|
+
|
|
39
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js
|
|
40
|
+
function arraySome(array, predicate) {
|
|
41
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
42
|
+
while (++index < length) {
|
|
43
|
+
if (predicate(array[index], index, array)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
var arraySome_default = arraySome;
|
|
50
|
+
|
|
51
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js
|
|
52
|
+
function cacheHas(cache, key) {
|
|
53
|
+
return cache.has(key);
|
|
54
|
+
}
|
|
55
|
+
var cacheHas_default = cacheHas;
|
|
56
|
+
|
|
57
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js
|
|
58
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
|
59
|
+
var COMPARE_UNORDERED_FLAG = 2;
|
|
60
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
61
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
62
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
var arrStacked = stack.get(array);
|
|
66
|
+
var othStacked = stack.get(other);
|
|
67
|
+
if (arrStacked && othStacked) {
|
|
68
|
+
return arrStacked == other && othStacked == array;
|
|
69
|
+
}
|
|
70
|
+
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0;
|
|
71
|
+
stack.set(array, other);
|
|
72
|
+
stack.set(other, array);
|
|
73
|
+
while (++index < arrLength) {
|
|
74
|
+
var arrValue = array[index], othValue = other[index];
|
|
75
|
+
if (customizer) {
|
|
76
|
+
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
77
|
+
}
|
|
78
|
+
if (compared !== void 0) {
|
|
79
|
+
if (compared) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
result = false;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (seen) {
|
|
86
|
+
if (!arraySome_default(other, function(othValue2, othIndex) {
|
|
87
|
+
if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
88
|
+
return seen.push(othIndex);
|
|
89
|
+
}
|
|
90
|
+
})) {
|
|
91
|
+
result = false;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
95
|
+
result = false;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
stack["delete"](array);
|
|
100
|
+
stack["delete"](other);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
var equalArrays_default = equalArrays;
|
|
104
|
+
|
|
105
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js
|
|
106
|
+
function mapToArray(map) {
|
|
107
|
+
var index = -1, result = Array(map.size);
|
|
108
|
+
map.forEach(function(value, key) {
|
|
109
|
+
result[++index] = [key, value];
|
|
110
|
+
});
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
var mapToArray_default = mapToArray;
|
|
114
|
+
|
|
115
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js
|
|
116
|
+
function setToArray(set) {
|
|
117
|
+
var index = -1, result = Array(set.size);
|
|
118
|
+
set.forEach(function(value) {
|
|
119
|
+
result[++index] = value;
|
|
120
|
+
});
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
var setToArray_default = setToArray;
|
|
124
|
+
|
|
125
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js
|
|
126
|
+
var COMPARE_PARTIAL_FLAG2 = 1;
|
|
127
|
+
var COMPARE_UNORDERED_FLAG2 = 2;
|
|
128
|
+
var boolTag = "[object Boolean]";
|
|
129
|
+
var dateTag = "[object Date]";
|
|
130
|
+
var errorTag = "[object Error]";
|
|
131
|
+
var mapTag = "[object Map]";
|
|
132
|
+
var numberTag = "[object Number]";
|
|
133
|
+
var regexpTag = "[object RegExp]";
|
|
134
|
+
var setTag = "[object Set]";
|
|
135
|
+
var stringTag = "[object String]";
|
|
136
|
+
var symbolTag = "[object Symbol]";
|
|
137
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
138
|
+
var dataViewTag = "[object DataView]";
|
|
139
|
+
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
|
|
140
|
+
var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
141
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
142
|
+
switch (tag) {
|
|
143
|
+
case dataViewTag:
|
|
144
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
object = object.buffer;
|
|
148
|
+
other = other.buffer;
|
|
149
|
+
case arrayBufferTag:
|
|
150
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object), new Uint8Array_default(other))) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return true;
|
|
154
|
+
case boolTag:
|
|
155
|
+
case dateTag:
|
|
156
|
+
case numberTag:
|
|
157
|
+
return eq_default(+object, +other);
|
|
158
|
+
case errorTag:
|
|
159
|
+
return object.name == other.name && object.message == other.message;
|
|
160
|
+
case regexpTag:
|
|
161
|
+
case stringTag:
|
|
162
|
+
return object == other + "";
|
|
163
|
+
case mapTag:
|
|
164
|
+
var convert = mapToArray_default;
|
|
165
|
+
case setTag:
|
|
166
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
|
|
167
|
+
convert || (convert = setToArray_default);
|
|
168
|
+
if (object.size != other.size && !isPartial) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
var stacked = stack.get(object);
|
|
172
|
+
if (stacked) {
|
|
173
|
+
return stacked == other;
|
|
174
|
+
}
|
|
175
|
+
bitmask |= COMPARE_UNORDERED_FLAG2;
|
|
176
|
+
stack.set(object, other);
|
|
177
|
+
var result = equalArrays_default(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
178
|
+
stack["delete"](object);
|
|
179
|
+
return result;
|
|
180
|
+
case symbolTag:
|
|
181
|
+
if (symbolValueOf) {
|
|
182
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
var equalByTag_default = equalByTag;
|
|
188
|
+
|
|
189
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js
|
|
190
|
+
var COMPARE_PARTIAL_FLAG3 = 1;
|
|
191
|
+
var objectProto = Object.prototype;
|
|
192
|
+
var hasOwnProperty2 = objectProto.hasOwnProperty;
|
|
193
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
194
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length;
|
|
195
|
+
if (objLength != othLength && !isPartial) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
var index = objLength;
|
|
199
|
+
while (index--) {
|
|
200
|
+
var key = objProps[index];
|
|
201
|
+
if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var objStacked = stack.get(object);
|
|
206
|
+
var othStacked = stack.get(other);
|
|
207
|
+
if (objStacked && othStacked) {
|
|
208
|
+
return objStacked == other && othStacked == object;
|
|
209
|
+
}
|
|
210
|
+
var result = true;
|
|
211
|
+
stack.set(object, other);
|
|
212
|
+
stack.set(other, object);
|
|
213
|
+
var skipCtor = isPartial;
|
|
214
|
+
while (++index < objLength) {
|
|
215
|
+
key = objProps[index];
|
|
216
|
+
var objValue = object[key], othValue = other[key];
|
|
217
|
+
if (customizer) {
|
|
218
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
219
|
+
}
|
|
220
|
+
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
221
|
+
result = false;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
skipCtor || (skipCtor = key == "constructor");
|
|
225
|
+
}
|
|
226
|
+
if (result && !skipCtor) {
|
|
227
|
+
var objCtor = object.constructor, othCtor = other.constructor;
|
|
228
|
+
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
229
|
+
result = false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
stack["delete"](object);
|
|
233
|
+
stack["delete"](other);
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
var equalObjects_default = equalObjects;
|
|
237
|
+
|
|
238
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js
|
|
239
|
+
var COMPARE_PARTIAL_FLAG4 = 1;
|
|
240
|
+
var argsTag = "[object Arguments]";
|
|
241
|
+
var arrayTag = "[object Array]";
|
|
242
|
+
var objectTag = "[object Object]";
|
|
243
|
+
var objectProto2 = Object.prototype;
|
|
244
|
+
var hasOwnProperty3 = objectProto2.hasOwnProperty;
|
|
245
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
246
|
+
var objIsArr = isArray_default(object), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag : getTag_default(object), othTag = othIsArr ? arrayTag : getTag_default(other);
|
|
247
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
248
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
249
|
+
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
250
|
+
if (isSameTag && isBuffer_default(object)) {
|
|
251
|
+
if (!isBuffer_default(other)) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
objIsArr = true;
|
|
255
|
+
objIsObj = false;
|
|
256
|
+
}
|
|
257
|
+
if (isSameTag && !objIsObj) {
|
|
258
|
+
stack || (stack = new Stack_default());
|
|
259
|
+
return objIsArr || isTypedArray_default(object) ? equalArrays_default(object, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
260
|
+
}
|
|
261
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
|
|
262
|
+
var objIsWrapped = objIsObj && hasOwnProperty3.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty3.call(other, "__wrapped__");
|
|
263
|
+
if (objIsWrapped || othIsWrapped) {
|
|
264
|
+
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
265
|
+
stack || (stack = new Stack_default());
|
|
266
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (!isSameTag) {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
stack || (stack = new Stack_default());
|
|
273
|
+
return equalObjects_default(object, other, bitmask, customizer, equalFunc, stack);
|
|
274
|
+
}
|
|
275
|
+
var baseIsEqualDeep_default = baseIsEqualDeep;
|
|
276
|
+
|
|
277
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js
|
|
278
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
279
|
+
if (value === other) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
if (value == null || other == null || !isObjectLike_default(value) && !isObjectLike_default(other)) {
|
|
283
|
+
return value !== value && other !== other;
|
|
284
|
+
}
|
|
285
|
+
return baseIsEqualDeep_default(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
286
|
+
}
|
|
287
|
+
var baseIsEqual_default = baseIsEqual;
|
|
288
|
+
|
|
289
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js
|
|
290
|
+
var COMPARE_PARTIAL_FLAG5 = 1;
|
|
291
|
+
var COMPARE_UNORDERED_FLAG3 = 2;
|
|
292
|
+
function baseIsMatch(object, source, matchData, customizer) {
|
|
293
|
+
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
294
|
+
if (object == null) {
|
|
295
|
+
return !length;
|
|
296
|
+
}
|
|
297
|
+
object = Object(object);
|
|
298
|
+
while (index--) {
|
|
299
|
+
var data = matchData[index];
|
|
300
|
+
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
while (++index < length) {
|
|
305
|
+
data = matchData[index];
|
|
306
|
+
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
307
|
+
if (noCustomizer && data[2]) {
|
|
308
|
+
if (objValue === void 0 && !(key in object)) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
var stack = new Stack_default();
|
|
313
|
+
if (customizer) {
|
|
314
|
+
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
315
|
+
}
|
|
316
|
+
if (!(result === void 0 ? baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3, customizer, stack) : result)) {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
var baseIsMatch_default = baseIsMatch;
|
|
324
|
+
|
|
325
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js
|
|
326
|
+
function isStrictComparable(value) {
|
|
327
|
+
return value === value && !isObject_default(value);
|
|
328
|
+
}
|
|
329
|
+
var isStrictComparable_default = isStrictComparable;
|
|
330
|
+
|
|
331
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js
|
|
332
|
+
function getMatchData(object) {
|
|
333
|
+
var result = keys_default(object), length = result.length;
|
|
334
|
+
while (length--) {
|
|
335
|
+
var key = result[length], value = object[key];
|
|
336
|
+
result[length] = [key, value, isStrictComparable_default(value)];
|
|
337
|
+
}
|
|
338
|
+
return result;
|
|
339
|
+
}
|
|
340
|
+
var getMatchData_default = getMatchData;
|
|
341
|
+
|
|
342
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js
|
|
343
|
+
function matchesStrictComparable(key, srcValue) {
|
|
344
|
+
return function(object) {
|
|
345
|
+
if (object == null) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
var matchesStrictComparable_default = matchesStrictComparable;
|
|
352
|
+
|
|
353
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js
|
|
354
|
+
function baseMatches(source) {
|
|
355
|
+
var matchData = getMatchData_default(source);
|
|
356
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
357
|
+
return matchesStrictComparable_default(matchData[0][0], matchData[0][1]);
|
|
358
|
+
}
|
|
359
|
+
return function(object) {
|
|
360
|
+
return object === source || baseIsMatch_default(object, source, matchData);
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
var baseMatches_default = baseMatches;
|
|
364
|
+
|
|
365
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js
|
|
366
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
367
|
+
var reIsPlainProp = /^\w*$/;
|
|
368
|
+
function isKey(value, object) {
|
|
369
|
+
if (isArray_default(value)) {
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
var type = typeof value;
|
|
373
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default(value)) {
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
377
|
+
}
|
|
378
|
+
var isKey_default = isKey;
|
|
379
|
+
|
|
380
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/memoize.js
|
|
381
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
382
|
+
function memoize(func, resolver) {
|
|
383
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
384
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
385
|
+
}
|
|
386
|
+
var memoized = function() {
|
|
387
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
388
|
+
if (cache.has(key)) {
|
|
389
|
+
return cache.get(key);
|
|
390
|
+
}
|
|
391
|
+
var result = func.apply(this, args);
|
|
392
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
393
|
+
return result;
|
|
394
|
+
};
|
|
395
|
+
memoized.cache = new (memoize.Cache || MapCache_default)();
|
|
396
|
+
return memoized;
|
|
397
|
+
}
|
|
398
|
+
memoize.Cache = MapCache_default;
|
|
399
|
+
var memoize_default = memoize;
|
|
400
|
+
|
|
401
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js
|
|
402
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
403
|
+
function memoizeCapped(func) {
|
|
404
|
+
var result = memoize_default(func, function(key) {
|
|
405
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
406
|
+
cache.clear();
|
|
407
|
+
}
|
|
408
|
+
return key;
|
|
409
|
+
});
|
|
410
|
+
var cache = result.cache;
|
|
411
|
+
return result;
|
|
412
|
+
}
|
|
413
|
+
var memoizeCapped_default = memoizeCapped;
|
|
414
|
+
|
|
415
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js
|
|
416
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
417
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
418
|
+
var stringToPath = memoizeCapped_default(function(string) {
|
|
419
|
+
var result = [];
|
|
420
|
+
if (string.charCodeAt(0) === 46) {
|
|
421
|
+
result.push("");
|
|
422
|
+
}
|
|
423
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
424
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
425
|
+
});
|
|
426
|
+
return result;
|
|
427
|
+
});
|
|
428
|
+
var stringToPath_default = stringToPath;
|
|
429
|
+
|
|
430
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js
|
|
431
|
+
function castPath(value, object) {
|
|
432
|
+
if (isArray_default(value)) {
|
|
433
|
+
return value;
|
|
434
|
+
}
|
|
435
|
+
return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
|
|
436
|
+
}
|
|
437
|
+
var castPath_default = castPath;
|
|
438
|
+
function toKey(value) {
|
|
439
|
+
if (typeof value == "string" || isSymbol_default(value)) {
|
|
440
|
+
return value;
|
|
441
|
+
}
|
|
442
|
+
var result = value + "";
|
|
443
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
444
|
+
}
|
|
445
|
+
var toKey_default = toKey;
|
|
446
|
+
|
|
447
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
|
|
448
|
+
function baseGet(object, path) {
|
|
449
|
+
path = castPath_default(path, object);
|
|
450
|
+
var index = 0, length = path.length;
|
|
451
|
+
while (object != null && index < length) {
|
|
452
|
+
object = object[toKey_default(path[index++])];
|
|
453
|
+
}
|
|
454
|
+
return index && index == length ? object : void 0;
|
|
455
|
+
}
|
|
456
|
+
var baseGet_default = baseGet;
|
|
457
|
+
|
|
458
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js
|
|
459
|
+
function get(object, path, defaultValue) {
|
|
460
|
+
var result = object == null ? void 0 : baseGet_default(object, path);
|
|
461
|
+
return result === void 0 ? defaultValue : result;
|
|
462
|
+
}
|
|
463
|
+
var get_default = get;
|
|
464
|
+
|
|
465
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js
|
|
466
|
+
function baseHasIn(object, key) {
|
|
467
|
+
return object != null && key in Object(object);
|
|
468
|
+
}
|
|
469
|
+
var baseHasIn_default = baseHasIn;
|
|
470
|
+
|
|
471
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js
|
|
472
|
+
function hasPath(object, path, hasFunc) {
|
|
473
|
+
path = castPath_default(path, object);
|
|
474
|
+
var index = -1, length = path.length, result = false;
|
|
475
|
+
while (++index < length) {
|
|
476
|
+
var key = toKey_default(path[index]);
|
|
477
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
object = object[key];
|
|
481
|
+
}
|
|
482
|
+
if (result || ++index != length) {
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
length = object == null ? 0 : object.length;
|
|
486
|
+
return !!length && isLength_default(length) && isIndex_default(key, length) && (isArray_default(object) || isArguments_default(object));
|
|
487
|
+
}
|
|
488
|
+
var hasPath_default = hasPath;
|
|
489
|
+
|
|
490
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js
|
|
491
|
+
function hasIn(object, path) {
|
|
492
|
+
return object != null && hasPath_default(object, path, baseHasIn_default);
|
|
493
|
+
}
|
|
494
|
+
var hasIn_default = hasIn;
|
|
495
|
+
|
|
496
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js
|
|
497
|
+
var COMPARE_PARTIAL_FLAG6 = 1;
|
|
498
|
+
var COMPARE_UNORDERED_FLAG4 = 2;
|
|
499
|
+
function baseMatchesProperty(path, srcValue) {
|
|
500
|
+
if (isKey_default(path) && isStrictComparable_default(srcValue)) {
|
|
501
|
+
return matchesStrictComparable_default(toKey_default(path), srcValue);
|
|
502
|
+
}
|
|
503
|
+
return function(object) {
|
|
504
|
+
var objValue = get_default(object, path);
|
|
505
|
+
return objValue === void 0 && objValue === srcValue ? hasIn_default(object, path) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4);
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
var baseMatchesProperty_default = baseMatchesProperty;
|
|
509
|
+
|
|
510
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js
|
|
511
|
+
function baseProperty(key) {
|
|
512
|
+
return function(object) {
|
|
513
|
+
return object == null ? void 0 : object[key];
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
var baseProperty_default = baseProperty;
|
|
517
|
+
|
|
518
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js
|
|
519
|
+
function basePropertyDeep(path) {
|
|
520
|
+
return function(object) {
|
|
521
|
+
return baseGet_default(object, path);
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
var basePropertyDeep_default = basePropertyDeep;
|
|
525
|
+
|
|
526
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js
|
|
527
|
+
function property(path) {
|
|
528
|
+
return isKey_default(path) ? baseProperty_default(toKey_default(path)) : basePropertyDeep_default(path);
|
|
529
|
+
}
|
|
530
|
+
var property_default = property;
|
|
531
|
+
|
|
532
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js
|
|
533
|
+
function baseIteratee(value) {
|
|
534
|
+
if (typeof value == "function") {
|
|
535
|
+
return value;
|
|
536
|
+
}
|
|
537
|
+
if (value == null) {
|
|
538
|
+
return identity_default;
|
|
539
|
+
}
|
|
540
|
+
if (typeof value == "object") {
|
|
541
|
+
return isArray_default(value) ? baseMatchesProperty_default(value[0], value[1]) : baseMatches_default(value);
|
|
542
|
+
}
|
|
543
|
+
return property_default(value);
|
|
544
|
+
}
|
|
545
|
+
var baseIteratee_default = baseIteratee;
|
|
546
|
+
|
|
547
|
+
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js
|
|
548
|
+
function mapValues(object, iteratee) {
|
|
549
|
+
var result = {};
|
|
550
|
+
iteratee = baseIteratee_default(iteratee);
|
|
551
|
+
baseForOwn_default(object, function(value, key, object2) {
|
|
552
|
+
baseAssignValue_default(result, key, iteratee(value, key, object2));
|
|
553
|
+
});
|
|
554
|
+
return result;
|
|
555
|
+
}
|
|
556
|
+
var mapValues_default = mapValues;
|
|
557
|
+
|
|
558
|
+
// ../replo-utils/lib/errors.ts
|
|
559
|
+
function getErrorMessage(error, fallback) {
|
|
560
|
+
if (error instanceof Error) {
|
|
561
|
+
return error.message;
|
|
562
|
+
}
|
|
563
|
+
return String(error);
|
|
564
|
+
}
|
|
565
|
+
var ReploError = class _ReploError extends Error {
|
|
566
|
+
config;
|
|
567
|
+
id;
|
|
568
|
+
constructor(config) {
|
|
569
|
+
super(config.message);
|
|
570
|
+
this.message = config.message ?? this.constructor.name;
|
|
571
|
+
this.config = config;
|
|
572
|
+
this.id = crypto.randomUUID();
|
|
573
|
+
const { cause } = config;
|
|
574
|
+
if (cause) {
|
|
575
|
+
this.cause = cause;
|
|
576
|
+
if (cause instanceof _ReploError) {
|
|
577
|
+
this.config.additionalData = {
|
|
578
|
+
...this.config.additionalData,
|
|
579
|
+
...cause.config.additionalData
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
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
|
+
};
|
|
594
|
+
var ReploAuthenticationError = class extends ReploError {
|
|
595
|
+
type;
|
|
596
|
+
userFacingDetails;
|
|
597
|
+
constructor(config) {
|
|
598
|
+
super({
|
|
599
|
+
message: config.message,
|
|
600
|
+
additionalData: {
|
|
601
|
+
...config.additionalData,
|
|
602
|
+
authErrorType: config.type
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
this.type = config.type;
|
|
606
|
+
this.userFacingDetails = config.userFacingDetails;
|
|
607
|
+
}
|
|
608
|
+
getHttpStatusCode() {
|
|
609
|
+
return exhaustiveSwitch({ type: this.type })({
|
|
610
|
+
unauthenticated: () => 401,
|
|
611
|
+
unauthorized: () => 403,
|
|
612
|
+
notFound: () => 404
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
getTRPCErrorCode() {
|
|
616
|
+
return exhaustiveSwitch({ type: this.type })({
|
|
617
|
+
unauthenticated: () => "UNAUTHORIZED",
|
|
618
|
+
unauthorized: () => "FORBIDDEN",
|
|
619
|
+
notFound: () => "NOT_FOUND"
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
var ReploHTTPError = class extends ReploError {
|
|
624
|
+
userFacingDetails;
|
|
625
|
+
statusCode;
|
|
626
|
+
details;
|
|
627
|
+
constructor(config) {
|
|
628
|
+
super({
|
|
629
|
+
...config,
|
|
630
|
+
message: config.message ?? config.userFacingDetails.message,
|
|
631
|
+
additionalData: {
|
|
632
|
+
...config.additionalData,
|
|
633
|
+
statusCode: config.statusCode
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
this.statusCode = config.statusCode;
|
|
637
|
+
this.userFacingDetails = config.userFacingDetails;
|
|
638
|
+
this.details = config.details;
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
var ReploRawHTTPError = class extends ReploError {
|
|
642
|
+
statusCode;
|
|
643
|
+
errorType;
|
|
644
|
+
data;
|
|
645
|
+
constructor(config) {
|
|
646
|
+
super({
|
|
647
|
+
message: config.message,
|
|
648
|
+
additionalData: { statusCode: config.statusCode, data: config.data }
|
|
649
|
+
});
|
|
650
|
+
this.statusCode = config.statusCode;
|
|
651
|
+
this.errorType = config.errorType;
|
|
652
|
+
this.data = config.data;
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
var Uncommon_GloballyMappedError = class extends ReploError {
|
|
656
|
+
userFacingDetails;
|
|
657
|
+
statusCode;
|
|
658
|
+
constructor(config) {
|
|
659
|
+
super(config);
|
|
660
|
+
this.statusCode = config.statusCode;
|
|
661
|
+
this.userFacingDetails = config.userFacingDetails;
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
var ReploValidationError = class extends ReploError {
|
|
665
|
+
constructor(message) {
|
|
666
|
+
super({ message: `[replo-validation-error]: ${message}` });
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
var UnexpectedMutationError = class extends ReploError {
|
|
670
|
+
constructor() {
|
|
671
|
+
super({ message: "Unexpected mutation in GraphQL query" });
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
var UnexpectedRawGraphqlClientError = class extends ReploError {
|
|
675
|
+
originalError;
|
|
676
|
+
errors;
|
|
677
|
+
data;
|
|
678
|
+
constructor(opts) {
|
|
679
|
+
const errorMessages = opts.errors.map((graphqlError) => {
|
|
680
|
+
if (graphqlError != null && typeof graphqlError === "object" && "message" in graphqlError && typeof graphqlError.message === "string") {
|
|
681
|
+
return graphqlError.message;
|
|
682
|
+
}
|
|
683
|
+
return JSON.stringify(graphqlError);
|
|
684
|
+
}).join("; ");
|
|
685
|
+
super({
|
|
686
|
+
message: errorMessages ? `GraphQL error: ${errorMessages}` : "Unexpected error from raw GraphQL client",
|
|
687
|
+
cause: opts.originalError,
|
|
688
|
+
additionalData: {
|
|
689
|
+
graphqlErrors: opts.errors,
|
|
690
|
+
graphqlData: opts.data
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
this.originalError = opts.originalError;
|
|
694
|
+
this.errors = opts.errors;
|
|
695
|
+
this.data = opts.data;
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
var DEFAULT_ERROR_MESSAGE_CONFIG = {
|
|
699
|
+
header: "Unknown Error",
|
|
700
|
+
message: "An unknown error has occurred",
|
|
701
|
+
isFullPage: false
|
|
702
|
+
};
|
|
703
|
+
var CUSTOM_ERROR_KEY_TO_PROPS = {
|
|
704
|
+
"shopifyArticle.failedToPublish": () => ({
|
|
705
|
+
header: "Shopify was unable to save this Article",
|
|
706
|
+
message: "Check that the Article does not contain invalid liquid code."
|
|
707
|
+
}),
|
|
708
|
+
"shopifySection.failedToPublish": () => ({
|
|
709
|
+
header: "Shopify was unable to save this Section",
|
|
710
|
+
message: "Check that the Section does not contain invalid liquid code."
|
|
711
|
+
}),
|
|
712
|
+
"page.failedToPublish": () => ({
|
|
713
|
+
header: "Shopify was unable to save this Page",
|
|
714
|
+
message: "Check that the Page does not contain invalid liquid code."
|
|
715
|
+
}),
|
|
716
|
+
"shopifyProductTemplate.failedToPublish": () => ({
|
|
717
|
+
header: "Shopify was unable to save this Product Template",
|
|
718
|
+
message: "Check that the Page does not contain invalid liquid code."
|
|
719
|
+
}),
|
|
720
|
+
"element.failedToPublish": () => ({
|
|
721
|
+
header: "Failed to Publish",
|
|
722
|
+
message: "Something went wrong publishing. Please try again"
|
|
723
|
+
}),
|
|
724
|
+
"element.failedToUpdate": () => ({
|
|
725
|
+
header: "Failed to Autosave",
|
|
726
|
+
message: "Your changes may not have been saved"
|
|
727
|
+
}),
|
|
728
|
+
"store.billingPlan.alreadyExist": () => ({
|
|
729
|
+
header: "Failed to change Plan",
|
|
730
|
+
message: "Same tier subscription already exists for this store"
|
|
731
|
+
}),
|
|
732
|
+
"error.assets.unsupportedFileType": ({ serverMessage }) => ({
|
|
733
|
+
header: "Unsupported file type",
|
|
734
|
+
message: serverMessage ?? "Please upload a file with a supported file type."
|
|
735
|
+
}),
|
|
736
|
+
"error.assets.fileTooLarge": () => ({
|
|
737
|
+
header: "File Too Large",
|
|
738
|
+
message: "Theme asset upload too large. Uploading to Files may accommodate larger assets."
|
|
739
|
+
}),
|
|
740
|
+
"error.files.fileTooLarge": () => ({
|
|
741
|
+
header: "File Too Large",
|
|
742
|
+
message: "File uploads must be smaller than 20MB and 20 Megapixels for images, and 1GB for videos. Please upload a smaller file or reach out to support@replo.app for help."
|
|
743
|
+
}),
|
|
744
|
+
base: () => {
|
|
745
|
+
return DEFAULT_ERROR_MESSAGE_CONFIG;
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
function extractErrorId(error) {
|
|
749
|
+
if (error instanceof ReploError) {
|
|
750
|
+
return error.id;
|
|
751
|
+
}
|
|
752
|
+
if (error && typeof error === "object") {
|
|
753
|
+
return error["reploErrorId"];
|
|
754
|
+
}
|
|
755
|
+
return void 0;
|
|
756
|
+
}
|
|
757
|
+
function addErrorIdIfNeeded(error) {
|
|
758
|
+
if (error && typeof error === "object" && !extractErrorId(error)) {
|
|
759
|
+
error["reploErrorId"] = crypto.randomUUID();
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
var errorUserFacingDetailsMessageSchema = z.object({
|
|
763
|
+
type: z.enum([
|
|
764
|
+
"toast",
|
|
765
|
+
"fullPageModal",
|
|
766
|
+
"shopifyStorePassword",
|
|
767
|
+
"billing.addPublishedElements",
|
|
768
|
+
"billing.addShopifyThemeProject",
|
|
769
|
+
"billing.addReploSite",
|
|
770
|
+
// Agent Billing ONLY
|
|
771
|
+
"agentBilling.shopifyThemeBuilder.publishedElements.exceeded",
|
|
772
|
+
"agentBilling.shopifyThemeBuilder.projects.exceeded",
|
|
773
|
+
"agentBilling.sites.exceeded",
|
|
774
|
+
"agentBilling.credits.exceeded",
|
|
775
|
+
"agentBilling.upgradeRequired"
|
|
776
|
+
]),
|
|
777
|
+
message: z.string(),
|
|
778
|
+
isRecoverable: z.boolean().optional(),
|
|
779
|
+
// NOTE (Matt 2024-03-22): We support detail being an array of strings
|
|
780
|
+
// in FullPageModal only.
|
|
781
|
+
detail: z.array(z.string()).or(z.string()).optional(),
|
|
782
|
+
key: z.string(),
|
|
783
|
+
usage: z.object({
|
|
784
|
+
current: z.number(),
|
|
785
|
+
maximum: z.number()
|
|
786
|
+
}).optional(),
|
|
787
|
+
plan: z.string().optional(),
|
|
788
|
+
callToAction: z.discriminatedUnion("type", [
|
|
789
|
+
z.object({ type: z.literal("reload") }),
|
|
790
|
+
z.object({ type: z.literal("installApp") }),
|
|
791
|
+
z.object({ type: z.literal("goToHomepage") }),
|
|
792
|
+
z.object({ type: z.literal("navigateToProjectEditor") }),
|
|
793
|
+
z.object({ type: z.literal("closeModal") }),
|
|
794
|
+
z.object({
|
|
795
|
+
type: z.literal("navigateToLink"),
|
|
796
|
+
link: z.discriminatedUnion("type", [
|
|
797
|
+
z.object({ type: z.literal("errors.wrongJsonExtension") }),
|
|
798
|
+
z.object({ type: z.literal("errors.chunkingError") }),
|
|
799
|
+
z.object({ type: z.literal("errors.indexBackupError") }),
|
|
800
|
+
z.object({
|
|
801
|
+
type: z.literal("errors.shopifyIntegrationAlreadyAssigned")
|
|
802
|
+
}),
|
|
803
|
+
z.object({
|
|
804
|
+
type: z.literal("errors.shopifyIntegrationMissingAccessScopes"),
|
|
805
|
+
url: z.string()
|
|
806
|
+
}),
|
|
807
|
+
z.object({
|
|
808
|
+
type: z.literal("customLink"),
|
|
809
|
+
url: z.string()
|
|
810
|
+
}),
|
|
811
|
+
z.object({
|
|
812
|
+
type: z.literal(
|
|
813
|
+
"errors.projectConnectedToBillingIntegrationForShopifyWorkspace"
|
|
814
|
+
)
|
|
815
|
+
}),
|
|
816
|
+
z.object({ type: z.literal("errors.themeAssetSizeLimitExceeded") }),
|
|
817
|
+
z.object({ type: z.literal("errors.themeTotalSizeLimitExceeded") }),
|
|
818
|
+
z.object({
|
|
819
|
+
type: z.literal("errors.pageMetafieldDefinitionsChanged")
|
|
820
|
+
}),
|
|
821
|
+
z.object({ type: z.literal("settings.billing") })
|
|
822
|
+
])
|
|
823
|
+
})
|
|
824
|
+
]).optional()
|
|
825
|
+
}).describe("ErrorUserFacingDetailsWithMessage");
|
|
826
|
+
var errorUserFacingDetailsSchema = z.discriminatedUnion("type", [
|
|
827
|
+
/**
|
|
828
|
+
* Normal errors, show error UI depending on the type
|
|
829
|
+
*/
|
|
830
|
+
errorUserFacingDetailsMessageSchema,
|
|
831
|
+
/**
|
|
832
|
+
* Errors which should be ignored by the frontend. This is uncommon, usually
|
|
833
|
+
* you want to show an error in the UI, and if you don't want to then you catch
|
|
834
|
+
* the error in your route.
|
|
835
|
+
*/
|
|
836
|
+
z.object({
|
|
837
|
+
type: z.literal("uncommon_none"),
|
|
838
|
+
key: z.string(),
|
|
839
|
+
usage: z.object({
|
|
840
|
+
current: z.number(),
|
|
841
|
+
maximum: z.number()
|
|
842
|
+
}).optional(),
|
|
843
|
+
message: z.string().optional(),
|
|
844
|
+
isRecoverable: z.boolean().optional(),
|
|
845
|
+
detail: z.array(z.string()).or(z.string()).optional()
|
|
846
|
+
})
|
|
847
|
+
]).describe("ErrorUserFacingDetails");
|
|
848
|
+
var extractErrorTrackingEventDetails = (error, transaction, tags = {}) => {
|
|
849
|
+
if (error instanceof ZodError) {
|
|
850
|
+
const errorId = extractErrorId(error);
|
|
851
|
+
return {
|
|
852
|
+
fingerprint: ["{{ default }}", transaction ?? ""],
|
|
853
|
+
extra: {
|
|
854
|
+
zodIssues: error.issues
|
|
855
|
+
},
|
|
856
|
+
tags: {
|
|
857
|
+
...tags,
|
|
858
|
+
...errorId ? { errorId } : {}
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
} else if (error && error instanceof ReploError) {
|
|
862
|
+
const fingerprint = ["{{ default }}"];
|
|
863
|
+
if (error.config.errorReportingDetails?.includeTransactionInFingerprint) {
|
|
864
|
+
fingerprint.push(transaction ?? "");
|
|
865
|
+
}
|
|
866
|
+
if (error.config.errorReportingDetails?.customFingerprint) {
|
|
867
|
+
fingerprint.push(...error.config.errorReportingDetails.customFingerprint);
|
|
868
|
+
}
|
|
869
|
+
const additionalDataStringValues = mapValues_default(
|
|
870
|
+
error.config.additionalData ?? {},
|
|
871
|
+
(value) => {
|
|
872
|
+
if (typeof value === "string") {
|
|
873
|
+
if (value.length > 1e3) {
|
|
874
|
+
return `${value.slice(0, 1e3)}...[truncated]`;
|
|
875
|
+
}
|
|
876
|
+
return value;
|
|
877
|
+
}
|
|
878
|
+
return JSON.stringify(value);
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
return {
|
|
882
|
+
fingerprint,
|
|
883
|
+
extra: error.config.additionalData,
|
|
884
|
+
tags: { errorId: error.id, ...additionalDataStringValues, ...tags }
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
if (error && error instanceof Error && hasOwnProperty(error, "cause")) {
|
|
888
|
+
const errorId = extractErrorId(error);
|
|
889
|
+
return {
|
|
890
|
+
extra: { cause: error.cause },
|
|
891
|
+
tags: { ...tags, ...errorId ? { errorId } : {} }
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
if (error && typeof error === "object") {
|
|
895
|
+
const errorId = extractErrorId(error);
|
|
896
|
+
return {
|
|
897
|
+
tags: { ...tags, ...errorId ? { errorId } : {} }
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
return null;
|
|
901
|
+
};
|
|
902
|
+
var shouldReportErrorToSentry = (error) => {
|
|
903
|
+
if (
|
|
904
|
+
// Note (Noah, 2024-01-21): Because Got doesn't allow throwing specific types
|
|
905
|
+
// of errors in the beforeError hook, we have to set the cause and map that
|
|
906
|
+
// instead, in order to implement globally mapped errors
|
|
907
|
+
error.cause instanceof ReploHTTPError || error.cause instanceof Uncommon_GloballyMappedError || error.cause instanceof ReploValidationError || error.cause instanceof ReploAuthenticationError
|
|
908
|
+
) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
if (error instanceof ReploHTTPError || error instanceof Uncommon_GloballyMappedError || error instanceof ReploValidationError || error instanceof ReploAuthenticationError) {
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
return true;
|
|
915
|
+
};
|
|
916
|
+
var CloudflareAgentCoordinatorRpcError = class extends ReploError {
|
|
917
|
+
constructor(error) {
|
|
918
|
+
super({
|
|
919
|
+
message: getErrorMessage(error)
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
var MiniappRpcError = class extends ReploError {
|
|
924
|
+
};
|
|
925
|
+
var MiniappRpcTimeoutError = class extends MiniappRpcError {
|
|
926
|
+
};
|
|
927
|
+
var MiniappRpcRemoteError = class extends MiniappRpcError {
|
|
928
|
+
};
|
|
929
|
+
var MiniappRpcUnmountedError = class extends MiniappRpcError {
|
|
930
|
+
};
|
|
931
|
+
|
|
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 };
|