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
|
@@ -946,6 +946,44 @@ function buildCardUrl(baseUrl, objId, dataId) {
|
|
|
946
946
|
if (!baseUrl || !objId || !dataId) return null;
|
|
947
947
|
return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/card/0/" + objId + "/" + dataId;
|
|
948
948
|
}
|
|
949
|
+
var TALENT_UI_ROUTE = "/sp/custom/ecode/recruit-talent";
|
|
950
|
+
async function detectTalentUi(host, cache) {
|
|
951
|
+
const flag = String(cache.talentUi || "");
|
|
952
|
+
if (flag === "1") return true;
|
|
953
|
+
if (flag === "0") return false;
|
|
954
|
+
let installed = false;
|
|
955
|
+
try {
|
|
956
|
+
const r = await host.request({
|
|
957
|
+
path: "/api/ecode/project/searchAll",
|
|
958
|
+
method: "GET",
|
|
959
|
+
query: { page: 1, size: 100 },
|
|
960
|
+
operation: "detect-talent-ui"
|
|
961
|
+
});
|
|
962
|
+
const list = r && r.data && r.data.list || r && r.list || [];
|
|
963
|
+
installed = Array.isArray(list) && list.some((x) => String(x && x.projectName || "").startsWith("recruit-talent-ui"));
|
|
964
|
+
} catch {
|
|
965
|
+
installed = false;
|
|
966
|
+
}
|
|
967
|
+
cache.talentUi = installed ? "1" : "0";
|
|
968
|
+
return installed;
|
|
969
|
+
}
|
|
970
|
+
async function resolveTalentListUrl(host, cache, baseUrl, fallbackListId) {
|
|
971
|
+
if (await detectTalentUi(host, cache)) {
|
|
972
|
+
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE;
|
|
973
|
+
}
|
|
974
|
+
return buildListUrl(baseUrl, fallbackListId);
|
|
975
|
+
}
|
|
976
|
+
async function resolveInterviewListUrlOrNative(host, cache, baseUrl, fallbackListId) {
|
|
977
|
+
if (await detectTalentUi(host, cache)) {
|
|
978
|
+
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE + "/interview";
|
|
979
|
+
}
|
|
980
|
+
return buildListUrl(baseUrl, fallbackListId);
|
|
981
|
+
}
|
|
982
|
+
async function talentUiCardUrl(host, cache, baseUrl, talentId) {
|
|
983
|
+
if (!talentId) return null;
|
|
984
|
+
if (!await detectTalentUi(host, cache)) return null;
|
|
985
|
+
return String(baseUrl).replace(/\/+$/, "") + TALENT_UI_ROUTE + "/card?talentId=" + encodeURIComponent(String(talentId));
|
|
986
|
+
}
|
|
949
987
|
function buildListUrl(baseUrl, listId) {
|
|
950
988
|
if (!baseUrl || !listId) return null;
|
|
951
989
|
return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/list/" + listId;
|
|
@@ -2557,7 +2595,11 @@ function makeBriefReader(ctx, formId, objId, fields) {
|
|
|
2557
2595
|
}
|
|
2558
2596
|
};
|
|
2559
2597
|
}
|
|
2560
|
-
function resolveTalentCardUrl(ctx, talentId) {
|
|
2598
|
+
async function resolveTalentCardUrl(ctx, talentId) {
|
|
2599
|
+
if (talentId) {
|
|
2600
|
+
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
2601
|
+
if (ui) return ui;
|
|
2602
|
+
}
|
|
2561
2603
|
const pid = ctx.cache.ebdDetailPageId;
|
|
2562
2604
|
if (!pid || !talentId) {
|
|
2563
2605
|
const forms = ctx.cache.forms || {};
|
|
@@ -2566,8 +2608,10 @@ function resolveTalentCardUrl(ctx, talentId) {
|
|
|
2566
2608
|
}
|
|
2567
2609
|
return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
|
|
2568
2610
|
}
|
|
2569
|
-
function resolveTalentListLocateUrl(ctx, _talentId) {
|
|
2611
|
+
async function resolveTalentListLocateUrl(ctx, _talentId) {
|
|
2570
2612
|
const listId = ctx.cache.lists?.talent?.listId;
|
|
2613
|
+
const preferred = await resolveTalentListUrl(ctx.host, ctx.cache, ctx.baseUrl, listId || "");
|
|
2614
|
+
if (preferred) return preferred;
|
|
2571
2615
|
if (!listId) return null;
|
|
2572
2616
|
return `${ctx.baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${listId}`;
|
|
2573
2617
|
}
|
|
@@ -3086,8 +3130,8 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3086
3130
|
talentId: b.talentId,
|
|
3087
3131
|
candidateId: b.candidateId,
|
|
3088
3132
|
talentViewUrl: b.candidateId ? buildTalentViewUrl(ctx.baseUrl, b.candidateId) : null,
|
|
3089
|
-
talentCardUrl: b.talentId ? resolveTalentCardUrl(ctx, b.talentId) : null,
|
|
3090
|
-
talentListLocateUrl: b.talentId ? resolveTalentListLocateUrl(ctx, b.talentId) : null
|
|
3133
|
+
talentCardUrl: b.talentId ? await resolveTalentCardUrl(ctx, b.talentId) : null,
|
|
3134
|
+
talentListLocateUrl: b.talentId ? await resolveTalentListLocateUrl(ctx, b.talentId) : null
|
|
3091
3135
|
};
|
|
3092
3136
|
}
|
|
3093
3137
|
} else {
|
|
@@ -3106,8 +3150,8 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3106
3150
|
formConflicts.existing.push({
|
|
3107
3151
|
talentId: id,
|
|
3108
3152
|
...rec,
|
|
3109
|
-
talentCardUrl: resolveTalentCardUrl(ctx, id),
|
|
3110
|
-
talentListLocateUrl: resolveTalentListLocateUrl(ctx, id),
|
|
3153
|
+
talentCardUrl: await resolveTalentCardUrl(ctx, id),
|
|
3154
|
+
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, id),
|
|
3111
3155
|
recordCardUrl: buildCardUrl(ctx.baseUrl, objId, id)
|
|
3112
3156
|
});
|
|
3113
3157
|
} else formConflicts.unreadable.push(id);
|
|
@@ -3389,8 +3433,8 @@ async function applyCore(args, env, payload) {
|
|
|
3389
3433
|
talentId: updateTalentId,
|
|
3390
3434
|
afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
|
|
3391
3435
|
verifyWarnings: verifyWarnings.length ? verifyWarnings : void 0,
|
|
3392
|
-
talentCardUrl: resolveTalentCardUrl(ctx, updateTalentId),
|
|
3393
|
-
talentListLocateUrl: resolveTalentListLocateUrl(ctx, updateTalentId),
|
|
3436
|
+
talentCardUrl: await resolveTalentCardUrl(ctx, updateTalentId),
|
|
3437
|
+
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, updateTalentId),
|
|
3394
3438
|
parsed: { name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || "(\u7A7A)" }
|
|
3395
3439
|
});
|
|
3396
3440
|
}
|
|
@@ -3489,8 +3533,8 @@ async function applyCore(args, env, payload) {
|
|
|
3489
3533
|
for (const m of verification.mismatches) writeWarnings.push("\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual);
|
|
3490
3534
|
}
|
|
3491
3535
|
const result = detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
|
|
3492
|
-
const talentCardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
3493
|
-
const talentListLocateUrl = resolveTalentListLocateUrl(ctx, talentId);
|
|
3536
|
+
const talentCardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
3537
|
+
const talentListLocateUrl = await resolveTalentListLocateUrl(ctx, talentId);
|
|
3494
3538
|
return rsSuccess("recruit-stage.resume.import.apply", {
|
|
3495
3539
|
mode: "apply",
|
|
3496
3540
|
result,
|
|
@@ -4233,7 +4277,11 @@ async function resolveRequiredHint(plan, ctx) {
|
|
|
4233
4277
|
dataDetails: plan.dataDetails
|
|
4234
4278
|
});
|
|
4235
4279
|
}
|
|
4236
|
-
function resolveTalentCardUrl2(ctx, talentId) {
|
|
4280
|
+
async function resolveTalentCardUrl2(ctx, talentId) {
|
|
4281
|
+
if (talentId) {
|
|
4282
|
+
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
4283
|
+
if (ui) return ui;
|
|
4284
|
+
}
|
|
4237
4285
|
const pid = ctx.cache.ebdDetailPageId;
|
|
4238
4286
|
if (!pid || !talentId) {
|
|
4239
4287
|
const forms = ctx.cache.forms || {};
|
|
@@ -4461,7 +4509,12 @@ async function applyCore2(args, env, payload) {
|
|
|
4461
4509
|
(m) => "\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual + "\uFF08\u8BE5\u5B57\u6BB5\u53EF\u80FD\u672A\u5199\u5165\uFF09"
|
|
4462
4510
|
);
|
|
4463
4511
|
const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
|
|
4464
|
-
const listLocateUrl =
|
|
4512
|
+
const listLocateUrl = await resolveInterviewListUrlOrNative(
|
|
4513
|
+
ctx.host,
|
|
4514
|
+
ctx.cache,
|
|
4515
|
+
ctx.baseUrl,
|
|
4516
|
+
ctx.cache.lists?.interview?.listId || ""
|
|
4517
|
+
);
|
|
4465
4518
|
return rsSuccess("recruit-stage.interview.arrange.apply", {
|
|
4466
4519
|
mode: "apply",
|
|
4467
4520
|
result: verification.mismatches.length ? "partial" : "success",
|
|
@@ -4505,7 +4558,7 @@ async function prefill2(args, env) {
|
|
|
4505
4558
|
}
|
|
4506
4559
|
throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeFull.map).join("/") + "\uFF09");
|
|
4507
4560
|
}
|
|
4508
|
-
const cardUrl = resolveTalentCardUrl2(ctx, talentId);
|
|
4561
|
+
const cardUrl = await resolveTalentCardUrl2(ctx, talentId);
|
|
4509
4562
|
const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
|
|
4510
4563
|
const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}'); if (!i) return 'no-form-instance(\u8BF7\u5148\u5728\u4EBA\u624D\u5361\u7247\u70B9\u300C\u5B89\u6392\u9762\u8BD5\u300D\u6253\u5F00\u9762\u8BD5\u5B89\u6392\u8868\u5355)'; try { i.changeFieldValue('field${typeFid}', { value: '${typeId}' }); return 'ok \u9762\u8BD5\u65B9\u5F0F=${typeKey}'; } catch (e) { return 'err:' + e.message; } })()`;
|
|
4511
4564
|
return rsSuccess("recruit-stage.interview.arrange.prefill", {
|
|
@@ -4,8 +4,10 @@ import {
|
|
|
4
4
|
getHrmOperation,
|
|
5
5
|
hasHrmOperation,
|
|
6
6
|
hrmOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-6QYNE6HE.js";
|
|
8
|
+
import "./chunk-IW7A2IQY.js";
|
|
9
|
+
import "./chunk-5QYE52LG.js";
|
|
10
|
+
import "./chunk-JEQHNNSS.js";
|
|
9
11
|
import "./chunk-56EZERK4.js";
|
|
10
12
|
import "./chunk-UG5G54VL.js";
|
|
11
13
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
hasMeetingOperation,
|
|
6
6
|
meetingOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-D2QRZUW4.js";
|
|
8
|
+
import "./chunk-EJVA5ZVB.js";
|
|
9
|
+
import "./chunk-3NV2ETZR.js";
|
|
10
|
+
import "./chunk-BRRW7CWA.js";
|
|
11
|
+
import "./chunk-ZKEUGS2U.js";
|
|
12
|
+
import "./chunk-GEOMANP7.js";
|
|
13
|
+
import "./chunk-KV5SOWMS.js";
|
|
14
|
+
import "./chunk-3X7VOSBA.js";
|
|
15
|
+
import "./chunk-6GWU63YF.js";
|
|
16
|
+
import "./chunk-K3BT54CU.js";
|
|
17
17
|
import "./chunk-7BDPM5ST.js";
|
|
18
18
|
import "./chunk-UG5G54VL.js";
|
|
19
19
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
loadRooms,
|
|
8
8
|
recommendRooms,
|
|
9
9
|
rememberFrequentRoom
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-KV5SOWMS.js";
|
|
11
|
+
import "./chunk-3X7VOSBA.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";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
resolveMeetingScheduleTypeIds,
|
|
9
9
|
resolveMemberIdsByName,
|
|
10
10
|
runScheduleConflictFlow
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-GEOMANP7.js";
|
|
12
|
+
import "./chunk-3X7VOSBA.js";
|
|
13
|
+
import "./chunk-6GWU63YF.js";
|
|
14
|
+
import "./chunk-K3BT54CU.js";
|
|
15
15
|
import "./chunk-7BDPM5ST.js";
|
|
16
16
|
import "./chunk-UG5G54VL.js";
|
|
17
17
|
import "./chunk-BUSC6UAE.js";
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ var builtinShortcuts = [
|
|
|
50
50
|
lazyShortcut({
|
|
51
51
|
name: "recruit-stage",
|
|
52
52
|
description: "\u6CDB\u5FAEE10\u62DB\u8058\u52A9\u624B\uFF08JD\u751F\u6210/\u7B80\u5386\u5EFA\u6863/AI\u9762\u8BD5\u9080\u7EA6\uFF09CLI",
|
|
53
|
-
load: async () => (await import("./chunks/recruit-stage-
|
|
53
|
+
load: async () => (await import("./chunks/recruit-stage-FKWS5UQF.js")).recruitStageShortcut
|
|
54
54
|
}),
|
|
55
55
|
lazyShortcut({
|
|
56
56
|
name: "cowork",
|
|
@@ -65,7 +65,7 @@ var builtinShortcuts = [
|
|
|
65
65
|
lazyShortcut({
|
|
66
66
|
name: "archive-oa",
|
|
67
67
|
description: "E10 \u6863\u6848\u5B9A\u4F4D\u4E0E OA \u5546\u52A1\u5408\u540C\u501F\u9605 CLI",
|
|
68
|
-
load: async () => (await import("./chunks/archive-oa-
|
|
68
|
+
load: async () => (await import("./chunks/archive-oa-57R2FYHV.js")).archiveOaShortcut
|
|
69
69
|
}),
|
|
70
70
|
lazyShortcut({
|
|
71
71
|
name: "calendar",
|
|
@@ -80,7 +80,7 @@ var builtinShortcuts = [
|
|
|
80
80
|
lazyShortcut({
|
|
81
81
|
name: "hrm",
|
|
82
82
|
description: "\u6CDB\u5FAEE10\u7EC4\u7EC7\u7BA1\u7406\uFF08\u5458\u5DE5/\u7EC4\u7EC7/\u5C97\u4F4D\u67E5\u8BE2\uFF09CLI",
|
|
83
|
-
load: async () => (await import("./chunks/hrm-
|
|
83
|
+
load: async () => (await import("./chunks/hrm-YGIR3HGF.js")).hrmShortcut
|
|
84
84
|
}),
|
|
85
85
|
lazyShortcut({
|
|
86
86
|
name: "mail",
|
|
@@ -90,7 +90,7 @@ var builtinShortcuts = [
|
|
|
90
90
|
lazyShortcut({
|
|
91
91
|
name: "meeting",
|
|
92
92
|
description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
|
|
93
|
-
load: async () => (await import("./chunks/meeting-
|
|
93
|
+
load: async () => (await import("./chunks/meeting-N2FQBHXI.js")).meetingShortcut
|
|
94
94
|
}),
|
|
95
95
|
lazyShortcut({
|
|
96
96
|
name: "okr",
|
|
@@ -110,7 +110,7 @@ var builtinShortcuts = [
|
|
|
110
110
|
lazyShortcut({
|
|
111
111
|
name: "ebuilder-form",
|
|
112
112
|
description: "\u6CDB\u5FAEE10 eBuilder \u8868\u5355\u83DC\u5355\u3001\u5217\u8868\u548C\u8868\u5355\u6570\u636E CLI",
|
|
113
|
-
load: async () => (await import("./chunks/ebuilder-form-
|
|
113
|
+
load: async () => (await import("./chunks/ebuilder-form-CBYI6CQ6.js")).ebuilderFormShortcut
|
|
114
114
|
}),
|
|
115
115
|
lazyShortcut({
|
|
116
116
|
name: "jiuchuanhui",
|
|
@@ -140,7 +140,7 @@ var builtinShortcuts = [
|
|
|
140
140
|
lazyShortcut({
|
|
141
141
|
name: "workflow",
|
|
142
142
|
description: "\u6CDB\u5FAEE10\u6D41\u7A0B\u667A\u80FD\u52A9\u624B CLI\uFF08\u67E5\u8BE2/\u67E5\u770B/\u64CD\u4F5C/\u6279\u91CF/\u53D1\u8D77/\u4FEE\u6539\uFF09",
|
|
143
|
-
load: async () => (await import("./chunks/workflow-
|
|
143
|
+
load: async () => (await import("./chunks/workflow-2TRU2ZSP.js")).workflowShortcut
|
|
144
144
|
}),
|
|
145
145
|
lazyShortcut({
|
|
146
146
|
name: "blog",
|
|
@@ -160,7 +160,12 @@ var builtinShortcuts = [
|
|
|
160
160
|
lazyShortcut({
|
|
161
161
|
name: "reception",
|
|
162
162
|
description: "\u6CDB\u5FAE\u5BA2\u6237\u53C2\u89C2\u63A5\u5F85\u6D41\u7A0B CLI\uFF08\u9762\u677F/\u884C\u7A0B\u5355\u4E0E\u5185\u90E8\u65B9\u6848/\u586B\u5355\u9875\u9884\u586B\uFF09",
|
|
163
|
-
load: async () => (await import("./chunks/reception-
|
|
163
|
+
load: async () => (await import("./chunks/reception-MYOKJULO.js")).receptionShortcut
|
|
164
|
+
}),
|
|
165
|
+
lazyShortcut({
|
|
166
|
+
name: "data",
|
|
167
|
+
description: "\u6CDB\u5FAEE10\u6570\u636E\u52A9\u624B CLI\uFF08\u6570\u636E\u6E90\u67E5\u8BE2 / \u914D\u7F6E\u4E2D\u5FC3 / \u573A\u666F\u5B9A\u4F4D\uFF09",
|
|
168
|
+
load: async () => (await import("./chunks/data-QO7QWOIV.js")).dataShortcut
|
|
164
169
|
})
|
|
165
170
|
];
|
|
166
171
|
function shortcutMetadata() {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { archiveOaValidationError } from '../errors.js';
|
|
2
|
+
import { READ, archiveOaSuccess, schemaOf, } from './types.js';
|
|
3
|
+
import { positiveInt, unwrapData } from './shared.js';
|
|
4
|
+
/** 合同专项模块(`zxfa`)浏览按钮候选值接口。 */
|
|
5
|
+
const MODULE_BROWSER_PATH = '/api/bcw/common/browser/complete/customBrowser_sw_htzxmk';
|
|
6
|
+
/** 合同表单里专项模块控件的 controlId(浏览按钮搜索时必带)。 */
|
|
7
|
+
const MODULE_CONTROL_ID = '3753081';
|
|
8
|
+
export const contractModuleOptionsOperation = {
|
|
9
|
+
name: 'archive-oa.contract.module-options',
|
|
10
|
+
resource: 'contract',
|
|
11
|
+
method: 'module-options',
|
|
12
|
+
action: 'archive-oa.contract.module-options',
|
|
13
|
+
summary: '查询合同专项模块(zxfa)的候选值,用于把「文书定」等模块名转成 inC 需要的对象',
|
|
14
|
+
capability: 'contract',
|
|
15
|
+
risk: READ,
|
|
16
|
+
inputSchema: schemaOf({
|
|
17
|
+
keyword: { type: 'string', description: '关键字,如「文书定」,缺省返回前 N 项' },
|
|
18
|
+
pageSize: { type: 'integer', minimum: 1, maximum: 100, description: '返回条数,缺省 50' },
|
|
19
|
+
}, { description: '查询合同专项模块候选值' }),
|
|
20
|
+
handler: async (args, env) => {
|
|
21
|
+
const keyword = typeof args.keyword === 'string' ? args.keyword.trim() : '';
|
|
22
|
+
const pageSize = positiveInt(args.pageSize, 'pageSize', 50);
|
|
23
|
+
if (pageSize > 100) {
|
|
24
|
+
throw archiveOaValidationError('number_invalid', 'pageSize 最多 100');
|
|
25
|
+
}
|
|
26
|
+
const response = await env.host.request({
|
|
27
|
+
method: 'POST',
|
|
28
|
+
path: MODULE_BROWSER_PATH,
|
|
29
|
+
operation: 'archive-oa.contract.module-options',
|
|
30
|
+
body: {
|
|
31
|
+
browserMultiple: true,
|
|
32
|
+
fromSearch: '1',
|
|
33
|
+
controlId: MODULE_CONTROL_ID,
|
|
34
|
+
formParam: JSON.stringify({ filterItems: [], module: 'ebuilderform', dataDetails: [] }),
|
|
35
|
+
notFromLayout: true,
|
|
36
|
+
newly: 0,
|
|
37
|
+
searchValue: keyword,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const data = unwrapData(response);
|
|
41
|
+
const list = Array.isArray(data?.data) ? data.data : [];
|
|
42
|
+
const options = list
|
|
43
|
+
.map((item) => ({
|
|
44
|
+
id: String(item?.id ?? ''),
|
|
45
|
+
name: String(item?.name ?? ''),
|
|
46
|
+
}))
|
|
47
|
+
.filter((item) => item.id.length > 0 && item.name.length > 0)
|
|
48
|
+
.slice(0, pageSize);
|
|
49
|
+
/** 服务端按 `searchValue` 过滤;这里再兜一层,避免接口忽略关键字时把全部模块当命中。 */
|
|
50
|
+
const matched = keyword ? options.filter((item) => item.name.includes(keyword)) : options;
|
|
51
|
+
return archiveOaSuccess('archive-oa.contract.module-options', {
|
|
52
|
+
keyword,
|
|
53
|
+
total: matched.length,
|
|
54
|
+
options: matched,
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -5,6 +5,10 @@ const CONTRACT_LIST_PATH = '/api/ebuilder/form/list/getListDatas';
|
|
|
5
5
|
function filterPath(profile) {
|
|
6
6
|
return `/api/ebuilder/form/listFilter/showFilters/${profile.listId}`;
|
|
7
7
|
}
|
|
8
|
+
/** 查询列表字段配置(含快速搜索与高级搜索字段),比 showFilters 更全。 */
|
|
9
|
+
function searchFieldsPath(profile) {
|
|
10
|
+
return `/api/ebuilder/form/listSearch/getListSearch/${profile.listId}`;
|
|
11
|
+
}
|
|
8
12
|
function operationName(profile, action) {
|
|
9
13
|
return profile.source === 'qys'
|
|
10
14
|
? `archive-oa.qys.contract.${action}`
|
|
@@ -47,17 +51,27 @@ function makeFieldsOperation(profile) {
|
|
|
47
51
|
handler: async (_args, env) => {
|
|
48
52
|
const response = await env.host.request({
|
|
49
53
|
method: 'GET',
|
|
50
|
-
path:
|
|
54
|
+
path: searchFieldsPath(profile),
|
|
51
55
|
operation: name,
|
|
52
|
-
query: { passid: profile.passId
|
|
56
|
+
query: { passid: profile.passId },
|
|
53
57
|
});
|
|
54
58
|
const data = (unwrapData(response) ?? {});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
/** getListSearch 把字段放在 `layout`(二维:分组 → 字段项),每项含 id / label / groupId。 */
|
|
60
|
+
const layout = Array.isArray(data.layout) ? data.layout : [];
|
|
61
|
+
const groups = Array.isArray(data.groups) ? data.groups : [];
|
|
62
|
+
const groupTitle = new Map(groups.map((group) => [String(group.id), String(group.title ?? '')]));
|
|
63
|
+
const fields = layout.flat().map((item) => {
|
|
64
|
+
const id = String(item?.id ?? '');
|
|
65
|
+
const groupId = String(item?.groupId ?? '');
|
|
66
|
+
return {
|
|
67
|
+
fieldName: id,
|
|
68
|
+
showName: String(item?.label ?? ''),
|
|
69
|
+
groupId,
|
|
70
|
+
groupName: groupTitle.get(groupId) ?? '',
|
|
71
|
+
hidden: item?.hide === true,
|
|
72
|
+
};
|
|
73
|
+
}).filter((item) => item.fieldName.length > 0);
|
|
74
|
+
return archiveOaSuccess(name, { fields }, { source: profile.source, listId: profile.listId, count: fields.length });
|
|
61
75
|
},
|
|
62
76
|
};
|
|
63
77
|
}
|
|
@@ -116,5 +130,6 @@ function makeListOperation(profile) {
|
|
|
116
130
|
};
|
|
117
131
|
}
|
|
118
132
|
export const weaverContractFieldsOperation = makeFieldsOperation(WEAVER_CONTRACT);
|
|
133
|
+
export const qysContractFieldsOperation = makeFieldsOperation(QYS_CONTRACT);
|
|
119
134
|
export const weaverContractListOperation = makeListOperation(WEAVER_CONTRACT);
|
|
120
135
|
export const qysContractListOperation = makeListOperation(QYS_CONTRACT);
|
|
@@ -2,15 +2,18 @@ import { QYS_BORROW_CAR, QYS_ESB_ADD, QYS_ESB_REMOVE, WEAVER_BORROW_CAR, WEAVER_
|
|
|
2
2
|
import { archiveOaValidationError } from '../errors.js';
|
|
3
3
|
import { createBorrowCarOperations } from './borrow-car.js';
|
|
4
4
|
import { createBorrowStartUrlOperation } from './borrow-url.js';
|
|
5
|
-
import { qysContractListOperation, weaverContractFieldsOperation, weaverContractListOperation, } from './contract.js';
|
|
5
|
+
import { qysContractFieldsOperation, qysContractListOperation, weaverContractFieldsOperation, weaverContractListOperation, } from './contract.js';
|
|
6
6
|
import { archiveLocateOperation } from './locate.js';
|
|
7
|
+
import { contractModuleOptionsOperation } from './contract-modules.js';
|
|
7
8
|
import { myBorrowListOperation } from './my-borrow-contract.js';
|
|
8
9
|
function buildRegistry() {
|
|
9
10
|
const registry = new Map();
|
|
10
11
|
const definitions = [
|
|
11
12
|
archiveLocateOperation,
|
|
12
13
|
myBorrowListOperation,
|
|
14
|
+
contractModuleOptionsOperation,
|
|
13
15
|
weaverContractFieldsOperation,
|
|
16
|
+
qysContractFieldsOperation,
|
|
14
17
|
weaverContractListOperation,
|
|
15
18
|
qysContractListOperation,
|
|
16
19
|
...createBorrowCarOperations(WEAVER_BORROW_CAR, WEAVER_ESB_ADD, WEAVER_ESB_REMOVE),
|
|
@@ -127,26 +127,62 @@ export function buildCommonSearchFields(fields, extra = []) {
|
|
|
127
127
|
}
|
|
128
128
|
for (const item of items) {
|
|
129
129
|
const value = normalizeConditionValue(item.conditionType, item.value, item.field);
|
|
130
|
-
|
|
130
|
+
const entry = {
|
|
131
|
+
[`${item.field}_condition_type`]: item.conditionType,
|
|
132
|
+
[item.field]: value,
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* 日期字段的 between 在源资料里是「数组值 + 快捷区间元数据」,
|
|
136
|
+
* 只传 `{min,max}` 服务端匹配不到(表现为恒 0 条),必须补 `_obj` 与 `_selectedKeyPrior`。
|
|
137
|
+
*/
|
|
138
|
+
if (item.conditionType === 'between' && Array.isArray(value)) {
|
|
139
|
+
const [min, max] = value;
|
|
140
|
+
entry[`${item.field}_obj`] = { value, ...dateRangePreset(min, max) };
|
|
141
|
+
entry[`${item.field}_selectedKeyPrior`] = false;
|
|
142
|
+
}
|
|
143
|
+
result[item.field] = [entry];
|
|
131
144
|
}
|
|
132
145
|
return result;
|
|
133
146
|
}
|
|
147
|
+
const DATE_TEXT = /^\d{4}-\d{2}-\d{2}$/u;
|
|
148
|
+
/** 识别常见快捷日期区间(上半年/下半年/今年),识别不到时留空,由服务端按自定义区间处理。 */
|
|
149
|
+
function dateRangePreset(min, max) {
|
|
150
|
+
const year = new Date().getFullYear();
|
|
151
|
+
if (min === `${year}-01-01` && max === `${year}-06-30`) {
|
|
152
|
+
return { selectedKey: 'firstHalfYear', selectedName: '上半年' };
|
|
153
|
+
}
|
|
154
|
+
if (min === `${year}-07-01` && max === `${year}-12-31`) {
|
|
155
|
+
return { selectedKey: 'secondHalfYear', selectedName: '下半年' };
|
|
156
|
+
}
|
|
157
|
+
if (min === `${year}-01-01` && max === `${year}-12-31`) {
|
|
158
|
+
return { selectedKey: 'currentYear', selectedName: '今年' };
|
|
159
|
+
}
|
|
160
|
+
return { selectedKey: '', selectedName: '' };
|
|
161
|
+
}
|
|
134
162
|
function normalizeConditionValue(conditionType, value, field) {
|
|
135
163
|
if (conditionType === 'between') {
|
|
164
|
+
let min;
|
|
165
|
+
let max;
|
|
136
166
|
if (Array.isArray(value)) {
|
|
137
167
|
if (value.length !== 2) {
|
|
138
168
|
throw archiveOaValidationError('search_value_invalid', `${field} 的 between 条件需要两个值`);
|
|
139
169
|
}
|
|
140
|
-
|
|
170
|
+
min = String(value[0]);
|
|
171
|
+
max = String(value[1]);
|
|
141
172
|
}
|
|
142
|
-
if (value && typeof value === 'object') {
|
|
173
|
+
else if (value && typeof value === 'object') {
|
|
143
174
|
const range = value;
|
|
144
175
|
if (range.min === undefined || range.max === undefined) {
|
|
145
176
|
throw archiveOaValidationError('search_value_invalid', `${field} 的 between 条件需要 min / max`);
|
|
146
177
|
}
|
|
147
|
-
|
|
178
|
+
min = String(range.min);
|
|
179
|
+
max = String(range.max);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
throw archiveOaValidationError('search_value_invalid', `${field} 的 between 条件必须是 {min,max} 或 [起,止]`);
|
|
148
183
|
}
|
|
149
|
-
|
|
184
|
+
/** 日期区间按源资料用数组;数值区间(如合同金额)仍用 {min,max}。 */
|
|
185
|
+
return DATE_TEXT.test(min) && DATE_TEXT.test(max) ? [min, max] : { min, max };
|
|
150
186
|
}
|
|
151
187
|
if (conditionType === 'in' || conditionType === 'inC') {
|
|
152
188
|
if (!Array.isArray(value)) {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CliError, ExitCode } from '../../core/errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* data 模块的错误类型。
|
|
4
|
+
*
|
|
5
|
+
* 退出码沿用 e10-data 的既有语义(技能侧按退出码分流,不能改):
|
|
6
|
+
* 0 正常(**空结果也算正常**)|2 未登录·凭据失效|3 非 JSON·confAttrs 异常
|
|
7
|
+
* 4 权限受限(hasSearchRight=false,终端态)|6 命中 HRM 路径黑名单|7 请求失败|8 用法错误
|
|
8
|
+
* 映射到框架的 ExitCode:2→UsageError、3→AuthError、4→PolicyError、6→PolicyError、
|
|
9
|
+
* 7→NetworkError、8→UsageError。**退出码数值本身必须与旧版一致**,因此这里直接使用数值。
|
|
10
|
+
*/
|
|
11
|
+
export const DataExit = {
|
|
12
|
+
OK: 0,
|
|
13
|
+
AUTH: 2,
|
|
14
|
+
JSON: 3,
|
|
15
|
+
PERM: 4,
|
|
16
|
+
HRM: 6,
|
|
17
|
+
HTTP: 7,
|
|
18
|
+
USAGE: 8,
|
|
19
|
+
};
|
|
20
|
+
export class DataCliError extends CliError {
|
|
21
|
+
type;
|
|
22
|
+
subtype;
|
|
23
|
+
code;
|
|
24
|
+
retryable;
|
|
25
|
+
stage;
|
|
26
|
+
details;
|
|
27
|
+
constructor(type, subtype, message, options = {}) {
|
|
28
|
+
super(message, options.exitCode ?? ExitCode.GeneralError);
|
|
29
|
+
this.name = 'DataCliError';
|
|
30
|
+
this.type = type;
|
|
31
|
+
this.subtype = subtype;
|
|
32
|
+
this.code = options.code;
|
|
33
|
+
this.retryable = options.retryable ?? false;
|
|
34
|
+
this.stage = options.stage;
|
|
35
|
+
this.details = options.details;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function dataValidationError(subtype, message, exitCode = DataExit.USAGE) {
|
|
39
|
+
return new DataCliError('validation', subtype, message, { exitCode });
|
|
40
|
+
}
|
|
41
|
+
export function dataAuthError(subtype, message, details) {
|
|
42
|
+
return new DataCliError('authentication', subtype, message, { exitCode: DataExit.AUTH, details });
|
|
43
|
+
}
|
|
44
|
+
export function dataNetworkError(subtype, message, details) {
|
|
45
|
+
return new DataCliError('network', subtype, message, { exitCode: DataExit.HTTP, retryable: true, details });
|
|
46
|
+
}
|
|
47
|
+
export function dataApiError(subtype, message, options = {}) {
|
|
48
|
+
return new DataCliError('api', subtype, message, {
|
|
49
|
+
code: options.code,
|
|
50
|
+
details: options.details,
|
|
51
|
+
exitCode: options.exitCode ?? DataExit.JSON,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function dataPolicyError(subtype, message, details) {
|
|
55
|
+
return new DataCliError('policy', subtype, message, { exitCode: DataExit.PERM, details });
|
|
56
|
+
}
|
|
57
|
+
/** 权限受限是「终端态」:结果照常给,但退出码必须非 0(对齐 call_module.py)。 */
|
|
58
|
+
export function dataPermissionBlocked(message) {
|
|
59
|
+
return new DataCliError('policy', 'permission_restricted', message, { exitCode: DataExit.PERM });
|
|
60
|
+
}
|
|
61
|
+
/** HRM 路径黑名单:人员/部门/岗位一律走 `weaver-work-cli hrm`,禁止在 data 通道直调。 */
|
|
62
|
+
export function dataHrmBlocked(apiPath) {
|
|
63
|
+
return new DataCliError('policy', 'hrm_path_blocked', `该接口命中 HRM 路径黑名单(${apiPath})→ 人员/部门/岗位一律走 weaver-work-cli 的 hrm 子命令,禁止直调`, { exitCode: DataExit.HRM, details: { apiPath } });
|
|
64
|
+
}
|