@01.software/sdk 0.43.0 → 0.45.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/CHANGELOG.md +375 -2
- package/MIGRATION.md +89 -10
- package/README.md +451 -109
- package/dist/{server-nXOezi4b.d.cts → catalog-mappers-sIshKNb3.d.cts} +14 -3
- package/dist/{server-nXOezi4b.d.ts → catalog-mappers-sIshKNb3.d.ts} +14 -3
- package/dist/client.cjs +2680 -345
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +10 -7
- package/dist/client.d.ts +10 -7
- package/dist/client.js +2680 -345
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-U70KizLf.d.cts → collection-client-BSo7VXQE.d.cts} +8 -5
- package/dist/{collection-client-gWsA7BVP.d.ts → collection-client-Ckfusuee.d.ts} +8 -5
- package/dist/{const-_WWHU-gX.d.ts → const-BAG0MH0u.d.cts} +13 -10
- package/dist/{const-BBynifk0.d.cts → const-CaPq2AE4.d.ts} +13 -10
- package/dist/errors.cjs +74 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +38 -1
- package/dist/errors.d.ts +38 -1
- package/dist/errors.js +74 -1
- package/dist/errors.js.map +1 -1
- package/dist/{index-DPi5NWU8.d.ts → index-BNICJxBL.d.ts} +4 -4
- package/dist/{index-Dg4Y6Aq7.d.cts → index-YGrZrxNn.d.cts} +4 -4
- package/dist/index.cjs +2741 -368
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -19
- package/dist/index.d.ts +18 -19
- package/dist/index.js +2741 -368
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DLxkB7Mv.d.cts → payload-types-CJZuXcgF.d.cts} +6873 -4208
- package/dist/{payload-types-DLxkB7Mv.d.ts → payload-types-CJZuXcgF.d.ts} +6873 -4208
- package/dist/query.cjs +550 -101
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +43 -45
- package/dist/query.d.ts +43 -45
- package/dist/query.js +550 -101
- 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.cjs +2252 -444
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +11 -10
- package/dist/server.d.ts +11 -10
- package/dist/server.js +2252 -444
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +65 -1
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +65 -1
- package/dist/storefront-cache.js.map +1 -1
- package/dist/types-BC6rVmJa.d.ts +47 -0
- package/dist/{types-B9lGhZlB.d.ts → types-BlOvjoTX.d.ts} +1095 -504
- package/dist/{types-Bpx5sYKo.d.cts → types-C4WuJfw7.d.cts} +1095 -504
- package/dist/types-D5p7-m1l.d.cts +47 -0
- package/dist/ui/canvas/server.cjs +244 -2
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +27 -1
- package/dist/ui/canvas/server.d.ts +27 -1
- package/dist/ui/canvas/server.js +244 -2
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +419 -103
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +19 -7
- package/dist/ui/canvas.d.ts +19 -7
- package/dist/ui/canvas.js +419 -103
- 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 +4 -4
- package/dist/webhook.d.ts +4 -4
- package/dist/webhook.js +2 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +12 -11
- package/dist/types-B1ngKbWI.d.cts +0 -33
- package/dist/types-BiKNBwRA.d.ts +0 -33
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
2
|
-
import { C as CollectionType,
|
|
3
|
-
import { O as Order,
|
|
1
|
+
import { P as PublicCollection, C as Collection, S as ServerCollection } from './const-CaPq2AE4.js';
|
|
2
|
+
import { C as CollectionType, a as PublicProduct, P as PublicMarket } from './types-BC6rVmJa.js';
|
|
3
|
+
import { O as Order, k as Transaction, l as Fulfillment, R as Return } from './payload-types-CJZuXcgF.js';
|
|
4
|
+
|
|
5
|
+
declare const operationBrand: unique symbol;
|
|
6
|
+
type HttpOperation = {
|
|
7
|
+
readonly [operationBrand]: true;
|
|
8
|
+
readonly collection: string | null;
|
|
9
|
+
readonly method: 'get' | 'post' | 'patch' | 'delete';
|
|
10
|
+
readonly path: `/${string}`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Single source of truth for the commerce HTTP paths the SDK calls.
|
|
15
|
+
*
|
|
16
|
+
* Console exposes these as `slug + Endpoint.path` on collection configs; the SDK
|
|
17
|
+
* has to hardcode the joined `/api/<slug>/<path>` because it cannot import the
|
|
18
|
+
* Console at build time. To stop a Console path change from silently turning into
|
|
19
|
+
* a runtime 404, non-quarantined values are cross-checked against live Console
|
|
20
|
+
* endpoint registration by `apps/console/tests/unit/sdk/endpoint-parity.test.ts`.
|
|
21
|
+
* That test also records canonical Phase 1 operations whose route is absent or
|
|
22
|
+
* whose same-path legacy handler is not yet contract-compatible; registration
|
|
23
|
+
* alone must never be interpreted as transport parity.
|
|
24
|
+
*
|
|
25
|
+
* Keep this internal — it is the transport contract, not public SDK surface.
|
|
26
|
+
*/
|
|
27
|
+
type CanonicalCommerceEndpointDescriptor = {
|
|
28
|
+
readonly method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
29
|
+
readonly path: string;
|
|
30
|
+
};
|
|
31
|
+
type CommerceEndpointDescriptor = CanonicalCommerceEndpointDescriptor | HttpOperation;
|
|
4
32
|
|
|
5
33
|
interface CustomerScopedApiOptions {
|
|
6
34
|
publishableKey?: string;
|
|
@@ -15,14 +43,22 @@ interface CustomerScopedRequestOptions {
|
|
|
15
43
|
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
16
44
|
body?: unknown;
|
|
17
45
|
headers?: Record<string, string>;
|
|
46
|
+
errorFamily?: 'commerce';
|
|
18
47
|
}
|
|
48
|
+
type EndpointRequestOptions$1 = {
|
|
49
|
+
headers?: Record<string, string>;
|
|
50
|
+
pathParams?: Readonly<Record<string, string>>;
|
|
51
|
+
query?: string | URLSearchParams;
|
|
52
|
+
};
|
|
53
|
+
/** Operation-only base for customer-scoped commerce APIs. */
|
|
19
54
|
declare class CustomerScopedApi {
|
|
20
|
-
private readonly
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
private readonly transport;
|
|
56
|
+
constructor(apiName: string, options: CustomerScopedApiOptions);
|
|
57
|
+
protected requestEndpoint<T>(endpoint: CommerceEndpointDescriptor, body?: unknown, options?: EndpointRequestOptions$1): Promise<T>;
|
|
58
|
+
}
|
|
59
|
+
/** Raw transport base reserved for non-commerce customer-scoped APIs. */
|
|
60
|
+
declare class RawCustomerScopedApi {
|
|
61
|
+
private readonly transport;
|
|
26
62
|
constructor(apiName: string, options: CustomerScopedApiOptions);
|
|
27
63
|
protected request<T>(endpoint: string, options: CustomerScopedRequestOptions): Promise<T>;
|
|
28
64
|
}
|
|
@@ -167,7 +203,7 @@ type CommunityPostMutationResponse = CommunityPost | RawCommunityPost;
|
|
|
167
203
|
type CommunityCommentMutationResponse = CommunityComment | RawCommunityComment;
|
|
168
204
|
type CommunityReactionMutationResponse = Reaction | RawCommunityReaction;
|
|
169
205
|
type CommunityBookmarkMutationResponse = Bookmark | RawCommunityBookmark;
|
|
170
|
-
declare class CommunityClient extends
|
|
206
|
+
declare class CommunityClient extends RawCustomerScopedApi {
|
|
171
207
|
constructor(options: CommunityClientOptions);
|
|
172
208
|
private buildQuery;
|
|
173
209
|
private buildPostsListQuery;
|
|
@@ -332,8 +368,22 @@ interface ServerApiOptions {
|
|
|
332
368
|
interface RequestOptions {
|
|
333
369
|
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
334
370
|
headers?: Record<string, string>;
|
|
371
|
+
errorFamily?: 'commerce';
|
|
335
372
|
}
|
|
373
|
+
type EndpointRequestOptions = {
|
|
374
|
+
headers?: Record<string, string>;
|
|
375
|
+
pathParams?: Readonly<Record<string, string>>;
|
|
376
|
+
query?: string | URLSearchParams;
|
|
377
|
+
};
|
|
378
|
+
/** Operation-only base for commerce APIs. Raw URL execution is intentionally absent. */
|
|
336
379
|
declare abstract class BaseApi {
|
|
380
|
+
private readonly transport;
|
|
381
|
+
constructor(apiName: string, options: ServerApiOptions);
|
|
382
|
+
protected requestEndpoint<T>(endpoint: CommerceEndpointDescriptor, body: unknown, options?: EndpointRequestOptions): Promise<T>;
|
|
383
|
+
}
|
|
384
|
+
/** Raw transport base reserved for non-commerce APIs with genuinely dynamic URLs. */
|
|
385
|
+
declare abstract class RawBaseApi {
|
|
386
|
+
private readonly transport;
|
|
337
387
|
protected readonly publishableKey: string;
|
|
338
388
|
protected readonly secretKey: string;
|
|
339
389
|
protected readonly apiUrl?: string;
|
|
@@ -362,7 +412,7 @@ type BanCustomerParams = {
|
|
|
362
412
|
type UnbanCustomerParams = {
|
|
363
413
|
customerId: string;
|
|
364
414
|
};
|
|
365
|
-
declare class ModerationApi extends
|
|
415
|
+
declare class ModerationApi extends RawBaseApi {
|
|
366
416
|
constructor(options: ModerationApiOptions);
|
|
367
417
|
banCustomer(params: BanCustomerParams): Promise<CommunityBan>;
|
|
368
418
|
unbanCustomer(params: UnbanCustomerParams): Promise<{
|
|
@@ -388,6 +438,177 @@ type PublicMediaAsset = string | {
|
|
|
388
438
|
sizes?: Record<string, PublicMediaSize>;
|
|
389
439
|
};
|
|
390
440
|
|
|
441
|
+
interface CartApiOptions {
|
|
442
|
+
publishableKey?: string;
|
|
443
|
+
secretKey?: string;
|
|
444
|
+
apiUrl?: string;
|
|
445
|
+
customerToken?: string | (() => string | null);
|
|
446
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
447
|
+
onRequestId?: (id: string | null) => void;
|
|
448
|
+
}
|
|
449
|
+
declare const MAX_CART_LINE_ADMISSIONS = 32;
|
|
450
|
+
type PublicAttribute = {
|
|
451
|
+
key: string;
|
|
452
|
+
value: string;
|
|
453
|
+
};
|
|
454
|
+
type CreateCartParams = {
|
|
455
|
+
market?: string;
|
|
456
|
+
attributes?: PublicAttribute[];
|
|
457
|
+
};
|
|
458
|
+
type PublicCartItemAdmission = {
|
|
459
|
+
eventId: string;
|
|
460
|
+
occurrenceId: string;
|
|
461
|
+
admissionTypeId: string;
|
|
462
|
+
};
|
|
463
|
+
type AddItemParams = {
|
|
464
|
+
cartToken: string;
|
|
465
|
+
expectedRevision: number;
|
|
466
|
+
idempotencyKey: string;
|
|
467
|
+
productId: string;
|
|
468
|
+
variantId: string;
|
|
469
|
+
quantity: number;
|
|
470
|
+
admissions?: readonly [PublicCartItemAdmission, ...PublicCartItemAdmission[]];
|
|
471
|
+
};
|
|
472
|
+
type UpdateItemParams = {
|
|
473
|
+
cartToken: string;
|
|
474
|
+
expectedRevision: number;
|
|
475
|
+
idempotencyKey: string;
|
|
476
|
+
cartItemId: string;
|
|
477
|
+
quantity: number;
|
|
478
|
+
};
|
|
479
|
+
type RemoveItemParams = {
|
|
480
|
+
cartToken: string;
|
|
481
|
+
expectedRevision: number;
|
|
482
|
+
idempotencyKey: string;
|
|
483
|
+
cartItemId: string;
|
|
484
|
+
};
|
|
485
|
+
type UpdateDiscountCodesParams = {
|
|
486
|
+
cartToken: string;
|
|
487
|
+
expectedRevision: number;
|
|
488
|
+
idempotencyKey: string;
|
|
489
|
+
discountCodes: string[];
|
|
490
|
+
};
|
|
491
|
+
type UpdateCartAttributesParams = {
|
|
492
|
+
cartToken: string;
|
|
493
|
+
expectedRevision: number;
|
|
494
|
+
idempotencyKey: string;
|
|
495
|
+
attributes: PublicAttribute[];
|
|
496
|
+
};
|
|
497
|
+
type ClearCartParams = {
|
|
498
|
+
cartToken: string;
|
|
499
|
+
expectedRevision: number;
|
|
500
|
+
idempotencyKey: string;
|
|
501
|
+
};
|
|
502
|
+
type RetrieveCartParams = {
|
|
503
|
+
cartToken: string;
|
|
504
|
+
};
|
|
505
|
+
type CartMineParams = Record<string, never>;
|
|
506
|
+
type ServerCartMineParams = {
|
|
507
|
+
customerToken: string;
|
|
508
|
+
};
|
|
509
|
+
type CartMergeParams = {
|
|
510
|
+
guestCartToken: string;
|
|
511
|
+
idempotencyKey: string;
|
|
512
|
+
};
|
|
513
|
+
type ServerCartMergeParams = CartMergeParams & {
|
|
514
|
+
customerToken: string;
|
|
515
|
+
};
|
|
516
|
+
type CartDiscountCode = {
|
|
517
|
+
code: string;
|
|
518
|
+
applicable: boolean;
|
|
519
|
+
};
|
|
520
|
+
type CartWarningCode = 'DISCOUNT_CODE_NOT_HONOURED' | 'DISCOUNT_CURRENTLY_INACTIVE' | 'DISCOUNT_CUSTOMER_NOT_ELIGIBLE' | 'DISCOUNT_CUSTOMER_USAGE_LIMIT_REACHED' | 'DISCOUNT_ELIGIBLE_CUSTOMER_MISSING' | 'DISCOUNT_NO_ENTITLED_LINE_ITEMS' | 'DISCOUNT_NO_ENTITLED_SHIPPING_LINES' | 'DISCOUNT_NOT_FOUND' | 'DISCOUNT_PURCHASE_NOT_IN_RANGE' | 'DISCOUNT_USAGE_LIMIT_REACHED' | 'MERCHANDISE_NOT_ENOUGH_STOCK' | 'MERCHANDISE_OUT_OF_STOCK';
|
|
521
|
+
type CartWarning = {
|
|
522
|
+
code: CartWarningCode;
|
|
523
|
+
message: string;
|
|
524
|
+
target: string;
|
|
525
|
+
};
|
|
526
|
+
type PublicCartReference = {
|
|
527
|
+
id: string;
|
|
528
|
+
title: string;
|
|
529
|
+
handle: string | null;
|
|
530
|
+
image: PublicMediaAsset | null;
|
|
531
|
+
};
|
|
532
|
+
type PublicCartMarket = {
|
|
533
|
+
id: string;
|
|
534
|
+
handle: string;
|
|
535
|
+
name: string;
|
|
536
|
+
};
|
|
537
|
+
type PublicCartItem = {
|
|
538
|
+
id: string;
|
|
539
|
+
product: PublicCartReference;
|
|
540
|
+
variant: PublicCartReference;
|
|
541
|
+
admissions: PublicCartItemAdmission[];
|
|
542
|
+
quantity: number;
|
|
543
|
+
unitPriceMinor: number;
|
|
544
|
+
discountMinor: number;
|
|
545
|
+
estimatedLineTotalMinor: number;
|
|
546
|
+
requiresShipping: boolean;
|
|
547
|
+
};
|
|
548
|
+
type PublicCart = {
|
|
549
|
+
id: string;
|
|
550
|
+
status: 'active' | 'completed' | 'abandoned';
|
|
551
|
+
revision: number;
|
|
552
|
+
currency: Uppercase<string>;
|
|
553
|
+
market: PublicCartMarket;
|
|
554
|
+
subtotalMinor: number;
|
|
555
|
+
discountMinor: number;
|
|
556
|
+
estimatedTotalMinor: number;
|
|
557
|
+
discountCodes: CartDiscountCode[];
|
|
558
|
+
attributes: PublicAttribute[];
|
|
559
|
+
items: PublicCartItem[];
|
|
560
|
+
expiresAt: string;
|
|
561
|
+
createdAt: string;
|
|
562
|
+
updatedAt: string;
|
|
563
|
+
};
|
|
564
|
+
type CartMutationResult = {
|
|
565
|
+
cart: PublicCart;
|
|
566
|
+
warnings: CartWarning[];
|
|
567
|
+
};
|
|
568
|
+
type CreateCartResult = {
|
|
569
|
+
cart: PublicCart;
|
|
570
|
+
warnings: CartWarning[];
|
|
571
|
+
cartToken: string;
|
|
572
|
+
};
|
|
573
|
+
type CartMergeResultBase = CreateCartResult;
|
|
574
|
+
type CartMergeResult = CartMergeResultBase & ({
|
|
575
|
+
resolution: 'unchanged';
|
|
576
|
+
merged: false;
|
|
577
|
+
claimed: false;
|
|
578
|
+
} | {
|
|
579
|
+
resolution: 'claimed';
|
|
580
|
+
merged: false;
|
|
581
|
+
claimed: true;
|
|
582
|
+
} | {
|
|
583
|
+
resolution: 'merged';
|
|
584
|
+
merged: true;
|
|
585
|
+
claimed: false;
|
|
586
|
+
});
|
|
587
|
+
type CartMineResult = {
|
|
588
|
+
cart: PublicCart;
|
|
589
|
+
cartToken: string;
|
|
590
|
+
} | {
|
|
591
|
+
cart: null;
|
|
592
|
+
cartToken: null;
|
|
593
|
+
};
|
|
594
|
+
declare class CartApi extends CustomerScopedApi {
|
|
595
|
+
private readonly serverTransport;
|
|
596
|
+
constructor(options: CartApiOptions);
|
|
597
|
+
private endpoint;
|
|
598
|
+
private execute;
|
|
599
|
+
create(params?: CreateCartParams): Promise<CreateCartResult>;
|
|
600
|
+
retrieve(params: RetrieveCartParams): Promise<PublicCart>;
|
|
601
|
+
mine(params?: CartMineParams | ServerCartMineParams): Promise<CartMineResult>;
|
|
602
|
+
merge(params: CartMergeParams | ServerCartMergeParams): Promise<CartMergeResult>;
|
|
603
|
+
addItem(params: AddItemParams): Promise<CartMutationResult>;
|
|
604
|
+
private mutate;
|
|
605
|
+
updateItem(params: UpdateItemParams): Promise<CartMutationResult>;
|
|
606
|
+
removeItem(params: RemoveItemParams): Promise<CartMutationResult>;
|
|
607
|
+
clear(params: ClearCartParams): Promise<CartMutationResult>;
|
|
608
|
+
updateDiscountCodes(params: UpdateDiscountCodesParams): Promise<CartMutationResult>;
|
|
609
|
+
updateAttributes(params: UpdateCartAttributesParams): Promise<CartMutationResult>;
|
|
610
|
+
}
|
|
611
|
+
|
|
391
612
|
type OrderApiOptions = ServerApiOptions;
|
|
392
613
|
/** Header-only; never sent in the JSON body. */
|
|
393
614
|
type WithIdempotencyKey<T> = T & {
|
|
@@ -397,190 +618,76 @@ type WithIdempotencyKey<T> = T & {
|
|
|
397
618
|
*/
|
|
398
619
|
idempotencyKey?: string;
|
|
399
620
|
};
|
|
400
|
-
type
|
|
401
|
-
name?: string;
|
|
402
|
-
email: string;
|
|
403
|
-
phone?: string;
|
|
404
|
-
};
|
|
405
|
-
type CheckoutShippingAddress = {
|
|
406
|
-
recipientName: string;
|
|
407
|
-
phone: string;
|
|
408
|
-
postalCode: string;
|
|
409
|
-
address: string;
|
|
410
|
-
detailAddress: string;
|
|
411
|
-
deliveryMessage?: string;
|
|
412
|
-
};
|
|
413
|
-
type PublicOrderReference = string | {
|
|
414
|
-
id?: string | number | null;
|
|
415
|
-
title?: string | null;
|
|
416
|
-
name?: string | null;
|
|
417
|
-
slug?: string | null;
|
|
418
|
-
displayName?: string | null;
|
|
419
|
-
handle?: string | null;
|
|
420
|
-
color?: string | null;
|
|
421
|
-
image?: PublicMediaAsset | null;
|
|
422
|
-
thumbnail?: PublicMediaAsset | null;
|
|
423
|
-
avatar?: PublicMediaAsset | null;
|
|
424
|
-
};
|
|
621
|
+
type PublicOrderReference = PublicCartReference;
|
|
425
622
|
type PublicOrderItem = {
|
|
426
|
-
id
|
|
427
|
-
product
|
|
428
|
-
variant
|
|
429
|
-
productTitle
|
|
430
|
-
variantTitle
|
|
431
|
-
sku
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
623
|
+
id: string;
|
|
624
|
+
product: PublicOrderReference | null;
|
|
625
|
+
variant: PublicOrderReference | null;
|
|
626
|
+
productTitle: string;
|
|
627
|
+
variantTitle: string | null;
|
|
628
|
+
sku: string | null;
|
|
629
|
+
admissions: PublicCartItemAdmission[];
|
|
630
|
+
quantity: number;
|
|
631
|
+
unitPriceMinor: number;
|
|
632
|
+
discountMinor: number;
|
|
633
|
+
lineTotalMinor: number;
|
|
634
|
+
requiresShipping: boolean;
|
|
635
|
+
};
|
|
636
|
+
type PublicOrderAmounts = {
|
|
637
|
+
currency: Uppercase<string>;
|
|
638
|
+
subtotalMinor: number;
|
|
639
|
+
shippingMinor: number;
|
|
640
|
+
discountMinor: number;
|
|
641
|
+
totalMinor: number;
|
|
642
|
+
refundedMinor: number;
|
|
643
|
+
currentTotalMinor: number;
|
|
441
644
|
};
|
|
442
645
|
type PublicOrder = {
|
|
443
|
-
id
|
|
444
|
-
orderNumber
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
displayFulfillmentStatus?: string | null;
|
|
452
|
-
returnStatus?: string | null;
|
|
453
|
-
returnDisplayStatus?: string | null;
|
|
454
|
-
totalAmount?: number | null;
|
|
455
|
-
subtotalAmount?: number | null;
|
|
456
|
-
shippingAmount?: number | null;
|
|
457
|
-
discountAmount?: number | null;
|
|
458
|
-
taxAmount?: number | null;
|
|
459
|
-
refundedAmount?: number | null;
|
|
460
|
-
/** Net order total after refunds (`totalAmount - refundedAmount`, clamped at 0). */
|
|
461
|
-
currentTotalAmount?: number | null;
|
|
462
|
-
currency?: string | null;
|
|
463
|
-
customerNote?: string | null;
|
|
464
|
-
createdAt?: string | null;
|
|
465
|
-
updatedAt?: string | null;
|
|
466
|
-
customerSnapshot?: {
|
|
467
|
-
name?: string | null;
|
|
468
|
-
email?: string | null;
|
|
469
|
-
phone?: string | null;
|
|
470
|
-
};
|
|
471
|
-
shippingAddress?: {
|
|
472
|
-
recipientName?: string | null;
|
|
473
|
-
phone?: string | null;
|
|
474
|
-
postalCode?: string | null;
|
|
475
|
-
address1?: string | null;
|
|
476
|
-
address2?: string | null;
|
|
477
|
-
jibunAddress?: string | null;
|
|
478
|
-
administrativeArea?: string | null;
|
|
479
|
-
city?: string | null;
|
|
480
|
-
province?: string | null;
|
|
481
|
-
country?: string | null;
|
|
482
|
-
deliveryMemo?: string | null;
|
|
483
|
-
address?: string | null;
|
|
484
|
-
detailAddress?: string | null;
|
|
485
|
-
deliveryMessage?: string | null;
|
|
646
|
+
id: string;
|
|
647
|
+
orderNumber: string;
|
|
648
|
+
amounts: PublicOrderAmounts;
|
|
649
|
+
market: PublicCartMarket | null;
|
|
650
|
+
customerSnapshot: {
|
|
651
|
+
email: string;
|
|
652
|
+
name?: string;
|
|
653
|
+
phone?: string;
|
|
486
654
|
};
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
655
|
+
shippingAddress: {
|
|
656
|
+
recipientName: string;
|
|
657
|
+
phone: string;
|
|
658
|
+
countryCode?: string;
|
|
659
|
+
regionCode?: string;
|
|
660
|
+
postalCode: string;
|
|
661
|
+
address: string;
|
|
662
|
+
detailAddress: string;
|
|
663
|
+
deliveryMessage?: string;
|
|
664
|
+
} | null;
|
|
665
|
+
attributes: PublicAttribute[];
|
|
666
|
+
items: PublicOrderItem[];
|
|
667
|
+
financialStatus: 'pending' | 'authorized' | 'expired' | 'partially_paid' | 'paid' | 'canceled' | 'partially_refunded' | 'refunded' | 'reconciliation_required';
|
|
668
|
+
fulfillmentStatus: 'unfulfilled' | 'in_progress' | 'on_hold' | 'partially_fulfilled' | 'shipped' | 'fulfilled' | 'canceled';
|
|
669
|
+
returnStatus: 'no_return' | 'return_requested' | 'in_progress' | 'returned';
|
|
670
|
+
confirmationStatus: 'unconfirmed' | 'confirmed';
|
|
671
|
+
primaryDisplayStatus: 'pending' | 'paid' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed';
|
|
672
|
+
placedAt: string;
|
|
673
|
+
createdAt: string;
|
|
674
|
+
updatedAt: string;
|
|
675
|
+
};
|
|
676
|
+
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'size_too_large' | 'size_too_small' | 'color' | 'style' | 'not_as_described' | 'wrong_item' | 'unknown' | 'other';
|
|
677
|
+
type ReturnRejectionReason = 'window_expired' | 'used_or_damaged' | 'non_returnable' | 'other';
|
|
678
|
+
type ReturnCancellationReasonCode = 'items_not_received' | 'customer_withdrew' | 'merchant_decision' | 'other';
|
|
490
679
|
type ReturnItem = {
|
|
491
680
|
orderItem: string | number;
|
|
492
681
|
quantity: number;
|
|
493
682
|
restockAction?: RestockAction;
|
|
494
683
|
restockingFee?: number;
|
|
495
684
|
};
|
|
496
|
-
type OrderCreateEntityID = string | number;
|
|
497
|
-
type CreateOrderItem = {
|
|
498
|
-
/**
|
|
499
|
-
* Compatibility input: the create-order endpoint derives the line's product
|
|
500
|
-
* from the variant's parent server-side; storefront items may omit this.
|
|
501
|
-
*/
|
|
502
|
-
product?: OrderCreateEntityID;
|
|
503
|
-
variant: OrderCreateEntityID;
|
|
504
|
-
/**
|
|
505
|
-
* Compatibility input: accepted but unused by the create-order endpoint;
|
|
506
|
-
* option selection is snapshotted server-side from the variant.
|
|
507
|
-
*/
|
|
508
|
-
option?: OrderCreateEntityID;
|
|
509
|
-
quantity: number;
|
|
510
|
-
/**
|
|
511
|
-
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
512
|
-
* derives authoritative line pricing from the product variant.
|
|
513
|
-
*/
|
|
514
|
-
unitPrice?: number;
|
|
515
|
-
/**
|
|
516
|
-
* Compatibility input: the create-order endpoint accepts this, but the server
|
|
517
|
-
* derives authoritative line totals from the product variant.
|
|
518
|
-
*/
|
|
519
|
-
totalPrice?: number;
|
|
520
|
-
};
|
|
521
|
-
type CreateOrderLineItemsInput = {
|
|
522
|
-
orderItems: CreateOrderItem[];
|
|
523
|
-
items?: never;
|
|
524
|
-
} | {
|
|
525
|
-
/**
|
|
526
|
-
* Storefront-facing alias for orderItems. The SDK serializes this to
|
|
527
|
-
* orderItems for the existing create-order endpoint.
|
|
528
|
-
*/
|
|
529
|
-
items: CreateOrderItem[];
|
|
530
|
-
/**
|
|
531
|
-
* @deprecated Use items for storefront-facing create-order inputs.
|
|
532
|
-
*/
|
|
533
|
-
orderItems?: never;
|
|
534
|
-
};
|
|
535
|
-
type CreateOrderBodyBase = {
|
|
536
|
-
orderNumber: string;
|
|
537
|
-
customer?: string;
|
|
538
|
-
customerSnapshot: CustomerSnapshot;
|
|
539
|
-
shippingAddress?: Order['shippingAddress'];
|
|
540
|
-
totalAmount: number;
|
|
541
|
-
shippingAmount?: number;
|
|
542
|
-
pgPaymentId?: string;
|
|
543
|
-
discountCode?: string;
|
|
544
|
-
};
|
|
545
|
-
type CreateOrderParams = WithIdempotencyKey<CreateOrderBodyBase & CreateOrderLineItemsInput>;
|
|
546
685
|
type UpdateOrderParams = {
|
|
547
686
|
orderNumber: string;
|
|
548
687
|
status: 'confirmed';
|
|
549
688
|
};
|
|
550
|
-
type TransactionStatus = 'pending' | 'paid' | 'failed' | 'canceled' | 'refunded';
|
|
551
|
-
type UpdateTransactionParams = {
|
|
552
|
-
pgPaymentId: string;
|
|
553
|
-
status: TransactionStatus;
|
|
554
|
-
paymentMethod?: string;
|
|
555
|
-
receiptUrl?: string;
|
|
556
|
-
paymentKey?: string;
|
|
557
|
-
amount?: number;
|
|
558
|
-
};
|
|
559
|
-
type ConfirmPaymentParams = WithIdempotencyKey<{
|
|
560
|
-
orderNumber?: string;
|
|
561
|
-
pgPaymentId: string;
|
|
562
|
-
pgProvider: string;
|
|
563
|
-
pgOrderId?: string;
|
|
564
|
-
amount: number;
|
|
565
|
-
currency?: string;
|
|
566
|
-
paymentMethod?: string;
|
|
567
|
-
receiptUrl?: string;
|
|
568
|
-
approvedAt?: string;
|
|
569
|
-
providerStatus?: string;
|
|
570
|
-
/** Provider event id; also used as idempotency key when `idempotencyKey` is omitted. */
|
|
571
|
-
providerEventId?: string;
|
|
572
|
-
paymentKey?: string;
|
|
573
|
-
confirmationSource?: 'provider_webhook' | 'provider_lookup' | 'provider_api_confirm' | 'manual_server';
|
|
574
|
-
metadata?: Record<string, unknown>;
|
|
575
|
-
}>;
|
|
576
|
-
type ConfirmPaymentResponse = {
|
|
577
|
-
orderId: string;
|
|
578
|
-
transactionId: string;
|
|
579
|
-
status: 'paid';
|
|
580
|
-
alreadyConfirmed?: boolean;
|
|
581
|
-
};
|
|
582
689
|
type GetOrderByPaymentIdParams = {
|
|
583
|
-
/** Payment provider slug, e.g. `toss
|
|
690
|
+
/** Payment provider slug, e.g. `toss`. */
|
|
584
691
|
pgProvider: string;
|
|
585
692
|
/** Provider payment identifier stored on the payment transaction. */
|
|
586
693
|
pgPaymentId: string;
|
|
@@ -595,18 +702,7 @@ type OrderByPaymentResult = {
|
|
|
595
702
|
order: Order;
|
|
596
703
|
transaction: Transaction | null;
|
|
597
704
|
};
|
|
598
|
-
/**
|
|
599
|
-
* Result of {@link OrderApi.confirmPaymentReturningOrder}: the raw
|
|
600
|
-
* `confirmPayment` confirmation plus the depth-populated order/transaction
|
|
601
|
-
* resolved by the same payment id.
|
|
602
|
-
*/
|
|
603
|
-
type ConfirmPaymentWithOrderResult = ConfirmPaymentResponse & {
|
|
604
|
-
order: Order;
|
|
605
|
-
transaction: Transaction | null;
|
|
606
|
-
};
|
|
607
705
|
type CancelReasonCode = 'customer' | 'inventory' | 'fraud' | 'declined' | 'staff' | 'other';
|
|
608
|
-
type CancelOrderStatus = 'pending' | 'paid' | 'canceled' | 'refunded' | 'preparing' | 'shipped' | 'delivered' | 'confirmed' | 'return_requested' | 'return_processing' | 'returned';
|
|
609
|
-
type CancelOrderReconciliationStatus = Exclude<CancelOrderStatus, 'pending' | 'canceled'>;
|
|
610
706
|
type CancelOrderResponseBase = {
|
|
611
707
|
orderId: string;
|
|
612
708
|
};
|
|
@@ -620,12 +716,6 @@ type CancelOrderPaidCommittedResponseFields = {
|
|
|
620
716
|
providerRefunded: false;
|
|
621
717
|
refundPending: true;
|
|
622
718
|
};
|
|
623
|
-
type CancelOrderLegacyProviderRefundResponseFields = {
|
|
624
|
-
transactionId: string;
|
|
625
|
-
refundedAmount: number;
|
|
626
|
-
refundSeq: number;
|
|
627
|
-
providerRefunded: true;
|
|
628
|
-
};
|
|
629
719
|
type CancelOrderAlreadyCanceledResponseFields = {
|
|
630
720
|
refundedAmount: number;
|
|
631
721
|
providerRefunded: false;
|
|
@@ -655,13 +745,7 @@ type CancelOrderAlreadyCanceledRefundPendingResponse = CancelOrderResponseBase &
|
|
|
655
745
|
cancelCommitted: false;
|
|
656
746
|
alreadyCanceled: true;
|
|
657
747
|
};
|
|
658
|
-
|
|
659
|
-
type CancelOrderReconciliationResponse = CancelOrderResponseBase & CancelOrderLegacyProviderRefundResponseFields & {
|
|
660
|
-
status: CancelOrderReconciliationStatus;
|
|
661
|
-
cancelCommitted: false;
|
|
662
|
-
reconciliationRequired: true;
|
|
663
|
-
};
|
|
664
|
-
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse | CancelOrderReconciliationResponse;
|
|
748
|
+
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse;
|
|
665
749
|
type CancelOrderParams = {
|
|
666
750
|
orderNumber: string;
|
|
667
751
|
reasonCode?: CancelReasonCode;
|
|
@@ -692,7 +776,7 @@ type ResolveCancelRefundSucceededResponse = {
|
|
|
692
776
|
refundTransactionId: string;
|
|
693
777
|
refundedAmount: number;
|
|
694
778
|
refundStatus: 'succeeded';
|
|
695
|
-
transactionStatus: 'refunded';
|
|
779
|
+
transactionStatus: 'paid' | 'refunded';
|
|
696
780
|
};
|
|
697
781
|
type ResolveCancelRefundFailedResponse = {
|
|
698
782
|
orderId: string;
|
|
@@ -723,15 +807,6 @@ type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
|
723
807
|
paymentKey?: string;
|
|
724
808
|
refundReceiptUrl?: string;
|
|
725
809
|
}>;
|
|
726
|
-
type CheckoutParams = WithIdempotencyKey<{
|
|
727
|
-
cartId: string;
|
|
728
|
-
cartToken?: string;
|
|
729
|
-
orderNumber: string;
|
|
730
|
-
customerSnapshot: CustomerSnapshot;
|
|
731
|
-
shippingAddress?: CheckoutShippingAddress;
|
|
732
|
-
pgPaymentId?: string;
|
|
733
|
-
discountCode?: string;
|
|
734
|
-
}>;
|
|
735
810
|
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
736
811
|
orderNumber: string;
|
|
737
812
|
fulfillmentOrderId?: string | number;
|
|
@@ -744,7 +819,7 @@ type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
|
744
819
|
carrier?: string;
|
|
745
820
|
trackingNumber?: string;
|
|
746
821
|
items?: Array<{
|
|
747
|
-
orderItem: string;
|
|
822
|
+
orderItem: string | number;
|
|
748
823
|
quantity: number;
|
|
749
824
|
}>;
|
|
750
825
|
}>;
|
|
@@ -759,7 +834,7 @@ type PrepareFulfillmentOrderResponse = {
|
|
|
759
834
|
}>;
|
|
760
835
|
};
|
|
761
836
|
type UpdateFulfillmentParams = {
|
|
762
|
-
fulfillmentId: string;
|
|
837
|
+
fulfillmentId: string | number;
|
|
763
838
|
status?: 'shipped' | 'delivered' | 'failed';
|
|
764
839
|
carrier?: string;
|
|
765
840
|
trackingNumber?: string;
|
|
@@ -792,39 +867,23 @@ type CreateReturnParams = WithIdempotencyKey<{
|
|
|
792
867
|
initialShippingRefundOverrideNote?: string;
|
|
793
868
|
}>;
|
|
794
869
|
type UpdateReturnParams = {
|
|
795
|
-
returnId: string;
|
|
796
|
-
status: 'processing' | 'approved' | 'rejected' | 'completed';
|
|
870
|
+
returnId: string | number;
|
|
871
|
+
status: 'processing' | 'approved' | 'rejected' | 'canceled' | 'completed';
|
|
872
|
+
reasonCode?: ReturnRejectionReason;
|
|
873
|
+
cancellationReasonCode?: ReturnCancellationReasonCode;
|
|
874
|
+
cancellationReasonDetail?: string;
|
|
797
875
|
};
|
|
798
876
|
declare class OrderApi extends BaseApi {
|
|
799
877
|
constructor(options: OrderApiOptions);
|
|
800
|
-
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
801
878
|
updateOrder(params: UpdateOrderParams): Promise<Order>;
|
|
802
|
-
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
803
|
-
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
804
879
|
/**
|
|
805
880
|
* Resolve an order + its payment transaction by PG payment id. Replaces raw
|
|
806
881
|
* `transactions.find({ where: { pgPaymentId } })` + a local file index in
|
|
807
882
|
* storefronts. Server-only (sk01_) read of the full populated Order.
|
|
808
883
|
*/
|
|
809
884
|
getByPaymentId(params: GetOrderByPaymentIdParams): Promise<OrderByPaymentResult>;
|
|
810
|
-
/**
|
|
811
|
-
* Composed facade: confirm a provider payment, then resolve the
|
|
812
|
-
* depth-populated order/transaction by the same payment id. `confirmPayment`'s
|
|
813
|
-
* wire response carries only IDs (its contract is `.strict()`); this returns
|
|
814
|
-
* the populated `Order` so storefronts stop reconstructing order state
|
|
815
|
-
* locally. Two round trips by design — the alternative (widening the strict
|
|
816
|
-
* confirm-payment wire contract to embed a full Order) is rejected.
|
|
817
|
-
*/
|
|
818
|
-
confirmPaymentReturningOrder(params: ConfirmPaymentParams): Promise<ConfirmPaymentWithOrderResult>;
|
|
819
885
|
cancelOrder(params: CancelOrderParams): Promise<CancelOrderResponse>;
|
|
820
886
|
resolveCancelRefund(params: ResolveCancelRefundParams): Promise<ResolveCancelRefundResponse>;
|
|
821
|
-
/**
|
|
822
|
-
* Returns a `PublicOrder`-compatible shape even when the server backs the
|
|
823
|
-
* response with a Checkout (checkout/order separation, #1285). `orderNumber`
|
|
824
|
-
* stays the stable cross-window key. A breaking `PublicCheckout` split is a
|
|
825
|
-
* deferred follow-up (design D10 / Q3-b); do not change this return type here.
|
|
826
|
-
*/
|
|
827
|
-
checkout(params: CheckoutParams): Promise<PublicOrder>;
|
|
828
887
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
829
888
|
prepareFulfillmentOrder(params: PrepareFulfillmentOrderParams): Promise<PrepareFulfillmentOrderResponse>;
|
|
830
889
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
@@ -837,18 +896,88 @@ declare class OrderApi extends BaseApi {
|
|
|
837
896
|
updateReturn(params: UpdateReturnParams): Promise<Return>;
|
|
838
897
|
}
|
|
839
898
|
|
|
899
|
+
interface CustomerOAuthConfig {
|
|
900
|
+
clientId: string;
|
|
901
|
+
issuer: string;
|
|
902
|
+
timeout?: number;
|
|
903
|
+
}
|
|
904
|
+
interface CustomerAuthorizationUrlInput {
|
|
905
|
+
redirectUri: string;
|
|
906
|
+
returnTo?: string;
|
|
907
|
+
scopes?: readonly string[];
|
|
908
|
+
}
|
|
909
|
+
interface CustomerAuthorizationUrlResult {
|
|
910
|
+
authorizationUrl: string;
|
|
911
|
+
codeChallenge: string;
|
|
912
|
+
codeVerifier: string;
|
|
913
|
+
nonce: string;
|
|
914
|
+
returnTo: string | null;
|
|
915
|
+
state: string;
|
|
916
|
+
}
|
|
917
|
+
interface CustomerOAuthCallbackResult {
|
|
918
|
+
code: string;
|
|
919
|
+
state: string;
|
|
920
|
+
}
|
|
921
|
+
interface CustomerOAuthTokenSet {
|
|
922
|
+
accessToken: string;
|
|
923
|
+
expiresAt: number;
|
|
924
|
+
expiresIn: number;
|
|
925
|
+
idToken?: string;
|
|
926
|
+
refreshToken: string;
|
|
927
|
+
scope?: string;
|
|
928
|
+
tokenType: 'Bearer';
|
|
929
|
+
}
|
|
930
|
+
declare class CustomerOAuth {
|
|
931
|
+
private readonly clientId;
|
|
932
|
+
private readonly issuer;
|
|
933
|
+
private readonly timeout;
|
|
934
|
+
constructor(config: CustomerOAuthConfig);
|
|
935
|
+
createAuthorizationUrl(input: CustomerAuthorizationUrlInput): Promise<CustomerAuthorizationUrlResult>;
|
|
936
|
+
parseCallback(callbackUrl: string, options: {
|
|
937
|
+
expectedState: string;
|
|
938
|
+
}): CustomerOAuthCallbackResult;
|
|
939
|
+
exchangeCode(input: {
|
|
940
|
+
code: string;
|
|
941
|
+
codeVerifier: string;
|
|
942
|
+
redirectUri: string;
|
|
943
|
+
}): Promise<CustomerOAuthTokenSet>;
|
|
944
|
+
refresh(input: {
|
|
945
|
+
refreshToken: string;
|
|
946
|
+
}): Promise<CustomerOAuthTokenSet>;
|
|
947
|
+
logout(input: {
|
|
948
|
+
postLogoutRedirectUri?: string;
|
|
949
|
+
refreshToken?: string;
|
|
950
|
+
}): Promise<{
|
|
951
|
+
redirectUrl?: string;
|
|
952
|
+
success: boolean;
|
|
953
|
+
}>;
|
|
954
|
+
verifyIdToken(): never;
|
|
955
|
+
private tokenRequest;
|
|
956
|
+
}
|
|
957
|
+
|
|
840
958
|
interface CustomerAuthResponse {
|
|
841
959
|
token: string;
|
|
960
|
+
refreshToken?: string;
|
|
842
961
|
customer: CustomerProfile;
|
|
843
962
|
}
|
|
963
|
+
type MarketingConsentState = 'not_subscribed' | 'pending' | 'subscribed' | 'unsubscribed';
|
|
964
|
+
type MarketingOptInLevel = 'single_opt_in' | 'confirmed_opt_in' | 'unknown';
|
|
844
965
|
interface MarketingConsentChannel {
|
|
966
|
+
state?: MarketingConsentState | null;
|
|
967
|
+
optInLevel?: MarketingOptInLevel | null;
|
|
968
|
+
source?: string | null;
|
|
969
|
+
reason?: string | null;
|
|
970
|
+
consentedAt?: string | null;
|
|
971
|
+
consentUpdatedAt?: string | null;
|
|
972
|
+
expiresAt?: string | null;
|
|
973
|
+
unsubscribedAt?: string | null;
|
|
974
|
+
/** Backward-compatible write input; responses use `state`. */
|
|
845
975
|
isConsented?: boolean;
|
|
846
976
|
}
|
|
847
977
|
interface MarketingConsent {
|
|
848
978
|
email?: MarketingConsentChannel;
|
|
849
979
|
sms?: MarketingConsentChannel;
|
|
850
980
|
push?: MarketingConsentChannel;
|
|
851
|
-
consentSource?: string;
|
|
852
981
|
}
|
|
853
982
|
interface CustomerProfile {
|
|
854
983
|
id: string;
|
|
@@ -876,6 +1005,7 @@ interface CustomerLoginData {
|
|
|
876
1005
|
}
|
|
877
1006
|
interface CustomerRefreshResponse {
|
|
878
1007
|
token: string;
|
|
1008
|
+
refreshToken?: string;
|
|
879
1009
|
}
|
|
880
1010
|
interface UpdateProfileData {
|
|
881
1011
|
name?: string;
|
|
@@ -895,20 +1025,24 @@ interface CustomerAuthOptions {
|
|
|
895
1025
|
persist?: boolean | string;
|
|
896
1026
|
/** Initial token (e.g. from SSR cookie) */
|
|
897
1027
|
token?: string;
|
|
1028
|
+
/** Initial refresh token, stored separately from the access token */
|
|
1029
|
+
refreshToken?: string;
|
|
898
1030
|
/** Called when token changes (login/logout) — use to persist in localStorage/cookie */
|
|
899
1031
|
onTokenChange?: (token: string | null) => void;
|
|
1032
|
+
/** Called when refresh token changes (login/refresh/logout) */
|
|
1033
|
+
onRefreshTokenChange?: (refreshToken: string | null) => void;
|
|
1034
|
+
/** Optional hosted OAuth helper configuration */
|
|
1035
|
+
oauth?: CustomerOAuthConfig;
|
|
900
1036
|
}
|
|
901
1037
|
|
|
902
1038
|
type CustomerOrderListOptions = {
|
|
903
1039
|
page?: number;
|
|
904
1040
|
limit?: number;
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
returnStatus?:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
/** @deprecated Read-only compatibility alias filter. Prefer independent status axes. */
|
|
911
|
-
status?: string;
|
|
1041
|
+
financialStatus?: PublicOrder['financialStatus'];
|
|
1042
|
+
fulfillmentStatus?: PublicOrder['fulfillmentStatus'];
|
|
1043
|
+
returnStatus?: PublicOrder['returnStatus'];
|
|
1044
|
+
confirmationStatus?: PublicOrder['confirmationStatus'];
|
|
1045
|
+
primaryDisplayStatus?: PublicOrder['primaryDisplayStatus'];
|
|
912
1046
|
};
|
|
913
1047
|
/**
|
|
914
1048
|
* Customer authentication client.
|
|
@@ -920,7 +1054,9 @@ declare class CustomerAuth {
|
|
|
920
1054
|
private publishableKey;
|
|
921
1055
|
private baseUrl;
|
|
922
1056
|
private token;
|
|
1057
|
+
private refreshTokenValue;
|
|
923
1058
|
private onTokenChange?;
|
|
1059
|
+
private onRefreshTokenChange?;
|
|
924
1060
|
private refreshPromise;
|
|
925
1061
|
constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
|
|
926
1062
|
/**
|
|
@@ -932,7 +1068,8 @@ declare class CustomerAuth {
|
|
|
932
1068
|
*/
|
|
933
1069
|
login(data: CustomerLoginData): Promise<CustomerAuthResponse>;
|
|
934
1070
|
/**
|
|
935
|
-
* Refresh the current token.
|
|
1071
|
+
* Refresh the current token. Uses a refresh token when available, otherwise
|
|
1072
|
+
* falls back to the legacy bearer-token compatibility path.
|
|
936
1073
|
*/
|
|
937
1074
|
refreshToken(): Promise<CustomerRefreshResponse>;
|
|
938
1075
|
private _doRefreshToken;
|
|
@@ -968,10 +1105,18 @@ declare class CustomerAuth {
|
|
|
968
1105
|
* Get the current token (or null if not authenticated)
|
|
969
1106
|
*/
|
|
970
1107
|
getToken(): string | null;
|
|
1108
|
+
/**
|
|
1109
|
+
* Get the current refresh token (or null if unavailable)
|
|
1110
|
+
*/
|
|
1111
|
+
getRefreshToken(): string | null;
|
|
971
1112
|
/**
|
|
972
1113
|
* Set the token manually (e.g. from SSR)
|
|
973
1114
|
*/
|
|
974
1115
|
setToken(token: string | null): void;
|
|
1116
|
+
/**
|
|
1117
|
+
* Set the refresh token manually (e.g. from SSR cookie)
|
|
1118
|
+
*/
|
|
1119
|
+
setRefreshToken(refreshToken: string | null): void;
|
|
975
1120
|
/**
|
|
976
1121
|
* Check if the customer is currently authenticated
|
|
977
1122
|
*/
|
|
@@ -983,158 +1128,6 @@ declare class CustomerAuth {
|
|
|
983
1128
|
private requestJson;
|
|
984
1129
|
}
|
|
985
1130
|
|
|
986
|
-
interface CartApiOptions {
|
|
987
|
-
publishableKey?: string;
|
|
988
|
-
secretKey?: string;
|
|
989
|
-
apiUrl?: string;
|
|
990
|
-
customerToken?: string | (() => string | null);
|
|
991
|
-
onUnauthorized?: () => Promise<string | null>;
|
|
992
|
-
onRequestId?: (id: string | null) => void;
|
|
993
|
-
}
|
|
994
|
-
type CreateCartParams = Record<string, never>;
|
|
995
|
-
type AddItemParams = {
|
|
996
|
-
cartToken: string;
|
|
997
|
-
product: string;
|
|
998
|
-
variant: string;
|
|
999
|
-
option?: string;
|
|
1000
|
-
quantity: number;
|
|
1001
|
-
};
|
|
1002
|
-
type UpdateItemParams = {
|
|
1003
|
-
cartToken: string;
|
|
1004
|
-
cartItemId: string;
|
|
1005
|
-
quantity: number;
|
|
1006
|
-
};
|
|
1007
|
-
type RemoveItemParams = {
|
|
1008
|
-
cartToken: string;
|
|
1009
|
-
cartItemId: string;
|
|
1010
|
-
};
|
|
1011
|
-
type ApplyDiscountParams = {
|
|
1012
|
-
cartToken: string;
|
|
1013
|
-
discountCode: string;
|
|
1014
|
-
};
|
|
1015
|
-
type RemoveDiscountParams = {
|
|
1016
|
-
cartToken: string;
|
|
1017
|
-
};
|
|
1018
|
-
type ClearCartParams = {
|
|
1019
|
-
cartToken: string;
|
|
1020
|
-
};
|
|
1021
|
-
type CartMergeParams = {
|
|
1022
|
-
guestCartToken: string;
|
|
1023
|
-
};
|
|
1024
|
-
type PublicCartReference = string | {
|
|
1025
|
-
id?: string | number | null;
|
|
1026
|
-
title?: string | null;
|
|
1027
|
-
name?: string | null;
|
|
1028
|
-
slug?: string | null;
|
|
1029
|
-
displayName?: string | null;
|
|
1030
|
-
handle?: string | null;
|
|
1031
|
-
color?: string | null;
|
|
1032
|
-
image?: PublicMediaAsset | null;
|
|
1033
|
-
thumbnail?: PublicMediaAsset | null;
|
|
1034
|
-
avatar?: PublicMediaAsset | null;
|
|
1035
|
-
};
|
|
1036
|
-
type PublicCartItem = {
|
|
1037
|
-
id?: string | number;
|
|
1038
|
-
product?: PublicCartReference;
|
|
1039
|
-
variant?: PublicCartReference;
|
|
1040
|
-
quantity?: number | null;
|
|
1041
|
-
unitPrice?: number | null;
|
|
1042
|
-
discountAllocation?: number | null;
|
|
1043
|
-
discountedUnitPrice?: number | null;
|
|
1044
|
-
discountedTotalPrice?: number | null;
|
|
1045
|
-
requiresShipping?: boolean | null;
|
|
1046
|
-
createdAt?: string | null;
|
|
1047
|
-
updatedAt?: string | null;
|
|
1048
|
-
};
|
|
1049
|
-
type PublicCart = {
|
|
1050
|
-
id?: string | number;
|
|
1051
|
-
status?: string | null;
|
|
1052
|
-
currency?: string | null;
|
|
1053
|
-
subtotalAmount?: number | null;
|
|
1054
|
-
shippingAmount?: number | null;
|
|
1055
|
-
discountAmount?: number | null;
|
|
1056
|
-
totalAmount?: number | null;
|
|
1057
|
-
discountCode?: string | null;
|
|
1058
|
-
customerNote?: string | null;
|
|
1059
|
-
lastActivityAt?: string | null;
|
|
1060
|
-
expiresAt?: string | null;
|
|
1061
|
-
createdAt?: string | null;
|
|
1062
|
-
updatedAt?: string | null;
|
|
1063
|
-
shippingAddress?: {
|
|
1064
|
-
recipientName?: string | null;
|
|
1065
|
-
phone?: string | null;
|
|
1066
|
-
postalCode?: string | null;
|
|
1067
|
-
address?: string | null;
|
|
1068
|
-
detailAddress?: string | null;
|
|
1069
|
-
deliveryMessage?: string | null;
|
|
1070
|
-
address1?: string | null;
|
|
1071
|
-
address2?: string | null;
|
|
1072
|
-
jibunAddress?: string | null;
|
|
1073
|
-
administrativeArea?: string | null;
|
|
1074
|
-
city?: string | null;
|
|
1075
|
-
province?: string | null;
|
|
1076
|
-
country?: string | null;
|
|
1077
|
-
deliveryMemo?: string | null;
|
|
1078
|
-
};
|
|
1079
|
-
items?: PublicCartItem[];
|
|
1080
|
-
};
|
|
1081
|
-
/**
|
|
1082
|
-
* Create response: the only place the server returns the `cartToken`. Persist
|
|
1083
|
-
* it (cookie/storage) and pass it as the handle on every later cart call.
|
|
1084
|
-
*/
|
|
1085
|
-
type CreatedCart = PublicCart & {
|
|
1086
|
-
cartToken?: string;
|
|
1087
|
-
};
|
|
1088
|
-
type CartMergeResult = {
|
|
1089
|
-
cart: PublicCart;
|
|
1090
|
-
merged: boolean;
|
|
1091
|
-
claimed: boolean;
|
|
1092
|
-
guestCartId: string | number;
|
|
1093
|
-
customerCartId: string | number;
|
|
1094
|
-
/**
|
|
1095
|
-
* The resolved customer cart's capability handle. Persist it after a merge so
|
|
1096
|
-
* the storefront can keep operating the cart when a union moved lines into a
|
|
1097
|
-
* different cart row. `null` only if the resolved cart has no token.
|
|
1098
|
-
*/
|
|
1099
|
-
cartToken: string | null;
|
|
1100
|
-
};
|
|
1101
|
-
/**
|
|
1102
|
-
* The authenticated customer's active cart resolved by JWT. `cartToken` is the
|
|
1103
|
-
* capability handle returned to the owner; persist it for later token-keyed
|
|
1104
|
-
* mutations. Both fields are `null` when the customer has no active cart.
|
|
1105
|
-
*/
|
|
1106
|
-
type CartMineResult = {
|
|
1107
|
-
cart: PublicCart | null;
|
|
1108
|
-
cartToken: string | null;
|
|
1109
|
-
};
|
|
1110
|
-
declare class CartApi extends CustomerScopedApi {
|
|
1111
|
-
constructor(options: CartApiOptions);
|
|
1112
|
-
private execute;
|
|
1113
|
-
/**
|
|
1114
|
-
* Create a cart and receive its `cartToken`. Store the token and pass it to
|
|
1115
|
-
* every subsequent cart operation.
|
|
1116
|
-
*/
|
|
1117
|
-
createCart(params?: CreateCartParams): Promise<CreatedCart>;
|
|
1118
|
-
getCart(cartToken: string): Promise<PublicCart>;
|
|
1119
|
-
merge(params: CartMergeParams): Promise<CartMergeResult>;
|
|
1120
|
-
/**
|
|
1121
|
-
* Resolve the authenticated customer's active cart by JWT (no `cartToken`
|
|
1122
|
-
* required). Returns the cart and its capability handle, or both `null` when
|
|
1123
|
-
* the customer has no active cart. Requires a customer token.
|
|
1124
|
-
*/
|
|
1125
|
-
mine(): Promise<CartMineResult>;
|
|
1126
|
-
addItem(params: AddItemParams): Promise<PublicCartItem>;
|
|
1127
|
-
updateItem(params: UpdateItemParams): Promise<PublicCartItem>;
|
|
1128
|
-
removeItem(params: RemoveItemParams): Promise<{
|
|
1129
|
-
success: boolean;
|
|
1130
|
-
}>;
|
|
1131
|
-
applyDiscount(params: ApplyDiscountParams): Promise<PublicCart>;
|
|
1132
|
-
removeDiscount(params: RemoveDiscountParams): Promise<PublicCart>;
|
|
1133
|
-
clearCart(params: ClearCartParams): Promise<{
|
|
1134
|
-
success: boolean;
|
|
1135
|
-
}>;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
1131
|
type NormalizedOptionSwatch<TMedia = unknown> = {
|
|
1139
1132
|
type: 'color' | 'media' | null;
|
|
1140
1133
|
color?: string | null;
|
|
@@ -1147,7 +1140,7 @@ type ProductSelectionMediaSource = 'variant_media_selected' | 'variant_media_mat
|
|
|
1147
1140
|
type ProductDisplayMediaSource = 'featured_image' | 'product_pool' | 'none';
|
|
1148
1141
|
/** @deprecated Use {@link ProductSelectionMediaSource} or {@link ProductDisplayMediaSource}. */
|
|
1149
1142
|
type ProductMediaResolutionSource = ProductSelectionMediaSource | ProductDisplayMediaSource;
|
|
1150
|
-
type ProductSelectionVariant<TMedia> = {
|
|
1143
|
+
type ProductSelectionVariant$1<TMedia> = {
|
|
1151
1144
|
id?: string | number | null;
|
|
1152
1145
|
images?: Array<TMedia | string | number | null | undefined> | null;
|
|
1153
1146
|
};
|
|
@@ -1160,8 +1153,8 @@ type ProductSelectionMediaPointer = string | number | {
|
|
|
1160
1153
|
} | null;
|
|
1161
1154
|
type ResolveProductSelectionMediaInput<TMedia> = {
|
|
1162
1155
|
productMediaPool?: TMedia[] | null;
|
|
1163
|
-
selectedVariant?: ProductSelectionVariant<TMedia> | null;
|
|
1164
|
-
matchingVariants?: Array<ProductSelectionVariant<TMedia> | null | undefined> | null;
|
|
1156
|
+
selectedVariant?: ProductSelectionVariant$1<TMedia> | null;
|
|
1157
|
+
matchingVariants?: Array<ProductSelectionVariant$1<TMedia> | null | undefined> | null;
|
|
1165
1158
|
selectedOptionValues?: Array<ProductSelectionOptionValue | null | undefined> | null;
|
|
1166
1159
|
};
|
|
1167
1160
|
type ResolveProductSelectionMediaResult<TMedia> = {
|
|
@@ -1188,6 +1181,9 @@ type FeaturedImagePointerInput<TMedia> = {
|
|
|
1188
1181
|
};
|
|
1189
1182
|
declare function resolveFeaturedImagePointer<TMedia>(input: FeaturedImagePointerInput<TMedia>): string | null;
|
|
1190
1183
|
|
|
1184
|
+
type ProductSelectionDetail = ProductDetail | ProductDetailCatalog;
|
|
1185
|
+
type ProductSelectionVariant = ProductDetailVariant | ProductDetailCatalog['variants'][number];
|
|
1186
|
+
type ProductSelectionVariantForDetail<TDetail extends ProductSelectionDetail> = TDetail extends ProductDetail ? ProductDetailVariant : ProductDetailCatalog['variants'][number];
|
|
1191
1187
|
type EntityID = string;
|
|
1192
1188
|
type RelationshipValue = string | number | null | undefined | {
|
|
1193
1189
|
id?: string | number | null;
|
|
@@ -1224,17 +1220,26 @@ interface ProductVariantShape {
|
|
|
1224
1220
|
optionValues?: unknown[] | null;
|
|
1225
1221
|
price?: number | null;
|
|
1226
1222
|
compareAtPrice?: number | null;
|
|
1223
|
+
resolvedPrice?: {
|
|
1224
|
+
amount: number;
|
|
1225
|
+
compareAtPrice?: number | null;
|
|
1226
|
+
currency?: string | null;
|
|
1227
|
+
marketId?: string | null;
|
|
1228
|
+
source?: 'fixed' | 'computed';
|
|
1229
|
+
};
|
|
1227
1230
|
stock?: number | null;
|
|
1228
1231
|
reservedStock?: number | null;
|
|
1229
1232
|
isUnlimited?: boolean | null;
|
|
1230
1233
|
inventoryPolicy?: ('deny' | 'continue') | null;
|
|
1231
1234
|
isActive?: boolean | null;
|
|
1235
|
+
availableForSale?: boolean | null;
|
|
1232
1236
|
thumbnail?: MediaValue;
|
|
1233
1237
|
images?: MediaValue[] | null;
|
|
1234
1238
|
_order?: string | null;
|
|
1235
1239
|
}
|
|
1236
1240
|
interface ProductListingProductShape {
|
|
1237
1241
|
id?: EntityID;
|
|
1242
|
+
title?: ProductLocalizedText;
|
|
1238
1243
|
images?: MediaValue[] | null;
|
|
1239
1244
|
featuredImage?: MediaValue;
|
|
1240
1245
|
priceRange?: {
|
|
@@ -1334,7 +1339,7 @@ type ProductListingCardRepresentativeVariant = ProductListingCardSourceItem['gro
|
|
|
1334
1339
|
type ProductListingCard = {
|
|
1335
1340
|
id: EntityID;
|
|
1336
1341
|
href: string;
|
|
1337
|
-
title:
|
|
1342
|
+
title: ProductLocalizedText;
|
|
1338
1343
|
representativeVariant?: ProductListingCardRepresentativeVariant | null;
|
|
1339
1344
|
primaryImage: ProductDetailMedia | null;
|
|
1340
1345
|
priceRange: ProductListingCardPriceRange;
|
|
@@ -1377,10 +1382,10 @@ type ProductSelectionCodecOptions = {
|
|
|
1377
1382
|
onLegacyOptionIdParam?: (event: LegacyProductSelectionParamEvent) => void;
|
|
1378
1383
|
};
|
|
1379
1384
|
type ProductSelectionResolutionContext = {
|
|
1380
|
-
detail?: Pick<
|
|
1381
|
-
featuredImage?:
|
|
1382
|
-
images?:
|
|
1383
|
-
selectedOrFirstAvailableVariant?:
|
|
1385
|
+
detail?: Pick<ProductSelectionDetail, 'featuredImage' | 'images' | 'selectedOrFirstAvailableVariant'>;
|
|
1386
|
+
featuredImage?: ProductSelectionDetail['featuredImage'];
|
|
1387
|
+
images?: ProductSelectionDetail['images'];
|
|
1388
|
+
selectedOrFirstAvailableVariant?: ProductSelectionDetail['selectedOrFirstAvailableVariant'];
|
|
1384
1389
|
};
|
|
1385
1390
|
type ProductSelectionAvailableSwatch = {
|
|
1386
1391
|
color?: string | null;
|
|
@@ -1399,11 +1404,11 @@ type ProductSelectionAvailableValue = {
|
|
|
1399
1404
|
availableStock: number | null;
|
|
1400
1405
|
swatch: ProductOptionValueSwatch;
|
|
1401
1406
|
};
|
|
1402
|
-
type ProductSelectionResolution = {
|
|
1407
|
+
type ProductSelectionResolution<TVariant extends ProductVariantShape = ProductSelectionVariant> = {
|
|
1403
1408
|
normalizedSelection: NormalizedProductSelection;
|
|
1404
|
-
selectedVariant:
|
|
1405
|
-
matchingVariants:
|
|
1406
|
-
partialVariants:
|
|
1409
|
+
selectedVariant: TVariant | null;
|
|
1410
|
+
matchingVariants: TVariant[];
|
|
1411
|
+
partialVariants: TVariant[];
|
|
1407
1412
|
availableValuesByOptionSlug: Record<string, ProductSelectionAvailableValue[]>;
|
|
1408
1413
|
availableValuesByOptionId: Record<string, ProductSelectionAvailableValue[]>;
|
|
1409
1414
|
allOptionsSelected: boolean;
|
|
@@ -1435,21 +1440,21 @@ declare function buildProductOptionMatrix<TVariant extends ProductVariantShape =
|
|
|
1435
1440
|
options: ProductOptionShape[];
|
|
1436
1441
|
variants?: TVariant[];
|
|
1437
1442
|
}): ProductOptionMatrix<TVariant>;
|
|
1438
|
-
declare function buildProductOptionMatrixFromDetail(detail:
|
|
1443
|
+
declare function buildProductOptionMatrixFromDetail<TDetail extends ProductSelectionDetail>(detail: TDetail): ProductOptionMatrix<ProductSelectionVariantForDetail<TDetail>>;
|
|
1439
1444
|
declare function getSelectedValueByOptionId<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): Map<string, string>;
|
|
1440
1445
|
declare function normalizeSelectedValueIds<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): string[];
|
|
1441
1446
|
declare function getAvailableOptionValues<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, optionId: string, selectedValueIds: Iterable<unknown>): ProductOptionMatrixValue[];
|
|
1442
1447
|
declare function resolveVariantForSelection<TVariant extends ProductVariantShape = ProductVariantShape>(matrix: ProductOptionMatrix<TVariant>, selectedValueIds: Iterable<unknown>): ProductOptionMatrixVariant<TVariant> | undefined;
|
|
1443
|
-
declare function normalizeProductSelection(detail:
|
|
1444
|
-
declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<
|
|
1445
|
-
declare function parseProductSelection(detail:
|
|
1446
|
-
declare function stringifyProductSelection(detail:
|
|
1447
|
-
declare function createProductSelectionCodec(detail:
|
|
1448
|
+
declare function normalizeProductSelection(detail: ProductSelectionDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1449
|
+
declare function normalizeProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductSelectionVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1450
|
+
declare function parseProductSelection(detail: ProductSelectionDetail, search: string | URLSearchParams | URL | null | undefined, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1451
|
+
declare function stringifyProductSelection(detail: ProductSelectionDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): string;
|
|
1452
|
+
declare function createProductSelectionCodec(detail: ProductSelectionDetail, options?: ProductSelectionCodecOptions): {
|
|
1448
1453
|
parse: (search: string | URLSearchParams | URL | null | undefined) => NormalizedProductSelection;
|
|
1449
1454
|
stringify: (selection?: ProductSelectionInput) => string;
|
|
1450
1455
|
};
|
|
1451
|
-
declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<
|
|
1452
|
-
declare function resolveProductSelection(detail:
|
|
1456
|
+
declare function resolveProductSelectionFromMatrix(matrix: ProductOptionMatrix<ProductSelectionVariant>, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions, context?: ProductSelectionResolutionContext): ProductSelectionResolution;
|
|
1457
|
+
declare function resolveProductSelection<TDetail extends ProductSelectionDetail>(detail: TDetail, selection?: ProductSelectionInput, options?: ProductSelectionCodecOptions): ProductSelectionResolution<ProductSelectionVariantForDetail<TDetail>>;
|
|
1453
1458
|
declare function selectNext(detail: ProductDetail, current: ProductSelectionInput | undefined, optionSlug: string, valueSlug: string, options?: ProductSelectionCodecOptions): NormalizedProductSelection;
|
|
1454
1459
|
type ProductDetailImageMedia = Extract<ProductDetailMedia, {
|
|
1455
1460
|
id?: string | number | null;
|
|
@@ -1474,8 +1479,8 @@ type ProductHrefGroup = {
|
|
|
1474
1479
|
};
|
|
1475
1480
|
type ProductHrefOptions = {
|
|
1476
1481
|
basePath?: string;
|
|
1477
|
-
detail?:
|
|
1478
|
-
matrix?: ProductOptionMatrix<
|
|
1482
|
+
detail?: ProductSelectionDetail;
|
|
1483
|
+
matrix?: ProductOptionMatrix<ProductSelectionVariant>;
|
|
1479
1484
|
selection?: ProductSelectionInput;
|
|
1480
1485
|
trailingSlash?: boolean;
|
|
1481
1486
|
emit?: ProductSelectionUrlEmit;
|
|
@@ -1610,6 +1615,11 @@ type VariantInput = {
|
|
|
1610
1615
|
externalId?: string | null;
|
|
1611
1616
|
isActive?: boolean;
|
|
1612
1617
|
images?: string[];
|
|
1618
|
+
marketPrices?: Array<{
|
|
1619
|
+
market: string;
|
|
1620
|
+
price: number;
|
|
1621
|
+
compareAtPrice?: number | null;
|
|
1622
|
+
}>;
|
|
1613
1623
|
metadata?: unknown;
|
|
1614
1624
|
};
|
|
1615
1625
|
type ProductFieldsInput = {
|
|
@@ -1631,6 +1641,7 @@ type ProductFieldsInput = {
|
|
|
1631
1641
|
publishedAt?: string | null;
|
|
1632
1642
|
categories?: string[];
|
|
1633
1643
|
tags?: string[];
|
|
1644
|
+
markets?: string[] | null;
|
|
1634
1645
|
seo?: {
|
|
1635
1646
|
title?: string | null;
|
|
1636
1647
|
description?: string | null;
|
|
@@ -1679,16 +1690,31 @@ type StockCheckResponse = {
|
|
|
1679
1690
|
};
|
|
1680
1691
|
type ListingGroupsParams = {
|
|
1681
1692
|
productIds: string[];
|
|
1693
|
+
market?: string;
|
|
1694
|
+
locale?: ProductLocaleOption;
|
|
1695
|
+
fallbackLocale?: ProductFallbackLocaleOption;
|
|
1682
1696
|
};
|
|
1683
|
-
type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'stock' | 'isUnlimited' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
|
|
1697
|
+
type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'resolvedPrice' | 'stock' | 'isUnlimited' | 'inventoryPolicy' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
|
|
1684
1698
|
type ProductListingGroupSummary = ProductListingGroup<ProductListingGroupVariant>;
|
|
1685
1699
|
type ProductListingGroupCatalogVariant = Omit<ProductListingGroupVariant, 'stock'>;
|
|
1686
1700
|
type ProductListingGroupCatalogSummary = ProductListingGroup<ProductListingGroupCatalogVariant>;
|
|
1687
1701
|
type ProductListingGroupsProductVariants = NonNullable<PublicProduct['variants']>;
|
|
1688
|
-
type
|
|
1702
|
+
type ProductListingGroupsProductSeo = Omit<NonNullable<PublicProduct['seo']>, 'title' | 'description' | 'openGraph'> & {
|
|
1703
|
+
title?: ProductLocalizedText | null;
|
|
1704
|
+
description?: ProductLocalizedText | null;
|
|
1705
|
+
openGraph?: Omit<NonNullable<NonNullable<PublicProduct['seo']>['openGraph']>, 'title' | 'description'> & {
|
|
1706
|
+
title?: ProductLocalizedText | null;
|
|
1707
|
+
description?: ProductLocalizedText | null;
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
type ProductListingGroupsProduct = Omit<PublicProduct, 'content' | 'createdAt' | 'description' | 'seo' | 'subtitle' | 'title' | 'updatedAt' | 'variants'> & {
|
|
1689
1711
|
id: string;
|
|
1690
1712
|
slug: string;
|
|
1691
|
-
title:
|
|
1713
|
+
title: ProductLocalizedText;
|
|
1714
|
+
subtitle?: ProductLocalizedText | null;
|
|
1715
|
+
description?: ProductLocalizedText | null;
|
|
1716
|
+
content?: ProductLocalizedValue<NonNullable<PublicProduct['content']>> | null;
|
|
1717
|
+
seo?: ProductListingGroupsProductSeo;
|
|
1692
1718
|
createdAt?: PublicProduct['createdAt'];
|
|
1693
1719
|
updatedAt?: PublicProduct['updatedAt'];
|
|
1694
1720
|
featuredImage?: ProductDetailMedia | null;
|
|
@@ -1704,7 +1730,7 @@ type ProductListingGroupsCatalogProduct = {
|
|
|
1704
1730
|
id: string;
|
|
1705
1731
|
slug: string;
|
|
1706
1732
|
handle?: string | null;
|
|
1707
|
-
title:
|
|
1733
|
+
title: ProductLocalizedText;
|
|
1708
1734
|
subtitle?: ProductListingGroupsProduct['subtitle'];
|
|
1709
1735
|
images?: ProductListingGroupsProduct['images'];
|
|
1710
1736
|
featuredImage?: ProductDetailMedia | null;
|
|
@@ -1751,6 +1777,9 @@ type ProductListingPageFilters = {
|
|
|
1751
1777
|
availableForSale?: boolean;
|
|
1752
1778
|
};
|
|
1753
1779
|
type ProductListingPageBaseParams = {
|
|
1780
|
+
market?: string;
|
|
1781
|
+
locale?: ProductLocaleOption;
|
|
1782
|
+
fallbackLocale?: ProductFallbackLocaleOption;
|
|
1754
1783
|
page?: number;
|
|
1755
1784
|
limit?: number;
|
|
1756
1785
|
search?: string;
|
|
@@ -1767,11 +1796,24 @@ type ProductListingPageParams = ProductListingPageCatalogParams | ProductListing
|
|
|
1767
1796
|
type ProductListingPageResult<TItem> = PayloadFindResponse<TItem> & {
|
|
1768
1797
|
cards: ProductListingCard[];
|
|
1769
1798
|
};
|
|
1770
|
-
type
|
|
1799
|
+
type ProductLocaleOption = 'ko' | 'en' | 'all';
|
|
1800
|
+
type ProductFallbackLocaleOption = 'ko' | 'en' | false;
|
|
1801
|
+
type ProductLocaleReadParams = {
|
|
1802
|
+
locale?: ProductLocaleOption;
|
|
1803
|
+
fallbackLocale?: ProductFallbackLocaleOption;
|
|
1804
|
+
};
|
|
1805
|
+
type ProductLocalizedValue<T> = T | {
|
|
1806
|
+
en?: T | null;
|
|
1807
|
+
ko?: T | null;
|
|
1808
|
+
};
|
|
1809
|
+
type ProductLocalizedText = ProductLocalizedValue<string>;
|
|
1810
|
+
type ProductDetailParams = ({
|
|
1771
1811
|
slug: string;
|
|
1772
1812
|
} | {
|
|
1773
1813
|
id: string;
|
|
1774
|
-
}
|
|
1814
|
+
}) & {
|
|
1815
|
+
market?: string;
|
|
1816
|
+
} & ProductLocaleReadParams;
|
|
1775
1817
|
type ProductDetailPreviewParams = {
|
|
1776
1818
|
id: string;
|
|
1777
1819
|
};
|
|
@@ -1804,6 +1846,13 @@ type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
|
1804
1846
|
};
|
|
1805
1847
|
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
1806
1848
|
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
1849
|
+
interface ResolvedCatalogPrice {
|
|
1850
|
+
amount: number;
|
|
1851
|
+
compareAtPrice?: number | null;
|
|
1852
|
+
currency?: string | null;
|
|
1853
|
+
marketId?: string | null;
|
|
1854
|
+
source?: 'fixed' | 'computed';
|
|
1855
|
+
}
|
|
1807
1856
|
interface ProductDetailVariant {
|
|
1808
1857
|
id: string | number;
|
|
1809
1858
|
optionKey: string;
|
|
@@ -1812,6 +1861,7 @@ interface ProductDetailVariant {
|
|
|
1812
1861
|
sku?: string | null;
|
|
1813
1862
|
price: number;
|
|
1814
1863
|
compareAtPrice?: number | null;
|
|
1864
|
+
resolvedPrice?: ResolvedCatalogPrice;
|
|
1815
1865
|
stock: number;
|
|
1816
1866
|
reservedStock: number;
|
|
1817
1867
|
isUnlimited: boolean;
|
|
@@ -1876,7 +1926,9 @@ interface ProductMoneyRange {
|
|
|
1876
1926
|
interface ProductPriceRange extends ProductMoneyRange {
|
|
1877
1927
|
isPriceRange?: boolean | null;
|
|
1878
1928
|
}
|
|
1879
|
-
type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'
|
|
1929
|
+
type ProductDetailCatalogVariant = Omit<ProductDetailVariant, 'stock' | 'reservedStock'> & {
|
|
1930
|
+
availableForSale?: boolean | null;
|
|
1931
|
+
};
|
|
1880
1932
|
interface ProductDetailCatalog {
|
|
1881
1933
|
product: Omit<ProductDetail['product'], 'totalInventory'>;
|
|
1882
1934
|
variants: ProductDetailCatalogVariant[];
|
|
@@ -1915,9 +1967,9 @@ interface ProductDetail {
|
|
|
1915
1967
|
product: {
|
|
1916
1968
|
id: string | number;
|
|
1917
1969
|
slug: string;
|
|
1918
|
-
title:
|
|
1919
|
-
subtitle?:
|
|
1920
|
-
description?:
|
|
1970
|
+
title: ProductLocalizedText;
|
|
1971
|
+
subtitle?: ProductLocalizedText | null;
|
|
1972
|
+
description?: ProductLocalizedText | null;
|
|
1921
1973
|
content?: unknown;
|
|
1922
1974
|
publishedAt?: string | null;
|
|
1923
1975
|
status: string;
|
|
@@ -1959,6 +2011,34 @@ type ProductDetailCatalogResult = {
|
|
|
1959
2011
|
found: false;
|
|
1960
2012
|
reason: ProductDetailUnavailableReason;
|
|
1961
2013
|
};
|
|
2014
|
+
type ProductUpsertVariantOptionValue = string | {
|
|
2015
|
+
valueSlug?: string;
|
|
2016
|
+
valueId?: string;
|
|
2017
|
+
value?: string;
|
|
2018
|
+
};
|
|
2019
|
+
type ProductUpsertVariantInput = {
|
|
2020
|
+
id?: string;
|
|
2021
|
+
optionValues?: Record<string, ProductUpsertVariantOptionValue> | string[];
|
|
2022
|
+
sku?: string | null;
|
|
2023
|
+
title?: string | null;
|
|
2024
|
+
price: number;
|
|
2025
|
+
compareAtPrice?: number | null;
|
|
2026
|
+
stock?: number;
|
|
2027
|
+
isUnlimited?: boolean;
|
|
2028
|
+
inventoryPolicy?: 'deny' | 'continue';
|
|
2029
|
+
weight?: number | null;
|
|
2030
|
+
requiresShipping?: boolean;
|
|
2031
|
+
barcode?: string | null;
|
|
2032
|
+
externalId?: string | null;
|
|
2033
|
+
isActive?: boolean;
|
|
2034
|
+
images?: string[];
|
|
2035
|
+
marketPrices?: Array<{
|
|
2036
|
+
market: string;
|
|
2037
|
+
price: number;
|
|
2038
|
+
compareAtPrice?: number | null;
|
|
2039
|
+
}>;
|
|
2040
|
+
metadata?: unknown;
|
|
2041
|
+
};
|
|
1962
2042
|
type ProductUpsertParams = ProductUpsertInput;
|
|
1963
2043
|
/** Console `POST /api/products/upsert` field allowlist error reasons. */
|
|
1964
2044
|
declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
|
|
@@ -2021,8 +2101,14 @@ type DiscountApiOptions = ServerApiOptions;
|
|
|
2021
2101
|
type ValidateDiscountParams = {
|
|
2022
2102
|
code: string;
|
|
2023
2103
|
orderAmount: number;
|
|
2104
|
+
items?: Array<{
|
|
2105
|
+
product: string | number;
|
|
2106
|
+
totalPrice: number;
|
|
2107
|
+
}>;
|
|
2108
|
+
currency?: string;
|
|
2109
|
+
market?: string;
|
|
2024
2110
|
};
|
|
2025
|
-
type DiscountErrorReasonCode = 'discount_code_not_found' | 'discount_not_started' | 'discount_expired' | 'discount_usage_limit' | 'discount_per_customer_limit' | 'discount_customer_required' | 'discount_first_order_only' | 'discount_customer_not_eligible' | 'discount_customer_excluded' | 'discount_items_required' | 'discount_product_not_eligible' | 'discount_product_excluded' | 'discount_min_order_amount';
|
|
2111
|
+
type DiscountErrorReasonCode = 'discount_code_not_found' | 'discount_not_started' | 'discount_expired' | 'discount_usage_limit' | 'discount_per_customer_limit' | 'discount_customer_required' | 'discount_first_order_only' | 'discount_customer_not_eligible' | 'discount_customer_excluded' | 'discount_items_required' | 'discount_product_not_eligible' | 'discount_product_excluded' | 'discount_min_order_amount' | 'discount_currency_scope_required' | 'discount_allocation_method_unsupported' | 'market_not_found';
|
|
2026
2112
|
type ValidateDiscountResult = {
|
|
2027
2113
|
valid: boolean;
|
|
2028
2114
|
code: string;
|
|
@@ -2039,17 +2125,29 @@ declare class DiscountApi extends BaseApi {
|
|
|
2039
2125
|
|
|
2040
2126
|
type ShippingApiOptions = ServerApiOptions;
|
|
2041
2127
|
type CalculateShippingParams = {
|
|
2042
|
-
shippingPolicyId?: string;
|
|
2128
|
+
shippingPolicyId?: string | number;
|
|
2043
2129
|
orderAmount: number;
|
|
2130
|
+
countryCode?: string;
|
|
2131
|
+
regionCode?: string;
|
|
2044
2132
|
postalCode?: string;
|
|
2045
2133
|
};
|
|
2134
|
+
type ShippingLine = {
|
|
2135
|
+
label: string;
|
|
2136
|
+
lineType: 'base' | 'surcharge' | 'insurance' | 'handling';
|
|
2137
|
+
amount: number;
|
|
2138
|
+
rateId?: string;
|
|
2139
|
+
zoneId?: string;
|
|
2140
|
+
};
|
|
2046
2141
|
type CalculateShippingResult = {
|
|
2047
2142
|
shippingAmount: number;
|
|
2048
2143
|
baseShippingAmount: number;
|
|
2049
2144
|
extraShippingAmount: number;
|
|
2145
|
+
shippingLines: ShippingLine[];
|
|
2050
2146
|
freeShipping: boolean;
|
|
2051
2147
|
freeShippingMinAmount: number | null;
|
|
2148
|
+
/** Prefer shippingLines with zone-scoped rates. */
|
|
2052
2149
|
isJeju: boolean;
|
|
2150
|
+
/** Prefer shippingLines with zone-scoped rates. */
|
|
2053
2151
|
isRemoteIsland: boolean;
|
|
2054
2152
|
};
|
|
2055
2153
|
declare class ShippingApi extends BaseApi {
|
|
@@ -2057,15 +2155,383 @@ declare class ShippingApi extends BaseApi {
|
|
|
2057
2155
|
calculate(params: CalculateShippingParams): Promise<CalculateShippingResult>;
|
|
2058
2156
|
}
|
|
2059
2157
|
|
|
2158
|
+
type CheckoutApiOptions = CustomerScopedApiOptions;
|
|
2159
|
+
type CheckoutStatus = 'open' | 'placed' | 'abandoned';
|
|
2160
|
+
type CustomerSnapshot = {
|
|
2161
|
+
email: string;
|
|
2162
|
+
name?: string;
|
|
2163
|
+
phone?: string;
|
|
2164
|
+
};
|
|
2165
|
+
type CheckoutShippingAddress = {
|
|
2166
|
+
recipientName: string;
|
|
2167
|
+
phone: string;
|
|
2168
|
+
countryCode?: string;
|
|
2169
|
+
regionCode?: string;
|
|
2170
|
+
postalCode: string;
|
|
2171
|
+
address: string;
|
|
2172
|
+
detailAddress: string;
|
|
2173
|
+
deliveryMessage?: string;
|
|
2174
|
+
};
|
|
2175
|
+
type PublicCheckoutItem = {
|
|
2176
|
+
id: string;
|
|
2177
|
+
product: PublicCartReference;
|
|
2178
|
+
variant: PublicCartReference;
|
|
2179
|
+
productTitle: string;
|
|
2180
|
+
variantTitle: string | null;
|
|
2181
|
+
sku: string | null;
|
|
2182
|
+
admissions: PublicCartItemAdmission[];
|
|
2183
|
+
quantity: number;
|
|
2184
|
+
unitPriceMinor: number;
|
|
2185
|
+
discountMinor: number;
|
|
2186
|
+
lineTotalMinor: number;
|
|
2187
|
+
requiresShipping: boolean;
|
|
2188
|
+
};
|
|
2189
|
+
type CheckoutAmounts = {
|
|
2190
|
+
currency: Uppercase<string>;
|
|
2191
|
+
subtotalMinor: number;
|
|
2192
|
+
shippingMinor: number;
|
|
2193
|
+
discountMinor: number;
|
|
2194
|
+
totalMinor: number;
|
|
2195
|
+
};
|
|
2196
|
+
type CheckoutPaymentSessionRef = {
|
|
2197
|
+
id: string;
|
|
2198
|
+
provider: 'toss';
|
|
2199
|
+
providerStatus: 'requires_payment_method' | 'requires_action' | 'requires_confirmation' | 'initializing' | 'processing' | 'authorized' | 'canceling' | 'unknown' | 'captured' | 'failed' | 'canceled';
|
|
2200
|
+
};
|
|
2201
|
+
type OpenCheckoutPaymentState = {
|
|
2202
|
+
activePaymentSession: CheckoutPaymentSessionRef | null;
|
|
2203
|
+
};
|
|
2204
|
+
type SpentCheckoutPaymentState = {
|
|
2205
|
+
activePaymentSession: null;
|
|
2206
|
+
};
|
|
2207
|
+
type PublicCheckoutBase = {
|
|
2208
|
+
id: string;
|
|
2209
|
+
amounts: CheckoutAmounts;
|
|
2210
|
+
items: PublicCheckoutItem[];
|
|
2211
|
+
customerSnapshot: CustomerSnapshot;
|
|
2212
|
+
shippingAddress: CheckoutShippingAddress | null;
|
|
2213
|
+
attributes: PublicAttribute[];
|
|
2214
|
+
expiresAt: string;
|
|
2215
|
+
createdAt: string;
|
|
2216
|
+
updatedAt: string;
|
|
2217
|
+
};
|
|
2218
|
+
type CheckoutOrderReference = {
|
|
2219
|
+
id: string;
|
|
2220
|
+
orderNumber: string;
|
|
2221
|
+
};
|
|
2222
|
+
type CheckoutAbandonedReason = 'expired' | 'customer' | 'operator';
|
|
2223
|
+
type PublicCheckout = PublicCheckoutBase & ({
|
|
2224
|
+
status: 'open';
|
|
2225
|
+
paymentState: OpenCheckoutPaymentState;
|
|
2226
|
+
order: null;
|
|
2227
|
+
placedAt?: never;
|
|
2228
|
+
placedVia?: never;
|
|
2229
|
+
abandonedAt?: never;
|
|
2230
|
+
abandonedReason?: never;
|
|
2231
|
+
} | {
|
|
2232
|
+
status: 'placed';
|
|
2233
|
+
placedAt: string;
|
|
2234
|
+
paymentState: SpentCheckoutPaymentState;
|
|
2235
|
+
order: CheckoutOrderReference;
|
|
2236
|
+
placedVia?: never;
|
|
2237
|
+
abandonedAt?: never;
|
|
2238
|
+
abandonedReason?: never;
|
|
2239
|
+
} | {
|
|
2240
|
+
status: 'placed';
|
|
2241
|
+
placedAt: string;
|
|
2242
|
+
placedVia: 'late_capture';
|
|
2243
|
+
abandonedAt: string;
|
|
2244
|
+
abandonedReason: CheckoutAbandonedReason;
|
|
2245
|
+
paymentState: SpentCheckoutPaymentState;
|
|
2246
|
+
order: CheckoutOrderReference;
|
|
2247
|
+
} | {
|
|
2248
|
+
status: 'abandoned';
|
|
2249
|
+
abandonedAt: string;
|
|
2250
|
+
abandonedReason: CheckoutAbandonedReason;
|
|
2251
|
+
paymentState: {
|
|
2252
|
+
activePaymentSession: null;
|
|
2253
|
+
};
|
|
2254
|
+
order: null;
|
|
2255
|
+
placedAt?: never;
|
|
2256
|
+
placedVia?: never;
|
|
2257
|
+
});
|
|
2258
|
+
type ServerCheckout = PublicCheckout & {
|
|
2259
|
+
clientReferenceId: string | null;
|
|
2260
|
+
integrationMetadata: Record<string, string>;
|
|
2261
|
+
};
|
|
2262
|
+
type RetrieveCheckoutParams = {
|
|
2263
|
+
checkoutToken: string;
|
|
2264
|
+
};
|
|
2265
|
+
type RetrieveServerCheckoutParams = {
|
|
2266
|
+
checkoutId: string;
|
|
2267
|
+
};
|
|
2268
|
+
type CreateCheckoutParams = {
|
|
2269
|
+
cartToken: string;
|
|
2270
|
+
customer: CustomerSnapshot;
|
|
2271
|
+
shippingAddress?: CheckoutShippingAddress;
|
|
2272
|
+
idempotencyKey: string;
|
|
2273
|
+
};
|
|
2274
|
+
type CreateServerCheckoutParams = CreateCheckoutParams & {
|
|
2275
|
+
clientReferenceId?: string;
|
|
2276
|
+
integrationMetadata?: Record<string, string>;
|
|
2277
|
+
};
|
|
2278
|
+
type CreateCheckoutResult = {
|
|
2279
|
+
checkout: PublicCheckout;
|
|
2280
|
+
checkoutToken: string;
|
|
2281
|
+
};
|
|
2282
|
+
type CreateServerCheckoutResult = {
|
|
2283
|
+
checkout: ServerCheckout;
|
|
2284
|
+
checkoutToken: string;
|
|
2285
|
+
};
|
|
2286
|
+
type CheckoutQueryParams = {
|
|
2287
|
+
limit?: number;
|
|
2288
|
+
cursor?: string;
|
|
2289
|
+
status?: CheckoutStatus[];
|
|
2290
|
+
createdAtFrom?: string;
|
|
2291
|
+
createdAtTo?: string;
|
|
2292
|
+
clientReferenceId?: string;
|
|
2293
|
+
};
|
|
2294
|
+
type CheckoutListItem = PublicCheckout extends infer Checkout ? Checkout extends unknown ? Omit<Checkout, 'items' | 'shippingAddress' | 'attributes'> & {
|
|
2295
|
+
clientReferenceId: string | null;
|
|
2296
|
+
} : never : never;
|
|
2297
|
+
type CheckoutQueryResult = {
|
|
2298
|
+
data: CheckoutListItem[];
|
|
2299
|
+
hasMore: boolean;
|
|
2300
|
+
nextCursor: string | null;
|
|
2301
|
+
};
|
|
2302
|
+
declare class CheckoutApi extends CustomerScopedApi {
|
|
2303
|
+
constructor(options: CheckoutApiOptions);
|
|
2304
|
+
private post;
|
|
2305
|
+
private publicCheckout;
|
|
2306
|
+
private serverCheckout;
|
|
2307
|
+
private createResult;
|
|
2308
|
+
private createServerResult;
|
|
2309
|
+
create(params: CreateCheckoutParams): Promise<CreateCheckoutResult>;
|
|
2310
|
+
createServer(params: CreateServerCheckoutParams): Promise<CreateServerCheckoutResult>;
|
|
2311
|
+
retrieve(params: RetrieveCheckoutParams): Promise<PublicCheckout>;
|
|
2312
|
+
retrieveServer(params: RetrieveServerCheckoutParams): Promise<ServerCheckout>;
|
|
2313
|
+
query(params?: CheckoutQueryParams): Promise<CheckoutQueryResult>;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
type PaymentSessionApiOptions = CustomerScopedApiOptions;
|
|
2317
|
+
type Money = {
|
|
2318
|
+
amountMinor: number;
|
|
2319
|
+
currency: Uppercase<string>;
|
|
2320
|
+
};
|
|
2321
|
+
type CreatePaymentSessionParams = {
|
|
2322
|
+
checkoutToken: string;
|
|
2323
|
+
idempotencyKey: string;
|
|
2324
|
+
provider: 'toss';
|
|
2325
|
+
providerOptions: {
|
|
2326
|
+
profile: 'widget_v2';
|
|
2327
|
+
};
|
|
2328
|
+
};
|
|
2329
|
+
type RetrieveBrowserPaymentSessionParams = {
|
|
2330
|
+
paymentSessionId: string;
|
|
2331
|
+
checkoutToken: string;
|
|
2332
|
+
};
|
|
2333
|
+
type RetrieveServerPaymentSessionParams = {
|
|
2334
|
+
paymentSessionId: string;
|
|
2335
|
+
};
|
|
2336
|
+
type CancelBrowserPaymentSessionParams = RetrieveBrowserPaymentSessionParams & {
|
|
2337
|
+
idempotencyKey: string;
|
|
2338
|
+
};
|
|
2339
|
+
type CancelServerPaymentSessionParams = RetrieveServerPaymentSessionParams & {
|
|
2340
|
+
idempotencyKey: string;
|
|
2341
|
+
};
|
|
2342
|
+
type ConfirmTossPaymentSessionParams = {
|
|
2343
|
+
paymentSessionId: string;
|
|
2344
|
+
idempotencyKey: string;
|
|
2345
|
+
action: {
|
|
2346
|
+
type: 'toss_authorization';
|
|
2347
|
+
paymentKey: string;
|
|
2348
|
+
providerOrderId: string;
|
|
2349
|
+
};
|
|
2350
|
+
};
|
|
2351
|
+
type PaymentNextAction = {
|
|
2352
|
+
type: 'toss_widget';
|
|
2353
|
+
clientKey: string;
|
|
2354
|
+
paymentMethodVariantKey: string;
|
|
2355
|
+
agreementVariantKey: string;
|
|
2356
|
+
providerOrderId: string;
|
|
2357
|
+
providerCustomerKey: 'ANONYMOUS' | string;
|
|
2358
|
+
orderName: string;
|
|
2359
|
+
customerName?: string;
|
|
2360
|
+
customerEmail?: string;
|
|
2361
|
+
};
|
|
2362
|
+
type PaymentSessionRole = 'active' | 'canonical_candidate' | 'canonical' | 'residual' | 'historical';
|
|
2363
|
+
type PaymentProviderStatus = 'requires_payment_method' | 'requires_action' | 'requires_confirmation' | 'initializing' | 'processing' | 'authorized' | 'canceling' | 'unknown' | 'captured' | 'failed' | 'canceled';
|
|
2364
|
+
type PaymentReconciliationReason = 'provider_outcome_unknown' | 'local_commit_ambiguous' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture_pending_order' | 'inventory_unavailable' | 'admission_unavailable' | 'excess_capture' | 'late_capture' | 'cross_checkout_duplicate';
|
|
2365
|
+
type PaymentFailureReason = 'payment_declined' | 'authentication_failed' | 'authorization_expired' | 'payment_method_unavailable' | 'provider_terminal_failure' | 'unknown_provider_terminal_failure';
|
|
2366
|
+
type PublicCaptureEvidence = {
|
|
2367
|
+
amountMinor: number;
|
|
2368
|
+
currency: Uppercase<string>;
|
|
2369
|
+
observedAt: string;
|
|
2370
|
+
};
|
|
2371
|
+
type ReconciliationRequired<Reason extends string> = {
|
|
2372
|
+
status: 'required';
|
|
2373
|
+
reasons: readonly [Reason, ...Reason[]];
|
|
2374
|
+
};
|
|
2375
|
+
type PublicPaymentSessionBase = {
|
|
2376
|
+
id: string;
|
|
2377
|
+
money: Money;
|
|
2378
|
+
expiresAt: string | null;
|
|
2379
|
+
sessionRole: PaymentSessionRole;
|
|
2380
|
+
};
|
|
2381
|
+
type PublicPaymentSessionState<Action extends PaymentNextAction> = ({
|
|
2382
|
+
providerStatus: 'requires_payment_method' | 'requires_action';
|
|
2383
|
+
finalizationStatus: 'not_ready';
|
|
2384
|
+
reconciliation: {
|
|
2385
|
+
status: 'none';
|
|
2386
|
+
};
|
|
2387
|
+
order: null;
|
|
2388
|
+
} & ({
|
|
2389
|
+
sessionRole: 'active';
|
|
2390
|
+
presentationStatus: 'actionable';
|
|
2391
|
+
nextAction: Action;
|
|
2392
|
+
} | {
|
|
2393
|
+
sessionRole: 'residual';
|
|
2394
|
+
presentationStatus: 'suppressed';
|
|
2395
|
+
nextAction?: never;
|
|
2396
|
+
})) | {
|
|
2397
|
+
providerStatus: 'requires_confirmation';
|
|
2398
|
+
sessionRole: 'active' | 'residual';
|
|
2399
|
+
presentationStatus: 'suppressed';
|
|
2400
|
+
finalizationStatus: 'not_ready';
|
|
2401
|
+
nextAction?: never;
|
|
2402
|
+
reconciliation: {
|
|
2403
|
+
status: 'none';
|
|
2404
|
+
};
|
|
2405
|
+
order: null;
|
|
2406
|
+
} | {
|
|
2407
|
+
providerStatus: 'initializing' | 'processing' | 'authorized';
|
|
2408
|
+
sessionRole: 'active' | 'residual';
|
|
2409
|
+
presentationStatus: 'suppressed';
|
|
2410
|
+
finalizationStatus: 'not_ready';
|
|
2411
|
+
nextAction?: never;
|
|
2412
|
+
reconciliation: {
|
|
2413
|
+
status: 'none';
|
|
2414
|
+
};
|
|
2415
|
+
order: null;
|
|
2416
|
+
} | {
|
|
2417
|
+
providerStatus: 'canceling';
|
|
2418
|
+
sessionRole: 'active' | 'residual';
|
|
2419
|
+
presentationStatus: 'suppressed';
|
|
2420
|
+
finalizationStatus: 'not_ready';
|
|
2421
|
+
nextAction?: never;
|
|
2422
|
+
reconciliation: {
|
|
2423
|
+
status: 'none';
|
|
2424
|
+
};
|
|
2425
|
+
order: null;
|
|
2426
|
+
} | {
|
|
2427
|
+
providerStatus: 'unknown';
|
|
2428
|
+
sessionRole: 'active' | 'residual';
|
|
2429
|
+
presentationStatus: 'suppressed';
|
|
2430
|
+
finalizationStatus: 'not_ready';
|
|
2431
|
+
nextAction?: never;
|
|
2432
|
+
reconciliation: ReconciliationRequired<'provider_outcome_unknown'>;
|
|
2433
|
+
order: null;
|
|
2434
|
+
} | {
|
|
2435
|
+
providerStatus: 'captured';
|
|
2436
|
+
sessionRole: 'canonical_candidate' | 'residual';
|
|
2437
|
+
presentationStatus: 'suppressed';
|
|
2438
|
+
finalizationStatus: 'pending';
|
|
2439
|
+
nextAction?: never;
|
|
2440
|
+
reconciliation: {
|
|
2441
|
+
status: 'none';
|
|
2442
|
+
};
|
|
2443
|
+
providerEvidence: PublicCaptureEvidence;
|
|
2444
|
+
order: null;
|
|
2445
|
+
} | {
|
|
2446
|
+
providerStatus: 'captured';
|
|
2447
|
+
sessionRole: 'canonical' | 'historical';
|
|
2448
|
+
presentationStatus: 'suppressed';
|
|
2449
|
+
finalizationStatus: 'committed';
|
|
2450
|
+
nextAction?: never;
|
|
2451
|
+
reconciliation: {
|
|
2452
|
+
status: 'none';
|
|
2453
|
+
};
|
|
2454
|
+
providerEvidence: PublicCaptureEvidence;
|
|
2455
|
+
order: {
|
|
2456
|
+
id: string;
|
|
2457
|
+
orderNumber: string;
|
|
2458
|
+
};
|
|
2459
|
+
} | {
|
|
2460
|
+
providerStatus: 'captured';
|
|
2461
|
+
sessionRole: 'canonical_candidate' | 'residual';
|
|
2462
|
+
presentationStatus: 'suppressed';
|
|
2463
|
+
finalizationStatus: 'pending';
|
|
2464
|
+
nextAction?: never;
|
|
2465
|
+
reconciliation: ReconciliationRequired<'local_commit_ambiguous' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture_pending_order'>;
|
|
2466
|
+
providerEvidence: PublicCaptureEvidence;
|
|
2467
|
+
order: null;
|
|
2468
|
+
} | {
|
|
2469
|
+
providerStatus: 'captured';
|
|
2470
|
+
sessionRole: 'canonical' | 'residual';
|
|
2471
|
+
presentationStatus: 'suppressed';
|
|
2472
|
+
finalizationStatus: 'committed';
|
|
2473
|
+
nextAction?: never;
|
|
2474
|
+
reconciliation: ReconciliationRequired<'inventory_unavailable' | 'admission_unavailable' | 'amount_mismatch' | 'currency_mismatch' | 'excess_capture' | 'late_capture' | 'cross_checkout_duplicate'>;
|
|
2475
|
+
providerEvidence: PublicCaptureEvidence;
|
|
2476
|
+
order: {
|
|
2477
|
+
id: string;
|
|
2478
|
+
orderNumber: string;
|
|
2479
|
+
};
|
|
2480
|
+
} | {
|
|
2481
|
+
providerStatus: 'failed';
|
|
2482
|
+
sessionRole: 'historical';
|
|
2483
|
+
presentationStatus: 'suppressed';
|
|
2484
|
+
finalizationStatus: 'not_ready';
|
|
2485
|
+
nextAction?: never;
|
|
2486
|
+
providerEvidence?: never;
|
|
2487
|
+
cancellationReason?: never;
|
|
2488
|
+
reconciliation: {
|
|
2489
|
+
status: 'none';
|
|
2490
|
+
};
|
|
2491
|
+
failure: {
|
|
2492
|
+
reason: PaymentFailureReason;
|
|
2493
|
+
message?: string;
|
|
2494
|
+
};
|
|
2495
|
+
order: null;
|
|
2496
|
+
} | {
|
|
2497
|
+
providerStatus: 'canceled';
|
|
2498
|
+
sessionRole: 'historical';
|
|
2499
|
+
presentationStatus: 'suppressed';
|
|
2500
|
+
finalizationStatus: 'not_ready';
|
|
2501
|
+
nextAction?: never;
|
|
2502
|
+
providerEvidence?: never;
|
|
2503
|
+
failure?: never;
|
|
2504
|
+
cancellationReason: 'expired' | 'customer' | 'operator' | 'provider';
|
|
2505
|
+
reconciliation: {
|
|
2506
|
+
status: 'none';
|
|
2507
|
+
};
|
|
2508
|
+
order: null;
|
|
2509
|
+
};
|
|
2510
|
+
type PublicPaymentSession = PublicPaymentSessionBase & {
|
|
2511
|
+
provider: 'toss';
|
|
2512
|
+
} & PublicPaymentSessionState<PaymentNextAction>;
|
|
2513
|
+
declare class PaymentSessionApi extends CustomerScopedApi {
|
|
2514
|
+
private readonly serverTransport;
|
|
2515
|
+
constructor(options: PaymentSessionApiOptions);
|
|
2516
|
+
private post;
|
|
2517
|
+
private paymentSession;
|
|
2518
|
+
create(params: CreatePaymentSessionParams): Promise<PublicPaymentSession>;
|
|
2519
|
+
retrieve(params: RetrieveBrowserPaymentSessionParams | RetrieveServerPaymentSessionParams): Promise<PublicPaymentSession>;
|
|
2520
|
+
cancel(params: CancelBrowserPaymentSessionParams | CancelServerPaymentSessionParams): Promise<PublicPaymentSession>;
|
|
2521
|
+
confirm(params: ConfirmTossPaymentSessionParams): Promise<PublicPaymentSession>;
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2060
2524
|
interface CommerceClientOptions {
|
|
2061
2525
|
publishableKey: string;
|
|
2062
2526
|
apiUrl?: string;
|
|
2527
|
+
market?: string;
|
|
2063
2528
|
customerToken: () => string | null;
|
|
2064
2529
|
onUnauthorized?: () => Promise<string | null>;
|
|
2065
2530
|
onRequestId?: (id: string | null) => void;
|
|
2066
2531
|
customerAuth: CustomerAuth;
|
|
2067
2532
|
}
|
|
2068
2533
|
declare class CommerceClient {
|
|
2534
|
+
private readonly market?;
|
|
2069
2535
|
readonly product: {
|
|
2070
2536
|
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
2071
2537
|
stockSnapshot: (params: StockSnapshotParams) => Promise<StockSnapshotResponse>;
|
|
@@ -2074,22 +2540,18 @@ declare class CommerceClient {
|
|
|
2074
2540
|
listingPage: {
|
|
2075
2541
|
(params?: ProductListingPageCatalogParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem>>;
|
|
2076
2542
|
};
|
|
2077
|
-
detail: (params: ProductDetailParams) => Promise<
|
|
2543
|
+
detail: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
2078
2544
|
detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
2079
2545
|
};
|
|
2080
|
-
readonly
|
|
2081
|
-
create: (params?: CreateCartParams) => Promise<
|
|
2082
|
-
|
|
2083
|
-
addItem: (params: AddItemParams) => Promise<
|
|
2084
|
-
updateItem: (params: UpdateItemParams) => Promise<
|
|
2085
|
-
removeItem: (params: RemoveItemParams) => Promise<
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
removeDiscount: (params: RemoveDiscountParams) => Promise<PublicCart>;
|
|
2090
|
-
clear: (params: ClearCartParams) => Promise<{
|
|
2091
|
-
success: boolean;
|
|
2092
|
-
}>;
|
|
2546
|
+
readonly carts: {
|
|
2547
|
+
create: (params?: CreateCartParams) => Promise<CreateCartResult>;
|
|
2548
|
+
retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
|
|
2549
|
+
addItem: (params: AddItemParams) => Promise<CartMutationResult>;
|
|
2550
|
+
updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
|
|
2551
|
+
removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
|
|
2552
|
+
updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
|
|
2553
|
+
updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
|
|
2554
|
+
clear: (params: ClearCartParams) => Promise<CartMutationResult>;
|
|
2093
2555
|
/**
|
|
2094
2556
|
* Union/claim a pre-login guest cart into the authenticated customer's cart
|
|
2095
2557
|
* (customer JWT required). Returns the resolved customer cart's `cartToken`
|
|
@@ -2103,9 +2565,17 @@ declare class CommerceClient {
|
|
|
2103
2565
|
mine: () => Promise<CartMineResult>;
|
|
2104
2566
|
};
|
|
2105
2567
|
readonly orders: {
|
|
2106
|
-
checkout: (params: CheckoutParams) => Promise<PublicOrder>;
|
|
2107
2568
|
listMine: (options?: CustomerOrderListOptions) => Promise<PayloadFindResponse<PublicOrder>>;
|
|
2108
2569
|
};
|
|
2570
|
+
readonly checkouts: {
|
|
2571
|
+
create: (params: CreateCheckoutParams) => Promise<CreateCheckoutResult>;
|
|
2572
|
+
retrieve: (params: RetrieveCheckoutParams) => Promise<PublicCheckout>;
|
|
2573
|
+
};
|
|
2574
|
+
readonly paymentSessions: {
|
|
2575
|
+
create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2576
|
+
retrieve: (params: RetrieveBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2577
|
+
cancel: (params: CancelBrowserPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2578
|
+
};
|
|
2109
2579
|
readonly discounts: {
|
|
2110
2580
|
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
2111
2581
|
};
|
|
@@ -2113,6 +2583,8 @@ declare class CommerceClient {
|
|
|
2113
2583
|
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
2114
2584
|
};
|
|
2115
2585
|
constructor(options: CommerceClientOptions);
|
|
2586
|
+
getDefaultMarket(): string | undefined;
|
|
2587
|
+
private withMarket;
|
|
2116
2588
|
}
|
|
2117
2589
|
|
|
2118
2590
|
type StorefrontContentReference = {
|
|
@@ -2198,9 +2670,11 @@ interface ServerCommerceClientOptions {
|
|
|
2198
2670
|
publishableKey?: string;
|
|
2199
2671
|
secretKey: string;
|
|
2200
2672
|
apiUrl?: string;
|
|
2673
|
+
market?: string;
|
|
2201
2674
|
onRequestId?: (id: string | null) => void;
|
|
2202
2675
|
}
|
|
2203
2676
|
declare class ServerCommerceClient {
|
|
2677
|
+
private readonly market?;
|
|
2204
2678
|
readonly product: {
|
|
2205
2679
|
stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
|
|
2206
2680
|
listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
|
|
@@ -2210,37 +2684,24 @@ declare class ServerCommerceClient {
|
|
|
2210
2684
|
(params: ProductListingPageParams): Promise<ProductListingPageResult<ProductListingGroupsCatalogItem> | ProductListingPageResult<ProductListingGroupsItem>>;
|
|
2211
2685
|
};
|
|
2212
2686
|
detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
|
|
2687
|
+
detailCatalog: (params: ProductDetailParams) => Promise<ProductDetailCatalogResult>;
|
|
2213
2688
|
previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
|
|
2214
2689
|
upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
|
|
2215
2690
|
};
|
|
2216
|
-
readonly
|
|
2217
|
-
create: (params?: CreateCartParams) => Promise<
|
|
2218
|
-
|
|
2219
|
-
addItem: (params: AddItemParams) => Promise<
|
|
2220
|
-
updateItem: (params: UpdateItemParams) => Promise<
|
|
2221
|
-
removeItem: (params: RemoveItemParams) => Promise<
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
success: boolean;
|
|
2228
|
-
}>;
|
|
2229
|
-
/**
|
|
2230
|
-
* Union/claim a guest cart into a customer's cart. Customer-bound resolution
|
|
2231
|
-
* requires a customer JWT; a secret-key caller has no customer session.
|
|
2232
|
-
*/
|
|
2233
|
-
merge: (params: CartMergeParams) => Promise<CartMergeResult>;
|
|
2234
|
-
/** Load the authenticated customer's active cart by JWT. */
|
|
2235
|
-
mine: () => Promise<CartMineResult>;
|
|
2691
|
+
readonly carts: {
|
|
2692
|
+
create: (params?: CreateCartParams) => Promise<CreateCartResult>;
|
|
2693
|
+
retrieve: (params: RetrieveCartParams) => Promise<PublicCart>;
|
|
2694
|
+
addItem: (params: AddItemParams) => Promise<CartMutationResult>;
|
|
2695
|
+
updateItem: (params: UpdateItemParams) => Promise<CartMutationResult>;
|
|
2696
|
+
removeItem: (params: RemoveItemParams) => Promise<CartMutationResult>;
|
|
2697
|
+
updateDiscountCodes: (params: UpdateDiscountCodesParams) => Promise<CartMutationResult>;
|
|
2698
|
+
updateAttributes: (params: UpdateCartAttributesParams) => Promise<CartMutationResult>;
|
|
2699
|
+
clear: (params: ClearCartParams) => Promise<CartMutationResult>;
|
|
2700
|
+
merge: (params: ServerCartMergeParams) => Promise<CartMergeResult>;
|
|
2701
|
+
mine: (params: ServerCartMineParams) => Promise<CartMineResult>;
|
|
2236
2702
|
};
|
|
2237
2703
|
readonly orders: {
|
|
2238
|
-
checkout: (params: CheckoutParams) => Promise<PublicOrder>;
|
|
2239
|
-
create: (params: CreateOrderParams) => Promise<Order>;
|
|
2240
2704
|
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
2241
|
-
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
2242
|
-
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
2243
|
-
confirmPaymentReturningOrder: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentWithOrderResult>;
|
|
2244
2705
|
getByPaymentId: (params: GetOrderByPaymentIdParams) => Promise<OrderByPaymentResult>;
|
|
2245
2706
|
cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
|
|
2246
2707
|
resolveCancelRefund: (params: ResolveCancelRefundParams) => Promise<ResolveCancelRefundResponse>;
|
|
@@ -2255,6 +2716,17 @@ declare class ServerCommerceClient {
|
|
|
2255
2716
|
transaction: Transaction | null;
|
|
2256
2717
|
}>;
|
|
2257
2718
|
};
|
|
2719
|
+
readonly checkouts: {
|
|
2720
|
+
create: (params: CreateServerCheckoutParams) => Promise<CreateServerCheckoutResult>;
|
|
2721
|
+
retrieve: (params: RetrieveServerCheckoutParams) => Promise<ServerCheckout>;
|
|
2722
|
+
query: (params?: CheckoutQueryParams) => Promise<CheckoutQueryResult>;
|
|
2723
|
+
};
|
|
2724
|
+
readonly paymentSessions: {
|
|
2725
|
+
create: (params: CreatePaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2726
|
+
retrieve: (params: RetrieveServerPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2727
|
+
cancel: (params: CancelServerPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2728
|
+
confirm: (params: ConfirmTossPaymentSessionParams) => Promise<PublicPaymentSession>;
|
|
2729
|
+
};
|
|
2258
2730
|
readonly discounts: {
|
|
2259
2731
|
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
2260
2732
|
};
|
|
@@ -2262,6 +2734,8 @@ declare class ServerCommerceClient {
|
|
|
2262
2734
|
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
2263
2735
|
};
|
|
2264
2736
|
constructor(options: ServerCommerceClientOptions);
|
|
2737
|
+
getDefaultMarket(): string | undefined;
|
|
2738
|
+
private withMarket;
|
|
2265
2739
|
}
|
|
2266
2740
|
|
|
2267
2741
|
/**
|
|
@@ -2270,6 +2744,7 @@ declare class ServerCommerceClient {
|
|
|
2270
2744
|
*/
|
|
2271
2745
|
declare class CustomerNamespace {
|
|
2272
2746
|
readonly auth: CustomerAuth;
|
|
2747
|
+
readonly oauth?: CustomerOAuth;
|
|
2273
2748
|
constructor(publishableKey: string, options?: CustomerAuthOptions, apiUrl?: string);
|
|
2274
2749
|
}
|
|
2275
2750
|
|
|
@@ -2371,6 +2846,33 @@ interface EventsRangeResponse {
|
|
|
2371
2846
|
hasNextPage: boolean;
|
|
2372
2847
|
hasPrevPage: boolean;
|
|
2373
2848
|
}
|
|
2849
|
+
interface EventAdmissionAvailabilityParams {
|
|
2850
|
+
occurrence: string;
|
|
2851
|
+
}
|
|
2852
|
+
interface EventAdmissionPricePresentment {
|
|
2853
|
+
amount: number;
|
|
2854
|
+
compareAtPrice: number | null;
|
|
2855
|
+
currency: string | null;
|
|
2856
|
+
marketId: string | null;
|
|
2857
|
+
}
|
|
2858
|
+
interface EventAdmissionAvailabilityType {
|
|
2859
|
+
id: string | number;
|
|
2860
|
+
label?: string | null;
|
|
2861
|
+
description?: string | null;
|
|
2862
|
+
eventId: string | number;
|
|
2863
|
+
occurrenceId: string | number;
|
|
2864
|
+
productId: string | number | null;
|
|
2865
|
+
variantId: string | number | null;
|
|
2866
|
+
price: EventAdmissionPricePresentment | null;
|
|
2867
|
+
remainingCapacityHint: number | null;
|
|
2868
|
+
available: boolean;
|
|
2869
|
+
}
|
|
2870
|
+
interface EventAdmissionAvailabilityResponse {
|
|
2871
|
+
occurrenceId: string | number;
|
|
2872
|
+
eventId: string | number;
|
|
2873
|
+
remainingCapacityHint: number | null;
|
|
2874
|
+
admissionTypes: EventAdmissionAvailabilityType[];
|
|
2875
|
+
}
|
|
2374
2876
|
interface EventRegistrationAttendeeInput {
|
|
2375
2877
|
name?: string;
|
|
2376
2878
|
email?: string;
|
|
@@ -2427,13 +2929,81 @@ declare class EventsClient {
|
|
|
2427
2929
|
private readonly onRequestId?;
|
|
2428
2930
|
constructor(options: EventsClientOptions);
|
|
2429
2931
|
getRange(params: EventsRangeParams): Promise<EventsRangeResponse>;
|
|
2932
|
+
getAdmissionAvailability(params: EventAdmissionAvailabilityParams): Promise<EventAdmissionAvailabilityResponse>;
|
|
2430
2933
|
register(params: EventRegistrationRegisterParams): Promise<EventRegistrationRegisterResponse>;
|
|
2431
2934
|
getGuestRegistration(token: string): Promise<EventGuestRegistrationResponse>;
|
|
2432
2935
|
cancelGuestRegistration(token: string, params?: EventGuestCancelParams): Promise<EventGuestRegistrationResponse>;
|
|
2433
2936
|
private execute;
|
|
2434
2937
|
}
|
|
2435
2938
|
|
|
2939
|
+
/**
|
|
2940
|
+
* Client-safe market discovery shape (Shopify-like). Structural copy of the
|
|
2941
|
+
* private contracts package's `PublicMarketDTO` — the public SDK must not import
|
|
2942
|
+
* private contracts, so a parity `test-d` keeps the two in lockstep. The
|
|
2943
|
+
* `toMarketDTO` return annotation ties this shape back to the real `PublicMarket`
|
|
2944
|
+
* row (which the parity test alone cannot check).
|
|
2945
|
+
*/
|
|
2946
|
+
type MarketDTO = {
|
|
2947
|
+
id: string;
|
|
2948
|
+
handle: string;
|
|
2949
|
+
name: string;
|
|
2950
|
+
countryCode: string;
|
|
2951
|
+
targetCountries: string[];
|
|
2952
|
+
currency: string;
|
|
2953
|
+
isPrimary: boolean;
|
|
2954
|
+
isActive: boolean;
|
|
2955
|
+
};
|
|
2956
|
+
/**
|
|
2957
|
+
* Minimal reader the discovery helper depends on: the shape of
|
|
2958
|
+
* `collections.from('markets').find`. Kept narrow so the helper is
|
|
2959
|
+
* transport-agnostic and unit-testable against a mock.
|
|
2960
|
+
*/
|
|
2961
|
+
type MarketRowReader = (options: {
|
|
2962
|
+
where: Where;
|
|
2963
|
+
limit: number;
|
|
2964
|
+
}) => Promise<PayloadFindResponse<PublicMarket>>;
|
|
2965
|
+
interface MarketDiscoveryClient {
|
|
2966
|
+
/** List the tenant's active buyer markets. */
|
|
2967
|
+
list(): Promise<MarketDTO[]>;
|
|
2968
|
+
/** Resolve the tenant's default (active primary) market, or `null`. */
|
|
2969
|
+
default(): Promise<MarketDTO | null>;
|
|
2970
|
+
}
|
|
2971
|
+
/** Read-side helper for public market discovery. */
|
|
2972
|
+
declare class MarketDiscovery implements MarketDiscoveryClient {
|
|
2973
|
+
private readonly read;
|
|
2974
|
+
constructor(read: MarketRowReader);
|
|
2975
|
+
list(): Promise<MarketDTO[]>;
|
|
2976
|
+
default(): Promise<MarketDTO | null>;
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2436
2979
|
type TenantIntrospectionApiOptions = ServerApiOptions;
|
|
2980
|
+
interface TenantContextInput {
|
|
2981
|
+
includeCounts?: boolean;
|
|
2982
|
+
}
|
|
2983
|
+
interface TenantFieldConfigState {
|
|
2984
|
+
hiddenFields: string[];
|
|
2985
|
+
isHidden: boolean;
|
|
2986
|
+
}
|
|
2987
|
+
interface TenantContextResponse {
|
|
2988
|
+
tenant: {
|
|
2989
|
+
id: string;
|
|
2990
|
+
name: string;
|
|
2991
|
+
plan: string;
|
|
2992
|
+
planSource?: string;
|
|
2993
|
+
authoritative?: boolean;
|
|
2994
|
+
capabilityVersion?: string;
|
|
2995
|
+
};
|
|
2996
|
+
features: string[];
|
|
2997
|
+
collections: {
|
|
2998
|
+
active: string[];
|
|
2999
|
+
inactive: string[];
|
|
3000
|
+
};
|
|
3001
|
+
fieldConfigs: Record<string, TenantFieldConfigState>;
|
|
3002
|
+
counts?: Record<string, number>;
|
|
3003
|
+
config?: {
|
|
3004
|
+
webhookConfigured: boolean;
|
|
3005
|
+
};
|
|
3006
|
+
}
|
|
2437
3007
|
type TenantFeatureProgressFeature = 'ecommerce';
|
|
2438
3008
|
interface TenantFeatureProgressInput {
|
|
2439
3009
|
feature: TenantFeatureProgressFeature;
|
|
@@ -2518,11 +3088,13 @@ interface CollectionSchemaResponse {
|
|
|
2518
3088
|
};
|
|
2519
3089
|
}
|
|
2520
3090
|
interface TenantIntrospectionClient {
|
|
3091
|
+
context: (params?: TenantContextInput) => Promise<TenantContextResponse>;
|
|
2521
3092
|
collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
|
|
2522
3093
|
featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
|
|
2523
3094
|
}
|
|
2524
|
-
declare class TenantIntrospectionApi extends
|
|
3095
|
+
declare class TenantIntrospectionApi extends RawBaseApi implements TenantIntrospectionClient {
|
|
2525
3096
|
constructor(options: TenantIntrospectionApiOptions);
|
|
3097
|
+
context(params?: TenantContextInput): Promise<TenantContextResponse>;
|
|
2526
3098
|
collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
|
|
2527
3099
|
featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
|
|
2528
3100
|
}
|
|
@@ -2531,23 +3103,27 @@ declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospect
|
|
|
2531
3103
|
* SDK-local hand-declarations of the membership wire contract types.
|
|
2532
3104
|
*
|
|
2533
3105
|
* The public SDK must keep these types local because the canonical membership
|
|
2534
|
-
* contract package is private to the workspace
|
|
2535
|
-
* structurally checked by membership
|
|
3106
|
+
* contract package is private to the workspace and must not be imported at
|
|
3107
|
+
* runtime. These public types are structurally checked by membership
|
|
3108
|
+
* contract-parity type tests.
|
|
2536
3109
|
*/
|
|
2537
3110
|
type MembershipStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'cancelled' | 'expired';
|
|
2538
3111
|
/**
|
|
2539
3112
|
* Parameters for the subscribe endpoint (delegated charge model).
|
|
2540
|
-
* The storefront already collected the first payment
|
|
2541
|
-
* activates the membership.
|
|
3113
|
+
* The storefront already collected the first payment for non-trial plans; this
|
|
3114
|
+
* records it and activates the membership. Trial starts omit pgPaymentId until
|
|
3115
|
+
* the renewal cron sends the first delegated charge.
|
|
2542
3116
|
*/
|
|
2543
3117
|
type SubscribeMembershipParams = {
|
|
2544
3118
|
planId: string;
|
|
3119
|
+
priceId: string;
|
|
2545
3120
|
/** Stable client-generated key used as the deduplication key for this subscription intent. */
|
|
2546
3121
|
subscribeIntentKey: string;
|
|
2547
|
-
pgPaymentId
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
3122
|
+
pgPaymentId?: string;
|
|
3123
|
+
/** Internal Console customer document id. */
|
|
3124
|
+
customerId: string;
|
|
3125
|
+
/** Delegated payment provider customer reference. */
|
|
3126
|
+
customerRef: string;
|
|
2551
3127
|
card?: {
|
|
2552
3128
|
last4?: string;
|
|
2553
3129
|
brand?: string;
|
|
@@ -2559,8 +3135,9 @@ type SubscribeMembershipResponse = {
|
|
|
2559
3135
|
};
|
|
2560
3136
|
/**
|
|
2561
3137
|
* Parameters for cancelling a membership.
|
|
2562
|
-
* `immediate
|
|
2563
|
-
* the last paid period
|
|
3138
|
+
* Default (omit `immediate` or pass `false`) sets `cancelAtPeriodEnd`; benefits
|
|
3139
|
+
* persist until the last paid period end and renewals stop. Pass
|
|
3140
|
+
* `immediate=true` to cancel immediately and revoke groups now.
|
|
2564
3141
|
*/
|
|
2565
3142
|
type CancelMembershipParams = {
|
|
2566
3143
|
id: string;
|
|
@@ -2576,12 +3153,15 @@ type CancelMembershipResponse = {
|
|
|
2576
3153
|
type CustomerMembershipView = {
|
|
2577
3154
|
id: string;
|
|
2578
3155
|
plan: string;
|
|
3156
|
+
price: string;
|
|
2579
3157
|
status: MembershipStatus;
|
|
2580
3158
|
currentPeriodEnd: string;
|
|
2581
3159
|
nextBillingAt: string | null;
|
|
2582
3160
|
cancelAtPeriodEnd: boolean;
|
|
2583
3161
|
amount: number;
|
|
2584
3162
|
currency: string;
|
|
3163
|
+
billingInterval: 'month' | 'year';
|
|
3164
|
+
intervalCount: number;
|
|
2585
3165
|
card?: {
|
|
2586
3166
|
last4?: string;
|
|
2587
3167
|
brand?: string;
|
|
@@ -2592,26 +3172,16 @@ interface ClientConfig {
|
|
|
2592
3172
|
publishableKey: string;
|
|
2593
3173
|
/** API base URL for staging, self-hosted, preview, or proxy deployments. */
|
|
2594
3174
|
apiUrl?: string;
|
|
3175
|
+
/**
|
|
3176
|
+
* Default commerce market handle/id. Applied to market-aware product and cart
|
|
3177
|
+
* helpers when the individual call does not provide `market`.
|
|
3178
|
+
*/
|
|
3179
|
+
market?: string;
|
|
2595
3180
|
/**
|
|
2596
3181
|
* Customer authentication options.
|
|
2597
3182
|
* Used to initialize CustomerAuth on Client.
|
|
2598
3183
|
*/
|
|
2599
|
-
customer?:
|
|
2600
|
-
/**
|
|
2601
|
-
* Persist token in localStorage. Defaults to `true`.
|
|
2602
|
-
* - `true` (default): uses key `'customer-token'`
|
|
2603
|
-
* - `string`: uses the given string as localStorage key
|
|
2604
|
-
* - `false`: disables persistence (token/onTokenChange used instead)
|
|
2605
|
-
*
|
|
2606
|
-
* Handles SSR safely (no-op on server).
|
|
2607
|
-
* When enabled, `token` and `onTokenChange` are ignored.
|
|
2608
|
-
*/
|
|
2609
|
-
persist?: boolean | string;
|
|
2610
|
-
/** Initial token (e.g. from SSR cookie) */
|
|
2611
|
-
token?: string;
|
|
2612
|
-
/** Called when token changes (login/logout) — use to persist in localStorage/cookie */
|
|
2613
|
-
onTokenChange?: (token: string | null) => void;
|
|
2614
|
-
};
|
|
3184
|
+
customer?: CustomerAuthOptions;
|
|
2615
3185
|
}
|
|
2616
3186
|
interface ClientServerConfig extends ClientConfig {
|
|
2617
3187
|
secretKey: string;
|
|
@@ -2651,15 +3221,23 @@ interface PayloadMutationResponse<T = unknown> {
|
|
|
2651
3221
|
}
|
|
2652
3222
|
type Sort = string | string[];
|
|
2653
3223
|
type Where = Record<string, unknown>;
|
|
3224
|
+
type LocaleOption = 'en' | 'ko';
|
|
3225
|
+
type FallbackLocaleOption = 'en' | 'ko' | 'none' | false;
|
|
2654
3226
|
/**
|
|
2655
3227
|
* Do NOT replace with `Pick<FindOptions>` from `payload` or import Payload
|
|
2656
3228
|
* types here. Payload's generic query types depend on `PayloadTypes` module
|
|
2657
3229
|
* augmentation; external SDK consumers who only use `createClient` should not
|
|
2658
3230
|
* install Payload just to type REST query objects. Excluded vs native:
|
|
2659
|
-
* Local-API-only fields
|
|
3231
|
+
* Local-API-only fields.
|
|
2660
3232
|
*/
|
|
2661
3233
|
interface ApiQueryOptions {
|
|
2662
3234
|
page?: number;
|
|
3235
|
+
/**
|
|
3236
|
+
* Rows per page. With a browser publishable key, raw collection reads must
|
|
3237
|
+
* request a bounded limit in [1, 100]: `limit: 0`, a `limit` above 100, and
|
|
3238
|
+
* `pagination: false` are rejected (400) rather than returning an entire
|
|
3239
|
+
* collection — use `page` to paginate. Server credentials are not capped.
|
|
3240
|
+
*/
|
|
2663
3241
|
limit?: number;
|
|
2664
3242
|
sort?: Sort;
|
|
2665
3243
|
/**
|
|
@@ -2714,12 +3292,21 @@ interface ApiQueryOptions {
|
|
|
2714
3292
|
where?: Where;
|
|
2715
3293
|
count?: boolean;
|
|
2716
3294
|
} | false> | false;
|
|
2717
|
-
/**
|
|
3295
|
+
/**
|
|
3296
|
+
* Set to `false` to skip the count query — returns docs without
|
|
3297
|
+
* totalDocs/totalPages. With a browser publishable key this is rejected (400)
|
|
3298
|
+
* on raw collection reads (pagination cannot be disabled so the row cap
|
|
3299
|
+
* applies); it takes effect with server credentials.
|
|
3300
|
+
*/
|
|
2718
3301
|
pagination?: boolean;
|
|
2719
3302
|
/** Include draft versions (access control still applies on the server) */
|
|
2720
3303
|
draft?: boolean;
|
|
2721
3304
|
/** Include soft-deleted documents (requires `trash` enabled on the collection) */
|
|
2722
3305
|
trash?: boolean;
|
|
3306
|
+
/** Resolve localized fields for a specific locale. */
|
|
3307
|
+
locale?: LocaleOption;
|
|
3308
|
+
/** Fallback locale for missing localized values; set false to disable fallback. */
|
|
3309
|
+
fallbackLocale?: FallbackLocaleOption;
|
|
2723
3310
|
}
|
|
2724
3311
|
type ApiDeleteOptions = Pick<ApiQueryOptions, 'trash'>;
|
|
2725
3312
|
type PublicReadQueryOptions = Omit<ApiQueryOptions, 'depth' | 'joins' | 'populate'> & {
|
|
@@ -2746,7 +3333,7 @@ interface RetryConfig {
|
|
|
2746
3333
|
retryableStatuses?: number[];
|
|
2747
3334
|
retryDelay?: (attempt: number) => number;
|
|
2748
3335
|
}
|
|
2749
|
-
interface RootQueryLookup<T extends
|
|
3336
|
+
interface RootQueryLookup<T extends Collection, Options extends ApiQueryOptions = ApiQueryOptions> {
|
|
2750
3337
|
find(options?: Options): Promise<PayloadFindResponse<CollectionType<T>>>;
|
|
2751
3338
|
findById(id: string | number, options?: Options): Promise<CollectionType<T>>;
|
|
2752
3339
|
count(options?: Options): Promise<{
|
|
@@ -2781,10 +3368,13 @@ interface RootClient {
|
|
|
2781
3368
|
events?: EventsClient;
|
|
2782
3369
|
customer: CustomerNamespace;
|
|
2783
3370
|
collections: RootCollectionClient;
|
|
3371
|
+
markets: MarketDiscoveryClient;
|
|
2784
3372
|
memberships: {
|
|
2785
3373
|
me: () => Promise<CustomerMembershipView | null>;
|
|
3374
|
+
cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
|
|
2786
3375
|
};
|
|
2787
3376
|
lastRequestId: string | null;
|
|
3377
|
+
withMarket(market: string): RootClientWithEvents;
|
|
2788
3378
|
getState(): ClientState;
|
|
2789
3379
|
getConfig(): ClientConfig;
|
|
2790
3380
|
}
|
|
@@ -2794,7 +3384,6 @@ interface RootServerClient {
|
|
|
2794
3384
|
memberships: {
|
|
2795
3385
|
subscribe: (params: SubscribeMembershipParams) => Promise<SubscribeMembershipResponse>;
|
|
2796
3386
|
cancel: (params: CancelMembershipParams) => Promise<CancelMembershipResponse>;
|
|
2797
|
-
me: () => Promise<CustomerMembershipView | null>;
|
|
2798
3387
|
};
|
|
2799
3388
|
/** Set on {@link createServerClient} return values; optional for structural mocks. */
|
|
2800
3389
|
events?: EventsClient;
|
|
@@ -2807,7 +3396,9 @@ interface RootServerClient {
|
|
|
2807
3396
|
};
|
|
2808
3397
|
};
|
|
2809
3398
|
collections: RootServerCollectionClient;
|
|
3399
|
+
markets: MarketDiscoveryClient;
|
|
2810
3400
|
lastRequestId: string | null;
|
|
3401
|
+
withMarket(market: string): RootServerClientWithEvents;
|
|
2811
3402
|
getState(): ClientState;
|
|
2812
3403
|
getConfig(): Omit<ClientServerConfig, 'secretKey'>;
|
|
2813
3404
|
}
|
|
@@ -2822,4 +3413,4 @@ type DeepPartial<T> = {
|
|
|
2822
3413
|
};
|
|
2823
3414
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
2824
3415
|
|
|
2825
|
-
export { type BanCustomerParams as $, type AddItemParams as A, type RootCollectionClient as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type RootReadOnlyQueryBuilder as F, type StorefrontContentListOptions as G, type StorefrontContentReference as H, type StorefrontGalleryItem as I, type StorefrontGalleryItemsListOptions as J, type StorefrontGalleryItemsSort as K, type StorefrontLink as L, type StorefrontLinksListOptions as M, type StorefrontLinksSort as N, BaseApi as O, type PayloadFindResponse as P, type ServerApiOptions as Q, type RemoveDiscountParams as R, type Sort as S, ServerCommerceClient as T, type UpdateItemParams as U, type TenantIntrospectionClient as V, type Where as W, type SubscribeMembershipParams as X, type SubscribeMembershipResponse as Y, type CancelMembershipParams as Z, type CancelMembershipResponse as _, CommunityClient as a, type ResolveProductSelectionMediaResult as a$, type CommunityBan as a0, type UnbanCustomerParams as a1, type ClientServerConfig as a2, type RootServerClientWithEvents as a3, type CollectionFieldSchema as a4, type CollectionSchemaResponse as a5, type EventGuestCancelParams as a6, type EventGuestRegistration as a7, type EventGuestRegistrationResponse as a8, type EventRegistrationAnswerInput as a9, TenantIntrospectionApi as aA, type TenantIntrospectionApiOptions as aB, type ApiDeleteOptions as aC, type PublicReadQueryOptions as aD, CustomerAuth as aE, type CustomerProfile as aF, type CustomerAuthResponse as aG, type CustomerLoginData as aH, type CustomerRegisterResponse as aI, type CustomerRegisterData as aJ, type CustomerRefreshResponse as aK, type UpdateProfileData as aL, type ProductListingPageBaseParams as aM, type ProductListingPageParams as aN, type ProductDetailParams as aO, type ProductDetailResult as aP, type ProductListingPageCatalogParams as aQ, type ProductListingPageResult as aR, type ProductListingGroupsCatalogItem as aS, type ProductListingPageFullParams as aT, type ProductListingGroupsItem as aU, type ProductDetail as aV, type ProductDetailCatalog as aW, type StockSnapshotResponse as aX, type ProductSelectionMediaSource as aY, type ProductDisplayMediaSource as aZ, type ResolveProductSelectionMediaInput as a_, type EventRegistrationAttendeeInput as aa, type EventRegistrationPublic as ab, type EventRegistrationRegisterParams as ac, type EventRegistrationRegisterResponse as ad, type EventsCalendarItem as ae, type EventsClientOptions as af, type EventsDateParam as ag, type EventsExternalSource as ah, type EventsLocation as ai, type EventsOccurrenceLocation as aj, type EventsRangeEvent as ak, type EventsRangeOccurrence as al, type EventsRangeParams as am, type EventsRangeResponse as an, type EventsTaxonomyItem as ao, ModerationApi as ap, type RootServerClient as aq, type TenantFeatureProgressEvidenceValue as ar, type TenantFeatureProgressFeature as as, type TenantFeatureProgressGroup as at, type TenantFeatureProgressInput as au, type TenantFeatureProgressItem as av, type TenantFeatureProgressItemState as aw, type TenantFeatureProgressResponse as ax, type TenantFeatureProgressSeverity as ay, type TenantFeatureProgressStatus as az, ContentClient as b, type ProductDetailImage as b$, type ProductSelectionMediaPointer as b0, type RootClientWithEvents as b1, type BulkImportFulfillmentsParams as b2, type BulkImportFulfillmentsResponse as b3, type CalculateShippingParams as b4, type CalculateShippingResult as b5, type CancelOrderParams as b6, type CancelOrderReconciliationStatus as b7, type CancelOrderResponse as b8, type CancelReasonCode as b9, type CustomerOrderListOptions as bA, type CustomerSnapshot as bB, DiscountApi as bC, type DiscountApiOptions as bD, type DiscountErrorReasonCode as bE, type FeaturedImagePointerInput as bF, type GetOrderByPaymentIdParams as bG, type LegacyProductSelectionParamEvent as bH, type ListingGroupsParams as bI, type MediaValue as bJ, type MembershipStatus as bK, type NormalizedOptionSwatch as bL, type NormalizedProductSelection as bM, OrderApi as bN, type OrderApiOptions as bO, type OrderByPaymentResult as bP, PRODUCT_PLP_FIND_OPTIONS as bQ, PRODUCT_UPSERT_READONLY_FIELD_REASON as bR, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as bS, type PrepareFulfillmentOrderParams as bT, type PrepareFulfillmentOrderResponse as bU, ProductApi as bV, type ProductApiOptions as bW, type ProductDetailBrand as bX, type ProductDetailCatalogResult as bY, type ProductDetailCatalogVariant as bZ, type ProductDetailCategory as b_, CartApi as ba, type CartApiOptions as bb, type CartMergeParams as bc, type CartMergeResult as bd, type CartMineResult as be, type Comment as bf, type CommerceClientOptions as bg, type CommunityClientOptions as bh, type CommunityComment as bi, type CommunityCommentListSort as bj, type CommunityPost as bk, type CommunityPostCategory as bl, type CommunityPostListSort as bm, type CommunityPostTag as bn, type CommunityPublicAuthorSnapshot as bo, type CommunityPublicMediaAsset as bp, type CommunityPublicReference as bq, type CompatibilityProductSelectionParamEvent as br, type ConfirmPaymentParams as bs, type ConfirmPaymentResponse as bt, type ConfirmPaymentWithOrderResult as bu, type CreateFulfillmentParams as bv, type CreateOrderItem as bw, type CreateOrderParams as bx, type CreateReturnParams as by, type CustomerAuthOptions as bz, CustomerNamespace as c, type ReturnItem as c$, type ProductDetailImageMedia as c0, type ProductDetailMedia as c1, type ProductDetailOption as c2, type ProductDetailOptionValue as c3, type ProductDetailTag as c4, type ProductDetailUnavailableReason as c5, type ProductDetailVariant as c6, type ProductDetailVariantOptionValue as c7, type ProductDetailVideo as c8, type ProductHrefGroup as c9, type ProductOptionShape as cA, type ProductOptionValueShape as cB, type ProductOptionValueSwatch as cC, type ProductOptionValueSwatchInput as cD, type ProductPriceRange as cE, type ProductSelectionAvailableSwatch as cF, type ProductSelectionAvailableValue as cG, type ProductSelectionByOptionValue as cH, ProductSelectionCodecError as cI, type ProductSelectionCodecOptions as cJ, type ProductSelectionInput as cK, type ProductSelectionOptionValue as cL, type ProductSelectionResolution as cM, type ProductSelectionResolutionContext as cN, type ProductSelectionUrlEmit as cO, type ProductSelectionVariant as cP, type ProductUpsertFieldValidationErrorBody as cQ, type ProductUpsertFieldValidationErrorReason as cR, type ProductVariantShape as cS, type RequestOptions as cT, type ResolveCancelRefundFailedResponse as cU, type ResolveCancelRefundOutcome as cV, type ResolveCancelRefundParams as cW, type ResolveCancelRefundResponse as cX, type ResolveCancelRefundSucceededResponse as cY, type ResolveProductDisplayMediaInput as cZ, type ResolveProductDisplayMediaResult as c_, type ProductHrefOptions as ca, type ProductHrefProduct as cb, type ProductListingCard as cc, type ProductListingCardOptions as cd, type ProductListingCardPriceRange as ce, type ProductListingCardRepresentativeVariant as cf, type ProductListingGroup as cg, type ProductListingGroupCatalogSummary as ch, type ProductListingGroupCatalogVariant as ci, type ProductListingGroupProjection as cj, type ProductListingGroupSummary as ck, type ProductListingGroupVariant as cl, type ProductListingGroupsCatalogProduct as cm, type ProductListingGroupsCatalogResponse as cn, type ProductListingGroupsProduct as co, type ProductListingGroupsResponse as cp, type ProductListingPageFilters as cq, type ProductListingPageSort as cr, type ProductListingProductShape as cs, type ProductListingSwatch as ct, type ProductMediaResolutionSource as cu, type ProductMoneyRange as cv, type ProductOptionMatrix as cw, type ProductOptionMatrixOption as cx, type ProductOptionMatrixValue as cy, type ProductOptionMatrixVariant as cz, type CustomerMembershipView as d, type ReturnReason as d0, type ReturnWithRefundItem as d1, type ReturnWithRefundParams as d2, ShippingApi as d3, type ShippingApiOptions as d4, type StockCheckParams as d5, type StockCheckResponse as d6, type StockCheckResult as d7, type StockSnapshotItem as d8, type StockSnapshotParams as d9, projectProductToListingShape as dA, resolveFeaturedImagePointer as dB, resolveProductDisplayMedia as dC, resolveProductSelection as dD, resolveProductSelectionFromMatrix as dE, resolveProductSelectionMedia as dF, resolveVariantForSelection as dG, selectNext as dH, selectedSwatchMediaItemId as dI, stringifyProductSelection as dJ, toShopifyPriceRangeV2 as dK, type TransactionStatus as da, type UpdateFulfillmentParams as db, type UpdateOrderParams as dc, type UpdateReturnParams as dd, type UpdateTransactionParams as de, type ValidateDiscountParams as df, type ValidateDiscountResult as dg, type WithIdempotencyKey as dh, buildProductHref as di, buildProductListingCard as dj, buildProductListingGroupProjection as dk, buildProductListingGroupsByOption as dl, buildProductOptionMatrix as dm, buildProductOptionMatrixFromDetail as dn, createProductSelectionCodec as dp, getAvailableOptionValues as dq, getProductSelectionImages as dr, getSelectedValueByOptionId as ds, getVariantAvailableForSale as dt, getVariantAvailableStock as du, isProductUpsertFieldValidationErrorBody as dv, normalizeProductSelection as dw, normalizeProductSelectionFromMatrix as dx, normalizeSelectedValueIds as dy, parseProductSelection as dz, type ClientState as e, type ClientConfig as f, type ApiQueryOptions as g, type ApplyDiscountParams as h, type CheckoutParams as i, type ClearCartParams as j, type ClientMetadata as k, type ContentClientOptions as l, type DeepPartial as m, type ExtractArrayType as n, type PayloadMutationResponse as o, type PublicCart as p, type PublicCartItem as q, type PublicCartReference as r, type PublicMediaAsset as s, type PublicMediaSize as t, type PublicOrder as u, type PublicOrderItem as v, type PublicOrderReference as w, type RemoveItemParams as x, type RetryConfig as y, type RootClient as z };
|
|
3416
|
+
export { type PublicCartItemAdmission as $, type AddItemParams as A, type CreatePaymentSessionParams as B, CommerceClient as C, type CustomerSnapshot as D, EventsClient as E, type DebugConfig as F, type DeepPartial as G, type ExtractArrayType as H, type MembershipStatus as I, type Money as J, type PayloadMutationResponse as K, type PaymentFailureReason as L, MarketDiscovery as M, type PaymentNextAction as N, type OpenCheckoutPaymentState as O, type PayloadFindResponse as P, type PaymentProviderStatus as Q, type PaymentReconciliationReason as R, type PaymentSessionRole as S, type ProductUpsertInput as T, type ProductUpsertParams as U, type ProductUpsertResponse as V, type ProductUpsertVariantInput as W, type PublicAttribute as X, type PublicCaptureEvidence as Y, type PublicCart as Z, type PublicCartItem as _, CommunityClient as a, type EventAdmissionAvailabilityType as a$, type PublicCartMarket as a0, type PublicCartReference as a1, type PublicCheckout as a2, type PublicCheckoutItem as a3, type PublicMediaAsset as a4, type PublicMediaSize as a5, type PublicOrder as a6, type PublicOrderAmounts as a7, type PublicOrderItem as a8, type PublicOrderReference as a9, RawBaseApi as aA, type ServerApiOptions as aB, ServerCommerceClient as aC, type TenantIntrospectionClient as aD, type SubscribeMembershipParams as aE, type SubscribeMembershipResponse as aF, type BanCustomerParams as aG, type CommunityBan as aH, type UnbanCustomerParams as aI, type ClientServerConfig as aJ, type RootServerClientWithEvents as aK, type CancelServerPaymentSessionParams as aL, CartApi as aM, type CartApiOptions as aN, CheckoutApi as aO, type CheckoutApiOptions as aP, type CheckoutListItem as aQ, type CheckoutQueryParams as aR, type CheckoutQueryResult as aS, type CheckoutStatus as aT, type CollectionFieldSchema as aU, type CollectionSchemaResponse as aV, type ConfirmTossPaymentSessionParams as aW, type CreateServerCheckoutParams as aX, type CreateServerCheckoutResult as aY, type EventAdmissionAvailabilityParams as aZ, type EventAdmissionAvailabilityResponse as a_, type PublicPaymentSession as aa, type ReconciliationRequired as ab, type RemoveItemParams as ac, type RetrieveBrowserPaymentSessionParams as ad, type RetrieveCartParams as ae, type RetrieveCheckoutParams as af, type RetryConfig as ag, type RootClient as ah, type RootCollectionClient as ai, type RootReadOnlyQueryBuilder as aj, type ShippingLine as ak, type Sort as al, type SpentCheckoutPaymentState as am, type StorefrontContentListOptions as an, type StorefrontContentReference as ao, type StorefrontGalleryItem as ap, type StorefrontGalleryItemsListOptions as aq, type StorefrontGalleryItemsSort as ar, type StorefrontLink as as, type StorefrontLinksListOptions as at, type StorefrontLinksSort as au, type UpdateCartAttributesParams as av, type UpdateDiscountCodesParams as aw, type UpdateItemParams as ax, type VariantInput as ay, type Where as az, ContentClient as b, type ProductDetail as b$, type EventAdmissionPricePresentment as b0, type EventGuestCancelParams as b1, type EventGuestRegistration as b2, type EventGuestRegistrationResponse as b3, type EventRegistrationAnswerInput as b4, type EventRegistrationAttendeeInput as b5, type EventRegistrationPublic as b6, type EventRegistrationRegisterParams as b7, type EventRegistrationRegisterResponse as b8, type EventsCalendarItem as b9, type TenantFeatureProgressItemState as bA, type TenantFeatureProgressResponse as bB, type TenantFeatureProgressSeverity as bC, type TenantFeatureProgressStatus as bD, type TenantFieldConfigState as bE, TenantIntrospectionApi as bF, type TenantIntrospectionApiOptions as bG, type ApiDeleteOptions as bH, type PublicReadQueryOptions as bI, CustomerAuth as bJ, type CustomerProfile as bK, type CustomerAuthResponse as bL, type CustomerLoginData as bM, type CustomerRegisterResponse as bN, type CustomerRegisterData as bO, type CustomerRefreshResponse as bP, type UpdateProfileData as bQ, type ProductListingPageParams as bR, type ProductListingPageBaseParams as bS, type ProductDetailParams as bT, type ProductDetailCatalogResult as bU, type ProductListingPageCatalogParams as bV, type ProductListingPageResult as bW, type ProductListingGroupsCatalogItem as bX, type ProductListingPageFullParams as bY, type ProductListingGroupsItem as bZ, BaseApi as b_, type EventsClientOptions as ba, type EventsDateParam as bb, type EventsExternalSource as bc, type EventsLocation as bd, type EventsOccurrenceLocation as be, type EventsRangeEvent as bf, type EventsRangeOccurrence as bg, type EventsRangeParams as bh, type EventsRangeResponse as bi, type EventsTaxonomyItem as bj, ModerationApi as bk, PaymentSessionApi as bl, type PaymentSessionApiOptions as bm, type RetrieveServerCheckoutParams as bn, type RetrieveServerPaymentSessionParams as bo, type RootServerClient as bp, type ServerCartMergeParams as bq, type ServerCartMineParams as br, type ServerCheckout as bs, type TenantContextInput as bt, type TenantContextResponse as bu, type TenantFeatureProgressEvidenceValue as bv, type TenantFeatureProgressFeature as bw, type TenantFeatureProgressGroup as bx, type TenantFeatureProgressInput as by, type TenantFeatureProgressItem as bz, CustomerNamespace as c, type ProductDetailBrand as c$, type ProductDetailCatalog as c0, type StockSnapshotResponse as c1, type ProductSelectionMediaSource as c2, type ProductDisplayMediaSource as c3, type ResolveProductSelectionMediaInput as c4, type ResolveProductSelectionMediaResult as c5, type ProductSelectionMediaPointer as c6, type RootClientWithEvents as c7, type BulkImportFulfillmentsParams as c8, type BulkImportFulfillmentsResponse as c9, CustomerOAuth as cA, type CustomerOAuthCallbackResult as cB, type CustomerOAuthConfig as cC, type CustomerOAuthTokenSet as cD, type CustomerOrderListOptions as cE, DiscountApi as cF, type DiscountApiOptions as cG, type DiscountErrorReasonCode as cH, type FeaturedImagePointerInput as cI, type GetOrderByPaymentIdParams as cJ, type LegacyProductSelectionParamEvent as cK, type ListingGroupsParams as cL, MAX_CART_LINE_ADMISSIONS as cM, type MarketDTO as cN, type MediaValue as cO, type NormalizedOptionSwatch as cP, type NormalizedProductSelection as cQ, OrderApi as cR, type OrderApiOptions as cS, type OrderByPaymentResult as cT, PRODUCT_PLP_FIND_OPTIONS as cU, PRODUCT_UPSERT_READONLY_FIELD_REASON as cV, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as cW, type PrepareFulfillmentOrderParams as cX, type PrepareFulfillmentOrderResponse as cY, ProductApi as cZ, type ProductApiOptions as c_, type CalculateShippingParams as ca, type CalculateShippingResult as cb, type CancelOrderParams as cc, type CancelOrderResponse as cd, type CancelReasonCode as ce, type CartDiscountCode as cf, type CartWarning as cg, type CartWarningCode as ch, type Comment as ci, type CommerceClientOptions as cj, type CommunityClientOptions as ck, type CommunityComment as cl, type CommunityCommentListSort as cm, type CommunityPost as cn, type CommunityPostCategory as co, type CommunityPostListSort as cp, type CommunityPostTag as cq, type CommunityPublicAuthorSnapshot as cr, type CommunityPublicMediaAsset as cs, type CommunityPublicReference as ct, type CompatibilityProductSelectionParamEvent as cu, type CreateFulfillmentParams as cv, type CreateReturnParams as cw, type CustomerAuthOptions as cx, type CustomerAuthorizationUrlInput as cy, type CustomerAuthorizationUrlResult as cz, type CustomerMembershipView as d, type ProductUpsertFieldValidationErrorReason as d$, type ProductDetailCatalogVariant as d0, type ProductDetailCategory as d1, type ProductDetailImage as d2, type ProductDetailImageMedia as d3, type ProductDetailMedia as d4, type ProductDetailOption as d5, type ProductDetailOptionValue as d6, type ProductDetailResult as d7, type ProductDetailTag as d8, type ProductDetailUnavailableReason as d9, type ProductLocaleOption as dA, type ProductLocaleReadParams as dB, type ProductLocalizedText as dC, type ProductLocalizedValue as dD, type ProductMediaResolutionSource as dE, type ProductMoneyRange as dF, type ProductOptionMatrix as dG, type ProductOptionMatrixOption as dH, type ProductOptionMatrixValue as dI, type ProductOptionMatrixVariant as dJ, type ProductOptionShape as dK, type ProductOptionValueShape as dL, type ProductOptionValueSwatch as dM, type ProductOptionValueSwatchInput as dN, type ProductPriceRange as dO, type ProductSelectionAvailableSwatch as dP, type ProductSelectionAvailableValue as dQ, type ProductSelectionByOptionValue as dR, ProductSelectionCodecError as dS, type ProductSelectionCodecOptions as dT, type ProductSelectionInput as dU, type ProductSelectionOptionValue as dV, type ProductSelectionResolution as dW, type ProductSelectionResolutionContext as dX, type ProductSelectionUrlEmit as dY, type ProductSelectionVariant$1 as dZ, type ProductUpsertFieldValidationErrorBody as d_, type ProductDetailVariant as da, type ProductDetailVariantOptionValue as db, type ProductDetailVideo as dc, type ProductFallbackLocaleOption as dd, type ProductHrefGroup as de, type ProductHrefOptions as df, type ProductHrefProduct as dg, type ProductListingCard as dh, type ProductListingCardOptions as di, type ProductListingCardPriceRange as dj, type ProductListingCardRepresentativeVariant as dk, type ProductListingGroup as dl, type ProductListingGroupCatalogSummary as dm, type ProductListingGroupCatalogVariant as dn, type ProductListingGroupProjection as dp, type ProductListingGroupSummary as dq, type ProductListingGroupVariant as dr, type ProductListingGroupsCatalogProduct as ds, type ProductListingGroupsCatalogResponse as dt, type ProductListingGroupsProduct as du, type ProductListingGroupsResponse as dv, type ProductListingPageFilters as dw, type ProductListingPageSort as dx, type ProductListingProductShape as dy, type ProductListingSwatch as dz, type CancelMembershipParams as e, type ProductVariantShape as e0, type PublicCheckoutBase as e1, type RequestOptions as e2, type ResolveCancelRefundFailedResponse as e3, type ResolveCancelRefundOutcome as e4, type ResolveCancelRefundParams as e5, type ResolveCancelRefundResponse as e6, type ResolveCancelRefundSucceededResponse as e7, type ResolveProductDisplayMediaInput as e8, type ResolveProductDisplayMediaResult as e9, getAvailableOptionValues as eA, getProductSelectionImages as eB, getSelectedValueByOptionId as eC, getVariantAvailableForSale as eD, getVariantAvailableStock as eE, isProductUpsertFieldValidationErrorBody as eF, normalizeProductSelection as eG, normalizeProductSelectionFromMatrix as eH, normalizeSelectedValueIds as eI, parseProductSelection as eJ, projectProductToListingShape as eK, resolveFeaturedImagePointer as eL, resolveProductDisplayMedia as eM, resolveProductSelection as eN, resolveProductSelectionFromMatrix as eO, resolveProductSelectionMedia as eP, resolveVariantForSelection as eQ, selectNext as eR, selectedSwatchMediaItemId as eS, stringifyProductSelection as eT, toShopifyPriceRangeV2 as eU, type ResolvedCatalogPrice as ea, type ReturnCancellationReasonCode as eb, type ReturnItem as ec, type ReturnReason as ed, type ReturnWithRefundItem as ee, type ReturnWithRefundParams as ef, ShippingApi as eg, type ShippingApiOptions as eh, type StockCheckParams as ei, type StockCheckResponse as ej, type StockCheckResult as ek, type StockSnapshotItem as el, type StockSnapshotParams as em, type UpdateFulfillmentParams as en, type UpdateOrderParams as eo, type UpdateReturnParams as ep, type ValidateDiscountParams as eq, type ValidateDiscountResult as er, type WithIdempotencyKey as es, buildProductHref as et, buildProductListingCard as eu, buildProductListingGroupProjection as ev, buildProductListingGroupsByOption as ew, buildProductOptionMatrix as ex, buildProductOptionMatrixFromDetail as ey, createProductSelectionCodec as ez, type CancelMembershipResponse as f, type ClientState as g, type ClientConfig as h, type ApiQueryOptions as i, type CancelBrowserPaymentSessionParams as j, type CartMergeParams as k, type CartMergeResult as l, type CartMineResult as m, type CartMutationResult as n, type CheckoutAbandonedReason as o, type CheckoutAmounts as p, type CheckoutOrderReference as q, type CheckoutPaymentSessionRef as r, type CheckoutShippingAddress as s, type ClearCartParams as t, type ClientMetadata as u, type ContentClientOptions as v, type CreateCartParams as w, type CreateCartResult as x, type CreateCheckoutParams as y, type CreateCheckoutResult as z };
|