@sayren/store-sdk 0.30.3 → 0.30.4

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
@@ -92,6 +92,7 @@ const writePreviewSchema = z.object({
92
92
  type: z.string(),
93
93
  id: z.string().nullable()
94
94
  }),
95
+ targetName: z.string().nullable().optional().describe("대상 이름(상품명·쿠폰명·흐름 이름·구매자 이름 등). 읽을 수 없으면 null"),
95
96
  changes: z.array(z.object({
96
97
  field: z.string().describe("바뀌는 필드"),
97
98
  before: z.unknown().describe("현재 값. 새로 만드는 요청이거나 읽을 수 없으면 null"),
@@ -119,6 +120,7 @@ const approvalRequestSchema = z.object({
119
120
  approvalId: z.string().describe("승인 요청 ID"),
120
121
  status: approvalStatusSchema,
121
122
  operationId: z.string().describe("보류된 오퍼레이션 ID"),
123
+ operationName: z.string().nullable().optional().describe("작업 이름(예: 흐름 게시, 구매자 적립금 지급·차감). API 문서의 요약과 같다. 모르면 null"),
122
124
  method: z.string().describe("HTTP 메서드"),
123
125
  path: z.string().describe("요청 경로와 쿼리"),
124
126
  body: z.unknown().describe("요청 본문. 승인하면 이 본문 그대로 실행한다. 없으면 null"),
@@ -1441,7 +1443,7 @@ const POINT_ADJUSTMENT_MAX = 1e7;
1441
1443
  const pointAdjustmentRequestSchema = z.object({
1442
1444
  amount: z.number().int().min(-1e7).max(POINT_ADJUSTMENT_MAX).refine((value) => value !== 0, "0원은 조정할 수 없습니다").describe("지급은 양수, 차감은 음수(원)"),
1443
1445
  reason: z.string().trim().min(1).max(200).describe("사유(필수). 구매자에게는 보이지 않는다"),
1444
- expiresAt: z.iso.datetime({ offset: true }).optional().describe("지급분의 소멸 시각. 생략하면 정책 유효 기간으로 정한다. 차감에는 주지 않는다")
1446
+ expiresAt: z.iso.datetime({ offset: true }).optional().describe("지급분의 소멸 시각. 생략하면 정책 유효 기간(`expiryDays`)으로 정한다. **정책 유효 기간이 없으면 지급에 필수다**(없으면 400 `POINT_EXPIRY_REQUIRED`). 차감에는 주지 않는다")
1445
1447
  }).refine((value) => !(value.amount < 0 && value.expiresAt), {
1446
1448
  message: "차감에는 소멸 시각을 줄 수 없습니다",
1447
1449
  path: ["expiresAt"]
@@ -2742,8 +2744,8 @@ const commerceFlowSummarySchema = z.object({
2742
2744
  flowId: z.string(),
2743
2745
  key: z.string().describe("상점 안 유일한 키"),
2744
2746
  name: z.string(),
2745
- progression: z.enum(["ITEM", "ORDER_GROUP"]),
2746
- fulfillmentMethods: z.array(z.string()),
2747
+ progression: z.enum(["ITEM", "ORDER_GROUP"]).describe("진행 단위 — 지금 게시 버전의 값(초안 `definition.requires.progression`을 게시 때 고정한다). 주문상품은 주문 시점 버전의 값을 따른다"),
2748
+ fulfillmentMethods: z.array(z.string()).describe("이행 방식 — 지금 게시 버전의 `definition.requires.fulfillmentMethods`"),
2747
2749
  presetKey: z.string().nullable().describe("설치한 프리셋(설치 뒤 연결되지 않는다)"),
2748
2750
  presetVersion: z.number().int().nullable(),
2749
2751
  activeVersion: z.number().int().nullable().describe("게시된 버전. 새 주문이 따른다"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.30.3",
3
+ "version": "0.30.4",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
@@ -155,6 +155,11 @@ export const writePreviewSchema = z.object({
155
155
  method: z.string(),
156
156
  path: z.string(),
157
157
  target: z.object({ type: z.string(), id: z.string().nullable() }),
158
+ targetName: z
159
+ .string()
160
+ .nullable()
161
+ .optional()
162
+ .describe("대상 이름(상품명·쿠폰명·흐름 이름·구매자 이름 등). 읽을 수 없으면 null"),
158
163
  changes: z
159
164
  .array(
160
165
  z.object({
@@ -195,6 +200,13 @@ export const approvalRequestSchema = z.object({
195
200
  approvalId: z.string().describe("승인 요청 ID"),
196
201
  status: approvalStatusSchema,
197
202
  operationId: z.string().describe("보류된 오퍼레이션 ID"),
203
+ operationName: z
204
+ .string()
205
+ .nullable()
206
+ .optional()
207
+ .describe(
208
+ "작업 이름(예: 흐름 게시, 구매자 적립금 지급·차감). API 문서의 요약과 같다. 모르면 null",
209
+ ),
198
210
  method: z.string().describe("HTTP 메서드"),
199
211
  path: z.string().describe("요청 경로와 쿼리"),
200
212
  body: z.unknown().describe("요청 본문. 승인하면 이 본문 그대로 실행한다. 없으면 null"),
@@ -214,8 +214,14 @@ export const commerceFlowSummarySchema = z.object({
214
214
  flowId: z.string(),
215
215
  key: z.string().describe("상점 안 유일한 키"),
216
216
  name: z.string(),
217
- progression: z.enum(["ITEM", "ORDER_GROUP"]),
218
- fulfillmentMethods: z.array(z.string()),
217
+ progression: z
218
+ .enum(["ITEM", "ORDER_GROUP"])
219
+ .describe(
220
+ "진행 단위 — 지금 게시 버전의 값(초안 `definition.requires.progression`을 게시 때 고정한다). 주문상품은 주문 시점 버전의 값을 따른다",
221
+ ),
222
+ fulfillmentMethods: z
223
+ .array(z.string())
224
+ .describe("이행 방식 — 지금 게시 버전의 `definition.requires.fulfillmentMethods`"),
219
225
  presetKey: z.string().nullable().describe("설치한 프리셋(설치 뒤 연결되지 않는다)"),
220
226
  presetVersion: z.number().int().nullable(),
221
227
  activeVersion: z.number().int().nullable().describe("게시된 버전. 새 주문이 따른다"),
@@ -331,7 +331,9 @@ export const pointAdjustmentRequestSchema = z
331
331
  expiresAt: z.iso
332
332
  .datetime({ offset: true })
333
333
  .optional()
334
- .describe("지급분의 소멸 시각. 생략하면 정책 유효 기간으로 정한다. 차감에는 주지 않는다"),
334
+ .describe(
335
+ "지급분의 소멸 시각. 생략하면 정책 유효 기간(`expiryDays`)으로 정한다. **정책 유효 기간이 없으면 지급에 필수다**(없으면 400 `POINT_EXPIRY_REQUIRED`). 차감에는 주지 않는다",
336
+ ),
335
337
  })
336
338
  .refine((value) => !(value.amount < 0 && value.expiresAt), {
337
339
  message: "차감에는 소멸 시각을 줄 수 없습니다",