@sayren/store-sdk 0.8.0 → 0.10.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/index.d.mts CHANGED
@@ -1050,6 +1050,7 @@ export declare const changeTypeSchema: z.ZodEnum<{
1050
1050
  "CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
1051
1051
  "CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
1052
1052
  "CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
1053
+ "CLAIM.COMPLETED": "CLAIM.COMPLETED";
1053
1054
  }>;
1054
1055
  export type ChangeType = z.infer<typeof changeTypeSchema>;
1055
1056
  //#endregion
@@ -1118,6 +1119,7 @@ export declare const claimSchema: z.ZodObject<{
1118
1119
  }>;
1119
1120
  claimDeliveryFee: z.ZodNumber;
1120
1121
  expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
1122
+ expectedDeliveryFeeRefundAmount: z.ZodNullable<z.ZodNumber>;
1121
1123
  exchangeOption: z.ZodNullable<z.ZodObject<{
1122
1124
  optionId: z.ZodString;
1123
1125
  optionName: z.ZodString;
@@ -1196,6 +1198,7 @@ export declare const claimDetailSchema: z.ZodObject<{
1196
1198
  }>;
1197
1199
  claimDeliveryFee: z.ZodNumber;
1198
1200
  expectedRefundAmount: z.ZodNullable<z.ZodNumber>;
1201
+ expectedDeliveryFeeRefundAmount: z.ZodNullable<z.ZodNumber>;
1199
1202
  exchangeOption: z.ZodNullable<z.ZodObject<{
1200
1203
  optionId: z.ZodString;
1201
1204
  optionName: z.ZodString;
@@ -1255,6 +1258,9 @@ export declare const approveClaimResultSchema: z.ZodObject<{
1255
1258
  claimId: z.ZodString;
1256
1259
  refundAmount: z.ZodNumber;
1257
1260
  deductAmount: z.ZodNumber;
1261
+ quantity: z.ZodNumber;
1262
+ deliveryFeeRefundAmount: z.ZodNumber;
1263
+ deliveryFeeChargeAmount: z.ZodNumber;
1258
1264
  refundedAt: z.ZodString;
1259
1265
  }, z.core.$strip>;
1260
1266
  export type ApproveClaimResult = z.infer<typeof approveClaimResultSchema>;
@@ -1318,6 +1324,125 @@ export declare const customerAddressSchema: z.ZodObject<{
1318
1324
  address1: z.ZodString;
1319
1325
  address2: z.ZodNullable<z.ZodString>;
1320
1326
  }, z.core.$strip>;
1327
+ /** 동의 종류 — 이용약관·개인정보 수집이용은 가입 필수, 마케팅 수신은 선택 */
1328
+ export declare const consentKindSchema: z.ZodEnum<{
1329
+ TERMS: "TERMS";
1330
+ PRIVACY: "PRIVACY";
1331
+ MARKETING: "MARKETING";
1332
+ }>;
1333
+ export type ConsentKind = z.infer<typeof consentKindSchema>;
1334
+ export declare const consentActionSchema: z.ZodEnum<{
1335
+ WITHDRAWN: "WITHDRAWN";
1336
+ AGREED: "AGREED";
1337
+ }>;
1338
+ export type ConsentAction = z.infer<typeof consentActionSchema>;
1339
+ /**
1340
+ * 동의가 일어난 경로. 값이 추가될 수 있어 모르는 값은 그대로 보여 준다.
1341
+ * `SIGNUP` 비밀번호 가입 · `SOCIAL_SIGNUP` 소셜 가입 · `DELEGATED` 셀러 자체 회원 연동 ·
1342
+ * `RECONSENT` 약관 개정 재동의 · `MEMBER_UPDATE` 구매자가 직접 변경 · `SELLER` 셀러가 처리
1343
+ */
1344
+ export declare const consentSourceSchema: z.ZodEnum<{
1345
+ SELLER: "SELLER";
1346
+ SIGNUP: "SIGNUP";
1347
+ SOCIAL_SIGNUP: "SOCIAL_SIGNUP";
1348
+ DELEGATED: "DELEGATED";
1349
+ RECONSENT: "RECONSENT";
1350
+ MEMBER_UPDATE: "MEMBER_UPDATE";
1351
+ }>;
1352
+ export type ConsentSource = z.infer<typeof consentSourceSchema>;
1353
+ /** 동의 이력 한 줄 — 추가만 되고 지워지지 않는다(구매자 탈퇴 시에만 함께 지워진다) */
1354
+ export declare const customerConsentSchema: z.ZodObject<{
1355
+ consentId: z.ZodString;
1356
+ kind: z.ZodEnum<{
1357
+ TERMS: "TERMS";
1358
+ PRIVACY: "PRIVACY";
1359
+ MARKETING: "MARKETING";
1360
+ }>;
1361
+ version: z.ZodNullable<z.ZodString>;
1362
+ documentUrl: z.ZodNullable<z.ZodString>;
1363
+ action: z.ZodEnum<{
1364
+ WITHDRAWN: "WITHDRAWN";
1365
+ AGREED: "AGREED";
1366
+ }>;
1367
+ source: z.ZodEnum<{
1368
+ SELLER: "SELLER";
1369
+ SIGNUP: "SIGNUP";
1370
+ SOCIAL_SIGNUP: "SOCIAL_SIGNUP";
1371
+ DELEGATED: "DELEGATED";
1372
+ RECONSENT: "RECONSENT";
1373
+ MEMBER_UPDATE: "MEMBER_UPDATE";
1374
+ }>;
1375
+ occurredAt: z.ZodString;
1376
+ }, z.core.$strip>;
1377
+ export type CustomerConsent = z.infer<typeof customerConsentSchema>;
1378
+ /** 종류별 현재 동의 상태 */
1379
+ export declare const customerConsentStateSchema: z.ZodObject<{
1380
+ kind: z.ZodEnum<{
1381
+ TERMS: "TERMS";
1382
+ PRIVACY: "PRIVACY";
1383
+ MARKETING: "MARKETING";
1384
+ }>;
1385
+ agreed: z.ZodBoolean;
1386
+ agreedVersion: z.ZodNullable<z.ZodString>;
1387
+ currentVersion: z.ZodNullable<z.ZodString>;
1388
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1389
+ updatedAt: z.ZodNullable<z.ZodString>;
1390
+ reconsentRequired: z.ZodBoolean;
1391
+ }, z.core.$strip>;
1392
+ export type CustomerConsentState = z.infer<typeof customerConsentStateSchema>;
1393
+ export declare const customerConsentsSchema: z.ZodObject<{
1394
+ terms: z.ZodObject<{
1395
+ kind: z.ZodEnum<{
1396
+ TERMS: "TERMS";
1397
+ PRIVACY: "PRIVACY";
1398
+ MARKETING: "MARKETING";
1399
+ }>;
1400
+ agreed: z.ZodBoolean;
1401
+ agreedVersion: z.ZodNullable<z.ZodString>;
1402
+ currentVersion: z.ZodNullable<z.ZodString>;
1403
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1404
+ updatedAt: z.ZodNullable<z.ZodString>;
1405
+ reconsentRequired: z.ZodBoolean;
1406
+ }, z.core.$strip>;
1407
+ privacy: z.ZodObject<{
1408
+ kind: z.ZodEnum<{
1409
+ TERMS: "TERMS";
1410
+ PRIVACY: "PRIVACY";
1411
+ MARKETING: "MARKETING";
1412
+ }>;
1413
+ agreed: z.ZodBoolean;
1414
+ agreedVersion: z.ZodNullable<z.ZodString>;
1415
+ currentVersion: z.ZodNullable<z.ZodString>;
1416
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1417
+ updatedAt: z.ZodNullable<z.ZodString>;
1418
+ reconsentRequired: z.ZodBoolean;
1419
+ }, z.core.$strip>;
1420
+ marketing: z.ZodObject<{
1421
+ kind: z.ZodEnum<{
1422
+ TERMS: "TERMS";
1423
+ PRIVACY: "PRIVACY";
1424
+ MARKETING: "MARKETING";
1425
+ }>;
1426
+ agreed: z.ZodBoolean;
1427
+ agreedVersion: z.ZodNullable<z.ZodString>;
1428
+ currentVersion: z.ZodNullable<z.ZodString>;
1429
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1430
+ updatedAt: z.ZodNullable<z.ZodString>;
1431
+ reconsentRequired: z.ZodBoolean;
1432
+ }, z.core.$strip>;
1433
+ reconsentRequired: z.ZodBoolean;
1434
+ }, z.core.$strip>;
1435
+ export type CustomerConsents = z.infer<typeof customerConsentsSchema>;
1436
+ /** `GET /v1/customers/{id}/consents` 쿼리 — 최근 순이다 */
1437
+ export declare const customerConsentListQuerySchema: z.ZodObject<{
1438
+ page: z.ZodOptional<z.ZodString>;
1439
+ size: z.ZodOptional<z.ZodString>;
1440
+ kind: z.ZodOptional<z.ZodEnum<{
1441
+ TERMS: "TERMS";
1442
+ PRIVACY: "PRIVACY";
1443
+ MARKETING: "MARKETING";
1444
+ }>>;
1445
+ }, z.core.$strip>;
1321
1446
  /** 구매자 상세 — 휴대폰 전체를 보여 준다 */
1322
1447
  export declare const customerDetailSchema: z.ZodObject<{
1323
1448
  customerId: z.ZodString;
@@ -1336,6 +1461,48 @@ export declare const customerDetailSchema: z.ZodObject<{
1336
1461
  }>;
1337
1462
  linkedAt: z.ZodString;
1338
1463
  }, z.core.$strip>>;
1464
+ consents: z.ZodObject<{
1465
+ terms: z.ZodObject<{
1466
+ kind: z.ZodEnum<{
1467
+ TERMS: "TERMS";
1468
+ PRIVACY: "PRIVACY";
1469
+ MARKETING: "MARKETING";
1470
+ }>;
1471
+ agreed: z.ZodBoolean;
1472
+ agreedVersion: z.ZodNullable<z.ZodString>;
1473
+ currentVersion: z.ZodNullable<z.ZodString>;
1474
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1475
+ updatedAt: z.ZodNullable<z.ZodString>;
1476
+ reconsentRequired: z.ZodBoolean;
1477
+ }, z.core.$strip>;
1478
+ privacy: z.ZodObject<{
1479
+ kind: z.ZodEnum<{
1480
+ TERMS: "TERMS";
1481
+ PRIVACY: "PRIVACY";
1482
+ MARKETING: "MARKETING";
1483
+ }>;
1484
+ agreed: z.ZodBoolean;
1485
+ agreedVersion: z.ZodNullable<z.ZodString>;
1486
+ currentVersion: z.ZodNullable<z.ZodString>;
1487
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1488
+ updatedAt: z.ZodNullable<z.ZodString>;
1489
+ reconsentRequired: z.ZodBoolean;
1490
+ }, z.core.$strip>;
1491
+ marketing: z.ZodObject<{
1492
+ kind: z.ZodEnum<{
1493
+ TERMS: "TERMS";
1494
+ PRIVACY: "PRIVACY";
1495
+ MARKETING: "MARKETING";
1496
+ }>;
1497
+ agreed: z.ZodBoolean;
1498
+ agreedVersion: z.ZodNullable<z.ZodString>;
1499
+ currentVersion: z.ZodNullable<z.ZodString>;
1500
+ currentDocumentUrl: z.ZodNullable<z.ZodString>;
1501
+ updatedAt: z.ZodNullable<z.ZodString>;
1502
+ reconsentRequired: z.ZodBoolean;
1503
+ }, z.core.$strip>;
1504
+ reconsentRequired: z.ZodBoolean;
1505
+ }, z.core.$strip>;
1339
1506
  addresses: z.ZodArray<z.ZodObject<{
1340
1507
  addressId: z.ZodString;
1341
1508
  alias: z.ZodString;
@@ -1990,6 +2157,8 @@ export declare const orderItemSchema: z.ZodObject<{
1990
2157
  optionName: z.ZodNullable<z.ZodString>;
1991
2158
  sellerCode: z.ZodNullable<z.ZodString>;
1992
2159
  quantity: z.ZodNumber;
2160
+ canceledQuantity: z.ZodNumber;
2161
+ activeQuantity: z.ZodNumber;
1993
2162
  unitPrice: z.ZodNumber;
1994
2163
  discountAmount: z.ZodNumber;
1995
2164
  totalPrice: z.ZodNumber;
@@ -2011,6 +2180,7 @@ export declare const orderItemSchema: z.ZodObject<{
2011
2180
  "CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
2012
2181
  "CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
2013
2182
  "CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
2183
+ "CLAIM.COMPLETED": "CLAIM.COMPLETED";
2014
2184
  }>;
2015
2185
  testPayment: z.ZodBoolean;
2016
2186
  }, z.core.$strip>;
@@ -2074,6 +2244,8 @@ export declare const orderSchema: z.ZodObject<{
2074
2244
  optionName: z.ZodNullable<z.ZodString>;
2075
2245
  sellerCode: z.ZodNullable<z.ZodString>;
2076
2246
  quantity: z.ZodNumber;
2247
+ canceledQuantity: z.ZodNumber;
2248
+ activeQuantity: z.ZodNumber;
2077
2249
  unitPrice: z.ZodNumber;
2078
2250
  discountAmount: z.ZodNumber;
2079
2251
  totalPrice: z.ZodNumber;
@@ -2095,6 +2267,7 @@ export declare const orderSchema: z.ZodObject<{
2095
2267
  "CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
2096
2268
  "CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
2097
2269
  "CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
2270
+ "CLAIM.COMPLETED": "CLAIM.COMPLETED";
2098
2271
  }>;
2099
2272
  testPayment: z.ZodBoolean;
2100
2273
  }, z.core.$strip>>;
@@ -2156,6 +2329,8 @@ export declare const orderItemPageSchema: z.ZodObject<{
2156
2329
  optionName: z.ZodNullable<z.ZodString>;
2157
2330
  sellerCode: z.ZodNullable<z.ZodString>;
2158
2331
  quantity: z.ZodNumber;
2332
+ canceledQuantity: z.ZodNumber;
2333
+ activeQuantity: z.ZodNumber;
2159
2334
  unitPrice: z.ZodNumber;
2160
2335
  discountAmount: z.ZodNumber;
2161
2336
  totalPrice: z.ZodNumber;
@@ -2177,6 +2352,7 @@ export declare const orderItemPageSchema: z.ZodObject<{
2177
2352
  "CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
2178
2353
  "CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
2179
2354
  "CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
2355
+ "CLAIM.COMPLETED": "CLAIM.COMPLETED";
2180
2356
  }>;
2181
2357
  testPayment: z.ZodBoolean;
2182
2358
  }, z.core.$strip>>;
@@ -2227,6 +2403,7 @@ export declare const orderItemListQuerySchema: z.ZodObject<{
2227
2403
  "CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
2228
2404
  "CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
2229
2405
  "CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
2406
+ "CLAIM.COMPLETED": "CLAIM.COMPLETED";
2230
2407
  }>>;
2231
2408
  testPayment: z.ZodOptional<z.ZodEnum<{
2232
2409
  true: "true";
@@ -2347,12 +2524,17 @@ export declare const cancelBySellerRequestSchema: z.ZodObject<{
2347
2524
  DELIVERY_IMPOSSIBLE: "DELIVERY_IMPOSSIBLE";
2348
2525
  }>;
2349
2526
  detail: z.ZodOptional<z.ZodString>;
2527
+ quantity: z.ZodOptional<z.ZodNumber>;
2350
2528
  }, z.core.$strip>;
2351
2529
  export type CancelBySellerRequest = z.infer<typeof cancelBySellerRequestSchema>;
2352
2530
  /** `POST /v1/order-items/{orderItemId}/cancel` 응답 — 셀러 직권취소 환불 결과 */
2353
2531
  export declare const cancelBySellerResultSchema: z.ZodObject<{
2354
2532
  orderItemId: z.ZodString;
2355
2533
  refundAmount: z.ZodNumber;
2534
+ quantity: z.ZodNumber;
2535
+ canceledQuantity: z.ZodNumber;
2536
+ deliveryFeeRefundAmount: z.ZodNumber;
2537
+ deliveryFeeChargeAmount: z.ZodNumber;
2356
2538
  refundedAt: z.ZodString;
2357
2539
  }, z.core.$strip>;
2358
2540
  export type CancelBySellerResult = z.infer<typeof cancelBySellerResultSchema>;
@@ -3453,11 +3635,45 @@ export declare const productSchema: z.ZodObject<{
3453
3635
  conditionalFreeAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3454
3636
  returnFee: z.ZodOptional<z.ZodNumber>;
3455
3637
  exchangeFee: z.ZodOptional<z.ZodNumber>;
3638
+ refundPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3639
+ preShipmentDeliveryFeeRefund: z.ZodOptional<z.ZodBoolean>;
3640
+ returnDeliveryFee: z.ZodOptional<z.ZodNumber>;
3641
+ exchangeDeliveryFee: z.ZodOptional<z.ZodNumber>;
3642
+ sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
3643
+ conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
3644
+ }, z.core.$strict>>>;
3456
3645
  shippingAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3457
3646
  returnAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3458
3647
  createdAt: z.ZodOptional<z.ZodString>;
3459
3648
  }, z.core.$strip>;
3460
3649
  export type Product = z.infer<typeof productSchema>;
3650
+ /** 상품 하나에 등록할 수 있는 이미지 최대 장수 — 첫 장이 대표(썸네일)다 */
3651
+ export declare const MAX_PRODUCT_IMAGES = 10;
3652
+ /**
3653
+ * 상품 이미지 주소의 와이어 형식 — URL이고 2048자 이하다.
3654
+ *
3655
+ * https·확장자 규칙은 여기서 강제하지 않고 `productImageRejection`이 판정한다. 서버가
3656
+ * **새로 추가된 주소에만** 그 규칙을 적용해야 하기 때문이다(규칙이 생기기 전에 저장된
3657
+ * 주소 하나로 상품 수정 전체가 막히면 셀러가 빠져나갈 길이 없다).
3658
+ *
3659
+ * 응답 스키마(`productSchema.images`)도 넓게 둔다. 과거에 저장된 주소를 파싱 오류로
3660
+ * 만들면 상품 조회 자체가 막힌다.
3661
+ */
3662
+ export declare const productImageUrlSchema: z.ZodURL;
3663
+ export interface ProductImageRejection {
3664
+ code: "INVALID_IMAGE_URL" | "UNSUPPORTED_FILE_TYPE";
3665
+ message: string;
3666
+ }
3667
+ /**
3668
+ * 상품에 **새로 붙이는** 이미지 주소의 규칙. 통과하면 `null`.
3669
+ *
3670
+ * - https만 받는다. http는 https 스토어프론트에서 혼합 콘텐츠로 차단되고 `data:`·`javascript:`는
3671
+ * 상세 화면에 박히는 주입 경로가 된다.
3672
+ * - 호스트는 제한하지 않는다 — 셀러가 이미 쓰는 이미지 호스트를 그대로 붙일 수 있어야 한다.
3673
+ * - 경로에 확장자가 있으면 상품 이미지 형식이어야 한다(svg·동영상 거부). **확장자가 없으면 통과시킨다**
3674
+ * — 외부 이미지 CDN은 확장자 없는 키를 쓰는 경우가 흔하고, 주소만으로는 실제 형식을 알 수 없다.
3675
+ */
3676
+ export declare function productImageRejection(url: string): ProductImageRejection | null;
3461
3677
  /** 옵션 축(그룹) 최대 개수 — 스키마 상한의 단일 원천 */
3462
3678
  export declare const MAX_OPTION_GROUPS = 3;
3463
3679
  /** 축 하나가 가질 수 있는 값의 최대 개수 */
@@ -3583,6 +3799,13 @@ export declare const productCreateRequestSchema: z.ZodObject<{
3583
3799
  conditionalFreeAmount: z.ZodOptional<z.ZodNumber>;
3584
3800
  returnFee: z.ZodDefault<z.ZodNumber>;
3585
3801
  exchangeFee: z.ZodDefault<z.ZodNumber>;
3802
+ refundPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3803
+ preShipmentDeliveryFeeRefund: z.ZodOptional<z.ZodBoolean>;
3804
+ returnDeliveryFee: z.ZodOptional<z.ZodNumber>;
3805
+ exchangeDeliveryFee: z.ZodOptional<z.ZodNumber>;
3806
+ sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
3807
+ conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
3808
+ }, z.core.$strict>>>;
3586
3809
  shippingAddressId: z.ZodOptional<z.ZodString>;
3587
3810
  returnAddressId: z.ZodOptional<z.ZodString>;
3588
3811
  optionGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -3655,15 +3878,6 @@ export declare const productListQuerySchema: z.ZodObject<{
3655
3878
  "updatedAt.desc": "updatedAt.desc";
3656
3879
  }>>;
3657
3880
  }, z.core.$strip>;
3658
- /** `POST /v1/product-images` 응답 — 업로드된 이미지의 CDN 주소 */
3659
- export declare const productImageUploadResultSchema: z.ZodObject<{
3660
- images: z.ZodArray<z.ZodObject<{
3661
- url: z.ZodURL;
3662
- width: z.ZodNumber;
3663
- height: z.ZodNumber;
3664
- }, z.core.$strip>>;
3665
- }, z.core.$strip>;
3666
- export type ProductImageUploadResult = z.infer<typeof productImageUploadResultSchema>;
3667
3881
  export declare const discountSchema: z.ZodObject<{
3668
3882
  productId: z.ZodString;
3669
3883
  discountType: z.ZodEnum<{
@@ -3706,6 +3920,18 @@ export declare function isWebOrigin(value: string): boolean;
3706
3920
  export declare const analyticsOriginSchema: z.ZodString;
3707
3921
  /** 허용 오리진 상한 */
3708
3922
  export declare const MAX_ANALYTICS_ALLOWED_ORIGINS = 20;
3923
+ /** 자동 배송완료·자동 구매확정 대기일 상한 */
3924
+ export declare const MAX_AUTO_TRANSITION_DAYS = 30;
3925
+ /**
3926
+ * 약관 버전 — 스토어가 정하는 문자열이다(`1`·`2`·`2026-09-26`·`v1.2` 등). 형식은 강제하지 않고 값이 다르면 다른 버전이다.
3927
+ * 올리면 그 약관에 동의한 구매자의 `reconsentRequired`가 켜지고, 재동의가 이력에 남는다. 되돌리면 재동의 요구도 풀린다.
3928
+ */
3929
+ export declare const policyVersionSchema: z.ZodString;
3930
+ /**
3931
+ * 약관 문서 주소 — 구매자에게 보여 주는 약관 본문의 주소다. 동의 시점 값이 이력 행에 복사되므로
3932
+ * 나중에 주소를 바꿔도 "무엇에 동의했는지"가 남는다. `null`로 지울 수 있다.
3933
+ */
3934
+ export declare const policyDocumentUrlSchema: z.ZodNullable<z.ZodURL>;
3709
3935
  /** `PATCH /v1/store` 본문 — 바꿀 필드만 보낸다 */
3710
3936
  export declare const updateStoreRequestSchema: z.ZodObject<{
3711
3937
  name: z.ZodOptional<z.ZodString>;
@@ -3715,6 +3941,19 @@ export declare const updateStoreRequestSchema: z.ZodObject<{
3715
3941
  analyticsAllowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
3716
3942
  storefrontOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
3717
3943
  guestCheckoutEnabled: z.ZodOptional<z.ZodBoolean>;
3944
+ autoDeliverDays: z.ZodOptional<z.ZodNumber>;
3945
+ autoConfirmDays: z.ZodOptional<z.ZodNumber>;
3946
+ refundPolicy: z.ZodOptional<z.ZodObject<{
3947
+ preShipmentDeliveryFeeRefund: z.ZodOptional<z.ZodBoolean>;
3948
+ returnDeliveryFee: z.ZodOptional<z.ZodNumber>;
3949
+ exchangeDeliveryFee: z.ZodOptional<z.ZodNumber>;
3950
+ sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
3951
+ conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
3952
+ }, z.core.$strict>>;
3953
+ termsVersion: z.ZodOptional<z.ZodString>;
3954
+ privacyVersion: z.ZodOptional<z.ZodString>;
3955
+ termsUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
3956
+ privacyUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
3718
3957
  }, z.core.$strip>;
3719
3958
  export type UpdateStoreRequest = z.infer<typeof updateStoreRequestSchema>;
3720
3959
  export declare const storeSchema: z.ZodObject<{
@@ -3733,6 +3972,21 @@ export declare const storeSchema: z.ZodObject<{
3733
3972
  analyticsAllowedOrigins: z.ZodArray<z.ZodString>;
3734
3973
  storefrontOrigins: z.ZodArray<z.ZodString>;
3735
3974
  guestCheckoutEnabled: z.ZodBoolean;
3975
+ autoDeliverDays: z.ZodNumber;
3976
+ autoConfirmDays: z.ZodNumber;
3977
+ refundPolicy: z.ZodObject<{
3978
+ preShipmentDeliveryFeeRefund: z.ZodBoolean;
3979
+ returnDeliveryFee: z.ZodNumber;
3980
+ exchangeDeliveryFee: z.ZodNumber;
3981
+ sellerFaultFreeShipping: z.ZodBoolean;
3982
+ conditionalFreeShortfallCharge: z.ZodBoolean;
3983
+ }, z.core.$strip>;
3984
+ termsVersion: z.ZodString;
3985
+ privacyVersion: z.ZodString;
3986
+ termsVersionUpdatedAt: z.ZodNullable<z.ZodString>;
3987
+ privacyVersionUpdatedAt: z.ZodNullable<z.ZodString>;
3988
+ termsUrl: z.ZodNullable<z.ZodString>;
3989
+ privacyUrl: z.ZodNullable<z.ZodString>;
3736
3990
  memberCount: z.ZodNumber;
3737
3991
  createdAt: z.ZodString;
3738
3992
  }, z.core.$strip>;
@@ -3829,6 +4083,42 @@ export declare const sellerAddressRequestSchema: z.ZodObject<{
3829
4083
  export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
3830
4084
  //#endregion
3831
4085
  //#region src/schemas/upload.d.ts
4086
+ /**
4087
+ * 업로드 용도. 허용 확장자와 크기 상한이 용도별로 다르다.
4088
+ *
4089
+ * - `product-image`: 상품 목록·상세의 상품 이미지. 목록 썸네일로 쓰이므로 정지 이미지만 받는다.
4090
+ * - `description`: 상세설명 본문에 삽입하는 미디어. 동영상과 svg도 받는다.
4091
+ */
4092
+ export declare const uploadPurposeSchema: z.ZodEnum<{
4093
+ "product-image": "product-image";
4094
+ description: "description";
4095
+ }>;
4096
+ export type UploadPurpose = z.infer<typeof uploadPurposeSchema>;
4097
+ export interface UploadPurposeLimit {
4098
+ /** 소문자 확장자 목록 */
4099
+ extensions: readonly string[];
4100
+ maxBytes: number;
4101
+ }
4102
+ /**
4103
+ * 용도별 업로드 제한 — 서버(`POST /v1/uploads`)와 클라이언트가 공유하는 단일 원천이다.
4104
+ *
4105
+ * 크기는 **요청이 스스로 신고한 값**으로만 검사한다. 바이트는 api를 거치지 않고 CDN으로
4106
+ * 직접 PUT되므로 이 검사는 셀러가 올리기 전에 알게 하는 장치이고, 실제 상한은 CDN이 강제한다.
4107
+ */
4108
+ export declare const UPLOAD_PURPOSE_LIMITS: Record<UploadPurpose, UploadPurposeLimit>;
4109
+ /** 파일명의 소문자 확장자. 확장자가 없으면 `""` */
4110
+ export declare function uploadExtensionOf(filename: string): string;
4111
+ export interface UploadRejection {
4112
+ /** 400 형식 불일치 / 413 크기 초과 */
4113
+ status: 400 | 413;
4114
+ code: "UNSUPPORTED_FILE_TYPE" | "FILE_TOO_LARGE";
4115
+ message: string;
4116
+ }
4117
+ /**
4118
+ * 용도 제한 위반 여부. 통과하면 `null`.
4119
+ * 서버가 던지는 오류와 콘솔이 먼저 띄우는 안내가 갈리지 않도록 한 함수로 판정한다.
4120
+ */
4121
+ export declare function uploadRejection(purpose: UploadPurpose, filename: string, size?: number): UploadRejection | null;
3832
4122
  /**
3833
4123
  * 미디어 업로드 자리 발급 — `POST /v1/uploads`.
3834
4124
  *
@@ -3838,6 +4128,11 @@ export type SellerAddressRequest = z.infer<typeof sellerAddressRequestSchema>;
3838
4128
  */
3839
4129
  export declare const uploadRequestSchema: z.ZodObject<{
3840
4130
  filename: z.ZodString;
4131
+ purpose: z.ZodDefault<z.ZodEnum<{
4132
+ "product-image": "product-image";
4133
+ description: "description";
4134
+ }>>;
4135
+ size: z.ZodOptional<z.ZodNumber>;
3841
4136
  }, z.core.$strip>;
3842
4137
  export type UploadRequest = z.infer<typeof uploadRequestSchema>;
3843
4138
  export declare const uploadTicketSchema: z.ZodObject<{
@@ -4123,6 +4418,16 @@ export declare function createStoreClient(options: StoreClientOptions): {
4123
4418
  url: string;
4124
4419
  uploadUrl: string;
4125
4420
  }>;
4421
+ /**
4422
+ * 자리 발급 + 바이트 PUT을 한 번에 — 끝나면 `url`이 공개 주소다.
4423
+ *
4424
+ * 용도 제한(확장자·크기)은 서버가 판정하지만, 같은 규칙으로 여기서 먼저 걸러
4425
+ * 큰 파일을 CDN까지 보내고 나서 거절되는 왕복을 없앤다.
4426
+ */
4427
+ upload: (file: Blob, options?: {
4428
+ purpose?: UploadPurpose;
4429
+ filename?: string;
4430
+ }) => Promise<UploadTicket>;
4126
4431
  };
4127
4432
  products: {
4128
4433
  list: (params?: ProductListParams) => Promise<{
@@ -4190,6 +4495,13 @@ export declare function createStoreClient(options: StoreClientOptions): {
4190
4495
  conditionalFreeAmount?: number | null | undefined;
4191
4496
  returnFee?: number | undefined;
4192
4497
  exchangeFee?: number | undefined;
4498
+ refundPolicy?: {
4499
+ preShipmentDeliveryFeeRefund?: boolean | undefined;
4500
+ returnDeliveryFee?: number | undefined;
4501
+ exchangeDeliveryFee?: number | undefined;
4502
+ sellerFaultFreeShipping?: boolean | undefined;
4503
+ conditionalFreeShortfallCharge?: boolean | undefined;
4504
+ } | null | undefined;
4193
4505
  shippingAddressId?: string | null | undefined;
4194
4506
  returnAddressId?: string | null | undefined;
4195
4507
  createdAt?: string | undefined;
@@ -4241,6 +4553,13 @@ export declare function createStoreClient(options: StoreClientOptions): {
4241
4553
  conditionalFreeAmount?: number | null | undefined;
4242
4554
  returnFee?: number | undefined;
4243
4555
  exchangeFee?: number | undefined;
4556
+ refundPolicy?: {
4557
+ preShipmentDeliveryFeeRefund?: boolean | undefined;
4558
+ returnDeliveryFee?: number | undefined;
4559
+ exchangeDeliveryFee?: number | undefined;
4560
+ sellerFaultFreeShipping?: boolean | undefined;
4561
+ conditionalFreeShortfallCharge?: boolean | undefined;
4562
+ } | null | undefined;
4244
4563
  shippingAddressId?: string | null | undefined;
4245
4564
  returnAddressId?: string | null | undefined;
4246
4565
  createdAt?: string | undefined;
@@ -4292,6 +4611,13 @@ export declare function createStoreClient(options: StoreClientOptions): {
4292
4611
  conditionalFreeAmount?: number | null | undefined;
4293
4612
  returnFee?: number | undefined;
4294
4613
  exchangeFee?: number | undefined;
4614
+ refundPolicy?: {
4615
+ preShipmentDeliveryFeeRefund?: boolean | undefined;
4616
+ returnDeliveryFee?: number | undefined;
4617
+ exchangeDeliveryFee?: number | undefined;
4618
+ sellerFaultFreeShipping?: boolean | undefined;
4619
+ conditionalFreeShortfallCharge?: boolean | undefined;
4620
+ } | null | undefined;
4295
4621
  shippingAddressId?: string | null | undefined;
4296
4622
  returnAddressId?: string | null | undefined;
4297
4623
  createdAt?: string | undefined;
@@ -4598,6 +4924,8 @@ export declare function createStoreClient(options: StoreClientOptions): {
4598
4924
  optionName: string | null;
4599
4925
  sellerCode: string | null;
4600
4926
  quantity: number;
4927
+ canceledQuantity: number;
4928
+ activeQuantity: number;
4601
4929
  unitPrice: number;
4602
4930
  discountAmount: number;
4603
4931
  totalPrice: number;
@@ -4609,7 +4937,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4609
4937
  sellerMemo: string | null;
4610
4938
  orderedAt: string;
4611
4939
  lastChangedAt: string;
4612
- lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED";
4940
+ lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
4613
4941
  testPayment: boolean;
4614
4942
  }[];
4615
4943
  }>;
@@ -4632,6 +4960,8 @@ export declare function createStoreClient(options: StoreClientOptions): {
4632
4960
  optionName: string | null;
4633
4961
  sellerCode: string | null;
4634
4962
  quantity: number;
4963
+ canceledQuantity: number;
4964
+ activeQuantity: number;
4635
4965
  unitPrice: number;
4636
4966
  discountAmount: number;
4637
4967
  totalPrice: number;
@@ -4643,7 +4973,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4643
4973
  sellerMemo: string | null;
4644
4974
  orderedAt: string;
4645
4975
  lastChangedAt: string;
4646
- lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED";
4976
+ lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
4647
4977
  testPayment: boolean;
4648
4978
  }[];
4649
4979
  }>;
@@ -4663,6 +4993,10 @@ export declare function createStoreClient(options: StoreClientOptions): {
4663
4993
  cancelBySeller: (orderItemId: string, body: CancelBySellerRequest, idempotencyKey?: string) => Promise<{
4664
4994
  orderItemId: string;
4665
4995
  refundAmount: number;
4996
+ quantity: number;
4997
+ canceledQuantity: number;
4998
+ deliveryFeeRefundAmount: number;
4999
+ deliveryFeeChargeAmount: number;
4666
5000
  refundedAt: string;
4667
5001
  }>;
4668
5002
  updateMemo: (orderItemId: string, memo: string) => Promise<void>;
@@ -4696,6 +5030,48 @@ export declare function createStoreClient(options: StoreClientOptions): {
4696
5030
  }[];
4697
5031
  }>;
4698
5032
  updateTracking: (orderItemId: string, carrierCode: string, trackingNumber: string) => Promise<void>;
5033
+ /**
5034
+ * 배송완료 처리 — `DISPATCHED`·`DELIVERING`만 넘어간다. 응답의 `autoDecisionDate`가 자동 구매확정 예정일이다
5035
+ * (스토어 설정 `autoConfirmDays`가 0이면 null).
5036
+ */
5037
+ markDelivered: (orderItemId: string, idempotencyKey?: string) => Promise<{
5038
+ orderItemId: string;
5039
+ orderId: string;
5040
+ status: "PAID" | "PAYMENT_WAITING" | "CONFIRMED" | "DISPATCHED" | "DELIVERING" | "DELIVERED" | "PURCHASE_DECIDED" | "CANCELED";
5041
+ claimStatus: "CANCEL_REQUESTED" | "RETURN_REQUESTED" | "EXCHANGE_REQUESTED" | null;
5042
+ productId: string;
5043
+ productName: string;
5044
+ optionId: string | null;
5045
+ optionName: string | null;
5046
+ sellerCode: string | null;
5047
+ quantity: number;
5048
+ canceledQuantity: number;
5049
+ activeQuantity: number;
5050
+ unitPrice: number;
5051
+ discountAmount: number;
5052
+ totalPrice: number;
5053
+ hold: {
5054
+ reason: string;
5055
+ expectedDispatchDate: string;
5056
+ } | null;
5057
+ autoDecisionDate: string | null;
5058
+ sellerMemo: string | null;
5059
+ orderedAt: string;
5060
+ lastChangedAt: string;
5061
+ lastChangedType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED";
5062
+ testPayment: boolean;
5063
+ }>;
5064
+ /** 배송완료 일괄 처리 — 항목별 부분 성공이다 */
5065
+ markDeliveredBulk: (orderItemIds: string[], idempotencyKey?: string) => Promise<{
5066
+ succeeded: string[];
5067
+ failed: {
5068
+ code: string;
5069
+ message: string;
5070
+ id?: string | undefined;
5071
+ productId?: string | undefined;
5072
+ orderItemId?: string | undefined;
5073
+ }[];
5074
+ }>;
4699
5075
  getDelivery: (orderItemId: string) => Promise<{
4700
5076
  orderItemId: string;
4701
5077
  deliveryMethod: "COURIER" | "DIRECT" | "QUICK" | "NOTHING";
@@ -4739,6 +5115,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4739
5115
  responsibility: "BUYER" | "SELLER";
4740
5116
  claimDeliveryFee: number;
4741
5117
  expectedRefundAmount: number | null;
5118
+ expectedDeliveryFeeRefundAmount: number | null;
4742
5119
  exchangeOption: {
4743
5120
  optionId: string;
4744
5121
  optionName: string;
@@ -4767,6 +5144,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4767
5144
  responsibility: "BUYER" | "SELLER";
4768
5145
  claimDeliveryFee: number;
4769
5146
  expectedRefundAmount: number | null;
5147
+ expectedDeliveryFeeRefundAmount: number | null;
4770
5148
  exchangeOption: {
4771
5149
  optionId: string;
4772
5150
  optionName: string;
@@ -4790,6 +5168,9 @@ export declare function createStoreClient(options: StoreClientOptions): {
4790
5168
  claimId: string;
4791
5169
  refundAmount: number;
4792
5170
  deductAmount: number;
5171
+ quantity: number;
5172
+ deliveryFeeRefundAmount: number;
5173
+ deliveryFeeChargeAmount: number;
4793
5174
  refundedAt: string;
4794
5175
  }>;
4795
5176
  reject: (claimId: string, body: RejectClaimRequest) => Promise<void>;
@@ -4818,6 +5199,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
4818
5199
  responsibility: "BUYER" | "SELLER";
4819
5200
  claimDeliveryFee: number;
4820
5201
  expectedRefundAmount: number | null;
5202
+ expectedDeliveryFeeRefundAmount: number | null;
4821
5203
  exchangeOption: {
4822
5204
  optionId: string;
4823
5205
  optionName: string;
@@ -5010,6 +5392,36 @@ export declare function createStoreClient(options: StoreClientOptions): {
5010
5392
  method: "kakao" | "naver" | "google" | "password";
5011
5393
  linkedAt: string;
5012
5394
  }[];
5395
+ consents: {
5396
+ terms: {
5397
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
5398
+ agreed: boolean;
5399
+ agreedVersion: string | null;
5400
+ currentVersion: string | null;
5401
+ currentDocumentUrl: string | null;
5402
+ updatedAt: string | null;
5403
+ reconsentRequired: boolean;
5404
+ };
5405
+ privacy: {
5406
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
5407
+ agreed: boolean;
5408
+ agreedVersion: string | null;
5409
+ currentVersion: string | null;
5410
+ currentDocumentUrl: string | null;
5411
+ updatedAt: string | null;
5412
+ reconsentRequired: boolean;
5413
+ };
5414
+ marketing: {
5415
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
5416
+ agreed: boolean;
5417
+ agreedVersion: string | null;
5418
+ currentVersion: string | null;
5419
+ currentDocumentUrl: string | null;
5420
+ updatedAt: string | null;
5421
+ reconsentRequired: boolean;
5422
+ };
5423
+ reconsentRequired: boolean;
5424
+ };
5013
5425
  addresses: {
5014
5426
  addressId: string;
5015
5427
  alias: string;
@@ -5049,6 +5461,24 @@ export declare function createStoreClient(options: StoreClientOptions): {
5049
5461
  }[];
5050
5462
  }[];
5051
5463
  }>;
5464
+ /** 동의 이력 — 최근 순. 가입·재동의·마케팅 변경이 한 줄씩 남는다 */
5465
+ consents: (customerId: string, params?: PageParams & {
5466
+ kind?: ConsentKind;
5467
+ }) => Promise<{
5468
+ page: number;
5469
+ size: number;
5470
+ totalElements: number;
5471
+ totalPages: number;
5472
+ contents: {
5473
+ consentId: string;
5474
+ kind: "TERMS" | "PRIVACY" | "MARKETING";
5475
+ version: string | null;
5476
+ documentUrl: string | null;
5477
+ action: "WITHDRAWN" | "AGREED";
5478
+ source: "SELLER" | "SIGNUP" | "SOCIAL_SIGNUP" | "DELEGATED" | "RECONSENT" | "MEMBER_UPDATE";
5479
+ occurredAt: string;
5480
+ }[];
5481
+ }>;
5052
5482
  withdraw: (customerId: string, body: WithdrawCustomerRequest) => Promise<void>;
5053
5483
  };
5054
5484
  customerInquiries: {
@@ -6418,6 +6848,21 @@ export declare function createStoreClient(options: StoreClientOptions): {
6418
6848
  analyticsAllowedOrigins: string[];
6419
6849
  storefrontOrigins: string[];
6420
6850
  guestCheckoutEnabled: boolean;
6851
+ autoDeliverDays: number;
6852
+ autoConfirmDays: number;
6853
+ refundPolicy: {
6854
+ preShipmentDeliveryFeeRefund: boolean;
6855
+ returnDeliveryFee: number;
6856
+ exchangeDeliveryFee: number;
6857
+ sellerFaultFreeShipping: boolean;
6858
+ conditionalFreeShortfallCharge: boolean;
6859
+ };
6860
+ termsVersion: string;
6861
+ privacyVersion: string;
6862
+ termsVersionUpdatedAt: string | null;
6863
+ privacyVersionUpdatedAt: string | null;
6864
+ termsUrl: string | null;
6865
+ privacyUrl: string | null;
6421
6866
  memberCount: number;
6422
6867
  createdAt: string;
6423
6868
  }>;
@@ -6437,6 +6882,21 @@ export declare function createStoreClient(options: StoreClientOptions): {
6437
6882
  analyticsAllowedOrigins: string[];
6438
6883
  storefrontOrigins: string[];
6439
6884
  guestCheckoutEnabled: boolean;
6885
+ autoDeliverDays: number;
6886
+ autoConfirmDays: number;
6887
+ refundPolicy: {
6888
+ preShipmentDeliveryFeeRefund: boolean;
6889
+ returnDeliveryFee: number;
6890
+ exchangeDeliveryFee: number;
6891
+ sellerFaultFreeShipping: boolean;
6892
+ conditionalFreeShortfallCharge: boolean;
6893
+ };
6894
+ termsVersion: string;
6895
+ privacyVersion: string;
6896
+ termsVersionUpdatedAt: string | null;
6897
+ privacyVersionUpdatedAt: string | null;
6898
+ termsUrl: string | null;
6899
+ privacyUrl: string | null;
6440
6900
  memberCount: number;
6441
6901
  createdAt: string;
6442
6902
  }>;
@@ -6520,6 +6980,77 @@ export declare function exchangeStoreTokenViaOAuth(options: {
6520
6980
  role?: string;
6521
6981
  }>;
6522
6982
  //#endregion
6983
+ //#region src/schemas/refund-policy.d.ts
6984
+ /** 유효 환불 정책 — 스토어 기본 + 상품별 덮어쓰기를 합친 결과 */
6985
+ export declare const refundPolicySchema: z.ZodObject<{
6986
+ preShipmentDeliveryFeeRefund: z.ZodBoolean;
6987
+ returnDeliveryFee: z.ZodNumber;
6988
+ exchangeDeliveryFee: z.ZodNumber;
6989
+ sellerFaultFreeShipping: z.ZodBoolean;
6990
+ conditionalFreeShortfallCharge: z.ZodBoolean;
6991
+ }, z.core.$strip>;
6992
+ export type RefundPolicy = z.infer<typeof refundPolicySchema>;
6993
+ /**
6994
+ * 스토어가 정하지 않았을 때 서버가 쓰는 값.
6995
+ *
6996
+ * `as const`가 아니라 `RefundPolicy`로 타입을 좁힌다 — 리터럴 타입이면 `Partial<typeof …>`로 일부만 바꿀 때
6997
+ * `true` 자리에 `false`를 넣을 수 없다.
6998
+ */
6999
+ export declare const REFUND_POLICY_DEFAULTS: RefundPolicy;
7000
+ /**
7001
+ * 부분 정책 — 스토어 설정 요청과 상품별 덮어쓰기가 쓴다. 준 항목만 바뀐다.
7002
+ *
7003
+ * `strictObject`라 모르는 키는 400이다. 오타(`returnFee` 등)를 조용히 무시하면 셀러는 저장됐다고
7004
+ * 믿는데 정책은 기본값으로 남는다.
7005
+ */
7006
+ export declare const refundPolicyPatchSchema: z.ZodObject<{
7007
+ preShipmentDeliveryFeeRefund: z.ZodOptional<z.ZodBoolean>;
7008
+ returnDeliveryFee: z.ZodOptional<z.ZodNumber>;
7009
+ exchangeDeliveryFee: z.ZodOptional<z.ZodNumber>;
7010
+ sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
7011
+ conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
7012
+ }, z.core.$strict>;
7013
+ export type RefundPolicyPatch = z.infer<typeof refundPolicyPatchSchema>;
7014
+ /** 정책 해석에 쓰는 상품 값 — 상품별 덮어쓰기와 레거시 배송비 필드 */
7015
+ export interface RefundPolicyProductInput {
7016
+ /** 상품별 덮어쓰기. 없으면 스토어 기본을 그대로 쓴다 */
7017
+ refundPolicy?: RefundPolicyPatch | null;
7018
+ /** @deprecated 레거시 상품 반품비 — `refundPolicy`가 없는 옛 상품의 값이다 */
7019
+ returnFee?: number | null;
7020
+ /** @deprecated 레거시 상품 교환비 — `refundPolicy`가 없는 옛 상품의 값이다 */
7021
+ exchangeFee?: number | null;
7022
+ }
7023
+ /**
7024
+ * 유효 정책 해석 — 상품별 덮어쓰기 → 스토어 기본 → `REFUND_POLICY_DEFAULTS` 순이다.
7025
+ *
7026
+ * 반품비·교환비는 레거시 필드(`products.returnFee`·`exchangeFee`)와 **연결**한다. 상품이
7027
+ * `refundPolicy.returnDeliveryFee`를 정하면 그 값이 원천이고(서버가 `returnFee`도 같은 값으로 맞춘다),
7028
+ * 정하지 않았으면 레거시 값이 0보다 클 때 그 값을 쓴다. 0이면 스토어 기본을 따른다 —
7029
+ * 정책이 생기기 전에 만든 상품(반품비 0)이 스토어 기본을 물려받게 하는 규칙이다.
7030
+ */
7031
+ export declare function resolveRefundPolicy(storePolicy?: RefundPolicyPatch | null, product?: RefundPolicyProductInput | null): RefundPolicy;
7032
+ /**
7033
+ * 상품의 **덮어쓰기 자체** — 레거시 반품비·교환비를 같은 형태로 승격한 값이다. 덮어쓰기가 없으면 null.
7034
+ *
7035
+ * `resolveRefundPolicy`가 합친 결과로는 "상품이 정한 값"과 "스토어 기본을 물려받은 값"을 가를 수 없다.
7036
+ * 관리 API 응답의 `refundPolicy`와 콘솔 폼의 덮어쓰기 스위치가 이 함수를 원천으로 쓴다 — 가르지 못하면
7037
+ * 스토어 기본을 쓰는 상품을 저장할 때 그 순간의 기본값이 상품에 박히거나, 레거시 값이 조용히 사라진다.
7038
+ */
7039
+ export declare function productRefundPolicyOverride(product?: RefundPolicyProductInput | null): RefundPolicyPatch | null;
7040
+ /**
7041
+ * 수량 단위 부분 취소의 환불 기준액 — **누적 내림의 차분**이다.
7042
+ *
7043
+ * 원 단위 반올림 규칙: `floor(주문상품 금액 × 누적 수량 ÷ 전체 수량)`을 두 번 구해 그 차를 쓴다.
7044
+ * 부분 취소를 몇 번 나눠도 합이 주문상품 금액과 정확히 같아서 1원이 남거나 넘치지 않는다.
7045
+ * 할인은 이미 단가에 들어 있어(주문 단위 쿠폰이 없다) 별도 안분이 없다.
7046
+ *
7047
+ * @param totalPrice 주문상품 금액 (할인 반영 단가 × 전체 수량)
7048
+ * @param quantity 주문상품 전체 수량
7049
+ * @param settledQuantity 이미 취소·반품된 누적 수량
7050
+ * @param cancelQuantity 이번에 취소·반품할 수량
7051
+ */
7052
+ export declare function proratedRefundBase(totalPrice: number, quantity: number, settledQuantity: number, cancelQuantity: number): number;
7053
+ //#endregion
6523
7054
  //#region src/schemas/scope.d.ts
6524
7055
  /**
6525
7056
  * 스토어 스코프 카탈로그 (auth-spec §7) — 형식 `{리소스}:{r|rw}`, rw는 r을 함의한다.
@@ -6612,6 +7143,11 @@ export declare const claimWebhookEventDataSchema: z.ZodObject<{
6612
7143
  COMPLETED: "COMPLETED";
6613
7144
  WITHDRAWN: "WITHDRAWN";
6614
7145
  }>;
7146
+ quantity: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7147
+ refundAmount: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
7148
+ deliveryFeeRefundAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7149
+ deliveryFeeChargeAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7150
+ deductAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6615
7151
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6616
7152
  }, z.core.$strip>;
6617
7153
  export type ClaimWebhookEventData = z.infer<typeof claimWebhookEventDataSchema>;
@@ -6685,6 +7221,11 @@ export declare const claimWebhookEventSchema: z.ZodObject<{
6685
7221
  COMPLETED: "COMPLETED";
6686
7222
  WITHDRAWN: "WITHDRAWN";
6687
7223
  }>;
7224
+ quantity: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7225
+ refundAmount: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
7226
+ deliveryFeeRefundAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7227
+ deliveryFeeChargeAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7228
+ deductAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6688
7229
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6689
7230
  }, z.core.$strip>;
6690
7231
  id: z.ZodString;
@@ -6776,6 +7317,11 @@ export declare const webhookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6776
7317
  COMPLETED: "COMPLETED";
6777
7318
  WITHDRAWN: "WITHDRAWN";
6778
7319
  }>;
7320
+ quantity: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7321
+ refundAmount: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
7322
+ deliveryFeeRefundAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7323
+ deliveryFeeChargeAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7324
+ deductAmount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6779
7325
  testPayment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6780
7326
  }, z.core.$strip>;
6781
7327
  id: z.ZodString;