@sayren/store-sdk 0.29.4 → 0.29.6
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/index.d.mts +127 -51
- package/dist/index.mjs +74 -16
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/claim.ts +4 -0
- package/src/schemas/commerce-number.ts +28 -0
- package/src/schemas/order.ts +29 -4
- package/src/schemas/payment.ts +21 -2
- package/src/schemas/product.ts +25 -0
- package/src/schemas/promotion.ts +27 -14
- package/src/schemas/webhook-event.ts +32 -0
|
@@ -41,6 +41,14 @@ const envelopeFields = {
|
|
|
41
41
|
|
|
42
42
|
export const orderWebhookEventDataSchema = z.object({
|
|
43
43
|
orderId: z.string().describe("주문 ID"),
|
|
44
|
+
orderNo: z
|
|
45
|
+
.string()
|
|
46
|
+
.nullable()
|
|
47
|
+
.optional()
|
|
48
|
+
.default(null)
|
|
49
|
+
.describe(
|
|
50
|
+
"주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다",
|
|
51
|
+
),
|
|
44
52
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
45
53
|
testPayment: z
|
|
46
54
|
.boolean()
|
|
@@ -101,6 +109,14 @@ export type OrderWebhookEventData = z.infer<typeof orderWebhookEventDataSchema>;
|
|
|
101
109
|
*/
|
|
102
110
|
export const orderFulfilledWebhookEventDataSchema = z.object({
|
|
103
111
|
orderId: z.string().describe("주문 ID"),
|
|
112
|
+
orderNo: z
|
|
113
|
+
.string()
|
|
114
|
+
.nullable()
|
|
115
|
+
.optional()
|
|
116
|
+
.default(null)
|
|
117
|
+
.describe(
|
|
118
|
+
"주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다",
|
|
119
|
+
),
|
|
104
120
|
orderItemId: z.string().describe("제공한 주문상품 ID"),
|
|
105
121
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
106
122
|
fulfillmentSnapshot: orderItemFulfillmentSnapshotResponseSchema.describe(
|
|
@@ -126,6 +142,14 @@ export type OrderFulfilledWebhookEventData = z.infer<typeof orderFulfilledWebhoo
|
|
|
126
142
|
*/
|
|
127
143
|
export const orderCanceledWebhookEventDataSchema = z.object({
|
|
128
144
|
orderId: z.string().describe("주문 ID"),
|
|
145
|
+
orderNo: z
|
|
146
|
+
.string()
|
|
147
|
+
.nullable()
|
|
148
|
+
.optional()
|
|
149
|
+
.default(null)
|
|
150
|
+
.describe(
|
|
151
|
+
"주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다",
|
|
152
|
+
),
|
|
129
153
|
orderItemId: z.string().describe("취소한 주문 상품 ID"),
|
|
130
154
|
status: orderItemStatusSchema.describe(
|
|
131
155
|
"취소 뒤 주문 대표 상태. 모든 주문 상품이 취소됐으면 `CANCELED`다",
|
|
@@ -188,6 +212,14 @@ export type OrderCanceledWebhookEventData = z.infer<typeof orderCanceledWebhookE
|
|
|
188
212
|
|
|
189
213
|
export const claimWebhookEventDataSchema = z.object({
|
|
190
214
|
claimId: z.string().describe("클레임 ID"),
|
|
215
|
+
claimNo: z
|
|
216
|
+
.string()
|
|
217
|
+
.nullable()
|
|
218
|
+
.optional()
|
|
219
|
+
.default(null)
|
|
220
|
+
.describe(
|
|
221
|
+
"클레임번호(이슈 #107) — `C` + YYMMDD + 숫자 8자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 클레임은 null로 읽는다",
|
|
222
|
+
),
|
|
191
223
|
orderId: z.string().describe("주문 ID"),
|
|
192
224
|
orderItemId: z.string().describe("클레임 대상 주문 상품 ID"),
|
|
193
225
|
claimType: claimTypeSchema.describe("클레임 유형"),
|