@sayren/store-sdk 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2961 -829
- package/dist/index.mjs +753 -74
- package/package.json +1 -1
- package/src/client.ts +111 -4
- package/src/index.ts +4 -0
- package/src/schemas/analytics.ts +16 -0
- package/src/schemas/app-manifest.ts +1 -0
- package/src/schemas/coupon.ts +13 -0
- package/src/schemas/currency-prices.ts +138 -0
- package/src/schemas/currency.ts +184 -0
- package/src/schemas/customer.ts +20 -1
- package/src/schemas/fulfillment.ts +19 -0
- package/src/schemas/inventory.ts +230 -0
- package/src/schemas/market.ts +76 -0
- package/src/schemas/misc.ts +2 -0
- package/src/schemas/order.ts +16 -1
- package/src/schemas/payment.ts +107 -14
- package/src/schemas/product.ts +32 -3
- package/src/schemas/promotion.ts +36 -17
- package/src/schemas/refund-policy.ts +55 -2
- package/src/schemas/scope-descriptions.ts +4 -0
- package/src/schemas/scope.ts +5 -0
- package/src/schemas/shipping-policy.ts +56 -7
- package/src/schemas/store.ts +12 -0
- package/src/schemas/webhook-event.ts +75 -0
package/dist/index.mjs
CHANGED
|
@@ -357,6 +357,227 @@ const myAccountSchema = z.object({
|
|
|
357
357
|
createdAt: z.string()
|
|
358
358
|
});
|
|
359
359
|
//#endregion
|
|
360
|
+
//#region src/schemas/currency.ts
|
|
361
|
+
const INT4_MAX = 2147483647;
|
|
362
|
+
/** Stripe 카드 외 결제 상한이 8자리(999,999.99)라 2자리 통화는 이 값이 int4보다 먼저 걸린다 */
|
|
363
|
+
const PG_8_DIGIT_MAX = 99999999;
|
|
364
|
+
/**
|
|
365
|
+
* 1차 판매 통화 16종(설계 Q6). 판매가 단위는 KRW 10원(현행 규칙), JPY 1엔, 2자리 통화 1센트, TWD 100(= 1달러, PayPal이 TWD를 정수로만 받는다).
|
|
366
|
+
* 최소 결제액은 KRW가 현행 100원이고, 그 밖은 Stripe 최소 청구액(https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts)을 따른다.
|
|
367
|
+
* Stripe 표에 없는 CNY·TWD·PHP는 USD 0.50 근처의 근사값이다(PG 하한은 어댑터 선언이 따로 더한다).
|
|
368
|
+
*/
|
|
369
|
+
const CURRENCIES = {
|
|
370
|
+
KRW: {
|
|
371
|
+
code: "KRW",
|
|
372
|
+
digits: 0,
|
|
373
|
+
saleUnit: 10,
|
|
374
|
+
minPayment: 100,
|
|
375
|
+
maxOrderAmount: INT4_MAX
|
|
376
|
+
},
|
|
377
|
+
USD: {
|
|
378
|
+
code: "USD",
|
|
379
|
+
digits: 2,
|
|
380
|
+
saleUnit: 1,
|
|
381
|
+
minPayment: 50,
|
|
382
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
383
|
+
},
|
|
384
|
+
EUR: {
|
|
385
|
+
code: "EUR",
|
|
386
|
+
digits: 2,
|
|
387
|
+
saleUnit: 1,
|
|
388
|
+
minPayment: 50,
|
|
389
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
390
|
+
},
|
|
391
|
+
JPY: {
|
|
392
|
+
code: "JPY",
|
|
393
|
+
digits: 0,
|
|
394
|
+
saleUnit: 1,
|
|
395
|
+
minPayment: 50,
|
|
396
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
397
|
+
},
|
|
398
|
+
GBP: {
|
|
399
|
+
code: "GBP",
|
|
400
|
+
digits: 2,
|
|
401
|
+
saleUnit: 1,
|
|
402
|
+
minPayment: 30,
|
|
403
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
404
|
+
},
|
|
405
|
+
CNY: {
|
|
406
|
+
code: "CNY",
|
|
407
|
+
digits: 2,
|
|
408
|
+
saleUnit: 1,
|
|
409
|
+
minPayment: 400,
|
|
410
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
411
|
+
},
|
|
412
|
+
HKD: {
|
|
413
|
+
code: "HKD",
|
|
414
|
+
digits: 2,
|
|
415
|
+
saleUnit: 1,
|
|
416
|
+
minPayment: 400,
|
|
417
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
418
|
+
},
|
|
419
|
+
TWD: {
|
|
420
|
+
code: "TWD",
|
|
421
|
+
digits: 2,
|
|
422
|
+
saleUnit: 100,
|
|
423
|
+
minPayment: 2e3,
|
|
424
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
425
|
+
},
|
|
426
|
+
SGD: {
|
|
427
|
+
code: "SGD",
|
|
428
|
+
digits: 2,
|
|
429
|
+
saleUnit: 1,
|
|
430
|
+
minPayment: 50,
|
|
431
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
432
|
+
},
|
|
433
|
+
AUD: {
|
|
434
|
+
code: "AUD",
|
|
435
|
+
digits: 2,
|
|
436
|
+
saleUnit: 1,
|
|
437
|
+
minPayment: 50,
|
|
438
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
439
|
+
},
|
|
440
|
+
CAD: {
|
|
441
|
+
code: "CAD",
|
|
442
|
+
digits: 2,
|
|
443
|
+
saleUnit: 1,
|
|
444
|
+
minPayment: 50,
|
|
445
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
446
|
+
},
|
|
447
|
+
THB: {
|
|
448
|
+
code: "THB",
|
|
449
|
+
digits: 2,
|
|
450
|
+
saleUnit: 1,
|
|
451
|
+
minPayment: 1e3,
|
|
452
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
453
|
+
},
|
|
454
|
+
MYR: {
|
|
455
|
+
code: "MYR",
|
|
456
|
+
digits: 2,
|
|
457
|
+
saleUnit: 1,
|
|
458
|
+
minPayment: 200,
|
|
459
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
460
|
+
},
|
|
461
|
+
PHP: {
|
|
462
|
+
code: "PHP",
|
|
463
|
+
digits: 2,
|
|
464
|
+
saleUnit: 1,
|
|
465
|
+
minPayment: 3e3,
|
|
466
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
467
|
+
},
|
|
468
|
+
NZD: {
|
|
469
|
+
code: "NZD",
|
|
470
|
+
digits: 2,
|
|
471
|
+
saleUnit: 1,
|
|
472
|
+
minPayment: 50,
|
|
473
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
474
|
+
},
|
|
475
|
+
CHF: {
|
|
476
|
+
code: "CHF",
|
|
477
|
+
digits: 2,
|
|
478
|
+
saleUnit: 1,
|
|
479
|
+
minPayment: 50,
|
|
480
|
+
maxOrderAmount: PG_8_DIGIT_MAX
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
const CURRENCY_CODES = Object.keys(CURRENCIES);
|
|
484
|
+
/** 기본 통화 — 1차는 KRW 고정(설계 Q9). 기본 권역의 통화이고 지금의 금액 컬럼이 이 통화 값이다 */
|
|
485
|
+
const BASE_CURRENCY = "KRW";
|
|
486
|
+
const currencyCodeSchema = z.enum(CURRENCY_CODES).describe("통화(ISO 4217). 금액 필드는 이 통화의 최소 단위 정수다");
|
|
487
|
+
function isCurrencyCode(value) {
|
|
488
|
+
return Object.hasOwn(CURRENCIES, value);
|
|
489
|
+
}
|
|
490
|
+
/** 통화표 항목. 모르는 통화면 RangeError — 판매 통화가 아닌 값이 계산까지 오면 원천의 검증 누락이다 */
|
|
491
|
+
function currencySpecOf(code) {
|
|
492
|
+
if (!isCurrencyCode(code)) throw new RangeError(`unsupported currency: ${code}`);
|
|
493
|
+
return CURRENCIES[code];
|
|
494
|
+
}
|
|
495
|
+
function scaleOf(spec) {
|
|
496
|
+
return 10 ** spec.digits;
|
|
497
|
+
}
|
|
498
|
+
/** 주 단위 → 최소 단위(반올림). 입력·화면 값 변환용이고 PG 응답 해석은 `fromDecimalString`이다 */
|
|
499
|
+
function toMinor(major, currency) {
|
|
500
|
+
return Math.round(major * scaleOf(currencySpecOf(currency)));
|
|
501
|
+
}
|
|
502
|
+
/** 최소 단위 → 주 단위(표시용 숫자) */
|
|
503
|
+
function minorToMajor(minor, currency) {
|
|
504
|
+
return minor / scaleOf(currencySpecOf(currency));
|
|
505
|
+
}
|
|
506
|
+
/** 최소 단위 → PG 요청 형식 십진 문자열(`1099` USD → `"10.99"`, `1000` KRW → `"1000"`). 정수 연산만 쓴다 */
|
|
507
|
+
function toDecimalString(minor, currency) {
|
|
508
|
+
if (!Number.isSafeInteger(minor)) throw new RangeError(`amount must be an integer: ${minor}`);
|
|
509
|
+
const { digits } = currencySpecOf(currency);
|
|
510
|
+
const sign = minor < 0 ? "-" : "";
|
|
511
|
+
const abs = String(Math.abs(minor));
|
|
512
|
+
if (digits === 0) return `${sign}${abs}`;
|
|
513
|
+
const padded = abs.padStart(digits + 1, "0");
|
|
514
|
+
return `${sign}${padded.slice(0, -digits)}.${padded.slice(-digits)}`;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* PG 응답의 십진 문자열 → 최소 단위 정수. 통화 자릿수보다 긴 소수는 끝이 0일 때만 받는다(`"10.990"` → 1099, `"10.999"`는 RangeError).
|
|
518
|
+
* 형식이 틀리면 RangeError다 — 금액을 추정하지 않는다.
|
|
519
|
+
*/
|
|
520
|
+
function fromDecimalString(value, currency) {
|
|
521
|
+
const { digits } = currencySpecOf(currency);
|
|
522
|
+
const match = /^(-?)(\d+)(?:\.(\d+))?$/.exec(value.trim());
|
|
523
|
+
if (!match) throw new RangeError(`invalid decimal amount: ${value}`);
|
|
524
|
+
const [, sign, whole, fraction = ""] = match;
|
|
525
|
+
const extra = fraction.slice(digits);
|
|
526
|
+
if (/[^0]/.test(extra)) throw new RangeError(`too many fraction digits for ${currency}: ${value}`);
|
|
527
|
+
const minor = Number(`${whole}${fraction.slice(0, digits).padEnd(digits, "0")}`);
|
|
528
|
+
if (!Number.isSafeInteger(minor)) throw new RangeError(`amount out of range: ${value}`);
|
|
529
|
+
return sign === "-" && minor !== 0 ? -minor : minor;
|
|
530
|
+
}
|
|
531
|
+
/** 판매가 단위로 내림 — 할인·정률 쿠폰 계산의 단위 맞춤(KRW 10원 내림은 현행 규칙 그대로) */
|
|
532
|
+
function floorToSaleUnit(amount, currency) {
|
|
533
|
+
const { saleUnit } = currencySpecOf(currency);
|
|
534
|
+
return Math.floor(amount / saleUnit) * saleUnit;
|
|
535
|
+
}
|
|
536
|
+
/** 판매가 규칙(판매가 단위의 배수, 최소 판매가 단위)을 지키는가 */
|
|
537
|
+
function isSaleUnitPrice(amount, currency) {
|
|
538
|
+
const { saleUnit } = currencySpecOf(currency);
|
|
539
|
+
return Number.isInteger(amount) && amount >= saleUnit && amount % saleUnit === 0;
|
|
540
|
+
}
|
|
541
|
+
/** 판매가 규칙 위반 — api가 400 `INVALID_PRICE_UNIT`으로 바꾼다 */
|
|
542
|
+
var InvalidPriceUnitError = class extends Error {
|
|
543
|
+
amount;
|
|
544
|
+
currency;
|
|
545
|
+
saleUnit;
|
|
546
|
+
code = "INVALID_PRICE_UNIT";
|
|
547
|
+
constructor(amount, currency, saleUnit) {
|
|
548
|
+
super(`sale price ${amount} ${currency} must be a multiple of ${saleUnit} and at least ${saleUnit}`);
|
|
549
|
+
this.amount = amount;
|
|
550
|
+
this.currency = currency;
|
|
551
|
+
this.saleUnit = saleUnit;
|
|
552
|
+
this.name = "InvalidPriceUnitError";
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
/** 판매가 단위 검증의 원천 — zod `superRefine`과 api 상품 쓰기가 같이 부른다 */
|
|
556
|
+
function assertSaleUnit(amount, currency) {
|
|
557
|
+
if (!isSaleUnitPrice(amount, currency)) throw new InvalidPriceUnitError(amount, currency, currencySpecOf(currency).saleUnit);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* 최소 결제액 = max(통화표 값, 후보들). 후보는 PG 어댑터 선언의 하한(`descriptor.minAmount(currency)`, #131)이고 null은 「하한 없음」이다.
|
|
561
|
+
* 서버의 최소 결제 검사는 이 값 하나를 쓴다.
|
|
562
|
+
*/
|
|
563
|
+
function minPaymentOf(currency, candidates = []) {
|
|
564
|
+
let floor = currencySpecOf(currency).minPayment;
|
|
565
|
+
for (const candidate of candidates) if (candidate !== null && candidate !== void 0 && candidate > floor) floor = candidate;
|
|
566
|
+
return floor;
|
|
567
|
+
}
|
|
568
|
+
/** 통화의 규칙 값. `minPayment`를 주면(서버가 `minPaymentOf`로 구한 값) 통화표 값 대신 쓴다 */
|
|
569
|
+
function moneyRulesOf(currency, options = {}) {
|
|
570
|
+
const spec = currencySpecOf(currency);
|
|
571
|
+
return {
|
|
572
|
+
currency: spec.code,
|
|
573
|
+
saleUnit: spec.saleUnit,
|
|
574
|
+
minPayment: options.minPayment ?? spec.minPayment,
|
|
575
|
+
maxOrderAmount: spec.maxOrderAmount
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
/** 기본 통화(KRW) 규칙 — 규칙 값을 넘기지 않는 옛 호출부의 기본값 */
|
|
579
|
+
const KRW_MONEY_RULES = moneyRulesOf("KRW");
|
|
580
|
+
//#endregion
|
|
360
581
|
//#region src/schemas/refund-policy.ts
|
|
361
582
|
/**
|
|
362
583
|
* 환불 정책 (이슈 #25) — 취소·반품·교환에서 **배송비를 누가 부담하는지**를 정한다.
|
|
@@ -374,8 +595,15 @@ const descriptions$3 = {
|
|
|
374
595
|
exchangeDeliveryFee: "단순 변심(구매자 귀책) 교환의 교환 배송비. 원 단위. 구매자에게 청구할 금액을 안내값으로 싣는다. 기본 0(무료). 배송 상품에만 있다",
|
|
375
596
|
sellerFaultFreeShipping: "판매자 귀책(셀러 직권취소, 불량·오배송 반품)이면 배송비를 셀러가 부담한다 — 배송비를 환불하고 반품비를 받지 않는다. false면 구매자 귀책과 같은 규칙을 쓴다. 기본 true",
|
|
376
597
|
conditionalFreeShortfallCharge: "조건부 무료배송(`CONDITIONAL_FREE`) 상품에서 일부 취소로 남은 금액이 무료 기준액에 미달하면 그 배송비를 환불액에서 뺀다. false면 추가 청구 없이 셀러가 부담한다. 기본 false",
|
|
377
|
-
couponShortfallCharge: "쿠폰 조건 미달 차감. 일부 취소·반품으로 남은 주문상품이 쿠폰 조건(최소 주문 금액 등)을 잃으면 남은 주문상품이 받던 쿠폰 할인을 환불액에서 뺀다. 판매자 귀책(셀러 직권취소, 불량·오배송 반품)은 빼지 않는다. false면 차감 없이 실결제 금액만 나눠 환불한다. 기본 true"
|
|
598
|
+
couponShortfallCharge: "쿠폰 조건 미달 차감. 일부 취소·반품으로 남은 주문상품이 쿠폰 조건(최소 주문 금액 등)을 잃으면 남은 주문상품이 받던 쿠폰 할인을 환불액에서 뺀다. 판매자 귀책(셀러 직권취소, 불량·오배송 반품)은 빼지 않는다. false면 차감 없이 실결제 금액만 나눠 환불한다. 기본 true",
|
|
599
|
+
currencies: "외화별 반품 배송비·교환 배송비(이슈 #130). 키는 판매 통화 코드이고 기본 통화(KRW)는 넣지 않는다. 금액은 그 통화의 최소 단위다. 상품이 정한 통화 값이 상점 값보다 앞선다. 정하지 않은 외화로는 배송 상품을 팔지 않는다. 주면 맵 전체를 바꾼다"
|
|
378
600
|
};
|
|
601
|
+
/** 외화 한 통화의 반품·교환 배송비 */
|
|
602
|
+
const currencyRefundFeesSchema = z.strictObject({
|
|
603
|
+
returnDeliveryFee: z.number().int().min(0).describe("이 통화의 반품 배송비. 통화의 최소 단위"),
|
|
604
|
+
exchangeDeliveryFee: z.number().int().min(0).describe("이 통화의 교환 배송비. 통화의 최소 단위")
|
|
605
|
+
});
|
|
606
|
+
const currencyRefundMapSchema = z.partialRecord(currencyCodeSchema, currencyRefundFeesSchema).refine((map) => !("KRW" in map), { message: "기본 통화는 currencies에 넣지 않습니다" }).describe(descriptions$3.currencies);
|
|
379
607
|
/** 유효 환불 정책 — 상점 기본 + 상품별 덮어쓰기를 합친 결과 */
|
|
380
608
|
const refundPolicySchema = z.object({
|
|
381
609
|
preShipmentDeliveryFeeRefund: z.boolean().describe(descriptions$3.preShipmentDeliveryFeeRefund),
|
|
@@ -383,7 +611,8 @@ const refundPolicySchema = z.object({
|
|
|
383
611
|
exchangeDeliveryFee: z.number().int().min(0).describe(descriptions$3.exchangeDeliveryFee),
|
|
384
612
|
sellerFaultFreeShipping: z.boolean().describe(descriptions$3.sellerFaultFreeShipping),
|
|
385
613
|
conditionalFreeShortfallCharge: z.boolean().describe(descriptions$3.conditionalFreeShortfallCharge),
|
|
386
|
-
couponShortfallCharge: z.boolean().optional().default(true).describe(`${descriptions$3.couponShortfallCharge}. 이 필드가 없는 이전 서버 응답은 true로 읽는다`)
|
|
614
|
+
couponShortfallCharge: z.boolean().optional().default(true).describe(`${descriptions$3.couponShortfallCharge}. 이 필드가 없는 이전 서버 응답은 true로 읽는다`),
|
|
615
|
+
currencies: currencyRefundMapSchema.optional()
|
|
387
616
|
});
|
|
388
617
|
/**
|
|
389
618
|
* 상점이 정하지 않았을 때 서버가 쓰는 값.
|
|
@@ -411,24 +640,39 @@ const refundPolicyPatchSchema = z.strictObject({
|
|
|
411
640
|
exchangeDeliveryFee: z.number().int().min(0).optional().describe(descriptions$3.exchangeDeliveryFee),
|
|
412
641
|
sellerFaultFreeShipping: z.boolean().optional().describe(descriptions$3.sellerFaultFreeShipping),
|
|
413
642
|
conditionalFreeShortfallCharge: z.boolean().optional().describe(descriptions$3.conditionalFreeShortfallCharge),
|
|
414
|
-
couponShortfallCharge: z.boolean().optional().describe(descriptions$3.couponShortfallCharge)
|
|
643
|
+
couponShortfallCharge: z.boolean().optional().describe(descriptions$3.couponShortfallCharge),
|
|
644
|
+
currencies: currencyRefundMapSchema.optional()
|
|
415
645
|
});
|
|
416
646
|
/**
|
|
417
647
|
* 상품별 덮어쓰기 — 쿠폰 조건 미달 차감(`couponShortfallCharge`)은 주문 단위 규칙이라 상품이 정하지 않는다.
|
|
418
648
|
* 상점 정책만 읽는다(이슈 #47).
|
|
419
649
|
*/
|
|
420
650
|
const productRefundPolicyPatchSchema = refundPolicyPatchSchema.omit({ couponShortfallCharge: true });
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
*
|
|
424
|
-
* 반품·교환 배송비의 원천은 정책 하나다(이슈 #57 결정 3). 상품의 레거시 반품비·교환비 필드와의 연결은 없앴고,
|
|
425
|
-
* 레거시 값은 마이그레이션이 상품별 정책으로 옮겼다.
|
|
426
|
-
*/
|
|
427
|
-
function resolveRefundPolicy(storePolicy, product) {
|
|
428
|
-
return {
|
|
651
|
+
function resolveRefundPolicy(storePolicy, product, currency = "KRW") {
|
|
652
|
+
const store = {
|
|
429
653
|
...REFUND_POLICY_DEFAULTS,
|
|
430
|
-
...dropUndefined(storePolicy)
|
|
431
|
-
|
|
654
|
+
...dropUndefined(storePolicy)
|
|
655
|
+
};
|
|
656
|
+
const override = productRefundPolicyOverride(product) ?? {};
|
|
657
|
+
const merged = {
|
|
658
|
+
...store,
|
|
659
|
+
...override
|
|
660
|
+
};
|
|
661
|
+
if (currency === "KRW") {
|
|
662
|
+
if (store.currencies || override.currencies) merged.currencies = {
|
|
663
|
+
...store.currencies,
|
|
664
|
+
...override.currencies
|
|
665
|
+
};
|
|
666
|
+
return merged;
|
|
667
|
+
}
|
|
668
|
+
const code = currency;
|
|
669
|
+
const fees = override.currencies?.[code] ?? store.currencies?.[code];
|
|
670
|
+
if (!fees) return null;
|
|
671
|
+
const { currencies: _byCurrency, ...rest } = merged;
|
|
672
|
+
return {
|
|
673
|
+
...rest,
|
|
674
|
+
returnDeliveryFee: fees.returnDeliveryFee,
|
|
675
|
+
exchangeDeliveryFee: fees.exchangeDeliveryFee
|
|
432
676
|
};
|
|
433
677
|
}
|
|
434
678
|
/**
|
|
@@ -470,6 +714,75 @@ function proratedRefundBase(totalPrice, quantity, settledQuantity, cancelQuantit
|
|
|
470
714
|
return Math.max(0, after - before);
|
|
471
715
|
}
|
|
472
716
|
//#endregion
|
|
717
|
+
//#region src/schemas/currency-prices.ts
|
|
718
|
+
/**
|
|
719
|
+
* 통화별 가격 입력·응답 (이슈 #130 설계 D3·D6·§8.1) — **외화만 담는다.** 기본 통화(KRW) 값은 지금의 평면 필드(`salePrice`·`deliveryFee` 등)다.
|
|
720
|
+
* 금액은 그 통화의 최소 단위 정수다. 목록에 없는 외화로는 그 상품을 팔지 않는다. 쓰기(PUT·POST)는 목록 전체 교체이고 생략하면 유지한다.
|
|
721
|
+
* 통화는 상점의 판매 통화여야 한다(400 `CURRENCY_NOT_SOLD`).
|
|
722
|
+
*/
|
|
723
|
+
/** 외화만·통화마다 한 번 — 기본 통화 원소와 같은 통화 두 번은 400이다 */
|
|
724
|
+
function foreignOnce(items, ctx) {
|
|
725
|
+
const seen = /* @__PURE__ */ new Set();
|
|
726
|
+
items.forEach((item, index) => {
|
|
727
|
+
if (item.currency === "KRW") ctx.addIssue({
|
|
728
|
+
code: "custom",
|
|
729
|
+
path: [index, "currency"],
|
|
730
|
+
message: "기본 통화는 prices에 넣지 않습니다"
|
|
731
|
+
});
|
|
732
|
+
if (seen.has(item.currency)) ctx.addIssue({
|
|
733
|
+
code: "custom",
|
|
734
|
+
path: [index, "currency"],
|
|
735
|
+
message: "통화가 겹칩니다"
|
|
736
|
+
});
|
|
737
|
+
seen.add(item.currency);
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
/** 상품 판매가의 외화 값 */
|
|
741
|
+
const productCurrencyPriceSchema = z.strictObject({
|
|
742
|
+
currency: currencyCodeSchema,
|
|
743
|
+
salePrice: z.number().int().describe("이 통화의 판매가. 통화의 최소 단위이고 판매가 단위(KRW 10, JPY 1, USD 1센트, TWD 100)의 배수다"),
|
|
744
|
+
originalPrice: z.number().int().min(0).nullable().optional().describe("이 통화의 정가(표시용). 생략은 null"),
|
|
745
|
+
discountAmount: z.number().int().min(0).nullable().optional().describe("정액 즉시할인의 이 통화 값. 정률 할인은 모든 통화에 그대로 적용된다. null이면 이 통화에는 정액 할인이 없다")
|
|
746
|
+
}).superRefine((value, ctx) => {
|
|
747
|
+
if (!isSaleUnitPrice(value.salePrice, value.currency)) ctx.addIssue({
|
|
748
|
+
code: "custom",
|
|
749
|
+
path: ["salePrice"],
|
|
750
|
+
message: "판매가가 이 통화의 판매가 단위가 아닙니다 (INVALID_PRICE_UNIT)"
|
|
751
|
+
});
|
|
752
|
+
});
|
|
753
|
+
const productCurrencyPricesSchema = z.array(productCurrencyPriceSchema).max(15).superRefine(foreignOnce).describe("외화 판매가(이슈 #130). 기본 통화는 넣지 않는다. 주면 판매 중인 외화 안에서 목록 전체를 바꾸고(판매하지 않는 통화의 저장 값은 유지한다) 생략하면 유지한다. 목록에 없는 외화로는 팔지 않는다");
|
|
754
|
+
/** 상품 배송의 외화 값 — 배송비 유형·출고지는 상품 하나다 */
|
|
755
|
+
const shippingCurrencyPriceSchema = z.strictObject({
|
|
756
|
+
currency: currencyCodeSchema,
|
|
757
|
+
deliveryFee: z.number().int().min(0).optional().describe("이 통화의 배송비. 생략하면 그 통화의 상점 기본 배송비이고, 상점 값도 없으면 이 통화로 배송 상품을 팔지 않는다. FREE면 0"),
|
|
758
|
+
conditionalFreeAmount: z.number().int().min(1).nullable().optional().describe("이 통화의 조건부 무료 기준 묶음 소계. CONDITIONAL_FREE가 아니면 무시한다")
|
|
759
|
+
});
|
|
760
|
+
const shippingCurrencyPricesSchema = z.array(shippingCurrencyPriceSchema).max(15).superRefine(foreignOnce).describe("외화 배송비(이슈 #130). 기본 통화는 넣지 않는다. 주면 판매 중인 외화 안에서 목록 전체를 바꾸고(판매하지 않는 통화의 저장 값은 유지한다) 생략하면 유지한다");
|
|
761
|
+
/** 저장된 외화 배송 값(응답) */
|
|
762
|
+
const storedShippingCurrencyPriceSchema = z.object({
|
|
763
|
+
currency: z.string(),
|
|
764
|
+
deliveryFee: z.number().int(),
|
|
765
|
+
conditionalFreeAmount: z.number().int().nullable()
|
|
766
|
+
});
|
|
767
|
+
/** 저장된 외화 판매가(응답) */
|
|
768
|
+
const storedProductCurrencyPriceSchema = z.object({
|
|
769
|
+
currency: z.string(),
|
|
770
|
+
salePrice: z.number().int(),
|
|
771
|
+
originalPrice: z.number().int().nullable(),
|
|
772
|
+
discountAmount: z.number().int().nullable()
|
|
773
|
+
});
|
|
774
|
+
/** 조합·추가 선택 값 추가금의 외화 값 — 추가금은 판매가 단위 규칙이 없다(설계 D4) */
|
|
775
|
+
const additionalCurrencyPriceSchema = z.strictObject({
|
|
776
|
+
currency: currencyCodeSchema,
|
|
777
|
+
additionalPrice: z.number().int().min(0).describe("이 통화의 추가금. 통화의 최소 단위(0 이상)")
|
|
778
|
+
});
|
|
779
|
+
const additionalCurrencyPricesSchema = z.array(additionalCurrencyPriceSchema).max(15).superRefine(foreignOnce).describe("외화 추가금(이슈 #130). 기본 통화는 넣지 않는다. 주면 판매 중인 외화 안에서 목록 전체를 바꾸고(판매하지 않는 통화의 저장 값은 유지한다) 생략하면 유지한다. 기본 통화 추가금이 0이 아닌데 목록에 없는 외화로는 이 조합·값을 팔지 않는다");
|
|
780
|
+
/** 저장된 외화 추가금(응답) */
|
|
781
|
+
const storedAdditionalCurrencyPriceSchema = z.object({
|
|
782
|
+
currency: z.string(),
|
|
783
|
+
additionalPrice: z.number().int()
|
|
784
|
+
});
|
|
785
|
+
//#endregion
|
|
473
786
|
//#region src/schemas/fulfillment.ts
|
|
474
787
|
/**
|
|
475
788
|
* 상품 유형 (이슈 #48·#57) — 배송이 필요한 상품과 필요 없는 상품을 가르는 축이다.
|
|
@@ -643,7 +956,8 @@ const shippingCreateSchema = z.strictObject({
|
|
|
643
956
|
deliveryFee: z.number().int().min(0).optional().describe("배송비. 원 단위. 생략하면 상점 기본 배송비(`GET /v1/store`의 `shippingPolicy.baseDeliveryFee`)를 저장한다. FREE면 0이거나 생략한다"),
|
|
644
957
|
conditionalFreeAmount: z.number().int().min(0).nullable().optional().describe("무료 배송이 되는 묶음 소계. 원 단위. CONDITIONAL_FREE에서만 받고 필수다"),
|
|
645
958
|
shippingAddressId: z.string().nullable().optional().describe(ADDRESS_ID_DESCRIPTIONS.shipping),
|
|
646
|
-
returnAddressId: z.string().nullable().optional().describe(ADDRESS_ID_DESCRIPTIONS.return)
|
|
959
|
+
returnAddressId: z.string().nullable().optional().describe(ADDRESS_ID_DESCRIPTIONS.return),
|
|
960
|
+
prices: shippingCurrencyPricesSchema.optional()
|
|
647
961
|
}).superRefine(refineShippingConsistency);
|
|
648
962
|
/**
|
|
649
963
|
* 상품 이행 — 등록(POST). 배송 상품의 `shipping`을 생략하면 기본값(유료 배송·상점 기본 배송비·기본 출고지·반품지)이다.
|
|
@@ -661,7 +975,8 @@ const shippingUpdateSchema = z.strictObject({
|
|
|
661
975
|
deliveryFee: z.number().int().min(0).describe("배송비. 원 단위. FREE면 0"),
|
|
662
976
|
conditionalFreeAmount: z.number().int().min(0).nullable().describe("무료 배송이 되는 묶음 소계. CONDITIONAL_FREE면 필수, 아니면 null"),
|
|
663
977
|
shippingAddressId: z.string().nullable().describe(ADDRESS_ID_DESCRIPTIONS.shipping),
|
|
664
|
-
returnAddressId: z.string().nullable().describe(ADDRESS_ID_DESCRIPTIONS.return)
|
|
978
|
+
returnAddressId: z.string().nullable().describe(ADDRESS_ID_DESCRIPTIONS.return),
|
|
979
|
+
prices: shippingCurrencyPricesSchema.optional()
|
|
665
980
|
}).superRefine(refineShippingConsistency);
|
|
666
981
|
/**
|
|
667
982
|
* 상품 이행 — 수정(PUT·PATCH). 통째 교체이고 유형 키와 그 안의 필드가 **모두 필수**다. 서버는 현재 값과 병합하지 않는다.
|
|
@@ -686,7 +1001,8 @@ const productFulfillmentSchema = z.discriminatedUnion("type", [z.object({
|
|
|
686
1001
|
deliveryFee: z.number().int().describe("배송비. 원 단위. FREE면 0"),
|
|
687
1002
|
conditionalFreeAmount: z.number().int().nullable().describe("조건부 무료 기준 묶음 소계. CONDITIONAL_FREE가 아니면 null"),
|
|
688
1003
|
shippingAddressId: z.string().nullable().describe("출고지 주소 id. null이면 상점 기본 출고지를 따른다"),
|
|
689
|
-
returnAddressId: z.string().nullable().describe("반품지 주소 id. null이면 상점 기본 반품지를 따른다")
|
|
1004
|
+
returnAddressId: z.string().nullable().describe("반품지 주소 id. null이면 상점 기본 반품지를 따른다"),
|
|
1005
|
+
prices: z.array(storedShippingCurrencyPriceSchema).optional().describe("외화 배송비(이슈 #130). 관리 API 상품 조회만 싣는다")
|
|
690
1006
|
}),
|
|
691
1007
|
methods: storedMethodsSchema
|
|
692
1008
|
}), z.object({
|
|
@@ -745,6 +1061,7 @@ const pickupLocationSchema = z.object({
|
|
|
745
1061
|
hours: z.string().nullable().describe("수령 가능 시간 안내. 없으면 null"),
|
|
746
1062
|
usable: z.boolean().describe("사용 여부. false면 구매자에게 보이지 않고 주문서에서 고를 수 없다"),
|
|
747
1063
|
sortOrder: z.number().int(),
|
|
1064
|
+
inventoryLocationId: z.string().nullable().optional().describe("이 장소의 재고 위치 ID — 방문 수령 주문을 이 위치 재고로 판다. 위치를 하나만 쓰는 상점은 기본 위치다"),
|
|
748
1065
|
createdAt: z.string()
|
|
749
1066
|
});
|
|
750
1067
|
const pickupLocationRequestSchema = z.strictObject({
|
|
@@ -752,7 +1069,8 @@ const pickupLocationRequestSchema = z.strictObject({
|
|
|
752
1069
|
address: z.string().trim().min(1).max(200),
|
|
753
1070
|
phone: z.string().trim().max(30).nullish(),
|
|
754
1071
|
hours: z.string().trim().max(100).nullish(),
|
|
755
|
-
usable: z.boolean().default(true)
|
|
1072
|
+
usable: z.boolean().default(true),
|
|
1073
|
+
inventoryLocationId: z.string().min(1).optional().describe("재고 위치 ID. 등록에서 생략하면 기본 위치, 수정에서 생략하면 지금 연결을 유지한다")
|
|
756
1074
|
});
|
|
757
1075
|
//#endregion
|
|
758
1076
|
//#region src/schemas/shipping-policy.ts
|
|
@@ -782,14 +1100,22 @@ const descriptions$2 = {
|
|
|
782
1100
|
baseDeliveryFee: "상점 기본 배송비. 원 단위. 상품 등록·수정에서 `deliveryFee`를 생략하면 이 값을 쓴다. 기본 3000",
|
|
783
1101
|
freeThreshold: "상점 전체 무료배송 기준액. 주문 상품 금액 합이 이 값 이상이면 모든 묶음의 배송비가 0이다. null이면 전체 무료배송을 쓰지 않는다(상품별 조건부 무료는 그대로 동작한다). 기본 null",
|
|
784
1102
|
jejuSurcharge: "제주 지역 추가 배송비. 원 단위. **배송 묶음마다** 더한다. 기본 0",
|
|
785
|
-
isolatedSurcharge: "도서산간 지역 추가 배송비. 원 단위. **배송 묶음마다** 더한다. 기본 0"
|
|
1103
|
+
isolatedSurcharge: "도서산간 지역 추가 배송비. 원 단위. **배송 묶음마다** 더한다. 기본 0",
|
|
1104
|
+
currencies: "외화별 기본 배송비·전체 무료배송 기준액(이슈 #130). 키는 판매 통화 코드이고 기본 통화(KRW)는 넣지 않는다. 금액은 그 통화의 최소 단위다. 정하지 않은 외화로는 배송 상품을 팔지 않는다. 지역 추가 배송비는 국내(기본 통화) 값만 있다. 주면 맵 전체를 바꾼다"
|
|
786
1105
|
};
|
|
1106
|
+
/** 외화 한 통화의 상점 배송 값 */
|
|
1107
|
+
const currencyShippingPolicySchema = z.strictObject({
|
|
1108
|
+
baseDeliveryFee: z.number().int().min(0).describe("이 통화의 기본 배송비. 통화의 최소 단위"),
|
|
1109
|
+
freeThreshold: z.number().int().min(1).nullable().describe("이 통화의 전체 무료배송 기준액. null이면 쓰지 않는다")
|
|
1110
|
+
});
|
|
1111
|
+
const currencyShippingMapSchema = z.partialRecord(currencyCodeSchema, currencyShippingPolicySchema).refine((map) => !("KRW" in map), { message: "기본 통화는 currencies에 넣지 않습니다" }).describe(descriptions$2.currencies);
|
|
787
1112
|
/** 유효 배송비 정책 — 상점이 정하지 않은 항목은 `SHIPPING_POLICY_DEFAULTS`로 채운 값이다 */
|
|
788
1113
|
const shippingPolicySchema = z.object({
|
|
789
1114
|
baseDeliveryFee: z.number().int().min(0).describe(descriptions$2.baseDeliveryFee),
|
|
790
1115
|
freeThreshold: z.number().int().min(1).nullable().describe(descriptions$2.freeThreshold),
|
|
791
1116
|
jejuSurcharge: z.number().int().min(0).describe(descriptions$2.jejuSurcharge),
|
|
792
|
-
isolatedSurcharge: z.number().int().min(0).describe(descriptions$2.isolatedSurcharge)
|
|
1117
|
+
isolatedSurcharge: z.number().int().min(0).describe(descriptions$2.isolatedSurcharge),
|
|
1118
|
+
currencies: currencyShippingMapSchema.optional()
|
|
793
1119
|
});
|
|
794
1120
|
/**
|
|
795
1121
|
* 상점이 정하지 않았을 때 서버가 쓰는 값.
|
|
@@ -813,16 +1139,24 @@ const shippingPolicyPatchSchema = z.strictObject({
|
|
|
813
1139
|
baseDeliveryFee: z.number().int().min(0).optional().describe(descriptions$2.baseDeliveryFee),
|
|
814
1140
|
freeThreshold: z.number().int().min(1).nullable().optional().describe(descriptions$2.freeThreshold),
|
|
815
1141
|
jejuSurcharge: z.number().int().min(0).optional().describe(descriptions$2.jejuSurcharge),
|
|
816
|
-
isolatedSurcharge: z.number().int().min(0).optional().describe(descriptions$2.isolatedSurcharge)
|
|
1142
|
+
isolatedSurcharge: z.number().int().min(0).optional().describe(descriptions$2.isolatedSurcharge),
|
|
1143
|
+
currencies: currencyShippingMapSchema.optional()
|
|
817
1144
|
});
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
const given = Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== void 0));
|
|
822
|
-
return {
|
|
1145
|
+
function resolveShippingPolicy(patch, currency = "KRW") {
|
|
1146
|
+
const given = patch ? Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== void 0)) : {};
|
|
1147
|
+
const base = {
|
|
823
1148
|
...SHIPPING_POLICY_DEFAULTS,
|
|
824
1149
|
...given
|
|
825
1150
|
};
|
|
1151
|
+
if (currency === "KRW") return base;
|
|
1152
|
+
const foreign = base.currencies?.[currency];
|
|
1153
|
+
if (!foreign) return null;
|
|
1154
|
+
return {
|
|
1155
|
+
baseDeliveryFee: foreign.baseDeliveryFee,
|
|
1156
|
+
freeThreshold: foreign.freeThreshold,
|
|
1157
|
+
jejuSurcharge: 0,
|
|
1158
|
+
isolatedSurcharge: 0
|
|
1159
|
+
};
|
|
826
1160
|
}
|
|
827
1161
|
/** 지역 구분 — 우편번호로 판정한다 */
|
|
828
1162
|
const remoteAreaSchema = z.enum([
|
|
@@ -1452,6 +1786,7 @@ const sellerAddressSchema = z.object({
|
|
|
1452
1786
|
zipCode: z.string(),
|
|
1453
1787
|
address1: z.string(),
|
|
1454
1788
|
address2: z.string().optional(),
|
|
1789
|
+
inventoryLocationId: z.string().nullable().optional().describe("이 주소의 재고 위치 ID — 출고지면 배송 주문을 이 위치 재고로 팔고, 반품지면 반품을 이 위치로 들인다. 위치를 하나만 쓰는 상점은 기본 위치다"),
|
|
1455
1790
|
createdAt: z.string()
|
|
1456
1791
|
});
|
|
1457
1792
|
const sellerAddressRequestSchema = z.object({
|
|
@@ -1461,7 +1796,8 @@ const sellerAddressRequestSchema = z.object({
|
|
|
1461
1796
|
phone: z.string().regex(/^01[0-9]{8,9}$/),
|
|
1462
1797
|
zipCode: z.string().regex(/^[0-9]{5}$/),
|
|
1463
1798
|
address1: z.string().min(1),
|
|
1464
|
-
address2: z.string().optional()
|
|
1799
|
+
address2: z.string().optional(),
|
|
1800
|
+
inventoryLocationId: z.string().min(1).optional().describe("재고 위치 ID. 등록에서 생략하면 기본 위치, 수정에서 생략하면 지금 연결을 유지한다")
|
|
1465
1801
|
});
|
|
1466
1802
|
//#endregion
|
|
1467
1803
|
//#region src/schemas/storefront-hosting.ts
|
|
@@ -3096,7 +3432,12 @@ const analyticsOverviewSchema = z.object({
|
|
|
3096
3432
|
summary: analyticsTotalsSchema.describe("기간 합계"),
|
|
3097
3433
|
funnel: z.array(analyticsFunnelStepSchema).describe("세션 기준 구매 퍼널. 각 단계는 그 행동을 한 세션 수이고, 앞 단계를 거쳤는지는 따지지 않는다"),
|
|
3098
3434
|
rows: z.array(analyticsTotalsSchema.extend({ date: z.string().describe("일자 (YYYY-MM-DD)") })).describe("날짜별 값. 세션이 없는 날은 생략된다"),
|
|
3099
|
-
excludedBotSessions: z.number().int().describe("집계에서 뺀 봇 세션 수 — 봇 표시 이벤트가 하나라도 있는 세션은 모든 값에서 빠진다")
|
|
3435
|
+
excludedBotSessions: z.number().int().describe("집계에서 뺀 봇 세션 수 — 봇 표시 이벤트가 하나라도 있는 세션은 모든 값에서 빠진다"),
|
|
3436
|
+
byCurrency: z.array(z.object({
|
|
3437
|
+
currency: z.string().describe("구매 통화(ISO 4217)"),
|
|
3438
|
+
purchases: z.number().int().describe("실결제 구매 수(테스트 결제 제외)"),
|
|
3439
|
+
revenue: z.number().int().describe("매출(그 통화의 최소 단위). `includeTest`면 테스트 결제 매출을 더한다")
|
|
3440
|
+
})).optional().default([]).describe("통화별 매출(이슈 #130) — 기간 합계, 기본 통화(KRW) 포함. 통화 사이는 환산하지 않는다. `summary.revenue`는 기본 통화 매출이다. 옛 서버 응답은 빈 목록")
|
|
3100
3441
|
});
|
|
3101
3442
|
const analyticsProductSortSchema = z.enum([
|
|
3102
3443
|
"VIEWS",
|
|
@@ -3349,7 +3690,8 @@ const STORE_SCOPE_RESOURCES = {
|
|
|
3349
3690
|
audit: ["r"],
|
|
3350
3691
|
promotion: ["r", "rw"],
|
|
3351
3692
|
storefront: ["r", "rw"],
|
|
3352
|
-
flow: ["r", "rw"]
|
|
3693
|
+
flow: ["r", "rw"],
|
|
3694
|
+
inventory: ["r", "rw"]
|
|
3353
3695
|
};
|
|
3354
3696
|
const storeScopeResourceSchema = z.enum(Object.keys(STORE_SCOPE_RESOURCES)).describe("스코프 리소스");
|
|
3355
3697
|
/** 카탈로그상 존재하는 스코프 문자열인가 (예: `settlement:rw`는 false) */
|
|
@@ -3379,7 +3721,8 @@ const STORE_ROLE_SCOPES = {
|
|
|
3379
3721
|
"audit:r",
|
|
3380
3722
|
"promotion:rw",
|
|
3381
3723
|
"storefront:rw",
|
|
3382
|
-
"flow:rw"
|
|
3724
|
+
"flow:rw",
|
|
3725
|
+
"inventory:rw"
|
|
3383
3726
|
],
|
|
3384
3727
|
ADMIN: [
|
|
3385
3728
|
"product:rw",
|
|
@@ -3396,7 +3739,8 @@ const STORE_ROLE_SCOPES = {
|
|
|
3396
3739
|
"audit:r",
|
|
3397
3740
|
"promotion:rw",
|
|
3398
3741
|
"storefront:rw",
|
|
3399
|
-
"flow:rw"
|
|
3742
|
+
"flow:rw",
|
|
3743
|
+
"inventory:rw"
|
|
3400
3744
|
],
|
|
3401
3745
|
STAFF: [
|
|
3402
3746
|
"product:rw",
|
|
@@ -3407,7 +3751,8 @@ const STORE_ROLE_SCOPES = {
|
|
|
3407
3751
|
"review:rw",
|
|
3408
3752
|
"customer:r",
|
|
3409
3753
|
"promotion:r",
|
|
3410
|
-
"flow:r"
|
|
3754
|
+
"flow:r",
|
|
3755
|
+
"inventory:rw"
|
|
3411
3756
|
]
|
|
3412
3757
|
};
|
|
3413
3758
|
//#endregion
|
|
@@ -3480,6 +3825,10 @@ const SCOPE_DESCRIPTIONS = {
|
|
|
3480
3825
|
flow: {
|
|
3481
3826
|
r: "주문 흐름 설정을 읽습니다",
|
|
3482
3827
|
rw: "주문 흐름을 만들고 수정합니다"
|
|
3828
|
+
},
|
|
3829
|
+
inventory: {
|
|
3830
|
+
r: "위치별 재고와 재고 변동 내역을 읽습니다",
|
|
3831
|
+
rw: "재고를 조정·실사하고 위치 사이에서 이동합니다"
|
|
3483
3832
|
}
|
|
3484
3833
|
};
|
|
3485
3834
|
/** `{resource}:{r|rw}` → 문장. 카탈로그에 없는 스코프는 null */
|
|
@@ -4186,6 +4535,7 @@ const productVariantSchema = z.object({
|
|
|
4186
4535
|
/** 값 이름을 " / "로 이은 파생 표시명. 옵션 없으면 "" */
|
|
4187
4536
|
name: z.string(),
|
|
4188
4537
|
additionalPrice: z.number().int(),
|
|
4538
|
+
prices: z.array(storedAdditionalCurrencyPriceSchema).optional().describe("외화 추가금(이슈 #130, 관리 API만). 기본 통화 값은 `additionalPrice`다"),
|
|
4189
4539
|
stockQuantity: z.number().int(),
|
|
4190
4540
|
sku: z.string().nullable(),
|
|
4191
4541
|
barcode: z.string().nullable(),
|
|
@@ -4226,6 +4576,7 @@ const addonValueSchema = z.object({
|
|
|
4226
4576
|
name: z.string(),
|
|
4227
4577
|
sortOrder: z.number().int(),
|
|
4228
4578
|
additionalPrice: z.number().int().describe("이 값을 고르면 단가에 더하는 금액(원, 0 이상)"),
|
|
4579
|
+
prices: z.array(storedAdditionalCurrencyPriceSchema).optional().describe("외화 추가금(이슈 #130, 관리 API만). 기본 통화 값은 `additionalPrice`다"),
|
|
4229
4580
|
usable: z.boolean().describe("사용 여부. false면 구매자에게 보이지 않고 고를 수 없다")
|
|
4230
4581
|
});
|
|
4231
4582
|
/** 추가 선택 옵션명 */
|
|
@@ -4309,6 +4660,7 @@ const addonValueRequestSchema = z.object({
|
|
|
4309
4660
|
valueId: z.string().optional(),
|
|
4310
4661
|
name: optionNameSchema,
|
|
4311
4662
|
additionalPrice: z.number().int().min(0).default(0).describe("추가금(원, 0 이상)"),
|
|
4663
|
+
prices: additionalCurrencyPricesSchema.optional(),
|
|
4312
4664
|
usable: z.boolean().default(true)
|
|
4313
4665
|
});
|
|
4314
4666
|
const addonGroupRequestSchema = z.object({
|
|
@@ -4357,6 +4709,7 @@ const discountSchema = z.object({
|
|
|
4357
4709
|
endAt: z.string().nullable()
|
|
4358
4710
|
});
|
|
4359
4711
|
const productSchema = productSummarySchema.extend({
|
|
4712
|
+
prices: z.array(storedProductCurrencyPriceSchema).optional().describe("외화 판매가(이슈 #130). 기본 통화 값은 `salePrice`·`originalPrice`다"),
|
|
4360
4713
|
description: z.string().optional(),
|
|
4361
4714
|
/**
|
|
4362
4715
|
* 상세설명 에디터(@avarlabs/editor)의 직렬화 상태. 재편집 때 이 값으로 문서를 복원한다.
|
|
@@ -4459,6 +4812,7 @@ const productVariantRequestSchema = z.object({
|
|
|
4459
4812
|
/** optionGroups 순서대로 각 축에서 고른 값 이름. 서버가 이름 → valueId를 해석한다 */
|
|
4460
4813
|
valueNames: z.array(z.string()).default([]),
|
|
4461
4814
|
additionalPrice: z.number().int().default(0),
|
|
4815
|
+
prices: additionalCurrencyPricesSchema.optional(),
|
|
4462
4816
|
/**
|
|
4463
4817
|
* 생략 = 기존 재고 유지 (신규 variant는 0).
|
|
4464
4818
|
* 구조 교체(PUT)가 폼 로드 시점의 재고를 되쓰지 않게 하는 옵트인 필드다 —
|
|
@@ -4515,12 +4869,18 @@ const productImagesRequestSchema = z.array(productImageUrlSchema).min(1).max(10)
|
|
|
4515
4869
|
* 최상위가 `strictObject`다. 모르는 필드는 400이다 — 이슈 #57 이전의 평면 필드(`deliveryFee`·`fulfillmentType`·`returnFee` 등)를
|
|
4516
4870
|
* 보낸 요청이 조용히 무시되지 않게 한다. 옛 필드는 `fulfillment.{유형}.…`과 `refundPolicy`로 옮겼다.
|
|
4517
4871
|
*/
|
|
4872
|
+
/**
|
|
4873
|
+
* 기본 통화 판매가 단위 — 통화표가 원천이다(이슈 #130). zod `multipleOf`로 두어 OpenAPI에 그대로 드러난다.
|
|
4874
|
+
* 외화 판매가(`prices[]`)는 통화마다 `isSaleUnitPrice`로 검사한다
|
|
4875
|
+
*/
|
|
4876
|
+
const BASE_SALE_UNIT = CURRENCIES["KRW"].saleUnit;
|
|
4518
4877
|
const productWriteShape = {
|
|
4519
4878
|
name: z.string().min(1).max(100),
|
|
4520
4879
|
categoryId: z.string().min(1, "카테고리를 선택해주십시오"),
|
|
4521
|
-
salePrice: z.number().int().min(
|
|
4880
|
+
salePrice: z.number().int().min(BASE_SALE_UNIT).multipleOf(BASE_SALE_UNIT, "판매가는 10원 단위여야 합니다 (INVALID_PRICE_UNIT)").describe("판매가. 원(KRW) 단위 정수, 최소 10원, 10원 단위"),
|
|
4522
4881
|
originalPrice: z.number().int().optional().describe("정가(할인 전 표시 가격). 원 단위. 비교용 표시 값이고 결제 금액은 판매가(즉시할인이 있으면 할인 적용가)다. 스토어프론트가 판매가보다 클 때 취소선·할인율로 보인다. 즉시할인은 `PUT /v1/products/{productId}/discount`로 따로 정한다"),
|
|
4523
4882
|
pointEarnRateBp: pointEarnRateBpSchema.nullable().optional().describe("구매 적립률 덮어쓰기(만분율, 100 = 1%, 0~3000, 이슈 #93). null이면 상점 기본 적립률, 0이면 이 상품은 적립하지 않는다. 결제 확정 시점 값이 주문상품에 남는다. 전체 수정(PUT)에서 생략하면 지금 값을 유지한다"),
|
|
4883
|
+
prices: productCurrencyPricesSchema.optional(),
|
|
4524
4884
|
description: z.string().optional(),
|
|
4525
4885
|
/**
|
|
4526
4886
|
* 상세설명 에디터(@avarlabs/editor)의 직렬화 상태. 재편집 때 이 값으로 문서를 복원한다.
|
|
@@ -4550,11 +4910,12 @@ const productReplaceRequestSchema = z.strictObject({
|
|
|
4550
4910
|
});
|
|
4551
4911
|
const productPatchRequestSchema = z.strictObject({
|
|
4552
4912
|
name: z.string().max(100).optional(),
|
|
4553
|
-
salePrice: z.number().int().multipleOf(
|
|
4913
|
+
salePrice: z.number().int().multipleOf(BASE_SALE_UNIT).optional(),
|
|
4554
4914
|
status: productStatusSchema.optional(),
|
|
4555
4915
|
flowId: z.string().nullable().optional().describe("주문 흐름(이슈 #115) — 게시한 흐름 id, null이면 카테고리의 흐름(없으면 기본 흐름). 생략하면 바꾸지 않는다"),
|
|
4556
4916
|
images: productImagesRequestSchema.optional().describe("상품 이미지 주소 목록. 주면 통째로 바꾼다(현재 목록과 병합하지 않는다). 첫 장이 대표 이미지(썸네일)다. 생략하면 바꾸지 않는다"),
|
|
4557
4917
|
fulfillment: productFulfillmentUpdateSchema.optional().describe(fulfillmentUpdateDescription),
|
|
4918
|
+
prices: productCurrencyPricesSchema.optional(),
|
|
4558
4919
|
refundPolicy: productRefundPolicyPatchSchema.nullable().optional().describe("상품별 환불 정책. 주면 통째로 바꾼다(준 항목만 상점 기본을 덮어쓴다). `null`은 덮어쓰기를 지워 상점 기본을 따른다. 생략하면 바꾸지 않는다"),
|
|
4559
4920
|
pointEarnRateBp: pointEarnRateBpSchema.nullable().optional().describe("구매 적립률 덮어쓰기(만분율, 100 = 1%, 0~3000, 이슈 #93). null이면 상점 기본 적립률, 0이면 이 상품은 적립하지 않는다. 결제 확정 시점 값이 주문상품에 남는다. 생략하면 바꾸지 않는다")
|
|
4560
4921
|
}).refine((value) => Object.values(value).some((v) => v !== void 0), { message: "최소 1개 필드가 필요합니다" });
|
|
@@ -4593,6 +4954,7 @@ const orderWebhookEventDataSchema = z.object({
|
|
|
4593
4954
|
orderId: z.string().describe("주문 ID"),
|
|
4594
4955
|
orderNo: z.string().nullable().optional().default(null).describe("주문번호(이슈 #107) — 숫자 14자리. 이 필드가 없는 이전 이벤트와 번호 체계 이전 주문은 null로 읽는다"),
|
|
4595
4956
|
status: orderItemStatusSchema.describe("이벤트 발생 시점의 주문 대표 상태"),
|
|
4957
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 이 이벤트의 금액은 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 이 필드가 없는 이전 이벤트는 KRW다"),
|
|
4596
4958
|
testPayment: z.boolean().optional().default(false).describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았다. 이 필드가 없는 이전 이벤트는 false로 읽는다"),
|
|
4597
4959
|
couponDiscountAmount: z.number().int().optional().default(0).describe("주문이 받은 상품·주문 쿠폰 할인 합계 (원). 즉시할인(`discountAmount`)과 별개다. 쿠폰이 없거나 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
4598
4960
|
pointAmount: z.number().int().optional().default(0).describe("주문에 쓴 적립금 (원, #93). 적립금을 쓰지 않았거나 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
@@ -4616,6 +4978,7 @@ const orderFulfilledWebhookEventDataSchema = z.object({
|
|
|
4616
4978
|
fulfillmentSnapshot: orderItemFulfillmentSnapshotResponseSchema.describe("제공한 주문상품의 주문 시점 이행 스냅샷(주문상품 응답의 `fulfillmentSnapshot`과 같다, 이슈 #57)"),
|
|
4617
4979
|
fulfillment: z.object({ mode: z.string() }).optional().describe("**Deprecated** — 항상 `{ mode: \"MANUAL\" }`이다. 자동 제공을 없앴고(이슈 #48) store-sdk 0.19 이하 호환으로만 싣는다. 게시된 연동이 store-sdk 0.20 이상으로 넘어간 뒤 다음 릴리스에서 뺀다"),
|
|
4618
4980
|
fulfilledAt: z.string().describe("제공 시각 (ISO 8601). 주문상품의 `deliveredAt`과 같다"),
|
|
4981
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 이 이벤트의 금액은 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 이 필드가 없는 이전 이벤트는 KRW다"),
|
|
4619
4982
|
testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았다")
|
|
4620
4983
|
});
|
|
4621
4984
|
/**
|
|
@@ -4638,6 +5001,7 @@ const orderCanceledWebhookEventDataSchema = z.object({
|
|
|
4638
5001
|
couponChargeAmount: z.number().int().optional().default(0).describe("환불액에서 뺀 쿠폰 조건 미달 차감 (원). 판매자 취소는 차감하지 않으므로 늘 0이다. 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
4639
5002
|
couponChargeRefundAmount: z.number().int().optional().default(0).describe("환불액에 더한 금액 (원) — 앞선 환불에서 뺀 쿠폰 조건 미달 차감을 되돌린 몫이다. 전량 취소면 누적 차감이 모두 되돌아간다. 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
4640
5003
|
pointRefundAmount: z.number().int().optional().default(0).describe("돌려준 적립금 (원, #93) — 결제에 쓴 적립금 중 이번 취소·반품 수량의 몫이다. 현금 환불(`refundAmount`)과 별개다. 차감은 현금에서 먼저 빼고 모자란 몫만 여기서 뺀다. 적립금을 쓰지 않은 주문과 이 필드가 없는 이전 응답·이벤트는 0으로 읽는다"),
|
|
5004
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 이 이벤트의 금액은 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 이 필드가 없는 이전 이벤트는 KRW다"),
|
|
4641
5005
|
testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았다")
|
|
4642
5006
|
});
|
|
4643
5007
|
const claimWebhookEventDataSchema = z.object({
|
|
@@ -4655,6 +5019,7 @@ const claimWebhookEventDataSchema = z.object({
|
|
|
4655
5019
|
couponChargeAmount: z.number().int().optional().default(0).describe("환불액에서 뺀 쿠폰 조건 미달 차감 (원) — 일부 취소·반품으로 남은 주문상품이 쿠폰 조건(최소 주문 금액 등)을 잃어 남은 주문상품이 받던 할인을 뺀 금액이다. 배송비 차감·추가 차감과 별개다. 접수 이벤트는 예상값이다. 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
4656
5020
|
couponChargeRefundAmount: z.number().int().optional().default(0).describe("환불액에 더한 금액 (원) — 앞선 환불에서 뺀 쿠폰 조건 미달 차감을 되돌린 몫이다. 접수 이벤트는 예상값이다. 이 필드가 없는 이전 이벤트는 0으로 읽는다"),
|
|
4657
5021
|
pointRefundAmount: z.number().int().optional().default(0).describe("돌려준 적립금 (원, #93) — 결제에 쓴 적립금 중 이번 취소·반품 수량의 몫이다. 현금 환불(`refundAmount`)과 별개다. 차감은 현금에서 먼저 빼고 모자란 몫만 여기서 뺀다. 적립금을 쓰지 않은 주문과 이 필드가 없는 이전 응답·이벤트는 0으로 읽는다"),
|
|
5022
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 이 이벤트의 금액은 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 이 필드가 없는 이전 이벤트는 KRW다"),
|
|
4658
5023
|
testPayment: z.boolean().optional().default(false).describe("테스트 결제(샌드박스 결제) 주문의 클레임인가. 이 필드가 없는 이전 이벤트는 false로 읽는다")
|
|
4659
5024
|
});
|
|
4660
5025
|
const inquiryWebhookEventDataSchema = z.object({
|
|
@@ -4668,7 +5033,30 @@ const reviewWebhookEventDataSchema = z.object({
|
|
|
4668
5033
|
});
|
|
4669
5034
|
const productOutOfStockWebhookEventDataSchema = z.object({
|
|
4670
5035
|
productId: z.string().describe("상품 ID"),
|
|
4671
|
-
variantId: z.string().describe("재고가 0이 된 판매 단위(variant) ID. 주문 상품의 `optionId`와 같은 값 공간이다")
|
|
5036
|
+
variantId: z.string().describe("재고가 0이 된 판매 단위(variant) ID. 주문 상품의 `optionId`와 같은 값 공간이다"),
|
|
5037
|
+
inventoryLocationId: z.string().optional().describe("재고가 0이 된 재고 위치 ID. 품절은 위치별 가용 재고의 0 전이다. 위치를 하나만 쓰는 상점은 기본 위치다(옛 이벤트에는 없다)")
|
|
5038
|
+
});
|
|
5039
|
+
/**
|
|
5040
|
+
* 위치별 재고 변화(이슈 #132) — 재고 변동 내역 한 행마다 한 건이다. 같은 위치·조합의 순서는 `levelVersion`(빈 번호 없음)으로 맞추고,
|
|
5041
|
+
* 상점 전체 순서는 `movementSeq`(재고 변동 내역 조회의 `after` 커서와 같은 값)다. 자기가 한 조정의 반향은 `actorType`·`actorId`·`operationId`로 거른다.
|
|
5042
|
+
* 출고 대기·실재고(상태 전이) 변화는 이벤트를 내지 않는다 — 필요하면 위치별 재고 조회를 다시 읽는다
|
|
5043
|
+
*/
|
|
5044
|
+
const inventoryChangedWebhookEventDataSchema = z.object({
|
|
5045
|
+
productId: z.string().describe("상품 ID"),
|
|
5046
|
+
variantId: z.string().describe("판매 단위(variant) ID. 주문 상품의 `optionId`와 같은 값 공간이다"),
|
|
5047
|
+
inventoryLocationId: z.string().describe("재고 위치 ID"),
|
|
5048
|
+
available: z.number().int().describe("변화 뒤 가용 재고"),
|
|
5049
|
+
delta: z.number().int().describe("가용 재고 변화량(0이 아니다)"),
|
|
5050
|
+
kind: z.string().describe("변동 종류 — `OPENING`·`SALE`·`RESTORE`·`REVERT`·`EXCHANGE_OUT`·`ADJUST`·`COUNT`·`TRANSFER_OUT`·`TRANSFER_IN`·`REMOVED`. 값이 늘 수 있다"),
|
|
5051
|
+
reason: z.string().nullable().describe("조정·실사 사유 코드. 없으면 null"),
|
|
5052
|
+
levelVersion: z.number().int().describe("위치별 재고 행의 버전 — 같은 위치·조합 안에서 빈 번호 없이 오른다"),
|
|
5053
|
+
movementSeq: z.number().int().describe("상점별 재고 변동 내역 순번"),
|
|
5054
|
+
actorType: z.string().describe("행위자 유형 — `seller`·`app`·`agent`·`system`"),
|
|
5055
|
+
actorId: z.string().nullable().describe("행위자 ID. 시스템이면 null"),
|
|
5056
|
+
refType: z.string().nullable().describe("출처 유형 — `order_item`·`claim`·`operation`. 없으면 null"),
|
|
5057
|
+
refId: z.string().nullable().describe("출처 ID"),
|
|
5058
|
+
operationId: z.string().nullable().describe("재고 조정·이동 요청 ID. 조정·이동이 아니면 null"),
|
|
5059
|
+
occurredAt: z.string().describe("변화 시각")
|
|
4672
5060
|
});
|
|
4673
5061
|
const orderWebhookEventSchema = z.object({
|
|
4674
5062
|
...envelopeFields,
|
|
@@ -4717,6 +5105,11 @@ const productOutOfStockWebhookEventSchema = z.object({
|
|
|
4717
5105
|
type: z.literal("PRODUCT.OUT_OF_STOCK"),
|
|
4718
5106
|
data: productOutOfStockWebhookEventDataSchema
|
|
4719
5107
|
});
|
|
5108
|
+
const inventoryChangedWebhookEventSchema = z.object({
|
|
5109
|
+
...envelopeFields,
|
|
5110
|
+
type: z.literal("INVENTORY.CHANGED"),
|
|
5111
|
+
data: inventoryChangedWebhookEventDataSchema
|
|
5112
|
+
});
|
|
4720
5113
|
/**
|
|
4721
5114
|
* 플로우 알림(이슈 #115) — 상점이 플로우에 둔 알림 블록(`core.notify`, 채널 `webhook`)이 보낸다. 구매자 알림(알림톡·메일)은 이 이벤트를 받아
|
|
4722
5115
|
* 상점이 보낸다(플랫폼은 구매자에게 직접 보내지 않는다). 개인정보는 싣지 않는다
|
|
@@ -4764,7 +5157,8 @@ const webhookEventSchema = z.discriminatedUnion("type", [
|
|
|
4764
5157
|
reviewWebhookEventSchema,
|
|
4765
5158
|
productOutOfStockWebhookEventSchema,
|
|
4766
5159
|
flowNotificationWebhookEventSchema,
|
|
4767
|
-
flowStateChangedWebhookEventSchema
|
|
5160
|
+
flowStateChangedWebhookEventSchema,
|
|
5161
|
+
inventoryChangedWebhookEventSchema
|
|
4768
5162
|
]).describe("웹훅 요청 본문 (얇은 이벤트). 개인정보를 싣지 않으며 `data`의 id로 관리 API를 조회한다");
|
|
4769
5163
|
/**
|
|
4770
5164
|
* 알려진 웹훅 이벤트 타입 — `webhookEventSchema`의 판별 값 목록(이 SDK 버전이 아는 것).
|
|
@@ -4880,6 +5274,7 @@ const APP_EVENT_SCOPES = {
|
|
|
4880
5274
|
"INQUIRY.CREATED": "inquiry:r",
|
|
4881
5275
|
"REVIEW.CREATED": "review:r",
|
|
4882
5276
|
"PRODUCT.OUT_OF_STOCK": "product:r",
|
|
5277
|
+
"INVENTORY.CHANGED": "inventory:r",
|
|
4883
5278
|
"APP.INSTALLED": null,
|
|
4884
5279
|
"APP.UNINSTALLED": null,
|
|
4885
5280
|
"APP.SETTINGS_UPDATED": null,
|
|
@@ -5425,7 +5820,8 @@ const eventTypeSchema = z.enum([
|
|
|
5425
5820
|
"REVIEW.CREATED",
|
|
5426
5821
|
"PRODUCT.OUT_OF_STOCK",
|
|
5427
5822
|
"ORDER.FLOW_NOTIFICATION",
|
|
5428
|
-
"ORDER.FLOW_STATE_CHANGED"
|
|
5823
|
+
"ORDER.FLOW_STATE_CHANGED",
|
|
5824
|
+
"INVENTORY.CHANGED"
|
|
5429
5825
|
]).describe("웹훅 이벤트 타입. `ORDER.ADDRESS_CHANGE_REQUESTED`는 현재 발송하지 않음(호환을 위해 값만 남았고, 구독해도 이벤트가 오지 않는다)");
|
|
5430
5826
|
const webhookStatusSchema = z.enum(["ACTIVE", "SUSPENDED"]).describe("구독 상태. `ACTIVE`=발송 대상, `SUSPENDED`=24시간 이상 연속 전송 실패로 발송이 정지된 상태. 정지 중 발생한 이벤트는 적재하지 않는다. 재개(`POST /webhooks/{id}/resume`)하거나 구독을 수정하면 ACTIVE로 돌아간다");
|
|
5431
5827
|
const webhookSchema = z.object({
|
|
@@ -7024,16 +7420,17 @@ const couponRejectReasonSchema = z.enum([
|
|
|
7024
7420
|
"NO_DISCOUNT"
|
|
7025
7421
|
]).describe("쿠폰을 적용하지 못한 사유. `DUPLICATE_COUPON`=같은 쿠폰을 두 번 넣음, `STACK_LIMIT`=같은 종류의 쿠폰이 이미 적용됨(주문 쿠폰·배송비 쿠폰은 주문당 1장, 상품 쿠폰은 주문상품 한 줄에 1장), `NOT_STARTED`=사용 기간 전, `EXPIRED`=사용 기간 지남, `MEMBER_ONLY`=회원 전용, `FIRST_ORDER_ONLY`=첫 구매 전용, `NO_ELIGIBLE_ITEMS`=대상 상품이 주문에 없음, `MIN_ORDER_AMOUNT`=최소 주문 금액 미달, `LINE_NOT_ELIGIBLE`=지정한 주문상품이 대상이 아니거나 이미 상품 쿠폰이 있음, `LINE_AMBIGUOUS`=지정한 `optionId`의 줄이 여럿이라 줄을 정할 수 없음(`lineId`로 지목한다), `NO_DISCOUNT`=할인할 금액이 없음");
|
|
7026
7422
|
/** 쿠폰 적용 뒤 결제 금액의 하한 — 0원 결제 경로가 없어 이보다 작으면 결제를 시작하지 않는다(400 `PAYMENT_AMOUNT_TOO_LOW`) */
|
|
7027
|
-
const MIN_PAYMENT_AMOUNT =
|
|
7423
|
+
const MIN_PAYMENT_AMOUNT = CURRENCIES.KRW.minPayment;
|
|
7028
7424
|
/**
|
|
7029
|
-
* 할인액 — 정률은 10원
|
|
7425
|
+
* 할인액 — 정률은 판매가 단위(`rules.saleUnit`, KRW 10원) 내림, 최대 할인액과 기준 금액을 넘지 않는다. 기준 금액이 0 이하면 0이다.
|
|
7030
7426
|
*
|
|
7031
|
-
* 곱셈을 먼저 하고 나눈다. `base × 율 ÷
|
|
7032
|
-
* 부동소수 오차가 끼지
|
|
7427
|
+
* 곱셈을 먼저 하고 나눈다. `base × 율 ÷ (100 × 단위)`를 내려 단위를 곱하면 `floor(base × 율 / 100 / 단위) × 단위`와 같고
|
|
7428
|
+
* 부동소수 오차가 끼지 않는다(KRW는 지금의 `÷ 1000 × 10` 그대로).
|
|
7033
7429
|
*/
|
|
7034
|
-
function couponDiscountOf(benefit, base) {
|
|
7430
|
+
function couponDiscountOf(benefit, base, rules = KRW_MONEY_RULES) {
|
|
7035
7431
|
if (base <= 0) return 0;
|
|
7036
|
-
|
|
7432
|
+
const unit = rules.saleUnit;
|
|
7433
|
+
let raw = benefit.type === "RATE" ? Math.floor(base * benefit.value / (100 * unit)) * unit : benefit.value;
|
|
7037
7434
|
if (benefit.type === "RATE" && benefit.maxDiscountAmount !== null) raw = Math.min(raw, benefit.maxDiscountAmount);
|
|
7038
7435
|
return Math.max(0, Math.min(raw, base));
|
|
7039
7436
|
}
|
|
@@ -7101,6 +7498,7 @@ function periodRejectOf(coupon, now) {
|
|
|
7101
7498
|
* 사본 중 앞 장이 만료됐으면 뒤 장이 쓰인다. 결과의 `coupons`는 입력 순서 그대로다. 입력이 같으면 결과도 같다.
|
|
7102
7499
|
*/
|
|
7103
7500
|
function quotePricing(input) {
|
|
7501
|
+
const rules = input.moneyRules ?? KRW_MONEY_RULES;
|
|
7104
7502
|
const lines = input.lines.map((line) => ({
|
|
7105
7503
|
line,
|
|
7106
7504
|
productDiscount: 0,
|
|
@@ -7176,14 +7574,14 @@ function quotePricing(input) {
|
|
|
7176
7574
|
continue;
|
|
7177
7575
|
}
|
|
7178
7576
|
chosen = coupon.lineId;
|
|
7179
|
-
best = couponDiscountOf(coupon.rule.benefit, lineOf(chosen)?.line.amount ?? 0);
|
|
7577
|
+
best = couponDiscountOf(coupon.rule.benefit, lineOf(chosen)?.line.amount ?? 0, rules);
|
|
7180
7578
|
} else {
|
|
7181
7579
|
if (candidates.length === 0) {
|
|
7182
7580
|
result.rejectReason = "STACK_LIMIT";
|
|
7183
7581
|
continue;
|
|
7184
7582
|
}
|
|
7185
7583
|
for (const id of candidates) {
|
|
7186
|
-
const discount = couponDiscountOf(coupon.rule.benefit, lineOf(id)?.line.amount ?? 0);
|
|
7584
|
+
const discount = couponDiscountOf(coupon.rule.benefit, lineOf(id)?.line.amount ?? 0, rules);
|
|
7187
7585
|
if (chosen === null || discount > best) {
|
|
7188
7586
|
chosen = id;
|
|
7189
7587
|
best = discount;
|
|
@@ -7216,7 +7614,7 @@ function quotePricing(input) {
|
|
|
7216
7614
|
const targets = result.eligibleLineIds.map((id) => lineOf(id)).filter((entry) => entry !== void 0);
|
|
7217
7615
|
const weights = targets.map((entry) => Math.max(0, entry.line.amount - entry.productDiscount));
|
|
7218
7616
|
const base = weights.reduce((sum, w) => sum + w, 0);
|
|
7219
|
-
const discount = couponDiscountOf(coupon.rule.benefit, base);
|
|
7617
|
+
const discount = couponDiscountOf(coupon.rule.benefit, base, rules);
|
|
7220
7618
|
if (discount <= 0) {
|
|
7221
7619
|
result.rejectReason = "NO_DISCOUNT";
|
|
7222
7620
|
continue;
|
|
@@ -7251,7 +7649,7 @@ function quotePricing(input) {
|
|
|
7251
7649
|
}
|
|
7252
7650
|
const weights = deliveryBundles.map((bundle) => Math.max(0, bundle.fee));
|
|
7253
7651
|
const base = weights.reduce((sum, w) => sum + w, 0);
|
|
7254
|
-
const discount = couponDiscountOf(coupon.rule.benefit, base);
|
|
7652
|
+
const discount = couponDiscountOf(coupon.rule.benefit, base, rules);
|
|
7255
7653
|
if (discount <= 0) {
|
|
7256
7654
|
result.rejectReason = "NO_DISCOUNT";
|
|
7257
7655
|
continue;
|
|
@@ -7281,7 +7679,7 @@ function quotePricing(input) {
|
|
|
7281
7679
|
productPaid: productWeights.reduce((sum, w) => sum + w, 0),
|
|
7282
7680
|
deliveryPaid: bundleWeights.reduce((sum, w) => sum + w, 0),
|
|
7283
7681
|
total: beforePoints
|
|
7284
|
-
});
|
|
7682
|
+
}, rules);
|
|
7285
7683
|
if (points.amount > 0) {
|
|
7286
7684
|
const productPaid = productWeights.reduce((sum, w) => sum + w, 0);
|
|
7287
7685
|
const toLines = Math.min(points.amount, productPaid);
|
|
@@ -7316,7 +7714,7 @@ function quotePricing(input) {
|
|
|
7316
7714
|
* - 그 밖에는 사용 단위로 내리고, 남는 결제 금액이 1~99원이면 적립금을 줄여 100원을 남긴다(`MIN_PAYMENT`)
|
|
7317
7715
|
* 최소 보유액·최소 사용액에 못 미치면 0이다.
|
|
7318
7716
|
*/
|
|
7319
|
-
function pointUseOf(points, amounts) {
|
|
7717
|
+
function pointUseOf(points, amounts, moneyRules = KRW_MONEY_RULES) {
|
|
7320
7718
|
const none = {
|
|
7321
7719
|
amount: 0,
|
|
7322
7720
|
maxUsable: 0,
|
|
@@ -7339,8 +7737,8 @@ function pointUseOf(points, amounts) {
|
|
|
7339
7737
|
};
|
|
7340
7738
|
const amount = floorUnit(Math.min(cap, total));
|
|
7341
7739
|
const remaining = total - amount;
|
|
7342
|
-
if (remaining > 0 && remaining <
|
|
7343
|
-
amount: floorUnit(total -
|
|
7740
|
+
if (remaining > 0 && remaining < moneyRules.minPayment) return {
|
|
7741
|
+
amount: floorUnit(total - moneyRules.minPayment),
|
|
7344
7742
|
adjusted: true
|
|
7345
7743
|
};
|
|
7346
7744
|
return {
|
|
@@ -7596,7 +7994,8 @@ const createCouponRequestSchema = z.strictObject({
|
|
|
7596
7994
|
totalIssueLimit: limitField(descriptions.totalIssueLimit),
|
|
7597
7995
|
totalUseLimit: limitField(descriptions.totalUseLimit),
|
|
7598
7996
|
perMemberIssueLimit: limitField(descriptions.perMemberIssueLimit),
|
|
7599
|
-
perMemberUseLimit: limitField(descriptions.perMemberUseLimit)
|
|
7997
|
+
perMemberUseLimit: limitField(descriptions.perMemberUseLimit),
|
|
7998
|
+
currency: currencyCodeSchema.optional().describe("쿠폰 통화(이슈 #130). 정액·최대 할인액·최소 주문 금액이 이 통화 값이고 같은 통화 주문서에만 적용된다. 생략하면 기본 통화(KRW). 판매 통화여야 하고 만든 뒤에는 바꿀 수 없다")
|
|
7600
7999
|
}).superRefine((body, ctx) => {
|
|
7601
8000
|
const issue = (path, message) => ctx.addIssue({
|
|
7602
8001
|
code: "custom",
|
|
@@ -7652,6 +8051,7 @@ const couponSchema = z.object({
|
|
|
7652
8051
|
issuedCount: z.number().int().describe("발급 수 — 회수한 발급도 센다. 총 발급 한도(`totalIssueLimit`)가 이 값과 비교된다"),
|
|
7653
8052
|
reservedCount: z.number().int().describe("결제 중인 예약 수 — 결제가 끝나거나 만료되면 풀린다"),
|
|
7654
8053
|
usedCount: z.number().int().describe("사용 수 — 전량 취소로 복원되면 줄어든다"),
|
|
8054
|
+
currency: z.string().optional().default("KRW").describe("쿠폰 통화(이슈 #130). 금액 필드는 이 통화의 최소 단위다. 옛 서버 응답은 KRW로 읽는다"),
|
|
7655
8055
|
status: couponStatusSchema,
|
|
7656
8056
|
locked: z.boolean().describe("발급·사용이 시작돼 혜택·조건·대상·사용 시작일을 바꿀 수 없는가"),
|
|
7657
8057
|
lockedAt: z.string().nullable(),
|
|
@@ -7765,7 +8165,7 @@ const customerListQuerySchema = z.object({
|
|
|
7765
8165
|
/** 구매 통계 — 구매 금액은 취소된 주문 상품을 빼고, 완료된 반품은 수량 비율로 뺀 금액이다 */
|
|
7766
8166
|
const customerStatsSchema = z.object({
|
|
7767
8167
|
orderCount: z.number().int().describe("주문 수(취소 포함)"),
|
|
7768
|
-
totalPaid: z.number().int().describe("구매 금액(원) — 취소·완료된 반품
|
|
8168
|
+
totalPaid: z.number().int().describe("구매 금액(원) — 취소·완료된 반품 제외. 원화 주문만 더한다(외화 주문은 환산하지 않고 빠진다)"),
|
|
7769
8169
|
lastOrderedAt: z.string().nullable().describe("최근 주문 시각")
|
|
7770
8170
|
});
|
|
7771
8171
|
/** 목록 행 — 휴대폰은 가운데를 가린다(`010-****-1234`) */
|
|
@@ -7787,7 +8187,10 @@ const customerAddressSchema = z.object({
|
|
|
7787
8187
|
phone: z.string(),
|
|
7788
8188
|
zipCode: z.string(),
|
|
7789
8189
|
address1: z.string(),
|
|
7790
|
-
address2: z.string().nullable()
|
|
8190
|
+
address2: z.string().nullable(),
|
|
8191
|
+
countryCode: z.string().optional().default("KR").describe("국가(ISO 3166-1 alpha-2, 이슈 #130). 해외 주소의 `zipCode`는 그 나라 우편번호이고 없으면 빈 문자열이다"),
|
|
8192
|
+
city: z.string().nullable().optional().default(null).describe("해외 주소의 도시. 국내는 null"),
|
|
8193
|
+
region: z.string().nullable().optional().default(null).describe("해외 주소의 주·도·현. 국내는 null")
|
|
7791
8194
|
});
|
|
7792
8195
|
/** 동의 종류 — 이용약관·개인정보 수집이용은 가입 필수, 마케팅 수신은 선택 */
|
|
7793
8196
|
const consentKindSchema = z.enum([
|
|
@@ -7910,6 +8313,149 @@ const customerWithdrawalBlockedDetailsSchema = z.object({
|
|
|
7910
8313
|
pendingPayments: z.number().int()
|
|
7911
8314
|
});
|
|
7912
8315
|
//#endregion
|
|
8316
|
+
//#region src/schemas/inventory.ts
|
|
8317
|
+
/**
|
|
8318
|
+
* 위치별 재고 (이슈 #132) — 재고 위치(창고·상설 매장·팝업 매장)마다 조합의 가용 재고를 따로 센다. 출고지·반품지·픽업 장소가 위치를
|
|
8319
|
+
* 가리키고, 배송 주문은 출고지 위치에서, 방문 수령 주문은 그 매장 위치에서 뺀다. 위치를 하나만 쓰는 상점은 기본 위치 하나다.
|
|
8320
|
+
*
|
|
8321
|
+
* - 가용 재고(`available`)는 지금 팔 수 있는 수량이다(팔린 미출고분이 이미 빠진 수). 저장하는 값이다.
|
|
8322
|
+
* - 출고 대기(`pendingFulfillment`)는 그 위치에 할당됐고 아직 출고 전(주문상품 `PAID`·`CONFIRMED`)인 수량이다.
|
|
8323
|
+
* - 실재고(`onHand`)는 가용 재고 + 출고 대기다. 위치에 실제로 있어야 하는 수량이다.
|
|
8324
|
+
* - 상품·옵션 API의 `stockQuantity`는 그 상품 기준 위치의 가용 재고다(이름·뜻 유지).
|
|
8325
|
+
*/
|
|
8326
|
+
/** 재고 조정 사유 — `COUNT`는 실사 줄(`counted`)이 쓴다 */
|
|
8327
|
+
const inventoryAdjustmentReasonSchema = z.enum([
|
|
8328
|
+
"RECEIVED",
|
|
8329
|
+
"DAMAGED",
|
|
8330
|
+
"LOST",
|
|
8331
|
+
"FOUND",
|
|
8332
|
+
"RETURN_RESTOCK",
|
|
8333
|
+
"CORRECTION",
|
|
8334
|
+
"COUNT"
|
|
8335
|
+
]).describe("조정 사유 — 입고 `RECEIVED`, 파손 `DAMAGED`, 분실 `LOST`, 재발견 `FOUND`, 반품 재입고 `RETURN_RESTOCK`, 정정 `CORRECTION`, 실사 `COUNT`");
|
|
8336
|
+
const inventoryLocationSchema = z.object({
|
|
8337
|
+
inventoryLocationId: z.string(),
|
|
8338
|
+
name: z.string().describe("위치 이름(예: 본사 창고, 성수 팝업)"),
|
|
8339
|
+
isDefault: z.boolean().describe("기본 위치인가 — 상점마다 하나이고 삭제할 수 없다. 기존 재고가 있는 곳이다"),
|
|
8340
|
+
sortOrder: z.number().int(),
|
|
8341
|
+
createdAt: z.string(),
|
|
8342
|
+
updatedAt: z.string()
|
|
8343
|
+
});
|
|
8344
|
+
const inventoryLocationRequestSchema = z.strictObject({
|
|
8345
|
+
name: z.string().trim().min(1).max(50),
|
|
8346
|
+
sortOrder: z.number().int().min(0).max(1e4).optional()
|
|
8347
|
+
});
|
|
8348
|
+
const inventoryLevelSchema = z.object({
|
|
8349
|
+
productId: z.string(),
|
|
8350
|
+
variantId: z.string().describe("판매 단위(variant) ID. 주문 상품의 `optionId`와 같은 값 공간이다"),
|
|
8351
|
+
inventoryLocationId: z.string(),
|
|
8352
|
+
available: z.number().int().describe("가용 재고"),
|
|
8353
|
+
pendingFulfillment: z.number().int().describe("출고 대기 — 할당됐고 아직 출고 전인 수량"),
|
|
8354
|
+
onHand: z.number().int().describe("실재고 — 가용 재고 + 출고 대기"),
|
|
8355
|
+
version: z.number().int().describe("쓰기마다 1씩 오르는 버전(`INVENTORY.CHANGED`의 `levelVersion`)"),
|
|
8356
|
+
updatedAt: z.string()
|
|
8357
|
+
});
|
|
8358
|
+
const inventoryLevelListQuerySchema = z.object({
|
|
8359
|
+
inventoryLocationId: z.string().optional(),
|
|
8360
|
+
productId: z.string().optional(),
|
|
8361
|
+
variantId: z.string().optional(),
|
|
8362
|
+
cursor: z.string().optional().describe("이전 응답의 `nextCursor`. 생략하면 처음부터"),
|
|
8363
|
+
limit: z.coerce.number().int().min(1).max(200).optional().describe("한 쪽 크기(기본 100)")
|
|
8364
|
+
});
|
|
8365
|
+
const inventoryLevelPageSchema = z.object({
|
|
8366
|
+
contents: z.array(inventoryLevelSchema),
|
|
8367
|
+
nextCursor: z.string().nullable().describe("다음 페이지 커서. 마지막 페이지면 null")
|
|
8368
|
+
});
|
|
8369
|
+
const inventoryMovementKindSchema = z.enum([
|
|
8370
|
+
"OPENING",
|
|
8371
|
+
"SALE",
|
|
8372
|
+
"RESTORE",
|
|
8373
|
+
"REVERT",
|
|
8374
|
+
"EXCHANGE_OUT",
|
|
8375
|
+
"ADJUST",
|
|
8376
|
+
"COUNT",
|
|
8377
|
+
"TRANSFER_OUT",
|
|
8378
|
+
"TRANSFER_IN",
|
|
8379
|
+
"REMOVED"
|
|
8380
|
+
]).describe("변동 종류 — 시작 `OPENING`, 판매 `SALE`, 복원 `RESTORE`, 복원 되돌리기 `REVERT`, 교환 출고 `EXCHANGE_OUT`, 조정 `ADJUST`, 실사 `COUNT`, 이동 출고 `TRANSFER_OUT`, 이동 입고 `TRANSFER_IN`, 조합 삭제 `REMOVED`");
|
|
8381
|
+
const inventoryMovementSchema = z.object({
|
|
8382
|
+
movementId: z.string(),
|
|
8383
|
+
seq: z.number().int().describe("상점별 순번 — 커밋 순서와 같고 빈 번호가 없다. `after` 커서에 쓴다"),
|
|
8384
|
+
productId: z.string(),
|
|
8385
|
+
variantId: z.string(),
|
|
8386
|
+
inventoryLocationId: z.string(),
|
|
8387
|
+
kind: z.string().describe("변동 종류(`inventoryMovementKindSchema`). 값이 늘 수 있다"),
|
|
8388
|
+
delta: z.number().int().describe("가용 재고 변화량"),
|
|
8389
|
+
available: z.number().int().describe("변화 뒤 가용 재고"),
|
|
8390
|
+
levelVersion: z.number().int(),
|
|
8391
|
+
reason: z.string().nullable(),
|
|
8392
|
+
note: z.string().nullable(),
|
|
8393
|
+
refType: z.string().nullable().describe("출처 유형 — `order_item`·`claim`·`operation`"),
|
|
8394
|
+
refId: z.string().nullable(),
|
|
8395
|
+
operationId: z.string().nullable().describe("재고 조정·이동 요청 ID"),
|
|
8396
|
+
actorType: z.string().describe("행위자 유형 — `seller`·`app`·`agent`·`system`"),
|
|
8397
|
+
actorId: z.string().nullable(),
|
|
8398
|
+
createdAt: z.string()
|
|
8399
|
+
});
|
|
8400
|
+
const inventoryMovementListQuerySchema = z.object({
|
|
8401
|
+
inventoryLocationId: z.string().optional(),
|
|
8402
|
+
productId: z.string().optional(),
|
|
8403
|
+
variantId: z.string().optional(),
|
|
8404
|
+
kind: inventoryMovementKindSchema.optional(),
|
|
8405
|
+
after: z.coerce.number().int().min(0).optional().describe("이 순번 다음부터(오름차순). 생략하면 처음부터"),
|
|
8406
|
+
from: z.string().optional().describe("이 시각 이후(ISO 8601)"),
|
|
8407
|
+
to: z.string().optional().describe("이 시각 이전(ISO 8601)"),
|
|
8408
|
+
limit: z.coerce.number().int().min(1).max(200).optional().describe("한 쪽 크기(기본 100)")
|
|
8409
|
+
});
|
|
8410
|
+
const inventoryMovementPageSchema = z.object({
|
|
8411
|
+
contents: z.array(inventoryMovementSchema),
|
|
8412
|
+
nextAfter: z.number().int().nullable().describe("다음 쪽의 `after` 값. 더 없으면 null(새 변동을 기다릴 때는 마지막 `seq`를 그대로 쓴다)")
|
|
8413
|
+
});
|
|
8414
|
+
/** 한 요청의 줄 상한 — 30초 타임아웃·바인드 한도 */
|
|
8415
|
+
const MAX_INVENTORY_OPERATION_LINES = 200;
|
|
8416
|
+
const inventoryAdjustmentLineSchema = z.strictObject({
|
|
8417
|
+
variantId: z.string().min(1),
|
|
8418
|
+
inventoryLocationId: z.string().min(1).optional().describe("생략하면 기본 위치"),
|
|
8419
|
+
delta: z.number().int().refine((value) => value !== 0, { message: "delta는 0이 아니어야 합니다" }).optional().describe("가용 재고 증감. 감소는 가용 재고를 넘지 않는다"),
|
|
8420
|
+
counted: z.number().int().min(0).optional().describe("실사 — 센 실물 수량. 실재고가 이 값이 되도록 가용 재고를 맞춘다(센 값 − 출고 대기)")
|
|
8421
|
+
}).refine((line) => line.delta === void 0 !== (line.counted === void 0), { message: "줄마다 delta와 counted 중 하나만 줍니다" });
|
|
8422
|
+
const inventoryAdjustmentRequestSchema = z.strictObject({
|
|
8423
|
+
lines: z.array(inventoryAdjustmentLineSchema).min(1).max(200),
|
|
8424
|
+
reason: inventoryAdjustmentReasonSchema.optional().describe("증감 줄(`delta`)의 사유. 실사 줄은 늘 `COUNT`다. 증감 줄이 있으면 필수"),
|
|
8425
|
+
note: z.string().trim().max(500).optional(),
|
|
8426
|
+
reference: z.string().trim().max(100).optional().describe("외부 참조(입고서 번호 등)")
|
|
8427
|
+
});
|
|
8428
|
+
const inventoryTransferRequestSchema = z.strictObject({
|
|
8429
|
+
fromInventoryLocationId: z.string().min(1),
|
|
8430
|
+
toInventoryLocationId: z.string().min(1),
|
|
8431
|
+
lines: z.array(z.strictObject({
|
|
8432
|
+
variantId: z.string().min(1),
|
|
8433
|
+
quantity: z.number().int().min(1)
|
|
8434
|
+
})).min(1).max(200),
|
|
8435
|
+
note: z.string().trim().max(500).optional()
|
|
8436
|
+
});
|
|
8437
|
+
const inventoryOperationResultSchema = z.object({
|
|
8438
|
+
operationId: z.string(),
|
|
8439
|
+
kind: z.enum(["ADJUSTMENT", "TRANSFER"]),
|
|
8440
|
+
lines: z.array(z.object({
|
|
8441
|
+
variantId: z.string(),
|
|
8442
|
+
inventoryLocationId: z.string(),
|
|
8443
|
+
delta: z.number().int().describe("적용한 가용 재고 변화량(실사는 맞춘 차이, 같으면 0)"),
|
|
8444
|
+
available: z.number().int().describe("적용 뒤 가용 재고")
|
|
8445
|
+
})),
|
|
8446
|
+
createdAt: z.string()
|
|
8447
|
+
});
|
|
8448
|
+
/** 수거 완료의 재입고 지정(Q3) — 생략하면 조합은 할당 순서(교환 → 판매), 위치는 반품지에 연결된 위치 → 할당 위치다 */
|
|
8449
|
+
const claimCollectCompleteRequestSchema = z.object({ restock: z.object({
|
|
8450
|
+
optionId: z.string().min(1).optional().describe("돌아온 조합 — 그 주문상품의 할당 조합이어야 한다(아니면 400 `INVALID_RESTOCK_OPTION`)"),
|
|
8451
|
+
inventoryLocationId: z.string().min(1).optional().describe("재입고할 재고 위치")
|
|
8452
|
+
}).optional() });
|
|
8453
|
+
const claimRedeliveryRequestSchema = z.object({
|
|
8454
|
+
carrierCode: z.string().min(1),
|
|
8455
|
+
trackingNumber: z.string().min(1),
|
|
8456
|
+
inventoryLocationId: z.string().min(1).optional().describe("교환품을 보낼 재고 위치. 생략하면 그 상품의 기준 위치")
|
|
8457
|
+
});
|
|
8458
|
+
//#endregion
|
|
7913
8459
|
//#region src/schemas/login.ts
|
|
7914
8460
|
/** 소셜 로그인 공급자 */
|
|
7915
8461
|
const loginProviderSchema = z.enum([
|
|
@@ -7957,6 +8503,45 @@ const loginProviderTestSchema = z.object({
|
|
|
7957
8503
|
testedAt: z.string()
|
|
7958
8504
|
});
|
|
7959
8505
|
//#endregion
|
|
8506
|
+
//#region src/schemas/market.ts
|
|
8507
|
+
/**
|
|
8508
|
+
* 판매 권역 (이슈 #130) — 상점이 어느 국가에 어느 통화로 파는지를 정한다.
|
|
8509
|
+
*
|
|
8510
|
+
* 권역 = 이름 + 통화 하나 + 국가 목록 + 연결 도메인 + 쿠폰·적립금 사용. 국가는 상점 안에서 한 권역에만 속하고, 판매 국가는 보관하지 않은 모든 권역 국가의
|
|
8511
|
+
* 합집합이다. 기본 권역은 상점마다 하나이고 그 통화가 기본 통화(KRW)다. 기본 권역은 보관할 수 없고 국가 목록을 비울 수 없다. 권역의 통화는 만들 때만 정한다.
|
|
8512
|
+
*
|
|
8513
|
+
* 스토어프론트는 요청마다 도메인(`X-Storefront-Host`) → 구매자 국가(`X-Buyer-Country`) → 기본 권역 순으로 권역을 고르고, 주문서가 그 권역·통화를 굳힌다.
|
|
8514
|
+
* 외화 권역은 적립금을 켤 수 없다(적립금은 기본 통화 단위다).
|
|
8515
|
+
*/
|
|
8516
|
+
const countryCodeSchema = z.string().regex(/^[A-Za-z]{2}$/, "국가는 ISO 3166-1 alpha-2 두 글자입니다").transform((value) => value.toUpperCase()).describe("국가(ISO 3166-1 alpha-2, 예: KR·US·JP)");
|
|
8517
|
+
const hostnameSchema = z.string().min(1).max(253).regex(/^[A-Za-z0-9.-]+$/, "도메인은 호스트 이름만 입력합니다(예: shop.example.com)").transform((value) => value.toLowerCase().replace(/\.$/, "")).describe("연결 도메인(호스트 이름). 셀러가 직접 호스팅하는 스토어프론트가 `X-Storefront-Host`로 보낸다");
|
|
8518
|
+
const marketSchema = z.object({
|
|
8519
|
+
marketId: z.string(),
|
|
8520
|
+
name: z.string(),
|
|
8521
|
+
currency: currencyCodeSchema,
|
|
8522
|
+
isDefault: z.boolean().describe("기본 권역. 상점마다 하나이고 보관할 수 없다. 이 통화가 기본 통화다"),
|
|
8523
|
+
countries: z.array(z.string()).describe("이 권역 국가. 국가는 상점 안에서 한 권역에만 속한다"),
|
|
8524
|
+
domains: z.array(z.string()).describe("이 권역에 연결한 도메인"),
|
|
8525
|
+
couponsEnabled: z.boolean().describe("이 권역 주문서에서 쿠폰을 쓸 수 있는가"),
|
|
8526
|
+
pointsEnabled: z.boolean().describe("이 권역 주문서에서 적립금을 쓸 수 있는가. 외화 권역은 늘 false다"),
|
|
8527
|
+
archivedAt: z.string().nullable().describe("보관 시각. 보관한 권역은 판정에서 빠지고 그 국가·도메인은 풀린다")
|
|
8528
|
+
});
|
|
8529
|
+
const createMarketRequestSchema = z.strictObject({
|
|
8530
|
+
name: z.string().trim().min(1).max(50),
|
|
8531
|
+
currency: currencyCodeSchema.describe("이 권역의 통화. 만든 뒤에는 바꿀 수 없다"),
|
|
8532
|
+
countries: z.array(countryCodeSchema).min(1).max(250),
|
|
8533
|
+
domains: z.array(hostnameSchema).max(20).optional(),
|
|
8534
|
+
couponsEnabled: z.boolean().optional().describe("기본 false"),
|
|
8535
|
+
pointsEnabled: z.boolean().optional().describe("기본 false. 외화 권역은 true로 둘 수 없다")
|
|
8536
|
+
});
|
|
8537
|
+
const updateMarketRequestSchema = z.strictObject({
|
|
8538
|
+
name: z.string().trim().min(1).max(50).optional(),
|
|
8539
|
+
countries: z.array(countryCodeSchema).max(250).optional().describe("주면 국가 목록 전체를 바꾼다. 다른 권역의 국가는 그 권역에서 먼저 빼야 한다"),
|
|
8540
|
+
domains: z.array(hostnameSchema).max(20).optional().describe("주면 도메인 목록 전체를 바꾼다"),
|
|
8541
|
+
couponsEnabled: z.boolean().optional(),
|
|
8542
|
+
pointsEnabled: z.boolean().optional().describe("외화 권역은 true로 둘 수 없다")
|
|
8543
|
+
});
|
|
8544
|
+
//#endregion
|
|
7960
8545
|
//#region src/schemas/payment.ts
|
|
7961
8546
|
/**
|
|
7962
8547
|
* 상점 결제(PG) 설정과 매출 리포트 계약.
|
|
@@ -7969,15 +8554,23 @@ const pgProviderSchema = z.enum([
|
|
|
7969
8554
|
"tosspayments",
|
|
7970
8555
|
"portone",
|
|
7971
8556
|
"kakaopay",
|
|
7972
|
-
"naverpay"
|
|
7973
|
-
|
|
8557
|
+
"naverpay",
|
|
8558
|
+
"paypal"
|
|
8559
|
+
]).describe("PG 식별자. `tosspayments`=토스페이먼츠, `portone`=포트원(V2), `kakaopay`=카카오페이(직접 연동), `naverpay`=네이버페이 결제형(직접 연동), `paypal`=PayPal(직접 연동, 외화)");
|
|
8560
|
+
/**
|
|
8561
|
+
* 응답에 실리는 PG — 서버가 PG를 추가해도 응답 파싱이 깨지지 않게 문자열로 받는다(`easyPayProviderResponseSchema`와 같은 방식, 이슈 #131 CD2).
|
|
8562
|
+
* 요청(우선순위·리포트 필터·경로)은 값을 골라 보내는 자리라 `pgProviderSchema` enum 그대로다. 현재 값은 `pgProviderSchema`의 값이고
|
|
8563
|
+
* 화면은 모르는 값을 원문 그대로 보여 준다
|
|
8564
|
+
*/
|
|
8565
|
+
const pgProviderResponseSchema = z.string().describe("PG 식별자(`pgProviderSchema`의 값). 모르는 값이 와도 응답 파싱이 깨지지 않는다");
|
|
7974
8566
|
/**
|
|
7975
8567
|
* 간편결제 전용 PG — 결제수단이 간편결제 하나이고 간편결제사가 PG 자신이다(`kakaopay` → `KAKAOPAY`).
|
|
7976
8568
|
* 이 PG는 `easyPayProviders` 설정 없이 결제 옵션이 하나(`EASY_PAY` + 그 간편결제사) 나온다
|
|
7977
8569
|
*/
|
|
7978
8570
|
const DEDICATED_EASY_PAY_PROVIDER = {
|
|
7979
8571
|
kakaopay: "KAKAOPAY",
|
|
7980
|
-
naverpay: "NAVERPAY"
|
|
8572
|
+
naverpay: "NAVERPAY",
|
|
8573
|
+
paypal: "PAYPAL"
|
|
7981
8574
|
};
|
|
7982
8575
|
const pgPaymentMethodSchema = z.enum([
|
|
7983
8576
|
"CARD",
|
|
@@ -7994,7 +8587,8 @@ const easyPayProviderSchema = z.enum([
|
|
|
7994
8587
|
"NAVERPAY",
|
|
7995
8588
|
"KAKAOPAY",
|
|
7996
8589
|
"TOSSPAY",
|
|
7997
|
-
"PAYCO"
|
|
8590
|
+
"PAYCO",
|
|
8591
|
+
"PAYPAL"
|
|
7998
8592
|
]);
|
|
7999
8593
|
/**
|
|
8000
8594
|
* 응답에 실리는 간편결제사 — 서버가 간편결제사를 추가해도 파싱이 깨지지 않게 문자열로 받는다
|
|
@@ -8060,6 +8654,30 @@ const naverPayCredentialsInputSchema = z.object({
|
|
|
8060
8654
|
chainId: z.string().trim().min(4).max(100).describe("네이버페이 Chain ID. 공개 값 — 결제창과 API 요청에 쓰인다"),
|
|
8061
8655
|
clientSecret: secretInput().optional().describe("Client Secret. 비밀 값. 최초 연결 시 필수, 수정 시 생략하면 기존 값을 유지한다")
|
|
8062
8656
|
});
|
|
8657
|
+
/**
|
|
8658
|
+
* PayPal이 받는 통화 중 sayren이 여는 것(이슈 #131 설계 §3b) — PayPal 통화 코드(https://developer.paypal.com/api/rest/reference/currency-codes/) ∩ 통화표
|
|
8659
|
+
* − 원화(PayPal이 받지 않는다) − CNY·MYR(현지 계정 전용) − TWD(부분 환불 소수 문제, 설계 Q4)
|
|
8660
|
+
*/
|
|
8661
|
+
const PAYPAL_CURRENCIES = [
|
|
8662
|
+
"USD",
|
|
8663
|
+
"EUR",
|
|
8664
|
+
"JPY",
|
|
8665
|
+
"GBP",
|
|
8666
|
+
"HKD",
|
|
8667
|
+
"SGD",
|
|
8668
|
+
"AUD",
|
|
8669
|
+
"CAD",
|
|
8670
|
+
"THB",
|
|
8671
|
+
"PHP",
|
|
8672
|
+
"NZD",
|
|
8673
|
+
"CHF"
|
|
8674
|
+
];
|
|
8675
|
+
const payPalCredentialsInputSchema = z.object({
|
|
8676
|
+
clientId: z.string().trim().min(10).max(200).describe("PayPal REST 앱의 Client ID(테스트 세트는 샌드박스 앱). 공개 값"),
|
|
8677
|
+
currencies: z.array(z.enum(PAYPAL_CURRENCIES)).min(1).max(PAYPAL_CURRENCIES.length).describe("받는 통화 — PayPal 계정에 열어 둔 통화를 고른다. 결제 세션 통화가 여기 있는 주문서에만 PayPal 옵션이 나온다(원화는 받지 않는다)"),
|
|
8678
|
+
webhookId: z.string().trim().min(1).max(100).nullable().optional().describe("PayPal 앱에 등록한 웹훅의 ID(선택). 주면 서버 통지의 서명을 검증해 결제 확인을 앞당긴다. 생략·null이면 통지를 받지 않고 주기 확인만 한다"),
|
|
8679
|
+
clientSecret: secretInput().optional().describe("Secret. 비밀 값. 최초 연결 시 필수, 수정 시 생략하면 기존 값을 유지한다")
|
|
8680
|
+
});
|
|
8063
8681
|
const upsertEnvironment = () => pgEnvironmentSchema.describe("저장할 자격 증명 세트. PG마다 `TEST`(샌드박스)·`LIVE`(실결제) 세트를 따로 둔다. 어느 세트로 결제할지는 이 값이 아니라 샌드박스 스위치(`sandboxMode`)가 정한다");
|
|
8064
8682
|
const upsertTossPaymentsProviderRequestSchema = z.object({
|
|
8065
8683
|
environment: upsertEnvironment(),
|
|
@@ -8077,6 +8695,10 @@ const upsertNaverPayProviderRequestSchema = z.object({
|
|
|
8077
8695
|
environment: upsertEnvironment(),
|
|
8078
8696
|
credentials: naverPayCredentialsInputSchema
|
|
8079
8697
|
});
|
|
8698
|
+
const upsertPayPalProviderRequestSchema = z.object({
|
|
8699
|
+
environment: upsertEnvironment(),
|
|
8700
|
+
credentials: payPalCredentialsInputSchema
|
|
8701
|
+
});
|
|
8080
8702
|
const updatePaymentProviderRequestSchema = z.object({
|
|
8081
8703
|
enabled: z.boolean().optional().describe("사용 여부. 켜려면 활성 환경(샌드박스면 TEST, 아니면 LIVE) 자격 증명이 모두 저장돼 있어야 한다(`PAYMENT_PROVIDER_INCOMPLETE`)"),
|
|
8082
8704
|
sandboxMode: z.boolean().optional().describe("샌드박스 스위치. `true`면 새 결제에 TEST 세트를 쓴다(항상 허용). `false`(라이브 전환)는 라이브 개방 조건을 모두 충족해야 한다(`LIVE_GATE_NOT_MET`)"),
|
|
@@ -8102,6 +8724,11 @@ const publicConfigSchema = z.union([
|
|
|
8102
8724
|
z.object({
|
|
8103
8725
|
clientId: z.string(),
|
|
8104
8726
|
chainId: z.string()
|
|
8727
|
+
}),
|
|
8728
|
+
z.object({
|
|
8729
|
+
clientId: z.string(),
|
|
8730
|
+
currencies: z.array(z.string()),
|
|
8731
|
+
webhookId: z.string().nullable()
|
|
8105
8732
|
})
|
|
8106
8733
|
]);
|
|
8107
8734
|
const verificationSchema = z.object({
|
|
@@ -8111,7 +8738,7 @@ const verificationSchema = z.object({
|
|
|
8111
8738
|
});
|
|
8112
8739
|
const paymentCredentialSetSchema = z.object({
|
|
8113
8740
|
environment: pgEnvironmentSchema,
|
|
8114
|
-
publicConfig: publicConfigSchema.describe("공개 값. 토스페이먼츠는 `{clientKey}`, 포트원은 `{storeId, channels}`, 카카오페이는 `{cid}`, 네이버페이는 `{clientId, chainId}`"),
|
|
8741
|
+
publicConfig: publicConfigSchema.describe("공개 값. 토스페이먼츠는 `{clientKey}`, 포트원은 `{storeId, channels}`, 카카오페이는 `{cid}`, 네이버페이는 `{clientId, chainId}`, PayPal은 `{clientId, currencies, webhookId}`"),
|
|
8115
8742
|
secrets: z.array(maskedSecretSchema).describe("비밀 값의 저장 여부와 마스킹. 평문은 어떤 응답에도 나오지 않는다"),
|
|
8116
8743
|
lastVerification: verificationSchema.nullable().describe("이 세트의 마지막 연결 테스트 결과. 세트를 바꾸면 초기화된다"),
|
|
8117
8744
|
updatedAt: z.string()
|
|
@@ -8141,7 +8768,7 @@ const liveGateSchema = z.object({
|
|
|
8141
8768
|
*/
|
|
8142
8769
|
const liveGateErrorDetailsSchema = z.object({ conditions: z.array(liveGateConditionSchema).describe("라이브 개방 조건별 충족 여부 (순서 고정)") });
|
|
8143
8770
|
const paymentProviderSchema = z.object({
|
|
8144
|
-
provider:
|
|
8771
|
+
provider: pgProviderResponseSchema,
|
|
8145
8772
|
displayName: z.string().describe("표시 이름 (토스페이먼츠·포트원)"),
|
|
8146
8773
|
connected: z.boolean().describe("자격 증명이 저장돼 있는가"),
|
|
8147
8774
|
enabled: z.boolean().describe("결제에 사용 중인가"),
|
|
@@ -8191,14 +8818,14 @@ const paymentFailureWarningSchema = z.object({
|
|
|
8191
8818
|
});
|
|
8192
8819
|
const paymentSettingsSchema = z.object({
|
|
8193
8820
|
checkoutOrigins: z.array(z.string()).describe("결제 도메인 — 결제를 마친 구매자가 돌아올 스토어프론트 origin 목록"),
|
|
8194
|
-
providers: z.array(paymentProviderSchema).describe("연결된 PG(우선순위순)와 연결되지 않은 토스페이먼츠·포트원.
|
|
8821
|
+
providers: z.array(paymentProviderSchema).describe("연결된 PG(우선순위순)와 연결되지 않은 토스페이먼츠·포트원. 그 밖의 PG(카카오페이·네이버페이 등)는 연결했을 때만 여기에 온다(이 PG를 모르는 이전 SDK가 응답을 읽을 수 있게). 연결할 수 있는 PG 전체는 `connectableProviders`다"),
|
|
8195
8822
|
connectableProviders: z.array(paymentProviderSchema).optional().default(() => []).describe("연결되지 않은 PG 전체(카카오페이·네이버페이 포함). 서버는 항상 싣는다. 이 필드가 없는 이전 서버 응답은 기본값(빈 배열)으로 읽는다"),
|
|
8196
8823
|
environment: pgEnvironmentSchema.nullable().optional().default(null).describe("지금 결제를 시작하면 쓰는 결제 환경. 사용 가능한 PG 중 하나라도 라이브면 `LIVE`(샌드박스 PG는 제외), 아니면 `TEST`. 사용 가능한 PG가 없으면 null. 서버는 항상 싣는다. 이 필드가 없는 이전 서버 응답은 기본값(null)으로 읽는다"),
|
|
8197
8824
|
candidates: z.array(z.string()).optional().default(() => []).describe("지금 결제를 시작하면 쓰는 PG, 우선순위순(`tosspayments`·`portone`). 비어 있으면 구매자가 결제할 수 없다. 빠진 PG의 사유는 `providers[].routingExclusion` — 후보가 아닌 PG에는 항상 사유 코드를 붙인다. 서버는 항상 싣는다. 이 필드가 없는 이전 서버 응답은 기본값(빈 배열)으로 읽는다"),
|
|
8198
8825
|
warnings: z.array(paymentFailureWarningSchema).optional().default(() => []).describe("최근 24시간 안에 같은 PG·결제수단·간편결제사가 가맹점 설정 문제로 3번 이상 실패한 조합, 마지막 실패가 최근인 순. 판정 규칙은 서버가 정하고 바뀔 수 있다. 서버는 항상 싣는다. 이 필드가 없는 이전 서버 응답은 기본값(빈 배열)으로 읽는다")
|
|
8199
8826
|
});
|
|
8200
8827
|
const paymentProviderVerificationSchema = z.object({
|
|
8201
|
-
provider:
|
|
8828
|
+
provider: pgProviderResponseSchema,
|
|
8202
8829
|
environment: pgEnvironmentSchema.describe("연결 테스트한 자격 증명 세트"),
|
|
8203
8830
|
result: pgVerificationResultSchema,
|
|
8204
8831
|
message: z.string().nullable().describe("실패 사유 또는 참고 메시지"),
|
|
@@ -8229,20 +8856,27 @@ const salesTotalsSchema = z.object({
|
|
|
8229
8856
|
});
|
|
8230
8857
|
const salesReportRowSchema = salesTotalsSchema.extend({
|
|
8231
8858
|
date: z.string().nullable().describe("일자 (YYYY-MM-DD, Asia/Seoul). groupBy=DAY일 때만 값"),
|
|
8232
|
-
provider:
|
|
8859
|
+
provider: pgProviderResponseSchema.nullable().describe("PG. groupBy에 PROVIDER가 포함될 때만 값"),
|
|
8233
8860
|
method: pgPaymentMethodSchema.nullable().describe("실제 결제수단(PG가 보고한 수단, 모르면 요청 수단). groupBy에 METHOD가 포함될 때만 값. 관리 주문 API의 method는 호환용이며 간편결제를 CARD로 표시한다. 실제 수단은 approvedMethod를 본다")
|
|
8234
8861
|
});
|
|
8862
|
+
/** 통화별 매출(이슈 #130) — 환산하지 않는다. 금액은 그 통화의 최소 단위다 */
|
|
8863
|
+
const salesReportCurrencySchema = z.object({
|
|
8864
|
+
currency: z.string().describe("결제 통화(ISO 4217)"),
|
|
8865
|
+
summary: salesTotalsSchema.describe("이 통화의 기간 전체 합계"),
|
|
8866
|
+
rows: z.array(salesReportRowSchema).describe("이 통화의 집계 행(`groupBy` 기준)")
|
|
8867
|
+
});
|
|
8235
8868
|
const salesReportSchema = z.object({
|
|
8236
8869
|
from: z.string(),
|
|
8237
8870
|
to: z.string(),
|
|
8238
8871
|
timezone: z.literal("Asia/Seoul"),
|
|
8239
|
-
currency: z.literal("KRW"),
|
|
8872
|
+
currency: z.literal("KRW").describe("`summary`·`rows`의 통화. 기본 통화(원화) 결제만 집계한다. 외화 결제는 `byCurrency`에 있다"),
|
|
8240
8873
|
groupBy: salesReportGroupBySchema,
|
|
8241
|
-
provider:
|
|
8874
|
+
provider: pgProviderResponseSchema.nullable().describe("적용된 PG 필터"),
|
|
8242
8875
|
method: pgPaymentMethodSchema.nullable().describe("적용된 결제수단 필터"),
|
|
8243
8876
|
includeTest: z.boolean().describe("테스트 결제(샌드박스 결제)를 집계에 포함했는가"),
|
|
8244
8877
|
summary: salesTotalsSchema.describe("기간 전체 합계"),
|
|
8245
|
-
rows: z.array(salesReportRowSchema).describe("집계 행. 활동이 없는 날짜·PG는 생략된다")
|
|
8878
|
+
rows: z.array(salesReportRowSchema).describe("집계 행. 활동이 없는 날짜·PG는 생략된다"),
|
|
8879
|
+
byCurrency: z.array(salesReportCurrencySchema).optional().default([]).describe("통화별 매출(이슈 #130) — 활동이 있는 통화마다 한 항목이고 기본 통화(KRW)도 포함한다. 통화 사이는 환산하지 않는다. 옛 서버 응답은 빈 목록")
|
|
8246
8880
|
});
|
|
8247
8881
|
/**
|
|
8248
8882
|
* 결제 내역 — 결제 건(세션) 단위 공개 상태. 주문 단위 상태와 다르다.
|
|
@@ -8284,7 +8918,7 @@ const cashReceiptSchema = z.object({
|
|
|
8284
8918
|
identityNumberMasked: z.string().describe("가린 식별 번호 (예: 010****5678). 원문은 조회할 수 없다"),
|
|
8285
8919
|
amount: z.number().int().describe("발급해야 할 금액 = 결제 금액 − 환불 완료 금액. 승인 전에는 결제 금액"),
|
|
8286
8920
|
issuedAmount: z.number().int().describe("PG에 현재 발급돼 있는 금액. 취소됐거나 발급 전이면 0"),
|
|
8287
|
-
provider:
|
|
8921
|
+
provider: pgProviderResponseSchema.nullable().describe("발급 PG — 결제를 승인한 PG. 승인 전에는 null"),
|
|
8288
8922
|
issueNumber: z.string().nullable().describe("현금영수증 승인 번호"),
|
|
8289
8923
|
receiptUrl: z.string().nullable().describe("현금영수증 확인 주소"),
|
|
8290
8924
|
issuedAt: z.string().nullable().describe("최근 발급 시각 (ISO 8601)"),
|
|
@@ -8304,7 +8938,7 @@ const paymentRecordSchema = z.object({
|
|
|
8304
8938
|
amount: z.number().int().describe("결제 금액"),
|
|
8305
8939
|
refundedAmount: z.number().int().describe("환불 완료 금액 합계. 실패한 환불은 빼고 센다"),
|
|
8306
8940
|
heldRefundAmount: z.number().int().optional().default(0).describe("환불 대기 금액 합계(#115) — 주문만 취소하고 아직 환불하지 않은 몫. 결제 상세에서 환불 처리한다"),
|
|
8307
|
-
provider:
|
|
8941
|
+
provider: pgProviderResponseSchema.nullable().describe("승인한 PG. 승인 전에 끝났으면 마지막 시도의 PG"),
|
|
8308
8942
|
method: pgPaymentMethodSchema.nullable().describe("실제 결제수단. 모르면 요청 수단"),
|
|
8309
8943
|
easyPayProvider: easyPayProviderResponseSchema.nullable().optional().default(null).describe("간편결제사. `method`가 `EASY_PAY`일 때만 값이 있고, PG가 알려 주지 않았으면 요청한 간편결제사다. 그 밖의 결제수단과 간편결제 이전 결제는 null. 서버는 항상 싣는다. 현재 값은 `NAVERPAY`·`KAKAOPAY`·`TOSSPAY`·`PAYCO`이고 값이 추가될 수 있어 문자열로 받는다"),
|
|
8310
8944
|
environment: pgEnvironmentSchema.nullable().describe("결제 환경"),
|
|
@@ -8324,7 +8958,7 @@ const paymentAttemptRecordSchema = z.object({
|
|
|
8324
8958
|
attemptId: z.string(),
|
|
8325
8959
|
pgOrderId: z.string().nullable().optional().default(null).describe("PG에 보낸 주문번호(이슈 #107) — 토스페이먼츠 orderId·포트원 paymentId. 새 시도는 `{주문번호}-{시도 순번 2자리}`이고, 번호 체계 이전 시도는 시도 id(`attemptId`)와 같습니다. PG 관리자 화면에서 결제를 찾을 때 씁니다"),
|
|
8326
8960
|
sequence: z.number().int().describe("결제 건 안에서의 순번 (1부터)"),
|
|
8327
|
-
provider:
|
|
8961
|
+
provider: pgProviderResponseSchema,
|
|
8328
8962
|
status: paymentAttemptStatusSchema,
|
|
8329
8963
|
method: pgPaymentMethodSchema.describe("주문서에서 고른 결제수단"),
|
|
8330
8964
|
easyPayProvider: easyPayProviderResponseSchema.nullable().optional().default(null).describe("주문서에서 고른 간편결제사. 간편결제가 아니면 null. 서버는 항상 싣는다(값이 추가될 수 있어 문자열)"),
|
|
@@ -8373,7 +9007,7 @@ const paymentListQuerySchema = z.object({
|
|
|
8373
9007
|
const setPlatformTestKeysRequestSchema = z.object({ enabled: z.boolean().describe("`true`면 sayren 지정 테스트 키를 TEST 세트로 저장하고 PG를 켠다. `false`면 고정만 푼다(TEST 세트는 그대로)") });
|
|
8374
9008
|
/** 결제 상태 PG 한 줄 — 비밀 값·공개 키 없이 연결·사용·환경·테스트모드 키만 */
|
|
8375
9009
|
const paymentStatusProviderSchema = z.object({
|
|
8376
|
-
provider:
|
|
9010
|
+
provider: pgProviderResponseSchema,
|
|
8377
9011
|
displayName: z.string(),
|
|
8378
9012
|
connected: z.boolean().describe("자격 증명이 저장돼 있는가"),
|
|
8379
9013
|
enabled: z.boolean().describe("결제에 사용 중인가"),
|
|
@@ -8397,12 +9031,16 @@ const orderSummarySchema = z.object({
|
|
|
8397
9031
|
representativeStatus: orderItemStatusSchema,
|
|
8398
9032
|
progressStatus: orderItemStatusSchema.optional().describe("진행 중 주문상품 가운데 가장 앞 단계(취소 제외, 모두 취소면 CANCELED, #115). 섞인 주문에서 아직 기다리는 단계다. 서버는 항상 싣는다"),
|
|
8399
9033
|
orderedAt: z.string(),
|
|
9034
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 금액 필드는 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 없으면 KRW다. 서버는 항상 싣는다"),
|
|
8400
9035
|
testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오")
|
|
8401
9036
|
});
|
|
8402
9037
|
const shippingAddressSchema = z.object({
|
|
8403
9038
|
receiverName: z.string(),
|
|
8404
9039
|
phone: z.string(),
|
|
8405
|
-
zipCode: z.string(),
|
|
9040
|
+
zipCode: z.string().describe("우편번호. 해외 배송지는 그 나라 우편번호이고 없으면 빈 문자열이다"),
|
|
9041
|
+
countryCode: z.string().optional().describe("배송 국가(이슈 #130). 없으면 국내(KR)다"),
|
|
9042
|
+
region: z.string().nullish().describe("해외 배송지의 1차 행정 구역"),
|
|
9043
|
+
city: z.string().nullish().describe("해외 배송지의 도시. 국내 배송지는 없다"),
|
|
8406
9044
|
address1: z.string(),
|
|
8407
9045
|
address2: z.string().nullish(),
|
|
8408
9046
|
deliveryMemo: z.string().nullish(),
|
|
@@ -8496,6 +9134,7 @@ const orderSchema = z.object({
|
|
|
8496
9134
|
paidAt: z.string().nullable(),
|
|
8497
9135
|
cashReceipt: cashReceiptSchema.nullable().optional().default(null).describe("현금영수증. 구매자가 계좌이체·가상계좌 결제에서 신청했을 때만 있고 그 밖에는 null. 서버는 항상 싣는다")
|
|
8498
9136
|
}),
|
|
9137
|
+
currency: z.string().optional().describe("주문 통화(ISO 4217, 이슈 #130). 금액 필드는 모두 이 통화의 최소 단위다. 외화 주문이 생기면 이 값을 확인한다. 없으면 KRW다. 서버는 항상 싣는다"),
|
|
8499
9138
|
testPayment: z.boolean().describe("테스트 결제(샌드박스 결제) 주문인가. true면 실제로 돈이 오가지 않았습니다. 상품을 발송하지 않도록 주의하십시오"),
|
|
8500
9139
|
items: z.array(orderItemSchema)
|
|
8501
9140
|
});
|
|
@@ -9411,10 +10050,13 @@ function createStoreClient(options) {
|
|
|
9411
10050
|
}),
|
|
9412
10051
|
reject: (claimId, body) => storeHttp.requestVoid("POST", path`/claims/${claimId}/reject`, { body: rejectClaimRequestSchema.parse(body) }),
|
|
9413
10052
|
registerCollect: (claimId, body) => storeHttp.requestVoid("POST", path`/claims/${claimId}/collect`, { body }),
|
|
9414
|
-
|
|
9415
|
-
|
|
10053
|
+
/** 수거 완료 — `restock`(이슈 #132)으로 돌아온 조합·재입고 위치를 지정한다. 생략하면 할당 순서·반품지 위치다 */
|
|
10054
|
+
completeCollect: (claimId, body) => storeHttp.requestVoid("POST", path`/claims/${claimId}/collect/complete`, { ...body ? { body: claimCollectCompleteRequestSchema.parse(body) } : {} }),
|
|
10055
|
+
/** 교환 재배송 — `inventoryLocationId`(이슈 #132)로 교환품을 보낼 위치를 지정한다. 생략하면 그 상품의 기준 위치다 */
|
|
10056
|
+
registerRedelivery: (claimId, carrierCode, trackingNumber, options = {}) => storeHttp.requestVoid("POST", path`/claims/${claimId}/redelivery`, { body: {
|
|
9416
10057
|
carrierCode,
|
|
9417
|
-
trackingNumber
|
|
10058
|
+
trackingNumber,
|
|
10059
|
+
...options.inventoryLocationId ? { inventoryLocationId: options.inventoryLocationId } : {}
|
|
9418
10060
|
} }),
|
|
9419
10061
|
hold: (claimId, reason) => storeHttp.request("POST", path`/claims/${claimId}/hold`, claimHoldResultSchema, { body: { reason } }),
|
|
9420
10062
|
releaseHold: (claimId) => storeHttp.requestVoid("DELETE", path`/claims/${claimId}/hold`),
|
|
@@ -9597,6 +10239,11 @@ get: (params) => storeHttp.request("GET", "/sales-report", salesReportSchema, {
|
|
|
9597
10239
|
*/
|
|
9598
10240
|
upsertNaverPay: (body) => storeHttp.request("PUT", "/store/payment-providers/naverpay", paymentProviderSchema, { body: upsertNaverPayProviderRequestSchema.parse(body) }),
|
|
9599
10241
|
/**
|
|
10242
|
+
* `PUT /v1/store/payment-providers/paypal` — PayPal(직접 연동) 자격 증명 세트 저장. 규칙·에러는 `upsertTossPayments`와 같다
|
|
10243
|
+
* (가맹점 식별자는 `clientId`, 비밀 필드는 `clientSecret`). 결제 옵션은 PayPal 간편결제 하나이고 `currencies`의 외화 주문서에만 나온다.
|
|
10244
|
+
*/
|
|
10245
|
+
upsertPayPal: (body) => storeHttp.request("PUT", "/store/payment-providers/paypal", paymentProviderSchema, { body: upsertPayPalProviderRequestSchema.parse(body) }),
|
|
10246
|
+
/**
|
|
9600
10247
|
* `PATCH /v1/store/payment-providers/{provider}` — 사용 여부(`enabled`)·샌드박스 스위치(`sandboxMode`) 변경.
|
|
9601
10248
|
* 하나 이상 보내야 한다(아니면 요청 전에 ZodError). 검증을 모두 통과해야 한 번에 적용된다(부분 적용 없음).
|
|
9602
10249
|
* 끈 PG로 승인된 결제의 환불은 계속 그 PG로 간다.
|
|
@@ -9771,6 +10418,38 @@ list: (params) => storeHttp.request("GET", "/audit-logs", auditLogPageSchema, {
|
|
|
9771
10418
|
setDefault: (addressId) => storeHttp.requestVoid("POST", path`/seller-addresses/${addressId}/default`)
|
|
9772
10419
|
},
|
|
9773
10420
|
/** 픽업 장소 (이슈 #115) — 방문 수령 주문의 수령 장소. 조회 `store:r`, 쓰기 `store:rw`(상점 플랫폼 OWNER·ADMIN) */
|
|
10421
|
+
/**
|
|
10422
|
+
* 위치별 재고 (이슈 #132) — 재고 위치·위치별 가용 재고·재고 조정·실사·이동·변동 내역. 위치 쓰기는 상점 설정 표면(상점 플랫폼 OWNER·ADMIN)이고
|
|
10423
|
+
* 조회는 `inventory:r`, 조정·이동은 `inventory:rw`다. 같은 `idempotencyKey`로 다시 보내면 첫 결과를 돌려준다(다른 본문이면 409)
|
|
10424
|
+
*/
|
|
10425
|
+
inventory: {
|
|
10426
|
+
locations: {
|
|
10427
|
+
list: () => storeHttp.request("GET", "/inventory-locations", z.array(inventoryLocationSchema)),
|
|
10428
|
+
create: (body) => storeHttp.request("POST", "/inventory-locations", inventoryLocationSchema, { body: inventoryLocationRequestSchema.parse(body) }),
|
|
10429
|
+
update: (inventoryLocationId, body) => storeHttp.request("PUT", path`/inventory-locations/${inventoryLocationId}`, inventoryLocationSchema, { body: inventoryLocationRequestSchema.parse(body) }),
|
|
10430
|
+
remove: (inventoryLocationId) => storeHttp.requestVoid("DELETE", path`/inventory-locations/${inventoryLocationId}`)
|
|
10431
|
+
},
|
|
10432
|
+
/** 커서 페이지네이션 — 다음 페이지는 응답의 `nextCursor`를 `cursor`로 넘긴다 */
|
|
10433
|
+
levels: (params) => storeHttp.request("GET", "/inventory/levels", inventoryLevelPageSchema, { query: params }),
|
|
10434
|
+
/** 순번 오름차순 — 다음 쪽은 `nextAfter`를 `after`로 넘긴다 */
|
|
10435
|
+
movements: (params) => storeHttp.request("GET", "/inventory/movements", inventoryMovementPageSchema, { query: params }),
|
|
10436
|
+
adjust: (body, idempotencyKey) => storeHttp.request("POST", "/inventory/adjustments", inventoryOperationResultSchema, {
|
|
10437
|
+
body: inventoryAdjustmentRequestSchema.parse(body),
|
|
10438
|
+
headers: idempotency(idempotencyKey)
|
|
10439
|
+
}),
|
|
10440
|
+
transfer: (body, idempotencyKey) => storeHttp.request("POST", "/inventory/transfers", inventoryOperationResultSchema, {
|
|
10441
|
+
body: inventoryTransferRequestSchema.parse(body),
|
|
10442
|
+
headers: idempotency(idempotencyKey)
|
|
10443
|
+
})
|
|
10444
|
+
},
|
|
10445
|
+
/** 판매 권역(이슈 #130) — 국가·통화·도메인. 쓰기는 다중 통화가 켜진 상점에서만 된다 */
|
|
10446
|
+
markets: {
|
|
10447
|
+
list: () => storeHttp.request("GET", "/markets", z.array(marketSchema)),
|
|
10448
|
+
get: (marketId) => storeHttp.request("GET", path`/markets/${marketId}`, marketSchema),
|
|
10449
|
+
create: (body) => storeHttp.request("POST", "/markets", marketSchema, { body: createMarketRequestSchema.parse(body) }),
|
|
10450
|
+
update: (marketId, body) => storeHttp.request("PATCH", path`/markets/${marketId}`, marketSchema, { body: updateMarketRequestSchema.parse(body) }),
|
|
10451
|
+
archive: (marketId) => storeHttp.requestVoid("DELETE", path`/markets/${marketId}`)
|
|
10452
|
+
},
|
|
9774
10453
|
pickupLocations: {
|
|
9775
10454
|
list: () => storeHttp.request("GET", "/pickup-locations", z.array(pickupLocationSchema)),
|
|
9776
10455
|
create: (body) => storeHttp.request("POST", "/pickup-locations", pickupLocationSchema, { body: pickupLocationRequestSchema.parse(body) }),
|
|
@@ -10300,4 +10979,4 @@ function createStoreSession(options) {
|
|
|
10300
10979
|
};
|
|
10301
10980
|
}
|
|
10302
10981
|
//#endregion
|
|
10303
|
-
export { AI_AGENT_NOTES_DIR, AI_AGENT_PHASES, AI_DESIGN_BOARDS_MAX, AI_DESIGN_BOARD_FILE_PATTERN, AI_DESIGN_BOARD_KINDS, AI_DESIGN_CANVAS_PATH, AI_DESIGN_CONFIRM_APPROVE, AI_DESIGN_DIR, AI_DESIGN_VIEWPORTS, AI_MESSAGE_MAX_ATTACHMENTS, AI_MESSAGE_MAX_CHARS, AI_RUN_ACTIVE_STATUSES, AI_RUN_FILE_CHANGES_RETENTION_DAYS, AI_SETUP_CONFIRM_APPROVE, AI_TODOS_MAX, AI_TODO_STATUSES, APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, APP_CAPABILITIES, APP_DEPLOY_KEY_PATTERN, APP_DEPLOY_KEY_PREFIX, APP_EVENTS_MAX, APP_EVENT_SCOPES, APP_EVENT_TYPES, APP_FLOW_EVENT_PATTERN, APP_FLOW_ITEMS_MAX, APP_FLOW_NOTIFICATION_PATTERN, APP_HANDLE_PATTERN, APP_HTTP_KEY_PATTERN, APP_ICON_CONTENT_TYPES, APP_ICON_MAX_BYTES, APP_ICON_MIN_PX, APP_LIFECYCLE_EVENT_TYPES, APP_NETWORK_DENIED_SUFFIXES, APP_NETWORK_HOSTS_MAX, APP_PUBLIC_HTTP_MAX, APP_README_MAX_BYTES, APP_RESERVED_HANDLES, APP_SCHEDULES_MAX, APP_SCHEDULE_INTERVALS, APP_SCHEDULE_NAME_PATTERN, APP_SECRETS_MAX, APP_SECRET_NAME_PATTERN, APP_SECRET_PATTERNS, APP_SERVER_BUNDLE_MAX_GZIP_BYTES, APP_SETTINGS_MAX_FIELDS, APP_SETTING_FIELD_TYPES, APP_SETTING_KEY_PATTERN, APP_STORAGE_KEY_PATTERN, APP_STORAGE_MAX_BYTES, APP_STORAGE_MAX_KEYS, APP_TOOL_NAME_PATTERN, APP_UI_MAX_BYTES, APP_UI_MAX_FILES, ApiError, ApprovalPendingError, BRAND_BRIEF_MAX_REFERENCES, 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, CUSTOM_INPUT_TYPES, DEDICATED_EASY_PAY_PROVIDER, FULFILLMENT_METHODS, FULFILLMENT_METHODS_BY_TYPE, FULFILLMENT_METHOD_RULES, FULFILLMENT_RULES, INSTALLABLE_SCOPES, KAKAOPAY_TEST_CID, KNOWN_WEBHOOK_EVENT_TYPES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CALENDAR_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_PICKUP_LOCATIONS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_STAY_NIGHTS, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NON_INSTALLABLE_SCOPES, 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, SCOPE_DESCRIPTIONS, SHIPPING_POLICY_DEFAULTS, STARTER_SELLER_TASKS, STARTER_STAGES, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CLOSED_SITE_HOLD_DAYS, 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_DRAFT_ATTACHMENT_MAX_BYTES, STORE_DRAFT_MAX_ATTACHMENTS, STORE_DRAFT_RETENTION_DAYS, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, STORE_SHOP_TYPES, TEMPLATE_STORE_LOCKED_BUSINESS_FIELDS, 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, aiActivitySchema, aiAgentPhaseSchema, aiAttachmentSchema, aiChoiceOptionSchema, aiConversationFileChangesSchema, aiConversationSchema, aiConversationSummarySchema, aiDesignBoardSchema, aiDesignCanvasSchema, aiDesignConfirmBoardSchema, aiDesignSelectionSchema, aiFileChangeKindSchema, aiFocusAreaSchema, aiFocusSchema, aiMessagePartSchema, aiMessageSchema, aiPreviewSelectionSchema, aiRunChangesSchema, aiRunChangesStatusSchema, aiRunFileDiffSchema, aiRunRevertConflictDetailsSchema, aiRunRevertResultSchema, aiRunSchema, aiRunStatusSchema, aiSetupConfirmItemSchema, aiStreamAccessSchema, aiStreamEventSchema, aiStreamRecordSchema, aiTodoSchema, aiToolChangeSchema, 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, appArtifactUploadSchema, appBuildSchema, appBuildStageSchema, appCapabilitiesOf, appDeployKeyCreateSchema, appDeployKeyCreatedSchema, appDeployKeySchema, appDevTokenSchema, appDistributionSchema, appEventTypeSchema, appFlowEventSchema, appFlowEventSummarySchema, appFlowNotificationSchema, appFlowNotificationSummarySchema, appFlowParamSchema, appFlowSummaryOf, appHandleSchema, appHttpKeyMatches, appIconProblem, appInstallRequestSchema, appInstallationActivitySchema, appInstallationAppSchema, appInstallationRunSchema, appInstallationSchema, appInstallationSelfSchema, appInstallationSettingsSchema, appInstallationSettingsUpdateSchema, appInstallationStatusSchema, appInvocationSchema, appListingReviewSchema, appListingReviewStatusSchema, appListingSchema, appManifestProblems, appManifestSchema, appManifestWidens, appNetworkHostProblem, appNetworkHostSchema, appReleaseResultSchema, appRuntimeSchema, appScheduleIntervalLabel, appScheduleListOf, appScheduleSummarySchema, appScopeSchema, appSecretSummarySchema, appSessionSchema, appSettingFieldSchema, appStatusSchema, appStorageEntrySchema, appStorageKeysSchema, appStorageListQuerySchema, appStoragePutSchema, appToolCallSchema, appToolInputSchema, appToolListOf, appToolResultSchema, appToolSchema, appToolSummarySchema, appVersionSchema, appVersionStatusSchema, appVisibilitySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, brandBriefProductSourceSchema, brandBriefReferenceSchema, brandBriefSchema, brandBriefViewSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, calendarDateSchema, calendarDaySchema, calendarQuerySchema, 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, commerceFlowCheckSchema, commerceFlowSchema, commerceFlowSummarySchema, commerceFlowVersionViewSchema, commerceNumberField, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createAiConversationRequestSchema, createAiConversationResponseSchema, createCommerceFlowRequestSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreDraftRequestSchema, createStoreDraftResponseSchema, 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, defaultFulfillmentMethodOf, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, describeScope, devStoreSchema, developerAppCreateSchema, developerAppSchema, developerInstallationSchema, developerOrgSchema, developerStoreSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowNodeTypesSchema, flowNotificationWebhookEventDataSchema, flowNotificationWebhookEventSchema, flowPresetDetailSchema, flowPresetSummarySchema, flowRunSchema, flowRunStepSchema, flowSecretNameSchema, flowSecretSchema, flowStateChangedWebhookEventDataSchema, flowStateChangedWebhookEventSchema, flowStateSchema, formatOrderNo, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentMethodOf, fulfillmentMethodSchema, fulfillmentMethodsOf, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, inventoryModeSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isAiAgentNotesPath, isAiDesignPath, isCouponTargetLine, isEditableStorefrontPath, isInstallableScope, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, kakaoPayCredentialsInputSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, migrateFlowVersionRequestSchema, migrateFlowVersionResultSchema, moveFlowStateRequestSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, naverPayCredentialsInputSchema, nightsOf, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFlowActionResultSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFlowSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, parseOrderNo, parseWebhookEvent, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, paymentStatusProviderSchema, paymentStatusSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, pickupLocationRequestSchema, pickupLocationSchema, pickupLocationSnapshotSchema, 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, putBrandBriefRequestSchema, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, replayFlowRequestSchema, replayFlowResultSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, resolvedFlowSchema, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveFlowDraftRequestSchema, saveFlowSecretRequestSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, scopesCoverEvent, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCancelPreviewSchema, sellerCustomerInquirySchema, sendAiMessageRequestSchema, sendAiMessageResponseSchema, setCalendarRequestSchema, setPlatformTestKeysRequestSchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, simulateFlowRequestSchema, simulateFlowResultSchema, simulationStepSchema, splitRefund, starterSellerTaskSchema, starterStageSchema, starterStatusSchema, starterStoreInfoFieldSchema, stayRangeSchema, staySnapshotSchema, storeAppDetailSchema, storeAppSchema, storeCodeSchema, storeDraftPreviewSchema, storeDraftSchema, storeIndustrySchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSetupBriefSchema, storeShopTypeSchema, storeSubscriptionSchema, storeTemplateSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDevLogsSchema, 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, storefrontSiteSnapshotSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionPreviewLabelOf, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, unknownWebhookEventSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, updateStoreTemplateRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertKakaoPayProviderRequestSchema, upsertNaverPayProviderRequestSchema, 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 };
|
|
10982
|
+
export { AI_AGENT_NOTES_DIR, AI_AGENT_PHASES, AI_DESIGN_BOARDS_MAX, AI_DESIGN_BOARD_FILE_PATTERN, AI_DESIGN_BOARD_KINDS, AI_DESIGN_CANVAS_PATH, AI_DESIGN_CONFIRM_APPROVE, AI_DESIGN_DIR, AI_DESIGN_VIEWPORTS, AI_MESSAGE_MAX_ATTACHMENTS, AI_MESSAGE_MAX_CHARS, AI_RUN_ACTIVE_STATUSES, AI_RUN_FILE_CHANGES_RETENTION_DAYS, AI_SETUP_CONFIRM_APPROVE, AI_TODOS_MAX, AI_TODO_STATUSES, APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, APP_CAPABILITIES, APP_DEPLOY_KEY_PATTERN, APP_DEPLOY_KEY_PREFIX, APP_EVENTS_MAX, APP_EVENT_SCOPES, APP_EVENT_TYPES, APP_FLOW_EVENT_PATTERN, APP_FLOW_ITEMS_MAX, APP_FLOW_NOTIFICATION_PATTERN, APP_HANDLE_PATTERN, APP_HTTP_KEY_PATTERN, APP_ICON_CONTENT_TYPES, APP_ICON_MAX_BYTES, APP_ICON_MIN_PX, APP_LIFECYCLE_EVENT_TYPES, APP_NETWORK_DENIED_SUFFIXES, APP_NETWORK_HOSTS_MAX, APP_PUBLIC_HTTP_MAX, APP_README_MAX_BYTES, APP_RESERVED_HANDLES, APP_SCHEDULES_MAX, APP_SCHEDULE_INTERVALS, APP_SCHEDULE_NAME_PATTERN, APP_SECRETS_MAX, APP_SECRET_NAME_PATTERN, APP_SECRET_PATTERNS, APP_SERVER_BUNDLE_MAX_GZIP_BYTES, APP_SETTINGS_MAX_FIELDS, APP_SETTING_FIELD_TYPES, APP_SETTING_KEY_PATTERN, APP_STORAGE_KEY_PATTERN, APP_STORAGE_MAX_BYTES, APP_STORAGE_MAX_KEYS, APP_TOOL_NAME_PATTERN, APP_UI_MAX_BYTES, APP_UI_MAX_FILES, ApiError, ApprovalPendingError, BASE_CURRENCY, BRAND_BRIEF_MAX_REFERENCES, 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, CURRENCIES, CURRENCY_CODES, CUSTOM_INPUT_FORBIDDEN_WORDS, CUSTOM_INPUT_TYPES, DEDICATED_EASY_PAY_PROVIDER, FULFILLMENT_METHODS, FULFILLMENT_METHODS_BY_TYPE, FULFILLMENT_METHOD_RULES, FULFILLMENT_RULES, INSTALLABLE_SCOPES, InvalidPriceUnitError, KAKAOPAY_TEST_CID, KNOWN_WEBHOOK_EVENT_TYPES, KRW_MONEY_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_CALENDAR_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_INVENTORY_OPERATION_LINES, MAX_OPTION_GROUPS, MAX_PICKUP_LOCATIONS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_STAY_NIGHTS, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NON_INSTALLABLE_SCOPES, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, PAYPAL_CURRENCIES, 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, SCOPE_DESCRIPTIONS, SHIPPING_POLICY_DEFAULTS, STARTER_SELLER_TASKS, STARTER_STAGES, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CLOSED_SITE_HOLD_DAYS, 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_DRAFT_ATTACHMENT_MAX_BYTES, STORE_DRAFT_MAX_ATTACHMENTS, STORE_DRAFT_RETENTION_DAYS, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, STORE_SHOP_TYPES, TEMPLATE_STORE_LOCKED_BUSINESS_FIELDS, 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, additionalCurrencyPriceSchema, additionalCurrencyPricesSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, aiActivitySchema, aiAgentPhaseSchema, aiAttachmentSchema, aiChoiceOptionSchema, aiConversationFileChangesSchema, aiConversationSchema, aiConversationSummarySchema, aiDesignBoardSchema, aiDesignCanvasSchema, aiDesignConfirmBoardSchema, aiDesignSelectionSchema, aiFileChangeKindSchema, aiFocusAreaSchema, aiFocusSchema, aiMessagePartSchema, aiMessageSchema, aiPreviewSelectionSchema, aiRunChangesSchema, aiRunChangesStatusSchema, aiRunFileDiffSchema, aiRunRevertConflictDetailsSchema, aiRunRevertResultSchema, aiRunSchema, aiRunStatusSchema, aiSetupConfirmItemSchema, aiStreamAccessSchema, aiStreamEventSchema, aiStreamRecordSchema, aiTodoSchema, aiToolChangeSchema, 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, appArtifactUploadSchema, appBuildSchema, appBuildStageSchema, appCapabilitiesOf, appDeployKeyCreateSchema, appDeployKeyCreatedSchema, appDeployKeySchema, appDevTokenSchema, appDistributionSchema, appEventTypeSchema, appFlowEventSchema, appFlowEventSummarySchema, appFlowNotificationSchema, appFlowNotificationSummarySchema, appFlowParamSchema, appFlowSummaryOf, appHandleSchema, appHttpKeyMatches, appIconProblem, appInstallRequestSchema, appInstallationActivitySchema, appInstallationAppSchema, appInstallationRunSchema, appInstallationSchema, appInstallationSelfSchema, appInstallationSettingsSchema, appInstallationSettingsUpdateSchema, appInstallationStatusSchema, appInvocationSchema, appListingReviewSchema, appListingReviewStatusSchema, appListingSchema, appManifestProblems, appManifestSchema, appManifestWidens, appNetworkHostProblem, appNetworkHostSchema, appReleaseResultSchema, appRuntimeSchema, appScheduleIntervalLabel, appScheduleListOf, appScheduleSummarySchema, appScopeSchema, appSecretSummarySchema, appSessionSchema, appSettingFieldSchema, appStatusSchema, appStorageEntrySchema, appStorageKeysSchema, appStorageListQuerySchema, appStoragePutSchema, appToolCallSchema, appToolInputSchema, appToolListOf, appToolResultSchema, appToolSchema, appToolSummarySchema, appVersionSchema, appVersionStatusSchema, appVisibilitySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, assertSaleUnit, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, bestSellingRuleOf, brandBriefProductSourceSchema, brandBriefReferenceSchema, brandBriefSchema, brandBriefViewSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, calendarDateSchema, calendarDaySchema, calendarQuerySchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimCollectCompleteRequestSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimRedeliveryRequestSchema, 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, commerceFlowCheckSchema, commerceFlowSchema, commerceFlowSummarySchema, commerceFlowVersionViewSchema, commerceNumberField, compareBySales, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createAiConversationRequestSchema, createAiConversationResponseSchema, createCommerceFlowRequestSchema, createCouponRequestSchema, createMarketRequestSchema, createPkcePair, createStoreClient, createStoreDraftRequestSchema, createStoreDraftResponseSchema, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, currencyCodeSchema, currencyRefundFeesSchema, currencyShippingPolicySchema, currencySpecOf, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, defaultFulfillmentMethodOf, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, descendantCategoryIdsOf, describeScope, devStoreSchema, developerAppCreateSchema, developerAppSchema, developerInstallationSchema, developerOrgSchema, developerStoreSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, floorToSaleUnit, flowActionRequestSchema, flowActionResultSchema, flowActionSchema, flowFieldValueSchema, flowInputFieldSchema, flowNodeTypesSchema, flowNotificationWebhookEventDataSchema, flowNotificationWebhookEventSchema, flowPresetDetailSchema, flowPresetSummarySchema, flowRunSchema, flowRunStepSchema, flowSecretNameSchema, flowSecretSchema, flowStateChangedWebhookEventDataSchema, flowStateChangedWebhookEventSchema, flowStateSchema, formatOrderNo, fromDecimalString, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentMethodOf, fulfillmentMethodSchema, fulfillmentMethodsOf, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, inventoryAdjustmentLineSchema, inventoryAdjustmentReasonSchema, inventoryAdjustmentRequestSchema, inventoryChangedWebhookEventDataSchema, inventoryChangedWebhookEventSchema, inventoryLevelListQuerySchema, inventoryLevelPageSchema, inventoryLevelSchema, inventoryLocationRequestSchema, inventoryLocationSchema, inventoryModeSchema, inventoryMovementKindSchema, inventoryMovementListQuerySchema, inventoryMovementPageSchema, inventoryMovementSchema, inventoryOperationResultSchema, inventoryTransferRequestSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isAiAgentNotesPath, isAiDesignPath, isCouponTargetLine, isCurrencyCode, isEditableStorefrontPath, isInstallableScope, isReservedStoreCode, isReservedStorefrontSlug, isSaleUnitPrice, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, kakaoPayCredentialsInputSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, marketSchema, maskedSecretSchema, matchesCollectionRules, mcpRuleResultSchema, mcpToolEventSchema, migrateFlowVersionRequestSchema, migrateFlowVersionResultSchema, minPaymentOf, minorToMajor, moneyRulesOf, moveFlowStateRequestSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, naverPayCredentialsInputSchema, nightsOf, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFlowActionResultSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFlowSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, parseOrderNo, parseWebhookEvent, payPalCredentialsInputSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, paymentStatusProviderSchema, paymentStatusSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderResponseSchema, pgProviderSchema, pgVerificationResultSchema, pickupLocationRequestSchema, pickupLocationSchema, pickupLocationSnapshotSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, pointRestoreExpiresAtOf, pointUseOf, pointUsePolicySchema, policyDocumentUrlSchema, policyVersionSchema, portOneChannelSchema, portOneCredentialsInputSchema, productCreateRequestSchema, productCurrencyPriceSchema, productCurrencyPricesSchema, 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, putBrandBriefRequestSchema, quoteDelivery, quotePricing, rankBestSelling, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, replayFlowRequestSchema, replayFlowResultSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, resolvedFlowSchema, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportCurrencySchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveFlowDraftRequestSchema, saveFlowSecretRequestSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, scopesCoverEvent, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCancelPreviewSchema, sellerCustomerInquirySchema, sendAiMessageRequestSchema, sendAiMessageResponseSchema, setCalendarRequestSchema, setPlatformTestKeysRequestSchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingCurrencyPriceSchema, shippingCurrencyPricesSchema, shippingPolicyPatchSchema, shippingPolicySchema, simulateFlowRequestSchema, simulateFlowResultSchema, simulationStepSchema, splitRefund, starterSellerTaskSchema, starterStageSchema, starterStatusSchema, starterStoreInfoFieldSchema, stayRangeSchema, staySnapshotSchema, storeAppDetailSchema, storeAppSchema, storeCodeSchema, storeDraftPreviewSchema, storeDraftSchema, storeIndustrySchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSetupBriefSchema, storeShopTypeSchema, storeSubscriptionSchema, storeTemplateSchema, storedAdditionalCurrencyPriceSchema, storedProductCurrencyPriceSchema, storedShippingCurrencyPriceSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDevLogsSchema, 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, storefrontSiteSnapshotSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionPreviewLabelOf, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, toDecimalString, toMinor, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, unknownWebhookEventSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMarketRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, updateStoreTemplateRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertKakaoPayProviderRequestSchema, upsertNaverPayProviderRequestSchema, upsertPayPalProviderRequestSchema, 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 };
|