@sayren/storefront-sdk 0.7.0 → 0.9.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-JFk3b8RG.mjs +189 -0
- package/dist/{client-B1uXGefY.mjs → client-D9iQIWnV.mjs} +29 -143
- package/dist/index-DvHOQm2-.d.mts +1998 -0
- package/dist/index.d.mts +2 -1645
- package/dist/index.mjs +3 -2
- package/dist/payments/index.d.mts +166 -0
- package/dist/payments/index.mjs +320 -0
- package/package.json +7 -2
- package/src/client.ts +28 -35
- package/src/payments/index.ts +551 -0
- package/src/schemas/cart.ts +1 -1
- package/src/schemas/catalog.ts +1 -1
- package/src/schemas/checkout.ts +148 -54
- package/src/schemas/order.ts +11 -2
- package/src/schemas/review.ts +1 -1
|
@@ -0,0 +1,1998 @@
|
|
|
1
|
+
import { c as LinkIdentityRequest, d as SignupRequest, f as SocialProvider, l as LoginRequest, m as WithdrawRequest, o as IdpAuthorizeRequest, r as TokenSource, s as IdpTokenRequest } from "./http-BbFHVGBf.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/analytics-ids.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 요청의 Cookie 헤더에서 방문자·세션 ID를 읽는다 — SSR 서버가 스토어프론트 API를 부를 때 쓴다.
|
|
6
|
+
* 브라우저 모듈(`@sayren/storefront-sdk/analytics`)이 셀러 도메인에 남긴 쿠키다. 형식이 틀린 값은 버린다.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const ids = analyticsIdsFromCookie(request.headers.get("cookie"));
|
|
10
|
+
* createStorefrontClient({ baseUrl, storeCode, ...ids });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare function analyticsIdsFromCookie(cookieHeader: string | null | undefined): {
|
|
14
|
+
visitorId?: string;
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/schemas/cart.d.ts
|
|
19
|
+
declare const cartItemSchema: z.ZodObject<{
|
|
20
|
+
cartItemId: z.ZodString;
|
|
21
|
+
productId: z.ZodString;
|
|
22
|
+
productName: z.ZodString;
|
|
23
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
24
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
25
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
26
|
+
quantity: z.ZodNumber;
|
|
27
|
+
unitPrice: z.ZodNumber;
|
|
28
|
+
totalPrice: z.ZodNumber;
|
|
29
|
+
purchasable: z.ZodBoolean;
|
|
30
|
+
unpurchasableReason: z.ZodNullable<z.ZodEnum<{
|
|
31
|
+
SOLD_OUT: "SOLD_OUT";
|
|
32
|
+
SUSPENDED: "SUSPENDED";
|
|
33
|
+
CLOSED: "CLOSED";
|
|
34
|
+
}>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type CartItem = z.infer<typeof cartItemSchema>;
|
|
37
|
+
declare const cartSchema: z.ZodObject<{
|
|
38
|
+
items: z.ZodArray<z.ZodObject<{
|
|
39
|
+
cartItemId: z.ZodString;
|
|
40
|
+
productId: z.ZodString;
|
|
41
|
+
productName: z.ZodString;
|
|
42
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
43
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
45
|
+
quantity: z.ZodNumber;
|
|
46
|
+
unitPrice: z.ZodNumber;
|
|
47
|
+
totalPrice: z.ZodNumber;
|
|
48
|
+
purchasable: z.ZodBoolean;
|
|
49
|
+
unpurchasableReason: z.ZodNullable<z.ZodEnum<{
|
|
50
|
+
SOLD_OUT: "SOLD_OUT";
|
|
51
|
+
SUSPENDED: "SUSPENDED";
|
|
52
|
+
CLOSED: "CLOSED";
|
|
53
|
+
}>>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
summary: z.ZodObject<{
|
|
56
|
+
productAmount: z.ZodNumber;
|
|
57
|
+
deliveryFee: z.ZodNumber;
|
|
58
|
+
totalAmount: z.ZodNumber;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
type Cart = z.infer<typeof cartSchema>;
|
|
62
|
+
declare const addCartItemRequestSchema: z.ZodObject<{
|
|
63
|
+
productId: z.ZodString;
|
|
64
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
quantity: z.ZodNumber;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
type AddCartItemRequest = z.infer<typeof addCartItemRequestSchema>;
|
|
68
|
+
declare const updateCartItemRequestSchema: z.ZodObject<{
|
|
69
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type UpdateCartItemRequest = z.infer<typeof updateCartItemRequestSchema>;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/schemas/common.d.ts
|
|
75
|
+
declare const pageInfoSchema: z.ZodObject<{
|
|
76
|
+
page: z.ZodNumber;
|
|
77
|
+
size: z.ZodNumber;
|
|
78
|
+
totalElements: z.ZodNumber;
|
|
79
|
+
totalPages: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
type PageInfo = z.infer<typeof pageInfoSchema>;
|
|
82
|
+
declare function pageSchema<T extends z.ZodType>(item: T): z.ZodObject<{
|
|
83
|
+
page: z.ZodNumber;
|
|
84
|
+
size: z.ZodNumber;
|
|
85
|
+
totalElements: z.ZodNumber;
|
|
86
|
+
totalPages: z.ZodNumber;
|
|
87
|
+
contents: z.ZodArray<T>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
interface PageParams {
|
|
90
|
+
page?: number;
|
|
91
|
+
size?: number;
|
|
92
|
+
}
|
|
93
|
+
declare const orderItemStatusSchema: z.ZodEnum<{
|
|
94
|
+
CANCELED: "CANCELED";
|
|
95
|
+
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
96
|
+
PAID: "PAID";
|
|
97
|
+
CONFIRMED: "CONFIRMED";
|
|
98
|
+
DISPATCHED: "DISPATCHED";
|
|
99
|
+
DELIVERING: "DELIVERING";
|
|
100
|
+
DELIVERED: "DELIVERED";
|
|
101
|
+
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
102
|
+
}>;
|
|
103
|
+
type OrderItemStatus = z.infer<typeof orderItemStatusSchema>;
|
|
104
|
+
declare const claimStatusSchema: z.ZodEnum<{
|
|
105
|
+
COMPLETED: "COMPLETED";
|
|
106
|
+
REQUESTED: "REQUESTED";
|
|
107
|
+
HELD: "HELD";
|
|
108
|
+
COLLECTING: "COLLECTING";
|
|
109
|
+
COLLECTED: "COLLECTED";
|
|
110
|
+
REDELIVERING: "REDELIVERING";
|
|
111
|
+
APPROVED: "APPROVED";
|
|
112
|
+
REJECTED: "REJECTED";
|
|
113
|
+
WITHDRAWN: "WITHDRAWN";
|
|
114
|
+
}>;
|
|
115
|
+
type ClaimStatus = z.infer<typeof claimStatusSchema>;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/schemas/catalog.d.ts
|
|
118
|
+
interface CategoryNode {
|
|
119
|
+
categoryId: string;
|
|
120
|
+
name: string;
|
|
121
|
+
depth: number;
|
|
122
|
+
children: CategoryNode[];
|
|
123
|
+
}
|
|
124
|
+
declare const categoryNodeSchema: z.ZodType<CategoryNode>;
|
|
125
|
+
declare const productCardSchema: z.ZodObject<{
|
|
126
|
+
productId: z.ZodString;
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
129
|
+
salePrice: z.ZodNumber;
|
|
130
|
+
discountedPrice: z.ZodNullable<z.ZodNumber>;
|
|
131
|
+
discountRate: z.ZodNullable<z.ZodNumber>;
|
|
132
|
+
freeShipping: z.ZodBoolean;
|
|
133
|
+
averageRating: z.ZodNumber;
|
|
134
|
+
reviewCount: z.ZodNumber;
|
|
135
|
+
soldOut: z.ZodBoolean;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
type ProductCard = z.infer<typeof productCardSchema>;
|
|
138
|
+
declare const productDetailSchema: z.ZodObject<{
|
|
139
|
+
productId: z.ZodString;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
142
|
+
salePrice: z.ZodNumber;
|
|
143
|
+
discountedPrice: z.ZodNullable<z.ZodNumber>;
|
|
144
|
+
discountRate: z.ZodNullable<z.ZodNumber>;
|
|
145
|
+
freeShipping: z.ZodBoolean;
|
|
146
|
+
averageRating: z.ZodNumber;
|
|
147
|
+
reviewCount: z.ZodNumber;
|
|
148
|
+
soldOut: z.ZodBoolean;
|
|
149
|
+
description: z.ZodString;
|
|
150
|
+
images: z.ZodArray<z.ZodURL>;
|
|
151
|
+
optionGroups: z.ZodArray<z.ZodObject<{
|
|
152
|
+
groupId: z.ZodString;
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
values: z.ZodArray<z.ZodObject<{
|
|
155
|
+
valueId: z.ZodString;
|
|
156
|
+
name: z.ZodString;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
160
|
+
variantId: z.ZodString;
|
|
161
|
+
valueIds: z.ZodArray<z.ZodString>;
|
|
162
|
+
name: z.ZodString;
|
|
163
|
+
additionalPrice: z.ZodNumber;
|
|
164
|
+
soldOut: z.ZodBoolean;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
delivery: z.ZodObject<{
|
|
167
|
+
type: z.ZodEnum<{
|
|
168
|
+
PAID: "PAID";
|
|
169
|
+
FREE: "FREE";
|
|
170
|
+
CONDITIONAL_FREE: "CONDITIONAL_FREE";
|
|
171
|
+
}>;
|
|
172
|
+
fee: z.ZodNumber;
|
|
173
|
+
conditionalFreeAmount: z.ZodNullable<z.ZodNumber>;
|
|
174
|
+
estimatedDays: z.ZodString;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
returnPolicy: z.ZodObject<{
|
|
177
|
+
returnFee: z.ZodNumber;
|
|
178
|
+
exchangeFee: z.ZodNumber;
|
|
179
|
+
periodDays: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
categoryPath: z.ZodArray<z.ZodObject<{
|
|
182
|
+
categoryId: z.ZodString;
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
type ProductDetail = z.infer<typeof productDetailSchema>;
|
|
187
|
+
declare const productSortSchema: z.ZodEnum<{
|
|
188
|
+
latest: "latest";
|
|
189
|
+
ratingDesc: "ratingDesc";
|
|
190
|
+
reviewCount: "reviewCount";
|
|
191
|
+
recommend: "recommend";
|
|
192
|
+
priceAsc: "priceAsc";
|
|
193
|
+
priceDesc: "priceDesc";
|
|
194
|
+
}>;
|
|
195
|
+
type ProductSort = z.infer<typeof productSortSchema>;
|
|
196
|
+
interface ProductSearchParams extends PageParams {
|
|
197
|
+
keyword?: string;
|
|
198
|
+
categoryId?: string;
|
|
199
|
+
minPrice?: number;
|
|
200
|
+
maxPrice?: number;
|
|
201
|
+
freeShipping?: boolean;
|
|
202
|
+
sort?: ProductSort;
|
|
203
|
+
}
|
|
204
|
+
declare const productFacetsSchema: z.ZodObject<{
|
|
205
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
206
|
+
categoryId: z.ZodString;
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
count: z.ZodNumber;
|
|
209
|
+
}, z.core.$strip>>>;
|
|
210
|
+
priceRange: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
min: z.ZodNumber;
|
|
212
|
+
max: z.ZodNumber;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
type ProductFacets = z.infer<typeof productFacetsSchema>;
|
|
216
|
+
/** `GET /products` 응답 — 상품 카드 페이지와 검색 패싯 */
|
|
217
|
+
declare const productPageSchema: z.ZodObject<{
|
|
218
|
+
page: z.ZodNumber;
|
|
219
|
+
size: z.ZodNumber;
|
|
220
|
+
totalElements: z.ZodNumber;
|
|
221
|
+
totalPages: z.ZodNumber;
|
|
222
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
223
|
+
productId: z.ZodString;
|
|
224
|
+
name: z.ZodString;
|
|
225
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
226
|
+
salePrice: z.ZodNumber;
|
|
227
|
+
discountedPrice: z.ZodNullable<z.ZodNumber>;
|
|
228
|
+
discountRate: z.ZodNullable<z.ZodNumber>;
|
|
229
|
+
freeShipping: z.ZodBoolean;
|
|
230
|
+
averageRating: z.ZodNumber;
|
|
231
|
+
reviewCount: z.ZodNumber;
|
|
232
|
+
soldOut: z.ZodBoolean;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
facets: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
|
+
categoryId: z.ZodString;
|
|
237
|
+
name: z.ZodString;
|
|
238
|
+
count: z.ZodNumber;
|
|
239
|
+
}, z.core.$strip>>>;
|
|
240
|
+
priceRange: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
min: z.ZodNumber;
|
|
242
|
+
max: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
}, z.core.$strip>>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
type ProductPage = z.infer<typeof productPageSchema>;
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/schemas/checkout.d.ts
|
|
249
|
+
declare const createCheckoutRequestSchema: z.ZodObject<{
|
|
250
|
+
cartItemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
251
|
+
directItem: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
productId: z.ZodString;
|
|
253
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
254
|
+
quantity: z.ZodNumber;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
type CreateCheckoutRequest = z.infer<typeof createCheckoutRequestSchema>;
|
|
258
|
+
declare const checkoutSessionSchema: z.ZodObject<{
|
|
259
|
+
checkoutId: z.ZodString;
|
|
260
|
+
items: z.ZodArray<z.ZodObject<{
|
|
261
|
+
productId: z.ZodString;
|
|
262
|
+
productName: z.ZodString;
|
|
263
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
264
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
265
|
+
quantity: z.ZodNumber;
|
|
266
|
+
unitPrice: z.ZodNumber;
|
|
267
|
+
totalPrice: z.ZodNumber;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
amounts: z.ZodObject<{
|
|
270
|
+
productAmount: z.ZodNumber;
|
|
271
|
+
deliveryFee: z.ZodNumber;
|
|
272
|
+
totalAmount: z.ZodNumber;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
expiresAt: z.ZodString;
|
|
275
|
+
paymentOptions: z.ZodLazy<z.ZodPreprocess<z.ZodArray<z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
276
|
+
pg: z.ZodEnum<{
|
|
277
|
+
tosspayments: "tosspayments";
|
|
278
|
+
portone: "portone";
|
|
279
|
+
}>;
|
|
280
|
+
method: z.ZodLiteral<"CARD">;
|
|
281
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
+
pg: z.ZodEnum<{
|
|
283
|
+
tosspayments: "tosspayments";
|
|
284
|
+
portone: "portone";
|
|
285
|
+
}>;
|
|
286
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
287
|
+
provider: z.ZodEnum<{
|
|
288
|
+
NAVERPAY: "NAVERPAY";
|
|
289
|
+
KAKAOPAY: "KAKAOPAY";
|
|
290
|
+
TOSSPAY: "TOSSPAY";
|
|
291
|
+
PAYCO: "PAYCO";
|
|
292
|
+
}>;
|
|
293
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
294
|
+
pg: z.ZodEnum<{
|
|
295
|
+
tosspayments: "tosspayments";
|
|
296
|
+
portone: "portone";
|
|
297
|
+
}>;
|
|
298
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
pg: z.ZodEnum<{
|
|
301
|
+
tosspayments: "tosspayments";
|
|
302
|
+
portone: "portone";
|
|
303
|
+
}>;
|
|
304
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
pg: z.ZodEnum<{
|
|
307
|
+
tosspayments: "tosspayments";
|
|
308
|
+
portone: "portone";
|
|
309
|
+
}>;
|
|
310
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
311
|
+
}, z.core.$strip>], "method">, z.ZodObject<{
|
|
312
|
+
label: z.ZodString;
|
|
313
|
+
pgName: z.ZodString;
|
|
314
|
+
}, z.core.$strip>>>, unknown>>;
|
|
315
|
+
testPayment: z.ZodBoolean;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
|
|
318
|
+
declare const paymentMethodSchema: z.ZodEnum<{
|
|
319
|
+
CARD: "CARD";
|
|
320
|
+
EASY_PAY: "EASY_PAY";
|
|
321
|
+
BANK_TRANSFER: "BANK_TRANSFER";
|
|
322
|
+
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
323
|
+
MOBILE: "MOBILE";
|
|
324
|
+
}>;
|
|
325
|
+
type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
326
|
+
/** 결제를 처리하는 PG. 셀러가 직접 계약하고 콘솔 설정 › 결제에서 연결한다 */
|
|
327
|
+
declare const pgProviderSchema: z.ZodEnum<{
|
|
328
|
+
tosspayments: "tosspayments";
|
|
329
|
+
portone: "portone";
|
|
330
|
+
}>;
|
|
331
|
+
type PgProvider = z.infer<typeof pgProviderSchema>;
|
|
332
|
+
/** 간편결제사. 토스페이먼츠·포트원 모두 같은 코드를 쓴다 */
|
|
333
|
+
declare const easyPayProviderSchema: z.ZodEnum<{
|
|
334
|
+
NAVERPAY: "NAVERPAY";
|
|
335
|
+
KAKAOPAY: "KAKAOPAY";
|
|
336
|
+
TOSSPAY: "TOSSPAY";
|
|
337
|
+
PAYCO: "PAYCO";
|
|
338
|
+
}>;
|
|
339
|
+
type EasyPayProvider = z.infer<typeof easyPayProviderSchema>;
|
|
340
|
+
/**
|
|
341
|
+
* 응답에 실리는 간편결제사 — 서버가 간편결제사를 추가해도 파싱이 깨지지 않게 문자열로 받는다
|
|
342
|
+
* (`pgProvider`·결제 상태와 같은 방식). 요청과 결제 옵션은 값을 골라 보내는 자리라 enum 그대로다.
|
|
343
|
+
*/
|
|
344
|
+
declare const easyPayProviderResponseSchema: z.ZodString;
|
|
345
|
+
/**
|
|
346
|
+
* 결제 옵션 — 어느 PG로 어떤 결제수단을 쓸지. `method`로 좁히면 필요한 필드가 타입으로 정해진다
|
|
347
|
+
* (`EASY_PAY`만 `provider`가 있다). 주문서의 `paymentOptions` 항목을 그대로 넘기거나 직접 써도 된다.
|
|
348
|
+
* 셀러가 켜지 않은 조합이면 서버가 409 `PAYMENT_OPTION_UNAVAILABLE`로 거절한다.
|
|
349
|
+
*/
|
|
350
|
+
declare const paymentOptionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
351
|
+
pg: z.ZodEnum<{
|
|
352
|
+
tosspayments: "tosspayments";
|
|
353
|
+
portone: "portone";
|
|
354
|
+
}>;
|
|
355
|
+
method: z.ZodLiteral<"CARD">;
|
|
356
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
357
|
+
pg: z.ZodEnum<{
|
|
358
|
+
tosspayments: "tosspayments";
|
|
359
|
+
portone: "portone";
|
|
360
|
+
}>;
|
|
361
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
362
|
+
provider: z.ZodEnum<{
|
|
363
|
+
NAVERPAY: "NAVERPAY";
|
|
364
|
+
KAKAOPAY: "KAKAOPAY";
|
|
365
|
+
TOSSPAY: "TOSSPAY";
|
|
366
|
+
PAYCO: "PAYCO";
|
|
367
|
+
}>;
|
|
368
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
369
|
+
pg: z.ZodEnum<{
|
|
370
|
+
tosspayments: "tosspayments";
|
|
371
|
+
portone: "portone";
|
|
372
|
+
}>;
|
|
373
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
374
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
375
|
+
pg: z.ZodEnum<{
|
|
376
|
+
tosspayments: "tosspayments";
|
|
377
|
+
portone: "portone";
|
|
378
|
+
}>;
|
|
379
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
380
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
381
|
+
pg: z.ZodEnum<{
|
|
382
|
+
tosspayments: "tosspayments";
|
|
383
|
+
portone: "portone";
|
|
384
|
+
}>;
|
|
385
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
386
|
+
}, z.core.$strip>], "method">;
|
|
387
|
+
type PaymentOption = z.infer<typeof paymentOptionSchema>;
|
|
388
|
+
/** 주문서가 내려주는 결제 옵션 — 결제 옵션 + 표시 이름 */
|
|
389
|
+
declare const availablePaymentOptionSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
390
|
+
pg: z.ZodEnum<{
|
|
391
|
+
tosspayments: "tosspayments";
|
|
392
|
+
portone: "portone";
|
|
393
|
+
}>;
|
|
394
|
+
method: z.ZodLiteral<"CARD">;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
pg: z.ZodEnum<{
|
|
397
|
+
tosspayments: "tosspayments";
|
|
398
|
+
portone: "portone";
|
|
399
|
+
}>;
|
|
400
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
401
|
+
provider: z.ZodEnum<{
|
|
402
|
+
NAVERPAY: "NAVERPAY";
|
|
403
|
+
KAKAOPAY: "KAKAOPAY";
|
|
404
|
+
TOSSPAY: "TOSSPAY";
|
|
405
|
+
PAYCO: "PAYCO";
|
|
406
|
+
}>;
|
|
407
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
408
|
+
pg: z.ZodEnum<{
|
|
409
|
+
tosspayments: "tosspayments";
|
|
410
|
+
portone: "portone";
|
|
411
|
+
}>;
|
|
412
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
413
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
414
|
+
pg: z.ZodEnum<{
|
|
415
|
+
tosspayments: "tosspayments";
|
|
416
|
+
portone: "portone";
|
|
417
|
+
}>;
|
|
418
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
419
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
420
|
+
pg: z.ZodEnum<{
|
|
421
|
+
tosspayments: "tosspayments";
|
|
422
|
+
portone: "portone";
|
|
423
|
+
}>;
|
|
424
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
425
|
+
}, z.core.$strip>], "method">, z.ZodObject<{
|
|
426
|
+
label: z.ZodString;
|
|
427
|
+
pgName: z.ZodString;
|
|
428
|
+
}, z.core.$strip>>;
|
|
429
|
+
type AvailablePaymentOption = z.infer<typeof availablePaymentOptionSchema>;
|
|
430
|
+
/**
|
|
431
|
+
* 결제 옵션 목록 — 서버가 나중에 추가한 결제수단·PG를 이 SDK가 모르면 **그 항목만 빼고** 읽는다(목록 파싱은 깨지지 않는다).
|
|
432
|
+
*
|
|
433
|
+
* 모르는 항목을 버리는 일은 `preprocess`가 하고 항목 타입은 그대로 남는다 — OpenAPI 문서에 `items` 없는
|
|
434
|
+
* 배열로 나가지 않게 하기 위해서다(`z.array(z.unknown()).transform(...)`은 출력 타입을 표현하지 못한다).
|
|
435
|
+
*/
|
|
436
|
+
declare const paymentOptionListSchema: z.ZodPreprocess<z.ZodArray<z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
437
|
+
pg: z.ZodEnum<{
|
|
438
|
+
tosspayments: "tosspayments";
|
|
439
|
+
portone: "portone";
|
|
440
|
+
}>;
|
|
441
|
+
method: z.ZodLiteral<"CARD">;
|
|
442
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
443
|
+
pg: z.ZodEnum<{
|
|
444
|
+
tosspayments: "tosspayments";
|
|
445
|
+
portone: "portone";
|
|
446
|
+
}>;
|
|
447
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
448
|
+
provider: z.ZodEnum<{
|
|
449
|
+
NAVERPAY: "NAVERPAY";
|
|
450
|
+
KAKAOPAY: "KAKAOPAY";
|
|
451
|
+
TOSSPAY: "TOSSPAY";
|
|
452
|
+
PAYCO: "PAYCO";
|
|
453
|
+
}>;
|
|
454
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
455
|
+
pg: z.ZodEnum<{
|
|
456
|
+
tosspayments: "tosspayments";
|
|
457
|
+
portone: "portone";
|
|
458
|
+
}>;
|
|
459
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
460
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
461
|
+
pg: z.ZodEnum<{
|
|
462
|
+
tosspayments: "tosspayments";
|
|
463
|
+
portone: "portone";
|
|
464
|
+
}>;
|
|
465
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
466
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
467
|
+
pg: z.ZodEnum<{
|
|
468
|
+
tosspayments: "tosspayments";
|
|
469
|
+
portone: "portone";
|
|
470
|
+
}>;
|
|
471
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
472
|
+
}, z.core.$strip>], "method">, z.ZodObject<{
|
|
473
|
+
label: z.ZodString;
|
|
474
|
+
pgName: z.ZodString;
|
|
475
|
+
}, z.core.$strip>>>, unknown>;
|
|
476
|
+
/** 결제 옵션을 화면 키로 — 라디오 value·React key. 예: `tosspayments:CARD`, `portone:EASY_PAY:NAVERPAY` */
|
|
477
|
+
declare function paymentOptionKey(option: PaymentOption): string;
|
|
478
|
+
declare const shippingAddressInputSchema: z.ZodObject<{
|
|
479
|
+
addressId: z.ZodOptional<z.ZodString>;
|
|
480
|
+
receiverName: z.ZodString;
|
|
481
|
+
phone: z.ZodString;
|
|
482
|
+
zipCode: z.ZodString;
|
|
483
|
+
address1: z.ZodString;
|
|
484
|
+
address2: z.ZodOptional<z.ZodString>;
|
|
485
|
+
deliveryMemo: z.ZodOptional<z.ZodString>;
|
|
486
|
+
entranceCode: z.ZodOptional<z.ZodString>;
|
|
487
|
+
}, z.core.$strip>;
|
|
488
|
+
type ShippingAddressInput = z.infer<typeof shippingAddressInputSchema>;
|
|
489
|
+
declare const guestInfoSchema: z.ZodObject<{
|
|
490
|
+
name: z.ZodString;
|
|
491
|
+
phone: z.ZodString;
|
|
492
|
+
email: z.ZodEmail;
|
|
493
|
+
orderPassword: z.ZodString;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
type GuestInfo = z.infer<typeof guestInfoSchema>;
|
|
496
|
+
/**
|
|
497
|
+
* 결제 시작 — 배송지를 확정하고 고른 결제 옵션으로 결제 시도를 연다. 응답의 `payUrl`(결제 서비스)을 팝업(`mode=popup`)이나
|
|
498
|
+
* 전체 페이지로 열면 결제 서비스가 PG 결제창을 띄우고 승인까지 한다. 리다이렉트 결제가 끝나면 구매자는 `returnUrl`로 돌아온다.
|
|
499
|
+
* `returnUrl`의 도메인은 스토어 결제 도메인(콘솔 설정 › 결제)에 등록돼 있어야 한다(테스트 결제는 localhost 허용).
|
|
500
|
+
*/
|
|
501
|
+
declare const startPaymentRequestSchema: z.ZodObject<{
|
|
502
|
+
option: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
503
|
+
pg: z.ZodEnum<{
|
|
504
|
+
tosspayments: "tosspayments";
|
|
505
|
+
portone: "portone";
|
|
506
|
+
}>;
|
|
507
|
+
method: z.ZodLiteral<"CARD">;
|
|
508
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
509
|
+
pg: z.ZodEnum<{
|
|
510
|
+
tosspayments: "tosspayments";
|
|
511
|
+
portone: "portone";
|
|
512
|
+
}>;
|
|
513
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
514
|
+
provider: z.ZodEnum<{
|
|
515
|
+
NAVERPAY: "NAVERPAY";
|
|
516
|
+
KAKAOPAY: "KAKAOPAY";
|
|
517
|
+
TOSSPAY: "TOSSPAY";
|
|
518
|
+
PAYCO: "PAYCO";
|
|
519
|
+
}>;
|
|
520
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
521
|
+
pg: z.ZodEnum<{
|
|
522
|
+
tosspayments: "tosspayments";
|
|
523
|
+
portone: "portone";
|
|
524
|
+
}>;
|
|
525
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
526
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
527
|
+
pg: z.ZodEnum<{
|
|
528
|
+
tosspayments: "tosspayments";
|
|
529
|
+
portone: "portone";
|
|
530
|
+
}>;
|
|
531
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
532
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
533
|
+
pg: z.ZodEnum<{
|
|
534
|
+
tosspayments: "tosspayments";
|
|
535
|
+
portone: "portone";
|
|
536
|
+
}>;
|
|
537
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
538
|
+
}, z.core.$strip>], "method">;
|
|
539
|
+
returnUrl: z.ZodURL;
|
|
540
|
+
shippingAddress: z.ZodObject<{
|
|
541
|
+
addressId: z.ZodOptional<z.ZodString>;
|
|
542
|
+
receiverName: z.ZodString;
|
|
543
|
+
phone: z.ZodString;
|
|
544
|
+
zipCode: z.ZodString;
|
|
545
|
+
address1: z.ZodString;
|
|
546
|
+
address2: z.ZodOptional<z.ZodString>;
|
|
547
|
+
deliveryMemo: z.ZodOptional<z.ZodString>;
|
|
548
|
+
entranceCode: z.ZodOptional<z.ZodString>;
|
|
549
|
+
}, z.core.$strip>;
|
|
550
|
+
guest: z.ZodOptional<z.ZodObject<{
|
|
551
|
+
name: z.ZodString;
|
|
552
|
+
phone: z.ZodString;
|
|
553
|
+
email: z.ZodEmail;
|
|
554
|
+
orderPassword: z.ZodString;
|
|
555
|
+
}, z.core.$strip>>;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
type StartPaymentRequest = z.infer<typeof startPaymentRequestSchema>;
|
|
558
|
+
/** 같은 결제에서 다른 결제 옵션으로 다시 시도. `returnUrl`을 생략하면 결제 시작 때의 복귀 주소를 쓴다 */
|
|
559
|
+
declare const retryPaymentRequestSchema: z.ZodObject<{
|
|
560
|
+
option: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
561
|
+
pg: z.ZodEnum<{
|
|
562
|
+
tosspayments: "tosspayments";
|
|
563
|
+
portone: "portone";
|
|
564
|
+
}>;
|
|
565
|
+
method: z.ZodLiteral<"CARD">;
|
|
566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
567
|
+
pg: z.ZodEnum<{
|
|
568
|
+
tosspayments: "tosspayments";
|
|
569
|
+
portone: "portone";
|
|
570
|
+
}>;
|
|
571
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
572
|
+
provider: z.ZodEnum<{
|
|
573
|
+
NAVERPAY: "NAVERPAY";
|
|
574
|
+
KAKAOPAY: "KAKAOPAY";
|
|
575
|
+
TOSSPAY: "TOSSPAY";
|
|
576
|
+
PAYCO: "PAYCO";
|
|
577
|
+
}>;
|
|
578
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
579
|
+
pg: z.ZodEnum<{
|
|
580
|
+
tosspayments: "tosspayments";
|
|
581
|
+
portone: "portone";
|
|
582
|
+
}>;
|
|
583
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
584
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
585
|
+
pg: z.ZodEnum<{
|
|
586
|
+
tosspayments: "tosspayments";
|
|
587
|
+
portone: "portone";
|
|
588
|
+
}>;
|
|
589
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
590
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
591
|
+
pg: z.ZodEnum<{
|
|
592
|
+
tosspayments: "tosspayments";
|
|
593
|
+
portone: "portone";
|
|
594
|
+
}>;
|
|
595
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
596
|
+
}, z.core.$strip>], "method">;
|
|
597
|
+
returnUrl: z.ZodOptional<z.ZodURL>;
|
|
598
|
+
}, z.core.$strip>;
|
|
599
|
+
type RetryPaymentRequest = z.infer<typeof retryPaymentRequestSchema>;
|
|
600
|
+
declare const paymentStartSchema: z.ZodObject<{
|
|
601
|
+
paymentId: z.ZodString;
|
|
602
|
+
attemptId: z.ZodString;
|
|
603
|
+
option: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
604
|
+
pg: z.ZodEnum<{
|
|
605
|
+
tosspayments: "tosspayments";
|
|
606
|
+
portone: "portone";
|
|
607
|
+
}>;
|
|
608
|
+
method: z.ZodLiteral<"CARD">;
|
|
609
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
610
|
+
pg: z.ZodEnum<{
|
|
611
|
+
tosspayments: "tosspayments";
|
|
612
|
+
portone: "portone";
|
|
613
|
+
}>;
|
|
614
|
+
method: z.ZodLiteral<"EASY_PAY">;
|
|
615
|
+
provider: z.ZodEnum<{
|
|
616
|
+
NAVERPAY: "NAVERPAY";
|
|
617
|
+
KAKAOPAY: "KAKAOPAY";
|
|
618
|
+
TOSSPAY: "TOSSPAY";
|
|
619
|
+
PAYCO: "PAYCO";
|
|
620
|
+
}>;
|
|
621
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
622
|
+
pg: z.ZodEnum<{
|
|
623
|
+
tosspayments: "tosspayments";
|
|
624
|
+
portone: "portone";
|
|
625
|
+
}>;
|
|
626
|
+
method: z.ZodLiteral<"BANK_TRANSFER">;
|
|
627
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
628
|
+
pg: z.ZodEnum<{
|
|
629
|
+
tosspayments: "tosspayments";
|
|
630
|
+
portone: "portone";
|
|
631
|
+
}>;
|
|
632
|
+
method: z.ZodLiteral<"VIRTUAL_ACCOUNT">;
|
|
633
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
634
|
+
pg: z.ZodEnum<{
|
|
635
|
+
tosspayments: "tosspayments";
|
|
636
|
+
portone: "portone";
|
|
637
|
+
}>;
|
|
638
|
+
method: z.ZodLiteral<"MOBILE">;
|
|
639
|
+
}, z.core.$strip>], "method">;
|
|
640
|
+
payUrl: z.ZodString;
|
|
641
|
+
expiresAt: z.ZodString;
|
|
642
|
+
testPayment: z.ZodBoolean;
|
|
643
|
+
}, z.core.$strip>;
|
|
644
|
+
type PaymentStart = z.infer<typeof paymentStartSchema>;
|
|
645
|
+
/** 결제창에서 결제하지 못한 이유 */
|
|
646
|
+
declare const paymentFailureCategorySchema: z.ZodEnum<{
|
|
647
|
+
PREPARE_FAILURE: "PREPARE_FAILURE";
|
|
648
|
+
DECLINED: "DECLINED";
|
|
649
|
+
USER_CANCELED: "USER_CANCELED";
|
|
650
|
+
}>;
|
|
651
|
+
type PaymentFailureCategory = z.infer<typeof paymentFailureCategorySchema>;
|
|
652
|
+
/**
|
|
653
|
+
* 결제 상태 조회의 현재 상태 값 — 응답 스키마는 서버가 상태를 추가해도 파싱이 깨지지 않게 문자열로 받는다
|
|
654
|
+
* (`pgProvider`와 같은 방식). 화면 분기는 이 목록으로 하고 모르는 값은 확인 중으로 다룬다.
|
|
655
|
+
*/
|
|
656
|
+
declare const PAYMENT_STATUS_VALUES: readonly ["pending", "processing", "completed", "failed", "expired"];
|
|
657
|
+
type KnownPaymentStatus = (typeof PAYMENT_STATUS_VALUES)[number];
|
|
658
|
+
/** 결제 결과 구분 — 결제 서비스가 스토어프론트에 돌려주는 값과 같다 */
|
|
659
|
+
declare const PAYMENT_RESULT_VALUES: readonly ["COMPLETED", "PROCESSING", "CANCELED", "FAILED", "EXPIRED", "PENDING"];
|
|
660
|
+
type KnownPaymentResult = (typeof PAYMENT_RESULT_VALUES)[number];
|
|
661
|
+
declare const paymentStatusSchema: z.ZodObject<{
|
|
662
|
+
paymentId: z.ZodString;
|
|
663
|
+
status: z.ZodString;
|
|
664
|
+
result: z.ZodString;
|
|
665
|
+
orderId: z.ZodNullable<z.ZodString>;
|
|
666
|
+
lastFailure: z.ZodNullable<z.ZodObject<{
|
|
667
|
+
attemptId: z.ZodString;
|
|
668
|
+
category: z.ZodString;
|
|
669
|
+
code: z.ZodNullable<z.ZodString>;
|
|
670
|
+
message: z.ZodNullable<z.ZodString>;
|
|
671
|
+
}, z.core.$strip>>;
|
|
672
|
+
testPayment: z.ZodBoolean;
|
|
673
|
+
expiresAt: z.ZodString;
|
|
674
|
+
}, z.core.$strip>;
|
|
675
|
+
type PaymentStatus = z.infer<typeof paymentStatusSchema>;
|
|
676
|
+
/**
|
|
677
|
+
* 결제 서비스가 팝업 opener에 보내는 메시지 — `type`으로 거르고 결과의 원천은 결제 상태 조회다.
|
|
678
|
+
* 안내 문구는 싣지 않는다. 화면 문구는 상태 조회의 `lastFailure`를 쓴다
|
|
679
|
+
*/
|
|
680
|
+
declare const paymentMessageSchema: z.ZodObject<{
|
|
681
|
+
type: z.ZodLiteral<"sayren:payment">;
|
|
682
|
+
paymentId: z.ZodString;
|
|
683
|
+
result: z.ZodString;
|
|
684
|
+
orderId: z.ZodOptional<z.ZodString>;
|
|
685
|
+
}, z.core.$strip>;
|
|
686
|
+
type PaymentMessage = z.infer<typeof paymentMessageSchema>;
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/schemas/claim.d.ts
|
|
689
|
+
declare const claimTypeSchema: z.ZodEnum<{
|
|
690
|
+
CANCEL: "CANCEL";
|
|
691
|
+
RETURN: "RETURN";
|
|
692
|
+
EXCHANGE: "EXCHANGE";
|
|
693
|
+
}>;
|
|
694
|
+
type ClaimType = z.infer<typeof claimTypeSchema>;
|
|
695
|
+
declare const claimReasonSchema: z.ZodEnum<{
|
|
696
|
+
CHANGE_OF_MIND: "CHANGE_OF_MIND";
|
|
697
|
+
WRONG_ORDER: "WRONG_ORDER";
|
|
698
|
+
DEFECTIVE: "DEFECTIVE";
|
|
699
|
+
WRONG_DELIVERY: "WRONG_DELIVERY";
|
|
700
|
+
DIFFERENT_FROM_PAGE: "DIFFERENT_FROM_PAGE";
|
|
701
|
+
DELAY: "DELAY";
|
|
702
|
+
}>;
|
|
703
|
+
type ClaimReason = z.infer<typeof claimReasonSchema>;
|
|
704
|
+
declare const createClaimRequestSchema: z.ZodObject<{
|
|
705
|
+
type: z.ZodEnum<{
|
|
706
|
+
CANCEL: "CANCEL";
|
|
707
|
+
RETURN: "RETURN";
|
|
708
|
+
EXCHANGE: "EXCHANGE";
|
|
709
|
+
}>;
|
|
710
|
+
reason: z.ZodEnum<{
|
|
711
|
+
CHANGE_OF_MIND: "CHANGE_OF_MIND";
|
|
712
|
+
WRONG_ORDER: "WRONG_ORDER";
|
|
713
|
+
DEFECTIVE: "DEFECTIVE";
|
|
714
|
+
WRONG_DELIVERY: "WRONG_DELIVERY";
|
|
715
|
+
DIFFERENT_FROM_PAGE: "DIFFERENT_FROM_PAGE";
|
|
716
|
+
DELAY: "DELAY";
|
|
717
|
+
}>;
|
|
718
|
+
reasonDetail: z.ZodOptional<z.ZodString>;
|
|
719
|
+
evidenceImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
720
|
+
exchangeOptionId: z.ZodOptional<z.ZodString>;
|
|
721
|
+
}, z.core.$strip>;
|
|
722
|
+
type CreateClaimRequest = z.infer<typeof createClaimRequestSchema>;
|
|
723
|
+
declare const createClaimResultSchema: z.ZodObject<{
|
|
724
|
+
claimId: z.ZodString;
|
|
725
|
+
status: z.ZodLiteral<"REQUESTED">;
|
|
726
|
+
expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
727
|
+
claimDeliveryFee: z.ZodNumber;
|
|
728
|
+
}, z.core.$strip>;
|
|
729
|
+
type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
|
|
730
|
+
declare const myClaimSchema: z.ZodObject<{
|
|
731
|
+
claimId: z.ZodString;
|
|
732
|
+
type: z.ZodEnum<{
|
|
733
|
+
CANCEL: "CANCEL";
|
|
734
|
+
RETURN: "RETURN";
|
|
735
|
+
EXCHANGE: "EXCHANGE";
|
|
736
|
+
}>;
|
|
737
|
+
status: z.ZodEnum<{
|
|
738
|
+
COMPLETED: "COMPLETED";
|
|
739
|
+
REQUESTED: "REQUESTED";
|
|
740
|
+
HELD: "HELD";
|
|
741
|
+
COLLECTING: "COLLECTING";
|
|
742
|
+
COLLECTED: "COLLECTED";
|
|
743
|
+
REDELIVERING: "REDELIVERING";
|
|
744
|
+
APPROVED: "APPROVED";
|
|
745
|
+
REJECTED: "REJECTED";
|
|
746
|
+
WITHDRAWN: "WITHDRAWN";
|
|
747
|
+
}>;
|
|
748
|
+
orderItemId: z.ZodString;
|
|
749
|
+
productName: z.ZodString;
|
|
750
|
+
reason: z.ZodString;
|
|
751
|
+
expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
752
|
+
rejectReason: z.ZodNullable<z.ZodString>;
|
|
753
|
+
requestedAt: z.ZodString;
|
|
754
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
755
|
+
}, z.core.$strip>;
|
|
756
|
+
type MyClaim = z.infer<typeof myClaimSchema>;
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/schemas/customer-inquiry.d.ts
|
|
759
|
+
declare const customerInquiryCategorySchema: z.ZodEnum<{
|
|
760
|
+
RETURN: "RETURN";
|
|
761
|
+
EXCHANGE: "EXCHANGE";
|
|
762
|
+
DELIVERY: "DELIVERY";
|
|
763
|
+
PAYMENT: "PAYMENT";
|
|
764
|
+
ETC: "ETC";
|
|
765
|
+
}>;
|
|
766
|
+
type CustomerInquiryCategory = z.infer<typeof customerInquiryCategorySchema>;
|
|
767
|
+
/** 구매자 본인 뷰 — 마스킹 없이 본인 데이터, 셀러 답변(수정횟수 제외) */
|
|
768
|
+
declare const customerInquirySchema: z.ZodObject<{
|
|
769
|
+
inquiryId: z.ZodString;
|
|
770
|
+
category: z.ZodEnum<{
|
|
771
|
+
RETURN: "RETURN";
|
|
772
|
+
EXCHANGE: "EXCHANGE";
|
|
773
|
+
DELIVERY: "DELIVERY";
|
|
774
|
+
PAYMENT: "PAYMENT";
|
|
775
|
+
ETC: "ETC";
|
|
776
|
+
}>;
|
|
777
|
+
title: z.ZodString;
|
|
778
|
+
content: z.ZodString;
|
|
779
|
+
orderItemId: z.ZodNullable<z.ZodString>;
|
|
780
|
+
answered: z.ZodBoolean;
|
|
781
|
+
answer: z.ZodNullable<z.ZodObject<{
|
|
782
|
+
content: z.ZodString;
|
|
783
|
+
answeredAt: z.ZodString;
|
|
784
|
+
}, z.core.$strip>>;
|
|
785
|
+
createdAt: z.ZodString;
|
|
786
|
+
}, z.core.$strip>;
|
|
787
|
+
type CustomerInquiry = z.infer<typeof customerInquirySchema>;
|
|
788
|
+
declare const createCustomerInquiryRequestSchema: z.ZodObject<{
|
|
789
|
+
category: z.ZodEnum<{
|
|
790
|
+
RETURN: "RETURN";
|
|
791
|
+
EXCHANGE: "EXCHANGE";
|
|
792
|
+
DELIVERY: "DELIVERY";
|
|
793
|
+
PAYMENT: "PAYMENT";
|
|
794
|
+
ETC: "ETC";
|
|
795
|
+
}>;
|
|
796
|
+
title: z.ZodString;
|
|
797
|
+
content: z.ZodString;
|
|
798
|
+
orderItemId: z.ZodOptional<z.ZodString>;
|
|
799
|
+
}, z.core.$strip>;
|
|
800
|
+
type CreateCustomerInquiryRequest = z.infer<typeof createCustomerInquiryRequestSchema>;
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/schemas/inquiry.d.ts
|
|
803
|
+
declare const publicInquirySchema: z.ZodObject<{
|
|
804
|
+
inquiryId: z.ZodString;
|
|
805
|
+
content: z.ZodNullable<z.ZodString>;
|
|
806
|
+
secret: z.ZodBoolean;
|
|
807
|
+
mine: z.ZodBoolean;
|
|
808
|
+
writerMaskedName: z.ZodString;
|
|
809
|
+
answer: z.ZodNullable<z.ZodObject<{
|
|
810
|
+
content: z.ZodNullable<z.ZodString>;
|
|
811
|
+
answeredAt: z.ZodString;
|
|
812
|
+
}, z.core.$strip>>;
|
|
813
|
+
createdAt: z.ZodString;
|
|
814
|
+
}, z.core.$strip>;
|
|
815
|
+
type PublicInquiry = z.infer<typeof publicInquirySchema>;
|
|
816
|
+
declare const createInquiryRequestSchema: z.ZodObject<{
|
|
817
|
+
content: z.ZodString;
|
|
818
|
+
secret: z.ZodDefault<z.ZodBoolean>;
|
|
819
|
+
}, z.core.$strip>;
|
|
820
|
+
type CreateInquiryRequest = z.infer<typeof createInquiryRequestSchema>;
|
|
821
|
+
/** `POST /products/{productId}/inquiries` 응답 */
|
|
822
|
+
declare const createInquiryResultSchema: z.ZodObject<{
|
|
823
|
+
inquiryId: z.ZodString;
|
|
824
|
+
createdAt: z.ZodString;
|
|
825
|
+
}, z.core.$strip>;
|
|
826
|
+
type CreateInquiryResult = z.infer<typeof createInquiryResultSchema>;
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region src/schemas/member.d.ts
|
|
829
|
+
declare const memberSchema: z.ZodObject<{
|
|
830
|
+
memberId: z.ZodString;
|
|
831
|
+
email: z.ZodNullable<z.ZodEmail>;
|
|
832
|
+
name: z.ZodString;
|
|
833
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
834
|
+
point: z.ZodNumber;
|
|
835
|
+
marketingAgreed: z.ZodBoolean;
|
|
836
|
+
joinedAt: z.ZodString;
|
|
837
|
+
}, z.core.$strip>;
|
|
838
|
+
type Member = z.infer<typeof memberSchema>;
|
|
839
|
+
declare const updateProfileRequestSchema: z.ZodObject<{
|
|
840
|
+
name: z.ZodOptional<z.ZodString>;
|
|
841
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
842
|
+
marketingAgreed: z.ZodOptional<z.ZodBoolean>;
|
|
843
|
+
}, z.core.$strip>;
|
|
844
|
+
type UpdateProfileRequest = z.infer<typeof updateProfileRequestSchema>;
|
|
845
|
+
declare const memberAddressSchema: z.ZodObject<{
|
|
846
|
+
addressId: z.ZodString;
|
|
847
|
+
alias: z.ZodString;
|
|
848
|
+
isDefault: z.ZodBoolean;
|
|
849
|
+
receiverName: z.ZodString;
|
|
850
|
+
phone: z.ZodString;
|
|
851
|
+
zipCode: z.ZodString;
|
|
852
|
+
address1: z.ZodString;
|
|
853
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
854
|
+
}, z.core.$strip>;
|
|
855
|
+
type MemberAddress = z.infer<typeof memberAddressSchema>;
|
|
856
|
+
declare const memberAddressRequestSchema: z.ZodObject<{
|
|
857
|
+
alias: z.ZodString;
|
|
858
|
+
receiverName: z.ZodString;
|
|
859
|
+
phone: z.ZodString;
|
|
860
|
+
zipCode: z.ZodString;
|
|
861
|
+
address1: z.ZodString;
|
|
862
|
+
address2: z.ZodOptional<z.ZodString>;
|
|
863
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
864
|
+
}, z.core.$strip>;
|
|
865
|
+
type MemberAddressRequest = z.infer<typeof memberAddressRequestSchema>;
|
|
866
|
+
/** `POST /me/wishlist` 응답 — 이미 찜한 상품이어도 같은 응답이다 */
|
|
867
|
+
declare const wishlistAddResultSchema: z.ZodObject<{
|
|
868
|
+
productId: z.ZodString;
|
|
869
|
+
wished: z.ZodLiteral<true>;
|
|
870
|
+
}, z.core.$strip>;
|
|
871
|
+
type WishlistAddResult = z.infer<typeof wishlistAddResultSchema>;
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/schemas/review.d.ts
|
|
874
|
+
declare const publicReviewSchema: z.ZodObject<{
|
|
875
|
+
reviewId: z.ZodString;
|
|
876
|
+
rating: z.ZodNumber;
|
|
877
|
+
content: z.ZodString;
|
|
878
|
+
images: z.ZodArray<z.ZodURL>;
|
|
879
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
880
|
+
writerMaskedName: z.ZodString;
|
|
881
|
+
sellerReply: z.ZodNullable<z.ZodObject<{
|
|
882
|
+
content: z.ZodString;
|
|
883
|
+
repliedAt: z.ZodString;
|
|
884
|
+
}, z.core.$strip>>;
|
|
885
|
+
createdAt: z.ZodString;
|
|
886
|
+
}, z.core.$strip>;
|
|
887
|
+
type PublicReview = z.infer<typeof publicReviewSchema>;
|
|
888
|
+
declare const reviewSummarySchema: z.ZodObject<{
|
|
889
|
+
averageRating: z.ZodNumber;
|
|
890
|
+
totalCount: z.ZodNumber;
|
|
891
|
+
distribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
892
|
+
}, z.core.$strip>;
|
|
893
|
+
type ReviewSummary = z.infer<typeof reviewSummarySchema>;
|
|
894
|
+
declare const writableReviewSchema: z.ZodObject<{
|
|
895
|
+
orderItemId: z.ZodString;
|
|
896
|
+
productId: z.ZodString;
|
|
897
|
+
productName: z.ZodString;
|
|
898
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
899
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
900
|
+
writableUntil: z.ZodString;
|
|
901
|
+
}, z.core.$strip>;
|
|
902
|
+
type WritableReview = z.infer<typeof writableReviewSchema>;
|
|
903
|
+
declare const createReviewRequestSchema: z.ZodObject<{
|
|
904
|
+
rating: z.ZodNumber;
|
|
905
|
+
content: z.ZodString;
|
|
906
|
+
images: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
907
|
+
}, z.core.$strip>;
|
|
908
|
+
type CreateReviewRequest = z.infer<typeof createReviewRequestSchema>;
|
|
909
|
+
declare const createReviewResultSchema: z.ZodObject<{
|
|
910
|
+
reviewId: z.ZodString;
|
|
911
|
+
rewardPoint: z.ZodNumber;
|
|
912
|
+
}, z.core.$strip>;
|
|
913
|
+
type CreateReviewResult = z.infer<typeof createReviewResultSchema>;
|
|
914
|
+
declare const updateReviewRequestSchema: z.ZodObject<{
|
|
915
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
916
|
+
content: z.ZodOptional<z.ZodString>;
|
|
917
|
+
images: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
918
|
+
}, z.core.$strip>;
|
|
919
|
+
type UpdateReviewRequest = z.infer<typeof updateReviewRequestSchema>;
|
|
920
|
+
/** `GET /products/{productId}/reviews` 응답 — 리뷰 페이지와 평점 분포 */
|
|
921
|
+
declare const reviewPageSchema: z.ZodObject<{
|
|
922
|
+
page: z.ZodNumber;
|
|
923
|
+
size: z.ZodNumber;
|
|
924
|
+
totalElements: z.ZodNumber;
|
|
925
|
+
totalPages: z.ZodNumber;
|
|
926
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
927
|
+
reviewId: z.ZodString;
|
|
928
|
+
rating: z.ZodNumber;
|
|
929
|
+
content: z.ZodString;
|
|
930
|
+
images: z.ZodArray<z.ZodURL>;
|
|
931
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
932
|
+
writerMaskedName: z.ZodString;
|
|
933
|
+
sellerReply: z.ZodNullable<z.ZodObject<{
|
|
934
|
+
content: z.ZodString;
|
|
935
|
+
repliedAt: z.ZodString;
|
|
936
|
+
}, z.core.$strip>>;
|
|
937
|
+
createdAt: z.ZodString;
|
|
938
|
+
}, z.core.$strip>>;
|
|
939
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
averageRating: z.ZodNumber;
|
|
941
|
+
totalCount: z.ZodNumber;
|
|
942
|
+
distribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
943
|
+
}, z.core.$strip>>;
|
|
944
|
+
}, z.core.$strip>;
|
|
945
|
+
type ReviewPage = z.infer<typeof reviewPageSchema>;
|
|
946
|
+
/** `PUT /me/reviews/{reviewId}` 응답 */
|
|
947
|
+
declare const updateReviewResultSchema: z.ZodObject<{
|
|
948
|
+
reviewId: z.ZodString;
|
|
949
|
+
updatedAt: z.ZodString;
|
|
950
|
+
}, z.core.$strip>;
|
|
951
|
+
type UpdateReviewResult = z.infer<typeof updateReviewResultSchema>;
|
|
952
|
+
//#endregion
|
|
953
|
+
//#region src/session.d.ts
|
|
954
|
+
/**
|
|
955
|
+
* SDK 세션 매니저 — 스토어프론트(회원, member) CREDENTIAL 로그인(email/password)의
|
|
956
|
+
* 저장·무음 갱신·회전을 캡슐화한다. store-sdk의 세션과 동형이지만 진입 메서드는
|
|
957
|
+
* `.login()`이다 (구매자는 oauth2 authorize 플로우를 타지 않는다 — `/auth/login` → tokenPair).
|
|
958
|
+
*
|
|
959
|
+
* 저장 매체(쿠키/localStorage/…)와 그 속성은 **어댑터(앱) 책임**이다. SDK는 "무엇을 어떤 키로
|
|
960
|
+
* 저장할지"만 알고, "어떻게 저장할지"는 SessionStorage 어댑터에 위임한다.
|
|
961
|
+
*/
|
|
962
|
+
interface SessionStorage {
|
|
963
|
+
get(key: string): string | null;
|
|
964
|
+
set(key: string, value: string): void;
|
|
965
|
+
remove(key: string): void;
|
|
966
|
+
}
|
|
967
|
+
/** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
|
|
968
|
+
declare const STOREFRONT_SESSION_KEYS: {
|
|
969
|
+
readonly accessToken: "sayren.storefront.accessToken";
|
|
970
|
+
readonly refreshToken: "sayren.storefront.refreshToken";
|
|
971
|
+
};
|
|
972
|
+
interface StorefrontSessionOptions {
|
|
973
|
+
/** 예: https://shop.api.example.com/storefront/v1 */
|
|
974
|
+
baseUrl: string;
|
|
975
|
+
/** 테넌트 스토어 코드 — X-Store-Code 헤더로 전송한다 */
|
|
976
|
+
storeCode?: string;
|
|
977
|
+
/** 저장 매체 어댑터 (앱 소유) */
|
|
978
|
+
storage: SessionStorage;
|
|
979
|
+
fetch?: typeof globalThis.fetch;
|
|
980
|
+
}
|
|
981
|
+
interface StorefrontSession {
|
|
982
|
+
/** POST /auth/login — 성공 시 accessToken/refreshToken 저장 + 구독자 통지 */
|
|
983
|
+
login(body: LoginRequest): Promise<void>;
|
|
984
|
+
/** POST /auth/signup — login과 동일하게 tokenPair를 저장한다 */
|
|
985
|
+
signup(body: SignupRequest): Promise<void>;
|
|
986
|
+
/**
|
|
987
|
+
* 무음 세션 갱신 — refreshToken으로 새 tokenPair를 받아 회전 저장한다.
|
|
988
|
+
* - 탭 내부: 동시 다발 호출을 single-flight로 합친다.
|
|
989
|
+
* - 탭 간: navigator.locks(있으면)로 회전을 직렬화하고, 락 진입 시 다른 탭이 이미
|
|
990
|
+
* 회전했으면(accessToken 변경) 내 refreshToken을 소비하지 않고 true를 반환한다.
|
|
991
|
+
* refreshToken이 없거나 실패(만료·재사용 폐기)하면 세션을 clear하고 false.
|
|
992
|
+
*/
|
|
993
|
+
refresh(): Promise<boolean>;
|
|
994
|
+
/** 현재 accessToken (없으면 null) */
|
|
995
|
+
readonly accessToken: string | null;
|
|
996
|
+
/** 현재 refreshToken (없으면 null) */
|
|
997
|
+
readonly refreshToken: string | null;
|
|
998
|
+
/** GET /me — 토큰이 없으면 null, 있으면 Member */
|
|
999
|
+
userinfo(): Promise<Member | null>;
|
|
1000
|
+
/** 세션 키를 지우고 best-effort로 /auth/logout을 호출한 뒤 구독자에게 통지한다 */
|
|
1001
|
+
clear(): void;
|
|
1002
|
+
/** 변경 구독(useSyncExternalStore 소비용) — 해지 함수 반환 */
|
|
1003
|
+
subscribe(cb: () => void): () => void;
|
|
1004
|
+
}
|
|
1005
|
+
declare function createStorefrontSession(options: StorefrontSessionOptions): StorefrontSession;
|
|
1006
|
+
//#endregion
|
|
1007
|
+
//#region src/client.d.ts
|
|
1008
|
+
interface StorefrontClientOptions {
|
|
1009
|
+
/** 예: https://demo.store.example.com/api/v1 */
|
|
1010
|
+
baseUrl: string;
|
|
1011
|
+
/**
|
|
1012
|
+
* 테넌트 스토어 코드 — `X-Store-Code` 헤더로 전송한다. 공유 API 호스트로 접근할 때
|
|
1013
|
+
* 서버가 Host 서브도메인을 추측하는 대신 명시적으로 테넌트를 지정한다(멀티테넌트 격리).
|
|
1014
|
+
* 함수로 전달하면 매 요청마다 재평가.
|
|
1015
|
+
*/
|
|
1016
|
+
storeCode?: TokenSource;
|
|
1017
|
+
/** 회원 Access Token. 함수로 전달하면 매 요청마다 재평가 */
|
|
1018
|
+
accessToken?: TokenSource;
|
|
1019
|
+
/**
|
|
1020
|
+
* accessToken의 별칭 옵션 — `{ auth: { accessToken } }` 형태로 전달할 수 있다.
|
|
1021
|
+
* 우선순위: 명시적 `accessToken` 옵션 > `auth.accessToken` > `session.accessToken`.
|
|
1022
|
+
*/
|
|
1023
|
+
auth?: {
|
|
1024
|
+
accessToken?: string;
|
|
1025
|
+
};
|
|
1026
|
+
/** 비회원 장바구니 토큰 */
|
|
1027
|
+
cartToken?: TokenSource;
|
|
1028
|
+
/**
|
|
1029
|
+
* 방문 분석 식별자 — 방문자·세션 ID(`sy_vid`·`sy_sid` 쿠키 값). 실으면 서버가 장바구니 담기·결제 시작·구매를
|
|
1030
|
+
* 이 방문과 이어 기록한다. 브라우저는 `@sayren/storefront-sdk/analytics`의 `analytics.ids()`, SSR은
|
|
1031
|
+
* `analyticsIdsFromCookie(request.headers.get("cookie"))`로 얻는다. 함수로 전달하면 매 요청마다 재평가.
|
|
1032
|
+
*/
|
|
1033
|
+
visitorId?: TokenSource;
|
|
1034
|
+
sessionId?: TokenSource;
|
|
1035
|
+
/** 서버가 새 X-Cart-Token을 발급했을 때 호출 */
|
|
1036
|
+
onCartToken?: (token: string) => void;
|
|
1037
|
+
/**
|
|
1038
|
+
* SDK 세션 매니저 — 전달하면 accessToken(Bearer)·401 refresh·복구불가 시 clear를
|
|
1039
|
+
* 자동 배선한다. `accessToken`/`auth.accessToken`을 명시하면 그쪽이 우선한다(하위호환).
|
|
1040
|
+
*/
|
|
1041
|
+
session?: StorefrontSession;
|
|
1042
|
+
fetch?: typeof globalThis.fetch;
|
|
1043
|
+
}
|
|
1044
|
+
declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
1045
|
+
/** 현재 세션 accessToken (session 미전달 시 null) */
|
|
1046
|
+
readonly accessToken: string | null;
|
|
1047
|
+
/** 현재 세션 refreshToken (session 미전달 시 null) */
|
|
1048
|
+
readonly refreshToken: string | null;
|
|
1049
|
+
/** session.userinfo() 위임 — session 미전달 시 에러 */
|
|
1050
|
+
userinfo(): Promise<{
|
|
1051
|
+
memberId: string;
|
|
1052
|
+
email: string | null;
|
|
1053
|
+
name: string;
|
|
1054
|
+
phone: string | null;
|
|
1055
|
+
point: number;
|
|
1056
|
+
marketingAgreed: boolean;
|
|
1057
|
+
joinedAt: string;
|
|
1058
|
+
} | null>;
|
|
1059
|
+
auth: {
|
|
1060
|
+
/** 비회원 익명 세션 발급 — 응답의 cartToken을 `cartToken` 옵션(X-Cart-Token)으로 쓴다 */
|
|
1061
|
+
anonymous: () => Promise<{
|
|
1062
|
+
cartToken: string;
|
|
1063
|
+
expiresAt: string;
|
|
1064
|
+
}>;
|
|
1065
|
+
signup: (body: SignupRequest) => Promise<{
|
|
1066
|
+
accessToken: string;
|
|
1067
|
+
refreshToken: string;
|
|
1068
|
+
expiresIn: number;
|
|
1069
|
+
}>;
|
|
1070
|
+
login: (body: LoginRequest) => Promise<{
|
|
1071
|
+
accessToken: string;
|
|
1072
|
+
refreshToken: string;
|
|
1073
|
+
expiresIn: number;
|
|
1074
|
+
}>;
|
|
1075
|
+
refresh: (refreshToken: string) => Promise<{
|
|
1076
|
+
accessToken: string;
|
|
1077
|
+
refreshToken: string;
|
|
1078
|
+
expiresIn: number;
|
|
1079
|
+
}>;
|
|
1080
|
+
logout: () => Promise<void>;
|
|
1081
|
+
/** 소셜 로그인 시작 — 공급자 로그인 주소를 받는다. PKCE·state는 `@sayren/storefront-sdk/auth`의 `idp()`가 만든다 */
|
|
1082
|
+
idpAuthorize: (provider: SocialProvider, body: IdpAuthorizeRequest) => Promise<{
|
|
1083
|
+
url: string;
|
|
1084
|
+
}>;
|
|
1085
|
+
/** 소셜 로그인 마무리 — 돌아온 1회용 code + codeVerifier를 구매자 토큰으로 바꾼다 */
|
|
1086
|
+
idpToken: (body: IdpTokenRequest) => Promise<{
|
|
1087
|
+
accessToken: string;
|
|
1088
|
+
refreshToken: string;
|
|
1089
|
+
expiresIn: number;
|
|
1090
|
+
}>;
|
|
1091
|
+
/** 구매자 탈퇴 — 로그인 상태(accessToken)에서 비밀번호로 본인 확인. 성공하면 토큰은 모두 무효 */
|
|
1092
|
+
withdraw: (body: WithdrawRequest) => Promise<void>;
|
|
1093
|
+
/** 로그인 수단 — 비밀번호 여부와 연결된 소셜 계정(로그인 필요) */
|
|
1094
|
+
identities: () => Promise<{
|
|
1095
|
+
hasPassword: boolean;
|
|
1096
|
+
hasExternalAuth: boolean;
|
|
1097
|
+
identities: {
|
|
1098
|
+
provider: "kakao" | "naver" | "google";
|
|
1099
|
+
email: string | null;
|
|
1100
|
+
linkedAt: string;
|
|
1101
|
+
}[];
|
|
1102
|
+
}>;
|
|
1103
|
+
/** 소셜 계정 연결 시작(로그인 필요) — 공급자 로그인 주소를 받는다. 본문은 `idpAuthorize`와 같다 */
|
|
1104
|
+
linkIdentityAuthorize: (provider: SocialProvider, body: IdpAuthorizeRequest) => Promise<{
|
|
1105
|
+
url: string;
|
|
1106
|
+
}>;
|
|
1107
|
+
/** 소셜 계정 연결 마무리 — 돌아온 code + codeVerifier로 이 구매자에 연결한다 */
|
|
1108
|
+
linkIdentity: (provider: SocialProvider, body: LinkIdentityRequest) => Promise<{
|
|
1109
|
+
hasPassword: boolean;
|
|
1110
|
+
hasExternalAuth: boolean;
|
|
1111
|
+
identities: {
|
|
1112
|
+
provider: "kakao" | "naver" | "google";
|
|
1113
|
+
email: string | null;
|
|
1114
|
+
linkedAt: string;
|
|
1115
|
+
}[];
|
|
1116
|
+
}>;
|
|
1117
|
+
/** 소셜 계정 연결 해제 — 마지막 로그인 수단이면 409 `LAST_LOGIN_METHOD` */
|
|
1118
|
+
unlinkIdentity: (provider: SocialProvider) => Promise<{
|
|
1119
|
+
hasPassword: boolean;
|
|
1120
|
+
hasExternalAuth: boolean;
|
|
1121
|
+
identities: {
|
|
1122
|
+
provider: "kakao" | "naver" | "google";
|
|
1123
|
+
email: string | null;
|
|
1124
|
+
linkedAt: string;
|
|
1125
|
+
}[];
|
|
1126
|
+
}>;
|
|
1127
|
+
};
|
|
1128
|
+
store: {
|
|
1129
|
+
/** 스토어 공개 설정 — 이름·고객센터·비회원 주문 허용 여부 */
|
|
1130
|
+
get: () => Promise<{
|
|
1131
|
+
storeCode: string;
|
|
1132
|
+
name: string;
|
|
1133
|
+
logoUrl: string | null;
|
|
1134
|
+
customerCenterPhone: string | null;
|
|
1135
|
+
businessHours: string | null;
|
|
1136
|
+
guestCheckout: boolean;
|
|
1137
|
+
loginMethods: ("password" | "kakao" | "naver" | "google")[];
|
|
1138
|
+
}>;
|
|
1139
|
+
};
|
|
1140
|
+
catalog: {
|
|
1141
|
+
listCategories: () => Promise<CategoryNode[]>;
|
|
1142
|
+
searchProducts: (params?: ProductSearchParams) => Promise<{
|
|
1143
|
+
page: number;
|
|
1144
|
+
size: number;
|
|
1145
|
+
totalElements: number;
|
|
1146
|
+
totalPages: number;
|
|
1147
|
+
contents: {
|
|
1148
|
+
productId: string;
|
|
1149
|
+
name: string;
|
|
1150
|
+
thumbnailUrl: string | null;
|
|
1151
|
+
salePrice: number;
|
|
1152
|
+
discountedPrice: number | null;
|
|
1153
|
+
discountRate: number | null;
|
|
1154
|
+
freeShipping: boolean;
|
|
1155
|
+
averageRating: number;
|
|
1156
|
+
reviewCount: number;
|
|
1157
|
+
soldOut: boolean;
|
|
1158
|
+
}[];
|
|
1159
|
+
facets?: {
|
|
1160
|
+
categories?: {
|
|
1161
|
+
categoryId: string;
|
|
1162
|
+
name: string;
|
|
1163
|
+
count: number;
|
|
1164
|
+
}[] | undefined;
|
|
1165
|
+
priceRange?: {
|
|
1166
|
+
min: number;
|
|
1167
|
+
max: number;
|
|
1168
|
+
} | undefined;
|
|
1169
|
+
} | undefined;
|
|
1170
|
+
}>;
|
|
1171
|
+
getProduct: (productId: string) => Promise<{
|
|
1172
|
+
productId: string;
|
|
1173
|
+
name: string;
|
|
1174
|
+
thumbnailUrl: string | null;
|
|
1175
|
+
salePrice: number;
|
|
1176
|
+
discountedPrice: number | null;
|
|
1177
|
+
discountRate: number | null;
|
|
1178
|
+
freeShipping: boolean;
|
|
1179
|
+
averageRating: number;
|
|
1180
|
+
reviewCount: number;
|
|
1181
|
+
soldOut: boolean;
|
|
1182
|
+
description: string;
|
|
1183
|
+
images: string[];
|
|
1184
|
+
optionGroups: {
|
|
1185
|
+
groupId: string;
|
|
1186
|
+
name: string;
|
|
1187
|
+
values: {
|
|
1188
|
+
valueId: string;
|
|
1189
|
+
name: string;
|
|
1190
|
+
}[];
|
|
1191
|
+
}[];
|
|
1192
|
+
variants: {
|
|
1193
|
+
variantId: string;
|
|
1194
|
+
valueIds: string[];
|
|
1195
|
+
name: string;
|
|
1196
|
+
additionalPrice: number;
|
|
1197
|
+
soldOut: boolean;
|
|
1198
|
+
}[];
|
|
1199
|
+
delivery: {
|
|
1200
|
+
type: "PAID" | "FREE" | "CONDITIONAL_FREE";
|
|
1201
|
+
fee: number;
|
|
1202
|
+
conditionalFreeAmount: number | null;
|
|
1203
|
+
estimatedDays: string;
|
|
1204
|
+
};
|
|
1205
|
+
returnPolicy: {
|
|
1206
|
+
returnFee: number;
|
|
1207
|
+
exchangeFee: number;
|
|
1208
|
+
periodDays: number;
|
|
1209
|
+
};
|
|
1210
|
+
categoryPath: {
|
|
1211
|
+
categoryId: string;
|
|
1212
|
+
name: string;
|
|
1213
|
+
}[];
|
|
1214
|
+
}>;
|
|
1215
|
+
listProductReviews: (productId: string, params?: PageParams & {
|
|
1216
|
+
rating?: number;
|
|
1217
|
+
hasImage?: boolean;
|
|
1218
|
+
sort?: "latest" | "ratingDesc" | "ratingAsc" | "helpful";
|
|
1219
|
+
}) => Promise<{
|
|
1220
|
+
page: number;
|
|
1221
|
+
size: number;
|
|
1222
|
+
totalElements: number;
|
|
1223
|
+
totalPages: number;
|
|
1224
|
+
contents: {
|
|
1225
|
+
reviewId: string;
|
|
1226
|
+
rating: number;
|
|
1227
|
+
content: string;
|
|
1228
|
+
images: string[];
|
|
1229
|
+
optionName: string | null;
|
|
1230
|
+
writerMaskedName: string;
|
|
1231
|
+
sellerReply: {
|
|
1232
|
+
content: string;
|
|
1233
|
+
repliedAt: string;
|
|
1234
|
+
} | null;
|
|
1235
|
+
createdAt: string;
|
|
1236
|
+
}[];
|
|
1237
|
+
summary?: {
|
|
1238
|
+
averageRating: number;
|
|
1239
|
+
totalCount: number;
|
|
1240
|
+
distribution: Record<string, number>;
|
|
1241
|
+
} | undefined;
|
|
1242
|
+
}>;
|
|
1243
|
+
listProductInquiries: (productId: string, params?: PageParams) => Promise<{
|
|
1244
|
+
page: number;
|
|
1245
|
+
size: number;
|
|
1246
|
+
totalElements: number;
|
|
1247
|
+
totalPages: number;
|
|
1248
|
+
contents: {
|
|
1249
|
+
inquiryId: string;
|
|
1250
|
+
content: string | null;
|
|
1251
|
+
secret: boolean;
|
|
1252
|
+
mine: boolean;
|
|
1253
|
+
writerMaskedName: string;
|
|
1254
|
+
answer: {
|
|
1255
|
+
content: string | null;
|
|
1256
|
+
answeredAt: string;
|
|
1257
|
+
} | null;
|
|
1258
|
+
createdAt: string;
|
|
1259
|
+
}[];
|
|
1260
|
+
}>;
|
|
1261
|
+
createInquiry: (productId: string, body: CreateInquiryRequest) => Promise<void>;
|
|
1262
|
+
};
|
|
1263
|
+
cart: {
|
|
1264
|
+
get: () => Promise<{
|
|
1265
|
+
items: {
|
|
1266
|
+
cartItemId: string;
|
|
1267
|
+
productId: string;
|
|
1268
|
+
productName: string;
|
|
1269
|
+
thumbnailUrl: string | null;
|
|
1270
|
+
optionId: string | null;
|
|
1271
|
+
optionName: string | null;
|
|
1272
|
+
quantity: number;
|
|
1273
|
+
unitPrice: number;
|
|
1274
|
+
totalPrice: number;
|
|
1275
|
+
purchasable: boolean;
|
|
1276
|
+
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
1277
|
+
}[];
|
|
1278
|
+
summary: {
|
|
1279
|
+
productAmount: number;
|
|
1280
|
+
deliveryFee: number;
|
|
1281
|
+
totalAmount: number;
|
|
1282
|
+
};
|
|
1283
|
+
}>;
|
|
1284
|
+
addItem: (body: AddCartItemRequest) => Promise<{
|
|
1285
|
+
items: {
|
|
1286
|
+
cartItemId: string;
|
|
1287
|
+
productId: string;
|
|
1288
|
+
productName: string;
|
|
1289
|
+
thumbnailUrl: string | null;
|
|
1290
|
+
optionId: string | null;
|
|
1291
|
+
optionName: string | null;
|
|
1292
|
+
quantity: number;
|
|
1293
|
+
unitPrice: number;
|
|
1294
|
+
totalPrice: number;
|
|
1295
|
+
purchasable: boolean;
|
|
1296
|
+
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
1297
|
+
}[];
|
|
1298
|
+
summary: {
|
|
1299
|
+
productAmount: number;
|
|
1300
|
+
deliveryFee: number;
|
|
1301
|
+
totalAmount: number;
|
|
1302
|
+
};
|
|
1303
|
+
}>;
|
|
1304
|
+
updateItem: (cartItemId: string, body: UpdateCartItemRequest) => Promise<{
|
|
1305
|
+
items: {
|
|
1306
|
+
cartItemId: string;
|
|
1307
|
+
productId: string;
|
|
1308
|
+
productName: string;
|
|
1309
|
+
thumbnailUrl: string | null;
|
|
1310
|
+
optionId: string | null;
|
|
1311
|
+
optionName: string | null;
|
|
1312
|
+
quantity: number;
|
|
1313
|
+
unitPrice: number;
|
|
1314
|
+
totalPrice: number;
|
|
1315
|
+
purchasable: boolean;
|
|
1316
|
+
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
1317
|
+
}[];
|
|
1318
|
+
summary: {
|
|
1319
|
+
productAmount: number;
|
|
1320
|
+
deliveryFee: number;
|
|
1321
|
+
totalAmount: number;
|
|
1322
|
+
};
|
|
1323
|
+
}>;
|
|
1324
|
+
removeItem: (cartItemId: string) => Promise<void>;
|
|
1325
|
+
};
|
|
1326
|
+
checkout: {
|
|
1327
|
+
create: (body: CreateCheckoutRequest) => Promise<{
|
|
1328
|
+
checkoutId: string;
|
|
1329
|
+
items: {
|
|
1330
|
+
productId: string;
|
|
1331
|
+
productName: string;
|
|
1332
|
+
optionId: string | null;
|
|
1333
|
+
optionName: string | null;
|
|
1334
|
+
quantity: number;
|
|
1335
|
+
unitPrice: number;
|
|
1336
|
+
totalPrice: number;
|
|
1337
|
+
}[];
|
|
1338
|
+
amounts: {
|
|
1339
|
+
productAmount: number;
|
|
1340
|
+
deliveryFee: number;
|
|
1341
|
+
totalAmount: number;
|
|
1342
|
+
};
|
|
1343
|
+
expiresAt: string;
|
|
1344
|
+
paymentOptions: (({
|
|
1345
|
+
pg: "tosspayments" | "portone";
|
|
1346
|
+
method: "CARD";
|
|
1347
|
+
} | {
|
|
1348
|
+
pg: "tosspayments" | "portone";
|
|
1349
|
+
method: "EASY_PAY";
|
|
1350
|
+
provider: "NAVERPAY" | "KAKAOPAY" | "TOSSPAY" | "PAYCO";
|
|
1351
|
+
} | {
|
|
1352
|
+
pg: "tosspayments" | "portone";
|
|
1353
|
+
method: "BANK_TRANSFER";
|
|
1354
|
+
} | {
|
|
1355
|
+
pg: "tosspayments" | "portone";
|
|
1356
|
+
method: "VIRTUAL_ACCOUNT";
|
|
1357
|
+
} | {
|
|
1358
|
+
pg: "tosspayments" | "portone";
|
|
1359
|
+
method: "MOBILE";
|
|
1360
|
+
}) & {
|
|
1361
|
+
label: string;
|
|
1362
|
+
pgName: string;
|
|
1363
|
+
})[];
|
|
1364
|
+
testPayment: boolean;
|
|
1365
|
+
}>;
|
|
1366
|
+
/**
|
|
1367
|
+
* `POST /checkout/{checkoutId}/payment` — 결제 시작. 배송지와 결제 옵션(`paymentOptions` 항목 또는 직접 쓴 옵션)으로
|
|
1368
|
+
* 결제 세션·첫 시도를 만들고 결제 서비스 주소(`payUrl`)를 돌려준다. 그 주소를 열어 결제를 진행하는 것은
|
|
1369
|
+
* `@sayren/storefront-sdk/payments`의 `createPayments().start()`다 — 이 메서드는 값만 받는다.
|
|
1370
|
+
*
|
|
1371
|
+
* 에러(`ApiError.code`):
|
|
1372
|
+
* - 409 `PAYMENT_OPTION_UNAVAILABLE`: 이 스토어에서 쓸 수 없는 옵션. `details.paymentOptions`에 지금 목록
|
|
1373
|
+
* - 409 `PAYMENT_NOT_CONFIGURED`: 사용 중인 PG가 없다
|
|
1374
|
+
* - 400 `RETURN_URL_NOT_ALLOWED`: `returnUrl`이 https가 아니거나(테스트 결제의 localhost는 예외),
|
|
1375
|
+
* 스토어가 결제 도메인을 등록했는데 그 안이 아니다. 등록하지 않았으면 https 주소는 모두 받는다
|
|
1376
|
+
* - 503 `PAYMENT_PROVIDER_UNAVAILABLE`: 고른 PG의 결제창을 준비하지 못했다(다른 옵션으로 다시 시도)
|
|
1377
|
+
*/
|
|
1378
|
+
startPayment: (checkoutId: string, body: StartPaymentRequest) => Promise<{
|
|
1379
|
+
paymentId: string;
|
|
1380
|
+
attemptId: string;
|
|
1381
|
+
option: {
|
|
1382
|
+
pg: "tosspayments" | "portone";
|
|
1383
|
+
method: "CARD";
|
|
1384
|
+
} | {
|
|
1385
|
+
pg: "tosspayments" | "portone";
|
|
1386
|
+
method: "EASY_PAY";
|
|
1387
|
+
provider: "NAVERPAY" | "KAKAOPAY" | "TOSSPAY" | "PAYCO";
|
|
1388
|
+
} | {
|
|
1389
|
+
pg: "tosspayments" | "portone";
|
|
1390
|
+
method: "BANK_TRANSFER";
|
|
1391
|
+
} | {
|
|
1392
|
+
pg: "tosspayments" | "portone";
|
|
1393
|
+
method: "VIRTUAL_ACCOUNT";
|
|
1394
|
+
} | {
|
|
1395
|
+
pg: "tosspayments" | "portone";
|
|
1396
|
+
method: "MOBILE";
|
|
1397
|
+
};
|
|
1398
|
+
payUrl: string;
|
|
1399
|
+
expiresAt: string;
|
|
1400
|
+
testPayment: boolean;
|
|
1401
|
+
}>;
|
|
1402
|
+
};
|
|
1403
|
+
payments: {
|
|
1404
|
+
/**
|
|
1405
|
+
* `GET /storefront/v1/payments/{paymentId}` — 결제 상태 조회. 복귀 화면에서 결과가 확인 중(`processing`)이면
|
|
1406
|
+
* `expiresAt`까지 폴링한다. `completed`면 `orderId`로 완료 화면, `failed`·`expired`면 실패 안내다.
|
|
1407
|
+
* TTL이 지난 `pending`은 `expired`로 보고된다. `testPayment`는 완료면 주문 플래그, 아니면 세션 환경이다.
|
|
1408
|
+
*
|
|
1409
|
+
* 에러: 404 `PAYMENT_NOT_FOUND`(없음·다른 스토어) · 410 `STORE_CLOSED` · 503 `STORE_SUSPENDED`
|
|
1410
|
+
*/
|
|
1411
|
+
getStatus: (paymentId: string) => Promise<{
|
|
1412
|
+
paymentId: string;
|
|
1413
|
+
status: string;
|
|
1414
|
+
result: string;
|
|
1415
|
+
orderId: string | null;
|
|
1416
|
+
lastFailure: {
|
|
1417
|
+
attemptId: string;
|
|
1418
|
+
category: string;
|
|
1419
|
+
code: string | null;
|
|
1420
|
+
message: string | null;
|
|
1421
|
+
} | null;
|
|
1422
|
+
testPayment: boolean;
|
|
1423
|
+
expiresAt: string;
|
|
1424
|
+
}>;
|
|
1425
|
+
/**
|
|
1426
|
+
* `POST /payments/{paymentId}/attempts` — 같은 결제에서 다른 결제 옵션으로 다시 시도한다. 새 시도의 결제창 값을
|
|
1427
|
+
* 돌려준다. 승인 중이거나 결과 확인 중이면 409 `PAYMENT_IN_PROGRESS`다.
|
|
1428
|
+
*/
|
|
1429
|
+
retry: (paymentId: string, body: RetryPaymentRequest) => Promise<{
|
|
1430
|
+
paymentId: string;
|
|
1431
|
+
attemptId: string;
|
|
1432
|
+
option: {
|
|
1433
|
+
pg: "tosspayments" | "portone";
|
|
1434
|
+
method: "CARD";
|
|
1435
|
+
} | {
|
|
1436
|
+
pg: "tosspayments" | "portone";
|
|
1437
|
+
method: "EASY_PAY";
|
|
1438
|
+
provider: "NAVERPAY" | "KAKAOPAY" | "TOSSPAY" | "PAYCO";
|
|
1439
|
+
} | {
|
|
1440
|
+
pg: "tosspayments" | "portone";
|
|
1441
|
+
method: "BANK_TRANSFER";
|
|
1442
|
+
} | {
|
|
1443
|
+
pg: "tosspayments" | "portone";
|
|
1444
|
+
method: "VIRTUAL_ACCOUNT";
|
|
1445
|
+
} | {
|
|
1446
|
+
pg: "tosspayments" | "portone";
|
|
1447
|
+
method: "MOBILE";
|
|
1448
|
+
};
|
|
1449
|
+
payUrl: string;
|
|
1450
|
+
expiresAt: string;
|
|
1451
|
+
testPayment: boolean;
|
|
1452
|
+
}>;
|
|
1453
|
+
};
|
|
1454
|
+
myOrders: {
|
|
1455
|
+
list: (params?: PageParams & {
|
|
1456
|
+
status?: OrderItemStatus;
|
|
1457
|
+
from?: string;
|
|
1458
|
+
}) => Promise<{
|
|
1459
|
+
page: number;
|
|
1460
|
+
size: number;
|
|
1461
|
+
totalElements: number;
|
|
1462
|
+
totalPages: number;
|
|
1463
|
+
contents: {
|
|
1464
|
+
orderId: string;
|
|
1465
|
+
orderedAt: string;
|
|
1466
|
+
items: {
|
|
1467
|
+
orderItemId: string;
|
|
1468
|
+
productId: string;
|
|
1469
|
+
productName: string;
|
|
1470
|
+
thumbnailUrl: string | null;
|
|
1471
|
+
optionName: string | null;
|
|
1472
|
+
quantity: number;
|
|
1473
|
+
totalPrice: number;
|
|
1474
|
+
status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
|
|
1475
|
+
claimStatus: string | null;
|
|
1476
|
+
reviewWritten: boolean;
|
|
1477
|
+
autoDecisionDate: string | null;
|
|
1478
|
+
}[];
|
|
1479
|
+
shippingAddress: {
|
|
1480
|
+
receiverName: string;
|
|
1481
|
+
phone: string;
|
|
1482
|
+
zipCode: string;
|
|
1483
|
+
address1: string;
|
|
1484
|
+
address2?: string | null | undefined;
|
|
1485
|
+
deliveryMemo?: string | null | undefined;
|
|
1486
|
+
entranceCode?: string | null | undefined;
|
|
1487
|
+
};
|
|
1488
|
+
payment: {
|
|
1489
|
+
method: "CARD" | "EASY_PAY" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE";
|
|
1490
|
+
easyPayProvider: string | null;
|
|
1491
|
+
totalAmount: number;
|
|
1492
|
+
paidAt: string | null;
|
|
1493
|
+
receiptUrl: string | null;
|
|
1494
|
+
};
|
|
1495
|
+
testPayment: boolean;
|
|
1496
|
+
}[];
|
|
1497
|
+
}>;
|
|
1498
|
+
get: (orderId: string) => Promise<{
|
|
1499
|
+
orderId: string;
|
|
1500
|
+
orderedAt: string;
|
|
1501
|
+
items: {
|
|
1502
|
+
orderItemId: string;
|
|
1503
|
+
productId: string;
|
|
1504
|
+
productName: string;
|
|
1505
|
+
thumbnailUrl: string | null;
|
|
1506
|
+
optionName: string | null;
|
|
1507
|
+
quantity: number;
|
|
1508
|
+
totalPrice: number;
|
|
1509
|
+
status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
|
|
1510
|
+
claimStatus: string | null;
|
|
1511
|
+
reviewWritten: boolean;
|
|
1512
|
+
autoDecisionDate: string | null;
|
|
1513
|
+
}[];
|
|
1514
|
+
shippingAddress: {
|
|
1515
|
+
receiverName: string;
|
|
1516
|
+
phone: string;
|
|
1517
|
+
zipCode: string;
|
|
1518
|
+
address1: string;
|
|
1519
|
+
address2?: string | null | undefined;
|
|
1520
|
+
deliveryMemo?: string | null | undefined;
|
|
1521
|
+
entranceCode?: string | null | undefined;
|
|
1522
|
+
};
|
|
1523
|
+
payment: {
|
|
1524
|
+
method: "CARD" | "EASY_PAY" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE";
|
|
1525
|
+
easyPayProvider: string | null;
|
|
1526
|
+
totalAmount: number;
|
|
1527
|
+
paidAt: string | null;
|
|
1528
|
+
receiptUrl: string | null;
|
|
1529
|
+
};
|
|
1530
|
+
testPayment: boolean;
|
|
1531
|
+
}>;
|
|
1532
|
+
getGuestOrder: (orderId: string, body: {
|
|
1533
|
+
phone: string;
|
|
1534
|
+
orderPassword: string;
|
|
1535
|
+
}) => Promise<{
|
|
1536
|
+
orderId: string;
|
|
1537
|
+
orderedAt: string;
|
|
1538
|
+
items: {
|
|
1539
|
+
orderItemId: string;
|
|
1540
|
+
productId: string;
|
|
1541
|
+
productName: string;
|
|
1542
|
+
thumbnailUrl: string | null;
|
|
1543
|
+
optionName: string | null;
|
|
1544
|
+
quantity: number;
|
|
1545
|
+
totalPrice: number;
|
|
1546
|
+
status: "CANCELED" | "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED";
|
|
1547
|
+
claimStatus: string | null;
|
|
1548
|
+
reviewWritten: boolean;
|
|
1549
|
+
autoDecisionDate: string | null;
|
|
1550
|
+
}[];
|
|
1551
|
+
shippingAddress: {
|
|
1552
|
+
receiverName: string;
|
|
1553
|
+
phone: string;
|
|
1554
|
+
zipCode: string;
|
|
1555
|
+
address1: string;
|
|
1556
|
+
address2?: string | null | undefined;
|
|
1557
|
+
deliveryMemo?: string | null | undefined;
|
|
1558
|
+
entranceCode?: string | null | undefined;
|
|
1559
|
+
};
|
|
1560
|
+
payment: {
|
|
1561
|
+
method: "CARD" | "EASY_PAY" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE";
|
|
1562
|
+
easyPayProvider: string | null;
|
|
1563
|
+
totalAmount: number;
|
|
1564
|
+
paidAt: string | null;
|
|
1565
|
+
receiptUrl: string | null;
|
|
1566
|
+
};
|
|
1567
|
+
testPayment: boolean;
|
|
1568
|
+
}>;
|
|
1569
|
+
getDelivery: (orderItemId: string) => Promise<{
|
|
1570
|
+
carrierName: string;
|
|
1571
|
+
trackingNumber: string;
|
|
1572
|
+
trackingUrl: string;
|
|
1573
|
+
status: "DISPATCHED" | "DELIVERING" | "DELIVERED";
|
|
1574
|
+
trackingEvents: {
|
|
1575
|
+
status: string;
|
|
1576
|
+
location: string;
|
|
1577
|
+
occurredAt: string;
|
|
1578
|
+
}[];
|
|
1579
|
+
}>;
|
|
1580
|
+
decidePurchase: (orderItemId: string) => Promise<void>;
|
|
1581
|
+
};
|
|
1582
|
+
myClaims: {
|
|
1583
|
+
create: (orderItemId: string, body: CreateClaimRequest) => Promise<{
|
|
1584
|
+
claimId: string;
|
|
1585
|
+
status: "REQUESTED";
|
|
1586
|
+
expectedRefundAmount: number | null;
|
|
1587
|
+
claimDeliveryFee: number;
|
|
1588
|
+
}>;
|
|
1589
|
+
list: (params?: PageParams & {
|
|
1590
|
+
status?: ClaimStatus;
|
|
1591
|
+
}) => Promise<{
|
|
1592
|
+
page: number;
|
|
1593
|
+
size: number;
|
|
1594
|
+
totalElements: number;
|
|
1595
|
+
totalPages: number;
|
|
1596
|
+
contents: {
|
|
1597
|
+
claimId: string;
|
|
1598
|
+
type: "CANCEL" | "RETURN" | "EXCHANGE";
|
|
1599
|
+
status: "COMPLETED" | "REQUESTED" | "HELD" | "COLLECTING" | "COLLECTED" | "REDELIVERING" | "APPROVED" | "REJECTED" | "WITHDRAWN";
|
|
1600
|
+
orderItemId: string;
|
|
1601
|
+
productName: string;
|
|
1602
|
+
reason: string;
|
|
1603
|
+
expectedRefundAmount: number | null;
|
|
1604
|
+
rejectReason: string | null;
|
|
1605
|
+
requestedAt: string;
|
|
1606
|
+
completedAt: string | null;
|
|
1607
|
+
}[];
|
|
1608
|
+
}>;
|
|
1609
|
+
withdraw: (claimId: string) => Promise<void>;
|
|
1610
|
+
};
|
|
1611
|
+
member: {
|
|
1612
|
+
me: () => Promise<{
|
|
1613
|
+
memberId: string;
|
|
1614
|
+
email: string | null;
|
|
1615
|
+
name: string;
|
|
1616
|
+
phone: string | null;
|
|
1617
|
+
point: number;
|
|
1618
|
+
marketingAgreed: boolean;
|
|
1619
|
+
joinedAt: string;
|
|
1620
|
+
}>;
|
|
1621
|
+
updateMe: (body: UpdateProfileRequest) => Promise<void>;
|
|
1622
|
+
listAddresses: () => Promise<{
|
|
1623
|
+
addressId: string;
|
|
1624
|
+
alias: string;
|
|
1625
|
+
isDefault: boolean;
|
|
1626
|
+
receiverName: string;
|
|
1627
|
+
phone: string;
|
|
1628
|
+
zipCode: string;
|
|
1629
|
+
address1: string;
|
|
1630
|
+
address2: string | null;
|
|
1631
|
+
}[]>;
|
|
1632
|
+
createAddress: (body: MemberAddressRequest) => Promise<void>;
|
|
1633
|
+
updateAddress: (addressId: string, body: MemberAddressRequest) => Promise<void>;
|
|
1634
|
+
deleteAddress: (addressId: string) => Promise<void>;
|
|
1635
|
+
listWishlist: (params?: PageParams) => Promise<{
|
|
1636
|
+
page: number;
|
|
1637
|
+
size: number;
|
|
1638
|
+
totalElements: number;
|
|
1639
|
+
totalPages: number;
|
|
1640
|
+
contents: {
|
|
1641
|
+
productId: string;
|
|
1642
|
+
name: string;
|
|
1643
|
+
thumbnailUrl: string | null;
|
|
1644
|
+
salePrice: number;
|
|
1645
|
+
discountedPrice: number | null;
|
|
1646
|
+
discountRate: number | null;
|
|
1647
|
+
freeShipping: boolean;
|
|
1648
|
+
averageRating: number;
|
|
1649
|
+
reviewCount: number;
|
|
1650
|
+
soldOut: boolean;
|
|
1651
|
+
}[];
|
|
1652
|
+
}>;
|
|
1653
|
+
addWishlist: (productId: string) => Promise<void>;
|
|
1654
|
+
removeWishlist: (productId: string) => Promise<void>;
|
|
1655
|
+
};
|
|
1656
|
+
reviews: {
|
|
1657
|
+
listWritable: () => Promise<{
|
|
1658
|
+
orderItemId: string;
|
|
1659
|
+
productId: string;
|
|
1660
|
+
productName: string;
|
|
1661
|
+
optionName: string | null;
|
|
1662
|
+
thumbnailUrl: string | null;
|
|
1663
|
+
writableUntil: string;
|
|
1664
|
+
}[]>;
|
|
1665
|
+
create: (orderItemId: string, body: CreateReviewRequest) => Promise<{
|
|
1666
|
+
reviewId: string;
|
|
1667
|
+
rewardPoint: number;
|
|
1668
|
+
}>;
|
|
1669
|
+
update: (reviewId: string, body: UpdateReviewRequest) => Promise<void>;
|
|
1670
|
+
remove: (reviewId: string) => Promise<void>;
|
|
1671
|
+
};
|
|
1672
|
+
inquiries: {
|
|
1673
|
+
listMine: (params?: PageParams & {
|
|
1674
|
+
answered?: boolean;
|
|
1675
|
+
}) => Promise<{
|
|
1676
|
+
page: number;
|
|
1677
|
+
size: number;
|
|
1678
|
+
totalElements: number;
|
|
1679
|
+
totalPages: number;
|
|
1680
|
+
contents: {
|
|
1681
|
+
inquiryId: string;
|
|
1682
|
+
content: string | null;
|
|
1683
|
+
secret: boolean;
|
|
1684
|
+
mine: boolean;
|
|
1685
|
+
writerMaskedName: string;
|
|
1686
|
+
answer: {
|
|
1687
|
+
content: string | null;
|
|
1688
|
+
answeredAt: string;
|
|
1689
|
+
} | null;
|
|
1690
|
+
createdAt: string;
|
|
1691
|
+
}[];
|
|
1692
|
+
}>;
|
|
1693
|
+
};
|
|
1694
|
+
me: {
|
|
1695
|
+
customerInquiries: {
|
|
1696
|
+
create: (body: CreateCustomerInquiryRequest) => Promise<{
|
|
1697
|
+
inquiryId: string;
|
|
1698
|
+
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1699
|
+
title: string;
|
|
1700
|
+
content: string;
|
|
1701
|
+
orderItemId: string | null;
|
|
1702
|
+
answered: boolean;
|
|
1703
|
+
answer: {
|
|
1704
|
+
content: string;
|
|
1705
|
+
answeredAt: string;
|
|
1706
|
+
} | null;
|
|
1707
|
+
createdAt: string;
|
|
1708
|
+
}>;
|
|
1709
|
+
list: (params?: PageParams & {
|
|
1710
|
+
answered?: boolean;
|
|
1711
|
+
category?: CustomerInquiryCategory;
|
|
1712
|
+
}) => Promise<{
|
|
1713
|
+
page: number;
|
|
1714
|
+
size: number;
|
|
1715
|
+
totalElements: number;
|
|
1716
|
+
totalPages: number;
|
|
1717
|
+
contents: {
|
|
1718
|
+
inquiryId: string;
|
|
1719
|
+
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1720
|
+
title: string;
|
|
1721
|
+
content: string;
|
|
1722
|
+
orderItemId: string | null;
|
|
1723
|
+
answered: boolean;
|
|
1724
|
+
answer: {
|
|
1725
|
+
content: string;
|
|
1726
|
+
answeredAt: string;
|
|
1727
|
+
} | null;
|
|
1728
|
+
createdAt: string;
|
|
1729
|
+
}[];
|
|
1730
|
+
}>;
|
|
1731
|
+
get: (inquiryId: string) => Promise<{
|
|
1732
|
+
inquiryId: string;
|
|
1733
|
+
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1734
|
+
title: string;
|
|
1735
|
+
content: string;
|
|
1736
|
+
orderItemId: string | null;
|
|
1737
|
+
answered: boolean;
|
|
1738
|
+
answer: {
|
|
1739
|
+
content: string;
|
|
1740
|
+
answeredAt: string;
|
|
1741
|
+
} | null;
|
|
1742
|
+
createdAt: string;
|
|
1743
|
+
}>;
|
|
1744
|
+
};
|
|
1745
|
+
};
|
|
1746
|
+
};
|
|
1747
|
+
type StorefrontClient = ReturnType<typeof createStorefrontClient>;
|
|
1748
|
+
//#endregion
|
|
1749
|
+
//#region src/schemas/analytics.d.ts
|
|
1750
|
+
/**
|
|
1751
|
+
* 방문 분석 이벤트 계약 — 브라우저 모듈(`@sayren/storefront-sdk/analytics`)과 수집 엔드포인트
|
|
1752
|
+
* (`POST /storefront/v1/events`)가 같은 스키마를 쓴다.
|
|
1753
|
+
*
|
|
1754
|
+
* 행동 이벤트(페이지뷰·상품 조회·목록 노출·검색·체류)는 브라우저가 보낸다. 거래 이벤트(장바구니·결제 시작·구매)는
|
|
1755
|
+
* 스토어프론트 API가 요청을 처리하면서 서버에서 기록하므로 브라우저가 보내지 않는다 — 매출·전환은 조작이나
|
|
1756
|
+
* 누락이 없는 서버 데이터로 계산한다.
|
|
1757
|
+
*/
|
|
1758
|
+
/** 방문자·세션 식별자 — SDK가 만드는 URL-safe 난수 */
|
|
1759
|
+
declare const analyticsIdSchema: z.ZodString;
|
|
1760
|
+
/** 방문자 ID 쿠키(1년) · 세션 ID 쿠키(30분 비활동) 이름. SSR 서버도 같은 이름으로 읽는다 */
|
|
1761
|
+
declare const ANALYTICS_VISITOR_COOKIE = "sy_vid";
|
|
1762
|
+
declare const ANALYTICS_SESSION_COOKIE = "sy_sid";
|
|
1763
|
+
/** 스토어프론트 API 요청에 실어 서버 거래 이벤트와 방문자·세션을 잇는 헤더 */
|
|
1764
|
+
declare const ANALYTICS_VISITOR_HEADER = "x-sayren-visitor";
|
|
1765
|
+
declare const ANALYTICS_SESSION_HEADER = "x-sayren-session";
|
|
1766
|
+
/** 브라우저가 보내는 이벤트 이름 */
|
|
1767
|
+
declare const analyticsClientEventNameSchema: z.ZodEnum<{
|
|
1768
|
+
search: "search";
|
|
1769
|
+
page_view: "page_view";
|
|
1770
|
+
page_engagement: "page_engagement";
|
|
1771
|
+
product_view: "product_view";
|
|
1772
|
+
product_list_view: "product_list_view";
|
|
1773
|
+
}>;
|
|
1774
|
+
type AnalyticsClientEventName = z.infer<typeof analyticsClientEventNameSchema>;
|
|
1775
|
+
/** 서버가 기록하는 이벤트 이름 */
|
|
1776
|
+
declare const analyticsServerEventNameSchema: z.ZodEnum<{
|
|
1777
|
+
add_to_cart: "add_to_cart";
|
|
1778
|
+
remove_from_cart: "remove_from_cart";
|
|
1779
|
+
begin_checkout: "begin_checkout";
|
|
1780
|
+
purchase: "purchase";
|
|
1781
|
+
}>;
|
|
1782
|
+
type AnalyticsServerEventName = z.infer<typeof analyticsServerEventNameSchema>;
|
|
1783
|
+
type AnalyticsEventName = AnalyticsClientEventName | AnalyticsServerEventName;
|
|
1784
|
+
declare const analyticsClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1785
|
+
name: z.ZodLiteral<"page_view">;
|
|
1786
|
+
referrer: z.ZodOptional<z.ZodURL>;
|
|
1787
|
+
occurredAt: z.ZodISODateTime;
|
|
1788
|
+
url: z.ZodURL;
|
|
1789
|
+
pageViewId: z.ZodString;
|
|
1790
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1791
|
+
name: z.ZodLiteral<"page_engagement">;
|
|
1792
|
+
visibleMs: z.ZodNumber;
|
|
1793
|
+
occurredAt: z.ZodISODateTime;
|
|
1794
|
+
url: z.ZodURL;
|
|
1795
|
+
pageViewId: z.ZodString;
|
|
1796
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1797
|
+
name: z.ZodLiteral<"product_view">;
|
|
1798
|
+
productId: z.ZodString;
|
|
1799
|
+
variantId: z.ZodOptional<z.ZodString>;
|
|
1800
|
+
occurredAt: z.ZodISODateTime;
|
|
1801
|
+
url: z.ZodURL;
|
|
1802
|
+
pageViewId: z.ZodString;
|
|
1803
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1804
|
+
name: z.ZodLiteral<"product_list_view">;
|
|
1805
|
+
listId: z.ZodString;
|
|
1806
|
+
productIds: z.ZodArray<z.ZodString>;
|
|
1807
|
+
occurredAt: z.ZodISODateTime;
|
|
1808
|
+
url: z.ZodURL;
|
|
1809
|
+
pageViewId: z.ZodString;
|
|
1810
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1811
|
+
name: z.ZodLiteral<"search">;
|
|
1812
|
+
query: z.ZodString;
|
|
1813
|
+
resultCount: z.ZodNumber;
|
|
1814
|
+
occurredAt: z.ZodISODateTime;
|
|
1815
|
+
url: z.ZodURL;
|
|
1816
|
+
pageViewId: z.ZodString;
|
|
1817
|
+
}, z.core.$strip>], "name">;
|
|
1818
|
+
type AnalyticsClientEvent = z.infer<typeof analyticsClientEventSchema>;
|
|
1819
|
+
/** 한 번에 보내는 배치 — sendBeacon이라 헤더를 못 실어 테넌트·식별자를 본문에 싣는다 */
|
|
1820
|
+
declare const analyticsBatchSchema: z.ZodObject<{
|
|
1821
|
+
storeCode: z.ZodString;
|
|
1822
|
+
visitorId: z.ZodString;
|
|
1823
|
+
sessionId: z.ZodString;
|
|
1824
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1825
|
+
name: z.ZodLiteral<"page_view">;
|
|
1826
|
+
referrer: z.ZodOptional<z.ZodURL>;
|
|
1827
|
+
occurredAt: z.ZodISODateTime;
|
|
1828
|
+
url: z.ZodURL;
|
|
1829
|
+
pageViewId: z.ZodString;
|
|
1830
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1831
|
+
name: z.ZodLiteral<"page_engagement">;
|
|
1832
|
+
visibleMs: z.ZodNumber;
|
|
1833
|
+
occurredAt: z.ZodISODateTime;
|
|
1834
|
+
url: z.ZodURL;
|
|
1835
|
+
pageViewId: z.ZodString;
|
|
1836
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1837
|
+
name: z.ZodLiteral<"product_view">;
|
|
1838
|
+
productId: z.ZodString;
|
|
1839
|
+
variantId: z.ZodOptional<z.ZodString>;
|
|
1840
|
+
occurredAt: z.ZodISODateTime;
|
|
1841
|
+
url: z.ZodURL;
|
|
1842
|
+
pageViewId: z.ZodString;
|
|
1843
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1844
|
+
name: z.ZodLiteral<"product_list_view">;
|
|
1845
|
+
listId: z.ZodString;
|
|
1846
|
+
productIds: z.ZodArray<z.ZodString>;
|
|
1847
|
+
occurredAt: z.ZodISODateTime;
|
|
1848
|
+
url: z.ZodURL;
|
|
1849
|
+
pageViewId: z.ZodString;
|
|
1850
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1851
|
+
name: z.ZodLiteral<"search">;
|
|
1852
|
+
query: z.ZodString;
|
|
1853
|
+
resultCount: z.ZodNumber;
|
|
1854
|
+
occurredAt: z.ZodISODateTime;
|
|
1855
|
+
url: z.ZodURL;
|
|
1856
|
+
pageViewId: z.ZodString;
|
|
1857
|
+
}, z.core.$strip>], "name">>;
|
|
1858
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
1859
|
+
webdriver: z.ZodOptional<z.ZodBoolean>;
|
|
1860
|
+
}, z.core.$strip>>;
|
|
1861
|
+
}, z.core.$strip>;
|
|
1862
|
+
type AnalyticsBatch = z.infer<typeof analyticsBatchSchema>;
|
|
1863
|
+
/** 배치 본문 상한(바이트) — 서버가 넘는 요청을 거부한다 */
|
|
1864
|
+
declare const ANALYTICS_MAX_BATCH_BYTES: number;
|
|
1865
|
+
//#endregion
|
|
1866
|
+
//#region src/schemas/order.d.ts
|
|
1867
|
+
declare const myOrderItemSchema: z.ZodObject<{
|
|
1868
|
+
orderItemId: z.ZodString;
|
|
1869
|
+
productId: z.ZodString;
|
|
1870
|
+
productName: z.ZodString;
|
|
1871
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
1872
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
1873
|
+
quantity: z.ZodNumber;
|
|
1874
|
+
totalPrice: z.ZodNumber;
|
|
1875
|
+
status: z.ZodEnum<{
|
|
1876
|
+
CANCELED: "CANCELED";
|
|
1877
|
+
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
1878
|
+
PAID: "PAID";
|
|
1879
|
+
CONFIRMED: "CONFIRMED";
|
|
1880
|
+
DISPATCHED: "DISPATCHED";
|
|
1881
|
+
DELIVERING: "DELIVERING";
|
|
1882
|
+
DELIVERED: "DELIVERED";
|
|
1883
|
+
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
1884
|
+
}>;
|
|
1885
|
+
claimStatus: z.ZodNullable<z.ZodString>;
|
|
1886
|
+
reviewWritten: z.ZodBoolean;
|
|
1887
|
+
autoDecisionDate: z.ZodNullable<z.ZodString>;
|
|
1888
|
+
}, z.core.$strip>;
|
|
1889
|
+
type MyOrderItem = z.infer<typeof myOrderItemSchema>;
|
|
1890
|
+
/**
|
|
1891
|
+
* 주문 응답의 배송지 — 결제 요청 시 저장된 스냅샷. 요청 스키마(`shippingAddressInputSchema`)와 분리한 응답 스키마라
|
|
1892
|
+
* 형식 검증(regex·길이)을 하지 않는다. 입력하지 않은 선택 필드는 null로 오거나 빠질 수 있다.
|
|
1893
|
+
*/
|
|
1894
|
+
declare const orderShippingAddressSchema: z.ZodObject<{
|
|
1895
|
+
receiverName: z.ZodString;
|
|
1896
|
+
phone: z.ZodString;
|
|
1897
|
+
zipCode: z.ZodString;
|
|
1898
|
+
address1: z.ZodString;
|
|
1899
|
+
address2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1900
|
+
deliveryMemo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1901
|
+
entranceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1902
|
+
}, z.core.$strip>;
|
|
1903
|
+
type OrderShippingAddress = z.infer<typeof orderShippingAddressSchema>;
|
|
1904
|
+
declare const myOrderSchema: z.ZodObject<{
|
|
1905
|
+
orderId: z.ZodString;
|
|
1906
|
+
orderedAt: z.ZodString;
|
|
1907
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1908
|
+
orderItemId: z.ZodString;
|
|
1909
|
+
productId: z.ZodString;
|
|
1910
|
+
productName: z.ZodString;
|
|
1911
|
+
thumbnailUrl: z.ZodNullable<z.ZodURL>;
|
|
1912
|
+
optionName: z.ZodNullable<z.ZodString>;
|
|
1913
|
+
quantity: z.ZodNumber;
|
|
1914
|
+
totalPrice: z.ZodNumber;
|
|
1915
|
+
status: z.ZodEnum<{
|
|
1916
|
+
CANCELED: "CANCELED";
|
|
1917
|
+
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
1918
|
+
PAID: "PAID";
|
|
1919
|
+
CONFIRMED: "CONFIRMED";
|
|
1920
|
+
DISPATCHED: "DISPATCHED";
|
|
1921
|
+
DELIVERING: "DELIVERING";
|
|
1922
|
+
DELIVERED: "DELIVERED";
|
|
1923
|
+
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
1924
|
+
}>;
|
|
1925
|
+
claimStatus: z.ZodNullable<z.ZodString>;
|
|
1926
|
+
reviewWritten: z.ZodBoolean;
|
|
1927
|
+
autoDecisionDate: z.ZodNullable<z.ZodString>;
|
|
1928
|
+
}, z.core.$strip>>;
|
|
1929
|
+
shippingAddress: z.ZodObject<{
|
|
1930
|
+
receiverName: z.ZodString;
|
|
1931
|
+
phone: z.ZodString;
|
|
1932
|
+
zipCode: z.ZodString;
|
|
1933
|
+
address1: z.ZodString;
|
|
1934
|
+
address2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1935
|
+
deliveryMemo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1936
|
+
entranceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1937
|
+
}, z.core.$strip>;
|
|
1938
|
+
payment: z.ZodObject<{
|
|
1939
|
+
method: z.ZodEnum<{
|
|
1940
|
+
CARD: "CARD";
|
|
1941
|
+
EASY_PAY: "EASY_PAY";
|
|
1942
|
+
BANK_TRANSFER: "BANK_TRANSFER";
|
|
1943
|
+
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
1944
|
+
MOBILE: "MOBILE";
|
|
1945
|
+
}>;
|
|
1946
|
+
easyPayProvider: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1947
|
+
totalAmount: z.ZodNumber;
|
|
1948
|
+
paidAt: z.ZodNullable<z.ZodString>;
|
|
1949
|
+
receiptUrl: z.ZodNullable<z.ZodURL>;
|
|
1950
|
+
}, z.core.$strip>;
|
|
1951
|
+
testPayment: z.ZodBoolean;
|
|
1952
|
+
}, z.core.$strip>;
|
|
1953
|
+
type MyOrder = z.infer<typeof myOrderSchema>;
|
|
1954
|
+
declare const deliveryTrackingSchema: z.ZodObject<{
|
|
1955
|
+
carrierName: z.ZodString;
|
|
1956
|
+
trackingNumber: z.ZodString;
|
|
1957
|
+
trackingUrl: z.ZodURL;
|
|
1958
|
+
status: z.ZodEnum<{
|
|
1959
|
+
DISPATCHED: "DISPATCHED";
|
|
1960
|
+
DELIVERING: "DELIVERING";
|
|
1961
|
+
DELIVERED: "DELIVERED";
|
|
1962
|
+
}>;
|
|
1963
|
+
trackingEvents: z.ZodArray<z.ZodObject<{
|
|
1964
|
+
status: z.ZodString;
|
|
1965
|
+
location: z.ZodString;
|
|
1966
|
+
occurredAt: z.ZodString;
|
|
1967
|
+
}, z.core.$strip>>;
|
|
1968
|
+
}, z.core.$strip>;
|
|
1969
|
+
type DeliveryTracking = z.infer<typeof deliveryTrackingSchema>;
|
|
1970
|
+
/** `POST /me/order-items/{orderItemId}/purchase-decision` 응답 */
|
|
1971
|
+
declare const purchaseDecisionResultSchema: z.ZodObject<{
|
|
1972
|
+
orderItemId: z.ZodString;
|
|
1973
|
+
status: z.ZodLiteral<"PURCHASE_DECIDED">;
|
|
1974
|
+
decidedAt: z.ZodString;
|
|
1975
|
+
}, z.core.$strip>;
|
|
1976
|
+
type PurchaseDecisionResult = z.infer<typeof purchaseDecisionResultSchema>;
|
|
1977
|
+
//#endregion
|
|
1978
|
+
//#region src/schemas/store.d.ts
|
|
1979
|
+
/**
|
|
1980
|
+
* 스토어 공개 설정 — `GET /store`. 스토어프론트가 화면을 그릴 때 읽는 값만 담는다.
|
|
1981
|
+
*/
|
|
1982
|
+
declare const storefrontStoreSchema: z.ZodObject<{
|
|
1983
|
+
storeCode: z.ZodString;
|
|
1984
|
+
name: z.ZodString;
|
|
1985
|
+
logoUrl: z.ZodNullable<z.ZodString>;
|
|
1986
|
+
customerCenterPhone: z.ZodNullable<z.ZodString>;
|
|
1987
|
+
businessHours: z.ZodNullable<z.ZodString>;
|
|
1988
|
+
guestCheckout: z.ZodBoolean;
|
|
1989
|
+
loginMethods: z.ZodArray<z.ZodEnum<{
|
|
1990
|
+
password: "password";
|
|
1991
|
+
kakao: "kakao";
|
|
1992
|
+
naver: "naver";
|
|
1993
|
+
google: "google";
|
|
1994
|
+
}>>;
|
|
1995
|
+
}, z.core.$strip>;
|
|
1996
|
+
type StorefrontStore = z.infer<typeof storefrontStoreSchema>;
|
|
1997
|
+
//#endregion
|
|
1998
|
+
export { MemberAddress as $, easyPayProviderSchema as $t, createStorefrontClient as A, claimStatusSchema as An, AvailablePaymentOption as At, ReviewSummary as B, cartSchema as Bn, PaymentMessage as Bt, analyticsBatchSchema as C, productFacetsSchema as Cn, CreateClaimResult as Ct, analyticsServerEventNameSchema as D, OrderItemStatus as Dn, createClaimRequestSchema as Dt, analyticsIdSchema as E, ClaimStatus as En, claimTypeSchema as Et, createStorefrontSession as F, Cart as Fn, KnownPaymentResult as Ft, createReviewResultSchema as G, PgProvider as Gt, UpdateReviewResult as H, analyticsIdsFromCookie as Hn, PaymentOption as Ht, CreateReviewRequest as I, CartItem as In, KnownPaymentStatus as It, reviewSummarySchema as J, StartPaymentRequest as Jt, publicReviewSchema as K, RetryPaymentRequest as Kt, CreateReviewResult as L, UpdateCartItemRequest as Ln, PAYMENT_RESULT_VALUES as Lt, SessionStorage as M, pageInfoSchema as Mn, CreateCheckoutRequest as Mt, StorefrontSession as N, pageSchema as Nn, EasyPayProvider as Nt, StorefrontClient as O, PageInfo as On, createClaimResultSchema as Ot, StorefrontSessionOptions as P, AddCartItemRequest as Pn, GuestInfo as Pt, Member as Q, easyPayProviderResponseSchema as Qt, PublicReview as R, addCartItemRequestSchema as Rn, PAYMENT_STATUS_VALUES as Rt, AnalyticsServerEventName as S, productDetailSchema as Sn, CreateClaimRequest as St, analyticsClientEventSchema as T, productSortSchema as Tn, claimReasonSchema as Tt, WritableReview as U, PaymentStart as Ut, UpdateReviewRequest as V, updateCartItemRequestSchema as Vn, PaymentMethod as Vt, createReviewRequestSchema as W, PaymentStatus as Wt, updateReviewResultSchema as X, checkoutSessionSchema as Xt, updateReviewRequestSchema as Y, availablePaymentOptionSchema as Yt, writableReviewSchema as Z, createCheckoutRequestSchema as Zt, ANALYTICS_VISITOR_HEADER as _, ProductPage as _n, createCustomerInquiryRequestSchema as _t, MyOrderItem as a, paymentOptionListSchema as an, memberSchema as at, AnalyticsClientEventName as b, categoryNodeSchema as bn, ClaimReason as bt, deliveryTrackingSchema as c, paymentStatusSchema as cn, CreateInquiryRequest as ct, orderShippingAddressSchema as d, shippingAddressInputSchema as dn, createInquiryRequestSchema as dt, guestInfoSchema as en, MemberAddressRequest as et, purchaseDecisionResultSchema as f, startPaymentRequestSchema as fn, createInquiryResultSchema as ft, ANALYTICS_VISITOR_COOKIE as g, ProductFacets as gn, CustomerInquiryCategory as gt, ANALYTICS_SESSION_HEADER as h, ProductDetail as hn, CustomerInquiry as ht, MyOrder as i, paymentOptionKey as in, memberAddressSchema as it, STOREFRONT_SESSION_KEYS as j, orderItemStatusSchema as jn, CheckoutSession as jt, StorefrontClientOptions as k, PageParams as kn, myClaimSchema as kt, myOrderItemSchema as l, pgProviderSchema as ln, CreateInquiryResult as lt, ANALYTICS_SESSION_COOKIE as m, ProductCard as mn, CreateCustomerInquiryRequest as mt, storefrontStoreSchema as n, paymentMessageSchema as nn, WishlistAddResult as nt, OrderShippingAddress as o, paymentOptionSchema as on, updateProfileRequestSchema as ot, ANALYTICS_MAX_BATCH_BYTES as p, CategoryNode as pn, publicInquirySchema as pt, reviewPageSchema as q, ShippingAddressInput as qt, DeliveryTracking as r, paymentMethodSchema as rn, memberAddressRequestSchema as rt, PurchaseDecisionResult as s, paymentStartSchema as sn, wishlistAddResultSchema as st, StorefrontStore as t, paymentFailureCategorySchema as tn, UpdateProfileRequest as tt, myOrderSchema as u, retryPaymentRequestSchema as un, PublicInquiry as ut, AnalyticsBatch as v, ProductSearchParams as vn, customerInquiryCategorySchema as vt, analyticsClientEventNameSchema as w, productPageSchema as wn, MyClaim as wt, AnalyticsEventName as x, productCardSchema as xn, ClaimType as xt, AnalyticsClientEvent as y, ProductSort as yn, customerInquirySchema as yt, ReviewPage as z, cartItemSchema as zn, PaymentFailureCategory as zt };
|