@sayren/store-sdk 0.29.4 → 0.29.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +127 -51
- package/dist/index.mjs +74 -16
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/claim.ts +4 -0
- package/src/schemas/commerce-number.ts +28 -0
- package/src/schemas/order.ts +29 -4
- package/src/schemas/payment.ts +21 -2
- package/src/schemas/product.ts +25 -0
- package/src/schemas/promotion.ts +27 -14
- package/src/schemas/webhook-event.ts +32 -0
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
|
});
|
|
@@ -2730,8 +2759,10 @@ function quotePricing(input) {
|
|
|
2730
2759
|
};
|
|
2731
2760
|
}
|
|
2732
2761
|
/**
|
|
2733
|
-
* 사용 적립금 금액(순수) — 요청·잔액·최대
|
|
2734
|
-
*
|
|
2762
|
+
* 사용 적립금 금액(순수) — 요청·잔액·최대 비율 중 작은 값을 쓴다(#93 P3·P4).
|
|
2763
|
+
* - 결제 금액 전체를 덮을 수 있으면 전액을 쓴다(0원 결제, 이때만 사용 단위를 보지 않는다)
|
|
2764
|
+
* - 그 밖에는 사용 단위로 내리고, 남는 결제 금액이 1~99원이면 적립금을 줄여 100원을 남긴다(`MIN_PAYMENT`)
|
|
2765
|
+
* 최소 보유액·최소 사용액에 못 미치면 0이다.
|
|
2735
2766
|
*/
|
|
2736
2767
|
function pointUseOf(points, amounts) {
|
|
2737
2768
|
const none = {
|
|
@@ -2745,12 +2776,29 @@ function pointUseOf(points, amounts) {
|
|
|
2745
2776
|
const unit = Math.max(1, Math.floor(rules.unit));
|
|
2746
2777
|
const base = amounts.productPaid + (rules.includeDeliveryFee ? amounts.deliveryPaid : 0);
|
|
2747
2778
|
const byRatio = Math.floor(base * rules.maxRatioBp / 1e4);
|
|
2748
|
-
const byPayment = Math.max(0, amounts.total - 100);
|
|
2749
2779
|
const balance = Math.max(0, points.balance);
|
|
2780
|
+
const total = Math.max(0, amounts.total);
|
|
2750
2781
|
const floorUnit = (value) => Math.floor(Math.max(0, value) / unit) * unit;
|
|
2782
|
+
/** 상한 `cap`으로 쓸 수 있는 금액 — 전액이면 0원 결제, 아니면 단위 내림 + 100원 남기기 */
|
|
2783
|
+
const usableWithin = (cap) => {
|
|
2784
|
+
if (total > 0 && cap >= total) return {
|
|
2785
|
+
amount: total,
|
|
2786
|
+
adjusted: false
|
|
2787
|
+
};
|
|
2788
|
+
const amount = floorUnit(Math.min(cap, total));
|
|
2789
|
+
const remaining = total - amount;
|
|
2790
|
+
if (remaining > 0 && remaining < 100) return {
|
|
2791
|
+
amount: floorUnit(total - 100),
|
|
2792
|
+
adjusted: true
|
|
2793
|
+
};
|
|
2794
|
+
return {
|
|
2795
|
+
amount,
|
|
2796
|
+
adjusted: false
|
|
2797
|
+
};
|
|
2798
|
+
};
|
|
2751
2799
|
const eligible = balance >= rules.minBalance;
|
|
2752
|
-
const ceiling = Math.min(balance, byRatio
|
|
2753
|
-
const maxUsable = eligible &&
|
|
2800
|
+
const ceiling = usableWithin(Math.min(balance, byRatio)).amount;
|
|
2801
|
+
const maxUsable = eligible && ceiling > 0 && ceiling >= rules.minAmount ? ceiling : 0;
|
|
2754
2802
|
const requested = Math.max(0, Math.floor(points.requested));
|
|
2755
2803
|
if (requested === 0) return {
|
|
2756
2804
|
...none,
|
|
@@ -2762,23 +2810,23 @@ function pointUseOf(points, amounts) {
|
|
|
2762
2810
|
adjustReason: null,
|
|
2763
2811
|
rejectReason: "MIN_BALANCE"
|
|
2764
2812
|
};
|
|
2765
|
-
const
|
|
2766
|
-
if (amount <= 0) return {
|
|
2813
|
+
const used = usableWithin(Math.min(requested, balance, byRatio));
|
|
2814
|
+
if (used.amount <= 0) return {
|
|
2767
2815
|
amount: 0,
|
|
2768
2816
|
maxUsable,
|
|
2769
2817
|
adjustReason: null,
|
|
2770
2818
|
rejectReason: "NOT_PAYABLE"
|
|
2771
2819
|
};
|
|
2772
|
-
if (amount < rules.minAmount) return {
|
|
2820
|
+
if (used.amount < rules.minAmount) return {
|
|
2773
2821
|
amount: 0,
|
|
2774
2822
|
maxUsable,
|
|
2775
2823
|
adjustReason: null,
|
|
2776
2824
|
rejectReason: "MIN_AMOUNT"
|
|
2777
2825
|
};
|
|
2778
2826
|
return {
|
|
2779
|
-
amount,
|
|
2827
|
+
amount: used.amount,
|
|
2780
2828
|
maxUsable,
|
|
2781
|
-
adjustReason:
|
|
2829
|
+
adjustReason: used.adjusted ? "MIN_PAYMENT" : null,
|
|
2782
2830
|
rejectReason: null
|
|
2783
2831
|
};
|
|
2784
2832
|
}
|
|
@@ -3947,7 +3995,8 @@ const paymentRecordSchema = z.object({
|
|
|
3947
3995
|
environment: pgEnvironmentSchema.nullable().describe("결제 환경"),
|
|
3948
3996
|
testPayment: z.boolean().describe("샌드박스 결제인가"),
|
|
3949
3997
|
pgTransactionId: z.string().nullable().describe("PG 거래 id (토스 paymentKey, 포트원 txId)"),
|
|
3950
|
-
attemptId: z.string().nullable().describe("
|
|
3998
|
+
attemptId: z.string().nullable().describe("대표 시도 id. 번호 체계(이슈 #107) 이전 시도는 이 값을 PG 주문번호로 보냈습니다"),
|
|
3999
|
+
pgOrderId: z.string().nullable().optional().default(null).describe("PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다"),
|
|
3951
4000
|
attemptCount: z.number().int().describe("시도 횟수"),
|
|
3952
4001
|
failCode: z.string().nullable().describe("실패 코드. 실패로 끝난 결제만"),
|
|
3953
4002
|
failMessage: z.string().nullable().describe("실패 사유"),
|
|
@@ -3958,6 +4007,7 @@ const paymentRecordSchema = z.object({
|
|
|
3958
4007
|
const paymentRecordPageSchema = pageSchema(paymentRecordSchema);
|
|
3959
4008
|
const paymentAttemptRecordSchema = z.object({
|
|
3960
4009
|
attemptId: z.string(),
|
|
4010
|
+
pgOrderId: z.string().nullable().optional().default(null).describe("PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다"),
|
|
3961
4011
|
sequence: z.number().int().describe("결제 건 안에서의 순번 (1부터)"),
|
|
3962
4012
|
provider: pgProviderSchema,
|
|
3963
4013
|
status: paymentAttemptStatusSchema,
|
|
@@ -3998,7 +4048,7 @@ const paymentListQuerySchema = z.object({
|
|
|
3998
4048
|
status: z.string().optional().describe("결제 상태 필터 (PaymentRecordStatus)"),
|
|
3999
4049
|
provider: z.string().optional().describe("PG 필터"),
|
|
4000
4050
|
method: z.string().optional().describe("실제 결제수단 필터"),
|
|
4001
|
-
keyword: z.string().optional().describe("결제 id
|
|
4051
|
+
keyword: z.string().optional().describe("결제 id·주문 id·PG 거래 id·시도 id·PG 주문번호(일치), 구매자명(포함)"),
|
|
4002
4052
|
includeTest: z.string().optional().describe("테스트 결제 포함 여부 (`true`·`false`. 기본 false — 실결제만)"),
|
|
4003
4053
|
page: z.string().optional().describe("페이지 번호 (1부터)"),
|
|
4004
4054
|
size: z.string().optional().describe("페이지 크기 (기본 20, 최대 100)")
|
|
@@ -4007,6 +4057,7 @@ const paymentListQuerySchema = z.object({
|
|
|
4007
4057
|
//#region src/schemas/order.ts
|
|
4008
4058
|
const orderSummarySchema = z.object({
|
|
4009
4059
|
orderId: z.string(),
|
|
4060
|
+
orderNo: commerceNumberField("주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오"),
|
|
4010
4061
|
ordererName: z.string(),
|
|
4011
4062
|
itemCount: z.number().int(),
|
|
4012
4063
|
totalAmount: z.number().int(),
|
|
@@ -4032,6 +4083,7 @@ const orderItemFulfillmentSchema = z.object({
|
|
|
4032
4083
|
});
|
|
4033
4084
|
const orderItemSchema = z.object({
|
|
4034
4085
|
orderItemId: z.string(),
|
|
4086
|
+
orderItemNo: commerceNumberField("상품주문번호(이슈 #107) — 주문번호 + 줄 순번 2자리(01부터, 100줄부터 3자리). 부분 취소·클레임·송장의 처리 단위 번호이고 생성 후 바뀌지 않습니다"),
|
|
4035
4087
|
orderId: z.string(),
|
|
4036
4088
|
status: orderItemStatusSchema,
|
|
4037
4089
|
claimStatus: z.enum([
|
|
@@ -4077,6 +4129,7 @@ const orderDiscountSchema = z.object({
|
|
|
4077
4129
|
});
|
|
4078
4130
|
const orderSchema = z.object({
|
|
4079
4131
|
orderId: z.string(),
|
|
4132
|
+
orderNo: commerceNumberField("주문번호(이슈 #107) — 숫자 14자리(YYMMDD KST + 난수 8자리), 전역 유일, 생성 후 바뀌지 않습니다. 전화 CS·ARS용 번호이고 API 경로의 식별자는 여전히 `orderId`입니다. 화면 표기는 `formatOrderNo`(4자리 하이픈)를 쓰십시오"),
|
|
4080
4133
|
orderedAt: z.string(),
|
|
4081
4134
|
orderer: z.object({
|
|
4082
4135
|
name: z.string(),
|
|
@@ -4118,14 +4171,15 @@ const testPaymentQuery = z.enum(["true", "false"]).optional().describe("테스
|
|
|
4118
4171
|
const pageQuery = { page: z.string().optional().describe("페이지 번호 (1부터, 기본 1)") };
|
|
4119
4172
|
/**
|
|
4120
4173
|
* `GET /v1/orders` 쿼리 — OpenAPI 문서용 형태(값은 쿼리 문자열). 검증 규칙은 서버가 적용한다:
|
|
4121
|
-
* `orderedFrom` 누락 400 `MISSING_PARAMETER`,
|
|
4174
|
+
* `orderNo` 없이 `orderedFrom` 누락 400 `MISSING_PARAMETER`, 날짜·`orderNo` 형식 오류 400 `INVALID_PARAMETER`, 31일 초과 400 `RANGE_TOO_WIDE`,
|
|
4122
4175
|
* `testPayment`가 `true`·`false`가 아니면 400 `INVALID_PARAMETER`
|
|
4123
4176
|
*/
|
|
4124
4177
|
const orderListQuerySchema = z.object({
|
|
4125
|
-
orderedFrom: z.string().describe("조회 시작 시각 (ISO 8601 날짜 또는 일시, 포함). 필수"),
|
|
4178
|
+
orderedFrom: z.string().optional().describe("조회 시작 시각 (ISO 8601 날짜 또는 일시, 포함). `orderNo`가 없으면 필수"),
|
|
4126
4179
|
orderedTo: z.string().optional().describe("조회 끝 시각 (ISO 8601, 포함). 생략하면 orderedFrom부터 31일. 기간은 최대 31일"),
|
|
4127
4180
|
status: orderItemStatusSchema.optional().describe("주문상품 상태 필터 — 이 상태의 주문상품이 하나라도 있는 주문"),
|
|
4128
|
-
keyword: z.string().optional().describe("
|
|
4181
|
+
keyword: z.string().optional().describe("주문 id·주문번호(일치, 하이픈 허용)·주문자명·수령인명(포함) 검색"),
|
|
4182
|
+
orderNo: z.string().optional().describe("주문번호 조회(이슈 #107) — 숫자 14자리, 하이픈 허용(`2610-0284-7315-92`). 주면 기간 조건 없이 그 주문만 찾습니다. 형식이 아니면 400 `INVALID_PARAMETER`"),
|
|
4129
4183
|
fulfillmentType: z.string().optional().describe("상품 유형 필터(이슈 #48) — 이 유형(`SHIPPING`·`MANUAL`)의 주문상품이 하나라도 있는 주문"),
|
|
4130
4184
|
testPayment: testPaymentQuery,
|
|
4131
4185
|
...pageQuery,
|
|
@@ -7118,6 +7172,7 @@ const envelopeFields = {
|
|
|
7118
7172
|
};
|
|
7119
7173
|
const orderWebhookEventDataSchema = z.object({
|
|
7120
7174
|
orderId: z.string().describe("주문 ID"),
|
|
7175
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7121
7176
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
7122
7177
|
testPayment: z.boolean().optional().default(false).describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았다. 이 필드가 없는 이전 이벤트는 false로 읽는다"),
|
|
7123
7178
|
couponDiscountAmount: z.number().int().optional().default(0).describe("주문이 받은 상품·주문 쿠폰 할인 합계 (원). 즉시할인(`discountAmount`)과 별개다. 쿠폰이 없거나 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
@@ -7136,6 +7191,7 @@ const orderWebhookEventDataSchema = z.object({
|
|
|
7136
7191
|
*/
|
|
7137
7192
|
const orderFulfilledWebhookEventDataSchema = z.object({
|
|
7138
7193
|
orderId: z.string().describe("주문 ID"),
|
|
7194
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7139
7195
|
orderItemId: z.string().describe("제공한 주문상품 ID"),
|
|
7140
7196
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
7141
7197
|
fulfillmentSnapshot: orderItemFulfillmentSnapshotResponseSchema.describe("제공한 주문상품의 주문 시점 이행 스냅샷(주문상품 응답의 `fulfillmentSnapshot`과 같다, 이슈 #57)"),
|
|
@@ -7150,6 +7206,7 @@ const orderFulfilledWebhookEventDataSchema = z.object({
|
|
|
7150
7206
|
*/
|
|
7151
7207
|
const orderCanceledWebhookEventDataSchema = z.object({
|
|
7152
7208
|
orderId: z.string().describe("주문 ID"),
|
|
7209
|
+
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
7153
7210
|
orderItemId: z.string().describe("취소한 주문 상품 ID"),
|
|
7154
7211
|
status: orderItemStatusSchema.describe("취소 뒤 주문 대표 상태. 모든 주문 상품이 취소됐으면 `CANCELED`다"),
|
|
7155
7212
|
itemStatus: orderItemStatusSchema.describe("취소 뒤 주문 상품 상태. 전 수량이 취소됐으면 `CANCELED`, 일부만 취소했으면 원래 상태다"),
|
|
@@ -7166,6 +7223,7 @@ const orderCanceledWebhookEventDataSchema = z.object({
|
|
|
7166
7223
|
});
|
|
7167
7224
|
const claimWebhookEventDataSchema = z.object({
|
|
7168
7225
|
claimId: z.string().describe("클레임 ID"),
|
|
7226
|
+
claimNo: z.string().nullable().optional().default(null).describe("클레임번호(이슈 #107) — `C` + YYMMDD + 숫자 8자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 클레임은 null로 읽는다"),
|
|
7169
7227
|
orderId: z.string().describe("주문 ID"),
|
|
7170
7228
|
orderItemId: z.string().describe("클레임 대상 주문 상품 ID"),
|
|
7171
7229
|
claimType: claimTypeSchema.describe("클레임 유형"),
|
|
@@ -7430,4 +7488,4 @@ function createStoreSession(options) {
|
|
|
7430
7488
|
};
|
|
7431
7489
|
}
|
|
7432
7490
|
//#endregion
|
|
7433
|
-
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 };
|
|
7491
|
+
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/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
|
});
|
package/src/schemas/promotion.ts
CHANGED
|
@@ -316,7 +316,7 @@ export interface PricingResult {
|
|
|
316
316
|
pointAmount: number;
|
|
317
317
|
/** 지금 쓸 수 있는 최대 적립금 — 주문서 안내값(잔액을 모두 요청했을 때의 금액). 적립금 입력이 없으면 0 */
|
|
318
318
|
pointMaxUsable: number;
|
|
319
|
-
/** 요청보다 적게 썼다면 그 이유 — `MIN_PAYMENT`: 결제
|
|
319
|
+
/** 요청보다 적게 썼다면 그 이유 — `MIN_PAYMENT`: 남는 결제 금액이 1~99원이라 100원을 남기려고 줄였다(전액이면 0원 결제) */
|
|
320
320
|
pointAdjustReason: "MIN_PAYMENT" | null;
|
|
321
321
|
/** 요청했지만 쓰지 못했다면 그 이유 */
|
|
322
322
|
pointRejectReason: PointRejectReason | null;
|
|
@@ -662,8 +662,10 @@ export function quotePricing(input: PricingInput): PricingResult {
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
/**
|
|
665
|
-
* 사용 적립금 금액(순수) — 요청·잔액·최대
|
|
666
|
-
*
|
|
665
|
+
* 사용 적립금 금액(순수) — 요청·잔액·최대 비율 중 작은 값을 쓴다(#93 P3·P4).
|
|
666
|
+
* - 결제 금액 전체를 덮을 수 있으면 전액을 쓴다(0원 결제, 이때만 사용 단위를 보지 않는다)
|
|
667
|
+
* - 그 밖에는 사용 단위로 내리고, 남는 결제 금액이 1~99원이면 적립금을 줄여 100원을 남긴다(`MIN_PAYMENT`)
|
|
668
|
+
* 최소 보유액·최소 사용액에 못 미치면 0이다.
|
|
667
669
|
*/
|
|
668
670
|
export function pointUseOf(
|
|
669
671
|
points: PricingPoints | null,
|
|
@@ -680,27 +682,38 @@ export function pointUseOf(
|
|
|
680
682
|
const unit = Math.max(1, Math.floor(rules.unit));
|
|
681
683
|
const base = amounts.productPaid + (rules.includeDeliveryFee ? amounts.deliveryPaid : 0);
|
|
682
684
|
const byRatio = Math.floor((base * rules.maxRatioBp) / 10_000);
|
|
683
|
-
// 결제 금액은 0원 또는 100원 이상이어야 하고, 지금은 0원 결제를 받지 않으므로 100원을 남긴다
|
|
684
|
-
const byPayment = Math.max(0, amounts.total - MIN_PAYMENT_AMOUNT);
|
|
685
685
|
const balance = Math.max(0, points.balance);
|
|
686
|
+
const total = Math.max(0, amounts.total);
|
|
686
687
|
const floorUnit = (value: number) => Math.floor(Math.max(0, value) / unit) * unit;
|
|
688
|
+
/** 상한 `cap`으로 쓸 수 있는 금액 — 전액이면 0원 결제, 아니면 단위 내림 + 100원 남기기 */
|
|
689
|
+
const usableWithin = (cap: number): { amount: number; adjusted: boolean } => {
|
|
690
|
+
if (total > 0 && cap >= total) return { amount: total, adjusted: false };
|
|
691
|
+
const amount = floorUnit(Math.min(cap, total));
|
|
692
|
+
const remaining = total - amount;
|
|
693
|
+
if (remaining > 0 && remaining < MIN_PAYMENT_AMOUNT) {
|
|
694
|
+
return { amount: floorUnit(total - MIN_PAYMENT_AMOUNT), adjusted: true };
|
|
695
|
+
}
|
|
696
|
+
return { amount, adjusted: false };
|
|
697
|
+
};
|
|
687
698
|
const eligible = balance >= rules.minBalance;
|
|
688
|
-
const ceiling = Math.min(balance, byRatio
|
|
689
|
-
const maxUsable = eligible &&
|
|
699
|
+
const ceiling = usableWithin(Math.min(balance, byRatio)).amount;
|
|
700
|
+
const maxUsable = eligible && ceiling > 0 && ceiling >= rules.minAmount ? ceiling : 0;
|
|
690
701
|
const requested = Math.max(0, Math.floor(points.requested));
|
|
691
702
|
if (requested === 0) return { ...none, maxUsable };
|
|
692
703
|
if (!eligible) return { amount: 0, maxUsable, adjustReason: null, rejectReason: "MIN_BALANCE" };
|
|
693
|
-
const
|
|
694
|
-
if (amount <= 0) {
|
|
704
|
+
const used = usableWithin(Math.min(requested, balance, byRatio));
|
|
705
|
+
if (used.amount <= 0) {
|
|
695
706
|
return { amount: 0, maxUsable, adjustReason: null, rejectReason: "NOT_PAYABLE" };
|
|
696
707
|
}
|
|
697
|
-
if (amount < rules.minAmount) {
|
|
708
|
+
if (used.amount < rules.minAmount) {
|
|
698
709
|
return { amount: 0, maxUsable, adjustReason: null, rejectReason: "MIN_AMOUNT" };
|
|
699
710
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
711
|
+
return {
|
|
712
|
+
amount: used.amount,
|
|
713
|
+
maxUsable,
|
|
714
|
+
adjustReason: used.adjusted ? "MIN_PAYMENT" : null,
|
|
715
|
+
rejectReason: null,
|
|
716
|
+
};
|
|
704
717
|
}
|
|
705
718
|
|
|
706
719
|
// ─── 환불 정산: 조건 미달 차감 ─────────────────────────────
|