@sayren/storefront-sdk 0.20.7 → 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-Bt6j2eDw.mjs → checkout-BjJ4Efbn.mjs} +98 -10
- package/dist/{client-Dn_JdIqv.mjs → client-S_gOAeBM.mjs} +91 -5
- package/dist/{index-atHaDBC3.d.mts → index-Bv49jTFH.d.mts} +760 -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 +49 -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/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, 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, 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, storefrontCouponListQuerySchema, storefrontCouponSchema, storefrontCouponTargetSchema, 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 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
|
|
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, storefrontCouponListQuerySchema, storefrontCouponSchema, storefrontCouponTargetSchema, 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,
|
|
@@ -83,6 +88,7 @@ import {
|
|
|
83
88
|
createCustomerInquiryRequestSchema,
|
|
84
89
|
customerInquirySchema,
|
|
85
90
|
} from "./schemas/customer-inquiry";
|
|
91
|
+
import { pickupLocationViewSchema } from "./schemas/fulfillment";
|
|
86
92
|
import { type CreateInquiryRequest, publicInquirySchema } from "./schemas/inquiry";
|
|
87
93
|
import {
|
|
88
94
|
type MemberAddressRequest,
|
|
@@ -112,6 +118,7 @@ import {
|
|
|
112
118
|
uploadTicketSchema,
|
|
113
119
|
writableReviewSchema,
|
|
114
120
|
} from "./schemas/review";
|
|
121
|
+
import { calendarDayViewSchema } from "./schemas/stay";
|
|
115
122
|
import { storefrontStoreSchema } from "./schemas/store";
|
|
116
123
|
import type { StorefrontSession } from "./session";
|
|
117
124
|
|
|
@@ -276,6 +283,17 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
276
283
|
query: params as Query,
|
|
277
284
|
},
|
|
278
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
|
+
}),
|
|
279
297
|
createInquiry: (productId: string, body: CreateInquiryRequest) =>
|
|
280
298
|
http.requestVoid("POST", path`/products/${productId}/inquiries`, { body }),
|
|
281
299
|
/** 노출 중인 컬렉션(노출 켜짐 + 기간 안) — 셀러가 정한 순서 */
|
|
@@ -301,6 +319,11 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
301
319
|
}),
|
|
302
320
|
},
|
|
303
321
|
|
|
322
|
+
/** `GET /pickup-locations` — 방문 수령 장소(이슈 #115). 주문서의 `pickupLocationId`로 고른다 */
|
|
323
|
+
pickupLocations: {
|
|
324
|
+
list: () => http.request("GET", "/pickup-locations", z.array(pickupLocationViewSchema)),
|
|
325
|
+
},
|
|
326
|
+
|
|
304
327
|
cart: {
|
|
305
328
|
get: () => http.request("GET", "/cart", cartSchema),
|
|
306
329
|
addItem: (body: AddCartItemRequest) =>
|
|
@@ -403,6 +426,32 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
403
426
|
http.request("GET", path`/me/order-items/${orderItemId}/delivery`, deliveryTrackingSchema),
|
|
404
427
|
decidePurchase: (orderItemId: string) =>
|
|
405
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
|
+
),
|
|
406
455
|
},
|
|
407
456
|
|
|
408
457
|
myClaims: {
|
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>;
|
|
@@ -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>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { stayRequestSchema, stayViewSchema } from "./stay";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 추가 선택·직접 입력 (이슈 #59) — 상품 상세의 옵션 표시, 장바구니 담기·바로 구매 요청, 줄 스냅샷의 공통 모양.
|
|
@@ -30,10 +31,62 @@ export const customInputViewSchema = z.object({
|
|
|
30
31
|
placeholder: z.string().nullable().describe("입력 안내. 없으면 null"),
|
|
31
32
|
maxLength: z.number().int().describe("최대 글자 수"),
|
|
32
33
|
required: z.boolean(),
|
|
34
|
+
key: z.string().nullable().optional().describe("고정 키. 없으면 null"),
|
|
35
|
+
type: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe(
|
|
39
|
+
"입력 타입. 현재 값은 `text`·`number`(정수)·`select`·`date`(`YYYY-MM-DD`, 한국 날짜)·`datetime`(오프셋 있는 ISO 8601)·`image`(업로드 주소 목록, `maxLength`가 최대 장수)이고 값이 추가될 수 있어 문자열로 받는다. 없으면 `text`",
|
|
40
|
+
),
|
|
41
|
+
options: z
|
|
42
|
+
.array(z.string())
|
|
43
|
+
.nullable()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("`select`의 선택지. 그 밖의 타입은 null"),
|
|
33
46
|
});
|
|
34
47
|
|
|
35
48
|
export type CustomInputView = z.infer<typeof customInputViewSchema>;
|
|
36
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 직접 입력값을 타입대로 검사하고 저장할 모양으로 바꾼다(정규화 뒤 값). 서버 판정(400 `CUSTOM_INPUT_INVALID`)과 스토어프론트
|
|
52
|
+
* 입력 검사가 이 함수 하나를 쓴다. 모르는 타입은 `text`로 본다. 맞지 않으면 null
|
|
53
|
+
*/
|
|
54
|
+
export function parseCustomInputValue(
|
|
55
|
+
type: string | null | undefined,
|
|
56
|
+
options: readonly string[] | null | undefined,
|
|
57
|
+
raw: string,
|
|
58
|
+
): string | null {
|
|
59
|
+
const value = normalizeCustomInputValue(raw);
|
|
60
|
+
switch (type) {
|
|
61
|
+
case "number":
|
|
62
|
+
// 플로우 식의 int와 같은 범위 — 정수만 받는다(소수는 셀러가 단위를 바꿔 받는다, 예: g)
|
|
63
|
+
return /^-?\d{1,15}$/.test(value) ? String(Number(value)) : null;
|
|
64
|
+
case "select":
|
|
65
|
+
return options?.includes(value) ? value : null;
|
|
66
|
+
case "date": {
|
|
67
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return null;
|
|
68
|
+
const date = new Date(`${value}T00:00:00Z`);
|
|
69
|
+
return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value
|
|
70
|
+
? value
|
|
71
|
+
: null;
|
|
72
|
+
}
|
|
73
|
+
case "image": {
|
|
74
|
+
// 주문 입력 이미지(#115 E4) — 업로드 주소 목록(공백·줄바꿈 구분). 저장은 줄바꿈으로 잇는다. 주소의 출처(이 상점 업로드)는 서버가 본다
|
|
75
|
+
const urls = value.split(/\s+/).filter(Boolean);
|
|
76
|
+
if (urls.length === 0 || !urls.every((url) => /^https:\/\/\S+$/.test(url))) return null;
|
|
77
|
+
return [...new Set(urls)].join("\n");
|
|
78
|
+
}
|
|
79
|
+
case "datetime": {
|
|
80
|
+
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})$/.test(value))
|
|
81
|
+
return null;
|
|
82
|
+
const time = new Date(value);
|
|
83
|
+
return Number.isNaN(time.getTime()) ? null : time.toISOString();
|
|
84
|
+
}
|
|
85
|
+
default:
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
37
90
|
/**
|
|
38
91
|
* 직접 입력값 정규화 — NFC로 모으고, 제어 문자(C0·C1·줄바꿈·줄·문단 구분자)는 공백으로, 제로폭·양방향 제어 문자는 지운 뒤
|
|
39
92
|
* 앞뒤 공백을 지운다. 서버가 저장하는 값이 이것이다. 빈 문자열이면 입력하지 않은 것으로 본다.
|
|
@@ -88,8 +141,9 @@ export const lineSelectionRequestShape = {
|
|
|
88
141
|
.max(20)
|
|
89
142
|
.optional()
|
|
90
143
|
.describe(
|
|
91
|
-
"직접 입력값. 필수 항목을 비우면 400 `CUSTOM_INPUT_REQUIRED`, 최대 글자 수를 넘으면 400 `CUSTOM_INPUT_TOO_LONG`, 없는 항목이면 400 `CUSTOM_INPUT_NOT_FOUND`",
|
|
144
|
+
"직접 입력값. 필수 항목을 비우면 400 `CUSTOM_INPUT_REQUIRED`, 최대 글자 수를 넘으면 400 `CUSTOM_INPUT_TOO_LONG`, 없는 항목이면 400 `CUSTOM_INPUT_NOT_FOUND`, 항목 타입에 맞지 않으면 400 `CUSTOM_INPUT_INVALID`",
|
|
92
145
|
),
|
|
146
|
+
stay: stayRequestSchema.optional(),
|
|
93
147
|
};
|
|
94
148
|
|
|
95
149
|
/** 줄의 옵션 선택 스냅샷 한 칸 — 조합 옵션은 옵션명마다 한 칸이고 추가금이 0이다(조합 추가금은 단가에 들어 있다) */
|
|
@@ -108,7 +162,9 @@ export type OptionSelectionView = z.infer<typeof optionSelectionViewSchema>;
|
|
|
108
162
|
|
|
109
163
|
export const customInputValueViewSchema = z.object({
|
|
110
164
|
label: z.string().describe("항목명"),
|
|
111
|
-
value: z.string().describe("구매자가 적은 값"),
|
|
165
|
+
value: z.string().describe("구매자가 적은 값(타입별 정규화 뒤 값, `datetime`은 UTC ISO 8601)"),
|
|
166
|
+
key: z.string().nullable().optional().describe("항목의 고정 키(주문 시점). 없으면 null"),
|
|
167
|
+
type: z.string().optional().describe("항목의 입력 타입(주문 시점). 없으면 `text`"),
|
|
112
168
|
});
|
|
113
169
|
|
|
114
170
|
export type CustomInputValueView = z.infer<typeof customInputValueViewSchema>;
|
|
@@ -125,4 +181,18 @@ export const lineSelectionResponseShape = {
|
|
|
125
181
|
.optional()
|
|
126
182
|
.default([])
|
|
127
183
|
.describe("직접 입력값(항목명과 값). 없으면 빈 배열. 서버는 항상 싣는다"),
|
|
184
|
+
stay: stayViewSchema.optional().describe("숙박 기간과 박별 가격(날짜별 재고 상품만, 이슈 #118)"),
|
|
128
185
|
};
|
|
186
|
+
|
|
187
|
+
/** 주문 입력 이미지 업로드 자리 요청(#115 E4) — 파일명은 확장자만 쓰인다 */
|
|
188
|
+
export const orderInputUploadRequestSchema = z.object({
|
|
189
|
+
filename: z.string().min(1).max(200),
|
|
190
|
+
size: z
|
|
191
|
+
.number()
|
|
192
|
+
.int()
|
|
193
|
+
.positive()
|
|
194
|
+
.optional()
|
|
195
|
+
.describe("바이트. 주면 상한을 넘을 때 미리 거절한다"),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
export type OrderInputUploadRequest = z.infer<typeof orderInputUploadRequestSchema>;
|