weaver-work-cli 0.1.48 → 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-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-MU2LPI5P.js} +3 -3
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-3NV2ETZR.js} +6 -6
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-3X7VOSBA.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-6GWU63YF.js} +1 -1
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-BRRW7CWA.js} +25 -25
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-D2QRZUW4.js} +209 -25
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-EJVA5ZVB.js} +2 -2
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-GEOMANP7.js} +3 -3
- 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-K3BT54CU.js} +3 -3
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-KV5SOWMS.js} +4 -4
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-ZKEUGS2U.js} +5 -5
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-6347A7YK.js} +2 -2
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-7WG7LVX5.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-LHRKSLG6.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-2H7Z4RWJ.js} +1 -1
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-EW6PNDDT.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-N2FQBHXI.js} +10 -10
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-MYOKJULO.js} +429 -94
- 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-CKUVBS53.js} +10 -10
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-MBCYENQ2.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-5IFMCXME.js} +4 -4
- package/dist/index.js +12 -7
- 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/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/index.js +5 -0
- 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/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 +1 -1
- package/dist/shortcuts/reception/operations/panels.js +84 -21
- 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/docs/SKILL.md +1 -0
- package/docs/_catalog.md +3 -0
- 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/data.md +15 -0
- 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-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-reception-flow/SKILL.md +30 -16
- package/skills/weaver-e10-reception-flow/references/guide.md +4 -3
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-2TRU2ZSP.js} +3 -3
|
@@ -5,30 +5,35 @@ import {
|
|
|
5
5
|
listMeetingAttachments,
|
|
6
6
|
meetingAttachmentContentOperations,
|
|
7
7
|
renderDocx
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EJVA5ZVB.js";
|
|
9
9
|
import {
|
|
10
10
|
meetingEbGroupChatOperations
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3NV2ETZR.js";
|
|
12
12
|
import {
|
|
13
13
|
meetingEbCreateFlowOperations
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BRRW7CWA.js";
|
|
15
15
|
import {
|
|
16
16
|
ebMeetingWritePreflight,
|
|
17
17
|
meetingEbConflictOperations
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZKEUGS2U.js";
|
|
19
19
|
import {
|
|
20
20
|
meetingEbScheduleOperations
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GEOMANP7.js";
|
|
22
22
|
import {
|
|
23
23
|
ebRoomRecommendOperation,
|
|
24
24
|
recommendRooms,
|
|
25
25
|
rememberFrequentRoom
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KV5SOWMS.js";
|
|
27
|
+
import {
|
|
28
|
+
cacheScopeSuffix,
|
|
29
|
+
readCache,
|
|
30
|
+
writeCache
|
|
31
|
+
} from "./chunk-3X7VOSBA.js";
|
|
27
32
|
import {
|
|
28
33
|
meetingEnvOperations,
|
|
29
34
|
meetingStateDir,
|
|
30
35
|
resolveMeetingEnvMode
|
|
31
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-6GWU63YF.js";
|
|
32
37
|
import {
|
|
33
38
|
EB_BASE,
|
|
34
39
|
EB_ENDPOINTS,
|
|
@@ -60,7 +65,7 @@ import {
|
|
|
60
65
|
toIdString,
|
|
61
66
|
verifyLease,
|
|
62
67
|
writeBody
|
|
63
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-K3BT54CU.js";
|
|
64
69
|
import {
|
|
65
70
|
CONTINUATION_TTL_SECONDS
|
|
66
71
|
} from "./chunk-7BDPM5ST.js";
|
|
@@ -2224,7 +2229,7 @@ var meetingAttachmentAttach = {
|
|
|
2224
2229
|
if (mode === "append" && existingIds.length === 0) {
|
|
2225
2230
|
existingIds.push(...beforeIds);
|
|
2226
2231
|
}
|
|
2227
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
2232
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
2228
2233
|
const list = getMeetingOperation2("meeting.eb.meeting.list");
|
|
2229
2234
|
let fileId = incomingFileId;
|
|
2230
2235
|
let name = String(args.name ?? "").trim();
|
|
@@ -2312,7 +2317,7 @@ function textOf(value) {
|
|
|
2312
2317
|
return value === void 0 || value === null ? "" : String(value);
|
|
2313
2318
|
}
|
|
2314
2319
|
async function readMinute(env, id) {
|
|
2315
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
2320
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
2316
2321
|
const detail = getMeetingOperation2("meeting.eb.minute.detail");
|
|
2317
2322
|
const result = await detail.handler({ id }, env);
|
|
2318
2323
|
const row = result?.data?.data;
|
|
@@ -2391,7 +2396,7 @@ var meetingMinuteWriteContent = {
|
|
|
2391
2396
|
} else {
|
|
2392
2397
|
statusReason = "\u4EC5\u6E05\u7A7A\u5185\u5BB9\uFF0C\u672A\u6539\u72B6\u6001";
|
|
2393
2398
|
}
|
|
2394
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
2399
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
2395
2400
|
const prepare = getMeetingOperation2("meeting.eb.minute.update.prepare");
|
|
2396
2401
|
const apply = getMeetingOperation2("meeting.eb.minute.update.apply");
|
|
2397
2402
|
const prepared = await prepare.handler({ id, mt_id: mtId, ...patch }, env);
|
|
@@ -2750,7 +2755,7 @@ var meetingMinuteFromGroupChat = {
|
|
|
2750
2755
|
const mtId = textOf2(args.mt_id).trim();
|
|
2751
2756
|
if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
|
|
2752
2757
|
const pipeline = ["text", "minutes", "document"].includes(args.pipeline) ? args.pipeline : "text";
|
|
2753
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
2758
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
2754
2759
|
const ctx = env.ctx;
|
|
2755
2760
|
let stepStart = Date.now();
|
|
2756
2761
|
const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
|
|
@@ -2844,7 +2849,7 @@ var meetingMinuteFromGroupChat = {
|
|
|
2844
2849
|
try {
|
|
2845
2850
|
const { readFile: readFile4 } = await import("node:fs/promises");
|
|
2846
2851
|
const buffer = await readFile4(file);
|
|
2847
|
-
const { extractText } = await import("./attachment-content-
|
|
2852
|
+
const { extractText } = await import("./attachment-content-MU2LPI5P.js");
|
|
2848
2853
|
const extracted = extractText(buffer, file, "");
|
|
2849
2854
|
if (extracted.text.trim()) {
|
|
2850
2855
|
extraSections.push(`\u3010\u6750\u6599\uFF1A${file.split(/[\\/]/).pop() ?? file}\u3011
|
|
@@ -3163,7 +3168,7 @@ var meetingDecisionNotifyGroup = {
|
|
|
3163
3168
|
const warnings = [];
|
|
3164
3169
|
const mtId = textOf3(args.mt_id).trim();
|
|
3165
3170
|
if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
|
|
3166
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
3171
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
3167
3172
|
const ctx = env.ctx;
|
|
3168
3173
|
const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
|
|
3169
3174
|
{ mt_id: mtId, pageNo: 1, pageSize: 1 },
|
|
@@ -3465,7 +3470,7 @@ var meetingPipelineRun = {
|
|
|
3465
3470
|
const needsConfirm = level === "tasks" || level === "notify";
|
|
3466
3471
|
const confirmed = args.confirm === true;
|
|
3467
3472
|
const executedLevel = needsConfirm && !confirmed ? "document" : level;
|
|
3468
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
3473
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
3469
3474
|
const ctx = env.ctx;
|
|
3470
3475
|
let stepStart = Date.now();
|
|
3471
3476
|
const reuseMinuteId = textOf4(args.minuteId).trim();
|
|
@@ -3535,7 +3540,7 @@ var meetingPipelineRun = {
|
|
|
3535
3540
|
}
|
|
3536
3541
|
stepStart = Date.now();
|
|
3537
3542
|
const { createHrmHost } = await import("./host-G3VU7SDW.js");
|
|
3538
|
-
const { getHrmOperation } = await import("./registry-
|
|
3543
|
+
const { getHrmOperation } = await import("./registry-3UGIWH53.js");
|
|
3539
3544
|
const hrmEnv = { ctx, host: createHrmHost(ctx) };
|
|
3540
3545
|
const queryOp = getHrmOperation("hrm.employee.query");
|
|
3541
3546
|
const resolved = [];
|
|
@@ -3837,7 +3842,7 @@ function formatTimeRange(start, end) {
|
|
|
3837
3842
|
}
|
|
3838
3843
|
async function loadAgendaFromTopics(env, mtId) {
|
|
3839
3844
|
try {
|
|
3840
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
3845
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
3841
3846
|
const operation = getMeetingOperation2("meeting.eb.topic.list");
|
|
3842
3847
|
const result = await operation.handler({ mt_id: mtId, pageNo: 1, pageSize: 200 }, env);
|
|
3843
3848
|
const rows = result.data?.rows ?? [];
|
|
@@ -3930,7 +3935,7 @@ function flattenFieldValue(raw) {
|
|
|
3930
3935
|
}
|
|
3931
3936
|
async function resolveIssuerOrganization(env, creatorId) {
|
|
3932
3937
|
try {
|
|
3933
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
3938
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
3934
3939
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
3935
3940
|
if (!batch) return null;
|
|
3936
3941
|
const result = await batch.handler({ ids: [creatorId] }, env);
|
|
@@ -3952,7 +3957,7 @@ async function resolveSessionUserName(env) {
|
|
|
3952
3957
|
const session = await env.host.getSession();
|
|
3953
3958
|
const userId = String(session?.userId ?? "").trim();
|
|
3954
3959
|
if (!userId) return "";
|
|
3955
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
3960
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
3956
3961
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
3957
3962
|
if (!batch) return "";
|
|
3958
3963
|
const result = await batch.handler({ ids: [userId] }, env);
|
|
@@ -3988,7 +3993,7 @@ async function supplementRowFromDetail(row, mtId, env) {
|
|
|
3988
3993
|
const missing = DETAIL_FALLBACK_KEYS.filter((key) => isBlank(row[key]));
|
|
3989
3994
|
if (missing.length === 0) return { row, filled: [] };
|
|
3990
3995
|
try {
|
|
3991
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
3996
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
3992
3997
|
const detailOperation = getMeetingOperation2("meeting.eb.meeting.detail");
|
|
3993
3998
|
const result = await detailOperation.handler({ id: mtId }, env);
|
|
3994
3999
|
const flat = result?.data?.data ?? result?.data ?? {};
|
|
@@ -4162,7 +4167,7 @@ var meetingInvitationRender = {
|
|
|
4162
4167
|
};
|
|
4163
4168
|
dataSource = "payload";
|
|
4164
4169
|
} else {
|
|
4165
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
4170
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
4166
4171
|
const listOperation = getMeetingOperation2("meeting.eb.meeting.list");
|
|
4167
4172
|
try {
|
|
4168
4173
|
const listed = await listOperation.handler({ mt_id: mtId, pageNo: 1, pageSize: 1 }, env);
|
|
@@ -4279,6 +4284,184 @@ var meetingInvitationRender = {
|
|
|
4279
4284
|
};
|
|
4280
4285
|
var meetingInvitationOperations = [meetingInvitationRender];
|
|
4281
4286
|
|
|
4287
|
+
// src/shortcuts/meeting/operations/eb/member-expand.ts
|
|
4288
|
+
var TTL_HOURS = (() => {
|
|
4289
|
+
const raw = Number(process.env.WEAVER_MEETING_MEMBER_CACHE_TTL_HOURS ?? "");
|
|
4290
|
+
return Number.isFinite(raw) && raw > 0 ? Math.min(raw, 24 * 30) : 24 * 30;
|
|
4291
|
+
})();
|
|
4292
|
+
var TTL_ORG_MS = TTL_HOURS * 60 * 60 * 1e3;
|
|
4293
|
+
var TTL_MEMBERS_MS = TTL_ORG_MS;
|
|
4294
|
+
var MAX_DEPARTMENTS = 30;
|
|
4295
|
+
var MAX_MEMBERS_RETURN = 300;
|
|
4296
|
+
async function runHrm(name, input, env) {
|
|
4297
|
+
const { hrmOrgOperations } = await import("./org-NFE7X7FK.js");
|
|
4298
|
+
const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
|
|
4299
|
+
const all = [...hrmOrgOperations, ...hrmEmployeeOperations];
|
|
4300
|
+
const operation = all.find((item) => item.name === name);
|
|
4301
|
+
if (!operation) throw meetingValidationError("hrm_operation_missing", `\u5F53\u524D CLI \u7F3A\u5C11 ${name}\uFF08\u8BF7\u5347\u7EA7 weaver-work-cli\uFF09`);
|
|
4302
|
+
return operation.handler(input, env);
|
|
4303
|
+
}
|
|
4304
|
+
async function lookupOrg(env, keyword, refresh) {
|
|
4305
|
+
const scope = await cacheScopeSuffix(env);
|
|
4306
|
+
const key = `org-lookup-v1-${scope}-${encodeURIComponent(keyword)}`;
|
|
4307
|
+
if (!refresh) {
|
|
4308
|
+
const hit = await readCache(env, key, { ttlMs: TTL_ORG_MS });
|
|
4309
|
+
if (hit) return { rows: hit.data, cached: true };
|
|
4310
|
+
}
|
|
4311
|
+
const result = await runHrm("hrm.org.lookup", { keyword, limit: 20 }, env);
|
|
4312
|
+
const rows = (result?.data?.rows ?? []).map((row) => ({
|
|
4313
|
+
id: String(row.id ?? ""),
|
|
4314
|
+
name: String(row.name ?? ""),
|
|
4315
|
+
type: String(row.type ?? ""),
|
|
4316
|
+
...row.fullPath ? { fullPath: String(row.fullPath) } : {},
|
|
4317
|
+
...row.score !== void 0 ? { score: Number(row.score) } : {}
|
|
4318
|
+
})).filter((row) => row.id && row.name);
|
|
4319
|
+
await writeCache(env, key, rows);
|
|
4320
|
+
return { rows, cached: false };
|
|
4321
|
+
}
|
|
4322
|
+
async function deptMembers(env, deptId, refresh) {
|
|
4323
|
+
const scope = await cacheScopeSuffix(env);
|
|
4324
|
+
const key = `dept-members-v1-${scope}-${deptId}`;
|
|
4325
|
+
if (!refresh) {
|
|
4326
|
+
const hit = await readCache(env, key, { ttlMs: TTL_MEMBERS_MS });
|
|
4327
|
+
if (hit) return { members: hit.data, cached: true };
|
|
4328
|
+
}
|
|
4329
|
+
const result = await runHrm("hrm.dept.members", { dept: deptId }, env);
|
|
4330
|
+
const rows = result?.data?.rows ?? result?.data?.members ?? [];
|
|
4331
|
+
const members = rows.map((row) => ({
|
|
4332
|
+
id: String(row.id ?? row.employeeId ?? ""),
|
|
4333
|
+
name: String(row.name ?? row.employeeName ?? ""),
|
|
4334
|
+
...row.department ? { department: String(row.department) } : {},
|
|
4335
|
+
...row.departmentId ? { departmentId: String(row.departmentId) } : {},
|
|
4336
|
+
...row.subCompany ? { subCompany: String(row.subCompany) } : {}
|
|
4337
|
+
})).filter((row) => row.id);
|
|
4338
|
+
await writeCache(env, key, members);
|
|
4339
|
+
return { members, cached: false };
|
|
4340
|
+
}
|
|
4341
|
+
async function deptsUnderSubcompany(env, subcompanyId) {
|
|
4342
|
+
const result = await runHrm("hrm.org.query", { type: "department", subcompany: [subcompanyId], pageSize: 100 }, env);
|
|
4343
|
+
const rows = result?.data?.rows ?? [];
|
|
4344
|
+
return rows.map((row) => ({ id: String(row.id ?? ""), name: String(row.name ?? "") })).filter((row) => row.id);
|
|
4345
|
+
}
|
|
4346
|
+
var meetingMemberExpand = {
|
|
4347
|
+
name: "meeting.member.expand",
|
|
4348
|
+
resource: "member",
|
|
4349
|
+
method: "expand",
|
|
4350
|
+
action: "meeting.member.expand",
|
|
4351
|
+
summary: "\u628A\u300C\u6211\u4EEC\u90E8\u95E8\u6240\u6709\u4EBA / \u67D0\u5206\u90E8 / \u6A21\u7CCA\u90E8\u95E8\u540D\u300D\u4E00\u6B21\u5C55\u5F00\u6210\u5458\u5DE5 id \u5217\u8868\uFF08\u67E5\u7EC4\u7EC7 + \u53D6\u6210\u5458\uFF0C\u5E26 30 \u5929\u7F13\u5B58\uFF0Crefresh \u53EF\u5F3A\u5236\u5237\u65B0\uFF09\u3002\u652F\u6301 keywords \u591A\u4E2A\u90E8\u95E8\u5E76\u96C6\uFF1B\u6A21\u7CCA\u547D\u4E2D\u591A\u4E2A\u65F6\u8FD4\u56DE candidates\uFF08ambiguous=true\uFF09\u8BA9\u7528\u6237\u70B9\u9009\uFF0C\u4E0D\u731C\u3002\u26D4 \u4E0D\u8981\u7528 hrm.employee.query \u4E0D\u5E26\u6761\u4EF6\u67E5\u5168\u516C\u53F8\uFF08\u5B9E\u6D4B 51 \u79D2\uFF09\u3002",
|
|
4352
|
+
capability: "eb.meeting",
|
|
4353
|
+
risk: "read",
|
|
4354
|
+
inputSchema: {
|
|
4355
|
+
type: "object",
|
|
4356
|
+
additionalProperties: false,
|
|
4357
|
+
properties: {
|
|
4358
|
+
keyword: { type: "string", description: "\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\uFF0C\u652F\u6301\u6A21\u7CCA\uFF08\u5982\u300C\u4F1A\u8BAE\u6A21\u5757\u7EC4\u300D\u300C\u4EA7\u54C1\u7814\u53D1\u4E2D\u5FC3\u300D\u300C\u4F1A\u8BAE\u300D\uFF09" },
|
|
4359
|
+
keywords: { type: "array", items: { type: "string" }, description: "\u591A\u4E2A\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\uFF08\u5E76\u96C6\u53BB\u91CD\uFF09" },
|
|
4360
|
+
scope: { type: "string", enum: ["any", "department", "subcompany"], description: "\u9650\u5B9A\u7EC4\u7EC7\u7C7B\u578B\uFF0C\u9ED8\u8BA4 any" },
|
|
4361
|
+
includeMembers: { type: "boolean", description: "\u662F\u5426\u5C55\u5F00\u6210\u5458\uFF0C\u9ED8\u8BA4 true\uFF1B\u53EA\u67E5\u90E8\u95E8 id \u65F6\u4F20 false" },
|
|
4362
|
+
refresh: { type: "boolean", description: "\u5FFD\u7565\u7F13\u5B58\u91CD\u65B0\u67E5\uFF08\u9ED8\u8BA4 false\uFF09" },
|
|
4363
|
+
maxDepartments: { type: "number", description: `\u5206\u90E8\u5C55\u5F00\u65F6\u6700\u591A\u53D6\u51E0\u4E2A\u90E8\u95E8\uFF0C\u9ED8\u8BA4 ${MAX_DEPARTMENTS}` }
|
|
4364
|
+
}
|
|
4365
|
+
},
|
|
4366
|
+
handler: async (args, env) => {
|
|
4367
|
+
const tokens = [
|
|
4368
|
+
...typeof args.keyword === "string" ? [args.keyword] : [],
|
|
4369
|
+
...Array.isArray(args.keywords) ? args.keywords.map((item) => String(item)) : []
|
|
4370
|
+
].map((item) => item.trim()).filter((item) => item !== "");
|
|
4371
|
+
if (tokens.length === 0) {
|
|
4372
|
+
throw meetingValidationError("keyword_required", "\u8BF7\u4F20 keyword\uFF08\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\uFF09\u6216 keywords\uFF08\u591A\u4E2A\uFF09");
|
|
4373
|
+
}
|
|
4374
|
+
const scope = String(args.scope ?? "any");
|
|
4375
|
+
const includeMembers = args.includeMembers !== false;
|
|
4376
|
+
const refresh = args.refresh === true;
|
|
4377
|
+
const maxDepartments = Math.max(1, Math.min(100, Number(args.maxDepartments) || MAX_DEPARTMENTS));
|
|
4378
|
+
const warnings = [];
|
|
4379
|
+
const resolved = [];
|
|
4380
|
+
const unresolved = [];
|
|
4381
|
+
const ambiguous = [];
|
|
4382
|
+
let fromCache = true;
|
|
4383
|
+
for (const keyword of tokens) {
|
|
4384
|
+
const { rows, cached } = await lookupOrg(env, keyword, refresh);
|
|
4385
|
+
fromCache = fromCache && cached;
|
|
4386
|
+
const filtered = scope === "any" ? rows : rows.filter((row) => row.type === scope);
|
|
4387
|
+
if (filtered.length === 0) {
|
|
4388
|
+
unresolved.push(keyword);
|
|
4389
|
+
continue;
|
|
4390
|
+
}
|
|
4391
|
+
const exact = filtered.find((row) => row.name === keyword);
|
|
4392
|
+
const picked = exact ?? (filtered.length === 1 ? filtered[0] : null);
|
|
4393
|
+
if (!picked) {
|
|
4394
|
+
ambiguous.push({ keyword, candidates: filtered.slice(0, 10) });
|
|
4395
|
+
continue;
|
|
4396
|
+
}
|
|
4397
|
+
let members2 = [];
|
|
4398
|
+
let deptCached = true;
|
|
4399
|
+
if (includeMembers) {
|
|
4400
|
+
if (picked.type === "subcompany") {
|
|
4401
|
+
const depts = await deptsUnderSubcompany(env, picked.id);
|
|
4402
|
+
const limited = depts.slice(0, maxDepartments);
|
|
4403
|
+
if (depts.length > limited.length) {
|
|
4404
|
+
warnings.push(`\u300C${picked.name}\u300D\u4E0B\u6709 ${depts.length} \u4E2A\u90E8\u95E8\uFF0C\u53EA\u5C55\u5F00\u4E86\u524D ${limited.length} \u4E2A\uFF08maxDepartments \u53EF\u8C03\uFF09`);
|
|
4405
|
+
}
|
|
4406
|
+
for (const dept of limited) {
|
|
4407
|
+
const part = await deptMembers(env, dept.id, refresh);
|
|
4408
|
+
deptCached = deptCached && part.cached;
|
|
4409
|
+
members2.push(...part.members);
|
|
4410
|
+
}
|
|
4411
|
+
} else {
|
|
4412
|
+
const part = await deptMembers(env, picked.id, refresh);
|
|
4413
|
+
deptCached = part.cached;
|
|
4414
|
+
members2 = part.members;
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
fromCache = fromCache && deptCached;
|
|
4418
|
+
resolved.push({ keyword, org: picked, members: members2, cached: deptCached });
|
|
4419
|
+
}
|
|
4420
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4421
|
+
const allMembers = [];
|
|
4422
|
+
for (const item of resolved) {
|
|
4423
|
+
for (const member of item.members) {
|
|
4424
|
+
if (seen.has(member.id)) continue;
|
|
4425
|
+
seen.add(member.id);
|
|
4426
|
+
allMembers.push(member);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
const overflow = allMembers.length > MAX_MEMBERS_RETURN;
|
|
4430
|
+
const members = overflow ? allMembers.slice(0, MAX_MEMBERS_RETURN) : allMembers;
|
|
4431
|
+
if (overflow) warnings.push(`\u4EBA\u5458\u8F83\u591A\uFF08${allMembers.length}\uFF09\uFF0C\u53EA\u8FD4\u56DE\u524D ${MAX_MEMBERS_RETURN} \u4E2A\uFF1B\u5EFA\u8BAE\u6309\u66F4\u5C0F\u7684\u90E8\u95E8\u8303\u56F4\u67E5`);
|
|
4432
|
+
if (unresolved.length > 0) warnings.push(`\u672A\u627E\u5230\u7EC4\u7EC7\uFF1A${unresolved.join("\u3001")}`);
|
|
4433
|
+
const isAmbiguous = ambiguous.length > 0;
|
|
4434
|
+
if (isAmbiguous) {
|
|
4435
|
+
warnings.push("\u5B58\u5728\u591A\u4E2A\u540C\u540D/\u8FD1\u540D\u7EC4\u7EC7\uFF1A\u8BF7\u628A candidates \u505A\u6210\u9009\u9879\u8BA9\u7528\u6237\u70B9\u9009\uFF0C\u4E0D\u8981\u81EA\u5DF1\u6311");
|
|
4436
|
+
}
|
|
4437
|
+
return meetingSuccess(
|
|
4438
|
+
"meeting.member.expand",
|
|
4439
|
+
{
|
|
4440
|
+
input: { keywords: tokens, scope, includeMembers },
|
|
4441
|
+
departments: resolved.map((item) => ({
|
|
4442
|
+
keyword: item.keyword,
|
|
4443
|
+
id: item.org.id,
|
|
4444
|
+
name: item.org.name,
|
|
4445
|
+
type: item.org.type,
|
|
4446
|
+
...item.org.fullPath ? { fullPath: item.org.fullPath } : {},
|
|
4447
|
+
memberCount: item.members.length
|
|
4448
|
+
})),
|
|
4449
|
+
members,
|
|
4450
|
+
count: members.length,
|
|
4451
|
+
/** 直接可用的参会人入参(逗号分隔的员工 id) */
|
|
4452
|
+
membersCsv: members.map((member) => member.id).join(","),
|
|
4453
|
+
memberNames: members.map((member) => member.name).join("\u3001"),
|
|
4454
|
+
ambiguous: isAmbiguous,
|
|
4455
|
+
candidates: ambiguous.flatMap((item) => item.candidates.map((row) => ({ keyword: item.keyword, ...row }))),
|
|
4456
|
+
unresolved,
|
|
4457
|
+
source: fromCache ? "cache" : "api"
|
|
4458
|
+
},
|
|
4459
|
+
warnings.length > 0 ? { warnings } : {}
|
|
4460
|
+
);
|
|
4461
|
+
}
|
|
4462
|
+
};
|
|
4463
|
+
var meetingMemberExpandOperations = [meetingMemberExpand];
|
|
4464
|
+
|
|
4282
4465
|
// src/shortcuts/meeting/operations/invitation-publish.ts
|
|
4283
4466
|
import { win32 } from "node:path";
|
|
4284
4467
|
var DEFAULT_FOLDER_ID = "300";
|
|
@@ -4328,7 +4511,7 @@ var meetingInvitationPublish = {
|
|
|
4328
4511
|
"\u4F1A\u771F\u5B9E\u521B\u5EFA\u6587\u6863\uFF0C\u5FC5\u987B\u663E\u5F0F\u4F20 confirm: true\uFF08\u53EF\u5148\u4E0D\u5E26 confirm \u8C03 meeting.invitation.render \u9884\u89C8\u6B63\u6587\uFF09"
|
|
4329
4512
|
);
|
|
4330
4513
|
}
|
|
4331
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
4514
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
4332
4515
|
const render = getMeetingOperation2("meeting.invitation.render");
|
|
4333
4516
|
const rendered = await render.handler(
|
|
4334
4517
|
{
|
|
@@ -5043,7 +5226,7 @@ var meetingSummaryGet = {
|
|
|
5043
5226
|
const mtId = textOf5(args.mt_id).trim();
|
|
5044
5227
|
if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
|
|
5045
5228
|
const ctx = env.ctx;
|
|
5046
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
5229
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
5047
5230
|
const warnings = [];
|
|
5048
5231
|
const timings = {};
|
|
5049
5232
|
const include = Array.isArray(args.include) && args.include.length > 0 ? args.include.filter((item) => ALL_SECTIONS.includes(item)) : ALL_SECTIONS;
|
|
@@ -5364,7 +5547,7 @@ var MT_STATUS_OVER = "8";
|
|
|
5364
5547
|
var CANCELLED_MARK_DELAY_MS = 800;
|
|
5365
5548
|
async function isCancelledMeeting(env, mtId) {
|
|
5366
5549
|
try {
|
|
5367
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
5550
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
5368
5551
|
const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
|
|
5369
5552
|
// withCount:false —— 这里只要一行状态,不必额外请求 count(少一次往返,也便于测试替身)
|
|
5370
5553
|
{ mt_id: mtId, pageNo: 1, pageSize: 1, withCount: false },
|
|
@@ -6389,7 +6572,7 @@ var ebAutoInvitationAfterWrite = async (context) => {
|
|
|
6389
6572
|
const mtId = String(context.dataIds?.[0] ?? "").trim();
|
|
6390
6573
|
if (!isCreate || !enabled || !mtId) return association;
|
|
6391
6574
|
try {
|
|
6392
|
-
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-
|
|
6575
|
+
const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-CKUVBS53.js");
|
|
6393
6576
|
const render = getMeetingOperation2("meeting.invitation.render");
|
|
6394
6577
|
const result = await render.handler({ mtId }, context.env);
|
|
6395
6578
|
return { ...association ?? {}, invitation: result?.data ?? null };
|
|
@@ -6440,6 +6623,7 @@ function buildRegistry() {
|
|
|
6440
6623
|
...meetingDecisionNotifyOperations,
|
|
6441
6624
|
...meetingPipelineOperations,
|
|
6442
6625
|
...meetingInvitationOperations,
|
|
6626
|
+
...meetingMemberExpandOperations,
|
|
6443
6627
|
...meetingInvitationPublishOperations,
|
|
6444
6628
|
...meetingQrOperations,
|
|
6445
6629
|
...meetingSummaryOperations,
|
|
@@ -2,13 +2,13 @@ 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
|
SCHEMA_ID,
|
|
8
8
|
meetingSuccess,
|
|
9
9
|
meetingValidationError,
|
|
10
10
|
schemaOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-K3BT54CU.js";
|
|
12
12
|
|
|
13
13
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
14
14
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -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-3X7VOSBA.js";
|
|
7
7
|
import {
|
|
8
8
|
SCHEMA_DATETIME_MINUTE,
|
|
9
9
|
meetingSuccess,
|
|
10
10
|
meetingValidationError,
|
|
11
11
|
schemaOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-K3BT54CU.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) {
|
|
@@ -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
|
};
|