@sayren/store-sdk 0.29.5 → 0.29.7
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 +170 -82
- package/dist/index.mjs +63 -14
- 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/coupon.ts +29 -10
- package/src/schemas/order.ts +29 -4
- package/src/schemas/payment.ts +21 -2
- package/src/schemas/product.ts +25 -0
- package/src/schemas/webhook-event.ts +32 -0
package/dist/index.mjs
CHANGED
|
@@ -730,6 +730,31 @@ const categoryListQuerySchema = z.object({
|
|
|
730
730
|
/** `DELETE /v1/categories/{categoryId}` 쿼리 — OpenAPI 문서용 형태 */
|
|
731
731
|
const categoryDeleteQuerySchema = z.object({ strategy: categoryDeleteStrategySchema.optional().describe("하위 카테고리·연결 상품 처리 방식. 생략하면 둘 중 하나라도 있을 때 409 `CATEGORY_NOT_EMPTY`다. `reparent`는 직계 자식을 삭제할 카테고리의 부모로 옮기고, `cascade`는 서브트리를 삭제하고 연결 상품을 미분류로 둔다") });
|
|
732
732
|
//#endregion
|
|
733
|
+
//#region src/schemas/commerce-number.ts
|
|
734
|
+
/**
|
|
735
|
+
* 국내 쇼핑몰 번호 체계(이슈 #107) — 공개 ID(`ord_…` 등)와 따로 싣는 숫자 번호의 표기·필드.
|
|
736
|
+
* 번호는 서버가 만들고 생성 후 바뀌지 않는다. 새 필드라 옛 서버 응답에는 없다 — 파싱은 null로 채운다.
|
|
737
|
+
*/
|
|
738
|
+
/**
|
|
739
|
+
* 번호 표기 — 숫자를 앞에서부터 4자리씩 하이픈으로 나눈다. 주문번호 `26100284731592` → `2610-0284-7315-92`,
|
|
740
|
+
* 상품주문번호 `2610028473159201` → `2610-0284-7315-9201`. 숫자만으로 된 값이 아니면(클레임번호 `C…`) 그대로, 없으면 빈 문자열이다.
|
|
741
|
+
* 화면 표기 전용이다 — API에 보낼 때는 원래 값을 쓴다(주문번호 조회는 하이픈도 받는다)
|
|
742
|
+
*/
|
|
743
|
+
function formatOrderNo(no) {
|
|
744
|
+
if (!no) return "";
|
|
745
|
+
if (!/^\d+$/.test(no)) return no;
|
|
746
|
+
return no.match(/.{1,4}/g)?.join("-") ?? no;
|
|
747
|
+
}
|
|
748
|
+
/** 표기 하이픈·공백을 지운 숫자 번호. 숫자가 아닌 글자가 남거나 비면 null */
|
|
749
|
+
function parseOrderNo(value) {
|
|
750
|
+
const digits = value.replace(/[\s-]/g, "");
|
|
751
|
+
return /^\d+$/.test(digits) ? digits : null;
|
|
752
|
+
}
|
|
753
|
+
/** 응답 번호 필드 — 서버는 항상 싣고, 번호 체계 이전 행(백필 전)·옛 서버 응답은 null이다 */
|
|
754
|
+
function commerceNumberField(description) {
|
|
755
|
+
return z.string().nullable().optional().default(null).describe(description);
|
|
756
|
+
}
|
|
757
|
+
//#endregion
|
|
733
758
|
//#region src/schemas/common.ts
|
|
734
759
|
const pageInfoSchema = z.object({
|
|
735
760
|
page: z.number().int(),
|
|
@@ -826,6 +851,7 @@ const claimReturnAddressSchema = z.object({
|
|
|
826
851
|
});
|
|
827
852
|
const claimSchema = z.object({
|
|
828
853
|
claimId: z.string(),
|
|
854
|
+
claimNo: commerceNumberField("클레임번호(이슈 #107) — `C` + YYMMDD(KST) + 숫자 8자리. 취소·반품·교환 접수 단위 번호이고 생성 후 바뀌지 않습니다"),
|
|
829
855
|
type: claimTypeSchema,
|
|
830
856
|
status: claimStatusSchema,
|
|
831
857
|
orderId: z.string(),
|
|
@@ -1545,6 +1571,7 @@ const productStatusSchema = z.enum([
|
|
|
1545
1571
|
]);
|
|
1546
1572
|
const productSummarySchema = z.object({
|
|
1547
1573
|
productId: z.string(),
|
|
1574
|
+
productNo: z.number().int().nullable().optional().default(null).describe("상품번호(이슈 #107) — 상점별 1부터 증가하는 숫자, 상점 안에서 유일, 생성 후 바뀌지 않으며 지운 상품의 번호는 다시 쓰지 않습니다. URL에 써도 됩니다(스토어프론트 상품 상세 경로가 받습니다). 번호 체계 이전 응답은 null"),
|
|
1548
1575
|
name: z.string(),
|
|
1549
1576
|
status: productStatusSchema,
|
|
1550
1577
|
salePrice: z.number().int().describe("판매가. 원(KRW) 단위 정수"),
|
|
@@ -1578,6 +1605,7 @@ const optionGroupSchema = z.object({
|
|
|
1578
1605
|
*/
|
|
1579
1606
|
const productVariantSchema = z.object({
|
|
1580
1607
|
variantId: z.string(),
|
|
1608
|
+
variantNo: z.string().nullable().optional().default(null).describe("조합 번호(이슈 #107) — `{productNo}-{조합 순번 2자리}`(예: `10482-03`). 시스템이 매기는 SKU이고 상점 안에서 유일합니다(상품번호가 상점 범위라 다른 상점과는 겹칠 수 있습니다). 생성 후 바뀌지 않으며, 지운 조합의 번호는 다시 쓰지 않습니다. 셀러가 입력하는 `sku`와 별개입니다"),
|
|
1581
1609
|
/** 축 sortOrder 순서와 1:1 대응. 옵션 없는 상품은 [] */
|
|
1582
1610
|
valueIds: z.array(z.string()),
|
|
1583
1611
|
/** 값 이름을 " / "로 이은 파생 표시명. 옵션 없으면 "" */
|
|
@@ -1937,6 +1965,7 @@ const productListQuerySchema = z.object({
|
|
|
1937
1965
|
categoryId: z.string().optional().describe("카테고리 필터 — 하위 카테고리의 상품도 포함"),
|
|
1938
1966
|
keyword: z.string().optional().describe("상품명 검색 (포함)"),
|
|
1939
1967
|
sellerCode: z.string().optional().describe("판매자 상품코드 — 이 코드가 붙은 variant를 가진 상품"),
|
|
1968
|
+
productNo: z.string().optional().describe("상품번호(이슈 #107) — 이 상점의 그 번호 상품만. 숫자가 아니면 400 `INVALID_PARAMETER`"),
|
|
1940
1969
|
sort: productSortSchema.optional().describe("정렬 (기본 createdAt.desc)"),
|
|
1941
1970
|
...pageQueryShape()
|
|
1942
1971
|
});
|
|
@@ -2955,8 +2984,16 @@ const couponStatusSchema = z.enum([
|
|
|
2955
2984
|
"PAUSED",
|
|
2956
2985
|
"ENDED"
|
|
2957
2986
|
]).describe("쿠폰 상태. `ACTIVE`=사용 중, `PAUSED`=중지(재개 가능), `ENDED`=종료(되돌릴 수 없음)");
|
|
2958
|
-
/**
|
|
2959
|
-
|
|
2987
|
+
/**
|
|
2988
|
+
* 발급 방식 — 코드 입력·셀러 지급·다운로드(구매자가 받기)·회원가입 자동 지급(이슈 #110).
|
|
2989
|
+
* 응답(`couponSchema.issueMethod`)은 값이 늘 수 있어 문자열로 받는다. 이 enum은 요청 검증용이다.
|
|
2990
|
+
*/
|
|
2991
|
+
const couponIssueMethodSchema = z.enum([
|
|
2992
|
+
"CODE",
|
|
2993
|
+
"MANUAL",
|
|
2994
|
+
"DOWNLOAD",
|
|
2995
|
+
"SIGNUP"
|
|
2996
|
+
]).describe("발급 방식. `CODE`=구매자가 주문서에 코드를 입력한다, `MANUAL`=셀러가 회원을 골라 지급한다, `DOWNLOAD`=구매자가 스토어프론트에서 받는다, `SIGNUP`=회원가입 때 자동으로 지급한다");
|
|
2960
2997
|
/** 코드 형식 — 영문·숫자·`-`·`_` 6~30자. 대소문자를 구분하지 않고 서버가 대문자로 저장한다 */
|
|
2961
2998
|
const COUPON_CODE_PATTERN = /^[A-Za-z0-9_-]{6,30}$/;
|
|
2962
2999
|
/** 코드 정규화 — 대문자, 앞뒤 공백 제거. 입력·저장·조회가 같은 함수를 쓴다 */
|
|
@@ -2970,10 +3007,10 @@ const descriptions$1 = {
|
|
|
2970
3007
|
code: "쿠폰 코드 — 발급 방식이 `CODE`일 때 필수. 영문·숫자·`-`·`_` 6~30자, 대소문자 구분 없음(대문자로 저장). 상점 안에서 유일하다",
|
|
2971
3008
|
startsAt: "사용 시작 시각(ISO 8601, 시간대 포함). 생략하면 바로 쓸 수 있다",
|
|
2972
3009
|
endsAt: "사용 종료 시각(ISO 8601, 시간대 포함). 이 시각부터 못 쓴다. 생략하면 제한이 없다. 이미 지급한 쿠폰의 유효 기간은 지급 때 정해지므로 뒤에 종료일을 늦춰도 늘어나지 않는다",
|
|
2973
|
-
validDaysAfterIssue: "발급 후 유효 일수 —
|
|
2974
|
-
totalIssueLimit: "총 발급 수 한도. 생략하면
|
|
3010
|
+
validDaysAfterIssue: "발급 후 유효 일수 — 발급형(`MANUAL`·`DOWNLOAD`·`SIGNUP`) 쿠폰만. 쿠폰 종료일과 둘 중 먼저 끝나는 쪽이 적용된다",
|
|
3011
|
+
totalIssueLimit: "총 발급 수 한도. 생략하면 무제한. 다운로드·회원가입 쿠폰은 한도에 닿으면 더 발급하지 않는다",
|
|
2975
3012
|
totalUseLimit: "총 사용 수 한도. 결제 중인 예약도 센다. 생략하면 무제한",
|
|
2976
|
-
perMemberIssueLimit: "1인 발급 수 한도(셀러
|
|
3013
|
+
perMemberIssueLimit: "1인 발급 수 한도(셀러 지급·다운로드). 생략하면 1인 1장. 회원가입 쿠폰은 1장 고정이라 1만 받는다",
|
|
2977
3014
|
perMemberUseLimit: "1인 사용 수 한도(코드 입력형). 생략하면 무제한. 비회원에게 여는 쿠폰은 둘 수 없다"
|
|
2978
3015
|
};
|
|
2979
3016
|
/** 조건 입력 — 생략한 항목은 기본값(`COUPON_CONDITIONS_DEFAULTS`)이다 */
|
|
@@ -3017,8 +3054,9 @@ const createCouponRequestSchema = z.strictObject({
|
|
|
3017
3054
|
if (body.issueMethod === "CODE" && !body.code) issue("code", "코드 입력형 쿠폰은 코드가 필요합니다");
|
|
3018
3055
|
if (body.issueMethod !== "CODE" && body.code) issue("code", "코드는 코드 입력형 쿠폰에만 둡니다");
|
|
3019
3056
|
if (body.issueMethod === "CODE" && body.validDaysAfterIssue != null) issue("validDaysAfterIssue", "발급 후 유효 일수는 셀러 지급 쿠폰에만 둡니다");
|
|
3020
|
-
if (body.issueMethod === "CODE" && body.perMemberIssueLimit != null) issue("perMemberIssueLimit", "1인 발급 수 한도는
|
|
3021
|
-
if (body.issueMethod === "
|
|
3057
|
+
if (body.issueMethod === "CODE" && body.perMemberIssueLimit != null) issue("perMemberIssueLimit", "1인 발급 수 한도는 발급형 쿠폰에만 둡니다");
|
|
3058
|
+
if (body.issueMethod === "SIGNUP" && body.perMemberIssueLimit != null && body.perMemberIssueLimit !== 1) issue("perMemberIssueLimit", "회원가입 쿠폰은 1인 1장입니다");
|
|
3059
|
+
if (body.issueMethod !== "CODE" && body.perMemberUseLimit != null) issue("perMemberUseLimit", "발급형 쿠폰은 발급 한 장이 한 번 쓰입니다. 1인 발급 수 한도를 사용하십시오");
|
|
3022
3060
|
if (!(body.conditions?.memberOnly ?? COUPON_CONDITIONS_DEFAULTS.memberOnly) && (body.issueMethod !== "CODE" || body.perMemberUseLimit != null)) issue("conditions", "비회원에게 여는 쿠폰은 코드 입력형이면서 1인 사용 한도가 없어야 합니다");
|
|
3023
3061
|
if (body.startsAt && body.endsAt && Date.parse(body.endsAt) <= Date.parse(body.startsAt)) issue("endsAt", "종료 시각은 시작 시각보다 뒤여야 합니다");
|
|
3024
3062
|
});
|
|
@@ -3050,7 +3088,7 @@ const couponSchema = z.object({
|
|
|
3050
3088
|
benefit: couponBenefitSchema,
|
|
3051
3089
|
conditions: couponConditionsSchema,
|
|
3052
3090
|
target: couponTargetSchema,
|
|
3053
|
-
issueMethod: z.string().describe("발급 방식. 현재 값은 `CODE`·`MANUAL
|
|
3091
|
+
issueMethod: z.string().describe("발급 방식. 현재 값은 `CODE`·`MANUAL`·`DOWNLOAD`(구매자가 받기)·`SIGNUP`(회원가입 자동 지급)이고 값이 추가될 수 있어 문자열로 받는다"),
|
|
3054
3092
|
code: z.string().nullable().describe("쿠폰 코드(대문자). 코드 입력형이 아니면 null"),
|
|
3055
3093
|
startsAt: z.string().nullable(),
|
|
3056
3094
|
endsAt: z.string().nullable(),
|
|
@@ -3083,6 +3121,7 @@ const couponIssueSchema = z.object({
|
|
|
3083
3121
|
couponId: z.string(),
|
|
3084
3122
|
customerId: z.string(),
|
|
3085
3123
|
customerName: z.string().nullable().describe("구매자 이름. 탈퇴한 구매자는 null"),
|
|
3124
|
+
source: z.string().optional().describe("발급 경로(이슈 #110). 현재 값은 `MANUAL`(셀러 지급)·`DOWNLOAD`(구매자가 받음)·`SIGNUP`(회원가입 자동 지급)이고 값이 추가될 수 있다. 서버는 항상 싣는다"),
|
|
3086
3125
|
status: couponIssueStatusSchema,
|
|
3087
3126
|
validFrom: z.string(),
|
|
3088
3127
|
validUntil: z.string().nullable(),
|
|
@@ -3966,7 +4005,8 @@ const paymentRecordSchema = z.object({
|
|
|
3966
4005
|
environment: pgEnvironmentSchema.nullable().describe("결제 환경"),
|
|
3967
4006
|
testPayment: z.boolean().describe("샌드박스 결제인가"),
|
|
3968
4007
|
pgTransactionId: z.string().nullable().describe("PG 거래 id (토스 paymentKey, 포트원 txId)"),
|
|
3969
|
-
attemptId: z.string().nullable().describe("
|
|
4008
|
+
attemptId: z.string().nullable().describe("대표 시도 id. 번호 체계(이슈 #107) 이전 시도는 이 값을 PG 주문번호로 보냈습니다"),
|
|
4009
|
+
pgOrderId: z.string().nullable().optional().default(null).describe("PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다"),
|
|
3970
4010
|
attemptCount: z.number().int().describe("시도 횟수"),
|
|
3971
4011
|
failCode: z.string().nullable().describe("실패 코드. 실패로 끝난 결제만"),
|
|
3972
4012
|
failMessage: z.string().nullable().describe("실패 사유"),
|
|
@@ -3977,6 +4017,7 @@ const paymentRecordSchema = z.object({
|
|
|
3977
4017
|
const paymentRecordPageSchema = pageSchema(paymentRecordSchema);
|
|
3978
4018
|
const paymentAttemptRecordSchema = z.object({
|
|
3979
4019
|
attemptId: z.string(),
|
|
4020
|
+
pgOrderId: z.string().nullable().optional().default(null).describe("PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다"),
|
|
3980
4021
|
sequence: z.number().int().describe("결제 건 안에서의 순번 (1부터)"),
|
|
3981
4022
|
provider: pgProviderSchema,
|
|
3982
4023
|
status: paymentAttemptStatusSchema,
|
|
@@ -4017,7 +4058,7 @@ const paymentListQuerySchema = z.object({
|
|
|
4017
4058
|
status: z.string().optional().describe("결제 상태 필터 (PaymentRecordStatus)"),
|
|
4018
4059
|
provider: z.string().optional().describe("PG 필터"),
|
|
4019
4060
|
method: z.string().optional().describe("실제 결제수단 필터"),
|
|
4020
|
-
keyword: z.string().optional().describe("결제 id
|
|
4061
|
+
keyword: z.string().optional().describe("결제 id·주문 id·PG 거래 id·시도 id·PG 주문번호(일치), 구매자명(포함)"),
|
|
4021
4062
|
includeTest: z.string().optional().describe("테스트 결제 포함 여부 (`true`·`false`. 기본 false — 실결제만)"),
|
|
4022
4063
|
page: z.string().optional().describe("페이지 번호 (1부터)"),
|
|
4023
4064
|
size: z.string().optional().describe("페이지 크기 (기본 20, 최대 100)")
|
|
@@ -4026,6 +4067,7 @@ const paymentListQuerySchema = z.object({
|
|
|
4026
4067
|
//#region src/schemas/order.ts
|
|
4027
4068
|
const orderSummarySchema = z.object({
|
|
4028
4069
|
orderId: z.string(),
|
|
4070
|
+
orderNo: commerceNumberField("주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오"),
|
|
4029
4071
|
ordererName: z.string(),
|
|
4030
4072
|
itemCount: z.number().int(),
|
|
4031
4073
|
totalAmount: z.number().int(),
|
|
@@ -4051,6 +4093,7 @@ const orderItemFulfillmentSchema = z.object({
|
|
|
4051
4093
|
});
|
|
4052
4094
|
const orderItemSchema = z.object({
|
|
4053
4095
|
orderItemId: z.string(),
|
|
4096
|
+
orderItemNo: commerceNumberField("상품주문번호(이슈 #107) — 주문번호 + 줄 순번 2자리(01부터, 100줄부터 3자리). 부분 취소·클레임·송장의 처리 단위 번호이고 생성 후 바뀌지 않습니다"),
|
|
4054
4097
|
orderId: z.string(),
|
|
4055
4098
|
status: orderItemStatusSchema,
|
|
4056
4099
|
claimStatus: z.enum([
|
|
@@ -4096,6 +4139,7 @@ const orderDiscountSchema = z.object({
|
|
|
4096
4139
|
});
|
|
4097
4140
|
const orderSchema = z.object({
|
|
4098
4141
|
orderId: z.string(),
|
|
4142
|
+
orderNo: commerceNumberField("주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오"),
|
|
4099
4143
|
orderedAt: z.string(),
|
|
4100
4144
|
orderer: z.object({
|
|
4101
4145
|
name: z.string(),
|
|
@@ -4137,14 +4181,15 @@ const testPaymentQuery = z.enum(["true", "false"]).optional().describe("테스
|
|
|
4137
4181
|
const pageQuery = { page: z.string().optional().describe("페이지 번호 (1부터, 기본 1)") };
|
|
4138
4182
|
/**
|
|
4139
4183
|
* `GET /v1/orders` 쿼리 — OpenAPI 문서용 형태(값은 쿼리 문자열). 검증 규칙은 서버가 적용한다:
|
|
4140
|
-
* `orderedFrom` 누락 400 `MISSING_PARAMETER`,
|
|
4184
|
+
* `orderNo` 없이 `orderedFrom` 누락 400 `MISSING_PARAMETER`, 날짜·`orderNo` 형식 오류 400 `INVALID_PARAMETER`, 31일 초과 400 `RANGE_TOO_WIDE`,
|
|
4141
4185
|
* `testPayment`가 `true`·`false`가 아니면 400 `INVALID_PARAMETER`
|
|
4142
4186
|
*/
|
|
4143
4187
|
const orderListQuerySchema = z.object({
|
|
4144
|
-
orderedFrom: z.string().describe("조회 시작 시각 (ISO 8601 날짜 또는 일시, 포함). 필수"),
|
|
4188
|
+
orderedFrom: z.string().optional().describe("조회 시작 시각 (ISO 8601 날짜 또는 일시, 포함). `orderNo`가 없으면 필수"),
|
|
4145
4189
|
orderedTo: z.string().optional().describe("조회 끝 시각 (ISO 8601, 포함). 생략하면 orderedFrom부터 31일. 기간은 최대 31일"),
|
|
4146
4190
|
status: orderItemStatusSchema.optional().describe("주문상품 상태 필터 — 이 상태의 주문상품이 하나라도 있는 주문"),
|
|
4147
|
-
keyword: z.string().optional().describe("
|
|
4191
|
+
keyword: z.string().optional().describe("주문 id·주문번호(일치, 하이픈 허용)·주문자명·수령인명(포함) 검색"),
|
|
4192
|
+
orderNo: z.string().optional().describe("주문번호 조회(이슈 #107) — 숫자 14자리, 하이픈 허용(`2610-0284-7315-92`). 주면 기간 조건 없이 그 주문만 찾습니다. 형식이 아니면 400 `INVALID_PARAMETER`"),
|
|
4148
4193
|
fulfillmentType: z.string().optional().describe("상품 유형 필터(이슈 #48) — 이 유형(`SHIPPING`·`MANUAL`)의 주문상품이 하나라도 있는 주문"),
|
|
4149
4194
|
testPayment: testPaymentQuery,
|
|
4150
4195
|
...pageQuery,
|
|
@@ -7137,6 +7182,7 @@ const envelopeFields = {
|
|
|
7137
7182
|
};
|
|
7138
7183
|
const orderWebhookEventDataSchema = z.object({
|
|
7139
7184
|
orderId: z.string().describe("주문 ID"),
|
|
7185
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7140
7186
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
7141
7187
|
testPayment: z.boolean().optional().default(false).describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았다. 이 필드가 없는 이전 이벤트는 false로 읽는다"),
|
|
7142
7188
|
couponDiscountAmount: z.number().int().optional().default(0).describe("주문이 받은 상품·주문 쿠폰 할인 합계 (원). 즉시할인(`discountAmount`)과 별개다. 쿠폰이 없거나 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
@@ -7155,6 +7201,7 @@ const orderWebhookEventDataSchema = z.object({
|
|
|
7155
7201
|
*/
|
|
7156
7202
|
const orderFulfilledWebhookEventDataSchema = z.object({
|
|
7157
7203
|
orderId: z.string().describe("주문 ID"),
|
|
7204
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7158
7205
|
orderItemId: z.string().describe("제공한 주문상품 ID"),
|
|
7159
7206
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
7160
7207
|
fulfillmentSnapshot: orderItemFulfillmentSnapshotResponseSchema.describe("제공한 주문상품의 주문 시점 이행 스냅샷(주문상품 응답의 `fulfillmentSnapshot`과 같다, 이슈 #57)"),
|
|
@@ -7169,6 +7216,7 @@ const orderFulfilledWebhookEventDataSchema = z.object({
|
|
|
7169
7216
|
*/
|
|
7170
7217
|
const orderCanceledWebhookEventDataSchema = z.object({
|
|
7171
7218
|
orderId: z.string().describe("주문 ID"),
|
|
7219
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7172
7220
|
orderItemId: z.string().describe("취소한 주문 상품 ID"),
|
|
7173
7221
|
status: orderItemStatusSchema.describe("취소 뒤 주문 대표 상태. 모든 주문 상품이 취소됐으면 `CANCELED`다"),
|
|
7174
7222
|
itemStatus: orderItemStatusSchema.describe("취소 뒤 주문 상품 상태. 전 수량이 취소됐으면 `CANCELED`, 일부만 취소했으면 원래 상태다"),
|
|
@@ -7185,6 +7233,7 @@ const orderCanceledWebhookEventDataSchema = z.object({
|
|
|
7185
7233
|
});
|
|
7186
7234
|
const claimWebhookEventDataSchema = z.object({
|
|
7187
7235
|
claimId: z.string().describe("클레임 ID"),
|
|
7236
|
+
claimNo: z.string().nullable().optional().default(null).describe("클레임번호(이슈 #107) — `C` + YYMMDD + 숫자 8자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 클레임은 null로 읽는다"),
|
|
7188
7237
|
orderId: z.string().describe("주문 ID"),
|
|
7189
7238
|
orderItemId: z.string().describe("클레임 대상 주문 상품 ID"),
|
|
7190
7239
|
claimType: claimTypeSchema.describe("클레임 유형"),
|
|
@@ -7449,4 +7498,4 @@ function createStoreSession(options) {
|
|
|
7449
7498
|
};
|
|
7450
7499
|
}
|
|
7451
7500
|
//#endregion
|
|
7452
|
-
export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_BEST_SELLING_DAYS, COLLECTION_PREVIEW_SIZE, COLLECTION_PRODUCT_SORTS, COLLECTION_SALES_SORT_DEFAULT_DAYS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_BEST_SELLING_TOP, MAX_COLLECTION_CREATED_WITHIN_DAYS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_RULES, MAX_COLLECTION_RULE_CATEGORIES, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, POINT_ADJUSTMENT_MAX, POINT_EARN_RATE_BP_MAX, POINT_ENTRY_TYPES, POINT_EXPIRY_DAYS_MAX, POINT_EXPIRY_DAYS_MIN, POINT_LOT_SOURCES, POINT_POLICY_DEFAULTS, POINT_REVIEW_REWARD_MAX, POINT_USE_UNITS, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT, STOREFRONT_DOMAIN_DNS_GRACE_DAYS, STOREFRONT_DOMAIN_DNS_WAIT_DAYS, STOREFRONT_DOMAIN_TXT_LABEL, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_PLATFORM_DOMAINS, STOREFRONT_PUBLIC_SUFFIXES, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SHOWCASE_SLUG_PREFIX, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_SOURCE_BLOB_BATCH_MAX, STOREFRONT_SOURCE_PART_BYTES, STOREFRONT_WORKSPACE_MAX_BYTES, STOREFRONT_WORKSPACE_MAX_FILES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addStorefrontDomainRequestSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionPreviewRequestSchema, collectionPreviewSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionRuleCategoryIds, collectionRuleSchema, collectionRuleViewSchema, collectionRulesPredicate, collectionRulesSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, pointRestoreExpiresAtOf, pointUseOf, pointUsePolicySchema, policyDocumentUrlSchema, policyVersionSchema, portOneChannelSchema, portOneCredentialsInputSchema, productCreateRequestSchema, productFulfillmentCreateSchema, productFulfillmentResponseSchema, productFulfillmentSchema, productFulfillmentUpdateSchema, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productRefundPolicyPatchSchema, productReplaceRequestSchema, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedPaidRefundBase, proratedPointRefund, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, purchaseEarnPolicySchema, purchaseEarnRateOf, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, splitRefund, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDnsRecordSchema, storefrontDomainSchema, storefrontDomainTxtNameOf, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteDomainSchema, storefrontSiteDomainsSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
|
|
7501
|
+
export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_BEST_SELLING_DAYS, COLLECTION_PREVIEW_SIZE, COLLECTION_PRODUCT_SORTS, COLLECTION_SALES_SORT_DEFAULT_DAYS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_BEST_SELLING_TOP, MAX_COLLECTION_CREATED_WITHIN_DAYS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_RULES, MAX_COLLECTION_RULE_CATEGORIES, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, POINT_ADJUSTMENT_MAX, POINT_EARN_RATE_BP_MAX, POINT_ENTRY_TYPES, POINT_EXPIRY_DAYS_MAX, POINT_EXPIRY_DAYS_MIN, POINT_LOT_SOURCES, POINT_POLICY_DEFAULTS, POINT_REVIEW_REWARD_MAX, POINT_USE_UNITS, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT, STOREFRONT_DOMAIN_DNS_GRACE_DAYS, STOREFRONT_DOMAIN_DNS_WAIT_DAYS, STOREFRONT_DOMAIN_TXT_LABEL, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_PLATFORM_DOMAINS, STOREFRONT_PUBLIC_SUFFIXES, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SHOWCASE_SLUG_PREFIX, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_SOURCE_BLOB_BATCH_MAX, STOREFRONT_SOURCE_PART_BYTES, STOREFRONT_WORKSPACE_MAX_BYTES, STOREFRONT_WORKSPACE_MAX_FILES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addStorefrontDomainRequestSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionPreviewRequestSchema, collectionPreviewSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionRuleCategoryIds, collectionRuleSchema, collectionRuleViewSchema, collectionRulesPredicate, collectionRulesSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, commerceNumberField, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, formatOrderNo, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, parseOrderNo, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, pointRestoreExpiresAtOf, pointUseOf, pointUsePolicySchema, policyDocumentUrlSchema, policyVersionSchema, portOneChannelSchema, portOneCredentialsInputSchema, productCreateRequestSchema, productFulfillmentCreateSchema, productFulfillmentResponseSchema, productFulfillmentSchema, productFulfillmentUpdateSchema, productImageRejection, productImageUrlSchema, productListQuerySchema, productOutOfStockWebhookEventDataSchema, productOutOfStockWebhookEventSchema, productPatchRequestSchema, productRefundPolicyOverride, productRefundPolicyPatchSchema, productReplaceRequestSchema, productSchema, productSortSchema, productStatusSchema, productSummarySchema, productVariantRequestSchema, productVariantSchema, proratedPaidRefundBase, proratedPointRefund, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, purchaseEarnPolicySchema, purchaseEarnRateOf, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, splitRefund, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDnsRecordSchema, storefrontDomainSchema, storefrontDomainTxtNameOf, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteDomainSchema, storefrontSiteDomainsSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./schemas/auth";
|
|
|
23
23
|
export * from "./schemas/category";
|
|
24
24
|
export * from "./schemas/claim";
|
|
25
25
|
export * from "./schemas/collection";
|
|
26
|
+
export * from "./schemas/commerce-number";
|
|
26
27
|
export * from "./schemas/common";
|
|
27
28
|
export * from "./schemas/coupon";
|
|
28
29
|
export * from "./schemas/customer";
|
package/src/schemas/claim.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { commerceNumberField } from "./commerce-number";
|
|
2
3
|
import { type PageParams, pageQueryShape } from "./common";
|
|
3
4
|
|
|
4
5
|
export const claimTypeSchema = z.enum(["CANCEL", "RETURN", "EXCHANGE"]);
|
|
@@ -50,6 +51,9 @@ export type ClaimReturnAddress = z.infer<typeof claimReturnAddressSchema>;
|
|
|
50
51
|
|
|
51
52
|
export const claimSchema = z.object({
|
|
52
53
|
claimId: z.string(),
|
|
54
|
+
claimNo: commerceNumberField(
|
|
55
|
+
"클레임번호(이슈 #107) — `C` + YYMMDD(KST) + 숫자 8자리. 취소·반품·교환 접수 단위 번호이고 생성 후 바뀌지 않습니다",
|
|
56
|
+
),
|
|
53
57
|
type: claimTypeSchema,
|
|
54
58
|
status: claimStatusSchema,
|
|
55
59
|
orderId: z.string(),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 국내 쇼핑몰 번호 체계(이슈 #107) — 공개 ID(`ord_…` 등)와 따로 싣는 숫자 번호의 표기·필드.
|
|
5
|
+
* 번호는 서버가 만들고 생성 후 바뀌지 않는다. 새 필드라 옛 서버 응답에는 없다 — 파싱은 null로 채운다.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 번호 표기 — 숫자를 앞에서부터 4자리씩 하이픈으로 나눈다. 주문번호 `26100284731592` → `2610-0284-7315-92`,
|
|
10
|
+
* 상품주문번호 `2610028473159201` → `2610-0284-7315-9201`. 숫자만으로 된 값이 아니면(클레임번호 `C…`) 그대로, 없으면 빈 문자열이다.
|
|
11
|
+
* 화면 표기 전용이다 — API에 보낼 때는 원래 값을 쓴다(주문번호 조회는 하이픈도 받는다)
|
|
12
|
+
*/
|
|
13
|
+
export function formatOrderNo(no: string | null | undefined): string {
|
|
14
|
+
if (!no) return "";
|
|
15
|
+
if (!/^\d+$/.test(no)) return no;
|
|
16
|
+
return no.match(/.{1,4}/g)?.join("-") ?? no;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** 표기 하이픈·공백을 지운 숫자 번호. 숫자가 아닌 글자가 남거나 비면 null */
|
|
20
|
+
export function parseOrderNo(value: string): string | null {
|
|
21
|
+
const digits = value.replace(/[\s-]/g, "");
|
|
22
|
+
return /^\d+$/.test(digits) ? digits : null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** 응답 번호 필드 — 서버는 항상 싣고, 번호 체계 이전 행(백필 전)·옛 서버 응답은 null이다 */
|
|
26
|
+
export function commerceNumberField(description: string) {
|
|
27
|
+
return z.string().nullable().optional().default(null).describe(description);
|
|
28
|
+
}
|
package/src/schemas/coupon.ts
CHANGED
|
@@ -23,11 +23,15 @@ export const couponStatusSchema = z
|
|
|
23
23
|
.describe("쿠폰 상태. `ACTIVE`=사용 중, `PAUSED`=중지(재개 가능), `ENDED`=종료(되돌릴 수 없음)");
|
|
24
24
|
export type CouponStatus = z.infer<typeof couponStatusSchema>;
|
|
25
25
|
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* 발급 방식 — 코드 입력·셀러 지급·다운로드(구매자가 받기)·회원가입 자동 지급(이슈 #110).
|
|
28
|
+
* 응답(`couponSchema.issueMethod`)은 값이 늘 수 있어 문자열로 받는다. 이 enum은 요청 검증용이다.
|
|
29
|
+
*/
|
|
27
30
|
export const couponIssueMethodSchema = z
|
|
28
|
-
.enum(["CODE", "MANUAL"])
|
|
31
|
+
.enum(["CODE", "MANUAL", "DOWNLOAD", "SIGNUP"])
|
|
29
32
|
.describe(
|
|
30
|
-
"발급 방식. `CODE`=구매자가 주문서에 코드를 입력한다, `MANUAL`=셀러가 회원을 골라
|
|
33
|
+
"발급 방식. `CODE`=구매자가 주문서에 코드를 입력한다, `MANUAL`=셀러가 회원을 골라 지급한다, " +
|
|
34
|
+
"`DOWNLOAD`=구매자가 스토어프론트에서 받는다, `SIGNUP`=회원가입 때 자동으로 지급한다",
|
|
31
35
|
);
|
|
32
36
|
export type CouponIssueMethod = z.infer<typeof couponIssueMethodSchema>;
|
|
33
37
|
|
|
@@ -51,10 +55,12 @@ const descriptions = {
|
|
|
51
55
|
"사용 종료 시각(ISO 8601, 시간대 포함). 이 시각부터 못 쓴다. 생략하면 제한이 없다. " +
|
|
52
56
|
"이미 지급한 쿠폰의 유효 기간은 지급 때 정해지므로 뒤에 종료일을 늦춰도 늘어나지 않는다",
|
|
53
57
|
validDaysAfterIssue:
|
|
54
|
-
"발급 후 유효 일수 —
|
|
55
|
-
totalIssueLimit:
|
|
58
|
+
"발급 후 유효 일수 — 발급형(`MANUAL`·`DOWNLOAD`·`SIGNUP`) 쿠폰만. 쿠폰 종료일과 둘 중 먼저 끝나는 쪽이 적용된다",
|
|
59
|
+
totalIssueLimit:
|
|
60
|
+
"총 발급 수 한도. 생략하면 무제한. 다운로드·회원가입 쿠폰은 한도에 닿으면 더 발급하지 않는다",
|
|
56
61
|
totalUseLimit: "총 사용 수 한도. 결제 중인 예약도 센다. 생략하면 무제한",
|
|
57
|
-
perMemberIssueLimit:
|
|
62
|
+
perMemberIssueLimit:
|
|
63
|
+
"1인 발급 수 한도(셀러 지급·다운로드). 생략하면 1인 1장. 회원가입 쿠폰은 1장 고정이라 1만 받는다",
|
|
58
64
|
perMemberUseLimit:
|
|
59
65
|
"1인 사용 수 한도(코드 입력형). 생략하면 무제한. 비회원에게 여는 쿠폰은 둘 수 없다",
|
|
60
66
|
} as const;
|
|
@@ -117,12 +123,19 @@ export const createCouponRequestSchema = z
|
|
|
117
123
|
issue("validDaysAfterIssue", "발급 후 유효 일수는 셀러 지급 쿠폰에만 둡니다");
|
|
118
124
|
}
|
|
119
125
|
if (body.issueMethod === "CODE" && body.perMemberIssueLimit != null) {
|
|
120
|
-
issue("perMemberIssueLimit", "1인 발급 수 한도는
|
|
126
|
+
issue("perMemberIssueLimit", "1인 발급 수 한도는 발급형 쿠폰에만 둡니다");
|
|
127
|
+
}
|
|
128
|
+
if (
|
|
129
|
+
body.issueMethod === "SIGNUP" &&
|
|
130
|
+
body.perMemberIssueLimit != null &&
|
|
131
|
+
body.perMemberIssueLimit !== 1
|
|
132
|
+
) {
|
|
133
|
+
issue("perMemberIssueLimit", "회원가입 쿠폰은 1인 1장입니다");
|
|
121
134
|
}
|
|
122
|
-
if (body.issueMethod
|
|
135
|
+
if (body.issueMethod !== "CODE" && body.perMemberUseLimit != null) {
|
|
123
136
|
issue(
|
|
124
137
|
"perMemberUseLimit",
|
|
125
|
-
"
|
|
138
|
+
"발급형 쿠폰은 발급 한 장이 한 번 쓰입니다. 1인 발급 수 한도를 사용하십시오",
|
|
126
139
|
);
|
|
127
140
|
}
|
|
128
141
|
const memberOnly = body.conditions?.memberOnly ?? COUPON_CONDITIONS_DEFAULTS.memberOnly;
|
|
@@ -168,7 +181,7 @@ export const couponSchema = z.object({
|
|
|
168
181
|
issueMethod: z
|
|
169
182
|
.string()
|
|
170
183
|
.describe(
|
|
171
|
-
"발급 방식. 현재 값은 `CODE`·`MANUAL
|
|
184
|
+
"발급 방식. 현재 값은 `CODE`·`MANUAL`·`DOWNLOAD`(구매자가 받기)·`SIGNUP`(회원가입 자동 지급)이고 값이 추가될 수 있어 문자열로 받는다",
|
|
172
185
|
),
|
|
173
186
|
code: z.string().nullable().describe("쿠폰 코드(대문자). 코드 입력형이 아니면 null"),
|
|
174
187
|
startsAt: z.string().nullable(),
|
|
@@ -214,6 +227,12 @@ export const couponIssueSchema = z.object({
|
|
|
214
227
|
couponId: z.string(),
|
|
215
228
|
customerId: z.string(),
|
|
216
229
|
customerName: z.string().nullable().describe("구매자 이름. 탈퇴한 구매자는 null"),
|
|
230
|
+
source: z
|
|
231
|
+
.string()
|
|
232
|
+
.optional()
|
|
233
|
+
.describe(
|
|
234
|
+
"발급 경로(이슈 #110). 현재 값은 `MANUAL`(셀러 지급)·`DOWNLOAD`(구매자가 받음)·`SIGNUP`(회원가입 자동 지급)이고 값이 추가될 수 있다. 서버는 항상 싣는다",
|
|
235
|
+
),
|
|
217
236
|
status: couponIssueStatusSchema,
|
|
218
237
|
validFrom: z.string(),
|
|
219
238
|
validUntil: z.string().nullable(),
|
package/src/schemas/order.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { commerceNumberField } from "./commerce-number";
|
|
2
3
|
import { changeTypeSchema, orderItemStatusSchema, type PageParams, pageSchema } from "./common";
|
|
3
4
|
import { orderItemFulfillmentSnapshotResponseSchema } from "./fulfillment";
|
|
4
5
|
import { cashReceiptSchema, easyPayProviderResponseSchema } from "./payment";
|
|
@@ -6,6 +7,9 @@ import { customInputValueSchema, optionSelectionSchema } from "./product";
|
|
|
6
7
|
|
|
7
8
|
export const orderSummarySchema = z.object({
|
|
8
9
|
orderId: z.string(),
|
|
10
|
+
orderNo: commerceNumberField(
|
|
11
|
+
"주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오",
|
|
12
|
+
),
|
|
9
13
|
ordererName: z.string(),
|
|
10
14
|
itemCount: z.number().int(),
|
|
11
15
|
totalAmount: z.number().int(),
|
|
@@ -53,6 +57,9 @@ export type OrderItemFulfillment = z.infer<typeof orderItemFulfillmentSchema>;
|
|
|
53
57
|
|
|
54
58
|
export const orderItemSchema = z.object({
|
|
55
59
|
orderItemId: z.string(),
|
|
60
|
+
orderItemNo: commerceNumberField(
|
|
61
|
+
"상품주문번호(이슈 #107) — 주문번호 + 줄 순번 2자리(01부터, 100줄부터 3자리). 부분 취소·클레임·송장의 처리 단위 번호이고 생성 후 바뀌지 않습니다",
|
|
62
|
+
),
|
|
56
63
|
orderId: z.string(),
|
|
57
64
|
status: orderItemStatusSchema,
|
|
58
65
|
claimStatus: z.enum(["CANCEL_REQUESTED", "RETURN_REQUESTED", "EXCHANGE_REQUESTED"]).nullable(),
|
|
@@ -151,6 +158,9 @@ export type OrderDiscount = z.infer<typeof orderDiscountSchema>;
|
|
|
151
158
|
|
|
152
159
|
export const orderSchema = z.object({
|
|
153
160
|
orderId: z.string(),
|
|
161
|
+
orderNo: commerceNumberField(
|
|
162
|
+
"주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오",
|
|
163
|
+
),
|
|
154
164
|
orderedAt: z.string(),
|
|
155
165
|
orderer: z.object({
|
|
156
166
|
name: z.string(),
|
|
@@ -271,11 +281,14 @@ const pageQuery = {
|
|
|
271
281
|
|
|
272
282
|
/**
|
|
273
283
|
* `GET /v1/orders` 쿼리 — OpenAPI 문서용 형태(값은 쿼리 문자열). 검증 규칙은 서버가 적용한다:
|
|
274
|
-
* `orderedFrom` 누락 400 `MISSING_PARAMETER`,
|
|
284
|
+
* `orderNo` 없이 `orderedFrom` 누락 400 `MISSING_PARAMETER`, 날짜·`orderNo` 형식 오류 400 `INVALID_PARAMETER`, 31일 초과 400 `RANGE_TOO_WIDE`,
|
|
275
285
|
* `testPayment`가 `true`·`false`가 아니면 400 `INVALID_PARAMETER`
|
|
276
286
|
*/
|
|
277
287
|
export const orderListQuerySchema = z.object({
|
|
278
|
-
orderedFrom: z
|
|
288
|
+
orderedFrom: z
|
|
289
|
+
.string()
|
|
290
|
+
.optional()
|
|
291
|
+
.describe("조회 시작 시각 (ISO 8601 날짜 또는 일시, 포함). `orderNo`가 없으면 필수"),
|
|
279
292
|
orderedTo: z
|
|
280
293
|
.string()
|
|
281
294
|
.optional()
|
|
@@ -283,7 +296,16 @@ export const orderListQuerySchema = z.object({
|
|
|
283
296
|
status: orderItemStatusSchema
|
|
284
297
|
.optional()
|
|
285
298
|
.describe("주문상품 상태 필터 — 이 상태의 주문상품이 하나라도 있는 주문"),
|
|
286
|
-
keyword: z
|
|
299
|
+
keyword: z
|
|
300
|
+
.string()
|
|
301
|
+
.optional()
|
|
302
|
+
.describe("주문 id·주문번호(일치, 하이픈 허용)·주문자명·수령인명(포함) 검색"),
|
|
303
|
+
orderNo: z
|
|
304
|
+
.string()
|
|
305
|
+
.optional()
|
|
306
|
+
.describe(
|
|
307
|
+
"주문번호 조회(이슈 #107) — 숫자 14자리, 하이픈 허용(`2610-0284-7315-92`). 주면 기간 조건 없이 그 주문만 찾습니다. 형식이 아니면 400 `INVALID_PARAMETER`",
|
|
308
|
+
),
|
|
287
309
|
fulfillmentType: z
|
|
288
310
|
.string()
|
|
289
311
|
.optional()
|
|
@@ -314,7 +336,10 @@ export const orderItemListQuerySchema = z.object({
|
|
|
314
336
|
});
|
|
315
337
|
|
|
316
338
|
export interface OrderListParams extends PageParams {
|
|
317
|
-
|
|
339
|
+
/** 조회 시작 시각 — `orderNo`가 없으면 필수 */
|
|
340
|
+
orderedFrom?: string;
|
|
341
|
+
/** 주문번호 조회(이슈 #107) — 주면 기간 없이 그 주문만 찾는다 */
|
|
342
|
+
orderNo?: string;
|
|
318
343
|
orderedTo?: string;
|
|
319
344
|
status?: z.infer<typeof orderItemStatusSchema>;
|
|
320
345
|
keyword?: string;
|
package/src/schemas/payment.ts
CHANGED
|
@@ -624,7 +624,18 @@ export const paymentRecordSchema = z.object({
|
|
|
624
624
|
environment: pgEnvironmentSchema.nullable().describe("결제 환경"),
|
|
625
625
|
testPayment: z.boolean().describe("샌드박스 결제인가"),
|
|
626
626
|
pgTransactionId: z.string().nullable().describe("PG 거래 id (토스 paymentKey, 포트원 txId)"),
|
|
627
|
-
attemptId: z
|
|
627
|
+
attemptId: z
|
|
628
|
+
.string()
|
|
629
|
+
.nullable()
|
|
630
|
+
.describe("대표 시도 id. 번호 체계(이슈 #107) 이전 시도는 이 값을 PG 주문번호로 보냈습니다"),
|
|
631
|
+
pgOrderId: z
|
|
632
|
+
.string()
|
|
633
|
+
.nullable()
|
|
634
|
+
.optional()
|
|
635
|
+
.default(null)
|
|
636
|
+
.describe(
|
|
637
|
+
"PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다",
|
|
638
|
+
),
|
|
628
639
|
attemptCount: z.number().int().describe("시도 횟수"),
|
|
629
640
|
failCode: z.string().nullable().describe("실패 코드. 실패로 끝난 결제만"),
|
|
630
641
|
failMessage: z.string().nullable().describe("실패 사유"),
|
|
@@ -646,6 +657,14 @@ export type PaymentRecordPage = z.infer<typeof paymentRecordPageSchema>;
|
|
|
646
657
|
|
|
647
658
|
export const paymentAttemptRecordSchema = z.object({
|
|
648
659
|
attemptId: z.string(),
|
|
660
|
+
pgOrderId: z
|
|
661
|
+
.string()
|
|
662
|
+
.nullable()
|
|
663
|
+
.optional()
|
|
664
|
+
.default(null)
|
|
665
|
+
.describe(
|
|
666
|
+
"PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다",
|
|
667
|
+
),
|
|
649
668
|
sequence: z.number().int().describe("결제 건 안에서의 순번 (1부터)"),
|
|
650
669
|
provider: pgProviderSchema,
|
|
651
670
|
status: paymentAttemptStatusSchema,
|
|
@@ -721,7 +740,7 @@ export const paymentListQuerySchema = z.object({
|
|
|
721
740
|
keyword: z
|
|
722
741
|
.string()
|
|
723
742
|
.optional()
|
|
724
|
-
.describe("결제 id
|
|
743
|
+
.describe("결제 id·주문 id·PG 거래 id·시도 id·PG 주문번호(일치), 구매자명(포함)"),
|
|
725
744
|
includeTest: z
|
|
726
745
|
.string()
|
|
727
746
|
.optional()
|
package/src/schemas/product.ts
CHANGED
|
@@ -16,6 +16,15 @@ export type ProductStatus = z.infer<typeof productStatusSchema>;
|
|
|
16
16
|
|
|
17
17
|
export const productSummarySchema = z.object({
|
|
18
18
|
productId: z.string(),
|
|
19
|
+
productNo: z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.nullable()
|
|
23
|
+
.optional()
|
|
24
|
+
.default(null)
|
|
25
|
+
.describe(
|
|
26
|
+
"상품번호(이슈 #107) — 상점별 1부터 증가하는 숫자, 상점 안에서 유일, 생성 후 바뀌지 않으며 지운 상품의 번호는 다시 쓰지 않습니다. URL에 써도 됩니다(스토어프론트 상품 상세 경로가 받습니다). 번호 체계 이전 응답은 null",
|
|
27
|
+
),
|
|
19
28
|
name: z.string(),
|
|
20
29
|
status: productStatusSchema,
|
|
21
30
|
salePrice: z.number().int().describe("판매가. 원(KRW) 단위 정수"),
|
|
@@ -72,6 +81,14 @@ export type OptionGroup = z.infer<typeof optionGroupSchema>;
|
|
|
72
81
|
*/
|
|
73
82
|
export const productVariantSchema = z.object({
|
|
74
83
|
variantId: z.string(),
|
|
84
|
+
variantNo: z
|
|
85
|
+
.string()
|
|
86
|
+
.nullable()
|
|
87
|
+
.optional()
|
|
88
|
+
.default(null)
|
|
89
|
+
.describe(
|
|
90
|
+
"조합 번호(이슈 #107) — `{productNo}-{조합 순번 2자리}`(예: `10482-03`). 시스템이 매기는 SKU이고 상점 안에서 유일합니다(상품번호가 상점 범위라 다른 상점과는 겹칠 수 있습니다). 생성 후 바뀌지 않으며, 지운 조합의 번호는 다시 쓰지 않습니다. 셀러가 입력하는 `sku`와 별개입니다",
|
|
91
|
+
),
|
|
75
92
|
/** 축 sortOrder 순서와 1:1 대응. 옵션 없는 상품은 [] */
|
|
76
93
|
valueIds: z.array(z.string()),
|
|
77
94
|
/** 값 이름을 " / "로 이은 파생 표시명. 옵션 없으면 "" */
|
|
@@ -657,6 +674,8 @@ export interface ProductListParams extends PageParams {
|
|
|
657
674
|
categoryId?: string;
|
|
658
675
|
keyword?: string;
|
|
659
676
|
sellerCode?: string;
|
|
677
|
+
/** 상품번호(이슈 #107, 상점 범위) — 그 상품만 */
|
|
678
|
+
productNo?: number;
|
|
660
679
|
sort?: ProductSort;
|
|
661
680
|
}
|
|
662
681
|
|
|
@@ -669,6 +688,12 @@ export const productListQuerySchema = z.object({
|
|
|
669
688
|
.string()
|
|
670
689
|
.optional()
|
|
671
690
|
.describe("판매자 상품코드 — 이 코드가 붙은 variant를 가진 상품"),
|
|
691
|
+
productNo: z
|
|
692
|
+
.string()
|
|
693
|
+
.optional()
|
|
694
|
+
.describe(
|
|
695
|
+
"상품번호(이슈 #107) — 이 상점의 그 번호 상품만. 숫자가 아니면 400 `INVALID_PARAMETER`",
|
|
696
|
+
),
|
|
672
697
|
sort: productSortSchema.optional().describe("정렬 (기본 createdAt.desc)"),
|
|
673
698
|
...pageQueryShape(),
|
|
674
699
|
});
|