weaver-work-cli 0.1.47 → 0.1.49
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-BBDP7AKJ.js → archive-oa-57R2FYHV.js} +565 -17
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-MU2LPI5P.js} +3 -3
- package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-3NV2ETZR.js} +8 -8
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-3X7VOSBA.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-6GWU63YF.js} +1 -1
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-BRRW7CWA.js} +121 -46
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-D2QRZUW4.js} +221 -37
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-EJVA5ZVB.js} +2 -2
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-GEOMANP7.js} +3 -3
- package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-K3BT54CU.js} +4 -4
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-KV5SOWMS.js} +4 -4
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-ZKEUGS2U.js} +36 -7
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-6347A7YK.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-7WG7LVX5.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-66FPSJDV.js → env-LHRKSLG6.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-2H7Z4RWJ.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-EW6PNDDT.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
- package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-N2FQBHXI.js} +10 -10
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-5WITA44R.js → reception-MYOKJULO.js} +905 -116
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-FKWS5UQF.js} +118 -29
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
- package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-CKUVBS53.js} +10 -10
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-MBCYENQ2.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-5IFMCXME.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-2TRU2ZSP.js} +5 -5
- package/dist/core/refs.js +19 -2
- package/dist/index.js +20 -15
- package/dist/shortcuts/archive-oa/constants.js +42 -0
- package/dist/shortcuts/archive-oa/host.js +2 -2
- package/dist/shortcuts/archive-oa/index.js +38 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
- 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/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +9 -4
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/index.js +9 -1
- package/dist/shortcuts/contract/manifest.js +14 -2
- package/dist/shortcuts/contract/operations/card.js +231 -0
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/review.js +16 -5
- package/dist/shortcuts/contract/operations/summary.js +25 -17
- 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/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +28 -12
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +90 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/host.js +0 -3
- package/dist/shortcuts/invoice/manifest.js +0 -1
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
- package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
- package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +11 -0
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +22 -1
- package/dist/shortcuts/reception/manifest.js +55 -2
- package/dist/shortcuts/reception/operations/ask.js +37 -1
- package/dist/shortcuts/reception/operations/compose.js +124 -3
- 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 +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/panels.js +84 -21
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +76 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +264 -0
- package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
- package/dist/shortcuts/reception/operations/schedule.js +7 -1
- package/dist/shortcuts/reception/upload.js +22 -6
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +28 -12
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +99 -14
- package/docs/SKILL.md +1 -0
- package/docs/_catalog.md +3 -0
- package/docs/archive-oa.md +4 -2
- package/docs/data.md +149 -0
- 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 +23 -0
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/master-skill-template.md +1 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +35 -7
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +105 -4
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +2 -2
- package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +48 -2
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
- package/skills/weaver-e10-cowork/SKILL.md +9 -6
- 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 +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
- package/skills/weaver-e10-jucailin/SKILL.md +7 -4
- package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
- package/skills/weaver-e10-mail/SKILL.md +17 -4
- package/skills/weaver-e10-meeting/SKILL.md +129 -412
- package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
- package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
- package/skills/weaver-e10-reception-flow/SKILL.md +77 -19
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
- package/skills/weaver-e10-reception-flow/references/guide.md +4 -3
- package/skills/weaver-e10-reception-flow/scripts/render.py +84 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +78 -8
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +169 -0
- package/skills/weaver-e10-shijingran/SKILL.md +6 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-CBYI6CQ6.js} +3 -3
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
looksLikeFileId,
|
|
9
9
|
meetingAttachmentContentOperations,
|
|
10
10
|
parseFileIdList
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-EJVA5ZVB.js";
|
|
12
|
+
import "./chunk-6GWU63YF.js";
|
|
13
|
+
import "./chunk-K3BT54CU.js";
|
|
14
14
|
import "./chunk-7BDPM5ST.js";
|
|
15
15
|
import "./chunk-UG5G54VL.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
refMaxCount,
|
|
14
14
|
resolveRefInput,
|
|
15
15
|
resultThresholdBytes
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2IGZUMNG.js";
|
|
17
17
|
import {
|
|
18
18
|
Command,
|
|
19
19
|
clearInvoiceTokenForSession
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GR76ZDDX.js";
|
|
21
21
|
import {
|
|
22
22
|
refsDir
|
|
23
23
|
} from "./chunk-AJ62BGAW.js";
|
|
@@ -299,7 +299,20 @@ function pruneRefs(ctx, options = {}) {
|
|
|
299
299
|
}
|
|
300
300
|
function pickValue(value, path) {
|
|
301
301
|
let cursor = value;
|
|
302
|
-
|
|
302
|
+
let tokens = tokenizePath(path);
|
|
303
|
+
const rootIsObject = cursor !== null && typeof cursor === "object" && !Array.isArray(cursor);
|
|
304
|
+
if (rootIsObject && typeof tokens[0] === "string" && !(tokens[0] in cursor)) {
|
|
305
|
+
const root = cursor;
|
|
306
|
+
if (tokens[0] === "data" && root.data === void 0) {
|
|
307
|
+
tokens = tokens.slice(1);
|
|
308
|
+
} else {
|
|
309
|
+
const data = root.data;
|
|
310
|
+
if (data !== null && typeof data === "object" && tokens[0] in data) {
|
|
311
|
+
cursor = data;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
for (const token of tokens) {
|
|
303
316
|
if (cursor === null || cursor === void 0) {
|
|
304
317
|
throw new RefError("ref_pick_failed", `--pick \u8DEF\u5F84 ${path} \u5728 ${token} \u5904\u65E0\u6CD5\u7EE7\u7EED`);
|
|
305
318
|
}
|
|
@@ -322,7 +335,7 @@ function pickValue(value, path) {
|
|
|
322
335
|
return cursor;
|
|
323
336
|
}
|
|
324
337
|
function tokenizePath(path) {
|
|
325
|
-
|
|
338
|
+
const cursor = path.trim().replace(/^\$/, "");
|
|
326
339
|
const tokens = [];
|
|
327
340
|
const pattern = /([^.[\]]+)|\[(\d+)\]/g;
|
|
328
341
|
let match;
|
|
@@ -2,12 +2,12 @@ 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-6GWU63YF.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingSuccess,
|
|
8
8
|
meetingValidationError,
|
|
9
9
|
schemaOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-K3BT54CU.js";
|
|
11
11
|
|
|
12
12
|
// src/shortcuts/meeting/operations/eb/group-chat.ts
|
|
13
13
|
import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
@@ -113,7 +113,7 @@ async function findGroupByName(env, name) {
|
|
|
113
113
|
const target = name.trim();
|
|
114
114
|
if (target === "") return null;
|
|
115
115
|
try {
|
|
116
|
-
const { getImOperation } = await import("./registry-
|
|
116
|
+
const { getImOperation } = await import("./registry-BUTEDK3C.js");
|
|
117
117
|
const search = getImOperation("im.group.search");
|
|
118
118
|
const imEnv = await buildImEnv(env);
|
|
119
119
|
const found = await search.handler({ name: target }, imEnv);
|
|
@@ -159,7 +159,7 @@ async function triggerGroupFlow(env, input, meetingName, memberIds) {
|
|
|
159
159
|
if (addressText === "[object Object]") addressText = "";
|
|
160
160
|
if (addressText) {
|
|
161
161
|
try {
|
|
162
|
-
const { resolveAddressRoom } = await import("./create-flow-
|
|
162
|
+
const { resolveAddressRoom } = await import("./create-flow-7WG7LVX5.js");
|
|
163
163
|
const room = await resolveAddressRoom(env, addressText);
|
|
164
164
|
if (room?.name) addressText = room.name;
|
|
165
165
|
} catch {
|
|
@@ -201,7 +201,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
201
201
|
const group = String(groupId).trim();
|
|
202
202
|
if (id === "" || group === "") return { ok: false, error: "\u6CA1\u6709\u4F1A\u8BAE id \u6216\u7FA4 id" };
|
|
203
203
|
try {
|
|
204
|
-
const { EB_BASE, ebBusinessSuccess, writeBody } = await import("./factory-
|
|
204
|
+
const { EB_BASE, ebBusinessSuccess, writeBody } = await import("./factory-2H7Z4RWJ.js");
|
|
205
205
|
const session = await env.host.getSession();
|
|
206
206
|
await env.host.request({
|
|
207
207
|
method: "POST",
|
|
@@ -219,7 +219,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
219
219
|
return { ok: false, error: String(error?.message ?? error).slice(0, 300) };
|
|
220
220
|
}
|
|
221
221
|
try {
|
|
222
|
-
const { getMeetingOperation } = await import("./registry-
|
|
222
|
+
const { getMeetingOperation } = await import("./registry-CKUVBS53.js");
|
|
223
223
|
const detail = getMeetingOperation("meeting.eb.meeting.detail");
|
|
224
224
|
const read = await detail.handler({ id }, env);
|
|
225
225
|
const main = read?.data?.data ?? read?.data?.main ?? {};
|
|
@@ -235,7 +235,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
235
235
|
}
|
|
236
236
|
async function searchMyRequests(env, options = {}) {
|
|
237
237
|
try {
|
|
238
|
-
const { getWorkflowOperation } = await import("./registry-
|
|
238
|
+
const { getWorkflowOperation } = await import("./registry-7VZ6YJUF.js");
|
|
239
239
|
const op = getWorkflowOperation("workflow.search");
|
|
240
240
|
const wfEnv = await buildWorkflowEnv(env);
|
|
241
241
|
const args = { category: "mine", pageSize: 20, sort: "createTime:desc" };
|
|
@@ -267,7 +267,7 @@ async function resolveMeetingByRequestId(env, requestId, sinceMs) {
|
|
|
267
267
|
const target = String(requestId).trim();
|
|
268
268
|
if (target === "") return null;
|
|
269
269
|
try {
|
|
270
|
-
const { getMeetingOperation } = await import("./registry-
|
|
270
|
+
const { getMeetingOperation } = await import("./registry-CKUVBS53.js");
|
|
271
271
|
const list = getMeetingOperation("meeting.eb.meeting.list");
|
|
272
272
|
const detail = getMeetingOperation("meeting.eb.meeting.detail");
|
|
273
273
|
const page = await list.handler({ pageSize: 30 }, 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-6GWU63YF.js";
|
|
6
6
|
|
|
7
7
|
// src/shortcuts/meeting/operations/eb/cache.ts
|
|
8
8
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
READ,
|
|
5
|
+
SCHEMA_ID,
|
|
6
|
+
SCHEMA_PAGE,
|
|
7
|
+
browserBaseBody,
|
|
8
|
+
hrmSuccess,
|
|
9
|
+
orgLink,
|
|
10
|
+
pickDefined,
|
|
11
|
+
schemaOf,
|
|
12
|
+
toNumber,
|
|
13
|
+
toPositiveInt,
|
|
14
|
+
toStringIdList
|
|
15
|
+
} from "./chunk-JEQHNNSS.js";
|
|
16
|
+
import {
|
|
17
|
+
hrmValidationError
|
|
18
|
+
} from "./chunk-56EZERK4.js";
|
|
19
|
+
|
|
20
|
+
// src/shortcuts/hrm/operations/org.ts
|
|
21
|
+
var ORG_TYPES = ["subcompany", "department"];
|
|
22
|
+
var orgQuery = {
|
|
23
|
+
name: "hrm.org.query",
|
|
24
|
+
resource: "org",
|
|
25
|
+
method: "org.query",
|
|
26
|
+
action: "hrm.org.query",
|
|
27
|
+
summary: "\u6309\u540D\u79F0/\u7F16\u53F7/\u4E0A\u7EA7\u7EC4\u7EC7\u67E5\u8BE2\u5206\u90E8\u6216\u90E8\u95E8\uFF08type \u533A\u5206\uFF1B\u4E0D\u4F20 type \u65F6\u9ED8\u8BA4\u90E8\u95E8\uFF0C\u53EF\u7528 type \u5207\u5206\u90E8\u5206\u90E8\uFF09",
|
|
28
|
+
risk: READ,
|
|
29
|
+
inputSchema: schemaOf({
|
|
30
|
+
type: { type: "string", enum: [...ORG_TYPES], description: "subcompany \u5206\u90E8 / department \u90E8\u95E8\uFF1B\u4E0D\u4F20\u9ED8\u8BA4 department" },
|
|
31
|
+
name: { type: "string", description: "\u540D\u79F0\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
32
|
+
code: { type: "string", description: "\u7F16\u53F7\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
33
|
+
parent: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u90E8\u95E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u90E8\u95E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
34
|
+
subcompany: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
35
|
+
supSubDepartment: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u5206\u90E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Csubcompany\uFF09" },
|
|
36
|
+
...SCHEMA_PAGE
|
|
37
|
+
}),
|
|
38
|
+
handler: async (args, { host }) => {
|
|
39
|
+
const type = args.type === void 0 ? "department" : String(args.type);
|
|
40
|
+
if (!ORG_TYPES.includes(type)) {
|
|
41
|
+
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
42
|
+
}
|
|
43
|
+
const name = args.name === void 0 ? "" : String(args.name).trim();
|
|
44
|
+
const code = args.code === void 0 ? "" : String(args.code).trim();
|
|
45
|
+
const parentIds = toStringIdList(args.parent, "parent");
|
|
46
|
+
const subcompanyIds = toStringIdList(args.subcompany, "subcompany");
|
|
47
|
+
const supSubDepartmentIds = toStringIdList(args.supSubDepartment, "supSubDepartment");
|
|
48
|
+
const hasText = name !== "" || code !== "";
|
|
49
|
+
const hasOrg = Boolean(parentIds?.length || subcompanyIds?.length || supSubDepartmentIds?.length);
|
|
50
|
+
if (!hasText && !hasOrg) {
|
|
51
|
+
throw hrmValidationError("empty_condition", "\u7EC4\u7EC7\u67E5\u8BE2\u5FC5\u987B\u643A\u5E26\u81F3\u5C11\u4E00\u4E2A\u6536\u655B\u6761\u4EF6\uFF1Aname / code / parent / subcompany / supSubDepartment");
|
|
52
|
+
}
|
|
53
|
+
const formDatas = {};
|
|
54
|
+
if (name) formDatas.name = [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name }];
|
|
55
|
+
if (code) formDatas.code = [{ codeCondition: { id: "in", content: "\u5305\u542B", disabled: false }, code }];
|
|
56
|
+
if (parentIds?.length) {
|
|
57
|
+
formDatas.parent = [{ parentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, parent: parentIds.map((id) => ({ id })) }];
|
|
58
|
+
}
|
|
59
|
+
if (subcompanyIds?.length) {
|
|
60
|
+
formDatas.subcompany = [{ subcompanyCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, subcompany: subcompanyIds.map((id) => ({ id })) }];
|
|
61
|
+
}
|
|
62
|
+
if (supSubDepartmentIds?.length) {
|
|
63
|
+
formDatas.supSubDepartment = [{ supSubDepartmentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, supSubDepartment: supSubDepartmentIds.map((id) => ({ id })) }];
|
|
64
|
+
}
|
|
65
|
+
const body = {
|
|
66
|
+
...browserBaseBody(),
|
|
67
|
+
virtualType: "ALL",
|
|
68
|
+
cmd: "list",
|
|
69
|
+
formDatas,
|
|
70
|
+
quickSearchDatas: {},
|
|
71
|
+
type: "and",
|
|
72
|
+
stopDepartment: false
|
|
73
|
+
};
|
|
74
|
+
const current = toPositiveInt(args.current, "current") ?? 1;
|
|
75
|
+
const pageSize = toNumber(args.pageSize, "pageSize") ?? 200;
|
|
76
|
+
body.current = current;
|
|
77
|
+
body.pageSize = pageSize;
|
|
78
|
+
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
79
|
+
const resp = await host.request({ method: "POST", path, body });
|
|
80
|
+
const d = resp?.data ?? {};
|
|
81
|
+
const rawRows = Array.isArray(d.data) ? d.data : [];
|
|
82
|
+
const session = await host.getSession();
|
|
83
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
84
|
+
const rows = rawRows.map((r) => ({ ...r, link: orgLink(baseUrl, r.id) }));
|
|
85
|
+
return hrmSuccess("hrm.org.query", { rows, total: Number(d.total ?? rows.length), type }, { current, pageSize });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var orgDetail = {
|
|
89
|
+
name: "hrm.org.detail",
|
|
90
|
+
resource: "org",
|
|
91
|
+
method: "org.detail",
|
|
92
|
+
action: "hrm.org.detail",
|
|
93
|
+
summary: "\u6309\u7EC4\u7EC7\u8282\u70B9 id \u53D6\u90E8\u95E8/\u5206\u90E8\u8BE6\u60C5\u8868\u5355\uFF08\u7C7B\u578B\u7531\u670D\u52A1\u7AEF\u6309\u8BB0\u5F55\u81EA\u52A8\u5224\u65AD\uFF1B\u542B\u5168\u8DEF\u5F84 fullPath \u4E0E\u4EBA\u5458\u7EDF\u8BA1\uFF09",
|
|
94
|
+
risk: READ,
|
|
95
|
+
inputSchema: schemaOf(
|
|
96
|
+
{ id: SCHEMA_ID },
|
|
97
|
+
{ required: ["id"] }
|
|
98
|
+
),
|
|
99
|
+
handler: async (args, { host }) => {
|
|
100
|
+
const id = String(args.id).trim();
|
|
101
|
+
if (!id) throw hrmValidationError("id_required", "id \u5FC5\u586B");
|
|
102
|
+
const session = await host.getSession();
|
|
103
|
+
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
104
|
+
const resp = await host.request({
|
|
105
|
+
method: "GET",
|
|
106
|
+
path: "/api/bs/hrm/organization/getForm",
|
|
107
|
+
query: { id, readOnly: true, includeSub: true, quote: true, isMobile: false },
|
|
108
|
+
headers: { Referer: `${baseUrl}/sp/hrm/orgCard/${id}` }
|
|
109
|
+
});
|
|
110
|
+
const raw = resp?.data?.data ?? {};
|
|
111
|
+
const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
|
|
112
|
+
const subcompanyName = Array.isArray(raw.subcompany) && raw.subcompany[0]?.name ? String(raw.subcompany[0].name) : "";
|
|
113
|
+
return hrmSuccess("hrm.org.detail", {
|
|
114
|
+
id,
|
|
115
|
+
name: raw.name,
|
|
116
|
+
type: raw.type,
|
|
117
|
+
code: raw.code,
|
|
118
|
+
fullPath: raw.fullPath,
|
|
119
|
+
status: raw.status,
|
|
120
|
+
...parentName ? { parentName } : {},
|
|
121
|
+
...subcompanyName ? { subcompanyName } : {},
|
|
122
|
+
...pickDefined(raw, ["description", "remark"]),
|
|
123
|
+
link: orgLink(baseUrl, id)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var orgLookup = {
|
|
128
|
+
name: "hrm.org.lookup",
|
|
129
|
+
resource: "org",
|
|
130
|
+
method: "org.lookup",
|
|
131
|
+
action: "hrm.org.lookup",
|
|
132
|
+
summary: "\u7EC4\u7EC7\u6A21\u7CCA\u67E5\u627E\uFF1A\u5173\u952E\u8BCD**\u4E0D\u7528\u5199\u5168**\uFF0C\u4E00\u6B21\u8FD4\u56DE\u6240\u6709\u8FD1\u4F3C\u7684\u90E8\u95E8/\u5206\u90E8\uFF08\u542B\u5B8C\u6574\u8DEF\u5F84\u3001\u6309\u76F8\u4F3C\u5EA6\u6392\u5E8F\uFF09",
|
|
133
|
+
risk: READ,
|
|
134
|
+
inputSchema: schemaOf({
|
|
135
|
+
keyword: { type: "string", minLength: 1, description: "\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u53EF\u53EA\u5199\u4E00\u90E8\u5206\uFF0C\u5982\u300C\u4F1A\u8BAE\u7BA1\u7406\u300D\u300C\u7814\u53D1\u300D\uFF09" },
|
|
136
|
+
type: { type: "string", enum: ["department", "subcompany", "both"], description: "\u9ED8\u8BA4 both\uFF08\u90E8\u95E8+\u5206\u90E8\u90FD\u67E5\uFF09" },
|
|
137
|
+
limit: { type: "number", minimum: 1, maximum: 50, description: "\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 10" }
|
|
138
|
+
}, { required: ["keyword"] }),
|
|
139
|
+
handler: async (args, { host }) => {
|
|
140
|
+
const keyword = String(args.keyword ?? "").trim();
|
|
141
|
+
if (!keyword) throw hrmValidationError("keyword_required", "keyword \u5FC5\u586B");
|
|
142
|
+
const scope = args.type === "department" || args.type === "subcompany" ? String(args.type) : "both";
|
|
143
|
+
const limit = Math.max(1, Math.min(50, Number(args.limit) || 10));
|
|
144
|
+
const fetchOrg = async (type, text) => {
|
|
145
|
+
const body = {
|
|
146
|
+
...browserBaseBody(),
|
|
147
|
+
virtualType: "ALL",
|
|
148
|
+
cmd: "list",
|
|
149
|
+
formDatas: { name: [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name: text }] },
|
|
150
|
+
quickSearchDatas: {},
|
|
151
|
+
type: "and",
|
|
152
|
+
stopDepartment: false,
|
|
153
|
+
current: 1,
|
|
154
|
+
pageSize: 200
|
|
155
|
+
};
|
|
156
|
+
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
157
|
+
const resp = await host.request({ method: "POST", path, body });
|
|
158
|
+
const rows2 = resp?.data?.data ?? [];
|
|
159
|
+
return rows2.map((r) => ({
|
|
160
|
+
id: String(r.id ?? ""),
|
|
161
|
+
name: String(r.name ?? ""),
|
|
162
|
+
type,
|
|
163
|
+
fullPath: String(r.fullPath ?? r.path ?? ""),
|
|
164
|
+
...r.subcompanyName ? { subcompanyName: String(r.subcompanyName) } : {},
|
|
165
|
+
...r.parentName ? { parentName: String(r.parentName) } : {}
|
|
166
|
+
})).filter((r) => r.id);
|
|
167
|
+
};
|
|
168
|
+
const types = scope === "both" ? ["department", "subcompany"] : [scope];
|
|
169
|
+
const collected = [];
|
|
170
|
+
let requests = 0;
|
|
171
|
+
const stripSuffix = (text) => text.replace(/(部门|事业部|中心|科室|组|部)$/u, "").trim();
|
|
172
|
+
for (const type of types) {
|
|
173
|
+
requests += 1;
|
|
174
|
+
collected.push(...await fetchOrg(type, keyword));
|
|
175
|
+
const stripped = stripSuffix(keyword);
|
|
176
|
+
if (collected.length === 0 && stripped !== "" && stripped !== keyword) {
|
|
177
|
+
const raws = await fetchOrg(type, stripped);
|
|
178
|
+
collected.push(...raws.map((row) => ({ ...row, stripped: true })));
|
|
179
|
+
requests += 1;
|
|
180
|
+
}
|
|
181
|
+
if (collected.length === 0) {
|
|
182
|
+
for (let len = Math.min(keyword.length, 6) - 1; len >= 2; len -= 1) {
|
|
183
|
+
const short = keyword.slice(0, len);
|
|
184
|
+
const raws = await fetchOrg(type, short);
|
|
185
|
+
requests += 1;
|
|
186
|
+
if (raws.length > 0) {
|
|
187
|
+
collected.push(...raws.map((row) => ({ ...row, shortened: short })));
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const scoreOf = (row) => {
|
|
194
|
+
const name = String(row.name);
|
|
195
|
+
const pathText = String(row.fullPath ?? "");
|
|
196
|
+
let score = 0;
|
|
197
|
+
if (name === keyword) score = 100;
|
|
198
|
+
else if (name.startsWith(keyword)) score = 85;
|
|
199
|
+
else if (name.includes(keyword)) score = 70;
|
|
200
|
+
else if (pathText.includes(keyword)) score = 50;
|
|
201
|
+
else score = 35;
|
|
202
|
+
if (row.type === "department") score += 5;
|
|
203
|
+
if (row.stripped) score -= 5;
|
|
204
|
+
if (row.shortened) score -= 15;
|
|
205
|
+
return score;
|
|
206
|
+
};
|
|
207
|
+
const rows = collected.map((row) => ({ ...row, score: scoreOf(row) })).sort((left, right) => Number(right.score) - Number(left.score) || String(left.name).localeCompare(String(right.name), "zh-Hans-CN")).slice(0, limit);
|
|
208
|
+
return hrmSuccess("hrm.org.lookup", {
|
|
209
|
+
rows,
|
|
210
|
+
total: rows.length,
|
|
211
|
+
...rows.length === 0 ? { hint: `\u6CA1\u6709\u540D\u79F0\u542B\u300C${keyword}\u300D\u7684\u90E8\u95E8\u6216\u5206\u90E8\u3002\u6362\u66F4\u77ED\u7684\u5173\u952E\u8BCD\uFF08\u5982\u4E24\u4E2A\u5B57\uFF09\u518D\u8BD5\uFF0C\u6216\u7528 hrm.org.query \u6309 parent/subcompany \u9010\u7EA7\u627E\u3002` } : {}
|
|
212
|
+
}, { requests, keyword });
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var hrmOrgOperations = [
|
|
216
|
+
orgQuery,
|
|
217
|
+
orgLookup,
|
|
218
|
+
orgDetail
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
export {
|
|
222
|
+
hrmOrgOperations
|
|
223
|
+
};
|
|
@@ -1,225 +1,25 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
hrmEmployeeOperations
|
|
5
|
+
} from "./chunk-IW7A2IQY.js";
|
|
6
|
+
import {
|
|
7
|
+
hrmOrgOperations
|
|
8
|
+
} from "./chunk-5QYE52LG.js";
|
|
3
9
|
import {
|
|
4
10
|
READ,
|
|
5
11
|
SCHEMA_ID,
|
|
6
|
-
SCHEMA_PAGE,
|
|
7
12
|
browserBaseBody,
|
|
8
|
-
hrmEmployeeOperations,
|
|
9
13
|
hrmSuccess,
|
|
10
14
|
orgLink,
|
|
11
|
-
pickDefined,
|
|
12
15
|
positionLink,
|
|
13
16
|
schemaOf,
|
|
14
|
-
toNumber
|
|
15
|
-
|
|
16
|
-
toStringIdList
|
|
17
|
-
} from "./chunk-O6CMPO65.js";
|
|
17
|
+
toNumber
|
|
18
|
+
} from "./chunk-JEQHNNSS.js";
|
|
18
19
|
import {
|
|
19
20
|
hrmValidationError
|
|
20
21
|
} from "./chunk-56EZERK4.js";
|
|
21
22
|
|
|
22
|
-
// src/shortcuts/hrm/operations/org.ts
|
|
23
|
-
var ORG_TYPES = ["subcompany", "department"];
|
|
24
|
-
var orgQuery = {
|
|
25
|
-
name: "hrm.org.query",
|
|
26
|
-
resource: "org",
|
|
27
|
-
method: "org.query",
|
|
28
|
-
action: "hrm.org.query",
|
|
29
|
-
summary: "\u6309\u540D\u79F0/\u7F16\u53F7/\u4E0A\u7EA7\u7EC4\u7EC7\u67E5\u8BE2\u5206\u90E8\u6216\u90E8\u95E8\uFF08type \u533A\u5206\uFF1B\u4E0D\u4F20 type \u65F6\u9ED8\u8BA4\u90E8\u95E8\uFF0C\u53EF\u7528 type \u5207\u5206\u90E8\u5206\u90E8\uFF09",
|
|
30
|
-
risk: READ,
|
|
31
|
-
inputSchema: schemaOf({
|
|
32
|
-
type: { type: "string", enum: [...ORG_TYPES], description: "subcompany \u5206\u90E8 / department \u90E8\u95E8\uFF1B\u4E0D\u4F20\u9ED8\u8BA4 department" },
|
|
33
|
-
name: { type: "string", description: "\u540D\u79F0\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
34
|
-
code: { type: "string", description: "\u7F16\u53F7\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
35
|
-
parent: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u90E8\u95E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u90E8\u95E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
36
|
-
subcompany: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
37
|
-
supSubDepartment: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u5206\u90E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Csubcompany\uFF09" },
|
|
38
|
-
...SCHEMA_PAGE
|
|
39
|
-
}),
|
|
40
|
-
handler: async (args, { host }) => {
|
|
41
|
-
const type = args.type === void 0 ? "department" : String(args.type);
|
|
42
|
-
if (!ORG_TYPES.includes(type)) {
|
|
43
|
-
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
44
|
-
}
|
|
45
|
-
const name = args.name === void 0 ? "" : String(args.name).trim();
|
|
46
|
-
const code = args.code === void 0 ? "" : String(args.code).trim();
|
|
47
|
-
const parentIds = toStringIdList(args.parent, "parent");
|
|
48
|
-
const subcompanyIds = toStringIdList(args.subcompany, "subcompany");
|
|
49
|
-
const supSubDepartmentIds = toStringIdList(args.supSubDepartment, "supSubDepartment");
|
|
50
|
-
const hasText = name !== "" || code !== "";
|
|
51
|
-
const hasOrg = Boolean(parentIds?.length || subcompanyIds?.length || supSubDepartmentIds?.length);
|
|
52
|
-
if (!hasText && !hasOrg) {
|
|
53
|
-
throw hrmValidationError("empty_condition", "\u7EC4\u7EC7\u67E5\u8BE2\u5FC5\u987B\u643A\u5E26\u81F3\u5C11\u4E00\u4E2A\u6536\u655B\u6761\u4EF6\uFF1Aname / code / parent / subcompany / supSubDepartment");
|
|
54
|
-
}
|
|
55
|
-
const formDatas = {};
|
|
56
|
-
if (name) formDatas.name = [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name }];
|
|
57
|
-
if (code) formDatas.code = [{ codeCondition: { id: "in", content: "\u5305\u542B", disabled: false }, code }];
|
|
58
|
-
if (parentIds?.length) {
|
|
59
|
-
formDatas.parent = [{ parentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, parent: parentIds.map((id) => ({ id })) }];
|
|
60
|
-
}
|
|
61
|
-
if (subcompanyIds?.length) {
|
|
62
|
-
formDatas.subcompany = [{ subcompanyCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, subcompany: subcompanyIds.map((id) => ({ id })) }];
|
|
63
|
-
}
|
|
64
|
-
if (supSubDepartmentIds?.length) {
|
|
65
|
-
formDatas.supSubDepartment = [{ supSubDepartmentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, supSubDepartment: supSubDepartmentIds.map((id) => ({ id })) }];
|
|
66
|
-
}
|
|
67
|
-
const body = {
|
|
68
|
-
...browserBaseBody(),
|
|
69
|
-
virtualType: "ALL",
|
|
70
|
-
cmd: "list",
|
|
71
|
-
formDatas,
|
|
72
|
-
quickSearchDatas: {},
|
|
73
|
-
type: "and",
|
|
74
|
-
stopDepartment: false
|
|
75
|
-
};
|
|
76
|
-
const current = toPositiveInt(args.current, "current") ?? 1;
|
|
77
|
-
const pageSize = toNumber(args.pageSize, "pageSize") ?? 200;
|
|
78
|
-
body.current = current;
|
|
79
|
-
body.pageSize = pageSize;
|
|
80
|
-
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
81
|
-
const resp = await host.request({ method: "POST", path, body });
|
|
82
|
-
const d = resp?.data ?? {};
|
|
83
|
-
const rawRows = Array.isArray(d.data) ? d.data : [];
|
|
84
|
-
const session = await host.getSession();
|
|
85
|
-
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
86
|
-
const rows = rawRows.map((r) => ({ ...r, link: orgLink(baseUrl, r.id) }));
|
|
87
|
-
return hrmSuccess("hrm.org.query", { rows, total: Number(d.total ?? rows.length), type }, { current, pageSize });
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var orgDetail = {
|
|
91
|
-
name: "hrm.org.detail",
|
|
92
|
-
resource: "org",
|
|
93
|
-
method: "org.detail",
|
|
94
|
-
action: "hrm.org.detail",
|
|
95
|
-
summary: "\u6309\u7EC4\u7EC7\u8282\u70B9 id \u53D6\u90E8\u95E8/\u5206\u90E8\u8BE6\u60C5\u8868\u5355\uFF08\u7C7B\u578B\u7531\u670D\u52A1\u7AEF\u6309\u8BB0\u5F55\u81EA\u52A8\u5224\u65AD\uFF1B\u542B\u5168\u8DEF\u5F84 fullPath \u4E0E\u4EBA\u5458\u7EDF\u8BA1\uFF09",
|
|
96
|
-
risk: READ,
|
|
97
|
-
inputSchema: schemaOf(
|
|
98
|
-
{ id: SCHEMA_ID },
|
|
99
|
-
{ required: ["id"] }
|
|
100
|
-
),
|
|
101
|
-
handler: async (args, { host }) => {
|
|
102
|
-
const id = String(args.id).trim();
|
|
103
|
-
if (!id) throw hrmValidationError("id_required", "id \u5FC5\u586B");
|
|
104
|
-
const session = await host.getSession();
|
|
105
|
-
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
106
|
-
const resp = await host.request({
|
|
107
|
-
method: "GET",
|
|
108
|
-
path: "/api/bs/hrm/organization/getForm",
|
|
109
|
-
query: { id, readOnly: true, includeSub: true, quote: true, isMobile: false },
|
|
110
|
-
headers: { Referer: `${baseUrl}/sp/hrm/orgCard/${id}` }
|
|
111
|
-
});
|
|
112
|
-
const raw = resp?.data?.data ?? {};
|
|
113
|
-
const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
|
|
114
|
-
const subcompanyName = Array.isArray(raw.subcompany) && raw.subcompany[0]?.name ? String(raw.subcompany[0].name) : "";
|
|
115
|
-
return hrmSuccess("hrm.org.detail", {
|
|
116
|
-
id,
|
|
117
|
-
name: raw.name,
|
|
118
|
-
type: raw.type,
|
|
119
|
-
code: raw.code,
|
|
120
|
-
fullPath: raw.fullPath,
|
|
121
|
-
status: raw.status,
|
|
122
|
-
...parentName ? { parentName } : {},
|
|
123
|
-
...subcompanyName ? { subcompanyName } : {},
|
|
124
|
-
...pickDefined(raw, ["description", "remark"]),
|
|
125
|
-
link: orgLink(baseUrl, id)
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var orgLookup = {
|
|
130
|
-
name: "hrm.org.lookup",
|
|
131
|
-
resource: "org",
|
|
132
|
-
method: "org.lookup",
|
|
133
|
-
action: "hrm.org.lookup",
|
|
134
|
-
summary: "\u7EC4\u7EC7\u6A21\u7CCA\u67E5\u627E\uFF1A\u5173\u952E\u8BCD**\u4E0D\u7528\u5199\u5168**\uFF0C\u4E00\u6B21\u8FD4\u56DE\u6240\u6709\u8FD1\u4F3C\u7684\u90E8\u95E8/\u5206\u90E8\uFF08\u542B\u5B8C\u6574\u8DEF\u5F84\u3001\u6309\u76F8\u4F3C\u5EA6\u6392\u5E8F\uFF09",
|
|
135
|
-
risk: READ,
|
|
136
|
-
inputSchema: schemaOf({
|
|
137
|
-
keyword: { type: "string", minLength: 1, description: "\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u53EF\u53EA\u5199\u4E00\u90E8\u5206\uFF0C\u5982\u300C\u4F1A\u8BAE\u7BA1\u7406\u300D\u300C\u7814\u53D1\u300D\uFF09" },
|
|
138
|
-
type: { type: "string", enum: ["department", "subcompany", "both"], description: "\u9ED8\u8BA4 both\uFF08\u90E8\u95E8+\u5206\u90E8\u90FD\u67E5\uFF09" },
|
|
139
|
-
limit: { type: "number", minimum: 1, maximum: 50, description: "\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 10" }
|
|
140
|
-
}, { required: ["keyword"] }),
|
|
141
|
-
handler: async (args, { host }) => {
|
|
142
|
-
const keyword = String(args.keyword ?? "").trim();
|
|
143
|
-
if (!keyword) throw hrmValidationError("keyword_required", "keyword \u5FC5\u586B");
|
|
144
|
-
const scope = args.type === "department" || args.type === "subcompany" ? String(args.type) : "both";
|
|
145
|
-
const limit = Math.max(1, Math.min(50, Number(args.limit) || 10));
|
|
146
|
-
const fetchOrg = async (type, text2) => {
|
|
147
|
-
const body = {
|
|
148
|
-
...browserBaseBody(),
|
|
149
|
-
virtualType: "ALL",
|
|
150
|
-
cmd: "list",
|
|
151
|
-
formDatas: { name: [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name: text2 }] },
|
|
152
|
-
quickSearchDatas: {},
|
|
153
|
-
type: "and",
|
|
154
|
-
stopDepartment: false,
|
|
155
|
-
current: 1,
|
|
156
|
-
pageSize: 200
|
|
157
|
-
};
|
|
158
|
-
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
159
|
-
const resp = await host.request({ method: "POST", path, body });
|
|
160
|
-
const rows2 = resp?.data?.data ?? [];
|
|
161
|
-
return rows2.map((r) => ({
|
|
162
|
-
id: String(r.id ?? ""),
|
|
163
|
-
name: String(r.name ?? ""),
|
|
164
|
-
type,
|
|
165
|
-
fullPath: String(r.fullPath ?? r.path ?? ""),
|
|
166
|
-
...r.subcompanyName ? { subcompanyName: String(r.subcompanyName) } : {},
|
|
167
|
-
...r.parentName ? { parentName: String(r.parentName) } : {}
|
|
168
|
-
})).filter((r) => r.id);
|
|
169
|
-
};
|
|
170
|
-
const types = scope === "both" ? ["department", "subcompany"] : [scope];
|
|
171
|
-
const collected = [];
|
|
172
|
-
let requests = 0;
|
|
173
|
-
const stripSuffix = (text2) => text2.replace(/(部门|事业部|中心|科室|组|部)$/u, "").trim();
|
|
174
|
-
for (const type of types) {
|
|
175
|
-
requests += 1;
|
|
176
|
-
collected.push(...await fetchOrg(type, keyword));
|
|
177
|
-
const stripped = stripSuffix(keyword);
|
|
178
|
-
if (collected.length === 0 && stripped !== "" && stripped !== keyword) {
|
|
179
|
-
const raws = await fetchOrg(type, stripped);
|
|
180
|
-
collected.push(...raws.map((row) => ({ ...row, stripped: true })));
|
|
181
|
-
requests += 1;
|
|
182
|
-
}
|
|
183
|
-
if (collected.length === 0) {
|
|
184
|
-
for (let len = Math.min(keyword.length, 6) - 1; len >= 2; len -= 1) {
|
|
185
|
-
const short = keyword.slice(0, len);
|
|
186
|
-
const raws = await fetchOrg(type, short);
|
|
187
|
-
requests += 1;
|
|
188
|
-
if (raws.length > 0) {
|
|
189
|
-
collected.push(...raws.map((row) => ({ ...row, shortened: short })));
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const scoreOf = (row) => {
|
|
196
|
-
const name = String(row.name);
|
|
197
|
-
const pathText = String(row.fullPath ?? "");
|
|
198
|
-
let score = 0;
|
|
199
|
-
if (name === keyword) score = 100;
|
|
200
|
-
else if (name.startsWith(keyword)) score = 85;
|
|
201
|
-
else if (name.includes(keyword)) score = 70;
|
|
202
|
-
else if (pathText.includes(keyword)) score = 50;
|
|
203
|
-
else score = 35;
|
|
204
|
-
if (row.type === "department") score += 5;
|
|
205
|
-
if (row.stripped) score -= 5;
|
|
206
|
-
if (row.shortened) score -= 15;
|
|
207
|
-
return score;
|
|
208
|
-
};
|
|
209
|
-
const rows = collected.map((row) => ({ ...row, score: scoreOf(row) })).sort((left, right) => Number(right.score) - Number(left.score) || String(left.name).localeCompare(String(right.name), "zh-Hans-CN")).slice(0, limit);
|
|
210
|
-
return hrmSuccess("hrm.org.lookup", {
|
|
211
|
-
rows,
|
|
212
|
-
total: rows.length,
|
|
213
|
-
...rows.length === 0 ? { hint: `\u6CA1\u6709\u540D\u79F0\u542B\u300C${keyword}\u300D\u7684\u90E8\u95E8\u6216\u5206\u90E8\u3002\u6362\u66F4\u77ED\u7684\u5173\u952E\u8BCD\uFF08\u5982\u4E24\u4E2A\u5B57\uFF09\u518D\u8BD5\uFF0C\u6216\u7528 hrm.org.query \u6309 parent/subcompany \u9010\u7EA7\u627E\u3002` } : {}
|
|
214
|
-
}, { requests, keyword });
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
var hrmOrgOperations = [
|
|
218
|
-
orgQuery,
|
|
219
|
-
orgLookup,
|
|
220
|
-
orgDetail
|
|
221
|
-
];
|
|
222
|
-
|
|
223
23
|
// src/shortcuts/hrm/operations/position.ts
|
|
224
24
|
function positionFormDatas() {
|
|
225
25
|
const d = {};
|
|
@@ -405,7 +205,7 @@ var hrmPositionOperations = [
|
|
|
405
205
|
// src/shortcuts/hrm/operations/resolve.ts
|
|
406
206
|
var VIRTUAL_PATH = "/api/bs/hrm/companyVirtual/listCompanyVirtual";
|
|
407
207
|
var ORG_DETAIL_PATH = "/api/bs/hrm/organization/getForm";
|
|
408
|
-
var
|
|
208
|
+
var ORG_TYPES = ["department", "subcompany"];
|
|
409
209
|
var DEFAULT_MAX_CANDIDATES = 20;
|
|
410
210
|
var MAX_CANDIDATES = 200;
|
|
411
211
|
var MAX_SUGGESTIONS = 5;
|
|
@@ -672,7 +472,7 @@ var orgResolve = {
|
|
|
672
472
|
virtualId: SCHEMA_ID,
|
|
673
473
|
name: { type: "string", minLength: 1, description: "\u7EC4\u7EC7\u540D\u79F0\uFF1B\u4E0E orgId \u81F3\u5C11\u4F20\u4E00\u4E2A" },
|
|
674
474
|
orgId: SCHEMA_ID,
|
|
675
|
-
type: { type: "string", enum: [...
|
|
475
|
+
type: { type: "string", enum: [...ORG_TYPES] },
|
|
676
476
|
maxCandidates: { type: "integer", minimum: 1, maximum: MAX_CANDIDATES, default: DEFAULT_MAX_CANDIDATES }
|
|
677
477
|
}),
|
|
678
478
|
handler: async (args, { host }) => {
|
|
@@ -688,8 +488,8 @@ var orgResolve = {
|
|
|
688
488
|
}
|
|
689
489
|
const explicitType = args.type !== void 0;
|
|
690
490
|
const requestedType = explicitType ? text(args.type) : "";
|
|
691
|
-
if (explicitType && !
|
|
692
|
-
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${
|
|
491
|
+
if (explicitType && !ORG_TYPES.includes(requestedType)) {
|
|
492
|
+
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
693
493
|
}
|
|
694
494
|
const types = explicitType ? [requestedType] : ["department", "subcompany"];
|
|
695
495
|
const maxCandidates = maxCandidatesValue(args.maxCandidates);
|
|
@@ -2934,6 +2934,10 @@ var sessionList = {
|
|
|
2934
2934
|
sessionType: type,
|
|
2935
2935
|
sessionTypeName: typeName,
|
|
2936
2936
|
name,
|
|
2937
|
+
// 目标 id:单聊对方 uid/cid、群聊 group_id、系统消息分组 group(直接可用于发消息/查消息,不用再按名字反查)
|
|
2938
|
+
...[1, 6, 9].includes(type) && s?.fuser ? { toUid: str(s.fuser.uid), toCid: str(s.fuser.cid) } : {},
|
|
2939
|
+
...[2, 3, 7, 11].includes(type) && s?.group_id ? { groupId: str(s.group_id) } : {},
|
|
2940
|
+
...[4, 10].includes(type) && s?.group ? { group: str(s.group) } : {},
|
|
2937
2941
|
unread: Number(unread),
|
|
2938
2942
|
dontDisturb,
|
|
2939
2943
|
unreadLabel: Number(unread) > 0 ? dontDisturb ? `${unread}\uFF08\u514D\u6253\u6270\uFF09` : String(unread) : "",
|