weaver-work-cli 0.1.53 → 0.1.56
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-ZQ4A4TV6.js → archive-4SQAVTIB.js} +3 -2
- package/dist/chunks/{archive-oa-57R2FYHV.js → archive-oa-W2UEJ67L.js} +137 -8
- package/dist/chunks/{asset-ZOJVBWZH.js → asset-EGZEABBI.js} +3 -2
- package/dist/chunks/{asset-idle-XGB5IPGT.js → asset-idle-EBUZBB6M.js} +3 -2
- package/dist/chunks/{attachment-content-W3TSJC3Y.js → attachment-content-QGM5MLQE.js} +4 -3
- package/dist/chunks/{blog-QSHLZSFW.js → blog-2YKMWOWI.js} +3 -2
- package/dist/chunks/{caizhilian-KCQYFH72.js → caizhilian-QJ4FLSQJ.js} +5 -4
- package/dist/chunks/{calendar-DLGMRJQA.js → calendar-H4QTJCUY.js} +3 -2
- package/dist/chunks/{chunk-XPQN4E5O.js → chunk-44KJ7WFA.js} +300 -55
- package/dist/chunks/{chunk-CZNZKOHR.js → chunk-4GG72JAT.js} +2 -2
- package/dist/chunks/{chunk-YIKSL36S.js → chunk-5N222HK6.js} +2 -2
- package/dist/chunks/{chunk-6GCXWKG6.js → chunk-6DVL5IN5.js} +4 -1
- package/dist/chunks/{chunk-WTLQGS6D.js → chunk-6MS3RLPO.js} +5 -334
- package/dist/chunks/{chunk-Z4G7LLDD.js → chunk-7EBV7Q3R.js} +124 -27
- package/dist/chunks/{chunk-76PRVYH4.js → chunk-AHJZIMCX.js} +1 -1
- package/dist/chunks/{chunk-TGAGQV4I.js → chunk-CQ4OVCKG.js} +2 -2
- package/dist/chunks/{chunk-2BQESR2U.js → chunk-DVR2EDUU.js} +99 -34
- package/dist/chunks/{chunk-QQXMHM3J.js → chunk-FDAJC7R4.js} +4 -4
- package/dist/chunks/{chunk-GR76ZDDX.js → chunk-FMNCSYIG.js} +2 -2
- package/dist/chunks/{chunk-IF33CG4V.js → chunk-L2LMBFG5.js} +1 -1
- package/dist/chunks/{chunk-DLY5GUXX.js → chunk-PH7N4UFT.js} +1 -1
- package/dist/chunks/{chunk-U6R6FZHD.js → chunk-SFM3M2L3.js} +286 -93
- package/dist/chunks/chunk-SHYQUBY3.js +48 -0
- package/dist/chunks/{chunk-HFXK54M4.js → chunk-TGM7BWEH.js} +2 -2
- package/dist/chunks/{chunk-2J3XY4ED.js → chunk-TJUAGZU7.js} +11 -11
- package/dist/chunks/{chunk-PE334WL3.js → chunk-UI66EMOR.js} +4 -4
- package/dist/chunks/{chunk-762M5XJS.js → chunk-VMCCRWFO.js} +2 -2
- package/dist/chunks/{chunk-U7ROML5E.js → chunk-WHJIUKJW.js} +681 -48
- package/dist/chunks/{chunk-PGO4ILMQ.js → chunk-WMB3SMXI.js} +1 -1
- package/dist/chunks/chunk-WMRNO6IU.js +337 -0
- package/dist/chunks/{chunk-6NXT4ICB.js → chunk-WVH5ESDA.js} +1 -1
- package/dist/chunks/{chunk-DEHJ7PMA.js → chunk-XU3FL3AW.js} +4 -4
- package/dist/chunks/{chunk-Z6UUBY37.js → chunk-Z4IPY5GV.js} +2 -2
- package/dist/chunks/{conflict-57WDJWL7.js → conflict-VAFFPUY3.js} +2 -2
- package/dist/chunks/{contract-LJRAXVZU.js → contract-LLRKMLQQ.js} +2655 -1319
- package/dist/chunks/{cowork-3ACICHDQ.js → cowork-2RDFBZWB.js} +3 -2
- package/dist/chunks/{create-flow-3FMMZBCA.js → create-flow-TVYE3IOH.js} +6 -6
- package/dist/chunks/{data-WK5CQXNF.js → data-WVICO3DT.js} +57 -11
- package/dist/chunks/{ebuilder-form-CBYI6CQ6.js → ebuilder-form-TWSXS5NA.js} +7 -6
- package/dist/chunks/{ehr-XI4BIVR2.js → ehr-52GBKNJR.js} +3 -2
- package/dist/chunks/{env-JYZE3BZB.js → env-BVVFIN4P.js} +2 -2
- package/dist/chunks/{esb-4BQHNP5C.js → esb-HJSXCEOM.js} +5 -4
- package/dist/chunks/{factory-66SCIKW3.js → factory-RCQ36LLE.js} +1 -1
- package/dist/chunks/{fna-ECOYBQYL.js → fna-OBACRT3J.js} +72 -3
- package/dist/chunks/{group-chat-MNRYMLNG.js → group-chat-YFZDUUY3.js} +3 -3
- package/dist/chunks/{host-TUOIOEMC.js → host-2BKMPWDH.js} +4 -3
- package/dist/chunks/{host-3TNBMDTR.js → host-KJT3G5D2.js} +4 -3
- package/dist/chunks/{host-7OWWPLM4.js → host-KOWUMNAY.js} +4 -3
- package/dist/chunks/{host-M4XP5URR.js → host-MFXRA2MY.js} +4 -3
- package/dist/chunks/{host-7NTIBSPK.js → host-TTSGY5NZ.js} +4 -3
- package/dist/chunks/{host-G3VU7SDW.js → host-W4JCNRFS.js} +4 -3
- package/dist/chunks/{hrm-YGIR3HGF.js → hrm-AK3WGBMN.js} +4 -3
- package/dist/chunks/{im-TN2JYVGJ.js → im-JZSBPO4Z.js} +4 -3
- package/dist/chunks/{invoice-V7ZTITUO.js → invoice-V6KD4TZE.js} +4 -3
- package/dist/chunks/{jiuchuanhui-ASFZBMPU.js → jiuchuanhui-K4EQU6GK.js} +3 -2
- package/dist/chunks/{lazy-dispatch-XSAHDK6Z.js → lazy-dispatch-JHGFCKJN.js} +5 -4
- package/dist/chunks/{mail-M3HJF5ER.js → mail-IKVCQCVZ.js} +3 -2
- package/dist/chunks/{meeting-IIY4UAJL.js → meeting-JOHV4RH3.js} +14 -12
- package/dist/chunks/minute-doc-JLS4KMFZ.js +156 -0
- package/dist/chunks/{okr-EVX7FB5G.js → okr-KV43FPPX.js} +3 -2
- package/dist/chunks/{operations-J7PUIVWZ.js → operations-ZPWBMYKE.js} +5 -4
- package/dist/chunks/{plan-2QJQEPBO.js → plan-WOYR4WEG.js} +3 -2
- package/dist/chunks/{project-XELELW2T.js → project-CQJKBUIL.js} +3 -2
- package/dist/chunks/{reception-QGPNTGHG.js → reception-MPBU3JXC.js} +3 -2
- package/dist/chunks/{recruit-stage-XCMVEQA2.js → recruit-stage-USTTRHOX.js} +3 -2
- package/dist/chunks/{registry-CJOVECZD.js → registry-GURQG4ZV.js} +3 -2
- package/dist/chunks/{registry-METZ2LWE.js → registry-LITYOH2W.js} +12 -10
- package/dist/chunks/{registry-QJCZ2GVG.js → registry-SS5J2FZQ.js} +5 -4
- package/dist/chunks/{room-recommend-YFY7HTOF.js → room-recommend-62MECG4J.js} +4 -4
- package/dist/chunks/{schedule-6I63TERA.js → schedule-6QRXIBGU.js} +4 -4
- package/dist/chunks/{smart-extract-FOUYNIG3.js → smart-extract-APX2PNIN.js} +3 -2
- package/dist/chunks/{workflow-YHXFIU63.js → workflow-WMPW3WSB.js} +5 -4
- package/dist/index.js +33 -32
- package/dist/internal/e10/auth/agent-host-key.js +68 -0
- package/dist/internal/e10/auth/agent-hosts.js +250 -0
- package/dist/internal/e10/auth/commands.js +99 -30
- package/dist/internal/e10/auth/paths.js +9 -0
- package/dist/internal/e10/auth/session.js +17 -0
- package/dist/internal/e10/auth/xiaoe.js +37 -3
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +106 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +38 -4
- package/dist/shortcuts/archive-oa/operations/registry.js +2 -1
- package/dist/shortcuts/contract/index.js +6 -7
- package/dist/shortcuts/contract/manifest.js +101 -24
- package/dist/shortcuts/contract/ooxml/docx-table.js +75 -3
- package/dist/shortcuts/contract/ooxml/xlsx.js +49 -13
- package/dist/shortcuts/contract/operations/card-action.js +113 -12
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +29 -7
- package/dist/shortcuts/contract/operations/card-plan.js +75 -9
- package/dist/shortcuts/contract/operations/card-risk-report.js +2 -2
- package/dist/shortcuts/contract/operations/card.js +1 -1
- package/dist/shortcuts/contract/operations/clause-library.js +88 -16
- package/dist/shortcuts/contract/operations/compare-screen.js +378 -0
- package/dist/shortcuts/contract/operations/compare.js +1 -1
- package/dist/shortcuts/contract/operations/credit-page.js +1 -1
- package/dist/shortcuts/contract/operations/docx-slots.js +1000 -0
- package/dist/shortcuts/contract/operations/flow.js +2 -2
- package/dist/shortcuts/contract/operations/quote-to-contract.js +495 -0
- package/dist/shortcuts/contract/operations/quote.js +2 -229
- package/dist/shortcuts/contract/operations/recommend.js +1 -1
- package/dist/shortcuts/contract/operations/registry.js +6 -2
- package/dist/shortcuts/contract/operations/review.js +230 -4
- package/dist/shortcuts/contract/operations/save-recognize.js +122 -3
- package/dist/shortcuts/contract/operations/template.js +11 -10
- package/dist/shortcuts/data/operations/ds.js +5 -5
- package/dist/shortcuts/data/operations/shared.js +76 -4
- package/dist/shortcuts/fna/manifest.js +7 -2
- package/dist/shortcuts/fna/operations/budget.js +68 -0
- package/dist/shortcuts/meeting/minute-doc.js +153 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +176 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +47 -0
- package/dist/shortcuts/meeting/operations/eb/decision-task-batch.js +144 -0
- package/dist/shortcuts/meeting/operations/eb/decision.js +92 -4
- package/dist/shortcuts/meeting/operations/eb/index.js +133 -4
- package/dist/shortcuts/meeting/operations/eb/meeting-link.js +90 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +46 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +61 -0
- package/dist/shortcuts/meeting/operations/registry.js +14 -1
- package/dist/shortcuts/meeting/operations/self-check.js +49 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +114 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +72 -46
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +41 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +46 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +18 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroupAdd.js +51 -0
- package/docs/e10-auth.md +78 -0
- package/docs/fna.md +8 -3
- package/package.json +4 -2
- package/scripts/pack-offline.mjs +228 -0
- package/scripts/package-skill.mjs +14 -5
- package/skill-template/business-info.json +3 -0
- package/skill-template/domains/qiyecheng.md +4 -3
- package/skills/weaver-e10-archive-oa/SKILL.md +6 -1
- package/skills/weaver-e10-archive-oa/references/contract-search.md +91 -4
- package/skills/weaver-e10-jinchengda/SKILL.md +100 -81
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +11 -6
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +38 -12
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +20 -6
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +8 -3
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +56 -13
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +11 -5
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +38 -7
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +13 -25
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +8 -6
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +26 -18
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -13
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +5 -3
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +105 -49
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +3 -6
- package/skills/weaver-e10-meeting/SKILL.md +48 -9
- package/skills/weaver-e10-qiyecheng/SKILL.md +16 -7
- package/skills/weaver-e10-qiyecheng/references/budget.md +77 -3
- package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -4
- package/skills/weaver-e10-qiyecheng/references/getEnabledTemplate-api.md +255 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +70 -25
- package/skills/weaver-e10-workflow/SKILL.md +54 -40
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +134 -0
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +102 -80
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +23 -13
- package/skills/weaver-e10-workflow/references/workflow-query.md +68 -46
- package/skills/weaver-e10-workflow/references/workflow-view.md +21 -13
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +317 -332
- package/dist/shortcuts/contract/ooxml/docx.js +0 -295
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +0 -532
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +0 -178
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +0 -1270
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +0 -998
- package/skills/weaver-e10-workflow/tools/todo-serve.cjs +0 -327
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/shortcuts/meeting/invitation/docx.ts
|
|
5
|
+
import { deflateRawSync, inflateRawSync } from "node:zlib";
|
|
6
|
+
var EOCD_SIG = 101010256;
|
|
7
|
+
var CEN_SIG = 33639248;
|
|
8
|
+
var LOC_SIG = 67324752;
|
|
9
|
+
function findEocd(buf) {
|
|
10
|
+
const min = Math.max(0, buf.length - 65535 - 22);
|
|
11
|
+
for (let i = buf.length - 22; i >= min; i -= 1) {
|
|
12
|
+
if (buf.readUInt32LE(i) === EOCD_SIG) return i;
|
|
13
|
+
}
|
|
14
|
+
throw new Error("docx \u89E3\u6790\u5931\u8D25\uFF1A\u627E\u4E0D\u5230 ZIP \u7ED3\u675F\u8BB0\u5F55\uFF08EOCD\uFF09");
|
|
15
|
+
}
|
|
16
|
+
function readDocxEntries(buf) {
|
|
17
|
+
const eocd = findEocd(buf);
|
|
18
|
+
const count = buf.readUInt16LE(eocd + 10);
|
|
19
|
+
let offset = buf.readUInt32LE(eocd + 16);
|
|
20
|
+
const entries = [];
|
|
21
|
+
for (let i = 0; i < count; i += 1) {
|
|
22
|
+
if (buf.readUInt32LE(offset) !== CEN_SIG) {
|
|
23
|
+
throw new Error("docx \u89E3\u6790\u5931\u8D25\uFF1A\u4E2D\u592E\u76EE\u5F55\u6761\u76EE\u7B7E\u540D\u4E0D\u5339\u914D");
|
|
24
|
+
}
|
|
25
|
+
const method = buf.readUInt16LE(offset + 10);
|
|
26
|
+
const compSize = buf.readUInt32LE(offset + 20);
|
|
27
|
+
const nameLen = buf.readUInt16LE(offset + 28);
|
|
28
|
+
const extraLen = buf.readUInt16LE(offset + 30);
|
|
29
|
+
const commentLen = buf.readUInt16LE(offset + 32);
|
|
30
|
+
const localOffset = buf.readUInt32LE(offset + 42);
|
|
31
|
+
const name = buf.subarray(offset + 46, offset + 46 + nameLen).toString("utf8");
|
|
32
|
+
if (buf.readUInt32LE(localOffset) !== LOC_SIG) {
|
|
33
|
+
throw new Error(`docx \u89E3\u6790\u5931\u8D25\uFF1A${name} \u7684\u672C\u5730\u5934\u7B7E\u540D\u4E0D\u5339\u914D`);
|
|
34
|
+
}
|
|
35
|
+
const localNameLen = buf.readUInt16LE(localOffset + 26);
|
|
36
|
+
const localExtraLen = buf.readUInt16LE(localOffset + 28);
|
|
37
|
+
const dataStart = localOffset + 30 + localNameLen + localExtraLen;
|
|
38
|
+
const raw = buf.subarray(dataStart, dataStart + compSize);
|
|
39
|
+
const data = method === 0 ? Buffer.from(raw) : inflateRawSync(raw);
|
|
40
|
+
entries.push({ name, data });
|
|
41
|
+
offset += 46 + nameLen + extraLen + commentLen;
|
|
42
|
+
}
|
|
43
|
+
return entries;
|
|
44
|
+
}
|
|
45
|
+
var CRC_TABLE = (() => {
|
|
46
|
+
const table = new Int32Array(256);
|
|
47
|
+
for (let i = 0; i < 256; i += 1) {
|
|
48
|
+
let c = i;
|
|
49
|
+
for (let k = 0; k < 8; k += 1) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
50
|
+
table[i] = c;
|
|
51
|
+
}
|
|
52
|
+
return table;
|
|
53
|
+
})();
|
|
54
|
+
function crc32(buf) {
|
|
55
|
+
let crc = -1;
|
|
56
|
+
for (let i = 0; i < buf.length; i += 1) crc = CRC_TABLE[(crc ^ buf[i]) & 255] ^ crc >>> 8;
|
|
57
|
+
return (crc ^ -1) >>> 0;
|
|
58
|
+
}
|
|
59
|
+
function dosDateTime(date) {
|
|
60
|
+
const time = (date.getHours() << 11 | date.getMinutes() << 5 | date.getSeconds() >> 1) & 65535;
|
|
61
|
+
const d = (date.getFullYear() - 1980 << 9 | date.getMonth() + 1 << 5 | date.getDate()) & 65535;
|
|
62
|
+
return { time, date: d };
|
|
63
|
+
}
|
|
64
|
+
function writeDocxEntries(entries, now = /* @__PURE__ */ new Date()) {
|
|
65
|
+
const { time, date } = dosDateTime(now);
|
|
66
|
+
const locals = [];
|
|
67
|
+
const centrals = [];
|
|
68
|
+
let offset = 0;
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
const nameBuf = Buffer.from(entry.name, "utf8");
|
|
71
|
+
const crc = crc32(entry.data);
|
|
72
|
+
const deflated = deflateRawSync(entry.data);
|
|
73
|
+
const useDeflate = deflated.length < entry.data.length;
|
|
74
|
+
const payload = useDeflate ? deflated : entry.data;
|
|
75
|
+
const method = useDeflate ? 8 : 0;
|
|
76
|
+
const local = Buffer.alloc(30);
|
|
77
|
+
local.writeUInt32LE(LOC_SIG, 0);
|
|
78
|
+
local.writeUInt16LE(20, 4);
|
|
79
|
+
local.writeUInt16LE(2048, 6);
|
|
80
|
+
local.writeUInt16LE(method, 8);
|
|
81
|
+
local.writeUInt16LE(time, 10);
|
|
82
|
+
local.writeUInt16LE(date, 12);
|
|
83
|
+
local.writeUInt32LE(crc, 14);
|
|
84
|
+
local.writeUInt32LE(payload.length, 18);
|
|
85
|
+
local.writeUInt32LE(entry.data.length, 22);
|
|
86
|
+
local.writeUInt16LE(nameBuf.length, 26);
|
|
87
|
+
local.writeUInt16LE(0, 28);
|
|
88
|
+
const central = Buffer.alloc(46);
|
|
89
|
+
central.writeUInt32LE(CEN_SIG, 0);
|
|
90
|
+
central.writeUInt16LE(20, 4);
|
|
91
|
+
central.writeUInt16LE(20, 6);
|
|
92
|
+
central.writeUInt16LE(2048, 8);
|
|
93
|
+
central.writeUInt16LE(method, 10);
|
|
94
|
+
central.writeUInt16LE(time, 12);
|
|
95
|
+
central.writeUInt16LE(date, 14);
|
|
96
|
+
central.writeUInt32LE(crc, 16);
|
|
97
|
+
central.writeUInt32LE(payload.length, 20);
|
|
98
|
+
central.writeUInt32LE(entry.data.length, 24);
|
|
99
|
+
central.writeUInt16LE(nameBuf.length, 28);
|
|
100
|
+
central.writeUInt16LE(0, 30);
|
|
101
|
+
central.writeUInt16LE(0, 32);
|
|
102
|
+
central.writeUInt16LE(0, 34);
|
|
103
|
+
central.writeUInt16LE(0, 36);
|
|
104
|
+
central.writeUInt32LE(0, 38);
|
|
105
|
+
central.writeUInt32LE(offset, 42);
|
|
106
|
+
locals.push(local, nameBuf, payload);
|
|
107
|
+
centrals.push(central, nameBuf);
|
|
108
|
+
offset += local.length + nameBuf.length + payload.length;
|
|
109
|
+
}
|
|
110
|
+
const centralBuf = Buffer.concat(centrals);
|
|
111
|
+
const eocd = Buffer.alloc(22);
|
|
112
|
+
eocd.writeUInt32LE(EOCD_SIG, 0);
|
|
113
|
+
eocd.writeUInt16LE(0, 4);
|
|
114
|
+
eocd.writeUInt16LE(0, 6);
|
|
115
|
+
eocd.writeUInt16LE(entries.length, 8);
|
|
116
|
+
eocd.writeUInt16LE(entries.length, 10);
|
|
117
|
+
eocd.writeUInt32LE(centralBuf.length, 12);
|
|
118
|
+
eocd.writeUInt32LE(offset, 16);
|
|
119
|
+
eocd.writeUInt16LE(0, 20);
|
|
120
|
+
return Buffer.concat([...locals, centralBuf, eocd]);
|
|
121
|
+
}
|
|
122
|
+
var PENDING_MARK = "\u3010\u5F85\u8865\u5145\u3011";
|
|
123
|
+
function unescapeXml(text) {
|
|
124
|
+
return text.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
125
|
+
}
|
|
126
|
+
function escapeXml(text) {
|
|
127
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
128
|
+
}
|
|
129
|
+
var PLACEHOLDER_RE = /\{([A-Za-z_][A-Za-z0-9_.]*)\}/g;
|
|
130
|
+
var PLACEHOLDER_TEST = /\{[A-Za-z_][A-Za-z0-9_.]*\}/;
|
|
131
|
+
var UNSAFE_PARAGRAPH_RE = /<w:(drawing|pict|hyperlink|fldSimple|sdt|object|txbxContent)\b/;
|
|
132
|
+
function splitParagraph(paraXml) {
|
|
133
|
+
const openMatch = /^<w:p(?:\s[^>]*)?>/.exec(paraXml);
|
|
134
|
+
const open = openMatch ? openMatch[0] : "<w:p>";
|
|
135
|
+
let body = paraXml.slice(open.length).replace(/<\/w:p>\s*$/, "");
|
|
136
|
+
let pPr = "";
|
|
137
|
+
const pPrMatch = /^<w:pPr>[\s\S]*?<\/w:pPr>/.exec(body);
|
|
138
|
+
if (pPrMatch) {
|
|
139
|
+
pPr = pPrMatch[0];
|
|
140
|
+
body = body.slice(pPr.length);
|
|
141
|
+
}
|
|
142
|
+
return { open, pPr, body };
|
|
143
|
+
}
|
|
144
|
+
function parseRuns(body) {
|
|
145
|
+
const runs = [];
|
|
146
|
+
const runRe = /<w:r(?:\s[^>]*)?>([\s\S]*?)<\/w:r>/g;
|
|
147
|
+
let match;
|
|
148
|
+
while ((match = runRe.exec(body)) !== null) {
|
|
149
|
+
const inner = match[1];
|
|
150
|
+
const rPrMatch = /<w:rPr>[\s\S]*?<\/w:rPr>/.exec(inner);
|
|
151
|
+
const rPr = rPrMatch ? rPrMatch[0] : "";
|
|
152
|
+
let text = "";
|
|
153
|
+
const tRe = /<w:t(?:\s[^>]*)?>([\s\S]*?)<\/w:t>/g;
|
|
154
|
+
let tMatch;
|
|
155
|
+
while ((tMatch = tRe.exec(inner)) !== null) text += unescapeXml(tMatch[1]);
|
|
156
|
+
runs.push({ rPr, text });
|
|
157
|
+
}
|
|
158
|
+
return runs;
|
|
159
|
+
}
|
|
160
|
+
function withHighlight(rPr) {
|
|
161
|
+
const highlight = '<w:highlight w:val="yellow"/>';
|
|
162
|
+
if (!rPr) return `<w:rPr>${highlight}</w:rPr>`;
|
|
163
|
+
if (rPr.includes("<w:highlight")) return rPr;
|
|
164
|
+
return rPr.replace(/<\/w:rPr>$/, `${highlight}</w:rPr>`);
|
|
165
|
+
}
|
|
166
|
+
function emitRun(rPr, text) {
|
|
167
|
+
return `<w:r>${rPr}<w:t xml:space="preserve">${escapeXml(text)}</w:t></w:r>`;
|
|
168
|
+
}
|
|
169
|
+
function replaceInParagraph(paraXml, resolver, filled, pending) {
|
|
170
|
+
if (!paraXml.includes("{")) return null;
|
|
171
|
+
const { open, pPr, body } = splitParagraph(paraXml);
|
|
172
|
+
const runs = parseRuns(body);
|
|
173
|
+
if (runs.length === 0) return null;
|
|
174
|
+
const concat = runs.map((run) => run.text).join("");
|
|
175
|
+
if (!PLACEHOLDER_TEST.test(concat)) return null;
|
|
176
|
+
if (UNSAFE_PARAGRAPH_RE.test(paraXml)) return "unsafe";
|
|
177
|
+
PLACEHOLDER_RE.lastIndex = 0;
|
|
178
|
+
const matches = [...concat.matchAll(PLACEHOLDER_RE)];
|
|
179
|
+
if (matches.length === 0) return null;
|
|
180
|
+
const spans = [];
|
|
181
|
+
let cursor = 0;
|
|
182
|
+
for (const run of runs) {
|
|
183
|
+
spans.push({ start: cursor, end: cursor + run.text.length });
|
|
184
|
+
cursor += run.text.length;
|
|
185
|
+
}
|
|
186
|
+
const runAt = (pos) => {
|
|
187
|
+
for (let i = 0; i < spans.length; i += 1) if (pos >= spans[i].start && pos < spans[i].end) return i;
|
|
188
|
+
return spans.length - 1;
|
|
189
|
+
};
|
|
190
|
+
const units = [];
|
|
191
|
+
runs.forEach((run, index) => {
|
|
192
|
+
for (const ch of run.text) units.push({ ch, run: index, highlight: false });
|
|
193
|
+
});
|
|
194
|
+
for (const match of [...matches].reverse()) {
|
|
195
|
+
const key = match[1];
|
|
196
|
+
const start = match.index ?? 0;
|
|
197
|
+
const end = start + match[0].length;
|
|
198
|
+
const value = resolver(key);
|
|
199
|
+
const text = value.pending ? PENDING_MARK : value.text;
|
|
200
|
+
(value.pending ? pending : filled).push(key);
|
|
201
|
+
const firstRun = runAt(start);
|
|
202
|
+
const replacement = [...text].map((ch) => ({ ch, run: firstRun, highlight: Boolean(value.pending) }));
|
|
203
|
+
units.splice(start, end - start, ...replacement);
|
|
204
|
+
}
|
|
205
|
+
const merged = [];
|
|
206
|
+
for (const unit of units) {
|
|
207
|
+
const rPr = runs[unit.run]?.rPr ?? "";
|
|
208
|
+
const last = merged[merged.length - 1];
|
|
209
|
+
if (last && last.rPr === rPr && last.highlight === unit.highlight) last.text += unit.ch;
|
|
210
|
+
else merged.push({ text: unit.ch, rPr, highlight: unit.highlight });
|
|
211
|
+
}
|
|
212
|
+
const rendered = merged.map((run) => emitRun(run.highlight ? withHighlight(run.rPr) : run.rPr, run.text)).join("");
|
|
213
|
+
return `${open}${pPr}${rendered}</w:p>`;
|
|
214
|
+
}
|
|
215
|
+
function replacePlaceholdersInXml(xml, resolver) {
|
|
216
|
+
const filled = [];
|
|
217
|
+
const pending = [];
|
|
218
|
+
let skippedParagraphs = 0;
|
|
219
|
+
const output = xml.replace(/<w:p(?:\s[^>]*)?>[\s\S]*?<\/w:p>/g, (paraXml) => {
|
|
220
|
+
if (!paraXml.includes("{")) return paraXml;
|
|
221
|
+
const replaced = replaceInParagraph(paraXml, resolver, filled, pending);
|
|
222
|
+
if (replaced === "unsafe") {
|
|
223
|
+
skippedParagraphs += 1;
|
|
224
|
+
return paraXml;
|
|
225
|
+
}
|
|
226
|
+
if (replaced === null) return paraXml;
|
|
227
|
+
return replaced;
|
|
228
|
+
});
|
|
229
|
+
return {
|
|
230
|
+
xml: output,
|
|
231
|
+
filled: [...new Set(filled)],
|
|
232
|
+
pending: [...new Set(pending)],
|
|
233
|
+
skippedParagraphs
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
var TR_RE = /<w:tr(?:\s[^>]*)?>[\s\S]*?<\/w:tr>/g;
|
|
237
|
+
var TC_RE = /<w:tc(?:\s[^>]*)?>[\s\S]*?<\/w:tc>/g;
|
|
238
|
+
var WT_RE = /<w:t(?:\s[^>]*)?>([^<]*)<\/w:t>/g;
|
|
239
|
+
function cellText(tc) {
|
|
240
|
+
return [...tc.matchAll(WT_RE)].map((match) => unescapeXml(match[1])).join("");
|
|
241
|
+
}
|
|
242
|
+
function setCellText(tc, text) {
|
|
243
|
+
const tcOpen = /^<w:tc(?:\s[^>]*)?>/.exec(tc)?.[0] ?? "<w:tc>";
|
|
244
|
+
const tcPr = /<w:tcPr>[\s\S]*?<\/w:tcPr>/.exec(tc)?.[0] ?? "";
|
|
245
|
+
const paragraphs = tc.match(/<w:p(?:\s[^>]*)?>[\s\S]*?<\/w:p>/g) ?? [];
|
|
246
|
+
const firstParagraph = paragraphs[0] ?? "<w:p></w:p>";
|
|
247
|
+
const pOpen = /^<w:p(?:\s[^>]*)?>/.exec(firstParagraph)?.[0] ?? "<w:p>";
|
|
248
|
+
const pPr = /<w:pPr>[\s\S]*?<\/w:pPr>/.exec(firstParagraph)?.[0] ?? "";
|
|
249
|
+
const firstRun = /<w:r(?:\s[^>]*)?>[\s\S]*?<\/w:r>/.exec(firstParagraph)?.[0] ?? "";
|
|
250
|
+
const rPr = /<w:rPr>[\s\S]*?<\/w:rPr>/.exec(firstRun)?.[0] ?? /<w:rPr>[\s\S]*?<\/w:rPr>/.exec(pPr)?.[0] ?? "";
|
|
251
|
+
const run = text ? `<w:r>${rPr}<w:t xml:space="preserve">${escapeXml(text)}</w:t></w:r>` : "";
|
|
252
|
+
return `${tcOpen}${tcPr}${pOpen}${pPr}${run}</w:p></w:tc>`;
|
|
253
|
+
}
|
|
254
|
+
function fillTableRowsInXml(xml, option) {
|
|
255
|
+
const rows = option.rows.filter((row) => row.some((cell) => String(cell ?? "").trim() !== ""));
|
|
256
|
+
if (rows.length === 0) return { xml, filled: false, rowCount: 0 };
|
|
257
|
+
const tables = [...xml.matchAll(/<w:tbl(?:\s[^>]*)?>[\s\S]*?<\/w:tbl>/g)];
|
|
258
|
+
for (const table of tables) {
|
|
259
|
+
const tableXml = table[0];
|
|
260
|
+
const tableRows = tableXml.match(TR_RE) ?? [];
|
|
261
|
+
if (tableRows.length < 2) continue;
|
|
262
|
+
const headerRow = tableRows[0];
|
|
263
|
+
const headerText = (headerRow.match(TC_RE) ?? []).map(cellText).join(" ");
|
|
264
|
+
if (!headerText.includes(option.headerKeyword)) continue;
|
|
265
|
+
const dataRows = tableRows.slice(1);
|
|
266
|
+
const cloneSource = dataRows[dataRows.length - 1];
|
|
267
|
+
const shadingFill = (rowXml) => {
|
|
268
|
+
const matched = /<w:shd\b[^>]*w:fill="([^"]*)"/.exec(rowXml);
|
|
269
|
+
return (matched?.[1] ?? "").trim().toUpperCase();
|
|
270
|
+
};
|
|
271
|
+
const isShadedRow = (rowXml) => {
|
|
272
|
+
const fill = shadingFill(rowXml);
|
|
273
|
+
return fill !== "" && fill !== "AUTO" && fill !== "FFFFFF";
|
|
274
|
+
};
|
|
275
|
+
const shadedRow = dataRows.find((row) => isShadedRow(row));
|
|
276
|
+
const plainRow = dataRows.find((row) => !isShadedRow(row));
|
|
277
|
+
const hasZebra = Boolean(shadedRow && plainRow);
|
|
278
|
+
const rebuilt = [headerRow];
|
|
279
|
+
rows.forEach((values, index) => {
|
|
280
|
+
const base = hasZebra ? index % 2 === 0 ? shadedRow : plainRow : dataRows[index] ?? cloneSource;
|
|
281
|
+
const trOpen = /^<w:tr(?:\s[^>]*)?>/.exec(base)?.[0] ?? "<w:tr>";
|
|
282
|
+
const trPr = /<w:trPr>[\s\S]*?<\/w:trPr>/.exec(base)?.[0] ?? "";
|
|
283
|
+
const cells = base.match(TC_RE) ?? [];
|
|
284
|
+
const rebuiltCells = cells.map((cell, cellIndex) => setCellText(cell, values[cellIndex] ?? ""));
|
|
285
|
+
rebuilt.push(`${trOpen}${trPr}${rebuiltCells.join("")}</w:tr>`);
|
|
286
|
+
});
|
|
287
|
+
const firstRowIndex = tableXml.indexOf(headerRow);
|
|
288
|
+
const head = tableXml.slice(0, firstRowIndex);
|
|
289
|
+
const newTableXml = `${head}${rebuilt.join("")}</w:tbl>`;
|
|
290
|
+
const start = table.index ?? 0;
|
|
291
|
+
return {
|
|
292
|
+
xml: `${xml.slice(0, start)}${newTableXml}${xml.slice(start + tableXml.length)}`,
|
|
293
|
+
filled: true,
|
|
294
|
+
rowCount: rows.length
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
return { xml, filled: false, rowCount: 0 };
|
|
298
|
+
}
|
|
299
|
+
var TEXT_PART_RE = /^word\/(document|header\d*|footer\d*|footnotes|endnotes)\.xml$/;
|
|
300
|
+
function renderDocx(template, resolver, options = {}) {
|
|
301
|
+
const entries = readDocxEntries(template);
|
|
302
|
+
const filled = /* @__PURE__ */ new Set();
|
|
303
|
+
const pending = /* @__PURE__ */ new Set();
|
|
304
|
+
let skippedParagraphs = 0;
|
|
305
|
+
let agenda;
|
|
306
|
+
const updated = entries.map((entry) => {
|
|
307
|
+
if (!TEXT_PART_RE.test(entry.name)) return entry;
|
|
308
|
+
let xml = entry.data.toString("utf8");
|
|
309
|
+
if (options.agenda && entry.name === "word/document.xml") {
|
|
310
|
+
const tableResult = fillTableRowsInXml(xml, options.agenda);
|
|
311
|
+
agenda = { filled: tableResult.filled, rowCount: tableResult.rowCount };
|
|
312
|
+
xml = tableResult.xml;
|
|
313
|
+
}
|
|
314
|
+
if (!xml.includes("{")) {
|
|
315
|
+
return xml === entry.data.toString("utf8") ? entry : { name: entry.name, data: Buffer.from(xml, "utf8") };
|
|
316
|
+
}
|
|
317
|
+
const result = replacePlaceholdersInXml(xml, resolver);
|
|
318
|
+
result.filled.forEach((key) => filled.add(key));
|
|
319
|
+
result.pending.forEach((key) => pending.add(key));
|
|
320
|
+
skippedParagraphs += result.skippedParagraphs;
|
|
321
|
+
return { name: entry.name, data: Buffer.from(result.xml, "utf8") };
|
|
322
|
+
});
|
|
323
|
+
return {
|
|
324
|
+
buffer: writeDocxEntries(updated),
|
|
325
|
+
filled: [...filled],
|
|
326
|
+
pending: [...pending],
|
|
327
|
+
skippedParagraphs,
|
|
328
|
+
...options.agenda ? { agenda: agenda ?? { filled: false, rowCount: 0 } } : {}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export {
|
|
333
|
+
readDocxEntries,
|
|
334
|
+
writeDocxEntries,
|
|
335
|
+
PENDING_MARK,
|
|
336
|
+
renderDocx
|
|
337
|
+
};
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
queryBody,
|
|
14
14
|
toIdCsv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6DVL5IN5.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-6QRXIBGU.js");
|
|
300
300
|
const idsByName = await resolveMemberIdsByName(env, nameLike);
|
|
301
301
|
const resolved = items.map((item) => idsByName.get(item) ?? item);
|
|
302
302
|
payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
|
|
@@ -429,7 +429,7 @@ var ebConflictRoom = {
|
|
|
429
429
|
let addressId = String(args.address ?? "").trim();
|
|
430
430
|
let resolvedRoom = null;
|
|
431
431
|
if (!addressId && String(args.room_name ?? "").trim()) {
|
|
432
|
-
const { resolveAddressRoom } = await import("./create-flow-
|
|
432
|
+
const { resolveAddressRoom } = await import("./create-flow-TVYE3IOH.js");
|
|
433
433
|
const resolved = await resolveAddressRoom(env, String(args.room_name));
|
|
434
434
|
if (!resolved?.id) {
|
|
435
435
|
throw meetingValidationError(
|
|
@@ -639,7 +639,7 @@ async function findCommonFreeSlots(env, input) {
|
|
|
639
639
|
const scheduleItems = [];
|
|
640
640
|
if (includeSchedule) {
|
|
641
641
|
try {
|
|
642
|
-
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-
|
|
642
|
+
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-6QRXIBGU.js");
|
|
643
643
|
const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
|
|
644
644
|
const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
|
|
645
645
|
const flow = await runScheduleConflictFlow(env, {
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
createE10RequestRuntime,
|
|
12
12
|
isE10SessionExpiredResponse,
|
|
13
13
|
requireE10Session
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WVH5ESDA.js";
|
|
15
15
|
import {
|
|
16
16
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
17
17
|
getActiveProfile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SFM3M2L3.js";
|
|
19
19
|
|
|
20
20
|
// src/shortcuts/hrm/host.ts
|
|
21
21
|
function inferProfile(ctx) {
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
findCommonFreeSlots,
|
|
8
8
|
meetingEbConflictOperations,
|
|
9
9
|
runEbConflictCheck
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-XU3FL3AW.js";
|
|
11
|
+
import "./chunk-6DVL5IN5.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|