@sayren/storefront-sdk 0.13.0 → 0.14.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/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { C as loginRequestSchema, D as tokenPairSchema, E as socialProviderSchema, O as withdrawRequestSchema, S as linkIdentityRequestSchema, T as signupRequestSchema, _ as anonymousSessionSchema, a as AnonymousSession, b as idpAuthorizeResponseSchema, c as IdpTokenRequest, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, i as buildQuery, k as withdrawalBlockedDetailsSchema, l as LinkIdentityRequest, m as TokenPair, n as Query, o as IdpAgreements, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, t as ApiError, u as LoginRequest, v as idpAgreementsSchema, w as memberIdentitiesSchema, x as idpTokenRequestSchema, y as idpAuthorizeRequestSchema } from "./http-1ab7tP4-.mjs";
2
- import { $ as Member, $n as productCardSchema, $t as DeliveryQuoteRequest, A as StorefrontClientOptions, An as guestInfoSchema, At as consentStateSchema, B as ReviewPage, Bn as remoteAreaSchema, Bt as claimReturnAddressSchema, C as AnalyticsServerEventName, Cn as checkoutDeliverySchema, Ct as ConsentSource, D as analyticsIdSchema, Dn as deliveryQuoteSchema, Dt as consentActionSchema, E as analyticsClientEventSchema, En as deliveryQuoteRequestSchema, Et as MemberConsents, F as StorefrontSessionOptions, Fn as paymentOptionListSchema, Ft as ClaimType, G as createReviewRequestSchema, Gn as CategoryNode, Gt as AvailablePaymentOption, H as UpdateReviewRequest, Hn as retryPaymentRequestSchema, Ht as createClaimRequestSchema, I as createStorefrontSession, In as paymentOptionSchema, It as CreateClaimRequest, J as reviewPageSchema, Jn as ProductFacets, Jt as CashReceiptRequest, K as createReviewResultSchema, Kn as ProductCard, Kt as CASH_RECEIPT_METHODS, L as CreateReviewRequest, Ln as paymentStartSchema, Lt as CreateClaimResult, M as STOREFRONT_SESSION_KEYS, Mn as paymentMessageSchema, Mt as memberConsentsSchema, N as SessionStorage, Nn as paymentMethodSchema, Nt as ClaimReason, O as analyticsServerEventNameSchema, On as easyPayProviderResponseSchema, Ot as consentKindSchema, P as StorefrontSession, Pn as paymentOptionKey, Pt as ClaimReturnAddress, Q as writableReviewSchema, Qn as categoryNodeSchema, Qt as CreateCheckoutRequest, R as CreateReviewResult, Rn as paymentStatusSchema, Rt as MyClaim, S as AnalyticsEventName, Sn as cashReceiptTypeSchema, St as ConsentKind, T as analyticsClientEventNameSchema, Tn as createCheckoutRequestSchema, Tt as ConsentUpdateRequest, U as UpdateReviewResult, Un as shippingAddressInputSchema, Ut as createClaimResultSchema, V as ReviewSummary, Vn as residentNumberLike, Vt as claimTypeSchema, W as WritableReview, Wn as startPaymentRequestSchema, Wt as myClaimSchema, X as updateReviewRequestSchema, Xn as ProductSearchParams, Xt as CheckoutDelivery, Y as reviewSummarySchema, Yn as ProductPage, Yt as CashReceiptType, Z as updateReviewResultSchema, Zn as ProductSort, Zt as CheckoutSession, _ as ANALYTICS_VISITOR_COOKIE, _n as StartPaymentRequest, _r as cartItemSchema, _t as CustomerInquiryCategory, a as MyOrderItem, an as PAYMENT_RESULT_VALUES, ar as OrderItemStatus, at as memberAddressSchema, b as AnalyticsClientEvent, bn as cashReceiptIdentityTypeOf, br as analyticsIdsFromCookie, bt as customerInquirySchema, c as deliveryTrackingSchema, cn as PaymentMessage, cr as claimStatusSchema, ct as wishlistAddResultSchema, d as orderShippingAddressSchema, dn as PaymentStart, dr as pageSchema, dt as PublicInquiry, en as DeliveryQuoteResult, er as productDetailSchema, et as MemberAddress, f as purchaseDecisionResultSchema, fn as PaymentStatus, fr as AddCartItemRequest, ft as createInquiryRequestSchema, g as ANALYTICS_SESSION_HEADER, gn as ShippingAddressInput, gr as addCartItemRequestSchema, gt as CustomerInquiry, h as ANALYTICS_SESSION_COOKIE, hn as RetryPaymentRequest, hr as UpdateCartItemRequest, ht as CreateCustomerInquiryRequest, i as MyOrder, in as KnownPaymentStatus, ir as ClaimStatus, it as memberAddressRequestSchema, j as createStorefrontClient, jn as paymentFailureCategorySchema, jt as consentUpdateRequestSchema, k as StorefrontClient, kn as easyPayProviderSchema, kt as consentSourceSchema, l as myOrderItemSchema, ln as PaymentMethod, lr as orderItemStatusSchema, lt as CreateInquiryRequest, m as ANALYTICS_MAX_BATCH_BYTES, mn as RemoteArea, mr as CartItem, mt as publicInquirySchema, n as storefrontStoreSchema, nn as GuestInfo, nr as productPageSchema, nt as UpdateProfileRequest, o as OrderShippingAddress, on as PAYMENT_STATUS_VALUES, or as PageInfo, ot as memberSchema, p as trackingStageResponseSchema, pn as PgProvider, pr as Cart, pt as createInquiryResultSchema, q as publicReviewSchema, qn as ProductDetail, qt as CashReceiptIdentityType, r as DeliveryTracking, rn as KnownPaymentResult, rr as productSortSchema, rt as WishlistAddResult, s as PurchaseDecisionResult, sn as PaymentFailureCategory, sr as PageParams, st as updateProfileRequestSchema, t as StorefrontStore, tn as EasyPayProvider, tr as productFacetsSchema, tt as MemberAddressRequest, u as myOrderSchema, un as PaymentOption, ur as pageInfoSchema, ut as CreateInquiryResult, v as ANALYTICS_VISITOR_HEADER, vn as availablePaymentOptionSchema, vr as cartSchema, vt as createCustomerInquiryRequestSchema, w as analyticsBatchSchema, wn as checkoutSessionSchema, wt as ConsentState, x as AnalyticsClientEventName, xn as cashReceiptRequestSchema, xt as ConsentAction, y as AnalyticsBatch, yn as cashReceiptAvailable, yr as updateCartItemRequestSchema, yt as customerInquiryCategorySchema, z as PublicReview, zn as pgProviderSchema, zt as claimReasonSchema } from "./index-BaSx86ts.mjs";
3
- export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
2
+ import { $ as fulfillmentRevealSchema, $n as easyPayProviderSchema, $t as consentSourceSchema, A as ReviewSummary, An as PAYMENT_STATUS_VALUES, Ar as PageInfo, At as CouponApplication, B as updateReviewResultSchema, Bn as ShippingAddressInput, Br as Cart, Bt as couponBenefitViewSchema, C as StorefrontSession, Cn as DeliveryQuoteRequest, Cr as productCardSchema, Ct as CustomerInquiryCategory, D as CreateReviewResult, Dn as KnownPaymentResult, Dr as productSortSchema, Dt as ApplicableCoupon, E as CreateReviewRequest, En as GuestInfo, Er as productPageSchema, Et as customerInquirySchema, F as createReviewResultSchema, Fn as PaymentStart, Fr as orderItemStatusSchema, Ft as applicableCouponSchema, G as FulfillmentReveal, Gn as cashReceiptRequestSchema, Gr as cartSchema, Gt as ConsentAction, H as DeliveryTracking, Hn as availablePaymentOptionSchema, Hr as UpdateCartItemRequest, Ht as myCouponListQuerySchema, I as publicReviewSchema, In as PaymentStatus, Ir as pageInfoSchema, It as checkoutPricingRequestSchema, J as OrderShippingAddress, Jn as checkoutSessionSchema, Jt as ConsentState, K as MyOrder, Kn as cashReceiptTypeSchema, Kr as updateCartItemRequestSchema, Kt as ConsentKind, L as reviewPageSchema, Ln as PgProvider, Lr as pageSchema, Lt as checkoutPricingSchema, M as UpdateReviewResult, Mn as PaymentMessage, Mr as claimStatusSchema, Mt as MAX_COUPONS_PER_CHECKOUT, N as WritableReview, Nn as PaymentMethod, Nr as fulfillmentTypeField, Nt as MIN_PAYMENT_AMOUNT, O as PublicReview, On as KnownPaymentStatus, Or as ClaimStatus, Ot as CheckoutPricing, P as createReviewRequestSchema, Pn as PaymentOption, Pr as isShippingFulfillment, Pt as MyCoupon, Q as downloadRequestSchema, Qn as easyPayProviderResponseSchema, Qt as consentKindSchema, R as reviewSummarySchema, Rn as RemoteArea, Rr as requiresShippingField, Rt as couponApplicationListSchema, S as SessionStorage, Sn as CreateCheckoutRequest, Sr as categoryNodeSchema, St as CustomerInquiry, T as createStorefrontSession, Tn as EasyPayProvider, Tr as productFacetsSchema, Tt as customerInquiryCategorySchema, U as DownloadLink, Un as cashReceiptAvailable, Ur as addCartItemRequestSchema, Ut as myCouponSchema, V as writableReviewSchema, Vn as StartPaymentRequest, Vr as CartItem, Vt as couponResultSchema, W as DownloadRequest, Wn as cashReceiptIdentityTypeOf, Wr as cartItemSchema, Wt as pricingAmountsSchema, X as deliveryTrackingSchema, Xn as deliveryQuoteRequestSchema, Xt as MemberConsents, Y as PurchaseDecisionResult, Yn as createCheckoutRequestSchema, Yt as ConsentUpdateRequest, Z as downloadLinkSchema, Zn as deliveryQuoteSchema, Zt as consentActionSchema, _ as analyticsServerEventNameSchema, _n as CashReceiptIdentityType, _r as ProductDetail, _t as PublicInquiry, a as ANALYTICS_SESSION_HEADER, an as ClaimType, ar as paymentOptionListSchema, at as Member, b as createStorefrontClient, bn as CheckoutDelivery, br as ProductSearchParams, bt as publicInquirySchema, c as AnalyticsBatch, cn as MyClaim, cr as paymentStatusSchema, ct as UpdateProfileRequest, d as AnalyticsEventName, dn as claimTypeSchema, dr as residentNumberLike, dt as memberAddressSchema, en as consentStateSchema, er as guestInfoSchema, et as myOrderItemSchema, f as AnalyticsServerEventName, fn as createClaimRequestSchema, fr as retryPaymentRequestSchema, ft as memberSchema, g as analyticsIdSchema, gn as CASH_RECEIPT_METHODS, gr as ProductCard, gt as CreateInquiryResult, h as analyticsClientEventSchema, hn as AvailablePaymentOption, hr as CategoryNode, ht as CreateInquiryRequest, i as ANALYTICS_SESSION_COOKIE, in as ClaimReturnAddress, ir as paymentOptionKey, it as trackingStageResponseSchema, j as UpdateReviewRequest, jn as PaymentFailureCategory, jr as PageParams, jt as CouponResult, k as ReviewPage, kn as PAYMENT_RESULT_VALUES, kr as OrderItemStatus, kt as CheckoutPricingRequest, l as AnalyticsClientEvent, ln as claimReasonSchema, lr as pgProviderSchema, lt as WishlistAddResult, m as analyticsClientEventNameSchema, mn as myClaimSchema, mr as startPaymentRequestSchema, mt as wishlistAddResultSchema, n as storefrontStoreSchema, nn as memberConsentsSchema, nr as paymentMessageSchema, nt as orderShippingAddressSchema, o as ANALYTICS_VISITOR_COOKIE, on as CreateClaimRequest, or as paymentOptionSchema, ot as MemberAddress, p as analyticsBatchSchema, pn as createClaimResultSchema, pr as shippingAddressInputSchema, pt as updateProfileRequestSchema, q as MyOrderItem, qn as checkoutDeliverySchema, qr as analyticsIdsFromCookie, qt as ConsentSource, r as ANALYTICS_MAX_BATCH_BYTES, rn as ClaimReason, rr as paymentMethodSchema, rt as purchaseDecisionResultSchema, s as ANALYTICS_VISITOR_HEADER, sn as CreateClaimResult, sr as paymentStartSchema, st as MemberAddressRequest, t as StorefrontStore, tn as consentUpdateRequestSchema, tr as paymentFailureCategorySchema, tt as myOrderSchema, u as AnalyticsClientEventName, un as claimReturnAddressSchema, ur as remoteAreaSchema, ut as memberAddressRequestSchema, v as StorefrontClient, vn as CashReceiptRequest, vr as ProductFacets, vt as createInquiryRequestSchema, w as StorefrontSessionOptions, wn as DeliveryQuoteResult, wr as productDetailSchema, wt as createCustomerInquiryRequestSchema, x as STOREFRONT_SESSION_KEYS, xn as CheckoutSession, xr as ProductSort, xt as CreateCustomerInquiryRequest, y as StorefrontClientOptions, yn as CashReceiptType, yr as ProductPage, yt as createInquiryResultSchema, z as updateReviewRequestSchema, zn as RetryPaymentRequest, zr as AddCartItemRequest, zt as couponApplicationSchema } from "./index-dIZNg-hO.mjs";
3
+ export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, ApplicableCoupon, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutPricing, CheckoutPricingRequest, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, DownloadLink, DownloadRequest, EasyPayProvider, FulfillmentReveal, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyCoupon, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, downloadLinkSchema, downloadRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, fulfillmentRevealSchema, fulfillmentTypeField, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, isShippingFulfillment, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, requiresShippingField, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as ANALYTICS_VISITOR_HEADER, c as analyticsClientEventSchema, i as ANALYTICS_VISITOR_COOKIE, l as analyticsIdSchema, n as ANALYTICS_SESSION_COOKIE, o as analyticsBatchSchema, r as ANALYTICS_SESSION_HEADER, s as analyticsClientEventNameSchema, t as ANALYTICS_MAX_BATCH_BYTES, u as analyticsServerEventNameSchema } from "./analytics-CgD70OqH.mjs";
2
2
  import { t as analyticsIdsFromCookie } from "./analytics-ids-COElZiI3.mjs";
3
- import { $ as updateCartItemRequestSchema, A as consentSourceSchema, B as categoryNodeSchema, C as createInquiryResultSchema, D as customerInquirySchema, E as customerInquiryCategorySchema, F as claimReturnAddressSchema, G as productSortSchema, H as productDetailSchema, I as claimTypeSchema, J as pageInfoSchema, K as claimStatusSchema, L as createClaimRequestSchema, M as consentUpdateRequestSchema, N as memberConsentsSchema, O as consentActionSchema, P as claimReasonSchema, Q as cartSchema, R as createClaimResultSchema, S as createInquiryRequestSchema, T as createCustomerInquiryRequestSchema, U as productFacetsSchema, V as productCardSchema, W as productPageSchema, X as addCartItemRequestSchema, Y as pageSchema, Z as cartItemSchema, _ as memberAddressRequestSchema, a as publicReviewSchema, at as linkIdentityRequestSchema, b as updateProfileRequestSchema, c as updateReviewRequestSchema, ct as signupRequestSchema, d as deliveryTrackingSchema, dt as withdrawRequestSchema, et as anonymousSessionSchema, f as myOrderItemSchema, ft as withdrawalBlockedDetailsSchema, g as trackingStageResponseSchema, gt as unwrapData, h as purchaseDecisionResultSchema, ht as toApiError, i as createReviewResultSchema, it as idpTokenRequestSchema, j as consentStateSchema, k as consentKindSchema, l as updateReviewResultSchema, lt as socialProviderSchema, m as orderShippingAddressSchema, mt as buildQuery, n as storefrontStoreSchema, nt as idpAuthorizeRequestSchema, o as reviewPageSchema, ot as loginRequestSchema, p as myOrderSchema, pt as ApiError, q as orderItemStatusSchema, r as createReviewRequestSchema, rt as idpAuthorizeResponseSchema, s as reviewSummarySchema, st as memberIdentitiesSchema, t as createStorefrontClient, tt as idpAgreementsSchema, u as writableReviewSchema, ut as tokenPairSchema, v as memberAddressSchema, w as publicInquirySchema, x as wishlistAddResultSchema, y as memberSchema, z as myClaimSchema } from "./client-U1LJGfWn.mjs";
4
- import { A as startPaymentRequestSchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, O as retryPaymentRequestSchema, S as paymentOptionSchema, T as pgProviderSchema, _ as paymentFailureCategorySchema, a as cashReceiptAvailable, b as paymentOptionKey, c as cashReceiptTypeSchema, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, g as guestInfoSchema, h as easyPayProviderSchema, i as availablePaymentOptionSchema, k as shippingAddressInputSchema, l as checkoutDeliverySchema, m as easyPayProviderResponseSchema, n as PAYMENT_RESULT_VALUES, o as cashReceiptIdentityTypeOf, p as deliveryQuoteSchema, r as PAYMENT_STATUS_VALUES, s as cashReceiptRequestSchema, t as CASH_RECEIPT_METHODS, u as checkoutSessionSchema, v as paymentMessageSchema, w as paymentStatusSchema, x as paymentOptionListSchema, y as paymentMethodSchema } from "./checkout-Cm9YAC5l.mjs";
3
+ import { $ as anonymousSessionSchema, A as customerInquirySchema, B as createClaimRequestSchema, C as updateProfileRequestSchema, D as publicInquirySchema, E as createInquiryResultSchema, F as consentUpdateRequestSchema, G as productDetailSchema, H as myClaimSchema, I as memberConsentsSchema, J as productSortSchema, K as productFacetsSchema, L as claimReasonSchema, M as consentKindSchema, N as consentSourceSchema, O as createCustomerInquiryRequestSchema, P as consentStateSchema, Q as updateCartItemRequestSchema, R as claimReturnAddressSchema, S as memberSchema, T as createInquiryRequestSchema, U as categoryNodeSchema, V as createClaimResultSchema, W as productCardSchema, X as cartItemSchema, Y as addCartItemRequestSchema, Z as cartSchema, _ as orderShippingAddressSchema, a as publicReviewSchema, at as loginRequestSchema, b as memberAddressRequestSchema, c as updateReviewRequestSchema, ct as socialProviderSchema, d as deliveryTrackingSchema, dt as withdrawalBlockedDetailsSchema, et as idpAgreementsSchema, f as downloadLinkSchema, ft as ApiError, g as myOrderSchema, h as myOrderItemSchema, ht as unwrapData, i as createReviewResultSchema, it as linkIdentityRequestSchema, j as consentActionSchema, k as customerInquiryCategorySchema, l as updateReviewResultSchema, lt as tokenPairSchema, m as fulfillmentRevealSchema, mt as toApiError, n as storefrontStoreSchema, nt as idpAuthorizeResponseSchema, o as reviewPageSchema, ot as memberIdentitiesSchema, p as downloadRequestSchema, pt as buildQuery, q as productPageSchema, r as createReviewRequestSchema, rt as idpTokenRequestSchema, s as reviewSummarySchema, st as signupRequestSchema, t as createStorefrontClient, tt as idpAuthorizeRequestSchema, u as writableReviewSchema, ut as withdrawRequestSchema, v as purchaseDecisionResultSchema, w as wishlistAddResultSchema, x as memberAddressSchema, y as trackingStageResponseSchema, z as claimTypeSchema } from "./client-CUF2xGu8.mjs";
4
+ import { A as startPaymentRequestSchema, B as myCouponListQuerySchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, F as checkoutPricingSchema, G as isShippingFulfillment, H as pricingAmountsSchema, I as couponApplicationListSchema, J as pageSchema, K as orderItemStatusSchema, L as couponApplicationSchema, M as MIN_PAYMENT_AMOUNT, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, R as couponBenefitViewSchema, S as paymentOptionSchema, T as pgProviderSchema, U as claimStatusSchema, V as myCouponSchema, W as fulfillmentTypeField, Y as requiresShippingField, _ as paymentFailureCategorySchema, a as cashReceiptAvailable, b as paymentOptionKey, c as cashReceiptTypeSchema, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, g as guestInfoSchema, h as easyPayProviderSchema, i as availablePaymentOptionSchema, j as MAX_COUPONS_PER_CHECKOUT, k as shippingAddressInputSchema, l as checkoutDeliverySchema, m as easyPayProviderResponseSchema, n as PAYMENT_RESULT_VALUES, o as cashReceiptIdentityTypeOf, p as deliveryQuoteSchema, q as pageInfoSchema, r as PAYMENT_STATUS_VALUES, s as cashReceiptRequestSchema, t as CASH_RECEIPT_METHODS, u as checkoutSessionSchema, v as paymentMessageSchema, w as paymentStatusSchema, x as paymentOptionListSchema, y as paymentMethodSchema, z as couponResultSchema } from "./checkout-wrCpR-P1.mjs";
5
5
  //#region src/session.ts
6
6
  /** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
7
7
  const STOREFRONT_SESSION_KEYS = {
@@ -125,4 +125,4 @@ function createStorefrontSession(options) {
125
125
  };
126
126
  }
127
127
  //#endregion
128
- export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, CASH_RECEIPT_METHODS, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
128
+ export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, CASH_RECEIPT_METHODS, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, downloadLinkSchema, downloadRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, fulfillmentRevealSchema, fulfillmentTypeField, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, isShippingFulfillment, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, requiresShippingField, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
@@ -1,4 +1,4 @@
1
- import { Jt as CashReceiptRequest, dn as PaymentStart, fn as PaymentStatus, gn as ShippingAddressInput, j as createStorefrontClient, nn as GuestInfo, un as PaymentOption } from "../index-BaSx86ts.mjs";
1
+ import { Bn as ShippingAddressInput, En as GuestInfo, Fn as PaymentStart, In as PaymentStatus, Pn as PaymentOption, Vn as StartPaymentRequest, b as createStorefrontClient, vn as CashReceiptRequest } from "../index-dIZNg-hO.mjs";
2
2
  //#region src/payments/index.d.ts
3
3
  /**
4
4
  * 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
@@ -107,10 +107,15 @@ export interface PaymentsOptions {
107
107
  }
108
108
  export interface StartOptions {
109
109
  option: PaymentOption;
110
- shippingAddress: ShippingAddressInput;
110
+ /** 배송지 — 주문서의 `requiresShipping`이 false(배송이 필요 없는 주문)면 생략한다 */
111
+ shippingAddress?: ShippingAddressInput;
111
112
  guest?: GuestInfo;
112
113
  /** 현금영수증 신청 — 계좌이체·가상계좌 옵션에서만 보낸다 */
113
114
  cashReceipt?: CashReceiptRequest;
115
+ /** 적용할 쿠폰 — 결제 시작이 예약하고 할인한 금액으로 결제한다 */
116
+ coupons?: StartPaymentRequest["coupons"];
117
+ /** 청약철회 제한 동의 — 주문서의 `withdrawal.required`가 true면 true로 보낸다 */
118
+ withdrawalAgreement?: boolean;
114
119
  returnUrl?: string;
115
120
  mode?: PaymentMode;
116
121
  /** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창. 폼 검증이 비동기라 클릭 태스크를 넘길 때 쓴다 */
@@ -1,4 +1,4 @@
1
- import { v as paymentMessageSchema } from "../checkout-Cm9YAC5l.mjs";
1
+ import { v as paymentMessageSchema } from "../checkout-wrCpR-P1.mjs";
2
2
  //#region src/payments/index.ts
3
3
  /** 복귀 주소에 결제 서비스가 붙이는 쿼리 */
4
4
  const RETURN_PAYMENT_ID = "sayrenPaymentId";
@@ -289,6 +289,8 @@ function createPayments(options) {
289
289
  shippingAddress: startOptions.shippingAddress,
290
290
  guest: startOptions.guest,
291
291
  ...startOptions.cashReceipt ? { cashReceipt: startOptions.cashReceipt } : {},
292
+ ...startOptions.coupons ? { coupons: startOptions.coupons } : {},
293
+ ...startOptions.withdrawalAgreement !== void 0 ? { withdrawalAgreement: startOptions.withdrawalAgreement } : {},
292
294
  returnUrl
293
295
  }));
294
296
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/storefront-sdk",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -64,6 +64,13 @@ import {
64
64
  consentUpdateRequestSchema,
65
65
  memberConsentsSchema,
66
66
  } from "./schemas/consent";
67
+ import {
68
+ applicableCouponSchema,
69
+ type CheckoutPricingRequest,
70
+ checkoutPricingRequestSchema,
71
+ checkoutPricingSchema,
72
+ myCouponSchema,
73
+ } from "./schemas/coupon";
67
74
  import {
68
75
  type CreateCustomerInquiryRequest,
69
76
  type CustomerInquiryCategory,
@@ -79,7 +86,14 @@ import {
79
86
  type UpdateProfileRequest,
80
87
  updateProfileRequestSchema,
81
88
  } from "./schemas/member";
82
- import { deliveryTrackingSchema, myOrderSchema } from "./schemas/order";
89
+ import {
90
+ type DownloadRequest,
91
+ deliveryTrackingSchema,
92
+ downloadLinkSchema,
93
+ downloadRequestSchema,
94
+ fulfillmentRevealSchema,
95
+ myOrderSchema,
96
+ } from "./schemas/order";
83
97
  import {
84
98
  type CreateReviewRequest,
85
99
  createReviewRequestSchema,
@@ -308,6 +322,19 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
308
322
  http.request("POST", path`/checkout/${checkoutId}/payment`, paymentStartSchema, {
309
323
  body: startPaymentRequestSchema.parse(body),
310
324
  }),
325
+ /**
326
+ * `POST /checkout/{checkoutId}/pricing` — 쿠폰 금액 미리보기(이슈 #47). 주문서를 바꾸지 않고 쿠폰을 예약하지 않는다.
327
+ * 확정은 결제 시작의 `coupons`다. 코드 입력은 구매자당 분당 10회까지다(429 `TOO_MANY_REQUESTS`).
328
+ *
329
+ * 에러: 404 `COUPON_NOT_FOUND`(없는 코드·남의 쿠폰) · 409 `COUPONS_UNAVAILABLE`(지금 쿠폰을 쓸 수 없음)
330
+ */
331
+ pricing: (checkoutId: string, body: CheckoutPricingRequest) =>
332
+ http.request("POST", path`/checkout/${checkoutId}/pricing`, checkoutPricingSchema, {
333
+ body: checkoutPricingRequestSchema.parse(body),
334
+ }),
335
+ /** `GET /checkout/{checkoutId}/coupons` — 이 주문서에 쓸 수 있는 내 쿠폰과 예상 할인(회원 전용) */
336
+ applicableCoupons: (checkoutId: string) =>
337
+ http.request("GET", path`/checkout/${checkoutId}/coupons`, z.array(applicableCouponSchema)),
311
338
  },
312
339
 
313
340
  payments: {
@@ -347,6 +374,55 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
347
374
  http.request("POST", path`/guest/orders/${orderId}`, myOrderSchema, { body }),
348
375
  getDelivery: (orderItemId: string) =>
349
376
  http.request("GET", path`/me/order-items/${orderItemId}/delivery`, deliveryTrackingSchema),
377
+ /**
378
+ * 코드 열람 (이슈 #48) — 코드 발급 상품의 평문 코드. 처음 열람한 시각이 제공 개시 증거로 남는다.
379
+ *
380
+ * 에러: 404 `ORDER_ITEM_NOT_FOUND`(없거나 남의 주문상품) · 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·코드 상품 아님) ·
381
+ * 429 `TOO_MANY_REQUESTS`
382
+ */
383
+ revealCode: (orderItemId: string) =>
384
+ http.request(
385
+ "POST",
386
+ path`/me/order-items/${orderItemId}/fulfillment/reveal`,
387
+ fulfillmentRevealSchema,
388
+ ),
389
+ /**
390
+ * 파일 다운로드 (이슈 #48) — 수명 300초의 서명 주소를 받는다. 받을 때마다 남은 횟수가 준다.
391
+ *
392
+ * 에러: 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·파일 상품 아님) · 409 `DOWNLOAD_LIMIT_REACHED`(횟수 소진) ·
393
+ * 409 `DOWNLOAD_EXPIRED`(기한 지남) · 400 `ASSET_REQUIRED`(파일이 여러 개인데 `assetId` 없음)
394
+ */
395
+ createDownload: (orderItemId: string, body: DownloadRequest = {}) =>
396
+ http.request("POST", path`/me/order-items/${orderItemId}/downloads`, downloadLinkSchema, {
397
+ body: downloadRequestSchema.parse(body),
398
+ }),
399
+ /** 비회원 다운로드 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인한다 */
400
+ createGuestDownload: (
401
+ orderId: string,
402
+ orderItemId: string,
403
+ body: { phone: string; orderPassword: string; assetId?: string },
404
+ ) =>
405
+ http.request(
406
+ "POST",
407
+ path`/guest/orders/${orderId}/order-items/${orderItemId}/downloads`,
408
+ downloadLinkSchema,
409
+ { body },
410
+ ),
411
+ /**
412
+ * 비회원 코드 열람 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인하고 같은 시도 한도를 쓴다.
413
+ * 틀리면 구분 없이 404 `ORDER_NOT_FOUND`다.
414
+ */
415
+ revealGuestCode: (
416
+ orderId: string,
417
+ orderItemId: string,
418
+ body: { phone: string; orderPassword: string },
419
+ ) =>
420
+ http.request(
421
+ "POST",
422
+ path`/guest/orders/${orderId}/order-items/${orderItemId}/fulfillment/reveal`,
423
+ fulfillmentRevealSchema,
424
+ { body },
425
+ ),
350
426
  decidePurchase: (orderItemId: string) =>
351
427
  http.requestVoid("POST", path`/me/order-items/${orderItemId}/purchase-decision`),
352
428
  },
@@ -418,6 +494,9 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
418
494
  },
419
495
 
420
496
  me: {
497
+ /** `GET /me/coupons` — 내 쿠폰(이슈 #47). `status`로 사용 가능·사용함·기간 지남을 거른다 */
498
+ coupons: (params?: { status?: "available" | "used" | "expired" }) =>
499
+ http.request("GET", "/me/coupons", z.array(myCouponSchema), { query: params as Query }),
421
500
  customerInquiries: {
422
501
  create: (body: CreateCustomerInquiryRequest) =>
423
502
  http.request("POST", "/me/customer-inquiries", customerInquirySchema, {
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./schemas/checkout";
11
11
  export * from "./schemas/claim";
12
12
  export * from "./schemas/common";
13
13
  export * from "./schemas/consent";
14
+ export * from "./schemas/coupon";
14
15
  export * from "./schemas/customer-inquiry";
15
16
  export * from "./schemas/inquiry";
16
17
  export * from "./schemas/member";
@@ -7,6 +7,7 @@ import {
7
7
  type PaymentStatus,
8
8
  paymentMessageSchema,
9
9
  type ShippingAddressInput,
10
+ type StartPaymentRequest,
10
11
  } from "../schemas/checkout";
11
12
 
12
13
  /**
@@ -235,10 +236,15 @@ export interface PaymentsOptions {
235
236
 
236
237
  export interface StartOptions {
237
238
  option: PaymentOption;
238
- shippingAddress: ShippingAddressInput;
239
+ /** 배송지 — 주문서의 `requiresShipping`이 false(배송이 필요 없는 주문)면 생략한다 */
240
+ shippingAddress?: ShippingAddressInput;
239
241
  guest?: GuestInfo;
240
242
  /** 현금영수증 신청 — 계좌이체·가상계좌 옵션에서만 보낸다 */
241
243
  cashReceipt?: CashReceiptRequest;
244
+ /** 적용할 쿠폰 — 결제 시작이 예약하고 할인한 금액으로 결제한다 */
245
+ coupons?: StartPaymentRequest["coupons"];
246
+ /** 청약철회 제한 동의 — 주문서의 `withdrawal.required`가 true면 true로 보낸다 */
247
+ withdrawalAgreement?: boolean;
242
248
  returnUrl?: string;
243
249
  mode?: PaymentMode;
244
250
  /** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창. 폼 검증이 비동기라 클릭 태스크를 넘길 때 쓴다 */
@@ -527,6 +533,10 @@ export function createPayments(options: PaymentsOptions): Payments {
527
533
  shippingAddress: startOptions.shippingAddress,
528
534
  guest: startOptions.guest,
529
535
  ...(startOptions.cashReceipt ? { cashReceipt: startOptions.cashReceipt } : {}),
536
+ ...(startOptions.coupons ? { coupons: startOptions.coupons } : {}),
537
+ ...(startOptions.withdrawalAgreement !== undefined
538
+ ? { withdrawalAgreement: startOptions.withdrawalAgreement }
539
+ : {}),
530
540
  returnUrl,
531
541
  }),
532
542
  );
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { fulfillmentTypeField, requiresShippingField } from "./common";
2
3
 
3
4
  export const cartItemSchema = z.object({
4
5
  cartItemId: z.string(),
@@ -10,6 +11,7 @@ export const cartItemSchema = z.object({
10
11
  quantity: z.number().int(),
11
12
  unitPrice: z.number().int(),
12
13
  totalPrice: z.number().int(),
14
+ fulfillmentType: fulfillmentTypeField(),
13
15
  purchasable: z.boolean(),
14
16
  unpurchasableReason: z.enum(["SOLD_OUT", "SUSPENDED", "CLOSED"]).nullable(),
15
17
  });
@@ -22,6 +24,9 @@ export const cartSchema = z.object({
22
24
  productAmount: z.number().int(),
23
25
  deliveryFee: z.number().int(),
24
26
  totalAmount: z.number().int(),
27
+ requiresShipping: requiresShippingField(
28
+ "구매 가능한 항목 중 택배 배송이 필요한 상품이 있는가. false면 배송비가 0이고 주문서가 배송지를 받지 않는다.",
29
+ ),
25
30
  }),
26
31
  });
27
32
 
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type PageParams, pageSchema } from "./common";
2
+ import { fulfillmentTypeField, type PageParams, pageSchema, requiresShippingField } from "./common";
3
3
 
4
4
  export interface CategoryNode {
5
5
  categoryId: string;
@@ -29,6 +29,10 @@ export const productCardSchema = z.object({
29
29
  .describe("즉시 할인 적용가. 원 단위. 할인이 없으면 null"),
30
30
  discountRate: z.number().int().nullable().describe("할인율(%). 할인이 없으면 null"),
31
31
  freeShipping: z.boolean(),
32
+ fulfillmentType: fulfillmentTypeField(),
33
+ requiresShipping: requiresShippingField(
34
+ "택배 배송이 필요한 상품인가. false면 배송비가 없고 주문서가 배송지를 받지 않는다.",
35
+ ),
32
36
  averageRating: z.number(),
33
37
  reviewCount: z.number().int(),
34
38
  soldOut: z.boolean(),
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod";
2
+ import { requiresShippingField } from "./common";
3
+ import { couponApplicationListSchema } from "./coupon";
2
4
 
3
5
  export const createCheckoutRequestSchema = z
4
6
  .object({
@@ -73,10 +75,43 @@ export const checkoutSessionSchema = z.object({
73
75
  productAmount: z.number().int(),
74
76
  deliveryFee: z.number().int(),
75
77
  totalAmount: z.number().int(),
78
+ couponDiscountAmount: z
79
+ .number()
80
+ .int()
81
+ .optional()
82
+ .default(0)
83
+ .describe(
84
+ "쿠폰 할인(상품·주문 쿠폰). 주문서는 쿠폰 전이라 0이고, 결제 시작 응답은 적용한 쿠폰의 할인이다",
85
+ ),
86
+ deliveryDiscountAmount: z
87
+ .number()
88
+ .int()
89
+ .optional()
90
+ .default(0)
91
+ .describe("배송비 쿠폰 할인. 쿠폰이 없으면 0"),
76
92
  }),
77
93
  delivery: checkoutDeliverySchema.describe(
78
94
  "배송비 내역. 배송지를 입력하면 금액이 바뀔 수 있다 — 최종 금액은 결제 시작 응답의 `amounts`다",
79
95
  ),
96
+ requiresShipping: requiresShippingField(
97
+ "택배 배송이 필요한 상품이 있는가. false면 배송지를 받지 않는다 — 결제 시작에 `shippingAddress`를 보내지 않아도 된다.",
98
+ ),
99
+ withdrawal: z
100
+ .object({
101
+ required: z
102
+ .boolean()
103
+ .describe(
104
+ "청약철회 제한 상품(제공이 시작되면 취소·반품할 수 없는 파일·코드·이용권)이 있는가. true면 `notice`를 결제 전에 보여 주고 " +
105
+ "동의를 받아 결제 시작에 `withdrawalAgreement: true`를 보낸다",
106
+ ),
107
+ notice: z
108
+ .string()
109
+ .nullable()
110
+ .describe("구매자에게 보여 줄 고지 문구. `required`가 false면 null"),
111
+ })
112
+ .optional()
113
+ .default({ required: false, notice: null })
114
+ .describe("청약철회 제한 고지(이슈 #48). 서버는 항상 싣는다"),
80
115
  expiresAt: z.string(),
81
116
  paymentOptions: z
82
117
  .lazy(() => paymentOptionListSchema)
@@ -342,9 +377,28 @@ export const startPaymentRequestSchema = z.object({
342
377
  .describe(
343
378
  "결제를 마치면 돌아올 스토어프론트 주소. 스토어 결제 도메인에 등록된 도메인이어야 한다",
344
379
  ),
345
- shippingAddress: shippingAddressInputSchema,
380
+ shippingAddress: shippingAddressInputSchema
381
+ .optional()
382
+ .describe(
383
+ "배송지. 주문서의 `requiresShipping`이 true면 필수이고 없으면 400 `SHIPPING_ADDRESS_REQUIRED`다. " +
384
+ "배송이 필요 없는 주문(파일·코드·이용권·방문 수령만)은 보내지 않아도 된다. 보내면 형식을 검사한 뒤 버린다",
385
+ ),
346
386
  guest: guestInfoSchema.optional(),
387
+ withdrawalAgreement: z
388
+ .boolean()
389
+ .optional()
390
+ .describe(
391
+ "청약철회 제한 동의. 주문서의 `withdrawal.required`가 true면 true여야 하고 아니면 400 `WITHDRAWAL_AGREEMENT_REQUIRED`다. " +
392
+ "동의 시각이 주문에 남는다",
393
+ ),
347
394
  cashReceipt: cashReceiptField,
395
+ coupons: couponApplicationListSchema
396
+ .optional()
397
+ .describe(
398
+ "적용할 쿠폰(이슈 #47). 결제 시작이 쿠폰을 예약하고 할인한 금액으로 결제 금액을 정한다 — 응답의 `amounts`가 확정 금액이다. " +
399
+ "적용하지 못하는 쿠폰이 하나라도 있으면 400 `COUPON_NOT_APPLICABLE`(`details`에 사유)이다. 결제가 실패하거나 만료되면 예약이 풀린다. " +
400
+ "쿠폰을 바꾸려면 새로 결제를 시작한다(재시도는 같은 쿠폰을 쓴다)",
401
+ ),
348
402
  });
349
403
 
350
404
  export type StartPaymentRequest = z.infer<typeof startPaymentRequestSchema>;
@@ -42,7 +42,8 @@ export const createClaimResultSchema = z.object({
42
42
  .int()
43
43
  .nullable()
44
44
  .describe(
45
- "예상 환불액 — 수량 비율 상품 금액 − 반품 배송비. **배송비 환불은 여기 포함되지 않고 " +
45
+ "예상 환불액 — 수량 비율 상품 실결제 금액(쿠폰 할인을 뺀 금액) − 반품 배송비 − 조건부 무료배송 미달 차감 " +
46
+ "− 쿠폰 조건 미달 차감(`couponChargeAmount`) + 되돌릴 쿠폰 차감. **배송비 환불은 여기 포함되지 않고 " +
46
47
  "`deliveryFeeRefundAmount`로 따로 온다**(승인 시점의 배송 묶음 상태로 확정되기 때문이다). " +
47
48
  "교환은 환불이 없어 null이다",
48
49
  ),
@@ -52,6 +53,24 @@ export const createClaimResultSchema = z.object({
52
53
  .number()
53
54
  .int()
54
55
  .describe("환불 예정 배송비. 배송 묶음이 모두 취소되거나 판매자 귀책일 때만 0보다 크다"),
56
+ couponChargeAmount: z
57
+ .number()
58
+ .int()
59
+ .optional()
60
+ .default(0)
61
+ .describe(
62
+ "쿠폰 조건 미달 차감 예상액. 이 취소·반품으로 남은 주문상품이 쿠폰 조건(최소 주문 금액 등)을 잃으면 " +
63
+ "남은 주문상품이 받던 쿠폰 할인을 환불액에서 뺀다. 예상 환불액에 이미 반영돼 있다. 서버는 항상 싣는다",
64
+ ),
65
+ couponChargeRefundAmount: z
66
+ .number()
67
+ .int()
68
+ .optional()
69
+ .default(0)
70
+ .describe(
71
+ "되돌릴 쿠폰 차감 예상액 — 앞선 취소·반품에서 뺀 쿠폰 조건 미달 차감 중 이번에 돌려받을 몫이다. " +
72
+ "예상 환불액에 이미 반영돼 있다. 서버는 항상 싣는다",
73
+ ),
55
74
  });
56
75
 
57
76
  export type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
@@ -87,7 +106,7 @@ export const myClaimSchema = z.object({
87
106
  .int()
88
107
  .nullable()
89
108
  .describe(
90
- "예상 환불액 — 수량 비율 상품 금액 − 반품 배송비 − 조건부 무료배송 미달 차감. " +
109
+ "예상 환불액 — 수량 비율 상품 실결제 금액 − 반품 배송비 − 조건부 무료배송 미달 차감 − 쿠폰 조건 미달 차감 + 되돌릴 쿠폰 차감. " +
91
110
  "**배송비 환불은 포함되지 않고 `expectedDeliveryFeeRefundAmount`로 따로 온다.** 교환은 null이다",
92
111
  ),
93
112
  expectedDeliveryFeeRefundAmount: z
@@ -44,3 +44,33 @@ export const claimStatusSchema = z.enum([
44
44
  ]);
45
45
 
46
46
  export type ClaimStatus = z.infer<typeof claimStatusSchema>;
47
+
48
+ /**
49
+ * 상품 유형 (이슈 #48). 응답에서는 문자열로 받는다(값이 추가될 수 있다). 현재 값은 `SHIPPING`(배송 상품)·
50
+ * `DOWNLOAD`(파일 다운로드)·`CODE`(코드 발급)·`SERVICE`(이용권·서비스)·`PICKUP`(방문 수령)이다.
51
+ * 이 필드 이전 서버의 응답에는 없어 `SHIPPING`으로 읽는다. 서버는 항상 싣는다.
52
+ */
53
+ export const fulfillmentTypeField = () =>
54
+ z
55
+ .string()
56
+ .optional()
57
+ .default("SHIPPING")
58
+ .describe(
59
+ "상품 유형. 현재 값은 `SHIPPING`(배송 상품)·`DOWNLOAD`(파일 다운로드)·`CODE`(코드 발급)·`SERVICE`(이용권·서비스)·" +
60
+ "`PICKUP`(방문 수령)이고 값이 추가될 수 있어 문자열로 받는다. 서버는 항상 싣는다",
61
+ );
62
+
63
+ /**
64
+ * 배송 필요 여부 (이슈 #48). false면 배송지를 받지 않는다. 이 필드 이전 서버의 응답에는 없어 true로 읽는다.
65
+ */
66
+ export const requiresShippingField = (description: string) =>
67
+ z.boolean().optional().default(true).describe(`${description} 서버는 항상 싣는다`);
68
+
69
+ /** 배송이 필요한 상품 유형인가 — 배송 상품(`SHIPPING`)만 택배 배송이 있다. 모르는 값은 배송 상품으로 본다 */
70
+ export function isShippingFulfillment(fulfillmentType: string | null | undefined): boolean {
71
+ return (
72
+ fulfillmentType === undefined ||
73
+ fulfillmentType === null ||
74
+ !["DOWNLOAD", "CODE", "SERVICE", "PICKUP"].includes(fulfillmentType)
75
+ );
76
+ }