@sayren/storefront-sdk 0.20.7 → 0.20.8
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-Bt6j2eDw.mjs → checkout-BjJ4Efbn.mjs} +98 -10
- package/dist/{client-Dn_JdIqv.mjs → client-S_gOAeBM.mjs} +91 -5
- package/dist/{index-atHaDBC3.d.mts → index-Bv49jTFH.d.mts} +760 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/payments/index.d.mts +1 -1
- package/dist/payments/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client.ts +49 -0
- package/src/index.ts +2 -0
- package/src/schemas/catalog.ts +10 -0
- package/src/schemas/checkout.ts +12 -0
- package/src/schemas/commerce-flow.ts +88 -0
- package/src/schemas/fulfillment.ts +53 -3
- package/src/schemas/order.ts +10 -0
- package/src/schemas/product-options.ts +72 -2
- package/src/schemas/stay.ts +32 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 숙박 기간·날짜별 달력(이슈 #118) — 날짜별 재고 상품(상품 상세 `inventoryMode: "DATED"`)은 담기·바로 구매에 기간을 함께 보내고,
|
|
5
|
+
* 가격은 박마다 달력의 가격을 더한 값이다. 날짜는 한국 날짜 `YYYY-MM-DD`다.
|
|
6
|
+
*/
|
|
7
|
+
export const stayRequestSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
checkIn: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
10
|
+
checkOut: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
11
|
+
})
|
|
12
|
+
.describe(
|
|
13
|
+
"숙박 기간(날짜별 재고 상품만). 체크인 날부터 체크아웃 전날까지 박마다 재고·가격을 본다. 최대 30박. 날짜별 재고 상품에 빠지면 400 `STAY_REQUIRED`, 다른 상품에 주면 400 `STAY_NOT_APPLICABLE`, 재고가 없는 날이 있으면 409 `DATES_UNAVAILABLE`",
|
|
14
|
+
);
|
|
15
|
+
export type StayRequest = z.infer<typeof stayRequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const stayViewSchema = z.object({
|
|
18
|
+
checkIn: z.string(),
|
|
19
|
+
checkOut: z.string(),
|
|
20
|
+
nights: z
|
|
21
|
+
.array(z.object({ date: z.string(), price: z.number().int() }))
|
|
22
|
+
.describe("박마다 날짜·가격(객실 1개 기준). 합이 줄 단가다"),
|
|
23
|
+
});
|
|
24
|
+
export type StayView = z.infer<typeof stayViewSchema>;
|
|
25
|
+
|
|
26
|
+
/** 구매자 달력 한 칸 — 재고 수는 보이지 않고 예약 가능 여부만 */
|
|
27
|
+
export const calendarDayViewSchema = z.object({
|
|
28
|
+
date: z.string(),
|
|
29
|
+
available: z.boolean(),
|
|
30
|
+
price: z.number().int().describe("그날 가격(원)"),
|
|
31
|
+
});
|
|
32
|
+
export type CalendarDayView = z.infer<typeof calendarDayViewSchema>;
|