@01.software/sdk 0.37.0 → 0.39.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/README.md +189 -84
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +1286 -109
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.js +1286 -109
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-DyELGUcL.d.ts → collection-client-CaMgs5KE.d.ts} +18 -12
- package/dist/{collection-client-zOmnxwdA.d.cts → collection-client-DVfB0Em1.d.cts} +18 -12
- package/dist/const-6XHz_jej.d.ts +32 -0
- package/dist/const-B5KT72c7.d.cts +32 -0
- package/dist/errors.cjs +4 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +4 -1
- package/dist/errors.js.map +1 -1
- package/dist/{index-DRJs7QIh.d.cts → index-BOLQxveo.d.cts} +3 -3
- package/dist/{index-DTqoUZk_.d.ts → index-CSwR2HSg.d.ts} +3 -3
- package/dist/index.cjs +2861 -2714
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2861 -2714
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-CREOjFNT.d.cts → payload-types-m3jjhxk9.d.cts} +418 -106
- package/dist/{payload-types-CREOjFNT.d.ts → payload-types-m3jjhxk9.d.ts} +418 -106
- package/dist/query.cjs +244 -1093
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +159 -34
- package/dist/query.d.ts +159 -34
- package/dist/query.js +244 -1093
- package/dist/query.js.map +1 -1
- package/dist/realtime.cjs +5 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +5 -1
- package/dist/realtime.js.map +1 -1
- package/dist/server.cjs +1191 -22
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +1191 -22
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +144 -0
- package/dist/storefront-cache.cjs.map +1 -0
- package/dist/storefront-cache.d.cts +24 -0
- package/dist/storefront-cache.d.ts +24 -0
- package/dist/storefront-cache.js +121 -0
- package/dist/storefront-cache.js.map +1 -0
- package/dist/{types-DMvVHdb1.d.ts → types-BQo7UdI9.d.cts} +1608 -1215
- package/dist/{types-BWMUr3Zw.d.cts → types-CVf8sCZ-.d.ts} +1608 -1215
- package/dist/{types-CxzWHspI.d.ts → types-Cmrd1ezc.d.ts} +1 -15
- package/dist/{types-BkZNhuBh.d.cts → types-D0ubzQw0.d.cts} +1 -15
- package/dist/ui/canvas/server.cjs +5 -1
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.js +5 -1
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +5 -1
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.js +5 -1
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/package.json +11 -1
- package/dist/const-CK_FPaIn.d.cts +0 -32
- package/dist/const-Dqz05oaG.d.ts +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
2
|
-
import { C as CollectionType, P as PublicProduct } from './types-
|
|
3
|
-
import { O as Order,
|
|
1
|
+
import { P as PublicCollection, S as ServerCollection } from './const-6XHz_jej.js';
|
|
2
|
+
import { C as CollectionType, P as PublicProduct } from './types-Cmrd1ezc.js';
|
|
3
|
+
import { O as Order, l as Transaction, m as Fulfillment, R as Return } from './payload-types-m3jjhxk9.js';
|
|
4
4
|
|
|
5
5
|
interface CustomerScopedApiOptions {
|
|
6
6
|
publishableKey?: string;
|
|
@@ -27,6 +27,10 @@ declare class CustomerScopedApi {
|
|
|
27
27
|
protected request<T>(endpoint: string, options: CustomerScopedRequestOptions): Promise<T>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
type RawCommunityPost = CollectionType<'posts'>;
|
|
31
|
+
type RawCommunityComment = CollectionType<'comments'>;
|
|
32
|
+
type RawCommunityReaction = CollectionType<'reactions'>;
|
|
33
|
+
type RawCommunityBookmark = CollectionType<'bookmarks'>;
|
|
30
34
|
interface CommunityClientOptions {
|
|
31
35
|
publishableKey?: string;
|
|
32
36
|
secretKey?: string;
|
|
@@ -35,10 +39,82 @@ interface CommunityClientOptions {
|
|
|
35
39
|
onUnauthorized?: () => Promise<string | null>;
|
|
36
40
|
onRequestId?: (id: string | null) => void;
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
type CommunityPublicMediaAsset = string | {
|
|
43
|
+
id?: string | number | null;
|
|
44
|
+
alt?: string | null;
|
|
45
|
+
width?: number | null;
|
|
46
|
+
height?: number | null;
|
|
47
|
+
mimeType?: string | null;
|
|
48
|
+
filename?: string | null;
|
|
49
|
+
url?: string | null;
|
|
50
|
+
sizes?: Record<string, {
|
|
51
|
+
width?: number | null;
|
|
52
|
+
height?: number | null;
|
|
53
|
+
mimeType?: string | null;
|
|
54
|
+
filename?: string | null;
|
|
55
|
+
url?: string | null;
|
|
56
|
+
}> | null;
|
|
57
|
+
};
|
|
58
|
+
type CommunityPublicReference = string | {
|
|
59
|
+
id?: string | number | null;
|
|
60
|
+
title?: string | null;
|
|
61
|
+
name?: string | null;
|
|
62
|
+
slug?: string | null;
|
|
63
|
+
displayName?: string | null;
|
|
64
|
+
handle?: string | null;
|
|
65
|
+
color?: string | null;
|
|
66
|
+
image?: CommunityPublicMediaAsset | null;
|
|
67
|
+
thumbnail?: CommunityPublicMediaAsset | null;
|
|
68
|
+
avatar?: CommunityPublicMediaAsset | null;
|
|
69
|
+
};
|
|
70
|
+
interface CommunityPublicAuthorSnapshot {
|
|
71
|
+
displayName?: string | null;
|
|
72
|
+
handle?: string | null;
|
|
73
|
+
avatarUrl?: string | null;
|
|
74
|
+
avatar?: CommunityPublicMediaAsset | null;
|
|
75
|
+
}
|
|
76
|
+
/** Public read shape for projected community post endpoints. */
|
|
77
|
+
interface CommunityPost {
|
|
78
|
+
id: RawCommunityPost['id'];
|
|
79
|
+
title?: RawCommunityPost['title'];
|
|
80
|
+
slug?: RawCommunityPost['slug'];
|
|
81
|
+
content?: RawCommunityPost['content'];
|
|
82
|
+
status?: RawCommunityPost['status'];
|
|
83
|
+
thumbnail?: CommunityPublicMediaAsset | null;
|
|
84
|
+
categories?: CommunityPublicReference[] | null;
|
|
85
|
+
tags?: CommunityPublicReference[] | null;
|
|
86
|
+
authorProfile?: CommunityPublicReference | null;
|
|
87
|
+
authorSnapshot?: CommunityPublicAuthorSnapshot | null;
|
|
88
|
+
viewCount?: RawCommunityPost['viewCount'];
|
|
89
|
+
commentCount?: RawCommunityPost['commentCount'];
|
|
90
|
+
reactionCount?: RawCommunityPost['reactionCount'];
|
|
91
|
+
isPinned?: RawCommunityPost['isPinned'];
|
|
92
|
+
allowsComments?: RawCommunityPost['allowsComments'];
|
|
93
|
+
isEdited?: RawCommunityPost['isEdited'];
|
|
94
|
+
editedAt?: RawCommunityPost['editedAt'];
|
|
95
|
+
lastActivityAt?: RawCommunityPost['lastActivityAt'];
|
|
96
|
+
publishedAt?: RawCommunityPost['publishedAt'];
|
|
97
|
+
createdAt: RawCommunityPost['createdAt'];
|
|
98
|
+
updatedAt: RawCommunityPost['updatedAt'];
|
|
99
|
+
}
|
|
100
|
+
/** Public read shape for projected community comment endpoints. */
|
|
101
|
+
interface CommunityComment {
|
|
102
|
+
id: RawCommunityComment['id'];
|
|
103
|
+
body?: RawCommunityComment['body'];
|
|
104
|
+
post?: CommunityPublicReference | null;
|
|
105
|
+
parent?: CommunityPublicReference | null;
|
|
106
|
+
rootComment?: CommunityPublicReference | null;
|
|
107
|
+
authorProfile?: CommunityPublicReference | null;
|
|
108
|
+
authorSnapshot?: CommunityPublicAuthorSnapshot | null;
|
|
109
|
+
depth?: RawCommunityComment['depth'];
|
|
110
|
+
status?: RawCommunityComment['status'];
|
|
111
|
+
reactionCount?: RawCommunityComment['reactionCount'];
|
|
112
|
+
replyCount?: RawCommunityComment['replyCount'];
|
|
113
|
+
isEdited?: RawCommunityComment['isEdited'];
|
|
114
|
+
editedAt?: RawCommunityComment['editedAt'];
|
|
115
|
+
createdAt: RawCommunityComment['createdAt'];
|
|
116
|
+
updatedAt: RawCommunityComment['updatedAt'];
|
|
117
|
+
}
|
|
42
118
|
/** @deprecated Use {@link CommunityComment}. */
|
|
43
119
|
type Comment = CommunityComment;
|
|
44
120
|
/** Public read shape for `post-categories`. */
|
|
@@ -49,10 +125,11 @@ type CommunityPostListSort = 'createdAt' | '-createdAt' | 'lastActivityAt' | '-l
|
|
|
49
125
|
type CommunityCommentListSort = 'createdAt' | '-createdAt';
|
|
50
126
|
interface Reaction {
|
|
51
127
|
id: string;
|
|
52
|
-
post?:
|
|
53
|
-
comment?:
|
|
54
|
-
type?:
|
|
128
|
+
post?: CommunityPublicReference | null;
|
|
129
|
+
comment?: CommunityPublicReference | null;
|
|
130
|
+
type?: CommunityPublicReference | null;
|
|
55
131
|
createdAt?: string;
|
|
132
|
+
updatedAt?: string;
|
|
56
133
|
[key: string]: unknown;
|
|
57
134
|
}
|
|
58
135
|
interface ReactionSummary {
|
|
@@ -62,8 +139,9 @@ interface ReactionSummary {
|
|
|
62
139
|
}
|
|
63
140
|
interface Bookmark {
|
|
64
141
|
id: string;
|
|
65
|
-
post?: string;
|
|
142
|
+
post?: string | CommunityPost | null;
|
|
66
143
|
createdAt?: string;
|
|
144
|
+
updatedAt?: string;
|
|
67
145
|
[key: string]: unknown;
|
|
68
146
|
}
|
|
69
147
|
interface ReactionType {
|
|
@@ -85,6 +163,10 @@ interface PaginatedResponse<T> {
|
|
|
85
163
|
prevPage: number | null;
|
|
86
164
|
nextPage: number | null;
|
|
87
165
|
}
|
|
166
|
+
type CommunityPostMutationResponse = CommunityPost | RawCommunityPost;
|
|
167
|
+
type CommunityCommentMutationResponse = CommunityComment | RawCommunityComment;
|
|
168
|
+
type CommunityReactionMutationResponse = Reaction | RawCommunityReaction;
|
|
169
|
+
type CommunityBookmarkMutationResponse = Bookmark | RawCommunityBookmark;
|
|
88
170
|
declare class CommunityClient extends CustomerScopedApi {
|
|
89
171
|
constructor(options: CommunityClientOptions);
|
|
90
172
|
private buildQuery;
|
|
@@ -97,7 +179,7 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
97
179
|
content?: unknown;
|
|
98
180
|
categories?: string[];
|
|
99
181
|
thumbnail?: string;
|
|
100
|
-
}): Promise<
|
|
182
|
+
}): Promise<CommunityPostMutationResponse>;
|
|
101
183
|
/**
|
|
102
184
|
* Public post feed. Server applies the same visibility contract as
|
|
103
185
|
* `communityPostRead` (published + visible + moderation-safe).
|
|
@@ -143,7 +225,7 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
143
225
|
postId: string;
|
|
144
226
|
body: string;
|
|
145
227
|
parentId?: string;
|
|
146
|
-
}): Promise<
|
|
228
|
+
}): Promise<CommunityCommentMutationResponse>;
|
|
147
229
|
/**
|
|
148
230
|
* List comments for a post.
|
|
149
231
|
*
|
|
@@ -169,12 +251,10 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
169
251
|
updateComment(params: {
|
|
170
252
|
commentId: string;
|
|
171
253
|
body: string;
|
|
172
|
-
}): Promise<
|
|
254
|
+
}): Promise<CommunityCommentMutationResponse>;
|
|
173
255
|
deleteComment(params: {
|
|
174
256
|
commentId: string;
|
|
175
|
-
}): Promise<
|
|
176
|
-
success: boolean;
|
|
177
|
-
}>;
|
|
257
|
+
}): Promise<CommunityCommentMutationResponse>;
|
|
178
258
|
reportComment(params: {
|
|
179
259
|
commentId: string;
|
|
180
260
|
reason?: string;
|
|
@@ -187,7 +267,7 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
187
267
|
typeSlug?: string;
|
|
188
268
|
/** @deprecated Use `typeSlug`. */
|
|
189
269
|
type?: string;
|
|
190
|
-
}): Promise<
|
|
270
|
+
}): Promise<CommunityReactionMutationResponse>;
|
|
191
271
|
removeReaction(params: {
|
|
192
272
|
postId: string;
|
|
193
273
|
type: string;
|
|
@@ -199,7 +279,7 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
199
279
|
typeSlug?: string;
|
|
200
280
|
/** @deprecated Use `typeSlug`. */
|
|
201
281
|
type?: string;
|
|
202
|
-
}): Promise<
|
|
282
|
+
}): Promise<CommunityReactionMutationResponse>;
|
|
203
283
|
removeCommentReaction(params: {
|
|
204
284
|
commentId: string;
|
|
205
285
|
type: string;
|
|
@@ -215,7 +295,7 @@ declare class CommunityClient extends CustomerScopedApi {
|
|
|
215
295
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
216
296
|
addBookmark(params: {
|
|
217
297
|
postId: string;
|
|
218
|
-
}): Promise<
|
|
298
|
+
}): Promise<CommunityBookmarkMutationResponse>;
|
|
219
299
|
removeBookmark(params: {
|
|
220
300
|
postId: string;
|
|
221
301
|
}): Promise<{
|
|
@@ -290,1304 +370,1515 @@ declare class ModerationApi extends BaseApi {
|
|
|
290
370
|
}>;
|
|
291
371
|
}
|
|
292
372
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
phone?: string | null;
|
|
311
|
-
authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
|
|
312
|
-
isGuest?: boolean | null;
|
|
313
|
-
marketingConsent?: MarketingConsent | null;
|
|
314
|
-
metadata?: Record<string, unknown> | null;
|
|
315
|
-
groups?: string[];
|
|
316
|
-
}
|
|
317
|
-
interface CustomerRegisterData {
|
|
318
|
-
name: string;
|
|
319
|
-
email: string;
|
|
320
|
-
password: string;
|
|
321
|
-
phone?: string;
|
|
322
|
-
}
|
|
323
|
-
interface CustomerRegisterResponse {
|
|
324
|
-
customer: CustomerProfile;
|
|
325
|
-
}
|
|
326
|
-
interface CustomerLoginData {
|
|
327
|
-
email: string;
|
|
328
|
-
password: string;
|
|
329
|
-
}
|
|
330
|
-
interface CustomerRefreshResponse {
|
|
331
|
-
token: string;
|
|
332
|
-
}
|
|
333
|
-
interface UpdateProfileData {
|
|
334
|
-
name?: string;
|
|
335
|
-
phone?: string;
|
|
336
|
-
marketingConsent?: MarketingConsent;
|
|
337
|
-
}
|
|
338
|
-
interface CustomerAuthOptions {
|
|
339
|
-
/**
|
|
340
|
-
* Persist token in localStorage. Defaults to `true`.
|
|
341
|
-
* - `true` (default): uses key `'customer-token'`
|
|
342
|
-
* - `string`: uses the given string as localStorage key
|
|
343
|
-
* - `false`: disables persistence (token/onTokenChange used instead)
|
|
344
|
-
*
|
|
345
|
-
* Handles SSR safely (no-op on server).
|
|
346
|
-
* When enabled, `token` and `onTokenChange` are ignored.
|
|
347
|
-
*/
|
|
348
|
-
persist?: boolean | string;
|
|
349
|
-
/** Initial token (e.g. from SSR cookie) */
|
|
350
|
-
token?: string;
|
|
351
|
-
/** Called when token changes (login/logout) — use to persist in localStorage/cookie */
|
|
352
|
-
onTokenChange?: (token: string | null) => void;
|
|
353
|
-
}
|
|
373
|
+
type PublicMediaSize = {
|
|
374
|
+
width?: number | null;
|
|
375
|
+
height?: number | null;
|
|
376
|
+
mimeType?: string | null;
|
|
377
|
+
filename?: string | null;
|
|
378
|
+
url?: string | null;
|
|
379
|
+
};
|
|
380
|
+
type PublicMediaAsset = string | {
|
|
381
|
+
id?: string | number | null;
|
|
382
|
+
alt?: string | null;
|
|
383
|
+
width?: number | null;
|
|
384
|
+
height?: number | null;
|
|
385
|
+
mimeType?: string | null;
|
|
386
|
+
filename?: string | null;
|
|
387
|
+
url?: string | null;
|
|
388
|
+
sizes?: Record<string, PublicMediaSize>;
|
|
389
|
+
};
|
|
354
390
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
* Manages customer registration, login, logout, and token lifecycle.
|
|
359
|
-
* All requests include X-Publishable-Key for tenant resolution.
|
|
360
|
-
*/
|
|
361
|
-
declare class CustomerAuth {
|
|
362
|
-
private publishableKey;
|
|
363
|
-
private baseUrl;
|
|
364
|
-
private token;
|
|
365
|
-
private onTokenChange?;
|
|
366
|
-
private refreshPromise;
|
|
367
|
-
constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
|
|
368
|
-
/**
|
|
369
|
-
* Register a new customer account
|
|
370
|
-
*/
|
|
371
|
-
register(data: CustomerRegisterData): Promise<CustomerRegisterResponse>;
|
|
372
|
-
/**
|
|
373
|
-
* Login with email and password. Stores the token internally.
|
|
374
|
-
*/
|
|
375
|
-
login(data: CustomerLoginData): Promise<CustomerAuthResponse>;
|
|
376
|
-
/**
|
|
377
|
-
* Refresh the current token. Requires a valid (non-expired) token.
|
|
378
|
-
*/
|
|
379
|
-
refreshToken(): Promise<CustomerRefreshResponse>;
|
|
380
|
-
private _doRefreshToken;
|
|
381
|
-
/**
|
|
382
|
-
* Clear the stored token
|
|
383
|
-
*/
|
|
384
|
-
logout(): void;
|
|
385
|
-
/**
|
|
386
|
-
* Get the current authenticated customer's profile
|
|
387
|
-
*/
|
|
388
|
-
me(): Promise<CustomerProfile | null>;
|
|
389
|
-
/**
|
|
390
|
-
* Request a password reset email
|
|
391
|
-
*/
|
|
392
|
-
forgotPassword(email: string): Promise<void>;
|
|
393
|
-
/**
|
|
394
|
-
* Reset password using a token from the reset email
|
|
395
|
-
*/
|
|
396
|
-
resetPassword(token: string, password: string): Promise<void>;
|
|
391
|
+
type OrderApiOptions = ServerApiOptions;
|
|
392
|
+
/** Header-only; never sent in the JSON body. */
|
|
393
|
+
type WithIdempotencyKey<T> = T & {
|
|
397
394
|
/**
|
|
398
|
-
*
|
|
395
|
+
* Client-generated key for safe retries. Sent as `X-Idempotency-Key` when the
|
|
396
|
+
* server endpoint supports HTTP idempotency.
|
|
399
397
|
*/
|
|
400
|
-
|
|
398
|
+
idempotencyKey?: string;
|
|
399
|
+
};
|
|
400
|
+
type CustomerSnapshot = {
|
|
401
|
+
name?: string;
|
|
402
|
+
email: string;
|
|
403
|
+
phone?: string;
|
|
404
|
+
};
|
|
405
|
+
type PublicOrderReference = string | {
|
|
406
|
+
id?: string | number | null;
|
|
407
|
+
title?: string | null;
|
|
408
|
+
name?: string | null;
|
|
409
|
+
slug?: string | null;
|
|
410
|
+
displayName?: string | null;
|
|
411
|
+
handle?: string | null;
|
|
412
|
+
color?: string | null;
|
|
413
|
+
image?: PublicMediaAsset | null;
|
|
414
|
+
thumbnail?: PublicMediaAsset | null;
|
|
415
|
+
avatar?: PublicMediaAsset | null;
|
|
416
|
+
};
|
|
417
|
+
type PublicOrderItem = {
|
|
418
|
+
id?: string | number;
|
|
419
|
+
product?: PublicOrderReference;
|
|
420
|
+
variant?: PublicOrderReference;
|
|
421
|
+
productTitle?: string | null;
|
|
422
|
+
variantTitle?: string | null;
|
|
423
|
+
sku?: string | null;
|
|
424
|
+
quantity?: number | null;
|
|
425
|
+
unitPrice?: number | null;
|
|
426
|
+
discountedUnitPrice?: number | null;
|
|
427
|
+
totalPrice?: number | null;
|
|
428
|
+
options?: unknown;
|
|
429
|
+
createdAt?: string | null;
|
|
430
|
+
updatedAt?: string | null;
|
|
431
|
+
image?: PublicMediaAsset | null;
|
|
432
|
+
};
|
|
433
|
+
type PublicOrder = {
|
|
434
|
+
id?: string | number;
|
|
435
|
+
orderNumber?: string | null;
|
|
436
|
+
status?: string | null;
|
|
437
|
+
displayStatus?: string | null;
|
|
438
|
+
primaryDisplayStatus?: string | null;
|
|
439
|
+
displayFinancialStatus?: string | null;
|
|
440
|
+
displayFulfillmentStatus?: string | null;
|
|
441
|
+
returnDisplayStatus?: string | null;
|
|
442
|
+
totalAmount?: number | null;
|
|
443
|
+
subtotalAmount?: number | null;
|
|
444
|
+
shippingAmount?: number | null;
|
|
445
|
+
discountAmount?: number | null;
|
|
446
|
+
taxAmount?: number | null;
|
|
447
|
+
refundedAmount?: number | null;
|
|
448
|
+
currency?: string | null;
|
|
449
|
+
customerNote?: string | null;
|
|
450
|
+
createdAt?: string | null;
|
|
451
|
+
updatedAt?: string | null;
|
|
452
|
+
customerSnapshot?: {
|
|
453
|
+
name?: string | null;
|
|
454
|
+
email?: string | null;
|
|
455
|
+
phone?: string | null;
|
|
456
|
+
};
|
|
457
|
+
shippingAddress?: {
|
|
458
|
+
recipientName?: string | null;
|
|
459
|
+
phone?: string | null;
|
|
460
|
+
postalCode?: string | null;
|
|
461
|
+
address1?: string | null;
|
|
462
|
+
address2?: string | null;
|
|
463
|
+
jibunAddress?: string | null;
|
|
464
|
+
administrativeArea?: string | null;
|
|
465
|
+
city?: string | null;
|
|
466
|
+
province?: string | null;
|
|
467
|
+
country?: string | null;
|
|
468
|
+
deliveryMemo?: string | null;
|
|
469
|
+
address?: string | null;
|
|
470
|
+
detailAddress?: string | null;
|
|
471
|
+
deliveryMessage?: string | null;
|
|
472
|
+
};
|
|
473
|
+
items?: PublicOrderItem[];
|
|
474
|
+
};
|
|
475
|
+
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
|
|
476
|
+
type ReturnItem = {
|
|
477
|
+
orderItem: string | number;
|
|
478
|
+
quantity: number;
|
|
479
|
+
restockAction?: RestockAction;
|
|
480
|
+
restockingFee?: number;
|
|
481
|
+
};
|
|
482
|
+
type OrderCreateEntityID = string | number;
|
|
483
|
+
type CreateOrderItem = {
|
|
401
484
|
/**
|
|
402
|
-
*
|
|
485
|
+
* Compatibility input: the create-order endpoint derives the line's product
|
|
486
|
+
* from the variant's parent server-side; storefront items may omit this.
|
|
403
487
|
*/
|
|
404
|
-
|
|
488
|
+
product?: OrderCreateEntityID;
|
|
489
|
+
variant: OrderCreateEntityID;
|
|
405
490
|
/**
|
|
406
|
-
*
|
|
491
|
+
* Compatibility input: accepted but unused by the create-order endpoint;
|
|
492
|
+
* option selection is snapshotted server-side from the variant.
|
|
407
493
|
*/
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
limit?: number;
|
|
411
|
-
status?: string;
|
|
412
|
-
}): Promise<PayloadFindResponse<Order>>;
|
|
494
|
+
option?: OrderCreateEntityID;
|
|
495
|
+
quantity: number;
|
|
413
496
|
/**
|
|
414
|
-
*
|
|
497
|
+
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
498
|
+
* derives authoritative line pricing from the product variant.
|
|
415
499
|
*/
|
|
416
|
-
|
|
500
|
+
unitPrice?: number;
|
|
417
501
|
/**
|
|
418
|
-
*
|
|
502
|
+
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
503
|
+
* derives authoritative line totals from the product variant.
|
|
419
504
|
*/
|
|
420
|
-
|
|
505
|
+
totalPrice?: number;
|
|
506
|
+
};
|
|
507
|
+
type CreateOrderLineItemsInput = {
|
|
508
|
+
orderItems: CreateOrderItem[];
|
|
509
|
+
items?: never;
|
|
510
|
+
} | {
|
|
421
511
|
/**
|
|
422
|
-
*
|
|
512
|
+
* Storefront-facing alias for orderItems. The SDK serializes this to
|
|
513
|
+
* orderItems for the existing create-order endpoint.
|
|
423
514
|
*/
|
|
424
|
-
|
|
515
|
+
items: CreateOrderItem[];
|
|
425
516
|
/**
|
|
426
|
-
*
|
|
427
|
-
* Auth endpoints don't retry — failures are final.
|
|
517
|
+
* @deprecated Use items for storefront-facing create-order inputs.
|
|
428
518
|
*/
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
interface CartApiOptions {
|
|
433
|
-
publishableKey?: string;
|
|
434
|
-
secretKey?: string;
|
|
435
|
-
apiUrl?: string;
|
|
436
|
-
customerToken?: string | (() => string | null);
|
|
437
|
-
onUnauthorized?: () => Promise<string | null>;
|
|
438
|
-
onRequestId?: (id: string | null) => void;
|
|
439
|
-
}
|
|
440
|
-
type AddItemParams = {
|
|
441
|
-
cartId: string;
|
|
442
|
-
product: string;
|
|
443
|
-
variant: string;
|
|
444
|
-
option: string;
|
|
445
|
-
quantity: number;
|
|
446
|
-
};
|
|
447
|
-
type UpdateItemParams = {
|
|
448
|
-
cartItemId: string;
|
|
449
|
-
quantity: number;
|
|
450
|
-
};
|
|
451
|
-
type RemoveItemParams = {
|
|
452
|
-
cartItemId: string;
|
|
519
|
+
orderItems?: never;
|
|
453
520
|
};
|
|
454
|
-
type
|
|
455
|
-
|
|
456
|
-
|
|
521
|
+
type CreateOrderBodyBase = {
|
|
522
|
+
orderNumber: string;
|
|
523
|
+
customer?: string;
|
|
524
|
+
customerSnapshot: CustomerSnapshot;
|
|
525
|
+
shippingAddress: Order['shippingAddress'];
|
|
526
|
+
totalAmount: number;
|
|
527
|
+
shippingAmount?: number;
|
|
528
|
+
pgPaymentId?: string;
|
|
529
|
+
discountCode?: string;
|
|
457
530
|
};
|
|
458
|
-
type
|
|
459
|
-
|
|
531
|
+
type CreateOrderParams = WithIdempotencyKey<CreateOrderBodyBase & CreateOrderLineItemsInput>;
|
|
532
|
+
type UpdateOrderParams = {
|
|
533
|
+
orderNumber: string;
|
|
534
|
+
status: 'confirmed';
|
|
460
535
|
};
|
|
461
|
-
type
|
|
462
|
-
|
|
536
|
+
type TransactionStatus = 'pending' | 'paid' | 'failed' | 'canceled';
|
|
537
|
+
type UpdateTransactionParams = {
|
|
538
|
+
pgPaymentId: string;
|
|
539
|
+
status: TransactionStatus;
|
|
540
|
+
paymentMethod?: string;
|
|
541
|
+
receiptUrl?: string;
|
|
542
|
+
paymentKey?: string;
|
|
543
|
+
amount?: number;
|
|
463
544
|
};
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
545
|
+
type ConfirmPaymentParams = WithIdempotencyKey<{
|
|
546
|
+
orderNumber?: string;
|
|
547
|
+
pgPaymentId: string;
|
|
548
|
+
pgProvider: string;
|
|
549
|
+
pgOrderId?: string;
|
|
550
|
+
amount: number;
|
|
551
|
+
currency?: string;
|
|
552
|
+
paymentMethod?: string;
|
|
553
|
+
receiptUrl?: string;
|
|
554
|
+
approvedAt?: string;
|
|
555
|
+
providerStatus?: string;
|
|
556
|
+
/** Provider event id; also used as idempotency key when `idempotencyKey` is omitted. */
|
|
557
|
+
providerEventId?: string;
|
|
558
|
+
paymentKey?: string;
|
|
559
|
+
confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
|
|
560
|
+
metadata?: Record<string, unknown>;
|
|
561
|
+
}>;
|
|
562
|
+
type ConfirmPaymentResponse = {
|
|
563
|
+
orderId: string;
|
|
564
|
+
transactionId: string;
|
|
565
|
+
status: 'paid';
|
|
566
|
+
alreadyConfirmed?: boolean;
|
|
486
567
|
};
|
|
487
|
-
|
|
488
|
-
type
|
|
489
|
-
type
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
type ProductSelectionVariant<TMedia> = {
|
|
493
|
-
id?: string | number | null;
|
|
494
|
-
images?: Array<TMedia | string | number | null | undefined> | null;
|
|
568
|
+
type CancelReasonCode = 'customer' | 'inventory' | 'fraud' | 'declined' | 'staff' | 'other';
|
|
569
|
+
type CancelOrderStatus = 'pending' | 'paid' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed' | 'return_requested' | 'return_processing' | 'returned';
|
|
570
|
+
type CancelOrderReconciliationStatus = Exclude<CancelOrderStatus, 'pending' | 'canceled'>;
|
|
571
|
+
type CancelOrderResponseBase = {
|
|
572
|
+
orderId: string;
|
|
495
573
|
};
|
|
496
|
-
type
|
|
497
|
-
|
|
498
|
-
|
|
574
|
+
type CancelOrderUnpaidCommittedResponseFields = {
|
|
575
|
+
refundedAmount: 0;
|
|
576
|
+
providerRefunded: false;
|
|
499
577
|
};
|
|
500
|
-
type
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
506
|
-
selectedVariant?: ProductSelectionVariant<TMedia> | null;
|
|
507
|
-
matchingVariants?: Array<ProductSelectionVariant<TMedia> | null | undefined> | null;
|
|
508
|
-
selectedOptionValues?: Array<ProductSelectionOptionValue | null | undefined> | null;
|
|
578
|
+
type CancelOrderPaidCommittedResponseFields = {
|
|
579
|
+
transactionId: string;
|
|
580
|
+
refundedAmount: 0;
|
|
581
|
+
providerRefunded: false;
|
|
582
|
+
refundPending: true;
|
|
509
583
|
};
|
|
510
|
-
type
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
584
|
+
type CancelOrderLegacyProviderRefundResponseFields = {
|
|
585
|
+
transactionId: string;
|
|
586
|
+
refundedAmount: number;
|
|
587
|
+
refundSeq: number;
|
|
588
|
+
providerRefunded: true;
|
|
514
589
|
};
|
|
515
|
-
type
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
listingPrimaryImage?: ProductSelectionMediaPointer;
|
|
590
|
+
type CancelOrderAlreadyCanceledResponseFields = {
|
|
591
|
+
refundedAmount: number;
|
|
592
|
+
providerRefunded: false;
|
|
519
593
|
};
|
|
520
|
-
type
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
594
|
+
type CancelOrderAlreadyCanceledRefundPendingResponseFields = {
|
|
595
|
+
transactionId: string;
|
|
596
|
+
refundedAmount: number;
|
|
597
|
+
providerRefunded: false;
|
|
598
|
+
refundPending: true;
|
|
524
599
|
};
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
productMediaPool?: TMedia[] | null;
|
|
529
|
-
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
530
|
-
productThumbnail?: TMedia | string | number | null;
|
|
531
|
-
listingPrimaryImage?: TMedia | string | number | null;
|
|
532
|
-
resolvedPrimary?: TMedia | null;
|
|
533
|
-
resolvedSource?: ProductMediaResolutionSource;
|
|
600
|
+
type CancelOrderPaidCommittedResponse = CancelOrderResponseBase & CancelOrderPaidCommittedResponseFields & {
|
|
601
|
+
status: 'canceled';
|
|
602
|
+
cancelCommitted: true;
|
|
534
603
|
};
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
type RelationshipValue = string | number | null | undefined | {
|
|
539
|
-
id?: string | number | null;
|
|
604
|
+
type CancelOrderUnpaidCommittedResponse = CancelOrderResponseBase & CancelOrderUnpaidCommittedResponseFields & {
|
|
605
|
+
status: 'canceled';
|
|
606
|
+
cancelCommitted: true;
|
|
540
607
|
};
|
|
541
|
-
type
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
color?: string | null;
|
|
547
|
-
mediaItemId?: RelationshipValue;
|
|
608
|
+
type CancelOrderCommittedResponse = CancelOrderPaidCommittedResponse | CancelOrderUnpaidCommittedResponse;
|
|
609
|
+
type CancelOrderAlreadyCanceledResponse = CancelOrderResponseBase & CancelOrderAlreadyCanceledResponseFields & {
|
|
610
|
+
status: 'canceled';
|
|
611
|
+
cancelCommitted: false;
|
|
612
|
+
alreadyCanceled: true;
|
|
548
613
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
slug?: string | null;
|
|
554
|
-
swatch?: ProductOptionValueSwatch | ProductOptionValueSwatchInput | null;
|
|
555
|
-
_order?: string | null;
|
|
556
|
-
'_product-option-values_values_order'?: string | null;
|
|
557
|
-
}
|
|
558
|
-
interface ProductOptionShape {
|
|
559
|
-
id?: string | number | null;
|
|
560
|
-
title?: string | null;
|
|
561
|
-
slug?: string | null;
|
|
562
|
-
_order?: string | null;
|
|
563
|
-
'_product-options_options_order'?: string | null;
|
|
564
|
-
values?: {
|
|
565
|
-
docs?: unknown[];
|
|
566
|
-
} | null;
|
|
567
|
-
}
|
|
568
|
-
interface ProductVariantShape {
|
|
569
|
-
id?: string | number | null;
|
|
570
|
-
optionValues?: unknown[] | null;
|
|
571
|
-
price?: number | null;
|
|
572
|
-
compareAtPrice?: number | null;
|
|
573
|
-
stock?: number | null;
|
|
574
|
-
reservedStock?: number | null;
|
|
575
|
-
isUnlimited?: boolean | null;
|
|
576
|
-
isActive?: boolean | null;
|
|
577
|
-
thumbnail?: MediaValue;
|
|
578
|
-
images?: MediaValue[] | null;
|
|
579
|
-
_order?: string | null;
|
|
580
|
-
}
|
|
581
|
-
interface ProductListingProductShape {
|
|
582
|
-
id?: EntityID;
|
|
583
|
-
thumbnail?: MediaValue;
|
|
584
|
-
primaryMediaItemId?: MediaValue;
|
|
585
|
-
images?: MediaValue[] | null;
|
|
586
|
-
listing?: {
|
|
587
|
-
primaryImage?: MediaValue;
|
|
588
|
-
} | null;
|
|
589
|
-
}
|
|
590
|
-
type ProductOptionMatrixValue = {
|
|
591
|
-
id: string;
|
|
592
|
-
optionId: string;
|
|
593
|
-
optionSlug: string;
|
|
594
|
-
label: string;
|
|
595
|
-
slug: string | null;
|
|
596
|
-
swatch: ProductOptionValueSwatch;
|
|
597
|
-
order: string;
|
|
614
|
+
type CancelOrderAlreadyCanceledRefundPendingResponse = CancelOrderResponseBase & CancelOrderAlreadyCanceledRefundPendingResponseFields & {
|
|
615
|
+
status: 'canceled';
|
|
616
|
+
cancelCommitted: false;
|
|
617
|
+
alreadyCanceled: true;
|
|
598
618
|
};
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
values: ProductOptionMatrixValue[];
|
|
619
|
+
/** @deprecated Inline PG cancel reconciliation; retained for legacy API consumers. */
|
|
620
|
+
type CancelOrderReconciliationResponse = CancelOrderResponseBase & CancelOrderLegacyProviderRefundResponseFields & {
|
|
621
|
+
status: CancelOrderReconciliationStatus;
|
|
622
|
+
cancelCommitted: false;
|
|
623
|
+
reconciliationRequired: true;
|
|
605
624
|
};
|
|
606
|
-
type
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
625
|
+
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse | CancelOrderReconciliationResponse;
|
|
626
|
+
type CancelOrderParams = {
|
|
627
|
+
orderNumber: string;
|
|
628
|
+
reasonCode?: CancelReasonCode;
|
|
629
|
+
reasonDetail?: string;
|
|
630
|
+
idempotencyKey?: string;
|
|
612
631
|
};
|
|
613
|
-
type
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
valueToOptionSlug: Map<string, string>;
|
|
622
|
-
variants: ProductOptionMatrixVariant<TVariant>[];
|
|
632
|
+
type ResolveCancelRefundOutcome = 'succeeded' | 'failed';
|
|
633
|
+
type ResolveCancelRefundSucceededParams = {
|
|
634
|
+
orderNumber: string;
|
|
635
|
+
idempotencyKey: string;
|
|
636
|
+
outcome: 'succeeded';
|
|
637
|
+
refundedAmount: number;
|
|
638
|
+
pgProvider: string;
|
|
639
|
+
pgRefundId: string;
|
|
623
640
|
};
|
|
624
|
-
type
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
isPriceRange: boolean;
|
|
632
|
-
availableForSale: boolean;
|
|
641
|
+
type ResolveCancelRefundFailedParams = {
|
|
642
|
+
orderNumber: string;
|
|
643
|
+
idempotencyKey: string;
|
|
644
|
+
outcome: 'failed';
|
|
645
|
+
refundedAmount: 0;
|
|
646
|
+
pgProvider: string;
|
|
647
|
+
pgRefundId?: string;
|
|
633
648
|
};
|
|
634
|
-
type
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
variantIds: EntityID[];
|
|
643
|
-
variantCount: number;
|
|
644
|
-
variants: TVariant[];
|
|
645
|
-
listing: ProductListingProjection;
|
|
649
|
+
type ResolveCancelRefundParams = ResolveCancelRefundSucceededParams | ResolveCancelRefundFailedParams;
|
|
650
|
+
type ResolveCancelRefundSucceededResponse = {
|
|
651
|
+
orderId: string;
|
|
652
|
+
transactionId: string;
|
|
653
|
+
refundTransactionId: string;
|
|
654
|
+
refundedAmount: number;
|
|
655
|
+
refundStatus: 'succeeded';
|
|
656
|
+
transactionStatus: 'refunded';
|
|
646
657
|
};
|
|
647
|
-
type
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
type ProductListingSwatch = {
|
|
655
|
-
optionId: EntityID;
|
|
656
|
-
optionValueId: EntityID;
|
|
657
|
-
label: string;
|
|
658
|
-
swatch: ProductOptionValueSwatch<ProductDetailMedia>;
|
|
659
|
-
href: string;
|
|
660
|
-
availableForSale: boolean;
|
|
661
|
-
};
|
|
662
|
-
type ProductListingCardRepresentativeVariant = ProductListingGroupsItem['groups'][number]['variants'][number];
|
|
663
|
-
type ProductListingCard = {
|
|
664
|
-
id: EntityID;
|
|
665
|
-
href: string;
|
|
666
|
-
title: string;
|
|
667
|
-
representativeVariant?: ProductListingCardRepresentativeVariant | null;
|
|
668
|
-
primaryImage: ProductDetailMedia | null;
|
|
669
|
-
priceRange: ProductListingCardPriceRange;
|
|
670
|
-
availableForSale: boolean;
|
|
671
|
-
swatches: ProductListingSwatch[];
|
|
672
|
-
};
|
|
673
|
-
type ProductSelectionByOptionValue = string | number | null | undefined | {
|
|
674
|
-
valueId?: string | number | null;
|
|
675
|
-
valueSlug?: string | null;
|
|
676
|
-
};
|
|
677
|
-
type ProductSelectionInput = {
|
|
678
|
-
variantId?: string | number | null;
|
|
679
|
-
byOptionSlug?: Record<string, ProductSelectionByOptionValue>;
|
|
680
|
-
byOptionId?: Record<string, ProductSelectionByOptionValue>;
|
|
681
|
-
valueIds?: Iterable<unknown>;
|
|
682
|
-
search?: string | URLSearchParams | URL | null;
|
|
683
|
-
};
|
|
684
|
-
type NormalizedProductSelection = {
|
|
685
|
-
byOptionSlug: Record<string, string>;
|
|
686
|
-
byOptionId: Record<string, string>;
|
|
687
|
-
valueIds: string[];
|
|
688
|
-
variantId: string | null;
|
|
689
|
-
};
|
|
690
|
-
type CompatibilityProductSelectionParamEvent = {
|
|
691
|
-
optionId: string;
|
|
692
|
-
optionSlug: string;
|
|
693
|
-
valueSlug: string;
|
|
694
|
-
searchParam: string;
|
|
658
|
+
type ResolveCancelRefundFailedResponse = {
|
|
659
|
+
orderId: string;
|
|
660
|
+
transactionId: string;
|
|
661
|
+
refundTransactionId: string;
|
|
662
|
+
refundedAmount: 0;
|
|
663
|
+
refundStatus: 'failed';
|
|
664
|
+
transactionStatus: 'paid';
|
|
695
665
|
};
|
|
696
|
-
type
|
|
697
|
-
type
|
|
698
|
-
type
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
*/
|
|
704
|
-
fillDefaults?: boolean;
|
|
705
|
-
onCompatibilityOptionIdParam?: (event: CompatibilityProductSelectionParamEvent) => void;
|
|
706
|
-
onLegacyOptionIdParam?: (event: LegacyProductSelectionParamEvent) => void;
|
|
666
|
+
type ResolveCancelRefundResponse = ResolveCancelRefundSucceededResponse | ResolveCancelRefundFailedResponse;
|
|
667
|
+
type RestockAction = 'return_to_stock' | 'discard';
|
|
668
|
+
type ReturnWithRefundItem = {
|
|
669
|
+
orderItem: string | number;
|
|
670
|
+
quantity: number;
|
|
671
|
+
restockAction?: RestockAction;
|
|
672
|
+
restockingFee?: number;
|
|
707
673
|
};
|
|
708
|
-
type
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
674
|
+
type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
675
|
+
orderNumber: string;
|
|
676
|
+
reason?: ReturnReason;
|
|
677
|
+
reasonDetail?: string;
|
|
678
|
+
returnItems: ReturnWithRefundItem[];
|
|
679
|
+
refundAmount: number;
|
|
680
|
+
returnShippingFee?: number;
|
|
681
|
+
initialShippingRefundAmount?: number;
|
|
682
|
+
initialShippingRefundOverrideNote?: string;
|
|
683
|
+
pgPaymentId: string;
|
|
684
|
+
paymentKey?: string;
|
|
685
|
+
refundReceiptUrl?: string;
|
|
686
|
+
}>;
|
|
687
|
+
type CheckoutParams = WithIdempotencyKey<{
|
|
688
|
+
cartId: string;
|
|
689
|
+
orderNumber: string;
|
|
690
|
+
customerSnapshot: CustomerSnapshot;
|
|
691
|
+
pgPaymentId?: string;
|
|
692
|
+
discountCode?: string;
|
|
693
|
+
}>;
|
|
694
|
+
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
695
|
+
orderNumber: string;
|
|
696
|
+
fulfillmentOrderId?: string | number;
|
|
697
|
+
carrier?: string;
|
|
698
|
+
trackingNumber?: string;
|
|
699
|
+
items?: Array<{
|
|
700
|
+
orderItem: string;
|
|
701
|
+
quantity: number;
|
|
702
|
+
}>;
|
|
703
|
+
}>;
|
|
704
|
+
type PrepareFulfillmentOrderParams = {
|
|
705
|
+
orderNumber: string;
|
|
713
706
|
};
|
|
714
|
-
type
|
|
715
|
-
|
|
716
|
-
|
|
707
|
+
type PrepareFulfillmentOrderResponse = {
|
|
708
|
+
orderId: string;
|
|
709
|
+
fulfillmentOrders: Array<{
|
|
710
|
+
id: string;
|
|
711
|
+
status: string;
|
|
712
|
+
}>;
|
|
717
713
|
};
|
|
718
|
-
type
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
selected: boolean;
|
|
724
|
-
available: boolean;
|
|
725
|
-
exists: boolean;
|
|
726
|
-
availableForSale: boolean;
|
|
727
|
-
isUnlimited: boolean;
|
|
728
|
-
availableStock: number | null;
|
|
729
|
-
swatch: ProductOptionValueSwatch;
|
|
714
|
+
type UpdateFulfillmentParams = {
|
|
715
|
+
fulfillmentId: string;
|
|
716
|
+
status?: 'shipped' | 'delivered' | 'failed';
|
|
717
|
+
carrier?: string;
|
|
718
|
+
trackingNumber?: string;
|
|
730
719
|
};
|
|
731
|
-
type
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
availableValuesByOptionId: Record<string, ProductSelectionAvailableValue[]>;
|
|
738
|
-
allOptionsSelected: boolean;
|
|
739
|
-
price: {
|
|
740
|
-
min: number | null;
|
|
741
|
-
max: number | null;
|
|
742
|
-
compareAtMin: number | null;
|
|
743
|
-
compareAtMax: number | null;
|
|
744
|
-
isRange: boolean;
|
|
745
|
-
};
|
|
746
|
-
media: {
|
|
747
|
-
primaryImage: ProductDetailMedia | null;
|
|
748
|
-
images: ProductDetailMedia[];
|
|
749
|
-
source?: ProductMediaResolutionSource;
|
|
750
|
-
};
|
|
751
|
-
stock: {
|
|
752
|
-
availableForSale: boolean;
|
|
753
|
-
isUnlimited: boolean;
|
|
754
|
-
stock: number | null;
|
|
755
|
-
reservedStock: number | null;
|
|
756
|
-
availableStock: number | null;
|
|
757
|
-
};
|
|
720
|
+
type BulkImportFulfillmentsParams = {
|
|
721
|
+
items: Array<{
|
|
722
|
+
orderNumber: string;
|
|
723
|
+
carrier: string;
|
|
724
|
+
trackingNumber: string;
|
|
725
|
+
}>;
|
|
758
726
|
};
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
declare function getSelectedValueByOptionId<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): Map<string, string>;
|
|
769
|
-
declare function normalizeSelectedValueIds<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): string[];
|
|
770
|
-
declare function getAvailableOptionValues<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, optionId: string, selectedValueIds: Iterable<unknown>): ProductOptionMatrixValue[];
|
|
771
|
-
declare function resolveVariantForSelection<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): ProductOptionMatrixVariant<TVariant> | undefined;
|
|
772
|
-
declare function normalizeProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
773
|
-
declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
774
|
-
declare function parseProductSelection(detail: ProductDetail, search: string | URLSearchParams | URL | null | undefined, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
775
|
-
declare function stringifyProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): string;
|
|
776
|
-
declare function createProductSelectionCodec(detail: ProductDetail, options?: ProductSelectionCodecOptions): {
|
|
777
|
-
parse: (search: string | URLSearchParams | URL | null | undefined) => NormalizedProductSelection;
|
|
778
|
-
stringify: (selection?: ProductSelectionInput) => string;
|
|
727
|
+
type BulkImportFulfillmentsResponse = {
|
|
728
|
+
succeeded: Array<{
|
|
729
|
+
orderNumber: string;
|
|
730
|
+
fulfillmentId: string;
|
|
731
|
+
}>;
|
|
732
|
+
failed: Array<{
|
|
733
|
+
orderNumber: string;
|
|
734
|
+
error: string;
|
|
735
|
+
}>;
|
|
779
736
|
};
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
737
|
+
type CreateReturnParams = WithIdempotencyKey<{
|
|
738
|
+
orderNumber: string;
|
|
739
|
+
reason?: ReturnReason;
|
|
740
|
+
reasonDetail?: string;
|
|
741
|
+
returnItems: ReturnItem[];
|
|
742
|
+
refundAmount: number;
|
|
743
|
+
returnShippingFee?: number;
|
|
744
|
+
initialShippingRefundAmount?: number;
|
|
745
|
+
initialShippingRefundOverrideNote?: string;
|
|
786
746
|
}>;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
product?: {
|
|
791
|
-
slug?: string | null;
|
|
792
|
-
} | null;
|
|
793
|
-
};
|
|
794
|
-
type ProductHrefGroup = {
|
|
795
|
-
optionId?: string | number | null;
|
|
796
|
-
optionSlug?: string | null;
|
|
797
|
-
optionValueId?: string | number | null;
|
|
798
|
-
optionValueSlug?: string | null;
|
|
799
|
-
variantId?: string | number | null;
|
|
800
|
-
listing?: {
|
|
801
|
-
selectionHintVariant?: string | number | null;
|
|
802
|
-
} | null;
|
|
803
|
-
};
|
|
804
|
-
type ProductHrefOptions = {
|
|
805
|
-
basePath?: string;
|
|
806
|
-
detail?: ProductDetail;
|
|
807
|
-
matrix?: ProductOptionMatrix<ProductDetailVariant>;
|
|
808
|
-
selection?: ProductSelectionInput;
|
|
809
|
-
trailingSlash?: boolean;
|
|
810
|
-
emit?: ProductSelectionUrlEmit;
|
|
811
|
-
preferCompleteVariantFromHint?: boolean;
|
|
812
|
-
};
|
|
813
|
-
type ProductListingCardOptions = {
|
|
814
|
-
basePath?: string;
|
|
815
|
-
trailingSlash?: boolean;
|
|
816
|
-
emit?: ProductSelectionUrlEmit;
|
|
817
|
-
preferCompleteVariantFromHint?: boolean;
|
|
818
|
-
};
|
|
819
|
-
declare function buildProductHref(product: ProductHrefProduct, group?: ProductHrefGroup | null, options?: ProductHrefOptions): string;
|
|
820
|
-
declare function buildProductListingProjection(product: ProductListingProductShape | null | undefined, variants: ProductVariantShape[]): ProductListingProjection;
|
|
821
|
-
declare function buildProductListingCard(item: ProductListingGroupsItem, options?: ProductListingCardOptions): ProductListingCard;
|
|
822
|
-
/** Shopify `priceRangeV2` naming for persisted listing projection fields. */
|
|
823
|
-
declare function toShopifyPriceRangeV2(listing: {
|
|
824
|
-
minPrice?: number | null;
|
|
825
|
-
maxPrice?: number | null;
|
|
826
|
-
}): {
|
|
827
|
-
minVariantPrice: {
|
|
828
|
-
amount: number | null;
|
|
829
|
-
};
|
|
830
|
-
maxVariantPrice: {
|
|
831
|
-
amount: number | null;
|
|
832
|
-
};
|
|
747
|
+
type UpdateReturnParams = {
|
|
748
|
+
returnId: string;
|
|
749
|
+
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
833
750
|
};
|
|
751
|
+
declare class OrderApi extends BaseApi {
|
|
752
|
+
constructor(options: OrderApiOptions);
|
|
753
|
+
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
754
|
+
updateOrder(params: UpdateOrderParams): Promise<Order>;
|
|
755
|
+
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
756
|
+
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
757
|
+
cancelOrder(params: CancelOrderParams): Promise<CancelOrderResponse>;
|
|
758
|
+
resolveCancelRefund(params: ResolveCancelRefundParams): Promise<ResolveCancelRefundResponse>;
|
|
759
|
+
checkout(params: CheckoutParams): Promise<PublicOrder>;
|
|
760
|
+
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
761
|
+
prepareFulfillmentOrder(params: PrepareFulfillmentOrderParams): Promise<PrepareFulfillmentOrderResponse>;
|
|
762
|
+
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
763
|
+
bulkImportFulfillments(params: BulkImportFulfillmentsParams): Promise<BulkImportFulfillmentsResponse>;
|
|
764
|
+
returnWithRefund(params: ReturnWithRefundParams): Promise<{
|
|
765
|
+
return: Return;
|
|
766
|
+
transaction: Transaction | null;
|
|
767
|
+
}>;
|
|
768
|
+
createReturn(params: CreateReturnParams): Promise<Return>;
|
|
769
|
+
updateReturn(params: UpdateReturnParams): Promise<Return>;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
interface CustomerAuthResponse {
|
|
773
|
+
token: string;
|
|
774
|
+
customer: CustomerProfile;
|
|
775
|
+
}
|
|
776
|
+
interface MarketingConsentChannel {
|
|
777
|
+
isConsented?: boolean;
|
|
778
|
+
}
|
|
779
|
+
interface MarketingConsent {
|
|
780
|
+
email?: MarketingConsentChannel;
|
|
781
|
+
sms?: MarketingConsentChannel;
|
|
782
|
+
push?: MarketingConsentChannel;
|
|
783
|
+
consentSource?: string;
|
|
784
|
+
}
|
|
785
|
+
interface CustomerProfile {
|
|
786
|
+
id: string;
|
|
787
|
+
name: string;
|
|
788
|
+
email?: string | null;
|
|
789
|
+
phone?: string | null;
|
|
790
|
+
authProvider?: 'local' | 'google' | 'apple' | 'kakao' | 'naver' | null;
|
|
791
|
+
isGuest?: boolean | null;
|
|
792
|
+
marketingConsent?: MarketingConsent | null;
|
|
793
|
+
metadata?: Record<string, unknown> | null;
|
|
794
|
+
groups?: string[];
|
|
795
|
+
}
|
|
796
|
+
interface CustomerRegisterData {
|
|
797
|
+
name: string;
|
|
798
|
+
email: string;
|
|
799
|
+
password: string;
|
|
800
|
+
phone?: string;
|
|
801
|
+
}
|
|
802
|
+
interface CustomerRegisterResponse {
|
|
803
|
+
customer: CustomerProfile;
|
|
804
|
+
}
|
|
805
|
+
interface CustomerLoginData {
|
|
806
|
+
email: string;
|
|
807
|
+
password: string;
|
|
808
|
+
}
|
|
809
|
+
interface CustomerRefreshResponse {
|
|
810
|
+
token: string;
|
|
811
|
+
}
|
|
812
|
+
interface UpdateProfileData {
|
|
813
|
+
name?: string;
|
|
814
|
+
phone?: string;
|
|
815
|
+
marketingConsent?: MarketingConsent;
|
|
816
|
+
}
|
|
817
|
+
interface CustomerAuthOptions {
|
|
818
|
+
/**
|
|
819
|
+
* Persist token in localStorage. Defaults to `true`.
|
|
820
|
+
* - `true` (default): uses key `'customer-token'`
|
|
821
|
+
* - `string`: uses the given string as localStorage key
|
|
822
|
+
* - `false`: disables persistence (token/onTokenChange used instead)
|
|
823
|
+
*
|
|
824
|
+
* Handles SSR safely (no-op on server).
|
|
825
|
+
* When enabled, `token` and `onTokenChange` are ignored.
|
|
826
|
+
*/
|
|
827
|
+
persist?: boolean | string;
|
|
828
|
+
/** Initial token (e.g. from SSR cookie) */
|
|
829
|
+
token?: string;
|
|
830
|
+
/** Called when token changes (login/logout) — use to persist in localStorage/cookie */
|
|
831
|
+
onTokenChange?: (token: string | null) => void;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
834
|
/**
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
* Payload's top-level `type: 'join'` fields on `products` (`variants`,
|
|
838
|
-
* `options`) return at most 10 docs by default when queried via the REST API.
|
|
839
|
-
* Storefront PLPs calling `client.collections.from('products').find()` without
|
|
840
|
-
* explicit join limits silently receive truncated variant/option join data.
|
|
841
|
-
* `buildProductListingGroupsByOption()` then drops primary-option values with
|
|
842
|
-
* no matching variant in the response — a common cause of missing color swatches
|
|
843
|
-
* even when the product has more variants than the default join cap.
|
|
844
|
-
*
|
|
845
|
-
* Spread this constant into your `find()` call to raise both top-level limits:
|
|
846
|
-
*
|
|
847
|
-
* ```typescript
|
|
848
|
-
* const { docs } = await client.collections.from('products').find({
|
|
849
|
-
* ...PRODUCT_PLP_FIND_OPTIONS,
|
|
850
|
-
* where: { status: { equals: 'published' } },
|
|
851
|
-
* limit: 24,
|
|
852
|
-
* })
|
|
853
|
-
* ```
|
|
854
|
-
*
|
|
855
|
-
* **Limitation:** This preset cures top-level `products.options` and
|
|
856
|
-
* `products.variants` join truncation. It cannot cure the nested
|
|
857
|
-
* `options[].values.docs` join — the Payload REST `joins` param is flat and
|
|
858
|
-
* nested join limits require the listing-groups endpoint. Prefer
|
|
859
|
-
* `commerce.product.listingGroupsCatalog()` + `buildProductListingCard()` as
|
|
860
|
-
* the primary PLP path; they apply unlimited join fetches server-side and
|
|
861
|
-
* return pre-grouped data ready for rendering.
|
|
862
|
-
*/
|
|
863
|
-
declare const PRODUCT_PLP_FIND_OPTIONS: ApiQueryOptions;
|
|
864
|
-
/**
|
|
865
|
-
* Builds product-first listing groups for one primary option.
|
|
835
|
+
* Customer authentication client.
|
|
866
836
|
*
|
|
867
|
-
*
|
|
868
|
-
*
|
|
869
|
-
* an expanded-card paginator; one product can still emit several groups.
|
|
837
|
+
* Manages customer registration, login, logout, and token lifecycle.
|
|
838
|
+
* All requests include X-Publishable-Key for tenant resolution.
|
|
870
839
|
*/
|
|
871
|
-
declare
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
840
|
+
declare class CustomerAuth {
|
|
841
|
+
private publishableKey;
|
|
842
|
+
private baseUrl;
|
|
843
|
+
private token;
|
|
844
|
+
private onTokenChange?;
|
|
845
|
+
private refreshPromise;
|
|
846
|
+
constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
|
|
847
|
+
/**
|
|
848
|
+
* Register a new customer account
|
|
849
|
+
*/
|
|
850
|
+
register(data: CustomerRegisterData): Promise<CustomerRegisterResponse>;
|
|
851
|
+
/**
|
|
852
|
+
* Login with email and password. Stores the token internally.
|
|
853
|
+
*/
|
|
854
|
+
login(data: CustomerLoginData): Promise<CustomerAuthResponse>;
|
|
855
|
+
/**
|
|
856
|
+
* Refresh the current token. Requires a valid (non-expired) token.
|
|
857
|
+
*/
|
|
858
|
+
refreshToken(): Promise<CustomerRefreshResponse>;
|
|
859
|
+
private _doRefreshToken;
|
|
860
|
+
/**
|
|
861
|
+
* Clear the stored token
|
|
862
|
+
*/
|
|
863
|
+
logout(): void;
|
|
864
|
+
/**
|
|
865
|
+
* Get the current authenticated customer's profile
|
|
866
|
+
*/
|
|
867
|
+
me(): Promise<CustomerProfile | null>;
|
|
868
|
+
/**
|
|
869
|
+
* Request a password reset email
|
|
870
|
+
*/
|
|
871
|
+
forgotPassword(email: string): Promise<void>;
|
|
872
|
+
/**
|
|
873
|
+
* Reset password using a token from the reset email
|
|
874
|
+
*/
|
|
875
|
+
resetPassword(token: string, password: string): Promise<void>;
|
|
876
|
+
/**
|
|
877
|
+
* Update the authenticated customer's profile (name, phone, marketingConsent)
|
|
878
|
+
*/
|
|
879
|
+
updateProfile(data: UpdateProfileData): Promise<CustomerProfile>;
|
|
880
|
+
/**
|
|
881
|
+
* Change the password of the currently authenticated customer
|
|
882
|
+
*/
|
|
883
|
+
changePassword(currentPassword: string, newPassword: string): Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Get the authenticated customer's orders with pagination and optional status filter
|
|
886
|
+
*/
|
|
887
|
+
getMyOrders(options?: {
|
|
888
|
+
page?: number;
|
|
889
|
+
limit?: number;
|
|
890
|
+
status?: string;
|
|
891
|
+
}): Promise<PayloadFindResponse<PublicOrder>>;
|
|
892
|
+
/**
|
|
893
|
+
* Get the current token (or null if not authenticated)
|
|
894
|
+
*/
|
|
895
|
+
getToken(): string | null;
|
|
896
|
+
/**
|
|
897
|
+
* Set the token manually (e.g. from SSR)
|
|
898
|
+
*/
|
|
899
|
+
setToken(token: string | null): void;
|
|
900
|
+
/**
|
|
901
|
+
* Check if the customer is currently authenticated
|
|
902
|
+
*/
|
|
903
|
+
isAuthenticated(): boolean;
|
|
904
|
+
/**
|
|
905
|
+
* Internal: make a request with timeout and error handling.
|
|
906
|
+
* Auth endpoints don't retry — failures are final.
|
|
907
|
+
*/
|
|
908
|
+
private requestJson;
|
|
909
|
+
}
|
|
877
910
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
911
|
+
interface CartApiOptions {
|
|
912
|
+
publishableKey?: string;
|
|
913
|
+
secretKey?: string;
|
|
914
|
+
apiUrl?: string;
|
|
915
|
+
customerToken?: string | (() => string | null);
|
|
916
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
917
|
+
onRequestId?: (id: string | null) => void;
|
|
918
|
+
}
|
|
919
|
+
type AddItemParams = {
|
|
920
|
+
cartId: string;
|
|
921
|
+
product: string;
|
|
922
|
+
variant: string;
|
|
923
|
+
option: string;
|
|
924
|
+
quantity: number;
|
|
882
925
|
};
|
|
883
|
-
type
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
color?: null;
|
|
926
|
+
type UpdateItemParams = {
|
|
927
|
+
cartItemId: string;
|
|
928
|
+
quantity: number;
|
|
887
929
|
};
|
|
888
|
-
type
|
|
889
|
-
|
|
890
|
-
id?: string;
|
|
891
|
-
value: string;
|
|
892
|
-
slug?: string;
|
|
893
|
-
swatch?: ProductUpsertSwatchInput | null;
|
|
894
|
-
metadata?: unknown;
|
|
930
|
+
type RemoveItemParams = {
|
|
931
|
+
cartItemId: string;
|
|
895
932
|
};
|
|
896
|
-
type
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
title: string;
|
|
900
|
-
slug?: string;
|
|
901
|
-
values: OptionValueInput[];
|
|
933
|
+
type ApplyDiscountParams = {
|
|
934
|
+
cartId: string;
|
|
935
|
+
discountCode: string;
|
|
902
936
|
};
|
|
903
|
-
type
|
|
904
|
-
|
|
905
|
-
optionValues?: Record<string, string | {
|
|
906
|
-
valueSlug?: string;
|
|
907
|
-
valueId?: string;
|
|
908
|
-
value?: string;
|
|
909
|
-
}> | string[];
|
|
910
|
-
sku?: string | null;
|
|
911
|
-
title?: string | null;
|
|
912
|
-
price: number;
|
|
913
|
-
compareAtPrice?: number | null;
|
|
914
|
-
stock?: number;
|
|
915
|
-
isUnlimited?: boolean;
|
|
916
|
-
weight?: number | null;
|
|
917
|
-
requiresShipping?: boolean;
|
|
918
|
-
barcode?: string | null;
|
|
919
|
-
externalId?: string | null;
|
|
920
|
-
isActive?: boolean;
|
|
921
|
-
images?: string[];
|
|
922
|
-
metadata?: unknown;
|
|
937
|
+
type RemoveDiscountParams = {
|
|
938
|
+
cartId: string;
|
|
923
939
|
};
|
|
924
|
-
type
|
|
925
|
-
|
|
926
|
-
title?: string;
|
|
927
|
-
subtitle?: string | null;
|
|
928
|
-
description?: string | null;
|
|
929
|
-
status?: string;
|
|
930
|
-
slug?: string;
|
|
931
|
-
primaryMediaItemId?: string | null;
|
|
932
|
-
thumbnail?: string | null;
|
|
933
|
-
images?: string[];
|
|
934
|
-
vendor?: string | null;
|
|
935
|
-
productType?: string | null;
|
|
936
|
-
brand?: string | null;
|
|
937
|
-
shippingPolicy?: string | null;
|
|
938
|
-
weight?: number | null;
|
|
939
|
-
minOrderQuantity?: number | null;
|
|
940
|
-
maxOrderQuantity?: number | null;
|
|
941
|
-
isFeatured?: boolean;
|
|
942
|
-
publishedAt?: string | null;
|
|
943
|
-
categories?: string[];
|
|
944
|
-
tags?: string[];
|
|
945
|
-
metadata?: unknown;
|
|
940
|
+
type ClearCartParams = {
|
|
941
|
+
cartId: string;
|
|
946
942
|
};
|
|
947
|
-
type
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
943
|
+
type PublicCartReference = string | {
|
|
944
|
+
id?: string | number | null;
|
|
945
|
+
title?: string | null;
|
|
946
|
+
name?: string | null;
|
|
947
|
+
slug?: string | null;
|
|
948
|
+
displayName?: string | null;
|
|
949
|
+
handle?: string | null;
|
|
950
|
+
color?: string | null;
|
|
951
|
+
image?: PublicMediaAsset | null;
|
|
952
|
+
thumbnail?: PublicMediaAsset | null;
|
|
953
|
+
avatar?: PublicMediaAsset | null;
|
|
952
954
|
};
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
955
|
+
type PublicCartItem = {
|
|
956
|
+
id?: string | number;
|
|
957
|
+
product?: PublicCartReference;
|
|
958
|
+
variant?: PublicCartReference;
|
|
959
|
+
quantity?: number | null;
|
|
960
|
+
unitPrice?: number | null;
|
|
961
|
+
discountAllocation?: number | null;
|
|
962
|
+
discountedUnitPrice?: number | null;
|
|
963
|
+
discountedTotalPrice?: number | null;
|
|
964
|
+
createdAt?: string | null;
|
|
965
|
+
updatedAt?: string | null;
|
|
966
|
+
};
|
|
967
|
+
type PublicCart = {
|
|
968
|
+
id?: string | number;
|
|
969
|
+
status?: string | null;
|
|
970
|
+
currency?: string | null;
|
|
971
|
+
subtotalAmount?: number | null;
|
|
972
|
+
shippingAmount?: number | null;
|
|
973
|
+
discountAmount?: number | null;
|
|
974
|
+
totalAmount?: number | null;
|
|
975
|
+
discountCode?: string | null;
|
|
976
|
+
customerNote?: string | null;
|
|
977
|
+
lastActivityAt?: string | null;
|
|
978
|
+
expiresAt?: string | null;
|
|
979
|
+
createdAt?: string | null;
|
|
980
|
+
updatedAt?: string | null;
|
|
981
|
+
shippingAddress?: {
|
|
982
|
+
recipientName?: string | null;
|
|
983
|
+
phone?: string | null;
|
|
984
|
+
postalCode?: string | null;
|
|
985
|
+
address?: string | null;
|
|
986
|
+
detailAddress?: string | null;
|
|
987
|
+
deliveryMessage?: string | null;
|
|
988
|
+
address1?: string | null;
|
|
989
|
+
address2?: string | null;
|
|
990
|
+
jibunAddress?: string | null;
|
|
991
|
+
administrativeArea?: string | null;
|
|
992
|
+
city?: string | null;
|
|
993
|
+
province?: string | null;
|
|
994
|
+
country?: string | null;
|
|
995
|
+
deliveryMemo?: string | null;
|
|
958
996
|
};
|
|
997
|
+
items?: PublicCartItem[];
|
|
959
998
|
};
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
type StockCheckParams = {
|
|
969
|
-
items: Array<{
|
|
970
|
-
variantId: string;
|
|
971
|
-
quantity: number;
|
|
999
|
+
declare class CartApi extends CustomerScopedApi {
|
|
1000
|
+
constructor(options: CartApiOptions);
|
|
1001
|
+
private execute;
|
|
1002
|
+
getCart(cartId: string): Promise<PublicCart>;
|
|
1003
|
+
addItem(params: AddItemParams): Promise<PublicCartItem>;
|
|
1004
|
+
updateItem(params: UpdateItemParams): Promise<PublicCartItem>;
|
|
1005
|
+
removeItem(params: RemoveItemParams): Promise<{
|
|
1006
|
+
success: boolean;
|
|
972
1007
|
}>;
|
|
1008
|
+
applyDiscount(params: ApplyDiscountParams): Promise<PublicCart>;
|
|
1009
|
+
removeDiscount(params: RemoveDiscountParams): Promise<PublicCart>;
|
|
1010
|
+
clearCart(params: ClearCartParams): Promise<{
|
|
1011
|
+
success: boolean;
|
|
1012
|
+
}>;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
type NormalizedOptionSwatch<TMedia = unknown> = {
|
|
1016
|
+
type: 'color' | 'media' | null;
|
|
1017
|
+
color?: string | null;
|
|
1018
|
+
mediaItemId?: string | number | null;
|
|
1019
|
+
/** Inlined swatch media when the API populated mediaItemId before pool indexing. */
|
|
1020
|
+
inlineMedia?: TMedia | null;
|
|
973
1021
|
};
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
};
|
|
983
|
-
type StockCheckResponse = {
|
|
984
|
-
results: StockCheckResult[];
|
|
985
|
-
allAvailable: boolean;
|
|
986
|
-
};
|
|
987
|
-
type ListingGroupsParams = {
|
|
988
|
-
productIds: string[];
|
|
1022
|
+
declare function selectedSwatchMediaItemId(swatch: NormalizedOptionSwatch | null | undefined): string | null;
|
|
1023
|
+
type ProductSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
1024
|
+
type ProductDisplayMediaSource = 'listing_primary' | 'product_primary' | 'product_pool' | 'none';
|
|
1025
|
+
/** @deprecated Use {@link ProductSelectionMediaSource} or {@link ProductDisplayMediaSource}. */
|
|
1026
|
+
type ProductMediaResolutionSource = ProductSelectionMediaSource | ProductDisplayMediaSource;
|
|
1027
|
+
type ProductSelectionVariant<TMedia> = {
|
|
1028
|
+
id?: string | number | null;
|
|
1029
|
+
images?: Array<TMedia | string | number | null | undefined> | null;
|
|
989
1030
|
};
|
|
990
|
-
type
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1031
|
+
type ProductSelectionOptionValue = {
|
|
1032
|
+
id?: string | number | null;
|
|
1033
|
+
swatch?: NormalizedOptionSwatch<unknown> | null;
|
|
1034
|
+
};
|
|
1035
|
+
type ProductSelectionMediaPointer = string | number | {
|
|
994
1036
|
id?: string | number | null;
|
|
995
1037
|
} | null;
|
|
996
|
-
type
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
docs: ProductListingGroupVariant[];
|
|
1003
|
-
}) | null;
|
|
1038
|
+
type ResolveProductSelectionMediaInput<TMedia> = {
|
|
1039
|
+
productMediaPool?: TMedia[] | null;
|
|
1040
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
1041
|
+
selectedVariant?: ProductSelectionVariant<TMedia> | null;
|
|
1042
|
+
matchingVariants?: Array<ProductSelectionVariant<TMedia> | null | undefined> | null;
|
|
1043
|
+
selectedOptionValues?: Array<ProductSelectionOptionValue | null | undefined> | null;
|
|
1004
1044
|
};
|
|
1005
|
-
type
|
|
1006
|
-
|
|
1007
|
-
|
|
1045
|
+
type ResolveProductSelectionMediaResult<TMedia> = {
|
|
1046
|
+
primaryImage: TMedia | null;
|
|
1047
|
+
images: TMedia[];
|
|
1048
|
+
source: ProductSelectionMediaSource;
|
|
1008
1049
|
};
|
|
1009
|
-
type
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
* tenant/key.
|
|
1014
|
-
*/
|
|
1015
|
-
docs: ProductListingGroupsItem[];
|
|
1016
|
-
/** Requested productIds that could not be returned. */
|
|
1017
|
-
missing: string[];
|
|
1050
|
+
type ResolveProductDisplayMediaInput<TMedia> = {
|
|
1051
|
+
productMediaPool?: TMedia[] | null;
|
|
1052
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
1053
|
+
listingPrimaryImage?: ProductSelectionMediaPointer;
|
|
1018
1054
|
};
|
|
1019
|
-
type
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1055
|
+
type ResolveProductDisplayMediaResult<TMedia> = {
|
|
1056
|
+
primaryImage: TMedia | null;
|
|
1057
|
+
images: TMedia[];
|
|
1058
|
+
source: ProductDisplayMediaSource;
|
|
1023
1059
|
};
|
|
1024
|
-
|
|
1025
|
-
|
|
1060
|
+
declare function resolveProductSelectionMedia<TMedia>(input: ResolveProductSelectionMediaInput<TMedia>): ResolveProductSelectionMediaResult<TMedia>;
|
|
1061
|
+
declare function resolveProductDisplayMedia<TMedia>(input: ResolveProductDisplayMediaInput<TMedia>): ResolveProductDisplayMediaResult<TMedia>;
|
|
1062
|
+
type ListingPrimaryImageFallbackInput<TMedia> = {
|
|
1063
|
+
productMediaPool?: TMedia[] | null;
|
|
1064
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
1065
|
+
productThumbnail?: TMedia | string | number | null;
|
|
1066
|
+
listingPrimaryImage?: TMedia | string | number | null;
|
|
1067
|
+
resolvedPrimary?: TMedia | null;
|
|
1068
|
+
resolvedSource?: ProductMediaResolutionSource;
|
|
1026
1069
|
};
|
|
1027
|
-
|
|
1028
|
-
|
|
1070
|
+
declare function resolveListingPrimaryImagePointer<TMedia>(input: ListingPrimaryImageFallbackInput<TMedia>): string | null;
|
|
1071
|
+
|
|
1072
|
+
type EntityID = string;
|
|
1073
|
+
type RelationshipValue = string | number | null | undefined | {
|
|
1074
|
+
id?: string | number | null;
|
|
1029
1075
|
};
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1076
|
+
type MediaValue = ProductDetailMedia | null | undefined;
|
|
1077
|
+
|
|
1078
|
+
/** Raw Payload / REST swatch before strict public normalization. */
|
|
1079
|
+
type ProductOptionValueSwatchInput = {
|
|
1080
|
+
type?: 'color' | 'media' | null;
|
|
1081
|
+
color?: string | null;
|
|
1082
|
+
mediaItemId?: RelationshipValue;
|
|
1083
|
+
};
|
|
1084
|
+
interface ProductOptionValueShape {
|
|
1085
|
+
id?: string | number | null;
|
|
1086
|
+
option?: RelationshipValue;
|
|
1035
1087
|
value?: string | null;
|
|
1088
|
+
slug?: string | null;
|
|
1089
|
+
swatch?: ProductOptionValueSwatch | ProductOptionValueSwatchInput | null;
|
|
1090
|
+
_order?: string | null;
|
|
1091
|
+
'_product-option-values_values_order'?: string | null;
|
|
1036
1092
|
}
|
|
1037
|
-
|
|
1093
|
+
interface ProductOptionShape {
|
|
1038
1094
|
id?: string | number | null;
|
|
1039
|
-
url?: string | null;
|
|
1040
|
-
alt?: string | null;
|
|
1041
|
-
width?: number | null;
|
|
1042
|
-
height?: number | null;
|
|
1043
|
-
};
|
|
1044
|
-
type ProductOptionValueColorSwatch = {
|
|
1045
|
-
type: 'color';
|
|
1046
|
-
color: string;
|
|
1047
|
-
mediaItemId?: null;
|
|
1048
|
-
};
|
|
1049
|
-
type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
1050
|
-
type: 'media';
|
|
1051
|
-
mediaItemId: TMedia;
|
|
1052
|
-
color?: null;
|
|
1053
|
-
};
|
|
1054
|
-
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
1055
|
-
type ProductDetailMediaValue = string | number | ProductDetailMedia | null;
|
|
1056
|
-
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
1057
|
-
interface ProductDetailVariant {
|
|
1058
|
-
id: string | number;
|
|
1059
|
-
optionKey: string;
|
|
1060
1095
|
title?: string | null;
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1096
|
+
slug?: string | null;
|
|
1097
|
+
_order?: string | null;
|
|
1098
|
+
'_product-options_options_order'?: string | null;
|
|
1099
|
+
values?: {
|
|
1100
|
+
docs?: unknown[];
|
|
1101
|
+
} | null;
|
|
1102
|
+
}
|
|
1103
|
+
interface ProductVariantShape {
|
|
1104
|
+
id?: string | number | null;
|
|
1105
|
+
optionValues?: unknown[] | null;
|
|
1106
|
+
price?: number | null;
|
|
1064
1107
|
compareAtPrice?: number | null;
|
|
1065
|
-
stock
|
|
1066
|
-
reservedStock
|
|
1067
|
-
isUnlimited
|
|
1068
|
-
isActive
|
|
1069
|
-
thumbnail?:
|
|
1070
|
-
images?:
|
|
1071
|
-
|
|
1072
|
-
primaryImage: ProductDetailMedia | null;
|
|
1073
|
-
images: ProductDetailMedia[];
|
|
1074
|
-
source: ProductDetailSelectionMediaSource;
|
|
1075
|
-
};
|
|
1076
|
-
optionValues: ProductDetailVariantOptionValue[];
|
|
1108
|
+
stock?: number | null;
|
|
1109
|
+
reservedStock?: number | null;
|
|
1110
|
+
isUnlimited?: boolean | null;
|
|
1111
|
+
isActive?: boolean | null;
|
|
1112
|
+
thumbnail?: MediaValue;
|
|
1113
|
+
images?: MediaValue[] | null;
|
|
1114
|
+
_order?: string | null;
|
|
1077
1115
|
}
|
|
1078
|
-
interface
|
|
1079
|
-
id
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1116
|
+
interface ProductListingProductShape {
|
|
1117
|
+
id?: EntityID;
|
|
1118
|
+
thumbnail?: MediaValue;
|
|
1119
|
+
primaryMediaItemId?: MediaValue;
|
|
1120
|
+
images?: MediaValue[] | null;
|
|
1121
|
+
listing?: {
|
|
1122
|
+
primaryImage?: MediaValue;
|
|
1123
|
+
} | null;
|
|
1083
1124
|
}
|
|
1084
|
-
|
|
1085
|
-
id: string
|
|
1125
|
+
type ProductOptionMatrixValue = {
|
|
1126
|
+
id: string;
|
|
1127
|
+
optionId: string;
|
|
1128
|
+
optionSlug: string;
|
|
1129
|
+
label: string;
|
|
1130
|
+
slug: string | null;
|
|
1131
|
+
swatch: ProductOptionValueSwatch;
|
|
1132
|
+
order: string;
|
|
1133
|
+
};
|
|
1134
|
+
type ProductOptionMatrixOption = {
|
|
1135
|
+
id: string;
|
|
1086
1136
|
title: string;
|
|
1087
1137
|
slug: string;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1138
|
+
order: string;
|
|
1139
|
+
values: ProductOptionMatrixValue[];
|
|
1140
|
+
};
|
|
1141
|
+
type ProductOptionMatrixVariant<TVariant extends ProductVariantShape = ProductVariantShape> = {
|
|
1142
|
+
id: string;
|
|
1143
|
+
optionValueIds: string[];
|
|
1144
|
+
optionValueByOptionId: Map<string, string>;
|
|
1145
|
+
optionValueByOptionSlug: Map<string, string>;
|
|
1146
|
+
source: TVariant;
|
|
1147
|
+
};
|
|
1148
|
+
type ProductOptionMatrix<TVariant extends ProductVariantShape = ProductVariantShape> = {
|
|
1149
|
+
options: ProductOptionMatrixOption[];
|
|
1150
|
+
optionIds: string[];
|
|
1151
|
+
optionSlugs: string[];
|
|
1152
|
+
optionById: Map<string, ProductOptionMatrixOption>;
|
|
1153
|
+
optionBySlug: Map<string, ProductOptionMatrixOption>;
|
|
1154
|
+
valueById: Map<string, ProductOptionMatrixValue>;
|
|
1155
|
+
valueToOptionId: Map<string, string>;
|
|
1156
|
+
valueToOptionSlug: Map<string, string>;
|
|
1157
|
+
variants: ProductOptionMatrixVariant<TVariant>[];
|
|
1158
|
+
};
|
|
1159
|
+
type ProductListingProjection = {
|
|
1160
|
+
selectionHintVariant: EntityID | null;
|
|
1161
|
+
primaryImage: EntityID | null;
|
|
1162
|
+
minPrice: number | null;
|
|
1163
|
+
maxPrice: number | null;
|
|
1164
|
+
minCompareAtPrice: number | null;
|
|
1165
|
+
maxCompareAtPrice: number | null;
|
|
1166
|
+
isPriceRange: boolean;
|
|
1167
|
+
availableForSale: boolean;
|
|
1168
|
+
};
|
|
1169
|
+
type ProductListingGroup<TVariant extends ProductVariantShape = ProductVariantShape> = {
|
|
1170
|
+
optionId: EntityID;
|
|
1171
|
+
optionTitle: string;
|
|
1172
|
+
optionSlug: string;
|
|
1173
|
+
optionValueId: EntityID;
|
|
1174
|
+
optionValueLabel: string;
|
|
1175
|
+
optionValueSlug: string | null;
|
|
1176
|
+
optionValueSwatch: ProductOptionValueSwatch;
|
|
1177
|
+
variantIds: EntityID[];
|
|
1178
|
+
variantCount: number;
|
|
1179
|
+
variants: TVariant[];
|
|
1180
|
+
listing: ProductListingProjection;
|
|
1181
|
+
};
|
|
1182
|
+
type ProductListingCardPriceRange = {
|
|
1183
|
+
minPrice: number | null;
|
|
1184
|
+
maxPrice: number | null;
|
|
1185
|
+
minCompareAtPrice: number | null;
|
|
1186
|
+
maxCompareAtPrice: number | null;
|
|
1187
|
+
isPriceRange: boolean;
|
|
1130
1188
|
};
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
tags: ProductDetail['tags'];
|
|
1138
|
-
images: ProductDetail['images'];
|
|
1139
|
-
videos: ProductDetail['videos'];
|
|
1140
|
-
primaryMediaItemId?: ProductDetail['primaryMediaItemId'];
|
|
1141
|
-
listing: ProductDetailCatalogListing;
|
|
1142
|
-
}
|
|
1143
|
-
type StockSnapshotItemStatus = 'available' | 'not_published' | 'archived' | 'not_found';
|
|
1144
|
-
interface StockSnapshotItem {
|
|
1145
|
-
variantId: string;
|
|
1146
|
-
status: StockSnapshotItemStatus;
|
|
1147
|
-
availableStock: number;
|
|
1189
|
+
type ProductListingSwatch = {
|
|
1190
|
+
optionId: EntityID;
|
|
1191
|
+
optionValueId: EntityID;
|
|
1192
|
+
label: string;
|
|
1193
|
+
swatch: ProductOptionValueSwatch<ProductDetailMedia>;
|
|
1194
|
+
href: string;
|
|
1148
1195
|
availableForSale: boolean;
|
|
1149
|
-
isUnlimited: boolean;
|
|
1150
|
-
}
|
|
1151
|
-
interface StockSnapshotResponse {
|
|
1152
|
-
snapshots: StockSnapshotItem[];
|
|
1153
|
-
}
|
|
1154
|
-
type StockSnapshotParams = {
|
|
1155
|
-
variantIds: string[];
|
|
1156
1196
|
};
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
totalVariants: number;
|
|
1169
|
-
hasUnlimitedVariant: boolean;
|
|
1170
|
-
hasOnlyDefaultVariant: boolean;
|
|
1171
|
-
};
|
|
1172
|
-
variants: ProductDetailVariant[];
|
|
1173
|
-
options: ProductDetailOption[];
|
|
1174
|
-
brand: ProductDetailBrand | null;
|
|
1175
|
-
categories: ProductDetailCategory[];
|
|
1176
|
-
tags: ProductDetailTag[];
|
|
1177
|
-
images: ProductDetailImage[];
|
|
1178
|
-
videos: ProductDetailVideo[];
|
|
1179
|
-
/** Canonical product primary pointer (pool member). */
|
|
1180
|
-
primaryMediaItemId?: ProductDetailMediaValue;
|
|
1181
|
-
listing: ProductDetailListing;
|
|
1182
|
-
}
|
|
1183
|
-
type ProductDetailUnavailableReason = 'not_found' | 'not_published' | 'feature_disabled';
|
|
1184
|
-
type ProductDetailResult = {
|
|
1185
|
-
found: true;
|
|
1186
|
-
product: ProductDetail;
|
|
1187
|
-
} | {
|
|
1188
|
-
found: false;
|
|
1189
|
-
reason: ProductDetailUnavailableReason;
|
|
1197
|
+
type ProductListingCardSourceItem = ProductListingGroupsCatalogItem | ProductListingGroupsItem;
|
|
1198
|
+
type ProductListingCardRepresentativeVariant = ProductListingCardSourceItem['groups'][number]['variants'][number];
|
|
1199
|
+
type ProductListingCard = {
|
|
1200
|
+
id: EntityID;
|
|
1201
|
+
href: string;
|
|
1202
|
+
title: string;
|
|
1203
|
+
representativeVariant?: ProductListingCardRepresentativeVariant | null;
|
|
1204
|
+
primaryImage: ProductDetailMedia | null;
|
|
1205
|
+
priceRange: ProductListingCardPriceRange;
|
|
1206
|
+
availableForSale: boolean;
|
|
1207
|
+
swatches: ProductListingSwatch[];
|
|
1190
1208
|
};
|
|
1191
|
-
type
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
} | {
|
|
1195
|
-
found: false;
|
|
1196
|
-
reason: ProductDetailUnavailableReason;
|
|
1209
|
+
type ProductSelectionByOptionValue = string | number | null | undefined | {
|
|
1210
|
+
valueId?: string | number | null;
|
|
1211
|
+
valueSlug?: string | null;
|
|
1197
1212
|
};
|
|
1198
|
-
type
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
type ProductUpsertFieldValidationErrorBody = {
|
|
1205
|
-
error: string;
|
|
1206
|
-
reason: ProductUpsertFieldValidationErrorReason;
|
|
1207
|
-
field: string;
|
|
1208
|
-
requestId?: string;
|
|
1213
|
+
type ProductSelectionInput = {
|
|
1214
|
+
variantId?: string | number | null;
|
|
1215
|
+
byOptionSlug?: Record<string, ProductSelectionByOptionValue>;
|
|
1216
|
+
byOptionId?: Record<string, ProductSelectionByOptionValue>;
|
|
1217
|
+
valueIds?: Iterable<unknown>;
|
|
1218
|
+
search?: string | URLSearchParams | URL | null;
|
|
1209
1219
|
};
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
} | {
|
|
1216
|
-
ok: false;
|
|
1217
|
-
failedEntity: 'product' | 'option' | 'option-value' | 'variant';
|
|
1218
|
-
failedIndex?: number;
|
|
1219
|
-
message: string;
|
|
1220
|
+
type NormalizedProductSelection = {
|
|
1221
|
+
byOptionSlug: Record<string, string>;
|
|
1222
|
+
byOptionId: Record<string, string>;
|
|
1223
|
+
valueIds: string[];
|
|
1224
|
+
variantId: string | null;
|
|
1220
1225
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
listingGroupsCatalog(params: ListingGroupsParams): Promise<ProductListingGroupsResponse>;
|
|
1232
|
-
/**
|
|
1233
|
-
* Fetch full product detail by slug or id.
|
|
1234
|
-
* Returns a discriminated result so storefronts can distinguish missing,
|
|
1235
|
-
* unpublished, and feature-disabled products.
|
|
1236
|
-
*
|
|
1237
|
-
* Only product-detail 404 responses carrying one of those allowlisted reasons
|
|
1238
|
-
* are mapped to `{ found: false, reason }`. Unknown or uncoded 404s, plus
|
|
1239
|
-
* permission/auth errors such as tenant mismatch, continue to throw typed SDK
|
|
1240
|
-
* errors instead of being collapsed into a storefront absence result.
|
|
1241
|
-
*/
|
|
1242
|
-
detail(params: ProductDetailParams): Promise<ProductDetailResult>;
|
|
1243
|
-
detailCatalog(params: ProductDetailParams): Promise<ProductDetailCatalogResult>;
|
|
1226
|
+
type CompatibilityProductSelectionParamEvent = {
|
|
1227
|
+
optionId: string;
|
|
1228
|
+
optionSlug: string;
|
|
1229
|
+
valueSlug: string;
|
|
1230
|
+
searchParam: string;
|
|
1231
|
+
};
|
|
1232
|
+
type LegacyProductSelectionParamEvent = CompatibilityProductSelectionParamEvent;
|
|
1233
|
+
type ProductSelectionUrlEmit = 'slug-compat' | 'canonical-id';
|
|
1234
|
+
type ProductSelectionCodecOptions = {
|
|
1235
|
+
emit?: ProductSelectionUrlEmit;
|
|
1244
1236
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1247
|
-
* `productSet` shape and is the canonical write path for the MCP
|
|
1248
|
-
* `product-upsert` tool.
|
|
1237
|
+
* When true, `resolveProductSelection()` fills unselected options to reach a
|
|
1238
|
+
* concrete variant. Does not change codec parse/stringify behavior.
|
|
1249
1239
|
*/
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
type
|
|
1240
|
+
fillDefaults?: boolean;
|
|
1241
|
+
onCompatibilityOptionIdParam?: (event: CompatibilityProductSelectionParamEvent) => void;
|
|
1242
|
+
onLegacyOptionIdParam?: (event: LegacyProductSelectionParamEvent) => void;
|
|
1243
|
+
};
|
|
1244
|
+
type ProductSelectionResolutionContext = {
|
|
1245
|
+
detail?: Pick<ProductDetail, 'images' | 'listing' | 'primaryMediaItemId'>;
|
|
1246
|
+
images?: ProductDetail['images'];
|
|
1247
|
+
listing?: ProductDetail['listing'];
|
|
1248
|
+
primaryMediaItemId?: ProductDetail['primaryMediaItemId'];
|
|
1249
|
+
};
|
|
1250
|
+
type ProductSelectionAvailableSwatch = {
|
|
1251
|
+
color?: string | null;
|
|
1252
|
+
image?: MediaValue | null;
|
|
1253
|
+
};
|
|
1254
|
+
type ProductSelectionAvailableValue = {
|
|
1255
|
+
valueId: string;
|
|
1256
|
+
value: string;
|
|
1257
|
+
label: string;
|
|
1258
|
+
slug: string;
|
|
1259
|
+
selected: boolean;
|
|
1260
|
+
available: boolean;
|
|
1261
|
+
exists: boolean;
|
|
1262
|
+
availableForSale: boolean;
|
|
1263
|
+
isUnlimited: boolean;
|
|
1264
|
+
availableStock: number | null;
|
|
1265
|
+
swatch: ProductOptionValueSwatch;
|
|
1266
|
+
};
|
|
1267
|
+
type ProductSelectionResolution = {
|
|
1268
|
+
normalizedSelection: NormalizedProductSelection;
|
|
1269
|
+
selectedVariant: ProductDetailVariant | null;
|
|
1270
|
+
matchingVariants: ProductDetailVariant[];
|
|
1271
|
+
partialVariants: ProductDetailVariant[];
|
|
1272
|
+
availableValuesByOptionSlug: Record<string, ProductSelectionAvailableValue[]>;
|
|
1273
|
+
availableValuesByOptionId: Record<string, ProductSelectionAvailableValue[]>;
|
|
1274
|
+
allOptionsSelected: boolean;
|
|
1275
|
+
price: {
|
|
1276
|
+
min: number | null;
|
|
1277
|
+
max: number | null;
|
|
1278
|
+
compareAtMin: number | null;
|
|
1279
|
+
compareAtMax: number | null;
|
|
1280
|
+
isRange: boolean;
|
|
1281
|
+
};
|
|
1282
|
+
media: {
|
|
1283
|
+
primaryImage: ProductDetailMedia | null;
|
|
1284
|
+
images: ProductDetailMedia[];
|
|
1285
|
+
source?: ProductMediaResolutionSource;
|
|
1286
|
+
};
|
|
1287
|
+
stock: {
|
|
1288
|
+
availableForSale: boolean;
|
|
1289
|
+
isUnlimited: boolean;
|
|
1290
|
+
stock: number | null;
|
|
1291
|
+
reservedStock: number | null;
|
|
1292
|
+
availableStock: number | null;
|
|
1293
|
+
};
|
|
1294
|
+
};
|
|
1295
|
+
declare class ProductSelectionCodecError extends Error {
|
|
1255
1296
|
code: string;
|
|
1256
|
-
|
|
1297
|
+
constructor(message: string);
|
|
1298
|
+
}
|
|
1299
|
+
declare function buildProductOptionMatrix<TVariant extends ProductVariantShape = ProductVariantShape>({ options, variants, }: {
|
|
1300
|
+
options: ProductOptionShape[];
|
|
1301
|
+
variants?: TVariant[];
|
|
1302
|
+
}): ProductOptionMatrix<TVariant>;
|
|
1303
|
+
declare function buildProductOptionMatrixFromDetail(detail: ProductDetail): ProductOptionMatrix<ProductDetailVariant>;
|
|
1304
|
+
declare function getSelectedValueByOptionId<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): Map<string, string>;
|
|
1305
|
+
declare function normalizeSelectedValueIds<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): string[];
|
|
1306
|
+
declare function getAvailableOptionValues<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, optionId: string, selectedValueIds: Iterable<unknown>): ProductOptionMatrixValue[];
|
|
1307
|
+
declare function resolveVariantForSelection<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): ProductOptionMatrixVariant<TVariant> | undefined;
|
|
1308
|
+
declare function normalizeProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1309
|
+
declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1310
|
+
declare function parseProductSelection(detail: ProductDetail, search: string | URLSearchParams | URL | null | undefined, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1311
|
+
declare function stringifyProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): string;
|
|
1312
|
+
declare function createProductSelectionCodec(detail: ProductDetail, options?: ProductSelectionCodecOptions): {
|
|
1313
|
+
parse: (search: string | URLSearchParams | URL | null | undefined) => NormalizedProductSelection;
|
|
1314
|
+
stringify: (selection?: ProductSelectionInput) => string;
|
|
1315
|
+
};
|
|
1316
|
+
declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions, context?: ProductSelectionResolutionContext): ProductSelectionResolution;
|
|
1317
|
+
declare function resolveProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): ProductSelectionResolution;
|
|
1318
|
+
declare function selectNext(detail: ProductDetail, current: ProductSelectionInput | undefined, optionSlug: string, valueSlug: string, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1319
|
+
type ProductDetailImageMedia = Extract<ProductDetailMedia, {
|
|
1320
|
+
id?: string | number | null;
|
|
1321
|
+
url?: string | null;
|
|
1322
|
+
}>;
|
|
1323
|
+
declare function getProductSelectionImages(resolution: Pick<ProductSelectionResolution, 'media'>): ProductDetailImageMedia[];
|
|
1324
|
+
type ProductHrefProduct = ProductDetail | {
|
|
1325
|
+
slug?: string | null;
|
|
1326
|
+
product?: {
|
|
1327
|
+
slug?: string | null;
|
|
1328
|
+
} | null;
|
|
1329
|
+
};
|
|
1330
|
+
type ProductHrefGroup = {
|
|
1331
|
+
optionId?: string | number | null;
|
|
1332
|
+
optionSlug?: string | null;
|
|
1333
|
+
optionValueId?: string | number | null;
|
|
1334
|
+
optionValueSlug?: string | null;
|
|
1335
|
+
variantId?: string | number | null;
|
|
1336
|
+
listing?: {
|
|
1337
|
+
selectionHintVariant?: string | number | null;
|
|
1338
|
+
} | null;
|
|
1257
1339
|
};
|
|
1258
|
-
type
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1340
|
+
type ProductHrefOptions = {
|
|
1341
|
+
basePath?: string;
|
|
1342
|
+
detail?: ProductDetail;
|
|
1343
|
+
matrix?: ProductOptionMatrix<ProductDetailVariant>;
|
|
1344
|
+
selection?: ProductSelectionInput;
|
|
1345
|
+
trailingSlash?: boolean;
|
|
1346
|
+
emit?: ProductSelectionUrlEmit;
|
|
1347
|
+
preferCompleteVariantFromHint?: boolean;
|
|
1265
1348
|
};
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
type ShippingApiOptions = ServerApiOptions;
|
|
1272
|
-
type CalculateShippingParams = {
|
|
1273
|
-
shippingPolicyId?: string;
|
|
1274
|
-
orderAmount: number;
|
|
1275
|
-
postalCode?: string;
|
|
1349
|
+
type ProductListingCardOptions = {
|
|
1350
|
+
basePath?: string;
|
|
1351
|
+
trailingSlash?: boolean;
|
|
1352
|
+
emit?: ProductSelectionUrlEmit;
|
|
1353
|
+
preferCompleteVariantFromHint?: boolean;
|
|
1276
1354
|
};
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1355
|
+
declare function buildProductHref(product: ProductHrefProduct, group?: ProductHrefGroup | null, options?: ProductHrefOptions): string;
|
|
1356
|
+
declare function buildProductListingProjection(product: ProductListingProductShape | null | undefined, variants: ProductVariantShape[]): ProductListingProjection;
|
|
1357
|
+
declare function buildProductListingCard(item: ProductListingCardSourceItem, options?: ProductListingCardOptions): ProductListingCard;
|
|
1358
|
+
/** Shopify `priceRangeV2` naming for persisted listing projection fields. */
|
|
1359
|
+
declare function toShopifyPriceRangeV2(listing: {
|
|
1360
|
+
minPrice?: number | null;
|
|
1361
|
+
maxPrice?: number | null;
|
|
1362
|
+
}): {
|
|
1363
|
+
minVariantPrice: {
|
|
1364
|
+
amount: number | null;
|
|
1365
|
+
};
|
|
1366
|
+
maxVariantPrice: {
|
|
1367
|
+
amount: number | null;
|
|
1368
|
+
};
|
|
1285
1369
|
};
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1370
|
+
/**
|
|
1371
|
+
* Server-side PLP query preset for raw `products` collection reads.
|
|
1372
|
+
*
|
|
1373
|
+
* Greenfield storefronts should prefer
|
|
1374
|
+
* `client.commerce.product.listingPage()` because it calls the shaped catalog
|
|
1375
|
+
* endpoint, preserves pagination metadata, returns card-ready `cards`, and
|
|
1376
|
+
* avoids exposing inventory quantities.
|
|
1377
|
+
*
|
|
1378
|
+
* This preset remains only for server-auth raw product query code
|
|
1379
|
+
* that deliberately understands Payload join behavior. It raises top-level
|
|
1380
|
+
* `products.options` and `products.variants` join limits, but it cannot fix
|
|
1381
|
+
* nested `options[].values.docs` joins because the Payload REST `joins` param
|
|
1382
|
+
* is flat.
|
|
1383
|
+
*
|
|
1384
|
+
* It is not accepted by publishable
|
|
1385
|
+
* `createClient().collections.from('products').find()` because browser-public
|
|
1386
|
+
* raw reads are constrained to `depth: 0`, `joins: false`, and no `populate`.
|
|
1387
|
+
*/
|
|
1388
|
+
declare const PRODUCT_PLP_FIND_OPTIONS: ApiQueryOptions;
|
|
1389
|
+
/**
|
|
1390
|
+
* Builds product-first listing groups for one primary option.
|
|
1391
|
+
*
|
|
1392
|
+
* The returned groups are intended for product cards with nested swatches or
|
|
1393
|
+
* option-value sections. They do not make a product-paginated API response into
|
|
1394
|
+
* an expanded-card paginator; one product can still emit several groups.
|
|
1395
|
+
*/
|
|
1396
|
+
declare function buildProductListingGroupsByOption<TVariant extends ProductVariantShape = ProductVariantShape>(args: {
|
|
1397
|
+
product: ProductListingProductShape | null | undefined;
|
|
1398
|
+
options: ProductOptionShape[];
|
|
1399
|
+
variants: TVariant[];
|
|
1400
|
+
primaryOptionId?: string | null;
|
|
1401
|
+
}): ProductListingGroup<TVariant>[];
|
|
1290
1402
|
|
|
1291
|
-
type
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
* Client-generated key for safe retries. Sent as `X-Idempotency-Key` when the
|
|
1296
|
-
* server endpoint supports HTTP idempotency.
|
|
1297
|
-
*/
|
|
1298
|
-
idempotencyKey?: string;
|
|
1403
|
+
type ProductUpsertColorSwatchInput = {
|
|
1404
|
+
type: 'color';
|
|
1405
|
+
color: string;
|
|
1406
|
+
mediaItemId?: null;
|
|
1299
1407
|
};
|
|
1300
|
-
type
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1408
|
+
type ProductUpsertMediaSwatchInput = {
|
|
1409
|
+
type: 'media';
|
|
1410
|
+
mediaItemId: string;
|
|
1411
|
+
color?: null;
|
|
1304
1412
|
};
|
|
1305
|
-
type
|
|
1306
|
-
type
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1413
|
+
type ProductUpsertSwatchInput = ProductUpsertColorSwatchInput | ProductUpsertMediaSwatchInput;
|
|
1414
|
+
type ProductUpsertOptionValueInput = {
|
|
1415
|
+
id?: string;
|
|
1416
|
+
value: string;
|
|
1417
|
+
slug?: string;
|
|
1418
|
+
swatch?: ProductUpsertSwatchInput | null;
|
|
1419
|
+
metadata?: unknown;
|
|
1311
1420
|
};
|
|
1312
|
-
type
|
|
1313
|
-
type
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
/**
|
|
1319
|
-
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
1320
|
-
* derives authoritative line pricing from the product variant.
|
|
1321
|
-
*/
|
|
1322
|
-
unitPrice?: number;
|
|
1323
|
-
/**
|
|
1324
|
-
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
1325
|
-
* derives authoritative line totals from the product variant.
|
|
1326
|
-
*/
|
|
1327
|
-
totalPrice?: number;
|
|
1421
|
+
type OptionValueInput = ProductUpsertOptionValueInput;
|
|
1422
|
+
type OptionInput = {
|
|
1423
|
+
id?: string;
|
|
1424
|
+
title: string;
|
|
1425
|
+
slug?: string;
|
|
1426
|
+
values: OptionValueInput[];
|
|
1328
1427
|
};
|
|
1329
|
-
type
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1428
|
+
type VariantInput = {
|
|
1429
|
+
id?: string;
|
|
1430
|
+
optionValues?: Record<string, string | {
|
|
1431
|
+
valueSlug?: string;
|
|
1432
|
+
valueId?: string;
|
|
1433
|
+
value?: string;
|
|
1434
|
+
}> | string[];
|
|
1435
|
+
sku?: string | null;
|
|
1436
|
+
title?: string | null;
|
|
1437
|
+
price: number;
|
|
1438
|
+
compareAtPrice?: number | null;
|
|
1439
|
+
stock?: number;
|
|
1440
|
+
isUnlimited?: boolean;
|
|
1441
|
+
weight?: number | null;
|
|
1442
|
+
requiresShipping?: boolean;
|
|
1443
|
+
barcode?: string | null;
|
|
1444
|
+
externalId?: string | null;
|
|
1445
|
+
isActive?: boolean;
|
|
1446
|
+
images?: string[];
|
|
1447
|
+
metadata?: unknown;
|
|
1342
1448
|
};
|
|
1343
|
-
type
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1449
|
+
type ProductFieldsInput = {
|
|
1450
|
+
id?: string;
|
|
1451
|
+
title?: string;
|
|
1452
|
+
subtitle?: string | null;
|
|
1453
|
+
description?: string | null;
|
|
1454
|
+
status?: string;
|
|
1455
|
+
slug?: string;
|
|
1456
|
+
primaryMediaItemId?: string | null;
|
|
1457
|
+
thumbnail?: string | null;
|
|
1458
|
+
images?: string[];
|
|
1459
|
+
vendor?: string | null;
|
|
1460
|
+
productType?: string | null;
|
|
1461
|
+
brand?: string | null;
|
|
1462
|
+
shippingPolicy?: string | null;
|
|
1463
|
+
weight?: number | null;
|
|
1464
|
+
minOrderQuantity?: number | null;
|
|
1465
|
+
maxOrderQuantity?: number | null;
|
|
1466
|
+
isFeatured?: boolean;
|
|
1467
|
+
publishedAt?: string | null;
|
|
1468
|
+
categories?: string[];
|
|
1469
|
+
tags?: string[];
|
|
1470
|
+
metadata?: unknown;
|
|
1352
1471
|
};
|
|
1353
|
-
type
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1472
|
+
type ProductUpsertGraphFields = {
|
|
1473
|
+
/** Required when updating an existing product graph if the server graph is non-empty. */
|
|
1474
|
+
graphRevision?: string;
|
|
1475
|
+
options?: OptionInput[];
|
|
1476
|
+
variants?: VariantInput[];
|
|
1357
1477
|
};
|
|
1358
|
-
|
|
1359
|
-
type
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
paymentKey?: string;
|
|
1365
|
-
amount?: number;
|
|
1478
|
+
/** Create a product document and initial graph. */
|
|
1479
|
+
type ProductUpsertCreateInput = ProductUpsertGraphFields & {
|
|
1480
|
+
productId?: never;
|
|
1481
|
+
product: ProductFieldsInput & {
|
|
1482
|
+
title: string;
|
|
1483
|
+
};
|
|
1366
1484
|
};
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1485
|
+
/** Graph-only update for an existing product (document fields via Payload save). */
|
|
1486
|
+
type ProductUpsertEditInput = ProductUpsertGraphFields & {
|
|
1487
|
+
productId: string;
|
|
1488
|
+
product?: never;
|
|
1489
|
+
};
|
|
1490
|
+
type ProductUpsertInput = ProductUpsertCreateInput | ProductUpsertEditInput;
|
|
1491
|
+
|
|
1492
|
+
type ProductApiOptions = ServerApiOptions;
|
|
1493
|
+
type StockCheckParams = {
|
|
1494
|
+
items: Array<{
|
|
1495
|
+
variantId: string;
|
|
1496
|
+
quantity: number;
|
|
1497
|
+
}>;
|
|
1498
|
+
};
|
|
1499
|
+
type StockCheckResult = {
|
|
1500
|
+
variantId: string;
|
|
1501
|
+
status: 'available' | 'not_published' | 'archived' | 'not_found';
|
|
1502
|
+
available: boolean;
|
|
1503
|
+
availableStock: number;
|
|
1504
|
+
isUnlimited: boolean;
|
|
1505
|
+
requestedQuantity: number;
|
|
1506
|
+
error?: string;
|
|
1388
1507
|
};
|
|
1389
|
-
type
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
type CancelOrderResponseBase = {
|
|
1393
|
-
orderId: string;
|
|
1508
|
+
type StockCheckResponse = {
|
|
1509
|
+
results: StockCheckResult[];
|
|
1510
|
+
allAvailable: boolean;
|
|
1394
1511
|
};
|
|
1395
|
-
type
|
|
1396
|
-
|
|
1397
|
-
providerRefunded: false;
|
|
1512
|
+
type ListingGroupsParams = {
|
|
1513
|
+
productIds: string[];
|
|
1398
1514
|
};
|
|
1399
|
-
type
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1515
|
+
type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'stock' | 'isUnlimited' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
|
|
1516
|
+
type ProductListingGroupSummary = ProductListingGroup<ProductListingGroupVariant>;
|
|
1517
|
+
type ProductListingGroupCatalogVariant = Omit<ProductListingGroupVariant, 'stock'>;
|
|
1518
|
+
type ProductListingGroupCatalogSummary = ProductListingGroup<ProductListingGroupCatalogVariant>;
|
|
1519
|
+
type ProductListingGroupsProductVariants = NonNullable<PublicProduct['variants']>;
|
|
1520
|
+
type ProductListingGroupsProductPrimaryMediaItemId = string | number | {
|
|
1521
|
+
id?: string | number | null;
|
|
1522
|
+
} | null;
|
|
1523
|
+
type ProductListingGroupsProduct = Omit<PublicProduct, 'createdAt' | 'primaryMediaItemId' | 'updatedAt' | 'variants'> & {
|
|
1524
|
+
id: string;
|
|
1525
|
+
slug: string;
|
|
1526
|
+
title: string;
|
|
1527
|
+
createdAt?: PublicProduct['createdAt'];
|
|
1528
|
+
updatedAt?: PublicProduct['updatedAt'];
|
|
1529
|
+
primaryMediaItemId?: ProductListingGroupsProductPrimaryMediaItemId;
|
|
1530
|
+
variants?: (Omit<ProductListingGroupsProductVariants, 'docs'> & {
|
|
1531
|
+
docs: ProductListingGroupVariant[];
|
|
1532
|
+
}) | null;
|
|
1404
1533
|
};
|
|
1405
|
-
type
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1534
|
+
type ProductListingGroupsCatalogListing = {
|
|
1535
|
+
minPrice?: NonNullable<ProductListingGroupsProduct['listing']>['minPrice'];
|
|
1536
|
+
maxPrice?: NonNullable<ProductListingGroupsProduct['listing']>['maxPrice'];
|
|
1537
|
+
minCompareAtPrice?: NonNullable<ProductListingGroupsProduct['listing']>['minCompareAtPrice'];
|
|
1538
|
+
maxCompareAtPrice?: NonNullable<ProductListingGroupsProduct['listing']>['maxCompareAtPrice'];
|
|
1539
|
+
isPriceRange?: NonNullable<ProductListingGroupsProduct['listing']>['isPriceRange'];
|
|
1540
|
+
primaryImage?: NonNullable<ProductListingGroupsProduct['listing']>['primaryImage'];
|
|
1541
|
+
availableForSale?: NonNullable<ProductListingGroupsProduct['listing']>['availableForSale'];
|
|
1542
|
+
selectionHintVariant?: NonNullable<ProductListingGroupsProduct['listing']>['selectionHintVariant'];
|
|
1543
|
+
};
|
|
1544
|
+
type ProductListingGroupsCatalogProduct = {
|
|
1545
|
+
id: string;
|
|
1546
|
+
slug: string;
|
|
1547
|
+
handle?: string | null;
|
|
1548
|
+
title: string;
|
|
1549
|
+
subtitle?: ProductListingGroupsProduct['subtitle'];
|
|
1550
|
+
primaryMediaItemId?: ProductListingGroupsProductPrimaryMediaItemId;
|
|
1551
|
+
thumbnail?: ProductListingGroupsProduct['thumbnail'];
|
|
1552
|
+
images?: ProductListingGroupsProduct['images'];
|
|
1553
|
+
listing?: ProductListingGroupsCatalogListing | null;
|
|
1554
|
+
variants?: (Omit<NonNullable<ProductListingGroupsProduct['variants']>, 'docs'> & {
|
|
1555
|
+
docs: ProductListingGroupCatalogVariant[];
|
|
1556
|
+
}) | null;
|
|
1410
1557
|
};
|
|
1411
|
-
type
|
|
1412
|
-
|
|
1413
|
-
|
|
1558
|
+
type ProductListingGroupsItem = {
|
|
1559
|
+
product: ProductListingGroupsProduct;
|
|
1560
|
+
groups: ProductListingGroupSummary[];
|
|
1414
1561
|
};
|
|
1415
|
-
type
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
providerRefunded: false;
|
|
1419
|
-
refundPending: true;
|
|
1562
|
+
type ProductListingGroupsCatalogItem = {
|
|
1563
|
+
product: ProductListingGroupsCatalogProduct;
|
|
1564
|
+
groups: ProductListingGroupCatalogSummary[];
|
|
1420
1565
|
};
|
|
1421
|
-
type
|
|
1422
|
-
|
|
1423
|
-
|
|
1566
|
+
type ProductListingGroupsResponse = {
|
|
1567
|
+
/**
|
|
1568
|
+
* Matching products in the same order as the requested productIds, excluding
|
|
1569
|
+
* ids that were not found, not published, or not accessible for the current
|
|
1570
|
+
* tenant/key.
|
|
1571
|
+
*/
|
|
1572
|
+
docs: ProductListingGroupsItem[];
|
|
1573
|
+
/** Requested productIds that could not be returned. */
|
|
1574
|
+
missing: string[];
|
|
1424
1575
|
};
|
|
1425
|
-
type
|
|
1426
|
-
|
|
1427
|
-
|
|
1576
|
+
type ProductListingGroupsCatalogResponse = Omit<ProductListingGroupsResponse, 'docs'> & {
|
|
1577
|
+
docs: ProductListingGroupsCatalogItem[];
|
|
1578
|
+
};
|
|
1579
|
+
type ProductListingPageSort = 'id' | '-id' | 'slug' | '-slug' | 'handle' | '-handle' | 'createdAt' | '-createdAt' | 'updatedAt' | '-updatedAt' | 'title' | '-title' | 'listing.minPrice' | '-listing.minPrice' | 'listing.maxPrice' | '-listing.maxPrice' | 'listing.availableForSale' | '-listing.availableForSale';
|
|
1580
|
+
type ProductListingPageFilters = {
|
|
1581
|
+
ids?: string[];
|
|
1582
|
+
slugs?: string[];
|
|
1583
|
+
handles?: string[];
|
|
1584
|
+
categoryIds?: string[];
|
|
1585
|
+
tagIds?: string[];
|
|
1586
|
+
price?: {
|
|
1587
|
+
min?: number;
|
|
1588
|
+
max?: number;
|
|
1589
|
+
};
|
|
1590
|
+
availableForSale?: boolean;
|
|
1428
1591
|
};
|
|
1429
|
-
type
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1592
|
+
type ProductListingPageBaseParams = {
|
|
1593
|
+
page?: number;
|
|
1594
|
+
limit?: number;
|
|
1595
|
+
search?: string;
|
|
1596
|
+
sort?: ProductListingPageSort | ProductListingPageSort[];
|
|
1597
|
+
filters?: ProductListingPageFilters;
|
|
1598
|
+
} & ProductListingCardOptions;
|
|
1599
|
+
type ProductListingPageCatalogParams = ProductListingPageBaseParams & {
|
|
1600
|
+
mode?: 'catalog';
|
|
1434
1601
|
};
|
|
1435
|
-
type
|
|
1436
|
-
|
|
1437
|
-
cancelCommitted: false;
|
|
1438
|
-
alreadyCanceled: true;
|
|
1602
|
+
type ProductListingPageFullParams = ProductListingPageBaseParams & {
|
|
1603
|
+
mode: 'full';
|
|
1439
1604
|
};
|
|
1440
|
-
|
|
1441
|
-
type
|
|
1442
|
-
|
|
1443
|
-
cancelCommitted: false;
|
|
1444
|
-
reconciliationRequired: true;
|
|
1605
|
+
type ProductListingPageParams = ProductListingPageCatalogParams | ProductListingPageFullParams;
|
|
1606
|
+
type ProductListingPageResult<TItem> = PayloadFindResponse<TItem> & {
|
|
1607
|
+
cards: ProductListingCard[];
|
|
1445
1608
|
};
|
|
1446
|
-
type
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
reasonDetail?: string;
|
|
1451
|
-
idempotencyKey?: string;
|
|
1609
|
+
type ProductDetailParams = {
|
|
1610
|
+
slug: string;
|
|
1611
|
+
} | {
|
|
1612
|
+
id: string;
|
|
1452
1613
|
};
|
|
1453
|
-
type
|
|
1454
|
-
|
|
1455
|
-
orderNumber: string;
|
|
1456
|
-
idempotencyKey: string;
|
|
1457
|
-
outcome: 'succeeded';
|
|
1458
|
-
refundedAmount: number;
|
|
1459
|
-
pgProvider: string;
|
|
1460
|
-
pgRefundId: string;
|
|
1614
|
+
type ProductDetailPreviewParams = {
|
|
1615
|
+
id: string;
|
|
1461
1616
|
};
|
|
1462
|
-
type
|
|
1463
|
-
|
|
1464
|
-
idempotencyKey: string;
|
|
1465
|
-
outcome: 'failed';
|
|
1466
|
-
refundedAmount: 0;
|
|
1467
|
-
pgProvider: string;
|
|
1468
|
-
pgRefundId?: string;
|
|
1617
|
+
type ProductDetailPreviewOptions = {
|
|
1618
|
+
previewToken: string;
|
|
1469
1619
|
};
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1620
|
+
interface ProductDetailVariantOptionValue {
|
|
1621
|
+
optionId: string | number;
|
|
1622
|
+
optionSlug: string;
|
|
1623
|
+
valueId: string | number;
|
|
1624
|
+
valueSlug: string;
|
|
1625
|
+
value?: string | null;
|
|
1626
|
+
}
|
|
1627
|
+
type ProductDetailMedia = string | number | {
|
|
1628
|
+
id?: string | number | null;
|
|
1629
|
+
url?: string | null;
|
|
1630
|
+
alt?: string | null;
|
|
1631
|
+
width?: number | null;
|
|
1632
|
+
height?: number | null;
|
|
1478
1633
|
};
|
|
1479
|
-
type
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1634
|
+
type ProductOptionValueColorSwatch = {
|
|
1635
|
+
type: 'color';
|
|
1636
|
+
color: string;
|
|
1637
|
+
mediaItemId?: null;
|
|
1638
|
+
};
|
|
1639
|
+
type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
1640
|
+
type: 'media';
|
|
1641
|
+
mediaItemId: TMedia;
|
|
1642
|
+
color?: null;
|
|
1643
|
+
};
|
|
1644
|
+
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
1645
|
+
type ProductDetailMediaValue = string | number | ProductDetailMedia | null;
|
|
1646
|
+
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
1647
|
+
interface ProductDetailVariant {
|
|
1648
|
+
id: string | number;
|
|
1649
|
+
optionKey: string;
|
|
1650
|
+
title?: string | null;
|
|
1651
|
+
displayName: string;
|
|
1652
|
+
sku?: string | null;
|
|
1653
|
+
price: number;
|
|
1654
|
+
compareAtPrice?: number | null;
|
|
1655
|
+
stock: number;
|
|
1656
|
+
reservedStock: number;
|
|
1657
|
+
isUnlimited: boolean;
|
|
1658
|
+
isActive: boolean;
|
|
1659
|
+
thumbnail?: ProductDetailMedia | null;
|
|
1660
|
+
images?: ProductDetailMedia[];
|
|
1661
|
+
media?: {
|
|
1662
|
+
primaryImage: ProductDetailMedia | null;
|
|
1663
|
+
images: ProductDetailMedia[];
|
|
1664
|
+
source: ProductDetailSelectionMediaSource;
|
|
1665
|
+
};
|
|
1666
|
+
optionValues: ProductDetailVariantOptionValue[];
|
|
1667
|
+
}
|
|
1668
|
+
interface ProductDetailOptionValue {
|
|
1669
|
+
id: string | number;
|
|
1670
|
+
value: string;
|
|
1671
|
+
slug: string;
|
|
1672
|
+
swatch?: ProductOptionValueSwatch<ProductDetailMedia>;
|
|
1673
|
+
}
|
|
1674
|
+
interface ProductDetailOption {
|
|
1675
|
+
id: string | number;
|
|
1676
|
+
title: string;
|
|
1677
|
+
slug: string;
|
|
1678
|
+
values: ProductDetailOptionValue[];
|
|
1679
|
+
}
|
|
1680
|
+
interface ProductDetailBrand {
|
|
1681
|
+
id: string | number;
|
|
1682
|
+
name: string;
|
|
1683
|
+
slug?: string | null;
|
|
1684
|
+
logo?: unknown | null;
|
|
1685
|
+
}
|
|
1686
|
+
interface ProductDetailCategory {
|
|
1687
|
+
id: string | number;
|
|
1688
|
+
title: string;
|
|
1689
|
+
slug?: string | null;
|
|
1690
|
+
}
|
|
1691
|
+
interface ProductDetailTag {
|
|
1692
|
+
id: string | number;
|
|
1693
|
+
title: string;
|
|
1694
|
+
slug?: string | null;
|
|
1695
|
+
}
|
|
1696
|
+
interface ProductDetailImage {
|
|
1697
|
+
id: string | number;
|
|
1698
|
+
url?: string | null;
|
|
1699
|
+
alt?: string | null;
|
|
1700
|
+
width?: number | null;
|
|
1701
|
+
height?: number | null;
|
|
1702
|
+
}
|
|
1703
|
+
interface ProductDetailVideo {
|
|
1704
|
+
id: string | number;
|
|
1705
|
+
url?: string | null;
|
|
1706
|
+
}
|
|
1707
|
+
interface ProductDetailListing {
|
|
1708
|
+
minPrice?: number | null;
|
|
1709
|
+
maxPrice?: number | null;
|
|
1710
|
+
minCompareAtPrice?: number | null;
|
|
1711
|
+
maxCompareAtPrice?: number | null;
|
|
1712
|
+
isPriceRange?: boolean | null;
|
|
1713
|
+
primaryImage?: ProductDetailMedia | null;
|
|
1714
|
+
availableForSale?: boolean | null;
|
|
1715
|
+
selectionHintVariant?: string | number | null;
|
|
1716
|
+
}
|
|
1717
|
+
type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'>;
|
|
1718
|
+
type ProductDetailCatalogListing = Omit<ProductDetailListing, 'availableForSale'> & {
|
|
1719
|
+
liveStockRequired: true;
|
|
1720
|
+
};
|
|
1721
|
+
interface ProductDetailCatalog {
|
|
1722
|
+
product: Omit<ProductDetail['product'], 'totalInventory'>;
|
|
1723
|
+
variants: ProductDetailCatalogVariant[];
|
|
1724
|
+
options: ProductDetail['options'];
|
|
1725
|
+
brand: ProductDetail['brand'];
|
|
1726
|
+
categories: ProductDetail['categories'];
|
|
1727
|
+
tags: ProductDetail['tags'];
|
|
1728
|
+
images: ProductDetail['images'];
|
|
1729
|
+
videos: ProductDetail['videos'];
|
|
1730
|
+
primaryMediaItemId?: ProductDetail['primaryMediaItemId'];
|
|
1731
|
+
listing: ProductDetailCatalogListing;
|
|
1732
|
+
}
|
|
1733
|
+
type StockSnapshotItemStatus = 'available' | 'not_published' | 'archived' | 'not_found';
|
|
1734
|
+
interface StockSnapshotItem {
|
|
1735
|
+
variantId: string;
|
|
1736
|
+
status: StockSnapshotItemStatus;
|
|
1737
|
+
availableStock: number;
|
|
1738
|
+
availableForSale: boolean;
|
|
1739
|
+
isUnlimited: boolean;
|
|
1740
|
+
}
|
|
1741
|
+
interface StockSnapshotResponse {
|
|
1742
|
+
snapshots: StockSnapshotItem[];
|
|
1743
|
+
}
|
|
1744
|
+
type StockSnapshotParams = {
|
|
1745
|
+
variantIds: string[];
|
|
1486
1746
|
};
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1747
|
+
interface ProductDetail {
|
|
1748
|
+
product: {
|
|
1749
|
+
id: string | number;
|
|
1750
|
+
slug: string;
|
|
1751
|
+
title: string;
|
|
1752
|
+
subtitle?: string | null;
|
|
1753
|
+
description?: string | null;
|
|
1754
|
+
content?: unknown;
|
|
1755
|
+
publishedAt?: string | null;
|
|
1756
|
+
status: string;
|
|
1757
|
+
totalInventory: number | null;
|
|
1758
|
+
totalVariants: number;
|
|
1759
|
+
hasUnlimitedVariant: boolean;
|
|
1760
|
+
hasOnlyDefaultVariant: boolean;
|
|
1761
|
+
};
|
|
1762
|
+
variants: ProductDetailVariant[];
|
|
1763
|
+
options: ProductDetailOption[];
|
|
1764
|
+
brand: ProductDetailBrand | null;
|
|
1765
|
+
categories: ProductDetailCategory[];
|
|
1766
|
+
tags: ProductDetailTag[];
|
|
1767
|
+
images: ProductDetailImage[];
|
|
1768
|
+
videos: ProductDetailVideo[];
|
|
1769
|
+
/** Canonical product primary pointer (pool member). */
|
|
1770
|
+
primaryMediaItemId?: ProductDetailMediaValue;
|
|
1771
|
+
listing: ProductDetailListing;
|
|
1772
|
+
}
|
|
1773
|
+
type ProductDetailUnavailableReason = 'not_found' | 'not_published' | 'feature_disabled';
|
|
1774
|
+
type ProductDetailResult = {
|
|
1775
|
+
found: true;
|
|
1776
|
+
product: ProductDetail;
|
|
1777
|
+
} | {
|
|
1778
|
+
found: false;
|
|
1779
|
+
reason: ProductDetailUnavailableReason;
|
|
1494
1780
|
};
|
|
1495
|
-
type
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
returnShippingFee?: number;
|
|
1502
|
-
initialShippingRefundAmount?: number;
|
|
1503
|
-
initialShippingRefundOverrideNote?: string;
|
|
1504
|
-
pgPaymentId: string;
|
|
1505
|
-
paymentKey?: string;
|
|
1506
|
-
refundReceiptUrl?: string;
|
|
1507
|
-
}>;
|
|
1508
|
-
type CheckoutParams = WithIdempotencyKey<{
|
|
1509
|
-
cartId: string;
|
|
1510
|
-
orderNumber: string;
|
|
1511
|
-
customerSnapshot: CustomerSnapshot;
|
|
1512
|
-
pgPaymentId?: string;
|
|
1513
|
-
discountCode?: string;
|
|
1514
|
-
}>;
|
|
1515
|
-
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
1516
|
-
orderNumber: string;
|
|
1517
|
-
fulfillmentOrderId?: string | number;
|
|
1518
|
-
carrier?: string;
|
|
1519
|
-
trackingNumber?: string;
|
|
1520
|
-
items?: Array<{
|
|
1521
|
-
orderItem: string;
|
|
1522
|
-
quantity: number;
|
|
1523
|
-
}>;
|
|
1524
|
-
}>;
|
|
1525
|
-
type PrepareFulfillmentOrderParams = {
|
|
1526
|
-
orderNumber: string;
|
|
1781
|
+
type ProductDetailCatalogResult = {
|
|
1782
|
+
found: true;
|
|
1783
|
+
product: ProductDetailCatalog;
|
|
1784
|
+
} | {
|
|
1785
|
+
found: false;
|
|
1786
|
+
reason: ProductDetailUnavailableReason;
|
|
1527
1787
|
};
|
|
1528
|
-
type
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1788
|
+
type ProductUpsertParams = ProductUpsertInput;
|
|
1789
|
+
/** Console `POST /api/products/upsert` field allowlist error reasons. */
|
|
1790
|
+
declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
|
|
1791
|
+
declare const PRODUCT_UPSERT_READONLY_FIELD_REASON: "product_field_readonly";
|
|
1792
|
+
type ProductUpsertFieldValidationErrorReason = typeof PRODUCT_UPSERT_UNKNOWN_FIELD_REASON | typeof PRODUCT_UPSERT_READONLY_FIELD_REASON;
|
|
1793
|
+
/** 400 response body when upsert rejects unknown or server-managed product fields. */
|
|
1794
|
+
type ProductUpsertFieldValidationErrorBody = {
|
|
1795
|
+
error: string;
|
|
1796
|
+
reason: ProductUpsertFieldValidationErrorReason;
|
|
1797
|
+
field: string;
|
|
1798
|
+
requestId?: string;
|
|
1534
1799
|
};
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1800
|
+
declare function isProductUpsertFieldValidationErrorBody(value: unknown): value is ProductUpsertFieldValidationErrorBody;
|
|
1801
|
+
type ProductUpsertResponse = {
|
|
1802
|
+
ok: true;
|
|
1803
|
+
product: PublicProduct;
|
|
1804
|
+
listingProjectionStale: boolean;
|
|
1805
|
+
} | {
|
|
1806
|
+
ok: false;
|
|
1807
|
+
failedEntity: 'product' | 'option' | 'option-value' | 'variant';
|
|
1808
|
+
failedIndex?: number;
|
|
1809
|
+
message: string;
|
|
1540
1810
|
};
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1811
|
+
declare class ProductApi extends BaseApi {
|
|
1812
|
+
constructor(options: ProductApiOptions);
|
|
1813
|
+
/**
|
|
1814
|
+
* Check point-in-time stock availability for one or more product variants.
|
|
1815
|
+
* Results reflect available stock at the moment of the call and are not guaranteed
|
|
1816
|
+
* to remain available by the time an order is placed.
|
|
1817
|
+
*/
|
|
1818
|
+
stockCheck(params: StockCheckParams): Promise<StockCheckResponse>;
|
|
1819
|
+
stockSnapshot(params: StockSnapshotParams): Promise<StockSnapshotResponse>;
|
|
1820
|
+
listingGroups(params: ListingGroupsParams): Promise<ProductListingGroupsResponse>;
|
|
1821
|
+
listingGroupsCatalog(params: ListingGroupsParams): Promise<ProductListingGroupsCatalogResponse>;
|
|
1822
|
+
listingPage(params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
1823
|
+
listingPage(params: ProductListingPageFullParams): Promise<ProductListingPageResult<ProductListingGroupsItem>>;
|
|
1824
|
+
listingPage(params: ProductListingPageParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
|
|
1825
|
+
/**
|
|
1826
|
+
* Fetch full product detail by slug or id.
|
|
1827
|
+
* Returns a discriminated result so storefronts can distinguish missing,
|
|
1828
|
+
* unpublished, and feature-disabled products.
|
|
1829
|
+
*
|
|
1830
|
+
* Only product-detail 404 responses carrying one of those allowlisted reasons
|
|
1831
|
+
* are mapped to `{ found: false, reason }`. Unknown or uncoded 404s, plus
|
|
1832
|
+
* permission/auth errors such as tenant mismatch, continue to throw typed SDK
|
|
1833
|
+
* errors instead of being collapsed into a storefront absence result.
|
|
1834
|
+
*/
|
|
1835
|
+
detail(params: ProductDetailParams): Promise<ProductDetailResult>;
|
|
1836
|
+
detailCatalog(params: ProductDetailParams): Promise<ProductDetailCatalogResult>;
|
|
1837
|
+
/**
|
|
1838
|
+
* Atomically create or update a product together with its options,
|
|
1839
|
+
* option-values, and variants in a single transaction. Mirrors Shopify's
|
|
1840
|
+
* `productSet` shape and is the canonical write path for the MCP
|
|
1841
|
+
* `product-upsert` tool.
|
|
1842
|
+
*/
|
|
1843
|
+
upsert(params: ProductUpsertParams): Promise<ProductUpsertResponse>;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
type DiscountApiOptions = ServerApiOptions;
|
|
1847
|
+
type ValidateDiscountParams = {
|
|
1848
|
+
code: string;
|
|
1849
|
+
orderAmount: number;
|
|
1547
1850
|
};
|
|
1548
|
-
type
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
error: string;
|
|
1556
|
-
}>;
|
|
1851
|
+
type ValidateDiscountResult = {
|
|
1852
|
+
valid: boolean;
|
|
1853
|
+
code: string;
|
|
1854
|
+
type?: 'percentage' | 'fixed_amount' | 'free_shipping' | 'tiered';
|
|
1855
|
+
discountAmount: number;
|
|
1856
|
+
freeShipping?: boolean;
|
|
1857
|
+
reason?: string;
|
|
1557
1858
|
};
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
type UpdateReturnParams = {
|
|
1569
|
-
returnId: string;
|
|
1570
|
-
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
1859
|
+
declare class DiscountApi extends BaseApi {
|
|
1860
|
+
constructor(options: DiscountApiOptions);
|
|
1861
|
+
validate(params: ValidateDiscountParams): Promise<ValidateDiscountResult>;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
type ShippingApiOptions = ServerApiOptions;
|
|
1865
|
+
type CalculateShippingParams = {
|
|
1866
|
+
shippingPolicyId?: string;
|
|
1867
|
+
orderAmount: number;
|
|
1868
|
+
postalCode?: string;
|
|
1571
1869
|
};
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
bulkImportFulfillments(params: BulkImportFulfillmentsParams): Promise<BulkImportFulfillmentsResponse>;
|
|
1585
|
-
returnWithRefund(params: ReturnWithRefundParams): Promise<{
|
|
1586
|
-
return: Return;
|
|
1587
|
-
transaction: Transaction | null;
|
|
1588
|
-
}>;
|
|
1589
|
-
createReturn(params: CreateReturnParams): Promise<Return>;
|
|
1590
|
-
updateReturn(params: UpdateReturnParams): Promise<Return>;
|
|
1870
|
+
type CalculateShippingResult = {
|
|
1871
|
+
shippingAmount: number;
|
|
1872
|
+
baseShippingAmount: number;
|
|
1873
|
+
extraShippingAmount: number;
|
|
1874
|
+
freeShipping: boolean;
|
|
1875
|
+
freeShippingMinAmount: number | null;
|
|
1876
|
+
isJeju: boolean;
|
|
1877
|
+
isRemoteIsland: boolean;
|
|
1878
|
+
};
|
|
1879
|
+
declare class ShippingApi extends BaseApi {
|
|
1880
|
+
constructor(options: ShippingApiOptions);
|
|
1881
|
+
calculate(params: CalculateShippingParams): Promise<CalculateShippingResult>;
|
|
1591
1882
|
}
|
|
1592
1883
|
|
|
1593
1884
|
interface CommerceClientOptions {
|
|
@@ -1602,31 +1893,34 @@ declare class CommerceClient {
|
|
|
1602
1893
|
readonly product: {
|
|
1603
1894
|
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
1604
1895
|
stockSnapshot: (params: StockSnapshotParams) => Promise<StockSnapshotResponse>;
|
|
1605
|
-
listingGroups: (params: ListingGroupsParams) => Promise<
|
|
1606
|
-
listingGroupsCatalog: (params: ListingGroupsParams) => Promise<
|
|
1896
|
+
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsCatalogResponse>;
|
|
1897
|
+
listingGroupsCatalog: (params: ListingGroupsParams) => Promise<ProductListingGroupsCatalogResponse>;
|
|
1898
|
+
listingPage: {
|
|
1899
|
+
(params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
1900
|
+
};
|
|
1607
1901
|
detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
|
|
1608
1902
|
detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
1609
1903
|
};
|
|
1610
1904
|
readonly cart: {
|
|
1611
|
-
get: (cartId: string) => Promise<
|
|
1612
|
-
addItem: (params: AddItemParams) => Promise<
|
|
1613
|
-
updateItem: (params: UpdateItemParams) => Promise<
|
|
1905
|
+
get: (cartId: string) => Promise<PublicCart>;
|
|
1906
|
+
addItem: (params: AddItemParams) => Promise<PublicCartItem>;
|
|
1907
|
+
updateItem: (params: UpdateItemParams) => Promise<PublicCartItem>;
|
|
1614
1908
|
removeItem: (params: RemoveItemParams) => Promise<{
|
|
1615
1909
|
success: boolean;
|
|
1616
1910
|
}>;
|
|
1617
|
-
applyDiscount: (params: ApplyDiscountParams) => Promise<
|
|
1618
|
-
removeDiscount: (params: RemoveDiscountParams) => Promise<
|
|
1911
|
+
applyDiscount: (params: ApplyDiscountParams) => Promise<PublicCart>;
|
|
1912
|
+
removeDiscount: (params: RemoveDiscountParams) => Promise<PublicCart>;
|
|
1619
1913
|
clear: (params: ClearCartParams) => Promise<{
|
|
1620
1914
|
success: boolean;
|
|
1621
1915
|
}>;
|
|
1622
1916
|
};
|
|
1623
1917
|
readonly orders: {
|
|
1624
|
-
checkout: (params: CheckoutParams) => Promise<
|
|
1918
|
+
checkout: (params: CheckoutParams) => Promise<PublicOrder>;
|
|
1625
1919
|
listMine: (options?: {
|
|
1626
1920
|
page?: number;
|
|
1627
1921
|
limit?: number;
|
|
1628
1922
|
status?: string;
|
|
1629
|
-
}) => Promise<PayloadFindResponse<
|
|
1923
|
+
}) => Promise<PayloadFindResponse<PublicOrder>>;
|
|
1630
1924
|
};
|
|
1631
1925
|
readonly discounts: {
|
|
1632
1926
|
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
@@ -1637,6 +1931,85 @@ declare class CommerceClient {
|
|
|
1637
1931
|
constructor(options: CommerceClientOptions);
|
|
1638
1932
|
}
|
|
1639
1933
|
|
|
1934
|
+
type StorefrontContentReference = {
|
|
1935
|
+
id?: string | number | null;
|
|
1936
|
+
title?: string | null;
|
|
1937
|
+
name?: string | null;
|
|
1938
|
+
slug?: string | null;
|
|
1939
|
+
displayName?: string | null;
|
|
1940
|
+
handle?: string | null;
|
|
1941
|
+
color?: string | null;
|
|
1942
|
+
image?: PublicMediaAsset | null;
|
|
1943
|
+
thumbnail?: PublicMediaAsset | null;
|
|
1944
|
+
avatar?: PublicMediaAsset | null;
|
|
1945
|
+
};
|
|
1946
|
+
type StorefrontLink = {
|
|
1947
|
+
id?: string | number | null;
|
|
1948
|
+
title?: string | null;
|
|
1949
|
+
subtitle?: string | null;
|
|
1950
|
+
url?: string | null;
|
|
1951
|
+
description?: string | null;
|
|
1952
|
+
slug?: string | null;
|
|
1953
|
+
type?: 'external' | 'social' | 'internal' | string | null;
|
|
1954
|
+
platform?: string | null;
|
|
1955
|
+
opensInNewTab?: boolean | null;
|
|
1956
|
+
noFollow?: boolean | null;
|
|
1957
|
+
expiresAt?: string | null;
|
|
1958
|
+
isFeatured?: boolean | null;
|
|
1959
|
+
publishedAt?: string | null;
|
|
1960
|
+
createdAt?: string | null;
|
|
1961
|
+
updatedAt?: string | null;
|
|
1962
|
+
categories?: StorefrontContentReference[] | StorefrontContentReference | null;
|
|
1963
|
+
tags?: StorefrontContentReference[] | StorefrontContentReference | null;
|
|
1964
|
+
thumbnail?: PublicMediaAsset | null;
|
|
1965
|
+
icon?: PublicMediaAsset | null;
|
|
1966
|
+
};
|
|
1967
|
+
type StorefrontGalleryItem = {
|
|
1968
|
+
id?: string | number | null;
|
|
1969
|
+
title?: string | null;
|
|
1970
|
+
description?: string | null;
|
|
1971
|
+
content?: unknown;
|
|
1972
|
+
createdAt?: string | null;
|
|
1973
|
+
updatedAt?: string | null;
|
|
1974
|
+
gallery?: StorefrontContentReference | string | null;
|
|
1975
|
+
image?: PublicMediaAsset | null;
|
|
1976
|
+
};
|
|
1977
|
+
type StorefrontLinksSort = 'createdAt' | '-createdAt' | 'updatedAt' | '-updatedAt' | 'publishedAt' | '-publishedAt' | 'title' | '-title' | 'isFeatured' | '-isFeatured';
|
|
1978
|
+
type StorefrontGalleryItemsSort = 'manual' | 'createdAt' | '-createdAt' | 'updatedAt' | '-updatedAt' | 'title' | '-title';
|
|
1979
|
+
type StorefrontContentListOptions<TSort extends string = string> = {
|
|
1980
|
+
page?: number;
|
|
1981
|
+
limit?: number;
|
|
1982
|
+
sort?: TSort;
|
|
1983
|
+
};
|
|
1984
|
+
type StorefrontLinksListOptions = StorefrontContentListOptions<StorefrontLinksSort> & {
|
|
1985
|
+
categoryId?: string;
|
|
1986
|
+
categorySlug?: string;
|
|
1987
|
+
tagId?: string;
|
|
1988
|
+
tagSlug?: string;
|
|
1989
|
+
featured?: boolean;
|
|
1990
|
+
};
|
|
1991
|
+
type StorefrontGalleryItemsListOptions = StorefrontContentListOptions<StorefrontGalleryItemsSort> & ({
|
|
1992
|
+
galleryId: string;
|
|
1993
|
+
gallerySlug?: string;
|
|
1994
|
+
} | {
|
|
1995
|
+
galleryId?: string;
|
|
1996
|
+
gallerySlug: string;
|
|
1997
|
+
});
|
|
1998
|
+
type ContentClientOptions = {
|
|
1999
|
+
publishableKey: string;
|
|
2000
|
+
apiUrl?: string;
|
|
2001
|
+
onRequestId?: (id: string | null) => void;
|
|
2002
|
+
};
|
|
2003
|
+
declare class ContentClient {
|
|
2004
|
+
readonly links: {
|
|
2005
|
+
list: (options?: StorefrontLinksListOptions) => Promise<PayloadFindResponse<StorefrontLink>>;
|
|
2006
|
+
};
|
|
2007
|
+
readonly galleryItems: {
|
|
2008
|
+
list: (options: StorefrontGalleryItemsListOptions) => Promise<PayloadFindResponse<StorefrontGalleryItem>>;
|
|
2009
|
+
};
|
|
2010
|
+
constructor(options: ContentClientOptions);
|
|
2011
|
+
}
|
|
2012
|
+
|
|
1640
2013
|
interface ServerCommerceClientOptions {
|
|
1641
2014
|
publishableKey?: string;
|
|
1642
2015
|
secretKey: string;
|
|
@@ -1647,25 +2020,30 @@ declare class ServerCommerceClient {
|
|
|
1647
2020
|
readonly product: {
|
|
1648
2021
|
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
1649
2022
|
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
2023
|
+
listingPage: {
|
|
2024
|
+
(params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
2025
|
+
(params: ProductListingPageFullParams): Promise<ProductListingPageResult<ProductListingGroupsItem>>;
|
|
2026
|
+
(params: ProductListingPageParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
|
|
2027
|
+
};
|
|
1650
2028
|
detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
|
|
1651
2029
|
previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
|
|
1652
2030
|
upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
|
|
1653
2031
|
};
|
|
1654
2032
|
readonly cart: {
|
|
1655
|
-
get: (cartId: string) => Promise<
|
|
1656
|
-
addItem: (params: AddItemParams) => Promise<
|
|
1657
|
-
updateItem: (params: UpdateItemParams) => Promise<
|
|
2033
|
+
get: (cartId: string) => Promise<PublicCart>;
|
|
2034
|
+
addItem: (params: AddItemParams) => Promise<PublicCartItem>;
|
|
2035
|
+
updateItem: (params: UpdateItemParams) => Promise<PublicCartItem>;
|
|
1658
2036
|
removeItem: (params: RemoveItemParams) => Promise<{
|
|
1659
2037
|
success: boolean;
|
|
1660
2038
|
}>;
|
|
1661
|
-
applyDiscount: (params: ApplyDiscountParams) => Promise<
|
|
1662
|
-
removeDiscount: (params: RemoveDiscountParams) => Promise<
|
|
2039
|
+
applyDiscount: (params: ApplyDiscountParams) => Promise<PublicCart>;
|
|
2040
|
+
removeDiscount: (params: RemoveDiscountParams) => Promise<PublicCart>;
|
|
1663
2041
|
clear: (params: ClearCartParams) => Promise<{
|
|
1664
2042
|
success: boolean;
|
|
1665
2043
|
}>;
|
|
1666
2044
|
};
|
|
1667
2045
|
readonly orders: {
|
|
1668
|
-
checkout: (params: CheckoutParams) => Promise<
|
|
2046
|
+
checkout: (params: CheckoutParams) => Promise<PublicOrder>;
|
|
1669
2047
|
create: (params: CreateOrderParams) => Promise<Order>;
|
|
1670
2048
|
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
1671
2049
|
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
@@ -2085,6 +2463,20 @@ interface ApiQueryOptions {
|
|
|
2085
2463
|
/** Include soft-deleted documents (requires `trash` enabled on the collection) */
|
|
2086
2464
|
trash?: boolean;
|
|
2087
2465
|
}
|
|
2466
|
+
type PublicReadQueryOptions = Omit<ApiQueryOptions, 'depth' | 'joins' | 'populate'> & {
|
|
2467
|
+
/**
|
|
2468
|
+
* Publishable collection reads stay unpopulated. Use shaped commerce/community
|
|
2469
|
+
* endpoints or a server client when populated relations are required.
|
|
2470
|
+
*/
|
|
2471
|
+
depth?: 0;
|
|
2472
|
+
/**
|
|
2473
|
+
* Publishable collection reads disable Payload join fields to avoid accidental
|
|
2474
|
+
* exposure and expensive generic list responses.
|
|
2475
|
+
*/
|
|
2476
|
+
joins?: false;
|
|
2477
|
+
/** Publishable collection reads do not support relationship populate maps. */
|
|
2478
|
+
populate?: never;
|
|
2479
|
+
};
|
|
2088
2480
|
interface DebugConfig {
|
|
2089
2481
|
logRequests?: boolean;
|
|
2090
2482
|
logResponses?: boolean;
|
|
@@ -2095,14 +2487,14 @@ interface RetryConfig {
|
|
|
2095
2487
|
retryableStatuses?: number[];
|
|
2096
2488
|
retryDelay?: (attempt: number) => number;
|
|
2097
2489
|
}
|
|
2098
|
-
interface RootQueryLookup<T extends string> {
|
|
2099
|
-
find(options?:
|
|
2100
|
-
findById(id: string | number, options?:
|
|
2101
|
-
count(options?:
|
|
2490
|
+
interface RootQueryLookup<T extends string, Options extends ApiQueryOptions = ApiQueryOptions> {
|
|
2491
|
+
find(options?: Options): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
2492
|
+
findById(id: string | number, options?: Options): Promise<CollectionType<T>>;
|
|
2493
|
+
count(options?: Options): Promise<{
|
|
2102
2494
|
totalDocs: number;
|
|
2103
2495
|
}>;
|
|
2104
2496
|
}
|
|
2105
|
-
type RootReadOnlyQueryBuilder<T extends PublicCollection> = RootQueryLookup<T>;
|
|
2497
|
+
type RootReadOnlyQueryBuilder<T extends PublicCollection> = RootQueryLookup<T, PublicReadQueryOptions>;
|
|
2106
2498
|
interface RootServerQueryBuilder<T extends ServerCollection> extends RootQueryLookup<T> {
|
|
2107
2499
|
create(data: Partial<CollectionType<T>>, options?: {
|
|
2108
2500
|
file?: File | Blob;
|
|
@@ -2125,6 +2517,7 @@ interface RootServerCollectionClient {
|
|
|
2125
2517
|
interface RootClient {
|
|
2126
2518
|
commerce: CommerceClient;
|
|
2127
2519
|
community: CommunityClient;
|
|
2520
|
+
content: ContentClient;
|
|
2128
2521
|
/** Set on {@link createClient} return values; optional for structural mocks. */
|
|
2129
2522
|
events?: EventsClient;
|
|
2130
2523
|
customer: CustomerNamespace;
|
|
@@ -2162,4 +2555,4 @@ type DeepPartial<T> = {
|
|
|
2162
2555
|
};
|
|
2163
2556
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
2164
2557
|
|
|
2165
|
-
export { type
|
|
2558
|
+
export { type CollectionFieldSchema as $, type AddItemParams as A, type RootReadOnlyQueryBuilder as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type StorefrontContentListOptions as F, type StorefrontContentReference as G, type StorefrontGalleryItem as H, type StorefrontGalleryItemsListOptions as I, type StorefrontGalleryItemsSort as J, type StorefrontLink as K, type StorefrontLinksListOptions as L, type StorefrontLinksSort as M, BaseApi as N, type ServerApiOptions as O, type PayloadFindResponse as P, ServerCommerceClient as Q, type RemoveDiscountParams as R, type Sort as S, type TenantIntrospectionClient as T, type UpdateItemParams as U, type BanCustomerParams as V, type Where as W, type CommunityBan as X, type UnbanCustomerParams as Y, type ClientServerConfig as Z, type RootServerClientWithEvents as _, CommunityClient as a, type CalculateShippingResult as a$, type CollectionSchemaResponse as a0, type EventGuestCancelParams as a1, type EventGuestRegistration as a2, type EventGuestRegistrationResponse as a3, type EventRegistrationAnswerInput as a4, type EventRegistrationAttendeeInput as a5, type EventRegistrationPublic as a6, type EventRegistrationRegisterParams as a7, type EventRegistrationRegisterResponse as a8, type EventsCalendarItem as a9, type CustomerAuthResponse as aA, type CustomerLoginData as aB, type CustomerRegisterResponse as aC, type CustomerRegisterData as aD, type CustomerRefreshResponse as aE, type UpdateProfileData as aF, type ProductListingPageBaseParams as aG, type ProductListingPageParams as aH, type ProductDetailParams as aI, type ProductDetailResult as aJ, type ProductListingPageCatalogParams as aK, type ProductListingPageResult as aL, type ProductListingGroupsCatalogItem as aM, type ProductListingPageFullParams as aN, type ProductListingGroupsItem as aO, type ProductDetail as aP, type ProductDetailCatalog as aQ, type StockSnapshotResponse as aR, type ProductSelectionMediaSource as aS, type ProductDisplayMediaSource as aT, type ResolveProductSelectionMediaInput as aU, type ResolveProductSelectionMediaResult as aV, type ProductSelectionMediaPointer as aW, type RootClientWithEvents as aX, type BulkImportFulfillmentsParams as aY, type BulkImportFulfillmentsResponse as aZ, type CalculateShippingParams as a_, type EventsClientOptions as aa, type EventsDateParam as ab, type EventsExternalSource as ac, type EventsLocation as ad, type EventsOccurrenceLocation as ae, type EventsRangeEvent as af, type EventsRangeOccurrence as ag, type EventsRangeParams as ah, type EventsRangeResponse as ai, type EventsTaxonomyItem as aj, ModerationApi as ak, type RootServerClient as al, type TenantFeatureProgressEvidenceValue as am, type TenantFeatureProgressFeature as an, type TenantFeatureProgressGroup as ao, type TenantFeatureProgressInput as ap, type TenantFeatureProgressItem as aq, type TenantFeatureProgressItemState as ar, type TenantFeatureProgressResponse as as, type TenantFeatureProgressSeverity as at, type TenantFeatureProgressStatus as au, TenantIntrospectionApi as av, type TenantIntrospectionApiOptions as aw, type PublicReadQueryOptions as ax, CustomerAuth as ay, type CustomerProfile as az, ContentClient as b, type ProductListingCard as b$, type CancelOrderParams as b0, type CancelOrderReconciliationStatus as b1, type CancelOrderResponse as b2, type CancelReasonCode as b3, CartApi as b4, type CartApiOptions as b5, type Comment as b6, type CommerceClientOptions as b7, type CommunityClientOptions as b8, type CommunityComment as b9, type OrderApiOptions as bA, PRODUCT_PLP_FIND_OPTIONS as bB, PRODUCT_UPSERT_READONLY_FIELD_REASON as bC, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as bD, type PrepareFulfillmentOrderParams as bE, type PrepareFulfillmentOrderResponse as bF, ProductApi as bG, type ProductApiOptions as bH, type ProductDetailBrand as bI, type ProductDetailCatalogListing as bJ, type ProductDetailCatalogResult as bK, type ProductDetailCatalogVariant as bL, type ProductDetailCategory as bM, type ProductDetailImage as bN, type ProductDetailImageMedia as bO, type ProductDetailListing as bP, type ProductDetailMedia as bQ, type ProductDetailOption as bR, type ProductDetailOptionValue as bS, type ProductDetailTag as bT, type ProductDetailUnavailableReason as bU, type ProductDetailVariant as bV, type ProductDetailVariantOptionValue as bW, type ProductDetailVideo as bX, type ProductHrefGroup as bY, type ProductHrefOptions as bZ, type ProductHrefProduct as b_, type CommunityCommentListSort as ba, type CommunityPost as bb, type CommunityPostCategory as bc, type CommunityPostListSort as bd, type CommunityPostTag as be, type CommunityPublicAuthorSnapshot as bf, type CommunityPublicMediaAsset as bg, type CommunityPublicReference as bh, type CompatibilityProductSelectionParamEvent as bi, type ConfirmPaymentParams as bj, type ConfirmPaymentResponse as bk, type CreateFulfillmentParams as bl, type CreateOrderItem as bm, type CreateOrderParams as bn, type CreateReturnParams as bo, type CustomerAuthOptions as bp, type CustomerSnapshot as bq, DiscountApi as br, type DiscountApiOptions as bs, type LegacyProductSelectionParamEvent as bt, type ListingGroupsParams as bu, type ListingPrimaryImageFallbackInput as bv, type MediaValue as bw, type NormalizedOptionSwatch as bx, type NormalizedProductSelection as by, OrderApi as bz, CustomerNamespace as c, type UpdateTransactionParams as c$, type ProductListingCardOptions as c0, type ProductListingCardPriceRange as c1, type ProductListingCardRepresentativeVariant as c2, type ProductListingGroup as c3, type ProductListingGroupCatalogSummary as c4, type ProductListingGroupCatalogVariant as c5, type ProductListingGroupSummary as c6, type ProductListingGroupVariant as c7, type ProductListingGroupsCatalogListing as c8, type ProductListingGroupsCatalogProduct as c9, type ProductSelectionUrlEmit as cA, type ProductSelectionVariant as cB, type ProductUpsertFieldValidationErrorBody as cC, type ProductUpsertFieldValidationErrorReason as cD, type ProductVariantShape as cE, type RequestOptions as cF, type ResolveCancelRefundFailedResponse as cG, type ResolveCancelRefundOutcome as cH, type ResolveCancelRefundParams as cI, type ResolveCancelRefundResponse as cJ, type ResolveCancelRefundSucceededResponse as cK, type ResolveProductDisplayMediaInput as cL, type ResolveProductDisplayMediaResult as cM, type ReturnItem as cN, type ReturnReason as cO, type ReturnWithRefundItem as cP, type ReturnWithRefundParams as cQ, ShippingApi as cR, type ShippingApiOptions as cS, type StockCheckParams as cT, type StockCheckResponse as cU, type StockCheckResult as cV, type StockSnapshotItem as cW, type StockSnapshotParams as cX, type UpdateFulfillmentParams as cY, type UpdateOrderParams as cZ, type UpdateReturnParams as c_, type ProductListingGroupsCatalogResponse as ca, type ProductListingGroupsProduct as cb, type ProductListingGroupsResponse as cc, type ProductListingPageFilters as cd, type ProductListingPageSort as ce, type ProductListingProductShape as cf, type ProductListingProjection as cg, type ProductListingSwatch as ch, type ProductMediaResolutionSource as ci, type ProductOptionMatrix as cj, type ProductOptionMatrixOption as ck, type ProductOptionMatrixValue as cl, type ProductOptionMatrixVariant as cm, type ProductOptionShape as cn, type ProductOptionValueShape as co, type ProductOptionValueSwatch as cp, type ProductOptionValueSwatchInput as cq, type ProductSelectionAvailableSwatch as cr, type ProductSelectionAvailableValue as cs, type ProductSelectionByOptionValue as ct, ProductSelectionCodecError as cu, type ProductSelectionCodecOptions as cv, type ProductSelectionInput as cw, type ProductSelectionOptionValue as cx, type ProductSelectionResolution as cy, type ProductSelectionResolutionContext as cz, type ClientState as d, type ValidateDiscountParams as d0, type ValidateDiscountResult as d1, type WithIdempotencyKey as d2, buildProductHref as d3, buildProductListingCard as d4, buildProductListingGroupsByOption as d5, buildProductListingProjection as d6, buildProductOptionMatrix as d7, buildProductOptionMatrixFromDetail as d8, createProductSelectionCodec as d9, getAvailableOptionValues as da, getProductSelectionImages as db, getSelectedValueByOptionId as dc, isProductUpsertFieldValidationErrorBody as dd, normalizeProductSelection as de, normalizeProductSelectionFromMatrix as df, normalizeSelectedValueIds as dg, parseProductSelection as dh, resolveListingPrimaryImagePointer as di, resolveProductDisplayMedia as dj, resolveProductSelection as dk, resolveProductSelectionFromMatrix as dl, resolveProductSelectionMedia as dm, resolveVariantForSelection as dn, selectNext as dp, selectedSwatchMediaItemId as dq, stringifyProductSelection as dr, toShopifyPriceRangeV2 as ds, type ClientConfig as e, type ApiQueryOptions as f, type ApplyDiscountParams as g, type CheckoutParams as h, type ClearCartParams as i, type ClientMetadata as j, type ContentClientOptions as k, type DeepPartial as l, type ExtractArrayType as m, type PayloadMutationResponse as n, type PublicCart as o, type PublicCartItem as p, type PublicCartReference as q, type PublicMediaAsset as r, type PublicMediaSize as s, type PublicOrder as t, type PublicOrderItem as u, type PublicOrderReference as v, type RemoveItemParams as w, type RetryConfig as x, type RootClient as y, type RootCollectionClient as z };
|