weaver-work-cli 0.1.59 → 0.1.61
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-4SQAVTIB.js → archive-S2VKZWQ3.js} +2 -2
- package/dist/chunks/{archive-oa-W2UEJ67L.js → archive-oa-HEDSIUUY.js} +2 -2
- package/dist/chunks/{asset-EGZEABBI.js → asset-HYH4W357.js} +2 -2
- package/dist/chunks/{asset-idle-EBUZBB6M.js → asset-idle-N7REBNGL.js} +2 -2
- package/dist/chunks/{attachment-content-TP6WDNC6.js → attachment-content-VYYA75FR.js} +3 -3
- package/dist/chunks/{blog-2YKMWOWI.js → blog-SLMZZICV.js} +2 -2
- package/dist/chunks/{caizhilian-5NM4X5HG.js → caizhilian-RV43KKBT.js} +4 -4
- package/dist/chunks/{calendar-H4QTJCUY.js → calendar-DMVZ4OLY.js} +2 -2
- package/dist/chunks/{chunk-QNPIY5R6.js → chunk-6XSSAUNW.js} +4 -4
- package/dist/chunks/{chunk-AQOPPNTR.js → chunk-BIA2NKUG.js} +4 -4
- package/dist/chunks/{chunk-VMCCRWFO.js → chunk-BQYX2UX5.js} +2 -2
- package/dist/chunks/{chunk-CI2RF3AJ.js → chunk-DTCQFTHW.js} +1 -1
- package/dist/chunks/{chunk-I3BFBBP2.js → chunk-E5YD5JWR.js} +1 -1
- package/dist/chunks/{chunk-PH7N4UFT.js → chunk-EGANE35F.js} +1 -1
- package/dist/chunks/{chunk-Z4IPY5GV.js → chunk-H6YOMI3U.js} +2 -2
- package/dist/chunks/{chunk-U2DWV6JC.js → chunk-ILALC2N6.js} +1 -1
- package/dist/chunks/{chunk-WINR2Q6K.js → chunk-KXJA42EA.js} +86 -19
- package/dist/chunks/{chunk-CQ4OVCKG.js → chunk-KY3R42RS.js} +2 -2
- package/dist/chunks/{chunk-WVH5ESDA.js → chunk-NRYDJN4J.js} +1 -1
- package/dist/chunks/{chunk-TGM7BWEH.js → chunk-P6TXQK75.js} +2 -2
- package/dist/chunks/{chunk-6YWHRXEQ.js → chunk-QBDXJS2W.js} +119 -9
- package/dist/chunks/{chunk-2IGZUMNG.js → chunk-SHX7XBYR.js} +180 -18
- package/dist/chunks/{chunk-XR5BGFNT.js → chunk-T2KVJFWJ.js} +10 -4
- package/dist/chunks/{chunk-FMNCSYIG.js → chunk-TEZHIB6T.js} +2 -2
- package/dist/chunks/{chunk-2FHP4PYS.js → chunk-UBGWIXU3.js} +116 -40
- package/dist/chunks/{chunk-5N222HK6.js → chunk-UBRWONP4.js} +2 -2
- package/dist/chunks/{chunk-MQBMMJUV.js → chunk-UQFPF4EX.js} +2 -2
- package/dist/chunks/{chunk-4GG72JAT.js → chunk-V2LASYKO.js} +2 -2
- package/dist/chunks/{chunk-FM7B5BIR.js → chunk-VBFBMM7G.js} +61 -53
- package/dist/chunks/{chunk-ZHPCNM2S.js → chunk-VNYOUAWV.js} +11 -11
- package/dist/chunks/{chunk-SFM3M2L3.js → chunk-WIWDVETN.js} +19 -3
- package/dist/chunks/{chunk-44KJ7WFA.js → chunk-XT77MP54.js} +2 -2
- package/dist/chunks/chunk-YI2YMW5N.js +111 -0
- package/dist/chunks/{conflict-Y3ESXYIA.js → conflict-GFJRS6I7.js} +2 -2
- package/dist/chunks/{contract-LLRKMLQQ.js → contract-U3ZGNRWB.js} +2 -2
- package/dist/chunks/{cowork-2RDFBZWB.js → cowork-EX7PKIDK.js} +2 -2
- package/dist/chunks/{create-flow-JHQSA6JF.js → create-flow-EJZD434E.js} +6 -6
- package/dist/chunks/{data-ZVS3BWPT.js → data-FOODGAMF.js} +278 -123
- package/dist/chunks/{ebuilder-form-TWSXS5NA.js → ebuilder-form-I2EOKODG.js} +5 -5
- package/dist/chunks/{ehr-52GBKNJR.js → ehr-TE4RFNID.js} +2 -2
- package/dist/chunks/entry-mode-ZOLSXEGX.js +19 -0
- package/dist/chunks/{env-LQBLL3MZ.js → env-TID5NFR6.js} +2 -2
- package/dist/chunks/{esb-HJSXCEOM.js → esb-7L6MHYLB.js} +4 -4
- package/dist/chunks/{factory-X7PN6B3B.js → factory-OG7BPMH5.js} +1 -1
- package/dist/chunks/{fna-OBACRT3J.js → fna-6V2ENR3Y.js} +2 -2
- package/dist/chunks/{group-chat-PPFY7SPV.js → group-chat-5DKPWIHL.js} +3 -3
- package/dist/chunks/{host-TTSGY5NZ.js → host-3DLYA54R.js} +3 -3
- package/dist/chunks/{host-KJT3G5D2.js → host-GOJHHTPY.js} +3 -3
- package/dist/chunks/{host-KOWUMNAY.js → host-OGBHL75G.js} +3 -3
- package/dist/chunks/{host-MFXRA2MY.js → host-ONZC6AE7.js} +3 -3
- package/dist/chunks/{host-W4JCNRFS.js → host-TJ5VVHM7.js} +3 -3
- package/dist/chunks/{host-2BKMPWDH.js → host-VTPAWDZV.js} +3 -3
- package/dist/chunks/{hrm-AK3WGBMN.js → hrm-2N7NFQDZ.js} +3 -3
- package/dist/chunks/{im-JZSBPO4Z.js → im-XCH47ZBN.js} +3 -3
- package/dist/chunks/{invoice-6XDMPCWB.js → invoice-XQRKMGNY.js} +3 -3
- package/dist/chunks/{jiuchuanhui-K4EQU6GK.js → jiuchuanhui-PL6DRPBM.js} +2 -2
- package/dist/chunks/{lazy-dispatch-GCA6HDOB.js → lazy-dispatch-UATEN7H7.js} +5 -5
- package/dist/chunks/{mail-IKVCQCVZ.js → mail-Q7Z4CQ4D.js} +2 -2
- package/dist/chunks/{meeting-GMRQZFJP.js → meeting-5E3BNARL.js} +13 -12
- package/dist/chunks/{minute-doc-JXH3MNC7.js → minute-doc-NXRE5C77.js} +4 -4
- package/dist/chunks/{okr-KV43FPPX.js → okr-3O3XNYOK.js} +2 -2
- package/dist/chunks/{operations-6NXJ7RTE.js → operations-EZWG72FH.js} +4 -4
- package/dist/chunks/performance-Y7CPNSOR.js +1295 -0
- package/dist/chunks/{plan-WOYR4WEG.js → plan-BLGPZF5M.js} +2 -2
- package/dist/chunks/{project-CQJKBUIL.js → project-6MZMLJMP.js} +2 -2
- package/dist/chunks/{reception-MPBU3JXC.js → reception-F2VT2X52.js} +2 -2
- package/dist/chunks/{recruit-stage-USTTRHOX.js → recruit-stage-4ETIBMIW.js} +2 -2
- package/dist/chunks/{registry-GURQG4ZV.js → registry-3FYSWV3U.js} +3 -3
- package/dist/chunks/{registry-SS5J2FZQ.js → registry-7RS74TCK.js} +4 -4
- package/dist/chunks/{registry-WZCCBI5L.js → registry-I4DVPDMU.js} +11 -10
- package/dist/chunks/{room-recommend-CKU5NF2E.js → room-recommend-GWCVKCXW.js} +4 -4
- package/dist/chunks/{schedule-DEFAO2RY.js → schedule-6AN63MJQ.js} +4 -4
- package/dist/chunks/{smart-extract-APX2PNIN.js → smart-extract-SR4SJJKN.js} +3 -3
- package/dist/chunks/{workflow-WMPW3WSB.js → workflow-KF7FA2UQ.js} +7 -7
- package/dist/cmd/refs/index.js +124 -4
- package/dist/core/output.js +199 -26
- package/dist/core/refs.js +36 -0
- package/dist/index.js +38 -33
- package/dist/internal/e10/auth/xiaoe.js +25 -3
- package/dist/shortcuts/caizhilian/operations/files.js +86 -15
- package/dist/shortcuts/data/index.js +12 -2
- package/dist/shortcuts/data/manifest.js +4 -2
- package/dist/shortcuts/data/operations/attribution.js +229 -0
- package/dist/shortcuts/data/operations/ds.js +87 -92
- package/dist/shortcuts/data/operations/index.js +3 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +111 -12
- package/dist/shortcuts/meeting/operations/eb/entry-mode.js +116 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +11 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/performance/continuation.js +74 -0
- package/dist/shortcuts/performance/errors.js +65 -0
- package/dist/shortcuts/performance/host.js +105 -0
- package/dist/shortcuts/performance/index.js +109 -0
- package/dist/shortcuts/performance/manifest.js +30 -0
- package/dist/shortcuts/performance/operations/hrm-resolve.js +114 -0
- package/dist/shortcuts/performance/operations/registry.js +44 -0
- package/dist/shortcuts/performance/operations/scheme-detail.js +70 -0
- package/dist/shortcuts/performance/operations/scheme-draft.js +116 -0
- package/dist/shortcuts/performance/operations/scheme-publish.js +158 -0
- package/dist/shortcuts/performance/operations/types.js +32 -0
- package/dist/shortcuts/performance/scheme-validate.js +307 -0
- package/dist/shortcuts/performance/shared.js +158 -0
- package/docs/agent-io-channel-design.md +67 -3
- package/docs/data.md +2 -1
- package/package.json +1 -1
- package/scripts/xiaoe_env.py +6 -1
- package/skill-template/business-info.json +19 -0
- package/skill-template/domains/performance.md +18 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-data/references/datasource.md +2 -1
- package/skills/weaver-e10-meeting/SKILL.md +16 -3
- package/skills/weaver-e10-performance/SKILL.md +202 -0
- package/skills/weaver-e10-performance/agents/openai.yaml +74 -0
- package/skills/weaver-e10-performance/references/default-assembly.md +108 -0
- package/skills/weaver-e10-performance/references/entity-resolution.md +69 -0
- package/skills/weaver-e10-performance/references/enums-and-normalization.md +80 -0
- package/skills/weaver-e10-performance/references/examples.md +146 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +144 -0
- package/skills/weaver-e10-performance/references/scheme-edit-req-fields.md +185 -0
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +62 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +483 -0
- package/skills/weaver-e10-shared/references/json-output-contract.md +5 -0
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
isE10SessionExpiredResponse,
|
|
7
7
|
requireE10Session
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NRYDJN4J.js";
|
|
9
9
|
import {
|
|
10
10
|
E10_SESSION_EXPIRED_MESSAGE
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WIWDVETN.js";
|
|
12
12
|
import "./chunk-SHYQUBY3.js";
|
|
13
13
|
import {
|
|
14
14
|
CliError
|
|
@@ -171,11 +171,11 @@ function createDataHost(ctx, dependencies = {}) {
|
|
|
171
171
|
return { status: response.status, text: response.text, value: response.value };
|
|
172
172
|
}
|
|
173
173
|
async function request(request2) {
|
|
174
|
-
const { status, value, text } = await requestText(request2);
|
|
174
|
+
const { status, value, text: text2 } = await requestText(request2);
|
|
175
175
|
if (status < 200 || status >= 300) {
|
|
176
176
|
throw dataApiError("http_error", `\u63A5\u53E3 HTTP ${status}`, {
|
|
177
177
|
code: status,
|
|
178
|
-
details: { status, body: String(
|
|
178
|
+
details: { status, body: String(text2 ?? "").slice(0, 500) },
|
|
179
179
|
exitCode: 7
|
|
180
180
|
});
|
|
181
181
|
}
|
|
@@ -233,9 +233,9 @@ function parseJsonSafe(raw) {
|
|
|
233
233
|
function readJsonArg(value, label) {
|
|
234
234
|
if (value === void 0 || value === null || value === true) return void 0;
|
|
235
235
|
const raw = String(value);
|
|
236
|
-
const
|
|
236
|
+
const text2 = raw.startsWith("@") ? readFileSync(raw.slice(1), "utf-8") : raw;
|
|
237
237
|
try {
|
|
238
|
-
return parseJsonSafe(
|
|
238
|
+
return parseJsonSafe(text2);
|
|
239
239
|
} catch (error) {
|
|
240
240
|
throw dataValidationError("json_invalid", `${label} \u4E0D\u662F\u5408\u6CD5 JSON\uFF1A${error.message}`);
|
|
241
241
|
}
|
|
@@ -441,8 +441,8 @@ function tipsLines(tips) {
|
|
|
441
441
|
function cell(value) {
|
|
442
442
|
if (value === null || value === void 0) return "";
|
|
443
443
|
if (typeof value === "object") {
|
|
444
|
-
const
|
|
445
|
-
return
|
|
444
|
+
const text2 = JSON.stringify(value);
|
|
445
|
+
return text2.length > 80 ? `${text2.slice(0, 80)}\u2026` : text2;
|
|
446
446
|
}
|
|
447
447
|
return String(value);
|
|
448
448
|
}
|
|
@@ -513,66 +513,42 @@ async function executeQuery(input, host) {
|
|
|
513
513
|
}
|
|
514
514
|
|
|
515
515
|
// src/shortcuts/data/operations/ds.ts
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
[36, "\u5F85\u529E\u4E8B\u9879", "weaver-my-service", null],
|
|
553
|
-
[37, "\u7B7E\u540D", "weaver-signature-service", null],
|
|
554
|
-
[38, "\u90AE\u4EF6", "weaver-mail-base-service", "email"],
|
|
555
|
-
[39, "\u85AA\u916C", "weaver-hrm-salary", "hrmsalary"],
|
|
556
|
-
[40, "\u7CFB\u7EDF\u5B89\u5168", "weaver-security-framework-service", "security"],
|
|
557
|
-
[41, "\u516C\u6587\u4EA4\u6362\u4E2D\u5FC3", "weaver-odocexchange-service", "odocexchange"],
|
|
558
|
-
[42, "\u62DB\u8058\u7BA1\u7406", "weaver-recruit-service", "recruit"],
|
|
559
|
-
[43, "\u5FAE\u641C", "weaver-esearch-search-service", null],
|
|
560
|
-
[44, "\u7EDF\u4E00\u5BA1\u6279\u4E2D\u5FC3", "weaver-intunifytodo-server-config-service", "intunifytodos"],
|
|
561
|
-
[45, "\u516C\u5171\u6570\u636E\u6E90", "weaver-component-web-service", "common"],
|
|
562
|
-
[46, "\u6570\u636E\u5206\u6790", "weaver-analyze-service", "analyze"],
|
|
563
|
-
[47, "\u8D22\u52A1\u6A21\u5757", "weaver-fna-expense-servicefexs", "fna"],
|
|
564
|
-
[48, "ESB\u8FDE\u63A5\u5668", "weaver-esb-setting-serviceesbConnect", "esb"],
|
|
565
|
-
[49, "AI\u8FDE\u63A5\u5668", "weaver-ai-application-service", "ai"],
|
|
566
|
-
[50, "\u5916\u90E8\u6D41\u7A0B", "weaver-workflow-core-serviceworkflowCoreOuterwf", "workflow"],
|
|
567
|
-
[51, "\u7EE9\u6548\u8003\u6838", "weaver-wr-performance-eb-service", "ebuilder"],
|
|
568
|
-
[52, "\u95EE\u9898\u5B9A\u4F4D\u5E73\u53F0", "weaver-tissot-service", "tissot"],
|
|
569
|
-
[53, "\u5DE5\u4F5C\u6D41\u57FA\u7840\u6548\u7387", "weaver-workflow-report-serviceworkflowEffReport", "workflow"],
|
|
570
|
-
[54, "\u5DE5\u4F5C\u6D41\u64CD\u4F5C\u8005\u6548\u7387", "weaver-workflow-report-serviceworkflowEffOperateReport", "workflow"],
|
|
571
|
-
[55, "\u5DE5\u4F5C\u6D41\u8282\u70B9\u6548\u7387", "weaver-workflow-report-serviceworkflowEffNodeReport", "workflow"],
|
|
572
|
-
[56, "\u89C4\u5219\u5F15\u64CE", "weaver-logicflow-service", "logicflow"],
|
|
573
|
-
[57, "\u5DE5\u4F5C\u6D41\u8868\u5355", "weaver-workflow-report-serviceworkflowFormReport", "workflow"],
|
|
574
|
-
[58, "\u7EDF\u4E00\u8BA4\u8BC1\u4E2D\u5FC3", "weaver-intunifyauth-server-base-service", null]
|
|
575
|
-
];
|
|
516
|
+
var DS_GROUPS_PATH = "/api/dw/ds/group";
|
|
517
|
+
var DS_GROUPS_SOURCE_TYPE = "LOGIC";
|
|
518
|
+
function normalizeServiceMark(raw) {
|
|
519
|
+
return typeof raw === "string" && raw.trim() !== "" ? raw : null;
|
|
520
|
+
}
|
|
521
|
+
function groupIndex(groups) {
|
|
522
|
+
return new Map(groups.map((group) => [group.groupId, group]));
|
|
523
|
+
}
|
|
524
|
+
async function fetchGroups(host) {
|
|
525
|
+
const response = await host.request({
|
|
526
|
+
method: "GET",
|
|
527
|
+
path: DS_GROUPS_PATH,
|
|
528
|
+
query: { sourceType: DS_GROUPS_SOURCE_TYPE },
|
|
529
|
+
operation: "ds.groups"
|
|
530
|
+
});
|
|
531
|
+
const rows = response?.data;
|
|
532
|
+
if (response?.code !== void 0 && response.code !== 200) {
|
|
533
|
+
throw dataApiError(
|
|
534
|
+
"groups_failed",
|
|
535
|
+
`\u5206\u7EC4\u6E05\u5355\u63A5\u53E3\u8FD4\u56DE\u5931\u8D25\uFF1A${response?.msg || `code=${response.code}`}`,
|
|
536
|
+
{ code: response.code, details: { sourceType: DS_GROUPS_SOURCE_TYPE } }
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
if (!Array.isArray(rows)) {
|
|
540
|
+
throw dataApiError(
|
|
541
|
+
"groups_failed",
|
|
542
|
+
`\u5206\u7EC4\u6E05\u5355\u63A5\u53E3\u5F02\u5E38\uFF1A${response?.msg || "\u672A\u8FD4\u56DE data \u6570\u7EC4"}`,
|
|
543
|
+
{ code: response?.code, details: { sourceType: DS_GROUPS_SOURCE_TYPE } }
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
return rows.filter((row) => row && typeof row.id === "string" && row.id !== "").map((row) => ({
|
|
547
|
+
groupId: row.id,
|
|
548
|
+
label: String(row.name ?? ""),
|
|
549
|
+
serviceMark: normalizeServiceMark(row.serviceMark)
|
|
550
|
+
}));
|
|
551
|
+
}
|
|
576
552
|
var DS_CORE_GROUPS = [
|
|
577
553
|
"weaver-formreport-service",
|
|
578
554
|
"weaver-ebuilder-form-service",
|
|
@@ -584,7 +560,6 @@ var DS_FIND_SEMANTIC_RULES = [
|
|
|
584
560
|
{ tag: "\u65E5\u62A5/\u5468\u62A5", re: /日报|周报|月报|年报|工作总结/, groups: ["weaver-blog-service", "weaver-wr-plan-service"] },
|
|
585
561
|
{ tag: "\u6587\u6863/\u9644\u4EF6", re: /文档|附件|文件夹|共享|资料/, groups: ["weaver-doc-servicedocument", "weaver-doc-service", "weaver-file-service"] },
|
|
586
562
|
{ tag: "\u9879\u76EE/\u4EFB\u52A1", re: /项目|任务|工时|里程碑|延期|验收/, groups: ["weaver-project-service", "weaver-project-servicetask"] },
|
|
587
|
-
{ tag: "\u5BA2\u6237/\u5546\u673A", re: /客户|商机|线索|联系人|公海|销售|CRM|营销/i, groups: ["weaver-crm-service", "weaver-crm-market-service"] },
|
|
588
563
|
{ tag: "\u4F1A\u8BAE/\u65E5\u7A0B", re: /会议|日程|日历|预约|会议室|预定/, groups: ["weaver-meeting-service", "weaver-calendar-service"] },
|
|
589
564
|
{ tag: "\u4EBA\u4E8B/\u62DB\u8058", re: /招聘|入职|离职|offer|人才|员工|人员|通讯录|调岗|组织/i, groups: ["weaver-recruit-service", "weaver-hr-service", "weaver-hrm-service"] },
|
|
590
565
|
{ tag: "\u85AA\u916C/\u7EE9\u6548", re: /薪酬|薪资|工资|社保|公积金|绩效|考核|KPI|OKR/i, groups: ["weaver-hrm-salary", "weaver-wr-performance-service", "weaver-wr-goal-service"] },
|
|
@@ -592,13 +567,11 @@ var DS_FIND_SEMANTIC_RULES = [
|
|
|
592
567
|
{ tag: "\u90AE\u4EF6/\u516C\u6587", re: /邮件|收件箱|公文|发文|档案|借阅/, groups: ["weaver-mail-base-service", "weaver-odoc-service"] },
|
|
593
568
|
{ tag: "\u8D44\u4EA7/\u65E5\u5FD7", re: /资产|台账|日志|动作流|自动化/, groups: ["weaver-elog-service", "weaver-esb-setting-serviceesbCustom"] }
|
|
594
569
|
];
|
|
595
|
-
function groupLabel(groupId) {
|
|
596
|
-
|
|
597
|
-
return hit ? hit[1] : null;
|
|
570
|
+
function groupLabel(index, groupId) {
|
|
571
|
+
return index?.get(groupId)?.label ?? null;
|
|
598
572
|
}
|
|
599
|
-
function groupMark(groupId) {
|
|
600
|
-
|
|
601
|
-
return hit ? hit[3] : null;
|
|
573
|
+
function groupMark(index, groupId) {
|
|
574
|
+
return index?.get(groupId)?.serviceMark ?? null;
|
|
602
575
|
}
|
|
603
576
|
function explicitAppId(input) {
|
|
604
577
|
const appId = input.app_id;
|
|
@@ -637,17 +610,23 @@ function renderFields(response) {
|
|
|
637
610
|
}
|
|
638
611
|
return lines.length ? lines.join("\n") : "(\u7A7A\uFF1A\u672A\u8FD4\u56DE\u5B57\u6BB5)";
|
|
639
612
|
}
|
|
640
|
-
async function dsGroups(input) {
|
|
613
|
+
async function dsGroups(input, host) {
|
|
641
614
|
const pattern = input.pattern ? String(input.pattern) : null;
|
|
642
|
-
const
|
|
615
|
+
const live = await fetchGroups(host);
|
|
616
|
+
const groups = live.filter((item) => !pattern || item.groupId.includes(pattern) || item.label.includes(pattern));
|
|
617
|
+
const liveIds = new Set(live.map((item) => item.groupId));
|
|
643
618
|
const data = {
|
|
644
619
|
count: groups.length,
|
|
645
620
|
groups,
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
621
|
+
sourceType: DS_GROUPS_SOURCE_TYPE,
|
|
622
|
+
coreGroups: DS_CORE_GROUPS.filter((groupId) => liveIds.has(groupId)),
|
|
623
|
+
semanticRules: DS_FIND_SEMANTIC_RULES.map((rule) => ({ tag: rule.tag, groups: rule.groups.filter((groupId) => liveIds.has(groupId)) })).filter((rule) => rule.groups.length > 0),
|
|
624
|
+
note: `\u5206\u7EC4\u6E05\u5355\u6765\u81EA ${DS_GROUPS_PATH} \u5B9E\u65F6\u8FD4\u56DE\uFF08sourceType=${DS_GROUPS_SOURCE_TYPE}\uFF09\uFF0C\u63A5\u53E3\u8FD4\u56DE\u4EC0\u4E48\u5C31\u662F\u4EC0\u4E48\u3001\u968F\u73AF\u5883\u589E\u51CF\uFF1Bds find \u7684\u9ED8\u8BA4\u626B\u63CF\u5019\u9009\u540C\u6837\u53EA\u53D6\u5B9E\u65F6\u5206\u7EC4\uFF0C\u9700\u7F29\u5C0F\u8303\u56F4\u65F6\u7528 --groups \u663E\u5F0F\u6307\u5B9A`
|
|
625
|
+
};
|
|
626
|
+
return {
|
|
627
|
+
data,
|
|
628
|
+
text: renderTable(`\u5206\u7EC4\u6E05\u5355 ${groups.length} \u4E2A\uFF08\u5B9E\u65F6\uFF09`, groups, ["groupId", "label", "serviceMark"])
|
|
649
629
|
};
|
|
650
|
-
return { data, text: renderTable(`\u5185\u7F6E\u5206\u7EC4\u6E05\u5355 ${groups.length} \u4E2A`, groups, ["groupId", "label", "serviceMark"]) };
|
|
651
630
|
}
|
|
652
631
|
async function dsTables(input, host) {
|
|
653
632
|
const groupId = needArg(input, "group");
|
|
@@ -767,15 +746,16 @@ async function dsCount(input, host) {
|
|
|
767
746
|
text: [...tipsLines(tips), `totalCount = ${response?.data?.totalCount ?? "-"}`].join("\n")
|
|
768
747
|
};
|
|
769
748
|
}
|
|
770
|
-
function pickFindGroups(input, keyword) {
|
|
749
|
+
function pickFindGroups(input, keyword, live) {
|
|
771
750
|
if (input.groups) {
|
|
772
751
|
return { mode: "explicit", groups: String(input.groups).split(",").map((item) => item.trim()).filter(Boolean) };
|
|
773
752
|
}
|
|
774
|
-
if (input.all_groups) return { mode: "all", groups:
|
|
753
|
+
if (input.all_groups) return { mode: "all", groups: live.map((item) => item.groupId) };
|
|
775
754
|
const max = Math.max(Number(input.max_groups || "6") || 6, DS_CORE_GROUPS.length);
|
|
755
|
+
const liveIds = new Set(live.map((item) => item.groupId));
|
|
776
756
|
const picked = [];
|
|
777
757
|
const push = (groupId) => {
|
|
778
|
-
if (groupId && !picked.includes(groupId)) picked.push(groupId);
|
|
758
|
+
if (groupId && liveIds.has(groupId) && !picked.includes(groupId)) picked.push(groupId);
|
|
779
759
|
};
|
|
780
760
|
for (const groupId of DS_CORE_GROUPS) push(groupId);
|
|
781
761
|
for (const rule of DS_FIND_SEMANTIC_RULES) {
|
|
@@ -796,12 +776,12 @@ async function mapLimit(items, limit, fn) {
|
|
|
796
776
|
await Promise.all(workers);
|
|
797
777
|
return out;
|
|
798
778
|
}
|
|
799
|
-
async function scanGroups(host, groupIds, keyword, sourceType, pageSize, concurrency, appId, pages) {
|
|
779
|
+
async function scanGroups(host, index, groupIds, keyword, sourceType, pageSize, concurrency, appId, pages) {
|
|
800
780
|
return mapLimit(groupIds, concurrency, async (groupId) => {
|
|
801
781
|
const result = {
|
|
802
782
|
groupId,
|
|
803
|
-
label: groupLabel(groupId),
|
|
804
|
-
serviceMark: groupMark(groupId),
|
|
783
|
+
label: groupLabel(index, groupId),
|
|
784
|
+
serviceMark: groupMark(index, groupId),
|
|
805
785
|
records: [],
|
|
806
786
|
error: null,
|
|
807
787
|
total: null,
|
|
@@ -897,7 +877,7 @@ function routeHint(candidates) {
|
|
|
897
877
|
if (has((c) => c.serviceMark === "attend")) return { channel: "EHR", desc: "EHR \u6A21\u5757\u914D\u7F6E\u901A\u9053\uFF08\u8003\u52E4/\u4EBA\u4E8B\uFF09", reason: "\u547D\u4E2D\u8003\u52E4\u5206\u7EC4" };
|
|
898
878
|
if (has((c) => c.serviceMark === "blog")) return { channel: "BLOG_DAILY", desc: "BLOG_DAILY \u6A21\u5757\u914D\u7F6E\u901A\u9053\uFF08\u65E5\u62A5\uFF09", reason: "\u547D\u4E2D\u65E5\u62A5\u5206\u7EC4" };
|
|
899
879
|
if (has((c) => c.serviceMark === "document")) return { channel: "DOCUMENT", desc: "DOCUMENT \u6A21\u5757\u914D\u7F6E\u901A\u9053\uFF08\u6587\u6863\uFF09", reason: "\u547D\u4E2D\u6587\u6863\u5206\u7EC4" };
|
|
900
|
-
if (has((c) => c.serviceMark === "customer" || c.serviceMark === "scrm")) {
|
|
880
|
+
if (has((c) => c.serviceMark === "customer" || c.serviceMark === "crm" || c.serviceMark === "scrm")) {
|
|
901
881
|
return { channel: "CRM", desc: "CRM \u6A21\u5757\u914D\u7F6E\u901A\u9053\uFF08\u5BA2\u6237/\u5546\u673A/\u7EBF\u7D22\uFF09", reason: "\u547D\u4E2D CRM \u5206\u7EC4" };
|
|
902
882
|
}
|
|
903
883
|
if (has((c) => c.serviceMark === "esb")) return { channel: "ESB", desc: "\u52A8\u4F5C\u6D41\uFF08ESB\uFF09\u2014\u2014 \u65E0\u6807\u51C6\u95EE\u6570\u901A\u9053\uFF0C\u9700\u4EBA\u5DE5\u786E\u8BA4", reason: "\u4EC5\u547D\u4E2D\u52A8\u4F5C\u6D41\u5206\u7EC4" };
|
|
@@ -911,9 +891,11 @@ async function dsFind(input, host) {
|
|
|
911
891
|
const pages = Math.min(Math.max(Number(input.pages || "1") || 1, 1), 50);
|
|
912
892
|
const concurrency = Math.max(1, Number(input.concurrency || "10") || 10);
|
|
913
893
|
const appId = explicitAppId(input);
|
|
914
|
-
const
|
|
894
|
+
const live = await fetchGroups(host);
|
|
895
|
+
const index = groupIndex(live);
|
|
896
|
+
const picked = pickFindGroups(input, keyword, live);
|
|
915
897
|
const startedAt = Date.now();
|
|
916
|
-
let scan = await scanGroups(host, picked.groups, keyword, sourceType, pageSize, concurrency, appId, pages);
|
|
898
|
+
let scan = await scanGroups(host, index, picked.groups, keyword, sourceType, pageSize, concurrency, appId, pages);
|
|
917
899
|
const keywordNorm = keyword.replace(/\s+/g, "").toLowerCase();
|
|
918
900
|
const looseSample = [];
|
|
919
901
|
let looseDropped = 0;
|
|
@@ -941,8 +923,8 @@ async function dsFind(input, host) {
|
|
|
941
923
|
if (!scan.some((result) => result.records.length) && picked.mode === "core" && !input.no_escalate && escalateOk) {
|
|
942
924
|
escalated = true;
|
|
943
925
|
const seen = new Set(picked.groups);
|
|
944
|
-
const extra =
|
|
945
|
-
scan = scan.concat(applyStrict(await scanGroups(host, extra, keyword, sourceType, pageSize, concurrency, appId, pages)));
|
|
926
|
+
const extra = live.map((item) => item.groupId).filter((groupId) => !seen.has(groupId));
|
|
927
|
+
scan = scan.concat(applyStrict(await scanGroups(host, index, extra, keyword, sourceType, pageSize, concurrency, appId, pages)));
|
|
946
928
|
}
|
|
947
929
|
const elapsedMs = Date.now() - startedAt;
|
|
948
930
|
const okScan = scan.filter((result) => !result.error);
|
|
@@ -1064,6 +1046,12 @@ async function dsDescribe(input, host) {
|
|
|
1064
1046
|
const tableId = String(needArg(input, "table"));
|
|
1065
1047
|
const sourceType = String(input.source_type || "LOGIC");
|
|
1066
1048
|
const startedAt = Date.now();
|
|
1049
|
+
let index = null;
|
|
1050
|
+
try {
|
|
1051
|
+
index = groupIndex(await fetchGroups(host));
|
|
1052
|
+
} catch {
|
|
1053
|
+
index = null;
|
|
1054
|
+
}
|
|
1067
1055
|
const branches = await Promise.all([
|
|
1068
1056
|
(async () => {
|
|
1069
1057
|
try {
|
|
@@ -1114,7 +1102,7 @@ async function dsDescribe(input, host) {
|
|
|
1114
1102
|
}
|
|
1115
1103
|
})()
|
|
1116
1104
|
]);
|
|
1117
|
-
const data = { groupId, groupLabel: groupLabel(groupId), tableId, sourceType, branches: branches.length };
|
|
1105
|
+
const data = { groupId, groupLabel: groupLabel(index, groupId), tableId, sourceType, branches: branches.length };
|
|
1118
1106
|
const errors = [];
|
|
1119
1107
|
for (const branch of branches) {
|
|
1120
1108
|
if (branch.error) {
|
|
@@ -1125,7 +1113,7 @@ async function dsDescribe(input, host) {
|
|
|
1125
1113
|
}
|
|
1126
1114
|
}
|
|
1127
1115
|
data.relatedFields = relatedHint(groupId, data.fields?.detailCount || 0);
|
|
1128
|
-
data.channelHint = routeHint([{ groupId, serviceMark: groupMark(groupId) }]);
|
|
1116
|
+
data.channelHint = routeHint([{ groupId, serviceMark: groupMark(index, groupId) }]);
|
|
1129
1117
|
data.permissionNote = groupId === "weaver-ebuilder-form-service" ? "\u8BE5\u5206\u7EC4\u662F EB \u5EFA\u6A21\u8868\u5355\uFF1A\u53D6\u6570\u4E0D\u518D\u505A\u6743\u9650\u524D\u7F6E\u6821\u9A8C\uFF0C--app-id \u76F4\u63A5\u53D6 ebdf_obj.app_id\uFF08obj_id = ebdf_obj.id = \u6570\u636E\u6E90 tableId\uFF09" : "\u975E EB \u5206\u7EC4\uFF0C\u6570\u636E\u6E90\u901A\u9053\u65E0\u9700 appId";
|
|
1130
1118
|
data.elapsedMs = Date.now() - startedAt;
|
|
1131
1119
|
if (errors.length && input.require) {
|
|
@@ -1325,6 +1313,166 @@ async function nounScope(input, host) {
|
|
|
1325
1313
|
return { data: { scopeIds: ids, count: docs.length, globalCount, scopedCount, docs }, text: lines.join("\n") };
|
|
1326
1314
|
}
|
|
1327
1315
|
|
|
1316
|
+
// src/shortcuts/data/operations/attribution.ts
|
|
1317
|
+
var ATTRIBUTION_PATH = "/api/dw/newetl/chatBi/attribution/getAttributionMetricByScopeId";
|
|
1318
|
+
function parseIds(value, flag) {
|
|
1319
|
+
const raw = String(readListArg(value) ?? "").trim();
|
|
1320
|
+
if (!raw) return [];
|
|
1321
|
+
const ids = raw.replace(/^\[|\]$/g, "").split(/[,\s]+/).map((item) => item.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
|
|
1322
|
+
for (const id of ids) {
|
|
1323
|
+
if (!/^\d+$/.test(id)) {
|
|
1324
|
+
throw dataValidationError("ids_invalid", `${flag} \u542B\u975E\u6CD5\u9879\u300C${id}\u300D\uFF08\u987B\u4E3A\u6570\u5B57\u578B id\uFF1A\u5206\u7EC4 id \u53D6\u81EA scene groups\uFF0C\u6761\u76EE id \u53D6\u81EA scene items\uFF09`);
|
|
1325
|
+
}
|
|
1326
|
+
if (BigInt(id) > 9223372036854775807n) {
|
|
1327
|
+
throw dataValidationError("ids_invalid", `${flag} \u542B\u8D85\u51FA Long \u4E0A\u9650\u7684 id\uFF1A${id}`);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
return ids;
|
|
1331
|
+
}
|
|
1332
|
+
function parseAttributionScopeIds(input) {
|
|
1333
|
+
const ids = [
|
|
1334
|
+
.../* @__PURE__ */ new Set([
|
|
1335
|
+
...parseIds(input.ids, "--ids"),
|
|
1336
|
+
...parseIds(input.group_ids, "--group-ids"),
|
|
1337
|
+
...parseIds(input.item_ids, "--item-ids")
|
|
1338
|
+
])
|
|
1339
|
+
];
|
|
1340
|
+
if (!ids.length) {
|
|
1341
|
+
throw dataValidationError(
|
|
1342
|
+
"missing_argument",
|
|
1343
|
+
"\u7F3A\u5C11\u751F\u6548\u8303\u56F4 id\uFF1A\u8BF7\u4F20 --ids\uFF08\u5206\u7EC4 id + \u6761\u76EE id \u5408\u5E76\uFF09\uFF0C\u6216\u5206\u522B\u4F20 --group-ids / --item-ids\uFF08\u5982 --ids 1060565684758507537,2120434818314403840 \u6216 --ids @ids.json\uFF09"
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
return ids;
|
|
1347
|
+
}
|
|
1348
|
+
function text(value) {
|
|
1349
|
+
return value === null || value === void 0 ? "" : String(value).trim();
|
|
1350
|
+
}
|
|
1351
|
+
function splitDimensions(raw) {
|
|
1352
|
+
const value = text(raw);
|
|
1353
|
+
if (!value) return [];
|
|
1354
|
+
return value.split(/[;;]/).map((item) => item.trim()).filter(Boolean);
|
|
1355
|
+
}
|
|
1356
|
+
function parseDrillPaths(raw) {
|
|
1357
|
+
if (Array.isArray(raw)) return raw.map((item) => splitPath(text(item))).filter((path) => path.length);
|
|
1358
|
+
const value = text(raw);
|
|
1359
|
+
if (!value) return [];
|
|
1360
|
+
try {
|
|
1361
|
+
const parsed = JSON.parse(value);
|
|
1362
|
+
if (Array.isArray(parsed)) return parsed.map((item) => splitPath(text(item))).filter((path) => path.length);
|
|
1363
|
+
if (typeof parsed === "string") return [splitPath(parsed)].filter((path) => path.length);
|
|
1364
|
+
} catch {
|
|
1365
|
+
}
|
|
1366
|
+
return value.split(/[;;]/).map(splitPath).filter((path) => path.length);
|
|
1367
|
+
}
|
|
1368
|
+
function splitPath(value) {
|
|
1369
|
+
return value.split(/\s*>\s*/).map((item) => item.trim()).filter(Boolean);
|
|
1370
|
+
}
|
|
1371
|
+
function scopeLevelOf(record, groupIds, itemIds, allIds) {
|
|
1372
|
+
const effectId = text(record?.scopeEffectId);
|
|
1373
|
+
const allScope = record?.allScope === null || record?.allScope === void 0 ? null : Number(record.allScope);
|
|
1374
|
+
if (effectId) {
|
|
1375
|
+
if (itemIds.includes(effectId)) return { level: "item", matchedId: effectId };
|
|
1376
|
+
if (groupIds.includes(effectId)) return { level: "group", matchedId: effectId };
|
|
1377
|
+
if (allIds.includes(effectId)) return { level: "scoped", matchedId: effectId };
|
|
1378
|
+
return { level: "other", matchedId: effectId };
|
|
1379
|
+
}
|
|
1380
|
+
if (allScope === 1) return { level: "global", matchedId: "" };
|
|
1381
|
+
return { level: "other", matchedId: "" };
|
|
1382
|
+
}
|
|
1383
|
+
var LEVEL_ORDER = { item: 0, group: 1, scoped: 2, other: 3, global: 4 };
|
|
1384
|
+
var LEVEL_LABEL = {
|
|
1385
|
+
item: "\u6761\u76EE\u7EA7",
|
|
1386
|
+
group: "\u5206\u7EC4\u7EA7",
|
|
1387
|
+
scoped: "\u672C\u6B21\u8303\u56F4",
|
|
1388
|
+
other: "\u5176\u5B83\u8303\u56F4",
|
|
1389
|
+
global: "\u5168\u5C40"
|
|
1390
|
+
};
|
|
1391
|
+
function normalizeAttributionMetric(record, groupIds = [], itemIds = [], allIds = []) {
|
|
1392
|
+
const { level, matchedId } = scopeLevelOf(record, groupIds, itemIds, allIds);
|
|
1393
|
+
const normalized = {
|
|
1394
|
+
id: text(record?.id),
|
|
1395
|
+
metricName: text(record?.metricName),
|
|
1396
|
+
caliber: text(record?.caliber),
|
|
1397
|
+
dimensions: splitDimensions(record?.dimensions),
|
|
1398
|
+
drillPaths: parseDrillPaths(record?.drillPaths),
|
|
1399
|
+
allScope: record?.allScope === null || record?.allScope === void 0 ? null : Number(record.allScope),
|
|
1400
|
+
scopeEffectId: text(record?.scopeEffectId),
|
|
1401
|
+
scopeLevel: level,
|
|
1402
|
+
matchedId,
|
|
1403
|
+
scopes: text(record?.scopes),
|
|
1404
|
+
scopeTableInfo: parseJsonOrRaw(record?.scopeTableInfo)
|
|
1405
|
+
};
|
|
1406
|
+
if (record?.creator !== void 0) normalized.creator = text(record.creator);
|
|
1407
|
+
if (record?.createTime !== void 0) normalized.createTime = text(record.createTime);
|
|
1408
|
+
if (record?.updateTime !== void 0) normalized.updateTime = text(record.updateTime);
|
|
1409
|
+
return normalized;
|
|
1410
|
+
}
|
|
1411
|
+
function parseJsonOrRaw(value) {
|
|
1412
|
+
const raw = text(value);
|
|
1413
|
+
if (!raw) return value ?? null;
|
|
1414
|
+
try {
|
|
1415
|
+
return JSON.parse(raw);
|
|
1416
|
+
} catch {
|
|
1417
|
+
return raw;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
function renderRecord(record) {
|
|
1421
|
+
const lines = [];
|
|
1422
|
+
const scope = record.scopeEffectId ? `${LEVEL_LABEL[record.scopeLevel]} ${record.scopeEffectId}` : LEVEL_LABEL[record.scopeLevel];
|
|
1423
|
+
lines.push(`\u3010${record.metricName || "(\u672A\u547D\u540D\u6307\u6807)"}\u3011 [${scope}]`);
|
|
1424
|
+
if (record.caliber) lines.push(` \u8BA1\u7B97\u53E3\u5F84\uFF1A${record.caliber.replace(/\n/g, " ")}`);
|
|
1425
|
+
if (record.dimensions.length) lines.push(` \u53EF\u5173\u8054\u7EF4\u5EA6\uFF1A${record.dimensions.join(" / ")}`);
|
|
1426
|
+
if (record.drillPaths.length) {
|
|
1427
|
+
lines.push(` \u4E0B\u94BB\u8DEF\u5F84\uFF1A${record.drillPaths.map((path) => path.join(" > ")).join("\uFF1B")}`);
|
|
1428
|
+
}
|
|
1429
|
+
if (!record.dimensions.length && !record.drillPaths.length) lines.push(" (\u8BE5\u6761\u8BBE\u7F6E\u672A\u914D\u7F6E\u7EF4\u5EA6 / \u4E0B\u94BB\u8DEF\u5F84)");
|
|
1430
|
+
return lines;
|
|
1431
|
+
}
|
|
1432
|
+
async function attributionMetric(input, host) {
|
|
1433
|
+
const ids = parseAttributionScopeIds(input);
|
|
1434
|
+
const groupIds = parseIds(input.group_ids, "--group-ids");
|
|
1435
|
+
const itemIds = parseIds(input.item_ids, "--item-ids");
|
|
1436
|
+
const response = await host.request({
|
|
1437
|
+
method: "POST",
|
|
1438
|
+
path: ATTRIBUTION_PATH,
|
|
1439
|
+
body: ids.map(String),
|
|
1440
|
+
operation: "attribution.metric"
|
|
1441
|
+
});
|
|
1442
|
+
const code = response?.actionMsg?.code ?? response?.code;
|
|
1443
|
+
const message = response?.actionMsg?.message ?? response?.msg;
|
|
1444
|
+
const bad = code !== void 0 && Number(code) !== 0 || response?.fail === true;
|
|
1445
|
+
if (bad) {
|
|
1446
|
+
throw dataApiError(
|
|
1447
|
+
"attribution_metric_failed",
|
|
1448
|
+
`getAttributionMetricByScopeId \u4E1A\u52A1\u5931\u8D25\uFF1Acode=${code} msg=${message || "(\u65E0 msg)"}`,
|
|
1449
|
+
{ code }
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
const rawList = Array.isArray(response?.data) ? response.data : response?.data ? [response.data] : [];
|
|
1453
|
+
const metrics = rawList.map((record) => normalizeAttributionMetric(record, groupIds, itemIds, ids)).sort((a, b) => LEVEL_ORDER[a.scopeLevel] - LEVEL_ORDER[b.scopeLevel]);
|
|
1454
|
+
const scoped = metrics.filter((record) => record.scopeLevel !== "global");
|
|
1455
|
+
const lines = [`== \u5F52\u56E0\u8BBE\u7F6E ${metrics.length} \u6761\uFF08\u751F\u6548\u8303\u56F4 id ${ids.length} \u4E2A\uFF1B\u975E\u5168\u5C40 ${scoped.length} \uFF0B \u5168\u5C40 ${metrics.length - scoped.length}\uFF09==`];
|
|
1456
|
+
if (!metrics.length) {
|
|
1457
|
+
lines.push("(\u7A7A\uFF1A\u8BE5\u73AF\u5883\u672A\u8FD4\u56DE\u4EFB\u4F55\u5F52\u56E0\u8BBE\u7F6E \u21D2 \u6309\u6280\u80FD\u901A\u7528\u89C4\u5219\u5F52\u56E0)");
|
|
1458
|
+
} else {
|
|
1459
|
+
for (const record of metrics) lines.push(...renderRecord(record));
|
|
1460
|
+
if (!scoped.length) {
|
|
1461
|
+
lines.push("(\u63D0\u793A\uFF1A\u672C\u6B21\u53EA\u547D\u4E2D\u5168\u5C40\u8BBE\u7F6E\uFF0C\u6240\u9009\u5206\u7EC4 / \u6761\u76EE\u672C\u8EAB\u672A\u5355\u72EC\u7ED1\u5B9A\u5F52\u56E0\u53E3\u5F84)");
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
return {
|
|
1465
|
+
data: {
|
|
1466
|
+
scopeIds: ids,
|
|
1467
|
+
count: metrics.length,
|
|
1468
|
+
scopedCount: scoped.length,
|
|
1469
|
+
globalCount: metrics.length - scoped.length,
|
|
1470
|
+
metrics
|
|
1471
|
+
},
|
|
1472
|
+
text: lines.join("\n")
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1328
1476
|
// src/shortcuts/data/operations/conf.ts
|
|
1329
1477
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
1330
1478
|
var CONF_PREFIX_TYPE = [["CONN_", "conn"], ["DS_", "ds"], ["WF_", "wf"], ["API_", "api"]];
|
|
@@ -1550,33 +1698,33 @@ async function resolveAll(host, keys, group) {
|
|
|
1550
1698
|
}
|
|
1551
1699
|
return map;
|
|
1552
1700
|
}
|
|
1553
|
-
async function resolveText(host,
|
|
1554
|
-
const found = [...new Set([...
|
|
1701
|
+
async function resolveText(host, text2, group) {
|
|
1702
|
+
const found = [...new Set([...text2.matchAll(CONF_TOKEN_RE)].map((match) => match[1]))];
|
|
1555
1703
|
const map = found.length ? await resolveAll(host, found, group) : {};
|
|
1556
|
-
const output =
|
|
1704
|
+
const output = text2.replace(CONF_TOKEN_RE, (whole, key) => {
|
|
1557
1705
|
const config = map[key];
|
|
1558
1706
|
if (!config) throw dataApiError("conf_missing", `\u914D\u7F6E\u4E0D\u5B58\u5728\u6216\u4E3A\u7A7A: ${key}`, { code: key });
|
|
1559
1707
|
return config.confValue ?? "";
|
|
1560
1708
|
});
|
|
1561
1709
|
return {
|
|
1562
|
-
input:
|
|
1710
|
+
input: text2,
|
|
1563
1711
|
output,
|
|
1564
1712
|
resolved: Object.fromEntries(Object.entries(map).map(([key, value]) => [key, value.confValue ?? ""]))
|
|
1565
1713
|
};
|
|
1566
1714
|
}
|
|
1567
1715
|
async function confResolve(input, host) {
|
|
1568
|
-
let
|
|
1569
|
-
if (!
|
|
1570
|
-
|
|
1571
|
-
if (
|
|
1572
|
-
const result = await resolveText(host,
|
|
1716
|
+
let text2 = input.text ?? positionals(input, "keys")[0];
|
|
1717
|
+
if (!text2) throw dataValidationError("missing_argument", "conf resolve \u7F3A\u5C11\u6587\u672C\uFF08\u7528\u6CD5: conf resolve '<\u542B#{KEY}\u6587\u672C>' | @file.txt [--group g]\uFF09");
|
|
1718
|
+
text2 = String(text2);
|
|
1719
|
+
if (text2.startsWith("@")) text2 = readFileSync2(text2.slice(1), "utf-8");
|
|
1720
|
+
const result = await resolveText(host, text2, input.group);
|
|
1573
1721
|
return { data: result, text: result.output };
|
|
1574
1722
|
}
|
|
1575
1723
|
async function confResolveFile(input, host) {
|
|
1576
1724
|
const path = input.resolve_file ?? positionals(input, "keys")[0];
|
|
1577
1725
|
if (!path) throw dataValidationError("missing_argument", "conf resolve-file \u7F3A\u5C11\u6587\u4EF6\u8DEF\u5F84");
|
|
1578
|
-
const
|
|
1579
|
-
const result = await resolveText(host,
|
|
1726
|
+
const text2 = readFileSync2(String(path), "utf-8");
|
|
1727
|
+
const result = await resolveText(host, text2, input.group);
|
|
1580
1728
|
return { data: result, text: result.output };
|
|
1581
1729
|
}
|
|
1582
1730
|
async function confAdd(input, host) {
|
|
@@ -1723,13 +1871,13 @@ function flagsOf(obj, payload) {
|
|
|
1723
1871
|
if (payload && typeof payload === "object" && !Array.isArray(payload) && payload.pageUid === "checkSecondFail") {
|
|
1724
1872
|
flags.push("pageUid=checkSecondFail\uFF08\u4E8C\u6B21\u8EAB\u4EFD\u9A8C\u8BC1\uFF1Atotal \u53EF\u4FE1\u3001\u660E\u7EC6\u6052 0 \u884C \u2192 \u5982\u5B9E\u8BF4\u660E\uFF0C\u4E0D\u5F97\u5F53\u65E0\u6570\u636E\uFF09");
|
|
1725
1873
|
}
|
|
1726
|
-
let
|
|
1874
|
+
let text2 = "";
|
|
1727
1875
|
try {
|
|
1728
|
-
|
|
1876
|
+
text2 = JSON.stringify(obj).slice(0, 4e3);
|
|
1729
1877
|
} catch {
|
|
1730
|
-
|
|
1878
|
+
text2 = "";
|
|
1731
1879
|
}
|
|
1732
|
-
if (PERM_WORDS.some((word) =>
|
|
1880
|
+
if (PERM_WORDS.some((word) => text2.includes(word))) flags.push("\u54CD\u5E94\u542B\u6743\u9650\u5173\u952E\u8BCD \u2192 \u6309\u300C\u65E0\u6743\u9650\u5373\u7EC8\u6B62\u300D\u5904\u7406");
|
|
1733
1881
|
return flags;
|
|
1734
1882
|
}
|
|
1735
1883
|
function loadConfFile(path) {
|
|
@@ -1921,7 +2069,7 @@ async function moduleCall(input, host) {
|
|
|
1921
2069
|
for (const [key, value] of Object.entries(extraHeaders)) {
|
|
1922
2070
|
if (/^token$/i.test(key) || ["cookie", "eteamsid", "user-agent"].includes(key.toLowerCase())) trustedHeaders[key] = value;
|
|
1923
2071
|
}
|
|
1924
|
-
const { status, text } = await host.requestText({
|
|
2072
|
+
const { status, text: text2 } = await host.requestText({
|
|
1925
2073
|
method: effMethod,
|
|
1926
2074
|
path: apiPath + queryString,
|
|
1927
2075
|
body: effMethod === "POST" ? jsonBody : void 0,
|
|
@@ -1936,16 +2084,16 @@ async function moduleCall(input, host) {
|
|
|
1936
2084
|
}
|
|
1937
2085
|
let obj = null;
|
|
1938
2086
|
try {
|
|
1939
|
-
obj = parseJsonSafe(
|
|
2087
|
+
obj = parseJsonSafe(text2);
|
|
1940
2088
|
} catch {
|
|
1941
2089
|
obj = null;
|
|
1942
2090
|
}
|
|
1943
2091
|
if (obj === null) {
|
|
1944
|
-
const out2 = { ok: status >= 200 && status < 300, api_name: apiName, http: status, nonJson:
|
|
2092
|
+
const out2 = { ok: status >= 200 && status < 300, api_name: apiName, http: status, nonJson: text2.slice(0, 2e3) };
|
|
1945
2093
|
if (status < 200 || status >= 300) {
|
|
1946
2094
|
throw dataApiError("non_json", `HTTP ${status} \u4E14\u54CD\u5E94\u975E JSON\uFF08\u5DF2\u539F\u6837\u8F93\u51FA\u524D 2000 \u5B57\u7B26\uFF09`, { code: 7, details: out2 });
|
|
1947
2095
|
}
|
|
1948
|
-
return { data: out2, text:
|
|
2096
|
+
return { data: out2, text: text2.slice(0, 2e3) };
|
|
1949
2097
|
}
|
|
1950
2098
|
if (input.raw) return { data: obj, text: JSON.stringify(obj, null, 1) };
|
|
1951
2099
|
const payload = payloadOf(obj);
|
|
@@ -2073,8 +2221,8 @@ async function sceneItems(input, host) {
|
|
|
2073
2221
|
function keywordsOf(raw) {
|
|
2074
2222
|
return String(raw ?? "").split(/[,,、;;\s]+/).map((item) => item.trim()).filter(Boolean);
|
|
2075
2223
|
}
|
|
2076
|
-
function hitScore(
|
|
2077
|
-
const hay = String(
|
|
2224
|
+
function hitScore(text2, keywords) {
|
|
2225
|
+
const hay = String(text2 ?? "").toLowerCase();
|
|
2078
2226
|
if (!hay) return 0;
|
|
2079
2227
|
let score = 0;
|
|
2080
2228
|
for (const keyword of keywords) if (hay.includes(keyword.toLowerCase())) score += 1;
|
|
@@ -2181,7 +2329,7 @@ async function sceneSearch(input, host) {
|
|
|
2181
2329
|
// src/shortcuts/data/operations/index.ts
|
|
2182
2330
|
var DEFINITIONS = [
|
|
2183
2331
|
{ name: "data.dsl.query", summary: "\u76F4\u63A5\u6267\u884C DSL \u67E5\u8BE2\uFF08executeQueryDsl\uFF1B\u4E0E ds list/chart/stat/count \u4E3A\u72EC\u7ACB\u901A\u9053\uFF09", capability: "dsl", handler: executeQuery, command: "query" },
|
|
2184
|
-
{ name: "data.ds.groups", summary: "\
|
|
2332
|
+
{ name: "data.ds.groups", summary: "\u6570\u636E\u6E90\u5206\u7EC4\u6E05\u5355\uFF08\u5B9E\u65F6 /api/dw/ds/group\uFF0CsourceType=LOGIC\uFF09", capability: "discovery", handler: dsGroups, command: "ds groups" },
|
|
2185
2333
|
{ name: "data.ds.find", summary: "\u6309\u5173\u952E\u8BCD\u8DE8\u5206\u7EC4\u627E\u8868\uFF08\u8FDB\u7A0B\u5185\u5E76\u53D1\u6247\u51FA + \u672C\u5730\u8FC7\u6EE4 + \u8DEF\u7531\u5EFA\u8BAE\uFF09", capability: "discovery", handler: dsFind, command: "ds find" },
|
|
2186
2334
|
{ name: "data.ds.describe", summary: "\u4E00\u6B21\u5E76\u53D1\u53D6\u56DE\u5B57\u6BB5\u5143\u6570\u636E + \u8BCD\u5E93\uFF0C\u5E76\u7ED9\u51FA\u5173\u8054\u5B57\u6BB5/\u901A\u9053\u63D0\u793A", capability: "discovery", handler: dsDescribe, command: "ds describe" },
|
|
2187
2335
|
{ name: "data.ds.tables", summary: "\u5217\u67D0\u4E2A\u5206\u7EC4\u4E0B\u7684\u6570\u636E\u96C6\uFF08\u8868\uFF09\u6E05\u5355", capability: "metadata", handler: dsTables, command: "ds tables" },
|
|
@@ -2193,6 +2341,7 @@ var DEFINITIONS = [
|
|
|
2193
2341
|
{ name: "data.ds.count", summary: "\u8BA1\u6570\uFF08getCountData\uFF09", capability: "fetch", handler: dsCount, command: "ds count" },
|
|
2194
2342
|
{ name: "data.noun.list", summary: "\u6309 skill \u53D6\u8BCD\u5E93\uFF08ChatBI \u540D\u8BCD\u89E3\u91CA\uFF09", capability: "lexicon", handler: nounList, command: "noun list" },
|
|
2195
2343
|
{ name: "data.noun.scope", summary: "\u6309\u6570\u636E\u96C6\u751F\u6548\u8303\u56F4\u6279\u91CF\u53D6\u8BCD\u5E93\uFF08getChatBiDocByScopeId\uFF09", capability: "lexicon", handler: nounScope, command: "noun scope" },
|
|
2344
|
+
{ name: "data.attribution.metric", summary: "\u6309\u751F\u6548\u8303\u56F4\u6279\u91CF\u53D6\u5F52\u56E0\u5206\u6790\u8BBE\u7F6E\uFF08getAttributionMetricByScopeId\uFF1B\u5206\u7EC4\u7EA7 / \u6761\u76EE\u7EA7\u7ED1\u5B9A\uFF09", capability: "attribution", handler: attributionMetric, command: "attribution metric" },
|
|
2196
2345
|
{ name: "data.field.name2id", summary: "\u540D\u79F0 \u2192 \u5B57\u6BB5\u503C id \u5019\u9009\uFF08\u6D4F\u89C8\u6309\u94AE\u7C7B\u5B57\u6BB5\uFF09", capability: "field", handler: fieldName2id, command: "field name2id" },
|
|
2197
2346
|
{ name: "data.field.options", summary: "Select/Radio/Checkbox \u9009\u9879\u503C\u5B57\u5178\uFF08id\u2194name\uFF09", capability: "field", handler: fieldOptions, command: "field options" },
|
|
2198
2347
|
{ name: "data.conf.get", summary: "\u6309 confKey \u53D6\u5355\u6761\u914D\u7F6E\uFF08confType \u7531\u524D\u7F00\u63A8\u5BFC\u6216 --type \u6307\u5B9A\uFF09", capability: "config", handler: confGet, command: "conf get" },
|
|
@@ -2257,6 +2406,7 @@ var INPUT_SCHEMAS = {
|
|
|
2257
2406
|
"data.ds.count": { required: ["group", "table"], optional: ["where", "source_type", "app_id"] },
|
|
2258
2407
|
"data.noun.list": { required: ["skill"], optional: ["source_type", "source_group", "source_table"] },
|
|
2259
2408
|
"data.noun.scope": { required: ["ids"], optional: [] },
|
|
2409
|
+
"data.attribution.metric": { required: [], optional: ["ids", "group_ids", "item_ids"] },
|
|
2260
2410
|
"data.field.name2id": { required: ["module", "type", "name"], optional: ["form_param", "eb_browser_param", "property_type"] },
|
|
2261
2411
|
"data.field.options": { required: ["field_name", "obj_id", "group"], optional: ["source_type"] },
|
|
2262
2412
|
"data.conf.get": { required: ["key"], optional: ["type", "group"] },
|
|
@@ -2304,7 +2454,7 @@ function inputSchemaOf(name) {
|
|
|
2304
2454
|
const spec = INPUT_SCHEMAS[name] || { required: [], optional: [] };
|
|
2305
2455
|
const properties = {};
|
|
2306
2456
|
for (const key of [...spec.required, ...spec.optional]) {
|
|
2307
|
-
properties[key] = { type: key === "keys" || key === "ids" ? "array" : "string" };
|
|
2457
|
+
properties[key] = { type: key === "keys" || key === "ids" || key === "group_ids" || key === "item_ids" ? "array" : "string" };
|
|
2308
2458
|
}
|
|
2309
2459
|
return {
|
|
2310
2460
|
type: "object",
|
|
@@ -2328,7 +2478,7 @@ var dataManifest = {
|
|
|
2328
2478
|
host: "e10-data",
|
|
2329
2479
|
status: "builtin",
|
|
2330
2480
|
sourceSkill: "weaver-e10-data",
|
|
2331
|
-
capabilities: ["dsl", "discovery", "metadata", "fetch", "lexicon", "field", "config", "scene", "module", "attend"],
|
|
2481
|
+
capabilities: ["dsl", "discovery", "metadata", "fetch", "lexicon", "field", "config", "scene", "module", "attend", "attribution"],
|
|
2332
2482
|
auth: {
|
|
2333
2483
|
required: "e10-session",
|
|
2334
2484
|
note: "\u6240\u6709\u64CD\u4F5C\u90FD\u8981\u6C42\u5DF2\u767B\u5F55 E10\uFF1B\u767B\u5F55\u7EDF\u4E00\u8D70 `weaver-work-cli auth login --base-url <\u57DF\u540D>`\uFF0Cdata \u6A21\u5757\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u767B\u5F55\u5165\u53E3\u3002"
|
|
@@ -2341,7 +2491,8 @@ var dataManifest = {
|
|
|
2341
2491
|
"`module call` \u7684 `token` \u5934\u5728\u8FD0\u884C\u65F6\u5C5E\u4FDD\u7559\u5934\uFF0C\u5FC5\u987B\u8D70 trustedHeaders\uFF08INVOICE \u5DF2\u5185\u7F6E\u6362\u53D6\u903B\u8F91\uFF09\u3002",
|
|
2342
2492
|
"\u4EBA\u5458 / \u90E8\u95E8 / \u5C97\u4F4D\u4E00\u5F8B\u8D70 `weaver-work-cli hrm`\uFF1Bdata \u901A\u9053\u5BF9 /api/hrm/ \u8DEF\u5F84\u6709\u9ED1\u540D\u5355\uFF08\u9000\u51FA\u7801 6\uFF09\u3002",
|
|
2343
2493
|
"`hasSearchRight=false` \u662F\u6743\u9650\u53D7\u9650\uFF08\u7EC8\u7AEF\u6001\uFF09\uFF1A\u7ED3\u679C\u7167\u5E38\u7ED9\u51FA\u4F46\u9000\u51FA\u7801 4\uFF0C\u4E0D\u5F97\u4EA4\u4ED8\u4E3A\u300C\u65E0\u6570\u636E\u300D\u3002",
|
|
2344
|
-
"`field name2id`\uFF08\u540D\u79F0\u2192\u5B57\u6BB5\u503C id\uFF09\u4E0E `ds fields`\uFF08\u5B57\u6BB5\u5143\u6570\u636E\uFF09\u662F\u4E24\u4EF6\u4E8B\uFF1B`id2name` \u5DF2\u505C\u7528\u5E76\u5728\u672C\u6B21\u8FC1\u79FB\u4E2D\u5220\u9664\u3002"
|
|
2494
|
+
"`field name2id`\uFF08\u540D\u79F0\u2192\u5B57\u6BB5\u503C id\uFF09\u4E0E `ds fields`\uFF08\u5B57\u6BB5\u5143\u6570\u636E\uFF09\u662F\u4E24\u4EF6\u4E8B\uFF1B`id2name` \u5DF2\u505C\u7528\u5E76\u5728\u672C\u6B21\u8FC1\u79FB\u4E2D\u5220\u9664\u3002",
|
|
2495
|
+
"`attribution metric` \u53D6\u7684\u662F**\u5F52\u56E0\u5206\u6790\u8BBE\u7F6E**\uFF08\u6307\u6807\u53E3\u5F84 / \u53EF\u5173\u8054\u7EF4\u5EA6 / \u4E0B\u94BB\u8DEF\u5F84\uFF09\uFF0C\u4E0E `noun scope` \u7684\u8BCD\u5E93\u89E3\u91CA\u4E0D\u540C\uFF1B\u5F52\u56E0\u5206\u6790\u4F18\u5148\u7528\u8FD9\u91CC\u7684\u8BBE\u7F6E\uFF0C\u672A\u914D\u7F6E\u65F6\u624D\u56DE\u9000\u901A\u7528\u6D41\u7A0B\u3002"
|
|
2345
2496
|
],
|
|
2346
2497
|
operations: dataOperations,
|
|
2347
2498
|
withheldOperations: [
|
|
@@ -2450,10 +2601,10 @@ var dataShortcut = {
|
|
|
2450
2601
|
await run(ctx, "data.dsl.query", toInput(options), false);
|
|
2451
2602
|
}));
|
|
2452
2603
|
const ds = data.command("ds").description("\u6570\u636E\u6E90\uFF1A\u5206\u7EC4 / \u627E\u8868 / \u5143\u6570\u636E / \u53D6\u6570");
|
|
2453
|
-
ds.command("groups").description("\
|
|
2604
|
+
ds.command("groups").description("\u6570\u636E\u6E90\u5206\u7EC4\u6E05\u5355\uFF08\u5B9E\u65F6 /api/dw/ds/group\uFF0CsourceType=LOGIC\uFF09").option("--pattern <sub>", "\u6309 groupId / \u4E2D\u6587\u540D\u8FC7\u6EE4").action(action(async (ctx, options) => {
|
|
2454
2605
|
await run(ctx, "data.ds.groups", toInput(options), false);
|
|
2455
2606
|
}));
|
|
2456
|
-
ds.command("find").description("\u6309\u5173\u952E\u8BCD\u8DE8\u5206\u7EC4\u627E\u8868\uFF08\u5E76\u53D1\u6247\u51FA + \u672C\u5730\u8FC7\u6EE4 + \u8DEF\u7531\u5EFA\u8BAE\uFF09").option("--name <keyword>", "\u8868\u540D\u5173\u952E\u8BCD").option("--keyword <keyword>", "\u540C --name").option("--source-type <type>", "LOGIC / ETEAMS\uFF0C\u9ED8\u8BA4 LOGIC").option("--size <n>", "\u6BCF\u9875\u6761\u6570\uFF08\u22642000\uFF09\uFF0C\u9ED8\u8BA4 100").option("--pages <n>", "\u6293\u53D6\u9875\u6570\uFF08\u226450\uFF09\uFF0C\u9ED8\u8BA4 1").option("--concurrency <n>", "\u8FDB\u7A0B\u5185\u5E76\u53D1\u6570\uFF0C\u9ED8\u8BA4 10").option("--groups <a,b>", "\u663E\u5F0F\u6307\u5B9A\u626B\u63CF\u5206\u7EC4").option("--all-groups", "\u626B\u63CF\u5168\u90E8
|
|
2607
|
+
ds.command("find").description("\u6309\u5173\u952E\u8BCD\u8DE8\u5206\u7EC4\u627E\u8868\uFF08\u5E76\u53D1\u6247\u51FA + \u672C\u5730\u8FC7\u6EE4 + \u8DEF\u7531\u5EFA\u8BAE\uFF09").option("--name <keyword>", "\u8868\u540D\u5173\u952E\u8BCD").option("--keyword <keyword>", "\u540C --name").option("--source-type <type>", "LOGIC / ETEAMS\uFF0C\u9ED8\u8BA4 LOGIC").option("--size <n>", "\u6BCF\u9875\u6761\u6570\uFF08\u22642000\uFF09\uFF0C\u9ED8\u8BA4 100").option("--pages <n>", "\u6293\u53D6\u9875\u6570\uFF08\u226450\uFF09\uFF0C\u9ED8\u8BA4 1").option("--concurrency <n>", "\u8FDB\u7A0B\u5185\u5E76\u53D1\u6570\uFF0C\u9ED8\u8BA4 10").option("--groups <a,b>", "\u663E\u5F0F\u6307\u5B9A\u626B\u63CF\u5206\u7EC4").option("--all-groups", "\u626B\u63CF\u5168\u90E8\u5B9E\u65F6\u5206\u7EC4").option("--max-groups <n>", "\u9ED8\u8BA4\u626B\u63CF\u96C6\u4E0A\u9650\uFF0C\u9ED8\u8BA4 6").option("--app-id <id>", "EB \u5206\u7EC4\u6309\u5E94\u7528\u5206\u57DF\u65F6\u663E\u5F0F\u4F20\u5165").option("--limit <n>", "\u5019\u9009\u4E0A\u9650").option("--loose", "\u5173\u95ED\u672C\u5730\u5173\u952E\u8BCD\u8FC7\u6EE4").option("--no-escalate", "\u672A\u547D\u4E2D\u65F6\u4E0D\u5347\u7EA7\u5168\u626B").action(action(async (ctx, options) => {
|
|
2457
2608
|
await run(ctx, "data.ds.find", toInput(options), false);
|
|
2458
2609
|
}));
|
|
2459
2610
|
ds.command("describe").description("\u5E76\u53D1\u53D6\u5B57\u6BB5\u5143\u6570\u636E + \u8BCD\u5E93\uFF0C\u5E76\u7ED9\u51FA\u5173\u8054\u5B57\u6BB5/\u901A\u9053\u63D0\u793A").option("--group <groupId>", "\u5206\u7EC4 ID").option("--table <tableId>", "\u6570\u636E\u96C6 ID").option("--source-type <type>", "LOGIC / ETEAMS").option("--app-id <id>", "EB \u5206\u7EC4\u5E94\u7528 ID").option("--skill <skillKey>", "\u8BCD\u5E93 skillKey\uFF0C\u9ED8\u8BA4 data-source-query").option("--require", "\u5B58\u5728\u5931\u8D25\u5206\u652F\u65F6\u76F4\u63A5\u5931\u8D25").action(action(async (ctx, options) => {
|
|
@@ -2487,6 +2638,10 @@ var dataShortcut = {
|
|
|
2487
2638
|
noun.command("scope").description("\u6309\u6570\u636E\u96C6\u751F\u6548\u8303\u56F4\u6279\u91CF\u53D6\u8BCD\u5E93").option("--ids <a,b|@f>", "\u6570\u636E\u96C6 id \u5217\u8868\uFF08\u53D6\u81EA scene items\uFF09").action(action(async (ctx, options) => {
|
|
2488
2639
|
await run(ctx, "data.noun.scope", toInput(options), false);
|
|
2489
2640
|
}));
|
|
2641
|
+
const attribution = data.command("attribution").description("\u5F52\u56E0\u5206\u6790\u8BBE\u7F6E\uFF08\u6307\u6807\u53E3\u5F84 / \u7EF4\u5EA6 / \u4E0B\u94BB\u8DEF\u5F84\uFF09");
|
|
2642
|
+
attribution.command("metric").description("\u6309\u751F\u6548\u8303\u56F4\u6279\u91CF\u53D6\u5F52\u56E0\u5206\u6790\u8BBE\u7F6E\uFF08\u5206\u7EC4\u7EA7 / \u6761\u76EE\u7EA7\u7ED1\u5B9A\uFF09").option("--ids <a,b|@f>", "\u751F\u6548\u8303\u56F4 id \u5217\u8868\uFF08\u5206\u7EC4 id + \u6761\u76EE id \u5408\u5E76\uFF09").option("--group-ids <a,b|@f>", "\u4EC5\u5206\u7EC4 id\uFF08\u4E0E --ids \u5408\u5E76\u53BB\u91CD\uFF09").option("--item-ids <a,b|@f>", "\u4EC5\u6761\u76EE id\uFF08\u4E0E --ids \u5408\u5E76\u53BB\u91CD\uFF09").action(action(async (ctx, options) => {
|
|
2643
|
+
await run(ctx, "data.attribution.metric", toInput(options), false);
|
|
2644
|
+
}));
|
|
2490
2645
|
const field = data.command("field").description("\u5B57\u6BB5\u503C\u7FFB\u8BD1 / \u9009\u9879\u5B57\u5178");
|
|
2491
2646
|
field.command("name2id").description("\u540D\u79F0 \u2192 \u5B57\u6BB5\u503C id \u5019\u9009\uFF08\u6D4F\u89C8\u6309\u94AE\u7C7B\u5B57\u6BB5\uFF09").option("--module <module>", "\u6A21\u5757\u6807\u8BC6\uFF0C\u5982 hrm / workflow").option("--type <browserType>", "\u6D4F\u89C8\u6309\u94AE\u7C7B\u578B").option("--name <text>", "\u8981\u7FFB\u8BD1\u7684\u540D\u79F0").option("--form-param <json>", "\u8868\u5355\u53C2\u6570").option("--eb-browser-param <json|@file>", "EB \u6D4F\u89C8\u53C2\u6570").option("--property-type <type>", "\u5C5E\u6027\u7C7B\u578B").action(action(async (ctx, options) => {
|
|
2492
2647
|
await run(ctx, "data.field.name2id", toInput(options), false);
|
|
@@ -2510,8 +2665,8 @@ var dataShortcut = {
|
|
|
2510
2665
|
conf.command("group-file").description("\u6309\u6587\u4EF6\u6279\u91CF\u53D6\u591A\u4E2A\u5206\u7EC4\u7684\u914D\u7F6E").argument("<file>", "JSON \u6587\u4EF6\uFF0C\u5F62\u5982 [{confType, confGroup}]").action(action(async (ctx, file, options) => {
|
|
2511
2666
|
await run(ctx, "data.conf.group-file", { ...toInput(options), group_file: file }, false);
|
|
2512
2667
|
}));
|
|
2513
|
-
conf.command("resolve").description("\u628A\u6587\u672C\u91CC\u7684 #{KEY} \u5360\u4F4D\u7B26\u66FF\u6362\u4E3A\u914D\u7F6E\u503C").argument("<text>", "\u542B #{KEY} \u7684\u6587\u672C\uFF0C\u6216 @file.txt").option("--group <confGroup>", "confGroup").action(action(async (ctx,
|
|
2514
|
-
await run(ctx, "data.conf.resolve", { ...toInput(options), text }, false);
|
|
2668
|
+
conf.command("resolve").description("\u628A\u6587\u672C\u91CC\u7684 #{KEY} \u5360\u4F4D\u7B26\u66FF\u6362\u4E3A\u914D\u7F6E\u503C").argument("<text>", "\u542B #{KEY} \u7684\u6587\u672C\uFF0C\u6216 @file.txt").option("--group <confGroup>", "confGroup").action(action(async (ctx, text2, options) => {
|
|
2669
|
+
await run(ctx, "data.conf.resolve", { ...toInput(options), text: text2 }, false);
|
|
2515
2670
|
}));
|
|
2516
2671
|
conf.command("resolve-file").description("\u6309\u6587\u4EF6\u66FF\u6362 #{KEY} \u5360\u4F4D\u7B26").argument("<path>", "\u6587\u672C\u6587\u4EF6\u8DEF\u5F84").option("--group <confGroup>", "confGroup").action(action(async (ctx, path, options) => {
|
|
2517
2672
|
await run(ctx, "data.conf.resolve-file", { ...toInput(options), path }, false);
|