weaver-work-cli 0.1.48 → 0.1.50
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-oa-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-EJYIOJPH.js} +3 -3
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-3NCFFHB2.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-6T53BSWZ.js} +158 -44
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-7AYQJSFY.js} +2 -2
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-7ECB22G3.js} +221 -30
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-BFKLQLBK.js} +8 -8
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-HARQF5IP.js} +28 -28
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-NK74RE5F.js → chunk-K67FODVC.js} +3 -3
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-MCZG6HPM.js} +3 -3
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-RYFRGTUV.js} +5 -5
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-WNJUGI2F.js} +1 -1
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-YB3AJYPY.js} +4 -4
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-C4UDHCWV.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-VUC6JOPG.js} +464 -9
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-6OG2LYBD.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-B6GKA2J3.js → env-WP57TF2S.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-VUXI7N5C.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-UQRGXILK.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-E7GOITEU.js} +1 -1
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-4BBLVAWM.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-QGPNTGHG.js} +526 -175
- package/dist/chunks/{recruit-stage-ERZD3ZNB.js → recruit-stage-FKWS5UQF.js} +66 -13
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-22O6UG4I.js → registry-5CRCN2TV.js} +10 -10
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-V4CHRQDI.js} +1 -1
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-AYR3UG7R.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-JZEFIXUS.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-3ZAF2J5E.js} +4 -4
- package/dist/index.js +16 -11
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/registry.js +4 -1
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +53 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +283 -1
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/manifest.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +13 -6
- package/dist/shortcuts/reception/index.js +3 -1
- package/dist/shortcuts/reception/manifest.js +3 -2
- package/dist/shortcuts/reception/operations/ask.js +20 -2
- package/dist/shortcuts/reception/operations/compose.js +11 -0
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +31 -7
- package/dist/shortcuts/reception/operations/panels.js +86 -22
- package/dist/shortcuts/reception/operations/render.js +40 -0
- package/dist/shortcuts/reception/operations/restaurant.js +17 -4
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/workflow/operations/read.js +58 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +2 -1
- package/docs/_catalog.md +4 -1
- package/docs/data.md +149 -0
- package/docs/fna.md +11 -4
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +29 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/domains/qiyecheng.md +4 -2
- package/skills/weaver-e10-archive-oa/SKILL.md +7 -6
- package/skills/weaver-e10-archive-oa/references/contract-search.md +83 -14
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +35 -11
- package/skills/weaver-e10-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +219 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +50 -30
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +24 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +43 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +265 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +83 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +21 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +104 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +17 -3
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +136 -30
- package/skills/weaver-e10-reception-flow/SKILL.md +70 -19
- package/skills/weaver-e10-reception-flow/references/guide.md +5 -4
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +1 -1
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +6 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +6 -45
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +4 -37
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +22 -35
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
|
@@ -1,141 +1,25 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
READ,
|
|
5
|
+
SCHEMA_ID,
|
|
6
|
+
SCHEMA_ID_LIST,
|
|
7
|
+
SCHEMA_PAGE,
|
|
8
|
+
browserBaseBody,
|
|
9
|
+
hrmSuccess,
|
|
10
|
+
inferEmployeeField,
|
|
11
|
+
orgLink,
|
|
12
|
+
personLink,
|
|
13
|
+
resolveDepartmentIdByName,
|
|
14
|
+
schemaOf,
|
|
15
|
+
toNumber,
|
|
16
|
+
toPositiveInt,
|
|
17
|
+
toStringIdList
|
|
18
|
+
} from "./chunk-JEQHNNSS.js";
|
|
3
19
|
import {
|
|
4
20
|
hrmValidationError
|
|
5
21
|
} from "./chunk-56EZERK4.js";
|
|
6
22
|
|
|
7
|
-
// src/shortcuts/hrm/operations/types.ts
|
|
8
|
-
var READ = "read";
|
|
9
|
-
function hrmSuccess(action, data, meta) {
|
|
10
|
-
const payload = { ok: true, action, data };
|
|
11
|
-
if (meta && Object.keys(meta).length > 0) payload.meta = meta;
|
|
12
|
-
return payload;
|
|
13
|
-
}
|
|
14
|
-
function schemaOf(properties, options = {}) {
|
|
15
|
-
return {
|
|
16
|
-
type: "object",
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
properties,
|
|
19
|
-
...options.required?.length ? { required: options.required } : {},
|
|
20
|
-
...options.description ? { description: options.description } : {}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
var SCHEMA_ID = { oneOf: [{ type: "integer" }, { type: "string", pattern: "^\\d+$" }] };
|
|
24
|
-
var SCHEMA_ID_LIST = { type: "array", items: SCHEMA_ID };
|
|
25
|
-
var SCHEMA_PAGE = {
|
|
26
|
-
current: SCHEMA_ID,
|
|
27
|
-
pageSize: SCHEMA_ID
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// src/shortcuts/hrm/operations/shared.ts
|
|
31
|
-
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
32
|
-
function asObject(value) {
|
|
33
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
34
|
-
throw hrmValidationError("input_not_object", "\u8F93\u5165\u5FC5\u987B\u662F JSON \u5BF9\u8C61");
|
|
35
|
-
}
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
function assertNoForbiddenKeys(input) {
|
|
39
|
-
for (const key of Object.keys(input)) {
|
|
40
|
-
if (FORBIDDEN_KEYS.has(key)) {
|
|
41
|
-
throw hrmValidationError("forbidden_key", `\u8F93\u5165\u5305\u542B\u975E\u6CD5\u5B57\u6BB5\uFF1A${key}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function toNumber(value, field) {
|
|
46
|
-
if (value === void 0 || value === null || value === "") return void 0;
|
|
47
|
-
const numeric = Number(value);
|
|
48
|
-
if (!Number.isFinite(numeric)) {
|
|
49
|
-
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6570\u5B57`);
|
|
50
|
-
}
|
|
51
|
-
return numeric;
|
|
52
|
-
}
|
|
53
|
-
function toPositiveInt(value, field) {
|
|
54
|
-
if (value === void 0 || value === null || value === "") return void 0;
|
|
55
|
-
const numeric = Number(value);
|
|
56
|
-
if (!Number.isFinite(numeric)) {
|
|
57
|
-
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6570\u5B57`);
|
|
58
|
-
}
|
|
59
|
-
const truncated = Math.trunc(numeric);
|
|
60
|
-
if (truncated !== numeric || truncated <= 0) {
|
|
61
|
-
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6B63\u6574\u6570`);
|
|
62
|
-
}
|
|
63
|
-
return truncated;
|
|
64
|
-
}
|
|
65
|
-
function toStringIdList(value, field) {
|
|
66
|
-
if (value === void 0 || value === null) return void 0;
|
|
67
|
-
const list = Array.isArray(value) ? value : [value];
|
|
68
|
-
if (list.length === 0) return void 0;
|
|
69
|
-
return list.map((item, index) => {
|
|
70
|
-
if (item === void 0 || item === null || item === "") {
|
|
71
|
-
throw hrmValidationError("id_list_invalid", `${field}[${index}] \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
72
|
-
}
|
|
73
|
-
const text = String(item);
|
|
74
|
-
if (!/^\d+$/.test(text)) {
|
|
75
|
-
throw hrmValidationError("id_list_invalid", `${field}[${index}] \u5FC5\u987B\u662F\u6570\u5B57 ID`);
|
|
76
|
-
}
|
|
77
|
-
return text;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function pickDefined(value, keys) {
|
|
81
|
-
const result = {};
|
|
82
|
-
for (const key of keys) {
|
|
83
|
-
if (value[key] !== void 0) result[key] = value[key];
|
|
84
|
-
}
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
function browserBaseBody() {
|
|
88
|
-
return {
|
|
89
|
-
browserMultiple: true,
|
|
90
|
-
authWecahtBook: false,
|
|
91
|
-
wxDepNeedConvertCount: 0,
|
|
92
|
-
wxEmpNeedConvertCount: 0,
|
|
93
|
-
wxTotalNeedConvertCount: 0
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function personLink(baseUrl, id) {
|
|
97
|
-
return `${baseUrl}/sp/hrm/profileInfo/${String(id)}`;
|
|
98
|
-
}
|
|
99
|
-
function orgLink(baseUrl, id) {
|
|
100
|
-
return `${baseUrl}/sp/hrm/orgCard/${String(id)}`;
|
|
101
|
-
}
|
|
102
|
-
function positionLink(baseUrl, id) {
|
|
103
|
-
return `${baseUrl}/sp/hrm/positionCard/${String(id)}`;
|
|
104
|
-
}
|
|
105
|
-
function inferEmployeeField(target) {
|
|
106
|
-
if (/@/.test(target)) return { key: "email", value: target };
|
|
107
|
-
if (/^\d{11}$/.test(target)) return { key: "mobile", value: target };
|
|
108
|
-
if (/^\d+$/.test(target) || /^[A-Za-z][A-Za-z0-9]*\d[A-Za-z0-9]*$/.test(target)) {
|
|
109
|
-
return { key: "job_num", value: target };
|
|
110
|
-
}
|
|
111
|
-
return { key: "username", value: target };
|
|
112
|
-
}
|
|
113
|
-
async function resolveDepartmentIdByName(host, name) {
|
|
114
|
-
const resp = await host.request({
|
|
115
|
-
method: "POST",
|
|
116
|
-
path: "/api/hrm/common/browser/data/department",
|
|
117
|
-
body: {
|
|
118
|
-
...browserBaseBody(),
|
|
119
|
-
virtualType: "ALL",
|
|
120
|
-
cmd: "list",
|
|
121
|
-
current: 1,
|
|
122
|
-
pageSize: 200,
|
|
123
|
-
formDatas: { name: [{ nameCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, name }] },
|
|
124
|
-
quickSearchDatas: {},
|
|
125
|
-
type: "and",
|
|
126
|
-
stopDepartment: false
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
const rows = resp?.data?.data ?? [];
|
|
130
|
-
if (rows.length === 0) {
|
|
131
|
-
throw hrmValidationError("dept_not_found", `\u672A\u627E\u5230\u90E8\u95E8\uFF1A${name}\uFF08\u8BF7\u786E\u8BA4\u90E8\u95E8\u540D\u79F0\uFF09`);
|
|
132
|
-
}
|
|
133
|
-
if (rows.length > 1) {
|
|
134
|
-
throw hrmValidationError("dept_ambiguous", `\u90E8\u95E8\u91CD\u540D\uFF08${rows.length} \u4E2A\u5019\u9009\uFF09\uFF1A${rows.map((x) => x.name).join("\u3001")}\uFF0C\u8BF7\u6539\u7528\u90E8\u95E8 id`);
|
|
135
|
-
}
|
|
136
|
-
return rows[0];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
23
|
// src/shortcuts/hrm/operations/employee.ts
|
|
140
24
|
var EMPLOYEE_STATUS = ["normal", "6"];
|
|
141
25
|
var SUBORDINATE_SCOPE = ["direct", "indirect", "all"];
|
|
@@ -589,19 +473,5 @@ var hrmEmployeeOperations = [
|
|
|
589
473
|
];
|
|
590
474
|
|
|
591
475
|
export {
|
|
592
|
-
READ,
|
|
593
|
-
hrmSuccess,
|
|
594
|
-
schemaOf,
|
|
595
|
-
SCHEMA_ID,
|
|
596
|
-
SCHEMA_PAGE,
|
|
597
|
-
asObject,
|
|
598
|
-
assertNoForbiddenKeys,
|
|
599
|
-
toNumber,
|
|
600
|
-
toPositiveInt,
|
|
601
|
-
toStringIdList,
|
|
602
|
-
pickDefined,
|
|
603
|
-
browserBaseBody,
|
|
604
|
-
orgLink,
|
|
605
|
-
positionLink,
|
|
606
476
|
hrmEmployeeOperations
|
|
607
477
|
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
hrmValidationError
|
|
5
|
+
} from "./chunk-56EZERK4.js";
|
|
6
|
+
|
|
7
|
+
// src/shortcuts/hrm/operations/types.ts
|
|
8
|
+
var READ = "read";
|
|
9
|
+
function hrmSuccess(action, data, meta) {
|
|
10
|
+
const payload = { ok: true, action, data };
|
|
11
|
+
if (meta && Object.keys(meta).length > 0) payload.meta = meta;
|
|
12
|
+
return payload;
|
|
13
|
+
}
|
|
14
|
+
function schemaOf(properties, options = {}) {
|
|
15
|
+
return {
|
|
16
|
+
type: "object",
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
properties,
|
|
19
|
+
...options.required?.length ? { required: options.required } : {},
|
|
20
|
+
...options.description ? { description: options.description } : {}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
var SCHEMA_ID = { oneOf: [{ type: "integer" }, { type: "string", pattern: "^\\d+$" }] };
|
|
24
|
+
var SCHEMA_ID_LIST = { type: "array", items: SCHEMA_ID };
|
|
25
|
+
var SCHEMA_PAGE = {
|
|
26
|
+
current: SCHEMA_ID,
|
|
27
|
+
pageSize: SCHEMA_ID
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/shortcuts/hrm/operations/shared.ts
|
|
31
|
+
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
32
|
+
function asObject(value) {
|
|
33
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
34
|
+
throw hrmValidationError("input_not_object", "\u8F93\u5165\u5FC5\u987B\u662F JSON \u5BF9\u8C61");
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function assertNoForbiddenKeys(input) {
|
|
39
|
+
for (const key of Object.keys(input)) {
|
|
40
|
+
if (FORBIDDEN_KEYS.has(key)) {
|
|
41
|
+
throw hrmValidationError("forbidden_key", `\u8F93\u5165\u5305\u542B\u975E\u6CD5\u5B57\u6BB5\uFF1A${key}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function toNumber(value, field) {
|
|
46
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
47
|
+
const numeric = Number(value);
|
|
48
|
+
if (!Number.isFinite(numeric)) {
|
|
49
|
+
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6570\u5B57`);
|
|
50
|
+
}
|
|
51
|
+
return numeric;
|
|
52
|
+
}
|
|
53
|
+
function toPositiveInt(value, field) {
|
|
54
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
55
|
+
const numeric = Number(value);
|
|
56
|
+
if (!Number.isFinite(numeric)) {
|
|
57
|
+
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6570\u5B57`);
|
|
58
|
+
}
|
|
59
|
+
const truncated = Math.trunc(numeric);
|
|
60
|
+
if (truncated !== numeric || truncated <= 0) {
|
|
61
|
+
throw hrmValidationError("number_invalid", `${field} \u5FC5\u987B\u662F\u6B63\u6574\u6570`);
|
|
62
|
+
}
|
|
63
|
+
return truncated;
|
|
64
|
+
}
|
|
65
|
+
function toStringIdList(value, field) {
|
|
66
|
+
if (value === void 0 || value === null) return void 0;
|
|
67
|
+
const list = Array.isArray(value) ? value : [value];
|
|
68
|
+
if (list.length === 0) return void 0;
|
|
69
|
+
return list.map((item, index) => {
|
|
70
|
+
if (item === void 0 || item === null || item === "") {
|
|
71
|
+
throw hrmValidationError("id_list_invalid", `${field}[${index}] \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
72
|
+
}
|
|
73
|
+
const text = String(item);
|
|
74
|
+
if (!/^\d+$/.test(text)) {
|
|
75
|
+
throw hrmValidationError("id_list_invalid", `${field}[${index}] \u5FC5\u987B\u662F\u6570\u5B57 ID`);
|
|
76
|
+
}
|
|
77
|
+
return text;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function pickDefined(value, keys) {
|
|
81
|
+
const result = {};
|
|
82
|
+
for (const key of keys) {
|
|
83
|
+
if (value[key] !== void 0) result[key] = value[key];
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
function browserBaseBody() {
|
|
88
|
+
return {
|
|
89
|
+
browserMultiple: true,
|
|
90
|
+
authWecahtBook: false,
|
|
91
|
+
wxDepNeedConvertCount: 0,
|
|
92
|
+
wxEmpNeedConvertCount: 0,
|
|
93
|
+
wxTotalNeedConvertCount: 0
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function personLink(baseUrl, id) {
|
|
97
|
+
return `${baseUrl}/sp/hrm/profileInfo/${String(id)}`;
|
|
98
|
+
}
|
|
99
|
+
function orgLink(baseUrl, id) {
|
|
100
|
+
return `${baseUrl}/sp/hrm/orgCard/${String(id)}`;
|
|
101
|
+
}
|
|
102
|
+
function positionLink(baseUrl, id) {
|
|
103
|
+
return `${baseUrl}/sp/hrm/positionCard/${String(id)}`;
|
|
104
|
+
}
|
|
105
|
+
function inferEmployeeField(target) {
|
|
106
|
+
if (/@/.test(target)) return { key: "email", value: target };
|
|
107
|
+
if (/^\d{11}$/.test(target)) return { key: "mobile", value: target };
|
|
108
|
+
if (/^\d+$/.test(target) || /^[A-Za-z][A-Za-z0-9]*\d[A-Za-z0-9]*$/.test(target)) {
|
|
109
|
+
return { key: "job_num", value: target };
|
|
110
|
+
}
|
|
111
|
+
return { key: "username", value: target };
|
|
112
|
+
}
|
|
113
|
+
async function resolveDepartmentIdByName(host, name) {
|
|
114
|
+
const resp = await host.request({
|
|
115
|
+
method: "POST",
|
|
116
|
+
path: "/api/hrm/common/browser/data/department",
|
|
117
|
+
body: {
|
|
118
|
+
...browserBaseBody(),
|
|
119
|
+
virtualType: "ALL",
|
|
120
|
+
cmd: "list",
|
|
121
|
+
current: 1,
|
|
122
|
+
pageSize: 200,
|
|
123
|
+
formDatas: { name: [{ nameCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, name }] },
|
|
124
|
+
quickSearchDatas: {},
|
|
125
|
+
type: "and",
|
|
126
|
+
stopDepartment: false
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const rows = resp?.data?.data ?? [];
|
|
130
|
+
if (rows.length === 0) {
|
|
131
|
+
throw hrmValidationError("dept_not_found", `\u672A\u627E\u5230\u90E8\u95E8\uFF1A${name}\uFF08\u8BF7\u786E\u8BA4\u90E8\u95E8\u540D\u79F0\uFF09`);
|
|
132
|
+
}
|
|
133
|
+
if (rows.length > 1) {
|
|
134
|
+
throw hrmValidationError("dept_ambiguous", `\u90E8\u95E8\u91CD\u540D\uFF08${rows.length} \u4E2A\u5019\u9009\uFF09\uFF1A${rows.map((x) => x.name).join("\u3001")}\uFF0C\u8BF7\u6539\u7528\u90E8\u95E8 id`);
|
|
135
|
+
}
|
|
136
|
+
return rows[0];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export {
|
|
140
|
+
READ,
|
|
141
|
+
hrmSuccess,
|
|
142
|
+
schemaOf,
|
|
143
|
+
SCHEMA_ID,
|
|
144
|
+
SCHEMA_ID_LIST,
|
|
145
|
+
SCHEMA_PAGE,
|
|
146
|
+
asObject,
|
|
147
|
+
assertNoForbiddenKeys,
|
|
148
|
+
toNumber,
|
|
149
|
+
toPositiveInt,
|
|
150
|
+
toStringIdList,
|
|
151
|
+
pickDefined,
|
|
152
|
+
browserBaseBody,
|
|
153
|
+
personLink,
|
|
154
|
+
orgLink,
|
|
155
|
+
positionLink,
|
|
156
|
+
inferEmployeeField,
|
|
157
|
+
resolveDepartmentIdByName
|
|
158
|
+
};
|
|
@@ -1562,7 +1562,7 @@ async function buildPersonnelText(env, data) {
|
|
|
1562
1562
|
if (ids.length === 0) return {};
|
|
1563
1563
|
const names = /* @__PURE__ */ new Map();
|
|
1564
1564
|
try {
|
|
1565
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
1565
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
1566
1566
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
1567
1567
|
if (batch) {
|
|
1568
1568
|
const result = await batch.handler({ ids: [...new Set(ids)] }, env);
|
|
@@ -2220,7 +2220,7 @@ function buildWriteInputSchema(endpoint, includeConfirm) {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
async function lookupEmployeeDepartmentId(env, userId) {
|
|
2222
2222
|
try {
|
|
2223
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
2223
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
2224
2224
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
2225
2225
|
if (!batch) return null;
|
|
2226
2226
|
const result = await batch.handler({ ids: [userId] }, env);
|
|
@@ -2329,7 +2329,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
|
|
|
2329
2329
|
);
|
|
2330
2330
|
}
|
|
2331
2331
|
if (endpoint.interfacePk === "create_meeting") {
|
|
2332
|
-
const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-
|
|
2332
|
+
const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-C4UDHCWV.js");
|
|
2333
2333
|
assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
|
|
2334
2334
|
}
|
|
2335
2335
|
const pkQuery = writePkQuery(endpoint, payload);
|
|
@@ -11,14 +11,14 @@ var MSG_TYPES = {
|
|
|
11
11
|
6: "\u56FE\u6587",
|
|
12
12
|
7: "\u89C6\u9891",
|
|
13
13
|
8: "\u4E8B\u9879",
|
|
14
|
-
9: "\u7CFB\u7EDF
|
|
14
|
+
9: "\u7CFB\u7EDF",
|
|
15
15
|
10: "\u64A4\u56DE",
|
|
16
16
|
11: "\u6296\u4E00\u6296",
|
|
17
17
|
12: "\u5C4F\u853D",
|
|
18
|
-
14: "\
|
|
19
|
-
15: "\
|
|
18
|
+
14: "\u5C45\u4E2D",
|
|
19
|
+
15: "\u7B2C\u4E09\u65B9",
|
|
20
20
|
16: "\u8BED\u97F3\u901A\u8BDD",
|
|
21
|
-
17: "\
|
|
21
|
+
17: "\u5408\u5E76\u8F6C\u53D1",
|
|
22
22
|
18: "\u89C6\u9891\u901A\u8BDD",
|
|
23
23
|
19: "\u7FA4\u516C\u544A",
|
|
24
24
|
20: "\u5206\u4EAB\u5730\u5740",
|
|
@@ -144,6 +144,16 @@ function parseSysMsg(msg) {
|
|
|
144
144
|
id18n: sys.id18n !== void 0 ? String(sys.id18n) : void 0
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
+
function isMarkdownTxt(txt) {
|
|
148
|
+
if (!txt || typeof txt !== "object") return false;
|
|
149
|
+
const vt = txt.vt;
|
|
150
|
+
return vt === 1 || vt === "1";
|
|
151
|
+
}
|
|
152
|
+
function isMarkdownMsg(msg) {
|
|
153
|
+
if (Number(msg?.type) !== 26) return false;
|
|
154
|
+
const dt = Array.isArray(msg?.dt) ? msg.dt : [];
|
|
155
|
+
return dt.some((seg) => isMarkdownTxt(seg?.txt));
|
|
156
|
+
}
|
|
147
157
|
function parseContent(value, opts = {}) {
|
|
148
158
|
const msg = parseMsg(value) || {};
|
|
149
159
|
const type = Number(msg.type || 0);
|
|
@@ -197,7 +207,8 @@ function parseContent(value, opts = {}) {
|
|
|
197
207
|
let title = "";
|
|
198
208
|
if (sys.etName) title = sys.etName;
|
|
199
209
|
else if (sys.id18n && opts.i18nMap?.[sys.id18n]) title = opts.i18nMap[sys.id18n];
|
|
200
|
-
|
|
210
|
+
const format = isMarkdownMsg(msg) ? "markdown" : "text";
|
|
211
|
+
return { type, typeName, content, title, must, fileName, sys, format };
|
|
201
212
|
}
|
|
202
213
|
function parseSegment(seg, opts = {}) {
|
|
203
214
|
if (!seg) return "";
|
|
@@ -359,6 +370,8 @@ export {
|
|
|
359
370
|
replaceMentions,
|
|
360
371
|
extractTxt,
|
|
361
372
|
parseSysMsg,
|
|
373
|
+
isMarkdownTxt,
|
|
374
|
+
isMarkdownMsg,
|
|
362
375
|
parseContent,
|
|
363
376
|
senderName,
|
|
364
377
|
extractImgs,
|
|
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
readCache,
|
|
5
5
|
writeCache
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WNJUGI2F.js";
|
|
7
7
|
import {
|
|
8
8
|
SCHEMA_DATETIME_MINUTE,
|
|
9
9
|
meetingSuccess,
|
|
10
10
|
meetingValidationError,
|
|
11
11
|
schemaOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-K67FODVC.js";
|
|
13
13
|
|
|
14
14
|
// src/shortcuts/meeting/operations/eb/schedule.ts
|
|
15
15
|
var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
|
|
@@ -331,7 +331,7 @@ async function resolveMemberIdsByName(env, names) {
|
|
|
331
331
|
const unique = [...new Set(names)].filter((name) => name !== "");
|
|
332
332
|
if (unique.length === 0) return map;
|
|
333
333
|
try {
|
|
334
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
334
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
335
335
|
const query = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.query");
|
|
336
336
|
if (!query) return map;
|
|
337
337
|
for (const name of unique) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
queryBody,
|
|
14
14
|
toIdCsv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K67FODVC.js";
|
|
16
16
|
|
|
17
17
|
// src/shortcuts/meeting/operations/eb/conflict.ts
|
|
18
18
|
var ACTIVE_MT_STATUS = "1,2,8,9";
|
|
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
|
|
|
296
296
|
const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
|
|
297
297
|
const nameLike = items.filter((item) => !/^\d+$/u.test(item));
|
|
298
298
|
if (nameLike.length > 0) {
|
|
299
|
-
const { resolveMemberIdsByName } = await import("./schedule-
|
|
299
|
+
const { resolveMemberIdsByName } = await import("./schedule-JZEFIXUS.js");
|
|
300
300
|
const idsByName = await resolveMemberIdsByName(env, nameLike);
|
|
301
301
|
const resolved = items.map((item) => idsByName.get(item) ?? item);
|
|
302
302
|
payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
|
|
@@ -429,7 +429,7 @@ var ebConflictRoom = {
|
|
|
429
429
|
let addressId = String(args.address ?? "").trim();
|
|
430
430
|
let resolvedRoom = null;
|
|
431
431
|
if (!addressId && String(args.room_name ?? "").trim()) {
|
|
432
|
-
const { resolveAddressRoom } = await import("./create-flow-
|
|
432
|
+
const { resolveAddressRoom } = await import("./create-flow-6OG2LYBD.js");
|
|
433
433
|
const resolved = await resolveAddressRoom(env, String(args.room_name));
|
|
434
434
|
if (!resolved?.id) {
|
|
435
435
|
throw meetingValidationError(
|
|
@@ -564,7 +564,7 @@ async function resolveMemberNames(env, ids) {
|
|
|
564
564
|
const unique = [...new Set(ids.filter((id) => id !== ""))];
|
|
565
565
|
if (unique.length === 0) return map;
|
|
566
566
|
try {
|
|
567
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
567
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
568
568
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
569
569
|
if (!batch) return map;
|
|
570
570
|
const result = await batch.handler({ ids: unique }, env);
|
|
@@ -639,7 +639,7 @@ async function findCommonFreeSlots(env, input) {
|
|
|
639
639
|
const scheduleItems = [];
|
|
640
640
|
if (includeSchedule) {
|
|
641
641
|
try {
|
|
642
|
-
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-
|
|
642
|
+
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-JZEFIXUS.js");
|
|
643
643
|
const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
|
|
644
644
|
const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
|
|
645
645
|
const flow = await runScheduleConflictFlow(env, {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
meetingStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3NCFFHB2.js";
|
|
6
6
|
|
|
7
7
|
// src/shortcuts/meeting/operations/eb/cache.ts
|
|
8
8
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
cacheScopeSuffix,
|
|
5
5
|
readCache,
|
|
6
6
|
writeCache
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WNJUGI2F.js";
|
|
8
8
|
import {
|
|
9
9
|
EB_BASE,
|
|
10
10
|
SCHEMA_DATETIME_MINUTE,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
meetingSuccess,
|
|
14
14
|
queryBody,
|
|
15
15
|
schemaOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-K67FODVC.js";
|
|
17
17
|
|
|
18
18
|
// src/shortcuts/meeting/operations/eb/usage-cache.ts
|
|
19
19
|
var USAGE_TTL_MS = 5 * 60 * 1e3;
|
|
@@ -88,7 +88,7 @@ async function clearCache(env, key) {
|
|
|
88
88
|
try {
|
|
89
89
|
const { rm } = await import("node:fs/promises");
|
|
90
90
|
const { join } = await import("node:path");
|
|
91
|
-
const { meetingStateDir } = await import("./env-
|
|
91
|
+
const { meetingStateDir } = await import("./env-WP57TF2S.js");
|
|
92
92
|
await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
|
|
93
93
|
} catch {
|
|
94
94
|
}
|
|
@@ -221,7 +221,7 @@ async function loadFrequentRooms(env, options = {}) {
|
|
|
221
221
|
const counts = /* @__PURE__ */ new Map();
|
|
222
222
|
let requests = 0;
|
|
223
223
|
try {
|
|
224
|
-
const { getMeetingOperation } = await import("./registry-
|
|
224
|
+
const { getMeetingOperation } = await import("./registry-5CRCN2TV.js");
|
|
225
225
|
const listOp = getMeetingOperation("meeting.eb.meeting.list");
|
|
226
226
|
let seen = 0;
|
|
227
227
|
let total = 0;
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
findCommonFreeSlots,
|
|
8
8
|
meetingEbConflictOperations,
|
|
9
9
|
runEbConflictCheck
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-RYFRGTUV.js";
|
|
11
|
+
import "./chunk-K67FODVC.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|