@01.software/sdk 0.46.1 → 0.48.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/README.md +81 -7
  3. package/dist/client.cjs +304 -63
  4. package/dist/client.cjs.map +1 -1
  5. package/dist/client.d.cts +6 -6
  6. package/dist/client.d.ts +6 -6
  7. package/dist/client.js +304 -63
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-L2rEgBaR.d.cts → collection-client-CBup9yOx.d.cts} +4 -4
  10. package/dist/{collection-client-BEGXnfQe.d.ts → collection-client-D3ExJU-7.d.ts} +4 -4
  11. package/dist/{const-y0eipvnQ.d.cts → const-BXEi1Kix.d.cts} +4 -4
  12. package/dist/{const-GYVwlXLr.d.ts → const-k9gHylYa.d.ts} +4 -4
  13. package/dist/errors.cjs +49 -1
  14. package/dist/errors.cjs.map +1 -1
  15. package/dist/errors.d.cts +3 -3
  16. package/dist/errors.d.ts +3 -3
  17. package/dist/errors.js +49 -1
  18. package/dist/errors.js.map +1 -1
  19. package/dist/{index-BfYL6Qb1.d.cts → index-BCM9CTL7.d.cts} +3 -3
  20. package/dist/{index-Bei4WlVw.d.ts → index-CHGGkcLj.d.ts} +3 -3
  21. package/dist/index.cjs +308 -64
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +7 -7
  24. package/dist/index.d.ts +7 -7
  25. package/dist/index.js +308 -64
  26. package/dist/index.js.map +1 -1
  27. package/dist/{payload-types-3WNyC0gk.d.cts → payload-types-B6AZQcB7.d.cts} +177 -15
  28. package/dist/{payload-types-3WNyC0gk.d.ts → payload-types-B6AZQcB7.d.ts} +177 -15
  29. package/dist/query.cjs +144 -43
  30. package/dist/query.cjs.map +1 -1
  31. package/dist/query.d.cts +5 -5
  32. package/dist/query.d.ts +5 -5
  33. package/dist/query.js +144 -43
  34. package/dist/query.js.map +1 -1
  35. package/dist/realtime.d.cts +2 -2
  36. package/dist/realtime.d.ts +2 -2
  37. package/dist/server.cjs +385 -63
  38. package/dist/server.cjs.map +1 -1
  39. package/dist/server.d.cts +7 -7
  40. package/dist/server.d.ts +7 -7
  41. package/dist/server.js +385 -63
  42. package/dist/server.js.map +1 -1
  43. package/dist/storefront-cache.cjs +49 -1
  44. package/dist/storefront-cache.cjs.map +1 -1
  45. package/dist/storefront-cache.js +49 -1
  46. package/dist/storefront-cache.js.map +1 -1
  47. package/dist/{types-CAicTn-o.d.cts → types-8us-_C-Q.d.cts} +2 -2
  48. package/dist/{types-DpSyNTxy.d.ts → types-ByD2zii1.d.ts} +2 -2
  49. package/dist/{types-mIROvhhP.d.ts → types-CM2je9Kw.d.cts} +84 -7
  50. package/dist/{types-CDJ2M-MJ.d.cts → types-DbA5V3mt.d.ts} +84 -7
  51. package/dist/ui/form.d.cts +1 -1
  52. package/dist/ui/form.d.ts +1 -1
  53. package/dist/ui/video.d.cts +1 -1
  54. package/dist/ui/video.d.ts +1 -1
  55. package/dist/webhook.d.cts +4 -4
  56. package/dist/webhook.d.ts +4 -4
  57. package/package.json +6 -6
@@ -71,6 +71,8 @@ interface Config {
71
71
  'payment-kernel-operations': PaymentKernelOperation;
72
72
  'payment-kernel-operation-attempts': PaymentKernelOperationAttempt;
73
73
  'payment-kernel-financial-movements': PaymentKernelFinancialMovement;
74
+ 'payment-kernel-provider-receipts': PaymentKernelProviderReceipt;
75
+ 'payment-kernel-reconciliation-cases': PaymentKernelReconciliationCase;
74
76
  'order-status-logs': OrderStatusLog;
75
77
  'inventory-reservations': InventoryReservation;
76
78
  'fulfillment-orders': FulfillmentOrder;
@@ -302,6 +304,8 @@ interface Config {
302
304
  'payment-kernel-operations': PaymentKernelOperationsSelect<false> | PaymentKernelOperationsSelect<true>;
303
305
  'payment-kernel-operation-attempts': PaymentKernelOperationAttemptsSelect<false> | PaymentKernelOperationAttemptsSelect<true>;
304
306
  'payment-kernel-financial-movements': PaymentKernelFinancialMovementsSelect<false> | PaymentKernelFinancialMovementsSelect<true>;
307
+ 'payment-kernel-provider-receipts': PaymentKernelProviderReceiptsSelect<false> | PaymentKernelProviderReceiptsSelect<true>;
308
+ 'payment-kernel-reconciliation-cases': PaymentKernelReconciliationCasesSelect<false> | PaymentKernelReconciliationCasesSelect<true>;
305
309
  'order-status-logs': OrderStatusLogsSelect<false> | OrderStatusLogsSelect<true>;
306
310
  'inventory-reservations': InventoryReservationsSelect<false> | InventoryReservationsSelect<true>;
307
311
  'fulfillment-orders': FulfillmentOrdersSelect<false> | FulfillmentOrdersSelect<true>;
@@ -606,6 +610,14 @@ interface Tenant {
606
610
  id: string;
607
611
  webhookPurgeFencedAt?: string | null;
608
612
  name: string;
613
+ /**
614
+ * TEST is a time-limited space with separate data and keys and no external effects.
615
+ */
616
+ tenantPurpose?: ('production' | 'test') | null;
617
+ /**
618
+ * A TEST tenant can be used for at most 30 days from creation.
619
+ */
620
+ testExpiresAt?: string | null;
609
621
  /**
610
622
  * URL-safe identifier (auto-generated)
611
623
  */
@@ -2933,7 +2945,7 @@ interface ShippingPolicy {
2933
2945
  */
2934
2946
  baseAmount?: number | null;
2935
2947
  /**
2936
- * Read-only rollout field. Edit the shipping rates array instead.
2948
+ * Read-only rollout field. Set up free shipping with an order-amount rate row priced at 0, or with an automatic free_shipping discount that sets a minimum order amount. When you use a rate row, cap the existing paid row with Max Amount so both rows never apply together.
2937
2949
  */
2938
2950
  freeShippingMinAmount?: number | null;
2939
2951
  rates?: {
@@ -2975,7 +2987,13 @@ interface ShippingPolicy {
2975
2987
  * Estimated delivery days
2976
2988
  */
2977
2989
  estimatedDays?: number | null;
2990
+ /**
2991
+ * When off, this policy is skipped and orders price against the default shipping policy.
2992
+ */
2978
2993
  isActive?: boolean | null;
2994
+ /**
2995
+ * Checking this clears the current default policy. Orders without an explicit policy and newly created products follow this one.
2996
+ */
2979
2997
  isDefault?: boolean | null;
2980
2998
  metadata?: {
2981
2999
  [k: string]: unknown;
@@ -3395,14 +3413,26 @@ interface Discount {
3395
3413
  * Amount in KRW (won)
3396
3414
  */
3397
3415
  maxDiscountAmount?: number | null;
3416
+ /**
3417
+ * Start of the validity window (empty = starts immediately)
3418
+ */
3398
3419
  startsAt?: string | null;
3420
+ /**
3421
+ * End of the validity window. Must be after the start; empty = never ends.
3422
+ */
3399
3423
  endsAt?: string | null;
3400
3424
  customerSelection?: {
3425
+ /**
3426
+ * Choosing Included or Excluded requires at least one target below.
3427
+ */
3401
3428
  type?: ('all' | 'included' | 'excluded') | null;
3402
3429
  customers?: (string | Customer)[] | null;
3403
3430
  customerGroups?: (string | CustomerGroup)[] | null;
3404
3431
  };
3405
3432
  productSelection?: {
3433
+ /**
3434
+ * Choosing Included or Excluded requires at least one target below.
3435
+ */
3406
3436
  type?: ('all' | 'included' | 'excluded') | null;
3407
3437
  products?: (string | Product)[] | null;
3408
3438
  collections?: (string | ProductCollection)[] | null;
@@ -3416,7 +3446,7 @@ interface Discount {
3416
3446
  */
3417
3447
  pricingMarket?: (string | null) | Market;
3418
3448
  /**
3419
- * Total usage limit (empty = unlimited)
3449
+ * Total usage limit (1 or more, empty = unlimited)
3420
3450
  */
3421
3451
  maxUses?: number | null;
3422
3452
  /**
@@ -3424,7 +3454,7 @@ interface Discount {
3424
3454
  */
3425
3455
  usesCount?: number | null;
3426
3456
  /**
3427
- * Usage limit per customer (empty = unlimited)
3457
+ * Usage limit per customer (1 or more, empty = unlimited)
3428
3458
  */
3429
3459
  maxUsesPerCustomer?: number | null;
3430
3460
  /**
@@ -3435,6 +3465,9 @@ interface Discount {
3435
3465
  * Allow combining with other discounts
3436
3466
  */
3437
3467
  isCombinable?: boolean | null;
3468
+ /**
3469
+ * Only across-order allocation is supported. Each-line-item is always rejected at checkout and cannot be saved.
3470
+ */
3438
3471
  allocationMethod?: ('across' | 'each') | null;
3439
3472
  /**
3440
3473
  * Discount priority (higher = first)
@@ -3510,6 +3543,10 @@ interface PaymentSession {
3510
3543
  */
3511
3544
  sessionOrigin?: ('managed_adapter' | 'custom_bridge') | null;
3512
3545
  providerSessionId: string;
3546
+ /**
3547
+ * Provider Hosted URL exposed only through an ownership-checked PaymentSession response.
3548
+ */
3549
+ providerActionUrl?: string | null;
3513
3550
  providerAccount?: (string | null) | CommercePaymentAccount;
3514
3551
  credentialVersion?: number | null;
3515
3552
  environment?: string | null;
@@ -3565,6 +3602,8 @@ interface PaymentSession {
3565
3602
  deletedAt?: string | null;
3566
3603
  }
3567
3604
  /**
3605
+ * Connect a Toss Payments or PortOne account and register its payment credentials.
3606
+ *
3568
3607
  * This interface was referenced by `Config`'s JSON-Schema
3569
3608
  * via the `definition` "commerce-payment-accounts".
3570
3609
  */
@@ -3577,26 +3616,51 @@ interface CommercePaymentAccount {
3577
3616
  */
3578
3617
  profileName: string;
3579
3618
  /**
3580
- * Immutable provider account identity (Toss mId / PortOne storeId).
3619
+ * Provider account identity, immutable after registration (Toss mId / PortOne storeId).
3581
3620
  */
3582
3621
  providerAccountKey: string;
3583
3622
  environment: 'test' | 'live';
3584
3623
  markets: (string | Market)[];
3585
3624
  tossConfiguration?: {
3625
+ /**
3626
+ * Toss client key. Must use the test_ / live_ prefix matching the registered environment.
3627
+ */
3586
3628
  clientKey: string;
3587
3629
  secretKey?: string | null;
3630
+ /**
3631
+ * Encrypted on save and never shown again. Leave blank to keep the registered key.
3632
+ */
3633
+ secretKeyInput?: string | null;
3634
+ /**
3635
+ * Toss payment widget payment-method UI key (e.g. DEFAULT).
3636
+ */
3588
3637
  paymentMethodVariantKey: string;
3638
+ /**
3639
+ * Toss payment widget agreement UI key (e.g. AGREEMENT).
3640
+ */
3589
3641
  agreementVariantKey: string;
3590
3642
  paymentMethodPolicy: 'instant_only';
3591
3643
  };
3592
3644
  portOneConfiguration?: {
3593
3645
  apiSecret?: string | null;
3646
+ /**
3647
+ * Encrypted on save and never shown again. Leave blank to keep the registered secret.
3648
+ */
3649
+ apiSecretInput?: string | null;
3650
+ webhookSecret?: string | null;
3651
+ /**
3652
+ * Encrypted on save and never shown again. Leave blank to keep the registered secret.
3653
+ */
3654
+ webhookSecretInput?: string | null;
3655
+ /**
3656
+ * PortOne channel/store profile key.
3657
+ */
3594
3658
  profileKey: string;
3595
3659
  /**
3596
3660
  * Hosted Payment Session country (ISO 3166-1 alpha-2 uppercase).
3597
3661
  */
3598
3662
  country: string;
3599
- allowedPaymentMethods: ('CARD_KR' | 'N_PAY' | 'KAKAO_PAY' | 'TOSS_PAY')[];
3663
+ allowedPaymentMethods: ('CARD_KR' | 'N_PAY' | 'KAKAO_PAY' | 'TOSS_PAY' | 'CARD_INTERNATIONAL' | 'PAY_PAL' | 'UNION_PAY' | 'ALIPAY_CN' | 'ALIPAY_HK' | 'TRUE_MONEY' | 'DANA' | 'TOUCH_N_GO' | 'G_CASH' | 'WE_CHAT_PAY' | 'KLARNA' | 'E_CONTEXT' | 'GRAB_PAY_MY' | 'GRAB_PAY_SG' | 'SHOPEE_PAY_TH' | 'PAY_PAY' | 'BPI' | 'RABBIT_LINE_PAY' | 'CONVENIENCE_STORE_JP' | 'AMAZON_PAY' | 'RAKUTEN_PAY' | 'D_BARAI' | 'AU_PAY' | 'MERPAY')[];
3600
3664
  };
3601
3665
  /**
3602
3666
  * When enabled, this connection is eligible for new PaymentSessions.
@@ -5841,17 +5905,68 @@ interface PaymentKernelFinancialMovement {
5841
5905
  tenant?: (string | null) | Tenant;
5842
5906
  operation: string | PaymentKernelOperation;
5843
5907
  providerObjectIdentity: string | PaymentKernelProviderObjectIdentity;
5844
- movementKind: 'capture_confirmed' | 'refund_reservation' | 'refund_confirmed' | 'refund_reservation_release';
5908
+ movementKind: 'capture_confirmed' | 'refund_reservation' | 'refund_confirmed' | 'refund_reservation_release' | 'dispute_loss' | 'reversal' | 'fee' | 'adjustment' | 'settled';
5845
5909
  movementIdentity: string;
5846
5910
  reservationMovement?: (string | null) | PaymentKernelFinancialMovement;
5847
5911
  terminalAttempt?: (string | null) | PaymentKernelOperationAttempt;
5848
5912
  definitivelyFailedAttempt?: (string | null) | PaymentKernelOperationAttempt;
5913
+ providerReceipt?: (string | null) | PaymentKernelProviderReceipt;
5849
5914
  amount: number;
5850
5915
  currency: string;
5851
5916
  effectiveAt: string;
5852
5917
  updatedAt: string;
5853
5918
  createdAt: string;
5854
5919
  }
5920
+ /**
5921
+ * This interface was referenced by `Config`'s JSON-Schema
5922
+ * via the `definition` "payment-kernel-provider-receipts".
5923
+ */
5924
+ interface PaymentKernelProviderReceipt {
5925
+ id: string;
5926
+ tenant?: (string | null) | Tenant;
5927
+ provider: string;
5928
+ providerAccountKey: string;
5929
+ environment: 'test' | 'live';
5930
+ providerConnection: string | PaymentKernelProviderConnection;
5931
+ credentialGeneration: string | PaymentKernelCredentialGeneration;
5932
+ providerObjectIdentity?: (string | null) | PaymentKernelProviderObjectIdentity;
5933
+ eventKind: string;
5934
+ eventId: string;
5935
+ bodyHash: string;
5936
+ rawPayload?: string | null;
5937
+ authenticatedAt: string;
5938
+ rawPayloadRetainedUntil: string;
5939
+ rawPayloadRedactedAt?: string | null;
5940
+ state: 'authenticated' | 'conflicting';
5941
+ updatedAt: string;
5942
+ createdAt: string;
5943
+ }
5944
+ /**
5945
+ * This interface was referenced by `Config`'s JSON-Schema
5946
+ * via the `definition` "payment-kernel-reconciliation-cases".
5947
+ */
5948
+ interface PaymentKernelReconciliationCase {
5949
+ id: string;
5950
+ tenant?: (string | null) | Tenant;
5951
+ provider: string;
5952
+ providerAccountKey: string;
5953
+ environment: 'test' | 'live';
5954
+ providerConnection: string | PaymentKernelProviderConnection;
5955
+ currency: string;
5956
+ periodStart: string;
5957
+ periodEnd: string;
5958
+ exceptionIdentity: string;
5959
+ capturedPrincipal: number;
5960
+ refundedPrincipal: number;
5961
+ disputeLoss: number;
5962
+ adjustments: number;
5963
+ fees: number;
5964
+ expectedSettledNet: number;
5965
+ reportedSettledNet: number;
5966
+ state: 'open' | 'reconciled';
5967
+ updatedAt: string;
5968
+ createdAt: string;
5969
+ }
5855
5970
  /**
5856
5971
  * This interface was referenced by `Config`'s JSON-Schema
5857
5972
  * via the `definition` "order-status-logs".
@@ -8401,9 +8516,6 @@ interface Form {
8401
8516
  blockType: 'textarea';
8402
8517
  })[] | null;
8403
8518
  submitButtonLabel?: string | null;
8404
- /**
8405
- * Choose whether to display an on-page message or redirect to a different page after they submit the form.
8406
- */
8407
8519
  confirmationType?: ('message' | 'redirect') | null;
8408
8520
  confirmationMessage?: {
8409
8521
  root: {
@@ -8423,9 +8535,6 @@ interface Form {
8423
8535
  redirect?: {
8424
8536
  url: string;
8425
8537
  };
8426
- /**
8427
- * Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}. You can use a wildcard {{*}} to output all data and {{*:table}} to format it as an HTML table in the email.
8428
- */
8429
8538
  emails?: {
8430
8539
  emailTo?: string | null;
8431
8540
  cc?: string | null;
@@ -8433,9 +8542,6 @@ interface Form {
8433
8542
  replyTo?: string | null;
8434
8543
  emailFrom?: string | null;
8435
8544
  subject: string;
8436
- /**
8437
- * Enter the message that should be sent in this email.
8438
- */
8439
8545
  message?: {
8440
8546
  root: {
8441
8547
  type: string;
@@ -8901,6 +9007,8 @@ interface WebhookOutboxDeliveriesSelect<T extends boolean = true> {
8901
9007
  interface TenantsSelect<T extends boolean = true> {
8902
9008
  webhookPurgeFencedAt?: T;
8903
9009
  name?: T;
9010
+ tenantPurpose?: T;
9011
+ testExpiresAt?: T;
8904
9012
  slug?: T;
8905
9013
  previewDestinations?: T | {
8906
9014
  origin?: T;
@@ -10229,6 +10337,7 @@ interface PaymentSessionsSelect<T extends boolean = true> {
10229
10337
  provider?: T;
10230
10338
  sessionOrigin?: T;
10231
10339
  providerSessionId?: T;
10340
+ providerActionUrl?: T;
10232
10341
  providerAccount?: T;
10233
10342
  credentialVersion?: T;
10234
10343
  environment?: T;
@@ -10524,12 +10633,61 @@ interface PaymentKernelFinancialMovementsSelect<T extends boolean = true> {
10524
10633
  reservationMovement?: T;
10525
10634
  terminalAttempt?: T;
10526
10635
  definitivelyFailedAttempt?: T;
10636
+ providerReceipt?: T;
10527
10637
  amount?: T;
10528
10638
  currency?: T;
10529
10639
  effectiveAt?: T;
10530
10640
  updatedAt?: T;
10531
10641
  createdAt?: T;
10532
10642
  }
10643
+ /**
10644
+ * This interface was referenced by `Config`'s JSON-Schema
10645
+ * via the `definition` "payment-kernel-provider-receipts_select".
10646
+ */
10647
+ interface PaymentKernelProviderReceiptsSelect<T extends boolean = true> {
10648
+ tenant?: T;
10649
+ provider?: T;
10650
+ providerAccountKey?: T;
10651
+ environment?: T;
10652
+ providerConnection?: T;
10653
+ credentialGeneration?: T;
10654
+ providerObjectIdentity?: T;
10655
+ eventKind?: T;
10656
+ eventId?: T;
10657
+ bodyHash?: T;
10658
+ rawPayload?: T;
10659
+ authenticatedAt?: T;
10660
+ rawPayloadRetainedUntil?: T;
10661
+ rawPayloadRedactedAt?: T;
10662
+ state?: T;
10663
+ updatedAt?: T;
10664
+ createdAt?: T;
10665
+ }
10666
+ /**
10667
+ * This interface was referenced by `Config`'s JSON-Schema
10668
+ * via the `definition` "payment-kernel-reconciliation-cases_select".
10669
+ */
10670
+ interface PaymentKernelReconciliationCasesSelect<T extends boolean = true> {
10671
+ tenant?: T;
10672
+ provider?: T;
10673
+ providerAccountKey?: T;
10674
+ environment?: T;
10675
+ providerConnection?: T;
10676
+ currency?: T;
10677
+ periodStart?: T;
10678
+ periodEnd?: T;
10679
+ exceptionIdentity?: T;
10680
+ capturedPrincipal?: T;
10681
+ refundedPrincipal?: T;
10682
+ disputeLoss?: T;
10683
+ adjustments?: T;
10684
+ fees?: T;
10685
+ expectedSettledNet?: T;
10686
+ reportedSettledNet?: T;
10687
+ state?: T;
10688
+ updatedAt?: T;
10689
+ createdAt?: T;
10690
+ }
10533
10691
  /**
10534
10692
  * This interface was referenced by `Config`'s JSON-Schema
10535
10693
  * via the `definition` "order-status-logs_select".
@@ -12848,12 +13006,16 @@ interface CommercePaymentAccountsSelect<T extends boolean = true> {
12848
13006
  tossConfiguration?: T | {
12849
13007
  clientKey?: T;
12850
13008
  secretKey?: T;
13009
+ secretKeyInput?: T;
12851
13010
  paymentMethodVariantKey?: T;
12852
13011
  agreementVariantKey?: T;
12853
13012
  paymentMethodPolicy?: T;
12854
13013
  };
12855
13014
  portOneConfiguration?: T | {
12856
13015
  apiSecret?: T;
13016
+ apiSecretInput?: T;
13017
+ webhookSecret?: T;
13018
+ webhookSecretInput?: T;
12857
13019
  profileKey?: T;
12858
13020
  country?: T;
12859
13021
  allowedPaymentMethods?: T;
package/dist/query.cjs CHANGED
@@ -540,34 +540,78 @@ var SDKError = class extends Error {
540
540
  };
541
541
  var COMMERCE_ERROR_CODES = [
542
542
  "validation_failed",
543
+ "bad_request",
543
544
  "unauthorized",
544
545
  "forbidden",
546
+ "account_suspended",
547
+ "key_invalid",
548
+ "pat_tenant_header_forbidden",
549
+ "tenant_mismatch",
550
+ "test_tenant_expired",
551
+ "token_invalid",
545
552
  "token_expired",
546
553
  "origin_not_allowed",
547
554
  "server_credentials_required",
555
+ "role_denied",
556
+ "scope_denied",
557
+ "feature_disabled",
548
558
  "not_found",
549
559
  "conflict",
560
+ "locked",
550
561
  "cart_revision_conflict",
551
562
  "rate_limit_exceeded",
552
563
  "usage_limit_exceeded",
553
564
  "service_unavailable",
554
565
  "idempotency_conflict",
555
566
  "idempotency_in_progress",
567
+ "idempotency_key_required",
568
+ "invalid_idempotency_key",
556
569
  "cart_not_active",
557
570
  "cart_locked",
558
571
  "cart_empty",
559
572
  "cart_market_unavailable",
560
573
  "cart_market_mismatch",
561
574
  "checkout_not_open",
575
+ "checkout_already_open",
562
576
  "payment_slot_held",
563
577
  "reservation_expired",
564
578
  "payment_session_not_cancelable",
579
+ "payment_session_conflict",
565
580
  "provider_identity_mismatch",
581
+ "payment_method_unavailable",
566
582
  "provider_unavailable",
567
583
  "lock_timeout",
568
584
  "price_changed",
569
585
  "pricing_fact_in_use",
570
586
  "insufficient_stock",
587
+ "reservation_conflict",
588
+ "stock_lock_unavailable",
589
+ "variant_not_found",
590
+ "variant_stock_write_failed",
591
+ "stock_invariant_violation",
592
+ "payment_confirmation_in_flight",
593
+ "checkout_reservation_release_requires_transaction",
594
+ "admission_metadata_invalid",
595
+ "admission_metadata_required",
596
+ "capacity_exceeded",
597
+ "occurrence_lock_unavailable",
598
+ "occurrence_not_open",
599
+ "admission_type_capacity_exceeded",
600
+ "admission_type_occurrence_mismatch",
601
+ "admission_hold_expired",
602
+ "admission_hold_checkout_item_conflict",
603
+ "admission_hold_checkout_conflict",
604
+ "admission_hold_quantity_mismatch",
605
+ "admission_hold_unbound",
606
+ "admission_hold_missing",
607
+ "admission_hold_checkout_item_missing",
608
+ "admission_hold_expiry_failed",
609
+ "admission_hold_expiry_requires_transaction",
610
+ "admission_hold_line_item_mismatch",
611
+ "admission_materialization_failed",
612
+ "variant_inactive",
613
+ "variant_product_mismatch",
614
+ "product_not_public",
571
615
  "market_not_found",
572
616
  "market_shipping_currency_unsupported",
573
617
  "missing_market_rate",
@@ -592,7 +636,11 @@ var COMMERCE_ERROR_CODES = [
592
636
  "discount_min_order_amount",
593
637
  "discount_currency_scope_required",
594
638
  "discount_allocation_method_unsupported",
595
- "currency_mismatch"
639
+ "currency_mismatch",
640
+ "customer_token_required",
641
+ "market_required",
642
+ "server_derived",
643
+ "internal_error"
596
644
  ];
597
645
  var COMMERCE_ERROR_CODE_SET = new Set(
598
646
  COMMERCE_ERROR_CODES
@@ -757,12 +805,14 @@ function listingPageSearchParams(options) {
757
805
 
758
806
  // ../../internal/http-contracts/src/index.ts
759
807
  var operationBrand = /* @__PURE__ */ Symbol("sdk-http-operation");
760
- var operation = (collection, method, path) => Object.freeze({
808
+ var operation = (collection, method, path, errorFamily) => Object.freeze({
761
809
  [operationBrand]: true,
762
810
  collection,
763
811
  method,
764
- path
812
+ path,
813
+ ...errorFamily && { errorFamily }
765
814
  });
815
+ var strictCommerceOperation = (collection, method, path) => operation(collection, method, path, "commerce");
766
816
  var COMMERCE_ENDPOINT_OPERATIONS = {
767
817
  products: {
768
818
  detail: operation("products", "get", "/detail"),
@@ -795,13 +845,13 @@ var COMMERCE_ENDPOINT_OPERATIONS = {
795
845
  byPayment: operation("orders", "get", "/by-payment"),
796
846
  cancel: operation("orders", "post", "/cancel"),
797
847
  resolveCancelRefund: operation("orders", "post", "/resolve-cancel-refund"),
798
- checkout: operation("orders", "post", "/checkout"),
848
+ checkout: strictCommerceOperation("orders", "post", "/checkout"),
799
849
  createFulfillment: operation("orders", "post", "/create-fulfillment"),
800
850
  updateFulfillment: operation("orders", "post", "/update-fulfillment")
801
851
  },
802
852
  checkouts: {
803
- detail: operation("checkouts", "post", "/detail"),
804
- query: operation("checkouts", "post", "/query")
853
+ detail: strictCommerceOperation("checkouts", "post", "/detail"),
854
+ query: strictCommerceOperation("checkouts", "post", "/query")
805
855
  },
806
856
  transactions: {
807
857
  update: operation("transactions", "post", "/update")
@@ -822,29 +872,58 @@ var COMMERCE_ENDPOINT_OPERATIONS = {
822
872
  bulkImport: operation("fulfillments", "post", "/bulk-import")
823
873
  },
824
874
  carts: {
825
- create: operation("carts", "post", "/create"),
826
- retrieve: operation("carts", "post", "/retrieve"),
827
- mine: operation("carts", "post", "/mine"),
828
- merge: operation("carts", "post", "/merge"),
829
- addItem: operation("carts", "post", "/add-item"),
830
- updateItem: operation("carts", "post", "/update-item"),
831
- removeItem: operation("carts", "post", "/remove-item"),
832
- updateDiscountCodes: operation("carts", "post", "/update-discount-codes"),
833
- updateAttributes: operation("carts", "post", "/update-attributes"),
834
- clear: operation("carts", "post", "/clear")
875
+ create: strictCommerceOperation("carts", "post", "/create"),
876
+ retrieve: strictCommerceOperation("carts", "post", "/retrieve"),
877
+ mine: strictCommerceOperation("carts", "post", "/mine"),
878
+ merge: strictCommerceOperation("carts", "post", "/merge"),
879
+ addItem: strictCommerceOperation("carts", "post", "/add-item"),
880
+ updateItem: strictCommerceOperation("carts", "post", "/update-item"),
881
+ removeItem: strictCommerceOperation("carts", "post", "/remove-item"),
882
+ updateDiscountCodes: strictCommerceOperation(
883
+ "carts",
884
+ "post",
885
+ "/update-discount-codes"
886
+ ),
887
+ updateAttributes: strictCommerceOperation(
888
+ "carts",
889
+ "post",
890
+ "/update-attributes"
891
+ ),
892
+ clear: strictCommerceOperation("carts", "post", "/clear")
835
893
  },
836
894
  paymentSessions: {
837
- create: operation("payment-sessions", "post", "/create"),
838
- retrieve: operation("payment-sessions", "post", "/retrieve"),
839
- cancel: operation("payment-sessions", "post", "/cancel"),
895
+ create: strictCommerceOperation("payment-sessions", "post", "/create"),
896
+ retrieve: strictCommerceOperation("payment-sessions", "post", "/retrieve"),
897
+ cancel: strictCommerceOperation("payment-sessions", "post", "/cancel"),
840
898
  server: {
841
- create: operation("payment-sessions", "post", "/server/create"),
842
- retrieve: operation("payment-sessions", "post", "/server/retrieve"),
843
- cancel: operation("payment-sessions", "post", "/server/cancel"),
844
- confirm: operation("payment-sessions", "post", "/server/confirm")
899
+ create: strictCommerceOperation(
900
+ "payment-sessions",
901
+ "post",
902
+ "/server/create"
903
+ ),
904
+ retrieve: strictCommerceOperation(
905
+ "payment-sessions",
906
+ "post",
907
+ "/server/retrieve"
908
+ ),
909
+ cancel: strictCommerceOperation(
910
+ "payment-sessions",
911
+ "post",
912
+ "/server/cancel"
913
+ ),
914
+ confirm: strictCommerceOperation(
915
+ "payment-sessions",
916
+ "post",
917
+ "/server/confirm"
918
+ )
845
919
  },
846
920
  custom: {
847
921
  create: operation("orders", "post", "/custom-payment-sessions"),
922
+ retrieve: operation(
923
+ "orders",
924
+ "post",
925
+ "/custom-payment-sessions/retrieve"
926
+ ),
848
927
  confirm: operation("orders", "post", "/custom-payment-sessions/confirm")
849
928
  }
850
929
  },
@@ -870,6 +949,11 @@ var EVENTS_ENDPOINT_OPERATIONS = {
870
949
  )
871
950
  }
872
951
  };
952
+ var COMMUNITY_ENDPOINT_OPERATIONS = {
953
+ posts: {
954
+ detail: operation("posts", "get", "/detail")
955
+ }
956
+ };
873
957
  function resolveOperationTemplate(descriptor) {
874
958
  return descriptor.collection ? `/api/${descriptor.collection}${descriptor.path}` : `/api${descriptor.path}`;
875
959
  }
@@ -929,12 +1013,12 @@ var COMMERCE_ENDPOINTS = {
929
1013
  updateFulfillment: endpoint("POST", "/api/orders/update-fulfillment")
930
1014
  },
931
1015
  checkouts: {
932
- create: endpoint("POST", "/api/orders/checkout"),
933
- retrieve: endpoint("POST", "/api/checkouts/detail"),
1016
+ create: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.orders.checkout),
1017
+ retrieve: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.checkouts.detail),
934
1018
  server: {
935
- create: endpoint("POST", "/api/orders/checkout"),
936
- retrieve: endpoint("POST", "/api/checkouts/detail"),
937
- query: endpoint("POST", "/api/checkouts/query")
1019
+ create: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.orders.checkout),
1020
+ retrieve: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.checkouts.detail),
1021
+ query: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.checkouts.query)
938
1022
  }
939
1023
  },
940
1024
  returns: {
@@ -952,10 +1036,10 @@ var COMMERCE_ENDPOINTS = {
952
1036
  bulkImport: endpoint("POST", "/api/fulfillments/bulk-import")
953
1037
  },
954
1038
  carts: {
955
- create: endpoint("POST", "/api/carts/create"),
1039
+ create: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.create),
956
1040
  retrieve: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.retrieve),
957
- mine: endpoint("POST", "/api/carts/mine"),
958
- merge: endpoint("POST", "/api/carts/merge"),
1041
+ mine: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.mine),
1042
+ merge: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.merge),
959
1043
  server: {
960
1044
  // Server credentials are an authorization lane, not a second Cart
961
1045
  // transport. These must stay bound to the registered shared operations.
@@ -975,29 +1059,46 @@ var COMMERCE_ENDPOINTS = {
975
1059
  clear: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.clear)
976
1060
  },
977
1061
  addItem: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.addItem),
978
- updateItem: endpoint("POST", "/api/carts/update-item"),
979
- removeItem: endpoint("POST", "/api/carts/remove-item"),
980
- updateDiscountCodes: endpoint("POST", "/api/carts/update-discount-codes"),
981
- updateAttributes: endpoint("POST", "/api/carts/update-attributes"),
982
- clear: endpoint("POST", "/api/carts/clear")
1062
+ updateItem: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.updateItem),
1063
+ removeItem: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.removeItem),
1064
+ updateDiscountCodes: sharedEndpoint(
1065
+ COMMERCE_ENDPOINT_OPERATIONS.carts.updateDiscountCodes
1066
+ ),
1067
+ updateAttributes: sharedEndpoint(
1068
+ COMMERCE_ENDPOINT_OPERATIONS.carts.updateAttributes
1069
+ ),
1070
+ clear: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.carts.clear)
983
1071
  },
984
1072
  paymentSessions: {
985
- create: endpoint("POST", "/api/payment-sessions/create"),
986
- retrieve: endpoint("POST", "/api/payment-sessions/retrieve"),
987
- cancel: endpoint("POST", "/api/payment-sessions/cancel"),
1073
+ create: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.create),
1074
+ retrieve: sharedEndpoint(
1075
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.retrieve
1076
+ ),
1077
+ cancel: sharedEndpoint(COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.cancel),
988
1078
  custom: {
989
1079
  create: sharedEndpoint(
990
1080
  COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.custom.create
991
1081
  ),
1082
+ retrieve: sharedEndpoint(
1083
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.custom.retrieve
1084
+ ),
992
1085
  confirm: sharedEndpoint(
993
1086
  COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.custom.confirm
994
1087
  )
995
1088
  },
996
1089
  server: {
997
- create: endpoint("POST", "/api/payment-sessions/server/create"),
998
- retrieve: endpoint("POST", "/api/payment-sessions/server/retrieve"),
999
- cancel: endpoint("POST", "/api/payment-sessions/server/cancel"),
1000
- confirm: endpoint("POST", "/api/payment-sessions/server/confirm")
1090
+ create: sharedEndpoint(
1091
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.server.create
1092
+ ),
1093
+ retrieve: sharedEndpoint(
1094
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.server.retrieve
1095
+ ),
1096
+ cancel: sharedEndpoint(
1097
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.server.cancel
1098
+ ),
1099
+ confirm: sharedEndpoint(
1100
+ COMMERCE_ENDPOINT_OPERATIONS.paymentSessions.server.confirm
1101
+ )
1001
1102
  }
1002
1103
  },
1003
1104
  shippingPolicies: {