@sayren/storefront-sdk 0.20.9 → 0.20.11
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/{client-vjq513VD.mjs → client-TokSE7D9.mjs} +69 -6
- package/dist/{index-BLjQQj49.d.mts → index-ilVVBQUs.d.mts} +705 -128
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/payments/index.d.mts +1 -1
- package/package.json +1 -1
- package/src/client.ts +13 -0
- package/src/schemas/commerce-flow.ts +92 -2
- package/src/schemas/order.ts +6 -1
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, 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, OrderFlowActionResult, 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, orderFlowActionResultSchema, 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 };
|
|
2
|
+
import { $ as ANALYTICS_VISITOR_HEADER, $i as storefrontCollectionSchema, $n as storefrontCouponListQuerySchema, $r as RetryPaymentRequest, $t as customInputEntrySchema, A as FlowAction, Ai as CategoryNode, An as createCustomerInquiryRequestSchema, Ar as CashReceiptType, At as WritableReview, B as flowActionRequestSchema, Bi as StorefrontCollection, Bn as MyCoupon, Br as KnownPaymentStatus, Bt as updateReviewRequestSchema, C as myOrderSchema, Ca as addCartItemRequestSchema, Ci as pgProviderSchema, Cn as createInquiryRequestSchema, Cr as createClaimRequestSchema, Ct as PublicReview, D as commerceNumberField, Da as analyticsIdsFromCookie, Di as retryPaymentRequestSchema, Dn as CreateCustomerInquiryRequest, Dr as CASH_RECEIPT_METHODS, Dt as UpdateReviewRequest, E as trackingStageResponseSchema, Ea as updateCartItemRequestSchema, Ei as responsePaymentMethodSchema, En as publicInquirySchema, Er as AvailablePaymentOption, Et as ReviewSummary, F as FlowState, Fi as ProductDetail, Fn as CheckoutPricingRequest, Fr as DeliveryQuoteResult, Ft as productReviewSortSchema, G as flowStateSchema, Gi as collectionProductSortSchema, Gn as checkoutPricingSchema, Gr as PaymentMessage, Gt as AddonSelection, H as flowActionSchema, Hi as categoryNodeSchema, Hn as StorefrontCouponListParams, Hr as PAYMENT_START_STATUS_VALUES, Ht as uploadTicketSchema, I as GuestFlowActionRequest, Ii as ProductFacets, In as CouponApplication, Ir as EasyPayProvider, It as publicReviewSchema, J as orderStepSchema, Ji as productFacetsSchema, Jn as couponBenefitViewSchema, Jr as PaymentStart, Jt as CustomInputView, K as guestFlowActionRequestSchema, Ki as productCardSchema, Kn as couponApplicationListSchema, Kr as PaymentMethod, Kt as CustomInputEntry, L as ORDER_STEP_TYPES, Li as ProductPage, Ln as CouponResult, Lr as GuestInfo, Lt as reviewImageUploadRequestSchema, M as FlowActionResult, Mi as CollectionProductParams, Mn as customerInquirySchema, Mr as CheckoutSession, Mt as createReviewResultSchema, N as FlowFieldValue, Ni as CollectionProductSortParam, Nn as ApplicableCoupon, Nr as CreateCheckoutRequest, Nt as myReviewSchema, O as formatOrderNo, Oi as shippingAddressInputSchema, On as CustomerInquiry, Or as CashReceiptIdentityType, Ot as UpdateReviewResult, P as FlowInputField, Pi as ProductCard, Pn as CheckoutPricing, Pr as DeliveryQuoteRequest, Pt as productReviewQuerySchema, Q as ANALYTICS_VISITOR_COOKIE, Qi as storefrontCollectionListQuerySchema, Qn as pricingAmountsSchema, Qr as ResponsePaymentMethod, Qt as addonSelectionSchema, R as OrderFlowActionResult, Ri as ProductSearchParams, Rn as MAX_COUPONS_PER_CHECKOUT, Rr as KnownPaymentResult, Rt as reviewPageSchema, S as myOrderItemSchema, Sa as UpdateCartItemRequest, Si as paymentStatusSchema, Sn as PublicInquiry, Sr as claimTypeSchema, St as ProductReviewSort, T as purchaseDecisionResultSchema, Ta as cartSchema, Ti as residentNumberLike, Tn as productInquiryCategorySchema, Tr as myClaimSchema, Tt as ReviewPage, U as flowFieldValueSchema, Ui as collectionProductPageSchema, Un as applicableCouponSchema, Ur as PAYMENT_STATUS_VALUES, Ut as writableReviewSchema, V as flowActionResultSchema, Vi as StorefrontCollectionDetail, Vn as StorefrontCoupon, Vr as PAYMENT_RESULT_VALUES, Vt as updateReviewResultSchema, W as flowInputFieldSchema, Wi as collectionProductQuerySchema, Wn as checkoutPricingRequestSchema, Wr as PaymentFailureCategory, Wt as AddonGroupView, X as ANALYTICS_SESSION_COOKIE, Xi as productSortSchema, Xn as myCouponListQuerySchema, Xr as PgProvider, Xt as OrderInputUploadRequest, Y as ANALYTICS_MAX_BATCH_BYTES, Yi as productPageSchema, Yn as couponResultSchema, Yr as PaymentStatus, Yt as OptionSelectionView, Z as ANALYTICS_SESSION_HEADER, Zi as storefrontCollectionDetailSchema, Zn as myCouponSchema, Zr as RemoteArea, Zt as addonGroupViewSchema, _ as MyOrder, _a as productCardFulfillmentSchema, _i as paymentMethodSchema, _n as updateProfileRequestSchema, _r as CreateClaimRequest, _t as createStorefrontSession, a as StayView, aa as orderItemStatusSchema, ai as cashReceiptRequestSchema, an as normalizeCustomInputValue, ar as ConsentState, at as analyticsBatchSchema, b as PurchaseDecisionResult, ba as Cart, bi as paymentOptionSchema, bn as CreateInquiryResult, br as claimReasonSchema, bt as MyReview, c as stayViewSchema, ca as LineFulfillment, ci as checkoutSessionSchema, cn as parseCustomInputValue, cr as consentActionSchema, ct as analyticsIdSchema, d as StorefrontPointPolicy, da as ProductCardFulfillment, di as deliveryQuoteSchema, dn as MemberAddressRequest, dr as consentStateSchema, dt as StorefrontClientOptions, ea as ClaimStatus, ei as ShippingAddressInput, en as customInputLength, er as storefrontCouponSchema, et as AnalyticsBatch, f as memberPointEntryPageSchema, fa as ProductFulfillmentView, fi as easyPayProviderResponseSchema, fn as UpdateProfileRequest, fr as consentUpdateRequestSchema, ft as createStorefrontClient, g as DeliveryTracking, ga as pickupLocationViewSchema, gi as paymentMessageSchema, gn as memberSchema, gr as ClaimType, gt as StorefrontSessionOptions, h as storefrontPointPolicySchema, ha as myOrderItemFulfillmentSnapshotSchema, hi as paymentFailureCategorySchema, hn as memberAddressSchema, hr as ClaimReturnAddress, ht as StorefrontSession, i as StayRequest, ia as claimStatusSchema, ii as cashReceiptIdentityTypeOf, in as lineSelectionResponseShape, ir as ConsentSource, it as AnalyticsServerEventName, j as FlowActionRequest, ji as CollectionProductPage, jn as customerInquiryCategorySchema, jr as CheckoutDelivery, jt as createReviewRequestSchema, k as parseOrderNo, ki as startPaymentRequestSchema, kn as CustomerInquiryCategory, kr as CashReceiptRequest, kt as UploadTicket, l as MemberPointEntry, la as MyOrderItemFulfillmentSnapshot, li as createCheckoutRequestSchema, ln as Member, lr as consentKindSchema, lt as analyticsServerEventNameSchema, m as memberPointsSchema, ma as lineFulfillmentSchema, mi as guestInfoSchema, mn as memberAddressRequestSchema, mr as ClaimReason, mt as SessionStorage, n as storefrontStoreSchema, na as PageInfo, ni as availablePaymentOptionSchema, nn as customInputViewSchema, nr as ConsentAction, nt as AnalyticsClientEventName, o as calendarDayViewSchema, oa as pageInfoSchema, oi as cashReceiptTypeSchema, on as optionSelectionViewSchema, or as ConsentUpdateRequest, ot as analyticsClientEventNameSchema, p as memberPointEntrySchema, pa as UnknownFulfillmentView, pi as easyPayProviderSchema, pn as WishlistAddResult, pr as memberConsentsSchema, pt as STOREFRONT_SESSION_KEYS, q as orderFlowActionResultSchema, qi as productDetailSchema, qn as couponApplicationSchema, qr as PaymentOption, qt as CustomInputValueView, r as CalendarDayView, ra as PageParams, ri as cashReceiptAvailable, rn as lineSelectionRequestShape, rr as ConsentKind, rt as AnalyticsEventName, s as stayRequestSchema, sa as pageSchema, si as checkoutDeliverySchema, sn as orderInputUploadRequestSchema, sr as MemberConsents, st as analyticsClientEventSchema, t as StorefrontStore, ta as OrderItemStatus, ti as StartPaymentRequest, tn as customInputValueViewSchema, tr as storefrontCouponTargetSchema, tt as AnalyticsClientEvent, u as MemberPoints, ua as PickupLocationView, ui as deliveryQuoteRequestSchema, un as MemberAddress, ur as consentSourceSchema, ut as StorefrontClient, v as MyOrderItem, va as productFulfillmentViewSchema, vi as paymentOptionKey, vn as wishlistAddResultSchema, vr as CreateClaimResult, vt as CreateReviewRequest, w as orderShippingAddressSchema, wa as cartItemSchema, wi as remoteAreaSchema, wn as createInquiryResultSchema, wr as createClaimResultSchema, wt as ReviewImageUploadRequest, x as deliveryTrackingSchema, xa as CartItem, xi as paymentStartSchema, xn as ProductInquiryCategory, xr as claimReturnAddressSchema, xt as ProductReviewParams, y as OrderShippingAddress, ya as AddCartItemRequest, yi as paymentOptionListSchema, yn as CreateInquiryRequest, yr as MyClaim, yt as CreateReviewResult, z as OrderStep, zi as ProductSort, zn as MIN_PAYMENT_AMOUNT, zr as KnownPaymentStartStatus, zt as reviewSummarySchema } from "./index-ilVVBQUs.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, ORDER_STEP_TYPES, OptionSelectionView, OrderFlowActionResult, OrderInputUploadRequest, OrderItemStatus, OrderShippingAddress, OrderStep, 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, orderFlowActionResultSchema, orderInputUploadRequestSchema, orderItemStatusSchema, orderShippingAddressSchema, orderStepSchema, 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,6 +1,6 @@
|
|
|
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
|
|
3
|
+
import { $ as orderStepSchema, A as wishlistAddResultSchema, At as idpAgreementsSchema, B as consentSourceSchema, Bt as withdrawRequestSchema, C as orderShippingAddressSchema, Ct as pageInfoSchema, D as memberAddressSchema, Dt as cartSchema, E as memberAddressRequestSchema, Et as cartItemSchema, F as createCustomerInquiryRequestSchema, Ft as loginRequestSchema, G as flowActionRequestSchema, Gt as unwrapData, H as consentUpdateRequestSchema, Ht as ApiError, I as customerInquiryCategorySchema, It as memberIdentitiesSchema, J as flowFieldValueSchema, K as flowActionResultSchema, L as customerInquirySchema, Lt as signupRequestSchema, M as createInquiryResultSchema, Mt as idpAuthorizeResponseSchema, N as productInquiryCategorySchema, Nt as idpTokenRequestSchema, O as memberSchema, Ot as updateCartItemRequestSchema, P as publicInquirySchema, Pt as linkIdentityRequestSchema, Q as orderFlowActionResultSchema, R as consentActionSchema, Rt as socialProviderSchema, S as myOrderSchema, St as orderItemStatusSchema, T as trackingStageResponseSchema, Tt as addCartItemRequestSchema, U as memberConsentsSchema, Ut as buildQuery, V as consentStateSchema, Vt as withdrawalBlockedDetailsSchema, W as ORDER_STEP_TYPES, Wt as toApiError, X as flowStateSchema, Y as flowInputFieldSchema, Z as guestFlowActionRequestSchema, _ as memberPointEntrySchema, _t as productSortSchema, a as myReviewSchema, at as myClaimSchema, b as deliveryTrackingSchema, bt as storefrontCollectionSchema, c as publicReviewSchema, ct as parseOrderNo, d as reviewSummarySchema, dt as collectionProductQuerySchema, et as claimReasonSchema, f as updateReviewRequestSchema, ft as collectionProductSortSchema, g as memberPointEntryPageSchema, gt as productPageSchema, h as writableReviewSchema, ht as productFacetsSchema, i as createReviewResultSchema, it as createClaimResultSchema, j as createInquiryRequestSchema, jt as idpAuthorizeRequestSchema, k as updateProfileRequestSchema, kt as anonymousSessionSchema, l as reviewImageUploadRequestSchema, lt as categoryNodeSchema, m as uploadTicketSchema, mt as productDetailSchema, n as storefrontStoreSchema, nt as claimTypeSchema, o as productReviewQuerySchema, ot as commerceNumberField, p as updateReviewResultSchema, pt as productCardSchema, q as flowActionSchema, r as createReviewRequestSchema, rt as createClaimRequestSchema, s as productReviewSortSchema, st as formatOrderNo, t as createStorefrontClient, tt as claimReturnAddressSchema, u as reviewPageSchema, ut as collectionProductPageSchema, v as memberPointsSchema, vt as storefrontCollectionDetailSchema, w as purchaseDecisionResultSchema, wt as pageSchema, x as myOrderItemSchema, xt as claimStatusSchema, y as storefrontPointPolicySchema, yt as storefrontCollectionListQuerySchema, z as consentKindSchema, zt as tokenPairSchema } from "./client-TokSE7D9.mjs";
|
|
4
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와 겹치지 않는 별도 네임스페이스. */
|
|
@@ -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, 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, orderFlowActionResultSchema, 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 };
|
|
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, ORDER_STEP_TYPES, 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, orderFlowActionResultSchema, orderInputUploadRequestSchema, orderItemStatusSchema, orderShippingAddressSchema, orderStepSchema, 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 { Jr as PaymentStart, Lr as GuestInfo, Yr as PaymentStatus, ei as ShippingAddressInput, ft as createStorefrontClient, kr as CashReceiptRequest, qr as PaymentOption, ti as StartPaymentRequest } from "../index-ilVVBQUs.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -105,6 +105,10 @@ import {
|
|
|
105
105
|
memberPointsSchema,
|
|
106
106
|
storefrontPointPolicySchema,
|
|
107
107
|
} from "./schemas/points";
|
|
108
|
+
import {
|
|
109
|
+
type OrderInputUploadRequest,
|
|
110
|
+
orderInputUploadRequestSchema,
|
|
111
|
+
} from "./schemas/product-options";
|
|
108
112
|
import {
|
|
109
113
|
type CreateReviewRequest,
|
|
110
114
|
createReviewRequestSchema,
|
|
@@ -337,6 +341,15 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
337
341
|
}),
|
|
338
342
|
removeItem: (cartItemId: string) =>
|
|
339
343
|
http.requestVoid("DELETE", path`/cart/items/${cartItemId}`),
|
|
344
|
+
/**
|
|
345
|
+
* 직접 입력 이미지(`type: "image"`) 업로드 자리 — 응답 `uploadUrl`에 파일을 PUT한 뒤 `url`을 담기·바로 구매의
|
|
346
|
+
* `customInputs` 값에 넣는다(여러 장이면 줄바꿈으로 잇는다). 비회원도 부를 수 있다.
|
|
347
|
+
* 형식·크기가 맞지 않으면 400 `UNSUPPORTED_FILE_TYPE`·413 `FILE_TOO_LARGE`, 연타하면 429 `TOO_MANY_REQUESTS`다
|
|
348
|
+
*/
|
|
349
|
+
createInputImageUpload: (body: OrderInputUploadRequest) =>
|
|
350
|
+
http.request("POST", "/uploads/order-inputs", uploadTicketSchema, {
|
|
351
|
+
body: orderInputUploadRequestSchema.parse(body),
|
|
352
|
+
}),
|
|
340
353
|
},
|
|
341
354
|
|
|
342
355
|
checkout: {
|
|
@@ -8,12 +8,30 @@ import { orderItemStatusSchema } from "./common";
|
|
|
8
8
|
|
|
9
9
|
export const flowInputFieldSchema = z.object({
|
|
10
10
|
key: z.string(),
|
|
11
|
-
type: z
|
|
11
|
+
type: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe(
|
|
14
|
+
"text · textarea · number · select · radio · checkbox · boolean · date · datetime · image (늘어날 수 있다). 값: checkbox는 고른 선택지 배열, boolean은 참거짓(필수면 true), date는 `YYYY-MM-DD`, datetime은 오프셋 있는 ISO 8601, image는 https 주소 배열",
|
|
15
|
+
),
|
|
12
16
|
required: z.boolean(),
|
|
13
17
|
label: z.string(),
|
|
18
|
+
placeholder: z.string().optional().describe("입력 안내"),
|
|
14
19
|
maxLength: z.number().int().optional(),
|
|
15
20
|
maxFiles: z.number().int().optional(),
|
|
16
|
-
options: z
|
|
21
|
+
options: z
|
|
22
|
+
.array(
|
|
23
|
+
z.union([
|
|
24
|
+
z.string(),
|
|
25
|
+
z.number(),
|
|
26
|
+
z.object({ value: z.string(), label: z.string() }).describe("값과 보여 줄 이름"),
|
|
27
|
+
]),
|
|
28
|
+
)
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("고르는 형식의 선택지. 값만 있거나 값·이름 쌍이다(보낼 때는 값)"),
|
|
31
|
+
when: z
|
|
32
|
+
.object({ key: z.string(), in: z.array(z.string()) })
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("다른 칸(`key`)의 값이 `in` 중 하나일 때만 보이고 받는 칸. 없으면 늘 받는다"),
|
|
17
35
|
});
|
|
18
36
|
export type FlowInputField = z.infer<typeof flowInputFieldSchema>;
|
|
19
37
|
|
|
@@ -56,11 +74,83 @@ export const flowStateSchema = z.object({
|
|
|
56
74
|
.array(z.string())
|
|
57
75
|
.optional()
|
|
58
76
|
.describe("가장 최근 행동이 붙인 첨부 주소(시안 등, #115). 없으면 생략"),
|
|
77
|
+
earlierAttachments: z
|
|
78
|
+
.array(z.string())
|
|
79
|
+
.optional()
|
|
80
|
+
.describe(
|
|
81
|
+
"앞 상태에서 붙인 첨부(수정 요청 뒤의 이전 시안 등). 다음 첨부가 오면 바뀐다. 없으면 생략",
|
|
82
|
+
),
|
|
83
|
+
inputs: z
|
|
84
|
+
.object({
|
|
85
|
+
by: z.string().describe("적은 사람 — seller · buyer"),
|
|
86
|
+
values: z.array(
|
|
87
|
+
z.object({
|
|
88
|
+
key: z.string(),
|
|
89
|
+
label: z.string(),
|
|
90
|
+
type: z.string(),
|
|
91
|
+
value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
|
|
92
|
+
}),
|
|
93
|
+
),
|
|
94
|
+
})
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("이 상태로 오게 한 행동의 입력값(수정 내용 등, #115). 없으면 생략"),
|
|
59
97
|
progress: z.boolean().optional(),
|
|
60
98
|
fields: z.record(z.string(), flowFieldValueSchema).describe("구매자 공개 범위의 커스텀 필드"),
|
|
61
99
|
});
|
|
62
100
|
export type FlowState = z.infer<typeof flowStateSchema>;
|
|
63
101
|
|
|
102
|
+
/**
|
|
103
|
+
* 주문상품의 지금 단계(#115) — 구매자 화면이 흐름 구조를 몰라도 그릴 수 있게 서버가 정리한 값이다. `type`으로 화면 모양을 고르고,
|
|
104
|
+
* `actions`(입력 칸 포함)로 버튼·폼을 그린다. 판정은 서버다.
|
|
105
|
+
*/
|
|
106
|
+
export const ORDER_STEP_TYPES = [
|
|
107
|
+
"BUYER_ACTION",
|
|
108
|
+
"SELLER_PROCESSING",
|
|
109
|
+
"IN_DELIVERY",
|
|
110
|
+
"DELIVERED",
|
|
111
|
+
"COMPLETED",
|
|
112
|
+
"CANCELED",
|
|
113
|
+
"CLAIM_IN_PROGRESS",
|
|
114
|
+
] as const;
|
|
115
|
+
|
|
116
|
+
export const orderStepSchema = z.object({
|
|
117
|
+
type: z
|
|
118
|
+
.string()
|
|
119
|
+
.describe(
|
|
120
|
+
"BUYER_ACTION 구매자 확인·입력 필요 · SELLER_PROCESSING 판매자 처리 중 · IN_DELIVERY 배송 중 · DELIVERED 배송·제공 완료 · " +
|
|
121
|
+
"COMPLETED 구매확정 · CANCELED 취소 · CLAIM_IN_PROGRESS 취소·반품·교환 처리 중. 값이 늘어날 수 있다(모르는 값은 SELLER_PROCESSING처럼 보인다)",
|
|
122
|
+
),
|
|
123
|
+
label: z.string().describe("지금 상태 이름(구매자용)"),
|
|
124
|
+
message: z.string().optional().describe("판매자가 둔 안내문"),
|
|
125
|
+
deadlineAt: z.string().optional().describe("가장 가까운 기한(ISO 8601)"),
|
|
126
|
+
attachments: z.array(z.string()).optional().describe("판매자가 올린 자료(시안 등)"),
|
|
127
|
+
earlierAttachments: z
|
|
128
|
+
.array(z.string())
|
|
129
|
+
.optional()
|
|
130
|
+
.describe("앞 단계에서 올린 자료(수정 요청 뒤의 이전 시안 등)"),
|
|
131
|
+
inputs: flowStateSchema.shape.inputs,
|
|
132
|
+
actions: z
|
|
133
|
+
.array(flowActionSchema)
|
|
134
|
+
.describe(
|
|
135
|
+
"이 단계에서 구매자가 할 행동(입력 칸 포함). `BUYER_ACTION`이면 하나 이상이다. 취소·반품 요청·구매확정은 `actions`(주문상품)에 있다",
|
|
136
|
+
),
|
|
137
|
+
data: z
|
|
138
|
+
.object({
|
|
139
|
+
delivery: z
|
|
140
|
+
.object({
|
|
141
|
+
carrierName: z.string().nullable(),
|
|
142
|
+
trackingNumber: z.string().nullable(),
|
|
143
|
+
trackingUrl: z.string().nullable(),
|
|
144
|
+
dispatchedAt: z.string(),
|
|
145
|
+
})
|
|
146
|
+
.optional()
|
|
147
|
+
.describe("`IN_DELIVERY` — 발송 정보"),
|
|
148
|
+
})
|
|
149
|
+
.optional()
|
|
150
|
+
.describe("단계별 부가 정보. 없으면 생략"),
|
|
151
|
+
});
|
|
152
|
+
export type OrderStep = z.infer<typeof orderStepSchema>;
|
|
153
|
+
|
|
64
154
|
export const flowActionRequestSchema = z.object({
|
|
65
155
|
input: z.record(z.string(), z.unknown()).optional(),
|
|
66
156
|
});
|
package/src/schemas/order.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { easyPayProviderResponseSchema, responsePaymentMethodSchema } from "./checkout";
|
|
3
|
-
import { flowActionSchema, flowStateSchema } from "./commerce-flow";
|
|
3
|
+
import { flowActionSchema, flowStateSchema, orderStepSchema } from "./commerce-flow";
|
|
4
4
|
import { commerceNumberField } from "./commerce-number";
|
|
5
5
|
import { orderItemStatusSchema } from "./common";
|
|
6
6
|
import { myOrderItemFulfillmentSnapshotSchema } from "./fulfillment";
|
|
@@ -84,6 +84,11 @@ export const myOrderItemSchema = z.object({
|
|
|
84
84
|
.describe(
|
|
85
85
|
"진행 위치가 둘 이상(병렬 진행·하위 흐름)이면 각 위치의 상태. `flowState`는 그 가운데 가장 앞 단계다",
|
|
86
86
|
),
|
|
87
|
+
step: orderStepSchema
|
|
88
|
+
.optional()
|
|
89
|
+
.describe(
|
|
90
|
+
"지금 단계 요약(#115) — `type`으로 화면을 고르고 `actions`의 입력 칸으로 폼을 그린다. 플로우가 없는 주문상품은 없다",
|
|
91
|
+
),
|
|
87
92
|
});
|
|
88
93
|
|
|
89
94
|
export type MyOrderItem = z.infer<typeof myOrderItemSchema>;
|