weaver-work-cli 0.1.68 → 0.1.70
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-SJTC5265.js → archive-VUTREF3P.js} +4 -4
- package/dist/chunks/{archive-oa-PN46RTI2.js → archive-oa-VXXO4RTB.js} +4 -4
- package/dist/chunks/{asset-XM3Y4FVU.js → asset-45U6TY7I.js} +32 -5
- package/dist/chunks/{asset-idle-DHGP3NYY.js → asset-idle-YCRBMTIT.js} +4 -4
- package/dist/chunks/{attachment-content-IXIBOET6.js → attachment-content-DMU7KNZ7.js} +3 -3
- package/dist/chunks/{blog-JC47AIXK.js → blog-5AML4WMG.js} +4 -4
- package/dist/chunks/{caizhilian-IKIHM77A.js → caizhilian-3P7BUNHT.js} +6 -6
- package/dist/chunks/{calendar-GZTSJ57Y.js → calendar-2HUXM3CZ.js} +4 -4
- package/dist/chunks/{chunk-6OK4LW76.js → chunk-4W6BSNIL.js} +6 -6
- package/dist/chunks/{chunk-3W5NMGDS.js → chunk-727VKJQK.js} +2 -2
- package/dist/chunks/{chunk-QHKY4WZA.js → chunk-7CINV2BU.js} +2 -2
- package/dist/chunks/{chunk-26FCCU5O.js → chunk-DSBV4GRK.js} +3 -3
- package/dist/chunks/{chunk-HWA2A25Y.js → chunk-E7VWE2XI.js} +3 -3
- package/dist/chunks/{chunk-C5IIIT4D.js → chunk-EHH363SP.js} +4 -4
- package/dist/chunks/{chunk-LXXR2RRE.js → chunk-GFOFUH6O.js} +50 -50
- package/dist/chunks/{chunk-TJN4PIYO.js → chunk-GTAFCAVP.js} +2 -0
- package/dist/chunks/{chunk-O7KPHPXQ.js → chunk-GWM5TLIK.js} +34 -34
- package/dist/chunks/{chunk-WSHIOSGM.js → chunk-H2NRTGZR.js} +3 -3
- package/dist/chunks/{chunk-YSEHTSHS.js → chunk-HAORST2G.js} +11 -11
- package/dist/chunks/{chunk-4WCVRDC5.js → chunk-HG6INLH6.js} +13 -0
- package/dist/chunks/{chunk-FDBAFANU.js → chunk-I5XB4MZT.js} +227 -23
- package/dist/chunks/{chunk-BJNSTCJK.js → chunk-IVCOZCAW.js} +1 -1
- package/dist/chunks/{chunk-Y7RGBRLG.js → chunk-KDOJW5LH.js} +1 -1
- package/dist/chunks/{chunk-QO6JYDIW.js → chunk-L2A3COWV.js} +4 -4
- package/dist/chunks/{chunk-X7ZTM4XG.js → chunk-LJE7RZNC.js} +1 -1
- package/dist/chunks/{chunk-FJUOUSV3.js → chunk-LRKKKO5A.js} +36 -9
- package/dist/chunks/{chunk-HLT6B26P.js → chunk-LSVA7QA6.js} +1 -1
- package/dist/chunks/{chunk-6N4JPNFL.js → chunk-MD5CW4B6.js} +1 -1
- package/dist/chunks/{chunk-Q6D6PSMH.js → chunk-QYDSTYGG.js} +3 -3
- package/dist/chunks/{chunk-AFZTMYGC.js → chunk-T24EBWAZ.js} +1 -1
- package/dist/chunks/{chunk-6T5X6YWX.js → chunk-U3OO3IZF.js} +3 -3
- package/dist/chunks/{chunk-VLY5RTVO.js → chunk-UVWW5ABZ.js} +3 -3
- package/dist/chunks/{chunk-NP3ZZFGI.js → chunk-VZUH3LKI.js} +16 -5
- package/dist/chunks/{chunk-OKUJY5YB.js → chunk-X6PMJQGO.js} +64 -21
- package/dist/chunks/{chunk-3NJQTG6X.js → chunk-XIBMZEDB.js} +2 -2
- package/dist/chunks/{conflict-CEXRX2KP.js → conflict-YW5BULJ3.js} +2 -2
- package/dist/chunks/{contract-PM3EUPZC.js → contract-3PMHUASH.js} +164 -5
- package/dist/chunks/{cowork-34CBYVQP.js → cowork-FZBTTBYX.js} +4 -4
- package/dist/chunks/{create-flow-DG6D7U2L.js → create-flow-5OBS3B3V.js} +6 -6
- package/dist/chunks/{data-3G4GQS5P.js → data-2YZ6A6TL.js} +19 -4
- package/dist/chunks/{ebuilder-form-5ENYH7IF.js → ebuilder-form-AWPTMZBZ.js} +5 -5
- package/dist/chunks/{ehr-2CONM7R6.js → ehr-MNPR4TE5.js} +4 -4
- package/dist/chunks/{entry-mode-KMP66KHE.js → entry-mode-L65OWPFM.js} +3 -3
- package/dist/chunks/{env-SW6CTETI.js → env-XW7LYIME.js} +2 -2
- package/dist/chunks/{esb-FQASCY2H.js → esb-GSB5QCEX.js} +6 -6
- package/dist/chunks/{factory-ETQAICPA.js → factory-MHFZZAGH.js} +1 -1
- package/dist/chunks/{fna-FCLVIWAS.js → fna-XBSNUS2V.js} +4 -4
- package/dist/chunks/{group-chat-GTYMCBYS.js → group-chat-EEOLO5NM.js} +3 -3
- package/dist/chunks/{host-P7G22WNM.js → host-2UMNXX5H.js} +4 -4
- package/dist/chunks/{host-XLCBLNJD.js → host-BD44ASOD.js} +4 -4
- package/dist/chunks/{host-2ED2KC4X.js → host-NVDG3NC6.js} +4 -4
- package/dist/chunks/{host-46NYKDQP.js → host-R7BP3CTI.js} +4 -4
- package/dist/chunks/{host-7IPZKIM4.js → host-SYPCA63D.js} +4 -4
- package/dist/chunks/{host-2UYZEY2V.js → host-XVWBOSEN.js} +4 -4
- package/dist/chunks/{hrm-5WSMSKPX.js → hrm-FZUDJAND.js} +17 -11
- package/dist/chunks/{im-P7GNBRG6.js → im-F5NENPD7.js} +4 -4
- package/dist/chunks/{invoice-2QCVNXBG.js → invoice-DS6FLU55.js} +42 -6
- package/dist/chunks/{jiuchuanhui-FHGFYAHU.js → jiuchuanhui-JCBUR563.js} +1332 -1037
- package/dist/chunks/{lazy-dispatch-K25LTKQY.js → lazy-dispatch-F6O2EPGR.js} +7 -7
- package/dist/chunks/{mail-P7VMUKQW.js → mail-ZEOSANEJ.js} +4 -4
- package/dist/chunks/{meeting-3PTTPUSG.js → meeting-PCD5EPBF.js} +15 -15
- package/dist/chunks/{minute-doc-3IMRJDJV.js → minute-doc-WTZJVCHG.js} +4 -4
- package/dist/chunks/{okr-OIWJRYWY.js → okr-OZUMTMCL.js} +4 -4
- package/dist/chunks/{operations-MI2BSKZX.js → operations-UTUWFJTX.js} +5 -5
- package/dist/chunks/{performance-OPEQNW7Y.js → performance-SMVTPK6T.js} +8 -7
- package/dist/chunks/{plan-TJAS4N5X.js → plan-C2NENH42.js} +4 -4
- package/dist/chunks/{project-CYBGU6K6.js → project-FAJ2P3UR.js} +4 -4
- package/dist/chunks/{reception-2VSWJQ5N.js → reception-NH6MJFPR.js} +16 -8
- package/dist/chunks/{recruit-stage-KHJYQE3I.js → recruit-stage-DPEFHLSE.js} +3 -3
- package/dist/chunks/{registry-FXBOGH2X.js → registry-3B3OAJYX.js} +4 -4
- package/dist/chunks/{registry-QRMXRSCT.js → registry-FTPUUHWC.js} +5 -5
- package/dist/chunks/{registry-PHPYTXS4.js → registry-ZQ7OONCB.js} +12 -12
- package/dist/chunks/{room-recommend-BKCPAXQG.js → room-recommend-73NBN3RU.js} +4 -4
- package/dist/chunks/{schedule-Q3MPSZV6.js → schedule-SDBOBBUQ.js} +4 -4
- package/dist/chunks/{smart-extract-TYYKC244.js → smart-extract-GTYKF5TJ.js} +4 -4
- package/dist/chunks/{workflow-GEDHALMY.js → workflow-OWHWLAOX.js} +81 -12
- package/dist/core/error-codes.js +1 -1
- package/dist/core/host-policy.js +56 -0
- package/dist/core/timing.js +227 -0
- package/dist/index.js +39 -36
- package/dist/internal/e10/auth/commands.js +11 -0
- package/dist/internal/e10/auth/error-log.js +13 -0
- package/dist/internal/e10/auth/messages.js +10 -0
- package/dist/internal/e10/auth/xiaoe.js +12 -2
- package/dist/internal/e10/context.js +39 -12
- package/dist/internal/e10/network-error.js +28 -0
- package/dist/internal/e10/tls-policy.js +260 -0
- package/dist/shortcuts/asset/manifest.js +34 -1
- package/dist/shortcuts/contract/manifest.js +166 -1
- package/dist/shortcuts/data/manifest.js +32 -1
- package/dist/shortcuts/hrm/index.js +20 -7
- package/dist/shortcuts/invoice/manifest.js +43 -1
- package/dist/shortcuts/jiuchuanhui/cache.js +49 -35
- package/dist/shortcuts/jiuchuanhui/host.js +109 -5
- package/dist/shortcuts/jiuchuanhui/index.js +43 -7
- package/dist/shortcuts/jiuchuanhui/manifest.js +138 -2
- package/dist/shortcuts/jiuchuanhui/operations/customer-quick.js +110 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +11 -56
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +9 -16
- package/dist/shortcuts/jiuchuanhui/operations/generic.js +8 -30
- package/dist/shortcuts/jiuchuanhui/operations/registry.js +8 -2
- package/dist/shortcuts/jiuchuanhui/operations/shared.js +0 -10
- package/dist/shortcuts/performance/operations/flow-detail.js +5 -4
- package/dist/shortcuts/reception/host.js +19 -5
- package/dist/shortcuts/workflow/index.js +55 -5
- package/dist/shortcuts/workflow/operations/aiDeepRead/collect.js +5 -2
- package/dist/shortcuts/workflow/operations/read.js +12 -2
- package/dist/shortcuts/workflow/operations/types.js +7 -1
- package/dist/shortcuts/workflow/operations/write.js +20 -2
- package/dist/shortcuts/workflow/operations.js +19 -1
- package/docs/e10-auth.md +48 -1
- package/docs/jiuchuanhui.md +17 -5
- package/package.json +1 -1
- package/scripts/xiaoe_env.py +18 -3
- package/skills/weaver-e10-asset-idle/SKILL.md +1 -1
- package/skills/weaver-e10-blog/SKILL.md +2 -2
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-data/SKILL.md +1 -1
- package/skills/weaver-e10-esb/SKILL.md +1 -1
- package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
- package/skills/weaver-e10-hrm/SKILL.md +1 -1
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +49 -90
- package/skills/weaver-e10-jiuchuanhui/references/cache.md +17 -13
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +33 -4
- package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +3 -3
- package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +9 -7
- package/skills/weaver-e10-jucailin/SKILL.md +84 -17
- package/skills/weaver-e10-jucailin/agents/openai.yaml +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-create.md +7 -8
- package/skills/weaver-e10-jucailin/references/recruit-implement-INDEX.md +41 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-consult-sop.md +77 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-guardrails.md +41 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-kb-data-update-channels.md +31 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-kb-form-external.md +43 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-kb-talent-base-form.md +32 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-collect-update-talent.md +93 -0
- package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-share-edit.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -11
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +3 -3
- package/skills/weaver-e10-mail/SKILL.md +52 -10
- package/skills/weaver-e10-mail/references/mail-agent-entry.md +1 -2
- package/skills/weaver-e10-meeting/SKILL.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-okr/SKILL.md +1 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +2 -2
- package/skills/weaver-e10-performance/agents/openai.yaml +4 -2
- package/skills/weaver-e10-performance/references/flow-assess.md +19 -6
- package/skills/weaver-e10-plan/SKILL.md +2 -2
- package/skills/weaver-e10-plan/references/source-manifest.json +3 -3
- package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +3 -3
- package/skills/weaver-e10-reception-flow/SKILL.md +53 -16
- package/skills/weaver-e10-shared/SKILL.md +4 -9
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-shijingran/SKILL.md +14 -6
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +2 -2
- package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -2
- package/skills/weaver-e10-workflow/references/workflow-deep-read.md +8 -3
- package/skills/weaver-e10-ziguanjia/SKILL.md +1 -1
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +1 -2
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { CUSTOMER_SEARCH_SCOPES } from './operations/customer-quick.js';
|
|
1
2
|
const pageProps = {
|
|
2
3
|
pageNo: { type: 'integer', minimum: 1, default: 1 },
|
|
3
4
|
pageSize: { type: 'integer', minimum: 1, maximum: 200, default: 10 },
|
|
4
5
|
count: { type: 'boolean', description: '是否并行请求总数接口' },
|
|
5
6
|
};
|
|
7
|
+
const customerQuickSearchProps = {
|
|
8
|
+
...pageProps,
|
|
9
|
+
customer_name: { type: 'string', minLength: 1, description: '客户名称搜索条件' },
|
|
10
|
+
};
|
|
6
11
|
const idProp = { type: 'string', pattern: '^[1-9]\\d*$' };
|
|
7
12
|
const formProp = {
|
|
8
13
|
type: 'object',
|
|
@@ -59,6 +64,107 @@ function writePair(baseName, title, props, required = [], fixed = {}, withPrepar
|
|
|
59
64
|
});
|
|
60
65
|
return list;
|
|
61
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* 每条 operation 的一句话用途,写入 schema 的 summary。
|
|
69
|
+
*
|
|
70
|
+
* 口径:只描述「做什么 + 关键入参 + 是否写库」,不写未在实现里体现的业务承诺;
|
|
71
|
+
* prepare/apply 成对出现时,prepare 标注「只出预览,不写入」,apply 标注「落库前需确认」。
|
|
72
|
+
*/
|
|
73
|
+
const OPERATION_SUMMARIES = {
|
|
74
|
+
'jiuchuanhui.cache.init': '初始化九氚汇本地缓存(写本地缓存文件,不调业务接口);入参 dryRun/verbose',
|
|
75
|
+
'jiuchuanhui.app.discovery': '按标签取九氚汇相关 eBuilder 应用 ID 列表',
|
|
76
|
+
'jiuchuanhui.form.discovery': '按标签与应用取表单(对象)定义,用于定位客户/商机等主表',
|
|
77
|
+
'jiuchuanhui.field.options': '取表单某字段的选项字典(id↔name);入参 fieldName/objId/groupId',
|
|
78
|
+
'jiuchuanhui.rest.cfg.detail': '按 apid + id 取 REST 配置详情(动作流配置解析结果)',
|
|
79
|
+
'jiuchuanhui.config.id.by.pk': '按主表与数据主键反查配置 ID(经动作流)',
|
|
80
|
+
'jiuchuanhui.file.preview': '取附件预览地址;入参 fileId/fieldId/appId',
|
|
81
|
+
'jiuchuanhui.customer.create.prepare': '准备新建客户(只出预览,不写入);入参 mainTable 与客户字段',
|
|
82
|
+
'jiuchuanhui.customer.create.apply': '提交新建客户(落库前需确认);需 continuation + confirm',
|
|
83
|
+
'jiuchuanhui.customer.get': '按 id 取客户详情',
|
|
84
|
+
'jiuchuanhui.customer.search': '分页查询客户列表(支持条件过滤)',
|
|
85
|
+
'jiuchuanhui.customer.type.search': '分页查询客户类型字典',
|
|
86
|
+
'jiuchuanhui.customer.status.search': '分页查询客户状态字典',
|
|
87
|
+
'jiuchuanhui.customer.industry.search': '分页查询客户行业字典',
|
|
88
|
+
'jiuchuanhui.customer.open-sea.search': '分页查询公海客户列表',
|
|
89
|
+
'jiuchuanhui.customer.update.prepare': '准备修改客户(只出预览,不写入);入参 mainTable 与待改字段',
|
|
90
|
+
'jiuchuanhui.customer.update.apply': '提交修改客户(落库前需确认);需 continuation + confirm',
|
|
91
|
+
'jiuchuanhui.customer.transfer.prepare': '准备转移客户负责人(只出预览,不写入);入参 mainTable 与目标负责人',
|
|
92
|
+
'jiuchuanhui.customer.transfer.apply': '提交转移客户负责人(落库前需确认);需 continuation + confirm',
|
|
93
|
+
'jiuchuanhui.customer.open-sea.release.prepare': '准备把客户释放到公海(只出预览,不写入)',
|
|
94
|
+
'jiuchuanhui.customer.open-sea.release.apply': '提交把客户释放到公海(落库前需确认);需 continuation + confirm',
|
|
95
|
+
'jiuchuanhui.customer.open-sea.claim.prepare': '准备从公海领取客户(只出预览,不写入)',
|
|
96
|
+
'jiuchuanhui.customer.open-sea.claim.apply': '提交从公海领取客户(落库前需确认);需 continuation + confirm',
|
|
97
|
+
'jiuchuanhui.customer.duplicate.check': '客户查重:按名称/关键信息找出疑似重复客户(经动作流)',
|
|
98
|
+
'jiuchuanhui.customer.contact-record.create.prepare': '准备新增客户联系记录(只出预览,不写入)',
|
|
99
|
+
'jiuchuanhui.customer.contact-record.create.apply': '提交新增客户联系记录(落库前需确认);需 continuation + confirm',
|
|
100
|
+
'jiuchuanhui.customer.contact-record.batch.prepare': '准备批量新增客户联系记录(只出预览,不写入)',
|
|
101
|
+
'jiuchuanhui.customer.contact-record.batch.apply': '提交批量新增客户联系记录(落库前需确认);需 continuation + confirm',
|
|
102
|
+
'jiuchuanhui.contact.create.prepare': '准备新建联系人(只出预览,不写入);入参 mainTable 与联系人字段',
|
|
103
|
+
'jiuchuanhui.contact.create.apply': '提交新建联系人(落库前需确认);需 continuation + confirm',
|
|
104
|
+
'jiuchuanhui.contact.get': '按 id 取联系人详情',
|
|
105
|
+
'jiuchuanhui.contact.update.prepare': '准备修改联系人(只出预览,不写入)',
|
|
106
|
+
'jiuchuanhui.contact.update.apply': '提交修改联系人(落库前需确认);需 continuation + confirm',
|
|
107
|
+
'jiuchuanhui.contact.by-entity.search': '按客户或商机查询关联的联系人列表;入参 customerId/saleChanceId',
|
|
108
|
+
'jiuchuanhui.sale.create.prepare': '准备新建商机(只出预览,不写入);入参 mainTable 与商机字段',
|
|
109
|
+
'jiuchuanhui.sale.create.apply': '提交新建商机(落库前需确认);需 continuation + confirm',
|
|
110
|
+
'jiuchuanhui.sale.get': '按 id 取商机详情',
|
|
111
|
+
'jiuchuanhui.sale.search': '分页查询商机列表(支持条件过滤)',
|
|
112
|
+
'jiuchuanhui.sale.update.prepare': '准备修改商机(只出预览,不写入)',
|
|
113
|
+
'jiuchuanhui.sale.update.apply': '提交修改商机(落库前需确认);需 continuation + confirm',
|
|
114
|
+
'jiuchuanhui.sale.stage.search': '分页查询销售阶段字典',
|
|
115
|
+
'jiuchuanhui.sale.process.search': '分页查询商机的流程/阶段推进记录',
|
|
116
|
+
'jiuchuanhui.sale.lose-reason.search': '分页查询丢单原因字典',
|
|
117
|
+
'jiuchuanhui.rival.search': '分页查询竞争对手列表',
|
|
118
|
+
'jiuchuanhui.sale.win.prepare': '准备标记商机赢单(只出预览,不写入)',
|
|
119
|
+
'jiuchuanhui.sale.win.apply': '提交标记商机赢单(落库前需确认);需 continuation + confirm',
|
|
120
|
+
'jiuchuanhui.sale.lose.prepare': '准备标记商机输单(只出预览,不写入)',
|
|
121
|
+
'jiuchuanhui.sale.lose.apply': '提交标记商机输单(落库前需确认);需 continuation + confirm',
|
|
122
|
+
'jiuchuanhui.sale.invalid.prepare': '准备作废商机(只出预览,不写入)',
|
|
123
|
+
'jiuchuanhui.sale.invalid.apply': '提交作废商机(落库前需确认);需 continuation + confirm',
|
|
124
|
+
'jiuchuanhui.sale.pause.prepare': '准备暂停商机(只出预览,不写入)',
|
|
125
|
+
'jiuchuanhui.sale.pause.apply': '提交暂停商机(落库前需确认);需 continuation + confirm',
|
|
126
|
+
'jiuchuanhui.sale.restart.prepare': '准备重启商机(只出预览,不写入)',
|
|
127
|
+
'jiuchuanhui.sale.restart.apply': '提交重启商机(落库前需确认);需 continuation + confirm',
|
|
128
|
+
'jiuchuanhui.sale.manager-change.prepare': '准备变更商机负责人(只出预览,不写入)',
|
|
129
|
+
'jiuchuanhui.sale.manager-change.apply': '提交变更商机负责人(落库前需确认);需 continuation + confirm',
|
|
130
|
+
'jiuchuanhui.sale.link-contacts.prepare': '准备给商机关联联系人(只出预览,不写入)',
|
|
131
|
+
'jiuchuanhui.sale.link-contacts.apply': '提交给商机关联联系人(落库前需确认);需 continuation + confirm',
|
|
132
|
+
'jiuchuanhui.sale.contact-record.create.prepare': '准备新增商机联系记录(只出预览,不写入)',
|
|
133
|
+
'jiuchuanhui.sale.contact-record.create.apply': '提交新增商机联系记录(落库前需确认);需 continuation + confirm',
|
|
134
|
+
'jiuchuanhui.clue.create.prepare': '准备新建线索(只出预览,不写入);入参 mainTable 与线索字段',
|
|
135
|
+
'jiuchuanhui.clue.create.apply': '提交新建线索(落库前需确认);需 continuation + confirm',
|
|
136
|
+
'jiuchuanhui.clue.get': '按 id 取线索详情',
|
|
137
|
+
'jiuchuanhui.clue.search': '分页查询线索列表(支持条件过滤)',
|
|
138
|
+
'jiuchuanhui.clue.pool.search': '分页查询线索池列表',
|
|
139
|
+
'jiuchuanhui.clue.update.prepare': '准备修改线索(只出预览,不写入)',
|
|
140
|
+
'jiuchuanhui.clue.update.apply': '提交修改线索(落库前需确认);需 continuation + confirm',
|
|
141
|
+
'jiuchuanhui.clue.status-change.prepare': '准备变更线索状态(只出预览,不写入)',
|
|
142
|
+
'jiuchuanhui.clue.status-change.apply': '提交变更线索状态(落库前需确认);需 continuation + confirm',
|
|
143
|
+
'jiuchuanhui.clue.to-customer.prepare': '准备把线索转为客户(只出预览,不写入)',
|
|
144
|
+
'jiuchuanhui.clue.to-customer.apply': '提交把线索转为客户(落库前需确认);需 continuation + confirm',
|
|
145
|
+
'jiuchuanhui.clue.contact-record.create.prepare': '准备新增线索联系记录(只出预览,不写入)',
|
|
146
|
+
'jiuchuanhui.clue.contact-record.create.apply': '提交新增线索联系记录(落库前需确认);需 continuation + confirm',
|
|
147
|
+
'jiuchuanhui.contact-plan.create.prepare': '准备新建联系计划(只出预览,不写入)',
|
|
148
|
+
'jiuchuanhui.contact-plan.create.apply': '提交新建联系计划(落库前需确认);需 continuation + confirm',
|
|
149
|
+
'jiuchuanhui.contact-plan.complete.prepare': '准备把联系计划标记完成(只出预览,不写入)',
|
|
150
|
+
'jiuchuanhui.contact-plan.complete.apply': '提交把联系计划标记完成(落库前需确认);需 continuation + confirm',
|
|
151
|
+
'jiuchuanhui.entity.contact-records.list': '查某个实体(客户/商机/线索)名下的联系记录;入参 mainTable 与实体主键',
|
|
152
|
+
'jiuchuanhui.contact-records.by-person-time.list': '按人员与时间范围查联系记录',
|
|
153
|
+
'jiuchuanhui.entity.id.by-name': '按名称解析实体 ID(重名时会给出候选)',
|
|
154
|
+
'jiuchuanhui.user.id.by-name': '按姓名解析用户 ID(重名时会给出候选)',
|
|
155
|
+
'jiuchuanhui.user.current-profile': '取当前登录人的画像信息(部门/岗位/上级)',
|
|
156
|
+
'jiuchuanhui.entity.permission.judge': '判定当前用户对某实体(客户/商机/线索)的操作权限',
|
|
157
|
+
'jiuchuanhui.company.business-profile.query': '查客户的工商画像信息',
|
|
158
|
+
'jiuchuanhui.field.info.by-ids': '按 ID 批量取字段信息(名称/类型)',
|
|
159
|
+
'jiuchuanhui.browser-option.search': '通用浏览按钮检索:按自定义浏览按钮类型取候选(路径参数 pathParams)',
|
|
160
|
+
'jiuchuanhui.get-rest-cfg-detail': '按 apid + id 取 REST 配置详情(与 rest.cfg.detail 同类,路径不同)',
|
|
161
|
+
};
|
|
162
|
+
function withSummaries(operations) {
|
|
163
|
+
return operations.map((item) => ({
|
|
164
|
+
...item,
|
|
165
|
+
summary: item.summary || OPERATION_SUMMARIES[item.name] || '',
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
62
168
|
export const jiuchuanhuiOperations = [
|
|
63
169
|
// ==================== 发现与配置 ====================
|
|
64
170
|
{
|
|
@@ -184,6 +290,29 @@ export const jiuchuanhuiOperations = [
|
|
|
184
290
|
properties: pageProps,
|
|
185
291
|
},
|
|
186
292
|
},
|
|
293
|
+
{
|
|
294
|
+
name: 'jiuchuanhui.customer.mine.search',
|
|
295
|
+
risk: 'read',
|
|
296
|
+
inputSchema: { type: 'object', additionalProperties: false, description: '查询我的客户。默认取第一页 10 条。', properties: customerQuickSearchProps },
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: 'jiuchuanhui.customer.success.search',
|
|
300
|
+
risk: 'read',
|
|
301
|
+
inputSchema: {
|
|
302
|
+
type: 'object',
|
|
303
|
+
additionalProperties: false,
|
|
304
|
+
description: '查询客户状态为“成功”或“成功客户”的客户。按当前租户的状态字典解析状态 ID,默认在我的客户范围内查询。',
|
|
305
|
+
properties: {
|
|
306
|
+
...customerQuickSearchProps,
|
|
307
|
+
scope: { type: 'string', enum: Object.keys(CUSTOMER_SEARCH_SCOPES), default: 'mine', description: '我的客户、全部可见客户或公海客户' },
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: 'jiuchuanhui.customer.open-sea.customers.search',
|
|
313
|
+
risk: 'read',
|
|
314
|
+
inputSchema: { type: 'object', additionalProperties: false, description: '查询公海范围中的客户记录。默认取第一页 10 条。', properties: customerQuickSearchProps },
|
|
315
|
+
},
|
|
187
316
|
{
|
|
188
317
|
name: 'jiuchuanhui.customer.type.search',
|
|
189
318
|
risk: 'read',
|
|
@@ -459,7 +588,7 @@ export const jiuchuanhuiManifest = {
|
|
|
459
588
|
host: 'e10-jiuchuanhui',
|
|
460
589
|
status: 'builtin',
|
|
461
590
|
sourceSkill: 'weaver-e10-jiuchuanhui',
|
|
462
|
-
operations: jiuchuanhuiOperations,
|
|
591
|
+
operations: withSummaries(jiuchuanhuiOperations),
|
|
463
592
|
withheldOperations: [
|
|
464
593
|
{
|
|
465
594
|
name: 'jiuchuanhui.sale.stage-advance',
|
|
@@ -467,6 +596,13 @@ export const jiuchuanhuiManifest = {
|
|
|
467
596
|
},
|
|
468
597
|
],
|
|
469
598
|
};
|
|
599
|
+
/**
|
|
600
|
+
* 单 operation 契约必须与 `jiuchuanhuiManifest.operations` 完全一致——尤其 `summary`
|
|
601
|
+
* (模型选工具的唯一依据)。所以查表要查**补全过 summary** 的清单,不能查原始数组。
|
|
602
|
+
*/
|
|
603
|
+
export function getJiuchuanhuiOperationContract(operation) {
|
|
604
|
+
return jiuchuanhuiManifest.operations.find((item) => item.name === operation);
|
|
605
|
+
}
|
|
470
606
|
export function hasJiuchuanhuiOperation(operation) {
|
|
471
|
-
return
|
|
607
|
+
return getJiuchuanhuiOperationContract(operation) !== undefined;
|
|
472
608
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { jiuchuanhuiCacheFile } from '../cache.js';
|
|
3
|
+
import { jiuchuanhuiValidationError } from '../errors.js';
|
|
4
|
+
import { asNonEmptyString } from './shared.js';
|
|
5
|
+
export const CUSTOMER_SEARCH_SCOPES = {
|
|
6
|
+
mine: { mine: '', all: '-1', customerSea: '-1' },
|
|
7
|
+
all: { mine: '-1', all: '', customerSea: '-1' },
|
|
8
|
+
'open-sea': { mine: '-1', all: '-1', customerSea: '' },
|
|
9
|
+
};
|
|
10
|
+
const STATUS_PAGE_SIZE = 100;
|
|
11
|
+
const STATUS_MAX_PAGES = 5;
|
|
12
|
+
function addSuccessStatusIds(ids, rows) {
|
|
13
|
+
for (const row of rows) {
|
|
14
|
+
const status = row?.mainTable ?? row;
|
|
15
|
+
const fields = status;
|
|
16
|
+
const label = String(fields?.state_name ?? '').trim() || String(fields?.name ?? '').trim();
|
|
17
|
+
if (label !== '成功客户' && label !== '成功')
|
|
18
|
+
continue;
|
|
19
|
+
const id = String(fields?.id ?? '').trim();
|
|
20
|
+
if (/^[1-9]\d*$/u.test(id))
|
|
21
|
+
ids.add(id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function cachedCustomerStatuses(context) {
|
|
25
|
+
const { tenantKey, userId } = await context.host.getSession();
|
|
26
|
+
if (!tenantKey || !userId)
|
|
27
|
+
return [];
|
|
28
|
+
try {
|
|
29
|
+
const raw = await readFile(jiuchuanhuiCacheFile(tenantKey, userId), 'utf8');
|
|
30
|
+
const rows = JSON.parse(raw.replace(/^\uFEFF/u, ''))?.ebuilder?.customer_status;
|
|
31
|
+
return Array.isArray(rows) && rows.length < STATUS_PAGE_SIZE * STATUS_MAX_PAGES ? rows : [];
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function uniqueSuccessStatusId(ids) {
|
|
38
|
+
if (ids.size > 1) {
|
|
39
|
+
throw jiuchuanhuiValidationError('customer_success_status_ambiguous', '找到多个成功客户状态,请确认要使用的客户状态', {
|
|
40
|
+
statusIds: [...ids],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return ids.values().next().value;
|
|
44
|
+
}
|
|
45
|
+
async function resolveSuccessStatus(search, context) {
|
|
46
|
+
const ids = new Set();
|
|
47
|
+
addSuccessStatusIds(ids, await cachedCustomerStatuses(context));
|
|
48
|
+
const cachedId = uniqueSuccessStatusId(ids);
|
|
49
|
+
if (cachedId)
|
|
50
|
+
return cachedId;
|
|
51
|
+
for (let pageNo = 1; pageNo <= STATUS_MAX_PAGES; pageNo += 1) {
|
|
52
|
+
const { response } = await search.execute({ pageNo, pageSize: STATUS_PAGE_SIZE }, context);
|
|
53
|
+
// This lookup supplies the filter for the next request. The final customer response is passed through.
|
|
54
|
+
const rows = response.value?.datajson?.datas;
|
|
55
|
+
if (response.httpStatus < 200 || response.httpStatus >= 300 || !Array.isArray(rows)) {
|
|
56
|
+
throw jiuchuanhuiValidationError('customer_success_status_lookup_failed', '无法读取客户状态字典,请确认需要使用的客户状态', { httpStatus: response.httpStatus });
|
|
57
|
+
}
|
|
58
|
+
addSuccessStatusIds(ids, rows);
|
|
59
|
+
const statusId = uniqueSuccessStatusId(ids);
|
|
60
|
+
if (rows.length < STATUS_PAGE_SIZE) {
|
|
61
|
+
if (statusId)
|
|
62
|
+
return statusId;
|
|
63
|
+
throw jiuchuanhuiValidationError('customer_success_status_not_found', '当前租户未找到“成功”或“成功客户”状态,请确认客户状态名称');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
throw jiuchuanhuiValidationError('customer_success_status_lookup_incomplete', '客户状态字典未查完,请确认需要使用的客户状态');
|
|
67
|
+
}
|
|
68
|
+
export class CustomerQuickSearchOperation {
|
|
69
|
+
name;
|
|
70
|
+
customerSearch;
|
|
71
|
+
defaultScope;
|
|
72
|
+
customerStatusSearch;
|
|
73
|
+
constructor(name, customerSearch, defaultScope, customerStatusSearch) {
|
|
74
|
+
this.name = name;
|
|
75
|
+
this.customerSearch = customerSearch;
|
|
76
|
+
this.defaultScope = defaultScope;
|
|
77
|
+
this.customerStatusSearch = customerStatusSearch;
|
|
78
|
+
}
|
|
79
|
+
async execute(input, context) {
|
|
80
|
+
const { customer_name, pageNo, pageSize, count, scope = this.defaultScope, ...unsupported } = input;
|
|
81
|
+
const unexpected = Object.keys(unsupported);
|
|
82
|
+
if (!this.customerStatusSearch && Object.hasOwn(input, 'scope'))
|
|
83
|
+
unexpected.push('scope');
|
|
84
|
+
if (unexpected.length) {
|
|
85
|
+
throw jiuchuanhuiValidationError('field_unsupported', `快捷查询不支持以下参数:${unexpected.join('、')}`, { fields: unexpected });
|
|
86
|
+
}
|
|
87
|
+
if (typeof scope !== 'string' || !Object.hasOwn(CUSTOMER_SEARCH_SCOPES, scope)) {
|
|
88
|
+
throw jiuchuanhuiValidationError('input_invalid', 'scope 必须是 mine、all 或 open-sea');
|
|
89
|
+
}
|
|
90
|
+
if (pageNo !== undefined && (!Number.isSafeInteger(pageNo) || pageNo < 1)) {
|
|
91
|
+
throw jiuchuanhuiValidationError('input_invalid', 'pageNo 必须是正整数');
|
|
92
|
+
}
|
|
93
|
+
if (pageSize !== undefined && (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 200)) {
|
|
94
|
+
throw jiuchuanhuiValidationError('input_invalid', 'pageSize 必须是 1 到 200 之间的整数');
|
|
95
|
+
}
|
|
96
|
+
if (count !== undefined && typeof count !== 'boolean') {
|
|
97
|
+
throw jiuchuanhuiValidationError('input_invalid', 'count 必须是布尔值');
|
|
98
|
+
}
|
|
99
|
+
const customerName = customer_name === undefined ? undefined : asNonEmptyString(customer_name, 'customer_name');
|
|
100
|
+
const status = this.customerStatusSearch ? await resolveSuccessStatus(this.customerStatusSearch, context) : undefined;
|
|
101
|
+
return this.customerSearch.execute({
|
|
102
|
+
...CUSTOMER_SEARCH_SCOPES[scope],
|
|
103
|
+
customer_name: customerName,
|
|
104
|
+
pageNo,
|
|
105
|
+
pageSize,
|
|
106
|
+
count,
|
|
107
|
+
status,
|
|
108
|
+
}, context);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
2
2
|
import { jiuchuanhuiConfirmationError, jiuchuanhuiPartialError, jiuchuanhuiValidationError, isJiuchuanhuiNetworkError, } from '../errors.js';
|
|
3
|
-
import { asObject, asPositiveString, byIdBody, datasBody, listBody,
|
|
3
|
+
import { asObject, asPositiveString, byIdBody, datasBody, listBody, pagingFrom, resultDataIds, sessionMatches, stripForbiddenKeys, workflow, } from './shared.js';
|
|
4
4
|
/**
|
|
5
5
|
* datajson 创建/更新写操作(saveFormData / updateFormData)。
|
|
6
6
|
* prepare -> apply 确认链;apply 校验 confirm + continuation + 会话一致后提交。
|
|
@@ -106,20 +106,12 @@ export class DatajsonDetailOperation {
|
|
|
106
106
|
async execute(input, { host }) {
|
|
107
107
|
const id = asPositiveString(String(input.id ?? input.dataId), 'id');
|
|
108
108
|
const session = await host.getSession();
|
|
109
|
-
const
|
|
109
|
+
const response = await host.query({
|
|
110
110
|
path: this.path,
|
|
111
111
|
body: byIdBody(id, session.userId),
|
|
112
112
|
operation: this.name,
|
|
113
113
|
});
|
|
114
|
-
return {
|
|
115
|
-
status: 'COMPLETE',
|
|
116
|
-
data: {
|
|
117
|
-
id,
|
|
118
|
-
...(result && typeof result === 'object' ? { raw: result } : {}),
|
|
119
|
-
mainTable: extractMainTable(result),
|
|
120
|
-
detail: result,
|
|
121
|
-
},
|
|
122
|
-
};
|
|
114
|
+
return { response };
|
|
123
115
|
}
|
|
124
116
|
}
|
|
125
117
|
/**
|
|
@@ -140,26 +132,14 @@ export class DatajsonSearchOperation {
|
|
|
140
132
|
const session = await host.getSession();
|
|
141
133
|
const query = buildSearchQuery(input, pageNo, pageSize);
|
|
142
134
|
const main = listBody(session.userId, pageNo, pageSize, {});
|
|
143
|
-
const listPromise = host.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const total = extractCount(countResult);
|
|
152
|
-
return {
|
|
153
|
-
status: 'COMPLETE',
|
|
154
|
-
data: {
|
|
155
|
-
items: records,
|
|
156
|
-
total,
|
|
157
|
-
pageNo,
|
|
158
|
-
pageSize,
|
|
159
|
-
hasMore: total === undefined ? records.length >= pageSize : pageNo * pageSize < total,
|
|
160
|
-
query,
|
|
161
|
-
},
|
|
162
|
-
};
|
|
135
|
+
const listPromise = host.query({ path: this.path, query, body: main, operation: this.name });
|
|
136
|
+
if (input.count !== true || !this.countPath)
|
|
137
|
+
return { response: await listPromise };
|
|
138
|
+
const [response, countResponse] = await Promise.all([
|
|
139
|
+
listPromise,
|
|
140
|
+
host.query({ path: this.countPath, query: withoutPaging(query), body: listBody(session.userId, 1, 1, {}), operation: `${this.name}.count` }),
|
|
141
|
+
]);
|
|
142
|
+
return { response, countResponse };
|
|
163
143
|
}
|
|
164
144
|
}
|
|
165
145
|
function buildSearchQuery(input, pageNo, pageSize) {
|
|
@@ -188,28 +168,3 @@ function withoutPaging(query) {
|
|
|
188
168
|
delete next.pageSize;
|
|
189
169
|
return next;
|
|
190
170
|
}
|
|
191
|
-
function extractCount(value) {
|
|
192
|
-
if (!value || typeof value !== 'object')
|
|
193
|
-
return undefined;
|
|
194
|
-
const root = value;
|
|
195
|
-
const datas = root.datajson?.datas;
|
|
196
|
-
const raw = Array.isArray(datas) ? datas[0] : datas;
|
|
197
|
-
const num = Number(raw ?? root.total ?? root.count);
|
|
198
|
-
return Number.isFinite(num) ? num : undefined;
|
|
199
|
-
}
|
|
200
|
-
function extractMainTable(value) {
|
|
201
|
-
if (!value || typeof value !== 'object')
|
|
202
|
-
return undefined;
|
|
203
|
-
const root = value;
|
|
204
|
-
const mt = root.datajson?.mainTable;
|
|
205
|
-
if (mt && typeof mt === 'object' && !Array.isArray(mt))
|
|
206
|
-
return mt;
|
|
207
|
-
const datas = root.datajson?.datas;
|
|
208
|
-
if (Array.isArray(datas) && datas[0] && typeof datas[0] === 'object') {
|
|
209
|
-
const first = datas[0];
|
|
210
|
-
if (first.mainTable && typeof first.mainTable === 'object')
|
|
211
|
-
return first.mainTable;
|
|
212
|
-
return first;
|
|
213
|
-
}
|
|
214
|
-
return undefined;
|
|
215
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
2
2
|
import { jiuchuanhuiConfirmationError, jiuchuanhuiPartialError, jiuchuanhuiValidationError, isJiuchuanhuiNetworkError, } from '../errors.js';
|
|
3
|
+
import { getJiuchuanhuiOperationContract } from '../manifest.js';
|
|
3
4
|
import { asObject, asNonEmptyString, esbBody, esbOutcome, sessionMatches, workflow } from './shared.js';
|
|
4
5
|
/**
|
|
5
6
|
* ESB 写操作模板。所有 ESB 动作流写操作(新建/修改/转移/释放/领取/状态变更/赢单/输单/无效/暂停/重启/完成计划)
|
|
@@ -20,6 +21,12 @@ export class EsbWritePrepareOperation {
|
|
|
20
21
|
}
|
|
21
22
|
async execute(input, { host, continuation }) {
|
|
22
23
|
const mainTable = normalizeMainTable(input.mainTable, this.mainTableKeys);
|
|
24
|
+
const properties = getJiuchuanhuiOperationContract(this.name)?.inputSchema.properties;
|
|
25
|
+
const missing = properties?.mainTable?.required?.filter((key) => !Object.hasOwn(mainTable, key)
|
|
26
|
+
|| mainTable[key] === undefined || mainTable[key] === null || mainTable[key] === '');
|
|
27
|
+
if (missing?.length) {
|
|
28
|
+
throw jiuchuanhuiValidationError('field_required', `缺少必填参数:${missing.join('、')}`, { fields: missing });
|
|
29
|
+
}
|
|
23
30
|
const preview = summaryOf(mainTable);
|
|
24
31
|
const session = await host.getSession();
|
|
25
32
|
const continuationToken = await continuation.issue({
|
|
@@ -117,26 +124,12 @@ export class EsbReadOperation {
|
|
|
117
124
|
async execute(input, { host }) {
|
|
118
125
|
const mainTable = normalizeMainTable(input.mainTable ?? input, this.mainTableKeys);
|
|
119
126
|
const session = await host.getSession();
|
|
120
|
-
const
|
|
127
|
+
const response = await host.query({
|
|
121
128
|
path: '/api/esb/server/event/triggerActionFlow',
|
|
122
129
|
body: esbBody(mainTable, this.uniqueIndent, session.userId),
|
|
123
130
|
operation: this.name,
|
|
124
131
|
});
|
|
125
|
-
|
|
126
|
-
if (resultCode !== 200) {
|
|
127
|
-
throw jiuchuanhuiValidationError('esb_read_failed', `动作流查询失败(resultCode=${resultCode}):${resultMsg}`);
|
|
128
|
-
}
|
|
129
|
-
const customData = result?.actionData?.responseData?.customData;
|
|
130
|
-
return {
|
|
131
|
-
status: 'COMPLETE',
|
|
132
|
-
data: {
|
|
133
|
-
resultCode,
|
|
134
|
-
resultMsg,
|
|
135
|
-
...(customData && typeof customData === 'object' ? { customData } : {}),
|
|
136
|
-
mainTable: customData?.mainTable,
|
|
137
|
-
raw: result,
|
|
138
|
-
},
|
|
139
|
-
};
|
|
132
|
+
return { response };
|
|
140
133
|
}
|
|
141
134
|
}
|
|
142
135
|
function normalizeMainTable(raw, allowedKeys) {
|
|
@@ -24,19 +24,13 @@ export class GetQueryOperation {
|
|
|
24
24
|
continue;
|
|
25
25
|
query[key] = Array.isArray(value) ? value.join(',') : value;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const response = await host.query({
|
|
28
28
|
method: 'GET',
|
|
29
29
|
path: this.path,
|
|
30
30
|
query,
|
|
31
31
|
operation: this.name,
|
|
32
32
|
});
|
|
33
|
-
return {
|
|
34
|
-
status: 'COMPLETE',
|
|
35
|
-
data: {
|
|
36
|
-
...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
|
|
37
|
-
query,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
33
|
+
return { response };
|
|
40
34
|
}
|
|
41
35
|
}
|
|
42
36
|
/** POST raw body 接口(bodyMode=raw):params 原样透传。 */
|
|
@@ -62,18 +56,13 @@ export class RawPostOperation {
|
|
|
62
56
|
query[key] = String(value);
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
|
-
const
|
|
59
|
+
const response = await host.query({
|
|
66
60
|
path: this.path,
|
|
67
61
|
query,
|
|
68
62
|
body,
|
|
69
63
|
operation: this.name,
|
|
70
64
|
});
|
|
71
|
-
return {
|
|
72
|
-
status: 'COMPLETE',
|
|
73
|
-
data: {
|
|
74
|
-
...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
|
|
75
|
-
},
|
|
76
|
-
};
|
|
65
|
+
return { response };
|
|
77
66
|
}
|
|
78
67
|
}
|
|
79
68
|
/** 占位符路径 raw POST(browser-option-search:path 含 {customBrowserType})。 */
|
|
@@ -96,17 +85,12 @@ export class PathParamsPostOperation {
|
|
|
96
85
|
path = path.replace(`{${name}}`, encodeURIComponent(String(value)));
|
|
97
86
|
}
|
|
98
87
|
const body = input.params && typeof input.params === 'object' ? input.params : {};
|
|
99
|
-
const
|
|
88
|
+
const response = await host.query({
|
|
100
89
|
path,
|
|
101
90
|
body,
|
|
102
91
|
operation: this.name,
|
|
103
92
|
});
|
|
104
|
-
return {
|
|
105
|
-
status: 'COMPLETE',
|
|
106
|
-
data: {
|
|
107
|
-
...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
|
|
108
|
-
},
|
|
109
|
-
};
|
|
93
|
+
return { response };
|
|
110
94
|
}
|
|
111
95
|
}
|
|
112
96
|
/** GET 文件预览/下载(get-file-preview):fileId 等 query,save 输出到本地。 */
|
|
@@ -129,18 +113,12 @@ export class FilePreviewOperation {
|
|
|
129
113
|
query.appId = input.appId;
|
|
130
114
|
if (input.customParam !== undefined)
|
|
131
115
|
query.customParam = typeof input.customParam === 'string' ? input.customParam : JSON.stringify(input.customParam);
|
|
132
|
-
const
|
|
116
|
+
const response = await host.query({
|
|
133
117
|
method: 'GET',
|
|
134
118
|
path: '/api/file/preview',
|
|
135
119
|
query,
|
|
136
120
|
operation: this.name,
|
|
137
121
|
});
|
|
138
|
-
return {
|
|
139
|
-
status: 'COMPLETE',
|
|
140
|
-
data: {
|
|
141
|
-
...(result && typeof result === 'object' ? { raw: result } : { raw: result }),
|
|
142
|
-
fileId,
|
|
143
|
-
},
|
|
144
|
-
};
|
|
122
|
+
return { response };
|
|
145
123
|
}
|
|
146
124
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jiuchuanhuiValidationError } from '../errors.js';
|
|
2
2
|
import { jiuchuanhuiOperations } from '../manifest.js';
|
|
3
3
|
import { CacheInitOperation } from '../cache.js';
|
|
4
|
+
import { CustomerQuickSearchOperation } from './customer-quick.js';
|
|
4
5
|
import { DatajsonDetailOperation, DatajsonSearchOperation, DatajsonWriteApplyOperation, DatajsonWritePrepareOperation, } from './datajson.js';
|
|
5
6
|
import { EsbReadOperation, EsbWriteApplyOperation, EsbWritePrepareOperation, } from './esb.js';
|
|
6
7
|
import { FilePreviewOperation, GetQueryOperation, PathParamsPostOperation, } from './generic.js';
|
|
@@ -12,6 +13,8 @@ import { FilePreviewOperation, GetQueryOperation, PathParamsPostOperation, } fro
|
|
|
12
13
|
*/
|
|
13
14
|
function buildRegistry() {
|
|
14
15
|
const registry = new Map();
|
|
16
|
+
const customerSearch = new DatajsonSearchOperation('jiuchuanhui.customer.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_search_api', '/api/ebuilder/form/formdata/v2/getFormDataCount/ebcustomer_search_count_api');
|
|
17
|
+
const customerStatusSearch = new DatajsonSearchOperation('jiuchuanhui.customer.status.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_status_search_api');
|
|
15
18
|
const handlers = [
|
|
16
19
|
// ===== 发现与缓存 =====
|
|
17
20
|
new CacheInitOperation(),
|
|
@@ -25,9 +28,12 @@ function buildRegistry() {
|
|
|
25
28
|
new DatajsonWritePrepareOperation('jiuchuanhui.customer.create.prepare', 'jiuchuanhui.customer.create.apply'),
|
|
26
29
|
new DatajsonWriteApplyOperation('jiuchuanhui.customer.create.apply', '/api/ebuilder/form/formdata/v2/saveFormData/customer_create_api'),
|
|
27
30
|
new DatajsonDetailOperation('jiuchuanhui.customer.get', '/api/ebuilder/form/formdata/v2/getFormDataByPk/customer_get_api'),
|
|
28
|
-
|
|
31
|
+
customerSearch,
|
|
32
|
+
new CustomerQuickSearchOperation('jiuchuanhui.customer.mine.search', customerSearch, 'mine'),
|
|
33
|
+
new CustomerQuickSearchOperation('jiuchuanhui.customer.success.search', customerSearch, 'mine', customerStatusSearch),
|
|
34
|
+
new CustomerQuickSearchOperation('jiuchuanhui.customer.open-sea.customers.search', customerSearch, 'open-sea'),
|
|
29
35
|
new DatajsonSearchOperation('jiuchuanhui.customer.type.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_type_search_api'),
|
|
30
|
-
|
|
36
|
+
customerStatusSearch,
|
|
31
37
|
new DatajsonSearchOperation('jiuchuanhui.customer.industry.search', '/api/ebuilder/form/formdata/v2/getFormDataList/ebcustomer_industry_search_api'),
|
|
32
38
|
new DatajsonSearchOperation('jiuchuanhui.customer.open-sea.search', '/api/ebuilder/form/formdata/v2/getFormDataList/customer_open_sea_search_api'),
|
|
33
39
|
new DatajsonWritePrepareOperation('jiuchuanhui.customer.update.prepare', 'jiuchuanhui.customer.update.apply'),
|
|
@@ -122,16 +122,6 @@ function stripForbidden(value) {
|
|
|
122
122
|
export function stripForbiddenKeys(value) {
|
|
123
123
|
return stripForbidden(value);
|
|
124
124
|
}
|
|
125
|
-
/** 从 datajson-list 响应中安全提取 records 数组。 */
|
|
126
|
-
export function listRecords(value) {
|
|
127
|
-
if (!value || typeof value !== 'object')
|
|
128
|
-
return [];
|
|
129
|
-
const root = value;
|
|
130
|
-
const datas = root.datajson?.datas;
|
|
131
|
-
if (Array.isArray(datas))
|
|
132
|
-
return datas;
|
|
133
|
-
return [];
|
|
134
|
-
}
|
|
135
125
|
/** datajson 类创建/更新成功后的 dataIds。 */
|
|
136
126
|
export function resultDataIds(value) {
|
|
137
127
|
if (!value || typeof value !== 'object')
|
|
@@ -52,10 +52,11 @@ async function assess(args, env) {
|
|
|
52
52
|
return pfSuccess('performance.flow.assess', {
|
|
53
53
|
...context,
|
|
54
54
|
scoringHints: [
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
55
|
+
'评分必须由 AI 自己给出:禁止向用户询问「这项该打多少分」',
|
|
56
|
+
'依据优先级:①指标描述/等级标准 ②定量(目标值+实际值)→达成率映射 ③实际值缺失或取数失败→替代证据,仍无则中性预评 ④定性无量化→专业判断,无旁证则中性预评',
|
|
57
|
+
'中性预评 = 满分×70%(四舍五入 0.01),理由里必须注明「按中性水平预评」,用户可在详情页调整',
|
|
58
|
+
'数据源 error 字段非空的指标照常给分并在理由注明「取数失败」,不得跳过该行或留空',
|
|
59
|
+
'不得编造实际值;评分上限为满分(maxScore),超出会被拒绝,不做静默截断',
|
|
59
60
|
],
|
|
60
61
|
});
|
|
61
62
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isStructuredError } from '../../core/errors.js';
|
|
2
|
+
import { getE10Session, requireE10Session } from '../../internal/e10/context.js';
|
|
3
|
+
import { E10_AUTH_REQUIRED_MESSAGE } from '../../internal/e10/auth/messages.js';
|
|
2
4
|
import { E10ApiError, createE10RequestRuntime, } from '../../internal/e10/request-runtime.js';
|
|
3
5
|
import { receptionBusinessError, receptionEnvironmentError } from './errors.js';
|
|
4
6
|
import { UploadProtocolError, uploadToFileService } from './upload.js';
|
|
5
7
|
import { fetchRestaurantRooms as fetchRooms } from './operations/restaurant-rooms.js';
|
|
6
8
|
/** 单次上传的总时限。分片上传是多轮请求,留足 3 分钟。 */
|
|
7
9
|
const UPLOAD_TIMEOUT_MS = 180_000;
|
|
8
|
-
export function createReceptionHost(ctx) {
|
|
10
|
+
export function createReceptionHost(ctx, dependencies = {}) {
|
|
9
11
|
let cached = null;
|
|
12
|
+
const requireSession = dependencies.requireSession || requireE10Session;
|
|
10
13
|
async function resolve() {
|
|
11
14
|
if (cached)
|
|
12
15
|
return cached;
|
|
@@ -129,11 +132,22 @@ export function createReceptionHost(ctx) {
|
|
|
129
132
|
/**
|
|
130
133
|
* 查「小食堂包厢」。
|
|
131
134
|
* eteamsId / tenantKey 只在这里取用并塞进请求体,不返回给调用方。
|
|
135
|
+
*
|
|
136
|
+
* 这条命令必须拿到真实会话,所以走 `requireSession` 而不是只读快照:
|
|
137
|
+
* 小e 下本地没有 auth 文件时,公共会话层会先静默换票再执行,不会再直接
|
|
138
|
+
* 报「未取得会话」。
|
|
132
139
|
*/
|
|
133
140
|
async function fetchRestaurantRooms(options = {}) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
let e10;
|
|
142
|
+
try {
|
|
143
|
+
e10 = await requireSession(ctx);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
// 小e 自动恢复失败时抛的是结构化认证错误(authentication/xiaoe_*),
|
|
147
|
+
// details.attemptedSteps 能说明试过哪些凭据通道,原样上抛让模型按现行口径处理。
|
|
148
|
+
if (isStructuredError(error))
|
|
149
|
+
throw error;
|
|
150
|
+
throw receptionEnvironmentError('NO_SESSION', E10_AUTH_REQUIRED_MESSAGE);
|
|
137
151
|
}
|
|
138
152
|
const runtime = createE10RequestRuntime(ctx, e10);
|
|
139
153
|
return fetchRooms(runtime, {
|