@replohq/sdk 2.5.0 → 2.7.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/json.mjs +4 -4
- package/_vendor/replo-utils/lib/misc.mjs +726 -4
- package/_vendor/replo-utils/lib/object.mjs +3 -3
- package/_vendor/schemas/contentCollection.d.ts +2 -2
- package/_vendor/schemas/contentEntry.mjs +3 -3
- package/_vendor/schemas/contentManifest.mjs +6 -6
- package/_vendor/schemas/routing/locale.d.ts +1 -1
- package/_vendor/schemas/routing/locale.mjs +0 -5
- package/_vendor/schemas/routing/rules.d.ts +1 -1
- package/_vendor/schemas/routing/rules.mjs +0 -5
- package/analytics/pixel-meta.d.ts +14 -0
- package/analytics/pixel-meta.js +28 -0
- package/analytics/replo-first-party-pixel.d.ts +5 -4
- package/analytics/replo-first-party-pixel.js +7 -3
- package/analytics/replo-pixel-from-meta.d.ts +7 -0
- package/analytics/replo-pixel-from-meta.js +27 -0
- package/analytics/replo-pixel-script.d.ts +3 -1
- package/analytics/replo-pixel-script.js +4 -2
- package/cart/buy-now-action.d.ts +2 -13
- package/cart/buy-now-action.js +11 -75
- package/cart/checkout-actions.d.ts +34 -0
- package/cart/checkout-actions.js +27 -0
- package/cart/checkout-appearance.d.ts +35 -0
- package/cart/checkout-appearance.js +131 -0
- package/cart/checkout-session-actions.d.ts +20 -0
- package/cart/checkout-session-actions.js +12 -0
- package/cart/checkout.d.ts +110 -0
- package/cart/checkout.js +420 -0
- package/cart/start-stripe-checkout.d.ts +40 -0
- package/cart/start-stripe-checkout.js +75 -0
- package/{chunk-TTEBDCWT.mjs → chunk-4YTXURVN.mjs} +2 -2
- package/{chunk-O4QBR4QC.mjs → chunk-DMJ5VUD6.mjs} +2 -2
- package/{chunk-OPKMOW43.mjs → chunk-GNIXARC7.mjs} +1 -1
- package/{chunk-XWWFRIXV.mjs → chunk-N4WC2Z43.mjs} +1 -1
- package/{chunk-PSYP2DYM.mjs → chunk-QYGRVXWQ.mjs} +1 -1
- package/env.d.ts +1 -0
- package/env.js +1 -0
- package/gateways/canopy-api.d.ts +97 -0
- package/gateways/canopy-api.js +120 -0
- package/lib/buildMetadata.js +3 -3
- package/package.json +14 -4
- package/_vendor/replo-utils/lib/errors.d.ts +0 -84
- package/_vendor/schemas/errors.d.ts +0 -450
- package/_vendor/schemas/generated/errors.d.ts +0 -64
- package/chunk-XGXJOHUY.mjs +0 -724
- package/chunk-XSMYSAKY.mjs +0 -78
- /package/{chunk-ZPDXVFCR.mjs → chunk-JBCOJHZN.mjs} +0 -0
|
@@ -1,450 +0,0 @@
|
|
|
1
|
-
import type { ErrorUserFacingDetails, ErrorUserFacingDetailsWithMessage } from "./generated/errors";
|
|
2
|
-
import type { ReploErrorConfig } from "./reploError";
|
|
3
|
-
import * as z from "zod";
|
|
4
|
-
import { ReploError } from "./reploError";
|
|
5
|
-
export { ReploError, type ReploErrorConfig } from "./reploError";
|
|
6
|
-
/**
|
|
7
|
-
* Wraps an error so `async-retry` stops immediately instead of scheduling
|
|
8
|
-
* another attempt: the library rejects with any thrown error carrying a truthy
|
|
9
|
-
* `bail` property. Preserves the underlying error's message and keeps it as the
|
|
10
|
-
* cause so callers still surface the real failure.
|
|
11
|
-
*/
|
|
12
|
-
export declare class AsyncRetryBailError extends ReploError {
|
|
13
|
-
readonly bail = true;
|
|
14
|
-
constructor(cause: unknown);
|
|
15
|
-
}
|
|
16
|
-
export type AuthErrorType = "unauthenticated" | "unauthorized" | "notFound";
|
|
17
|
-
export type ReploAuthenticationErrorConfig = {
|
|
18
|
-
message: string;
|
|
19
|
-
type: AuthErrorType;
|
|
20
|
-
userFacingDetails?: ErrorUserFacingDetailsWithMessage;
|
|
21
|
-
additionalData?: ReploErrorConfig["additionalData"];
|
|
22
|
-
cause?: ReploErrorConfig["cause"];
|
|
23
|
-
};
|
|
24
|
-
export declare class ReploAuthenticationError extends ReploError {
|
|
25
|
-
type: AuthErrorType;
|
|
26
|
-
userFacingDetails?: ErrorUserFacingDetailsWithMessage;
|
|
27
|
-
constructor(config: ReploAuthenticationErrorConfig);
|
|
28
|
-
getHttpStatusCode(): 401 | 403 | 404;
|
|
29
|
-
getTRPCErrorCode(): "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND";
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Error which automatically makes all Replo services respond with a specific
|
|
33
|
-
* HTTP status code when caught. Should only be thrown from routes, makes it
|
|
34
|
-
* easier to provide a standardized way of implementing user-facing messages
|
|
35
|
-
*/
|
|
36
|
-
export declare class ReploHTTPError extends ReploError {
|
|
37
|
-
userFacingDetails: ErrorUserFacingDetails;
|
|
38
|
-
statusCode: number;
|
|
39
|
-
details?: object;
|
|
40
|
-
constructor(config: ReploErrorConfig & {
|
|
41
|
-
statusCode: number;
|
|
42
|
-
userFacingDetails: ErrorUserFacingDetails;
|
|
43
|
-
details?: object;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* HTTP error for callers that branch on `key` in code (SDKs, other services)
|
|
48
|
-
* rather than showing it in Replo's own UI, so it has no display `type`. The
|
|
49
|
-
* worker error handler answers `{ key, message, details, errorId }`. Should
|
|
50
|
-
* only be thrown from routes.
|
|
51
|
-
*/
|
|
52
|
-
export declare class ReploParseableHTTPError extends ReploError {
|
|
53
|
-
statusCode: number;
|
|
54
|
-
key: string;
|
|
55
|
-
userFacingMessage: string;
|
|
56
|
-
details?: Record<string, unknown>;
|
|
57
|
-
constructor(config: ReploErrorConfig & {
|
|
58
|
-
statusCode: number;
|
|
59
|
-
key: string;
|
|
60
|
-
userFacingMessage: string;
|
|
61
|
-
details?: Record<string, unknown>;
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Error used to represent an HTTP error that should be surfaced as such. This
|
|
66
|
-
* should be thrown when we want to pass the error through without changing the
|
|
67
|
-
* status code and without providing any user facing details (because this route
|
|
68
|
-
* is not serving the client e.g. when we're calling Mirror through the
|
|
69
|
-
* Publisher)
|
|
70
|
-
*/
|
|
71
|
-
export declare class ReploRawHTTPError extends ReploError {
|
|
72
|
-
statusCode: number;
|
|
73
|
-
errorType: string;
|
|
74
|
-
data?: object;
|
|
75
|
-
constructor(config: {
|
|
76
|
-
statusCode: number;
|
|
77
|
-
message: string;
|
|
78
|
-
errorType: string;
|
|
79
|
-
data?: object;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Error which is automatically mapped to a status code response wherever it's
|
|
84
|
-
* thrown. Errors which are thrown from many different places where we want to
|
|
85
|
-
* always respond in the same way should inherit this, e.g. an error thrown for
|
|
86
|
-
* any Shopify call when the user has uninstalled the app.
|
|
87
|
-
*
|
|
88
|
-
* Inheriting from this should be uncommon, for most errors we want to inherit
|
|
89
|
-
* from ReploError and catch/map them to ReploHTTPErrors in our routes. For the
|
|
90
|
-
* uncommon cases where we want to globally map errors this reduces boilerplate.
|
|
91
|
-
*
|
|
92
|
-
* Globally mapped errors are never reported to Sentry or logged.
|
|
93
|
-
*/
|
|
94
|
-
export declare class Uncommon_GloballyMappedError extends ReploError {
|
|
95
|
-
userFacingDetails: ErrorUserFacingDetails;
|
|
96
|
-
statusCode: number;
|
|
97
|
-
constructor(config: ReploErrorConfig & {
|
|
98
|
-
statusCode: number;
|
|
99
|
-
userFacingDetails: ErrorUserFacingDetails;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* The `userFacingDetails.key` publisher puts on its 404 for a missing project.
|
|
104
|
-
* It lives here rather than next to the error class because a caller across a
|
|
105
|
-
* service boundary (airlock) matches on it to tell "this project is gone" apart
|
|
106
|
-
* from any other 404 that URL could produce.
|
|
107
|
-
*/
|
|
108
|
-
export declare const PROJECT_NOT_FOUND_ERROR_KEY = "errors.project.notFound";
|
|
109
|
-
export declare class ReploValidationError extends ReploError {
|
|
110
|
-
constructor(message: string);
|
|
111
|
-
}
|
|
112
|
-
export declare class UnexpectedMutationError extends ReploError {
|
|
113
|
-
constructor();
|
|
114
|
-
}
|
|
115
|
-
export declare class UnexpectedRawGraphqlClientError extends ReploError {
|
|
116
|
-
originalError: unknown;
|
|
117
|
-
errors: unknown[];
|
|
118
|
-
data: unknown;
|
|
119
|
-
constructor(opts: {
|
|
120
|
-
originalError: unknown;
|
|
121
|
-
errors: unknown[];
|
|
122
|
-
data: unknown;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
export declare const DEFAULT_ERROR_MESSAGE_CONFIG: {
|
|
126
|
-
header: string;
|
|
127
|
-
message: string;
|
|
128
|
-
isFullPage: boolean;
|
|
129
|
-
};
|
|
130
|
-
export type ErrorDetails = {
|
|
131
|
-
header: string;
|
|
132
|
-
subheader?: string;
|
|
133
|
-
message?: string | string[] | React.ReactNode;
|
|
134
|
-
messageDetail?: string;
|
|
135
|
-
isRecoverable?: boolean;
|
|
136
|
-
isFullPage?: boolean;
|
|
137
|
-
usage?: {
|
|
138
|
-
current: number;
|
|
139
|
-
maximum: number;
|
|
140
|
-
};
|
|
141
|
-
callToAction?: {
|
|
142
|
-
type: "installApp";
|
|
143
|
-
} | {
|
|
144
|
-
type: "callback";
|
|
145
|
-
name: string;
|
|
146
|
-
onClick(): void;
|
|
147
|
-
} | {
|
|
148
|
-
type: "link";
|
|
149
|
-
name: string;
|
|
150
|
-
to: string;
|
|
151
|
-
target?: string;
|
|
152
|
-
} | {
|
|
153
|
-
type: "closeModal";
|
|
154
|
-
name: string;
|
|
155
|
-
} | {
|
|
156
|
-
type: "navigate";
|
|
157
|
-
location: {
|
|
158
|
-
type: "integrationHub";
|
|
159
|
-
} | {
|
|
160
|
-
type: "home";
|
|
161
|
-
} | {
|
|
162
|
-
type: "workspace";
|
|
163
|
-
workspaceId: string;
|
|
164
|
-
workspaceName: string;
|
|
165
|
-
};
|
|
166
|
-
} | {
|
|
167
|
-
type: "custom";
|
|
168
|
-
callToActionType: ErrorUserFacingDetailsWithMessage["callToAction"];
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Map of error keys to custom user-facing details. Should ONLY be used
|
|
173
|
-
* in cases where we want to override the default behavior of ErrorUserFacingDetails
|
|
174
|
-
* from the backend.
|
|
175
|
-
*/
|
|
176
|
-
export declare const CUSTOM_ERROR_KEY_TO_PROPS: {
|
|
177
|
-
"shopifyArticle.failedToPublish": () => {
|
|
178
|
-
header: string;
|
|
179
|
-
message: string;
|
|
180
|
-
};
|
|
181
|
-
"shopifySection.failedToPublish": () => {
|
|
182
|
-
header: string;
|
|
183
|
-
message: string;
|
|
184
|
-
};
|
|
185
|
-
"page.failedToPublish": () => {
|
|
186
|
-
header: string;
|
|
187
|
-
message: string;
|
|
188
|
-
};
|
|
189
|
-
"shopifyProductTemplate.failedToPublish": () => {
|
|
190
|
-
header: string;
|
|
191
|
-
message: string;
|
|
192
|
-
};
|
|
193
|
-
"element.failedToPublish": () => {
|
|
194
|
-
header: string;
|
|
195
|
-
message: string;
|
|
196
|
-
};
|
|
197
|
-
"element.failedToUpdate": () => {
|
|
198
|
-
header: string;
|
|
199
|
-
message: string;
|
|
200
|
-
};
|
|
201
|
-
"store.billingPlan.alreadyExist": () => {
|
|
202
|
-
header: string;
|
|
203
|
-
message: string;
|
|
204
|
-
};
|
|
205
|
-
"error.assets.unsupportedFileType": ({ serverMessage }: {
|
|
206
|
-
type: string;
|
|
207
|
-
serverMessage?: string;
|
|
208
|
-
endpoint: string | null;
|
|
209
|
-
}) => {
|
|
210
|
-
header: string;
|
|
211
|
-
message: string;
|
|
212
|
-
};
|
|
213
|
-
"error.assets.fileTooLarge": () => {
|
|
214
|
-
header: string;
|
|
215
|
-
message: string;
|
|
216
|
-
};
|
|
217
|
-
"error.files.fileTooLarge": () => {
|
|
218
|
-
header: string;
|
|
219
|
-
message: string;
|
|
220
|
-
};
|
|
221
|
-
base: () => {
|
|
222
|
-
header: string;
|
|
223
|
-
message: string;
|
|
224
|
-
isFullPage: boolean;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
export declare function extractErrorId(error: unknown): string | undefined;
|
|
228
|
-
export declare function addErrorIdIfNeeded(error: unknown): void;
|
|
229
|
-
export declare const errorUserFacingDetailsMessageSchema: z.ZodObject<{
|
|
230
|
-
type: z.ZodEnum<{
|
|
231
|
-
toast: "toast";
|
|
232
|
-
fullPageModal: "fullPageModal";
|
|
233
|
-
shopifyStorePassword: "shopifyStorePassword";
|
|
234
|
-
"billing.addPublishedElements": "billing.addPublishedElements";
|
|
235
|
-
"billing.addShopifyThemeProject": "billing.addShopifyThemeProject";
|
|
236
|
-
"billing.addReploSite": "billing.addReploSite";
|
|
237
|
-
"agentBilling.shopifyThemeBuilder.publishedElements.exceeded": "agentBilling.shopifyThemeBuilder.publishedElements.exceeded";
|
|
238
|
-
"agentBilling.shopifyThemeBuilder.projects.exceeded": "agentBilling.shopifyThemeBuilder.projects.exceeded";
|
|
239
|
-
"agentBilling.sites.exceeded": "agentBilling.sites.exceeded";
|
|
240
|
-
"agentBilling.credits.exceeded": "agentBilling.credits.exceeded";
|
|
241
|
-
"agentBilling.upgradeRequired": "agentBilling.upgradeRequired";
|
|
242
|
-
}>;
|
|
243
|
-
message: z.ZodString;
|
|
244
|
-
isRecoverable: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
-
detail: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
246
|
-
key: z.ZodString;
|
|
247
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
248
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
249
|
-
current: z.ZodNumber;
|
|
250
|
-
maximum: z.ZodNumber;
|
|
251
|
-
}, z.core.$strip>>;
|
|
252
|
-
plan: z.ZodOptional<z.ZodString>;
|
|
253
|
-
callToAction: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
-
type: z.ZodLiteral<"reload">;
|
|
255
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
256
|
-
type: z.ZodLiteral<"installApp">;
|
|
257
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
258
|
-
type: z.ZodLiteral<"goToHomepage">;
|
|
259
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
-
type: z.ZodLiteral<"navigateToProjectEditor">;
|
|
261
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
262
|
-
type: z.ZodLiteral<"closeModal">;
|
|
263
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
-
type: z.ZodLiteral<"navigateToLink">;
|
|
265
|
-
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
266
|
-
type: z.ZodLiteral<"errors.wrongJsonExtension">;
|
|
267
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
-
type: z.ZodLiteral<"errors.chunkingError">;
|
|
269
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
270
|
-
type: z.ZodLiteral<"errors.indexBackupError">;
|
|
271
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
272
|
-
type: z.ZodLiteral<"errors.shopifyIntegrationAlreadyAssigned">;
|
|
273
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
-
type: z.ZodLiteral<"errors.shopifyIntegrationMissingAccessScopes">;
|
|
275
|
-
url: z.ZodString;
|
|
276
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
277
|
-
type: z.ZodLiteral<"customLink">;
|
|
278
|
-
url: z.ZodString;
|
|
279
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
280
|
-
type: z.ZodLiteral<"errors.projectConnectedToBillingIntegrationForShopifyWorkspace">;
|
|
281
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
-
type: z.ZodLiteral<"errors.themeAssetSizeLimitExceeded">;
|
|
283
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
284
|
-
type: z.ZodLiteral<"errors.themeTotalSizeLimitExceeded">;
|
|
285
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
-
type: z.ZodLiteral<"errors.pageMetafieldDefinitionsChanged">;
|
|
287
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
-
type: z.ZodLiteral<"settings.billing">;
|
|
289
|
-
}, z.core.$strip>], "type">;
|
|
290
|
-
}, z.core.$strip>], "type">>;
|
|
291
|
-
}, z.core.$strip>;
|
|
292
|
-
/**
|
|
293
|
-
* Schema for user-facing details which the frontend uses to show toasts, modals, etc
|
|
294
|
-
* when an error is thrown from the backend
|
|
295
|
-
*/
|
|
296
|
-
export declare const errorUserFacingDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
297
|
-
type: z.ZodEnum<{
|
|
298
|
-
toast: "toast";
|
|
299
|
-
fullPageModal: "fullPageModal";
|
|
300
|
-
shopifyStorePassword: "shopifyStorePassword";
|
|
301
|
-
"billing.addPublishedElements": "billing.addPublishedElements";
|
|
302
|
-
"billing.addShopifyThemeProject": "billing.addShopifyThemeProject";
|
|
303
|
-
"billing.addReploSite": "billing.addReploSite";
|
|
304
|
-
"agentBilling.shopifyThemeBuilder.publishedElements.exceeded": "agentBilling.shopifyThemeBuilder.publishedElements.exceeded";
|
|
305
|
-
"agentBilling.shopifyThemeBuilder.projects.exceeded": "agentBilling.shopifyThemeBuilder.projects.exceeded";
|
|
306
|
-
"agentBilling.sites.exceeded": "agentBilling.sites.exceeded";
|
|
307
|
-
"agentBilling.credits.exceeded": "agentBilling.credits.exceeded";
|
|
308
|
-
"agentBilling.upgradeRequired": "agentBilling.upgradeRequired";
|
|
309
|
-
}>;
|
|
310
|
-
message: z.ZodString;
|
|
311
|
-
isRecoverable: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
-
detail: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
313
|
-
key: z.ZodString;
|
|
314
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
315
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
316
|
-
current: z.ZodNumber;
|
|
317
|
-
maximum: z.ZodNumber;
|
|
318
|
-
}, z.core.$strip>>;
|
|
319
|
-
plan: z.ZodOptional<z.ZodString>;
|
|
320
|
-
callToAction: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
321
|
-
type: z.ZodLiteral<"reload">;
|
|
322
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
-
type: z.ZodLiteral<"installApp">;
|
|
324
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
325
|
-
type: z.ZodLiteral<"goToHomepage">;
|
|
326
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
327
|
-
type: z.ZodLiteral<"navigateToProjectEditor">;
|
|
328
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
329
|
-
type: z.ZodLiteral<"closeModal">;
|
|
330
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
-
type: z.ZodLiteral<"navigateToLink">;
|
|
332
|
-
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
333
|
-
type: z.ZodLiteral<"errors.wrongJsonExtension">;
|
|
334
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
335
|
-
type: z.ZodLiteral<"errors.chunkingError">;
|
|
336
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
-
type: z.ZodLiteral<"errors.indexBackupError">;
|
|
338
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
339
|
-
type: z.ZodLiteral<"errors.shopifyIntegrationAlreadyAssigned">;
|
|
340
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
341
|
-
type: z.ZodLiteral<"errors.shopifyIntegrationMissingAccessScopes">;
|
|
342
|
-
url: z.ZodString;
|
|
343
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
344
|
-
type: z.ZodLiteral<"customLink">;
|
|
345
|
-
url: z.ZodString;
|
|
346
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
347
|
-
type: z.ZodLiteral<"errors.projectConnectedToBillingIntegrationForShopifyWorkspace">;
|
|
348
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
-
type: z.ZodLiteral<"errors.themeAssetSizeLimitExceeded">;
|
|
350
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
351
|
-
type: z.ZodLiteral<"errors.themeTotalSizeLimitExceeded">;
|
|
352
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
353
|
-
type: z.ZodLiteral<"errors.pageMetafieldDefinitionsChanged">;
|
|
354
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
355
|
-
type: z.ZodLiteral<"settings.billing">;
|
|
356
|
-
}, z.core.$strip>], "type">;
|
|
357
|
-
}, z.core.$strip>], "type">>;
|
|
358
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
359
|
-
type: z.ZodLiteral<"uncommon_none">;
|
|
360
|
-
key: z.ZodString;
|
|
361
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
362
|
-
current: z.ZodNumber;
|
|
363
|
-
maximum: z.ZodNumber;
|
|
364
|
-
}, z.core.$strip>>;
|
|
365
|
-
message: z.ZodOptional<z.ZodString>;
|
|
366
|
-
isRecoverable: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
-
detail: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodString]>>;
|
|
368
|
-
}, z.core.$strip>], "type">;
|
|
369
|
-
export declare const extractErrorTrackingEventDetails: (error: unknown, transaction: string | undefined, tags?: Record<string, string>) => {
|
|
370
|
-
fingerprint: string[];
|
|
371
|
-
extra: {
|
|
372
|
-
zodIssues: z.core.$ZodIssue[];
|
|
373
|
-
cause?: undefined;
|
|
374
|
-
};
|
|
375
|
-
tags: {
|
|
376
|
-
errorId?: string | undefined;
|
|
377
|
-
};
|
|
378
|
-
} | {
|
|
379
|
-
fingerprint: string[];
|
|
380
|
-
extra: Record<string, unknown> | undefined;
|
|
381
|
-
tags: {
|
|
382
|
-
errorId: string;
|
|
383
|
-
};
|
|
384
|
-
} | {
|
|
385
|
-
extra: {
|
|
386
|
-
cause: unknown;
|
|
387
|
-
zodIssues?: undefined;
|
|
388
|
-
};
|
|
389
|
-
tags: {
|
|
390
|
-
errorId?: string | undefined;
|
|
391
|
-
};
|
|
392
|
-
fingerprint?: undefined;
|
|
393
|
-
} | {
|
|
394
|
-
tags: {
|
|
395
|
-
errorId?: string | undefined;
|
|
396
|
-
};
|
|
397
|
-
fingerprint?: undefined;
|
|
398
|
-
extra?: undefined;
|
|
399
|
-
} | null;
|
|
400
|
-
export declare const shouldReportErrorToSentry: (error: Error) => boolean;
|
|
401
|
-
export declare class CloudflareAgentCoordinatorRpcError extends ReploError {
|
|
402
|
-
constructor(error: unknown);
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Failures on the shared iframe RPC channel (miniapp ↔ parent, canopy ↔ WB).
|
|
406
|
-
* Live next to other domain errors so callers get ReploError reporting without
|
|
407
|
-
* a `replo-utils → schemas` workspace cycle (schemas already depends on
|
|
408
|
-
* replo-utils; the channel implementation lives in `schemas/iframeRpcChannel`).
|
|
409
|
-
*/
|
|
410
|
-
export declare abstract class IframeRpcChannelError extends ReploError {
|
|
411
|
-
}
|
|
412
|
-
export declare class IframeRpcChannelTimeoutError extends IframeRpcChannelError {
|
|
413
|
-
constructor({ method, timeoutMs }: {
|
|
414
|
-
method: string;
|
|
415
|
-
timeoutMs: number;
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
export declare class IframeRpcChannelTargetUnavailableError extends IframeRpcChannelError {
|
|
419
|
-
constructor({ callType, method, }: {
|
|
420
|
-
callType: "notify" | "request" | "response";
|
|
421
|
-
method?: string;
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
export declare class IframeRpcChannelRemoteError extends IframeRpcChannelError {
|
|
425
|
-
constructor({ method, message }: {
|
|
426
|
-
method: string;
|
|
427
|
-
message: string;
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
export declare class IframeRpcChannelUnsubscribedError extends IframeRpcChannelError {
|
|
431
|
-
constructor({ method }: {
|
|
432
|
-
method: string;
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
export declare class IframeRpcChannelUnknownMethodError extends IframeRpcChannelError {
|
|
436
|
-
constructor({ method }: {
|
|
437
|
-
method: string;
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
export declare class IframeRpcChannelConfigurationError extends IframeRpcChannelError {
|
|
441
|
-
constructor({ message }: {
|
|
442
|
-
message: string;
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
export declare class IframeRpcChannelInvalidInputError extends IframeRpcChannelError {
|
|
446
|
-
constructor({ method, cause }: {
|
|
447
|
-
method: string;
|
|
448
|
-
cause: z.ZodError;
|
|
449
|
-
});
|
|
450
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export type ErrorUserFacingDetailsWithMessage = {
|
|
2
|
-
type: "toast" | "fullPageModal" | "shopifyStorePassword" | "billing.addPublishedElements" | "billing.addShopifyThemeProject" | "billing.addReploSite" | "agentBilling.shopifyThemeBuilder.publishedElements.exceeded" | "agentBilling.shopifyThemeBuilder.projects.exceeded" | "agentBilling.sites.exceeded" | "agentBilling.credits.exceeded" | "agentBilling.upgradeRequired";
|
|
3
|
-
message: string;
|
|
4
|
-
isRecoverable?: boolean;
|
|
5
|
-
detail?: string[] | string;
|
|
6
|
-
key: string;
|
|
7
|
-
details?: {
|
|
8
|
-
[x: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
usage?: {
|
|
11
|
-
current: number;
|
|
12
|
-
maximum: number;
|
|
13
|
-
};
|
|
14
|
-
plan?: string;
|
|
15
|
-
callToAction?: {
|
|
16
|
-
type: "reload";
|
|
17
|
-
} | {
|
|
18
|
-
type: "installApp";
|
|
19
|
-
} | {
|
|
20
|
-
type: "goToHomepage";
|
|
21
|
-
} | {
|
|
22
|
-
type: "navigateToProjectEditor";
|
|
23
|
-
} | {
|
|
24
|
-
type: "closeModal";
|
|
25
|
-
} | {
|
|
26
|
-
type: "navigateToLink";
|
|
27
|
-
link: {
|
|
28
|
-
type: "errors.wrongJsonExtension";
|
|
29
|
-
} | {
|
|
30
|
-
type: "errors.chunkingError";
|
|
31
|
-
} | {
|
|
32
|
-
type: "errors.indexBackupError";
|
|
33
|
-
} | {
|
|
34
|
-
type: "errors.shopifyIntegrationAlreadyAssigned";
|
|
35
|
-
} | {
|
|
36
|
-
type: "errors.shopifyIntegrationMissingAccessScopes";
|
|
37
|
-
url: string;
|
|
38
|
-
} | {
|
|
39
|
-
type: "customLink";
|
|
40
|
-
url: string;
|
|
41
|
-
} | {
|
|
42
|
-
type: "errors.projectConnectedToBillingIntegrationForShopifyWorkspace";
|
|
43
|
-
} | {
|
|
44
|
-
type: "errors.themeAssetSizeLimitExceeded";
|
|
45
|
-
} | {
|
|
46
|
-
type: "errors.themeTotalSizeLimitExceeded";
|
|
47
|
-
} | {
|
|
48
|
-
type: "errors.pageMetafieldDefinitionsChanged";
|
|
49
|
-
} | {
|
|
50
|
-
type: "settings.billing";
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export type ErrorUserFacingDetails = ErrorUserFacingDetailsWithMessage | {
|
|
55
|
-
type: "uncommon_none";
|
|
56
|
-
key: string;
|
|
57
|
-
usage?: {
|
|
58
|
-
current: number;
|
|
59
|
-
maximum: number;
|
|
60
|
-
};
|
|
61
|
-
message?: string;
|
|
62
|
-
isRecoverable?: boolean;
|
|
63
|
-
detail?: string[] | string;
|
|
64
|
-
};
|