weaver-work-cli 0.1.70 → 0.1.73
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-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
- package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
- package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
- package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
- package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
- package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
- package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
- package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +42 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
- package/dist/shortcuts/ehr/operations/recruit.js +206 -82
- package/dist/shortcuts/ehr/operations/shared.js +31 -0
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +15 -2
- package/dist/shortcuts/reception/manifest.js +17 -3
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +12 -6
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
- package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +158 -4
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/form.js +36 -2
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -177,6 +177,10 @@ function getKeyFilePath() {
|
|
|
177
177
|
}
|
|
178
178
|
function loadKeyringEntryConstructor() {
|
|
179
179
|
if (keyringEntryConstructor !== void 0) return keyringEntryConstructor;
|
|
180
|
+
if (process.env.WEAVER_WORK_CLI_KEYCHAIN?.toLowerCase() === "off") {
|
|
181
|
+
keyringEntryConstructor = null;
|
|
182
|
+
return keyringEntryConstructor;
|
|
183
|
+
}
|
|
180
184
|
try {
|
|
181
185
|
const module = require2("@napi-rs/keyring");
|
|
182
186
|
keyringEntryConstructor = typeof module.Entry === "function" ? module.Entry : null;
|
|
@@ -221,17 +225,17 @@ function readKeyFile(filePath) {
|
|
|
221
225
|
}
|
|
222
226
|
function getEncKey() {
|
|
223
227
|
if (encKey) return encKey;
|
|
224
|
-
const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
|
|
225
|
-
if (storedKey) {
|
|
226
|
-
encKey = storedKey;
|
|
227
|
-
return encKey;
|
|
228
|
-
}
|
|
229
228
|
const keyFile = getKeyFilePath();
|
|
230
229
|
const fileKey = readKeyFile(keyFile);
|
|
231
230
|
if (fileKey) {
|
|
232
231
|
encKey = fileKey;
|
|
233
232
|
return encKey;
|
|
234
233
|
}
|
|
234
|
+
const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
|
|
235
|
+
if (storedKey) {
|
|
236
|
+
encKey = storedKey;
|
|
237
|
+
return encKey;
|
|
238
|
+
}
|
|
235
239
|
const fresh = randomBytes(32);
|
|
236
240
|
if (writeKeychainKey(KEYCHAIN_SERVICE, fresh)) {
|
|
237
241
|
encKey = fresh;
|
|
@@ -1041,14 +1045,59 @@ var E10AuthSession = class _E10AuthSession {
|
|
|
1041
1045
|
};
|
|
1042
1046
|
|
|
1043
1047
|
// src/internal/e10/tls-policy.ts
|
|
1044
|
-
import { existsSync as
|
|
1048
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
1045
1049
|
import { homedir as homedir2 } from "node:os";
|
|
1046
|
-
import { resolve as
|
|
1050
|
+
import { delimiter, resolve as resolve6 } from "node:path";
|
|
1047
1051
|
import * as tls from "node:tls";
|
|
1052
|
+
|
|
1053
|
+
// src/core/package-paths.ts
|
|
1054
|
+
import { existsSync as existsSync4, realpathSync } from "node:fs";
|
|
1055
|
+
import { dirname as dirname3, join, resolve as resolve5 } from "node:path";
|
|
1056
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1057
|
+
var cachedRoot;
|
|
1058
|
+
function entryDirectory(entry) {
|
|
1059
|
+
const absoluteEntry = resolve5(entry);
|
|
1060
|
+
try {
|
|
1061
|
+
return dirname3(realpathSync(absoluteEntry));
|
|
1062
|
+
} catch {
|
|
1063
|
+
return dirname3(absoluteEntry);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function packageRootDir() {
|
|
1067
|
+
if (cachedRoot) return cachedRoot;
|
|
1068
|
+
const seeds = [];
|
|
1069
|
+
const entry = process.argv[1];
|
|
1070
|
+
if (entry) seeds.push(entryDirectory(entry));
|
|
1071
|
+
seeds.push(dirname3(fileURLToPath(import.meta.url)));
|
|
1072
|
+
for (const seed of seeds) {
|
|
1073
|
+
let dir = seed;
|
|
1074
|
+
for (let depth = 0; depth < 10; depth += 1) {
|
|
1075
|
+
if (existsSync4(join(dir, "package.json"))) {
|
|
1076
|
+
cachedRoot = dir;
|
|
1077
|
+
return dir;
|
|
1078
|
+
}
|
|
1079
|
+
const parent = dirname3(dir);
|
|
1080
|
+
if (parent === dir) break;
|
|
1081
|
+
dir = parent;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
cachedRoot = process.cwd();
|
|
1085
|
+
return cachedRoot;
|
|
1086
|
+
}
|
|
1087
|
+
function packagePath(...segments) {
|
|
1088
|
+
return join(packageRootDir(), ...segments);
|
|
1089
|
+
}
|
|
1090
|
+
function packageFileUrl(...segments) {
|
|
1091
|
+
return pathToFileURL(packagePath(...segments));
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// src/internal/e10/tls-policy.ts
|
|
1048
1095
|
var E10_TLS_CA_FILE_ENV = "WEAVER_E10_CA_FILE";
|
|
1049
1096
|
var E10_TLS_CA_FILE_ALIASES = ["WEAVER_XIAOE_CA_FILE"];
|
|
1050
1097
|
var E10_TLS_INSECURE_ENV = "WEAVER_E10_TLS_INSECURE";
|
|
1098
|
+
var E10_TLS_INSECURE_FALLBACK = "0";
|
|
1051
1099
|
var INSECURE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
1100
|
+
var SECURE_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
|
|
1052
1101
|
var PEM_MARKER = "BEGIN CERTIFICATE";
|
|
1053
1102
|
function readE10TlsCaFilePaths(env = process.env) {
|
|
1054
1103
|
const raw = [E10_TLS_CA_FILE_ENV, ...E10_TLS_CA_FILE_ALIASES].map((key) => env[key]).filter((value) => typeof value === "string" && value.trim().length > 0).join(",");
|
|
@@ -1056,19 +1105,29 @@ function readE10TlsCaFilePaths(env = process.env) {
|
|
|
1056
1105
|
for (const candidate of raw.split(/[,\n]/u)) {
|
|
1057
1106
|
const trimmed = candidate.trim();
|
|
1058
1107
|
if (!trimmed) continue;
|
|
1059
|
-
const absolute =
|
|
1108
|
+
const absolute = resolve6(expandHome(trimmed));
|
|
1060
1109
|
if (!paths.includes(absolute)) paths.push(absolute);
|
|
1061
1110
|
}
|
|
1062
1111
|
return paths;
|
|
1063
1112
|
}
|
|
1064
1113
|
function expandHome(value) {
|
|
1065
1114
|
if (value === "~") return homedir2();
|
|
1066
|
-
if (value.startsWith("~/")) return
|
|
1115
|
+
if (value.startsWith("~/")) return resolve6(homedir2(), value.slice(2));
|
|
1067
1116
|
return value;
|
|
1068
1117
|
}
|
|
1069
|
-
function
|
|
1118
|
+
function readE10TlsInsecureSetting(env = process.env) {
|
|
1070
1119
|
const raw = env[E10_TLS_INSECURE_ENV];
|
|
1071
|
-
|
|
1120
|
+
if (typeof raw !== "string" || !raw.trim()) return "default";
|
|
1121
|
+
const value = raw.trim().toLowerCase();
|
|
1122
|
+
if (INSECURE_VALUES.has(value)) return "on";
|
|
1123
|
+
if (SECURE_VALUES.has(value)) return "off";
|
|
1124
|
+
return "default";
|
|
1125
|
+
}
|
|
1126
|
+
function isE10TlsInsecureEnabled(env = process.env) {
|
|
1127
|
+
const setting = readE10TlsInsecureSetting(env);
|
|
1128
|
+
if (setting === "on") return true;
|
|
1129
|
+
if (setting === "off") return false;
|
|
1130
|
+
return INSECURE_VALUES.has(E10_TLS_INSECURE_FALLBACK.trim().toLowerCase());
|
|
1072
1131
|
}
|
|
1073
1132
|
function resolveE10TlsPolicy(env = process.env) {
|
|
1074
1133
|
const configuredFiles = readE10TlsCaFilePaths(env);
|
|
@@ -1084,7 +1143,7 @@ function resolveE10TlsPolicy(env = process.env) {
|
|
|
1084
1143
|
const problems = [];
|
|
1085
1144
|
for (const file of configuredFiles) {
|
|
1086
1145
|
try {
|
|
1087
|
-
if (!
|
|
1146
|
+
if (!existsSync5(file)) {
|
|
1088
1147
|
problems.push(`${file}: \u6587\u4EF6\u4E0D\u5B58\u5728`);
|
|
1089
1148
|
continue;
|
|
1090
1149
|
}
|
|
@@ -1125,6 +1184,7 @@ function applyInsecure(policy) {
|
|
|
1125
1184
|
}
|
|
1126
1185
|
function applyUncached(policy) {
|
|
1127
1186
|
if (policy.mode === "insecure") return applyInsecure(policy);
|
|
1187
|
+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === "0") delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;
|
|
1128
1188
|
if (policy.mode !== "custom-ca" || !policy.ca.length) {
|
|
1129
1189
|
return { ...policy, applied: false, notAppliedReason: "no-custom-ca" };
|
|
1130
1190
|
}
|
|
@@ -1202,60 +1262,29 @@ function summarizeE10TlsPolicy(status) {
|
|
|
1202
1262
|
if (status.mode === "insecure" && status.insecureSource) summary.insecureSource = status.insecureSource;
|
|
1203
1263
|
return summary;
|
|
1204
1264
|
}
|
|
1265
|
+
function e10TlsPythonSiteDir() {
|
|
1266
|
+
const dir = packagePath("scripts", "pysite");
|
|
1267
|
+
return existsSync5(dir) ? dir : "";
|
|
1268
|
+
}
|
|
1205
1269
|
function e10TlsChildEnv(env = process.env) {
|
|
1206
1270
|
const policy = resolveE10TlsPolicy(env);
|
|
1207
1271
|
if (policy.mode === "insecure") {
|
|
1208
|
-
|
|
1272
|
+
const next2 = { ...env, [E10_TLS_INSECURE_ENV]: "1" };
|
|
1273
|
+
const siteDir = e10TlsPythonSiteDir();
|
|
1274
|
+
if (siteDir) {
|
|
1275
|
+
const existing = typeof next2.PYTHONPATH === "string" && next2.PYTHONPATH.trim() ? next2.PYTHONPATH : "";
|
|
1276
|
+
next2.PYTHONPATH = existing ? `${siteDir}${delimiter}${existing}` : siteDir;
|
|
1277
|
+
}
|
|
1278
|
+
return next2;
|
|
1209
1279
|
}
|
|
1210
|
-
|
|
1280
|
+
const next = { ...env, [E10_TLS_INSECURE_ENV]: "0" };
|
|
1281
|
+
if (policy.mode !== "custom-ca" || !policy.caFiles.length) return next;
|
|
1211
1282
|
const bundle = policy.caFiles[0];
|
|
1212
|
-
const next = { ...env };
|
|
1213
1283
|
if (!next.SSL_CERT_FILE) next.SSL_CERT_FILE = bundle;
|
|
1214
1284
|
if (!next.REQUESTS_CA_BUNDLE) next.REQUESTS_CA_BUNDLE = bundle;
|
|
1215
1285
|
return next;
|
|
1216
1286
|
}
|
|
1217
1287
|
|
|
1218
|
-
// src/core/package-paths.ts
|
|
1219
|
-
import { existsSync as existsSync5, realpathSync } from "node:fs";
|
|
1220
|
-
import { dirname as dirname3, join, resolve as resolve6 } from "node:path";
|
|
1221
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1222
|
-
var cachedRoot;
|
|
1223
|
-
function entryDirectory(entry) {
|
|
1224
|
-
const absoluteEntry = resolve6(entry);
|
|
1225
|
-
try {
|
|
1226
|
-
return dirname3(realpathSync(absoluteEntry));
|
|
1227
|
-
} catch {
|
|
1228
|
-
return dirname3(absoluteEntry);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
function packageRootDir() {
|
|
1232
|
-
if (cachedRoot) return cachedRoot;
|
|
1233
|
-
const seeds = [];
|
|
1234
|
-
const entry = process.argv[1];
|
|
1235
|
-
if (entry) seeds.push(entryDirectory(entry));
|
|
1236
|
-
seeds.push(dirname3(fileURLToPath(import.meta.url)));
|
|
1237
|
-
for (const seed of seeds) {
|
|
1238
|
-
let dir = seed;
|
|
1239
|
-
for (let depth = 0; depth < 10; depth += 1) {
|
|
1240
|
-
if (existsSync5(join(dir, "package.json"))) {
|
|
1241
|
-
cachedRoot = dir;
|
|
1242
|
-
return dir;
|
|
1243
|
-
}
|
|
1244
|
-
const parent = dirname3(dir);
|
|
1245
|
-
if (parent === dir) break;
|
|
1246
|
-
dir = parent;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
cachedRoot = process.cwd();
|
|
1250
|
-
return cachedRoot;
|
|
1251
|
-
}
|
|
1252
|
-
function packagePath(...segments) {
|
|
1253
|
-
return join(packageRootDir(), ...segments);
|
|
1254
|
-
}
|
|
1255
|
-
function packageFileUrl(...segments) {
|
|
1256
|
-
return pathToFileURL(packagePath(...segments));
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
1288
|
// src/core/runtime-agent.ts
|
|
1260
1289
|
var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
|
|
1261
1290
|
"xiaoe",
|
|
@@ -1614,11 +1643,11 @@ function parseXiaoEUnifiedLoginMap(raw, source) {
|
|
|
1614
1643
|
} catch {
|
|
1615
1644
|
}
|
|
1616
1645
|
return value.split(/[;,\n]+/u).map((entry) => entry.trim()).filter(Boolean).map((entry) => {
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1619
|
-
const index = entry.indexOf(
|
|
1646
|
+
const delimiter2 = entry.includes("|") ? "|" : entry.includes("=") ? "=" : "";
|
|
1647
|
+
if (delimiter2) {
|
|
1648
|
+
const index = entry.indexOf(delimiter2);
|
|
1620
1649
|
const baseUrl = entry.slice(0, index).trim();
|
|
1621
|
-
const eteamsId = entry.slice(index +
|
|
1650
|
+
const eteamsId = entry.slice(index + delimiter2.length).trim();
|
|
1622
1651
|
return baseUrl && eteamsId ? { baseUrl: normalizeUrl(baseUrl), eteamsId, source } : null;
|
|
1623
1652
|
}
|
|
1624
1653
|
const parts = entry.split(/\s+/u).filter(Boolean);
|
|
@@ -2362,7 +2391,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
2362
2391
|
}
|
|
2363
2392
|
async function tryXiaoEUnifiedLogin(options = {}) {
|
|
2364
2393
|
const env = options.env || process.env;
|
|
2365
|
-
const tlsPolicy = applyE10TlsPolicy(
|
|
2394
|
+
const tlsPolicy = applyE10TlsPolicy();
|
|
2366
2395
|
const explicitBaseUrl = normalizeUrl(options.baseUrl || "");
|
|
2367
2396
|
const baseUrl = resolveXiaoEPreferredBaseUrl({
|
|
2368
2397
|
explicitBaseUrl,
|
|
@@ -2500,14 +2529,15 @@ async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
2500
2529
|
}
|
|
2501
2530
|
|
|
2502
2531
|
export {
|
|
2503
|
-
packagePath,
|
|
2504
|
-
packageFileUrl,
|
|
2505
2532
|
isConnectorMode,
|
|
2506
2533
|
normalizeGlobalOptions,
|
|
2507
|
-
|
|
2534
|
+
packagePath,
|
|
2535
|
+
packageFileUrl,
|
|
2536
|
+
isXiaoERuntimeAgent,
|
|
2508
2537
|
readErrorCauseCode,
|
|
2509
2538
|
isTlsTrustErrorCode,
|
|
2510
2539
|
looksLikeTlsTrustMessage,
|
|
2540
|
+
writeWithRetry,
|
|
2511
2541
|
getE10AuthRoot,
|
|
2512
2542
|
resolveAgentHostKey,
|
|
2513
2543
|
lookupAgentHost,
|
|
@@ -2531,7 +2561,6 @@ export {
|
|
|
2531
2561
|
extractRawSetCookie,
|
|
2532
2562
|
extractSessionTicket,
|
|
2533
2563
|
E10AuthSession,
|
|
2534
|
-
isXiaoERuntimeAgent,
|
|
2535
2564
|
applyE10TlsPolicy,
|
|
2536
2565
|
currentE10TlsPolicyStatus,
|
|
2537
2566
|
summarizeE10TlsPolicy,
|
|
@@ -2539,6 +2568,7 @@ export {
|
|
|
2539
2568
|
summarizeXiaoEFailureKind,
|
|
2540
2569
|
lastXiaoEFailure,
|
|
2541
2570
|
hasXiaoEEnv,
|
|
2571
|
+
isXiaoECloudRuntime,
|
|
2542
2572
|
resolveDefaultE10BaseUrl,
|
|
2543
2573
|
inspectXiaoEUnifiedLoginSources,
|
|
2544
2574
|
resolveXiaoEPreferredBaseUrl,
|
|
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
readCache,
|
|
5
5
|
writeCache
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PAFOLIYQ.js";
|
|
7
7
|
import {
|
|
8
8
|
SCHEMA_DATETIME_MINUTE,
|
|
9
9
|
meetingSuccess,
|
|
10
10
|
meetingValidationError,
|
|
11
11
|
schemaOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4I26YMBY.js";
|
|
13
13
|
|
|
14
14
|
// src/shortcuts/meeting/operations/eb/schedule.ts
|
|
15
15
|
var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
|
|
@@ -110,9 +110,9 @@ async function runScheduleConflictFlow(env, input) {
|
|
|
110
110
|
if (!employeeId) {
|
|
111
111
|
throw meetingValidationError("schedule_employee_required", "\u53D6\u4E0D\u5230\u5F53\u524D\u767B\u5F55\u7528\u6237 id\uFF0C\u65E0\u6CD5\u89E6\u53D1 ESB \u65E5\u7A0B\u67E5\u8BE2");
|
|
112
112
|
}
|
|
113
|
-
const { createEsbHost } = await import("./host-
|
|
113
|
+
const { createEsbHost } = await import("./host-7FJW4E7R.js");
|
|
114
114
|
const { createEsbContinuationSigner } = await import("./continuation-KI7DRRZN.js");
|
|
115
|
-
const { getEsbOperation } = await import("./registry-
|
|
115
|
+
const { getEsbOperation } = await import("./registry-N7P3W2RD.js");
|
|
116
116
|
const esbEnv = {
|
|
117
117
|
ctx: env.ctx,
|
|
118
118
|
host: createEsbHost(env.ctx),
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
isXiaoECloudRuntime
|
|
5
|
+
} from "./chunk-AMAPQVBT.js";
|
|
3
6
|
import {
|
|
4
7
|
CliError
|
|
5
8
|
} from "./chunk-UG5G54VL.js";
|
|
@@ -66,6 +69,16 @@ function asObject(value) {
|
|
|
66
69
|
}
|
|
67
70
|
return value;
|
|
68
71
|
}
|
|
72
|
+
function toMenuList(value) {
|
|
73
|
+
if (Array.isArray(value)) return value;
|
|
74
|
+
if (value && typeof value === "object") {
|
|
75
|
+
const obj = value;
|
|
76
|
+
for (const key of ["cusAppMenus", "menus", "allMenus", "data", "list"]) {
|
|
77
|
+
if (Array.isArray(obj[key])) return obj[key];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
69
82
|
function assertNoForbiddenKeys(input) {
|
|
70
83
|
for (const key of Object.keys(input)) {
|
|
71
84
|
if (FORBIDDEN_KEYS.has(key)) {
|
|
@@ -250,7 +263,7 @@ function addDays(date, delta) {
|
|
|
250
263
|
|
|
251
264
|
// src/shortcuts/ehr/operations/recruit.ts
|
|
252
265
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
253
|
-
import { existsSync, mkdirSync, readFileSync,
|
|
266
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
254
267
|
import { homedir } from "node:os";
|
|
255
268
|
import { join, resolve } from "node:path";
|
|
256
269
|
|
|
@@ -279,7 +292,13 @@ var SCHEMA_STRING_LIST = { type: "array", items: { type: "string" } };
|
|
|
279
292
|
|
|
280
293
|
// src/shortcuts/ehr/operations/recruit.ts
|
|
281
294
|
var RECRUIT_APP_TAG = "weaver-recruit-service";
|
|
282
|
-
var
|
|
295
|
+
var SELF_TENANT_KEYS = /* @__PURE__ */ new Set(["t7akvdnf84"]);
|
|
296
|
+
function isSelfTenant(tenantKey) {
|
|
297
|
+
const key = String(tenantKey || "").trim();
|
|
298
|
+
return !!key && SELF_TENANT_KEYS.has(key);
|
|
299
|
+
}
|
|
300
|
+
var RECRUIT_CACHE_VERSION = 5;
|
|
301
|
+
var RECRUIT_CACHE_TTL_MS = 12 * 60 * 60 * 1e3;
|
|
283
302
|
var RECRUIT_CRITICAL_FORMS = /* @__PURE__ */ new Set(["position_manage", "talent_pool", "interview_plan"]);
|
|
284
303
|
var RECRUIT_CRITICAL_FORM_LABELS = {
|
|
285
304
|
position_manage: "\u62DB\u8058\u804C\u4F4D",
|
|
@@ -293,6 +312,7 @@ function hasCriticalFields(cache) {
|
|
|
293
312
|
const fmap = cache?.fields?.[objId] || {};
|
|
294
313
|
if (!Object.keys(fmap).length) return false;
|
|
295
314
|
}
|
|
315
|
+
if (Array.isArray(cache?.degraded) && cache.degraded.length) return false;
|
|
296
316
|
return true;
|
|
297
317
|
}
|
|
298
318
|
var RECRUIT_TAGS = {
|
|
@@ -372,6 +392,7 @@ function snapshotPathFor(baseUrl) {
|
|
|
372
392
|
return join(cacheDirFor(baseUrl), "..", "_recruit-stage", `context-snapshot-${host}.json`);
|
|
373
393
|
}
|
|
374
394
|
function readContextSnapshot(baseUrl) {
|
|
395
|
+
if (isXiaoECloudRuntime()) return null;
|
|
375
396
|
try {
|
|
376
397
|
const raw = JSON.parse(readFileSync(snapshotPathFor(baseUrl), "utf8"));
|
|
377
398
|
if (!raw?.at || raw.cacheVersion !== RECRUIT_CACHE_VERSION) return null;
|
|
@@ -383,6 +404,8 @@ function readContextSnapshot(baseUrl) {
|
|
|
383
404
|
}
|
|
384
405
|
}
|
|
385
406
|
function writeContextSnapshot(baseUrl, appId, resolved) {
|
|
407
|
+
if (Array.isArray(resolved?.degraded) && resolved.degraded.length) return;
|
|
408
|
+
if (isXiaoECloudRuntime()) return;
|
|
386
409
|
try {
|
|
387
410
|
const path = snapshotPathFor(baseUrl);
|
|
388
411
|
mkdirSync(join(path, ".."), { recursive: true });
|
|
@@ -465,6 +488,7 @@ async function fetchFormFields(host, appId, objId) {
|
|
|
465
488
|
return { fmap, omap };
|
|
466
489
|
}
|
|
467
490
|
async function resolveRecruitEnv(host, appId) {
|
|
491
|
+
const degraded = [];
|
|
468
492
|
const forms = {};
|
|
469
493
|
let tenantKey = "";
|
|
470
494
|
const tagEntries = Object.entries(RECRUIT_TAGS);
|
|
@@ -489,21 +513,27 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
489
513
|
`\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C${RECRUIT_CRITICAL_FORM_LABELS[logic] || logic}\u300D\u8868\u5355\uFF08getObjsByTag \u8FD4\u56DE\u7A7A\uFF09\uFF0C\u5DF2\u4E2D\u6B62\u4E14\u672A\u5199\u5165\u7F13\u5B58\uFF1B\u8BF7\u786E\u8BA4\u62DB\u8058\u5E94\u7528\u5DF2\u5B89\u88C5\u3001\u8D26\u53F7\u5BF9\u8BE5\u8868\u5355\u6709\u6743\u9650\u540E\u91CD\u8BD5\u3002`
|
|
490
514
|
);
|
|
491
515
|
}
|
|
492
|
-
|
|
493
|
-
path: "/api/cusapp/app/allMenus",
|
|
494
|
-
query: { isFront: 1, appId, terminalType: "PC" }
|
|
495
|
-
});
|
|
516
|
+
if (!forms.dictionary?.objId) degraded.push("dict");
|
|
496
517
|
const flat = [];
|
|
497
518
|
const walk = (nodes) => {
|
|
498
|
-
for (const node of nodes
|
|
519
|
+
for (const node of toMenuList(nodes)) {
|
|
499
520
|
if (node && typeof node === "object") {
|
|
500
521
|
flat.push(node);
|
|
501
|
-
walk(node.children
|
|
522
|
+
walk(node.children ?? node.childs);
|
|
502
523
|
}
|
|
503
524
|
}
|
|
504
525
|
};
|
|
505
|
-
|
|
506
|
-
|
|
526
|
+
let menuFailed = false;
|
|
527
|
+
try {
|
|
528
|
+
const menuResponse = await host.request({
|
|
529
|
+
path: "/api/cusapp/app/allMenus",
|
|
530
|
+
query: { isFront: 1, appId, terminalType: "PC" }
|
|
531
|
+
});
|
|
532
|
+
walk(menuResponse?.data);
|
|
533
|
+
} catch {
|
|
534
|
+
menuFailed = true;
|
|
535
|
+
}
|
|
536
|
+
if (menuFailed || !flat.length) degraded.push("menus");
|
|
507
537
|
const searchMenus = [];
|
|
508
538
|
const pages = [];
|
|
509
539
|
for (const node of flat) {
|
|
@@ -532,52 +562,57 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
532
562
|
const dictMenu = searchMenus.find((m) => (m.menuName || "").trim() === "\u6570\u636E\u5B57\u5178") || null;
|
|
533
563
|
const dictObjId = forms.dictionary?.objId || "";
|
|
534
564
|
if (dictObjId && dictMenu) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
(
|
|
571
|
-
|
|
565
|
+
try {
|
|
566
|
+
const size = 500;
|
|
567
|
+
const CONCURRENCY = 6;
|
|
568
|
+
const fetchDictPage = (pageNo2) => host.request({
|
|
569
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${dictObjId}&cid=${dictObjId}`,
|
|
570
|
+
body: {
|
|
571
|
+
current: pageNo2,
|
|
572
|
+
pageSize: size,
|
|
573
|
+
tableuid: randHex32(),
|
|
574
|
+
listId: dictMenu.listId,
|
|
575
|
+
searchParamData: { searchType: "3", type: "and" },
|
|
576
|
+
terminal: "PC",
|
|
577
|
+
browser: "Chrome",
|
|
578
|
+
requiredMatch: 1,
|
|
579
|
+
mapResult: 1,
|
|
580
|
+
recheckQuery: 1,
|
|
581
|
+
isFollow: 0,
|
|
582
|
+
isShareToMe: 0,
|
|
583
|
+
filterCondition: {},
|
|
584
|
+
cusMenuId: dictMenu.cusMenuId,
|
|
585
|
+
urlPageTitle: "\u6570\u636E\u5B57\u5178",
|
|
586
|
+
menuName: "\u6570\u636E\u5B57\u5178"
|
|
587
|
+
},
|
|
588
|
+
headers: { ebBusinessId: dictMenu.listId }
|
|
589
|
+
});
|
|
590
|
+
let pageNo = 1;
|
|
591
|
+
let reachedEnd = false;
|
|
592
|
+
while (!reachedEnd) {
|
|
593
|
+
const batchPages = Array.from({ length: CONCURRENCY }, (_, i) => pageNo + i);
|
|
594
|
+
const responses = await Promise.all(batchPages.map((p) => fetchDictPage(p)));
|
|
595
|
+
for (const response of responses) {
|
|
596
|
+
const rows = response?.data?.data || [];
|
|
597
|
+
for (const row of rows) {
|
|
598
|
+
const name = row.selection_name;
|
|
599
|
+
const optionId = row.form_data_id;
|
|
600
|
+
if (name && optionId) {
|
|
601
|
+
(dictByName[String(name)] ||= []).push(String(optionId));
|
|
602
|
+
dictRaw.push({ selection_name: String(name), option_id: String(optionId), dict_type: row.dict_type, browser_key: row.browser_key });
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
if (rows.length < size) {
|
|
606
|
+
reachedEnd = true;
|
|
607
|
+
break;
|
|
572
608
|
}
|
|
573
609
|
}
|
|
574
|
-
|
|
575
|
-
reachedEnd = true;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
610
|
+
pageNo += CONCURRENCY;
|
|
578
611
|
}
|
|
579
|
-
|
|
612
|
+
} catch {
|
|
613
|
+
degraded.push("dict");
|
|
580
614
|
}
|
|
615
|
+
if (!Object.keys(dictByName).length) degraded.push("dict");
|
|
581
616
|
}
|
|
582
617
|
let ebdDetailPageId = "";
|
|
583
618
|
let selfUse = "0";
|
|
@@ -642,6 +677,7 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
642
677
|
} catch {
|
|
643
678
|
}
|
|
644
679
|
}
|
|
680
|
+
if (isSelfTenant(tenantKey)) selfUse = "1";
|
|
645
681
|
if (!ebdDetailPageId) {
|
|
646
682
|
try {
|
|
647
683
|
const response = await host.request({
|
|
@@ -662,15 +698,19 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
662
698
|
const entry = forms[logic] || { objId: "", formId: "", objName: "" };
|
|
663
699
|
const fieldId = (fields[entry.objId] || {})[dataKey] || "";
|
|
664
700
|
if (fieldId && entry.objId) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
701
|
+
try {
|
|
702
|
+
const response = await host.request({
|
|
703
|
+
path: "/api/ebuilder/common/ds/options",
|
|
704
|
+
query: { fieldName: fieldId, objId: entry.objId, sourceType: "FORM", groupId: appId }
|
|
705
|
+
});
|
|
706
|
+
if (Array.isArray(response?.data)) {
|
|
707
|
+
options[dataKey] = {};
|
|
708
|
+
for (const option of response.data) {
|
|
709
|
+
if (option?.id) options[dataKey][String(option.id)] = option.name;
|
|
710
|
+
}
|
|
673
711
|
}
|
|
712
|
+
} catch {
|
|
713
|
+
degraded.push(`options:${dataKey}`);
|
|
674
714
|
}
|
|
675
715
|
}
|
|
676
716
|
}
|
|
@@ -698,6 +738,7 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
698
738
|
return {
|
|
699
739
|
appId,
|
|
700
740
|
tenantKey,
|
|
741
|
+
degraded,
|
|
701
742
|
forms,
|
|
702
743
|
lists,
|
|
703
744
|
fields,
|
|
@@ -716,23 +757,7 @@ function createRecruitContextLoader() {
|
|
|
716
757
|
const memoKey = baseUrl;
|
|
717
758
|
let cached = memo.get(memoKey);
|
|
718
759
|
if (cached) return cached;
|
|
719
|
-
|
|
720
|
-
let diskCache = null;
|
|
721
|
-
try {
|
|
722
|
-
const dir = cacheDirFor(baseUrl);
|
|
723
|
-
if (existsSync(dir)) {
|
|
724
|
-
const files = readdirSync(dir).filter((file) => file.endsWith(".json") && !file.startsWith("_"));
|
|
725
|
-
if (files.length === 1) {
|
|
726
|
-
appId = files[0].replace(/\.json$/, "");
|
|
727
|
-
diskCache = JSON.parse(readFileSync(join(dir, files[0]), "utf8"));
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
} catch {
|
|
731
|
-
}
|
|
732
|
-
if (diskCache && diskCache.cacheVersion === RECRUIT_CACHE_VERSION && hasCriticalFields(diskCache)) {
|
|
733
|
-
memo.set(memoKey, diskCache);
|
|
734
|
-
return diskCache;
|
|
735
|
-
}
|
|
760
|
+
const cloudRuntime = isXiaoECloudRuntime();
|
|
736
761
|
const gate = await host.request({
|
|
737
762
|
path: "/api/bs/ebuilder/app/tags/getAppIds",
|
|
738
763
|
query: { tag: RECRUIT_APP_TAG }
|
|
@@ -744,7 +769,22 @@ function createRecruitContextLoader() {
|
|
|
744
769
|
"\u5F53\u524D\u79DF\u6237\u672A\u5B89\u88C5\u62DB\u8058\u670D\u52A1\uFF08weaver-recruit-service\uFF09\uFF0C\u65E0\u6CD5\u4F7F\u7528\u62DB\u8058\u80FD\u529B\u3002\u8BF7\u5148\u5728 E10 \u5E94\u7528\u5E02\u573A\u5B89\u88C5\u300C\u62DB\u8058\u300D\u5E94\u7528\u3002"
|
|
745
770
|
);
|
|
746
771
|
}
|
|
747
|
-
appId = String(appIds[0]);
|
|
772
|
+
const appId = String(appIds[0]);
|
|
773
|
+
if (!cloudRuntime) {
|
|
774
|
+
try {
|
|
775
|
+
const file = join(cacheDirFor(baseUrl), `${appId}.json`);
|
|
776
|
+
if (existsSync(file)) {
|
|
777
|
+
const candidate = JSON.parse(readFileSync(file, "utf8"));
|
|
778
|
+
const savedAt = Number(candidate?.savedAt || 0);
|
|
779
|
+
const fresh = savedAt > 0 && Date.now() - savedAt <= RECRUIT_CACHE_TTL_MS;
|
|
780
|
+
if (candidate && candidate.cacheVersion === RECRUIT_CACHE_VERSION && fresh && hasCriticalFields(candidate)) {
|
|
781
|
+
memo.set(memoKey, candidate);
|
|
782
|
+
return candidate;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
} catch {
|
|
786
|
+
}
|
|
787
|
+
}
|
|
748
788
|
const snapshot = readContextSnapshot(baseUrl);
|
|
749
789
|
if (snapshot && snapshot.appId === appId && !process.env.E10_RS_NO_CTX_SNAPSHOT) {
|
|
750
790
|
let tagStillMatches = false;
|
|
@@ -774,6 +814,13 @@ function createRecruitContextLoader() {
|
|
|
774
814
|
return { load };
|
|
775
815
|
}
|
|
776
816
|
function persistContextCache(baseUrl, appId, cache) {
|
|
817
|
+
if (Array.isArray(cache?.degraded) && cache.degraded.length) {
|
|
818
|
+
if (process.env.WEAVER_CLI_DEBUG_CACHE) {
|
|
819
|
+
console.error("[recruit-context] \u89E3\u6790\u5B58\u5728\u964D\u7EA7\uFF08", cache.degraded.join(","), "\uFF09\uFF0C\u672C\u6B21\u4E0D\u843D\u76D8\uFF0C\u4E0B\u6B21\u8C03\u7528\u5C06\u5168\u91CF\u91CD\u5EFA");
|
|
820
|
+
}
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
if (isXiaoECloudRuntime()) return;
|
|
777
824
|
try {
|
|
778
825
|
const dir = cacheDirFor(baseUrl);
|
|
779
826
|
mkdirSync(dir, { recursive: true });
|
|
@@ -785,8 +832,10 @@ function persistContextCache(baseUrl, appId, cache) {
|
|
|
785
832
|
note: "recruit-ops \u73AF\u5883\u53C2\u6570\u7F13\u5B58\uFF08weaver-work-cli \u8FD0\u884C\u65F6\u89E3\u6790\u4EA7\u7269\uFF0C\u4E0D\u542B\u8BA4\u8BC1\u5B57\u6BB5\uFF09"
|
|
786
833
|
},
|
|
787
834
|
envKey: `${dir.split(/[\\/]/).pop()}|${appId}`,
|
|
835
|
+
...cache,
|
|
788
836
|
cacheVersion: RECRUIT_CACHE_VERSION,
|
|
789
|
-
...cache
|
|
837
|
+
// 🔴 savedAt 必须在 ...cache 之后:防止调用方携带旧 savedAt 把新写入标成过期
|
|
838
|
+
savedAt: Date.now()
|
|
790
839
|
}, null, 2),
|
|
791
840
|
"utf8"
|
|
792
841
|
);
|
|
@@ -1485,6 +1534,7 @@ export {
|
|
|
1485
1534
|
SCHEMA_ID_LIST,
|
|
1486
1535
|
SCHEMA_STRING_LIST,
|
|
1487
1536
|
asObject,
|
|
1537
|
+
toMenuList,
|
|
1488
1538
|
assertNoForbiddenKeys,
|
|
1489
1539
|
assertMonth,
|
|
1490
1540
|
toNumber,
|
|
@@ -1501,6 +1551,7 @@ export {
|
|
|
1501
1551
|
EHR_PAGES,
|
|
1502
1552
|
ehrPageUrl,
|
|
1503
1553
|
addDays,
|
|
1554
|
+
isSelfTenant,
|
|
1504
1555
|
LIST_TYPES,
|
|
1505
1556
|
namesOf,
|
|
1506
1557
|
createRecruitContextLoader,
|