@mawaru/sdk 0.15.0 → 0.17.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/_schemas/graph.ts CHANGED
@@ -230,6 +230,36 @@ export const graphNodeHookSchema = z.object({
230
230
  export type GraphNodeHook = z.infer<typeof graphNodeHookSchema>
231
231
 
232
232
  // 新規ノードの id・ポートの id もクライアントが採番する(一時IDの解決を不要にする)
233
+ // ノードの表示アイコン:プリセット・絵文字・画像 URL のいずれか一つ。
234
+ // 未設定(省略)=既定の kind アイコン(docs/tasks/wip/ノードのアイコン(プログラム任意設定・HUMAN担当者の自動表示).md)。
235
+ // preset は契約上不透明な文字列(承認ビューと同じ方式):カタログはフロントが
236
+ // 表示時に参照し、無い key は既定グリフへフォールバックする
237
+ export const nodeIconSchema = z.union([
238
+ z.strictObject({ preset: z.string().min(1) }),
239
+ // ZWJ 合字の絵文字を許容する長さ(1グリフでも code unit は最大10超になりうる)
240
+ z.strictObject({ emoji: z.string().min(1).max(16) }),
241
+ z.strictObject({ image_url: z.url() }),
242
+ ])
243
+ export type NodeIcon = z.infer<typeof nodeIconSchema>
244
+
245
+ // mawaru 提供のプリセットアイコンのカタログ(SVG 実体はフロントに同梱)
246
+ export const NODE_ICON_PRESETS = [
247
+ { key: "github", name: "GitHub" },
248
+ { key: "slack", name: "Slack" },
249
+ { key: "gmail", name: "Gmail" },
250
+ { key: "google-sheets", name: "Google スプレッドシート" },
251
+ { key: "google-drive", name: "Google Drive" },
252
+ { key: "google-analytics", name: "Google Analytics" },
253
+ { key: "notion", name: "Notion" },
254
+ { key: "salesforce", name: "Salesforce" },
255
+ { key: "freee", name: "freee" },
256
+ { key: "airtable", name: "Airtable" },
257
+ { key: "stripe", name: "Stripe" },
258
+ { key: "hubspot", name: "HubSpot" },
259
+ { key: "sentry", name: "Sentry" },
260
+ ] as const
261
+ export type NodeIconPresetKey = (typeof NODE_ICON_PRESETS)[number]["key"]
262
+
233
263
  export const graphNodeSchema = z.object({
234
264
  id: z.uuid(),
235
265
  kind: graphNodeKindSchema,
@@ -238,6 +268,13 @@ export const graphNodeSchema = z.object({
238
268
  hooks: z.array(graphNodeHookSchema).default([]),
239
269
  position_x: z.number(),
240
270
  position_y: z.number(),
271
+ // 表示アイコン(全 kind 共通の任意設定。human はフロントが担当から導出するので通常設定しない)
272
+ icon: nodeIconSchema.optional(),
273
+ // Slack ビュー(全 kind 共通の任意設定。承認待ち・完了メッセージの見せ方)。
274
+ // human の view と同じ「不透明なキー」で、実在・可視性の検証は保存時に mawaru 側が行う
275
+ // (カタログは非公開。@mawaru/common の slack-view.ts)。省略時は従来表示。
276
+ // ポートの型には一切影響しない
277
+ slack_view: z.string().min(1).optional(),
241
278
  // kind 別設定(自 kind のときだけ意味を持つ。省略時は保存側がデフォルトを補う)
242
279
  wait: waitConfigSchema.optional(),
243
280
  program: programConfigSchema.optional(),
@@ -78,6 +78,55 @@ export declare const graphNodeHookSchema: z.ZodObject<{
78
78
  on_signal: z.ZodDefault<z.ZodBoolean>;
79
79
  }, z.core.$strip>;
80
80
  export type GraphNodeHook = z.infer<typeof graphNodeHookSchema>;
81
+ export declare const nodeIconSchema: z.ZodUnion<readonly [z.ZodObject<{
82
+ preset: z.ZodString;
83
+ }, z.core.$strict>, z.ZodObject<{
84
+ emoji: z.ZodString;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ image_url: z.ZodURL;
87
+ }, z.core.$strict>]>;
88
+ export type NodeIcon = z.infer<typeof nodeIconSchema>;
89
+ export declare const NODE_ICON_PRESETS: readonly [{
90
+ readonly key: "github";
91
+ readonly name: "GitHub";
92
+ }, {
93
+ readonly key: "slack";
94
+ readonly name: "Slack";
95
+ }, {
96
+ readonly key: "gmail";
97
+ readonly name: "Gmail";
98
+ }, {
99
+ readonly key: "google-sheets";
100
+ readonly name: "Google スプレッドシート";
101
+ }, {
102
+ readonly key: "google-drive";
103
+ readonly name: "Google Drive";
104
+ }, {
105
+ readonly key: "google-analytics";
106
+ readonly name: "Google Analytics";
107
+ }, {
108
+ readonly key: "notion";
109
+ readonly name: "Notion";
110
+ }, {
111
+ readonly key: "salesforce";
112
+ readonly name: "Salesforce";
113
+ }, {
114
+ readonly key: "freee";
115
+ readonly name: "freee";
116
+ }, {
117
+ readonly key: "airtable";
118
+ readonly name: "Airtable";
119
+ }, {
120
+ readonly key: "stripe";
121
+ readonly name: "Stripe";
122
+ }, {
123
+ readonly key: "hubspot";
124
+ readonly name: "HubSpot";
125
+ }, {
126
+ readonly key: "sentry";
127
+ readonly name: "Sentry";
128
+ }];
129
+ export type NodeIconPresetKey = (typeof NODE_ICON_PRESETS)[number]["key"];
81
130
  export declare const graphNodeSchema: z.ZodObject<{
82
131
  id: z.ZodUUID;
83
132
  kind: z.ZodEnum<{
@@ -117,6 +166,14 @@ export declare const graphNodeSchema: z.ZodObject<{
117
166
  }, z.core.$strip>>>;
118
167
  position_x: z.ZodNumber;
119
168
  position_y: z.ZodNumber;
169
+ icon: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
170
+ preset: z.ZodString;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ emoji: z.ZodString;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ image_url: z.ZodURL;
175
+ }, z.core.$strict>]>>;
176
+ slack_view: z.ZodOptional<z.ZodString>;
120
177
  wait: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
121
178
  wait_type: z.ZodLiteral<"duration">;
122
179
  duration_seconds: z.ZodNumber;
@@ -209,6 +266,14 @@ export declare const saveGraphBodySchema: z.ZodObject<{
209
266
  }, z.core.$strip>>>;
210
267
  position_x: z.ZodNumber;
211
268
  position_y: z.ZodNumber;
269
+ icon: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
270
+ preset: z.ZodString;
271
+ }, z.core.$strict>, z.ZodObject<{
272
+ emoji: z.ZodString;
273
+ }, z.core.$strict>, z.ZodObject<{
274
+ image_url: z.ZodURL;
275
+ }, z.core.$strict>]>>;
276
+ slack_view: z.ZodOptional<z.ZodString>;
212
277
  wait: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
213
278
  wait_type: z.ZodLiteral<"duration">;
214
279
  duration_seconds: z.ZodNumber;
@@ -178,6 +178,32 @@ export const graphNodeHookSchema = z.object({
178
178
  on_signal: z.boolean().default(false),
179
179
  });
180
180
  // 新規ノードの id・ポートの id もクライアントが採番する(一時IDの解決を不要にする)
181
+ // ノードの表示アイコン:プリセット・絵文字・画像 URL のいずれか一つ。
182
+ // 未設定(省略)=既定の kind アイコン(docs/tasks/wip/ノードのアイコン(プログラム任意設定・HUMAN担当者の自動表示).md)。
183
+ // preset は契約上不透明な文字列(承認ビューと同じ方式):カタログはフロントが
184
+ // 表示時に参照し、無い key は既定グリフへフォールバックする
185
+ export const nodeIconSchema = z.union([
186
+ z.strictObject({ preset: z.string().min(1) }),
187
+ // ZWJ 合字の絵文字を許容する長さ(1グリフでも code unit は最大10超になりうる)
188
+ z.strictObject({ emoji: z.string().min(1).max(16) }),
189
+ z.strictObject({ image_url: z.url() }),
190
+ ]);
191
+ // mawaru 提供のプリセットアイコンのカタログ(SVG 実体はフロントに同梱)
192
+ export const NODE_ICON_PRESETS = [
193
+ { key: "github", name: "GitHub" },
194
+ { key: "slack", name: "Slack" },
195
+ { key: "gmail", name: "Gmail" },
196
+ { key: "google-sheets", name: "Google スプレッドシート" },
197
+ { key: "google-drive", name: "Google Drive" },
198
+ { key: "google-analytics", name: "Google Analytics" },
199
+ { key: "notion", name: "Notion" },
200
+ { key: "salesforce", name: "Salesforce" },
201
+ { key: "freee", name: "freee" },
202
+ { key: "airtable", name: "Airtable" },
203
+ { key: "stripe", name: "Stripe" },
204
+ { key: "hubspot", name: "HubSpot" },
205
+ { key: "sentry", name: "Sentry" },
206
+ ];
181
207
  export const graphNodeSchema = z.object({
182
208
  id: z.uuid(),
183
209
  kind: graphNodeKindSchema,
@@ -186,6 +212,13 @@ export const graphNodeSchema = z.object({
186
212
  hooks: z.array(graphNodeHookSchema).default([]),
187
213
  position_x: z.number(),
188
214
  position_y: z.number(),
215
+ // 表示アイコン(全 kind 共通の任意設定。human はフロントが担当から導出するので通常設定しない)
216
+ icon: nodeIconSchema.optional(),
217
+ // Slack ビュー(全 kind 共通の任意設定。承認待ち・完了メッセージの見せ方)。
218
+ // human の view と同じ「不透明なキー」で、実在・可視性の検証は保存時に mawaru 側が行う
219
+ // (カタログは非公開。@mawaru/common の slack-view.ts)。省略時は従来表示。
220
+ // ポートの型には一切影響しない
221
+ slack_view: z.string().min(1).optional(),
189
222
  // kind 別設定(自 kind のときだけ意味を持つ。省略時は保存側がデフォルトを補う)
190
223
  wait: waitConfigSchema.optional(),
191
224
  program: programConfigSchema.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mawaru/sdk",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "mawaru 実行 repo の開発 SDK。契約スキーマ(config.json 規約・ループ graph API)の正 + typegen / validate CLI",
5
5
  "type": "module",
6
6
  "bin": {