@sayren/storefront-sdk 0.18.3 → 0.18.4
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-PJk8g5DY.mjs → checkout-CCsO8PY2.mjs} +2 -1
- package/dist/{client-nLYVG_HJ.mjs → client-5Nd-KG-G.mjs} +3 -3
- package/dist/{index-jE8JxvGj.d.mts → index-AQs_Qyhm.d.mts} +3 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/payments/index.d.mts +6 -1
- package/dist/payments/index.mjs +3 -2
- package/package.json +1 -1
- package/src/payments/index.ts +6 -0
- package/src/schemas/checkout.ts +7 -0
- package/src/schemas/review.ts +5 -2
package/dist/auth/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createStorefrontClient, yt as ApiError } from "../client-
|
|
1
|
+
import { t as createStorefrontClient, yt as ApiError } from "../client-5Nd-KG-G.mjs";
|
|
2
2
|
//#region src/auth/index.ts
|
|
3
3
|
/** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
|
|
4
4
|
var IdpCallbackError = class extends Error {
|
|
@@ -536,7 +536,8 @@ const paymentStatusSchema = z.object({
|
|
|
536
536
|
attemptId: z.string(),
|
|
537
537
|
category: z.string().describe("`PREPARE_FAILURE`·`DECLINED`·`USER_CANCELED`(값이 추가될 수 있다)"),
|
|
538
538
|
code: z.string().nullable().describe("PG가 준 실패 코드. 내부 사유는 null입니다. 화면 분기는 `category`로 하십시오"),
|
|
539
|
-
message: z.string().nullable().describe("구매자에게 보여 줄 안내 문구")
|
|
539
|
+
message: z.string().nullable().describe("구매자에게 보여 줄 안내 문구"),
|
|
540
|
+
optionUnavailable: z.boolean().optional().describe("true면 상점의 PG 설정 문제처럼 구매자가 고칠 수 없는 실패입니다(이슈 #86). 같은 결제 옵션으로 다시 시도해도 실패하므로 그 옵션을 고르지 못하게 하고 다른 결제수단을 고르게 하십시오. 이때 `message`는 그 안내입니다. 서버는 항상 싣습니다")
|
|
540
541
|
}).nullable().describe("현재 결제 시도가 실패·취소로 끝났으면 그 내용, 아니면 null"),
|
|
541
542
|
testPayment: z.boolean().describe("테스트 결제(샌드박스)인가. true면 실제로 돈이 나가지 않았습니다"),
|
|
542
543
|
expiresAt: z.string().describe("결제 요청 만료 시각")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ANALYTICS_VISITOR_HEADER, r as ANALYTICS_SESSION_HEADER } from "./analytics-CgD70OqH.mjs";
|
|
2
|
-
import { $ as lineFulfillmentSchema, A as startPaymentRequestSchema, C as paymentStartSchema, F as checkoutPricingSchema, J as customInputViewSchema, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, U as addonGroupViewSchema, V as myCouponSchema, X as lineSelectionResponseShape, Y as lineSelectionRequestShape, d as createCheckoutRequestSchema, et as myOrderItemFulfillmentSnapshotSchema, f as deliveryQuoteRequestSchema, m as easyPayProviderResponseSchema, nt as productFulfillmentViewSchema, p as deliveryQuoteSchema, tt as productCardFulfillmentSchema, u as checkoutSessionSchema, w as paymentStatusSchema, y as paymentMethodSchema } from "./checkout-
|
|
2
|
+
import { $ as lineFulfillmentSchema, A as startPaymentRequestSchema, C as paymentStartSchema, F as checkoutPricingSchema, J as customInputViewSchema, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, U as addonGroupViewSchema, V as myCouponSchema, X as lineSelectionResponseShape, Y as lineSelectionRequestShape, d as createCheckoutRequestSchema, et as myOrderItemFulfillmentSnapshotSchema, f as deliveryQuoteRequestSchema, m as easyPayProviderResponseSchema, nt as productFulfillmentViewSchema, p as deliveryQuoteSchema, tt as productCardFulfillmentSchema, u as checkoutSessionSchema, w as paymentStatusSchema, y as paymentMethodSchema } from "./checkout-CCsO8PY2.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/http.ts
|
|
5
5
|
/** 표준 엔벨로프의 $.error 상세 */
|
|
@@ -771,7 +771,7 @@ const updateReviewRequestSchema = z.object({
|
|
|
771
771
|
content: z.string().min(10).max(2e3).optional(),
|
|
772
772
|
images: z.array(z.url()).max(5).optional()
|
|
773
773
|
}).refine((value) => Object.values(value).some((v) => v !== void 0), { message: "최소 1개 필드가 필요합니다" });
|
|
774
|
-
/** 리뷰 정렬 — `helpful
|
|
774
|
+
/** 리뷰 정렬 — `helpful`(랭킹순)은 사진 있는 리뷰 → 평점 높은 순 → 최신 순이다(도움돼요 수 데이터는 없다, #97) */
|
|
775
775
|
const productReviewSortSchema = z.enum([
|
|
776
776
|
"latest",
|
|
777
777
|
"ratingDesc",
|
|
@@ -783,7 +783,7 @@ const productReviewQuerySchema = z.object({
|
|
|
783
783
|
rating: z.string().optional().describe("이 평점(1~5)의 리뷰만"),
|
|
784
784
|
hasImage: z.string().optional().describe("`true`면 사진이 있는 리뷰만"),
|
|
785
785
|
variantId: z.string().optional().describe("이 옵션(조합)으로 산 리뷰만(이슈 #91). 상품 상세 `variants[].variantId`이고 리뷰 응답의 `variantId`와 같은 값이다. 다른 필터와 함께 쓰면 모두 만족하는 리뷰만 온다"),
|
|
786
|
-
sort: z.string().optional().describe("정렬. `latest`(
|
|
786
|
+
sort: z.string().optional().describe("정렬. `latest`(기본, 최신 순)·`ratingDesc`(평점 높은 순)·`ratingAsc`(평점 낮은 순)·`helpful`(랭킹순 — 사진 있는 리뷰 먼저, 그다음 평점 높은 순, 같으면 최신 순. 도움돼요 수는 반영하지 않는다)"),
|
|
787
787
|
page: z.string().optional().describe("페이지 번호 (1부터)"),
|
|
788
788
|
size: z.string().optional().describe("페이지 크기")
|
|
789
789
|
});
|
|
@@ -1023,6 +1023,7 @@ declare const paymentStatusSchema: z.ZodObject<{
|
|
|
1023
1023
|
category: z.ZodString;
|
|
1024
1024
|
code: z.ZodNullable<z.ZodString>;
|
|
1025
1025
|
message: z.ZodNullable<z.ZodString>;
|
|
1026
|
+
optionUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
1026
1027
|
}, z.core.$strip>>;
|
|
1027
1028
|
testPayment: z.ZodBoolean;
|
|
1028
1029
|
expiresAt: z.ZodString;
|
|
@@ -1610,7 +1611,7 @@ declare const updateReviewRequestSchema: z.ZodObject<{
|
|
|
1610
1611
|
images: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
1611
1612
|
}, z.core.$strip>;
|
|
1612
1613
|
type UpdateReviewRequest = z.infer<typeof updateReviewRequestSchema>;
|
|
1613
|
-
/** 리뷰 정렬 — `helpful
|
|
1614
|
+
/** 리뷰 정렬 — `helpful`(랭킹순)은 사진 있는 리뷰 → 평점 높은 순 → 최신 순이다(도움돼요 수 데이터는 없다, #97) */
|
|
1614
1615
|
declare const productReviewSortSchema: z.ZodEnum<{
|
|
1615
1616
|
latest: "latest";
|
|
1616
1617
|
ratingDesc: "ratingDesc";
|
|
@@ -2377,6 +2378,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2377
2378
|
category: string;
|
|
2378
2379
|
code: string | null;
|
|
2379
2380
|
message: string | null;
|
|
2381
|
+
optionUnavailable?: boolean | undefined;
|
|
2380
2382
|
} | null;
|
|
2381
2383
|
testPayment: boolean;
|
|
2382
2384
|
expiresAt: string;
|
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 CreateReviewRequest, $n as PaymentFailureCategory, $r as PageParams, $t as CouponResult, A as ANALYTICS_MAX_BATCH_BYTES, An as MyClaim, Ar as paymentStatusSchema, At as memberAddressRequestSchema, B as analyticsBatchSchema, Bn as CashReceiptRequest, Br as ProductFacets, Bt as createInquiryResultSchema, C as PurchaseDecisionResult, Cn as consentUpdateRequestSchema, Cr as paymentFailureCategorySchema, Ct as uploadTicketSchema, D as orderShippingAddressSchema, Dn as ClaimType, Dr as paymentOptionListSchema, Dt as MemberAddressRequest, E as myOrderSchema, En as ClaimReturnAddress, Er as paymentOptionKey, Et as MemberAddress, F as AnalyticsBatch, Fn as createClaimResultSchema, Fr as shippingAddressInputSchema, Ft as CreateInquiryRequest, G as StorefrontClient, Gn as DeliveryQuoteRequest, Gr as productCardSchema, Gt as CustomerInquiryCategory, H as analyticsClientEventSchema, Hn as CheckoutDelivery, Hr as ProductSearchParams, Ht as publicInquirySchema, I as AnalyticsClientEvent, In as myClaimSchema, Ir as startPaymentRequestSchema, It as CreateInquiryResult, J as STOREFRONT_SESSION_KEYS, Jn as GuestInfo, Jr as productPageSchema, Jt as customerInquirySchema, K as StorefrontClientOptions, Kn as DeliveryQuoteResult, Kr as productDetailSchema, Kt as createCustomerInquiryRequestSchema, L as AnalyticsClientEventName, Ln as AvailablePaymentOption, Lr as CategoryNode, Lt as ProductInquiryCategory, M as ANALYTICS_SESSION_HEADER, Mn as claimReturnAddressSchema, Mr as remoteAreaSchema, Mt as memberSchema, N as ANALYTICS_VISITOR_COOKIE, Nn as claimTypeSchema, Nr as residentNumberLike, Nt as updateProfileRequestSchema, O as purchaseDecisionResultSchema, On as CreateClaimRequest, Or as paymentOptionSchema, Ot as UpdateProfileRequest, P as ANALYTICS_VISITOR_HEADER, Pn as createClaimRequestSchema, Pr as retryPaymentRequestSchema, Pt as wishlistAddResultSchema, Q as createStorefrontSession, Qn as PAYMENT_STATUS_VALUES, Qr as PageInfo, Qt as CouponApplication, R as AnalyticsEventName, Rn as CASH_RECEIPT_METHODS, Rr as ProductCard, Rt as PublicInquiry, S as OrderShippingAddress, Sn as consentStateSchema, Sr as guestInfoSchema, St as updateReviewResultSchema, T as myOrderItemSchema, Tn as ClaimReason, Tr as paymentMethodSchema, Tt as Member, U as analyticsIdSchema, Un as CheckoutSession, Ur as ProductSort, Ut as CreateCustomerInquiryRequest, V as analyticsClientEventNameSchema, Vn as CashReceiptType, Vr as ProductPage, Vt as productInquiryCategorySchema, W as analyticsServerEventNameSchema, Wn as CreateCheckoutRequest, Wr as categoryNodeSchema, Wt as CustomerInquiry, X as StorefrontSession, Xn as KnownPaymentStatus, Xr as ClaimStatus, Xt as CheckoutPricing, Y as SessionStorage, Yn as KnownPaymentResult, Yr as productSortSchema, Yt as ApplicableCoupon, Z as StorefrontSessionOptions, Zn as PAYMENT_RESULT_VALUES, Zr as OrderItemStatus, Zt as CheckoutPricingRequest, _ as normalizeCustomInputValue, _i as addCartItemRequestSchema, _n as ConsentUpdateRequest, _r as createCheckoutRequestSchema, _t as publicReviewSchema, a as CustomInputEntry, ai as MyOrderItemFulfillmentSnapshot, an as checkoutPricingSchema, ar as PgProvider, at as ReviewImageUploadRequest, b as MyOrder, bi as updateCartItemRequestSchema, bn as consentKindSchema, br as easyPayProviderResponseSchema, bt as reviewSummarySchema, c as OptionSelectionView, ci as UnknownFulfillmentView, cn as couponBenefitViewSchema, cr as ShippingAddressInput, ct as UpdateReviewRequest, d as customInputEntrySchema, di as productCardFulfillmentSchema, dn as myCouponSchema, dr as cashReceiptAvailable, dt as WritableReview, ei as claimStatusSchema, en as MAX_COUPONS_PER_CHECKOUT, er as PaymentMessage, et as CreateReviewResult, f as customInputLength, fi as productFulfillmentViewSchema, fn as pricingAmountsSchema, fr as cashReceiptIdentityTypeOf, ft as createReviewRequestSchema, g as lineSelectionResponseShape, gi as UpdateCartItemRequest, gn as ConsentState, gr as checkoutSessionSchema, gt as productReviewSortSchema, h as lineSelectionRequestShape, hi as CartItem, hn as ConsentSource, hr as checkoutDeliverySchema, ht as productReviewQuerySchema, i as AddonSelection, ii as LineFulfillment, in as checkoutPricingRequestSchema, ir as PaymentStatus, it as PublicReview, j as ANALYTICS_SESSION_COOKIE, jn as claimReasonSchema, jr as pgProviderSchema, jt as memberAddressSchema, k as trackingStageResponseSchema, kn as CreateClaimResult, kr as paymentStartSchema, kt as WishlistAddResult, l as addonGroupViewSchema, li as lineFulfillmentSchema, ln as couponResultSchema, lr as StartPaymentRequest, lt as UpdateReviewResult, m as customInputViewSchema, mi as Cart, mn as ConsentKind, mr as cashReceiptTypeSchema, mt as myReviewSchema, n as storefrontStoreSchema, ni as pageInfoSchema, nn as MyCoupon, nr as PaymentOption, nt as ProductReviewParams, o as CustomInputValueView, oi as ProductCardFulfillment, on as couponApplicationListSchema, or as RemoteArea, ot as ReviewPage, p as customInputValueViewSchema, pi as AddCartItemRequest, pn as ConsentAction, pr as cashReceiptRequestSchema, pt as createReviewResultSchema, q as createStorefrontClient, qn as EasyPayProvider, qr as productFacetsSchema, qt as customerInquiryCategorySchema, r as AddonGroupView, ri as pageSchema, rn as applicableCouponSchema, rr as PaymentStart, rt as ProductReviewSort, s as CustomInputView, si as ProductFulfillmentView, sn as couponApplicationSchema, sr as RetryPaymentRequest, st as ReviewSummary, t as StorefrontStore, ti as orderItemStatusSchema, tn as MIN_PAYMENT_AMOUNT, tr as PaymentMethod, tt as MyReview, u as addonSelectionSchema, ui as myOrderItemFulfillmentSnapshotSchema, un as myCouponListQuerySchema, ur as availablePaymentOptionSchema, ut as UploadTicket, v as optionSelectionViewSchema, vi as cartItemSchema, vn as MemberConsents, vr as deliveryQuoteRequestSchema, vt as reviewImageUploadRequestSchema, w as deliveryTrackingSchema, wn as memberConsentsSchema, wr as paymentMessageSchema, wt as writableReviewSchema, x as MyOrderItem, xi as analyticsIdsFromCookie, xn as consentSourceSchema, xr as easyPayProviderSchema, xt as updateReviewRequestSchema, y as DeliveryTracking, yi as cartSchema, yn as consentActionSchema, yr as deliveryQuoteSchema, yt as reviewPageSchema, z as AnalyticsServerEventName, zn as CashReceiptIdentityType, zr as ProductDetail, zt as createInquiryRequestSchema } from "./index-
|
|
2
|
+
import { $ as CreateReviewRequest, $n as PaymentFailureCategory, $r as PageParams, $t as CouponResult, A as ANALYTICS_MAX_BATCH_BYTES, An as MyClaim, Ar as paymentStatusSchema, At as memberAddressRequestSchema, B as analyticsBatchSchema, Bn as CashReceiptRequest, Br as ProductFacets, Bt as createInquiryResultSchema, C as PurchaseDecisionResult, Cn as consentUpdateRequestSchema, Cr as paymentFailureCategorySchema, Ct as uploadTicketSchema, D as orderShippingAddressSchema, Dn as ClaimType, Dr as paymentOptionListSchema, Dt as MemberAddressRequest, E as myOrderSchema, En as ClaimReturnAddress, Er as paymentOptionKey, Et as MemberAddress, F as AnalyticsBatch, Fn as createClaimResultSchema, Fr as shippingAddressInputSchema, Ft as CreateInquiryRequest, G as StorefrontClient, Gn as DeliveryQuoteRequest, Gr as productCardSchema, Gt as CustomerInquiryCategory, H as analyticsClientEventSchema, Hn as CheckoutDelivery, Hr as ProductSearchParams, Ht as publicInquirySchema, I as AnalyticsClientEvent, In as myClaimSchema, Ir as startPaymentRequestSchema, It as CreateInquiryResult, J as STOREFRONT_SESSION_KEYS, Jn as GuestInfo, Jr as productPageSchema, Jt as customerInquirySchema, K as StorefrontClientOptions, Kn as DeliveryQuoteResult, Kr as productDetailSchema, Kt as createCustomerInquiryRequestSchema, L as AnalyticsClientEventName, Ln as AvailablePaymentOption, Lr as CategoryNode, Lt as ProductInquiryCategory, M as ANALYTICS_SESSION_HEADER, Mn as claimReturnAddressSchema, Mr as remoteAreaSchema, Mt as memberSchema, N as ANALYTICS_VISITOR_COOKIE, Nn as claimTypeSchema, Nr as residentNumberLike, Nt as updateProfileRequestSchema, O as purchaseDecisionResultSchema, On as CreateClaimRequest, Or as paymentOptionSchema, Ot as UpdateProfileRequest, P as ANALYTICS_VISITOR_HEADER, Pn as createClaimRequestSchema, Pr as retryPaymentRequestSchema, Pt as wishlistAddResultSchema, Q as createStorefrontSession, Qn as PAYMENT_STATUS_VALUES, Qr as PageInfo, Qt as CouponApplication, R as AnalyticsEventName, Rn as CASH_RECEIPT_METHODS, Rr as ProductCard, Rt as PublicInquiry, S as OrderShippingAddress, Sn as consentStateSchema, Sr as guestInfoSchema, St as updateReviewResultSchema, T as myOrderItemSchema, Tn as ClaimReason, Tr as paymentMethodSchema, Tt as Member, U as analyticsIdSchema, Un as CheckoutSession, Ur as ProductSort, Ut as CreateCustomerInquiryRequest, V as analyticsClientEventNameSchema, Vn as CashReceiptType, Vr as ProductPage, Vt as productInquiryCategorySchema, W as analyticsServerEventNameSchema, Wn as CreateCheckoutRequest, Wr as categoryNodeSchema, Wt as CustomerInquiry, X as StorefrontSession, Xn as KnownPaymentStatus, Xr as ClaimStatus, Xt as CheckoutPricing, Y as SessionStorage, Yn as KnownPaymentResult, Yr as productSortSchema, Yt as ApplicableCoupon, Z as StorefrontSessionOptions, Zn as PAYMENT_RESULT_VALUES, Zr as OrderItemStatus, Zt as CheckoutPricingRequest, _ as normalizeCustomInputValue, _i as addCartItemRequestSchema, _n as ConsentUpdateRequest, _r as createCheckoutRequestSchema, _t as publicReviewSchema, a as CustomInputEntry, ai as MyOrderItemFulfillmentSnapshot, an as checkoutPricingSchema, ar as PgProvider, at as ReviewImageUploadRequest, b as MyOrder, bi as updateCartItemRequestSchema, bn as consentKindSchema, br as easyPayProviderResponseSchema, bt as reviewSummarySchema, c as OptionSelectionView, ci as UnknownFulfillmentView, cn as couponBenefitViewSchema, cr as ShippingAddressInput, ct as UpdateReviewRequest, d as customInputEntrySchema, di as productCardFulfillmentSchema, dn as myCouponSchema, dr as cashReceiptAvailable, dt as WritableReview, ei as claimStatusSchema, en as MAX_COUPONS_PER_CHECKOUT, er as PaymentMessage, et as CreateReviewResult, f as customInputLength, fi as productFulfillmentViewSchema, fn as pricingAmountsSchema, fr as cashReceiptIdentityTypeOf, ft as createReviewRequestSchema, g as lineSelectionResponseShape, gi as UpdateCartItemRequest, gn as ConsentState, gr as checkoutSessionSchema, gt as productReviewSortSchema, h as lineSelectionRequestShape, hi as CartItem, hn as ConsentSource, hr as checkoutDeliverySchema, ht as productReviewQuerySchema, i as AddonSelection, ii as LineFulfillment, in as checkoutPricingRequestSchema, ir as PaymentStatus, it as PublicReview, j as ANALYTICS_SESSION_COOKIE, jn as claimReasonSchema, jr as pgProviderSchema, jt as memberAddressSchema, k as trackingStageResponseSchema, kn as CreateClaimResult, kr as paymentStartSchema, kt as WishlistAddResult, l as addonGroupViewSchema, li as lineFulfillmentSchema, ln as couponResultSchema, lr as StartPaymentRequest, lt as UpdateReviewResult, m as customInputViewSchema, mi as Cart, mn as ConsentKind, mr as cashReceiptTypeSchema, mt as myReviewSchema, n as storefrontStoreSchema, ni as pageInfoSchema, nn as MyCoupon, nr as PaymentOption, nt as ProductReviewParams, o as CustomInputValueView, oi as ProductCardFulfillment, on as couponApplicationListSchema, or as RemoteArea, ot as ReviewPage, p as customInputValueViewSchema, pi as AddCartItemRequest, pn as ConsentAction, pr as cashReceiptRequestSchema, pt as createReviewResultSchema, q as createStorefrontClient, qn as EasyPayProvider, qr as productFacetsSchema, qt as customerInquiryCategorySchema, r as AddonGroupView, ri as pageSchema, rn as applicableCouponSchema, rr as PaymentStart, rt as ProductReviewSort, s as CustomInputView, si as ProductFulfillmentView, sn as couponApplicationSchema, sr as RetryPaymentRequest, st as ReviewSummary, t as StorefrontStore, ti as orderItemStatusSchema, tn as MIN_PAYMENT_AMOUNT, tr as PaymentMethod, tt as MyReview, u as addonSelectionSchema, ui as myOrderItemFulfillmentSnapshotSchema, un as myCouponListQuerySchema, ur as availablePaymentOptionSchema, ut as UploadTicket, v as optionSelectionViewSchema, vi as cartItemSchema, vn as MemberConsents, vr as deliveryQuoteRequestSchema, vt as reviewImageUploadRequestSchema, w as deliveryTrackingSchema, wn as memberConsentsSchema, wr as paymentMessageSchema, wt as writableReviewSchema, x as MyOrderItem, xi as analyticsIdsFromCookie, xn as consentSourceSchema, xr as easyPayProviderSchema, xt as updateReviewRequestSchema, y as DeliveryTracking, yi as cartSchema, yn as consentActionSchema, yr as deliveryQuoteSchema, yt as reviewPageSchema, z as AnalyticsServerEventName, zn as CashReceiptIdentityType, zr as ProductDetail, zt as createInquiryRequestSchema } from "./index-AQs_Qyhm.mjs";
|
|
3
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, MyReview, OptionSelectionView, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_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, RetryPaymentRequest, ReviewImageUploadRequest, 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, 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, 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, myReviewSchema, normalizeCustomInputValue, optionSelectionViewSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, 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, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, 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 orderItemStatusSchema, A as publicInquirySchema, B as claimReasonSchema, C as memberAddressSchema, D as createInquiryRequestSchema, E as wishlistAddResultSchema, F as consentKindSchema, G as myClaimSchema, H as claimTypeSchema, I as consentSourceSchema, J as productDetailSchema, K as categoryNodeSchema, L as consentStateSchema, M as customerInquiryCategorySchema, N as customerInquirySchema, O as createInquiryResultSchema, P as consentActionSchema, Q as claimStatusSchema, R as consentUpdateRequestSchema, S as memberAddressRequestSchema, St as unwrapData, T as updateProfileRequestSchema, U as createClaimRequestSchema, V as claimReturnAddressSchema, W as createClaimResultSchema, X as productPageSchema, Y as productFacetsSchema, Z as productSortSchema, _ as myOrderItemSchema, _t as withdrawRequestSchema, a as myReviewSchema, at as updateCartItemRequestSchema, b as purchaseDecisionResultSchema, bt as buildQuery, c as publicReviewSchema, ct as idpAuthorizeRequestSchema, d as reviewSummarySchema, dt as linkIdentityRequestSchema, et as pageInfoSchema, f as updateReviewRequestSchema, ft as loginRequestSchema, g as deliveryTrackingSchema, gt as tokenPairSchema, h as writableReviewSchema, ht as socialProviderSchema, i as createReviewResultSchema, it as cartSchema, j as createCustomerInquiryRequestSchema, k as productInquiryCategorySchema, l as reviewImageUploadRequestSchema, lt as idpAuthorizeResponseSchema, m as uploadTicketSchema, mt as signupRequestSchema, n as storefrontStoreSchema, nt as addCartItemRequestSchema, o as productReviewQuerySchema, ot as anonymousSessionSchema, p as updateReviewResultSchema, pt as memberIdentitiesSchema, q as productCardSchema, r as createReviewRequestSchema, rt as cartItemSchema, s as productReviewSortSchema, st as idpAgreementsSchema, t as createStorefrontClient, tt as pageSchema, u as reviewPageSchema, ut as idpTokenRequestSchema, v as myOrderSchema, vt as withdrawalBlockedDetailsSchema, w as memberSchema, x as trackingStageResponseSchema, xt as toApiError, y as orderShippingAddressSchema, yt as ApiError, z as memberConsentsSchema } from "./client-
|
|
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-
|
|
3
|
+
import { $ as orderItemStatusSchema, A as publicInquirySchema, B as claimReasonSchema, C as memberAddressSchema, D as createInquiryRequestSchema, E as wishlistAddResultSchema, F as consentKindSchema, G as myClaimSchema, H as claimTypeSchema, I as consentSourceSchema, J as productDetailSchema, K as categoryNodeSchema, L as consentStateSchema, M as customerInquiryCategorySchema, N as customerInquirySchema, O as createInquiryResultSchema, P as consentActionSchema, Q as claimStatusSchema, R as consentUpdateRequestSchema, S as memberAddressRequestSchema, St as unwrapData, T as updateProfileRequestSchema, U as createClaimRequestSchema, V as claimReturnAddressSchema, W as createClaimResultSchema, X as productPageSchema, Y as productFacetsSchema, Z as productSortSchema, _ as myOrderItemSchema, _t as withdrawRequestSchema, a as myReviewSchema, at as updateCartItemRequestSchema, b as purchaseDecisionResultSchema, bt as buildQuery, c as publicReviewSchema, ct as idpAuthorizeRequestSchema, d as reviewSummarySchema, dt as linkIdentityRequestSchema, et as pageInfoSchema, f as updateReviewRequestSchema, ft as loginRequestSchema, g as deliveryTrackingSchema, gt as tokenPairSchema, h as writableReviewSchema, ht as socialProviderSchema, i as createReviewResultSchema, it as cartSchema, j as createCustomerInquiryRequestSchema, k as productInquiryCategorySchema, l as reviewImageUploadRequestSchema, lt as idpAuthorizeResponseSchema, m as uploadTicketSchema, mt as signupRequestSchema, n as storefrontStoreSchema, nt as addCartItemRequestSchema, o as productReviewQuerySchema, ot as anonymousSessionSchema, p as updateReviewResultSchema, pt as memberIdentitiesSchema, q as productCardSchema, r as createReviewRequestSchema, rt as cartItemSchema, s as productReviewSortSchema, st as idpAgreementsSchema, t as createStorefrontClient, tt as pageSchema, u as reviewPageSchema, ut as idpTokenRequestSchema, v as myOrderSchema, vt as withdrawalBlockedDetailsSchema, w as memberSchema, x as trackingStageResponseSchema, xt as toApiError, y as orderShippingAddressSchema, yt as ApiError, z as memberConsentsSchema } from "./client-5Nd-KG-G.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-CCsO8PY2.mjs";
|
|
5
5
|
//#region src/session.ts
|
|
6
6
|
/** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
|
|
7
7
|
const STOREFRONT_SESSION_KEYS = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bn as CashReceiptRequest, Jn as GuestInfo, cr as ShippingAddressInput, ir as PaymentStatus, lr as StartPaymentRequest, nr as PaymentOption, q as createStorefrontClient, rr as PaymentStart } from "../index-
|
|
1
|
+
import { Bn as CashReceiptRequest, Jn as GuestInfo, cr as ShippingAddressInput, ir as PaymentStatus, lr as StartPaymentRequest, nr as PaymentOption, q as createStorefrontClient, rr as PaymentStart } from "../index-AQs_Qyhm.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
|
@@ -47,6 +47,11 @@ export type PaymentResult = {
|
|
|
47
47
|
paymentId: string;
|
|
48
48
|
code: string;
|
|
49
49
|
message: string;
|
|
50
|
+
/**
|
|
51
|
+
* 상점의 PG 설정 문제처럼 구매자가 고칠 수 없는 실패다(`lastFailure.optionUnavailable`). 같은 옵션으로 다시 시도해도
|
|
52
|
+
* 실패하므로 그 옵션을 고르지 못하게 하고 다른 결제수단으로 `retry`하게 한다. `message`가 그 안내다
|
|
53
|
+
*/
|
|
54
|
+
optionUnavailable?: boolean;
|
|
50
55
|
} | {
|
|
51
56
|
/** 결과 확인 중 — `getStatus(paymentId)`로 확정될 때까지 조회한다 */
|
|
52
57
|
status: "PROCESSING";
|
package/dist/payments/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as paymentMessageSchema } from "../checkout-
|
|
1
|
+
import { v as paymentMessageSchema } from "../checkout-CCsO8PY2.mjs";
|
|
2
2
|
//#region src/payments/index.ts
|
|
3
3
|
/** 복귀 주소에 결제 서비스가 붙이는 쿼리 */
|
|
4
4
|
const RETURN_PAYMENT_ID = "sayrenPaymentId";
|
|
@@ -57,7 +57,8 @@ function paymentResultOf(status, options = {}) {
|
|
|
57
57
|
status: "FAILED",
|
|
58
58
|
paymentId,
|
|
59
59
|
code: lastFailure?.code ?? result,
|
|
60
|
-
message: lastFailure?.message ?? (result === "EXPIRED" ? "결제 요청이 만료됐습니다" : "결제에 실패했습니다")
|
|
60
|
+
message: lastFailure?.message ?? (result === "EXPIRED" ? "결제 요청이 만료됐습니다" : "결제에 실패했습니다"),
|
|
61
|
+
...lastFailure?.optionUnavailable ? { optionUnavailable: true } : {}
|
|
61
62
|
};
|
|
62
63
|
if (result === "PENDING") return options.popupClosed ? {
|
|
63
64
|
status: "CANCELED",
|
package/package.json
CHANGED
package/src/payments/index.ts
CHANGED
|
@@ -64,6 +64,11 @@ export type PaymentResult =
|
|
|
64
64
|
paymentId: string;
|
|
65
65
|
code: string;
|
|
66
66
|
message: string;
|
|
67
|
+
/**
|
|
68
|
+
* 상점의 PG 설정 문제처럼 구매자가 고칠 수 없는 실패다(`lastFailure.optionUnavailable`). 같은 옵션으로 다시 시도해도
|
|
69
|
+
* 실패하므로 그 옵션을 고르지 못하게 하고 다른 결제수단으로 `retry`하게 한다. `message`가 그 안내다
|
|
70
|
+
*/
|
|
71
|
+
optionUnavailable?: boolean;
|
|
67
72
|
}
|
|
68
73
|
| {
|
|
69
74
|
/** 결과 확인 중 — `getStatus(paymentId)`로 확정될 때까지 조회한다 */
|
|
@@ -180,6 +185,7 @@ export function paymentResultOf(
|
|
|
180
185
|
message:
|
|
181
186
|
lastFailure?.message ??
|
|
182
187
|
(result === "EXPIRED" ? "결제 요청이 만료됐습니다" : "결제에 실패했습니다"),
|
|
188
|
+
...(lastFailure?.optionUnavailable ? { optionUnavailable: true } : {}),
|
|
183
189
|
};
|
|
184
190
|
}
|
|
185
191
|
if (result === "PENDING") {
|
package/src/schemas/checkout.ts
CHANGED
|
@@ -499,6 +499,13 @@ export const paymentStatusSchema = z.object({
|
|
|
499
499
|
.nullable()
|
|
500
500
|
.describe("PG가 준 실패 코드. 내부 사유는 null입니다. 화면 분기는 `category`로 하십시오"),
|
|
501
501
|
message: z.string().nullable().describe("구매자에게 보여 줄 안내 문구"),
|
|
502
|
+
optionUnavailable: z
|
|
503
|
+
.boolean()
|
|
504
|
+
.optional()
|
|
505
|
+
.describe(
|
|
506
|
+
"true면 상점의 PG 설정 문제처럼 구매자가 고칠 수 없는 실패입니다(이슈 #86). 같은 결제 옵션으로 다시 시도해도 실패하므로 " +
|
|
507
|
+
"그 옵션을 고르지 못하게 하고 다른 결제수단을 고르게 하십시오. 이때 `message`는 그 안내입니다. 서버는 항상 싣습니다",
|
|
508
|
+
),
|
|
502
509
|
})
|
|
503
510
|
.nullable()
|
|
504
511
|
.describe("현재 결제 시도가 실패·취소로 끝났으면 그 내용, 아니면 null"),
|
package/src/schemas/review.ts
CHANGED
|
@@ -106,7 +106,7 @@ export const updateReviewRequestSchema = z
|
|
|
106
106
|
|
|
107
107
|
export type UpdateReviewRequest = z.infer<typeof updateReviewRequestSchema>;
|
|
108
108
|
|
|
109
|
-
/** 리뷰 정렬 — `helpful
|
|
109
|
+
/** 리뷰 정렬 — `helpful`(랭킹순)은 사진 있는 리뷰 → 평점 높은 순 → 최신 순이다(도움돼요 수 데이터는 없다, #97) */
|
|
110
110
|
export const productReviewSortSchema = z.enum(["latest", "ratingDesc", "ratingAsc", "helpful"]);
|
|
111
111
|
|
|
112
112
|
export type ProductReviewSort = z.infer<typeof productReviewSortSchema>;
|
|
@@ -125,7 +125,10 @@ export const productReviewQuerySchema = z.object({
|
|
|
125
125
|
sort: z
|
|
126
126
|
.string()
|
|
127
127
|
.optional()
|
|
128
|
-
.describe(
|
|
128
|
+
.describe(
|
|
129
|
+
"정렬. `latest`(기본, 최신 순)·`ratingDesc`(평점 높은 순)·`ratingAsc`(평점 낮은 순)·" +
|
|
130
|
+
"`helpful`(랭킹순 — 사진 있는 리뷰 먼저, 그다음 평점 높은 순, 같으면 최신 순. 도움돼요 수는 반영하지 않는다)",
|
|
131
|
+
),
|
|
129
132
|
page: z.string().optional().describe("페이지 번호 (1부터)"),
|
|
130
133
|
size: z.string().optional().describe("페이지 크기"),
|
|
131
134
|
});
|