@01.software/sdk 0.33.0 → 0.34.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 +214 -22
- 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 +341 -26
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -6
- package/dist/client.d.ts +7 -6
- package/dist/client.js +341 -26
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-De6eKW1J.d.cts → collection-client-CR2B8c1v.d.cts} +7 -3
- package/dist/{collection-client-B6SlhzIP.d.ts → collection-client-DkREjhQ9.d.ts} +7 -3
- package/dist/{const-sPR2IkCe.d.cts → const-BTvdrXtY.d.cts} +4 -4
- package/dist/{const-DwmSDeWq.d.ts → const-CdqCauHQ.d.ts} +4 -4
- package/dist/index-CjA3U6X3.d.cts +186 -0
- package/dist/index-DK8_NXkh.d.ts +186 -0
- package/dist/index.cjs +1401 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -9
- package/dist/index.d.ts +74 -9
- package/dist/index.js +1401 -176
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-dkeQyrDC.d.cts → payload-types-C7tb7Xbs.d.cts} +208 -52
- package/dist/{payload-types-dkeQyrDC.d.ts → payload-types-C7tb7Xbs.d.ts} +208 -52
- package/dist/query.cjs +194 -35
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +44 -17
- package/dist/query.d.ts +44 -17
- package/dist/query.js +194 -35
- package/dist/query.js.map +1 -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.map +1 -1
- package/dist/{server-CrsPyqEc.d.cts → server-nXOezi4b.d.cts} +22 -6
- package/dist/{server-CrsPyqEc.d.ts → server-nXOezi4b.d.ts} +22 -6
- package/dist/server.cjs +439 -32
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +11 -179
- package/dist/server.d.ts +11 -179
- package/dist/server.js +439 -32
- package/dist/server.js.map +1 -1
- package/dist/{types-Cel_4L9t.d.ts → types-1ylMrCuW.d.ts} +1 -1
- package/dist/{types-B3YT092I.d.cts → types-Bx558PU6.d.cts} +1 -1
- package/dist/{types-BHh0YLmq.d.ts → types-Byo_Rty4.d.ts} +705 -69
- package/dist/{types-BZKxss8Y.d.cts → types-DDhtZI6E.d.cts} +705 -69
- package/dist/ui/canvas/server.cjs +231 -38
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +1 -1
- package/dist/ui/canvas/server.d.ts +1 -1
- package/dist/ui/canvas/server.js +221 -38
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +320 -257
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +5 -19
- package/dist/ui/canvas.d.ts +5 -19
- package/dist/ui/canvas.js +323 -260
- 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.cjs +2 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +20 -179
- package/dist/webhook.d.ts +20 -179
- package/dist/webhook.js +2 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +4 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as PublicCollection } from './const-
|
|
2
|
-
import {
|
|
3
|
-
import { O as Order, i as Cart, j as CartItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
1
|
+
import { P as PublicCollection, S as ServerCollection } from './const-BTvdrXtY.cjs';
|
|
2
|
+
import { C as CollectionType, P as PublicProduct } from './types-Bx558PU6.cjs';
|
|
3
|
+
import { O as Order, i as Cart, j as CartItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-C7tb7Xbs.cjs';
|
|
4
4
|
|
|
5
5
|
interface CommunityClientOptions {
|
|
6
6
|
publishableKey?: string;
|
|
@@ -10,28 +10,18 @@ interface CommunityClientOptions {
|
|
|
10
10
|
onUnauthorized?: () => Promise<string | null>;
|
|
11
11
|
onRequestId?: (id: string | null) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
interface Comment {
|
|
26
|
-
id: string;
|
|
27
|
-
body: string;
|
|
28
|
-
post?: string;
|
|
29
|
-
parent?: string;
|
|
30
|
-
rootComment?: string;
|
|
31
|
-
createdAt?: string;
|
|
32
|
-
updatedAt?: string;
|
|
33
|
-
[key: string]: unknown;
|
|
34
|
-
}
|
|
13
|
+
/** Public read shape for `posts` (tenant-scoped author profiles). */
|
|
14
|
+
type CommunityPost = CollectionType<'posts'>;
|
|
15
|
+
/** Public read shape for `comments`. */
|
|
16
|
+
type CommunityComment = CollectionType<'comments'>;
|
|
17
|
+
/** @deprecated Use {@link CommunityComment}. */
|
|
18
|
+
type Comment = CommunityComment;
|
|
19
|
+
/** Public read shape for `post-categories`. */
|
|
20
|
+
type CommunityPostCategory = CollectionType<'post-categories'>;
|
|
21
|
+
/** Public read shape for `post-tags`. */
|
|
22
|
+
type CommunityPostTag = CollectionType<'post-tags'>;
|
|
23
|
+
type CommunityPostListSort = 'createdAt' | '-createdAt' | 'lastActivityAt' | '-lastActivityAt' | 'viewCount' | '-viewCount' | 'commentCount' | '-commentCount';
|
|
24
|
+
type CommunityCommentListSort = 'createdAt' | '-createdAt';
|
|
35
25
|
interface Reaction {
|
|
36
26
|
id: string;
|
|
37
27
|
post?: string;
|
|
@@ -79,6 +69,8 @@ declare class CommunityClient {
|
|
|
79
69
|
private readonly onRequestId?;
|
|
80
70
|
constructor(options: CommunityClientOptions);
|
|
81
71
|
private buildQuery;
|
|
72
|
+
private buildPostsListQuery;
|
|
73
|
+
private buildCommentsListQuery;
|
|
82
74
|
private execute;
|
|
83
75
|
createPost(params: {
|
|
84
76
|
title?: string | null;
|
|
@@ -86,6 +78,25 @@ declare class CommunityClient {
|
|
|
86
78
|
categories?: string[];
|
|
87
79
|
thumbnail?: string;
|
|
88
80
|
}): Promise<CommunityPost>;
|
|
81
|
+
/**
|
|
82
|
+
* Public post feed. Server applies the same visibility contract as
|
|
83
|
+
* `communityPostRead` (published + visible + moderation-safe).
|
|
84
|
+
*/
|
|
85
|
+
listPosts(params?: {
|
|
86
|
+
page?: number;
|
|
87
|
+
limit?: number;
|
|
88
|
+
categoryId?: string;
|
|
89
|
+
tagId?: string;
|
|
90
|
+
sort?: CommunityPostListSort;
|
|
91
|
+
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
92
|
+
listPostCategories(params?: {
|
|
93
|
+
page?: number;
|
|
94
|
+
limit?: number;
|
|
95
|
+
}): Promise<PaginatedResponse<CommunityPostCategory>>;
|
|
96
|
+
listPostTags(params?: {
|
|
97
|
+
page?: number;
|
|
98
|
+
limit?: number;
|
|
99
|
+
}): Promise<PaginatedResponse<CommunityPostTag>>;
|
|
89
100
|
getMyPosts(params?: {
|
|
90
101
|
page?: number;
|
|
91
102
|
limit?: number;
|
|
@@ -94,6 +105,7 @@ declare class CommunityClient {
|
|
|
94
105
|
page?: number;
|
|
95
106
|
limit?: number;
|
|
96
107
|
period?: string;
|
|
108
|
+
metric?: 'reactions' | 'comments' | 'views' | 'activity';
|
|
97
109
|
}): Promise<PaginatedResponse<CommunityPost>>;
|
|
98
110
|
incrementView(params: {
|
|
99
111
|
postId: string;
|
|
@@ -111,17 +123,33 @@ declare class CommunityClient {
|
|
|
111
123
|
postId: string;
|
|
112
124
|
body: string;
|
|
113
125
|
parentId?: string;
|
|
114
|
-
}): Promise<
|
|
126
|
+
}): Promise<CommunityComment>;
|
|
127
|
+
/**
|
|
128
|
+
* List comments for a post.
|
|
129
|
+
*
|
|
130
|
+
* - Default: all visible comments on the post (any depth).
|
|
131
|
+
* - `topLevelOnly: true`: only root comments (`parent` unset).
|
|
132
|
+
* - `rootComment`: comments belonging to a thread rooted at that comment.
|
|
133
|
+
*/
|
|
115
134
|
listComments(params: {
|
|
116
135
|
postId: string;
|
|
117
136
|
page?: number;
|
|
118
137
|
limit?: number;
|
|
119
138
|
rootComment?: string;
|
|
120
|
-
|
|
139
|
+
topLevelOnly?: boolean;
|
|
140
|
+
sort?: CommunityCommentListSort;
|
|
141
|
+
}): Promise<PaginatedResponse<CommunityComment>>;
|
|
142
|
+
/** Direct replies to a comment (`where[parent][equals]`). */
|
|
143
|
+
listReplies(params: {
|
|
144
|
+
commentId: string;
|
|
145
|
+
page?: number;
|
|
146
|
+
limit?: number;
|
|
147
|
+
sort?: CommunityCommentListSort;
|
|
148
|
+
}): Promise<PaginatedResponse<CommunityComment>>;
|
|
121
149
|
updateComment(params: {
|
|
122
150
|
commentId: string;
|
|
123
151
|
body: string;
|
|
124
|
-
}): Promise<
|
|
152
|
+
}): Promise<CommunityComment>;
|
|
125
153
|
deleteComment(params: {
|
|
126
154
|
commentId: string;
|
|
127
155
|
}): Promise<{
|
|
@@ -136,7 +164,9 @@ declare class CommunityClient {
|
|
|
136
164
|
}>;
|
|
137
165
|
addReaction(params: {
|
|
138
166
|
postId: string;
|
|
139
|
-
|
|
167
|
+
typeSlug?: string;
|
|
168
|
+
/** @deprecated Use `typeSlug`. */
|
|
169
|
+
type?: string;
|
|
140
170
|
}): Promise<Reaction>;
|
|
141
171
|
removeReaction(params: {
|
|
142
172
|
postId: string;
|
|
@@ -146,7 +176,9 @@ declare class CommunityClient {
|
|
|
146
176
|
}>;
|
|
147
177
|
addCommentReaction(params: {
|
|
148
178
|
commentId: string;
|
|
149
|
-
|
|
179
|
+
typeSlug?: string;
|
|
180
|
+
/** @deprecated Use `typeSlug`. */
|
|
181
|
+
type?: string;
|
|
150
182
|
}): Promise<Reaction>;
|
|
151
183
|
removeCommentReaction(params: {
|
|
152
184
|
commentId: string;
|
|
@@ -157,6 +189,9 @@ declare class CommunityClient {
|
|
|
157
189
|
getReactionSummary(params: {
|
|
158
190
|
postId: string;
|
|
159
191
|
}): Promise<ReactionSummary>;
|
|
192
|
+
getCommentReactionSummary(params: {
|
|
193
|
+
commentId: string;
|
|
194
|
+
}): Promise<ReactionSummary>;
|
|
160
195
|
getReactionTypes(): Promise<PaginatedResponse<ReactionType>>;
|
|
161
196
|
addBookmark(params: {
|
|
162
197
|
postId: string;
|
|
@@ -170,6 +205,22 @@ declare class CommunityClient {
|
|
|
170
205
|
page?: number;
|
|
171
206
|
limit?: number;
|
|
172
207
|
}): Promise<PaginatedResponse<Bookmark>>;
|
|
208
|
+
listProfileLists(params?: {
|
|
209
|
+
page?: number;
|
|
210
|
+
limit?: number;
|
|
211
|
+
}): Promise<PaginatedResponse<CollectionType<'customer-profile-lists'>>>;
|
|
212
|
+
getProfileList(params: {
|
|
213
|
+
slug: string;
|
|
214
|
+
} | {
|
|
215
|
+
id: string;
|
|
216
|
+
}): Promise<CollectionType<'customer-profile-lists'> | null>;
|
|
217
|
+
updatePublicProfile(body: {
|
|
218
|
+
displayName?: string | null;
|
|
219
|
+
handle?: string | null;
|
|
220
|
+
avatar?: string | null;
|
|
221
|
+
bio?: string | null;
|
|
222
|
+
bioRichText?: CollectionType<'customer-profiles'>['bioRichText'];
|
|
223
|
+
}): Promise<CollectionType<'customer-profiles'>>;
|
|
173
224
|
}
|
|
174
225
|
|
|
175
226
|
interface ServerApiOptions {
|
|
@@ -191,6 +242,34 @@ declare abstract class BaseApi {
|
|
|
191
242
|
protected request<T>(endpoint: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
192
243
|
}
|
|
193
244
|
|
|
245
|
+
type ModerationApiOptions = ServerApiOptions;
|
|
246
|
+
interface CommunityBan {
|
|
247
|
+
id: string;
|
|
248
|
+
customer: string;
|
|
249
|
+
isPermanent?: boolean;
|
|
250
|
+
bannedUntil?: string;
|
|
251
|
+
reason?: string;
|
|
252
|
+
createdAt?: string;
|
|
253
|
+
updatedAt?: string;
|
|
254
|
+
[key: string]: unknown;
|
|
255
|
+
}
|
|
256
|
+
type BanCustomerParams = {
|
|
257
|
+
customerId: string;
|
|
258
|
+
isPermanent?: boolean;
|
|
259
|
+
bannedUntil?: string;
|
|
260
|
+
reason?: string;
|
|
261
|
+
};
|
|
262
|
+
type UnbanCustomerParams = {
|
|
263
|
+
customerId: string;
|
|
264
|
+
};
|
|
265
|
+
declare class ModerationApi extends BaseApi {
|
|
266
|
+
constructor(options: ModerationApiOptions);
|
|
267
|
+
banCustomer(params: BanCustomerParams): Promise<CommunityBan>;
|
|
268
|
+
unbanCustomer(params: UnbanCustomerParams): Promise<{
|
|
269
|
+
success: true;
|
|
270
|
+
}>;
|
|
271
|
+
}
|
|
272
|
+
|
|
194
273
|
interface CustomerAuthResponse {
|
|
195
274
|
token: string;
|
|
196
275
|
customer: CustomerProfile;
|
|
@@ -384,19 +463,81 @@ declare class CartApi {
|
|
|
384
463
|
}>;
|
|
385
464
|
}
|
|
386
465
|
|
|
466
|
+
type NormalizedOptionSwatch<TMedia = unknown> = {
|
|
467
|
+
type: 'color' | 'media' | null;
|
|
468
|
+
color?: string | null;
|
|
469
|
+
mediaItemId?: string | number | null;
|
|
470
|
+
/** Inlined swatch media when the API populated mediaItemId before pool indexing. */
|
|
471
|
+
inlineMedia?: TMedia | null;
|
|
472
|
+
};
|
|
473
|
+
declare function selectedSwatchMediaItemId(swatch: NormalizedOptionSwatch | null | undefined): string | null;
|
|
474
|
+
type ProductSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
475
|
+
type ProductDisplayMediaSource = 'listing_primary' | 'product_primary' | 'product_pool' | 'none';
|
|
476
|
+
/** @deprecated Use {@link ProductSelectionMediaSource} or {@link ProductDisplayMediaSource}. */
|
|
477
|
+
type ProductMediaResolutionSource = ProductSelectionMediaSource | ProductDisplayMediaSource;
|
|
478
|
+
type ProductSelectionVariant<TMedia> = {
|
|
479
|
+
id?: string | number | null;
|
|
480
|
+
images?: Array<TMedia | string | number | null | undefined> | null;
|
|
481
|
+
};
|
|
482
|
+
type ProductSelectionOptionValue = {
|
|
483
|
+
id?: string | number | null;
|
|
484
|
+
swatch?: NormalizedOptionSwatch<unknown> | null;
|
|
485
|
+
};
|
|
486
|
+
type ProductSelectionMediaPointer = string | number | {
|
|
487
|
+
id?: string | number | null;
|
|
488
|
+
} | null;
|
|
489
|
+
type ResolveProductSelectionMediaInput<TMedia> = {
|
|
490
|
+
productMediaPool?: TMedia[] | null;
|
|
491
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
492
|
+
selectedVariant?: ProductSelectionVariant<TMedia> | null;
|
|
493
|
+
matchingVariants?: Array<ProductSelectionVariant<TMedia> | null | undefined> | null;
|
|
494
|
+
selectedOptionValues?: Array<ProductSelectionOptionValue | null | undefined> | null;
|
|
495
|
+
};
|
|
496
|
+
type ResolveProductSelectionMediaResult<TMedia> = {
|
|
497
|
+
primaryImage: TMedia | null;
|
|
498
|
+
images: TMedia[];
|
|
499
|
+
source: ProductSelectionMediaSource;
|
|
500
|
+
};
|
|
501
|
+
type ResolveProductDisplayMediaInput<TMedia> = {
|
|
502
|
+
productMediaPool?: TMedia[] | null;
|
|
503
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
504
|
+
listingPrimaryImage?: ProductSelectionMediaPointer;
|
|
505
|
+
};
|
|
506
|
+
type ResolveProductDisplayMediaResult<TMedia> = {
|
|
507
|
+
primaryImage: TMedia | null;
|
|
508
|
+
images: TMedia[];
|
|
509
|
+
source: ProductDisplayMediaSource;
|
|
510
|
+
};
|
|
511
|
+
declare function resolveProductSelectionMedia<TMedia>(input: ResolveProductSelectionMediaInput<TMedia>): ResolveProductSelectionMediaResult<TMedia>;
|
|
512
|
+
declare function resolveProductDisplayMedia<TMedia>(input: ResolveProductDisplayMediaInput<TMedia>): ResolveProductDisplayMediaResult<TMedia>;
|
|
513
|
+
type ListingPrimaryImageFallbackInput<TMedia> = {
|
|
514
|
+
productMediaPool?: TMedia[] | null;
|
|
515
|
+
productPrimaryMediaItemId?: ProductSelectionMediaPointer;
|
|
516
|
+
productThumbnail?: TMedia | string | number | null;
|
|
517
|
+
listingPrimaryImage?: TMedia | string | number | null;
|
|
518
|
+
resolvedPrimary?: TMedia | null;
|
|
519
|
+
resolvedSource?: ProductMediaResolutionSource;
|
|
520
|
+
};
|
|
521
|
+
declare function resolveListingPrimaryImagePointer<TMedia>(input: ListingPrimaryImageFallbackInput<TMedia>): string | null;
|
|
522
|
+
|
|
387
523
|
type EntityID = string;
|
|
388
524
|
type RelationshipValue = string | number | null | undefined | {
|
|
389
525
|
id?: string | number | null;
|
|
390
526
|
};
|
|
391
527
|
type MediaValue = ProductDetailMedia | null | undefined;
|
|
528
|
+
|
|
529
|
+
/** Raw Payload / REST swatch before strict public normalization. */
|
|
530
|
+
type ProductOptionValueSwatchInput = {
|
|
531
|
+
type?: 'color' | 'media' | null;
|
|
532
|
+
color?: string | null;
|
|
533
|
+
mediaItemId?: RelationshipValue;
|
|
534
|
+
};
|
|
392
535
|
interface ProductOptionValueShape {
|
|
393
536
|
id?: string | number | null;
|
|
394
537
|
option?: RelationshipValue;
|
|
395
538
|
value?: string | null;
|
|
396
539
|
slug?: string | null;
|
|
397
|
-
|
|
398
|
-
thumbnail?: MediaValue;
|
|
399
|
-
images?: MediaValue[] | null;
|
|
540
|
+
swatch?: ProductOptionValueSwatch | ProductOptionValueSwatchInput | null;
|
|
400
541
|
_order?: string | null;
|
|
401
542
|
'_product-option-values_values_order'?: string | null;
|
|
402
543
|
}
|
|
@@ -426,7 +567,11 @@ interface ProductVariantShape {
|
|
|
426
567
|
interface ProductListingProductShape {
|
|
427
568
|
id?: EntityID;
|
|
428
569
|
thumbnail?: MediaValue;
|
|
570
|
+
primaryMediaItemId?: MediaValue;
|
|
429
571
|
images?: MediaValue[] | null;
|
|
572
|
+
listing?: {
|
|
573
|
+
primaryImage?: MediaValue;
|
|
574
|
+
} | null;
|
|
430
575
|
}
|
|
431
576
|
type ProductOptionMatrixValue = {
|
|
432
577
|
id: string;
|
|
@@ -434,9 +579,7 @@ type ProductOptionMatrixValue = {
|
|
|
434
579
|
optionSlug: string;
|
|
435
580
|
label: string;
|
|
436
581
|
slug: string | null;
|
|
437
|
-
|
|
438
|
-
thumbnail?: MediaValue;
|
|
439
|
-
images?: MediaValue[] | null;
|
|
582
|
+
swatch: ProductOptionValueSwatch;
|
|
440
583
|
order: string;
|
|
441
584
|
};
|
|
442
585
|
type ProductOptionMatrixOption = {
|
|
@@ -477,12 +620,11 @@ type ProductListingProjection = {
|
|
|
477
620
|
type ProductListingGroup<TVariant extends ProductVariantShape = ProductVariantShape> = {
|
|
478
621
|
optionId: EntityID;
|
|
479
622
|
optionTitle: string;
|
|
623
|
+
optionSlug: string;
|
|
480
624
|
optionValueId: EntityID;
|
|
481
625
|
optionValueLabel: string;
|
|
482
626
|
optionValueSlug: string | null;
|
|
483
|
-
|
|
484
|
-
optionValueThumbnail?: MediaValue;
|
|
485
|
-
optionValueImages?: MediaValue[] | null;
|
|
627
|
+
optionValueSwatch: ProductOptionValueSwatch;
|
|
486
628
|
variantIds: EntityID[];
|
|
487
629
|
variantCount: number;
|
|
488
630
|
variants: TVariant[];
|
|
@@ -499,8 +641,7 @@ type ProductListingSwatch = {
|
|
|
499
641
|
optionId: EntityID;
|
|
500
642
|
optionValueId: EntityID;
|
|
501
643
|
label: string;
|
|
502
|
-
|
|
503
|
-
thumbnail: ProductDetailMedia | null;
|
|
644
|
+
swatch: ProductOptionValueSwatch<ProductDetailMedia>;
|
|
504
645
|
href: string;
|
|
505
646
|
availableForSale: boolean;
|
|
506
647
|
};
|
|
@@ -539,27 +680,39 @@ type CompatibilityProductSelectionParamEvent = {
|
|
|
539
680
|
searchParam: string;
|
|
540
681
|
};
|
|
541
682
|
type LegacyProductSelectionParamEvent = CompatibilityProductSelectionParamEvent;
|
|
683
|
+
type ProductSelectionUrlEmit = 'slug-compat' | 'canonical-id';
|
|
542
684
|
type ProductSelectionCodecOptions = {
|
|
685
|
+
emit?: ProductSelectionUrlEmit;
|
|
686
|
+
/**
|
|
687
|
+
* When true, `resolveProductSelection()` fills unselected options to reach a
|
|
688
|
+
* concrete variant. Does not change codec parse/stringify behavior.
|
|
689
|
+
*/
|
|
690
|
+
fillDefaults?: boolean;
|
|
543
691
|
onCompatibilityOptionIdParam?: (event: CompatibilityProductSelectionParamEvent) => void;
|
|
544
692
|
onLegacyOptionIdParam?: (event: LegacyProductSelectionParamEvent) => void;
|
|
545
693
|
};
|
|
546
694
|
type ProductSelectionResolutionContext = {
|
|
547
|
-
detail?: Pick<ProductDetail, 'images' | 'listing'>;
|
|
695
|
+
detail?: Pick<ProductDetail, 'images' | 'listing' | 'primaryMediaItemId'>;
|
|
548
696
|
images?: ProductDetail['images'];
|
|
549
697
|
listing?: ProductDetail['listing'];
|
|
698
|
+
primaryMediaItemId?: ProductDetail['primaryMediaItemId'];
|
|
699
|
+
};
|
|
700
|
+
type ProductSelectionAvailableSwatch = {
|
|
701
|
+
color?: string | null;
|
|
702
|
+
image?: MediaValue | null;
|
|
550
703
|
};
|
|
551
704
|
type ProductSelectionAvailableValue = {
|
|
552
705
|
valueId: string;
|
|
553
706
|
value: string;
|
|
707
|
+
label: string;
|
|
554
708
|
slug: string;
|
|
555
709
|
selected: boolean;
|
|
556
710
|
available: boolean;
|
|
711
|
+
exists: boolean;
|
|
557
712
|
availableForSale: boolean;
|
|
558
713
|
isUnlimited: boolean;
|
|
559
714
|
availableStock: number | null;
|
|
560
|
-
|
|
561
|
-
thumbnail?: MediaValue;
|
|
562
|
-
images?: MediaValue[] | null;
|
|
715
|
+
swatch: ProductOptionValueSwatch;
|
|
563
716
|
};
|
|
564
717
|
type ProductSelectionResolution = {
|
|
565
718
|
normalizedSelection: NormalizedProductSelection;
|
|
@@ -579,6 +732,7 @@ type ProductSelectionResolution = {
|
|
|
579
732
|
media: {
|
|
580
733
|
primaryImage: ProductDetailMedia | null;
|
|
581
734
|
images: ProductDetailMedia[];
|
|
735
|
+
source?: ProductMediaResolutionSource;
|
|
582
736
|
};
|
|
583
737
|
stock: {
|
|
584
738
|
availableForSale: boolean;
|
|
@@ -611,6 +765,7 @@ declare function createProductSelectionCodec(detail: ProductDetail, options?: Pr
|
|
|
611
765
|
};
|
|
612
766
|
declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductDetailVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions, context?: ProductSelectionResolutionContext): ProductSelectionResolution;
|
|
613
767
|
declare function resolveProductSelection(detail: ProductDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): ProductSelectionResolution;
|
|
768
|
+
declare function selectNext(detail: ProductDetail, current: ProductSelectionInput | undefined, optionSlug: string, valueSlug: string, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
614
769
|
type ProductDetailImageMedia = Extract<ProductDetailMedia, {
|
|
615
770
|
id?: string | number | null;
|
|
616
771
|
url?: string | null;
|
|
@@ -638,13 +793,18 @@ type ProductHrefOptions = {
|
|
|
638
793
|
matrix?: ProductOptionMatrix<ProductDetailVariant>;
|
|
639
794
|
selection?: ProductSelectionInput;
|
|
640
795
|
trailingSlash?: boolean;
|
|
796
|
+
emit?: ProductSelectionUrlEmit;
|
|
797
|
+
preferCompleteVariantFromHint?: boolean;
|
|
641
798
|
};
|
|
642
|
-
|
|
643
|
-
declare function buildProductListingProjection(product: ProductListingProductShape | null | undefined, variants: ProductVariantShape[]): ProductListingProjection;
|
|
644
|
-
declare function buildProductListingCard(item: ProductListingGroupsItem, options?: {
|
|
799
|
+
type ProductListingCardOptions = {
|
|
645
800
|
basePath?: string;
|
|
646
801
|
trailingSlash?: boolean;
|
|
647
|
-
|
|
802
|
+
emit?: ProductSelectionUrlEmit;
|
|
803
|
+
preferCompleteVariantFromHint?: boolean;
|
|
804
|
+
};
|
|
805
|
+
declare function buildProductHref(product: ProductHrefProduct, group?: ProductHrefGroup | null, options?: ProductHrefOptions): string;
|
|
806
|
+
declare function buildProductListingProjection(product: ProductListingProductShape | null | undefined, variants: ProductVariantShape[]): ProductListingProjection;
|
|
807
|
+
declare function buildProductListingCard(item: ProductListingGroupsItem, options?: ProductListingCardOptions): ProductListingCard;
|
|
648
808
|
/**
|
|
649
809
|
* Builds product-first listing groups for one primary option.
|
|
650
810
|
*
|
|
@@ -683,13 +843,18 @@ type ListingGroupsParams = {
|
|
|
683
843
|
productIds: string[];
|
|
684
844
|
};
|
|
685
845
|
type ListingGroupingState = 'grouped' | 'no_primary_option' | 'empty';
|
|
846
|
+
type ListingGroupingEmptyReason = 'primary_option_not_linked' | 'primary_option_has_no_values' | 'no_variants_for_primary_option';
|
|
686
847
|
type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'stock' | 'isUnlimited' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
|
|
687
848
|
type ProductListingGroupSummary = ProductListingGroup<ProductListingGroupVariant>;
|
|
688
849
|
type ProductListingGroupsProductVariants = NonNullable<PublicProduct['variants']>;
|
|
850
|
+
type ProductListingGroupsProductPrimaryMediaItemId = string | number | {
|
|
851
|
+
id?: string | number | null;
|
|
852
|
+
} | null;
|
|
689
853
|
type ProductListingGroupsProduct = Omit<PublicProduct, 'variants'> & {
|
|
690
854
|
id: string;
|
|
691
855
|
slug: string;
|
|
692
856
|
title: string;
|
|
857
|
+
primaryMediaItemId?: ProductListingGroupsProductPrimaryMediaItemId;
|
|
693
858
|
variants?: (Omit<ProductListingGroupsProductVariants, 'docs'> & {
|
|
694
859
|
docs: ProductListingGroupVariant[];
|
|
695
860
|
}) | null;
|
|
@@ -698,6 +863,8 @@ type ProductListingGroupsItem = {
|
|
|
698
863
|
product: ProductListingGroupsProduct;
|
|
699
864
|
primaryOptionId: string | null;
|
|
700
865
|
listingGroupingState: ListingGroupingState;
|
|
866
|
+
/** Present only when `listingGroupingState` is `empty`. */
|
|
867
|
+
listingGroupingEmptyReason: ListingGroupingEmptyReason | null;
|
|
701
868
|
groups: ProductListingGroupSummary[];
|
|
702
869
|
};
|
|
703
870
|
type ProductListingGroupsResponse = {
|
|
@@ -735,6 +902,20 @@ type ProductDetailMedia = string | number | {
|
|
|
735
902
|
width?: number | null;
|
|
736
903
|
height?: number | null;
|
|
737
904
|
};
|
|
905
|
+
type ProductOptionValueColorSwatch = {
|
|
906
|
+
type: 'color';
|
|
907
|
+
color: string;
|
|
908
|
+
mediaItemId?: null;
|
|
909
|
+
};
|
|
910
|
+
type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
911
|
+
type: 'media';
|
|
912
|
+
mediaItemId: TMedia;
|
|
913
|
+
color?: null;
|
|
914
|
+
};
|
|
915
|
+
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
916
|
+
type ProductUpsertSwatchInput = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<string>;
|
|
917
|
+
type ProductDetailMediaValue = string | number | ProductDetailMedia | null;
|
|
918
|
+
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
738
919
|
interface ProductDetailVariant {
|
|
739
920
|
id: string | number;
|
|
740
921
|
optionKey: string;
|
|
@@ -749,15 +930,18 @@ interface ProductDetailVariant {
|
|
|
749
930
|
isActive: boolean;
|
|
750
931
|
thumbnail?: ProductDetailMedia | null;
|
|
751
932
|
images?: ProductDetailMedia[];
|
|
933
|
+
media?: {
|
|
934
|
+
primaryImage: ProductDetailMedia | null;
|
|
935
|
+
images: ProductDetailMedia[];
|
|
936
|
+
source: ProductDetailSelectionMediaSource;
|
|
937
|
+
};
|
|
752
938
|
optionValues: ProductDetailVariantOptionValue[];
|
|
753
939
|
}
|
|
754
940
|
interface ProductDetailOptionValue {
|
|
755
941
|
id: string | number;
|
|
756
942
|
value: string;
|
|
757
943
|
slug: string;
|
|
758
|
-
|
|
759
|
-
thumbnail?: ProductDetailMedia | null;
|
|
760
|
-
images?: ProductDetailMedia[] | null;
|
|
944
|
+
swatch?: ProductOptionValueSwatch<ProductDetailMedia>;
|
|
761
945
|
}
|
|
762
946
|
interface ProductDetailOption {
|
|
763
947
|
id: string | number;
|
|
@@ -802,6 +986,36 @@ interface ProductDetailListing {
|
|
|
802
986
|
availableForSale?: boolean | null;
|
|
803
987
|
selectionHintVariant?: string | number | null;
|
|
804
988
|
}
|
|
989
|
+
type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'>;
|
|
990
|
+
type ProductDetailCatalogListing = Omit<ProductDetailListing, 'availableForSale'> & {
|
|
991
|
+
liveStockRequired: true;
|
|
992
|
+
};
|
|
993
|
+
interface ProductDetailCatalog {
|
|
994
|
+
product: Omit<ProductDetail['product'], 'totalInventory'>;
|
|
995
|
+
variants: ProductDetailCatalogVariant[];
|
|
996
|
+
options: ProductDetail['options'];
|
|
997
|
+
brand: ProductDetail['brand'];
|
|
998
|
+
categories: ProductDetail['categories'];
|
|
999
|
+
tags: ProductDetail['tags'];
|
|
1000
|
+
images: ProductDetail['images'];
|
|
1001
|
+
videos: ProductDetail['videos'];
|
|
1002
|
+
primaryMediaItemId?: ProductDetail['primaryMediaItemId'];
|
|
1003
|
+
listing: ProductDetailCatalogListing;
|
|
1004
|
+
}
|
|
1005
|
+
type StockSnapshotItemStatus = 'available' | 'not_published' | 'archived' | 'not_found';
|
|
1006
|
+
interface StockSnapshotItem {
|
|
1007
|
+
variantId: string;
|
|
1008
|
+
status: StockSnapshotItemStatus;
|
|
1009
|
+
availableStock: number;
|
|
1010
|
+
availableForSale: boolean;
|
|
1011
|
+
isUnlimited: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
interface StockSnapshotResponse {
|
|
1014
|
+
snapshots: StockSnapshotItem[];
|
|
1015
|
+
}
|
|
1016
|
+
type StockSnapshotParams = {
|
|
1017
|
+
variantIds: string[];
|
|
1018
|
+
};
|
|
805
1019
|
interface ProductDetail {
|
|
806
1020
|
product: {
|
|
807
1021
|
id: string | number;
|
|
@@ -824,6 +1038,8 @@ interface ProductDetail {
|
|
|
824
1038
|
tags: ProductDetailTag[];
|
|
825
1039
|
images: ProductDetailImage[];
|
|
826
1040
|
videos: ProductDetailVideo[];
|
|
1041
|
+
/** Canonical product primary pointer (pool member). */
|
|
1042
|
+
primaryMediaItemId?: ProductDetailMediaValue;
|
|
827
1043
|
listing: ProductDetailListing;
|
|
828
1044
|
}
|
|
829
1045
|
type ProductDetailUnavailableReason = 'not_found' | 'not_published' | 'feature_disabled';
|
|
@@ -834,13 +1050,18 @@ type ProductDetailResult = {
|
|
|
834
1050
|
found: false;
|
|
835
1051
|
reason: ProductDetailUnavailableReason;
|
|
836
1052
|
};
|
|
1053
|
+
type ProductDetailCatalogResult = {
|
|
1054
|
+
found: true;
|
|
1055
|
+
product: ProductDetailCatalog;
|
|
1056
|
+
} | {
|
|
1057
|
+
found: false;
|
|
1058
|
+
reason: ProductDetailUnavailableReason;
|
|
1059
|
+
};
|
|
837
1060
|
type ProductUpsertOptionValueInput = {
|
|
838
1061
|
id?: string;
|
|
839
1062
|
value: string;
|
|
840
1063
|
slug?: string;
|
|
841
|
-
|
|
842
|
-
thumbnail?: string | null;
|
|
843
|
-
images?: string[];
|
|
1064
|
+
swatch?: ProductUpsertSwatchInput | null;
|
|
844
1065
|
metadata?: unknown;
|
|
845
1066
|
};
|
|
846
1067
|
type ProductUpsertOptionInput = {
|
|
@@ -868,7 +1089,6 @@ type ProductUpsertVariantInput = {
|
|
|
868
1089
|
barcode?: string | null;
|
|
869
1090
|
externalId?: string | null;
|
|
870
1091
|
isActive?: boolean;
|
|
871
|
-
thumbnail?: string | null;
|
|
872
1092
|
images?: string[];
|
|
873
1093
|
metadata?: unknown;
|
|
874
1094
|
};
|
|
@@ -880,9 +1100,22 @@ type ProductUpsertParams = {
|
|
|
880
1100
|
options?: ProductUpsertOptionInput[];
|
|
881
1101
|
variants?: ProductUpsertVariantInput[];
|
|
882
1102
|
};
|
|
1103
|
+
/** Console `POST /api/products/upsert` field allowlist error reasons. */
|
|
1104
|
+
declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
|
|
1105
|
+
declare const PRODUCT_UPSERT_READONLY_FIELD_REASON: "product_field_readonly";
|
|
1106
|
+
type ProductUpsertFieldValidationErrorReason = typeof PRODUCT_UPSERT_UNKNOWN_FIELD_REASON | typeof PRODUCT_UPSERT_READONLY_FIELD_REASON;
|
|
1107
|
+
/** 400 response body when upsert rejects unknown or server-managed product fields. */
|
|
1108
|
+
type ProductUpsertFieldValidationErrorBody = {
|
|
1109
|
+
error: string;
|
|
1110
|
+
reason: ProductUpsertFieldValidationErrorReason;
|
|
1111
|
+
field: string;
|
|
1112
|
+
requestId?: string;
|
|
1113
|
+
};
|
|
1114
|
+
declare function isProductUpsertFieldValidationErrorBody(value: unknown): value is ProductUpsertFieldValidationErrorBody;
|
|
883
1115
|
type ProductUpsertResponse = {
|
|
884
1116
|
ok: true;
|
|
885
1117
|
product: PublicProduct;
|
|
1118
|
+
listingProjectionStale: boolean;
|
|
886
1119
|
} | {
|
|
887
1120
|
ok: false;
|
|
888
1121
|
failedEntity: 'product' | 'option' | 'option-value' | 'variant';
|
|
@@ -897,7 +1130,9 @@ declare class ProductApi extends BaseApi {
|
|
|
897
1130
|
* to remain available by the time an order is placed.
|
|
898
1131
|
*/
|
|
899
1132
|
stockCheck(params: StockCheckParams): Promise<StockCheckResponse>;
|
|
1133
|
+
stockSnapshot(params: StockSnapshotParams): Promise<StockSnapshotResponse>;
|
|
900
1134
|
listingGroups(params: ListingGroupsParams): Promise<ProductListingGroupsResponse>;
|
|
1135
|
+
listingGroupsCatalog(params: ListingGroupsParams): Promise<ProductListingGroupsResponse>;
|
|
901
1136
|
/**
|
|
902
1137
|
* Fetch full product detail by slug or id.
|
|
903
1138
|
* Returns a discriminated result so storefronts can distinguish missing,
|
|
@@ -909,6 +1144,7 @@ declare class ProductApi extends BaseApi {
|
|
|
909
1144
|
* errors instead of being collapsed into a storefront absence result.
|
|
910
1145
|
*/
|
|
911
1146
|
detail(params: ProductDetailParams): Promise<ProductDetailResult>;
|
|
1147
|
+
detailCatalog(params: ProductDetailParams): Promise<ProductDetailCatalogResult>;
|
|
912
1148
|
/**
|
|
913
1149
|
* Atomically create or update a product together with its options,
|
|
914
1150
|
* option-values, and variants in a single transaction. Mirrors Shopify's
|
|
@@ -957,6 +1193,14 @@ declare class ShippingApi extends BaseApi {
|
|
|
957
1193
|
}
|
|
958
1194
|
|
|
959
1195
|
type OrderApiOptions = ServerApiOptions;
|
|
1196
|
+
/** Header-only; never sent in the JSON body. */
|
|
1197
|
+
type WithIdempotencyKey<T> = T & {
|
|
1198
|
+
/**
|
|
1199
|
+
* Client-generated key for safe retries. Sent as `X-Idempotency-Key` when the
|
|
1200
|
+
* server endpoint supports HTTP idempotency.
|
|
1201
|
+
*/
|
|
1202
|
+
idempotencyKey?: string;
|
|
1203
|
+
};
|
|
960
1204
|
type CustomerSnapshot = {
|
|
961
1205
|
name?: string;
|
|
962
1206
|
email: string;
|
|
@@ -984,7 +1228,7 @@ type CreateOrderItem = {
|
|
|
984
1228
|
*/
|
|
985
1229
|
totalPrice?: number;
|
|
986
1230
|
};
|
|
987
|
-
type CreateOrderParams = {
|
|
1231
|
+
type CreateOrderParams = WithIdempotencyKey<{
|
|
988
1232
|
orderNumber: string;
|
|
989
1233
|
customer?: string;
|
|
990
1234
|
customerSnapshot: CustomerSnapshot;
|
|
@@ -994,7 +1238,7 @@ type CreateOrderParams = {
|
|
|
994
1238
|
shippingAmount?: number;
|
|
995
1239
|
pgPaymentId?: string;
|
|
996
1240
|
discountCode?: string;
|
|
997
|
-
}
|
|
1241
|
+
}>;
|
|
998
1242
|
type UpdateOrderParams = {
|
|
999
1243
|
orderNumber: string;
|
|
1000
1244
|
status: Order['status'];
|
|
@@ -1008,7 +1252,7 @@ type UpdateTransactionParams = {
|
|
|
1008
1252
|
paymentKey?: string;
|
|
1009
1253
|
amount?: number;
|
|
1010
1254
|
};
|
|
1011
|
-
type ConfirmPaymentParams = {
|
|
1255
|
+
type ConfirmPaymentParams = WithIdempotencyKey<{
|
|
1012
1256
|
orderNumber?: string;
|
|
1013
1257
|
pgPaymentId: string;
|
|
1014
1258
|
pgProvider: string;
|
|
@@ -1019,16 +1263,58 @@ type ConfirmPaymentParams = {
|
|
|
1019
1263
|
receiptUrl?: string;
|
|
1020
1264
|
approvedAt?: string;
|
|
1021
1265
|
providerStatus?: string;
|
|
1266
|
+
/** Provider event id; also used as idempotency key when `idempotencyKey` is omitted. */
|
|
1022
1267
|
providerEventId?: string;
|
|
1023
1268
|
confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
|
|
1024
1269
|
metadata?: Record<string, unknown>;
|
|
1025
|
-
}
|
|
1270
|
+
}>;
|
|
1026
1271
|
type ConfirmPaymentResponse = {
|
|
1027
1272
|
orderId: string;
|
|
1028
1273
|
transactionId: string;
|
|
1029
1274
|
status: 'paid';
|
|
1030
1275
|
alreadyConfirmed?: boolean;
|
|
1031
1276
|
};
|
|
1277
|
+
type CancelReasonCode = 'customer' | 'inventory' | 'fraud' | 'declined' | 'staff' | 'other';
|
|
1278
|
+
type CancelOrderStatus = 'pending' | 'paid' | 'failed' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed' | 'return_requested' | 'return_processing' | 'returned';
|
|
1279
|
+
type CancelOrderReconciliationStatus = Exclude<CancelOrderStatus, 'pending' | 'failed' | 'canceled'>;
|
|
1280
|
+
type CancelOrderResponseBase = {
|
|
1281
|
+
orderId: string;
|
|
1282
|
+
};
|
|
1283
|
+
type CancelOrderUnpaidResponseFields = {
|
|
1284
|
+
refundedAmount: 0;
|
|
1285
|
+
providerRefunded: false;
|
|
1286
|
+
};
|
|
1287
|
+
type CancelOrderAlreadyCanceledResponseFields = {
|
|
1288
|
+
refundedAmount: number;
|
|
1289
|
+
providerRefunded: false;
|
|
1290
|
+
};
|
|
1291
|
+
type CancelOrderProviderRefundResponseFields = {
|
|
1292
|
+
transactionId: string;
|
|
1293
|
+
refundedAmount: number;
|
|
1294
|
+
refundSeq: number;
|
|
1295
|
+
providerRefunded: true;
|
|
1296
|
+
};
|
|
1297
|
+
type CancelOrderCommittedResponse = CancelOrderResponseBase & (CancelOrderUnpaidResponseFields | CancelOrderProviderRefundResponseFields) & {
|
|
1298
|
+
status: 'canceled';
|
|
1299
|
+
cancelCommitted: true;
|
|
1300
|
+
};
|
|
1301
|
+
type CancelOrderAlreadyCanceledResponse = CancelOrderResponseBase & CancelOrderAlreadyCanceledResponseFields & {
|
|
1302
|
+
status: 'canceled';
|
|
1303
|
+
cancelCommitted: false;
|
|
1304
|
+
alreadyCanceled: true;
|
|
1305
|
+
};
|
|
1306
|
+
type CancelOrderReconciliationResponse = CancelOrderResponseBase & CancelOrderProviderRefundResponseFields & {
|
|
1307
|
+
status: CancelOrderReconciliationStatus;
|
|
1308
|
+
cancelCommitted: false;
|
|
1309
|
+
reconciliationRequired: true;
|
|
1310
|
+
};
|
|
1311
|
+
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderReconciliationResponse;
|
|
1312
|
+
type CancelOrderParams = {
|
|
1313
|
+
orderNumber: string;
|
|
1314
|
+
reasonCode?: CancelReasonCode;
|
|
1315
|
+
reasonDetail?: string;
|
|
1316
|
+
idempotencyKey?: string;
|
|
1317
|
+
};
|
|
1032
1318
|
type RestockAction = 'return_to_stock' | 'discard';
|
|
1033
1319
|
type ReturnWithRefundItem = {
|
|
1034
1320
|
orderItem: string | number;
|
|
@@ -1036,7 +1322,7 @@ type ReturnWithRefundItem = {
|
|
|
1036
1322
|
restockAction?: RestockAction;
|
|
1037
1323
|
restockingFee?: number;
|
|
1038
1324
|
};
|
|
1039
|
-
type ReturnWithRefundParams = {
|
|
1325
|
+
type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
1040
1326
|
orderNumber: string;
|
|
1041
1327
|
reason?: ReturnReason;
|
|
1042
1328
|
reasonDetail?: string;
|
|
@@ -1046,15 +1332,15 @@ type ReturnWithRefundParams = {
|
|
|
1046
1332
|
pgPaymentId: string;
|
|
1047
1333
|
paymentKey?: string;
|
|
1048
1334
|
refundReceiptUrl?: string;
|
|
1049
|
-
}
|
|
1050
|
-
type CheckoutParams = {
|
|
1335
|
+
}>;
|
|
1336
|
+
type CheckoutParams = WithIdempotencyKey<{
|
|
1051
1337
|
cartId: string;
|
|
1052
1338
|
orderNumber: string;
|
|
1053
1339
|
customerSnapshot: CustomerSnapshot;
|
|
1054
1340
|
pgPaymentId?: string;
|
|
1055
1341
|
discountCode?: string;
|
|
1056
|
-
}
|
|
1057
|
-
type CreateFulfillmentParams = {
|
|
1342
|
+
}>;
|
|
1343
|
+
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
1058
1344
|
orderNumber: string;
|
|
1059
1345
|
carrier?: string;
|
|
1060
1346
|
trackingNumber?: string;
|
|
@@ -1062,7 +1348,7 @@ type CreateFulfillmentParams = {
|
|
|
1062
1348
|
orderItem: string;
|
|
1063
1349
|
quantity: number;
|
|
1064
1350
|
}>;
|
|
1065
|
-
}
|
|
1351
|
+
}>;
|
|
1066
1352
|
type UpdateFulfillmentParams = {
|
|
1067
1353
|
fulfillmentId: string;
|
|
1068
1354
|
status: 'packed' | 'shipped' | 'delivered' | 'failed';
|
|
@@ -1086,13 +1372,13 @@ type BulkImportFulfillmentsResponse = {
|
|
|
1086
1372
|
error: string;
|
|
1087
1373
|
}>;
|
|
1088
1374
|
};
|
|
1089
|
-
type CreateReturnParams = {
|
|
1375
|
+
type CreateReturnParams = WithIdempotencyKey<{
|
|
1090
1376
|
orderNumber: string;
|
|
1091
1377
|
reason?: ReturnReason;
|
|
1092
1378
|
reasonDetail?: string;
|
|
1093
1379
|
returnItems: ReturnItem[];
|
|
1094
1380
|
refundAmount: number;
|
|
1095
|
-
}
|
|
1381
|
+
}>;
|
|
1096
1382
|
type UpdateReturnParams = {
|
|
1097
1383
|
returnId: string;
|
|
1098
1384
|
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
@@ -1103,6 +1389,7 @@ declare class OrderApi extends BaseApi {
|
|
|
1103
1389
|
updateOrder(params: UpdateOrderParams): Promise<Order>;
|
|
1104
1390
|
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
1105
1391
|
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
1392
|
+
cancelOrder(params: CancelOrderParams): Promise<CancelOrderResponse>;
|
|
1106
1393
|
checkout(params: CheckoutParams): Promise<Order>;
|
|
1107
1394
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
1108
1395
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
@@ -1126,8 +1413,11 @@ interface CommerceClientOptions {
|
|
|
1126
1413
|
declare class CommerceClient {
|
|
1127
1414
|
readonly product: {
|
|
1128
1415
|
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
1416
|
+
stockSnapshot: (params: StockSnapshotParams) => Promise<StockSnapshotResponse>;
|
|
1129
1417
|
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
1418
|
+
listingGroupsCatalog: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
1130
1419
|
detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
|
|
1420
|
+
detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
1131
1421
|
};
|
|
1132
1422
|
readonly cart: {
|
|
1133
1423
|
get: (cartId: string) => Promise<Cart>;
|
|
@@ -1159,6 +1449,59 @@ declare class CommerceClient {
|
|
|
1159
1449
|
constructor(options: CommerceClientOptions);
|
|
1160
1450
|
}
|
|
1161
1451
|
|
|
1452
|
+
interface ServerCommerceClientOptions {
|
|
1453
|
+
publishableKey?: string;
|
|
1454
|
+
secretKey: string;
|
|
1455
|
+
apiUrl?: string;
|
|
1456
|
+
onRequestId?: (id: string | null) => void;
|
|
1457
|
+
}
|
|
1458
|
+
declare class ServerCommerceClient {
|
|
1459
|
+
readonly product: {
|
|
1460
|
+
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
1461
|
+
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
1462
|
+
detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
|
|
1463
|
+
previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
|
|
1464
|
+
upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
|
|
1465
|
+
};
|
|
1466
|
+
readonly cart: {
|
|
1467
|
+
get: (cartId: string) => Promise<Cart>;
|
|
1468
|
+
addItem: (params: AddItemParams) => Promise<CartItem>;
|
|
1469
|
+
updateItem: (params: UpdateItemParams) => Promise<CartItem>;
|
|
1470
|
+
removeItem: (params: RemoveItemParams) => Promise<{
|
|
1471
|
+
success: boolean;
|
|
1472
|
+
}>;
|
|
1473
|
+
applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
|
|
1474
|
+
removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
|
|
1475
|
+
clear: (params: ClearCartParams) => Promise<{
|
|
1476
|
+
success: boolean;
|
|
1477
|
+
}>;
|
|
1478
|
+
};
|
|
1479
|
+
readonly orders: {
|
|
1480
|
+
checkout: (params: CheckoutParams) => Promise<Order>;
|
|
1481
|
+
create: (params: CreateOrderParams) => Promise<Order>;
|
|
1482
|
+
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
1483
|
+
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
1484
|
+
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
1485
|
+
cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
|
|
1486
|
+
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
1487
|
+
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
1488
|
+
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
1489
|
+
createReturn: (params: CreateReturnParams) => Promise<Return>;
|
|
1490
|
+
updateReturn: (params: UpdateReturnParams) => Promise<Return>;
|
|
1491
|
+
returnWithRefund: (params: ReturnWithRefundParams) => Promise<{
|
|
1492
|
+
return: Return;
|
|
1493
|
+
transaction: Transaction | null;
|
|
1494
|
+
}>;
|
|
1495
|
+
};
|
|
1496
|
+
readonly discounts: {
|
|
1497
|
+
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
1498
|
+
};
|
|
1499
|
+
readonly shipping: {
|
|
1500
|
+
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
1501
|
+
};
|
|
1502
|
+
constructor(options: ServerCommerceClientOptions);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1162
1505
|
/**
|
|
1163
1506
|
* Customer namespace. Currently exposes .auth; reserved for future customer-
|
|
1164
1507
|
* scoped capabilities (addresses, preferences, etc.).
|
|
@@ -1168,6 +1511,257 @@ declare class CustomerNamespace {
|
|
|
1168
1511
|
constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
|
|
1169
1512
|
}
|
|
1170
1513
|
|
|
1514
|
+
interface EventsClientOptions {
|
|
1515
|
+
publishableKey?: string;
|
|
1516
|
+
apiUrl?: string;
|
|
1517
|
+
customerToken?: string | (() => string | null);
|
|
1518
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
1519
|
+
onRequestId?: (id: string | null) => void;
|
|
1520
|
+
}
|
|
1521
|
+
type EventsDateParam = string | Date;
|
|
1522
|
+
interface EventsRangeParams {
|
|
1523
|
+
start: EventsDateParam;
|
|
1524
|
+
end: EventsDateParam;
|
|
1525
|
+
limit?: number;
|
|
1526
|
+
page?: number;
|
|
1527
|
+
calendar?: string | string[];
|
|
1528
|
+
calendarSlug?: string | string[];
|
|
1529
|
+
category?: string | string[];
|
|
1530
|
+
categorySlug?: string | string[];
|
|
1531
|
+
tag?: string | string[];
|
|
1532
|
+
tagSlug?: string | string[];
|
|
1533
|
+
}
|
|
1534
|
+
interface EventsTaxonomyItem {
|
|
1535
|
+
id: string | number;
|
|
1536
|
+
title?: string | null;
|
|
1537
|
+
slug?: string | null;
|
|
1538
|
+
description?: string | null;
|
|
1539
|
+
color?: string | null;
|
|
1540
|
+
}
|
|
1541
|
+
interface EventsCalendarItem extends EventsTaxonomyItem {
|
|
1542
|
+
timezone?: string | null;
|
|
1543
|
+
visibility?: string | null;
|
|
1544
|
+
}
|
|
1545
|
+
interface EventsLocation {
|
|
1546
|
+
type?: string | null;
|
|
1547
|
+
name?: string | null;
|
|
1548
|
+
address?: string | null;
|
|
1549
|
+
onlineUrl?: string | null;
|
|
1550
|
+
onlineNote?: string | null;
|
|
1551
|
+
}
|
|
1552
|
+
interface EventsOccurrenceLocation {
|
|
1553
|
+
name?: string | null;
|
|
1554
|
+
address?: string | null;
|
|
1555
|
+
onlineUrl?: string | null;
|
|
1556
|
+
note?: string | null;
|
|
1557
|
+
}
|
|
1558
|
+
interface EventsExternalSource {
|
|
1559
|
+
provider?: string | null;
|
|
1560
|
+
url?: string | null;
|
|
1561
|
+
}
|
|
1562
|
+
interface EventsRangeEvent {
|
|
1563
|
+
id: string | number;
|
|
1564
|
+
title?: string | null;
|
|
1565
|
+
slug?: string | null;
|
|
1566
|
+
description?: string | null;
|
|
1567
|
+
startsAt?: string | null;
|
|
1568
|
+
endsAt?: string | null;
|
|
1569
|
+
timezone?: string | null;
|
|
1570
|
+
isAllDay: boolean;
|
|
1571
|
+
visibility?: string | null;
|
|
1572
|
+
sourceType?: string | null;
|
|
1573
|
+
registrationPolicy?: string | null;
|
|
1574
|
+
externalRegistrationUrl?: string | null;
|
|
1575
|
+
externalSource: EventsExternalSource | null;
|
|
1576
|
+
location: EventsLocation | null;
|
|
1577
|
+
calendars: EventsCalendarItem[];
|
|
1578
|
+
categories: EventsTaxonomyItem[];
|
|
1579
|
+
tags: EventsTaxonomyItem[];
|
|
1580
|
+
}
|
|
1581
|
+
interface EventsRangeOccurrence {
|
|
1582
|
+
id: string | number;
|
|
1583
|
+
instanceKey?: string | null;
|
|
1584
|
+
startsAt?: string | null;
|
|
1585
|
+
endsAt?: string | null;
|
|
1586
|
+
timezone?: string | null;
|
|
1587
|
+
isAllDay: boolean;
|
|
1588
|
+
status?: string | null;
|
|
1589
|
+
capacity?: number;
|
|
1590
|
+
registrationCount?: number;
|
|
1591
|
+
waitlistCount?: number;
|
|
1592
|
+
locationOverride: EventsOccurrenceLocation | null;
|
|
1593
|
+
event: EventsRangeEvent;
|
|
1594
|
+
}
|
|
1595
|
+
interface EventsRangeResponse {
|
|
1596
|
+
range: {
|
|
1597
|
+
start: string;
|
|
1598
|
+
end: string;
|
|
1599
|
+
};
|
|
1600
|
+
docs: EventsRangeOccurrence[];
|
|
1601
|
+
calendars: EventsCalendarItem[];
|
|
1602
|
+
events: EventsRangeEvent[];
|
|
1603
|
+
categories: EventsTaxonomyItem[];
|
|
1604
|
+
tags: EventsTaxonomyItem[];
|
|
1605
|
+
totalDocs: number;
|
|
1606
|
+
limit: number;
|
|
1607
|
+
page: number;
|
|
1608
|
+
totalPages: number;
|
|
1609
|
+
hasNextPage: boolean;
|
|
1610
|
+
hasPrevPage: boolean;
|
|
1611
|
+
}
|
|
1612
|
+
interface EventRegistrationAttendeeInput {
|
|
1613
|
+
name?: string;
|
|
1614
|
+
email?: string;
|
|
1615
|
+
phone?: string;
|
|
1616
|
+
}
|
|
1617
|
+
interface EventRegistrationAnswerInput {
|
|
1618
|
+
question: string;
|
|
1619
|
+
answer?: string;
|
|
1620
|
+
}
|
|
1621
|
+
interface EventRegistrationRegisterParams {
|
|
1622
|
+
event: string;
|
|
1623
|
+
occurrence: string;
|
|
1624
|
+
quantity?: number;
|
|
1625
|
+
attendee?: EventRegistrationAttendeeInput;
|
|
1626
|
+
answers?: EventRegistrationAnswerInput[];
|
|
1627
|
+
}
|
|
1628
|
+
interface EventRegistrationPublic {
|
|
1629
|
+
id?: string | number;
|
|
1630
|
+
event?: unknown;
|
|
1631
|
+
occurrence?: unknown;
|
|
1632
|
+
registrationStatus?: string | null;
|
|
1633
|
+
attendanceStatus?: string | null;
|
|
1634
|
+
quantity?: number | null;
|
|
1635
|
+
guestTokenExpiresAt?: string | null;
|
|
1636
|
+
}
|
|
1637
|
+
interface EventGuestRegistration extends EventRegistrationPublic {
|
|
1638
|
+
attendee: {
|
|
1639
|
+
name: string | null;
|
|
1640
|
+
email: string | null;
|
|
1641
|
+
phone: string | null;
|
|
1642
|
+
} | null;
|
|
1643
|
+
attendeeEmail: string | null;
|
|
1644
|
+
answers: Array<{
|
|
1645
|
+
question: string;
|
|
1646
|
+
answer?: string;
|
|
1647
|
+
}>;
|
|
1648
|
+
}
|
|
1649
|
+
interface EventRegistrationRegisterResponse {
|
|
1650
|
+
registration: EventRegistrationPublic;
|
|
1651
|
+
guestToken: string;
|
|
1652
|
+
guestTokenExpiresAt: string;
|
|
1653
|
+
}
|
|
1654
|
+
interface EventGuestRegistrationResponse {
|
|
1655
|
+
registration: EventGuestRegistration;
|
|
1656
|
+
}
|
|
1657
|
+
interface EventGuestCancelParams {
|
|
1658
|
+
reason?: string;
|
|
1659
|
+
}
|
|
1660
|
+
declare class EventsClient {
|
|
1661
|
+
private readonly publishableKey;
|
|
1662
|
+
private readonly apiUrl?;
|
|
1663
|
+
private readonly customerToken?;
|
|
1664
|
+
private readonly onUnauthorized?;
|
|
1665
|
+
private readonly onRequestId?;
|
|
1666
|
+
constructor(options: EventsClientOptions);
|
|
1667
|
+
getRange(params: EventsRangeParams): Promise<EventsRangeResponse>;
|
|
1668
|
+
register(params: EventRegistrationRegisterParams): Promise<EventRegistrationRegisterResponse>;
|
|
1669
|
+
getGuestRegistration(token: string): Promise<EventGuestRegistrationResponse>;
|
|
1670
|
+
cancelGuestRegistration(token: string, params?: EventGuestCancelParams): Promise<EventGuestRegistrationResponse>;
|
|
1671
|
+
private execute;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
type TenantIntrospectionApiOptions = ServerApiOptions;
|
|
1675
|
+
type TenantFeatureProgressFeature = 'ecommerce';
|
|
1676
|
+
interface TenantFeatureProgressInput {
|
|
1677
|
+
feature: TenantFeatureProgressFeature;
|
|
1678
|
+
includeEvidence?: boolean;
|
|
1679
|
+
}
|
|
1680
|
+
type TenantFeatureProgressStatus = 'ready' | 'attention' | 'blocked';
|
|
1681
|
+
type TenantFeatureProgressItemState = 'complete' | 'incomplete' | 'blocked' | 'attention' | 'optional' | 'unknown' | 'manual' | 'not-applicable';
|
|
1682
|
+
type TenantFeatureProgressSeverity = 'required' | 'recommended' | 'optional';
|
|
1683
|
+
type TenantFeatureProgressEvidenceValue = string | number | boolean | null;
|
|
1684
|
+
interface TenantFeatureProgressItem {
|
|
1685
|
+
id: string;
|
|
1686
|
+
title: string;
|
|
1687
|
+
state: TenantFeatureProgressItemState;
|
|
1688
|
+
severity: TenantFeatureProgressSeverity;
|
|
1689
|
+
summary: string;
|
|
1690
|
+
evidence?: Record<string, TenantFeatureProgressEvidenceValue>;
|
|
1691
|
+
}
|
|
1692
|
+
interface TenantFeatureProgressGroup {
|
|
1693
|
+
id: string;
|
|
1694
|
+
title: string;
|
|
1695
|
+
summary?: string;
|
|
1696
|
+
items: TenantFeatureProgressItem[];
|
|
1697
|
+
}
|
|
1698
|
+
interface TenantFeatureProgressResponse {
|
|
1699
|
+
schemaVersion: 1;
|
|
1700
|
+
feature: TenantFeatureProgressFeature;
|
|
1701
|
+
status: TenantFeatureProgressStatus;
|
|
1702
|
+
generatedAt: string;
|
|
1703
|
+
tenant: {
|
|
1704
|
+
id: string;
|
|
1705
|
+
name: string;
|
|
1706
|
+
plan: string;
|
|
1707
|
+
};
|
|
1708
|
+
capability: {
|
|
1709
|
+
effectiveFeatures: string[];
|
|
1710
|
+
planBlocked: string[];
|
|
1711
|
+
closureAdded: string[];
|
|
1712
|
+
};
|
|
1713
|
+
summary: {
|
|
1714
|
+
complete: number;
|
|
1715
|
+
total: number;
|
|
1716
|
+
blocking: number;
|
|
1717
|
+
manual: number;
|
|
1718
|
+
unknown: number;
|
|
1719
|
+
};
|
|
1720
|
+
groups: TenantFeatureProgressGroup[];
|
|
1721
|
+
}
|
|
1722
|
+
interface CollectionFieldSchema {
|
|
1723
|
+
name: string;
|
|
1724
|
+
path: string;
|
|
1725
|
+
type: string;
|
|
1726
|
+
required?: true;
|
|
1727
|
+
unique?: true;
|
|
1728
|
+
hasMany?: true;
|
|
1729
|
+
relationTo?: string | string[];
|
|
1730
|
+
options?: Array<{
|
|
1731
|
+
label: string;
|
|
1732
|
+
value: string;
|
|
1733
|
+
}>;
|
|
1734
|
+
hidden?: true;
|
|
1735
|
+
systemManaged?: true;
|
|
1736
|
+
writable?: boolean;
|
|
1737
|
+
fields?: CollectionFieldSchema[];
|
|
1738
|
+
}
|
|
1739
|
+
interface CollectionSchemaResponse {
|
|
1740
|
+
contractVersion: 1;
|
|
1741
|
+
mode: 'effective';
|
|
1742
|
+
collection: {
|
|
1743
|
+
slug: string;
|
|
1744
|
+
timestamps: boolean;
|
|
1745
|
+
alwaysActive: boolean;
|
|
1746
|
+
feature: string | null;
|
|
1747
|
+
systemFields: string[];
|
|
1748
|
+
visibility: {
|
|
1749
|
+
collectionHidden: boolean;
|
|
1750
|
+
hiddenFields: string[];
|
|
1751
|
+
};
|
|
1752
|
+
fields: CollectionFieldSchema[];
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
interface TenantIntrospectionClient {
|
|
1756
|
+
collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
|
|
1757
|
+
featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
|
|
1758
|
+
}
|
|
1759
|
+
declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospectionClient {
|
|
1760
|
+
constructor(options: TenantIntrospectionApiOptions);
|
|
1761
|
+
collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
|
|
1762
|
+
featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1171
1765
|
interface ClientConfig {
|
|
1172
1766
|
publishableKey: string;
|
|
1173
1767
|
/** API base URL for staging, self-hosted, preview, or proxy deployments. */
|
|
@@ -1319,21 +1913,63 @@ interface RootQueryLookup<T extends string> {
|
|
|
1319
1913
|
}>;
|
|
1320
1914
|
}
|
|
1321
1915
|
type RootReadOnlyQueryBuilder<T extends PublicCollection> = RootQueryLookup<T>;
|
|
1916
|
+
interface RootServerQueryBuilder<T extends ServerCollection> extends RootQueryLookup<T> {
|
|
1917
|
+
create(data: Partial<CollectionType<T>>, options?: {
|
|
1918
|
+
file?: File | Blob;
|
|
1919
|
+
filename?: string;
|
|
1920
|
+
}): Promise<PayloadMutationResponse<CollectionType<T>>>;
|
|
1921
|
+
update(id: string, data: Partial<CollectionType<T>>, options?: {
|
|
1922
|
+
file?: File | Blob;
|
|
1923
|
+
filename?: string;
|
|
1924
|
+
}): Promise<PayloadMutationResponse<CollectionType<T>>>;
|
|
1925
|
+
updateMany(where: ApiQueryOptions['where'], data: Partial<CollectionType<T>>): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
1926
|
+
remove(id: string): Promise<CollectionType<T>>;
|
|
1927
|
+
removeMany(where: ApiQueryOptions['where']): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
1928
|
+
}
|
|
1322
1929
|
interface RootCollectionClient {
|
|
1323
1930
|
from<T extends PublicCollection>(collection: T): RootReadOnlyQueryBuilder<T>;
|
|
1324
1931
|
}
|
|
1932
|
+
interface RootServerCollectionClient {
|
|
1933
|
+
from<T extends ServerCollection>(collection: T): RootServerQueryBuilder<T>;
|
|
1934
|
+
}
|
|
1325
1935
|
interface RootClient {
|
|
1326
1936
|
commerce: CommerceClient;
|
|
1327
1937
|
community: CommunityClient;
|
|
1938
|
+
/** Set on {@link createClient} return values; optional for structural mocks. */
|
|
1939
|
+
events?: EventsClient;
|
|
1328
1940
|
customer: CustomerNamespace;
|
|
1329
1941
|
collections: RootCollectionClient;
|
|
1330
1942
|
lastRequestId: string | null;
|
|
1331
1943
|
getState(): ClientState;
|
|
1332
1944
|
getConfig(): ClientConfig;
|
|
1333
1945
|
}
|
|
1946
|
+
interface RootServerClient {
|
|
1947
|
+
commerce: ServerCommerceClient;
|
|
1948
|
+
tenant: TenantIntrospectionClient;
|
|
1949
|
+
/** Set on {@link createServerClient} return values; optional for structural mocks. */
|
|
1950
|
+
events?: EventsClient;
|
|
1951
|
+
community: CommunityClient & {
|
|
1952
|
+
moderation: {
|
|
1953
|
+
banCustomer: (p: BanCustomerParams) => Promise<CommunityBan>;
|
|
1954
|
+
unbanCustomer: (p: UnbanCustomerParams) => Promise<{
|
|
1955
|
+
success: true;
|
|
1956
|
+
}>;
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
collections: RootServerCollectionClient;
|
|
1960
|
+
lastRequestId: string | null;
|
|
1961
|
+
getState(): ClientState;
|
|
1962
|
+
getConfig(): Omit<ClientServerConfig, 'secretKey'>;
|
|
1963
|
+
}
|
|
1964
|
+
type RootClientWithEvents = RootClient & {
|
|
1965
|
+
events: EventsClient;
|
|
1966
|
+
};
|
|
1967
|
+
type RootServerClientWithEvents = RootServerClient & {
|
|
1968
|
+
events: EventsClient;
|
|
1969
|
+
};
|
|
1334
1970
|
type DeepPartial<T> = {
|
|
1335
1971
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1336
1972
|
};
|
|
1337
1973
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
1338
1974
|
|
|
1339
|
-
export { type
|
|
1975
|
+
export { type TenantFeatureProgressGroup as $, type ApiQueryOptions as A, BaseApi as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type EventRegistrationRegisterResponse as F, type EventsCalendarItem as G, type EventsClientOptions as H, type EventsDateParam as I, type EventsExternalSource as J, type EventsLocation as K, type EventsOccurrenceLocation as L, type EventsRangeEvent as M, type EventsRangeOccurrence as N, type EventsRangeParams as O, type PayloadFindResponse as P, type EventsRangeResponse as Q, type RetryConfig as R, type Sort as S, type TenantIntrospectionClient as T, type UnbanCustomerParams as U, type EventsTaxonomyItem as V, type Where as W, ModerationApi as X, type RootServerClient as Y, type TenantFeatureProgressEvidenceValue as Z, type TenantFeatureProgressFeature as _, CommunityClient as a, type ListingGroupingEmptyReason as a$, type TenantFeatureProgressInput as a0, type TenantFeatureProgressItem as a1, type TenantFeatureProgressItemState as a2, type TenantFeatureProgressResponse as a3, type TenantFeatureProgressSeverity as a4, type TenantFeatureProgressStatus as a5, TenantIntrospectionApi as a6, type TenantIntrospectionApiOptions as a7, CustomerAuth as a8, type CustomerProfile as a9, type CancelOrderResponse as aA, type CancelReasonCode as aB, CartApi as aC, type CartApiOptions as aD, type CheckoutParams as aE, type ClearCartParams as aF, type Comment as aG, type CommerceClientOptions as aH, type CommunityClientOptions as aI, type CommunityComment as aJ, type CommunityCommentListSort as aK, type CommunityPost as aL, type CommunityPostCategory as aM, type CommunityPostListSort as aN, type CommunityPostTag as aO, type CompatibilityProductSelectionParamEvent as aP, type ConfirmPaymentParams as aQ, type ConfirmPaymentResponse as aR, type CreateFulfillmentParams as aS, type CreateOrderItem as aT, type CreateOrderParams as aU, type CreateReturnParams as aV, type CustomerAuthOptions as aW, type CustomerSnapshot as aX, DiscountApi as aY, type DiscountApiOptions as aZ, type LegacyProductSelectionParamEvent as a_, 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 ProductDetailParams as ag, type ProductDetailResult as ah, type ProductListingGroupsItem as ai, type ProductDetail as aj, type ProductDetailCatalog as ak, type StockSnapshotResponse as al, type ProductSelectionMediaSource as am, type ProductDisplayMediaSource as an, type ResolveProductSelectionMediaInput as ao, type ResolveProductSelectionMediaResult as ap, type ProductSelectionMediaPointer as aq, type RootClientWithEvents as ar, type AddItemParams as as, type ApplyDiscountParams as at, type BulkImportFulfillmentsParams as au, type BulkImportFulfillmentsResponse as av, type CalculateShippingParams as aw, type CalculateShippingResult as ax, type CancelOrderParams as ay, type CancelOrderReconciliationStatus as az, CustomerNamespace as b, type ProductUpsertFieldValidationErrorBody as b$, type ListingGroupingState as b0, type ListingGroupsParams as b1, type ListingPrimaryImageFallbackInput as b2, type MediaValue as b3, type NormalizedOptionSwatch as b4, type NormalizedProductSelection as b5, OrderApi as b6, type OrderApiOptions as b7, PRODUCT_UPSERT_READONLY_FIELD_REASON as b8, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as b9, type ProductListingGroupSummary as bA, type ProductListingGroupVariant as bB, type ProductListingGroupsProduct as bC, type ProductListingGroupsResponse as bD, type ProductListingProductShape as bE, type ProductListingProjection as bF, type ProductListingSwatch as bG, type ProductMediaResolutionSource as bH, type ProductOptionMatrix as bI, type ProductOptionMatrixOption as bJ, type ProductOptionMatrixValue as bK, type ProductOptionMatrixVariant as bL, type ProductOptionShape as bM, type ProductOptionValueShape as bN, type ProductOptionValueSwatch as bO, type ProductOptionValueSwatchInput as bP, type ProductSelectionAvailableSwatch as bQ, type ProductSelectionAvailableValue as bR, type ProductSelectionByOptionValue as bS, ProductSelectionCodecError as bT, type ProductSelectionCodecOptions as bU, type ProductSelectionInput as bV, type ProductSelectionOptionValue as bW, type ProductSelectionResolution as bX, type ProductSelectionResolutionContext as bY, type ProductSelectionUrlEmit as bZ, type ProductSelectionVariant as b_, ProductApi as ba, type ProductApiOptions as bb, type ProductDetailBrand as bc, type ProductDetailCatalogListing as bd, type ProductDetailCatalogResult as be, type ProductDetailCatalogVariant as bf, type ProductDetailCategory as bg, type ProductDetailImage as bh, type ProductDetailImageMedia as bi, type ProductDetailListing as bj, type ProductDetailMedia as bk, type ProductDetailOption as bl, type ProductDetailOptionValue as bm, type ProductDetailTag as bn, type ProductDetailUnavailableReason as bo, type ProductDetailVariant as bp, type ProductDetailVariantOptionValue as bq, type ProductDetailVideo as br, type ProductHrefGroup as bs, type ProductHrefOptions as bt, type ProductHrefProduct as bu, type ProductListingCard as bv, type ProductListingCardOptions as bw, type ProductListingCardPriceRange as bx, type ProductListingCardRepresentativeVariant as by, type ProductListingGroup as bz, type ClientState as c, type ProductUpsertFieldValidationErrorReason as c0, type ProductVariantShape as c1, type RemoveDiscountParams as c2, type RemoveItemParams as c3, type RequestOptions as c4, type ResolveProductDisplayMediaInput as c5, type ResolveProductDisplayMediaResult as c6, type ReturnItem as c7, type ReturnReason as c8, type ReturnWithRefundItem as c9, isProductUpsertFieldValidationErrorBody as cA, normalizeProductSelection as cB, normalizeProductSelectionFromMatrix as cC, normalizeSelectedValueIds as cD, parseProductSelection as cE, resolveListingPrimaryImagePointer as cF, resolveProductDisplayMedia as cG, resolveProductSelection as cH, resolveProductSelectionFromMatrix as cI, resolveProductSelectionMedia as cJ, resolveVariantForSelection as cK, selectNext as cL, selectedSwatchMediaItemId as cM, stringifyProductSelection as cN, type ReturnWithRefundParams as ca, ShippingApi as cb, type ShippingApiOptions as cc, type StockCheckParams as cd, type StockCheckResponse as ce, type StockCheckResult as cf, type StockSnapshotItem as cg, type StockSnapshotParams as ch, type UpdateFulfillmentParams as ci, type UpdateItemParams as cj, type UpdateOrderParams as ck, type UpdateReturnParams as cl, type UpdateTransactionParams as cm, type ValidateDiscountParams as cn, type ValidateDiscountResult as co, type WithIdempotencyKey as cp, buildProductHref as cq, buildProductListingCard as cr, buildProductListingGroupsByOption as cs, buildProductListingProjection as ct, buildProductOptionMatrix as cu, buildProductOptionMatrixFromDetail as cv, createProductSelectionCodec as cw, getAvailableOptionValues as cx, getProductSelectionImages as cy, getSelectedValueByOptionId as cz, type ClientConfig as d, type ClientMetadata as e, type DeepPartial as f, type ExtractArrayType as g, type PayloadMutationResponse as h, type RootClient as i, type RootCollectionClient as j, type RootReadOnlyQueryBuilder as k, type ServerApiOptions as l, ServerCommerceClient as m, type BanCustomerParams as n, type CommunityBan as o, type ClientServerConfig as p, type RootServerClientWithEvents as q, type CollectionFieldSchema as r, type CollectionSchemaResponse as s, type EventGuestCancelParams as t, type EventGuestRegistration as u, type EventGuestRegistrationResponse as v, type EventRegistrationAnswerInput as w, type EventRegistrationAttendeeInput as x, type EventRegistrationPublic as y, type EventRegistrationRegisterParams as z };
|