@sayren/store-sdk 0.30.1 → 0.30.3

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
@@ -2592,12 +2592,24 @@ const collectionPreviewSchema = z.object({
2592
2592
  */
2593
2593
  const flowInputFieldSchema = z.object({
2594
2594
  key: z.string(),
2595
- type: z.string().describe("text · number · select · date · datetime · image (늘어날 수 있다)"),
2595
+ type: z.string().describe("text · textarea · number · select · radio · checkbox · boolean · date · datetime · image (늘어날 수 있다). 값: checkbox는 고른 선택지 배열, boolean은 참거짓(필수면 true), date는 `YYYY-MM-DD`, datetime은 오프셋 있는 ISO 8601, image는 https 주소 배열"),
2596
2596
  required: z.boolean(),
2597
2597
  label: z.string(),
2598
+ placeholder: z.string().optional().describe("입력 안내"),
2598
2599
  maxLength: z.number().int().optional(),
2599
2600
  maxFiles: z.number().int().optional(),
2600
- options: z.array(z.union([z.string(), z.number()])).optional()
2601
+ options: z.array(z.union([
2602
+ z.string(),
2603
+ z.number(),
2604
+ z.object({
2605
+ value: z.string(),
2606
+ label: z.string()
2607
+ }).describe("값과 보여 줄 이름")
2608
+ ])).optional().describe("고르는 형식의 선택지. 값만 있거나 값·이름 쌍이다(보낼 때는 값)"),
2609
+ when: z.object({
2610
+ key: z.string(),
2611
+ in: z.array(z.string())
2612
+ }).optional().describe("다른 칸(`key`)의 값이 `in` 중 하나일 때만 보이고 받는 칸. 없으면 늘 받는다")
2601
2613
  });
2602
2614
  const flowActionSchema = z.object({
2603
2615
  key: z.string().describe("행동 키. 플랫폼 키(예: CONFIRM_ORDER)와 상점·앱이 정한 키가 섞인다"),
@@ -2634,6 +2646,21 @@ const flowStateSchema = z.object({
2634
2646
  enteredAt: z.string().describe("이 상태에 들어온 시각(ISO 8601)"),
2635
2647
  deadlineAt: z.string().optional().describe("가장 가까운 기한(ISO 8601)"),
2636
2648
  attachments: z.array(z.string()).optional().describe("가장 최근 행동이 붙인 첨부 주소(시안 등, #115). 없으면 생략"),
2649
+ earlierAttachments: z.array(z.string()).optional().describe("앞 상태에서 붙인 첨부(수정 요청 뒤의 이전 시안 등). 다음 첨부가 오면 바뀐다. 없으면 생략"),
2650
+ inputs: z.object({
2651
+ by: z.string().describe("적은 사람 — seller · buyer"),
2652
+ values: z.array(z.object({
2653
+ key: z.string(),
2654
+ label: z.string(),
2655
+ type: z.string(),
2656
+ value: z.union([
2657
+ z.string(),
2658
+ z.number(),
2659
+ z.boolean(),
2660
+ z.array(z.string())
2661
+ ])
2662
+ }))
2663
+ }).optional().describe("이 상태로 오게 한 행동의 입력값(수정 내용 등, #115). 없으면 생략"),
2637
2664
  progress: z.boolean().optional().describe("진행 단계 표시에 넣는 상태인가"),
2638
2665
  fields: z.record(z.string(), flowFieldValueSchema).describe("보는 사람 공개 범위의 커스텀 필드")
2639
2666
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sayren/store-sdk",
3
- "version": "0.30.1",
3
+ "version": "0.30.3",
4
4
  "main": "./dist/index.mjs",
5
5
  "types": "./dist/index.d.mts",
6
6
  "exports": {
@@ -10,12 +10,30 @@ import { orderItemStatusSchema } from "./common";
10
10
 
11
11
  export const flowInputFieldSchema = z.object({
12
12
  key: z.string(),
13
- type: z.string().describe("text · number · select · date · datetime · image (늘어날 수 있다)"),
13
+ type: z
14
+ .string()
15
+ .describe(
16
+ "text · textarea · number · select · radio · checkbox · boolean · date · datetime · image (늘어날 수 있다). 값: checkbox는 고른 선택지 배열, boolean은 참거짓(필수면 true), date는 `YYYY-MM-DD`, datetime은 오프셋 있는 ISO 8601, image는 https 주소 배열",
17
+ ),
14
18
  required: z.boolean(),
15
19
  label: z.string(),
20
+ placeholder: z.string().optional().describe("입력 안내"),
16
21
  maxLength: z.number().int().optional(),
17
22
  maxFiles: z.number().int().optional(),
18
- options: z.array(z.union([z.string(), z.number()])).optional(),
23
+ options: z
24
+ .array(
25
+ z.union([
26
+ z.string(),
27
+ z.number(),
28
+ z.object({ value: z.string(), label: z.string() }).describe("값과 보여 줄 이름"),
29
+ ]),
30
+ )
31
+ .optional()
32
+ .describe("고르는 형식의 선택지. 값만 있거나 값·이름 쌍이다(보낼 때는 값)"),
33
+ when: z
34
+ .object({ key: z.string(), in: z.array(z.string()) })
35
+ .optional()
36
+ .describe("다른 칸(`key`)의 값이 `in` 중 하나일 때만 보이고 받는 칸. 없으면 늘 받는다"),
19
37
  });
20
38
  export type FlowInputField = z.infer<typeof flowInputFieldSchema>;
21
39
 
@@ -62,6 +80,26 @@ export const flowStateSchema = z.object({
62
80
  .array(z.string())
63
81
  .optional()
64
82
  .describe("가장 최근 행동이 붙인 첨부 주소(시안 등, #115). 없으면 생략"),
83
+ earlierAttachments: z
84
+ .array(z.string())
85
+ .optional()
86
+ .describe(
87
+ "앞 상태에서 붙인 첨부(수정 요청 뒤의 이전 시안 등). 다음 첨부가 오면 바뀐다. 없으면 생략",
88
+ ),
89
+ inputs: z
90
+ .object({
91
+ by: z.string().describe("적은 사람 — seller · buyer"),
92
+ values: z.array(
93
+ z.object({
94
+ key: z.string(),
95
+ label: z.string(),
96
+ type: z.string(),
97
+ value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
98
+ }),
99
+ ),
100
+ })
101
+ .optional()
102
+ .describe("이 상태로 오게 한 행동의 입력값(수정 내용 등, #115). 없으면 생략"),
65
103
  progress: z.boolean().optional().describe("진행 단계 표시에 넣는 상태인가"),
66
104
  fields: z.record(z.string(), flowFieldValueSchema).describe("보는 사람 공개 범위의 커스텀 필드"),
67
105
  });