weaver-work-cli 0.1.38 → 0.1.40
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/README.md +7 -3
- package/dist/chunks/{archive-PDV724YK.js → archive-JHTONRST.js} +556 -66
- package/dist/chunks/{archive-oa-4XE4MNXQ.js → archive-oa-FCHLCPHC.js} +2 -2
- package/dist/chunks/{asset-PDL2QE2N.js → asset-RLIHC7DB.js} +2 -2
- package/dist/chunks/asset-idle-KVOFTLCP.js +670 -0
- package/dist/chunks/{attachment-content-MDDGOE5E.js → attachment-content-RZYDB3MB.js} +3 -3
- package/dist/chunks/{blog-UYR3EUXW.js → blog-42OZTJNP.js} +2 -2
- package/dist/chunks/{caizhilian-LG2X5NMF.js → caizhilian-KRK547K5.js} +2 -2
- package/dist/chunks/{calendar-FG4BAZHE.js → calendar-RTWAMKHD.js} +2 -2
- package/dist/chunks/{chunk-J7USS3ED.js → chunk-4CTESSKI.js} +4 -4
- package/dist/chunks/{chunk-OJQUJZQF.js → chunk-4TEDNCON.js} +45 -5
- package/dist/chunks/chunk-57IECMWX.js +487 -0
- package/dist/chunks/{chunk-ELYDWBZJ.js → chunk-7BRU4EFH.js} +13 -7
- package/dist/chunks/{chunk-6LTFIFLM.js → chunk-7E6MUOEK.js} +2 -2
- package/dist/chunks/{chunk-KKRL3REV.js → chunk-7U577Q7U.js} +2 -2
- package/dist/chunks/{chunk-UJJD4QWF.js → chunk-CAQNBBQA.js} +2 -2
- package/dist/chunks/{chunk-CORFRD7Q.js → chunk-CXRQWOZ5.js} +2 -2
- package/dist/chunks/{chunk-GGJFMNJM.js → chunk-FLS4DPGP.js} +110 -16
- package/dist/chunks/{chunk-JSMFPO43.js → chunk-I566ZYNF.js} +1 -1
- package/dist/chunks/{chunk-6FTTSA45.js → chunk-IZSSVYAG.js} +2 -2
- package/dist/chunks/{chunk-XJY7G4DD.js → chunk-JWRZM2H2.js} +3 -3
- package/dist/chunks/{chunk-NI6GIPIM.js → chunk-LFMSDBZN.js} +529 -395
- package/dist/chunks/{chunk-VRYHGG6O.js → chunk-LN447PY2.js} +92 -51
- package/dist/chunks/{chunk-NR6RKXPA.js → chunk-NETCCARD.js} +4 -2
- package/dist/chunks/{chunk-Z32KWY6G.js → chunk-NJKREDA3.js} +1 -1
- package/dist/chunks/{chunk-FUWVHMVV.js → chunk-SPRHHSVC.js} +2 -2
- package/dist/chunks/{chunk-IZUDA353.js → chunk-T6EGVBKU.js} +1 -1
- package/dist/chunks/{chunk-DMV2TOMH.js → chunk-VNBU55SL.js} +428 -145
- package/dist/chunks/{chunk-UZZBA6PV.js → chunk-WFFNM65B.js} +47 -6
- package/dist/chunks/{chunk-EG6ZU444.js → chunk-ZUX3P6BQ.js} +10 -5
- package/dist/chunks/{conflict-BQZEQ4SP.js → conflict-VR55AOOO.js} +2 -2
- package/dist/chunks/{contract-XIRAFTEV.js → contract-HI4FNPYE.js} +2 -2
- package/dist/chunks/{cowork-BLG62BL2.js → cowork-HJLI353D.js} +12 -5
- package/dist/chunks/{ebuilder-form-NUKG5QW4.js → ebuilder-form-HTGI63UU.js} +3 -3
- package/dist/chunks/{ehr-2STW5ILH.js → ehr-GYXIYH3A.js} +2 -2
- package/dist/chunks/env-DW3G4HUO.js +19 -0
- package/dist/chunks/{esb-UUDQUNKY.js → esb-I5INCEFE.js} +4 -4
- package/dist/chunks/factory-TKXGXS6L.js +30 -0
- package/dist/chunks/{fna-6RCY4NU5.js → fna-K2MHTQ24.js} +2 -2
- package/dist/chunks/group-chat-VYBNMJLG.js +18 -0
- package/dist/chunks/{host-FWDOSRH5.js → host-256GVCAH.js} +3 -3
- package/dist/chunks/{host-EJZFROU3.js → host-D5SERMAJ.js} +3 -3
- package/dist/chunks/{host-RHM3NPXV.js → host-JM4YVHFM.js} +3 -3
- package/dist/chunks/{host-7RXEDMAH.js → host-L3VLITMT.js} +3 -3
- package/dist/chunks/{host-UFF33TWJ.js → host-ZUQTJYYK.js} +3 -3
- package/dist/chunks/{hrm-PKJ6ELSH.js → hrm-VLRBKTZB.js} +3 -3
- package/dist/chunks/{im-YJAXS7CO.js → im-QK3VTLXK.js} +8 -8
- package/dist/chunks/{invoice-HWVSXGX6.js → invoice-T5JTA32H.js} +3 -3
- package/dist/chunks/{jiuchuanhui-L7VKILZB.js → jiuchuanhui-P2FNEQVZ.js} +2 -2
- package/dist/chunks/{lazy-dispatch-NMYEIHRH.js → lazy-dispatch-XRRI46M6.js} +5 -5
- package/dist/chunks/{mail-B42RRU7G.js → mail-3Y7MJ6PS.js} +9 -4
- package/dist/chunks/{meeting-CFYVBJSS.js → meeting-M7LTXGJE.js} +11 -10
- package/dist/chunks/{okr-GCLF6V7W.js → okr-OBC6S67L.js} +2 -2
- package/dist/chunks/{plan-ZVL7GBRI.js → plan-5H6I53SK.js} +2 -2
- package/dist/chunks/{project-4YWAAE2K.js → project-L75QZV4S.js} +2 -2
- package/dist/chunks/{registry-EP4VTHZS.js → registry-KMHCPAAD.js} +9 -8
- package/dist/chunks/{registry-OZSMDVPP.js → registry-QGHFNUWS.js} +2 -2
- package/dist/chunks/{registry-FRJ6H7BT.js → registry-RXPN6BBT.js} +4 -4
- package/dist/chunks/{registry-SG2PGVCF.js → registry-UGRBCBHO.js} +3 -3
- package/dist/chunks/{room-recommend-R3JVUUAC.js → room-recommend-A3UDC3CA.js} +4 -4
- package/dist/chunks/{schedule-NIJBTYDO.js → schedule-5GCACCK7.js} +4 -4
- package/dist/chunks/{workflow-BB24DFBY.js → workflow-M5ZJ7DWF.js} +11 -8
- package/dist/core/output.js +16 -6
- package/dist/index.js +33 -28
- package/dist/internal/e10/auth/commands.js +109 -56
- package/dist/internal/e10/auth/messages.js +1 -0
- package/dist/internal/e10/auth/session.js +11 -1
- package/dist/internal/e10/auth/xiaoe.js +29 -4
- package/dist/internal/e10/auth-recovery.js +13 -6
- package/dist/internal/e10/client.js +13 -0
- package/dist/internal/e10/context.js +24 -3
- package/dist/internal/e10/request-runtime.js +12 -1
- package/dist/shortcuts/archive/host.js +2 -0
- package/dist/shortcuts/archive/manifest.js +1 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +13 -1
- package/dist/shortcuts/archive/operations/flow-url.js +1 -1
- package/dist/shortcuts/archive/operations/prelib.js +472 -0
- package/dist/shortcuts/archive/operations/registry.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -1
- package/dist/shortcuts/asset-idle/errors.js +44 -0
- package/dist/shortcuts/asset-idle/host.js +161 -0
- package/dist/shortcuts/asset-idle/index.js +114 -0
- package/dist/shortcuts/asset-idle/manifest.js +159 -0
- package/dist/shortcuts/asset-idle/operations/idle.js +47 -0
- package/dist/shortcuts/asset-idle/operations/registry.js +33 -0
- package/dist/shortcuts/asset-idle/operations/shared.js +142 -0
- package/dist/shortcuts/asset-idle/operations/types.js +9 -0
- package/dist/shortcuts/asset-idle/operations.js +15 -0
- package/dist/shortcuts/cowork/operations/item-write.js +10 -2
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/mail/operations/mail-send.js +8 -2
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +381 -104
- package/dist/shortcuts/meeting/operations/eb/crm-search.js +87 -5
- package/dist/shortcuts/meeting/operations/eb/flow-memory.js +49 -0
- package/dist/shortcuts/meeting/operations/eb/group-chat.js +583 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +19 -3
- package/dist/shortcuts/meeting/operations/eb/room-summary.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/usage-cache.js +99 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +35 -12
- package/dist/shortcuts/workflow/host.js +3 -0
- package/dist/shortcuts/workflow/index.js +1 -1
- package/dist/shortcuts/workflow/operations/form.js +65 -171
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +129 -27
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +6 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +60 -117
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +44 -7
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +37 -29
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +48 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +22 -18
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +17 -9
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +34 -10
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +5 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +9 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +122 -20
- package/docs/_catalog.md +3 -0
- package/docs/asset-idle.md +45 -0
- package/docs/e10-auth.md +16 -1
- package/docs/todo-smart-convert/subgroup-rules.md +1 -1
- package/package.json +1 -1
- package/scripts/mcp-meeting.mjs +234 -0
- package/scripts/package-skill.mjs +2 -0
- package/skill-template/business-info.json +14 -1
- package/skill-template/domains/asset-idle.md +13 -0
- package/skill-template/domains/wenshuding.md +3 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +1 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +49 -0
- package/skills/weaver-e10-asset-idle/SKILL.md +73 -0
- package/skills/weaver-e10-asset-idle/references/idle-list.md +62 -0
- package/skills/weaver-e10-asset-idle/references/idle-stats-and-charts.md +65 -0
- package/skills/weaver-e10-asset-idle/references/source-manifest.json +193 -0
- package/skills/weaver-e10-asset-idle/references/widget-style.md +205 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +29 -11
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +12 -0
- package/skills/weaver-e10-caizhilian/references/files.md +1 -1
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +1 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +45 -45
- package/skills/weaver-e10-cowork/SKILL.md +2 -0
- package/skills/weaver-e10-cowork/references/cowork-write.md +1 -1
- package/skills/weaver-e10-jucailin/SKILL.md +2 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
- package/skills/weaver-e10-mail/SKILL.md +3 -0
- package/skills/weaver-e10-mail/references/mail-send.md +2 -0
- package/skills/weaver-e10-meeting/SKILL.md +88 -25
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +25 -11
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-shared/SKILL.md +5 -5
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +3 -3
- package/skills/weaver-e10-wenshuding/SKILL.md +29 -6
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +14 -0
- package/skills/weaver-e10-wenshuding/references/archive-download.md +2 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +1 -1
- package/skills/weaver-e10-wenshuding/references/archive-prelib-arrange.md +76 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +107 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +59 -0
- package/skills/weaver-e10-wenshuding/references/archive-upload.md +4 -1
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +108 -65
- package/skills/weaver-e10-workflow/SKILL.md +9 -2
- package/skills/weaver-e10-workflow/aigroup/default.json +166 -19
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +72 -34
- package/skills/weaver-e10-workflow/tools/todo-serve.cjs +113 -25
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +350 -50
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-E7OK5WD5.js} +5 -5
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
cacheScopeSuffix,
|
|
5
5
|
readCache,
|
|
6
6
|
writeCache
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I566ZYNF.js";
|
|
8
8
|
import {
|
|
9
9
|
EB_BASE,
|
|
10
10
|
SCHEMA_DATETIME_MINUTE,
|
|
@@ -13,15 +13,94 @@ import {
|
|
|
13
13
|
meetingSuccess,
|
|
14
14
|
queryBody,
|
|
15
15
|
schemaOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7BRU4EFH.js";
|
|
17
|
+
|
|
18
|
+
// src/shortcuts/meeting/operations/eb/usage-cache.ts
|
|
19
|
+
var USAGE_TTL_MS = 5 * 60 * 1e3;
|
|
20
|
+
var MAX_PAGES = 10;
|
|
21
|
+
var PAGE_SIZE = 200;
|
|
22
|
+
function dayOf(datetime) {
|
|
23
|
+
return String(datetime ?? "").trim().slice(0, 10);
|
|
24
|
+
}
|
|
25
|
+
function usageOverlaps(row, begin, end) {
|
|
26
|
+
return row.start < end && row.end > begin;
|
|
27
|
+
}
|
|
28
|
+
function filterUsages(rows, options) {
|
|
29
|
+
return rows.filter((row) => {
|
|
30
|
+
if (options.roomId && row.roomId !== options.roomId) return false;
|
|
31
|
+
if (options.excludeMtId && row.mtId && row.mtId === options.excludeMtId) return false;
|
|
32
|
+
return usageOverlaps(row, options.begin, options.end);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function busyRoomIds(rows, begin, end) {
|
|
36
|
+
const ids = /* @__PURE__ */ new Set();
|
|
37
|
+
for (const row of rows) {
|
|
38
|
+
if (row.roomId && usageOverlaps(row, begin, end)) ids.add(row.roomId);
|
|
39
|
+
}
|
|
40
|
+
return ids;
|
|
41
|
+
}
|
|
42
|
+
function usageKey(scope, day) {
|
|
43
|
+
return `usage-v1-${scope}-${day}`;
|
|
44
|
+
}
|
|
45
|
+
async function loadDayUsages(env, day, options = {}) {
|
|
46
|
+
const scope = await cacheScopeSuffix(env);
|
|
47
|
+
const key = usageKey(scope, day);
|
|
48
|
+
if (options.refresh !== true) {
|
|
49
|
+
const cached = await readCache(env, key, { ttlMs: USAGE_TTL_MS });
|
|
50
|
+
if (cached) {
|
|
51
|
+
return { rows: cached.data, fromCache: true, ageMs: cached.ageMs, requests: 0 };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const session = await env.host.getSession();
|
|
55
|
+
const rows = [];
|
|
56
|
+
let requests = 0;
|
|
57
|
+
for (let pageNo = 1; pageNo <= MAX_PAGES; pageNo += 1) {
|
|
58
|
+
const response = await env.host.request({
|
|
59
|
+
method: "POST",
|
|
60
|
+
path: `${EB_BASE}/getFormDataList/query_roomusage_list`,
|
|
61
|
+
operation: "meeting.eb.roomUsage.list",
|
|
62
|
+
// 与 fetchBusyRoomIds 同一套算子语义:enddatetime lt 当天末尾、begindatetime gt 当天开头
|
|
63
|
+
query: { enddatetime: `${day} 23:59`, begindatetime: `${day} 00:00` },
|
|
64
|
+
body: queryBody(session.userId, { pageNo, pageSize: PAGE_SIZE }),
|
|
65
|
+
acceptBusiness: ebBusinessSuccess
|
|
66
|
+
});
|
|
67
|
+
requests += 1;
|
|
68
|
+
const { rows: pageRows } = extractEbRows(response);
|
|
69
|
+
for (const row of pageRows) {
|
|
70
|
+
const main = row?.mainTable ?? row ?? {};
|
|
71
|
+
const roomId = String(main.address ?? main.room_id ?? "").trim();
|
|
72
|
+
const start = String(main.startdate ?? "").trim();
|
|
73
|
+
const end = String(main.enddate ?? "").trim();
|
|
74
|
+
if (roomId && start && end) {
|
|
75
|
+
rows.push({ roomId, mtId: String(main.mt_id ?? "").trim(), start, end });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (pageRows.length < PAGE_SIZE) break;
|
|
79
|
+
}
|
|
80
|
+
await writeCache(env, key, rows);
|
|
81
|
+
return { rows, fromCache: false, ageMs: 0, requests };
|
|
82
|
+
}
|
|
83
|
+
async function invalidateDayUsages(env, day) {
|
|
84
|
+
const scope = await cacheScopeSuffix(env);
|
|
85
|
+
await clearCache(env, usageKey(scope, day));
|
|
86
|
+
}
|
|
87
|
+
async function clearCache(env, key) {
|
|
88
|
+
try {
|
|
89
|
+
const { rm } = await import("node:fs/promises");
|
|
90
|
+
const { join } = await import("node:path");
|
|
91
|
+
const { meetingStateDir } = await import("./env-DW3G4HUO.js");
|
|
92
|
+
await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
}
|
|
17
96
|
|
|
18
97
|
// src/shortcuts/meeting/operations/eb/room-recommend.ts
|
|
19
98
|
var ROOMS_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
20
99
|
var STALE_NOTICE_MS = 4 * 60 * 60 * 1e3;
|
|
21
100
|
var FREQUENT_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
22
101
|
var FREQUENT_WINDOW_DAYS = 180;
|
|
23
|
-
var
|
|
24
|
-
var
|
|
102
|
+
var PAGE_SIZE2 = 100;
|
|
103
|
+
var MAX_PAGES2 = 20;
|
|
25
104
|
var STATUS_TEXT = { "0": "\u6B63\u5E38", "1": "\u5C01\u5B58" };
|
|
26
105
|
var ATTR_TEXT = { "0": "\u5B9E\u4F53", "1": "\u865A\u62DF", "2": "\u7EC4\u5408" };
|
|
27
106
|
function toText(value) {
|
|
@@ -47,7 +126,7 @@ async function fetchRoomsPage(env, pageNo) {
|
|
|
47
126
|
method: "POST",
|
|
48
127
|
path: `${EB_BASE}/getFormDataList/query_meeting_room_list`,
|
|
49
128
|
operation: "meeting.eb.room.recommend",
|
|
50
|
-
body: queryBody(session.userId, { pageNo, pageSize:
|
|
129
|
+
body: queryBody(session.userId, { pageNo, pageSize: PAGE_SIZE2 }),
|
|
51
130
|
acceptBusiness: ebBusinessSuccess
|
|
52
131
|
});
|
|
53
132
|
const { rows } = extractEbRows(response);
|
|
@@ -72,7 +151,7 @@ function normalizeRoom(row) {
|
|
|
72
151
|
};
|
|
73
152
|
}
|
|
74
153
|
async function loadRooms(env, options = {}) {
|
|
75
|
-
const key = `rooms-${await cacheScopeSuffix(env)}`;
|
|
154
|
+
const key = `rooms-v2-${await cacheScopeSuffix(env)}`;
|
|
76
155
|
const warnings = [];
|
|
77
156
|
if (!options.refresh) {
|
|
78
157
|
const cached = await readCache(env, key, { ttlMs: ROOMS_TTL_MS });
|
|
@@ -88,11 +167,11 @@ async function loadRooms(env, options = {}) {
|
|
|
88
167
|
}
|
|
89
168
|
const rooms = [];
|
|
90
169
|
let requests = 0;
|
|
91
|
-
for (let pageNo = 1; pageNo <=
|
|
170
|
+
for (let pageNo = 1; pageNo <= MAX_PAGES2; pageNo += 1) {
|
|
92
171
|
const page = await fetchRoomsPage(env, pageNo);
|
|
93
172
|
requests += page.requests;
|
|
94
173
|
rooms.push(...page.rows.map(normalizeRoom).filter((room) => room.id !== ""));
|
|
95
|
-
if (page.rows.length <
|
|
174
|
+
if (page.rows.length < PAGE_SIZE2) break;
|
|
96
175
|
}
|
|
97
176
|
if (rooms.length === 0) {
|
|
98
177
|
warnings.push("\u4F1A\u8BAE\u5BA4\u5217\u8868\u4E3A\u7A7A\uFF08\u6216\u5F53\u524D\u8D26\u53F7\u65E0\u4F1A\u8BAE\u5BA4\u8BFB\u53D6\u6743\u9650\uFF09\u2014\u2014\u65E0\u6CD5\u63A8\u8350\uFF0C\u8BF7\u6539\u4E3A\u624B\u5DE5\u6307\u5B9A\u4F1A\u8BAE\u5BA4");
|
|
@@ -121,11 +200,11 @@ async function loadFrequentRooms(env, options = {}) {
|
|
|
121
200
|
const counts = /* @__PURE__ */ new Map();
|
|
122
201
|
let requests = 0;
|
|
123
202
|
try {
|
|
124
|
-
const { getMeetingOperation } = await import("./registry-
|
|
203
|
+
const { getMeetingOperation } = await import("./registry-KMHCPAAD.js");
|
|
125
204
|
const listOp = getMeetingOperation("meeting.eb.meeting.list");
|
|
126
205
|
for (let pageNo = 1; pageNo <= 5; pageNo += 1) {
|
|
127
206
|
const page = await listOp.handler(
|
|
128
|
-
{ creator: userId, begindatetime: sinceText, pageNo, pageSize:
|
|
207
|
+
{ creator: userId, begindatetime: sinceText, pageNo, pageSize: PAGE_SIZE2 },
|
|
129
208
|
env
|
|
130
209
|
);
|
|
131
210
|
requests += 1;
|
|
@@ -136,7 +215,7 @@ async function loadFrequentRooms(env, options = {}) {
|
|
|
136
215
|
if (!name) continue;
|
|
137
216
|
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
138
217
|
}
|
|
139
|
-
if (rows.length <
|
|
218
|
+
if (rows.length < PAGE_SIZE2) break;
|
|
140
219
|
}
|
|
141
220
|
} catch (error) {
|
|
142
221
|
warnings.push(`\u5E38\u7528\u4F1A\u8BAE\u5BA4\u7EDF\u8BA1\u5931\u8D25\uFF08${String(error?.message ?? error).slice(0, 80)}\uFF09\uFF1A\u672C\u6B21\u6309\u5168\u91CF\u4F1A\u8BAE\u5BA4\u6392\u5E8F\u63A8\u8350`);
|
|
@@ -150,13 +229,13 @@ async function fetchBusyRoomIds(env, begin, end) {
|
|
|
150
229
|
const ids = /* @__PURE__ */ new Set();
|
|
151
230
|
let requests = 0;
|
|
152
231
|
const usageQuery = { enddatetime: end, begindatetime: begin };
|
|
153
|
-
for (let pageNo = 1; pageNo <=
|
|
232
|
+
for (let pageNo = 1; pageNo <= MAX_PAGES2; pageNo += 1) {
|
|
154
233
|
const response = await env.host.request({
|
|
155
234
|
method: "POST",
|
|
156
235
|
path: `${EB_BASE}/getFormDataList/query_roomusage_list`,
|
|
157
236
|
operation: "meeting.eb.room.recommend",
|
|
158
237
|
query: usageQuery,
|
|
159
|
-
body: queryBody(session.userId, { pageNo, pageSize:
|
|
238
|
+
body: queryBody(session.userId, { pageNo, pageSize: PAGE_SIZE2 }),
|
|
160
239
|
acceptBusiness: ebBusinessSuccess
|
|
161
240
|
});
|
|
162
241
|
requests += 1;
|
|
@@ -166,7 +245,7 @@ async function fetchBusyRoomIds(env, begin, end) {
|
|
|
166
245
|
const roomId = toText(main.address ?? main.room_id).trim();
|
|
167
246
|
if (roomId) ids.add(roomId);
|
|
168
247
|
}
|
|
169
|
-
if (rows.length <
|
|
248
|
+
if (rows.length < PAGE_SIZE2) break;
|
|
170
249
|
}
|
|
171
250
|
return { ids, requests };
|
|
172
251
|
}
|
|
@@ -182,7 +261,7 @@ async function recommendRooms(env, input) {
|
|
|
182
261
|
}
|
|
183
262
|
const frequent = await loadFrequentRooms(env, { refresh: input.refreshFrequent === true });
|
|
184
263
|
warnings.push(...frequent.warnings);
|
|
185
|
-
const busy = await fetchBusyRoomIds(env, input.beginDatetime, input.endDatetime);
|
|
264
|
+
const busy = input.dayUsages ? { ids: busyRoomIds(input.dayUsages, input.beginDatetime, input.endDatetime), requests: 0 } : await fetchBusyRoomIds(env, input.beginDatetime, input.endDatetime);
|
|
186
265
|
const frequentRank = /* @__PURE__ */ new Map();
|
|
187
266
|
frequent.order.forEach((item, index) => {
|
|
188
267
|
frequentRank.set(item.name, { rank: index, count: item.count });
|
|
@@ -235,6 +314,15 @@ async function recommendRooms(env, input) {
|
|
|
235
314
|
reasons.push(`\u8BBE\u5907\u542B\u300C${requirement.equipmentsKeyword}\u300D`);
|
|
236
315
|
score += 10;
|
|
237
316
|
}
|
|
317
|
+
if (requirement.hasCustomer === true) {
|
|
318
|
+
const hostText = `${room.roomDesc ?? ""} ${room.name}`;
|
|
319
|
+
const hostHit = hostText.match(/(接待|招待|客户|商务|贵宾|vip|VIP)/u);
|
|
320
|
+
if (hostHit) {
|
|
321
|
+
const desc = String(room.roomDesc ?? "").trim();
|
|
322
|
+
reasons.push(`\u5E26\u5BA2\u6237\u4F18\u5148\uFF1A${desc !== "" ? `\u63CF\u8FF0\u542B\u300C${desc.slice(0, 30)}\u300D` : `\u540D\u79F0\u542B\u300C${hostHit[1]}\u300D`}`);
|
|
323
|
+
score += 35;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
238
326
|
if (isBusy) {
|
|
239
327
|
reasons.push("\u8BE5\u65F6\u6BB5\u5DF2\u88AB\u5360\u7528\uFF08\u6309 includeBusy \u4E00\u5E76\u8FD4\u56DE\uFF09");
|
|
240
328
|
score -= 100;
|
|
@@ -248,6 +336,7 @@ async function recommendRooms(env, input) {
|
|
|
248
336
|
place: room.place,
|
|
249
337
|
equipments: room.equipments,
|
|
250
338
|
roomAttrText: room.roomAttrText,
|
|
339
|
+
...String(room.roomDesc ?? "").trim() !== "" ? { roomDesc: String(room.roomDesc).trim() } : {},
|
|
251
340
|
frequentCount: freq?.count ?? 0,
|
|
252
341
|
score,
|
|
253
342
|
reasons
|
|
@@ -321,6 +410,7 @@ var ebRoomRecommendOperation = {
|
|
|
321
410
|
mrType: { type: "string", description: "\u4F1A\u8BAE\u5BA4\u7C7B\u578B id\uFF08mr_type\uFF09" },
|
|
322
411
|
roomAttr: { type: "string", enum: ["0", "1", "2"], description: "\u4F1A\u8BAE\u5BA4\u5C5E\u6027\uFF1A0 \u5B9E\u4F53 / 1 \u865A\u62DF / 2 \u7EC4\u5408" },
|
|
323
412
|
equipmentsKeyword: { type: "string", description: "\u8BBE\u5907\u5173\u952E\u8BCD\uFF08\u6A21\u7CCA\u5339\u914D equipments\uFF0C\u5982 \u6295\u5F71/\u89C6\u9891\uFF09" },
|
|
413
|
+
hasCustomer: { type: "boolean", description: "\u672C\u6B21\u4F1A\u8BAE\u662F\u5426\u5E26\u5BA2\u6237\uFF1Atrue \u65F6\u4F18\u5148\u63A8\u8350\u63A5\u5F85\u7C7B\u4F1A\u8BAE\u5BA4\uFF08\u63CF\u8FF0/\u540D\u79F0\u542B \u63A5\u5F85/\u62DB\u5F85/\u5BA2\u6237/\u5546\u52A1/\u8D35\u5BBE \u7684\u52A0\u5206\uFF09" },
|
|
324
414
|
topN: { type: "number", description: "\u8FD4\u56DE\u5019\u9009\u6570\u91CF\uFF08\u9ED8\u8BA4 3\uFF0C\u6700\u591A 10\uFF09" },
|
|
325
415
|
refresh: { type: "boolean", description: "true=\u5237\u65B0\u4F1A\u8BAE\u5BA4\u5168\u91CF\u4E0E\u5E38\u7528\u8BB0\u5F55\u7F13\u5B58" },
|
|
326
416
|
includeBusy: { type: "boolean", description: "true=\u628A\u8BE5\u65F6\u6BB5\u5DF2\u88AB\u5360\u7528\u7684\u4F1A\u8BAE\u5BA4\u4E5F\u8FD4\u56DE\uFF08\u6392\u5728\u6700\u540E\uFF0C\u5E26\u8BF4\u660E\uFF09" }
|
|
@@ -360,7 +450,7 @@ async function rememberFrequentRoom(env, roomId) {
|
|
|
360
450
|
const id = String(roomId ?? "").trim();
|
|
361
451
|
if (!id) return false;
|
|
362
452
|
const scope = await cacheScopeSuffix(env);
|
|
363
|
-
const roomsCached = await readCache(env, `rooms-${scope}`, { ttlMs: ROOMS_TTL_MS });
|
|
453
|
+
const roomsCached = await readCache(env, `rooms-v2-${scope}`, { ttlMs: ROOMS_TTL_MS });
|
|
364
454
|
const name = roomsCached?.data?.find((room) => room.id === id)?.name ?? "";
|
|
365
455
|
if (!name) return false;
|
|
366
456
|
const session = await env.host.getSession().catch(() => null);
|
|
@@ -378,6 +468,10 @@ async function rememberFrequentRoom(env, roomId) {
|
|
|
378
468
|
}
|
|
379
469
|
|
|
380
470
|
export {
|
|
471
|
+
dayOf,
|
|
472
|
+
filterUsages,
|
|
473
|
+
loadDayUsages,
|
|
474
|
+
invalidateDayUsages,
|
|
381
475
|
loadRooms,
|
|
382
476
|
loadFrequentRooms,
|
|
383
477
|
recommendRooms,
|
|
@@ -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-NJKREDA3.js";
|
|
6
6
|
|
|
7
7
|
// src/shortcuts/meeting/operations/eb/cache.ts
|
|
8
8
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
createE10RequestRuntime,
|
|
12
12
|
isE10SessionExpiredResponse,
|
|
13
13
|
requireE10Session
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WFFNM65B.js";
|
|
15
15
|
import {
|
|
16
16
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
17
17
|
getActiveProfile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4TEDNCON.js";
|
|
19
19
|
|
|
20
20
|
// src/shortcuts/hrm/host.ts
|
|
21
21
|
function inferProfile(ctx) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
queryBody,
|
|
14
14
|
toIdCsv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7BRU4EFH.js";
|
|
16
16
|
|
|
17
17
|
// src/shortcuts/meeting/operations/eb/conflict.ts
|
|
18
18
|
var ACTIVE_MT_STATUS = "1,2,8,9";
|
|
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
|
|
|
296
296
|
const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
|
|
297
297
|
const nameLike = items.filter((item) => !/^\d+$/u.test(item));
|
|
298
298
|
if (nameLike.length > 0) {
|
|
299
|
-
const { resolveMemberIdsByName } = await import("./schedule-
|
|
299
|
+
const { resolveMemberIdsByName } = await import("./schedule-5GCACCK7.js");
|
|
300
300
|
const idsByName = await resolveMemberIdsByName(env, nameLike);
|
|
301
301
|
const resolved = items.map((item) => idsByName.get(item) ?? item);
|
|
302
302
|
payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
|
|
@@ -610,7 +610,7 @@ async function findCommonFreeSlots(env, input) {
|
|
|
610
610
|
const scheduleItems = [];
|
|
611
611
|
if (includeSchedule) {
|
|
612
612
|
try {
|
|
613
|
-
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-
|
|
613
|
+
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-5GCACCK7.js");
|
|
614
614
|
const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
|
|
615
615
|
const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
|
|
616
616
|
const flow = await runScheduleConflictFlow(env, {
|