harvask-cli 0.4.0 → 0.6.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.
@@ -1,26 +1,104 @@
1
1
  /**
2
2
  * scheduled-task カテゴリ(定期タスク, /v1/projects/{project}/scheduled-tasks)。
3
+ *
4
+ * サーバー側の契約は ScheduledTaskController(store / update / execute)と
5
+ * Concerns/ProvidesScheduledTaskRules(automation_settings)。
6
+ * 実行タイプごとに受け付けるフィールドが変わるため、送る前にここで型別に振り分ける
7
+ * (サーバーはルールに無いフィールドを 422 にせず黙って捨てるので、
8
+ * 誤った組み合わせは CLI 側で落として「設定したのに効かない」を防ぐ)。
3
9
  */
4
10
  import { execCall, parseProjectArg, requireConfirmation } from '../_exec.js';
5
11
  import { printOutput } from '../../output/index.js';
6
12
  import { ValidationError } from '../../errors/index.js';
7
- import { parseIntArg, parseNumberList, readContentArg, parseJsonObjectArg } from '../../utils/input.js';
13
+ import { parseIntArg, parseNumberList, readContentArg, parseJsonObjectArg, parseJsonObjectOrNullArg, } from '../../utils/input.js';
8
14
  import { API_NS } from '../../api-base.js';
9
15
  const BASE = `${API_NS}/projects/{project}/scheduled-tasks`;
10
- export const EXECUTION_TYPES = ['issue', 'workflow'];
16
+ /** 手動実行は課題作成やチャット送信まで走るので、既定より長めに待ち、リトライもしない。 */
17
+ const SLOW_OP_TIMEOUT_MS = 120000;
18
+ export const EXECUTION_TYPES = ['issue', 'workflow', 'chat'];
11
19
  export const FREQUENCIES = ['daily', 'weekly', 'monthly', 'cron'];
12
20
  export const ST_ISSUE_TYPES = ['task', 'bug', 'feature', 'research', 'one_shot'];
13
21
  export const ST_PRIORITIES = ['low', 'normal', 'high', 'urgent'];
22
+ /** 実行日が非営業日に当たったときの寄せ方。 */
23
+ export const BUSINESS_DAY_ADJUSTMENTS = ['none', 'previous', 'next'];
24
+ /** chat 型の本文の組み立て方(template = 本文そのまま / ai = AI への指示)。 */
25
+ export const CHAT_COMPOSE_MODES = ['template', 'ai'];
26
+ /** automation_settings(AI を介さないシェルコマンド自動実行)で受け付けるキー。 */
27
+ const AUTOMATION_STRING_KEYS = ['command', 'trigger_status', 'on_success_status', 'on_failure_status'];
28
+ const AUTOMATION_MAX_LENGTH = {
29
+ command: 5000,
30
+ trigger_status: 64,
31
+ on_success_status: 64,
32
+ on_failure_status: 64,
33
+ };
14
34
  function assertEnum(value, allowed, field) {
15
35
  if (!allowed.includes(value))
16
36
  throw new ValidationError(`${field} must be one of: ${allowed.join(', ')}`);
17
37
  }
38
+ /**
39
+ * --automation の中身を検証する。
40
+ *
41
+ * null は自動化設定そのものの解除。オブジェクトの場合、サーバーは既存値とマージし、
42
+ * サブキーの明示 null だけをそのキーの解除として扱う(全置換ではない)。
43
+ */
44
+ export function normalizeAutomationSettings(value) {
45
+ if (value === null)
46
+ return null;
47
+ const allowed = [...AUTOMATION_STRING_KEYS, 'timeout_sec'];
48
+ const out = {};
49
+ for (const [key, raw] of Object.entries(value)) {
50
+ if (!allowed.includes(key)) {
51
+ throw new ValidationError(`--automation: unknown key "${key}" (allowed: ${allowed.join(', ')})`);
52
+ }
53
+ if (raw === null) {
54
+ out[key] = null;
55
+ continue;
56
+ }
57
+ if (key === 'timeout_sec') {
58
+ if (typeof raw !== 'number' || !Number.isInteger(raw) || raw < 1 || raw > 3600) {
59
+ throw new ValidationError('--automation: timeout_sec must be an integer between 1 and 3600');
60
+ }
61
+ }
62
+ else {
63
+ if (typeof raw !== 'string') {
64
+ throw new ValidationError(`--automation: ${key} must be a string`);
65
+ }
66
+ const max = AUTOMATION_MAX_LENGTH[key];
67
+ if (raw.length > max) {
68
+ throw new ValidationError(`--automation: ${key} must be <= ${max} characters`);
69
+ }
70
+ }
71
+ out[key] = raw;
72
+ }
73
+ return out;
74
+ }
75
+ /** HH:MM / 曜日 / 日 の形だけを見る(頻度との必須関係は呼び出し側)。 */
76
+ function assertScheduleShape(a) {
77
+ if (a.executionTime !== undefined && !/^\d{2}:\d{2}$/.test(a.executionTime)) {
78
+ throw new ValidationError('--time must be HH:MM');
79
+ }
80
+ if (a.dayOfWeek !== undefined && (a.dayOfWeek < 0 || a.dayOfWeek > 6)) {
81
+ throw new ValidationError('--day-of-week must be 0-6');
82
+ }
83
+ if (a.dayOfMonth !== undefined && (a.dayOfMonth < 1 || a.dayOfMonth > 28)) {
84
+ throw new ValidationError('--day-of-month must be 1-28');
85
+ }
86
+ }
18
87
  export function buildScheduledTaskListCall() {
19
88
  return { method: 'GET', path: BASE };
20
89
  }
21
90
  export function buildScheduledTaskShowCall(id) {
22
91
  return { method: 'GET', path: `${BASE}/${id}` };
23
92
  }
93
+ /** 手動実行(POST .../{id}/execute)。課題作成・チャット送信まで走るので冪等ではない。 */
94
+ export function buildScheduledTaskExecuteCall(id) {
95
+ return {
96
+ method: 'POST',
97
+ path: `${BASE}/${id}/execute`,
98
+ noRetry: true,
99
+ timeout: SLOW_OP_TIMEOUT_MS,
100
+ };
101
+ }
24
102
  export function buildScheduledTaskCreateCall(a) {
25
103
  if (!a.name || a.name.trim() === '')
26
104
  throw new ValidationError('name is required (--name)');
@@ -28,6 +106,7 @@ export function buildScheduledTaskCreateCall(a) {
28
106
  throw new ValidationError('name must be <= 255 characters');
29
107
  assertEnum(a.executionType, EXECUTION_TYPES, 'execution-type');
30
108
  assertEnum(a.frequency, FREQUENCIES, 'frequency');
109
+ const executionType = a.executionType;
31
110
  // 頻度別の必須チェック
32
111
  if (a.frequency === 'cron') {
33
112
  if (!a.cronExpression)
@@ -36,8 +115,6 @@ export function buildScheduledTaskCreateCall(a) {
36
115
  else {
37
116
  if (!a.executionTime)
38
117
  throw new ValidationError('--time (HH:MM) is required unless frequency=cron');
39
- if (!/^\d{2}:\d{2}$/.test(a.executionTime))
40
- throw new ValidationError('--time must be HH:MM');
41
118
  }
42
119
  if (a.frequency === 'weekly' && a.dayOfWeek === undefined) {
43
120
  throw new ValidationError('--day-of-week (0-6) is required when frequency=weekly');
@@ -45,34 +122,50 @@ export function buildScheduledTaskCreateCall(a) {
45
122
  if (a.frequency === 'monthly' && a.dayOfMonth === undefined) {
46
123
  throw new ValidationError('--day-of-month (1-28) is required when frequency=monthly');
47
124
  }
48
- if (a.dayOfWeek !== undefined && (a.dayOfWeek < 0 || a.dayOfWeek > 6)) {
49
- throw new ValidationError('--day-of-week must be 0-6');
50
- }
51
- if (a.dayOfMonth !== undefined && (a.dayOfMonth < 1 || a.dayOfMonth > 28)) {
52
- throw new ValidationError('--day-of-month must be 1-28');
125
+ assertScheduleShape(a);
126
+ if (a.businessDayAdjustment) {
127
+ assertEnum(a.businessDayAdjustment, BUSINESS_DAY_ADJUSTMENTS, 'business-day-adjustment');
53
128
  }
54
129
  // execution_type 別の必須
55
- if (a.executionType === 'issue') {
130
+ if (executionType === 'issue') {
56
131
  if (!a.title)
57
132
  throw new ValidationError('--title is required when execution-type=issue');
58
133
  if (!a.priority)
59
134
  throw new ValidationError('--priority is required when execution-type=issue');
135
+ if (!a.issueType && a.issueTypeId === undefined) {
136
+ throw new ValidationError('--issue-type or --issue-type-id is required when execution-type=issue');
137
+ }
60
138
  }
61
- else if (a.executionType === 'workflow') {
62
- if (a.workflowTemplateId === undefined)
139
+ else if (executionType === 'workflow') {
140
+ if (a.workflowTemplateId === undefined) {
63
141
  throw new ValidationError('--workflow-template-id is required when execution-type=workflow');
142
+ }
143
+ }
144
+ else {
145
+ if (!a.chatMessageTemplate) {
146
+ throw new ValidationError('--chat-message is required when execution-type=chat');
147
+ }
148
+ if (a.chatMessageTemplate.length > 5000) {
149
+ throw new ValidationError('--chat-message must be <= 5000 characters');
150
+ }
64
151
  }
65
152
  if (a.issueType)
66
153
  assertEnum(a.issueType, ST_ISSUE_TYPES, 'issue-type');
67
154
  if (a.priority)
68
155
  assertEnum(a.priority, ST_PRIORITIES, 'priority');
156
+ if (a.chatComposeMode)
157
+ assertEnum(a.chatComposeMode, CHAT_COMPOSE_MODES, 'chat-compose-mode');
69
158
  const b = {
70
159
  name: a.name.trim(),
71
- execution_type: a.executionType,
160
+ execution_type: executionType,
72
161
  frequency: a.frequency,
73
162
  };
74
163
  if (a.description !== undefined)
75
164
  b.description = a.description;
165
+ if (a.isActive !== undefined)
166
+ b.is_active = a.isActive;
167
+ if (a.businessDayAdjustment !== undefined)
168
+ b.business_day_adjustment = a.businessDayAdjustment;
76
169
  if (a.executionTime !== undefined)
77
170
  b.execution_time = a.executionTime;
78
171
  if (a.dayOfWeek !== undefined)
@@ -81,16 +174,33 @@ export function buildScheduledTaskCreateCall(a) {
81
174
  b.day_of_month = a.dayOfMonth;
82
175
  if (a.cronExpression !== undefined)
83
176
  b.cron_expression = a.cronExpression;
177
+ // title は chat 型でも受け付けられる(未指定なら name で補完される)。
84
178
  if (a.title !== undefined)
85
179
  b.title = a.title;
86
- if (a.issueType !== undefined)
87
- b.issue_type = a.issueType;
88
- if (a.priority !== undefined)
89
- b.priority = a.priority;
90
- if (a.workflowTemplateId !== undefined)
91
- b.workflow_template_id = a.workflowTemplateId;
92
- if (a.executionType === 'workflow' && a.workflowParameters !== undefined) {
93
- b.workflow_parameters = a.workflowParameters;
180
+ // issue_type / priority / workspace_only は chat 型ではルールに無く、送っても捨てられる。
181
+ if (executionType !== 'chat') {
182
+ if (a.issueType !== undefined)
183
+ b.issue_type = a.issueType;
184
+ if (a.issueTypeId !== undefined)
185
+ b.issue_type_id = a.issueTypeId;
186
+ if (a.priority !== undefined)
187
+ b.priority = a.priority;
188
+ if (a.workspaceOnly !== undefined)
189
+ b.workspace_only = a.workspaceOnly;
190
+ }
191
+ if (executionType === 'workflow') {
192
+ if (a.workflowTemplateId !== undefined)
193
+ b.workflow_template_id = a.workflowTemplateId;
194
+ if (a.workflowParameters !== undefined)
195
+ b.workflow_parameters = a.workflowParameters;
196
+ }
197
+ if (executionType === 'chat') {
198
+ if (a.chatComposeMode !== undefined)
199
+ b.chat_compose_mode = a.chatComposeMode;
200
+ if (a.chatMessageTemplate !== undefined)
201
+ b.chat_message_template = a.chatMessageTemplate;
202
+ if (a.chatSenderAiUserId !== undefined)
203
+ b.chat_sender_ai_user_id = a.chatSenderAiUserId;
94
204
  }
95
205
  if (a.assigneeId !== undefined)
96
206
  b.assignee_id = a.assigneeId;
@@ -100,18 +210,52 @@ export function buildScheduledTaskCreateCall(a) {
100
210
  b.estimated_hours = a.estimatedHours;
101
211
  if (a.siteCredentialIds && a.siteCredentialIds.length)
102
212
  b.site_credential_ids = a.siteCredentialIds;
213
+ if (a.automation !== undefined)
214
+ b.automation_settings = normalizeAutomationSettings(a.automation);
103
215
  return { method: 'POST', path: BASE, body: b };
104
216
  }
105
217
  export function buildScheduledTaskUpdateCall(id, a) {
106
218
  if (a.name !== undefined && a.name.length > 255)
107
219
  throw new ValidationError('name must be <= 255 characters');
220
+ if (a.frequency !== undefined)
221
+ assertEnum(a.frequency, FREQUENCIES, 'frequency');
222
+ assertScheduleShape(a);
223
+ if (a.businessDayAdjustment) {
224
+ assertEnum(a.businessDayAdjustment, BUSINESS_DAY_ADJUSTMENTS, 'business-day-adjustment');
225
+ }
226
+ if (a.issueType)
227
+ assertEnum(a.issueType, ST_ISSUE_TYPES, 'issue-type');
228
+ if (a.priority)
229
+ assertEnum(a.priority, ST_PRIORITIES, 'priority');
230
+ if (a.chatComposeMode)
231
+ assertEnum(a.chatComposeMode, CHAT_COMPOSE_MODES, 'chat-compose-mode');
232
+ if (a.chatMessageTemplate !== undefined && a.chatMessageTemplate.length > 5000) {
233
+ throw new ValidationError('--chat-message must be <= 5000 characters');
234
+ }
235
+ const hasWorkflowFields = a.workflowTemplateId !== undefined || a.workflowParameters !== undefined;
236
+ const hasChatFields = a.chatComposeMode !== undefined || a.chatMessageTemplate !== undefined || a.chatSenderAiUserId !== undefined;
237
+ const hasIssueOnlyFields = a.issueType !== undefined ||
238
+ a.issueTypeId !== undefined ||
239
+ a.priority !== undefined ||
240
+ a.workspaceOnly !== undefined;
241
+ // サーバーは「更新後の実効 execution_type」でフィールドを取捨する。
242
+ // --execution-type が来ているときだけ実効型が確定するので、そこだけ先に弾く
243
+ // (workflow 系は prohibited で 422、それ以外はルールに無く黙って捨てられる)。
108
244
  if (a.executionType !== undefined) {
109
245
  assertEnum(a.executionType, EXECUTION_TYPES, 'execution-type');
110
- if (a.executionType === 'workflow' && a.workflowTemplateId === undefined) {
111
- throw new ValidationError('--workflow-template-id is required when switching execution-type to workflow');
246
+ if (a.executionType === 'workflow') {
247
+ if (a.workflowTemplateId === undefined) {
248
+ throw new ValidationError('--workflow-template-id is required when switching execution-type to workflow');
249
+ }
250
+ }
251
+ else if (hasWorkflowFields) {
252
+ throw new ValidationError(`--workflow-template-id / --workflow-parameters cannot be used with execution-type=${a.executionType} (the server rejects them)`);
253
+ }
254
+ if (a.executionType !== 'chat' && hasChatFields) {
255
+ throw new ValidationError(`--chat-* options cannot be used with execution-type=${a.executionType} (they would be ignored)`);
112
256
  }
113
- if (a.executionType === 'issue') {
114
- throw new ValidationError('switching execution-type to issue via update is not supported (no --title/--priority here, and the server requires them for issue-type tasks); create a new scheduled task instead');
257
+ if (a.executionType === 'chat' && hasIssueOnlyFields) {
258
+ throw new ValidationError('--issue-type / --issue-type-id / --priority / --workspace-only cannot be used with execution-type=chat (they would be ignored)');
115
259
  }
116
260
  }
117
261
  const b = {};
@@ -123,12 +267,48 @@ export function buildScheduledTaskUpdateCall(id, a) {
123
267
  b.is_active = a.isActive;
124
268
  if (a.executionType !== undefined)
125
269
  b.execution_type = a.executionType;
270
+ if (a.businessDayAdjustment !== undefined)
271
+ b.business_day_adjustment = a.businessDayAdjustment;
272
+ if (a.frequency !== undefined)
273
+ b.frequency = a.frequency;
274
+ if (a.executionTime !== undefined)
275
+ b.execution_time = a.executionTime;
276
+ if (a.dayOfWeek !== undefined)
277
+ b.day_of_week = a.dayOfWeek;
278
+ if (a.dayOfMonth !== undefined)
279
+ b.day_of_month = a.dayOfMonth;
280
+ if (a.cronExpression !== undefined)
281
+ b.cron_expression = a.cronExpression;
282
+ if (a.title !== undefined)
283
+ b.title = a.title;
284
+ if (a.issueType !== undefined)
285
+ b.issue_type = a.issueType;
286
+ if (a.issueTypeId !== undefined)
287
+ b.issue_type_id = a.issueTypeId;
288
+ if (a.priority !== undefined)
289
+ b.priority = a.priority;
290
+ if (a.workspaceOnly !== undefined)
291
+ b.workspace_only = a.workspaceOnly;
126
292
  if (a.workflowTemplateId !== undefined)
127
293
  b.workflow_template_id = a.workflowTemplateId;
128
294
  if (a.workflowParameters !== undefined)
129
295
  b.workflow_parameters = a.workflowParameters;
296
+ if (a.chatComposeMode !== undefined)
297
+ b.chat_compose_mode = a.chatComposeMode;
298
+ if (a.chatMessageTemplate !== undefined)
299
+ b.chat_message_template = a.chatMessageTemplate;
300
+ if (a.chatSenderAiUserId !== undefined)
301
+ b.chat_sender_ai_user_id = a.chatSenderAiUserId;
302
+ if (a.assigneeId !== undefined)
303
+ b.assignee_id = a.assigneeId;
304
+ if (a.reviewerId !== undefined)
305
+ b.reviewer_id = a.reviewerId;
306
+ if (a.estimatedHours !== undefined)
307
+ b.estimated_hours = a.estimatedHours;
130
308
  if (a.siteCredentialIds && a.siteCredentialIds.length)
131
309
  b.site_credential_ids = a.siteCredentialIds;
310
+ if (a.automation !== undefined)
311
+ b.automation_settings = normalizeAutomationSettings(a.automation);
132
312
  if (Object.keys(b).length === 0)
133
313
  throw new ValidationError('nothing to update');
134
314
  return { method: 'PUT', path: `${BASE}/${id}`, body: b };
@@ -136,12 +316,41 @@ export function buildScheduledTaskUpdateCall(id, a) {
136
316
  export function buildScheduledTaskDeleteCall(id) {
137
317
  return { method: 'DELETE', path: `${BASE}/${id}` };
138
318
  }
319
+ /** --active / --inactive の組から is_active を決める。 */
320
+ function activeFlag(opts) {
321
+ if (opts.active && opts.inactive)
322
+ throw new ValidationError('use only one of --active / --inactive');
323
+ return opts.active ? true : opts.inactive ? false : undefined;
324
+ }
325
+ /** --automation の JSON を読む("null" で自動化設定の解除)。 */
326
+ function automationArg(value) {
327
+ return value !== undefined ? parseJsonObjectOrNullArg(value, '--automation') : undefined;
328
+ }
139
329
  export const scheduledTaskModule = {
140
330
  name: 'scheduled-task',
141
331
  describe: 'Manage scheduled tasks',
142
332
  register(program, ctx) {
143
333
  const st = program.command('scheduled-task').description('Scheduled (recurring) tasks');
144
334
  const withProject = (cmd) => cmd.option('-p, --project <key|id>', 'project key (PRJ) or numeric id');
335
+ /** create / update で共通の「実行内容」オプション。 */
336
+ const withPayloadOptions = (cmd) => cmd
337
+ .option('--description <text>', 'description (Markdown, @file or - for stdin)')
338
+ .option('--business-day-adjustment <mode>', `non-business-day handling (${BUSINESS_DAY_ADJUSTMENTS.join('|')})`)
339
+ .option('--title <title>', 'issue title (issue/workflow; chat falls back to --name)')
340
+ .option('--issue-type <type>', `(${ST_ISSUE_TYPES.join('|')})`)
341
+ .option('--issue-type-id <id>', 'custom issue type id (alternative to --issue-type)', parseIntArg)
342
+ .option('--priority <priority>', `(${ST_PRIORITIES.join('|')})`)
343
+ .option('--workspace-only', 'run against the AI workspace only')
344
+ .option('--workflow-template-id <id>', 'workflow template id (execution-type=workflow)', parseIntArg)
345
+ .option('--workflow-parameters <json>', 'workflow execution parameters (@file.json or - for stdin)')
346
+ .option('--chat-compose-mode <mode>', `(${CHAT_COMPOSE_MODES.join('|')}; execution-type=chat)`)
347
+ .option('--chat-message <text>', 'chat body template (@file or -; execution-type=chat, <=5000)')
348
+ .option('--chat-sender-ai-user-id <id>', 'AI user that sends the chat', parseIntArg)
349
+ .option('--assignee-id <id>', 'assignee user id', parseIntArg)
350
+ .option('--reviewer-id <id>', 'reviewer user id', parseIntArg)
351
+ .option('--estimated-hours <n>', 'estimated hours', parseFloat)
352
+ .option('--site-credential-ids <ids>', 'comma-separated site credential ids', parseNumberList)
353
+ .option('--automation <json|null>', 'automation_settings: {command,timeout_sec,trigger_status,on_success_status,on_failure_status} (@file.json or -); "null" clears it');
145
354
  withProject(st.command('list'))
146
355
  .description('List scheduled tasks')
147
356
  .action(async (opts) => {
@@ -153,77 +362,111 @@ export const scheduledTaskModule = {
153
362
  .action(async (id, opts) => {
154
363
  printOutput(await execCall(ctx, buildScheduledTaskShowCall(parseIntArg(id)), parseProjectArg(opts.project)), ctx.out);
155
364
  });
156
- withProject(st.command('create'))
365
+ withPayloadOptions(withProject(st.command('create'))
157
366
  .description('Create a scheduled task')
158
367
  .requiredOption('--name <name>', 'name (<=255)')
159
368
  .requiredOption('--execution-type <type>', `(${EXECUTION_TYPES.join('|')})`)
160
369
  .requiredOption('--frequency <freq>', `(${FREQUENCIES.join('|')})`)
161
- .option('--description <text>', 'description (Markdown, @file or - for stdin)')
162
370
  .option('--time <HH:MM>', 'execution time (required unless cron)')
163
371
  .option('--day-of-week <n>', 'weekly: 0(Sun)-6(Sat)', parseIntArg)
164
372
  .option('--day-of-month <n>', 'monthly: 1-28', parseIntArg)
165
373
  .option('--cron <expr>', 'cron expression (when frequency=cron)')
166
- .option('--title <title>', 'issue title (execution-type=issue)')
167
- .option('--issue-type <type>', `(${ST_ISSUE_TYPES.join('|')})`)
168
- .option('--priority <priority>', `(${ST_PRIORITIES.join('|')})`)
169
- .option('--workflow-template-id <id>', 'workflow template id (execution-type=workflow)', parseIntArg)
170
- .option('--workflow-parameters <json>', 'workflow execution parameters (@file.json or - for stdin)')
171
- .option('--assignee-id <id>', 'assignee user id', parseIntArg)
172
- .option('--reviewer-id <id>', 'reviewer user id', parseIntArg)
173
- .option('--estimated-hours <n>', 'estimated hours', parseFloat)
174
- .option('--site-credential-ids <ids>', 'comma-separated site credential ids', parseNumberList)
374
+ .option('--inactive', 'create it disabled (default: enabled)'))
375
+ .addHelpText('after', `
376
+ harvask scheduled-task create -p PRJ --name "Daily report" --execution-type issue \\
377
+ --frequency daily --time 09:00 --title "Daily report" --issue-type task --priority normal
378
+ harvask scheduled-task create -p PRJ --name "Morning ping" --execution-type chat \\
379
+ --frequency weekly --time 09:00 --day-of-week 1 --chat-message @greeting.md
380
+ `)
175
381
  .action(async (opts) => {
176
382
  const call = buildScheduledTaskCreateCall({
177
383
  name: opts.name,
178
384
  executionType: opts.executionType,
179
385
  frequency: opts.frequency,
180
386
  description: opts.description !== undefined ? readContentArg(opts.description) : undefined,
387
+ isActive: opts.inactive ? false : undefined,
388
+ businessDayAdjustment: opts.businessDayAdjustment,
181
389
  executionTime: opts.time,
182
390
  dayOfWeek: opts.dayOfWeek,
183
391
  dayOfMonth: opts.dayOfMonth,
184
392
  cronExpression: opts.cron,
185
393
  title: opts.title,
186
394
  issueType: opts.issueType,
395
+ issueTypeId: opts.issueTypeId,
187
396
  priority: opts.priority,
397
+ workspaceOnly: opts.workspaceOnly,
188
398
  workflowTemplateId: opts.workflowTemplateId,
189
399
  workflowParameters: opts.workflowParameters !== undefined
190
400
  ? parseJsonObjectArg(opts.workflowParameters, '--workflow-parameters')
191
401
  : undefined,
402
+ chatComposeMode: opts.chatComposeMode,
403
+ chatMessageTemplate: opts.chatMessage !== undefined ? readContentArg(opts.chatMessage) : undefined,
404
+ chatSenderAiUserId: opts.chatSenderAiUserId,
192
405
  assigneeId: opts.assigneeId,
193
406
  reviewerId: opts.reviewerId,
194
407
  estimatedHours: opts.estimatedHours,
195
408
  siteCredentialIds: opts.siteCredentialIds,
409
+ automation: automationArg(opts.automation),
196
410
  });
197
411
  printOutput(await execCall(ctx, call, parseProjectArg(opts.project)), ctx.out);
198
412
  });
199
- withProject(st.command('update'))
413
+ withPayloadOptions(withProject(st.command('update'))
200
414
  .description('Update a scheduled task')
201
415
  .argument('<id>', 'scheduled task id')
202
416
  .option('--name <name>', 'name (<=255)')
203
- .option('--description <text>', 'description (Markdown, @file or - for stdin)')
417
+ .option('--execution-type <type>', `switch execution type (${EXECUTION_TYPES.join('|')})`)
418
+ .option('--frequency <freq>', `(${FREQUENCIES.join('|')})`)
419
+ .option('--time <HH:MM>', 'execution time')
420
+ .option('--day-of-week <n>', 'weekly: 0(Sun)-6(Sat)', parseIntArg)
421
+ .option('--day-of-month <n>', 'monthly: 1-28', parseIntArg)
422
+ .option('--cron <expr>', 'cron expression')
204
423
  .option('--active', 'set active')
205
- .option('--inactive', 'set inactive')
206
- .option('--execution-type <type>', 'switch execution type to workflow (requires --workflow-template-id); switching back to issue is not supported here')
207
- .option('--workflow-template-id <id>', 'workflow template id (when switching to execution-type=workflow)', parseIntArg)
208
- .option('--workflow-parameters <json>', 'workflow execution parameters (@file.json or - for stdin)')
209
- .option('--site-credential-ids <ids>', 'comma-separated site credential ids', parseNumberList)
424
+ .option('--inactive', 'set inactive'))
425
+ .addHelpText('after', `
426
+ Only the fields you pass are changed. The frequency/time combination is validated
427
+ by the server against the values the task will have after the update, so you can
428
+ change them one at a time (e.g. --day-of-week 3 on a weekly task).
429
+ `)
210
430
  .action(async (id, opts) => {
211
- if (opts.active && opts.inactive)
212
- throw new ValidationError('use only one of --active / --inactive');
213
- const isActive = opts.active ? true : opts.inactive ? false : undefined;
214
431
  const call = buildScheduledTaskUpdateCall(parseIntArg(id), {
215
432
  name: opts.name,
216
433
  description: opts.description !== undefined ? readContentArg(opts.description) : undefined,
217
- isActive,
434
+ isActive: activeFlag(opts),
218
435
  executionType: opts.executionType,
436
+ businessDayAdjustment: opts.businessDayAdjustment,
437
+ frequency: opts.frequency,
438
+ executionTime: opts.time,
439
+ dayOfWeek: opts.dayOfWeek,
440
+ dayOfMonth: opts.dayOfMonth,
441
+ cronExpression: opts.cron,
442
+ title: opts.title,
443
+ issueType: opts.issueType,
444
+ issueTypeId: opts.issueTypeId,
445
+ priority: opts.priority,
446
+ workspaceOnly: opts.workspaceOnly,
219
447
  workflowTemplateId: opts.workflowTemplateId,
220
448
  workflowParameters: opts.workflowParameters !== undefined
221
449
  ? parseJsonObjectArg(opts.workflowParameters, '--workflow-parameters')
222
450
  : undefined,
451
+ chatComposeMode: opts.chatComposeMode,
452
+ chatMessageTemplate: opts.chatMessage !== undefined ? readContentArg(opts.chatMessage) : undefined,
453
+ chatSenderAiUserId: opts.chatSenderAiUserId,
454
+ assigneeId: opts.assigneeId,
455
+ reviewerId: opts.reviewerId,
456
+ estimatedHours: opts.estimatedHours,
223
457
  siteCredentialIds: opts.siteCredentialIds,
458
+ automation: automationArg(opts.automation),
224
459
  });
225
460
  printOutput(await execCall(ctx, call, parseProjectArg(opts.project)), ctx.out);
226
461
  });
462
+ withProject(st.command('execute'))
463
+ .description('Run a scheduled task now (creates the issue / sends the chat immediately)')
464
+ .argument('<id>', 'scheduled task id')
465
+ .option('--yes', 'skip confirmation (required in non-interactive mode)')
466
+ .action(async (id, opts) => {
467
+ requireConfirmation(opts, 'execute');
468
+ printOutput(await execCall(ctx, buildScheduledTaskExecuteCall(parseIntArg(id)), parseProjectArg(opts.project)), ctx.out);
469
+ });
227
470
  withProject(st.command('delete'))
228
471
  .description('Delete a scheduled task')
229
472
  .argument('<id>', 'scheduled task id')
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/scheduled-task/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,IAAI,GAAG,GAAG,MAAM,qCAAqC,CAAC;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,UAAU,CAAU,CAAC;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;A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AC,OAAO,EAAE,sDAAsD,CAAC;aACvE,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,IAAI,EAAE,EAAE;YACjC,mBAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACrC,WAAW,CACT,MAAM,QAAQ,CAAC,GAAG,EAAE,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAClG,GAAG,CAAC,GAAG,CACR,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAC9B,WAAW,CAAC,yBAAyB,CAAC;aACtC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;aACrC,MAAM,CAAC,OAAO,EAAE,sDAAsD,CAAC;aACvE,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,IAAI,EAAE,EAAE;YACjC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACpC,WAAW,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,4BAA4B,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1H,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC"}
@@ -11,6 +11,8 @@ import { buildFileFormData } from '../../utils/upload.js';
11
11
  import { saveBlob } from '../../utils/download.js';
12
12
  import { API_NS } from '../../api-base.js';
13
13
  const BASE = `${API_NS}/projects/{project}/storage`;
14
+ /** 同名ファイルが既にあるときの挙動(`StorageUploadController::CONFLICT_MODES` と同値)。 */
15
+ export const STORAGE_CONFLICT_MODES = ['rename', 'overwrite', 'error'];
14
16
  export function buildStorageSearchCall(query, opts = {}) {
15
17
  if (!query || query.trim() === '')
16
18
  throw new ValidationError('search query is required');
@@ -120,10 +122,24 @@ export const storageModule = {
120
122
  .description('Upload a file (multipart; very large files may exceed the request timeout)')
121
123
  .requiredOption('--file <path>', 'local file path')
122
124
  .option('--parent-id <id>', 'parent folder id (omit = root)', parseIntArg)
125
+ .option('--on-conflict <mode>', `same-name file in the target folder (${STORAGE_CONFLICT_MODES.join('|')}; default rename)`)
126
+ .option('--yes', 'skip confirmation (required with --on-conflict overwrite in non-interactive mode)')
123
127
  .action(async (opts) => {
128
+ const onConflict = opts.onConflict;
129
+ if (onConflict !== undefined && !STORAGE_CONFLICT_MODES.includes(onConflict)) {
130
+ throw new ValidationError(`--on-conflict must be one of: ${STORAGE_CONFLICT_MODES.join(', ')}`);
131
+ }
132
+ // overwrite は既存の実体を消して差し替える不可逆操作(storage_items の id は維持される)。
133
+ // delete と同じゲートを通す。
134
+ if (onConflict === 'overwrite') {
135
+ requireConfirmation(opts, 'overwrite an existing file');
136
+ }
124
137
  const client = ctx.getApiClient();
125
138
  const pid = await resolveProjectId(client, parseProjectArg(opts.project) ?? {});
126
- const form = buildFileFormData(opts.file, { parent_id: opts.parentId });
139
+ const form = buildFileFormData(opts.file, {
140
+ parent_id: opts.parentId,
141
+ on_conflict: onConflict,
142
+ });
127
143
  const result = await client.postMultipart(`${API_NS}/projects/${pid}/storage/upload`, form);
128
144
  printOutput(result, ctx.out);
129
145
  });