@sayren/storefront-sdk 0.14.0 → 0.16.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.
@@ -1,4 +1,4 @@
1
- import { ft as ApiError, t as createStorefrontClient } from "../client-CUF2xGu8.mjs";
1
+ import { pt as ApiError, t as createStorefrontClient } from "../client-BrDY5HO3.mjs";
2
2
  //#region src/auth/index.ts
3
3
  /** 소셜 로그인 실패 — 구매자가 취소했거나(`access_denied`) state가 맞지 않는다 */
4
4
  var IdpCallbackError = class extends Error {
@@ -1,54 +1,65 @@
1
1
  import { z } from "zod";
2
- //#region src/schemas/common.ts
3
- const pageInfoSchema = z.object({
4
- page: z.number().int(),
5
- size: z.number().int(),
6
- totalElements: z.number().int(),
7
- totalPages: z.number().int()
8
- });
9
- function pageSchema(item) {
10
- return pageInfoSchema.extend({ contents: z.array(item) });
11
- }
12
- const orderItemStatusSchema = z.enum([
13
- "PAYMENT_WAITING",
14
- "PAID",
15
- "CONFIRMED",
16
- "DISPATCHED",
17
- "DELIVERING",
18
- "DELIVERED",
19
- "PURCHASE_DECIDED",
20
- "CANCELED"
21
- ]);
22
- const claimStatusSchema = z.enum([
23
- "REQUESTED",
24
- "HELD",
25
- "COLLECTING",
26
- "COLLECTED",
27
- "REDELIVERING",
28
- "APPROVED",
29
- "REJECTED",
30
- "COMPLETED",
31
- "WITHDRAWN"
32
- ]);
2
+ //#region src/schemas/fulfillment.ts
33
3
  /**
34
- * 상품 유형 (이슈 #48). 응답에서는 문자열로 받는다(값이 추가될 수 있다). 현재 값은 `SHIPPING`(배송 상품)·
35
- * `DOWNLOAD`(파일 다운로드)·`CODE`(코드 발급)·`SERVICE`(이용권·서비스)·`PICKUP`(방문 수령)이다.
36
- * 이 필드 이전 서버의 응답에는 없어 `SHIPPING`으로 읽는다. 서버는 항상 싣는다.
4
+ * 구매자용 상품 이행 (이슈 #57) — 관리 API의 상품 이행에서 구매자에게 필요한 것만 싣는다. 유형, 배송 필요 여부, 배송 안내(배송비·
5
+ * 무료 기준·반품·교환 배송비)다. 셀러 내부 값(출고지·반품지 id)은 싣지 않는다.
6
+ *
7
+ * 유형은 `SHIPPING`(배송 상품)과 `MANUAL`(배송 없는 상품, 판매자가 제공 처리) 둘이다(이슈 #48 범위 축소).
8
+ * 유형 이름은 응답에서 문자열이고, 모르는 유형(서버가 나중에 더한 유형)은 `{ type: "OTHER", rawType,
9
+ * requiresShipping }`로 읽는다. `requiresShipping`은 판별 값에서 파생되지만 **모든 가지에 싣는다** — 모르는 유형에서도 주문서가
10
+ * 배송지를 받을지 정할 수 있어야 한다.
37
11
  */
38
- const fulfillmentTypeField = () => z.string().optional().default("SHIPPING").describe("상품 유형. 현재 값은 `SHIPPING`(배송 상품)·`DOWNLOAD`(파일 다운로드)·`CODE`(코드 발급)·`SERVICE`(이용권·서비스)·`PICKUP`(방문 수령)이고 값이 추가될 수 있어 문자열로 받는다. 서버는 항상 싣는다");
12
+ const KNOWN_TYPES = ["SHIPPING", "MANUAL"];
13
+ /** 알려진 유형만 판별 유니온으로 검사하고 모르는 유형은 `OTHER`로 읽는다. 알려진 유형의 모양이 틀리면 파싱 오류다 */
14
+ function openUnion(known) {
15
+ return z.union([known, z.looseObject({
16
+ type: z.string().refine((type) => !KNOWN_TYPES.includes(type), { message: "알려진 유형은 해당 유형의 모양이어야 합니다" }),
17
+ requiresShipping: z.boolean()
18
+ }).transform((value) => ({
19
+ type: "OTHER",
20
+ rawType: value.type,
21
+ requiresShipping: value.requiresShipping
22
+ }))]);
23
+ }
24
+ const requiresShippingDescription = "택배 배송이 필요한가. false면 배송비가 없고 주문서가 배송지를 받지 않는다";
25
+ /** 상품 카드(목록·찜)의 이행 — 유형과 배송 필요 여부만. 배송비·환불 정책은 상세에서 본다 */
26
+ const productCardFulfillmentSchema = z.object({
27
+ type: z.string().describe("상품 유형. 값이 추가될 수 있어 문자열로 받는다"),
28
+ requiresShipping: z.boolean().describe(requiresShippingDescription)
29
+ });
30
+ /** 상품 상세의 이행 */
31
+ const productFulfillmentViewSchema = openUnion(z.discriminatedUnion("type", [z.object({
32
+ type: z.literal("SHIPPING"),
33
+ requiresShipping: z.literal(true),
34
+ shipping: z.object({
35
+ deliveryType: z.string().describe("배송비 유형. 현재 값은 `FREE`·`PAID`·`CONDITIONAL_FREE`"),
36
+ deliveryFee: z.number().int().describe("기본 배송비. 원 단위. 묶음·지역 추가 배송비는 장바구니·주문서 견적이 정한다"),
37
+ conditionalFreeAmount: z.number().int().nullable().describe("조건부 무료 기준 금액. 조건부 무료가 아니면 null"),
38
+ estimatedDays: z.string().describe("예상 배송 기간 안내 문구"),
39
+ returnDeliveryFee: z.number().int().describe("단순 변심 반품 배송비(유효 환불 정책). 원 단위"),
40
+ exchangeDeliveryFee: z.number().int().describe("단순 변심 교환 배송비(유효 환불 정책). 원 단위")
41
+ })
42
+ }), z.object({
43
+ type: z.literal("MANUAL"),
44
+ requiresShipping: z.literal(false)
45
+ })])).describe("상품 이행. `type`이 유형이고 같은 이름의 키가 유형별 안내다. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다");
46
+ /** 장바구니 줄·주문서 줄의 이행 — 주문서 줄은 주문서 시점 스냅샷이다 */
47
+ const lineFulfillmentSchema = z.object({
48
+ type: z.string().describe("상품 유형. 값이 추가될 수 있어 문자열로 받는다"),
49
+ requiresShipping: z.boolean().describe(requiresShippingDescription),
50
+ withdrawalRestricted: z.boolean().optional().describe("**Deprecated** — 항상 false다. 청약철회 제한 기능을 없앴고(이슈 #48) storefront-sdk 0.15 이하 호환으로만 싣는다. 게시된 스토어프론트가 0.16 이상으로 넘어간 뒤 다음 릴리스에서 뺀다")
51
+ });
39
52
  /**
40
- * 배송 필요 여부 (이슈 #48). false면 배송지를 받지 않는다. 이 필드 이전 서버의 응답에는 없어 true로 읽는다.
53
+ * 내 주문 주문상품의 주문 시점 이행 스냅샷. 상품을 나중에 고쳐도 바뀌지 않는다. 제공 기록(제공 시각·판매자 안내)은
54
+ * 주문상품의 `fulfillment`다.
41
55
  */
42
- const requiresShippingField = (description) => z.boolean().optional().default(true).describe(`${description} 서버는 항상 싣는다`);
43
- /** 배송이 필요한 상품 유형인가 — 배송 상품(`SHIPPING`)만 택배 배송이 있다. 모르는 값은 배송 상품으로 본다 */
44
- function isShippingFulfillment(fulfillmentType) {
45
- return fulfillmentType === void 0 || fulfillmentType === null || ![
46
- "DOWNLOAD",
47
- "CODE",
48
- "SERVICE",
49
- "PICKUP"
50
- ].includes(fulfillmentType);
51
- }
56
+ const myOrderItemFulfillmentSnapshotSchema = openUnion(z.discriminatedUnion("type", [z.object({
57
+ type: z.literal("SHIPPING"),
58
+ requiresShipping: z.literal(true)
59
+ }), z.object({
60
+ type: z.literal("MANUAL"),
61
+ requiresShipping: z.literal(false)
62
+ })])).describe("주문 시점 이행 스냅샷. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다");
52
63
  //#endregion
53
64
  //#region src/schemas/coupon.ts
54
65
  /**
@@ -191,7 +202,8 @@ const checkoutSessionSchema = z.object({
191
202
  optionName: z.string().nullable(),
192
203
  quantity: z.number().int(),
193
204
  unitPrice: z.number().int(),
194
- totalPrice: z.number().int()
205
+ totalPrice: z.number().int(),
206
+ fulfillment: lineFulfillmentSchema.describe("주문서 시점 상품 이행")
195
207
  })),
196
208
  amounts: z.object({
197
209
  productAmount: z.number().int(),
@@ -201,14 +213,11 @@ const checkoutSessionSchema = z.object({
201
213
  deliveryDiscountAmount: z.number().int().optional().default(0).describe("배송비 쿠폰 할인. 쿠폰이 없으면 0")
202
214
  }),
203
215
  delivery: checkoutDeliverySchema.describe("배송비 내역. 배송지를 입력하면 금액이 바뀔 수 있다 — 최종 금액은 결제 시작 응답의 `amounts`다"),
204
- requiresShipping: requiresShippingField("택배 배송이 필요한 상품이 있는가. false면 배송지를 받지 않는다 — 결제 시작에 `shippingAddress`를 보내지 않아도 된다."),
216
+ requiresShipping: z.boolean().describe("택배 배송이 필요한 상품이 있는가. false면 배송지를 받지 않는다 — 결제 시작에 `shippingAddress`를 보내지 않아도 된다"),
205
217
  withdrawal: z.object({
206
- required: z.boolean().describe("청약철회 제한 상품(제공이 시작되면 취소·반품할 수 없는 파일·코드·이용권)이 있는가. true면 `notice`를 결제 전에 보여 주고 동의를 받아 결제 시작에 `withdrawalAgreement: true`를 보낸다"),
207
- notice: z.string().nullable().describe("구매자에게 보여 줄 고지 문구. `required`가 false면 null")
208
- }).optional().default({
209
- required: false,
210
- notice: null
211
- }).describe("청약철회 제한 고지(이슈 #48). 서버는 항상 싣는다"),
218
+ required: z.boolean(),
219
+ notice: z.string().nullable()
220
+ }).optional().describe("**Deprecated** — 항상 `{ required: false, notice: null }`이다. 청약철회 제한 고지를 없앴고(이슈 #48) storefront-sdk 0.15 이하 호환으로만 싣는다. 게시된 스토어프론트가 0.16 이상으로 넘어간 뒤 다음 릴리스에서 뺀다"),
212
221
  expiresAt: z.string(),
213
222
  paymentOptions: z.lazy(() => paymentOptionListSchema).describe("이 주문서에서 고를 수 있는 결제 옵션, PG 우선순위순. 셀러가 켠 PG·결제수단·간편결제만 담긴다. 비어 있으면 지금 결제할 수 없다"),
214
223
  testPayment: z.boolean().describe("지금 결제하면 테스트 결제(샌드박스)인가. true면 실제로 돈이 나가지 않습니다 — 주문서에 테스트 결제 안내를 표시합니다. 결제 요청 시점에 스토어 결제 설정으로 다시 정해지니 최종 값은 결제 요청 응답의 `testPayment`입니다")
@@ -390,9 +399,8 @@ const cashReceiptField = cashReceiptRequestSchema.optional().describe("현금영
390
399
  const startPaymentRequestSchema = z.object({
391
400
  option: paymentOptionSchema,
392
401
  returnUrl: z.url().max(2048).describe("결제를 마치면 돌아올 스토어프론트 주소. 스토어 결제 도메인에 등록된 도메인이어야 한다"),
393
- shippingAddress: shippingAddressInputSchema.optional().describe("배송지. 주문서의 `requiresShipping`이 true면 필수이고 없으면 400 `SHIPPING_ADDRESS_REQUIRED`다. 배송이 필요 없는 주문(파일·코드·이용권·방문 수령만)은 보내지 않아도 된다. 보내면 형식을 검사한 뒤 버린다"),
402
+ shippingAddress: shippingAddressInputSchema.optional().describe("배송지. 주문서의 `requiresShipping`이 true면 필수이고 없으면 400 `SHIPPING_ADDRESS_REQUIRED`다. 배송이 필요 없는 주문(배송 없는 상품만)은 보내지 않아도 된다. 보내면 형식을 검사한 뒤 버린다"),
394
403
  guest: guestInfoSchema.optional(),
395
- withdrawalAgreement: z.boolean().optional().describe("청약철회 제한 동의. 주문서의 `withdrawal.required`가 true면 true여야 하고 아니면 400 `WITHDRAWAL_AGREEMENT_REQUIRED`다. 동의 시각이 주문에 남는다"),
396
404
  cashReceipt: cashReceiptField,
397
405
  coupons: couponApplicationListSchema.optional().describe("적용할 쿠폰(이슈 #47). 결제 시작이 쿠폰을 예약하고 할인한 금액으로 결제 금액을 정한다 — 응답의 `amounts`가 확정 금액이다. 적용하지 못하는 쿠폰이 하나라도 있으면 400 `COUPON_NOT_APPLICABLE`(`details`에 사유)이다. 결제가 실패하거나 만료되면 예약이 풀린다. 쿠폰을 바꾸려면 새로 결제를 시작한다(재시도는 같은 쿠폰을 쓴다)")
398
406
  });
@@ -467,4 +475,4 @@ const paymentMessageSchema = z.object({
467
475
  orderId: z.string().optional()
468
476
  });
469
477
  //#endregion
470
- export { startPaymentRequestSchema as A, myCouponListQuerySchema as B, paymentStartSchema as C, residentNumberLike as D, remoteAreaSchema as E, checkoutPricingSchema as F, isShippingFulfillment as G, pricingAmountsSchema as H, couponApplicationListSchema as I, pageSchema as J, orderItemStatusSchema as K, couponApplicationSchema as L, MIN_PAYMENT_AMOUNT as M, applicableCouponSchema as N, retryPaymentRequestSchema as O, checkoutPricingRequestSchema as P, couponBenefitViewSchema as R, paymentOptionSchema as S, pgProviderSchema as T, claimStatusSchema as U, myCouponSchema as V, fulfillmentTypeField as W, requiresShippingField as Y, paymentFailureCategorySchema as _, cashReceiptAvailable as a, paymentOptionKey as b, cashReceiptTypeSchema as c, createCheckoutRequestSchema as d, deliveryQuoteRequestSchema as f, guestInfoSchema as g, easyPayProviderSchema as h, availablePaymentOptionSchema as i, MAX_COUPONS_PER_CHECKOUT as j, shippingAddressInputSchema as k, checkoutDeliverySchema as l, easyPayProviderResponseSchema as m, PAYMENT_RESULT_VALUES as n, cashReceiptIdentityTypeOf as o, deliveryQuoteSchema as p, pageInfoSchema as q, PAYMENT_STATUS_VALUES as r, cashReceiptRequestSchema as s, CASH_RECEIPT_METHODS as t, checkoutSessionSchema as u, paymentMessageSchema as v, paymentStatusSchema as w, paymentOptionListSchema as x, paymentMethodSchema as y, couponResultSchema as z };
478
+ export { startPaymentRequestSchema as A, myCouponListQuerySchema as B, paymentStartSchema as C, residentNumberLike as D, remoteAreaSchema as E, checkoutPricingSchema as F, productCardFulfillmentSchema as G, pricingAmountsSchema as H, couponApplicationListSchema as I, productFulfillmentViewSchema as K, couponApplicationSchema as L, MIN_PAYMENT_AMOUNT as M, applicableCouponSchema as N, retryPaymentRequestSchema as O, checkoutPricingRequestSchema as P, couponBenefitViewSchema as R, paymentOptionSchema as S, pgProviderSchema as T, lineFulfillmentSchema as U, myCouponSchema as V, myOrderItemFulfillmentSnapshotSchema as W, paymentFailureCategorySchema as _, cashReceiptAvailable as a, paymentOptionKey as b, cashReceiptTypeSchema as c, createCheckoutRequestSchema as d, deliveryQuoteRequestSchema as f, guestInfoSchema as g, easyPayProviderSchema as h, availablePaymentOptionSchema as i, MAX_COUPONS_PER_CHECKOUT as j, shippingAddressInputSchema as k, checkoutDeliverySchema as l, easyPayProviderResponseSchema as m, PAYMENT_RESULT_VALUES as n, cashReceiptIdentityTypeOf as o, deliveryQuoteSchema as p, PAYMENT_STATUS_VALUES as r, cashReceiptRequestSchema as s, CASH_RECEIPT_METHODS as t, checkoutSessionSchema as u, paymentMessageSchema as v, paymentStatusSchema as w, paymentOptionListSchema as x, paymentMethodSchema as y, couponResultSchema as z };
@@ -1,5 +1,5 @@
1
1
  import { a as ANALYTICS_VISITOR_HEADER, r as ANALYTICS_SESSION_HEADER } from "./analytics-CgD70OqH.mjs";
2
- import { A as startPaymentRequestSchema, C as paymentStartSchema, F as checkoutPricingSchema, J as pageSchema, K as orderItemStatusSchema, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, U as claimStatusSchema, V as myCouponSchema, W as fulfillmentTypeField, Y as requiresShippingField, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, m as easyPayProviderResponseSchema, p as deliveryQuoteSchema, u as checkoutSessionSchema, w as paymentStatusSchema, y as paymentMethodSchema } from "./checkout-wrCpR-P1.mjs";
2
+ import { A as startPaymentRequestSchema, C as paymentStartSchema, F as checkoutPricingSchema, G as productCardFulfillmentSchema, K as productFulfillmentViewSchema, N as applicableCouponSchema, O as retryPaymentRequestSchema, P as checkoutPricingRequestSchema, U as lineFulfillmentSchema, V as myCouponSchema, W as myOrderItemFulfillmentSnapshotSchema, d as createCheckoutRequestSchema, f as deliveryQuoteRequestSchema, m as easyPayProviderResponseSchema, p as deliveryQuoteSchema, u as checkoutSessionSchema, w as paymentStatusSchema, y as paymentMethodSchema } from "./checkout-DTfoCsMF.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/http.ts
5
5
  /** 표준 엔벨로프의 $.error 상세 */
@@ -246,7 +246,7 @@ const cartItemSchema = z.object({
246
246
  quantity: z.number().int(),
247
247
  unitPrice: z.number().int(),
248
248
  totalPrice: z.number().int(),
249
- fulfillmentType: fulfillmentTypeField(),
249
+ fulfillment: lineFulfillmentSchema,
250
250
  purchasable: z.boolean(),
251
251
  unpurchasableReason: z.enum([
252
252
  "SOLD_OUT",
@@ -260,7 +260,7 @@ const cartSchema = z.object({
260
260
  productAmount: z.number().int(),
261
261
  deliveryFee: z.number().int(),
262
262
  totalAmount: z.number().int(),
263
- requiresShipping: requiresShippingField("구매 가능한 항목 중 택배 배송이 필요한 상품이 있는가. false면 배송비가 0이고 주문서가 배송지를 받지 않는다.")
263
+ requiresShipping: z.boolean().describe("구매 가능한 항목 중 택배 배송이 필요한 상품이 있는가. false면 배송비가 0이고 주문서가 배송지를 받지 않는다")
264
264
  })
265
265
  });
266
266
  const addCartItemRequestSchema = z.object({
@@ -273,6 +273,38 @@ const updateCartItemRequestSchema = z.object({
273
273
  optionId: z.string().optional()
274
274
  }).refine((value) => Object.values(value).some((v) => v !== void 0), { message: "최소 1개 필드가 필요합니다" });
275
275
  //#endregion
276
+ //#region src/schemas/common.ts
277
+ const pageInfoSchema = z.object({
278
+ page: z.number().int(),
279
+ size: z.number().int(),
280
+ totalElements: z.number().int(),
281
+ totalPages: z.number().int()
282
+ });
283
+ function pageSchema(item) {
284
+ return pageInfoSchema.extend({ contents: z.array(item) });
285
+ }
286
+ const orderItemStatusSchema = z.enum([
287
+ "PAYMENT_WAITING",
288
+ "PAID",
289
+ "CONFIRMED",
290
+ "DISPATCHED",
291
+ "DELIVERING",
292
+ "DELIVERED",
293
+ "PURCHASE_DECIDED",
294
+ "CANCELED"
295
+ ]);
296
+ const claimStatusSchema = z.enum([
297
+ "REQUESTED",
298
+ "HELD",
299
+ "COLLECTING",
300
+ "COLLECTED",
301
+ "REDELIVERING",
302
+ "APPROVED",
303
+ "REJECTED",
304
+ "COMPLETED",
305
+ "WITHDRAWN"
306
+ ]);
307
+ //#endregion
276
308
  //#region src/schemas/catalog.ts
277
309
  const categoryNodeSchema = z.lazy(() => z.object({
278
310
  categoryId: z.string(),
@@ -287,9 +319,8 @@ const productCardSchema = z.object({
287
319
  salePrice: z.number().int().describe("판매가. 원(KRW) 단위 정수"),
288
320
  discountedPrice: z.number().int().nullable().describe("즉시 할인 적용가. 원 단위. 할인이 없으면 null"),
289
321
  discountRate: z.number().int().nullable().describe("할인율(%). 할인이 없으면 null"),
290
- freeShipping: z.boolean(),
291
- fulfillmentType: fulfillmentTypeField(),
292
- requiresShipping: requiresShippingField("택배 배송이 필요한 상품인가. false면 배송비가 없고 주문서가 배송지를 받지 않는다."),
322
+ freeShipping: z.boolean().describe("무료배송 배지. 배송 상품이고 배송비가 무료일 때만 true다(배송이 없는 상품은 false)"),
323
+ fulfillment: productCardFulfillmentSchema,
293
324
  averageRating: z.number(),
294
325
  reviewCount: z.number().int(),
295
326
  soldOut: z.boolean()
@@ -316,21 +347,8 @@ const productDetailSchema = productCardSchema.extend({
316
347
  additionalPrice: z.number().int(),
317
348
  soldOut: z.boolean()
318
349
  })),
319
- delivery: z.object({
320
- type: z.enum([
321
- "FREE",
322
- "PAID",
323
- "CONDITIONAL_FREE"
324
- ]),
325
- fee: z.number().int(),
326
- conditionalFreeAmount: z.number().int().nullable(),
327
- estimatedDays: z.string()
328
- }),
329
- returnPolicy: z.object({
330
- returnFee: z.number().int(),
331
- exchangeFee: z.number().int(),
332
- periodDays: z.number().int()
333
- }),
350
+ fulfillment: productFulfillmentViewSchema,
351
+ returnPeriodDays: z.number().int().describe("반품·교환을 받는 기간(수령·제공일부터 일수)"),
334
352
  categoryPath: z.array(z.object({
335
353
  categoryId: z.string(),
336
354
  name: z.string()
@@ -589,35 +607,12 @@ const myOrderItemSchema = z.object({
589
607
  totalPrice: z.number().int().describe("주문상품 금액 (즉시할인 반영, 쿠폰 전)"),
590
608
  couponDiscountAmount: z.number().int().optional().default(0).describe("이 주문상품에 배분된 쿠폰 할인. 실결제 금액은 `totalPrice − couponDiscountAmount`다. 쿠폰이 없으면 0. 서버는 항상 싣는다"),
591
609
  status: orderItemStatusSchema,
592
- fulfillmentType: fulfillmentTypeField(),
593
- withdrawalRestricted: z.boolean().optional().default(false).describe("청약철회 제한 주문상품인가(이슈 #48). 구매자가 결제 전에 동의했고 제공이 시작되면(다운로드·열람·이용 시작) 구매자 취소·반품을 받지 않는다. 서버는 항상 싣는다"),
610
+ fulfillmentSnapshot: myOrderItemFulfillmentSnapshotSchema.describe("주문 시점 이행 스냅샷(이슈 #57). `type`이 주문 시점 상품 유형이다. 배송 없는 상품(`MANUAL`)이면 `DELIVERED`는 제공 완료다"),
594
611
  fulfillment: z.object({
595
- status: z.string().describe("제공 상태. `FULFILLED`(제공함)·`REVOKED`(환불 등으로 회수함). 값이 추가될 수 있어 문자열로 받는다"),
612
+ status: z.string().describe("제공 상태. `FULFILLED`(제공함)·`REVOKED`(전량 취소·환불로 회수함). 값이 추가될 수 있어 문자열로 받는다"),
596
613
  fulfilledAt: z.string().describe("제공 시각 (ISO 8601)"),
597
- note: z.string().nullable().describe("셀러가 남긴 이용 안내. 없으면 null"),
598
- codes: z.array(z.object({
599
- codeId: z.string(),
600
- hint: z.string().describe("가린 코드 — 끝 4자만 보인다(예: `****AB12`)"),
601
- revealedAt: z.string().nullable().describe("처음 열람한 시각. 열람 전이면 null")
602
- })).optional().default([]).describe("코드 발급 상품의 코드(가린 값). 평문은 `fulfillment/reveal`로 연다. 환불로 회수된 코드는 싣지 않는다. 서버는 항상 싣는다"),
603
- download: z.object({
604
- count: z.number().int().describe("지금까지 받은 횟수"),
605
- limit: z.number().int().describe("받을 수 있는 횟수"),
606
- expiresAt: z.string().nullable().describe("받을 수 있는 기한 (ISO 8601)"),
607
- files: z.array(z.object({
608
- assetId: z.string(),
609
- fileName: z.string(),
610
- sizeBytes: z.number().int().nullable()
611
- }))
612
- }).nullable().optional().default(null).describe("파일 다운로드 상품의 횟수·기한·파일 목록. 파일 주소는 `downloads`로 받는다. 다른 유형은 null. 서버는 항상 싣는다")
613
- }).nullable().optional().default(null).describe("비실물 상품(이용권·방문 수령 등)의 제공 정보(이슈 #48). 제공 전이거나 배송 상품이면 null이다. 비실물의 `DELIVERED`는 제공 완료(방문 수령은 수령 완료)로 표시한다. 서버는 항상 싣는다"),
614
- pickupLocation: z.object({
615
- name: z.string().describe("수령 장소 이름"),
616
- zipCode: z.string(),
617
- address1: z.string(),
618
- address2: z.string().nullable(),
619
- phone: z.string().describe("수령 장소 연락처")
620
- }).nullable().optional().default(null).describe("방문 수령 장소(이슈 #48). 방문 수령 상품(`fulfillmentType` = `PICKUP`)이고 셀러가 수령지를 지정했을 때만 있다. 상품의 현재 수령지다. 서버는 항상 싣는다"),
614
+ note: z.string().nullable().describe("판매자가 제공 처리 때 남긴 이용 안내. 없으면 null")
615
+ }).nullable().optional().default(null).describe("배송 없는 상품의 제공 기록(이슈 #48). 제공 전이거나 배송 상품이면 null이다. 배송 없는 상품의 `DELIVERED`는 제공 완료로 표시한다. 서버는 항상 싣는다"),
621
616
  claimStatus: z.string().nullable(),
622
617
  reviewWritten: z.boolean(),
623
618
  autoDecisionDate: z.string().nullable()
@@ -639,7 +634,7 @@ const myOrderSchema = z.object({
639
634
  orderId: z.string(),
640
635
  orderedAt: z.string(),
641
636
  items: z.array(myOrderItemSchema),
642
- requiresShipping: requiresShippingField("택배 배송이 필요한 주문상품이 있는가. false면 `shippingAddress`는 주문자 이름·연락처만 있고 주소는 빈 문자열이다."),
637
+ requiresShipping: z.boolean().describe("택배 배송이 필요한 주문상품이 있는가. false면 `shippingAddress`는 주문자 이름·연락처만 있고 주소는 빈 문자열이다"),
643
638
  shippingAddress: orderShippingAddressSchema,
644
639
  payment: z.object({
645
640
  method: paymentMethodSchema.describe("실제 결제수단(PG가 보고한 수단, 모르면 주문서에서 고른 수단). 결제창에서 바뀔 수 있다(카드 결제창의 간편결제 탭 등)"),
@@ -656,7 +651,6 @@ const myOrderSchema = z.object({
656
651
  paidAt: z.string().nullable(),
657
652
  receiptUrl: z.url().nullable()
658
653
  }),
659
- withdrawalAgreedAt: z.string().nullable().optional().default(null).describe("청약철회 제한 안내에 동의한 시각(이슈 #48). 제한 상품이 없던 주문은 null. 서버는 항상 싣는다"),
660
654
  testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 나가지 않았습니다 — 주문 화면에 테스트 결제 배지를 표시합니다")
661
655
  });
662
656
  /**
@@ -688,33 +682,6 @@ const purchaseDecisionResultSchema = z.object({
688
682
  status: z.literal("PURCHASE_DECIDED"),
689
683
  decidedAt: z.string()
690
684
  });
691
- /**
692
- * 코드 열람 응답 (이슈 #48) — `POST /storefront/v1/me/order-items/{orderItemId}/fulfillment/reveal`(회원)·
693
- * `POST /storefront/v1/guest/orders/{orderId}/order-items/{orderItemId}/fulfillment/reveal`(비회원).
694
- * 평문 코드는 이 응답에만 있다. 화면에 보인 뒤 저장하지 않는다(응답은 `Cache-Control: no-store`).
695
- * 첫 열람 시각은 청약철회 판단의 근거(제공 개시)로 남는다.
696
- */
697
- const fulfillmentRevealSchema = z.object({
698
- orderItemId: z.string(),
699
- codes: z.array(z.object({
700
- codeId: z.string(),
701
- code: z.string().describe("코드 평문"),
702
- revealedAt: z.string().describe("처음 열람한 시각")
703
- }))
704
- });
705
- /**
706
- * 다운로드 요청 (이슈 #48) — `POST /storefront/v1/me/order-items/{orderItemId}/downloads`(회원)·
707
- * `POST /storefront/v1/guest/orders/{orderId}/order-items/{orderItemId}/downloads`(비회원, 연락처·비밀번호를 함께 보낸다).
708
- * 파일이 하나면 `assetId`를 생략할 수 있다.
709
- */
710
- const downloadRequestSchema = z.object({ assetId: z.string().min(1).max(64).optional().describe("받을 파일. 파일이 여러 개면 필수다") });
711
- /** 다운로드 응답 — 수명 300초의 서명 주소. 받을 때마다 횟수가 하나 준다 */
712
- const downloadLinkSchema = z.object({
713
- url: z.url().describe("서명 주소. 300초 뒤 만료된다 — 받아서 바로 쓰고 저장하지 않는다"),
714
- expiresAt: z.string().describe("서명 주소 만료 시각"),
715
- fileName: z.string(),
716
- remaining: z.number().int().describe("남은 다운로드 횟수")
717
- });
718
685
  //#endregion
719
686
  //#region src/schemas/review.ts
720
687
  const publicReviewSchema = z.object({
@@ -938,27 +905,6 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
938
905
  */
939
906
  getGuestOrder: (orderId, body) => http.request("POST", path`/guest/orders/${orderId}`, myOrderSchema, { body }),
940
907
  getDelivery: (orderItemId) => http.request("GET", path`/me/order-items/${orderItemId}/delivery`, deliveryTrackingSchema),
941
- /**
942
- * 코드 열람 (이슈 #48) — 코드 발급 상품의 평문 코드. 처음 열람한 시각이 제공 개시 증거로 남는다.
943
- *
944
- * 에러: 404 `ORDER_ITEM_NOT_FOUND`(없거나 남의 주문상품) · 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·코드 상품 아님) ·
945
- * 429 `TOO_MANY_REQUESTS`
946
- */
947
- revealCode: (orderItemId) => http.request("POST", path`/me/order-items/${orderItemId}/fulfillment/reveal`, fulfillmentRevealSchema),
948
- /**
949
- * 파일 다운로드 (이슈 #48) — 수명 300초의 서명 주소를 받는다. 받을 때마다 남은 횟수가 준다.
950
- *
951
- * 에러: 404 `FULFILLMENT_NOT_FOUND`(제공 전·회수됨·파일 상품 아님) · 409 `DOWNLOAD_LIMIT_REACHED`(횟수 소진) ·
952
- * 409 `DOWNLOAD_EXPIRED`(기한 지남) · 400 `ASSET_REQUIRED`(파일이 여러 개인데 `assetId` 없음)
953
- */
954
- createDownload: (orderItemId, body = {}) => http.request("POST", path`/me/order-items/${orderItemId}/downloads`, downloadLinkSchema, { body: downloadRequestSchema.parse(body) }),
955
- /** 비회원 다운로드 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인한다 */
956
- createGuestDownload: (orderId, orderItemId, body) => http.request("POST", path`/guest/orders/${orderId}/order-items/${orderItemId}/downloads`, downloadLinkSchema, { body }),
957
- /**
958
- * 비회원 코드 열람 — 비회원 주문 조회와 같은 연락처·주문 조회 비밀번호로 확인하고 같은 시도 한도를 쓴다.
959
- * 틀리면 구분 없이 404 `ORDER_NOT_FOUND`다.
960
- */
961
- revealGuestCode: (orderId, orderItemId, body) => http.request("POST", path`/guest/orders/${orderId}/order-items/${orderItemId}/fulfillment/reveal`, fulfillmentRevealSchema, { body }),
962
908
  decidePurchase: (orderItemId) => http.requestVoid("POST", path`/me/order-items/${orderItemId}/purchase-decision`)
963
909
  },
964
910
  myClaims: {
@@ -1000,4 +946,4 @@ get: () => http.request("GET", "/store", storefrontStoreSchema) },
1000
946
  };
1001
947
  }
1002
948
  //#endregion
1003
- export { anonymousSessionSchema as $, customerInquirySchema as A, createClaimRequestSchema as B, updateProfileRequestSchema as C, publicInquirySchema as D, createInquiryResultSchema as E, consentUpdateRequestSchema as F, productDetailSchema as G, myClaimSchema as H, memberConsentsSchema as I, productSortSchema as J, productFacetsSchema as K, claimReasonSchema as L, consentKindSchema as M, consentSourceSchema as N, createCustomerInquiryRequestSchema as O, consentStateSchema as P, updateCartItemRequestSchema as Q, claimReturnAddressSchema as R, memberSchema as S, createInquiryRequestSchema as T, categoryNodeSchema as U, createClaimResultSchema as V, productCardSchema as W, cartItemSchema as X, addCartItemRequestSchema as Y, cartSchema as Z, orderShippingAddressSchema as _, publicReviewSchema as a, loginRequestSchema as at, memberAddressRequestSchema as b, updateReviewRequestSchema as c, socialProviderSchema as ct, deliveryTrackingSchema as d, withdrawalBlockedDetailsSchema as dt, idpAgreementsSchema as et, downloadLinkSchema as f, ApiError as ft, myOrderSchema as g, myOrderItemSchema as h, unwrapData as ht, createReviewResultSchema as i, linkIdentityRequestSchema as it, consentActionSchema as j, customerInquiryCategorySchema as k, updateReviewResultSchema as l, tokenPairSchema as lt, fulfillmentRevealSchema as m, toApiError as mt, storefrontStoreSchema as n, idpAuthorizeResponseSchema as nt, reviewPageSchema as o, memberIdentitiesSchema as ot, downloadRequestSchema as p, buildQuery as pt, productPageSchema as q, createReviewRequestSchema as r, idpTokenRequestSchema as rt, reviewSummarySchema as s, signupRequestSchema as st, createStorefrontClient as t, idpAuthorizeRequestSchema as tt, writableReviewSchema as u, withdrawRequestSchema as ut, purchaseDecisionResultSchema as v, wishlistAddResultSchema as w, memberAddressSchema as x, trackingStageResponseSchema as y, claimTypeSchema as z };
949
+ export { updateCartItemRequestSchema as $, consentSourceSchema as A, categoryNodeSchema as B, createInquiryResultSchema as C, customerInquirySchema as D, customerInquiryCategorySchema as E, claimReturnAddressSchema as F, productSortSchema as G, productDetailSchema as H, claimTypeSchema as I, pageInfoSchema as J, claimStatusSchema as K, createClaimRequestSchema as L, consentUpdateRequestSchema as M, memberConsentsSchema as N, consentActionSchema as O, claimReasonSchema as P, cartSchema as Q, createClaimResultSchema as R, createInquiryRequestSchema as S, createCustomerInquiryRequestSchema as T, productFacetsSchema as U, productCardSchema as V, productPageSchema as W, addCartItemRequestSchema as X, pageSchema as Y, cartItemSchema as Z, memberAddressRequestSchema as _, publicReviewSchema as a, linkIdentityRequestSchema as at, updateProfileRequestSchema as b, updateReviewRequestSchema as c, signupRequestSchema as ct, deliveryTrackingSchema as d, withdrawRequestSchema as dt, anonymousSessionSchema as et, myOrderItemSchema as f, withdrawalBlockedDetailsSchema as ft, trackingStageResponseSchema as g, unwrapData as gt, purchaseDecisionResultSchema as h, toApiError as ht, createReviewResultSchema as i, idpTokenRequestSchema as it, consentStateSchema as j, consentKindSchema as k, updateReviewResultSchema as l, socialProviderSchema as lt, orderShippingAddressSchema as m, buildQuery as mt, storefrontStoreSchema as n, idpAuthorizeRequestSchema as nt, reviewPageSchema as o, loginRequestSchema as ot, myOrderSchema as p, ApiError as pt, orderItemStatusSchema as q, createReviewRequestSchema as r, idpAuthorizeResponseSchema as rt, reviewSummarySchema as s, memberIdentitiesSchema as st, createStorefrontClient as t, idpAgreementsSchema as tt, writableReviewSchema as u, tokenPairSchema as ut, memberAddressSchema as v, publicInquirySchema as w, wishlistAddResultSchema as x, memberSchema as y, myClaimSchema as z };