@sayren/storefront-sdk 0.7.0 → 0.8.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-DwqExvZN.mjs} +25 -139
- package/dist/index-BRXStiK2.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 +310 -0
- package/package.json +7 -2
- package/src/client.ts +28 -35
- package/src/payments/index.ts +541 -0
- package/src/schemas/checkout.ts +148 -54
- package/src/schemas/order.ts +10 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,1646 +1,3 @@
|
|
|
1
1
|
import { C as signupRequestSchema, D as withdrawalBlockedDetailsSchema, E as withdrawRequestSchema, S as memberIdentitiesSchema, T as tokenPairSchema, _ as idpAuthorizeRequestSchema, a as AnonymousSession, b as linkIdentityRequestSchema, c as LinkIdentityRequest, d as SignupRequest, f as SocialProvider, g as anonymousSessionSchema, h as WithdrawalBlockedDetails, i as buildQuery, l as LoginRequest, m as WithdrawRequest, n as Query, o as IdpAuthorizeRequest, p as TokenPair, r as TokenSource, s as IdpTokenRequest, t as ApiError, u as MemberIdentities, v as idpAuthorizeResponseSchema, w as socialProviderSchema, x as loginRequestSchema, y as idpTokenRequestSchema } from "./http-BbFHVGBf.mjs";
|
|
2
|
-
import { z } from "
|
|
3
|
-
|
|
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
|
-
export declare function analyticsIdsFromCookie(cookieHeader: string | null | undefined): {
|
|
14
|
-
visitorId?: string;
|
|
15
|
-
sessionId?: string;
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/schemas/cart.d.ts
|
|
19
|
-
export declare const cartItemSchema: z.ZodObject<{
|
|
20
|
-
cartItemId: z.ZodString;
|
|
21
|
-
productId: z.ZodString;
|
|
22
|
-
productName: z.ZodString;
|
|
23
|
-
thumbnailUrl: 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
|
-
export type CartItem = z.infer<typeof cartItemSchema>;
|
|
37
|
-
export 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.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
|
-
export type Cart = z.infer<typeof cartSchema>;
|
|
62
|
-
export declare const addCartItemRequestSchema: z.ZodObject<{
|
|
63
|
-
productId: z.ZodString;
|
|
64
|
-
optionId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
quantity: z.ZodNumber;
|
|
66
|
-
}, z.core.$strip>;
|
|
67
|
-
export type AddCartItemRequest = z.infer<typeof addCartItemRequestSchema>;
|
|
68
|
-
export declare const updateCartItemRequestSchema: z.ZodObject<{
|
|
69
|
-
quantity: z.ZodOptional<z.ZodNumber>;
|
|
70
|
-
optionId: z.ZodOptional<z.ZodString>;
|
|
71
|
-
}, z.core.$strip>;
|
|
72
|
-
export type UpdateCartItemRequest = z.infer<typeof updateCartItemRequestSchema>;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/schemas/common.d.ts
|
|
75
|
-
export 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
|
-
export type PageInfo = z.infer<typeof pageInfoSchema>;
|
|
82
|
-
export 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
|
-
export interface PageParams {
|
|
90
|
-
page?: number;
|
|
91
|
-
size?: number;
|
|
92
|
-
}
|
|
93
|
-
export declare const orderItemStatusSchema: z.ZodEnum<{
|
|
94
|
-
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
95
|
-
PAID: "PAID";
|
|
96
|
-
CONFIRMED: "CONFIRMED";
|
|
97
|
-
DISPATCHED: "DISPATCHED";
|
|
98
|
-
DELIVERING: "DELIVERING";
|
|
99
|
-
DELIVERED: "DELIVERED";
|
|
100
|
-
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
101
|
-
CANCELED: "CANCELED";
|
|
102
|
-
}>;
|
|
103
|
-
export type OrderItemStatus = z.infer<typeof orderItemStatusSchema>;
|
|
104
|
-
export declare const claimStatusSchema: z.ZodEnum<{
|
|
105
|
-
REQUESTED: "REQUESTED";
|
|
106
|
-
HELD: "HELD";
|
|
107
|
-
COLLECTING: "COLLECTING";
|
|
108
|
-
COLLECTED: "COLLECTED";
|
|
109
|
-
REDELIVERING: "REDELIVERING";
|
|
110
|
-
APPROVED: "APPROVED";
|
|
111
|
-
REJECTED: "REJECTED";
|
|
112
|
-
COMPLETED: "COMPLETED";
|
|
113
|
-
WITHDRAWN: "WITHDRAWN";
|
|
114
|
-
}>;
|
|
115
|
-
export type ClaimStatus = z.infer<typeof claimStatusSchema>;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/schemas/catalog.d.ts
|
|
118
|
-
export interface CategoryNode {
|
|
119
|
-
categoryId: string;
|
|
120
|
-
name: string;
|
|
121
|
-
depth: number;
|
|
122
|
-
children: CategoryNode[];
|
|
123
|
-
}
|
|
124
|
-
export declare const categoryNodeSchema: z.ZodType<CategoryNode>;
|
|
125
|
-
export declare const productCardSchema: z.ZodObject<{
|
|
126
|
-
productId: z.ZodString;
|
|
127
|
-
name: z.ZodString;
|
|
128
|
-
thumbnailUrl: 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
|
-
export type ProductCard = z.infer<typeof productCardSchema>;
|
|
138
|
-
export declare const productDetailSchema: z.ZodObject<{
|
|
139
|
-
productId: z.ZodString;
|
|
140
|
-
name: z.ZodString;
|
|
141
|
-
thumbnailUrl: 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
|
-
export type ProductDetail = z.infer<typeof productDetailSchema>;
|
|
187
|
-
export 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
|
-
export type ProductSort = z.infer<typeof productSortSchema>;
|
|
196
|
-
export interface ProductSearchParams extends PageParams {
|
|
197
|
-
keyword?: string;
|
|
198
|
-
categoryId?: string;
|
|
199
|
-
minPrice?: number;
|
|
200
|
-
maxPrice?: number;
|
|
201
|
-
freeShipping?: boolean;
|
|
202
|
-
sort?: ProductSort;
|
|
203
|
-
}
|
|
204
|
-
export 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
|
-
export type ProductFacets = z.infer<typeof productFacetsSchema>;
|
|
216
|
-
/** `GET /products` 응답 — 상품 카드 페이지와 검색 패싯 */
|
|
217
|
-
export 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.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
|
-
export type ProductPage = z.infer<typeof productPageSchema>;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/schemas/checkout.d.ts
|
|
249
|
-
export 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
|
-
export type CreateCheckoutRequest = z.infer<typeof createCheckoutRequestSchema>;
|
|
258
|
-
export 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
|
-
testPayment: z.ZodBoolean;
|
|
276
|
-
}, z.core.$strip>;
|
|
277
|
-
export type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
|
|
278
|
-
export declare const paymentMethodSchema: z.ZodEnum<{
|
|
279
|
-
CARD: "CARD";
|
|
280
|
-
BANK_TRANSFER: "BANK_TRANSFER";
|
|
281
|
-
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
282
|
-
MOBILE: "MOBILE";
|
|
283
|
-
EASY_PAY: "EASY_PAY";
|
|
284
|
-
}>;
|
|
285
|
-
export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
286
|
-
export declare const shippingAddressInputSchema: z.ZodObject<{
|
|
287
|
-
addressId: z.ZodOptional<z.ZodString>;
|
|
288
|
-
receiverName: z.ZodString;
|
|
289
|
-
phone: z.ZodString;
|
|
290
|
-
zipCode: z.ZodString;
|
|
291
|
-
address1: z.ZodString;
|
|
292
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
293
|
-
deliveryMemo: z.ZodOptional<z.ZodString>;
|
|
294
|
-
entranceCode: z.ZodOptional<z.ZodString>;
|
|
295
|
-
}, z.core.$strip>;
|
|
296
|
-
export type ShippingAddressInput = z.infer<typeof shippingAddressInputSchema>;
|
|
297
|
-
export declare const guestInfoSchema: z.ZodObject<{
|
|
298
|
-
name: z.ZodString;
|
|
299
|
-
phone: z.ZodString;
|
|
300
|
-
email: z.ZodEmail;
|
|
301
|
-
orderPassword: z.ZodString;
|
|
302
|
-
}, z.core.$strip>;
|
|
303
|
-
export type GuestInfo = z.infer<typeof guestInfoSchema>;
|
|
304
|
-
export declare const requestPaymentRequestSchema: z.ZodObject<{
|
|
305
|
-
shippingAddress: z.ZodObject<{
|
|
306
|
-
addressId: z.ZodOptional<z.ZodString>;
|
|
307
|
-
receiverName: z.ZodString;
|
|
308
|
-
phone: z.ZodString;
|
|
309
|
-
zipCode: z.ZodString;
|
|
310
|
-
address1: z.ZodString;
|
|
311
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
312
|
-
deliveryMemo: z.ZodOptional<z.ZodString>;
|
|
313
|
-
entranceCode: z.ZodOptional<z.ZodString>;
|
|
314
|
-
}, z.core.$strip>;
|
|
315
|
-
paymentMethod: z.ZodEnum<{
|
|
316
|
-
CARD: "CARD";
|
|
317
|
-
BANK_TRANSFER: "BANK_TRANSFER";
|
|
318
|
-
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
319
|
-
MOBILE: "MOBILE";
|
|
320
|
-
EASY_PAY: "EASY_PAY";
|
|
321
|
-
}>;
|
|
322
|
-
guest: z.ZodOptional<z.ZodObject<{
|
|
323
|
-
name: z.ZodString;
|
|
324
|
-
phone: z.ZodString;
|
|
325
|
-
email: z.ZodEmail;
|
|
326
|
-
orderPassword: z.ZodString;
|
|
327
|
-
}, z.core.$strip>>;
|
|
328
|
-
}, z.core.$strip>;
|
|
329
|
-
export type RequestPaymentRequest = z.infer<typeof requestPaymentRequestSchema>;
|
|
330
|
-
/**
|
|
331
|
-
* 결제창 파라미터. 스토어프론트가 쓰는 계약 값은 `popupUrl` 하나다(결제 팝업을 연다).
|
|
332
|
-
*
|
|
333
|
-
* 나머지는 결제 팝업 내부 값이라 선택 필드로만 타입을 준다(`attemptId`·`provider`·`mock`, 그리고
|
|
334
|
-
* 토스 `clientKey`·`orderId`…, 포트원 `storeId`·`channelKey`… 같은 PG별 결제창 값). 공개 값뿐이며
|
|
335
|
-
* 시크릿은 어떤 키에도 없다. 서버가 키를 추가·변경해도 파싱이 깨지지 않도록 모르는 키는 그대로 통과시킨다.
|
|
336
|
-
*/
|
|
337
|
-
export declare const pgParamsSchema: z.ZodObject<{
|
|
338
|
-
popupUrl: z.ZodString;
|
|
339
|
-
attemptId: z.ZodOptional<z.ZodString>;
|
|
340
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
341
|
-
mock: z.ZodOptional<z.ZodBoolean>;
|
|
342
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
343
|
-
}, z.core.$loose>;
|
|
344
|
-
export type PgParams = z.infer<typeof pgParamsSchema>;
|
|
345
|
-
export declare const paymentParamsSchema: z.ZodObject<{
|
|
346
|
-
paymentId: z.ZodString;
|
|
347
|
-
pgProvider: z.ZodString;
|
|
348
|
-
pgParams: z.ZodObject<{
|
|
349
|
-
popupUrl: z.ZodString;
|
|
350
|
-
attemptId: z.ZodOptional<z.ZodString>;
|
|
351
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
352
|
-
mock: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
-
environment: z.ZodOptional<z.ZodString>;
|
|
354
|
-
}, z.core.$loose>;
|
|
355
|
-
expiresAt: z.ZodString;
|
|
356
|
-
testPayment: z.ZodBoolean;
|
|
357
|
-
}, z.core.$strip>;
|
|
358
|
-
export type PaymentParams = z.infer<typeof paymentParamsSchema>;
|
|
359
|
-
export declare const confirmPaymentRequestSchema: z.ZodObject<{
|
|
360
|
-
pgToken: z.ZodString;
|
|
361
|
-
attemptId: z.ZodOptional<z.ZodString>;
|
|
362
|
-
}, z.core.$strip>;
|
|
363
|
-
export type ConfirmPaymentRequest = z.infer<typeof confirmPaymentRequestSchema>;
|
|
364
|
-
export declare const confirmPaymentResultSchema: z.ZodObject<{
|
|
365
|
-
orderId: z.ZodString;
|
|
366
|
-
status: z.ZodLiteral<"PAID">;
|
|
367
|
-
totalAmount: z.ZodNumber;
|
|
368
|
-
paidAt: z.ZodString;
|
|
369
|
-
}, z.core.$strip>;
|
|
370
|
-
export type ConfirmPaymentResult = z.infer<typeof confirmPaymentResultSchema>;
|
|
371
|
-
/**
|
|
372
|
-
* 결제 상태 조회의 현재 상태 값 — 응답 스키마는 서버가 상태를 추가해도 파싱이 깨지지 않게 문자열로 받는다
|
|
373
|
-
* (`pgProvider`와 같은 방식). 화면 분기는 이 목록으로 하고 모르는 값은 확인 중으로 다룬다.
|
|
374
|
-
*/
|
|
375
|
-
export declare const PAYMENT_STATUS_VALUES: readonly ["pending", "processing", "completed", "failed", "expired"];
|
|
376
|
-
export type KnownPaymentStatus = (typeof PAYMENT_STATUS_VALUES)[number];
|
|
377
|
-
export declare const paymentStatusSchema: z.ZodObject<{
|
|
378
|
-
paymentId: z.ZodString;
|
|
379
|
-
status: z.ZodString;
|
|
380
|
-
orderId: z.ZodNullable<z.ZodString>;
|
|
381
|
-
testPayment: z.ZodBoolean;
|
|
382
|
-
expiresAt: z.ZodString;
|
|
383
|
-
}, z.core.$strip>;
|
|
384
|
-
export type PaymentStatus = z.infer<typeof paymentStatusSchema>;
|
|
385
|
-
//#endregion
|
|
386
|
-
//#region src/schemas/claim.d.ts
|
|
387
|
-
export declare const claimTypeSchema: z.ZodEnum<{
|
|
388
|
-
CANCEL: "CANCEL";
|
|
389
|
-
RETURN: "RETURN";
|
|
390
|
-
EXCHANGE: "EXCHANGE";
|
|
391
|
-
}>;
|
|
392
|
-
export type ClaimType = z.infer<typeof claimTypeSchema>;
|
|
393
|
-
export declare const claimReasonSchema: z.ZodEnum<{
|
|
394
|
-
CHANGE_OF_MIND: "CHANGE_OF_MIND";
|
|
395
|
-
WRONG_ORDER: "WRONG_ORDER";
|
|
396
|
-
DEFECTIVE: "DEFECTIVE";
|
|
397
|
-
WRONG_DELIVERY: "WRONG_DELIVERY";
|
|
398
|
-
DIFFERENT_FROM_PAGE: "DIFFERENT_FROM_PAGE";
|
|
399
|
-
DELAY: "DELAY";
|
|
400
|
-
}>;
|
|
401
|
-
export type ClaimReason = z.infer<typeof claimReasonSchema>;
|
|
402
|
-
export declare const createClaimRequestSchema: z.ZodObject<{
|
|
403
|
-
type: z.ZodEnum<{
|
|
404
|
-
CANCEL: "CANCEL";
|
|
405
|
-
RETURN: "RETURN";
|
|
406
|
-
EXCHANGE: "EXCHANGE";
|
|
407
|
-
}>;
|
|
408
|
-
reason: z.ZodEnum<{
|
|
409
|
-
CHANGE_OF_MIND: "CHANGE_OF_MIND";
|
|
410
|
-
WRONG_ORDER: "WRONG_ORDER";
|
|
411
|
-
DEFECTIVE: "DEFECTIVE";
|
|
412
|
-
WRONG_DELIVERY: "WRONG_DELIVERY";
|
|
413
|
-
DIFFERENT_FROM_PAGE: "DIFFERENT_FROM_PAGE";
|
|
414
|
-
DELAY: "DELAY";
|
|
415
|
-
}>;
|
|
416
|
-
reasonDetail: z.ZodOptional<z.ZodString>;
|
|
417
|
-
evidenceImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
418
|
-
exchangeOptionId: z.ZodOptional<z.ZodString>;
|
|
419
|
-
}, z.core.$strip>;
|
|
420
|
-
export type CreateClaimRequest = z.infer<typeof createClaimRequestSchema>;
|
|
421
|
-
export declare const createClaimResultSchema: z.ZodObject<{
|
|
422
|
-
claimId: z.ZodString;
|
|
423
|
-
status: z.ZodLiteral<"REQUESTED">;
|
|
424
|
-
expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
425
|
-
claimDeliveryFee: z.ZodNumber;
|
|
426
|
-
}, z.core.$strip>;
|
|
427
|
-
export type CreateClaimResult = z.infer<typeof createClaimResultSchema>;
|
|
428
|
-
export declare const myClaimSchema: z.ZodObject<{
|
|
429
|
-
claimId: z.ZodString;
|
|
430
|
-
type: z.ZodEnum<{
|
|
431
|
-
CANCEL: "CANCEL";
|
|
432
|
-
RETURN: "RETURN";
|
|
433
|
-
EXCHANGE: "EXCHANGE";
|
|
434
|
-
}>;
|
|
435
|
-
status: z.ZodEnum<{
|
|
436
|
-
REQUESTED: "REQUESTED";
|
|
437
|
-
HELD: "HELD";
|
|
438
|
-
COLLECTING: "COLLECTING";
|
|
439
|
-
COLLECTED: "COLLECTED";
|
|
440
|
-
REDELIVERING: "REDELIVERING";
|
|
441
|
-
APPROVED: "APPROVED";
|
|
442
|
-
REJECTED: "REJECTED";
|
|
443
|
-
COMPLETED: "COMPLETED";
|
|
444
|
-
WITHDRAWN: "WITHDRAWN";
|
|
445
|
-
}>;
|
|
446
|
-
orderItemId: z.ZodString;
|
|
447
|
-
productName: z.ZodString;
|
|
448
|
-
reason: z.ZodString;
|
|
449
|
-
expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
|
|
450
|
-
rejectReason: z.ZodNullable<z.ZodString>;
|
|
451
|
-
requestedAt: z.ZodString;
|
|
452
|
-
completedAt: z.ZodNullable<z.ZodString>;
|
|
453
|
-
}, z.core.$strip>;
|
|
454
|
-
export type MyClaim = z.infer<typeof myClaimSchema>;
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region src/schemas/customer-inquiry.d.ts
|
|
457
|
-
export declare const customerInquiryCategorySchema: z.ZodEnum<{
|
|
458
|
-
RETURN: "RETURN";
|
|
459
|
-
EXCHANGE: "EXCHANGE";
|
|
460
|
-
DELIVERY: "DELIVERY";
|
|
461
|
-
PAYMENT: "PAYMENT";
|
|
462
|
-
ETC: "ETC";
|
|
463
|
-
}>;
|
|
464
|
-
export type CustomerInquiryCategory = z.infer<typeof customerInquiryCategorySchema>;
|
|
465
|
-
/** 구매자 본인 뷰 — 마스킹 없이 본인 데이터, 셀러 답변(수정횟수 제외) */
|
|
466
|
-
export declare const customerInquirySchema: z.ZodObject<{
|
|
467
|
-
inquiryId: z.ZodString;
|
|
468
|
-
category: z.ZodEnum<{
|
|
469
|
-
RETURN: "RETURN";
|
|
470
|
-
EXCHANGE: "EXCHANGE";
|
|
471
|
-
DELIVERY: "DELIVERY";
|
|
472
|
-
PAYMENT: "PAYMENT";
|
|
473
|
-
ETC: "ETC";
|
|
474
|
-
}>;
|
|
475
|
-
title: z.ZodString;
|
|
476
|
-
content: z.ZodString;
|
|
477
|
-
orderItemId: z.ZodNullable<z.ZodString>;
|
|
478
|
-
answered: z.ZodBoolean;
|
|
479
|
-
answer: z.ZodNullable<z.ZodObject<{
|
|
480
|
-
content: z.ZodString;
|
|
481
|
-
answeredAt: z.ZodString;
|
|
482
|
-
}, z.core.$strip>>;
|
|
483
|
-
createdAt: z.ZodString;
|
|
484
|
-
}, z.core.$strip>;
|
|
485
|
-
export type CustomerInquiry = z.infer<typeof customerInquirySchema>;
|
|
486
|
-
export declare const createCustomerInquiryRequestSchema: z.ZodObject<{
|
|
487
|
-
category: z.ZodEnum<{
|
|
488
|
-
RETURN: "RETURN";
|
|
489
|
-
EXCHANGE: "EXCHANGE";
|
|
490
|
-
DELIVERY: "DELIVERY";
|
|
491
|
-
PAYMENT: "PAYMENT";
|
|
492
|
-
ETC: "ETC";
|
|
493
|
-
}>;
|
|
494
|
-
title: z.ZodString;
|
|
495
|
-
content: z.ZodString;
|
|
496
|
-
orderItemId: z.ZodOptional<z.ZodString>;
|
|
497
|
-
}, z.core.$strip>;
|
|
498
|
-
export type CreateCustomerInquiryRequest = z.infer<typeof createCustomerInquiryRequestSchema>;
|
|
499
|
-
//#endregion
|
|
500
|
-
//#region src/schemas/inquiry.d.ts
|
|
501
|
-
export declare const publicInquirySchema: z.ZodObject<{
|
|
502
|
-
inquiryId: z.ZodString;
|
|
503
|
-
content: z.ZodNullable<z.ZodString>;
|
|
504
|
-
secret: z.ZodBoolean;
|
|
505
|
-
mine: z.ZodBoolean;
|
|
506
|
-
writerMaskedName: z.ZodString;
|
|
507
|
-
answer: z.ZodNullable<z.ZodObject<{
|
|
508
|
-
content: z.ZodNullable<z.ZodString>;
|
|
509
|
-
answeredAt: z.ZodString;
|
|
510
|
-
}, z.core.$strip>>;
|
|
511
|
-
createdAt: z.ZodString;
|
|
512
|
-
}, z.core.$strip>;
|
|
513
|
-
export type PublicInquiry = z.infer<typeof publicInquirySchema>;
|
|
514
|
-
export declare const createInquiryRequestSchema: z.ZodObject<{
|
|
515
|
-
content: z.ZodString;
|
|
516
|
-
secret: z.ZodDefault<z.ZodBoolean>;
|
|
517
|
-
}, z.core.$strip>;
|
|
518
|
-
export type CreateInquiryRequest = z.infer<typeof createInquiryRequestSchema>;
|
|
519
|
-
/** `POST /products/{productId}/inquiries` 응답 */
|
|
520
|
-
export declare const createInquiryResultSchema: z.ZodObject<{
|
|
521
|
-
inquiryId: z.ZodString;
|
|
522
|
-
createdAt: z.ZodString;
|
|
523
|
-
}, z.core.$strip>;
|
|
524
|
-
export type CreateInquiryResult = z.infer<typeof createInquiryResultSchema>;
|
|
525
|
-
//#endregion
|
|
526
|
-
//#region src/schemas/member.d.ts
|
|
527
|
-
export declare const memberSchema: z.ZodObject<{
|
|
528
|
-
memberId: z.ZodString;
|
|
529
|
-
email: z.ZodNullable<z.ZodEmail>;
|
|
530
|
-
name: z.ZodString;
|
|
531
|
-
phone: z.ZodNullable<z.ZodString>;
|
|
532
|
-
point: z.ZodNumber;
|
|
533
|
-
marketingAgreed: z.ZodBoolean;
|
|
534
|
-
joinedAt: z.ZodString;
|
|
535
|
-
}, z.core.$strip>;
|
|
536
|
-
export type Member = z.infer<typeof memberSchema>;
|
|
537
|
-
export declare const updateProfileRequestSchema: z.ZodObject<{
|
|
538
|
-
name: z.ZodOptional<z.ZodString>;
|
|
539
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
540
|
-
marketingAgreed: z.ZodOptional<z.ZodBoolean>;
|
|
541
|
-
}, z.core.$strip>;
|
|
542
|
-
export type UpdateProfileRequest = z.infer<typeof updateProfileRequestSchema>;
|
|
543
|
-
export declare const memberAddressSchema: z.ZodObject<{
|
|
544
|
-
addressId: z.ZodString;
|
|
545
|
-
alias: z.ZodString;
|
|
546
|
-
isDefault: z.ZodBoolean;
|
|
547
|
-
receiverName: z.ZodString;
|
|
548
|
-
phone: z.ZodString;
|
|
549
|
-
zipCode: z.ZodString;
|
|
550
|
-
address1: z.ZodString;
|
|
551
|
-
address2: z.ZodNullable<z.ZodString>;
|
|
552
|
-
}, z.core.$strip>;
|
|
553
|
-
export type MemberAddress = z.infer<typeof memberAddressSchema>;
|
|
554
|
-
export declare const memberAddressRequestSchema: z.ZodObject<{
|
|
555
|
-
alias: z.ZodString;
|
|
556
|
-
receiverName: z.ZodString;
|
|
557
|
-
phone: z.ZodString;
|
|
558
|
-
zipCode: z.ZodString;
|
|
559
|
-
address1: z.ZodString;
|
|
560
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
561
|
-
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
562
|
-
}, z.core.$strip>;
|
|
563
|
-
export type MemberAddressRequest = z.infer<typeof memberAddressRequestSchema>;
|
|
564
|
-
/** `POST /me/wishlist` 응답 — 이미 찜한 상품이어도 같은 응답이다 */
|
|
565
|
-
export declare const wishlistAddResultSchema: z.ZodObject<{
|
|
566
|
-
productId: z.ZodString;
|
|
567
|
-
wished: z.ZodLiteral<true>;
|
|
568
|
-
}, z.core.$strip>;
|
|
569
|
-
export type WishlistAddResult = z.infer<typeof wishlistAddResultSchema>;
|
|
570
|
-
//#endregion
|
|
571
|
-
//#region src/schemas/review.d.ts
|
|
572
|
-
export declare const publicReviewSchema: z.ZodObject<{
|
|
573
|
-
reviewId: z.ZodString;
|
|
574
|
-
rating: z.ZodNumber;
|
|
575
|
-
content: z.ZodString;
|
|
576
|
-
images: z.ZodArray<z.ZodURL>;
|
|
577
|
-
optionName: z.ZodNullable<z.ZodString>;
|
|
578
|
-
writerMaskedName: z.ZodString;
|
|
579
|
-
sellerReply: z.ZodNullable<z.ZodObject<{
|
|
580
|
-
content: z.ZodString;
|
|
581
|
-
repliedAt: z.ZodString;
|
|
582
|
-
}, z.core.$strip>>;
|
|
583
|
-
createdAt: z.ZodString;
|
|
584
|
-
}, z.core.$strip>;
|
|
585
|
-
export type PublicReview = z.infer<typeof publicReviewSchema>;
|
|
586
|
-
export declare const reviewSummarySchema: z.ZodObject<{
|
|
587
|
-
averageRating: z.ZodNumber;
|
|
588
|
-
totalCount: z.ZodNumber;
|
|
589
|
-
distribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
590
|
-
}, z.core.$strip>;
|
|
591
|
-
export type ReviewSummary = z.infer<typeof reviewSummarySchema>;
|
|
592
|
-
export declare const writableReviewSchema: z.ZodObject<{
|
|
593
|
-
orderItemId: z.ZodString;
|
|
594
|
-
productId: z.ZodString;
|
|
595
|
-
productName: z.ZodString;
|
|
596
|
-
optionName: z.ZodNullable<z.ZodString>;
|
|
597
|
-
thumbnailUrl: z.ZodURL;
|
|
598
|
-
writableUntil: z.ZodString;
|
|
599
|
-
}, z.core.$strip>;
|
|
600
|
-
export type WritableReview = z.infer<typeof writableReviewSchema>;
|
|
601
|
-
export declare const createReviewRequestSchema: z.ZodObject<{
|
|
602
|
-
rating: z.ZodNumber;
|
|
603
|
-
content: z.ZodString;
|
|
604
|
-
images: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
605
|
-
}, z.core.$strip>;
|
|
606
|
-
export type CreateReviewRequest = z.infer<typeof createReviewRequestSchema>;
|
|
607
|
-
export declare const createReviewResultSchema: z.ZodObject<{
|
|
608
|
-
reviewId: z.ZodString;
|
|
609
|
-
rewardPoint: z.ZodNumber;
|
|
610
|
-
}, z.core.$strip>;
|
|
611
|
-
export type CreateReviewResult = z.infer<typeof createReviewResultSchema>;
|
|
612
|
-
export declare const updateReviewRequestSchema: z.ZodObject<{
|
|
613
|
-
rating: z.ZodOptional<z.ZodNumber>;
|
|
614
|
-
content: z.ZodOptional<z.ZodString>;
|
|
615
|
-
images: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
616
|
-
}, z.core.$strip>;
|
|
617
|
-
export type UpdateReviewRequest = z.infer<typeof updateReviewRequestSchema>;
|
|
618
|
-
/** `GET /products/{productId}/reviews` 응답 — 리뷰 페이지와 평점 분포 */
|
|
619
|
-
export declare const reviewPageSchema: z.ZodObject<{
|
|
620
|
-
page: z.ZodNumber;
|
|
621
|
-
size: z.ZodNumber;
|
|
622
|
-
totalElements: z.ZodNumber;
|
|
623
|
-
totalPages: z.ZodNumber;
|
|
624
|
-
contents: z.ZodArray<z.ZodObject<{
|
|
625
|
-
reviewId: z.ZodString;
|
|
626
|
-
rating: z.ZodNumber;
|
|
627
|
-
content: z.ZodString;
|
|
628
|
-
images: z.ZodArray<z.ZodURL>;
|
|
629
|
-
optionName: z.ZodNullable<z.ZodString>;
|
|
630
|
-
writerMaskedName: z.ZodString;
|
|
631
|
-
sellerReply: z.ZodNullable<z.ZodObject<{
|
|
632
|
-
content: z.ZodString;
|
|
633
|
-
repliedAt: z.ZodString;
|
|
634
|
-
}, z.core.$strip>>;
|
|
635
|
-
createdAt: z.ZodString;
|
|
636
|
-
}, z.core.$strip>>;
|
|
637
|
-
summary: z.ZodOptional<z.ZodObject<{
|
|
638
|
-
averageRating: z.ZodNumber;
|
|
639
|
-
totalCount: z.ZodNumber;
|
|
640
|
-
distribution: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
641
|
-
}, z.core.$strip>>;
|
|
642
|
-
}, z.core.$strip>;
|
|
643
|
-
export type ReviewPage = z.infer<typeof reviewPageSchema>;
|
|
644
|
-
/** `PUT /me/reviews/{reviewId}` 응답 */
|
|
645
|
-
export declare const updateReviewResultSchema: z.ZodObject<{
|
|
646
|
-
reviewId: z.ZodString;
|
|
647
|
-
updatedAt: z.ZodString;
|
|
648
|
-
}, z.core.$strip>;
|
|
649
|
-
export type UpdateReviewResult = z.infer<typeof updateReviewResultSchema>;
|
|
650
|
-
//#endregion
|
|
651
|
-
//#region src/session.d.ts
|
|
652
|
-
/**
|
|
653
|
-
* SDK 세션 매니저 — 스토어프론트(회원, member) CREDENTIAL 로그인(email/password)의
|
|
654
|
-
* 저장·무음 갱신·회전을 캡슐화한다. store-sdk의 세션과 동형이지만 진입 메서드는
|
|
655
|
-
* `.login()`이다 (구매자는 oauth2 authorize 플로우를 타지 않는다 — `/auth/login` → tokenPair).
|
|
656
|
-
*
|
|
657
|
-
* 저장 매체(쿠키/localStorage/…)와 그 속성은 **어댑터(앱) 책임**이다. SDK는 "무엇을 어떤 키로
|
|
658
|
-
* 저장할지"만 알고, "어떻게 저장할지"는 SessionStorage 어댑터에 위임한다.
|
|
659
|
-
*/
|
|
660
|
-
interface SessionStorage {
|
|
661
|
-
get(key: string): string | null;
|
|
662
|
-
set(key: string, value: string): void;
|
|
663
|
-
remove(key: string): void;
|
|
664
|
-
}
|
|
665
|
-
/** 세션 키 상수 — SDK가 소유한다. store-sdk와 겹치지 않는 별도 네임스페이스. */
|
|
666
|
-
export declare const STOREFRONT_SESSION_KEYS: {
|
|
667
|
-
readonly accessToken: "sayren.storefront.accessToken";
|
|
668
|
-
readonly refreshToken: "sayren.storefront.refreshToken";
|
|
669
|
-
};
|
|
670
|
-
interface StorefrontSessionOptions {
|
|
671
|
-
/** 예: https://shop.api.example.com/storefront/v1 */
|
|
672
|
-
baseUrl: string;
|
|
673
|
-
/** 테넌트 스토어 코드 — X-Store-Code 헤더로 전송한다 */
|
|
674
|
-
storeCode?: string;
|
|
675
|
-
/** 저장 매체 어댑터 (앱 소유) */
|
|
676
|
-
storage: SessionStorage;
|
|
677
|
-
fetch?: typeof globalThis.fetch;
|
|
678
|
-
}
|
|
679
|
-
interface StorefrontSession {
|
|
680
|
-
/** POST /auth/login — 성공 시 accessToken/refreshToken 저장 + 구독자 통지 */
|
|
681
|
-
login(body: LoginRequest): Promise<void>;
|
|
682
|
-
/** POST /auth/signup — login과 동일하게 tokenPair를 저장한다 */
|
|
683
|
-
signup(body: SignupRequest): Promise<void>;
|
|
684
|
-
/**
|
|
685
|
-
* 무음 세션 갱신 — refreshToken으로 새 tokenPair를 받아 회전 저장한다.
|
|
686
|
-
* - 탭 내부: 동시 다발 호출을 single-flight로 합친다.
|
|
687
|
-
* - 탭 간: navigator.locks(있으면)로 회전을 직렬화하고, 락 진입 시 다른 탭이 이미
|
|
688
|
-
* 회전했으면(accessToken 변경) 내 refreshToken을 소비하지 않고 true를 반환한다.
|
|
689
|
-
* refreshToken이 없거나 실패(만료·재사용 폐기)하면 세션을 clear하고 false.
|
|
690
|
-
*/
|
|
691
|
-
refresh(): Promise<boolean>;
|
|
692
|
-
/** 현재 accessToken (없으면 null) */
|
|
693
|
-
readonly accessToken: string | null;
|
|
694
|
-
/** 현재 refreshToken (없으면 null) */
|
|
695
|
-
readonly refreshToken: string | null;
|
|
696
|
-
/** GET /me — 토큰이 없으면 null, 있으면 Member */
|
|
697
|
-
userinfo(): Promise<Member | null>;
|
|
698
|
-
/** 세션 키를 지우고 best-effort로 /auth/logout을 호출한 뒤 구독자에게 통지한다 */
|
|
699
|
-
clear(): void;
|
|
700
|
-
/** 변경 구독(useSyncExternalStore 소비용) — 해지 함수 반환 */
|
|
701
|
-
subscribe(cb: () => void): () => void;
|
|
702
|
-
}
|
|
703
|
-
export declare function createStorefrontSession(options: StorefrontSessionOptions): StorefrontSession;
|
|
704
|
-
//#endregion
|
|
705
|
-
//#region src/client.d.ts
|
|
706
|
-
interface StorefrontClientOptions {
|
|
707
|
-
/** 예: https://demo.store.example.com/api/v1 */
|
|
708
|
-
baseUrl: string;
|
|
709
|
-
/**
|
|
710
|
-
* 테넌트 스토어 코드 — `X-Store-Code` 헤더로 전송한다. 공유 API 호스트로 접근할 때
|
|
711
|
-
* 서버가 Host 서브도메인을 추측하는 대신 명시적으로 테넌트를 지정한다(멀티테넌트 격리).
|
|
712
|
-
* 함수로 전달하면 매 요청마다 재평가.
|
|
713
|
-
*/
|
|
714
|
-
storeCode?: TokenSource;
|
|
715
|
-
/** 회원 Access Token. 함수로 전달하면 매 요청마다 재평가 */
|
|
716
|
-
accessToken?: TokenSource;
|
|
717
|
-
/**
|
|
718
|
-
* accessToken의 별칭 옵션 — `{ auth: { accessToken } }` 형태로 전달할 수 있다.
|
|
719
|
-
* 우선순위: 명시적 `accessToken` 옵션 > `auth.accessToken` > `session.accessToken`.
|
|
720
|
-
*/
|
|
721
|
-
auth?: {
|
|
722
|
-
accessToken?: string;
|
|
723
|
-
};
|
|
724
|
-
/** 비회원 장바구니 토큰 */
|
|
725
|
-
cartToken?: TokenSource;
|
|
726
|
-
/**
|
|
727
|
-
* 방문 분석 식별자 — 방문자·세션 ID(`sy_vid`·`sy_sid` 쿠키 값). 실으면 서버가 장바구니 담기·결제 시작·구매를
|
|
728
|
-
* 이 방문과 이어 기록한다. 브라우저는 `@sayren/storefront-sdk/analytics`의 `analytics.ids()`, SSR은
|
|
729
|
-
* `analyticsIdsFromCookie(request.headers.get("cookie"))`로 얻는다. 함수로 전달하면 매 요청마다 재평가.
|
|
730
|
-
*/
|
|
731
|
-
visitorId?: TokenSource;
|
|
732
|
-
sessionId?: TokenSource;
|
|
733
|
-
/** 서버가 새 X-Cart-Token을 발급했을 때 호출 */
|
|
734
|
-
onCartToken?: (token: string) => void;
|
|
735
|
-
/**
|
|
736
|
-
* SDK 세션 매니저 — 전달하면 accessToken(Bearer)·401 refresh·복구불가 시 clear를
|
|
737
|
-
* 자동 배선한다. `accessToken`/`auth.accessToken`을 명시하면 그쪽이 우선한다(하위호환).
|
|
738
|
-
*/
|
|
739
|
-
session?: StorefrontSession;
|
|
740
|
-
fetch?: typeof globalThis.fetch;
|
|
741
|
-
}
|
|
742
|
-
export declare function createStorefrontClient(options: StorefrontClientOptions): {
|
|
743
|
-
/** 현재 세션 accessToken (session 미전달 시 null) */
|
|
744
|
-
readonly accessToken: string | null;
|
|
745
|
-
/** 현재 세션 refreshToken (session 미전달 시 null) */
|
|
746
|
-
readonly refreshToken: string | null;
|
|
747
|
-
/** session.userinfo() 위임 — session 미전달 시 에러 */
|
|
748
|
-
userinfo(): Promise<{
|
|
749
|
-
memberId: string;
|
|
750
|
-
email: string | null;
|
|
751
|
-
name: string;
|
|
752
|
-
phone: string | null;
|
|
753
|
-
point: number;
|
|
754
|
-
marketingAgreed: boolean;
|
|
755
|
-
joinedAt: string;
|
|
756
|
-
} | null>;
|
|
757
|
-
auth: {
|
|
758
|
-
/** 비회원 익명 세션 발급 — 응답의 cartToken을 `cartToken` 옵션(X-Cart-Token)으로 쓴다 */
|
|
759
|
-
anonymous: () => Promise<{
|
|
760
|
-
cartToken: string;
|
|
761
|
-
expiresAt: string;
|
|
762
|
-
}>;
|
|
763
|
-
signup: (body: SignupRequest) => Promise<{
|
|
764
|
-
accessToken: string;
|
|
765
|
-
refreshToken: string;
|
|
766
|
-
expiresIn: number;
|
|
767
|
-
}>;
|
|
768
|
-
login: (body: LoginRequest) => Promise<{
|
|
769
|
-
accessToken: string;
|
|
770
|
-
refreshToken: string;
|
|
771
|
-
expiresIn: number;
|
|
772
|
-
}>;
|
|
773
|
-
refresh: (refreshToken: string) => Promise<{
|
|
774
|
-
accessToken: string;
|
|
775
|
-
refreshToken: string;
|
|
776
|
-
expiresIn: number;
|
|
777
|
-
}>;
|
|
778
|
-
logout: () => Promise<void>;
|
|
779
|
-
/** 소셜 로그인 시작 — 공급자 로그인 주소를 받는다. PKCE·state는 `@sayren/storefront-sdk/auth`의 `idp()`가 만든다 */
|
|
780
|
-
idpAuthorize: (provider: SocialProvider, body: IdpAuthorizeRequest) => Promise<{
|
|
781
|
-
url: string;
|
|
782
|
-
}>;
|
|
783
|
-
/** 소셜 로그인 마무리 — 돌아온 1회용 code + codeVerifier를 구매자 토큰으로 바꾼다 */
|
|
784
|
-
idpToken: (body: IdpTokenRequest) => Promise<{
|
|
785
|
-
accessToken: string;
|
|
786
|
-
refreshToken: string;
|
|
787
|
-
expiresIn: number;
|
|
788
|
-
}>;
|
|
789
|
-
/** 구매자 탈퇴 — 로그인 상태(accessToken)에서 비밀번호로 본인 확인. 성공하면 토큰은 모두 무효 */
|
|
790
|
-
withdraw: (body: WithdrawRequest) => Promise<void>;
|
|
791
|
-
/** 로그인 수단 — 비밀번호 여부와 연결된 소셜 계정(로그인 필요) */
|
|
792
|
-
identities: () => Promise<{
|
|
793
|
-
hasPassword: boolean;
|
|
794
|
-
hasExternalAuth: boolean;
|
|
795
|
-
identities: {
|
|
796
|
-
provider: "kakao" | "naver" | "google";
|
|
797
|
-
email: string | null;
|
|
798
|
-
linkedAt: string;
|
|
799
|
-
}[];
|
|
800
|
-
}>;
|
|
801
|
-
/** 소셜 계정 연결 시작(로그인 필요) — 공급자 로그인 주소를 받는다. 본문은 `idpAuthorize`와 같다 */
|
|
802
|
-
linkIdentityAuthorize: (provider: SocialProvider, body: IdpAuthorizeRequest) => Promise<{
|
|
803
|
-
url: string;
|
|
804
|
-
}>;
|
|
805
|
-
/** 소셜 계정 연결 마무리 — 돌아온 code + codeVerifier로 이 구매자에 연결한다 */
|
|
806
|
-
linkIdentity: (provider: SocialProvider, body: LinkIdentityRequest) => Promise<{
|
|
807
|
-
hasPassword: boolean;
|
|
808
|
-
hasExternalAuth: boolean;
|
|
809
|
-
identities: {
|
|
810
|
-
provider: "kakao" | "naver" | "google";
|
|
811
|
-
email: string | null;
|
|
812
|
-
linkedAt: string;
|
|
813
|
-
}[];
|
|
814
|
-
}>;
|
|
815
|
-
/** 소셜 계정 연결 해제 — 마지막 로그인 수단이면 409 `LAST_LOGIN_METHOD` */
|
|
816
|
-
unlinkIdentity: (provider: SocialProvider) => Promise<{
|
|
817
|
-
hasPassword: boolean;
|
|
818
|
-
hasExternalAuth: boolean;
|
|
819
|
-
identities: {
|
|
820
|
-
provider: "kakao" | "naver" | "google";
|
|
821
|
-
email: string | null;
|
|
822
|
-
linkedAt: string;
|
|
823
|
-
}[];
|
|
824
|
-
}>;
|
|
825
|
-
};
|
|
826
|
-
store: {
|
|
827
|
-
/** 스토어 공개 설정 — 이름·고객센터·비회원 주문 허용 여부 */
|
|
828
|
-
get: () => Promise<{
|
|
829
|
-
storeCode: string;
|
|
830
|
-
name: string;
|
|
831
|
-
logoUrl: string | null;
|
|
832
|
-
customerCenterPhone: string | null;
|
|
833
|
-
businessHours: string | null;
|
|
834
|
-
guestCheckout: boolean;
|
|
835
|
-
loginMethods: ("password" | "kakao" | "naver" | "google")[];
|
|
836
|
-
}>;
|
|
837
|
-
};
|
|
838
|
-
catalog: {
|
|
839
|
-
listCategories: () => Promise<CategoryNode[]>;
|
|
840
|
-
searchProducts: (params?: ProductSearchParams) => Promise<{
|
|
841
|
-
page: number;
|
|
842
|
-
size: number;
|
|
843
|
-
totalElements: number;
|
|
844
|
-
totalPages: number;
|
|
845
|
-
contents: {
|
|
846
|
-
productId: string;
|
|
847
|
-
name: string;
|
|
848
|
-
thumbnailUrl: string;
|
|
849
|
-
salePrice: number;
|
|
850
|
-
discountedPrice: number | null;
|
|
851
|
-
discountRate: number | null;
|
|
852
|
-
freeShipping: boolean;
|
|
853
|
-
averageRating: number;
|
|
854
|
-
reviewCount: number;
|
|
855
|
-
soldOut: boolean;
|
|
856
|
-
}[];
|
|
857
|
-
facets?: {
|
|
858
|
-
categories?: {
|
|
859
|
-
categoryId: string;
|
|
860
|
-
name: string;
|
|
861
|
-
count: number;
|
|
862
|
-
}[] | undefined;
|
|
863
|
-
priceRange?: {
|
|
864
|
-
min: number;
|
|
865
|
-
max: number;
|
|
866
|
-
} | undefined;
|
|
867
|
-
} | undefined;
|
|
868
|
-
}>;
|
|
869
|
-
getProduct: (productId: string) => Promise<{
|
|
870
|
-
productId: string;
|
|
871
|
-
name: string;
|
|
872
|
-
thumbnailUrl: string;
|
|
873
|
-
salePrice: number;
|
|
874
|
-
discountedPrice: number | null;
|
|
875
|
-
discountRate: number | null;
|
|
876
|
-
freeShipping: boolean;
|
|
877
|
-
averageRating: number;
|
|
878
|
-
reviewCount: number;
|
|
879
|
-
soldOut: boolean;
|
|
880
|
-
description: string;
|
|
881
|
-
images: string[];
|
|
882
|
-
optionGroups: {
|
|
883
|
-
groupId: string;
|
|
884
|
-
name: string;
|
|
885
|
-
values: {
|
|
886
|
-
valueId: string;
|
|
887
|
-
name: string;
|
|
888
|
-
}[];
|
|
889
|
-
}[];
|
|
890
|
-
variants: {
|
|
891
|
-
variantId: string;
|
|
892
|
-
valueIds: string[];
|
|
893
|
-
name: string;
|
|
894
|
-
additionalPrice: number;
|
|
895
|
-
soldOut: boolean;
|
|
896
|
-
}[];
|
|
897
|
-
delivery: {
|
|
898
|
-
type: "PAID" | "FREE" | "CONDITIONAL_FREE";
|
|
899
|
-
fee: number;
|
|
900
|
-
conditionalFreeAmount: number | null;
|
|
901
|
-
estimatedDays: string;
|
|
902
|
-
};
|
|
903
|
-
returnPolicy: {
|
|
904
|
-
returnFee: number;
|
|
905
|
-
exchangeFee: number;
|
|
906
|
-
periodDays: number;
|
|
907
|
-
};
|
|
908
|
-
categoryPath: {
|
|
909
|
-
categoryId: string;
|
|
910
|
-
name: string;
|
|
911
|
-
}[];
|
|
912
|
-
}>;
|
|
913
|
-
listProductReviews: (productId: string, params?: PageParams & {
|
|
914
|
-
rating?: number;
|
|
915
|
-
hasImage?: boolean;
|
|
916
|
-
sort?: "latest" | "ratingDesc" | "ratingAsc" | "helpful";
|
|
917
|
-
}) => Promise<{
|
|
918
|
-
page: number;
|
|
919
|
-
size: number;
|
|
920
|
-
totalElements: number;
|
|
921
|
-
totalPages: number;
|
|
922
|
-
contents: {
|
|
923
|
-
reviewId: string;
|
|
924
|
-
rating: number;
|
|
925
|
-
content: string;
|
|
926
|
-
images: string[];
|
|
927
|
-
optionName: string | null;
|
|
928
|
-
writerMaskedName: string;
|
|
929
|
-
sellerReply: {
|
|
930
|
-
content: string;
|
|
931
|
-
repliedAt: string;
|
|
932
|
-
} | null;
|
|
933
|
-
createdAt: string;
|
|
934
|
-
}[];
|
|
935
|
-
summary?: {
|
|
936
|
-
averageRating: number;
|
|
937
|
-
totalCount: number;
|
|
938
|
-
distribution: Record<string, number>;
|
|
939
|
-
} | undefined;
|
|
940
|
-
}>;
|
|
941
|
-
listProductInquiries: (productId: string, params?: PageParams) => Promise<{
|
|
942
|
-
page: number;
|
|
943
|
-
size: number;
|
|
944
|
-
totalElements: number;
|
|
945
|
-
totalPages: number;
|
|
946
|
-
contents: {
|
|
947
|
-
inquiryId: string;
|
|
948
|
-
content: string | null;
|
|
949
|
-
secret: boolean;
|
|
950
|
-
mine: boolean;
|
|
951
|
-
writerMaskedName: string;
|
|
952
|
-
answer: {
|
|
953
|
-
content: string | null;
|
|
954
|
-
answeredAt: string;
|
|
955
|
-
} | null;
|
|
956
|
-
createdAt: string;
|
|
957
|
-
}[];
|
|
958
|
-
}>;
|
|
959
|
-
createInquiry: (productId: string, body: CreateInquiryRequest) => Promise<void>;
|
|
960
|
-
};
|
|
961
|
-
cart: {
|
|
962
|
-
get: () => Promise<{
|
|
963
|
-
items: {
|
|
964
|
-
cartItemId: string;
|
|
965
|
-
productId: string;
|
|
966
|
-
productName: string;
|
|
967
|
-
thumbnailUrl: string;
|
|
968
|
-
optionId: string | null;
|
|
969
|
-
optionName: string | null;
|
|
970
|
-
quantity: number;
|
|
971
|
-
unitPrice: number;
|
|
972
|
-
totalPrice: number;
|
|
973
|
-
purchasable: boolean;
|
|
974
|
-
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
975
|
-
}[];
|
|
976
|
-
summary: {
|
|
977
|
-
productAmount: number;
|
|
978
|
-
deliveryFee: number;
|
|
979
|
-
totalAmount: number;
|
|
980
|
-
};
|
|
981
|
-
}>;
|
|
982
|
-
addItem: (body: AddCartItemRequest) => Promise<{
|
|
983
|
-
items: {
|
|
984
|
-
cartItemId: string;
|
|
985
|
-
productId: string;
|
|
986
|
-
productName: string;
|
|
987
|
-
thumbnailUrl: string;
|
|
988
|
-
optionId: string | null;
|
|
989
|
-
optionName: string | null;
|
|
990
|
-
quantity: number;
|
|
991
|
-
unitPrice: number;
|
|
992
|
-
totalPrice: number;
|
|
993
|
-
purchasable: boolean;
|
|
994
|
-
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
995
|
-
}[];
|
|
996
|
-
summary: {
|
|
997
|
-
productAmount: number;
|
|
998
|
-
deliveryFee: number;
|
|
999
|
-
totalAmount: number;
|
|
1000
|
-
};
|
|
1001
|
-
}>;
|
|
1002
|
-
updateItem: (cartItemId: string, body: UpdateCartItemRequest) => Promise<{
|
|
1003
|
-
items: {
|
|
1004
|
-
cartItemId: string;
|
|
1005
|
-
productId: string;
|
|
1006
|
-
productName: string;
|
|
1007
|
-
thumbnailUrl: string;
|
|
1008
|
-
optionId: string | null;
|
|
1009
|
-
optionName: string | null;
|
|
1010
|
-
quantity: number;
|
|
1011
|
-
unitPrice: number;
|
|
1012
|
-
totalPrice: number;
|
|
1013
|
-
purchasable: boolean;
|
|
1014
|
-
unpurchasableReason: "SOLD_OUT" | "SUSPENDED" | "CLOSED" | null;
|
|
1015
|
-
}[];
|
|
1016
|
-
summary: {
|
|
1017
|
-
productAmount: number;
|
|
1018
|
-
deliveryFee: number;
|
|
1019
|
-
totalAmount: number;
|
|
1020
|
-
};
|
|
1021
|
-
}>;
|
|
1022
|
-
removeItem: (cartItemId: string) => Promise<void>;
|
|
1023
|
-
};
|
|
1024
|
-
checkout: {
|
|
1025
|
-
create: (body: CreateCheckoutRequest) => Promise<{
|
|
1026
|
-
checkoutId: string;
|
|
1027
|
-
items: {
|
|
1028
|
-
productId: string;
|
|
1029
|
-
productName: string;
|
|
1030
|
-
optionId: string | null;
|
|
1031
|
-
optionName: string | null;
|
|
1032
|
-
quantity: number;
|
|
1033
|
-
unitPrice: number;
|
|
1034
|
-
totalPrice: number;
|
|
1035
|
-
}[];
|
|
1036
|
-
amounts: {
|
|
1037
|
-
productAmount: number;
|
|
1038
|
-
deliveryFee: number;
|
|
1039
|
-
totalAmount: number;
|
|
1040
|
-
};
|
|
1041
|
-
expiresAt: string;
|
|
1042
|
-
testPayment: boolean;
|
|
1043
|
-
}>;
|
|
1044
|
-
/**
|
|
1045
|
-
* 결제 시작 — 결제 세션을 만들고 결제 팝업 URL(`pgParams.popupUrl`)을 돌려준다.
|
|
1046
|
-
* `pgProvider`는 첫 결제 시도의 PG다(현재 `tosspayments`·`portone`, 새 PG가 추가돼도 파싱은 깨지지 않는다).
|
|
1047
|
-
*
|
|
1048
|
-
* PG 관련 에러(`ApiError.code`) — 둘 다 "결제 수단 준비 중" 안내를 권장한다.
|
|
1049
|
-
* - 409 `PAYMENT_NOT_CONFIGURED`: 스토어에 사용 중인 PG가 없다. 결제 세션을 만들지 않는다
|
|
1050
|
-
* - 503 `PAYMENT_PROVIDER_UNAVAILABLE`: 사용 중인 PG가 모두 준비 장애다. 잠시 후 재시도할 수 있다
|
|
1051
|
-
*/
|
|
1052
|
-
requestPayment: (checkoutId: string, body: RequestPaymentRequest) => Promise<{
|
|
1053
|
-
paymentId: string;
|
|
1054
|
-
pgProvider: string;
|
|
1055
|
-
pgParams: {
|
|
1056
|
-
[x: string]: unknown;
|
|
1057
|
-
popupUrl: string;
|
|
1058
|
-
attemptId?: string | undefined;
|
|
1059
|
-
provider?: string | undefined;
|
|
1060
|
-
mock?: boolean | undefined;
|
|
1061
|
-
environment?: string | undefined;
|
|
1062
|
-
};
|
|
1063
|
-
expiresAt: string;
|
|
1064
|
-
testPayment: boolean;
|
|
1065
|
-
}>;
|
|
1066
|
-
/**
|
|
1067
|
-
* 결제 승인 확정 — 같은 `paymentId + pgToken` 재호출은 저장된 결과를 돌려준다(멱등).
|
|
1068
|
-
* `options.attemptId`는 결제창이 돌려준 주문번호(시도 id)이고, 생략하면 현재 시도를 승인한다.
|
|
1069
|
-
*
|
|
1070
|
-
* 요청 본문은 보내기 전에 `confirmPaymentRequestSchema`로 검증한다. 빈 `pgToken`처럼 형식이 틀리면
|
|
1071
|
-
* 요청을 보내지 않고 **동기로 ZodError를 던진다**(Promise reject 아님 — 다른 메서드의 요청 검증과 같다).
|
|
1072
|
-
*
|
|
1073
|
-
* 카드 거절(402 `PG_DECLINED` 등)·402 `PAYMENT_NOT_APPROVED`·502 `PG_REQUEST_FAILED`·
|
|
1074
|
-
* 503 `PG_CREDENTIALS_UNAVAILABLE` 뒤에도 세션은 `pending`으로 남아 다시 시도할 수 있다.
|
|
1075
|
-
* 409 `LATE_APPROVAL_CANCELED`(미승인으로 판정된 뒤 늦게 온 승인을 서버가 PG 취소함)도 세션이 `pending`으로 남는다.
|
|
1076
|
-
* 409 `PAYMENT_RESULT_UNKNOWN`은 결과 확인 중이라 재시도하면 안 된다. 그 밖의 409:
|
|
1077
|
-
* `ATTEMPT_NOT_CURRENT`·`INVALID_ATTEMPT_STATE`·`PAYMENT_SESSION_OUTDATED`·`PG_AMOUNT_MISMATCH`.
|
|
1078
|
-
* 503 `PG_MERCHANT_MISMATCH`: 승인 시도의 가맹점과 현재 저장된 자격 증명의 가맹점이 다르다.
|
|
1079
|
-
*/
|
|
1080
|
-
confirmPayment: (paymentId: string, pgToken: string, options?: {
|
|
1081
|
-
attemptId?: string;
|
|
1082
|
-
}) => Promise<{
|
|
1083
|
-
orderId: string;
|
|
1084
|
-
status: "PAID";
|
|
1085
|
-
totalAmount: number;
|
|
1086
|
-
paidAt: string;
|
|
1087
|
-
}>;
|
|
1088
|
-
};
|
|
1089
|
-
payments: {
|
|
1090
|
-
/**
|
|
1091
|
-
* `GET /storefront/v1/payments/{paymentId}` — 결제 상태 조회. 결제 팝업이 결과(postMessage)를 알리지 못하고 닫혔을 때
|
|
1092
|
-
* 부모 창이 `expiresAt`까지 폴링해 결과를 확인한다. `completed`면 `orderId`로 완료 화면, `processing`이면 계속 폴링,
|
|
1093
|
-
* `pending`이면 기존 안내, `failed`·`expired`면 실패 안내다. TTL이 지난 `pending`은 `expired`로 보고된다.
|
|
1094
|
-
* `testPayment`는 완료면 주문 플래그, 아니면 세션 환경이다.
|
|
1095
|
-
*
|
|
1096
|
-
* 에러: 404 `PAYMENT_NOT_FOUND`(없음·다른 스토어) · 410 `STORE_CLOSED` · 503 `STORE_SUSPENDED`
|
|
1097
|
-
*/
|
|
1098
|
-
getStatus: (paymentId: string) => Promise<{
|
|
1099
|
-
paymentId: string;
|
|
1100
|
-
status: string;
|
|
1101
|
-
orderId: string | null;
|
|
1102
|
-
testPayment: boolean;
|
|
1103
|
-
expiresAt: string;
|
|
1104
|
-
}>;
|
|
1105
|
-
};
|
|
1106
|
-
myOrders: {
|
|
1107
|
-
list: (params?: PageParams & {
|
|
1108
|
-
status?: OrderItemStatus;
|
|
1109
|
-
from?: string;
|
|
1110
|
-
}) => Promise<{
|
|
1111
|
-
page: number;
|
|
1112
|
-
size: number;
|
|
1113
|
-
totalElements: number;
|
|
1114
|
-
totalPages: number;
|
|
1115
|
-
contents: {
|
|
1116
|
-
orderId: string;
|
|
1117
|
-
orderedAt: string;
|
|
1118
|
-
items: {
|
|
1119
|
-
orderItemId: string;
|
|
1120
|
-
productId: string;
|
|
1121
|
-
productName: string;
|
|
1122
|
-
thumbnailUrl: string;
|
|
1123
|
-
optionName: string | null;
|
|
1124
|
-
quantity: number;
|
|
1125
|
-
totalPrice: number;
|
|
1126
|
-
status: "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
|
|
1127
|
-
claimStatus: string | null;
|
|
1128
|
-
reviewWritten: boolean;
|
|
1129
|
-
autoDecisionDate: string | null;
|
|
1130
|
-
}[];
|
|
1131
|
-
shippingAddress: {
|
|
1132
|
-
receiverName: string;
|
|
1133
|
-
phone: string;
|
|
1134
|
-
zipCode: string;
|
|
1135
|
-
address1: string;
|
|
1136
|
-
address2?: string | null | undefined;
|
|
1137
|
-
deliveryMemo?: string | null | undefined;
|
|
1138
|
-
entranceCode?: string | null | undefined;
|
|
1139
|
-
};
|
|
1140
|
-
payment: {
|
|
1141
|
-
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY";
|
|
1142
|
-
totalAmount: number;
|
|
1143
|
-
paidAt: string | null;
|
|
1144
|
-
receiptUrl: string | null;
|
|
1145
|
-
};
|
|
1146
|
-
testPayment: boolean;
|
|
1147
|
-
}[];
|
|
1148
|
-
}>;
|
|
1149
|
-
get: (orderId: string) => Promise<{
|
|
1150
|
-
orderId: string;
|
|
1151
|
-
orderedAt: string;
|
|
1152
|
-
items: {
|
|
1153
|
-
orderItemId: string;
|
|
1154
|
-
productId: string;
|
|
1155
|
-
productName: string;
|
|
1156
|
-
thumbnailUrl: string;
|
|
1157
|
-
optionName: string | null;
|
|
1158
|
-
quantity: number;
|
|
1159
|
-
totalPrice: number;
|
|
1160
|
-
status: "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
|
|
1161
|
-
claimStatus: string | null;
|
|
1162
|
-
reviewWritten: boolean;
|
|
1163
|
-
autoDecisionDate: string | null;
|
|
1164
|
-
}[];
|
|
1165
|
-
shippingAddress: {
|
|
1166
|
-
receiverName: string;
|
|
1167
|
-
phone: string;
|
|
1168
|
-
zipCode: string;
|
|
1169
|
-
address1: string;
|
|
1170
|
-
address2?: string | null | undefined;
|
|
1171
|
-
deliveryMemo?: string | null | undefined;
|
|
1172
|
-
entranceCode?: string | null | undefined;
|
|
1173
|
-
};
|
|
1174
|
-
payment: {
|
|
1175
|
-
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY";
|
|
1176
|
-
totalAmount: number;
|
|
1177
|
-
paidAt: string | null;
|
|
1178
|
-
receiptUrl: string | null;
|
|
1179
|
-
};
|
|
1180
|
-
testPayment: boolean;
|
|
1181
|
-
}>;
|
|
1182
|
-
getGuestOrder: (orderId: string, body: {
|
|
1183
|
-
phone: string;
|
|
1184
|
-
orderPassword: string;
|
|
1185
|
-
}) => Promise<{
|
|
1186
|
-
orderId: string;
|
|
1187
|
-
orderedAt: string;
|
|
1188
|
-
items: {
|
|
1189
|
-
orderItemId: string;
|
|
1190
|
-
productId: string;
|
|
1191
|
-
productName: string;
|
|
1192
|
-
thumbnailUrl: string;
|
|
1193
|
-
optionName: string | null;
|
|
1194
|
-
quantity: number;
|
|
1195
|
-
totalPrice: number;
|
|
1196
|
-
status: "PAYMENT_WAITING" | "PAID" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
|
|
1197
|
-
claimStatus: string | null;
|
|
1198
|
-
reviewWritten: boolean;
|
|
1199
|
-
autoDecisionDate: string | null;
|
|
1200
|
-
}[];
|
|
1201
|
-
shippingAddress: {
|
|
1202
|
-
receiverName: string;
|
|
1203
|
-
phone: string;
|
|
1204
|
-
zipCode: string;
|
|
1205
|
-
address1: string;
|
|
1206
|
-
address2?: string | null | undefined;
|
|
1207
|
-
deliveryMemo?: string | null | undefined;
|
|
1208
|
-
entranceCode?: string | null | undefined;
|
|
1209
|
-
};
|
|
1210
|
-
payment: {
|
|
1211
|
-
method: "CARD" | "BANK_TRANSFER" | "VIRTUAL_ACCOUNT" | "MOBILE" | "EASY_PAY";
|
|
1212
|
-
totalAmount: number;
|
|
1213
|
-
paidAt: string | null;
|
|
1214
|
-
receiptUrl: string | null;
|
|
1215
|
-
};
|
|
1216
|
-
testPayment: boolean;
|
|
1217
|
-
}>;
|
|
1218
|
-
getDelivery: (orderItemId: string) => Promise<{
|
|
1219
|
-
carrierName: string;
|
|
1220
|
-
trackingNumber: string;
|
|
1221
|
-
trackingUrl: string;
|
|
1222
|
-
status: "DISPATCHED" | "DELIVERING" | "DELIVERED";
|
|
1223
|
-
trackingEvents: {
|
|
1224
|
-
status: string;
|
|
1225
|
-
location: string;
|
|
1226
|
-
occurredAt: string;
|
|
1227
|
-
}[];
|
|
1228
|
-
}>;
|
|
1229
|
-
decidePurchase: (orderItemId: string) => Promise<void>;
|
|
1230
|
-
};
|
|
1231
|
-
myClaims: {
|
|
1232
|
-
create: (orderItemId: string, body: CreateClaimRequest) => Promise<{
|
|
1233
|
-
claimId: string;
|
|
1234
|
-
status: "REQUESTED";
|
|
1235
|
-
expectedRefundAmount: number | null;
|
|
1236
|
-
claimDeliveryFee: number;
|
|
1237
|
-
}>;
|
|
1238
|
-
list: (params?: PageParams & {
|
|
1239
|
-
status?: ClaimStatus;
|
|
1240
|
-
}) => Promise<{
|
|
1241
|
-
page: number;
|
|
1242
|
-
size: number;
|
|
1243
|
-
totalElements: number;
|
|
1244
|
-
totalPages: number;
|
|
1245
|
-
contents: {
|
|
1246
|
-
claimId: string;
|
|
1247
|
-
type: "CANCEL" | "RETURN" | "EXCHANGE";
|
|
1248
|
-
status: "REQUESTED" | "HELD" | "COLLECTING" | "COLLECTED" | "REDELIVERING" | "APPROVED" | "REJECTED" | "COMPLETED" | "WITHDRAWN";
|
|
1249
|
-
orderItemId: string;
|
|
1250
|
-
productName: string;
|
|
1251
|
-
reason: string;
|
|
1252
|
-
expectedRefundAmount: number | null;
|
|
1253
|
-
rejectReason: string | null;
|
|
1254
|
-
requestedAt: string;
|
|
1255
|
-
completedAt: string | null;
|
|
1256
|
-
}[];
|
|
1257
|
-
}>;
|
|
1258
|
-
withdraw: (claimId: string) => Promise<void>;
|
|
1259
|
-
};
|
|
1260
|
-
member: {
|
|
1261
|
-
me: () => Promise<{
|
|
1262
|
-
memberId: string;
|
|
1263
|
-
email: string | null;
|
|
1264
|
-
name: string;
|
|
1265
|
-
phone: string | null;
|
|
1266
|
-
point: number;
|
|
1267
|
-
marketingAgreed: boolean;
|
|
1268
|
-
joinedAt: string;
|
|
1269
|
-
}>;
|
|
1270
|
-
updateMe: (body: UpdateProfileRequest) => Promise<void>;
|
|
1271
|
-
listAddresses: () => Promise<{
|
|
1272
|
-
addressId: string;
|
|
1273
|
-
alias: string;
|
|
1274
|
-
isDefault: boolean;
|
|
1275
|
-
receiverName: string;
|
|
1276
|
-
phone: string;
|
|
1277
|
-
zipCode: string;
|
|
1278
|
-
address1: string;
|
|
1279
|
-
address2: string | null;
|
|
1280
|
-
}[]>;
|
|
1281
|
-
createAddress: (body: MemberAddressRequest) => Promise<void>;
|
|
1282
|
-
updateAddress: (addressId: string, body: MemberAddressRequest) => Promise<void>;
|
|
1283
|
-
deleteAddress: (addressId: string) => Promise<void>;
|
|
1284
|
-
listWishlist: (params?: PageParams) => Promise<{
|
|
1285
|
-
page: number;
|
|
1286
|
-
size: number;
|
|
1287
|
-
totalElements: number;
|
|
1288
|
-
totalPages: number;
|
|
1289
|
-
contents: {
|
|
1290
|
-
productId: string;
|
|
1291
|
-
name: string;
|
|
1292
|
-
thumbnailUrl: string;
|
|
1293
|
-
salePrice: number;
|
|
1294
|
-
discountedPrice: number | null;
|
|
1295
|
-
discountRate: number | null;
|
|
1296
|
-
freeShipping: boolean;
|
|
1297
|
-
averageRating: number;
|
|
1298
|
-
reviewCount: number;
|
|
1299
|
-
soldOut: boolean;
|
|
1300
|
-
}[];
|
|
1301
|
-
}>;
|
|
1302
|
-
addWishlist: (productId: string) => Promise<void>;
|
|
1303
|
-
removeWishlist: (productId: string) => Promise<void>;
|
|
1304
|
-
};
|
|
1305
|
-
reviews: {
|
|
1306
|
-
listWritable: () => Promise<{
|
|
1307
|
-
orderItemId: string;
|
|
1308
|
-
productId: string;
|
|
1309
|
-
productName: string;
|
|
1310
|
-
optionName: string | null;
|
|
1311
|
-
thumbnailUrl: string;
|
|
1312
|
-
writableUntil: string;
|
|
1313
|
-
}[]>;
|
|
1314
|
-
create: (orderItemId: string, body: CreateReviewRequest) => Promise<{
|
|
1315
|
-
reviewId: string;
|
|
1316
|
-
rewardPoint: number;
|
|
1317
|
-
}>;
|
|
1318
|
-
update: (reviewId: string, body: UpdateReviewRequest) => Promise<void>;
|
|
1319
|
-
remove: (reviewId: string) => Promise<void>;
|
|
1320
|
-
};
|
|
1321
|
-
inquiries: {
|
|
1322
|
-
listMine: (params?: PageParams & {
|
|
1323
|
-
answered?: boolean;
|
|
1324
|
-
}) => Promise<{
|
|
1325
|
-
page: number;
|
|
1326
|
-
size: number;
|
|
1327
|
-
totalElements: number;
|
|
1328
|
-
totalPages: number;
|
|
1329
|
-
contents: {
|
|
1330
|
-
inquiryId: string;
|
|
1331
|
-
content: string | null;
|
|
1332
|
-
secret: boolean;
|
|
1333
|
-
mine: boolean;
|
|
1334
|
-
writerMaskedName: string;
|
|
1335
|
-
answer: {
|
|
1336
|
-
content: string | null;
|
|
1337
|
-
answeredAt: string;
|
|
1338
|
-
} | null;
|
|
1339
|
-
createdAt: string;
|
|
1340
|
-
}[];
|
|
1341
|
-
}>;
|
|
1342
|
-
};
|
|
1343
|
-
me: {
|
|
1344
|
-
customerInquiries: {
|
|
1345
|
-
create: (body: CreateCustomerInquiryRequest) => Promise<{
|
|
1346
|
-
inquiryId: string;
|
|
1347
|
-
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1348
|
-
title: string;
|
|
1349
|
-
content: string;
|
|
1350
|
-
orderItemId: string | null;
|
|
1351
|
-
answered: boolean;
|
|
1352
|
-
answer: {
|
|
1353
|
-
content: string;
|
|
1354
|
-
answeredAt: string;
|
|
1355
|
-
} | null;
|
|
1356
|
-
createdAt: string;
|
|
1357
|
-
}>;
|
|
1358
|
-
list: (params?: PageParams & {
|
|
1359
|
-
answered?: boolean;
|
|
1360
|
-
category?: CustomerInquiryCategory;
|
|
1361
|
-
}) => Promise<{
|
|
1362
|
-
page: number;
|
|
1363
|
-
size: number;
|
|
1364
|
-
totalElements: number;
|
|
1365
|
-
totalPages: number;
|
|
1366
|
-
contents: {
|
|
1367
|
-
inquiryId: string;
|
|
1368
|
-
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1369
|
-
title: string;
|
|
1370
|
-
content: string;
|
|
1371
|
-
orderItemId: string | null;
|
|
1372
|
-
answered: boolean;
|
|
1373
|
-
answer: {
|
|
1374
|
-
content: string;
|
|
1375
|
-
answeredAt: string;
|
|
1376
|
-
} | null;
|
|
1377
|
-
createdAt: string;
|
|
1378
|
-
}[];
|
|
1379
|
-
}>;
|
|
1380
|
-
get: (inquiryId: string) => Promise<{
|
|
1381
|
-
inquiryId: string;
|
|
1382
|
-
category: "RETURN" | "EXCHANGE" | "DELIVERY" | "PAYMENT" | "ETC";
|
|
1383
|
-
title: string;
|
|
1384
|
-
content: string;
|
|
1385
|
-
orderItemId: string | null;
|
|
1386
|
-
answered: boolean;
|
|
1387
|
-
answer: {
|
|
1388
|
-
content: string;
|
|
1389
|
-
answeredAt: string;
|
|
1390
|
-
} | null;
|
|
1391
|
-
createdAt: string;
|
|
1392
|
-
}>;
|
|
1393
|
-
};
|
|
1394
|
-
};
|
|
1395
|
-
};
|
|
1396
|
-
type StorefrontClient = ReturnType<typeof createStorefrontClient>;
|
|
1397
|
-
//#endregion
|
|
1398
|
-
//#region src/schemas/analytics.d.ts
|
|
1399
|
-
/**
|
|
1400
|
-
* 방문 분석 이벤트 계약 — 브라우저 모듈(`@sayren/storefront-sdk/analytics`)과 수집 엔드포인트
|
|
1401
|
-
* (`POST /storefront/v1/events`)가 같은 스키마를 쓴다.
|
|
1402
|
-
*
|
|
1403
|
-
* 행동 이벤트(페이지뷰·상품 조회·목록 노출·검색·체류)는 브라우저가 보낸다. 거래 이벤트(장바구니·결제 시작·구매)는
|
|
1404
|
-
* 스토어프론트 API가 요청을 처리하면서 서버에서 기록하므로 브라우저가 보내지 않는다 — 매출·전환은 조작이나
|
|
1405
|
-
* 누락이 없는 서버 데이터로 계산한다.
|
|
1406
|
-
*/
|
|
1407
|
-
/** 방문자·세션 식별자 — SDK가 만드는 URL-safe 난수 */
|
|
1408
|
-
export declare const analyticsIdSchema: z.ZodString;
|
|
1409
|
-
/** 방문자 ID 쿠키(1년) · 세션 ID 쿠키(30분 비활동) 이름. SSR 서버도 같은 이름으로 읽는다 */
|
|
1410
|
-
export declare const ANALYTICS_VISITOR_COOKIE = "sy_vid";
|
|
1411
|
-
export declare const ANALYTICS_SESSION_COOKIE = "sy_sid";
|
|
1412
|
-
/** 스토어프론트 API 요청에 실어 서버 거래 이벤트와 방문자·세션을 잇는 헤더 */
|
|
1413
|
-
export declare const ANALYTICS_VISITOR_HEADER = "x-sayren-visitor";
|
|
1414
|
-
export declare const ANALYTICS_SESSION_HEADER = "x-sayren-session";
|
|
1415
|
-
/** 브라우저가 보내는 이벤트 이름 */
|
|
1416
|
-
export declare const analyticsClientEventNameSchema: z.ZodEnum<{
|
|
1417
|
-
search: "search";
|
|
1418
|
-
page_view: "page_view";
|
|
1419
|
-
page_engagement: "page_engagement";
|
|
1420
|
-
product_view: "product_view";
|
|
1421
|
-
product_list_view: "product_list_view";
|
|
1422
|
-
}>;
|
|
1423
|
-
export type AnalyticsClientEventName = z.infer<typeof analyticsClientEventNameSchema>;
|
|
1424
|
-
/** 서버가 기록하는 이벤트 이름 */
|
|
1425
|
-
export declare const analyticsServerEventNameSchema: z.ZodEnum<{
|
|
1426
|
-
add_to_cart: "add_to_cart";
|
|
1427
|
-
remove_from_cart: "remove_from_cart";
|
|
1428
|
-
begin_checkout: "begin_checkout";
|
|
1429
|
-
purchase: "purchase";
|
|
1430
|
-
}>;
|
|
1431
|
-
export type AnalyticsServerEventName = z.infer<typeof analyticsServerEventNameSchema>;
|
|
1432
|
-
export type AnalyticsEventName = AnalyticsClientEventName | AnalyticsServerEventName;
|
|
1433
|
-
export declare const analyticsClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1434
|
-
name: z.ZodLiteral<"page_view">;
|
|
1435
|
-
referrer: z.ZodOptional<z.ZodURL>;
|
|
1436
|
-
occurredAt: z.ZodISODateTime;
|
|
1437
|
-
url: z.ZodURL;
|
|
1438
|
-
pageViewId: z.ZodString;
|
|
1439
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1440
|
-
name: z.ZodLiteral<"page_engagement">;
|
|
1441
|
-
visibleMs: z.ZodNumber;
|
|
1442
|
-
occurredAt: z.ZodISODateTime;
|
|
1443
|
-
url: z.ZodURL;
|
|
1444
|
-
pageViewId: z.ZodString;
|
|
1445
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1446
|
-
name: z.ZodLiteral<"product_view">;
|
|
1447
|
-
productId: z.ZodString;
|
|
1448
|
-
variantId: z.ZodOptional<z.ZodString>;
|
|
1449
|
-
occurredAt: z.ZodISODateTime;
|
|
1450
|
-
url: z.ZodURL;
|
|
1451
|
-
pageViewId: z.ZodString;
|
|
1452
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1453
|
-
name: z.ZodLiteral<"product_list_view">;
|
|
1454
|
-
listId: z.ZodString;
|
|
1455
|
-
productIds: z.ZodArray<z.ZodString>;
|
|
1456
|
-
occurredAt: z.ZodISODateTime;
|
|
1457
|
-
url: z.ZodURL;
|
|
1458
|
-
pageViewId: z.ZodString;
|
|
1459
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1460
|
-
name: z.ZodLiteral<"search">;
|
|
1461
|
-
query: z.ZodString;
|
|
1462
|
-
resultCount: z.ZodNumber;
|
|
1463
|
-
occurredAt: z.ZodISODateTime;
|
|
1464
|
-
url: z.ZodURL;
|
|
1465
|
-
pageViewId: z.ZodString;
|
|
1466
|
-
}, z.core.$strip>], "name">;
|
|
1467
|
-
export type AnalyticsClientEvent = z.infer<typeof analyticsClientEventSchema>;
|
|
1468
|
-
/** 한 번에 보내는 배치 — sendBeacon이라 헤더를 못 실어 테넌트·식별자를 본문에 싣는다 */
|
|
1469
|
-
export declare const analyticsBatchSchema: z.ZodObject<{
|
|
1470
|
-
storeCode: z.ZodString;
|
|
1471
|
-
visitorId: z.ZodString;
|
|
1472
|
-
sessionId: z.ZodString;
|
|
1473
|
-
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1474
|
-
name: z.ZodLiteral<"page_view">;
|
|
1475
|
-
referrer: z.ZodOptional<z.ZodURL>;
|
|
1476
|
-
occurredAt: z.ZodISODateTime;
|
|
1477
|
-
url: z.ZodURL;
|
|
1478
|
-
pageViewId: z.ZodString;
|
|
1479
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1480
|
-
name: z.ZodLiteral<"page_engagement">;
|
|
1481
|
-
visibleMs: z.ZodNumber;
|
|
1482
|
-
occurredAt: z.ZodISODateTime;
|
|
1483
|
-
url: z.ZodURL;
|
|
1484
|
-
pageViewId: z.ZodString;
|
|
1485
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1486
|
-
name: z.ZodLiteral<"product_view">;
|
|
1487
|
-
productId: z.ZodString;
|
|
1488
|
-
variantId: z.ZodOptional<z.ZodString>;
|
|
1489
|
-
occurredAt: z.ZodISODateTime;
|
|
1490
|
-
url: z.ZodURL;
|
|
1491
|
-
pageViewId: z.ZodString;
|
|
1492
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1493
|
-
name: z.ZodLiteral<"product_list_view">;
|
|
1494
|
-
listId: z.ZodString;
|
|
1495
|
-
productIds: z.ZodArray<z.ZodString>;
|
|
1496
|
-
occurredAt: z.ZodISODateTime;
|
|
1497
|
-
url: z.ZodURL;
|
|
1498
|
-
pageViewId: z.ZodString;
|
|
1499
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1500
|
-
name: z.ZodLiteral<"search">;
|
|
1501
|
-
query: z.ZodString;
|
|
1502
|
-
resultCount: z.ZodNumber;
|
|
1503
|
-
occurredAt: z.ZodISODateTime;
|
|
1504
|
-
url: z.ZodURL;
|
|
1505
|
-
pageViewId: z.ZodString;
|
|
1506
|
-
}, z.core.$strip>], "name">>;
|
|
1507
|
-
context: z.ZodOptional<z.ZodObject<{
|
|
1508
|
-
webdriver: z.ZodOptional<z.ZodBoolean>;
|
|
1509
|
-
}, z.core.$strip>>;
|
|
1510
|
-
}, z.core.$strip>;
|
|
1511
|
-
export type AnalyticsBatch = z.infer<typeof analyticsBatchSchema>;
|
|
1512
|
-
/** 배치 본문 상한(바이트) — 서버가 넘는 요청을 거부한다 */
|
|
1513
|
-
export declare const ANALYTICS_MAX_BATCH_BYTES: number;
|
|
1514
|
-
//#endregion
|
|
1515
|
-
//#region src/schemas/order.d.ts
|
|
1516
|
-
export declare const myOrderItemSchema: z.ZodObject<{
|
|
1517
|
-
orderItemId: z.ZodString;
|
|
1518
|
-
productId: z.ZodString;
|
|
1519
|
-
productName: z.ZodString;
|
|
1520
|
-
thumbnailUrl: z.ZodURL;
|
|
1521
|
-
optionName: z.ZodNullable<z.ZodString>;
|
|
1522
|
-
quantity: z.ZodNumber;
|
|
1523
|
-
totalPrice: z.ZodNumber;
|
|
1524
|
-
status: z.ZodEnum<{
|
|
1525
|
-
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
1526
|
-
PAID: "PAID";
|
|
1527
|
-
CONFIRMED: "CONFIRMED";
|
|
1528
|
-
DISPATCHED: "DISPATCHED";
|
|
1529
|
-
DELIVERING: "DELIVERING";
|
|
1530
|
-
DELIVERED: "DELIVERED";
|
|
1531
|
-
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
1532
|
-
CANCELED: "CANCELED";
|
|
1533
|
-
}>;
|
|
1534
|
-
claimStatus: z.ZodNullable<z.ZodString>;
|
|
1535
|
-
reviewWritten: z.ZodBoolean;
|
|
1536
|
-
autoDecisionDate: z.ZodNullable<z.ZodString>;
|
|
1537
|
-
}, z.core.$strip>;
|
|
1538
|
-
export type MyOrderItem = z.infer<typeof myOrderItemSchema>;
|
|
1539
|
-
/**
|
|
1540
|
-
* 주문 응답의 배송지 — 결제 요청 시 저장된 스냅샷. 요청 스키마(`shippingAddressInputSchema`)와 분리한 응답 스키마라
|
|
1541
|
-
* 형식 검증(regex·길이)을 하지 않는다. 입력하지 않은 선택 필드는 null로 오거나 빠질 수 있다.
|
|
1542
|
-
*/
|
|
1543
|
-
export declare const orderShippingAddressSchema: z.ZodObject<{
|
|
1544
|
-
receiverName: z.ZodString;
|
|
1545
|
-
phone: z.ZodString;
|
|
1546
|
-
zipCode: z.ZodString;
|
|
1547
|
-
address1: z.ZodString;
|
|
1548
|
-
address2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1549
|
-
deliveryMemo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1550
|
-
entranceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1551
|
-
}, z.core.$strip>;
|
|
1552
|
-
export type OrderShippingAddress = z.infer<typeof orderShippingAddressSchema>;
|
|
1553
|
-
export declare const myOrderSchema: z.ZodObject<{
|
|
1554
|
-
orderId: z.ZodString;
|
|
1555
|
-
orderedAt: z.ZodString;
|
|
1556
|
-
items: z.ZodArray<z.ZodObject<{
|
|
1557
|
-
orderItemId: z.ZodString;
|
|
1558
|
-
productId: z.ZodString;
|
|
1559
|
-
productName: z.ZodString;
|
|
1560
|
-
thumbnailUrl: z.ZodURL;
|
|
1561
|
-
optionName: z.ZodNullable<z.ZodString>;
|
|
1562
|
-
quantity: z.ZodNumber;
|
|
1563
|
-
totalPrice: z.ZodNumber;
|
|
1564
|
-
status: z.ZodEnum<{
|
|
1565
|
-
PAYMENT_WAITING: "PAYMENT_WAITING";
|
|
1566
|
-
PAID: "PAID";
|
|
1567
|
-
CONFIRMED: "CONFIRMED";
|
|
1568
|
-
DISPATCHED: "DISPATCHED";
|
|
1569
|
-
DELIVERING: "DELIVERING";
|
|
1570
|
-
DELIVERED: "DELIVERED";
|
|
1571
|
-
PURCHASE_DECIDED: "PURCHASE_DECIDED";
|
|
1572
|
-
CANCELED: "CANCELED";
|
|
1573
|
-
}>;
|
|
1574
|
-
claimStatus: z.ZodNullable<z.ZodString>;
|
|
1575
|
-
reviewWritten: z.ZodBoolean;
|
|
1576
|
-
autoDecisionDate: z.ZodNullable<z.ZodString>;
|
|
1577
|
-
}, z.core.$strip>>;
|
|
1578
|
-
shippingAddress: z.ZodObject<{
|
|
1579
|
-
receiverName: z.ZodString;
|
|
1580
|
-
phone: z.ZodString;
|
|
1581
|
-
zipCode: z.ZodString;
|
|
1582
|
-
address1: z.ZodString;
|
|
1583
|
-
address2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1584
|
-
deliveryMemo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1585
|
-
entranceCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1586
|
-
}, z.core.$strip>;
|
|
1587
|
-
payment: z.ZodObject<{
|
|
1588
|
-
method: z.ZodEnum<{
|
|
1589
|
-
CARD: "CARD";
|
|
1590
|
-
BANK_TRANSFER: "BANK_TRANSFER";
|
|
1591
|
-
VIRTUAL_ACCOUNT: "VIRTUAL_ACCOUNT";
|
|
1592
|
-
MOBILE: "MOBILE";
|
|
1593
|
-
EASY_PAY: "EASY_PAY";
|
|
1594
|
-
}>;
|
|
1595
|
-
totalAmount: z.ZodNumber;
|
|
1596
|
-
paidAt: z.ZodNullable<z.ZodString>;
|
|
1597
|
-
receiptUrl: z.ZodNullable<z.ZodURL>;
|
|
1598
|
-
}, z.core.$strip>;
|
|
1599
|
-
testPayment: z.ZodBoolean;
|
|
1600
|
-
}, z.core.$strip>;
|
|
1601
|
-
export type MyOrder = z.infer<typeof myOrderSchema>;
|
|
1602
|
-
export declare const deliveryTrackingSchema: z.ZodObject<{
|
|
1603
|
-
carrierName: z.ZodString;
|
|
1604
|
-
trackingNumber: z.ZodString;
|
|
1605
|
-
trackingUrl: z.ZodURL;
|
|
1606
|
-
status: z.ZodEnum<{
|
|
1607
|
-
DISPATCHED: "DISPATCHED";
|
|
1608
|
-
DELIVERING: "DELIVERING";
|
|
1609
|
-
DELIVERED: "DELIVERED";
|
|
1610
|
-
}>;
|
|
1611
|
-
trackingEvents: z.ZodArray<z.ZodObject<{
|
|
1612
|
-
status: z.ZodString;
|
|
1613
|
-
location: z.ZodString;
|
|
1614
|
-
occurredAt: z.ZodString;
|
|
1615
|
-
}, z.core.$strip>>;
|
|
1616
|
-
}, z.core.$strip>;
|
|
1617
|
-
export type DeliveryTracking = z.infer<typeof deliveryTrackingSchema>;
|
|
1618
|
-
/** `POST /me/order-items/{orderItemId}/purchase-decision` 응답 */
|
|
1619
|
-
export declare const purchaseDecisionResultSchema: z.ZodObject<{
|
|
1620
|
-
orderItemId: z.ZodString;
|
|
1621
|
-
status: z.ZodLiteral<"PURCHASE_DECIDED">;
|
|
1622
|
-
decidedAt: z.ZodString;
|
|
1623
|
-
}, z.core.$strip>;
|
|
1624
|
-
export type PurchaseDecisionResult = z.infer<typeof purchaseDecisionResultSchema>;
|
|
1625
|
-
//#endregion
|
|
1626
|
-
//#region src/schemas/store.d.ts
|
|
1627
|
-
/**
|
|
1628
|
-
* 스토어 공개 설정 — `GET /store`. 스토어프론트가 화면을 그릴 때 읽는 값만 담는다.
|
|
1629
|
-
*/
|
|
1630
|
-
export declare const storefrontStoreSchema: z.ZodObject<{
|
|
1631
|
-
storeCode: z.ZodString;
|
|
1632
|
-
name: z.ZodString;
|
|
1633
|
-
logoUrl: z.ZodNullable<z.ZodString>;
|
|
1634
|
-
customerCenterPhone: z.ZodNullable<z.ZodString>;
|
|
1635
|
-
businessHours: z.ZodNullable<z.ZodString>;
|
|
1636
|
-
guestCheckout: z.ZodBoolean;
|
|
1637
|
-
loginMethods: z.ZodArray<z.ZodEnum<{
|
|
1638
|
-
password: "password";
|
|
1639
|
-
kakao: "kakao";
|
|
1640
|
-
naver: "naver";
|
|
1641
|
-
google: "google";
|
|
1642
|
-
}>>;
|
|
1643
|
-
}, z.core.$strip>;
|
|
1644
|
-
export type StorefrontStore = z.infer<typeof storefrontStoreSchema>;
|
|
1645
|
-
//#endregion
|
|
1646
|
-
export { AnonymousSession, ApiError, IdpAuthorizeRequest, IdpTokenRequest, LinkIdentityRequest, LoginRequest, MemberIdentities, type Query, type SessionStorage, SignupRequest, SocialProvider, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, TokenPair, type TokenSource, WithdrawRequest, WithdrawalBlockedDetails, anonymousSessionSchema, buildQuery, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberIdentitiesSchema, signupRequestSchema, socialProviderSchema, tokenPairSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema };
|
|
2
|
+
import { $ as MemberAddress, $t as easyPayProviderSchema, A as createStorefrontClient, An as claimStatusSchema, At as AvailablePaymentOption, B as ReviewSummary, Bn as cartSchema, Bt as PaymentMessage, C as analyticsBatchSchema, Cn as productFacetsSchema, Ct as CreateClaimResult, D as analyticsServerEventNameSchema, Dn as OrderItemStatus, Dt as createClaimRequestSchema, E as analyticsIdSchema, En as ClaimStatus, Et as claimTypeSchema, F as createStorefrontSession, Fn as Cart, Ft as KnownPaymentResult, G as createReviewResultSchema, Gt as PgProvider, H as UpdateReviewResult, Hn as analyticsIdsFromCookie, Ht as PaymentOption, I as CreateReviewRequest, In as CartItem, It as KnownPaymentStatus, J as reviewSummarySchema, Jt as StartPaymentRequest, K as publicReviewSchema, Kt as RetryPaymentRequest, L as CreateReviewResult, Ln as UpdateCartItemRequest, Lt as PAYMENT_RESULT_VALUES, M as SessionStorage, Mn as pageInfoSchema, Mt as CreateCheckoutRequest, N as StorefrontSession, Nn as pageSchema, Nt as EasyPayProvider, O as StorefrontClient, On as PageInfo, Ot as createClaimResultSchema, P as StorefrontSessionOptions, Pn as AddCartItemRequest, Pt as GuestInfo, Q as Member, Qt as easyPayProviderResponseSchema, R as PublicReview, Rn as addCartItemRequestSchema, Rt as PAYMENT_STATUS_VALUES, S as AnalyticsServerEventName, Sn as productDetailSchema, St as CreateClaimRequest, T as analyticsClientEventSchema, Tn as productSortSchema, Tt as claimReasonSchema, U as WritableReview, Ut as PaymentStart, V as UpdateReviewRequest, Vn as updateCartItemRequestSchema, Vt as PaymentMethod, W as createReviewRequestSchema, Wt as PaymentStatus, X as updateReviewResultSchema, Xt as checkoutSessionSchema, Y as updateReviewRequestSchema, Yt as availablePaymentOptionSchema, Z as writableReviewSchema, Zt as createCheckoutRequestSchema, _ as ANALYTICS_VISITOR_HEADER, _n as ProductPage, _t as createCustomerInquiryRequestSchema, a as MyOrderItem, an as paymentOptionListSchema, at as memberSchema, b as AnalyticsClientEventName, bn as categoryNodeSchema, bt as ClaimReason, c as deliveryTrackingSchema, cn as paymentStatusSchema, ct as CreateInquiryRequest, d as orderShippingAddressSchema, dn as shippingAddressInputSchema, dt as createInquiryRequestSchema, en as guestInfoSchema, et as MemberAddressRequest, f as purchaseDecisionResultSchema, fn as startPaymentRequestSchema, ft as createInquiryResultSchema, g as ANALYTICS_VISITOR_COOKIE, gn as ProductFacets, gt as CustomerInquiryCategory, h as ANALYTICS_SESSION_HEADER, hn as ProductDetail, ht as CustomerInquiry, i as MyOrder, in as paymentOptionKey, it as memberAddressSchema, j as STOREFRONT_SESSION_KEYS, jn as orderItemStatusSchema, jt as CheckoutSession, k as StorefrontClientOptions, kn as PageParams, kt as myClaimSchema, l as myOrderItemSchema, ln as pgProviderSchema, lt as CreateInquiryResult, m as ANALYTICS_SESSION_COOKIE, mn as ProductCard, mt as CreateCustomerInquiryRequest, n as storefrontStoreSchema, nn as paymentMessageSchema, nt as WishlistAddResult, o as OrderShippingAddress, on as paymentOptionSchema, ot as updateProfileRequestSchema, p as ANALYTICS_MAX_BATCH_BYTES, pn as CategoryNode, pt as publicInquirySchema, q as reviewPageSchema, qt as ShippingAddressInput, r as DeliveryTracking, rn as paymentMethodSchema, rt as memberAddressRequestSchema, s as PurchaseDecisionResult, sn as paymentStartSchema, st as wishlistAddResultSchema, t as StorefrontStore, tn as paymentFailureCategorySchema, tt as UpdateProfileRequest, u as myOrderSchema, un as retryPaymentRequestSchema, ut as PublicInquiry, v as AnalyticsBatch, vn as ProductSearchParams, vt as customerInquiryCategorySchema, w as analyticsClientEventNameSchema, wn as productPageSchema, wt as MyClaim, x as AnalyticsEventName, xn as productCardSchema, xt as ClaimType, y as AnalyticsClientEvent, yn as ProductSort, yt as customerInquirySchema, z as ReviewPage, zn as cartItemSchema, zt as PaymentFailureCategory } from "./index-BRXStiK2.mjs";
|
|
3
|
+
export { ANALYTICS_MAX_BATCH_BYTES, ANALYTICS_SESSION_COOKIE, ANALYTICS_SESSION_HEADER, ANALYTICS_VISITOR_COOKIE, ANALYTICS_VISITOR_HEADER, AddCartItemRequest, AnalyticsBatch, AnalyticsClientEvent, AnalyticsClientEventName, AnalyticsEventName, AnalyticsServerEventName, AnonymousSession, ApiError, AvailablePaymentOption, Cart, CartItem, CategoryNode, CheckoutSession, ClaimReason, ClaimStatus, ClaimType, CreateCheckoutRequest, CreateClaimRequest, CreateClaimResult, CreateCustomerInquiryRequest, CreateInquiryRequest, CreateInquiryResult, CreateReviewRequest, CreateReviewResult, CustomerInquiry, CustomerInquiryCategory, DeliveryTracking, EasyPayProvider, GuestInfo, IdpAuthorizeRequest, IdpTokenRequest, KnownPaymentResult, KnownPaymentStatus, LinkIdentityRequest, LoginRequest, Member, MemberAddress, MemberAddressRequest, MemberIdentities, MyClaim, MyOrder, MyOrderItem, OrderItemStatus, OrderShippingAddress, PAYMENT_RESULT_VALUES, PAYMENT_STATUS_VALUES, PageInfo, PageParams, PaymentFailureCategory, PaymentMessage, PaymentMethod, PaymentOption, PaymentStart, PaymentStatus, PgProvider, ProductCard, ProductDetail, ProductFacets, ProductPage, ProductSearchParams, ProductSort, PublicInquiry, PublicReview, PurchaseDecisionResult, type Query, RetryPaymentRequest, ReviewPage, ReviewSummary, STOREFRONT_SESSION_KEYS, type SessionStorage, ShippingAddressInput, SignupRequest, SocialProvider, StartPaymentRequest, type StorefrontClient, type StorefrontClientOptions, type StorefrontSession, type StorefrontSessionOptions, StorefrontStore, TokenPair, type TokenSource, UpdateCartItemRequest, UpdateProfileRequest, UpdateReviewRequest, UpdateReviewResult, WishlistAddResult, WithdrawRequest, WithdrawalBlockedDetails, WritableReview, addCartItemRequestSchema, analyticsBatchSchema, analyticsClientEventNameSchema, analyticsClientEventSchema, analyticsIdSchema, analyticsIdsFromCookie, analyticsServerEventNameSchema, anonymousSessionSchema, availablePaymentOptionSchema, buildQuery, cartItemSchema, cartSchema, categoryNodeSchema, checkoutSessionSchema, claimReasonSchema, claimStatusSchema, claimTypeSchema, createCheckoutRequestSchema, createClaimRequestSchema, createClaimResultSchema, createCustomerInquiryRequestSchema, createInquiryRequestSchema, createInquiryResultSchema, createReviewRequestSchema, createReviewResultSchema, createStorefrontClient, createStorefrontSession, customerInquiryCategorySchema, customerInquirySchema, deliveryTrackingSchema, easyPayProviderResponseSchema, easyPayProviderSchema, guestInfoSchema, idpAuthorizeRequestSchema, idpAuthorizeResponseSchema, idpTokenRequestSchema, linkIdentityRequestSchema, loginRequestSchema, memberAddressRequestSchema, memberAddressSchema, memberIdentitiesSchema, memberSchema, myClaimSchema, myOrderItemSchema, myOrderSchema, orderItemStatusSchema, orderShippingAddressSchema, pageInfoSchema, pageSchema, paymentFailureCategorySchema, paymentMessageSchema, paymentMethodSchema, paymentOptionKey, paymentOptionListSchema, paymentOptionSchema, paymentStartSchema, paymentStatusSchema, pgProviderSchema, productCardSchema, productDetailSchema, productFacetsSchema, productPageSchema, productSortSchema, publicInquirySchema, publicReviewSchema, purchaseDecisionResultSchema, retryPaymentRequestSchema, reviewPageSchema, reviewSummarySchema, shippingAddressInputSchema, signupRequestSchema, socialProviderSchema, startPaymentRequestSchema, storefrontStoreSchema, tokenPairSchema, updateCartItemRequestSchema, updateProfileRequestSchema, updateReviewRequestSchema, updateReviewResultSchema, wishlistAddResultSchema, withdrawRequestSchema, withdrawalBlockedDetailsSchema, writableReviewSchema };
|