@sayren/storefront-sdk 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.mjs +1 -1
- package/dist/{checkout-Dsv9C9Zp.mjs → checkout-C25liqdW.mjs} +113 -98
- package/dist/{client-ZPNEEeRT.mjs → client-CBAgQuTc.mjs} +15 -72
- package/dist/{index-D5uvtiOl.d.mts → index-BsHuMzBD.d.mts} +577 -698
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/payments/index.d.mts +1 -3
- package/dist/payments/index.mjs +1 -2
- package/package.json +1 -1
- package/src/client.ts +1 -57
- package/src/index.ts +1 -0
- package/src/payments/index.ts +0 -5
- package/src/schemas/cart.ts +9 -0
- package/src/schemas/catalog.ts +15 -0
- package/src/schemas/checkout.ts +20 -22
- package/src/schemas/coupon.ts +19 -2
- package/src/schemas/fulfillment.ts +14 -76
- package/src/schemas/order.ts +7 -86
- package/src/schemas/product-options.ts +128 -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, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, ApplicableCoupon, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutPricing, CheckoutPricingRequest, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking,
|
|
2
|
+
import { $ as CreateReviewRequest, $n as cashReceiptAvailable, $r as productCardFulfillmentSchema, $t as myCouponSchema, A as ANALYTICS_MAX_BATCH_BYTES, An as CheckoutDelivery, Ar as ProductSearchParams, At as publicInquirySchema, B as analyticsBatchSchema, Bn as PAYMENT_STATUS_VALUES, Br as PageInfo, Bt as CouponApplication, C as PurchaseDecisionResult, Cn as createClaimResultSchema, Cr as shippingAddressInputSchema, Ct as updateProfileRequestSchema, D as orderShippingAddressSchema, Dn as CashReceiptIdentityType, Dr as ProductDetail, Dt as PublicInquiry, E as myOrderSchema, En as CASH_RECEIPT_METHODS, Er as ProductCard, Et as CreateInquiryResult, F as AnalyticsBatch, Fn as EasyPayProvider, Fr as productFacetsSchema, Ft as customerInquiryCategorySchema, G as StorefrontClient, Gn as PaymentStart, Gr as pageSchema, Gt as applicableCouponSchema, H as analyticsClientEventSchema, Hn as PaymentMessage, Hr as claimStatusSchema, Ht as MAX_COUPONS_PER_CHECKOUT, I as AnalyticsClientEvent, In as GuestInfo, Ir as productPageSchema, It as customerInquirySchema, J as STOREFRONT_SESSION_KEYS, Jn as RemoteArea, Jr as ProductCardFulfillment, Jt as couponApplicationListSchema, K as StorefrontClientOptions, Kn as PaymentStatus, Kr as LineFulfillment, Kt as checkoutPricingRequestSchema, L as AnalyticsClientEventName, Ln as KnownPaymentResult, Lr as productSortSchema, Lt as ApplicableCoupon, M as ANALYTICS_SESSION_HEADER, Mn as CreateCheckoutRequest, Mr as categoryNodeSchema, Mt as CustomerInquiry, N as ANALYTICS_VISITOR_COOKIE, Nn as DeliveryQuoteRequest, Nr as productCardSchema, Nt as CustomerInquiryCategory, O as purchaseDecisionResultSchema, On as CashReceiptRequest, Or as ProductFacets, Ot as createInquiryRequestSchema, P as ANALYTICS_VISITOR_HEADER, Pn as DeliveryQuoteResult, Pr as productDetailSchema, Pt as createCustomerInquiryRequestSchema, Q as createStorefrontSession, Qn as availablePaymentOptionSchema, Qr as myOrderItemFulfillmentSnapshotSchema, Qt as myCouponListQuerySchema, R as AnalyticsEventName, Rn as KnownPaymentStatus, Rr as ClaimStatus, Rt as CheckoutPricing, S as OrderShippingAddress, Sn as createClaimRequestSchema, Sr as retryPaymentRequestSchema, St as memberSchema, T as myOrderItemSchema, Tn as AvailablePaymentOption, Tr as CategoryNode, Tt as CreateInquiryRequest, U as analyticsIdSchema, Un as PaymentMethod, Ur as orderItemStatusSchema, Ut as MIN_PAYMENT_AMOUNT, V as analyticsClientEventNameSchema, Vn as PaymentFailureCategory, Vr as PageParams, Vt as CouponResult, W as analyticsServerEventNameSchema, Wn as PaymentOption, Wr as pageInfoSchema, Wt as MyCoupon, X as StorefrontSession, Xn as ShippingAddressInput, Xr as UnknownFulfillmentView, Xt as couponBenefitViewSchema, Y as SessionStorage, Yn as RetryPaymentRequest, Yr as ProductFulfillmentView, Yt as couponApplicationSchema, Z as StorefrontSessionOptions, Zn as StartPaymentRequest, Zr as lineFulfillmentSchema, Zt as couponResultSchema, _ as normalizeCustomInputValue, _n as CreateClaimResult, _r as paymentStartSchema, _t as MemberAddressRequest, a as CustomInputEntry, ai as addCartItemRequestSchema, an as ConsentUpdateRequest, ar as createCheckoutRequestSchema, at as UpdateReviewResult, b as MyOrder, bn as claimReturnAddressSchema, br as remoteAreaSchema, bt as memberAddressRequestSchema, c as OptionSelectionView, ci as updateCartItemRequestSchema, cn as consentKindSchema, cr as easyPayProviderResponseSchema, ct as createReviewResultSchema, d as customInputEntrySchema, dn as consentUpdateRequestSchema, dr as paymentFailureCategorySchema, dt as reviewSummarySchema, ei as productFulfillmentViewSchema, en as pricingAmountsSchema, er as cashReceiptIdentityTypeOf, et as CreateReviewResult, f as customInputLength, fn as memberConsentsSchema, fr as paymentMessageSchema, ft as updateReviewRequestSchema, g as lineSelectionResponseShape, gn as CreateClaimRequest, gr as paymentOptionSchema, gt as MemberAddress, h as lineSelectionRequestShape, hn as ClaimType, hr as paymentOptionListSchema, ht as Member, i as AddonSelection, ii as UpdateCartItemRequest, in as ConsentState, ir as checkoutSessionSchema, it as UpdateReviewRequest, j as ANALYTICS_SESSION_COOKIE, jn as CheckoutSession, jr as ProductSort, jt as CreateCustomerInquiryRequest, k as trackingStageResponseSchema, kn as CashReceiptType, kr as ProductPage, kt as createInquiryResultSchema, l as addonGroupViewSchema, li as analyticsIdsFromCookie, ln as consentSourceSchema, lr as easyPayProviderSchema, lt as publicReviewSchema, m as customInputViewSchema, mn as ClaimReturnAddress, mr as paymentOptionKey, mt as writableReviewSchema, n as storefrontStoreSchema, ni as Cart, nn as ConsentKind, nr as cashReceiptTypeSchema, nt as ReviewPage, o as CustomInputValueView, oi as cartItemSchema, on as MemberConsents, or as deliveryQuoteRequestSchema, ot as WritableReview, p as customInputValueViewSchema, pn as ClaimReason, pr as paymentMethodSchema, pt as updateReviewResultSchema, q as createStorefrontClient, qn as PgProvider, qr as MyOrderItemFulfillmentSnapshot, qt as checkoutPricingSchema, r as AddonGroupView, ri as CartItem, rn as ConsentSource, rr as checkoutDeliverySchema, rt as ReviewSummary, s as CustomInputView, si as cartSchema, sn as consentActionSchema, sr as deliveryQuoteSchema, st as createReviewRequestSchema, t as StorefrontStore, ti as AddCartItemRequest, tn as ConsentAction, tr as cashReceiptRequestSchema, tt as PublicReview, u as addonSelectionSchema, un as consentStateSchema, ur as guestInfoSchema, ut as reviewPageSchema, v as optionSelectionViewSchema, vn as MyClaim, vr as paymentStatusSchema, vt as UpdateProfileRequest, w as deliveryTrackingSchema, wn as myClaimSchema, wr as startPaymentRequestSchema, wt as wishlistAddResultSchema, x as MyOrderItem, xn as claimTypeSchema, xr as residentNumberLike, xt as memberAddressSchema, y as DeliveryTracking, yn as claimReasonSchema, yr as pgProviderSchema, yt as WishlistAddResult, z as AnalyticsServerEventName, zn as PAYMENT_RESULT_VALUES, zr as OrderItemStatus, zt as CheckoutPricingRequest } from "./index-BsHuMzBD.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, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutPricing, CheckoutPricingRequest, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomInputEntry, CustomInputValueView, CustomInputView, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LineFulfillment, LinkIdentityRequest, LoginRequest, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MyClaim, MyCoupon, MyOrder, MyOrderItem, MyOrderItemFulfillmentSnapshot, OptionSelectionView, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductCardFulfillment, ProductDetail, ProductFacets, ProductFulfillmentView, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UnknownFulfillmentView, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, 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, 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, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
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 { A as startPaymentRequestSchema, B as myCouponListQuerySchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, F as checkoutPricingSchema, G as
|
|
3
|
+
import { $ as updateCartItemRequestSchema, A as consentSourceSchema, B as categoryNodeSchema, C as createInquiryResultSchema, D as customerInquirySchema, E as customerInquiryCategorySchema, F as claimReturnAddressSchema, G as productSortSchema, H as productDetailSchema, I as claimTypeSchema, J as pageInfoSchema, K as claimStatusSchema, L as createClaimRequestSchema, M as consentUpdateRequestSchema, N as memberConsentsSchema, O as consentActionSchema, P as claimReasonSchema, Q as cartSchema, R as createClaimResultSchema, S as createInquiryRequestSchema, T as createCustomerInquiryRequestSchema, U as productFacetsSchema, V as productCardSchema, W as productPageSchema, X as addCartItemRequestSchema, Y as pageSchema, Z as cartItemSchema, _ as memberAddressRequestSchema, a as publicReviewSchema, at as linkIdentityRequestSchema, b as updateProfileRequestSchema, c as updateReviewRequestSchema, ct as signupRequestSchema, d as deliveryTrackingSchema, dt as withdrawRequestSchema, et as anonymousSessionSchema, f as myOrderItemSchema, ft as withdrawalBlockedDetailsSchema, g as trackingStageResponseSchema, gt as unwrapData, h as purchaseDecisionResultSchema, ht as toApiError, i as createReviewResultSchema, it as idpTokenRequestSchema, j as consentStateSchema, k as consentKindSchema, l as updateReviewResultSchema, lt as socialProviderSchema, m as orderShippingAddressSchema, mt as buildQuery, n as storefrontStoreSchema, nt as idpAuthorizeRequestSchema, o as reviewPageSchema, ot as loginRequestSchema, p as myOrderSchema, pt as ApiError, q as orderItemStatusSchema, r as createReviewRequestSchema, rt as idpAuthorizeResponseSchema, s as reviewSummarySchema, st as memberIdentitiesSchema, t as createStorefrontClient, tt as idpAgreementsSchema, u as writableReviewSchema, ut as tokenPairSchema, v as memberAddressSchema, w as publicInquirySchema, x as wishlistAddResultSchema, y as memberSchema, z as myClaimSchema } from "./client-CBAgQuTc.mjs";
|
|
4
|
+
import { $ as lineFulfillmentSchema, A as startPaymentRequestSchema, B as myCouponListQuerySchema, C as paymentStartSchema, D as residentNumberLike, E as remoteAreaSchema, F as checkoutPricingSchema, G as customInputEntrySchema, H as pricingAmountsSchema, I as couponApplicationListSchema, J as customInputViewSchema, K as customInputLength, L as couponApplicationSchema, M as MIN_PAYMENT_AMOUNT, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, Q as optionSelectionViewSchema, R as couponBenefitViewSchema, S as paymentOptionSchema, T as pgProviderSchema, U as addonGroupViewSchema, V as myCouponSchema, W as addonSelectionSchema, X as lineSelectionResponseShape, Y as lineSelectionRequestShape, Z as normalizeCustomInputValue, _ as paymentFailureCategorySchema, a as cashReceiptAvailable, b as paymentOptionKey, c as cashReceiptTypeSchema, d as createCheckoutRequestSchema, et as myOrderItemFulfillmentSnapshotSchema, f as deliveryQuoteRequestSchema, g as guestInfoSchema, h as easyPayProviderSchema, i as availablePaymentOptionSchema, j as MAX_COUPONS_PER_CHECKOUT, k as shippingAddressInputSchema, l as checkoutDeliverySchema, m as easyPayProviderResponseSchema, n as PAYMENT_RESULT_VALUES, nt as productFulfillmentViewSchema, o as cashReceiptIdentityTypeOf, p as deliveryQuoteSchema, q as customInputValueViewSchema, r as PAYMENT_STATUS_VALUES, s as cashReceiptRequestSchema, t as CASH_RECEIPT_METHODS, tt as productCardFulfillmentSchema, u as checkoutSessionSchema, v as paymentMessageSchema, w as paymentStatusSchema, x as paymentOptionListSchema, y as paymentMethodSchema, z as couponResultSchema } from "./checkout-C25liqdW.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_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, consentActionSchema, consentKindSchema, consentSourceSchema, consentStateSchema, consentUpdateRequestSchema, couponApplicationListSchema, couponApplicationSchema, couponBenefitViewSchema, couponResultSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryQuoteRequestSchema, deliveryQuoteSchema, deliveryTrackingSchema,
|
|
128
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, CASH_RECEIPT_METHODS, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, 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, 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, guestInfoSchema, idpAgreementsSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, lineFulfillmentSchema, lineSelectionRequestShape, lineSelectionResponseShape, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberConsentsSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myCouponListQuerySchema, myCouponSchema, myOrderItemFulfillmentSnapshotSchema, myOrderItemSchema, myOrderSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, pricingAmountsSchema, productCardFulfillmentSchema, productCardSchema, productDetailSchema, productFacetsSchema, productFulfillmentViewSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, remoteAreaSchema, residentNumberLike, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gn as PaymentStart, In as GuestInfo, Kn as PaymentStatus, On as CashReceiptRequest, Wn as PaymentOption, Xn as ShippingAddressInput, Zn as StartPaymentRequest, q as createStorefrontClient } from "../index-BsHuMzBD.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
|
@@ -114,8 +114,6 @@ export interface StartOptions {
|
|
|
114
114
|
cashReceipt?: CashReceiptRequest;
|
|
115
115
|
/** 적용할 쿠폰 — 결제 시작이 예약하고 할인한 금액으로 결제한다 */
|
|
116
116
|
coupons?: StartPaymentRequest["coupons"];
|
|
117
|
-
/** 청약철회 제한 동의 — 주문서의 `withdrawal.required`가 true면 true로 보낸다 */
|
|
118
|
-
withdrawalAgreement?: boolean;
|
|
119
117
|
returnUrl?: string;
|
|
120
118
|
mode?: PaymentMode;
|
|
121
119
|
/** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창. 폼 검증이 비동기라 클릭 태스크를 넘길 때 쓴다 */
|
package/dist/payments/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as paymentMessageSchema } from "../checkout-
|
|
1
|
+
import { v as paymentMessageSchema } from "../checkout-C25liqdW.mjs";
|
|
2
2
|
//#region src/payments/index.ts
|
|
3
3
|
/** 복귀 주소에 결제 서비스가 붙이는 쿼리 */
|
|
4
4
|
const RETURN_PAYMENT_ID = "sayrenPaymentId";
|
|
@@ -290,7 +290,6 @@ function createPayments(options) {
|
|
|
290
290
|
guest: startOptions.guest,
|
|
291
291
|
...startOptions.cashReceipt ? { cashReceipt: startOptions.cashReceipt } : {},
|
|
292
292
|
...startOptions.coupons ? { coupons: startOptions.coupons } : {},
|
|
293
|
-
...startOptions.withdrawalAgreement !== void 0 ? { withdrawalAgreement: startOptions.withdrawalAgreement } : {},
|
|
294
293
|
returnUrl
|
|
295
294
|
}));
|
|
296
295
|
},
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -86,14 +86,7 @@ import {
|
|
|
86
86
|
type UpdateProfileRequest,
|
|
87
87
|
updateProfileRequestSchema,
|
|
88
88
|
} from "./schemas/member";
|
|
89
|
-
import {
|
|
90
|
-
type DownloadRequest,
|
|
91
|
-
deliveryTrackingSchema,
|
|
92
|
-
downloadLinkSchema,
|
|
93
|
-
downloadRequestSchema,
|
|
94
|
-
fulfillmentRevealSchema,
|
|
95
|
-
myOrderSchema,
|
|
96
|
-
} from "./schemas/order";
|
|
89
|
+
import { deliveryTrackingSchema, myOrderSchema } from "./schemas/order";
|
|
97
90
|
import {
|
|
98
91
|
type CreateReviewRequest,
|
|
99
92
|
createReviewRequestSchema,
|
|
@@ -374,55 +367,6 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
374
367
|
http.request("POST", path`/guest/orders/${orderId}`, myOrderSchema, { body }),
|
|
375
368
|
getDelivery: (orderItemId: string) =>
|
|
376
369
|
http.request("GET", path`/me/order-items/${orderItemId}/delivery`, deliveryTrackingSchema),
|
|
377
|
-
/**
|
|
378
|
-
* 코드 열람 (이슈 #48) — 코드 발급 상품의 평문 코드. 처음 열람한 시각이 제공 개시 증거로 남는다.
|
|
379
|
-
*
|
|
380
|
-
* 에러: 404 `ORDER_ITEM_NOT_FOUND`(없거나 남의 주문상품) · 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·코드 상품 아님) ·
|
|
381
|
-
* 429 `TOO_MANY_REQUESTS`
|
|
382
|
-
*/
|
|
383
|
-
revealCode: (orderItemId: string) =>
|
|
384
|
-
http.request(
|
|
385
|
-
"POST",
|
|
386
|
-
path`/me/order-items/${orderItemId}/fulfillment/reveal`,
|
|
387
|
-
fulfillmentRevealSchema,
|
|
388
|
-
),
|
|
389
|
-
/**
|
|
390
|
-
* 파일 다운로드 (이슈 #48) — 수명 300초의 서명 주소를 받는다. 받을 때마다 남은 횟수가 준다.
|
|
391
|
-
*
|
|
392
|
-
* 에러: 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·파일 상품 아님) · 409 `DOWNLOAD_LIMIT_REACHED`(횟수 소진) ·
|
|
393
|
-
* 409 `DOWNLOAD_EXPIRED`(기한 지남) · 400 `ASSET_REQUIRED`(파일이 여러 개인데 `assetId` 없음)
|
|
394
|
-
*/
|
|
395
|
-
createDownload: (orderItemId: string, body: DownloadRequest = {}) =>
|
|
396
|
-
http.request("POST", path`/me/order-items/${orderItemId}/downloads`, downloadLinkSchema, {
|
|
397
|
-
body: downloadRequestSchema.parse(body),
|
|
398
|
-
}),
|
|
399
|
-
/** 비회원 다운로드 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인한다 */
|
|
400
|
-
createGuestDownload: (
|
|
401
|
-
orderId: string,
|
|
402
|
-
orderItemId: string,
|
|
403
|
-
body: { phone: string; orderPassword: string; assetId?: string },
|
|
404
|
-
) =>
|
|
405
|
-
http.request(
|
|
406
|
-
"POST",
|
|
407
|
-
path`/guest/orders/${orderId}/order-items/${orderItemId}/downloads`,
|
|
408
|
-
downloadLinkSchema,
|
|
409
|
-
{ body },
|
|
410
|
-
),
|
|
411
|
-
/**
|
|
412
|
-
* 비회원 코드 열람 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인하고 같은 시도 한도를 쓴다.
|
|
413
|
-
* 틀리면 구분 없이 404 `ORDER_NOT_FOUND`다.
|
|
414
|
-
*/
|
|
415
|
-
revealGuestCode: (
|
|
416
|
-
orderId: string,
|
|
417
|
-
orderItemId: string,
|
|
418
|
-
body: { phone: string; orderPassword: string },
|
|
419
|
-
) =>
|
|
420
|
-
http.request(
|
|
421
|
-
"POST",
|
|
422
|
-
path`/guest/orders/${orderId}/order-items/${orderItemId}/fulfillment/reveal`,
|
|
423
|
-
fulfillmentRevealSchema,
|
|
424
|
-
{ body },
|
|
425
|
-
),
|
|
426
370
|
decidePurchase: (orderItemId: string) =>
|
|
427
371
|
http.requestVoid("POST", path`/me/order-items/${orderItemId}/purchase-decision`),
|
|
428
372
|
},
|
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./schemas/fulfillment";
|
|
|
17
17
|
export * from "./schemas/inquiry";
|
|
18
18
|
export * from "./schemas/member";
|
|
19
19
|
export * from "./schemas/order";
|
|
20
|
+
export * from "./schemas/product-options";
|
|
20
21
|
export * from "./schemas/review";
|
|
21
22
|
export * from "./schemas/store";
|
|
22
23
|
export {
|
package/src/payments/index.ts
CHANGED
|
@@ -243,8 +243,6 @@ export interface StartOptions {
|
|
|
243
243
|
cashReceipt?: CashReceiptRequest;
|
|
244
244
|
/** 적용할 쿠폰 — 결제 시작이 예약하고 할인한 금액으로 결제한다 */
|
|
245
245
|
coupons?: StartPaymentRequest["coupons"];
|
|
246
|
-
/** 청약철회 제한 동의 — 주문서의 `withdrawal.required`가 true면 true로 보낸다 */
|
|
247
|
-
withdrawalAgreement?: boolean;
|
|
248
246
|
returnUrl?: string;
|
|
249
247
|
mode?: PaymentMode;
|
|
250
248
|
/** 클릭 시점에 {@link Payments.prepareWindow}로 미리 연 창. 폼 검증이 비동기라 클릭 태스크를 넘길 때 쓴다 */
|
|
@@ -534,9 +532,6 @@ export function createPayments(options: PaymentsOptions): Payments {
|
|
|
534
532
|
guest: startOptions.guest,
|
|
535
533
|
...(startOptions.cashReceipt ? { cashReceipt: startOptions.cashReceipt } : {}),
|
|
536
534
|
...(startOptions.coupons ? { coupons: startOptions.coupons } : {}),
|
|
537
|
-
...(startOptions.withdrawalAgreement !== undefined
|
|
538
|
-
? { withdrawalAgreement: startOptions.withdrawalAgreement }
|
|
539
|
-
: {}),
|
|
540
535
|
returnUrl,
|
|
541
536
|
}),
|
|
542
537
|
);
|
package/src/schemas/cart.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { lineFulfillmentSchema } from "./fulfillment";
|
|
3
|
+
import { lineSelectionRequestShape, lineSelectionResponseShape } from "./product-options";
|
|
3
4
|
|
|
4
5
|
export const cartItemSchema = z.object({
|
|
5
6
|
cartItemId: z.string(),
|
|
@@ -8,6 +9,7 @@ export const cartItemSchema = z.object({
|
|
|
8
9
|
thumbnailUrl: z.url().nullable().describe("담은 상품의 대표 이미지. 없으면 null"),
|
|
9
10
|
optionId: z.string().nullable(),
|
|
10
11
|
optionName: z.string().nullable(),
|
|
12
|
+
...lineSelectionResponseShape,
|
|
11
13
|
quantity: z.number().int(),
|
|
12
14
|
unitPrice: z.number().int(),
|
|
13
15
|
totalPrice: z.number().int(),
|
|
@@ -38,6 +40,7 @@ export const addCartItemRequestSchema = z.object({
|
|
|
38
40
|
productId: z.string(),
|
|
39
41
|
optionId: z.string().optional(),
|
|
40
42
|
quantity: z.number().int().min(1).max(999),
|
|
43
|
+
...lineSelectionRequestShape,
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
export type AddCartItemRequest = z.infer<typeof addCartItemRequestSchema>;
|
|
@@ -46,6 +49,12 @@ export const updateCartItemRequestSchema = z
|
|
|
46
49
|
.object({
|
|
47
50
|
quantity: z.number().int().min(1).max(999).optional(),
|
|
48
51
|
optionId: z.string().optional(),
|
|
52
|
+
addons: lineSelectionRequestShape.addons.describe(
|
|
53
|
+
"추가 선택을 통째로 바꾼다. 생략하면 그대로 둔다",
|
|
54
|
+
),
|
|
55
|
+
customInputs: lineSelectionRequestShape.customInputs.describe(
|
|
56
|
+
"직접 입력값을 통째로 바꾼다. 생략하면 그대로 둔다",
|
|
57
|
+
),
|
|
49
58
|
})
|
|
50
59
|
.refine((value) => Object.values(value).some((v) => v !== undefined), {
|
|
51
60
|
message: "최소 1개 필드가 필요합니다",
|
package/src/schemas/catalog.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type PageParams, pageSchema } from "./common";
|
|
3
3
|
import { productCardFulfillmentSchema, productFulfillmentViewSchema } from "./fulfillment";
|
|
4
|
+
import { addonGroupViewSchema, customInputViewSchema } from "./product-options";
|
|
4
5
|
|
|
5
6
|
export interface CategoryNode {
|
|
6
7
|
categoryId: string;
|
|
@@ -63,6 +64,20 @@ export const productDetailSchema = productCardSchema.extend({
|
|
|
63
64
|
soldOut: z.boolean(),
|
|
64
65
|
}),
|
|
65
66
|
),
|
|
67
|
+
addonGroups: z
|
|
68
|
+
.array(addonGroupViewSchema)
|
|
69
|
+
.optional()
|
|
70
|
+
.default([])
|
|
71
|
+
.describe(
|
|
72
|
+
"추가 선택 옵션명(이슈 #59). 배열 순서가 표시 순서다. 담기·바로 구매의 `addons`로 `{groupId, valueId}`를 보낸다. 없으면 빈 배열. 서버는 항상 싣는다",
|
|
73
|
+
),
|
|
74
|
+
customInputs: z
|
|
75
|
+
.array(customInputViewSchema)
|
|
76
|
+
.optional()
|
|
77
|
+
.default([])
|
|
78
|
+
.describe(
|
|
79
|
+
"직접 입력 항목(이슈 #59). 배열 순서가 표시 순서다. 담기·바로 구매의 `customInputs`로 값을 보낸다. 없으면 빈 배열. 서버는 항상 싣는다",
|
|
80
|
+
),
|
|
66
81
|
fulfillment: productFulfillmentViewSchema,
|
|
67
82
|
returnPeriodDays: z.number().int().describe("반품·교환을 받는 기간(수령·제공일부터 일수)"),
|
|
68
83
|
categoryPath: z.array(z.object({ categoryId: z.string(), name: z.string() })),
|
package/src/schemas/checkout.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { couponApplicationListSchema } from "./coupon";
|
|
3
3
|
import { lineFulfillmentSchema } from "./fulfillment";
|
|
4
|
+
import { lineSelectionRequestShape, lineSelectionResponseShape } from "./product-options";
|
|
4
5
|
|
|
5
6
|
export const createCheckoutRequestSchema = z
|
|
6
7
|
.object({
|
|
@@ -10,6 +11,7 @@ export const createCheckoutRequestSchema = z
|
|
|
10
11
|
productId: z.string(),
|
|
11
12
|
optionId: z.string().optional(),
|
|
12
13
|
quantity: z.number().int().min(1),
|
|
14
|
+
...lineSelectionRequestShape,
|
|
13
15
|
})
|
|
14
16
|
.optional(),
|
|
15
17
|
})
|
|
@@ -61,13 +63,23 @@ export const checkoutSessionSchema = z.object({
|
|
|
61
63
|
checkoutId: z.string(),
|
|
62
64
|
items: z.array(
|
|
63
65
|
z.object({
|
|
66
|
+
lineId: z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe(
|
|
70
|
+
"주문서 줄 id(이슈 #59). 같은 `optionId`가 추가 선택·직접 입력이 달라 여러 줄에 나올 수 있어, 상품 쿠폰을 걸 줄은 이 값으로 지목한다. 서버는 항상 싣는다",
|
|
71
|
+
),
|
|
64
72
|
productId: z.string(),
|
|
65
73
|
productName: z.string(),
|
|
66
74
|
/** variantId. 옵션 없는 상품은 default variant id */
|
|
67
75
|
optionId: z.string().nullable(),
|
|
68
76
|
optionName: z.string().nullable(),
|
|
77
|
+
...lineSelectionResponseShape,
|
|
69
78
|
quantity: z.number().int(),
|
|
70
|
-
unitPrice: z
|
|
79
|
+
unitPrice: z
|
|
80
|
+
.number()
|
|
81
|
+
.int()
|
|
82
|
+
.describe("단가 — 할인 반영 판매가 + 조합 추가금 + 추가 선택 추가금"),
|
|
71
83
|
totalPrice: z.number().int(),
|
|
72
84
|
fulfillment: lineFulfillmentSchema.describe("주문서 시점 상품 이행"),
|
|
73
85
|
}),
|
|
@@ -100,19 +112,12 @@ export const checkoutSessionSchema = z.object({
|
|
|
100
112
|
"택배 배송이 필요한 상품이 있는가. false면 배송지를 받지 않는다 — 결제 시작에 `shippingAddress`를 보내지 않아도 된다",
|
|
101
113
|
),
|
|
102
114
|
withdrawal: z
|
|
103
|
-
.object({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
),
|
|
110
|
-
notice: z
|
|
111
|
-
.string()
|
|
112
|
-
.nullable()
|
|
113
|
-
.describe("구매자에게 보여 줄 고지 문구. `required`가 false면 null"),
|
|
114
|
-
})
|
|
115
|
-
.describe("청약철회 제한 고지(이슈 #48)"),
|
|
115
|
+
.object({ required: z.boolean(), notice: z.string().nullable() })
|
|
116
|
+
.optional()
|
|
117
|
+
.describe(
|
|
118
|
+
"**Deprecated** — 항상 `{ required: false, notice: null }`이다. 청약철회 제한 고지를 없앴고(이슈 #48) storefront-sdk 0.15 이하 " +
|
|
119
|
+
"호환으로만 싣는다. 게시된 스토어프론트가 0.16 이상으로 넘어간 뒤 다음 릴리스에서 뺀다",
|
|
120
|
+
),
|
|
116
121
|
expiresAt: z.string(),
|
|
117
122
|
paymentOptions: z
|
|
118
123
|
.lazy(() => paymentOptionListSchema)
|
|
@@ -382,16 +387,9 @@ export const startPaymentRequestSchema = z.object({
|
|
|
382
387
|
.optional()
|
|
383
388
|
.describe(
|
|
384
389
|
"배송지. 주문서의 `requiresShipping`이 true면 필수이고 없으면 400 `SHIPPING_ADDRESS_REQUIRED`다. " +
|
|
385
|
-
"배송이 필요 없는 주문(
|
|
390
|
+
"배송이 필요 없는 주문(배송 없는 상품만)은 보내지 않아도 된다. 보내면 형식을 검사한 뒤 버린다",
|
|
386
391
|
),
|
|
387
392
|
guest: guestInfoSchema.optional(),
|
|
388
|
-
withdrawalAgreement: z
|
|
389
|
-
.boolean()
|
|
390
|
-
.optional()
|
|
391
|
-
.describe(
|
|
392
|
-
"청약철회 제한 동의. 주문서의 `withdrawal.required`가 true면 true여야 하고 아니면 400 `WITHDRAWAL_AGREEMENT_REQUIRED`다. " +
|
|
393
|
-
"동의 시각이 주문에 남는다",
|
|
394
|
-
),
|
|
395
393
|
cashReceipt: cashReceiptField,
|
|
396
394
|
coupons: couponApplicationListSchema
|
|
397
395
|
.optional()
|
package/src/schemas/coupon.ts
CHANGED
|
@@ -29,7 +29,14 @@ export const couponApplicationSchema = z
|
|
|
29
29
|
.string()
|
|
30
30
|
.optional()
|
|
31
31
|
.describe(
|
|
32
|
-
"상품 쿠폰을 걸 주문서 항목의 `optionId`. 생략하면 할인이 가장 큰 항목에 건다. 주문 쿠폰에는 쓰지
|
|
32
|
+
"상품 쿠폰을 걸 주문서 항목의 `optionId`. 생략하면 할인이 가장 큰 항목에 건다. 주문 쿠폰에는 쓰지 않는다. " +
|
|
33
|
+
"같은 `optionId`의 줄이 여럿이면 적용하지 못한다(`LINE_AMBIGUOUS`) — 그때는 `lineId`를 쓴다",
|
|
34
|
+
),
|
|
35
|
+
lineId: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe(
|
|
39
|
+
"상품 쿠폰을 걸 주문서 줄의 `lineId`(이슈 #59). 주면 `optionId`보다 우선한다. 주문 쿠폰에는 쓰지 않는다",
|
|
33
40
|
),
|
|
34
41
|
})
|
|
35
42
|
.refine((value) => (value.issueId ? 1 : 0) + (value.code ? 1 : 0) === 1, {
|
|
@@ -68,12 +75,18 @@ export const couponResultSchema = z.object({
|
|
|
68
75
|
.describe(
|
|
69
76
|
"적용하지 못한 사유. `MIN_ORDER_AMOUNT`(최소 주문 금액 미달)·`NO_ELIGIBLE_ITEMS`(대상 상품 없음)·`NOT_STARTED`·`EXPIRED`·" +
|
|
70
77
|
"`MEMBER_ONLY`(회원 전용)·`STACK_LIMIT`(같은 종류 쿠폰이 이미 적용됨)·`DUPLICATE_COUPON`·`LINE_NOT_ELIGIBLE`·`NO_DISCOUNT`·" +
|
|
71
|
-
"`IN_USE`(다른 결제에서 쓰는 중)·`LIMIT_REACHED`(1인 사용 한도)·`EXHAUSTED`(총 사용 한도)·`INACTIVE`(중지된 쿠폰). 값이 늘 수 있다",
|
|
78
|
+
"`LINE_AMBIGUOUS`(같은 `optionId`의 줄이 여럿, `lineId`로 지목한다)·`IN_USE`(다른 결제에서 쓰는 중)·`LIMIT_REACHED`(1인 사용 한도)·`EXHAUSTED`(총 사용 한도)·`INACTIVE`(중지된 쿠폰). 값이 늘 수 있다",
|
|
72
79
|
),
|
|
73
80
|
optionId: z
|
|
74
81
|
.string()
|
|
75
82
|
.nullable()
|
|
76
83
|
.describe("상품 쿠폰이 걸린 주문서 항목의 `optionId`. 그 밖은 null"),
|
|
84
|
+
lineId: z
|
|
85
|
+
.string()
|
|
86
|
+
.nullable()
|
|
87
|
+
.optional()
|
|
88
|
+
.default(null)
|
|
89
|
+
.describe("상품 쿠폰이 걸린 주문서 줄의 `lineId`(이슈 #59). 그 밖은 null. 서버는 항상 싣는다"),
|
|
77
90
|
});
|
|
78
91
|
export type CouponResult = z.infer<typeof couponResultSchema>;
|
|
79
92
|
|
|
@@ -107,6 +120,10 @@ export const checkoutPricingSchema = z.object({
|
|
|
107
120
|
.array(
|
|
108
121
|
z.object({
|
|
109
122
|
optionId: z.string().nullable(),
|
|
123
|
+
lineId: z
|
|
124
|
+
.string()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe("주문서 줄의 `lineId`(이슈 #59). 서버는 항상 싣는다"),
|
|
110
127
|
couponDiscountAmount: z.number().int().describe("이 항목에 들어간 쿠폰 할인"),
|
|
111
128
|
}),
|
|
112
129
|
)
|
|
@@ -2,15 +2,15 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 구매자용 상품 이행 (이슈 #57) — 관리 API의 상품 이행에서 구매자에게 필요한 것만 싣는다. 유형, 배송 필요 여부, 배송 안내(배송비·
|
|
5
|
-
* 무료 기준·반품·교환 배송비)
|
|
6
|
-
* 싣지 않는다.
|
|
5
|
+
* 무료 기준·반품·교환 배송비)다. 셀러 내부 값(출고지·반품지 id)은 싣지 않는다.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
7
|
+
* 유형은 `SHIPPING`(배송 상품)과 `MANUAL`(배송 없는 상품, 판매자가 제공 처리) 둘이다(이슈 #48 범위 축소).
|
|
8
|
+
* 유형 이름은 응답에서 문자열이고, 모르는 유형(서버가 나중에 더한 유형)은 `{ type: "OTHER", rawType,
|
|
9
9
|
* requiresShipping }`로 읽는다. `requiresShipping`은 판별 값에서 파생되지만 **모든 가지에 싣는다** — 모르는 유형에서도 주문서가
|
|
10
10
|
* 배송지를 받을지 정할 수 있어야 한다.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const KNOWN_TYPES: readonly string[] = ["SHIPPING", "
|
|
13
|
+
const KNOWN_TYPES: readonly string[] = ["SHIPPING", "MANUAL"];
|
|
14
14
|
|
|
15
15
|
/** 모르는 유형 — SDK가 아직 모르는 유형이다 */
|
|
16
16
|
export interface UnknownFulfillmentView {
|
|
@@ -44,23 +44,6 @@ function openUnion<T extends z.ZodType>(known: T) {
|
|
|
44
44
|
const requiresShippingDescription =
|
|
45
45
|
"택배 배송이 필요한가. false면 배송비가 없고 주문서가 배송지를 받지 않는다";
|
|
46
46
|
|
|
47
|
-
const withdrawalRestrictedField = z
|
|
48
|
-
.boolean()
|
|
49
|
-
.describe(
|
|
50
|
-
"청약철회 제한 대상인가. true면 주문서가 제한 고지 동의를 받고, 첫 다운로드·열람 뒤 단순 변심 취소·반품을 받지 않는다",
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
/** 방문 수령 장소 표시값 — 주소 id는 싣지 않는다 */
|
|
54
|
-
export const pickupLocationSchema = z.object({
|
|
55
|
-
name: z.string().describe("수령 장소 이름"),
|
|
56
|
-
zipCode: z.string(),
|
|
57
|
-
address1: z.string(),
|
|
58
|
-
address2: z.string().nullable(),
|
|
59
|
-
phone: z.string().describe("수령 장소 연락처"),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export type PickupLocation = z.infer<typeof pickupLocationSchema>;
|
|
63
|
-
|
|
64
47
|
/** 상품 카드(목록·찜)의 이행 — 유형과 배송 필요 여부만. 배송비·환불 정책은 상세에서 본다 */
|
|
65
48
|
export const productCardFulfillmentSchema = z.object({
|
|
66
49
|
type: z.string().describe("상품 유형. 값이 추가될 수 있어 문자열로 받는다"),
|
|
@@ -99,30 +82,7 @@ export const productFulfillmentViewSchema = openUnion(
|
|
|
99
82
|
.describe("단순 변심 교환 배송비(유효 환불 정책). 원 단위"),
|
|
100
83
|
}),
|
|
101
84
|
}),
|
|
102
|
-
z.object({
|
|
103
|
-
type: z.literal("DOWNLOAD"),
|
|
104
|
-
requiresShipping: z.literal(false),
|
|
105
|
-
download: z.object({
|
|
106
|
-
limit: z.number().int().describe("다운로드 횟수 한도(수량 1개당)"),
|
|
107
|
-
days: z.number().int().describe("다운로드 기간(제공일부터 일수)"),
|
|
108
|
-
withdrawalRestricted: withdrawalRestrictedField,
|
|
109
|
-
}),
|
|
110
|
-
}),
|
|
111
|
-
z.object({
|
|
112
|
-
type: z.literal("CODE"),
|
|
113
|
-
requiresShipping: z.literal(false),
|
|
114
|
-
code: z.object({ withdrawalRestricted: withdrawalRestrictedField }),
|
|
115
|
-
}),
|
|
116
|
-
z.object({ type: z.literal("SERVICE"), requiresShipping: z.literal(false) }),
|
|
117
|
-
z.object({
|
|
118
|
-
type: z.literal("PICKUP"),
|
|
119
|
-
requiresShipping: z.literal(false),
|
|
120
|
-
pickup: z.object({
|
|
121
|
-
location: pickupLocationSchema
|
|
122
|
-
.nullable()
|
|
123
|
-
.describe("방문 수령 장소. 수령지가 지워졌으면 null이다(판매자에게 문의)"),
|
|
124
|
-
}),
|
|
125
|
-
}),
|
|
85
|
+
z.object({ type: z.literal("MANUAL"), requiresShipping: z.literal(false) }),
|
|
126
86
|
]),
|
|
127
87
|
).describe(
|
|
128
88
|
"상품 이행. `type`이 유형이고 같은 이름의 키가 유형별 안내다. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다",
|
|
@@ -134,48 +94,26 @@ export type ProductFulfillmentView = z.infer<typeof productFulfillmentViewSchema
|
|
|
134
94
|
export const lineFulfillmentSchema = z.object({
|
|
135
95
|
type: z.string().describe("상품 유형. 값이 추가될 수 있어 문자열로 받는다"),
|
|
136
96
|
requiresShipping: z.boolean().describe(requiresShippingDescription),
|
|
137
|
-
withdrawalRestricted:
|
|
97
|
+
withdrawalRestricted: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe(
|
|
101
|
+
"**Deprecated** — 항상 false다. 청약철회 제한 기능을 없앴고(이슈 #48) storefront-sdk 0.15 이하 호환으로만 싣는다. " +
|
|
102
|
+
"게시된 스토어프론트가 0.16 이상으로 넘어간 뒤 다음 릴리스에서 뺀다",
|
|
103
|
+
),
|
|
138
104
|
});
|
|
139
105
|
|
|
140
106
|
export type LineFulfillment = z.infer<typeof lineFulfillmentSchema>;
|
|
141
107
|
|
|
142
108
|
/**
|
|
143
|
-
* 내 주문 주문상품의 주문 시점 이행 스냅샷. 상품을 나중에 고쳐도 바뀌지 않는다.
|
|
109
|
+
* 내 주문 주문상품의 주문 시점 이행 스냅샷. 상품을 나중에 고쳐도 바뀌지 않는다. 제공 기록(제공 시각·판매자 안내)은
|
|
144
110
|
* 주문상품의 `fulfillment`다.
|
|
145
111
|
*/
|
|
146
112
|
export const myOrderItemFulfillmentSnapshotSchema = openUnion(
|
|
147
113
|
z.discriminatedUnion("type", [
|
|
148
114
|
z.object({ type: z.literal("SHIPPING"), requiresShipping: z.literal(true) }),
|
|
149
|
-
z.object({
|
|
150
|
-
type: z.literal("DOWNLOAD"),
|
|
151
|
-
requiresShipping: z.literal(false),
|
|
152
|
-
download: z.object({ withdrawalRestricted: withdrawalRestrictedField }),
|
|
153
|
-
}),
|
|
154
|
-
z.object({
|
|
155
|
-
type: z.literal("CODE"),
|
|
156
|
-
requiresShipping: z.literal(false),
|
|
157
|
-
code: z.object({ withdrawalRestricted: withdrawalRestrictedField }),
|
|
158
|
-
}),
|
|
159
|
-
z.object({ type: z.literal("SERVICE"), requiresShipping: z.literal(false) }),
|
|
160
|
-
z.object({
|
|
161
|
-
type: z.literal("PICKUP"),
|
|
162
|
-
requiresShipping: z.literal(false),
|
|
163
|
-
pickup: z.object({
|
|
164
|
-
location: pickupLocationSchema
|
|
165
|
-
.nullable()
|
|
166
|
-
.describe("주문 시점 방문 수령 장소. 수령지가 지워졌으면 null이다(판매자에게 문의)"),
|
|
167
|
-
}),
|
|
168
|
-
}),
|
|
115
|
+
z.object({ type: z.literal("MANUAL"), requiresShipping: z.literal(false) }),
|
|
169
116
|
]),
|
|
170
117
|
).describe("주문 시점 이행 스냅샷. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다");
|
|
171
118
|
|
|
172
119
|
export type MyOrderItemFulfillmentSnapshot = z.infer<typeof myOrderItemFulfillmentSnapshotSchema>;
|
|
173
|
-
|
|
174
|
-
/** 청약철회 제한 대상인가 — 파일 다운로드·코드 발급만 켤 수 있다 */
|
|
175
|
-
export function withdrawalRestrictedOfView(
|
|
176
|
-
fulfillment: ProductFulfillmentView | MyOrderItemFulfillmentSnapshot,
|
|
177
|
-
): boolean {
|
|
178
|
-
if (fulfillment.type === "DOWNLOAD") return fulfillment.download.withdrawalRestricted;
|
|
179
|
-
if (fulfillment.type === "CODE") return fulfillment.code.withdrawalRestricted;
|
|
180
|
-
return false;
|
|
181
|
-
}
|