@sayren/storefront-sdk 0.20.6 → 0.20.8
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/auth/index.mjs +1 -1
- package/dist/{checkout-CE-r7SFw.mjs → checkout-BjJ4Efbn.mjs} +133 -11
- package/dist/{client-D8DDKutm.mjs → client-S_gOAeBM.mjs} +104 -5
- package/dist/{index-Ca0AyapE.d.mts → index-Bv49jTFH.d.mts} +874 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/payments/index.d.mts +1 -1
- package/dist/payments/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client.ts +68 -0
- package/src/index.ts +2 -0
- package/src/schemas/catalog.ts +10 -0
- package/src/schemas/checkout.ts +12 -0
- package/src/schemas/commerce-flow.ts +88 -0
- package/src/schemas/coupon.ts +73 -0
- package/src/schemas/fulfillment.ts +53 -3
- package/src/schemas/order.ts +10 -0
- package/src/schemas/product-options.ts +72 -2
- package/src/schemas/stay.ts +32 -0
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
|
|
3
|
-
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AddonGroupView, AddonSelection, 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, CollectionProductPage, CollectionProductParams, CollectionProductSortParam, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomInputEntry, CustomInputValueView, CustomInputView, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStartStatus, KnownPaymentStatus, LineFulfillment, LinkIdentityRequest, LoginRequest, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MemberPointEntry, MemberPoints, MyClaim, MyCoupon, MyOrder, MyOrderItem, MyOrderItemFulfillmentSnapshot, MyReview, OptionSelectionView, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductCardFulfillment, ProductDetail, ProductFacets, ProductFulfillmentView, ProductInquiryCategory, ProductPage, ProductReviewParams, ProductReviewSort, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, ResponsePaymentMethod, RetryPaymentRequest, ReviewImageUploadRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, StorefrontCollection, StorefrontCollectionDetail, StorefrontPointPolicy, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UnknownFulfillmentView, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, UploadTicket, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, 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, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, commerceNumberField, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customInputEntrySchema, customInputLength, customInputValueViewSchema, customInputViewSchema, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, formatOrderNo, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, myReviewSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, parseOrderNo, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productInquiryCategorySchema, productPageSchema, productReviewQuerySchema, productReviewSortSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
2
|
+
import { $ as FlowInputField, $i as claimStatusSchema, $n as ConsentSource, $r as cashReceiptIdentityTypeOf, $t as reviewSummarySchema, A as StorefrontPointPolicy, Ai as ProductDetail, An as CheckoutPricingRequest, Ar as DeliveryQuoteResult, At as StorefrontSessionOptions, B as deliveryTrackingSchema, Bi as collectionProductSortSchema, Bn as checkoutPricingSchema, Br as PaymentMessage, Bt as ReviewSummary, C as lineSelectionResponseShape, Ci as shippingAddressInputSchema, Cn as CustomerInquiry, Cr as CashReceiptIdentityType, Ct as analyticsServerEventNameSchema, D as parseCustomInputValue, Di as CollectionProductParams, Dn as customerInquirySchema, Dr as CheckoutSession, Dt as STOREFRONT_SESSION_KEYS, E as orderInputUploadRequestSchema, Ei as CollectionProductPage, En as customerInquiryCategorySchema, Er as CheckoutDelivery, Et as createStorefrontClient, F as DeliveryTracking, Fi as StorefrontCollection, Fn as MyCoupon, Fr as KnownPaymentStatus, Ft as ProductReviewParams, G as trackingStageResponseSchema, Gi as productSortSchema, Gn as myCouponListQuerySchema, Gr as PgProvider, Gt as createReviewRequestSchema, H as myOrderSchema, Hi as productDetailSchema, Hn as couponApplicationSchema, Hr as PaymentOption, Ht as UpdateReviewResult, I as MyOrder, Ii as StorefrontCollectionDetail, In as StorefrontCoupon, Ir as PAYMENT_RESULT_VALUES, It as ProductReviewSort, J as parseOrderNo, Ji as storefrontCollectionSchema, Jn as storefrontCouponListQuerySchema, Jr as RetryPaymentRequest, Jt as productReviewQuerySchema, K as commerceNumberField, Ki as storefrontCollectionDetailSchema, Kn as myCouponSchema, Kr as RemoteArea, Kt as createReviewResultSchema, L as MyOrderItem, Li as categoryNodeSchema, Ln as StorefrontCouponListParams, Lr as PAYMENT_START_STATUS_VALUES, Lt as PublicReview, M as memberPointEntrySchema, Mi as ProductPage, Mn as CouponResult, Mr as GuestInfo, Mt as CreateReviewRequest, N as memberPointsSchema, Ni as ProductSearchParams, Nn as MAX_COUPONS_PER_CHECKOUT, Nr as KnownPaymentResult, Nt as CreateReviewResult, O as MemberPointEntry, Oi as CollectionProductSortParam, On as ApplicableCoupon, Or as CreateCheckoutRequest, Ot as SessionStorage, P as storefrontPointPolicySchema, Pi as ProductSort, Pn as MIN_PAYMENT_AMOUNT, Pr as KnownPaymentStartStatus, Pt as MyReview, Q as FlowFieldValue, Qi as PageParams, Qn as ConsentKind, Qr as cashReceiptAvailable, Qt as reviewPageSchema, R as OrderShippingAddress, Ri as collectionProductPageSchema, Rn as applicableCouponSchema, Rr as PAYMENT_STATUS_VALUES, Rt as ReviewImageUploadRequest, S as lineSelectionRequestShape, Sa as analyticsIdsFromCookie, Si as retryPaymentRequestSchema, Sn as CreateCustomerInquiryRequest, Sr as CASH_RECEIPT_METHODS, St as analyticsIdSchema, T as optionSelectionViewSchema, Ti as CategoryNode, Tn as createCustomerInquiryRequestSchema, Tr as CashReceiptType, Tt as StorefrontClientOptions, U as orderShippingAddressSchema, Ui as productFacetsSchema, Un as couponBenefitViewSchema, Ur as PaymentStart, Ut as UploadTicket, V as myOrderItemSchema, Vi as productCardSchema, Vn as couponApplicationListSchema, Vr as PaymentMethod, Vt as UpdateReviewRequest, W as purchaseDecisionResultSchema, Wi as productPageSchema, Wn as couponResultSchema, Wr as PaymentStatus, Wt as WritableReview, X as FlowActionRequest, Xi as OrderItemStatus, Xn as storefrontCouponTargetSchema, Xr as StartPaymentRequest, Xt as publicReviewSchema, Y as FlowAction, Yi as ClaimStatus, Yn as storefrontCouponSchema, Yr as ShippingAddressInput, Yt as productReviewSortSchema, Z as FlowActionResult, Zi as PageInfo, Zn as ConsentAction, Zr as availablePaymentOptionSchema, Zt as reviewImageUploadRequestSchema, _ as addonSelectionSchema, _a as UpdateCartItemRequest, _i as paymentStatusSchema, _n as PublicInquiry, _r as claimTypeSchema, _t as AnalyticsEventName, a as StayView, aa as PickupLocationView, ai as deliveryQuoteRequestSchema, an as MemberAddress, ar as consentSourceSchema, at as flowFieldValueSchema, b as customInputValueViewSchema, ba as cartSchema, bi as residentNumberLike, bn as productInquiryCategorySchema, br as myClaimSchema, bt as analyticsClientEventNameSchema, c as stayViewSchema, ca as UnknownFulfillmentView, ci as easyPayProviderSchema, cn as WishlistAddResult, cr as memberConsentsSchema, ct as guestFlowActionRequestSchema, d as CustomInputEntry, da as pickupLocationViewSchema, di as paymentMessageSchema, dn as memberSchema, dr as ClaimType, dt as ANALYTICS_SESSION_HEADER, ea as orderItemStatusSchema, ei as cashReceiptRequestSchema, en as updateReviewRequestSchema, er as ConsentState, et as FlowState, f as CustomInputValueView, fa as productCardFulfillmentSchema, fi as paymentMethodSchema, fn as updateProfileRequestSchema, fr as CreateClaimRequest, ft as ANALYTICS_VISITOR_COOKIE, g as addonGroupViewSchema, ga as CartItem, gi as paymentStartSchema, gn as ProductInquiryCategory, gr as claimReturnAddressSchema, gt as AnalyticsClientEventName, h as OrderInputUploadRequest, ha as Cart, hi as paymentOptionSchema, hn as CreateInquiryResult, hr as claimReasonSchema, ht as AnalyticsClientEvent, i as StayRequest, ia as MyOrderItemFulfillmentSnapshot, ii as createCheckoutRequestSchema, in as Member, ir as consentKindSchema, it as flowActionSchema, j as memberPointEntryPageSchema, ji as ProductFacets, jn as CouponApplication, jr as EasyPayProvider, jt as createStorefrontSession, k as MemberPoints, ki as ProductCard, kn as CheckoutPricing, kr as DeliveryQuoteRequest, kt as StorefrontSession, l as AddonGroupView, la as lineFulfillmentSchema, li as guestInfoSchema, ln as memberAddressRequestSchema, lr as ClaimReason, lt as ANALYTICS_MAX_BATCH_BYTES, m as OptionSelectionView, ma as AddCartItemRequest, mi as paymentOptionListSchema, mn as CreateInquiryRequest, mr as MyClaim, mt as AnalyticsBatch, n as storefrontStoreSchema, na as pageSchema, ni as checkoutDeliverySchema, nn as uploadTicketSchema, nr as MemberConsents, nt as flowActionRequestSchema, o as calendarDayViewSchema, oa as ProductCardFulfillment, oi as deliveryQuoteSchema, on as MemberAddressRequest, or as consentStateSchema, ot as flowInputFieldSchema, p as CustomInputView, pa as productFulfillmentViewSchema, pi as paymentOptionKey, pn as wishlistAddResultSchema, pr as CreateClaimResult, pt as ANALYTICS_VISITOR_HEADER, q as formatOrderNo, qi as storefrontCollectionListQuerySchema, qn as pricingAmountsSchema, qr as ResponsePaymentMethod, qt as myReviewSchema, r as CalendarDayView, ra as LineFulfillment, ri as checkoutSessionSchema, rn as writableReviewSchema, rr as consentActionSchema, rt as flowActionResultSchema, s as stayRequestSchema, sa as ProductFulfillmentView, si as easyPayProviderResponseSchema, sn as UpdateProfileRequest, sr as consentUpdateRequestSchema, st as flowStateSchema, t as StorefrontStore, ta as pageInfoSchema, ti as cashReceiptTypeSchema, tn as updateReviewResultSchema, tr as ConsentUpdateRequest, tt as GuestFlowActionRequest, u as AddonSelection, ua as myOrderItemFulfillmentSnapshotSchema, ui as paymentFailureCategorySchema, un as memberAddressSchema, ur as ClaimReturnAddress, ut as ANALYTICS_SESSION_COOKIE, v as customInputEntrySchema, va as addCartItemRequestSchema, vi as pgProviderSchema, vn as createInquiryRequestSchema, vr as createClaimRequestSchema, vt as AnalyticsServerEventName, w as normalizeCustomInputValue, wi as startPaymentRequestSchema, wn as CustomerInquiryCategory, wr as CashReceiptRequest, wt as StorefrontClient, x as customInputViewSchema, xa as updateCartItemRequestSchema, xi as responsePaymentMethodSchema, xn as publicInquirySchema, xr as AvailablePaymentOption, xt as analyticsClientEventSchema, y as customInputLength, ya as cartItemSchema, yi as remoteAreaSchema, yn as createInquiryResultSchema, yr as createClaimResultSchema, yt as analyticsBatchSchema, z as PurchaseDecisionResult, zi as collectionProductQuerySchema, zn as checkoutPricingRequestSchema, zr as PaymentFailureCategory, zt as ReviewPage } from "./index-Bv49jTFH.mjs";
|
|
3
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AddonGroupView, AddonSelection, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, ApplicableCoupon, AvailablePaymentOption, CASH_RECEIPT_METHODS, CalendarDayView, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutPricing, CheckoutPricingRequest, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, CollectionProductPage, CollectionProductParams, CollectionProductSortParam, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomInputEntry, CustomInputValueView, CustomInputView, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, FlowAction, FlowActionRequest, FlowActionResult, FlowFieldValue, FlowInputField, FlowState, GuestFlowActionRequest, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStartStatus, KnownPaymentStatus, LineFulfillment, LinkIdentityRequest, LoginRequest, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MemberPointEntry, MemberPoints, MyClaim, MyCoupon, MyOrder, MyOrderItem, MyOrderItemFulfillmentSnapshot, MyReview, OptionSelectionView, OrderInputUploadRequest, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, PickupLocationView, ProductCard, ProductCardFulfillment, ProductDetail, ProductFacets, ProductFulfillmentView, ProductInquiryCategory, ProductPage, ProductReviewParams, ProductReviewSort, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, ResponsePaymentMethod, RetryPaymentRequest, ReviewImageUploadRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, StayRequest, StayView, type StorefrontClient, type StorefrontClientOptions, StorefrontCollection, StorefrontCollectionDetail, StorefrontCoupon, StorefrontCouponListParams, StorefrontPointPolicy, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UnknownFulfillmentView, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, UploadTicket, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, calendarDayViewSchema, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, commerceNumberField, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customInputEntrySchema, customInputLength, customInputValueViewSchema, customInputViewSchema, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowStateSchema, formatOrderNo, guestFlowActionRequestSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, myReviewSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderInputUploadRequestSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, parseCustomInputValue, parseOrderNo, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pickupLocationViewSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productInquiryCategorySchema, productPageSchema, productReviewQuerySchema, productReviewSortSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, stayRequestSchema, stayViewSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontCouponListQuerySchema, storefrontCouponSchema, storefrontCouponTargetSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, 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
|
|
4
|
-
import { $ as
|
|
3
|
+
import { $ as claimTypeSchema, A as wishlistAddResultSchema, At as idpTokenRequestSchema, B as consentSourceSchema, Bt as buildQuery, C as orderShippingAddressSchema, Ct as cartItemSchema, D as memberAddressSchema, Dt as idpAgreementsSchema, E as memberAddressRequestSchema, Et as anonymousSessionSchema, F as createCustomerInquiryRequestSchema, Ft as socialProviderSchema, G as flowActionResultSchema, H as consentUpdateRequestSchema, Ht as unwrapData, I as customerInquiryCategorySchema, It as tokenPairSchema, J as flowInputFieldSchema, K as flowActionSchema, L as customerInquirySchema, Lt as withdrawRequestSchema, M as createInquiryResultSchema, Mt as loginRequestSchema, N as productInquiryCategorySchema, Nt as memberIdentitiesSchema, O as memberSchema, Ot as idpAuthorizeRequestSchema, P as publicInquirySchema, Pt as signupRequestSchema, Q as claimReturnAddressSchema, R as consentActionSchema, Rt as withdrawalBlockedDetailsSchema, S as myOrderSchema, St as addCartItemRequestSchema, T as trackingStageResponseSchema, Tt as updateCartItemRequestSchema, U as memberConsentsSchema, V as consentStateSchema, Vt as toApiError, W as flowActionRequestSchema, X as guestFlowActionRequestSchema, Y as flowStateSchema, Z as claimReasonSchema, _ as memberPointEntrySchema, _t as storefrontCollectionSchema, a as myReviewSchema, at as parseOrderNo, b as deliveryTrackingSchema, bt as pageInfoSchema, c as publicReviewSchema, ct as collectionProductQuerySchema, d as reviewSummarySchema, dt as productDetailSchema, et as createClaimRequestSchema, f as updateReviewRequestSchema, ft as productFacetsSchema, g as memberPointEntryPageSchema, gt as storefrontCollectionListQuerySchema, h as writableReviewSchema, ht as storefrontCollectionDetailSchema, i as createReviewResultSchema, it as formatOrderNo, j as createInquiryRequestSchema, jt as linkIdentityRequestSchema, k as updateProfileRequestSchema, kt as idpAuthorizeResponseSchema, l as reviewImageUploadRequestSchema, lt as collectionProductSortSchema, m as uploadTicketSchema, mt as productSortSchema, n as storefrontStoreSchema, nt as myClaimSchema, o as productReviewQuerySchema, ot as categoryNodeSchema, p as updateReviewResultSchema, pt as productPageSchema, q as flowFieldValueSchema, r as createReviewRequestSchema, rt as commerceNumberField, s as productReviewSortSchema, st as collectionProductPageSchema, t as createStorefrontClient, tt as createClaimResultSchema, u as reviewPageSchema, ut as productCardSchema, v as memberPointsSchema, vt as claimStatusSchema, w as purchaseDecisionResultSchema, wt as cartSchema, x as myOrderItemSchema, xt as pageSchema, y as storefrontPointPolicySchema, yt as orderItemStatusSchema, z as consentKindSchema, zt as ApiError } from "./client-S_gOAeBM.mjs";
|
|
4
|
+
import { $ as customInputViewSchema, A as retryPaymentRequestSchema, B as couponBenefitViewSchema, C as paymentOptionSchema, D as remoteAreaSchema, E as pgProviderSchema, F as applicableCouponSchema, G as storefrontCouponListQuerySchema, H as myCouponListQuerySchema, I as checkoutPricingRequestSchema, J as addonGroupViewSchema, K as storefrontCouponSchema, L as checkoutPricingSchema, M as startPaymentRequestSchema, N as MAX_COUPONS_PER_CHECKOUT, O as residentNumberLike, P as MIN_PAYMENT_AMOUNT, Q as customInputValueViewSchema, R as couponApplicationListSchema, S as paymentOptionListSchema, T as paymentStatusSchema, U as myCouponSchema, V as couponResultSchema, W as pricingAmountsSchema, X as customInputEntrySchema, Y as addonSelectionSchema, Z as customInputLength, _ as guestInfoSchema, a as availablePaymentOptionSchema, at as parseCustomInputValue, b as paymentMethodSchema, c as cashReceiptRequestSchema, ct as stayViewSchema, d as checkoutSessionSchema, dt as pickupLocationViewSchema, et as lineSelectionRequestShape, f as createCheckoutRequestSchema, ft as productCardFulfillmentSchema, g as easyPayProviderSchema, h as easyPayProviderResponseSchema, i as PAYMENT_STATUS_VALUES, it as orderInputUploadRequestSchema, j as shippingAddressInputSchema, k as responsePaymentMethodSchema, l as cashReceiptTypeSchema, lt as lineFulfillmentSchema, m as deliveryQuoteSchema, n as PAYMENT_RESULT_VALUES, nt as normalizeCustomInputValue, o as cashReceiptAvailable, ot as calendarDayViewSchema, p as deliveryQuoteRequestSchema, pt as productFulfillmentViewSchema, q as storefrontCouponTargetSchema, r as PAYMENT_START_STATUS_VALUES, rt as optionSelectionViewSchema, s as cashReceiptIdentityTypeOf, st as stayRequestSchema, t as CASH_RECEIPT_METHODS, tt as lineSelectionResponseShape, u as checkoutDeliverySchema, ut as myOrderItemFulfillmentSnapshotSchema, v as paymentFailureCategorySchema, w as paymentStartSchema, x as paymentOptionKey, y as paymentMessageSchema, z as couponApplicationSchema } from "./checkout-BjJ4Efbn.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, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, PAYMENT_RESULT_VALUES, PAYMENT_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, 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, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, commerceNumberField, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customInputEntrySchema, customInputLength, customInputValueViewSchema, customInputViewSchema, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, formatOrderNo, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, myReviewSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, parseOrderNo, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productInquiryCategorySchema, productPageSchema, productReviewQuerySchema, productReviewSortSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, 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_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, calendarDayViewSchema, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, commerceNumberField, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customInputEntrySchema, customInputLength, customInputValueViewSchema, customInputViewSchema, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowStateSchema, formatOrderNo, guestFlowActionRequestSchema, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, myReviewSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderInputUploadRequestSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, parseCustomInputValue, parseOrderNo, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pickupLocationViewSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productInquiryCategorySchema, productPageSchema, productReviewQuerySchema, productReviewSortSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, stayRequestSchema, stayViewSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontCouponListQuerySchema, storefrontCouponSchema, storefrontCouponTargetSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as createStorefrontClient, Hr as PaymentOption, Mr as GuestInfo, Ur as PaymentStart, Wr as PaymentStatus, Xr as StartPaymentRequest, Yr as ShippingAddressInput, wr as CashReceiptRequest } from "../index-Bv49jTFH.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
package/dist/payments/index.mjs
CHANGED
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -57,6 +57,11 @@ import {
|
|
|
57
57
|
createClaimResultSchema,
|
|
58
58
|
myClaimSchema,
|
|
59
59
|
} from "./schemas/claim";
|
|
60
|
+
import {
|
|
61
|
+
flowActionRequestSchema,
|
|
62
|
+
flowActionResultSchema,
|
|
63
|
+
guestFlowActionRequestSchema,
|
|
64
|
+
} from "./schemas/commerce-flow";
|
|
60
65
|
import {
|
|
61
66
|
type ClaimStatus,
|
|
62
67
|
type OrderItemStatus,
|
|
@@ -74,6 +79,8 @@ import {
|
|
|
74
79
|
checkoutPricingRequestSchema,
|
|
75
80
|
checkoutPricingSchema,
|
|
76
81
|
myCouponSchema,
|
|
82
|
+
type StorefrontCouponListParams,
|
|
83
|
+
storefrontCouponSchema,
|
|
77
84
|
} from "./schemas/coupon";
|
|
78
85
|
import {
|
|
79
86
|
type CreateCustomerInquiryRequest,
|
|
@@ -81,6 +88,7 @@ import {
|
|
|
81
88
|
createCustomerInquiryRequestSchema,
|
|
82
89
|
customerInquirySchema,
|
|
83
90
|
} from "./schemas/customer-inquiry";
|
|
91
|
+
import { pickupLocationViewSchema } from "./schemas/fulfillment";
|
|
84
92
|
import { type CreateInquiryRequest, publicInquirySchema } from "./schemas/inquiry";
|
|
85
93
|
import {
|
|
86
94
|
type MemberAddressRequest,
|
|
@@ -110,6 +118,7 @@ import {
|
|
|
110
118
|
uploadTicketSchema,
|
|
111
119
|
writableReviewSchema,
|
|
112
120
|
} from "./schemas/review";
|
|
121
|
+
import { calendarDayViewSchema } from "./schemas/stay";
|
|
113
122
|
import { storefrontStoreSchema } from "./schemas/store";
|
|
114
123
|
import type { StorefrontSession } from "./session";
|
|
115
124
|
|
|
@@ -274,6 +283,17 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
274
283
|
query: params as Query,
|
|
275
284
|
},
|
|
276
285
|
),
|
|
286
|
+
/**
|
|
287
|
+
* `GET /products/{productId}/calendar` — 날짜별 재고 상품(상세 `inventoryMode: "DATED"`, 이슈 #118)의 날마다 예약 가능 여부·가격.
|
|
288
|
+
* 기간은 포함이고 최대 120일이다. `variantId`를 생략하면 기본 조합이다
|
|
289
|
+
*/
|
|
290
|
+
getProductCalendar: (
|
|
291
|
+
productId: string,
|
|
292
|
+
params: { from: string; to: string; variantId?: string },
|
|
293
|
+
) =>
|
|
294
|
+
http.request("GET", path`/products/${productId}/calendar`, z.array(calendarDayViewSchema), {
|
|
295
|
+
query: params as Query,
|
|
296
|
+
}),
|
|
277
297
|
createInquiry: (productId: string, body: CreateInquiryRequest) =>
|
|
278
298
|
http.requestVoid("POST", path`/products/${productId}/inquiries`, { body }),
|
|
279
299
|
/** 노출 중인 컬렉션(노출 켜짐 + 기간 안) — 셀러가 정한 순서 */
|
|
@@ -281,6 +301,14 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
281
301
|
http.request("GET", "/collections", pageSchema(storefrontCollectionSchema), {
|
|
282
302
|
query: params as Query,
|
|
283
303
|
}),
|
|
304
|
+
/**
|
|
305
|
+
* `GET /coupons` — 지금 받을 수 있는 쿠폰(이슈 #110). `productId`를 주면 그 상품에 쓸 수 있는 쿠폰만 싣는다.
|
|
306
|
+
* 회원 토큰이 있으면 항목마다 `downloaded`·`downloadable`을 싣는다. 받기는 `me.downloadCoupon`이다
|
|
307
|
+
*/
|
|
308
|
+
listCoupons: (params?: StorefrontCouponListParams) =>
|
|
309
|
+
http.request("GET", "/coupons", pageSchema(storefrontCouponSchema), {
|
|
310
|
+
query: params as Query,
|
|
311
|
+
}),
|
|
284
312
|
/** 숨김·기간 밖·없음은 모두 404 `COLLECTION_NOT_FOUND` */
|
|
285
313
|
getCollection: (slug: string) =>
|
|
286
314
|
http.request("GET", path`/collections/${slug}`, storefrontCollectionDetailSchema),
|
|
@@ -291,6 +319,11 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
291
319
|
}),
|
|
292
320
|
},
|
|
293
321
|
|
|
322
|
+
/** `GET /pickup-locations` — 방문 수령 장소(이슈 #115). 주문서의 `pickupLocationId`로 고른다 */
|
|
323
|
+
pickupLocations: {
|
|
324
|
+
list: () => http.request("GET", "/pickup-locations", z.array(pickupLocationViewSchema)),
|
|
325
|
+
},
|
|
326
|
+
|
|
294
327
|
cart: {
|
|
295
328
|
get: () => http.request("GET", "/cart", cartSchema),
|
|
296
329
|
addItem: (body: AddCartItemRequest) =>
|
|
@@ -393,6 +426,32 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
393
426
|
http.request("GET", path`/me/order-items/${orderItemId}/delivery`, deliveryTrackingSchema),
|
|
394
427
|
decidePurchase: (orderItemId: string) =>
|
|
395
428
|
http.requestVoid("POST", path`/me/order-items/${orderItemId}/purchase-decision`),
|
|
429
|
+
/**
|
|
430
|
+
* `POST /me/order-items/{id}/actions/{key}` — 주문상품 `actions`에 켜진 행동을 실행한다(#115, 시안 승인 등).
|
|
431
|
+
* 응답의 `flowState`·`actions`로 화면을 바로 바꾼다. 에러: 409 `ACTION_NOT_AVAILABLE`(`details.reason`)
|
|
432
|
+
*/
|
|
433
|
+
act: (orderItemId: string, key: string, input: Record<string, unknown> = {}) =>
|
|
434
|
+
http.request(
|
|
435
|
+
"POST",
|
|
436
|
+
path`/me/order-items/${orderItemId}/actions/${key}`,
|
|
437
|
+
flowActionResultSchema,
|
|
438
|
+
{
|
|
439
|
+
body: flowActionRequestSchema.parse({ input }),
|
|
440
|
+
},
|
|
441
|
+
),
|
|
442
|
+
/** 비회원 행동 — 비회원 주문 조회와 같은 연락처·비밀번호 확인과 시도 한도를 지난다 */
|
|
443
|
+
guestAct: (
|
|
444
|
+
orderId: string,
|
|
445
|
+
orderItemId: string,
|
|
446
|
+
key: string,
|
|
447
|
+
body: { phone: string; orderPassword: string; input?: Record<string, unknown> },
|
|
448
|
+
) =>
|
|
449
|
+
http.request(
|
|
450
|
+
"POST",
|
|
451
|
+
path`/guest/orders/${orderId}/items/${orderItemId}/actions/${key}`,
|
|
452
|
+
flowActionResultSchema,
|
|
453
|
+
{ body: guestFlowActionRequestSchema.parse(body) },
|
|
454
|
+
),
|
|
396
455
|
},
|
|
397
456
|
|
|
398
457
|
myClaims: {
|
|
@@ -485,6 +544,15 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
485
544
|
/** `GET /me/coupons` — 내 쿠폰(이슈 #47). `status`로 사용 가능·사용함·기간 지남을 거른다 */
|
|
486
545
|
coupons: (params?: { status?: "available" | "used" | "expired" }) =>
|
|
487
546
|
http.request("GET", "/me/coupons", z.array(myCouponSchema), { query: params as Query }),
|
|
547
|
+
/**
|
|
548
|
+
* `POST /coupons/{couponId}/download` — 쿠폰 받기(이슈 #110, 회원 전용). 받은 쿠폰 한 장(내 쿠폰 항목)을 돌려준다.
|
|
549
|
+
*
|
|
550
|
+
* 에러(`ApiError.code`): 401 `UNAUTHORIZED`, 404 `COUPON_NOT_FOUND`(없음·중지·종료·다운로드 쿠폰 아님),
|
|
551
|
+
* 409 `COUPON_ALREADY_DOWNLOADED`(1인 장수를 다 받음)·`COUPON_SOLD_OUT`(총 발급 한도 소진)·`COUPON_NOT_STARTED`·
|
|
552
|
+
* `COUPON_EXPIRED`·`COUPONS_UNAVAILABLE`, 429 `TOO_MANY_REQUESTS`
|
|
553
|
+
*/
|
|
554
|
+
downloadCoupon: (couponId: string) =>
|
|
555
|
+
http.request("POST", path`/coupons/${couponId}/download`, myCouponSchema),
|
|
488
556
|
customerInquiries: {
|
|
489
557
|
create: (body: CreateCustomerInquiryRequest) =>
|
|
490
558
|
http.request("POST", "/me/customer-inquiries", customerInquirySchema, {
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./schemas/cart";
|
|
|
9
9
|
export * from "./schemas/catalog";
|
|
10
10
|
export * from "./schemas/checkout";
|
|
11
11
|
export * from "./schemas/claim";
|
|
12
|
+
export * from "./schemas/commerce-flow";
|
|
12
13
|
export * from "./schemas/commerce-number";
|
|
13
14
|
export * from "./schemas/common";
|
|
14
15
|
export * from "./schemas/consent";
|
|
@@ -21,6 +22,7 @@ export * from "./schemas/order";
|
|
|
21
22
|
export * from "./schemas/points";
|
|
22
23
|
export * from "./schemas/product-options";
|
|
23
24
|
export * from "./schemas/review";
|
|
25
|
+
export * from "./schemas/stay";
|
|
24
26
|
export * from "./schemas/store";
|
|
25
27
|
export {
|
|
26
28
|
createStorefrontSession,
|
package/src/schemas/catalog.ts
CHANGED
|
@@ -104,6 +104,10 @@ export const productDetailSchema = productCardSchema.extend({
|
|
|
104
104
|
name: z.string(),
|
|
105
105
|
additionalPrice: z.number().int(),
|
|
106
106
|
soldOut: z.boolean(),
|
|
107
|
+
attributes: z
|
|
108
|
+
.record(z.string(), z.string())
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("조합 속성(이슈 #115, 예: 회차 일시 `showAt`). 없으면 생략"),
|
|
107
111
|
}),
|
|
108
112
|
),
|
|
109
113
|
addonGroups: z
|
|
@@ -113,6 +117,12 @@ export const productDetailSchema = productCardSchema.extend({
|
|
|
113
117
|
.describe(
|
|
114
118
|
"추가 선택 옵션명(이슈 #59). 배열 순서가 표시 순서다. 담기·바로 구매의 `addons`로 `{groupId, valueId}`를 보낸다. 없으면 빈 배열. 서버는 항상 싣는다",
|
|
115
119
|
),
|
|
120
|
+
inventoryMode: z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe(
|
|
124
|
+
"재고 방식(이슈 #118). `DATED`면 날짜별 재고 상품이다 — 달력(`GET /products/{id}/calendar`)으로 날짜를 고르고 담기·바로 구매에 `stay`를 보낸다. 없으면 일반 상품",
|
|
125
|
+
),
|
|
116
126
|
customInputs: z
|
|
117
127
|
.array(customInputViewSchema)
|
|
118
128
|
.optional()
|
package/src/schemas/checkout.ts
CHANGED
|
@@ -14,6 +14,18 @@ export const createCheckoutRequestSchema = z
|
|
|
14
14
|
...lineSelectionRequestShape,
|
|
15
15
|
})
|
|
16
16
|
.optional(),
|
|
17
|
+
fulfillmentMethod: z
|
|
18
|
+
.enum(["CARRIER", "DIRECT", "PICKUP", "PROVIDED"])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe(
|
|
21
|
+
"이행 방식(이슈 #115). 모든 줄에 같은 방식을 적용하고, 상품 `fulfillment.methods`에 없는 줄이 있으면 400 `FULFILLMENT_METHOD_NOT_ALLOWED`다. 생략하면 줄마다 상품 허용 방식의 첫 값이다. 방문 수령(`PICKUP`)은 배송지·배송비가 없다",
|
|
22
|
+
),
|
|
23
|
+
pickupLocationId: z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(
|
|
27
|
+
"방문 수령 장소(`GET /pickup-locations`). 방식이 `PICKUP`이고 상점에 픽업 장소가 있으면 필수(400 `PICKUP_LOCATION_REQUIRED`), 없거나 쓰지 않는 장소면 400 `PICKUP_LOCATION_NOT_FOUND`. 다른 방식에 주면 400 `PICKUP_LOCATION_NOT_APPLICABLE`",
|
|
28
|
+
),
|
|
17
29
|
})
|
|
18
30
|
.refine((value) => (value.cartItemIds ? !value.directItem : !!value.directItem), {
|
|
19
31
|
message: "cartItemIds와 directItem 중 하나만 전달해야 합니다",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { orderItemStatusSchema } from "./common";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 커머스 플로우(이슈 #115) — 구매자가 보는 주문상품의 지금 상태와 할 수 있는 행동. 화면은 이 값만 그리고 상태 이름(`key`)으로
|
|
6
|
+
* 분기하지 않는다. 행동 키·필드 키·꺼진 이유는 열린 문자열이다(모르는 값도 파싱한다). 공개 상태(`coreStatus`)만 닫힌 값이다.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const flowInputFieldSchema = z.object({
|
|
10
|
+
key: z.string(),
|
|
11
|
+
type: z.string().describe("text · number · select · date · datetime · image (늘어날 수 있다)"),
|
|
12
|
+
required: z.boolean(),
|
|
13
|
+
label: z.string(),
|
|
14
|
+
maxLength: z.number().int().optional(),
|
|
15
|
+
maxFiles: z.number().int().optional(),
|
|
16
|
+
options: z.array(z.union([z.string(), z.number()])).optional(),
|
|
17
|
+
});
|
|
18
|
+
export type FlowInputField = z.infer<typeof flowInputFieldSchema>;
|
|
19
|
+
|
|
20
|
+
export const flowActionSchema = z.object({
|
|
21
|
+
key: z.string(),
|
|
22
|
+
label: z.string().describe("버튼에 쓸 이름"),
|
|
23
|
+
mode: z.enum(["INSTANT", "REQUEST", "VIEW"]),
|
|
24
|
+
enabled: z.boolean(),
|
|
25
|
+
disabled: z.object({ reason: z.string(), message: z.string().optional() }).optional(),
|
|
26
|
+
availableUntil: z.string().optional().describe("이 시각까지만 할 수 있다(ISO 8601)"),
|
|
27
|
+
subflow: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe(
|
|
31
|
+
"취소·반품·교환 요청처럼 하위 플로우를 시작하는 행동. 지금은 클레임 API(`POST /me/order-items/{id}/claims`)로 실행한다",
|
|
32
|
+
),
|
|
33
|
+
input: z.array(flowInputFieldSchema).optional().describe("받는 입력 폼"),
|
|
34
|
+
partialQuantity: z.union([z.boolean(), z.literal("UNIT")]).optional(),
|
|
35
|
+
});
|
|
36
|
+
export type FlowAction = z.infer<typeof flowActionSchema>;
|
|
37
|
+
|
|
38
|
+
/** 커스텀 필드 값 — 문자열(날짜·일시는 ISO 8601)·숫자·참거짓·null, 수량 단위 필드는 문자열 배열 */
|
|
39
|
+
export const flowFieldValueSchema = z.union([
|
|
40
|
+
z.string(),
|
|
41
|
+
z.number(),
|
|
42
|
+
z.boolean(),
|
|
43
|
+
z.null(),
|
|
44
|
+
z.array(z.string()),
|
|
45
|
+
]);
|
|
46
|
+
export type FlowFieldValue = z.infer<typeof flowFieldValueSchema>;
|
|
47
|
+
|
|
48
|
+
export const flowStateSchema = z.object({
|
|
49
|
+
key: z.string(),
|
|
50
|
+
label: z.string().describe("구매자에게 보여 줄 상태 이름"),
|
|
51
|
+
coreStatus: orderItemStatusSchema.optional(),
|
|
52
|
+
message: z.string().optional().describe("구매자 안내문"),
|
|
53
|
+
enteredAt: z.string(),
|
|
54
|
+
deadlineAt: z.string().optional().describe("가장 가까운 기한(ISO 8601)"),
|
|
55
|
+
attachments: z
|
|
56
|
+
.array(z.string())
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("가장 최근 행동이 붙인 첨부 주소(시안 등, #115). 없으면 생략"),
|
|
59
|
+
progress: z.boolean().optional(),
|
|
60
|
+
fields: z.record(z.string(), flowFieldValueSchema).describe("구매자 공개 범위의 커스텀 필드"),
|
|
61
|
+
});
|
|
62
|
+
export type FlowState = z.infer<typeof flowStateSchema>;
|
|
63
|
+
|
|
64
|
+
export const flowActionRequestSchema = z.object({
|
|
65
|
+
input: z.record(z.string(), z.unknown()).optional(),
|
|
66
|
+
});
|
|
67
|
+
export type FlowActionRequest = z.infer<typeof flowActionRequestSchema>;
|
|
68
|
+
|
|
69
|
+
/** 비회원 행동 — 비회원 주문 조회와 같은 확인(연락처·주문 조회 비밀번호)을 함께 보낸다 */
|
|
70
|
+
export const guestFlowActionRequestSchema = flowActionRequestSchema.extend({
|
|
71
|
+
phone: z.string(),
|
|
72
|
+
orderPassword: z.string(),
|
|
73
|
+
});
|
|
74
|
+
export type GuestFlowActionRequest = z.infer<typeof guestFlowActionRequestSchema>;
|
|
75
|
+
|
|
76
|
+
export const flowActionResultSchema = z.object({
|
|
77
|
+
status: z.literal("COMPLETED"),
|
|
78
|
+
flowState: flowStateSchema,
|
|
79
|
+
actions: z.array(flowActionSchema),
|
|
80
|
+
affectedOrderItemIds: z.array(z.string()),
|
|
81
|
+
claim: z
|
|
82
|
+
.object({ claimId: z.string(), claimNo: z.string().nullable() })
|
|
83
|
+
.optional()
|
|
84
|
+
.describe(
|
|
85
|
+
"취소·반품·교환 행동(하위 플로우 `core.claim.*`)이 접수한 클레임(#115). 클레임 API(`POST /me/order-items/{id}/claims`)와 같은 접수다. 다른 행동은 생략",
|
|
86
|
+
),
|
|
87
|
+
});
|
|
88
|
+
export type FlowActionResult = z.infer<typeof flowActionResultSchema>;
|
package/src/schemas/coupon.ts
CHANGED
|
@@ -220,6 +220,12 @@ export const myCouponSchema = z.object({
|
|
|
220
220
|
validUntil: z.string().nullable(),
|
|
221
221
|
usedOrderId: z.string().nullable(),
|
|
222
222
|
issuedAt: z.string(),
|
|
223
|
+
source: z
|
|
224
|
+
.string()
|
|
225
|
+
.optional()
|
|
226
|
+
.describe(
|
|
227
|
+
"받은 경로(이슈 #110). 현재 값은 `MANUAL`(셀러 지급)·`DOWNLOAD`(직접 받음)·`SIGNUP`(회원가입 축하)이고 값이 늘 수 있다. 서버는 항상 싣는다",
|
|
228
|
+
),
|
|
223
229
|
});
|
|
224
230
|
export type MyCoupon = z.infer<typeof myCouponSchema>;
|
|
225
231
|
|
|
@@ -231,3 +237,70 @@ export const myCouponListQuerySchema = z.object({
|
|
|
231
237
|
"`available`=사용 가능(결제 중 포함), `used`=사용함, `expired`=기간 지남. 생략하면 전부",
|
|
232
238
|
),
|
|
233
239
|
});
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 받을 수 있는 쿠폰 (이슈 #110) — `GET /coupons`. 셀러가 「다운로드」 방식으로 만든 쿠폰 중 지금 받을 수 있는 것
|
|
243
|
+
* (사용 중, 기간 안, 총 발급 한도가 남음)이다. 받은 쿠폰은 내 쿠폰(`GET /me/coupons`)과 주문서의 적용 가능 쿠폰에 그대로 뜬다.
|
|
244
|
+
*/
|
|
245
|
+
export const storefrontCouponTargetSchema = z.object({
|
|
246
|
+
allProducts: z
|
|
247
|
+
.boolean()
|
|
248
|
+
.describe("전 상품 대상인가(포함 목록이 비어 있다). 제외 목록은 따로 본다"),
|
|
249
|
+
includeProductIds: z.array(z.string()).describe("대상 상품 id"),
|
|
250
|
+
includeCategoryIds: z
|
|
251
|
+
.array(z.string())
|
|
252
|
+
.describe("대상 카테고리 id. 하위 카테고리 상품도 대상이다"),
|
|
253
|
+
excludeProductIds: z.array(z.string()).describe("제외 상품 id. 포함보다 우선한다"),
|
|
254
|
+
excludeCategoryIds: z.array(z.string()).describe("제외 카테고리 id. 포함보다 우선한다"),
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
export const storefrontCouponSchema = z.object({
|
|
258
|
+
couponId: z.string(),
|
|
259
|
+
name: z.string(),
|
|
260
|
+
description: z.string().nullable(),
|
|
261
|
+
kind: z.string().describe("쿠폰 종류. 현재 값은 `ORDER`(주문 쿠폰)·`PRODUCT`(상품 쿠폰)"),
|
|
262
|
+
benefit: couponBenefitViewSchema,
|
|
263
|
+
minOrderAmount: z.number().int().describe("최소 주문 금액(원). 0이면 조건 없음"),
|
|
264
|
+
stackWithInstantDiscount: z
|
|
265
|
+
.boolean()
|
|
266
|
+
.describe("즉시할인 중인 상품에도 쓰는가. false면 할인 중인 상품에는 적용되지 않는다"),
|
|
267
|
+
target: storefrontCouponTargetSchema,
|
|
268
|
+
startsAt: z.string().nullable().describe("사용 시작 시각. 없으면 null"),
|
|
269
|
+
endsAt: z
|
|
270
|
+
.string()
|
|
271
|
+
.nullable()
|
|
272
|
+
.describe("사용 종료 시각(이 시각부터 받거나 쓸 수 없다). 없으면 null"),
|
|
273
|
+
validDaysAfterIssue: z
|
|
274
|
+
.number()
|
|
275
|
+
.int()
|
|
276
|
+
.nullable()
|
|
277
|
+
.describe("받은 뒤 유효 일수. 쿠폰 종료 시각과 둘 중 먼저 끝나는 쪽이 적용된다. 없으면 null"),
|
|
278
|
+
perMemberIssueLimit: z.number().int().describe("1인이 받을 수 있는 장수"),
|
|
279
|
+
loginRequired: z.boolean().describe("받으려면 로그인이 필요한가 — 회원 토큰 없이 부르면 true"),
|
|
280
|
+
downloaded: z
|
|
281
|
+
.boolean()
|
|
282
|
+
.nullable()
|
|
283
|
+
.describe("이미 받았는가(회수되지 않은 발급이 있다). 회원 토큰이 없으면 null"),
|
|
284
|
+
downloadable: z
|
|
285
|
+
.boolean()
|
|
286
|
+
.nullable()
|
|
287
|
+
.describe("지금 더 받을 수 있는가(1인 장수가 남았다). 회원 토큰이 없으면 null"),
|
|
288
|
+
});
|
|
289
|
+
export type StorefrontCoupon = z.infer<typeof storefrontCouponSchema>;
|
|
290
|
+
|
|
291
|
+
export const storefrontCouponListQuerySchema = z.object({
|
|
292
|
+
productId: z
|
|
293
|
+
.string()
|
|
294
|
+
.optional()
|
|
295
|
+
.describe(
|
|
296
|
+
"이 상품에 쓸 수 있는 쿠폰만(대상 상품·카테고리 기준). 주문 쿠폰은 제외 대상이 아니면 싣는다",
|
|
297
|
+
),
|
|
298
|
+
page: z.string().optional().describe("페이지 번호 (1부터, 기본 1)"),
|
|
299
|
+
size: z.string().optional().describe("페이지 크기 (기본 20, 최대 100)"),
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
export interface StorefrontCouponListParams {
|
|
303
|
+
productId?: string;
|
|
304
|
+
page?: number;
|
|
305
|
+
size?: number;
|
|
306
|
+
}
|
|
@@ -41,6 +41,13 @@ function openUnion<T extends z.ZodType>(known: T) {
|
|
|
41
41
|
]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
const methodsViewSchema = z
|
|
45
|
+
.array(z.string())
|
|
46
|
+
.optional()
|
|
47
|
+
.describe(
|
|
48
|
+
"고를 수 있는 이행 방식(이슈 #115). 현재 값은 `CARRIER`(택배)·`DIRECT`(직접 배달)·`PICKUP`(방문 수령)·`PROVIDED`(제공 처리)이고 값이 추가될 수 있어 문자열로 받는다. 첫 값이 기본이다. 서버는 항상 싣는다",
|
|
49
|
+
);
|
|
50
|
+
|
|
44
51
|
const requiresShippingDescription =
|
|
45
52
|
"택배 배송이 필요한가. false면 배송비가 없고 주문서가 배송지를 받지 않는다";
|
|
46
53
|
|
|
@@ -81,8 +88,13 @@ export const productFulfillmentViewSchema = openUnion(
|
|
|
81
88
|
.int()
|
|
82
89
|
.describe("단순 변심 교환 배송비(유효 환불 정책). 원 단위"),
|
|
83
90
|
}),
|
|
91
|
+
methods: methodsViewSchema,
|
|
92
|
+
}),
|
|
93
|
+
z.object({
|
|
94
|
+
type: z.literal("MANUAL"),
|
|
95
|
+
requiresShipping: z.literal(false),
|
|
96
|
+
methods: methodsViewSchema,
|
|
84
97
|
}),
|
|
85
|
-
z.object({ type: z.literal("MANUAL"), requiresShipping: z.literal(false) }),
|
|
86
98
|
]),
|
|
87
99
|
).describe(
|
|
88
100
|
"상품 이행. `type`이 유형이고 같은 이름의 키가 유형별 안내다. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다",
|
|
@@ -94,6 +106,12 @@ export type ProductFulfillmentView = z.infer<typeof productFulfillmentViewSchema
|
|
|
94
106
|
export const lineFulfillmentSchema = z.object({
|
|
95
107
|
type: z.string().describe("상품 유형. 값이 추가될 수 있어 문자열로 받는다"),
|
|
96
108
|
requiresShipping: z.boolean().describe(requiresShippingDescription),
|
|
109
|
+
method: z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe(
|
|
113
|
+
"이행 방식(이슈 #115). 주문서 줄은 고른 방식, 장바구니 줄은 기본 방식이다. 값이 추가될 수 있어 문자열로 받는다",
|
|
114
|
+
),
|
|
97
115
|
withdrawalRestricted: z
|
|
98
116
|
.boolean()
|
|
99
117
|
.optional()
|
|
@@ -105,14 +123,46 @@ export const lineFulfillmentSchema = z.object({
|
|
|
105
123
|
|
|
106
124
|
export type LineFulfillment = z.infer<typeof lineFulfillmentSchema>;
|
|
107
125
|
|
|
126
|
+
/** 픽업 장소 — 방문 수령(`PICKUP`) 주문서에서 고른다 */
|
|
127
|
+
export const pickupLocationViewSchema = z.object({
|
|
128
|
+
locationId: z.string(),
|
|
129
|
+
name: z.string(),
|
|
130
|
+
address: z.string(),
|
|
131
|
+
phone: z.string().nullable(),
|
|
132
|
+
hours: z.string().nullable().describe("수령 가능 시간 안내"),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export type PickupLocationView = z.infer<typeof pickupLocationViewSchema>;
|
|
136
|
+
|
|
137
|
+
const snapshotMethodSchema = z
|
|
138
|
+
.string()
|
|
139
|
+
.optional()
|
|
140
|
+
.describe(
|
|
141
|
+
"주문 시점 이행 방식(이슈 #115). 값이 추가될 수 있어 문자열로 받는다. `requiresShipping`은 유형 규칙이고, 방문 수령(`PICKUP`)이면 배송지가 없다",
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const snapshotPickupSchema = pickupLocationViewSchema
|
|
145
|
+
.optional()
|
|
146
|
+
.describe("방문 수령에서 고른 장소(주문 시점 값). 없으면 생략");
|
|
147
|
+
|
|
108
148
|
/**
|
|
109
149
|
* 내 주문 주문상품의 주문 시점 이행 스냅샷. 상품을 나중에 고쳐도 바뀌지 않는다. 제공 기록(제공 시각·판매자 안내)은
|
|
110
150
|
* 주문상품의 `fulfillment`다.
|
|
111
151
|
*/
|
|
112
152
|
export const myOrderItemFulfillmentSnapshotSchema = openUnion(
|
|
113
153
|
z.discriminatedUnion("type", [
|
|
114
|
-
z.object({
|
|
115
|
-
|
|
154
|
+
z.object({
|
|
155
|
+
type: z.literal("SHIPPING"),
|
|
156
|
+
requiresShipping: z.literal(true),
|
|
157
|
+
method: snapshotMethodSchema,
|
|
158
|
+
pickupLocation: snapshotPickupSchema,
|
|
159
|
+
}),
|
|
160
|
+
z.object({
|
|
161
|
+
type: z.literal("MANUAL"),
|
|
162
|
+
requiresShipping: z.literal(false),
|
|
163
|
+
method: snapshotMethodSchema,
|
|
164
|
+
pickupLocation: snapshotPickupSchema,
|
|
165
|
+
}),
|
|
116
166
|
]),
|
|
117
167
|
).describe("주문 시점 이행 스냅샷. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다");
|
|
118
168
|
|
package/src/schemas/order.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { easyPayProviderResponseSchema, responsePaymentMethodSchema } from "./checkout";
|
|
3
|
+
import { flowActionSchema, flowStateSchema } from "./commerce-flow";
|
|
3
4
|
import { commerceNumberField } from "./commerce-number";
|
|
4
5
|
import { orderItemStatusSchema } from "./common";
|
|
5
6
|
import { myOrderItemFulfillmentSnapshotSchema } from "./fulfillment";
|
|
@@ -68,6 +69,15 @@ export const myOrderItemSchema = z.object({
|
|
|
68
69
|
claimStatus: z.string().nullable(),
|
|
69
70
|
reviewWritten: z.boolean(),
|
|
70
71
|
autoDecisionDate: z.string().nullable(),
|
|
72
|
+
flowState: flowStateSchema
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("주문 플로우의 지금 상태(이슈 #115). 플로우가 없는 주문상품은 없다"),
|
|
75
|
+
actions: z
|
|
76
|
+
.array(flowActionSchema)
|
|
77
|
+
.optional()
|
|
78
|
+
.describe(
|
|
79
|
+
"지금 할 수 있는 행동. 화면은 이 목록으로 버튼을 그린다(상태 이름으로 분기하지 않는다)",
|
|
80
|
+
),
|
|
71
81
|
});
|
|
72
82
|
|
|
73
83
|
export type MyOrderItem = z.infer<typeof myOrderItemSchema>;
|