@sayren/storefront-sdk 0.19.0 → 0.20.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-CCsO8PY2.mjs → checkout-f7iFQV88.mjs} +18 -4
- package/dist/{client-Dgpp9T8r.mjs → client-NPFWqMgT.mjs} +46 -3
- package/dist/{index-CfOZjg2U.d.mts → index-UhlK7HG7.d.mts} +130 -16
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/payments/index.d.mts +6 -1
- package/dist/payments/index.mjs +24 -3
- package/package.json +1 -1
- package/src/client.ts +14 -0
- package/src/index.ts +1 -0
- package/src/payments/index.ts +26 -2
- package/src/schemas/checkout.ts +47 -3
- package/src/schemas/order.ts +4 -3
- package/src/schemas/points.ts +62 -0
package/dist/auth/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { kt as ApiError, t as createStorefrontClient } from "../client-NPFWqMgT.mjs";
|
|
2
2
|
//#region src/auth/index.ts
|
|
3
3
|
/** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
|
|
4
4
|
var IdpCallbackError = class extends Error {
|
|
@@ -317,6 +317,13 @@ const paymentMethodSchema = z.enum([
|
|
|
317
317
|
"MOBILE",
|
|
318
318
|
"EASY_PAY"
|
|
319
319
|
]);
|
|
320
|
+
/**
|
|
321
|
+
* 응답에 실리는 결제수단 — 아는 값(`PaymentMethod`)이거나 이 SDK가 모르는 새 값(문자열)이다. 서버가 결제수단을 더해도
|
|
322
|
+
* 응답 파싱이 깨지지 않게 넓게 받는다(`responsePlanCodeSchema`·`easyPayProviderResponseSchema`와 같은 방식, #93 P0).
|
|
323
|
+
* 적립금 전액 결제 주문은 `POINT`가 온다. 화면은 아는 값으로 분기하고 모르는 값은 그대로 표시하거나 「기타」로 다룬다.
|
|
324
|
+
* 요청(결제 옵션)은 값을 골라 보내는 자리라 `paymentMethodSchema`(enum) 그대로다.
|
|
325
|
+
*/
|
|
326
|
+
const responsePaymentMethodSchema = z.union([paymentMethodSchema, z.string()]).describe("결제수단. `CARD` 카드 · `BANK_TRANSFER` 계좌이체 · `VIRTUAL_ACCOUNT` 가상계좌 · `MOBILE` 휴대폰 · `EASY_PAY` 간편결제 · `POINT` 적립금 전액 결제. 값이 추가될 수 있어 문자열로 받는다");
|
|
320
327
|
/** 결제를 처리하는 PG. 셀러가 직접 계약하고 상점 플랫폼 설정 › 결제에서 연결한다 */
|
|
321
328
|
const pgProviderSchema = z.enum(["tosspayments", "portone"]);
|
|
322
329
|
/** 간편결제사. 토스페이먼츠·포트원 모두 같은 코드를 쓴다 */
|
|
@@ -491,11 +498,18 @@ const retryPaymentRequestSchema = z.object({
|
|
|
491
498
|
returnUrl: startPaymentRequestSchema.shape.returnUrl.optional(),
|
|
492
499
|
cashReceipt: cashReceiptField
|
|
493
500
|
});
|
|
501
|
+
/**
|
|
502
|
+
* 결제 시작 상태 — `pending`이면 `payUrl`로 결제창을 연다. `completed`면 결제창 없이 결제가 끝나 주문이 만들어졌고
|
|
503
|
+
* `orderId`가 있다(적립금으로 결제 금액 전체를 낸 주문, #93). 값이 추가될 수 있어 응답은 문자열로 받는다.
|
|
504
|
+
*/
|
|
505
|
+
const PAYMENT_START_STATUS_VALUES = ["pending", "completed"];
|
|
494
506
|
const paymentStartSchema = z.object({
|
|
495
507
|
paymentId: z.string().describe("결제 id. 상태 조회·재시도의 키다"),
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
508
|
+
status: z.string().optional().default("pending").describe("결제 시작 상태. `pending`이면 `payUrl`로 결제창을 연다. `completed`면 결제창 없이 결제가 끝났고(적립금 전액 결제) `orderId`가 주문 번호다. 그 밖의 값은 결제 상태 조회(`GET /payments/{paymentId}`)로 확정한다. 이 필드가 없던 서버 응답은 `pending`으로 읽는다"),
|
|
509
|
+
orderId: z.string().nullable().optional().default(null).describe("만들어진 주문 번호. `status`가 `completed`일 때만 값이 있고 그 밖에는 null"),
|
|
510
|
+
attemptId: z.string().nullable().describe("결제 시도 id. PG 주문번호(토스 orderId, 포트원 paymentId)다. 결제창 없이 끝난 결제(`completed`)는 null"),
|
|
511
|
+
option: paymentOptionSchema.nullable().describe("이 시도의 결제 옵션. 결제창 없이 끝난 결제(`completed`)는 null"),
|
|
512
|
+
payUrl: z.string().nullable().describe("결제 서비스 주소. 팝업으로 열려면 쿼리 `mode=popup`을 붙이고, 그대로 이동하면 리다이렉트 결제다. 결제창 없이 끝난 결제(`completed`)는 null이다"),
|
|
499
513
|
expiresAt: z.string().describe("결제 요청 만료 시각"),
|
|
500
514
|
testPayment: z.boolean().describe("테스트 결제(샌드박스) 여부. true면 실제로 돈이 나가지 않는다 — 결제 화면에 테스트 결제 안내를 표시한다"),
|
|
501
515
|
amounts: checkoutSessionSchema.shape.amounts.describe("**확정 결제 금액** — 보낸 배송지로 배송비를 다시 계산한 값이다. 주문서 조회 시점의 `amounts`와 다를 수 있다(제주·도서산간 추가 배송비)"),
|
|
@@ -553,4 +567,4 @@ const paymentMessageSchema = z.object({
|
|
|
553
567
|
orderId: z.string().optional()
|
|
554
568
|
});
|
|
555
569
|
//#endregion
|
|
556
|
-
export {
|
|
570
|
+
export { normalizeCustomInputValue as $, retryPaymentRequestSchema as A, couponBenefitViewSchema as B, paymentOptionSchema as C, remoteAreaSchema as D, pgProviderSchema as E, applicableCouponSchema as F, addonGroupViewSchema as G, myCouponListQuerySchema as H, checkoutPricingRequestSchema as I, customInputLength as J, addonSelectionSchema as K, checkoutPricingSchema as L, startPaymentRequestSchema as M, MAX_COUPONS_PER_CHECKOUT as N, residentNumberLike as O, MIN_PAYMENT_AMOUNT as P, lineSelectionResponseShape as Q, couponApplicationListSchema as R, paymentOptionListSchema as S, paymentStatusSchema as T, myCouponSchema as U, couponResultSchema as V, pricingAmountsSchema as W, customInputViewSchema as X, customInputValueViewSchema as Y, lineSelectionRequestShape as Z, guestInfoSchema as _, availablePaymentOptionSchema as a, paymentMethodSchema as b, cashReceiptRequestSchema as c, checkoutSessionSchema as d, optionSelectionViewSchema as et, createCheckoutRequestSchema as f, easyPayProviderSchema as g, easyPayProviderResponseSchema as h, PAYMENT_STATUS_VALUES as i, productFulfillmentViewSchema as it, shippingAddressInputSchema as j, responsePaymentMethodSchema as k, cashReceiptTypeSchema as l, deliveryQuoteSchema as m, PAYMENT_RESULT_VALUES as n, myOrderItemFulfillmentSnapshotSchema as nt, cashReceiptAvailable as o, deliveryQuoteRequestSchema as p, customInputEntrySchema as q, PAYMENT_START_STATUS_VALUES as r, productCardFulfillmentSchema as rt, cashReceiptIdentityTypeOf as s, CASH_RECEIPT_METHODS as t, lineFulfillmentSchema as tt, checkoutDeliverySchema as u, paymentFailureCategorySchema as v, paymentStartSchema as w, paymentOptionKey as x, paymentMessageSchema as y, couponApplicationSchema as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ANALYTICS_VISITOR_HEADER, r as ANALYTICS_SESSION_HEADER } from "./analytics-CgD70OqH.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { A as retryPaymentRequestSchema, F as applicableCouponSchema, G as addonGroupViewSchema, I as checkoutPricingRequestSchema, L as checkoutPricingSchema, M as startPaymentRequestSchema, Q as lineSelectionResponseShape, T as paymentStatusSchema, U as myCouponSchema, X as customInputViewSchema, Z as lineSelectionRequestShape, d as checkoutSessionSchema, f as createCheckoutRequestSchema, h as easyPayProviderResponseSchema, it as productFulfillmentViewSchema, k as responsePaymentMethodSchema, m as deliveryQuoteSchema, nt as myOrderItemFulfillmentSnapshotSchema, p as deliveryQuoteRequestSchema, rt as productCardFulfillmentSchema, tt as lineFulfillmentSchema, w as paymentStartSchema } from "./checkout-f7iFQV88.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/http.ts
|
|
5
5
|
/** 표준 엔벨로프의 $.error 상세 */
|
|
@@ -697,7 +697,7 @@ const myOrderSchema = z.object({
|
|
|
697
697
|
requiresShipping: z.boolean().describe("택배 배송이 필요한 주문상품이 있는가. false면 `shippingAddress`는 주문자 이름·연락처만 있고 주소는 빈 문자열이다"),
|
|
698
698
|
shippingAddress: orderShippingAddressSchema,
|
|
699
699
|
payment: z.object({
|
|
700
|
-
method:
|
|
700
|
+
method: responsePaymentMethodSchema.describe("실제 결제수단(PG가 보고한 수단, 모르면 주문서에서 고른 수단). 결제창에서 바뀔 수 있다(카드 결제창의 간편결제 탭 등). 적립금 전액 결제 주문은 `POINT`다. 값이 추가될 수 있어 문자열로 받는다"),
|
|
701
701
|
easyPayProvider: easyPayProviderResponseSchema.nullable().optional().default(null).describe("간편결제사. `method`가 `EASY_PAY`일 때만 값이 있고, PG가 알려 주지 않았으면 주문서에서 고른 간편결제사다. 그 밖의 결제수단과 간편결제 이전 주문은 null. 서버는 항상 싣는다. 현재 값은 `NAVERPAY`·`KAKAOPAY`·`TOSSPAY`·`PAYCO`이고 값이 추가될 수 있어 문자열로 받는다"),
|
|
702
702
|
couponDiscountAmount: z.number().int().optional().default(0).describe("상품·주문 쿠폰 할인 합계. 쿠폰이 없으면 0. 서버는 항상 싣는다"),
|
|
703
703
|
deliveryDiscountAmount: z.number().int().optional().default(0).describe("배송비 쿠폰 할인. 쿠폰이 없으면 0. 서버는 항상 싣는다"),
|
|
@@ -743,6 +743,43 @@ const purchaseDecisionResultSchema = z.object({
|
|
|
743
743
|
decidedAt: z.string()
|
|
744
744
|
});
|
|
745
745
|
//#endregion
|
|
746
|
+
//#region src/schemas/points.ts
|
|
747
|
+
/**
|
|
748
|
+
* 적립금 (이슈 #93) — 상점 적립 정책 안내와 구매자 잔액·내역. 금액은 원 단위 정수다.
|
|
749
|
+
* 적립금 사용(주문서·결제)은 다음 단계에서 가산한다.
|
|
750
|
+
*/
|
|
751
|
+
/** `GET /point-policy` — 상점 적립 정책(인증 없음, 상점 단위). 리뷰 작성·주문 화면의 혜택 안내에 쓴다 */
|
|
752
|
+
const storefrontPointPolicySchema = z.object({
|
|
753
|
+
reviewReward: z.object({
|
|
754
|
+
enabled: z.boolean().describe("리뷰 적립 사용 여부. false면 리뷰 혜택 안내를 그리지 않는다"),
|
|
755
|
+
textPoint: z.number().int().describe("리뷰를 작성하면 주는 적립금(원)"),
|
|
756
|
+
photoPoint: z.number().int().describe("사진 리뷰에 더 주는 적립금(원). 사진 리뷰는 `textPoint + photoPoint`다")
|
|
757
|
+
}).describe("리뷰 적립"),
|
|
758
|
+
purchaseEarn: z.object({
|
|
759
|
+
enabled: z.boolean().describe("구매 적립 사용 여부"),
|
|
760
|
+
rateBp: z.number().int().describe("상점 기본 구매 적립률(만분율, 100 = 1%). 상품마다 다를 수 있다")
|
|
761
|
+
}).describe("구매 적립 — 구매확정 때 실결제 금액(배송비 제외) × 적립률을 준다"),
|
|
762
|
+
expiryDays: z.number().int().nullable().describe("적립금 유효 기간(일). 정하지 않았으면 null"),
|
|
763
|
+
review: z.object({
|
|
764
|
+
writableDays: z.number().int().describe("구매확정 뒤 리뷰를 쓸 수 있는 기간(일)"),
|
|
765
|
+
editableDays: z.number().int().describe("리뷰를 쓴 뒤 고칠 수 있는 기간(일)")
|
|
766
|
+
}).describe("리뷰 작성·수정 기한")
|
|
767
|
+
});
|
|
768
|
+
/** `GET /me/points` — 내 적립금 */
|
|
769
|
+
const memberPointsSchema = z.object({
|
|
770
|
+
balance: z.number().int().describe("잔액"),
|
|
771
|
+
expiringSoon: z.number().int().describe("30일 안에 소멸할 금액")
|
|
772
|
+
});
|
|
773
|
+
/** 내 적립금 내역 한 줄 — 셀러 메모는 싣지 않는다 */
|
|
774
|
+
const memberPointEntrySchema = z.object({
|
|
775
|
+
entryId: z.string(),
|
|
776
|
+
type: z.string().describe("유형. `EARN_REVIEW` 리뷰 적립 · `REVOKE_REVIEW` 리뷰 삭제 회수 · `EARN_PURCHASE` 구매 적립 · `EXPIRE` 소멸 · `ADJUST` 상점 지급·차감 · `OPENING` 기존 적립금. 값이 추가될 수 있어 문자열로 받는다"),
|
|
777
|
+
amount: z.number().int().describe("변동액. 적립 +, 회수·차감·소멸 −"),
|
|
778
|
+
balanceAfter: z.number().int().describe("이 변동 직후 잔액"),
|
|
779
|
+
createdAt: z.string()
|
|
780
|
+
});
|
|
781
|
+
const memberPointEntryPageSchema = pageSchema(memberPointEntrySchema);
|
|
782
|
+
//#endregion
|
|
746
783
|
//#region src/schemas/review.ts
|
|
747
784
|
const publicReviewSchema = z.object({
|
|
748
785
|
reviewId: z.string(),
|
|
@@ -968,6 +1005,8 @@ function createStorefrontClient(options) {
|
|
|
968
1005
|
get: () => http.request("GET", "/store", storefrontStoreSchema) },
|
|
969
1006
|
catalog: {
|
|
970
1007
|
listCategories: () => http.request("GET", "/categories", z.array(categoryNodeSchema)),
|
|
1008
|
+
/** `GET /point-policy` — 상점 적립 정책(리뷰·구매 적립, 유효 기간, 리뷰 작성·수정 기한, #93). 리뷰 혜택 안내에 쓴다 */
|
|
1009
|
+
getPointPolicy: () => http.request("GET", "/point-policy", storefrontPointPolicySchema),
|
|
971
1010
|
searchProducts: (params) => http.request("GET", "/products", productPageSchema, { query: params }),
|
|
972
1011
|
getProduct: (productId) => http.request("GET", path`/products/${productId}`, productDetailSchema),
|
|
973
1012
|
/** 상품 리뷰 목록 — `variantId`로 옵션(조합)별 리뷰만 받는다(상품 상세 `variants[].variantId`) */
|
|
@@ -1060,6 +1099,10 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
|
|
|
1060
1099
|
},
|
|
1061
1100
|
member: {
|
|
1062
1101
|
me: () => http.request("GET", "/me", memberSchema),
|
|
1102
|
+
/** `GET /me/points` — 내 적립금 잔액과 30일 안 소멸 예정액(#93) */
|
|
1103
|
+
getPoints: () => http.request("GET", "/me/points", memberPointsSchema),
|
|
1104
|
+
/** `GET /me/points/history` — 내 적립금 내역(최신순) */
|
|
1105
|
+
listPointHistory: (params) => http.request("GET", "/me/points/history", memberPointEntryPageSchema, { query: params }),
|
|
1063
1106
|
updateMe: (body) => http.requestVoid("PATCH", "/me", { body: updateProfileRequestSchema.parse(body) }),
|
|
1064
1107
|
/** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
|
|
1065
1108
|
consents: () => http.request("GET", "/me/consents", memberConsentsSchema),
|
|
@@ -1099,4 +1142,4 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
|
|
|
1099
1142
|
};
|
|
1100
1143
|
}
|
|
1101
1144
|
//#endregion
|
|
1102
|
-
export {
|
|
1145
|
+
export { collectionProductSortSchema as $, wishlistAddResultSchema as A, buildQuery as At, consentSourceSchema as B, orderShippingAddressSchema as C, memberIdentitiesSchema as Ct, memberAddressSchema as D, withdrawRequestSchema as Dt, memberAddressRequestSchema as E, tokenPairSchema as Et, createCustomerInquiryRequestSchema as F, claimReturnAddressSchema as G, consentUpdateRequestSchema as H, customerInquiryCategorySchema as I, createClaimResultSchema as J, claimTypeSchema as K, customerInquirySchema as L, createInquiryResultSchema as M, unwrapData as Mt, productInquiryCategorySchema as N, memberSchema as O, withdrawalBlockedDetailsSchema as Ot, publicInquirySchema as P, collectionProductQuerySchema as Q, consentActionSchema as R, myOrderSchema as S, loginRequestSchema as St, trackingStageResponseSchema as T, socialProviderSchema as Tt, memberConsentsSchema as U, consentStateSchema as V, claimReasonSchema as W, categoryNodeSchema as X, myClaimSchema as Y, collectionProductPageSchema as Z, memberPointEntrySchema as _, idpAgreementsSchema as _t, myReviewSchema as a, storefrontCollectionDetailSchema as at, deliveryTrackingSchema as b, idpTokenRequestSchema as bt, publicReviewSchema as c, claimStatusSchema as ct, reviewSummarySchema as d, pageSchema as dt, productCardSchema as et, updateReviewRequestSchema as f, addCartItemRequestSchema as ft, memberPointEntryPageSchema as g, anonymousSessionSchema as gt, writableReviewSchema as h, updateCartItemRequestSchema as ht, createReviewResultSchema as i, productSortSchema as it, createInquiryRequestSchema as j, toApiError as jt, updateProfileRequestSchema as k, ApiError as kt, reviewImageUploadRequestSchema as l, orderItemStatusSchema as lt, uploadTicketSchema as m, cartSchema as mt, storefrontStoreSchema as n, productFacetsSchema as nt, productReviewQuerySchema as o, storefrontCollectionListQuerySchema as ot, updateReviewResultSchema as p, cartItemSchema as pt, createClaimRequestSchema as q, createReviewRequestSchema as r, productPageSchema as rt, productReviewSortSchema as s, storefrontCollectionSchema as st, createStorefrontClient as t, productDetailSchema as tt, reviewPageSchema as u, pageInfoSchema as ut, memberPointsSchema as v, idpAuthorizeRequestSchema as vt, purchaseDecisionResultSchema as w, signupRequestSchema as wt, myOrderItemSchema as x, linkIdentityRequestSchema as xt, storefrontPointPolicySchema as y, idpAuthorizeResponseSchema as yt, consentKindSchema as z };
|
|
@@ -669,6 +669,20 @@ declare const paymentMethodSchema: z.ZodEnum<{
|
|
|
669
669
|
MOBILE: "MOBILE";
|
|
670
670
|
}>;
|
|
671
671
|
type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
672
|
+
/**
|
|
673
|
+
* 응답에 실리는 결제수단 — 아는 값(`PaymentMethod`)이거나 이 SDK가 모르는 새 값(문자열)이다. 서버가 결제수단을 더해도
|
|
674
|
+
* 응답 파싱이 깨지지 않게 넓게 받는다(`responsePlanCodeSchema`·`easyPayProviderResponseSchema`와 같은 방식, #93 P0).
|
|
675
|
+
* 적립금 전액 결제 주문은 `POINT`가 온다. 화면은 아는 값으로 분기하고 모르는 값은 그대로 표시하거나 「기타」로 다룬다.
|
|
676
|
+
* 요청(결제 옵션)은 값을 골라 보내는 자리라 `paymentMethodSchema`(enum) 그대로다.
|
|
677
|
+
*/
|
|
678
|
+
declare const responsePaymentMethodSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
679
|
+
CARD: "CARD";
|
|
680
|
+
EASY_PAY: "EASY_PAY";
|
|
681
|
+
BANK_TRANSFER: "BANK_TRANSFER";
|
|
682
|
+
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
683
|
+
MOBILE: "MOBILE";
|
|
684
|
+
}>, z.ZodString]>;
|
|
685
|
+
type ResponsePaymentMethod = PaymentMethod | (string & {});
|
|
672
686
|
/** 결제를 처리하는 PG. 셀러가 직접 계약하고 상점 플랫폼 설정 › 결제에서 연결한다 */
|
|
673
687
|
declare const pgProviderSchema: z.ZodEnum<{
|
|
674
688
|
tosspayments: "tosspayments";
|
|
@@ -1022,10 +1036,18 @@ declare const retryPaymentRequestSchema: z.ZodObject<{
|
|
|
1022
1036
|
}, z.core.$strip>>;
|
|
1023
1037
|
}, z.core.$strip>;
|
|
1024
1038
|
type RetryPaymentRequest = z.infer<typeof retryPaymentRequestSchema>;
|
|
1039
|
+
/**
|
|
1040
|
+
* 결제 시작 상태 — `pending`이면 `payUrl`로 결제창을 연다. `completed`면 결제창 없이 결제가 끝나 주문이 만들어졌고
|
|
1041
|
+
* `orderId`가 있다(적립금으로 결제 금액 전체를 낸 주문, #93). 값이 추가될 수 있어 응답은 문자열로 받는다.
|
|
1042
|
+
*/
|
|
1043
|
+
declare const PAYMENT_START_STATUS_VALUES: readonly ["pending", "completed"];
|
|
1044
|
+
type KnownPaymentStartStatus = (typeof PAYMENT_START_STATUS_VALUES)[number];
|
|
1025
1045
|
declare const paymentStartSchema: z.ZodObject<{
|
|
1026
1046
|
paymentId: z.ZodString;
|
|
1027
|
-
|
|
1028
|
-
|
|
1047
|
+
status: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1048
|
+
orderId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1049
|
+
attemptId: z.ZodNullable<z.ZodString>;
|
|
1050
|
+
option: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1029
1051
|
pg: z.ZodEnum<{
|
|
1030
1052
|
tosspayments: "tosspayments";
|
|
1031
1053
|
portone: "portone";
|
|
@@ -1061,8 +1083,8 @@ declare const paymentStartSchema: z.ZodObject<{
|
|
|
1061
1083
|
portone: "portone";
|
|
1062
1084
|
}>;
|
|
1063
1085
|
method: z.ZodLiteral<"MOBILE">;
|
|
1064
|
-
}, z.core.$strip>], "method"
|
|
1065
|
-
payUrl: z.ZodString
|
|
1086
|
+
}, z.core.$strip>], "method">>;
|
|
1087
|
+
payUrl: z.ZodNullable<z.ZodString>;
|
|
1066
1088
|
expiresAt: z.ZodString;
|
|
1067
1089
|
testPayment: z.ZodBoolean;
|
|
1068
1090
|
amounts: z.ZodObject<{
|
|
@@ -1980,6 +2002,23 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
1980
2002
|
};
|
|
1981
2003
|
catalog: {
|
|
1982
2004
|
listCategories: () => Promise<CategoryNode[]>;
|
|
2005
|
+
/** `GET /point-policy` — 상점 적립 정책(리뷰·구매 적립, 유효 기간, 리뷰 작성·수정 기한, #93). 리뷰 혜택 안내에 쓴다 */
|
|
2006
|
+
getPointPolicy: () => Promise<{
|
|
2007
|
+
reviewReward: {
|
|
2008
|
+
enabled: boolean;
|
|
2009
|
+
textPoint: number;
|
|
2010
|
+
photoPoint: number;
|
|
2011
|
+
};
|
|
2012
|
+
purchaseEarn: {
|
|
2013
|
+
enabled: boolean;
|
|
2014
|
+
rateBp: number;
|
|
2015
|
+
};
|
|
2016
|
+
expiryDays: number | null;
|
|
2017
|
+
review: {
|
|
2018
|
+
writableDays: number;
|
|
2019
|
+
editableDays: number;
|
|
2020
|
+
};
|
|
2021
|
+
}>;
|
|
1983
2022
|
searchProducts: (params?: ProductSearchParams) => Promise<{
|
|
1984
2023
|
page: number;
|
|
1985
2024
|
size: number;
|
|
@@ -2408,7 +2447,9 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2408
2447
|
*/
|
|
2409
2448
|
startPayment: (checkoutId: string, body: StartPaymentRequest) => Promise<{
|
|
2410
2449
|
paymentId: string;
|
|
2411
|
-
|
|
2450
|
+
status: string;
|
|
2451
|
+
orderId: string | null;
|
|
2452
|
+
attemptId: string | null;
|
|
2412
2453
|
option: {
|
|
2413
2454
|
pg: "tosspayments" | "portone";
|
|
2414
2455
|
method: "CARD";
|
|
@@ -2425,8 +2466,8 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2425
2466
|
} | {
|
|
2426
2467
|
pg: "tosspayments" | "portone";
|
|
2427
2468
|
method: "MOBILE";
|
|
2428
|
-
};
|
|
2429
|
-
payUrl: string;
|
|
2469
|
+
} | null;
|
|
2470
|
+
payUrl: string | null;
|
|
2430
2471
|
expiresAt: string;
|
|
2431
2472
|
testPayment: boolean;
|
|
2432
2473
|
amounts: {
|
|
@@ -2532,7 +2573,9 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2532
2573
|
*/
|
|
2533
2574
|
retry: (paymentId: string, body: RetryPaymentRequest) => Promise<{
|
|
2534
2575
|
paymentId: string;
|
|
2535
|
-
|
|
2576
|
+
status: string;
|
|
2577
|
+
orderId: string | null;
|
|
2578
|
+
attemptId: string | null;
|
|
2536
2579
|
option: {
|
|
2537
2580
|
pg: "tosspayments" | "portone";
|
|
2538
2581
|
method: "CARD";
|
|
@@ -2549,8 +2592,8 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2549
2592
|
} | {
|
|
2550
2593
|
pg: "tosspayments" | "portone";
|
|
2551
2594
|
method: "MOBILE";
|
|
2552
|
-
};
|
|
2553
|
-
payUrl: string;
|
|
2595
|
+
} | null;
|
|
2596
|
+
payUrl: string | null;
|
|
2554
2597
|
expiresAt: string;
|
|
2555
2598
|
testPayment: boolean;
|
|
2556
2599
|
amounts: {
|
|
@@ -2632,7 +2675,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2632
2675
|
entranceCode?: string | null | undefined;
|
|
2633
2676
|
};
|
|
2634
2677
|
payment: {
|
|
2635
|
-
method:
|
|
2678
|
+
method: string;
|
|
2636
2679
|
easyPayProvider: string | null;
|
|
2637
2680
|
couponDiscountAmount: number;
|
|
2638
2681
|
deliveryDiscountAmount: number;
|
|
@@ -2701,7 +2744,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2701
2744
|
entranceCode?: string | null | undefined;
|
|
2702
2745
|
};
|
|
2703
2746
|
payment: {
|
|
2704
|
-
method:
|
|
2747
|
+
method: string;
|
|
2705
2748
|
easyPayProvider: string | null;
|
|
2706
2749
|
couponDiscountAmount: number;
|
|
2707
2750
|
deliveryDiscountAmount: number;
|
|
@@ -2781,7 +2824,7 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2781
2824
|
entranceCode?: string | null | undefined;
|
|
2782
2825
|
};
|
|
2783
2826
|
payment: {
|
|
2784
|
-
method:
|
|
2827
|
+
method: string;
|
|
2785
2828
|
easyPayProvider: string | null;
|
|
2786
2829
|
couponDiscountAmount: number;
|
|
2787
2830
|
deliveryDiscountAmount: number;
|
|
@@ -2867,6 +2910,25 @@ declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
|
2867
2910
|
joinedAt: string;
|
|
2868
2911
|
reconsentRequired: boolean;
|
|
2869
2912
|
}>;
|
|
2913
|
+
/** `GET /me/points` — 내 적립금 잔액과 30일 안 소멸 예정액(#93) */
|
|
2914
|
+
getPoints: () => Promise<{
|
|
2915
|
+
balance: number;
|
|
2916
|
+
expiringSoon: number;
|
|
2917
|
+
}>;
|
|
2918
|
+
/** `GET /me/points/history` — 내 적립금 내역(최신순) */
|
|
2919
|
+
listPointHistory: (params?: PageParams) => Promise<{
|
|
2920
|
+
page: number;
|
|
2921
|
+
size: number;
|
|
2922
|
+
totalElements: number;
|
|
2923
|
+
totalPages: number;
|
|
2924
|
+
contents: {
|
|
2925
|
+
entryId: string;
|
|
2926
|
+
type: string;
|
|
2927
|
+
amount: number;
|
|
2928
|
+
balanceAfter: number;
|
|
2929
|
+
createdAt: string;
|
|
2930
|
+
}[];
|
|
2931
|
+
}>;
|
|
2870
2932
|
updateMe: (body: UpdateProfileRequest) => Promise<void>;
|
|
2871
2933
|
/** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
|
|
2872
2934
|
consents: () => Promise<{
|
|
@@ -3375,13 +3437,13 @@ declare const myOrderSchema: z.ZodObject<{
|
|
|
3375
3437
|
entranceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3376
3438
|
}, z.core.$strip>;
|
|
3377
3439
|
payment: z.ZodObject<{
|
|
3378
|
-
method: z.ZodEnum<{
|
|
3440
|
+
method: z.ZodUnion<readonly [z.ZodEnum<{
|
|
3379
3441
|
CARD: "CARD";
|
|
3380
3442
|
EASY_PAY: "EASY_PAY";
|
|
3381
3443
|
BANK_TRANSFER: "BANK_TRANSFER";
|
|
3382
3444
|
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
3383
3445
|
MOBILE: "MOBILE";
|
|
3384
|
-
}>;
|
|
3446
|
+
}>, z.ZodString]>;
|
|
3385
3447
|
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3386
3448
|
couponDiscountAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
3387
3449
|
deliveryDiscountAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -3430,6 +3492,58 @@ declare const purchaseDecisionResultSchema: z.ZodObject<{
|
|
|
3430
3492
|
}, z.core.$strip>;
|
|
3431
3493
|
type PurchaseDecisionResult = z.infer<typeof purchaseDecisionResultSchema>;
|
|
3432
3494
|
//#endregion
|
|
3495
|
+
//#region src/schemas/points.d.ts
|
|
3496
|
+
/**
|
|
3497
|
+
* 적립금 (이슈 #93) — 상점 적립 정책 안내와 구매자 잔액·내역. 금액은 원 단위 정수다.
|
|
3498
|
+
* 적립금 사용(주문서·결제)은 다음 단계에서 가산한다.
|
|
3499
|
+
*/
|
|
3500
|
+
/** `GET /point-policy` — 상점 적립 정책(인증 없음, 상점 단위). 리뷰 작성·주문 화면의 혜택 안내에 쓴다 */
|
|
3501
|
+
declare const storefrontPointPolicySchema: z.ZodObject<{
|
|
3502
|
+
reviewReward: z.ZodObject<{
|
|
3503
|
+
enabled: z.ZodBoolean;
|
|
3504
|
+
textPoint: z.ZodNumber;
|
|
3505
|
+
photoPoint: z.ZodNumber;
|
|
3506
|
+
}, z.core.$strip>;
|
|
3507
|
+
purchaseEarn: z.ZodObject<{
|
|
3508
|
+
enabled: z.ZodBoolean;
|
|
3509
|
+
rateBp: z.ZodNumber;
|
|
3510
|
+
}, z.core.$strip>;
|
|
3511
|
+
expiryDays: z.ZodNullable<z.ZodNumber>;
|
|
3512
|
+
review: z.ZodObject<{
|
|
3513
|
+
writableDays: z.ZodNumber;
|
|
3514
|
+
editableDays: z.ZodNumber;
|
|
3515
|
+
}, z.core.$strip>;
|
|
3516
|
+
}, z.core.$strip>;
|
|
3517
|
+
type StorefrontPointPolicy = z.infer<typeof storefrontPointPolicySchema>;
|
|
3518
|
+
/** `GET /me/points` — 내 적립금 */
|
|
3519
|
+
declare const memberPointsSchema: z.ZodObject<{
|
|
3520
|
+
balance: z.ZodNumber;
|
|
3521
|
+
expiringSoon: z.ZodNumber;
|
|
3522
|
+
}, z.core.$strip>;
|
|
3523
|
+
type MemberPoints = z.infer<typeof memberPointsSchema>;
|
|
3524
|
+
/** 내 적립금 내역 한 줄 — 셀러 메모는 싣지 않는다 */
|
|
3525
|
+
declare const memberPointEntrySchema: z.ZodObject<{
|
|
3526
|
+
entryId: z.ZodString;
|
|
3527
|
+
type: z.ZodString;
|
|
3528
|
+
amount: z.ZodNumber;
|
|
3529
|
+
balanceAfter: z.ZodNumber;
|
|
3530
|
+
createdAt: z.ZodString;
|
|
3531
|
+
}, z.core.$strip>;
|
|
3532
|
+
type MemberPointEntry = z.infer<typeof memberPointEntrySchema>;
|
|
3533
|
+
declare const memberPointEntryPageSchema: z.ZodObject<{
|
|
3534
|
+
page: z.ZodNumber;
|
|
3535
|
+
size: z.ZodNumber;
|
|
3536
|
+
totalElements: z.ZodNumber;
|
|
3537
|
+
totalPages: z.ZodNumber;
|
|
3538
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
3539
|
+
entryId: z.ZodString;
|
|
3540
|
+
type: z.ZodString;
|
|
3541
|
+
amount: z.ZodNumber;
|
|
3542
|
+
balanceAfter: z.ZodNumber;
|
|
3543
|
+
createdAt: z.ZodString;
|
|
3544
|
+
}, z.core.$strip>>;
|
|
3545
|
+
}, z.core.$strip>;
|
|
3546
|
+
//#endregion
|
|
3433
3547
|
//#region src/schemas/product-options.d.ts
|
|
3434
3548
|
/**
|
|
3435
3549
|
* 추가 선택·직접 입력 (이슈 #59) — 상품 상세의 옵션 표시, 장바구니 담기·바로 구매 요청, 줄 스냅샷의 공통 모양.
|
|
@@ -3554,4 +3668,4 @@ declare const storefrontStoreSchema: z.ZodObject<{
|
|
|
3554
3668
|
}, z.core.$strip>;
|
|
3555
3669
|
type StorefrontStore = z.infer<typeof storefrontStoreSchema>;
|
|
3556
3670
|
//#endregion
|
|
3557
|
-
export {
|
|
3671
|
+
export { StorefrontClientOptions as $, DeliveryQuoteResult as $n, ProductDetail as $r, createCustomerInquiryRequestSchema as $t, PurchaseDecisionResult as A, UnknownFulfillmentView as Ai, consentUpdateRequestSchema as An, easyPayProviderResponseSchema as Ar, uploadTicketSchema as At, ANALYTICS_VISITOR_COOKIE as B, cartItemSchema as Bi, claimTypeSchema as Bn, paymentStatusSchema as Br, updateProfileRequestSchema as Bt, memberPointEntrySchema as C, orderItemStatusSchema as Ci, ConsentState as Cn, cashReceiptRequestSchema as Cr, productReviewSortSchema as Ct, MyOrder as D, MyOrderItemFulfillmentSnapshot as Di, consentKindSchema as Dn, createCheckoutRequestSchema as Dr, reviewSummarySchema as Dt, DeliveryTracking as E, LineFulfillment as Ei, consentActionSchema as En, checkoutSessionSchema as Er, reviewPageSchema as Et, purchaseDecisionResultSchema as F, AddCartItemRequest as Fi, CreateClaimRequest as Fn, paymentMethodSchema as Fr, UpdateProfileRequest as Ft, AnalyticsEventName as G, CASH_RECEIPT_METHODS as Gn, retryPaymentRequestSchema as Gr, PublicInquiry as Gt, AnalyticsBatch as H, updateCartItemRequestSchema as Hi, createClaimResultSchema as Hn, remoteAreaSchema as Hr, CreateInquiryRequest as Ht, trackingStageResponseSchema as I, Cart as Ii, CreateClaimResult as In, paymentOptionKey as Ir, WishlistAddResult as It, analyticsClientEventNameSchema as J, CashReceiptType as Jn, CategoryNode as Jr, productInquiryCategorySchema as Jt, AnalyticsServerEventName as K, CashReceiptIdentityType as Kn, shippingAddressInputSchema as Kr, createInquiryRequestSchema as Kt, ANALYTICS_MAX_BATCH_BYTES as L, CartItem as Li, MyClaim as Ln, paymentOptionListSchema as Lr, memberAddressRequestSchema as Lt, myOrderItemSchema as M, myOrderItemFulfillmentSnapshotSchema as Mi, ClaimReason as Mn, guestInfoSchema as Mr, Member as Mt, myOrderSchema as N, productCardFulfillmentSchema as Ni, ClaimReturnAddress as Nn, paymentFailureCategorySchema as Nr, MemberAddress as Nt, MyOrderItem as O, ProductCardFulfillment as Oi, consentSourceSchema as On, deliveryQuoteRequestSchema as Or, updateReviewRequestSchema as Ot, orderShippingAddressSchema as P, productFulfillmentViewSchema as Pi, ClaimType as Pn, paymentMessageSchema as Pr, MemberAddressRequest as Pt, StorefrontClient as Q, DeliveryQuoteRequest as Qn, ProductCard as Qr, CustomerInquiryCategory as Qt, ANALYTICS_SESSION_COOKIE as R, UpdateCartItemRequest as Ri, claimReasonSchema as Rn, paymentOptionSchema as Rr, memberAddressSchema as Rt, memberPointEntryPageSchema as S, claimStatusSchema as Si, ConsentSource as Sn, cashReceiptIdentityTypeOf as Sr, productReviewQuerySchema as St, storefrontPointPolicySchema as T, pageSchema as Ti, MemberConsents as Tn, checkoutDeliverySchema as Tr, reviewImageUploadRequestSchema as Tt, AnalyticsClientEvent as U, analyticsIdsFromCookie as Ui, myClaimSchema as Un, residentNumberLike as Ur, CreateInquiryResult as Ut, ANALYTICS_VISITOR_HEADER as V, cartSchema as Vi, createClaimRequestSchema as Vn, pgProviderSchema as Vr, wishlistAddResultSchema as Vt, AnalyticsClientEventName as W, AvailablePaymentOption as Wn, responsePaymentMethodSchema as Wr, ProductInquiryCategory as Wt, analyticsIdSchema as X, CheckoutSession as Xn, CollectionProductParams as Xr, CreateCustomerInquiryRequest as Xt, analyticsClientEventSchema as Y, CheckoutDelivery as Yn, CollectionProductPage as Yr, publicInquirySchema as Yt, analyticsServerEventNameSchema as Z, CreateCheckoutRequest as Zn, CollectionProductSortParam as Zr, CustomerInquiry as Zt, normalizeCustomInputValue as _, storefrontCollectionSchema as _i, myCouponListQuerySchema as _n, RetryPaymentRequest as _r, UploadTicket as _t, CustomInputEntry as a, StorefrontCollectionDetail as ai, CouponApplication as an, PAYMENT_RESULT_VALUES as ar, createStorefrontSession as at, MemberPoints as b, PageInfo as bi, ConsentAction as bn, availablePaymentOptionSchema as br, createReviewResultSchema as bt, OptionSelectionView as c, collectionProductQuerySchema as ci, MIN_PAYMENT_AMOUNT as cn, PaymentFailureCategory as cr, MyReview as ct, customInputEntrySchema as d, productDetailSchema as di, checkoutPricingRequestSchema as dn, PaymentOption as dr, PublicReview as dt, ProductFacets as ei, customerInquiryCategorySchema as en, EasyPayProvider as er, createStorefrontClient as et, customInputLength as f, productFacetsSchema as fi, checkoutPricingSchema as fn, PaymentStart as fr, ReviewImageUploadRequest as ft, lineSelectionResponseShape as g, storefrontCollectionListQuerySchema as gi, couponResultSchema as gn, ResponsePaymentMethod as gr, UpdateReviewResult as gt, lineSelectionRequestShape as h, storefrontCollectionDetailSchema as hi, couponBenefitViewSchema as hn, RemoteArea as hr, UpdateReviewRequest as ht, AddonSelection as i, StorefrontCollection as ii, CheckoutPricingRequest as in, KnownPaymentStatus as ir, StorefrontSessionOptions as it, deliveryTrackingSchema as j, lineFulfillmentSchema as ji, memberConsentsSchema as jn, easyPayProviderSchema as jr, writableReviewSchema as jt, OrderShippingAddress as k, ProductFulfillmentView as ki, consentStateSchema as kn, deliveryQuoteSchema as kr, updateReviewResultSchema as kt, addonGroupViewSchema as l, collectionProductSortSchema as li, MyCoupon as ln, PaymentMessage as lr, ProductReviewParams as lt, customInputViewSchema as m, productSortSchema as mi, couponApplicationSchema as mn, PgProvider as mr, ReviewSummary as mt, storefrontStoreSchema as n, ProductSearchParams as ni, ApplicableCoupon as nn, KnownPaymentResult as nr, SessionStorage as nt, CustomInputValueView as o, categoryNodeSchema as oi, CouponResult as on, PAYMENT_START_STATUS_VALUES as or, CreateReviewRequest as ot, customInputValueViewSchema as p, productPageSchema as pi, couponApplicationListSchema as pn, PaymentStatus as pr, ReviewPage as pt, analyticsBatchSchema as q, CashReceiptRequest as qn, startPaymentRequestSchema as qr, createInquiryResultSchema as qt, AddonGroupView as r, ProductSort as ri, CheckoutPricing as rn, KnownPaymentStartStatus as rr, StorefrontSession as rt, CustomInputView as s, collectionProductPageSchema as si, MAX_COUPONS_PER_CHECKOUT as sn, PAYMENT_STATUS_VALUES as sr, CreateReviewResult as st, StorefrontStore as t, ProductPage as ti, customerInquirySchema as tn, GuestInfo as tr, STOREFRONT_SESSION_KEYS as tt, addonSelectionSchema as u, productCardSchema as ui, applicableCouponSchema as un, PaymentMethod as ur, ProductReviewSort as ut, optionSelectionViewSchema as v, ClaimStatus as vi, myCouponSchema as vn, ShippingAddressInput as vr, WritableReview as vt, memberPointsSchema as w, pageInfoSchema as wi, ConsentUpdateRequest as wn, cashReceiptTypeSchema as wr, publicReviewSchema as wt, StorefrontPointPolicy as x, PageParams as xi, ConsentKind as xn, cashReceiptAvailable as xr, myReviewSchema as xt, MemberPointEntry as y, OrderItemStatus as yi, pricingAmountsSchema as yn, StartPaymentRequest as yr, createReviewRequestSchema as yt, ANALYTICS_SESSION_HEADER as z, addCartItemRequestSchema as zi, claimReturnAddressSchema as zn, paymentStartSchema as zr, memberSchema as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { C as loginRequestSchema, D as tokenPairSchema, E as socialProviderSchema, O as withdrawRequestSchema, S as linkIdentityRequestSchema, T as signupRequestSchema, _ as anonymousSessionSchema, a as AnonymousSession, b as idpAuthorizeResponseSchema, c as IdpTokenRequest, d as MemberIdentities, f as SignupRequest, g as WithdrawalBlockedDetails, h as WithdrawRequest, i as buildQuery, k as withdrawalBlockedDetailsSchema, l as LinkIdentityRequest, m as TokenPair, n as Query, o as IdpAgreements, p as SocialProvider, r as TokenSource, s as IdpAuthorizeRequest, t as ApiError, u as LoginRequest, v as idpAgreementsSchema, w as memberIdentitiesSchema, x as idpTokenRequestSchema, y as idpAuthorizeRequestSchema } from "./http-1ab7tP4-.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AddonGroupView, AddonSelection, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, ApplicableCoupon, AvailablePaymentOption, CASH_RECEIPT_METHODS, Cart, CartItem, CashReceiptIdentityType, CashReceiptRequest, CashReceiptType, CategoryNode, CheckoutDelivery, CheckoutPricing, CheckoutPricingRequest, CheckoutSession, ClaimReason, ClaimReturnAddress, ClaimStatus, ClaimType, CollectionProductPage, CollectionProductParams, CollectionProductSortParam, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomInputEntry, CustomInputValueView, CustomInputView, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, 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, StorefrontCollection, StorefrontCollectionDetail, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UnknownFulfillmentView, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, UploadTicket, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, 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, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
2
|
+
import { $ as StorefrontClientOptions, $n as DeliveryQuoteResult, $r as ProductDetail, $t as createCustomerInquiryRequestSchema, A as PurchaseDecisionResult, Ai as UnknownFulfillmentView, An as consentUpdateRequestSchema, Ar as easyPayProviderResponseSchema, At as uploadTicketSchema, B as ANALYTICS_VISITOR_COOKIE, Bi as cartItemSchema, Bn as claimTypeSchema, Br as paymentStatusSchema, Bt as updateProfileRequestSchema, C as memberPointEntrySchema, Ci as orderItemStatusSchema, Cn as ConsentState, Cr as cashReceiptRequestSchema, Ct as productReviewSortSchema, D as MyOrder, Di as MyOrderItemFulfillmentSnapshot, Dn as consentKindSchema, Dr as createCheckoutRequestSchema, Dt as reviewSummarySchema, E as DeliveryTracking, Ei as LineFulfillment, En as consentActionSchema, Er as checkoutSessionSchema, Et as reviewPageSchema, F as purchaseDecisionResultSchema, Fi as AddCartItemRequest, Fn as CreateClaimRequest, Fr as paymentMethodSchema, Ft as UpdateProfileRequest, G as AnalyticsEventName, Gn as CASH_RECEIPT_METHODS, Gr as retryPaymentRequestSchema, Gt as PublicInquiry, H as AnalyticsBatch, Hi as updateCartItemRequestSchema, Hn as createClaimResultSchema, Hr as remoteAreaSchema, Ht as CreateInquiryRequest, I as trackingStageResponseSchema, Ii as Cart, In as CreateClaimResult, Ir as paymentOptionKey, It as WishlistAddResult, J as analyticsClientEventNameSchema, Jn as CashReceiptType, Jr as CategoryNode, Jt as productInquiryCategorySchema, K as AnalyticsServerEventName, Kn as CashReceiptIdentityType, Kr as shippingAddressInputSchema, Kt as createInquiryRequestSchema, L as ANALYTICS_MAX_BATCH_BYTES, Li as CartItem, Ln as MyClaim, Lr as paymentOptionListSchema, Lt as memberAddressRequestSchema, M as myOrderItemSchema, Mi as myOrderItemFulfillmentSnapshotSchema, Mn as ClaimReason, Mr as guestInfoSchema, Mt as Member, N as myOrderSchema, Ni as productCardFulfillmentSchema, Nn as ClaimReturnAddress, Nr as paymentFailureCategorySchema, Nt as MemberAddress, O as MyOrderItem, Oi as ProductCardFulfillment, On as consentSourceSchema, Or as deliveryQuoteRequestSchema, Ot as updateReviewRequestSchema, P as orderShippingAddressSchema, Pi as productFulfillmentViewSchema, Pn as ClaimType, Pr as paymentMessageSchema, Pt as MemberAddressRequest, Q as StorefrontClient, Qn as DeliveryQuoteRequest, Qr as ProductCard, Qt as CustomerInquiryCategory, R as ANALYTICS_SESSION_COOKIE, Ri as UpdateCartItemRequest, Rn as claimReasonSchema, Rr as paymentOptionSchema, Rt as memberAddressSchema, S as memberPointEntryPageSchema, Si as claimStatusSchema, Sn as ConsentSource, Sr as cashReceiptIdentityTypeOf, St as productReviewQuerySchema, T as storefrontPointPolicySchema, Ti as pageSchema, Tn as MemberConsents, Tr as checkoutDeliverySchema, Tt as reviewImageUploadRequestSchema, U as AnalyticsClientEvent, Ui as analyticsIdsFromCookie, Un as myClaimSchema, Ur as residentNumberLike, Ut as CreateInquiryResult, V as ANALYTICS_VISITOR_HEADER, Vi as cartSchema, Vn as createClaimRequestSchema, Vr as pgProviderSchema, Vt as wishlistAddResultSchema, W as AnalyticsClientEventName, Wn as AvailablePaymentOption, Wr as responsePaymentMethodSchema, Wt as ProductInquiryCategory, X as analyticsIdSchema, Xn as CheckoutSession, Xr as CollectionProductParams, Xt as CreateCustomerInquiryRequest, Y as analyticsClientEventSchema, Yn as CheckoutDelivery, Yr as CollectionProductPage, Yt as publicInquirySchema, Z as analyticsServerEventNameSchema, Zn as CreateCheckoutRequest, Zr as CollectionProductSortParam, Zt as CustomerInquiry, _ as normalizeCustomInputValue, _i as storefrontCollectionSchema, _n as myCouponListQuerySchema, _r as RetryPaymentRequest, _t as UploadTicket, a as CustomInputEntry, ai as StorefrontCollectionDetail, an as CouponApplication, ar as PAYMENT_RESULT_VALUES, at as createStorefrontSession, b as MemberPoints, bi as PageInfo, bn as ConsentAction, br as availablePaymentOptionSchema, bt as createReviewResultSchema, c as OptionSelectionView, ci as collectionProductQuerySchema, cn as MIN_PAYMENT_AMOUNT, cr as PaymentFailureCategory, ct as MyReview, d as customInputEntrySchema, di as productDetailSchema, dn as checkoutPricingRequestSchema, dr as PaymentOption, dt as PublicReview, ei as ProductFacets, en as customerInquiryCategorySchema, er as EasyPayProvider, et as createStorefrontClient, f as customInputLength, fi as productFacetsSchema, fn as checkoutPricingSchema, fr as PaymentStart, ft as ReviewImageUploadRequest, g as lineSelectionResponseShape, gi as storefrontCollectionListQuerySchema, gn as couponResultSchema, gr as ResponsePaymentMethod, gt as UpdateReviewResult, h as lineSelectionRequestShape, hi as storefrontCollectionDetailSchema, hn as couponBenefitViewSchema, hr as RemoteArea, ht as UpdateReviewRequest, i as AddonSelection, ii as StorefrontCollection, in as CheckoutPricingRequest, ir as KnownPaymentStatus, it as StorefrontSessionOptions, j as deliveryTrackingSchema, ji as lineFulfillmentSchema, jn as memberConsentsSchema, jr as easyPayProviderSchema, jt as writableReviewSchema, k as OrderShippingAddress, ki as ProductFulfillmentView, kn as consentStateSchema, kr as deliveryQuoteSchema, kt as updateReviewResultSchema, l as addonGroupViewSchema, li as collectionProductSortSchema, ln as MyCoupon, lr as PaymentMessage, lt as ProductReviewParams, m as customInputViewSchema, mi as productSortSchema, mn as couponApplicationSchema, mr as PgProvider, mt as ReviewSummary, n as storefrontStoreSchema, ni as ProductSearchParams, nn as ApplicableCoupon, nr as KnownPaymentResult, nt as SessionStorage, o as CustomInputValueView, oi as categoryNodeSchema, on as CouponResult, or as PAYMENT_START_STATUS_VALUES, ot as CreateReviewRequest, p as customInputValueViewSchema, pi as productPageSchema, pn as couponApplicationListSchema, pr as PaymentStatus, pt as ReviewPage, q as analyticsBatchSchema, qn as CashReceiptRequest, qr as startPaymentRequestSchema, qt as createInquiryResultSchema, r as AddonGroupView, ri as ProductSort, rn as CheckoutPricing, rr as KnownPaymentStartStatus, rt as StorefrontSession, s as CustomInputView, si as collectionProductPageSchema, sn as MAX_COUPONS_PER_CHECKOUT, sr as PAYMENT_STATUS_VALUES, st as CreateReviewResult, t as StorefrontStore, ti as ProductPage, tn as customerInquirySchema, tr as GuestInfo, tt as STOREFRONT_SESSION_KEYS, u as addonSelectionSchema, ui as productCardSchema, un as applicableCouponSchema, ur as PaymentMethod, ut as ProductReviewSort, v as optionSelectionViewSchema, vi as ClaimStatus, vn as myCouponSchema, vr as ShippingAddressInput, vt as WritableReview, w as memberPointsSchema, wi as pageInfoSchema, wn as ConsentUpdateRequest, wr as cashReceiptTypeSchema, wt as publicReviewSchema, x as StorefrontPointPolicy, xi as PageParams, xn as ConsentKind, xr as cashReceiptAvailable, xt as myReviewSchema, y as MemberPointEntry, yi as OrderItemStatus, yn as pricingAmountsSchema, yr as StartPaymentRequest, yt as createReviewRequestSchema, z as ANALYTICS_SESSION_HEADER, zi as addCartItemRequestSchema, zn as claimReturnAddressSchema, zr as paymentStartSchema, zt as memberSchema } from "./index-UhlK7HG7.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, CollectionProductPage, CollectionProductParams, CollectionProductSortParam, ConsentAction, ConsentKind, ConsentSource, ConsentState, ConsentUpdateRequest, CouponApplication, CouponResult, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomInputEntry, CustomInputValueView, CustomInputView, CustomerInquiry, CustomerInquiryCategory, DeliveryQuoteRequest, DeliveryQuoteResult, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAgreements, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStartStatus, KnownPaymentStatus, LineFulfillment, LinkIdentityRequest, LoginRequest, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, Member, MemberAddress, MemberAddressRequest, MemberConsents, MemberIdentities, MemberPointEntry, MemberPoints, MyClaim, MyCoupon, MyOrder, MyOrderItem, MyOrderItemFulfillmentSnapshot, MyReview, OptionSelectionView, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductCardFulfillment, ProductDetail, ProductFacets, ProductFulfillmentView, ProductInquiryCategory, ProductPage, ProductReviewParams, ProductReviewSort, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RemoteArea, ResponsePaymentMethod, RetryPaymentRequest, ReviewImageUploadRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, StorefrontCollection, StorefrontCollectionDetail, StorefrontPointPolicy, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UnknownFulfillmentView, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, UploadTicket, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, 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, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, 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, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as ANALYTICS_VISITOR_HEADER, c as analyticsClientEventSchema, i as ANALYTICS_VISITOR_COOKIE, l as analyticsIdSchema, n as ANALYTICS_SESSION_COOKIE, o as analyticsBatchSchema, r as ANALYTICS_SESSION_HEADER, s as analyticsClientEventNameSchema, t as ANALYTICS_MAX_BATCH_BYTES, u as analyticsServerEventNameSchema } from "./analytics-CgD70OqH.mjs";
|
|
2
2
|
import { t as analyticsIdsFromCookie } from "./analytics-ids-COElZiI3.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import { $ as
|
|
3
|
+
import { $ as collectionProductSortSchema, A as wishlistAddResultSchema, At as buildQuery, B as consentSourceSchema, C as orderShippingAddressSchema, Ct as memberIdentitiesSchema, D as memberAddressSchema, Dt as withdrawRequestSchema, E as memberAddressRequestSchema, Et as tokenPairSchema, F as createCustomerInquiryRequestSchema, G as claimReturnAddressSchema, H as consentUpdateRequestSchema, I as customerInquiryCategorySchema, J as createClaimResultSchema, K as claimTypeSchema, L as customerInquirySchema, M as createInquiryResultSchema, Mt as unwrapData, N as productInquiryCategorySchema, O as memberSchema, Ot as withdrawalBlockedDetailsSchema, P as publicInquirySchema, Q as collectionProductQuerySchema, R as consentActionSchema, S as myOrderSchema, St as loginRequestSchema, T as trackingStageResponseSchema, Tt as socialProviderSchema, U as memberConsentsSchema, V as consentStateSchema, W as claimReasonSchema, X as categoryNodeSchema, Y as myClaimSchema, Z as collectionProductPageSchema, _ as memberPointEntrySchema, _t as idpAgreementsSchema, a as myReviewSchema, at as storefrontCollectionDetailSchema, b as deliveryTrackingSchema, bt as idpTokenRequestSchema, c as publicReviewSchema, ct as claimStatusSchema, d as reviewSummarySchema, dt as pageSchema, et as productCardSchema, f as updateReviewRequestSchema, ft as addCartItemRequestSchema, g as memberPointEntryPageSchema, gt as anonymousSessionSchema, h as writableReviewSchema, ht as updateCartItemRequestSchema, i as createReviewResultSchema, it as productSortSchema, j as createInquiryRequestSchema, jt as toApiError, k as updateProfileRequestSchema, kt as ApiError, l as reviewImageUploadRequestSchema, lt as orderItemStatusSchema, m as uploadTicketSchema, mt as cartSchema, n as storefrontStoreSchema, nt as productFacetsSchema, o as productReviewQuerySchema, ot as storefrontCollectionListQuerySchema, p as updateReviewResultSchema, pt as cartItemSchema, q as createClaimRequestSchema, r as createReviewRequestSchema, rt as productPageSchema, s as productReviewSortSchema, st as storefrontCollectionSchema, t as createStorefrontClient, tt as productDetailSchema, u as reviewPageSchema, ut as pageInfoSchema, v as memberPointsSchema, vt as idpAuthorizeRequestSchema, w as purchaseDecisionResultSchema, wt as signupRequestSchema, x as myOrderItemSchema, xt as linkIdentityRequestSchema, y as storefrontPointPolicySchema, yt as idpAuthorizeResponseSchema, z as consentKindSchema } from "./client-NPFWqMgT.mjs";
|
|
4
|
+
import { $ as normalizeCustomInputValue, A as retryPaymentRequestSchema, B as couponBenefitViewSchema, C as paymentOptionSchema, D as remoteAreaSchema, E as pgProviderSchema, F as applicableCouponSchema, G as addonGroupViewSchema, H as myCouponListQuerySchema, I as checkoutPricingRequestSchema, J as customInputLength, K as addonSelectionSchema, L as checkoutPricingSchema, M as startPaymentRequestSchema, N as MAX_COUPONS_PER_CHECKOUT, O as residentNumberLike, P as MIN_PAYMENT_AMOUNT, Q as lineSelectionResponseShape, R as couponApplicationListSchema, S as paymentOptionListSchema, T as paymentStatusSchema, U as myCouponSchema, V as couponResultSchema, W as pricingAmountsSchema, X as customInputViewSchema, Y as customInputValueViewSchema, Z as lineSelectionRequestShape, _ as guestInfoSchema, a as availablePaymentOptionSchema, b as paymentMethodSchema, c as cashReceiptRequestSchema, d as checkoutSessionSchema, et as optionSelectionViewSchema, f as createCheckoutRequestSchema, g as easyPayProviderSchema, h as easyPayProviderResponseSchema, i as PAYMENT_STATUS_VALUES, it as productFulfillmentViewSchema, j as shippingAddressInputSchema, k as responsePaymentMethodSchema, l as cashReceiptTypeSchema, m as deliveryQuoteSchema, n as PAYMENT_RESULT_VALUES, nt as myOrderItemFulfillmentSnapshotSchema, o as cashReceiptAvailable, p as deliveryQuoteRequestSchema, q as customInputEntrySchema, r as PAYMENT_START_STATUS_VALUES, rt as productCardFulfillmentSchema, s as cashReceiptIdentityTypeOf, t as CASH_RECEIPT_METHODS, tt as lineFulfillmentSchema, u as checkoutDeliverySchema, v as paymentFailureCategorySchema, w as paymentStartSchema, x as paymentOptionKey, y as paymentMessageSchema, z as couponApplicationSchema } from "./checkout-f7iFQV88.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, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, 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, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
128
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, ApiError, CASH_RECEIPT_METHODS, MAX_COUPONS_PER_CHECKOUT, MIN_PAYMENT_AMOUNT, PAYMENT_RESULT_VALUES, PAYMENT_START_STATUS_VALUES, PAYMENT_STATUS_VALUES, STOREFRONT_SESSION_KEYS, addCartItemRequestSchema, addonGroupViewSchema, addonSelectionSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, applicableCouponSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, cashReceiptAvailable, cashReceiptIdentityTypeOf, cashReceiptRequestSchema, cashReceiptTypeSchema, categoryNodeSchema, checkoutDeliverySchema, checkoutPricingRequestSchema, checkoutPricingSchema, checkoutSessionSchema, claimReasonSchema, claimReturnAddressSchema, claimStatusSchema, claimTypeSchema, collectionProductPageSchema, collectionProductQuerySchema, collectionProductSortSchema, 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, memberPointEntryPageSchema, memberPointEntrySchema, memberPointsSchema, 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, responsePaymentMethodSchema, retryPaymentRequestSchema, reviewImageUploadRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontCollectionDetailSchema, storefrontCollectionListQuerySchema, storefrontCollectionSchema, storefrontPointPolicySchema, storefrontStoreSchema, tokenPairSchema, trackingStageResponseSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, uploadTicketSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dr as PaymentOption, et as createStorefrontClient, fr as PaymentStart, pr as PaymentStatus, qn as CashReceiptRequest, tr as GuestInfo, vr as ShippingAddressInput, yr as StartPaymentRequest } from "../index-UhlK7HG7.mjs";
|
|
2
2
|
//#region src/payments/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* 스토어프론트 결제 — 브라우저 전용(`@sayren/storefront-sdk/payments`).
|
|
@@ -9,6 +9,9 @@ import { Bn as CashReceiptRequest, Jn as GuestInfo, cr as ShippingAddressInput,
|
|
|
9
9
|
* if (result.status === "COMPLETED") location.assign(`/orders/${result.orderId}`);
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
+
* 결제 금액 전체를 적립금으로 낸 주문은 결제창이 없다. 결제 시작 응답이 `status: "completed"`·`payUrl: null`이면
|
|
13
|
+
* SDK는 창을 열지 않고(미리 연 팝업은 닫는다) 바로 `COMPLETED`를 돌려준다. 화면 분기는 그대로다.
|
|
14
|
+
*
|
|
12
15
|
* 결제창은 결제 서비스(`payUrl`)가 그린다. SDK는 그 창을 팝업으로 열고 결과 메시지를 받아 결제 상태 조회로 확정한다.
|
|
13
16
|
* 모바일(또는 `mode: "redirect"`)에서는 현재 탭을 `payUrl`로 보내고, 결제가 끝나면 구매자가 `returnUrl`로 돌아온다 —
|
|
14
17
|
* 복귀 화면에서 {@link Payments.result}를 부른다.
|
|
@@ -160,6 +163,8 @@ export interface Payments {
|
|
|
160
163
|
/**
|
|
161
164
|
* 이미 받은 결제 시작 값으로 결제창만 연다 — 결제 시작을 서버 함수로 하는 SSR 앱용.
|
|
162
165
|
* 클릭 핸들러에서 {@link Payments.prepareWindow}로 창을 먼저 열고 그 핸들을 `window`로 넘긴다.
|
|
166
|
+
* 결제 시작 값이 `status: "completed"`(결제창 없이 끝난 결제, `payUrl: null`)면 창을 열지 않고 미리 연 창을 닫은 뒤
|
|
167
|
+
* 바로 `COMPLETED`를 돌려준다. `start`·`retry`도 같다.
|
|
163
168
|
*/
|
|
164
169
|
open(start: PaymentStart, options?: {
|
|
165
170
|
mode?: PaymentMode;
|
package/dist/payments/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as paymentMessageSchema } from "../checkout-f7iFQV88.mjs";
|
|
2
2
|
//#region src/payments/index.ts
|
|
3
3
|
/** 복귀 주소에 결제 서비스가 붙이는 쿼리 */
|
|
4
4
|
const RETURN_PAYMENT_ID = "sayrenPaymentId";
|
|
@@ -252,13 +252,34 @@ function createPayments(options) {
|
|
|
252
252
|
cancelWatch = cancelThis;
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
+
/** 결제창을 열지 않는 결제 시작 응답의 결과 */
|
|
256
|
+
async function settleWithoutWindow(start) {
|
|
257
|
+
if (start.status === "completed" && start.orderId) return {
|
|
258
|
+
status: "COMPLETED",
|
|
259
|
+
paymentId: start.paymentId,
|
|
260
|
+
orderId: start.orderId
|
|
261
|
+
};
|
|
262
|
+
try {
|
|
263
|
+
return paymentResultOf(await client.payments.getStatus(start.paymentId));
|
|
264
|
+
} catch {
|
|
265
|
+
return {
|
|
266
|
+
status: "PROCESSING",
|
|
267
|
+
paymentId: start.paymentId
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
255
271
|
function open(start, openOptions = {}) {
|
|
256
272
|
stopWatch();
|
|
257
273
|
const popup = resolvePrepared(openOptions.window, openOptions.mode).popup;
|
|
258
|
-
const
|
|
274
|
+
const payUrl = start.payUrl;
|
|
275
|
+
if (start.status !== "pending" || !payUrl) {
|
|
276
|
+
popup?.close();
|
|
277
|
+
return settleWithoutWindow(start);
|
|
278
|
+
}
|
|
279
|
+
const url = popup ? popupUrl(payUrl) : null;
|
|
259
280
|
if (!popup || !url) {
|
|
260
281
|
popup?.close();
|
|
261
|
-
env.navigate(
|
|
282
|
+
env.navigate(payUrl);
|
|
262
283
|
return new Promise(() => {});
|
|
263
284
|
}
|
|
264
285
|
popup.navigate(url);
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -91,6 +91,11 @@ import {
|
|
|
91
91
|
updateProfileRequestSchema,
|
|
92
92
|
} from "./schemas/member";
|
|
93
93
|
import { deliveryTrackingSchema, myOrderSchema } from "./schemas/order";
|
|
94
|
+
import {
|
|
95
|
+
memberPointEntryPageSchema,
|
|
96
|
+
memberPointsSchema,
|
|
97
|
+
storefrontPointPolicySchema,
|
|
98
|
+
} from "./schemas/points";
|
|
94
99
|
import {
|
|
95
100
|
type CreateReviewRequest,
|
|
96
101
|
createReviewRequestSchema,
|
|
@@ -248,6 +253,8 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
248
253
|
|
|
249
254
|
catalog: {
|
|
250
255
|
listCategories: () => http.request("GET", "/categories", z.array(categoryNodeSchema)),
|
|
256
|
+
/** `GET /point-policy` — 상점 적립 정책(리뷰·구매 적립, 유효 기간, 리뷰 작성·수정 기한, #93). 리뷰 혜택 안내에 쓴다 */
|
|
257
|
+
getPointPolicy: () => http.request("GET", "/point-policy", storefrontPointPolicySchema),
|
|
251
258
|
searchProducts: (params?: ProductSearchParams) =>
|
|
252
259
|
http.request("GET", "/products", productPageSchema, { query: params as Query }),
|
|
253
260
|
getProduct: (productId: string) =>
|
|
@@ -399,6 +406,13 @@ export function createStorefrontClient(options: StorefrontClientOptions) {
|
|
|
399
406
|
|
|
400
407
|
member: {
|
|
401
408
|
me: () => http.request("GET", "/me", memberSchema),
|
|
409
|
+
/** `GET /me/points` — 내 적립금 잔액과 30일 안 소멸 예정액(#93) */
|
|
410
|
+
getPoints: () => http.request("GET", "/me/points", memberPointsSchema),
|
|
411
|
+
/** `GET /me/points/history` — 내 적립금 내역(최신순) */
|
|
412
|
+
listPointHistory: (params?: PageParams) =>
|
|
413
|
+
http.request("GET", "/me/points/history", memberPointEntryPageSchema, {
|
|
414
|
+
query: params as Query,
|
|
415
|
+
}),
|
|
402
416
|
updateMe: (body: UpdateProfileRequest) =>
|
|
403
417
|
http.requestVoid("PATCH", "/me", { body: updateProfileRequestSchema.parse(body) }),
|
|
404
418
|
/** 약관·개인정보·마케팅 동의의 현재 상태와 재동의 필요 여부 */
|
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/points";
|
|
20
21
|
export * from "./schemas/product-options";
|
|
21
22
|
export * from "./schemas/review";
|
|
22
23
|
export * from "./schemas/store";
|
package/src/payments/index.ts
CHANGED
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
* if (result.status === "COMPLETED") location.assign(`/orders/${result.orderId}`);
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
|
+
* 결제 금액 전체를 적립금으로 낸 주문은 결제창이 없다. 결제 시작 응답이 `status: "completed"`·`payUrl: null`이면
|
|
23
|
+
* SDK는 창을 열지 않고(미리 연 팝업은 닫는다) 바로 `COMPLETED`를 돌려준다. 화면 분기는 그대로다.
|
|
24
|
+
*
|
|
22
25
|
* 결제창은 결제 서비스(`payUrl`)가 그린다. SDK는 그 창을 팝업으로 열고 결과 메시지를 받아 결제 상태 조회로 확정한다.
|
|
23
26
|
* 모바일(또는 `mode: "redirect"`)에서는 현재 탭을 `payUrl`로 보내고, 결제가 끝나면 구매자가 `returnUrl`로 돌아온다 —
|
|
24
27
|
* 복귀 화면에서 {@link Payments.result}를 부른다.
|
|
@@ -294,6 +297,8 @@ export interface Payments {
|
|
|
294
297
|
/**
|
|
295
298
|
* 이미 받은 결제 시작 값으로 결제창만 연다 — 결제 시작을 서버 함수로 하는 SSR 앱용.
|
|
296
299
|
* 클릭 핸들러에서 {@link Payments.prepareWindow}로 창을 먼저 열고 그 핸들을 `window`로 넘긴다.
|
|
300
|
+
* 결제 시작 값이 `status: "completed"`(결제창 없이 끝난 결제, `payUrl: null`)면 창을 열지 않고 미리 연 창을 닫은 뒤
|
|
301
|
+
* 바로 `COMPLETED`를 돌려준다. `start`·`retry`도 같다.
|
|
297
302
|
*/
|
|
298
303
|
open(
|
|
299
304
|
start: PaymentStart,
|
|
@@ -484,6 +489,18 @@ export function createPayments(options: PaymentsOptions): Payments {
|
|
|
484
489
|
});
|
|
485
490
|
}
|
|
486
491
|
|
|
492
|
+
/** 결제창을 열지 않는 결제 시작 응답의 결과 */
|
|
493
|
+
async function settleWithoutWindow(start: PaymentStart): Promise<PaymentResult> {
|
|
494
|
+
if (start.status === "completed" && start.orderId) {
|
|
495
|
+
return { status: "COMPLETED", paymentId: start.paymentId, orderId: start.orderId };
|
|
496
|
+
}
|
|
497
|
+
try {
|
|
498
|
+
return paymentResultOf(await client.payments.getStatus(start.paymentId));
|
|
499
|
+
} catch {
|
|
500
|
+
return { status: "PROCESSING", paymentId: start.paymentId };
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
487
504
|
function open(
|
|
488
505
|
start: PaymentStart,
|
|
489
506
|
openOptions: { mode?: PaymentMode; window?: PreparedPaymentWindow } = {},
|
|
@@ -492,10 +509,17 @@ export function createPayments(options: PaymentsOptions): Payments {
|
|
|
492
509
|
stopWatch();
|
|
493
510
|
const prepared = resolvePrepared(openOptions.window, openOptions.mode);
|
|
494
511
|
const popup = prepared.popup;
|
|
495
|
-
const
|
|
512
|
+
const payUrl = start.payUrl;
|
|
513
|
+
if (start.status !== "pending" || !payUrl) {
|
|
514
|
+
// 결제창 없이 끝난 결제(적립금 전액 결제, #93)이거나 이 SDK가 모르는 상태다 — 창을 열지 않는다.
|
|
515
|
+
// 주문 번호가 오면 그대로 완료이고, 아니면 결제 상태 조회로 확정한다(원천은 언제나 `GET /payments/{id}`)
|
|
516
|
+
popup?.close();
|
|
517
|
+
return settleWithoutWindow(start);
|
|
518
|
+
}
|
|
519
|
+
const url = popup ? popupUrl(payUrl) : null;
|
|
496
520
|
if (!popup || !url) {
|
|
497
521
|
popup?.close();
|
|
498
|
-
env.navigate(
|
|
522
|
+
env.navigate(payUrl);
|
|
499
523
|
// 페이지가 떠난다 — 결과는 복귀 화면의 result()가 읽는다
|
|
500
524
|
return new Promise<PaymentResult>(() => {});
|
|
501
525
|
}
|
package/src/schemas/checkout.ts
CHANGED
|
@@ -165,6 +165,20 @@ export const paymentMethodSchema = z.enum([
|
|
|
165
165
|
|
|
166
166
|
export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* 응답에 실리는 결제수단 — 아는 값(`PaymentMethod`)이거나 이 SDK가 모르는 새 값(문자열)이다. 서버가 결제수단을 더해도
|
|
170
|
+
* 응답 파싱이 깨지지 않게 넓게 받는다(`responsePlanCodeSchema`·`easyPayProviderResponseSchema`와 같은 방식, #93 P0).
|
|
171
|
+
* 적립금 전액 결제 주문은 `POINT`가 온다. 화면은 아는 값으로 분기하고 모르는 값은 그대로 표시하거나 「기타」로 다룬다.
|
|
172
|
+
* 요청(결제 옵션)은 값을 골라 보내는 자리라 `paymentMethodSchema`(enum) 그대로다.
|
|
173
|
+
*/
|
|
174
|
+
export const responsePaymentMethodSchema = z
|
|
175
|
+
.union([paymentMethodSchema, z.string()])
|
|
176
|
+
.describe(
|
|
177
|
+
"결제수단. `CARD` 카드 · `BANK_TRANSFER` 계좌이체 · `VIRTUAL_ACCOUNT` 가상계좌 · `MOBILE` 휴대폰 · `EASY_PAY` 간편결제 · " +
|
|
178
|
+
"`POINT` 적립금 전액 결제. 값이 추가될 수 있어 문자열로 받는다",
|
|
179
|
+
);
|
|
180
|
+
export type ResponsePaymentMethod = PaymentMethod | (string & {});
|
|
181
|
+
|
|
168
182
|
/** 결제를 처리하는 PG. 셀러가 직접 계약하고 상점 플랫폼 설정 › 결제에서 연결한다 */
|
|
169
183
|
export const pgProviderSchema = z.enum(["tosspayments", "portone"]);
|
|
170
184
|
export type PgProvider = z.infer<typeof pgProviderSchema>;
|
|
@@ -415,14 +429,44 @@ export const retryPaymentRequestSchema = z.object({
|
|
|
415
429
|
|
|
416
430
|
export type RetryPaymentRequest = z.infer<typeof retryPaymentRequestSchema>;
|
|
417
431
|
|
|
432
|
+
/**
|
|
433
|
+
* 결제 시작 상태 — `pending`이면 `payUrl`로 결제창을 연다. `completed`면 결제창 없이 결제가 끝나 주문이 만들어졌고
|
|
434
|
+
* `orderId`가 있다(적립금으로 결제 금액 전체를 낸 주문, #93). 값이 추가될 수 있어 응답은 문자열로 받는다.
|
|
435
|
+
*/
|
|
436
|
+
export const PAYMENT_START_STATUS_VALUES = ["pending", "completed"] as const;
|
|
437
|
+
export type KnownPaymentStartStatus = (typeof PAYMENT_START_STATUS_VALUES)[number];
|
|
438
|
+
|
|
418
439
|
export const paymentStartSchema = z.object({
|
|
419
440
|
paymentId: z.string().describe("결제 id. 상태 조회·재시도의 키다"),
|
|
420
|
-
|
|
421
|
-
|
|
441
|
+
status: z
|
|
442
|
+
.string()
|
|
443
|
+
.optional()
|
|
444
|
+
.default("pending")
|
|
445
|
+
.describe(
|
|
446
|
+
"결제 시작 상태. `pending`이면 `payUrl`로 결제창을 연다. `completed`면 결제창 없이 결제가 끝났고(적립금 전액 결제) `orderId`가 주문 번호다. " +
|
|
447
|
+
"그 밖의 값은 결제 상태 조회(`GET /payments/{paymentId}`)로 확정한다. 이 필드가 없던 서버 응답은 `pending`으로 읽는다",
|
|
448
|
+
),
|
|
449
|
+
orderId: z
|
|
450
|
+
.string()
|
|
451
|
+
.nullable()
|
|
452
|
+
.optional()
|
|
453
|
+
.default(null)
|
|
454
|
+
.describe("만들어진 주문 번호. `status`가 `completed`일 때만 값이 있고 그 밖에는 null"),
|
|
455
|
+
attemptId: z
|
|
456
|
+
.string()
|
|
457
|
+
.nullable()
|
|
458
|
+
.describe(
|
|
459
|
+
"결제 시도 id. PG 주문번호(토스 orderId, 포트원 paymentId)다. 결제창 없이 끝난 결제(`completed`)는 null",
|
|
460
|
+
),
|
|
461
|
+
option: paymentOptionSchema
|
|
462
|
+
.nullable()
|
|
463
|
+
.describe("이 시도의 결제 옵션. 결제창 없이 끝난 결제(`completed`)는 null"),
|
|
422
464
|
payUrl: z
|
|
423
465
|
.string()
|
|
466
|
+
.nullable()
|
|
424
467
|
.describe(
|
|
425
|
-
"결제 서비스 주소. 팝업으로 열려면 쿼리 `mode=popup`을 붙이고, 그대로 이동하면 리다이렉트
|
|
468
|
+
"결제 서비스 주소. 팝업으로 열려면 쿼리 `mode=popup`을 붙이고, 그대로 이동하면 리다이렉트 결제다. " +
|
|
469
|
+
"결제창 없이 끝난 결제(`completed`)는 null이다",
|
|
426
470
|
),
|
|
427
471
|
expiresAt: z.string().describe("결제 요청 만료 시각"),
|
|
428
472
|
testPayment: z
|
package/src/schemas/order.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { easyPayProviderResponseSchema,
|
|
2
|
+
import { easyPayProviderResponseSchema, responsePaymentMethodSchema } from "./checkout";
|
|
3
3
|
import { orderItemStatusSchema } from "./common";
|
|
4
4
|
import { myOrderItemFulfillmentSnapshotSchema } from "./fulfillment";
|
|
5
5
|
import { lineSelectionResponseShape } from "./product-options";
|
|
@@ -90,8 +90,9 @@ export const myOrderSchema = z.object({
|
|
|
90
90
|
),
|
|
91
91
|
shippingAddress: orderShippingAddressSchema,
|
|
92
92
|
payment: z.object({
|
|
93
|
-
method:
|
|
94
|
-
"실제 결제수단(PG가 보고한 수단, 모르면 주문서에서 고른 수단). 결제창에서 바뀔 수 있다(카드 결제창의 간편결제 탭 등)"
|
|
93
|
+
method: responsePaymentMethodSchema.describe(
|
|
94
|
+
"실제 결제수단(PG가 보고한 수단, 모르면 주문서에서 고른 수단). 결제창에서 바뀔 수 있다(카드 결제창의 간편결제 탭 등). " +
|
|
95
|
+
"적립금 전액 결제 주문은 `POINT`다. 값이 추가될 수 있어 문자열로 받는다",
|
|
95
96
|
),
|
|
96
97
|
easyPayProvider: easyPayProviderResponseSchema
|
|
97
98
|
.nullable()
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { pageSchema } from "./common";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 적립금 (이슈 #93) — 상점 적립 정책 안내와 구매자 잔액·내역. 금액은 원 단위 정수다.
|
|
6
|
+
* 적립금 사용(주문서·결제)은 다음 단계에서 가산한다.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** `GET /point-policy` — 상점 적립 정책(인증 없음, 상점 단위). 리뷰 작성·주문 화면의 혜택 안내에 쓴다 */
|
|
10
|
+
export const storefrontPointPolicySchema = z.object({
|
|
11
|
+
reviewReward: z
|
|
12
|
+
.object({
|
|
13
|
+
enabled: z.boolean().describe("리뷰 적립 사용 여부. false면 리뷰 혜택 안내를 그리지 않는다"),
|
|
14
|
+
textPoint: z.number().int().describe("리뷰를 작성하면 주는 적립금(원)"),
|
|
15
|
+
photoPoint: z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.describe("사진 리뷰에 더 주는 적립금(원). 사진 리뷰는 `textPoint + photoPoint`다"),
|
|
19
|
+
})
|
|
20
|
+
.describe("리뷰 적립"),
|
|
21
|
+
purchaseEarn: z
|
|
22
|
+
.object({
|
|
23
|
+
enabled: z.boolean().describe("구매 적립 사용 여부"),
|
|
24
|
+
rateBp: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.describe("상점 기본 구매 적립률(만분율, 100 = 1%). 상품마다 다를 수 있다"),
|
|
28
|
+
})
|
|
29
|
+
.describe("구매 적립 — 구매확정 때 실결제 금액(배송비 제외) × 적립률을 준다"),
|
|
30
|
+
expiryDays: z.number().int().nullable().describe("적립금 유효 기간(일). 정하지 않았으면 null"),
|
|
31
|
+
review: z
|
|
32
|
+
.object({
|
|
33
|
+
writableDays: z.number().int().describe("구매확정 뒤 리뷰를 쓸 수 있는 기간(일)"),
|
|
34
|
+
editableDays: z.number().int().describe("리뷰를 쓴 뒤 고칠 수 있는 기간(일)"),
|
|
35
|
+
})
|
|
36
|
+
.describe("리뷰 작성·수정 기한"),
|
|
37
|
+
});
|
|
38
|
+
export type StorefrontPointPolicy = z.infer<typeof storefrontPointPolicySchema>;
|
|
39
|
+
|
|
40
|
+
/** `GET /me/points` — 내 적립금 */
|
|
41
|
+
export const memberPointsSchema = z.object({
|
|
42
|
+
balance: z.number().int().describe("잔액"),
|
|
43
|
+
expiringSoon: z.number().int().describe("30일 안에 소멸할 금액"),
|
|
44
|
+
});
|
|
45
|
+
export type MemberPoints = z.infer<typeof memberPointsSchema>;
|
|
46
|
+
|
|
47
|
+
/** 내 적립금 내역 한 줄 — 셀러 메모는 싣지 않는다 */
|
|
48
|
+
export const memberPointEntrySchema = z.object({
|
|
49
|
+
entryId: z.string(),
|
|
50
|
+
type: z
|
|
51
|
+
.string()
|
|
52
|
+
.describe(
|
|
53
|
+
"유형. `EARN_REVIEW` 리뷰 적립 · `REVOKE_REVIEW` 리뷰 삭제 회수 · `EARN_PURCHASE` 구매 적립 · `EXPIRE` 소멸 · `ADJUST` 상점 지급·차감 · " +
|
|
54
|
+
"`OPENING` 기존 적립금. 값이 추가될 수 있어 문자열로 받는다",
|
|
55
|
+
),
|
|
56
|
+
amount: z.number().int().describe("변동액. 적립 +, 회수·차감·소멸 −"),
|
|
57
|
+
balanceAfter: z.number().int().describe("이 변동 직후 잔액"),
|
|
58
|
+
createdAt: z.string(),
|
|
59
|
+
});
|
|
60
|
+
export type MemberPointEntry = z.infer<typeof memberPointEntrySchema>;
|
|
61
|
+
|
|
62
|
+
export const memberPointEntryPageSchema = pageSchema(memberPointEntrySchema);
|