@xiaoyuanhao/yunzhi-cli 2.1.0 → 2.1.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.
@@ -22,13 +22,14 @@ function item(resumption, detail) {
22
22
  workflow_status: nullable('integer'), workflow_status_name: nullable('string'), created_at: nullable('string'),
23
23
  records: nullable([resumption ? { ...resumptionRecord, leave_id: required('string'), original_leave: required(leaveRecord) } : leaveRecord]),
24
24
  ...(detail ? { fields: nullable([require('./leave.cjs').formField]), progress: nullable([step]),
25
+ progress_unavailable_reason: optional(nullable('string')),
25
26
  attachments: nullable([require('./teacher-leave-files.cjs').attachment]) } : {}) }, at);
26
27
  if (!validId(data.id, resumption) || (data.records || []).some(row => !validId(row.id, resumption)
27
28
  || resumption && (!validId(row.leave_id, false) || row.original_leave.id !== row.leave_id)
28
29
  || !resumption && row.resumptions?.some(r => !validId(r.id, true)))) throw new Error('学生请假身份或关联无效。');
29
30
  if ((detail || !data.owned) && data.records === null || !detail && data.owned && data.records !== null) throw new Error('学生业务关联加载状态不一致。');
30
- if (detail && (data.owned ? data.fields === null || data.progress === null || data.attachments === null
31
- : data.fields !== null || data.progress !== null || data.attachments !== null)) throw new Error('学生请假字段与可读范围不一致。');
31
+ if (detail && (data.owned ? data.fields === null || (data.progress === null ? !data.progress_unavailable_reason?.trim() : data.progress_unavailable_reason != null) || data.attachments === null
32
+ : data.fields !== null || data.progress !== null || data.progress_unavailable_reason != null || data.attachments !== null)) throw new Error('学生请假字段与可读范围不一致。');
32
33
  if (detail) require('./teacher-leave-files.cjs').displayAttachments(data);
33
34
  return data;
34
35
  };
@@ -35,14 +35,14 @@ async function execute(command, args, formField) {
35
35
  if (!validId(payload.id, prefix)) throw invalid('--id 必须使用对应 list 返回的查询 ID。');
36
36
  const result = await gateway.execute('attendance-leave:read', 'leave/' + command, payload, {
37
37
  ...summary, tenant_id: required('string'), applicant_id: required('string'), form_id: nullable('string'),
38
- fields: nullable([formField]), progress: nullable([progress]), attachments: nullable([require('./teacher-leave-files.cjs').attachment]),
38
+ fields: nullable([formField]), progress: nullable([progress]), progress_unavailable_reason: nullable('string'), attachments: nullable([require('./teacher-leave-files.cjs').attachment]),
39
39
  available_actions: nullable(['string']), resumption_status: nullable('string'), resumption_status_name: nullable('string'),
40
40
  resumption_source: nullable('integer'), resumption_applications: nullable([resumption]),
41
41
  });
42
42
  const data = result.value.data;
43
43
  if (data.id !== payload.id || !validItem(data, resumed)
44
- || (data.workflow_available ? data.fields === null || data.progress === null || data.attachments === null || data.form_id === null
45
- : data.fields !== null || data.progress !== null || data.attachments !== null || data.form_id !== null))
44
+ || (data.workflow_available ? data.fields === null || (data.progress === null ? !data.progress_unavailable_reason?.trim() : data.progress_unavailable_reason != null) || data.attachments === null || data.form_id === null
45
+ : data.fields !== null || data.progress !== null || data.progress_unavailable_reason != null || data.attachments !== null || data.form_id !== null))
46
46
  fail(result, '本人查询详情与目标或来源状态不一致。');
47
47
  require('./teacher-leave-files.cjs').displayAttachments(data);
48
48
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaoyuanhao/yunzhi-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Yunzhi Campus CLI for lesson preparation and school library workflows",
5
5
  "bin": {
6
6
  "yunzhi-cli": "yunzhi-cli.cjs"