weaver-work-cli 0.1.70 → 0.1.71
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/chunks/{archive-VUTREF3P.js → archive-5P33NAUN.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-7CN7JB6B.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-EJLP63UO.js} +1 -1
- package/dist/chunks/{chunk-HAORST2G.js → chunk-FRMDHZSN.js} +11 -11
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-G7ZM2VOX.js} +34 -34
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-ICNUOWLL.js} +4 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-LU2SPJYY.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-OFCF23FY.js} +6 -6
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-OPTJ6IF7.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-Q3EXRNB4.js} +1 -1
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-VJWVB55R.js} +2 -2
- package/dist/chunks/{chunk-EHH363SP.js → chunk-VMVMEIL3.js} +4 -4
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-X2C5CGGM.js} +52 -51
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-XLSJC6JZ.js} +6 -6
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-Y4PXZ2YQ.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-LOUOK46Z.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6N2IGCS4.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-QYLS3EB3.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-LPFPKZ4T.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-QP2WX4QJ.js} +3 -3
- package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
- package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
- package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
- package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-PTABJE7V.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-NIDHDBCB.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-G3QAT7DE.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-3MQ3AHDQ.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-3GQRYP2R.js} +12 -12
- package/dist/chunks/{registry-3B3OAJYX.js → registry-3S7AVMXR.js} +4 -4
- package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-IOKBJVYP.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-IB6EUARH.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-RINBAL2M.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +38 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/index.js +11 -2
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
- package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
- package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +11 -1
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mailRandomKey } from '../host.js';
|
|
2
2
|
import { mailSuccess, READ, schemaOf, SCHEMA_STRING, SCHEMA_INTEGER, SCHEMA_BOOLEAN } from './types.js';
|
|
3
|
+
import { mailValidationError } from '../errors.js';
|
|
3
4
|
const FOLDER_TEXT = {
|
|
4
5
|
'-10': '全部',
|
|
5
6
|
'0': '收件箱',
|
|
@@ -118,7 +119,7 @@ const opContactList = {
|
|
|
118
119
|
async handler(args, env) {
|
|
119
120
|
const name = String(args.name || '').trim();
|
|
120
121
|
if (!name)
|
|
121
|
-
throw
|
|
122
|
+
throw mailValidationError('name_required', 'name(人员姓名/工号)必填');
|
|
122
123
|
const [inbox, sent] = await Promise.all([
|
|
123
124
|
listMails(env, { ...args, size: args.size ?? 100 }, 0, { from: name }),
|
|
124
125
|
listMails(env, { ...args, size: args.size ?? 100 }, -1, { to: name }),
|
|
@@ -142,7 +143,7 @@ const opViewInfo = {
|
|
|
142
143
|
async handler(args, env) {
|
|
143
144
|
const id = String(args.id || '').trim();
|
|
144
145
|
if (!id)
|
|
145
|
-
throw
|
|
146
|
+
throw mailValidationError('id_required', 'id(邮件 id)必填');
|
|
146
147
|
const rk = mailRandomKey();
|
|
147
148
|
const [rkKey, rkVal] = rk.split('=');
|
|
148
149
|
const value = (await env.host.request({
|
|
@@ -181,7 +182,7 @@ const opViewContent = {
|
|
|
181
182
|
async handler(args, env) {
|
|
182
183
|
const id = String(args.id || '').trim();
|
|
183
184
|
if (!id)
|
|
184
|
-
throw
|
|
185
|
+
throw mailValidationError('id_required', 'id(邮件 id)必填');
|
|
185
186
|
const rk = mailRandomKey();
|
|
186
187
|
const [rkKey, rkVal] = rk.split('=');
|
|
187
188
|
const value = (await env.host.request({
|
|
@@ -234,7 +235,7 @@ const opPersonSearch = {
|
|
|
234
235
|
async handler(args, env) {
|
|
235
236
|
const keyword = String(args.keyword || '').trim();
|
|
236
237
|
if (!keyword)
|
|
237
|
-
throw
|
|
238
|
+
throw mailValidationError('keyword_required', 'keyword(姓名/工号)必填');
|
|
238
239
|
const value = (await env.host.request({
|
|
239
240
|
path: '/api/mail/base/common/browser/complete/resource',
|
|
240
241
|
method: 'POST',
|
|
@@ -322,7 +323,7 @@ const opAddressSearch = {
|
|
|
322
323
|
async handler(args, env) {
|
|
323
324
|
const keyword = String(args.keyword || '').trim();
|
|
324
325
|
if (!keyword)
|
|
325
|
-
throw
|
|
326
|
+
throw mailValidationError('keyword_required', 'keyword(邮箱关键字)必填');
|
|
326
327
|
const value = (await env.host.request({
|
|
327
328
|
path: '/api/mail/base/add/addressFullsearch',
|
|
328
329
|
method: 'POST',
|
|
@@ -384,7 +385,7 @@ const opGroupDetail = {
|
|
|
384
385
|
async handler(args, env) {
|
|
385
386
|
const id = String(args.id || '').trim();
|
|
386
387
|
if (!id)
|
|
387
|
-
throw
|
|
388
|
+
throw mailValidationError('id_required', 'id(分组 id)必填');
|
|
388
389
|
const value = (await env.host.request({
|
|
389
390
|
path: '/api/mail/base/contacts/getMailContactsGroupVosByGroupId',
|
|
390
391
|
method: 'POST',
|
|
@@ -469,24 +470,6 @@ const opAttachmentCenter = {
|
|
|
469
470
|
return mailSuccess('mail.attachment.center', value?.data || {});
|
|
470
471
|
},
|
|
471
472
|
};
|
|
472
|
-
const opClearlogList = {
|
|
473
|
-
name: 'mail.clearlog.list',
|
|
474
|
-
resource: 'mail/base/setting/mailClear/getEmailClearLogList',
|
|
475
|
-
method: 'POST',
|
|
476
|
-
action: 'mail.clearlog.list',
|
|
477
|
-
summary: '邮件清理日志列表',
|
|
478
|
-
risk: READ,
|
|
479
|
-
inputSchema: schemaOf({ page: SCHEMA_INTEGER, size: SCHEMA_INTEGER }, { description: '清理日志列表' }),
|
|
480
|
-
async handler(args, env) {
|
|
481
|
-
const body = { current: num(args.page, 1), pageSize: num(args.size, 20) };
|
|
482
|
-
const value = (await env.host.request({
|
|
483
|
-
path: '/api/mail/base/setting/mailClear/getEmailClearLogList',
|
|
484
|
-
method: 'POST',
|
|
485
|
-
body,
|
|
486
|
-
}));
|
|
487
|
-
return mailSuccess('mail.clearlog.list', value?.data || {});
|
|
488
|
-
},
|
|
489
|
-
};
|
|
490
473
|
export const mailReadOperations = [
|
|
491
474
|
opList,
|
|
492
475
|
opContactList,
|
|
@@ -504,5 +487,4 @@ export const mailReadOperations = [
|
|
|
504
487
|
opSignList,
|
|
505
488
|
opBlacklistList,
|
|
506
489
|
opAttachmentCenter,
|
|
507
|
-
opClearlogList,
|
|
508
490
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
2
|
import { randomBytes } from 'node:crypto';
|
|
3
|
-
import { mailValidationError } from '../errors.js';
|
|
3
|
+
import { mailRestrictedError, mailUpstreamError, mailValidationError } from '../errors.js';
|
|
4
4
|
import { WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
5
5
|
function b64(s) {
|
|
6
6
|
return Buffer.from(s, 'utf8').toString('base64');
|
|
@@ -41,7 +41,7 @@ async function mailAdd(env, flag, mailResourceId) {
|
|
|
41
41
|
}));
|
|
42
42
|
const d = value?.data || {};
|
|
43
43
|
if (!d.sessionUuid)
|
|
44
|
-
throw
|
|
44
|
+
throw mailUpstreamError('mail_add_contract', 'mailAdd 未返回 sessionUuid:' + JSON.stringify(value).slice(0, 300));
|
|
45
45
|
return d;
|
|
46
46
|
}
|
|
47
47
|
async function searchInternal(env, keyword) {
|
|
@@ -90,7 +90,7 @@ async function resolveInternal(env, names) {
|
|
|
90
90
|
else if (list.length > 1)
|
|
91
91
|
pending.push({ keyword: n, reason: '多候选(无精确匹配)', candidates: list.slice(0, 5).map(cand) });
|
|
92
92
|
else
|
|
93
|
-
throw
|
|
93
|
+
throw mailValidationError('recipient_person_not_found', '未找到内部人员:' + n + '(可尝试姓名/工号;若是部门请用 to-dep/cc-dep/bcc-dep 指定)');
|
|
94
94
|
}
|
|
95
95
|
if (pending.length)
|
|
96
96
|
throw new CandidateError(pending);
|
|
@@ -191,7 +191,7 @@ async function resolveDepartment(env, names) {
|
|
|
191
191
|
pending.push({ keyword: n, reason: '同名部门(请在结果中选择)', candidates: matches.map((x) => ({ id: x.id, name: x.name, type: '部门' })) });
|
|
192
192
|
}
|
|
193
193
|
else {
|
|
194
|
-
throw
|
|
194
|
+
throw mailValidationError('department_not_found', '未找到部门:' + n + '(请确认部门名称,或用 to 指定人员)');
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
if (pending.length)
|
|
@@ -208,7 +208,7 @@ async function resolveExternal(env, emails) {
|
|
|
208
208
|
const list = await searchExternal(env, e);
|
|
209
209
|
const hit = list.find((x) => x.mailAddress?.includes(e)) || list[0];
|
|
210
210
|
if (!hit)
|
|
211
|
-
throw
|
|
211
|
+
throw mailValidationError('external_address_not_found', '未找到外部邮箱:' + e + '(可尝试完整邮箱地址)');
|
|
212
212
|
out.push({ mailAddress: hit.mailAddress, mailNickName: hit.mailNickName });
|
|
213
213
|
}
|
|
214
214
|
return out;
|
|
@@ -249,10 +249,10 @@ async function parseRecipients(env, add, args) {
|
|
|
249
249
|
const hasEmail = all.some(looksLikeEmail);
|
|
250
250
|
const hasName = all.some((x) => !looksLikeEmail(x));
|
|
251
251
|
if (hasEmail && hasName) {
|
|
252
|
-
throw
|
|
252
|
+
throw mailValidationError('recipient_mixed', '收件人内外部混用:邮箱地址=外部邮件、姓名=内部邮件,请统一,或用 --internal/--external 明确邮件类型');
|
|
253
253
|
}
|
|
254
254
|
if (!all.length)
|
|
255
|
-
throw
|
|
255
|
+
throw mailValidationError('recipient_required', '请先说明收件人(姓名=内部邮件 / 邮箱地址=外部邮件 / 部门用 to-dep)');
|
|
256
256
|
kind = hasEmail ? 'external' : 'internal';
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -298,7 +298,7 @@ async function parseRecipients(env, add, args) {
|
|
|
298
298
|
const names = (arr) => arr.map((x) => x.mailNickName || x.mailAddress).join('、');
|
|
299
299
|
const from = (add.sendFrom_outer || []).find((x) => x.selected) || (add.sendFrom_outer || [])[0];
|
|
300
300
|
if (!from || !from.mailAddress) {
|
|
301
|
-
throw
|
|
301
|
+
throw mailRestrictedError('outer_account_unbound', '当前账号未配置外部邮箱发件账号(mailAdd.sendFrom_outer 为空),无法发送外部邮件;请先在邮件设置中绑定外部邮箱账号');
|
|
302
302
|
}
|
|
303
303
|
const totalCount = [...rawTo, ...rawCc, ...rawBcc].length;
|
|
304
304
|
return {
|
|
@@ -326,23 +326,23 @@ async function checkMailConfig(env, isInternal) {
|
|
|
326
326
|
const sys = value?.data?.sysConfig || {};
|
|
327
327
|
if (isInternal === 1) {
|
|
328
328
|
if (sys.innerMail !== undefined && Number(sys.innerMail) !== 1) {
|
|
329
|
-
throw
|
|
329
|
+
throw mailRestrictedError('internal_mail_disabled', '当前环境未启用内部邮件(getEmailAllConfig.sysConfig.innerMail=' + sys.innerMail + '),无法发送内部邮件');
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
else {
|
|
333
333
|
if (sys.outterMail !== undefined && Number(sys.outterMail) !== 1) {
|
|
334
|
-
throw
|
|
334
|
+
throw mailRestrictedError('outer_mail_disabled', '当前环境未启用外部邮件(getEmailAllConfig.outterMail=0),无法发送外部邮件');
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
if (sys.innerMail !== undefined && sys.outterMail !== undefined && Number(sys.innerMail) !== 1 && Number(sys.outterMail) !== 1) {
|
|
338
|
-
throw
|
|
338
|
+
throw mailRestrictedError('mail_disabled', '系统未启用邮件功能(内部/外部邮件均未开启),无法发送邮件');
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
async function precheckSend(env, body) {
|
|
342
342
|
const c = (await env.host.request({ path: '/api/mail/send/canSendMail', method: 'POST', body }));
|
|
343
343
|
const cdata = c?.data || {};
|
|
344
344
|
if (cdata.success !== undefined && cdata.success !== 1) {
|
|
345
|
-
throw
|
|
345
|
+
throw mailRestrictedError('send_blocked', '发送前校验未通过:' + (cdata.msg || '未知拦截(canSendMail)'));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
async function buildBody(env, add, args, draft) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
|
-
import { mailValidationError } from '../errors.js';
|
|
2
|
+
import { mailConfirmationError, mailValidationError } from '../errors.js';
|
|
3
3
|
import { READ, WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
4
4
|
const SIGN_SCHEMA = schemaOf({
|
|
5
5
|
id: SCHEMA_STRING,
|
|
@@ -16,9 +16,9 @@ function buildSignBody(args) {
|
|
|
16
16
|
const signName = String(args.signName || '').trim();
|
|
17
17
|
const clobContent = String(args.clobContent || '').trim();
|
|
18
18
|
if (!signName)
|
|
19
|
-
throw
|
|
19
|
+
throw mailValidationError('sign_name_required', 'signName(签名名称)必填');
|
|
20
20
|
if (!clobContent)
|
|
21
|
-
throw
|
|
21
|
+
throw mailValidationError('content_required', 'clobContent(Base64 编码的 HTML 内容)必填');
|
|
22
22
|
const body = {
|
|
23
23
|
signName,
|
|
24
24
|
clobContent,
|
|
@@ -68,9 +68,9 @@ const opSignSaveApply = {
|
|
|
68
68
|
inputSchema: SIGN_SCHEMA,
|
|
69
69
|
async handler(args, env) {
|
|
70
70
|
if (args.confirm !== true)
|
|
71
|
-
throw
|
|
71
|
+
throw mailConfirmationError('mail.sign.save.apply');
|
|
72
72
|
if (!args.continuation)
|
|
73
|
-
throw
|
|
73
|
+
throw mailValidationError('continuation_required', 'mail.sign.save.apply 需要 prepare 返回的 continuation');
|
|
74
74
|
const lease = await env.continuation.verify(String(args.continuation), 'mail.sign.save.apply');
|
|
75
75
|
const session = await env.host.getSession();
|
|
76
76
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
@@ -99,7 +99,7 @@ const opSignUpdate = {
|
|
|
99
99
|
async handler(args, env) {
|
|
100
100
|
const id = String(args.id || '').trim();
|
|
101
101
|
if (!id)
|
|
102
|
-
throw
|
|
102
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
103
103
|
const form = (await env.host.request({ path: '/api/mail/base/setting/sign/getMailSignForm', method: 'POST', body: { id } }));
|
|
104
104
|
const cur = form?.data?.formData || {};
|
|
105
105
|
const body = {
|
|
@@ -112,9 +112,9 @@ const opSignUpdate = {
|
|
|
112
112
|
electronSignEnable: args.electronSignEnable !== undefined ? Number(args.electronSignEnable) : (cur.electronSignEnable ?? 0),
|
|
113
113
|
};
|
|
114
114
|
if (!body.signName)
|
|
115
|
-
throw
|
|
115
|
+
throw mailValidationError('sign_name_empty', '签名名称为空(原值缺失且未提供 signName)');
|
|
116
116
|
if (!body.clobContent)
|
|
117
|
-
throw
|
|
117
|
+
throw mailValidationError('content_empty', '签名内容为空(原值缺失且未提供 clobContent)');
|
|
118
118
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/updateMailSign', method: 'POST', body }));
|
|
119
119
|
return mailSuccess('mail.sign.update', value?.data ?? 'SUCCESS', { id });
|
|
120
120
|
},
|
|
@@ -130,7 +130,7 @@ const opSignDelete = {
|
|
|
130
130
|
async handler(args, env) {
|
|
131
131
|
const id = String(args.id || '').trim();
|
|
132
132
|
if (!id)
|
|
133
|
-
throw
|
|
133
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
134
134
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/deleteMailSign', method: 'POST', body: { id } }));
|
|
135
135
|
return mailSuccess('mail.sign.delete', value?.data ?? 'SUCCESS', { id });
|
|
136
136
|
},
|
|
@@ -146,7 +146,7 @@ const opSignDefault = {
|
|
|
146
146
|
async handler(args, env) {
|
|
147
147
|
const id = String(args.id || '').trim();
|
|
148
148
|
if (!id)
|
|
149
|
-
throw
|
|
149
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
150
150
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/defaultMailSign', method: 'POST', body: { id } }));
|
|
151
151
|
return mailSuccess('mail.sign.default', value?.data ?? 'SUCCESS', { id });
|
|
152
152
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
|
-
import { mailValidationError } from '../errors.js';
|
|
2
|
+
import { mailConfirmationError, mailValidationError } from '../errors.js';
|
|
3
3
|
import { WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
4
4
|
const TEMPLATE_SCHEMA = schemaOf({
|
|
5
5
|
id: SCHEMA_STRING,
|
|
@@ -17,9 +17,9 @@ function buildTemplateBody(args) {
|
|
|
17
17
|
const subject = String(args.subject || '').trim();
|
|
18
18
|
const clobContent = String(args.clobContent || '').trim();
|
|
19
19
|
if (!subject)
|
|
20
|
-
throw
|
|
20
|
+
throw mailValidationError('subject_required', 'subject(模板主题)必填');
|
|
21
21
|
if (!clobContent)
|
|
22
|
-
throw
|
|
22
|
+
throw mailValidationError('content_required', 'clobContent(Base64 编码的 HTML 内容)必填');
|
|
23
23
|
const body = {
|
|
24
24
|
templateType: args.templateType ? String(args.templateType) : 'personal',
|
|
25
25
|
subject,
|
|
@@ -73,9 +73,9 @@ const opTemplateSaveApply = {
|
|
|
73
73
|
inputSchema: TEMPLATE_SCHEMA,
|
|
74
74
|
async handler(args, env) {
|
|
75
75
|
if (args.confirm !== true)
|
|
76
|
-
throw
|
|
76
|
+
throw mailConfirmationError('mail.template.save.apply');
|
|
77
77
|
if (!args.continuation)
|
|
78
|
-
throw
|
|
78
|
+
throw mailValidationError('continuation_required', 'mail.template.save.apply 需要 prepare 返回的 continuation');
|
|
79
79
|
const lease = await env.continuation.verify(String(args.continuation), 'mail.template.save.apply');
|
|
80
80
|
const session = await env.host.getSession();
|
|
81
81
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
@@ -103,7 +103,7 @@ const opTemplateUpdate = {
|
|
|
103
103
|
async handler(args, env) {
|
|
104
104
|
const id = String(args.id || '').trim();
|
|
105
105
|
if (!id)
|
|
106
|
-
throw
|
|
106
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
107
107
|
const info = (await env.host.request({
|
|
108
108
|
path: '/api/mail/base/setting/template/getMailTemplateInfo',
|
|
109
109
|
method: 'POST',
|
|
@@ -122,9 +122,9 @@ const opTemplateUpdate = {
|
|
|
122
122
|
templateFile: cur.templateFile ?? [],
|
|
123
123
|
};
|
|
124
124
|
if (!body.subject)
|
|
125
|
-
throw
|
|
125
|
+
throw mailValidationError('subject_empty', '模板主题为空(原值缺失且未提供 subject)');
|
|
126
126
|
if (!body.clobContent)
|
|
127
|
-
throw
|
|
127
|
+
throw mailValidationError('content_empty', '模板内容为空(原值缺失且未提供 clobContent)');
|
|
128
128
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/updateMailTemplate', method: 'POST', body }));
|
|
129
129
|
return mailSuccess('mail.template.update', value?.data ?? 'SUCCESS', { id });
|
|
130
130
|
},
|
|
@@ -140,7 +140,7 @@ const opTemplateDelete = {
|
|
|
140
140
|
async handler(args, env) {
|
|
141
141
|
const id = String(args.id || '').trim();
|
|
142
142
|
if (!id)
|
|
143
|
-
throw
|
|
143
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
144
144
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/deleteMailTemplate', method: 'POST', body: { id } }));
|
|
145
145
|
return mailSuccess('mail.template.delete', value?.data ?? 'SUCCESS', { id });
|
|
146
146
|
},
|
|
@@ -156,7 +156,7 @@ const opTemplateDefault = {
|
|
|
156
156
|
async handler(args, env) {
|
|
157
157
|
const id = String(args.id || '').trim();
|
|
158
158
|
if (!id)
|
|
159
|
-
throw
|
|
159
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
160
160
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/defaultMailTemplate', method: 'POST', body: { id } }));
|
|
161
161
|
return mailSuccess('mail.template.default', value?.data ?? 'SUCCESS', { id });
|
|
162
162
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createMeetingContinuationSigner } from './continuation.js';
|
|
5
6
|
import { createMeetingHost } from './host.js';
|
|
6
7
|
import { meetingManifest, OPERATION_INDEX_HINT } from './manifest.js';
|
|
@@ -101,8 +102,16 @@ export const meetingShortcut = {
|
|
|
101
102
|
const meeting = program.command('meeting').description('泛微E10会议管理(模式探测/会议列表/会议室/类型/冲突检测/预约/回执/签到)');
|
|
102
103
|
meeting.command('schema')
|
|
103
104
|
.description('Print meeting operation manifest for agents')
|
|
104
|
-
.
|
|
105
|
-
|
|
105
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
106
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
107
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
108
|
+
.action(action((ctx, options) => {
|
|
109
|
+
const schema = schemaOptionsOf(options);
|
|
110
|
+
ctx.output.write(manifestView(meetingManifest, schema), {
|
|
111
|
+
json: true,
|
|
112
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
113
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
114
|
+
});
|
|
106
115
|
}));
|
|
107
116
|
// 能力清单:**纯文本、不压缩**。
|
|
108
117
|
// 为什么必须单独开一条命令:`meeting schema --json` 完整 308KB,stdout 只回 20KB 预览,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createOkrContinuationSigner } from './continuation.js';
|
|
5
6
|
import { okrValidationError } from './errors.js';
|
|
6
7
|
import { createOkrHost } from './host.js';
|
|
@@ -97,8 +98,16 @@ export const okrShortcut = {
|
|
|
97
98
|
const okr = program.command('okr').description('泛微E10 OKR 目标管理(目标列表/详情/新建/编辑、关键成果、目标对齐、评论、链路判定)');
|
|
98
99
|
okr.command('schema')
|
|
99
100
|
.description('Print okr operation manifest for agents')
|
|
100
|
-
.
|
|
101
|
-
|
|
101
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
102
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
103
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
104
|
+
.action(action((ctx, options) => {
|
|
105
|
+
const schema = schemaOptionsOf(options);
|
|
106
|
+
ctx.output.write(manifestView(okrManifest, schema), {
|
|
107
|
+
json: true,
|
|
108
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
109
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
110
|
+
});
|
|
102
111
|
}));
|
|
103
112
|
okr.command('run')
|
|
104
113
|
.description('Run an okr operation with JSON input')
|
|
@@ -86,6 +86,47 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
86
86
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* schema 索引:只列 operation 与必需字段名,避免整份 manifest(约 129 KB)被输出预算截成预览。
|
|
91
|
+
* 字段类型/枚举/示例用 `--operation` 单取,整份清单用 `--full`。
|
|
92
|
+
*/
|
|
93
|
+
function performanceManifestIndex() {
|
|
94
|
+
return {
|
|
95
|
+
schemaVersion: performanceManifest.schemaVersion,
|
|
96
|
+
name: performanceManifest.name,
|
|
97
|
+
title: performanceManifest.title,
|
|
98
|
+
version: performanceManifest.version,
|
|
99
|
+
host: performanceManifest.host,
|
|
100
|
+
status: performanceManifest.status,
|
|
101
|
+
sourceSkill: performanceManifest.sourceSkill,
|
|
102
|
+
capabilities: performanceManifest.capabilities,
|
|
103
|
+
operationCount: performanceManifest.operations.length,
|
|
104
|
+
operations: performanceManifest.operations.map((operation) => {
|
|
105
|
+
const schema = operation.inputSchema;
|
|
106
|
+
return {
|
|
107
|
+
name: operation.name,
|
|
108
|
+
resource: operation.resource,
|
|
109
|
+
summary: operation.summary,
|
|
110
|
+
...(operation.capability ? { capability: operation.capability } : {}),
|
|
111
|
+
risk: operation.risk,
|
|
112
|
+
...(operation.requiresConfirmation ? { requiresConfirmation: true } : {}),
|
|
113
|
+
required: schema.required ?? [],
|
|
114
|
+
propertyCount: Object.keys(schema.properties ?? {}).length,
|
|
115
|
+
};
|
|
116
|
+
}),
|
|
117
|
+
withheldOperations: performanceManifest.withheldOperations,
|
|
118
|
+
operationsHint: '默认只列 operation 与必需字段;字段类型/枚举/示例用 `performance schema --operation <name>` 单取,整份 manifest 用 `performance schema --full`(约 129 KB,超预算会落 ref)。',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** `--operation` 单取:允许省略 `performance.` 前缀。未命中报参数错误(exit 2),不返回空对象。 */
|
|
122
|
+
function findPerformanceOperationContract(name) {
|
|
123
|
+
const full = name.startsWith('performance.') ? name : `performance.${name}`;
|
|
124
|
+
const matched = performanceManifest.operations.find((operation) => operation.name === full);
|
|
125
|
+
if (!matched) {
|
|
126
|
+
throw pfValidationError('operation_unknown', `绩效模块不支持操作:${name}。可用操作见 performance schema 索引`);
|
|
127
|
+
}
|
|
128
|
+
return matched;
|
|
129
|
+
}
|
|
89
130
|
export const performanceShortcut = {
|
|
90
131
|
name: 'performance',
|
|
91
132
|
description: '泛微E10绩效方案(文档导入 → 草稿 → 确认发布)CLI',
|
|
@@ -93,9 +134,27 @@ export const performanceShortcut = {
|
|
|
93
134
|
register({ program, action }) {
|
|
94
135
|
const pf = program.command('performance').description('泛微E10绩效方案(实体解析/落草稿/回读核对/确认发布)');
|
|
95
136
|
pf.command('schema')
|
|
96
|
-
.description('Print performance operation
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
.description('Print performance operation index for agents')
|
|
138
|
+
// `--list` 是本模块的默认行为(默认就输出精简索引),这里保留声明只为跨域统一:
|
|
139
|
+
// 其余业务域统一用 `schema --list` 拿全量清单,模型不必为 performance 记一个例外。
|
|
140
|
+
.option('--list', '只列操作索引(name/summary/risk),与默认输出一致,全量不截断')
|
|
141
|
+
.option('--operation <name>', 'print one operation with its full inputSchema')
|
|
142
|
+
.option('--full', 'print the whole manifest (about 129 KB; stdout may be trimmed to a ref)')
|
|
143
|
+
.action(action((ctx, options) => {
|
|
144
|
+
const opts = asOptions(options);
|
|
145
|
+
const requested = String(opts.operation ?? '').trim();
|
|
146
|
+
if (requested && opts.full === true) {
|
|
147
|
+
throw pfValidationError('option_conflict', '不能同时传 --operation 和 --full');
|
|
148
|
+
}
|
|
149
|
+
if (opts.full === true) {
|
|
150
|
+
ctx.output.write(performanceManifest, { json: true });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (requested) {
|
|
154
|
+
ctx.output.write(findPerformanceOperationContract(requested), { json: true });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
ctx.output.write(performanceManifestIndex(), { json: true });
|
|
99
158
|
}));
|
|
100
159
|
pf.command('run')
|
|
101
160
|
.description('Run a performance operation with JSON input')
|
|
@@ -113,6 +113,13 @@ export function validateScheme(req) {
|
|
|
113
113
|
if (req.includeInterviewItem === true && (!Array.isArray(req.interviewStepList) || req.interviewStepList.length === 0)) {
|
|
114
114
|
issues.push({ level: 'error', message: 'includeInterviewItem=true 时 interviewStepList 至少一个节点' });
|
|
115
115
|
}
|
|
116
|
+
// 提醒配置成对约束:服务端 saveSchemeRemindSetting 对两个列表是「任一为空即整块 return」,
|
|
117
|
+
// 只填一个不会报错,但自定义提醒会静默不生效(SchemeServiceImpl:446-449)。
|
|
118
|
+
const hasRemindOrdinary = Array.isArray(req.remindOrdinaryData) && req.remindOrdinaryData.length > 0;
|
|
119
|
+
const hasRemindTime = Array.isArray(req.remindTimeData) && req.remindTimeData.length > 0;
|
|
120
|
+
if (hasRemindOrdinary !== hasRemindTime) {
|
|
121
|
+
issues.push({ level: 'warn', message: 'remindOrdinaryData 与 remindTimeData 必须同时非空:服务端任一为空则整块提醒设置不落库(当前只填了一个,自定义提醒不会生效)' });
|
|
122
|
+
}
|
|
116
123
|
const basicData = Array.isArray(req.basicData) ? req.basicData : [];
|
|
117
124
|
const weights = basicData
|
|
118
125
|
.map((row) => num(row?.weight))
|
|
@@ -37,6 +37,36 @@ const stepFields = { sort: { type: 'integer' }, stepType: stringField, raterType
|
|
|
37
37
|
checkKps: booleanField, checkSignature: booleanField, stepWeight: numberField,
|
|
38
38
|
scoreMinNum: nullableNumber, scoreMaxNum: nullableNumber, interviewOrder: { type: ['string', 'null'] },
|
|
39
39
|
stepOperators: objectItems({ operateType: stringField, operater: { type: ['integer', 'string', 'null'] } }) };
|
|
40
|
+
/**
|
|
41
|
+
* 提醒配置元素(SchemeRemindSetting)。
|
|
42
|
+
* 证据:weaver-wr-performance 的 SchemeEditReq:397/402(List<SchemeRemindSetting>)、
|
|
43
|
+
* entity/SchemeRemindSetting.java、vo/basicSetting/RemindContentData.java;
|
|
44
|
+
* 事件名/提醒对象/timeRule 取值来自 weapp-performance 的 scheme/edit/remindCustomSetting.tsx 与 remindCustomEdit.tsx。
|
|
45
|
+
* 事件名不锁 enum:服务端不校验,前端才是权威取值源,锁死会挡住后续新增事件。
|
|
46
|
+
*/
|
|
47
|
+
const remindContentItem = {
|
|
48
|
+
type: 'object',
|
|
49
|
+
additionalProperties: true,
|
|
50
|
+
properties: {
|
|
51
|
+
id: { type: ['string', 'null'], description: '内容记录 id(服务端生成,回传时原样带上)' },
|
|
52
|
+
langId: { type: 'integer', description: '语言 id(中文=7)' },
|
|
53
|
+
value: { type: 'string', description: '提醒内容文案,可含 {字段} 占位符' },
|
|
54
|
+
targetId: { type: ['string', 'null'], description: '内容模板 id,字符串形式' },
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const remindSettingItem = {
|
|
58
|
+
type: 'object',
|
|
59
|
+
additionalProperties: true,
|
|
60
|
+
properties: {
|
|
61
|
+
remindEventName: { type: 'string', description: '提醒事件名。普通提醒:schemeSubmitRemind/schemeBackRemind/distributeDiscontRemind/distributeFileRemind/commitRemind/auditRemind/complateRemind/startFlowRemind/flowBackedRemind/flowBackRemind/commitedRemind/flowApprovedRemind;定时提醒:scoreEndRemind/approveEndRemind/scoreOverTimeRemind/approveOverTimeRemind/appealsOverTimeRemind' },
|
|
62
|
+
remindTarget: { type: 'string', description: '提醒对象:approver 审批人 / submiter 提交人 / distributionManager 分布负责人 / scorer 评分人 / kpiUser 被评分人 / appealsManager 申诉处理人。由事件决定,按服务端默认值原样带回,不要自造' },
|
|
63
|
+
remindStatus: { type: 'boolean', description: '是否启用' },
|
|
64
|
+
remindDay: { type: 'integer', description: '截止日期前 N 天(仅定时提醒需要;普通提醒填 0)' },
|
|
65
|
+
remindTime: { type: 'string', description: '提醒时刻 HH:mm,如 "08:00"(仅定时提醒需要)' },
|
|
66
|
+
timeRule: { type: 'string', enum: ['serverTime', 'localTime'], description: '时间基准:serverTime 按服务器时间 / localTime 按当地时间。真机回读报文通常不含该字段(缺省按 serverTime),原样带回时不必补写' },
|
|
67
|
+
remindContentData: { type: 'array', items: remindContentItem, description: '多语言提醒内容' },
|
|
68
|
+
},
|
|
69
|
+
};
|
|
40
70
|
export const schemeEditReqSchema = {
|
|
41
71
|
id: { type: 'string', description: '方案 id,字符串形式(18 位 Long 转 JSON 数字会丢精度)。首次暂存不传;再次暂存/发布必传(覆盖式更新)' },
|
|
42
72
|
detailId: { type: 'string', description: '指标明细 id,字符串形式(发布时必传;缺失会导致 hr_kpi_details 重复插入、detail 永久 500)' },
|
|
@@ -92,8 +122,16 @@ export const schemeEditReqSchema = {
|
|
|
92
122
|
kpsDistributeType: stringField, flowDistributeType: stringField, createMode: stringField,
|
|
93
123
|
fieldFilters: { type: 'array', items: { type: 'object', additionalProperties: true } },
|
|
94
124
|
operatingTargetList: { type: 'array', items: { type: 'object', additionalProperties: true } },
|
|
95
|
-
remindOrdinaryData: {
|
|
96
|
-
|
|
125
|
+
remindOrdinaryData: {
|
|
126
|
+
type: 'array',
|
|
127
|
+
items: remindSettingItem,
|
|
128
|
+
description: '普通(事件型)提醒配置。⚠️ 必须与 remindTimeData 同时非空:服务端任一为空则整块提醒设置不落库。首选做法是从 scheme.detail 的 data 回读后,只改 remindStatus/remindDay/remindTime 再原样带回,不要凭空构造;回读记录还带 id/creator/tenantKey/createTime/deleteType/schemeId 等服务端字段,原样带回即可,普通提醒回读不含 remindTime 键。示例:[{"remindEventName":"commitRemind","remindTarget":"scorer","remindStatus":true,"remindDay":0,"timeRule":"serverTime","remindContentData":[{"langId":7,"value":"您有考核评分待提交"}]}]',
|
|
129
|
+
},
|
|
130
|
+
remindTimeData: {
|
|
131
|
+
type: 'array',
|
|
132
|
+
items: remindSettingItem,
|
|
133
|
+
description: '定时(截止/超时)提醒配置。⚠️ 必须与 remindOrdinaryData 同时非空;定时提醒需 remindDay + remindTime(真机报文形如 "08:00")。回读记录还带 id/creator/tenantKey/createTime/deleteType/schemeId 等服务端字段,原样带回即可。示例:[{"remindEventName":"scoreEndRemind","remindTarget":"scorer","remindStatus":true,"remindDay":3,"remindTime":"08:00","timeRule":"serverTime","remindContentData":[{"langId":7,"value":"评分将于 3 天后截止"}]}]',
|
|
134
|
+
},
|
|
97
135
|
teffectTime: { type: 'string', description: '生效日期 yyyy-MM-dd(文档未提及时默认当天)' },
|
|
98
136
|
failureTime: { type: 'string', description: '失效日期 yyyy-MM-dd(可选)' },
|
|
99
137
|
dateTypeSet: { type: 'string', enum: ['setting', 'custom'], description: '自动时间项模式;填 distributeTime/forbidTime 时应为 custom' },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createPlanContinuationSigner } from './continuation.js';
|
|
5
6
|
import { planValidationError } from './errors.js';
|
|
6
7
|
import { createPlanHost } from './host.js';
|
|
@@ -97,8 +98,16 @@ export const planShortcut = {
|
|
|
97
98
|
const plan = program.command('plan').description('泛微E10计划报告(报告详情/列表/新建/修改/发布/撤回/提交提醒/评论)');
|
|
98
99
|
plan.command('schema')
|
|
99
100
|
.description('Print plan operation manifest for agents')
|
|
100
|
-
.
|
|
101
|
-
|
|
101
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
102
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
103
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
104
|
+
.action(action((ctx, options) => {
|
|
105
|
+
const schema = schemaOptionsOf(options);
|
|
106
|
+
ctx.output.write(manifestView(planManifest, schema), {
|
|
107
|
+
json: true,
|
|
108
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
109
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
110
|
+
});
|
|
102
111
|
}));
|
|
103
112
|
plan.command('run')
|
|
104
113
|
.description('Run a plan operation with JSON input')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createProjectContinuationSigner } from './continuation.js';
|
|
5
6
|
import { createProjectHost } from './host.js';
|
|
6
7
|
import { projectManifest } from './manifest.js';
|
|
@@ -93,8 +94,16 @@ export const projectShortcut = {
|
|
|
93
94
|
const project = program.command('project').description('泛微E10事井然项目管理(项目/任务查询与确认写入)');
|
|
94
95
|
project.command('schema')
|
|
95
96
|
.description('Print project operation manifest for agents')
|
|
96
|
-
.
|
|
97
|
-
|
|
97
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
98
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
99
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
100
|
+
.action(action((ctx, options) => {
|
|
101
|
+
const schema = schemaOptionsOf(options);
|
|
102
|
+
ctx.output.write(manifestView(projectManifest, schema), {
|
|
103
|
+
json: true,
|
|
104
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
105
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
106
|
+
});
|
|
98
107
|
}));
|
|
99
108
|
project.command('run')
|
|
100
109
|
.description('Run a project operation with JSON input')
|
|
@@ -103,6 +103,7 @@ function createOperations(namePrefix, target) {
|
|
|
103
103
|
action: prepareName,
|
|
104
104
|
summary: `预览并生成${target.entity === 'task' ? '任务' : '项目'}创建写入 continuation,不发生写入`,
|
|
105
105
|
risk: 'read-before-write',
|
|
106
|
+
requiresConfirmation: true,
|
|
106
107
|
inputSchema: schemaOf({ records: SCHEMA_RECORDS }, { required: ['records'] }),
|
|
107
108
|
handler: async (args, env) => {
|
|
108
109
|
const operator = await operatorId(env.host);
|
|
@@ -161,6 +162,7 @@ function updateOperations(namePrefix, target) {
|
|
|
161
162
|
action: prepareName,
|
|
162
163
|
summary: `回查并预览${target.entity === 'task' ? '任务' : '项目'}更新,生成 continuation,不发生写入`,
|
|
163
164
|
risk: 'read-before-write',
|
|
165
|
+
requiresConfirmation: true,
|
|
164
166
|
inputSchema: schemaOf({ id: SCHEMA_ID_STRING, fields: SCHEMA_FIELDS }, { required: ['id', 'fields'] }),
|
|
165
167
|
handler: async (args, env) => {
|
|
166
168
|
const id = idString(args.id, 'id');
|
|
@@ -231,6 +233,7 @@ function deleteOperations(namePrefix, target) {
|
|
|
231
233
|
action: prepareName,
|
|
232
234
|
summary: `回查${target.entity === 'task' ? '任务' : '项目'}并生成不可逆删除 continuation,不发生删除`,
|
|
233
235
|
risk: 'read-before-write',
|
|
236
|
+
requiresConfirmation: true,
|
|
234
237
|
inputSchema: schemaOf({ id: SCHEMA_ID_STRING }, { required: ['id'] }),
|
|
235
238
|
handler: async (args, env) => {
|
|
236
239
|
const id = idString(args.id, 'id');
|