@sayren/store-sdk 0.29.0 → 0.29.1

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.mjs CHANGED
@@ -1071,6 +1071,203 @@ const orderItemFulfillmentSnapshotSchema = z.discriminatedUnion("type", [z.objec
1071
1071
  }), z.object({ type: z.literal("MANUAL") })]);
1072
1072
  const orderItemFulfillmentSnapshotResponseSchema = openFulfillmentUnion(orderItemFulfillmentSnapshotSchema).describe("주문 시점 이행 스냅샷. 상품을 나중에 고쳐도 바뀌지 않는다. 제공 기록은 `fulfillment`에 있다. 값이 추가될 수 있어 SDK는 모르는 유형을 `OTHER`로 읽는다");
1073
1073
  //#endregion
1074
+ //#region src/schemas/points.ts
1075
+ /**
1076
+ * 적립금 (이슈 #93) — 상점 정책·원장 유형·순수 계산. 정책 해석은 `resolvePointPolicy`, 리뷰 적립 금액은
1077
+ * `reviewRewardPointOf`, 적립 묶음(lot) 만료 시각은 `pointExpiresAtOf` 한 곳이다. 서버·상점 플랫폼이 같은 함수를 쓴다.
1078
+ *
1079
+ * 정책이 없으면(null) 모든 적립이 꺼져 있다(사용자 결정 2026-10-02). 셀러가 켜야 적립이 시작된다.
1080
+ * 구매 적립 금액은 `pointEarnOf`, 적용 적립률은 `purchaseEarnRateOf`(상품 덮어쓰기 우선)다. 사용 규칙은 다음 단계(P3)에서 가산한다.
1081
+ */
1082
+ /** 리뷰 적립·회수 금액 상한 — 한 리뷰에 주는 금액 */
1083
+ const POINT_REVIEW_REWARD_MAX = 1e5;
1084
+ /** 유효 기간 범위(일) — 「소멸 없음」 선택지는 두지 않는다(사용자 결정 2026-10-02) */
1085
+ const POINT_EXPIRY_DAYS_MIN = 30;
1086
+ const POINT_EXPIRY_DAYS_MAX = 1825;
1087
+ /** 구매 적립률 상한(만분율) — 3000 = 30% */
1088
+ const POINT_EARN_RATE_BP_MAX = 3e3;
1089
+ const rewardAmount = z.number().int().min(0).max(POINT_REVIEW_REWARD_MAX);
1090
+ /** 구매 적립률(만분율, 100 = 1%). 상품별 덮어쓰기도 같은 범위다 */
1091
+ const pointEarnRateBpSchema = z.number().int().min(0).max(POINT_EARN_RATE_BP_MAX).describe("구매 적립률(만분율, 100 = 1%). 0~3000");
1092
+ const reviewRewardPolicySchema = z.object({
1093
+ enabled: z.boolean().describe("리뷰 적립 사용 여부"),
1094
+ textPoint: rewardAmount.describe("리뷰를 작성하면 주는 적립금(원). 0~100,000"),
1095
+ photoPoint: rewardAmount.describe("사진이 있는 리뷰에 **더** 주는 적립금(원). 0~100,000. 사진 리뷰는 `textPoint + photoPoint`를 받는다")
1096
+ });
1097
+ const purchaseEarnPolicySchema = z.object({
1098
+ enabled: z.boolean().describe("구매 적립 사용 여부"),
1099
+ rateBp: pointEarnRateBpSchema.describe("상점 기본 구매 적립률(만분율, 100 = 1%). 0~3000. 상품의 `pointEarnRateBp`가 있으면 그 값이 우선한다")
1100
+ });
1101
+ const expiryDays = z.number().int().min(30).max(POINT_EXPIRY_DAYS_MAX).describe("적립금 유효 기간(일, 30~1825). 적립한 날로부터 이 기간이 지난 날의 끝(한국 시간 23:59:59)에 소멸한다. 바꿔도 이미 적립된 적립금의 유효 기간은 바뀌지 않는다");
1102
+ /** 저장된 상점 정책(`stores.point_policy`) — 해석은 `resolvePointPolicy` */
1103
+ const pointPolicySchema = z.object({
1104
+ reviewReward: reviewRewardPolicySchema,
1105
+ purchaseEarn: purchaseEarnPolicySchema,
1106
+ expiryDays: expiryDays.nullable().describe("적립금 유효 기간(일). 정하지 않았으면 null")
1107
+ });
1108
+ /** 정책이 없을 때 — 모두 끔 */
1109
+ const POINT_POLICY_DEFAULTS = {
1110
+ reviewReward: {
1111
+ enabled: false,
1112
+ textPoint: 0,
1113
+ photoPoint: 0
1114
+ },
1115
+ purchaseEarn: {
1116
+ enabled: false,
1117
+ rateBp: 0
1118
+ },
1119
+ expiryDays: null
1120
+ };
1121
+ /**
1122
+ * 저장된 정책 → 유효 정책. null·형식이 틀린 값은 기본(모두 끔)이다. 키 하나가 틀려도 그 묶음만 기본으로 읽는다
1123
+ * (정책 형식이 바뀌어 옛 행이 남아 있을 때 적립을 잘못 켜지 않게 한다).
1124
+ */
1125
+ function resolvePointPolicy(stored) {
1126
+ if (!stored || typeof stored !== "object") return POINT_POLICY_DEFAULTS;
1127
+ const raw = stored;
1128
+ const review = reviewRewardPolicySchema.safeParse(raw.reviewReward);
1129
+ const purchase = purchaseEarnPolicySchema.safeParse(raw.purchaseEarn);
1130
+ const expiry = expiryDays.nullable().safeParse(raw.expiryDays ?? null);
1131
+ return {
1132
+ reviewReward: review.success ? review.data : POINT_POLICY_DEFAULTS.reviewReward,
1133
+ purchaseEarn: purchase.success ? purchase.data : POINT_POLICY_DEFAULTS.purchaseEarn,
1134
+ expiryDays: expiry.success ? expiry.data : null
1135
+ };
1136
+ }
1137
+ /** 적립을 하나라도 켰는가 — 켜면 유효 기간이 필수다 */
1138
+ function pointEarningEnabled(policy) {
1139
+ return policy.reviewReward.enabled || policy.purchaseEarn.enabled;
1140
+ }
1141
+ /**
1142
+ * 주문상품에 적용할 구매 적립률 — 구매 적립이 꺼져 있으면 0, 상품 덮어쓰기(`products.point_earn_rate_bp`)가 있으면 그 값
1143
+ * (0 = 적립 안 함), 없으면 상점 기본이다. 결제 확정 때 주문상품에 스냅샷한다.
1144
+ */
1145
+ function purchaseEarnRateOf(policy, productRateBp) {
1146
+ if (!policy.purchaseEarn.enabled) return 0;
1147
+ return productRateBp ?? policy.purchaseEarn.rateBp;
1148
+ }
1149
+ /** 구매 적립 금액 — 적립 기준 금액 × 적립률, 1원 미만은 내린다 */
1150
+ function pointEarnOf(input) {
1151
+ if (input.paidBase <= 0 || input.rateBp <= 0) return 0;
1152
+ return Math.floor(input.paidBase * input.rateBp / 1e4);
1153
+ }
1154
+ /** 리뷰 하나의 적립 금액 — 정책이 꺼져 있으면 0이다. 사진은 추가분이다 */
1155
+ function reviewRewardPointOf(policy, hasPhoto) {
1156
+ const { reviewReward } = policy;
1157
+ if (!reviewReward.enabled) return 0;
1158
+ return reviewReward.textPoint + (hasPhoto ? reviewReward.photoPoint : 0);
1159
+ }
1160
+ const DAY_MS = 864e5;
1161
+ const KST_OFFSET_MS = 324e5;
1162
+ /**
1163
+ * 적립 묶음의 만료 시각 — 적립 시각 + `days`일이 속한 한국 시간 날짜의 끝(23:59:59.999 KST). 구매자 안내가 날짜 단위라
1164
+ * 시각을 날짜 끝에 맞춘다. `days`가 null이면 만료 없음(null)이다.
1165
+ */
1166
+ function pointExpiresAtOf(earnedAt, days) {
1167
+ if (days === null) return null;
1168
+ const shifted = earnedAt.getTime() + days * DAY_MS + KST_OFFSET_MS;
1169
+ const endOfDay = Math.floor(shifted / DAY_MS) * DAY_MS + DAY_MS - 1;
1170
+ return /* @__PURE__ */ new Date(endOfDay - KST_OFFSET_MS);
1171
+ }
1172
+ /** 적립 묶음 출처 — 같은 출처 id에는 묶음이 하나뿐이다(DB 부분 유니크) */
1173
+ const POINT_LOT_SOURCES = [
1174
+ "REVIEW",
1175
+ "PURCHASE",
1176
+ "ADJUST",
1177
+ "REFUND_RESTORE",
1178
+ "OPENING"
1179
+ ];
1180
+ /** 원장 항목 유형. 지금 쓰는 것은 리뷰 적립·회수이고 나머지는 다음 단계 자리다 */
1181
+ const POINT_ENTRY_TYPES = [
1182
+ "EARN_REVIEW",
1183
+ "REVOKE_REVIEW",
1184
+ "EARN_PURCHASE",
1185
+ "USE_RESERVE",
1186
+ "USE_RELEASE",
1187
+ "REFUND_RESTORE",
1188
+ "EXPIRE",
1189
+ "ADJUST",
1190
+ "OPENING"
1191
+ ];
1192
+ /** 상점 플랫폼 알림 — `REVIEW_REWARD_PAUSED` 리뷰 자동 적립이 멈춤 · `POINTS_AVAILABLE` 적립금 설정을 쓸 수 있음 */
1193
+ const pointPolicyNoticeSchema = z.enum(["REVIEW_REWARD_PAUSED", "POINTS_AVAILABLE"]).nullable().describe("상점에 보일 안내. `REVIEW_REWARD_PAUSED`: 지난 90일에 리뷰 적립이 있었는데 적립금 기본값이 끔으로 바뀌어 리뷰 자동 적립(500원 + 사진 500원)이 멈췄다. `POINTS_AVAILABLE`: 적립금 설정을 열었으니 다시 켤 수 있다. 안내할 것이 없으면 null");
1194
+ /** `GET /v1/store/point-policy` 응답 */
1195
+ const storePointPolicySchema = z.object({
1196
+ available: z.boolean().describe("적립금 설정을 바꿀 수 있는가. false면 준비 중이라 정책 저장이 409 `POINTS_UNAVAILABLE`이고 모든 적립이 멈춰 있다"),
1197
+ configured: z.boolean().describe("셀러가 정책을 저장한 적이 있는가. false면 기본(모두 끔)이다"),
1198
+ reviewReward: reviewRewardPolicySchema.describe("리뷰 적립. 정하지 않았으면 끔·0원"),
1199
+ purchaseEarn: purchaseEarnPolicySchema.describe("구매 적립. 구매확정 때 주문상품 실결제 금액(배송비 제외) × 적립률을 준다. 정하지 않았으면 끔·0"),
1200
+ expiryDays: pointPolicySchema.shape.expiryDays,
1201
+ notice: pointPolicyNoticeSchema
1202
+ });
1203
+ /**
1204
+ * `PUT /v1/store/point-policy` 본문 — 준 항목만 바꾼다(생략 = 저장된 값 유지). 리뷰 적립·구매 적립 중 하나라도 켜면 유효 기간이 있어야 한다
1205
+ * (본문이나 저장된 값, 없으면 400 `POINT_EXPIRY_REQUIRED`).
1206
+ */
1207
+ const updatePointPolicyRequestSchema = z.object({
1208
+ reviewReward: reviewRewardPolicySchema.optional(),
1209
+ purchaseEarn: purchaseEarnPolicySchema.optional(),
1210
+ expiryDays: expiryDays.optional()
1211
+ });
1212
+ /** 응답의 원장 유형 — 값이 추가될 수 있어 문자열로 받는다 */
1213
+ const responsePointEntryTypeSchema = z.union([z.enum(POINT_ENTRY_TYPES), z.string()]).describe("유형. `EARN_REVIEW` 리뷰 적립 · `REVOKE_REVIEW` 리뷰 삭제 회수 · `EARN_PURCHASE` 구매 적립 · `EXPIRE` 소멸 · `ADJUST` 셀러 지급·차감 · `OPENING` 기존 잔액 이전. 값이 추가될 수 있어 문자열로 받는다");
1214
+ /** 원장 항목 — 셀러 조회용(사유·행위자 포함) */
1215
+ const pointEntrySchema = z.object({
1216
+ entryId: z.string(),
1217
+ memberId: z.string(),
1218
+ type: responsePointEntryTypeSchema,
1219
+ amount: z.number().int().describe("변동액. 적립 +, 회수·차감·소멸 −"),
1220
+ balanceAfter: z.number().int().describe("이 변동 직후 잔액"),
1221
+ refType: z.string().nullable().describe("가리키는 대상 종류(`REVIEW`·`ORDER_ITEM`·`LOT`·`ADJUSTMENT`)"),
1222
+ refId: z.string().nullable(),
1223
+ memo: z.string().nullable().describe("셀러 조정 사유. 그 밖에는 null"),
1224
+ actor: z.string().nullable().describe("셀러 조정을 한 행위자. 그 밖에는 null"),
1225
+ createdAt: z.string()
1226
+ });
1227
+ /** 적립 묶음 요약 — 남은 금액이 있는 묶음 */
1228
+ const pointLotSchema = z.object({
1229
+ lotId: z.string(),
1230
+ source: z.union([z.enum(POINT_LOT_SOURCES), z.string()]).describe("출처. `REVIEW`·`PURCHASE`·`ADJUST`·`OPENING` 등"),
1231
+ amount: z.number().int().describe("적립한 금액"),
1232
+ remaining: z.number().int().describe("남은 금액"),
1233
+ expiresAt: z.string().nullable().describe("소멸 시각. null이면 소멸 없음"),
1234
+ createdAt: z.string()
1235
+ });
1236
+ /** `GET /v1/customers/{customerId}/points` */
1237
+ const customerPointsSchema = z.object({
1238
+ balance: z.number().int().describe("잔액"),
1239
+ expiringSoon: z.number().int().describe("30일 안에 소멸할 금액"),
1240
+ lots: z.array(pointLotSchema).describe("남은 금액이 있는 묶음(소멸이 이른 순, 최대 100개)")
1241
+ });
1242
+ /** 원장 조회 쿼리 — 상점 전체(`GET /v1/points/history`)는 회원·유형·기간으로 거른다 */
1243
+ const pointHistoryQuerySchema = z.object({
1244
+ page: z.coerce.number().int().min(1).optional(),
1245
+ size: z.coerce.number().int().min(1).max(100).optional(),
1246
+ type: z.string().optional().describe("유형(`EARN_PURCHASE` 등)"),
1247
+ memberId: z.string().optional().describe("회원(구매자) id"),
1248
+ from: z.iso.datetime({ offset: true }).optional().describe("이 시각 이후(포함)"),
1249
+ to: z.iso.datetime({ offset: true }).optional().describe("이 시각 이전(미포함)")
1250
+ });
1251
+ /** 셀러 조정 금액 한도 — 한 번에 천만 원 */
1252
+ const POINT_ADJUSTMENT_MAX = 1e7;
1253
+ /**
1254
+ * `POST /v1/customers/{customerId}/points/adjustments` — 셀러 지급(+)·차감(−). 헤더 `Idempotency-Key`가 필수다.
1255
+ * 지급의 소멸 시각은 `expiresAt`(생략하면 정책 유효 기간, 정책이 없으면 400 `POINT_EXPIRY_REQUIRED`), 차감은 소멸이 이른 적립금부터 뺀다
1256
+ * (잔액보다 많으면 409 `POINT_BALANCE_INSUFFICIENT`).
1257
+ */
1258
+ const pointAdjustmentRequestSchema = z.object({
1259
+ amount: z.number().int().min(-1e7).max(POINT_ADJUSTMENT_MAX).refine((value) => value !== 0, "0원은 조정할 수 없습니다").describe("지급은 양수, 차감은 음수(원)"),
1260
+ reason: z.string().trim().min(1).max(200).describe("사유(필수). 구매자에게는 보이지 않는다"),
1261
+ expiresAt: z.iso.datetime({ offset: true }).optional().describe("지급분의 소멸 시각. 생략하면 정책 유효 기간으로 정한다. 차감에는 주지 않는다")
1262
+ }).refine((value) => !(value.amount < 0 && value.expiresAt), {
1263
+ message: "차감에는 소멸 시각을 줄 수 없습니다",
1264
+ path: ["expiresAt"]
1265
+ });
1266
+ const pointAdjustmentResultSchema = z.object({
1267
+ entry: pointEntrySchema,
1268
+ balance: z.number().int().describe("조정 뒤 잔액")
1269
+ });
1270
+ //#endregion
1074
1271
  //#region src/schemas/refund-policy.ts
1075
1272
  /**
1076
1273
  * 환불 정책 (이슈 #25) — 취소·반품·교환에서 **배송비를 누가 부담하는지**를 정한다.
@@ -1470,6 +1667,7 @@ const productSchema = productSummarySchema.extend({
1470
1667
  */
1471
1668
  descriptionJson: z.string().nullable().optional(),
1472
1669
  originalPrice: z.number().int().nullable().optional().describe("정가(할인 전 표시 가격). 원 단위. 비교용 표시 값이고 결제 금액 계산에 쓰지 않는다 — 구매자가 내는 가격은 즉시할인이 있으면 `discountedPrice`, 없으면 `salePrice`다. 스토어프론트 상품 응답에도 같은 값이 실린다. 정하지 않았으면 null"),
1670
+ pointEarnRateBp: pointEarnRateBpSchema.nullable().optional().describe("구매 적립률 덮어쓰기(만분율, 100 = 1%, 0~3000, 이슈 #93). null이면 상점 기본 적립률, 0이면 이 상품은 적립하지 않는다. 결제 확정 시점 값이 주문상품에 남는다"),
1473
1671
  images: z.array(z.url()).optional(),
1474
1672
  attributes: z.array(z.object({
1475
1673
  attributeId: z.string(),
@@ -1622,6 +1820,7 @@ const productWriteShape = {
1622
1820
  categoryId: z.string().min(1, "카테고리를 선택해주십시오"),
1623
1821
  salePrice: z.number().int().min(10).multipleOf(10, "판매가는 10원 단위여야 합니다 (INVALID_PRICE_UNIT)").describe("판매가. 원(KRW) 단위 정수, 최소 10원, 10원 단위"),
1624
1822
  originalPrice: z.number().int().optional().describe("정가(할인 전 표시 가격). 원 단위. 비교용 표시 값이고 결제 금액은 판매가(즉시할인이 있으면 할인 적용가)다. 스토어프론트가 판매가보다 클 때 취소선·할인율로 보인다. 즉시할인은 `PUT /v1/products/{productId}/discount`로 따로 정한다"),
1823
+ pointEarnRateBp: pointEarnRateBpSchema.nullable().optional().describe("구매 적립률 덮어쓰기(만분율, 100 = 1%, 0~3000, 이슈 #93). null이면 상점 기본 적립률, 0이면 이 상품은 적립하지 않는다. 결제 확정 시점 값이 주문상품에 남는다. 전체 수정(PUT)에서 생략하면 지금 값을 유지한다"),
1625
1824
  description: z.string().optional(),
1626
1825
  /**
1627
1826
  * 상세설명 에디터(@avarlabs/editor)의 직렬화 상태. 재편집 때 이 값으로 문서를 복원한다.
@@ -1653,7 +1852,8 @@ const productPatchRequestSchema = z.strictObject({
1653
1852
  status: productStatusSchema.optional(),
1654
1853
  images: productImagesRequestSchema.optional().describe("상품 이미지 주소 목록. 주면 통째로 바꾼다(현재 목록과 병합하지 않는다). 첫 장이 대표 이미지(썸네일)다. 생략하면 바꾸지 않는다"),
1655
1854
  fulfillment: productFulfillmentUpdateSchema.optional().describe(fulfillmentUpdateDescription),
1656
- refundPolicy: productRefundPolicyPatchSchema.nullable().optional().describe("상품별 환불 정책. 주면 통째로 바꾼다(준 항목만 상점 기본을 덮어쓴다). `null`은 덮어쓰기를 지워 상점 기본을 따른다. 생략하면 바꾸지 않는다")
1855
+ refundPolicy: productRefundPolicyPatchSchema.nullable().optional().describe("상품별 환불 정책. 주면 통째로 바꾼다(준 항목만 상점 기본을 덮어쓴다). `null`은 덮어쓰기를 지워 상점 기본을 따른다. 생략하면 바꾸지 않는다"),
1856
+ pointEarnRateBp: pointEarnRateBpSchema.nullable().optional().describe("구매 적립률 덮어쓰기(만분율, 100 = 1%, 0~3000, 이슈 #93). null이면 상점 기본 적립률, 0이면 이 상품은 적립하지 않는다. 결제 확정 시점 값이 주문상품에 남는다. 생략하면 바꾸지 않는다")
1657
1857
  }).refine((value) => Object.values(value).some((v) => v !== void 0), { message: "최소 1개 필드가 필요합니다" });
1658
1858
  const productSortSchema = z.enum([
1659
1859
  "createdAt.desc",
@@ -5888,7 +6088,23 @@ function createStoreClient(options) {
5888
6088
  removeProvider: (provider) => storeHttp.request("DELETE", path`/store/auth-providers/${provider}`, loginSettingsSchema)
5889
6089
  },
5890
6090
  /** 구매자 관리 — 조회 `customer:r`, 탈퇴 처리 `customer:rw`(상점 플랫폼 OWNER·ADMIN) */
6091
+ /** 적립금 — 상점 전체 원장(#93). 스코프 `promotion:r` */
6092
+ points: {
6093
+ /** `GET /v1/points/history` — 회원(`memberId`)·유형(`type`)·기간(`from`·`to`)으로 거른다 */
6094
+ listHistory: (params) => storeHttp.request("GET", "/points/history", pageSchema(pointEntrySchema), { query: params }) },
5891
6095
  customers: {
6096
+ /** `GET /v1/customers/{customerId}/points` — 잔액·30일 안 소멸 예정·남은 적립 묶음(#93) */
6097
+ getPoints: (customerId) => storeHttp.request("GET", path`/customers/${customerId}/points`, customerPointsSchema),
6098
+ /** `GET /v1/customers/{customerId}/points/history` — 적립금 내역(최신순, 셀러 사유 포함) */
6099
+ listPointHistory: (customerId, params) => storeHttp.request("GET", path`/customers/${customerId}/points/history`, pageSchema(pointEntrySchema), { query: params }),
6100
+ /**
6101
+ * `POST /v1/customers/{customerId}/points/adjustments` (201) — 스코프 `promotion:rw`. 양수 지급, 음수 차감. `idempotencyKey`가 필수다.
6102
+ * 에러: 409 `POINT_BALANCE_INSUFFICIENT`·`POINTS_UNAVAILABLE`, 400 `POINT_EXPIRY_REQUIRED`. 에이전트 요청은 승인 대상이다
6103
+ */
6104
+ adjustPoints: (customerId, body, idempotencyKey) => storeHttp.request("POST", path`/customers/${customerId}/points/adjustments`, pointAdjustmentResultSchema, {
6105
+ body: pointAdjustmentRequestSchema.parse(body),
6106
+ headers: idempotency(idempotencyKey)
6107
+ }),
5892
6108
  list: (params) => storeHttp.request("GET", "/customers", pageSchema(customerSummarySchema), { query: params }),
5893
6109
  get: (customerId) => storeHttp.request("GET", path`/customers/${customerId}`, customerDetailSchema),
5894
6110
  orders: (customerId, params) => storeHttp.request("GET", path`/customers/${customerId}/orders`, pageSchema(customerOrderSchema), { query: params }),
@@ -6276,6 +6492,16 @@ listPublic: () => storeHttp.request("GET", "/public/plans", publicPlansSchema) }
6276
6492
  * 스토어프론트 오리진 목록이다(빈 배열이면 모든 오리진 허용).
6277
6493
  */
6278
6494
  update: (body) => storeHttp.request("PATCH", "/store", storeSchema, { body: updateStoreRequestSchema.parse(body) }),
6495
+ /**
6496
+ * `GET /v1/store/point-policy` — 스코프 `promotion:r`. 적립금 정책(리뷰 적립·유효 기간)과 준비 여부(`available`), 상점에 보일 안내(`notice`).
6497
+ * 정책을 정하지 않았으면 모두 끔이다(#93)
6498
+ */
6499
+ getPointPolicy: () => storeHttp.request("GET", "/store/point-policy", storePointPolicySchema),
6500
+ /**
6501
+ * `PUT /v1/store/point-policy` — 스코프 `promotion:rw`. 준 항목만 바꾼다. 에이전트 요청은 승인 대상이다.
6502
+ * 에러: 409 `POINTS_UNAVAILABLE`(준비 중) · 400 `POINT_EXPIRY_REQUIRED`(리뷰 적립을 켜는데 유효 기간이 없음)
6503
+ */
6504
+ updatePointPolicy: (body) => storeHttp.request("PUT", "/store/point-policy", storePointPolicySchema, { body: updatePointPolicyRequestSchema.parse(body) }),
6279
6505
  listMembers: () => storeHttp.request("GET", "/store/members", z.array(storeMemberSchema)),
6280
6506
  /** `PATCH /v1/store/members/{userId}` — 스코프 `member:rw`. OWNER는 바꿀 수 없고 ADMIN 지정·ADMIN 변경은 OWNER만 한다 */
6281
6507
  updateMemberRole: (userId, body) => storeHttp.request("PATCH", path`/store/members/${userId}`, storeMemberRoleUpdatedSchema, { body: updateMemberRoleRequestSchema.parse(body) }),
@@ -6843,4 +7069,4 @@ function createStoreSession(options) {
6843
7069
  };
6844
7070
  }
6845
7071
  //#endregion
6846
- export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_PRODUCT_SORTS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT, STOREFRONT_DOMAIN_DNS_GRACE_DAYS, STOREFRONT_DOMAIN_DNS_WAIT_DAYS, STOREFRONT_DOMAIN_TXT_LABEL, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_PLATFORM_DOMAINS, STOREFRONT_PUBLIC_SUFFIXES, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SHOWCASE_SLUG_PREFIX, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_SOURCE_BLOB_BATCH_MAX, STOREFRONT_SOURCE_PART_BYTES, STOREFRONT_WORKSPACE_MAX_BYTES, STOREFRONT_WORKSPACE_MAX_FILES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addStorefrontDomainRequestSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, 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, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, quoteDelivery, quotePricing, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, requiresCollection, requiresShipping, resolveRefundPolicy, resolveShippingPolicy, responsePlanCodeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDnsRecordSchema, storefrontDomainSchema, storefrontDomainTxtNameOf, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteDomainSchema, storefrontSiteDomainsSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
7072
+ export { APPROVAL_ALREADY_DECIDED_CODE, APPROVAL_REQUIRED_CODE, ApiError, ApprovalPendingError, BUSINESS_INFO_MAX_LENGTH, BUSINESS_NUMBER_PATTERN, CASH_RECEIPT_STATUS_VALUES, COLLECTION_PRODUCT_SORTS, COLLECTION_SLUG_PATTERN, COLLECTION_TYPES, COUPON_CODE_PATTERN, COUPON_CONDITIONS_DEFAULTS, COUPON_TARGET_ALL, COUPON_TARGET_LIST_MAX, CUSTOM_INPUT_FORBIDDEN_WORDS, FULFILLMENT_RULES, MAX_ADDON_GROUPS, MAX_ANALYTICS_ALLOWED_ORIGINS, MAX_AUTO_TRANSITION_DAYS, MAX_COLLECTIONS, MAX_COLLECTION_DESCRIPTION, MAX_COLLECTION_PRODUCTS, MAX_COLLECTION_PRODUCTS_PER_ADD, MAX_COLLECTION_TITLE, MAX_CUSTOM_INPUTS, MAX_CUSTOM_INPUT_LENGTH, MAX_OPTION_GROUPS, MAX_PRODUCT_IMAGES, MAX_SAVED_OPTION_SETS, MAX_SAVED_OPTION_SET_NAME, MAX_VALUES_PER_GROUP, MAX_VARIANTS, MCP_TELEMETRY_MAX_RESULTS, MIN_PAYMENT_AMOUNT, NO_COUPON_SETTLEMENT, NO_SHIPPING_BUNDLE_KEY, PAYMENT_ROUTING_EXCLUSION_CODES, POINT_ADJUSTMENT_MAX, POINT_EARN_RATE_BP_MAX, POINT_ENTRY_TYPES, POINT_EXPIRY_DAYS_MAX, POINT_EXPIRY_DAYS_MIN, POINT_LOT_SOURCES, POINT_POLICY_DEFAULTS, POINT_REVIEW_REWARD_MAX, PORTONE_CHANNEL_NAME_MAX_LENGTH, PORTONE_MAX_CHANNELS, PORTONE_MIN_CHANNELS, REFUND_POLICY_DEFAULTS, REFUND_POLICY_DELIVERY_FEE_KEYS, REMOTE_AREA_ZIP_RANGES, RESERVED_STOREFRONT_SLUGS, RESERVED_STORE_CODES, SHIPPING_POLICY_DEFAULTS, STOREFRONT_BLOCKED_PATH_SEGMENTS, STOREFRONT_BUILD_STAGES, STOREFRONT_BUILD_TERMINAL_STATUSES, STOREFRONT_CHECK_TERMINAL_STATUSES, STOREFRONT_CUSTOM_DOMAIN_LIMIT_DEFAULT, STOREFRONT_DOMAIN_DNS_GRACE_DAYS, STOREFRONT_DOMAIN_DNS_WAIT_DAYS, STOREFRONT_DOMAIN_TXT_LABEL, STOREFRONT_EDIT_ACTIVITY_TIMEOUT_MINUTES, STOREFRONT_EDIT_CAPACITY, STOREFRONT_EDIT_IDLE_MINUTES, STOREFRONT_EDIT_PREVIEW_SUFFIX, STOREFRONT_EDIT_START_STAGES, STOREFRONT_FILE_BATCH_MAX, STOREFRONT_FILE_MAX_BYTES, STOREFRONT_PATH_SEGMENT_PATTERN, STOREFRONT_PLATFORM_DOMAINS, STOREFRONT_PUBLIC_SUFFIXES, STOREFRONT_SEARCH_REGEX_MAX_LENGTH, STOREFRONT_SHOWCASE_SLUG_PREFIX, STOREFRONT_SITE_CREATE_LIMIT, STOREFRONT_SLUG_CHANGE_LIMIT, STOREFRONT_SLUG_CHANGE_WINDOW_DAYS, STOREFRONT_SLUG_HOLD_DAYS, STOREFRONT_SLUG_PATTERN, STOREFRONT_SOURCE_BLOB_BATCH_MAX, STOREFRONT_SOURCE_PART_BYTES, STOREFRONT_WORKSPACE_MAX_BYTES, STOREFRONT_WORKSPACE_MAX_FILES, STORE_CODE_PATTERN, STORE_ROLE_SCOPES, STORE_SCOPE_RESOURCES, STORE_SESSION_KEYS, TOSS_WIDGET_CLIENT_KEY_PATTERN, TOSS_WIDGET_KEY_MESSAGE, TOSS_WIDGET_SECRET_KEY_PATTERN, UPLOAD_PURPOSE_LIMITS, VARIANT_COUNT_WARNING, VARIANT_STOCK_EXCLUSIVE_MESSAGE, WEBHOOK_DEFAULT_TOLERANCE_SEC, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_FAILURE_REASONS, WEBHOOK_HEADERS, WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES, WEBHOOK_RESOURCE_TYPES, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_USER_AGENT, addStorefrontDomainRequestSchema, addonGroupRequestSchema, addonGroupSchema, addonValueRequestSchema, addonValueSchema, addressChangeRequestListSchema, addressTypeSchema, agentPolicyDecisionSchema, allocateByWeight, analyticsChannelSchema, analyticsCheckoutOutcomeSchema, analyticsCheckoutSchema, analyticsDeviceRowSchema, analyticsDevicesSchema, analyticsFunnelStepSchema, analyticsOriginSchema, analyticsOverviewSchema, analyticsPagesQuerySchema, analyticsPagesSchema, analyticsProductRowSchema, analyticsProductSortSchema, analyticsProductsQuerySchema, analyticsProductsSchema, analyticsRangeQuerySchema, analyticsRealtimeSchema, analyticsSearchQuerySchema, analyticsSearchSchema, analyticsSourceGroupBySchema, analyticsSourceRowSchema, analyticsSourcesQuerySchema, analyticsSourcesSchema, analyticsTotalsSchema, apiLogErrorSchema, apiLogListQuerySchema, apiLogPageSchema, apiLogPrincipalSchema, apiLogPrincipalTypeSchema, apiLogSchema, apiLogStatusFilterSchema, apiLogSummarySchema, approvalDecisionRequestSchema, approvalListQuerySchema, approvalPageSchema, approvalRequestSchema, approvalStatusSchema, approveClaimResultSchema, auditActorSchema, auditActorTypeSchema, auditLogListQuerySchema, auditLogOutcomeSchema, auditLogPageSchema, auditLogSchema, auditLogSourceSchema, buildAuthorizeUrl, buildQuery, bulkResultSchema, businessInfoPatchShape, businessInfoResponseShape, businessNumberSchema, cancelBySellerRequestSchema, cancelBySellerResultSchema, carrierSchema, cashReceiptSchema, categoryAttributeSchema, categoryCreateRequestSchema, categoryDeleteQuerySchema, categoryDeleteStrategySchema, categoryListQuerySchema, categoryPatchRequestSchema, categoryProductSortSchema, categorySchema, categorySearchResultSchema, categoryTreeNodeSchema, categoryWithPathSchema, changeStorefrontSlugRequestSchema, changeStorefrontTemplateRequestSchema, changeTypeSchema, claimDetailSchema, claimHoldResultSchema, claimListQuerySchema, claimReasonSchema, claimReturnAddressSchema, claimSchema, claimStatusSchema, claimTypeSchema, claimWebhookEventDataSchema, claimWebhookEventSchema, collectionCreateRequestSchema, collectionListQuerySchema, collectionPageSchema, collectionPatchRequestSchema, collectionProductListQuerySchema, collectionProductSchema, collectionProductSortRequestSchema, collectionProductsAddRequestSchema, collectionProductsReplaceRequestSchema, collectionSchema, collectionStateCountsSchema, collectionStateOf, collectionStateSchema, consentActionSchema, consentKindSchema, consentSourceSchema, couponBenefitSchema, couponConditionsInputSchema, couponConditionsSchema, couponDiscountOf, couponIssueListQuerySchema, couponIssueMethodSchema, couponIssueSchema, couponIssueStatusSchema, couponKindSchema, couponListQuerySchema, couponRedemptionListQuerySchema, couponRedemptionSchema, couponRejectReasonSchema, couponRuleSchema, couponSchema, couponStatsSchema, couponStatusSchema, couponTargetInputSchema, couponTargetSchema, createCouponRequestSchema, createPkcePair, createStoreClient, createStoreSession, createStorefrontEditPreviewLinkRequestSchema, createStorefrontPreviewLinkRequestSchema, createStorefrontSiteRequestSchema, createStorefrontVersionRequestSchema, customInputLabelForbiddenWord, customInputRequestSchema, customInputSchema, customInputValueSchema, customerAddressSchema, customerConsentListQuerySchema, customerConsentSchema, customerConsentStateSchema, customerConsentsSchema, customerCouponSchema, customerDelegationRequestSchema, customerDelegationSchema, customerDetailSchema, customerInquiryCategorySchema, customerInquiryListQuerySchema, customerListQuerySchema, customerOrderSchema, customerPointsSchema, customerSortSchema, customerStatsSchema, customerSummarySchema, customerWithdrawalBlockedDetailsSchema, deleteStorefrontFileRequestSchema, deliveryBundleKeyOf, deliveryFeeWaiverSchema, deliveryInfoSchema, deliveryMethodSchema, deliveryStatusSchema, deliveryTypeSchema, disableStorefrontHostingRequestSchema, discountRequestSchema, discountSchema, dispatchRequestSchema, easyPayProviderResponseSchema, easyPayProviderSchema, eventTypeSchema, exchangeAuthorizationCode, fulfillBulkRequestSchema, fulfillRequestSchema, fulfillmentRuleOf, fulfillmentTypeOf, fulfillmentTypeResponseSchema, fulfillmentTypeSchema, holdOrderItemRequestSchema, inquiryListQuerySchema, inquirySchema, inquiryWebhookEventDataSchema, inquiryWebhookEventSchema, invitationDeliveryStatusSchema, invitationListQuerySchema, invitationSchema, inviteMemberRequestSchema, isCouponTargetLine, isEditableStorefrontPath, isReservedStoreCode, isReservedStorefrontSlug, isShowcaseStorefrontSlug, isStoreScope, isWebOrigin, issueCouponRequestSchema, issueCouponResultSchema, liveGateConditionCodeSchema, liveGateConditionSchema, liveGateErrorDetailsSchema, liveGateSchema, loginProviderSchema, loginProviderStatusSchema, loginProviderTestSchema, loginSettingsSchema, maskedSecretSchema, mcpRuleResultSchema, mcpToolEventSchema, moveStorefrontFileRequestSchema, myAccountSchema, myStoreSchema, normalizeBusinessNumber, normalizeCouponCode, normalizeStorefrontHostname, normalizeStorefrontPath, oauthTokenResponseSchema, openFulfillmentUnion, optionGroupKindSchema, optionGroupRequestSchema, optionGroupSchema, optionModelRequestSchema, optionModelSchema, optionSelectionSchema, optionSortSchema, optionValueRequestSchema, optionValueSchema, orderCanceledWebhookEventDataSchema, orderCanceledWebhookEventSchema, orderDiscountSchema, orderFulfilledWebhookEventDataSchema, orderFulfilledWebhookEventSchema, orderItemFulfillmentSchema, orderItemFulfillmentSnapshotResponseSchema, orderItemFulfillmentSnapshotSchema, orderItemListQuerySchema, orderItemMemoResultSchema, orderItemPageSchema, orderItemSchema, orderItemStatusSchema, orderListQuerySchema, orderSchema, orderSummaryPageSchema, orderSummarySchema, orderWebhookEventDataSchema, orderWebhookEventSchema, pageInfoSchema, pageQueryShape, pageSchema, paymentAttemptRecordSchema, paymentAttemptStatusSchema, paymentCredentialSetSchema, paymentFailureWarningSchema, paymentListQuerySchema, paymentProviderSchema, paymentProviderVerificationSchema, paymentRecordDetailSchema, paymentRecordPageSchema, paymentRecordSchema, paymentRecordStatusSchema, paymentRefundRecordSchema, paymentSettingsSchema, pgEnvironmentSchema, pgPaymentMethodSchema, pgProviderSchema, pgVerificationResultSchema, planCodeSchema, planEntitlementsSchema, planErrorDetailsSchema, pointAdjustmentRequestSchema, pointAdjustmentResultSchema, pointEarnOf, pointEarnRateBpSchema, pointEarningEnabled, pointEntrySchema, pointExpiresAtOf, pointHistoryQuerySchema, pointLotSchema, pointPolicyNoticeSchema, pointPolicySchema, 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, proratedRefundBase, publicPlanSchema, publicPlansSchema, publishStorefrontVersionRequestSchema, purchaseDecisionExtendResultSchema, purchaseDecisionRequestResultSchema, purchaseEarnPolicySchema, purchaseEarnRateOf, quoteDelivery, quotePricing, refreshUserToken, refundPolicyPatchSchema, refundPolicySchema, rejectClaimRequestSchema, remoteAreaLabelOf, remoteAreaOf, remoteAreaSchema, remoteSurchargeOf, replaceStorefrontSourceRequestSchema, requiresCollection, requiresShipping, resolvePointPolicy, resolveRefundPolicy, resolveShippingPolicy, responsePlanCodeSchema, responsePointEntryTypeSchema, reviewListQuerySchema, reviewReportResultSchema, reviewRewardPointOf, reviewRewardPolicySchema, reviewSchema, reviewSortSchema, reviewWebhookEventDataSchema, reviewWebhookEventSchema, rollbackStorefrontRequestSchema, runStorefrontCheckRequestSchema, salesReportGroupBySchema, salesReportQuerySchema, salesReportRowSchema, salesReportSchema, salesTotalsSchema, saveLoginProviderRequestSchema, savedCustomInputRequestSchema, savedCustomInputSchema, savedOptionGroupRequestSchema, savedOptionGroupSchema, savedOptionSetCompositionSchema, savedOptionSetFromProductRequestSchema, savedOptionSetFromProductResultSchema, savedOptionSetListQuerySchema, savedOptionSetRequestSchema, savedOptionSetSchema, savedOptionSetSortSchema, savedOptionValueRequestSchema, savedOptionValueSchema, scopeAccessSchema, searchStorefrontFilesRequestSchema, sellerAddressListQuerySchema, sellerAddressRequestSchema, sellerAddressSchema, sellerCustomerInquirySchema, setStorefrontVisibilityRequestSchema, settleCouponShortfall, settlementDetailQuerySchema, settlementDetailSchema, settlementListQuerySchema, settlementStatusSchema, settlementSummarySchema, settlementWithDetailsSchema, shippingAddressSchema, shippingPolicyPatchSchema, shippingPolicySchema, storeCodeSchema, storeMemberRoleUpdatedSchema, storeMemberSchema, storePointPolicySchema, storeRoleSchema, storeSchema, storeScopeResourceSchema, storeSubscriptionSchema, storefrontBuildDependenciesSchema, storefrontBuildListQuerySchema, storefrontBuildSchema, storefrontBuildStatusSchema, storefrontCheckSchema, storefrontCheckStatusSchema, storefrontCustomDomainStatusSchema, storefrontCustomHostnameProblem, storefrontDependencyFindingSchema, storefrontDeploymentLogSchema, storefrontDeploymentSchema, storefrontDeploymentStepSchema, storefrontDnsRecordSchema, storefrontDomainSchema, storefrontDomainTxtNameOf, storefrontEditPreviewLabelOf, storefrontEditPreviewSchema, storefrontEditSessionSchema, storefrontEditSessionStatusSchema, storefrontEditingSchema, storefrontFileConflictDetailsSchema, storefrontFileContentQuerySchema, storefrontFileContentSchema, storefrontFileDeleteResultSchema, storefrontFileEncodingSchema, storefrontFileEntrySchema, storefrontFileHashSchema, storefrontFileListQuerySchema, storefrontFileListSchema, storefrontFileMoveResultSchema, storefrontFilePathSchema, storefrontFileSearchResultSchema, storefrontFileWriteResultSchema, storefrontHostingSchema, storefrontPreviewLinkSchema, storefrontProvisioningSchema, storefrontRuleResultSchema, storefrontRuleSeveritySchema, storefrontSiteDomainSchema, storefrontSiteDomainsSchema, storefrontSiteSchema, storefrontSiteStatusSchema, storefrontSlugAvailabilityQuerySchema, storefrontSlugAvailabilitySchema, storefrontSlugSchema, storefrontSourceArchivePartSchema, storefrontSourceArchiveQuerySchema, storefrontSourceBlobsResultSchema, storefrontSourceModeSchema, storefrontSourceRefSchema, storefrontSourceReplacedSchema, storefrontSourceSchema, storefrontSuspensionSchema, storefrontTemplateSchema, storefrontVerifyReportSchema, storefrontVersionCreatedSchema, storefrontVersionSchema, storefrontVersionStatusSchema, storefrontVisibilitySchema, subscriptionLimitsSchema, subscriptionStatusSchema, subscriptionUsageSchema, tossPaymentsCredentialsInputSchema, trackingStageResponseSchema, trackingUpdateResultSchema, updateCouponRequestSchema, updateLoginProviderRequestSchema, updateLoginSettingsRequestSchema, updateMemberRoleRequestSchema, updatePaymentProviderRequestSchema, updatePaymentSettingsRequestSchema, updatePointPolicyRequestSchema, updateStoreRequestSchema, uploadExtensionOf, uploadPurposeSchema, uploadRejection, uploadRequestSchema, uploadStorefrontSourceBlobsRequestSchema, uploadTicketSchema, upsertPortOneProviderRequestSchema, upsertTossPaymentsProviderRequestSchema, variantStockRequestSchema, variantStockSchema, verifyPaymentProviderRequestSchema, webhookCreatedSchema, webhookDeliveryDetailSchema, webhookDeliveryErrorCodeSchema, webhookDeliveryListQuerySchema, webhookDeliveryResourceSchema, webhookDeliverySchema, webhookDeliveryStatusSchema, webhookEventSchema, webhookFailureReasonSchema, webhookRedeliverFailedResultSchema, webhookRequestHeaderSchema, webhookRequestSchema, webhookResourceTypeSchema, webhookSchema, webhookSecretRotatedSchema, webhookStatusSchema, webhookTestRequestSchema, webhookTestResultSchema, withdrawCustomerRequestSchema, writeDryRunResultSchema, writePreviewSchema, writeStorefrontFilesRequestSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
package/src/client.ts CHANGED
@@ -170,6 +170,17 @@ import {
170
170
  type VerifyPaymentProviderRequest,
171
171
  verifyPaymentProviderRequestSchema,
172
172
  } from "./schemas/payment";
173
+ import {
174
+ customerPointsSchema,
175
+ type PointAdjustmentRequest,
176
+ type PointHistoryQuery,
177
+ pointAdjustmentRequestSchema,
178
+ pointAdjustmentResultSchema,
179
+ pointEntrySchema,
180
+ storePointPolicySchema,
181
+ type UpdatePointPolicyRequest,
182
+ updatePointPolicyRequestSchema,
183
+ } from "./schemas/points";
173
184
  import {
174
185
  type DiscountRequest,
175
186
  discountRequestSchema,
@@ -800,7 +811,41 @@ export function createStoreClient(options: StoreClientOptions) {
800
811
  },
801
812
 
802
813
  /** 구매자 관리 — 조회 `customer:r`, 탈퇴 처리 `customer:rw`(상점 플랫폼 OWNER·ADMIN) */
814
+ /** 적립금 — 상점 전체 원장(#93). 스코프 `promotion:r` */
815
+ points: {
816
+ /** `GET /v1/points/history` — 회원(`memberId`)·유형(`type`)·기간(`from`·`to`)으로 거른다 */
817
+ listHistory: (params?: PointHistoryQuery) =>
818
+ storeHttp.request("GET", "/points/history", pageSchema(pointEntrySchema), {
819
+ query: params as Query,
820
+ }),
821
+ },
822
+
803
823
  customers: {
824
+ /** `GET /v1/customers/{customerId}/points` — 잔액·30일 안 소멸 예정·남은 적립 묶음(#93) */
825
+ getPoints: (customerId: string) =>
826
+ storeHttp.request("GET", path`/customers/${customerId}/points`, customerPointsSchema),
827
+ /** `GET /v1/customers/{customerId}/points/history` — 적립금 내역(최신순, 셀러 사유 포함) */
828
+ listPointHistory: (customerId: string, params?: Omit<PointHistoryQuery, "memberId">) =>
829
+ storeHttp.request(
830
+ "GET",
831
+ path`/customers/${customerId}/points/history`,
832
+ pageSchema(pointEntrySchema),
833
+ { query: params as Query },
834
+ ),
835
+ /**
836
+ * `POST /v1/customers/{customerId}/points/adjustments` (201) — 스코프 `promotion:rw`. 양수 지급, 음수 차감. `idempotencyKey`가 필수다.
837
+ * 에러: 409 `POINT_BALANCE_INSUFFICIENT`·`POINTS_UNAVAILABLE`, 400 `POINT_EXPIRY_REQUIRED`. 에이전트 요청은 승인 대상이다
838
+ */
839
+ adjustPoints: (customerId: string, body: PointAdjustmentRequest, idempotencyKey: string) =>
840
+ storeHttp.request(
841
+ "POST",
842
+ path`/customers/${customerId}/points/adjustments`,
843
+ pointAdjustmentResultSchema,
844
+ {
845
+ body: pointAdjustmentRequestSchema.parse(body),
846
+ headers: idempotency(idempotencyKey),
847
+ },
848
+ ),
804
849
  list: (
805
850
  params?: PageParams & Omit<z.input<typeof customerListQuerySchema>, "page" | "size">,
806
851
  ) =>
@@ -1553,6 +1598,19 @@ export function createStoreClient(options: StoreClientOptions) {
1553
1598
  storeHttp.request("PATCH", "/store", storeSchema, {
1554
1599
  body: updateStoreRequestSchema.parse(body),
1555
1600
  }),
1601
+ /**
1602
+ * `GET /v1/store/point-policy` — 스코프 `promotion:r`. 적립금 정책(리뷰 적립·유효 기간)과 준비 여부(`available`), 상점에 보일 안내(`notice`).
1603
+ * 정책을 정하지 않았으면 모두 끔이다(#93)
1604
+ */
1605
+ getPointPolicy: () => storeHttp.request("GET", "/store/point-policy", storePointPolicySchema),
1606
+ /**
1607
+ * `PUT /v1/store/point-policy` — 스코프 `promotion:rw`. 준 항목만 바꾼다. 에이전트 요청은 승인 대상이다.
1608
+ * 에러: 409 `POINTS_UNAVAILABLE`(준비 중) · 400 `POINT_EXPIRY_REQUIRED`(리뷰 적립을 켜는데 유효 기간이 없음)
1609
+ */
1610
+ updatePointPolicy: (body: UpdatePointPolicyRequest) =>
1611
+ storeHttp.request("PUT", "/store/point-policy", storePointPolicySchema, {
1612
+ body: updatePointPolicyRequestSchema.parse(body),
1613
+ }),
1556
1614
  listMembers: () => storeHttp.request("GET", "/store/members", z.array(storeMemberSchema)),
1557
1615
  /** `PATCH /v1/store/members/{userId}` — 스코프 `member:rw`. OWNER는 바꿀 수 없고 ADMIN 지정·ADMIN 변경은 OWNER만 한다 */
1558
1616
  updateMemberRole: (userId: string, body: UpdateMemberRoleRequest) =>
package/src/index.ts CHANGED
@@ -32,6 +32,7 @@ export * from "./schemas/login";
32
32
  export * from "./schemas/misc";
33
33
  export * from "./schemas/order";
34
34
  export * from "./schemas/payment";
35
+ export * from "./schemas/points";
35
36
  export * from "./schemas/product";
36
37
  export * from "./schemas/promotion";
37
38
  export * from "./schemas/refund-policy";