bpmax-cli 0.2.1-beta.33 → 0.2.1-beta.34
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/bin.js
CHANGED
|
@@ -492,7 +492,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
|
|
|
492
492
|
// package.json
|
|
493
493
|
var package_default = {
|
|
494
494
|
name: "bpmax-cli",
|
|
495
|
-
version: "0.2.1-beta.
|
|
495
|
+
version: "0.2.1-beta.34",
|
|
496
496
|
description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
497
497
|
type: "module",
|
|
498
498
|
bin: {
|
|
@@ -15658,6 +15658,31 @@ var PRIORITIES = /* @__PURE__ */ new Set(["P0", "P1", "P2"]);
|
|
|
15658
15658
|
var CASE_TYPES = /* @__PURE__ */ new Set(["positive", "negative", "boundary", "permission", "data_consistency", "regression"]);
|
|
15659
15659
|
var STATUSES = /* @__PURE__ */ new Set(["active", "deprecated", "draft"]);
|
|
15660
15660
|
var CASE_STEP_RUNNERS = /* @__PURE__ */ new Set(["browser", "e2e_create_page", "e2e_step_run", "observe"]);
|
|
15661
|
+
var CASE_STEP_ACTION_VERBS = [
|
|
15662
|
+
"\u6253\u5F00",
|
|
15663
|
+
"\u8FDB\u5165",
|
|
15664
|
+
"\u70B9\u51FB",
|
|
15665
|
+
"\u586B\u5199",
|
|
15666
|
+
"\u8F93\u5165",
|
|
15667
|
+
"\u9009\u62E9",
|
|
15668
|
+
"\u63D0\u4EA4",
|
|
15669
|
+
"\u5BA1\u6279",
|
|
15670
|
+
"\u9A73\u56DE",
|
|
15671
|
+
"\u56DE\u9000",
|
|
15672
|
+
"\u7B49\u5F85",
|
|
15673
|
+
"\u68C0\u67E5",
|
|
15674
|
+
"\u6838\u5BF9",
|
|
15675
|
+
"\u9A8C\u8BC1",
|
|
15676
|
+
"\u622A\u56FE",
|
|
15677
|
+
"\u5207\u6362",
|
|
15678
|
+
"\u6062\u590D",
|
|
15679
|
+
"\u521B\u5EFA",
|
|
15680
|
+
"\u641C\u7D22",
|
|
15681
|
+
"\u67E5\u770B",
|
|
15682
|
+
"\u786E\u8BA4",
|
|
15683
|
+
"\u4E0A\u4F20"
|
|
15684
|
+
];
|
|
15685
|
+
var CASE_STEP_ACTION_RE = new RegExp(CASE_STEP_ACTION_VERBS.join("|"));
|
|
15661
15686
|
var REVIEW_STATUSES = /* @__PURE__ */ new Set(["passed", "fixed"]);
|
|
15662
15687
|
var REVIEW_REQUIRED_PERSPECTIVES = /* @__PURE__ */ new Set([
|
|
15663
15688
|
"structure_lint",
|
|
@@ -16212,8 +16237,11 @@ function validateCaseSteps(filePath, cases, steps) {
|
|
|
16212
16237
|
if (/[>>]|(?:^|\s)\d+[.)、]\s*.*\d+[.)、]/.test(step.action) || /(然后|接着|随后|再然后)/.test(step.action)) {
|
|
16213
16238
|
fail(`${location}: action \u4E00\u884C\u53EA\u80FD\u63CF\u8FF0\u4E00\u4E2A\u7528\u6237\u52A8\u4F5C\uFF0C\u7981\u6B62\u805A\u5408\u591A\u4E2A\u6B65\u9AA4`, { rule_id: "test_suite.case_step.aggregated_action", path: filePath });
|
|
16214
16239
|
}
|
|
16215
|
-
if (step.action.trim().length < 4 ||
|
|
16216
|
-
fail(`${location}: action \u5FC5\u987B\u5199\u6E05\u5355\u4E00\u53EF\u6267\u884C\u52A8\u4F5C
|
|
16240
|
+
if (step.action.trim().length < 4 || !CASE_STEP_ACTION_RE.test(step.action)) {
|
|
16241
|
+
fail(`${location}: action \u5FC5\u987B\u5199\u6E05\u5355\u4E00\u53EF\u6267\u884C\u52A8\u4F5C\uFF1B\u53EF\u8BC6\u522B\u52A8\u8BCD\uFF1A${CASE_STEP_ACTION_VERBS.join("\u3001")}`, {
|
|
16242
|
+
rule_id: "test_suite.case_step.action_operable",
|
|
16243
|
+
path: filePath
|
|
16244
|
+
});
|
|
16217
16245
|
}
|
|
16218
16246
|
if (/^(页面|按钮|系统|表单|字段|项目|流程|环节|详情|列表)$/i.test(step.target.trim())) {
|
|
16219
16247
|
fail(`${location}: target \u8FC7\u4E8E\u6CDB\u5316\uFF0C\u5FC5\u987B\u5199\u660E\u5177\u4F53\u9875\u9762\u3001\u5B57\u6BB5\u3001\u6309\u94AE\u3001\u9879\u76EE\u6216\u6D41\u7A0B\u73AF\u8282`, { rule_id: "test_suite.case_step.target_specific", path: filePath });
|
|
@@ -17635,7 +17663,8 @@ function reportRuntimeEvidenceInvalid(text5) {
|
|
|
17635
17663
|
const hashRoute = url.hash.startsWith("#/") ? new URL(url.hash.slice(1), url.origin) : null;
|
|
17636
17664
|
const runtimePath = hashRoute?.pathname || url.pathname;
|
|
17637
17665
|
const runtimeParams = hashRoute?.searchParams || url.searchParams;
|
|
17638
|
-
|
|
17666
|
+
const isSupportedUiRoute = /(?:\/project(?:$|\/|\?|_detail)|\/myProject|\/projectContinue|\/pages\/)/i.test(runtimePath) || /\/w:[^/]+\/userManagement(?:\/|$)/i.test(runtimePath);
|
|
17667
|
+
if (/(^|\.)example\.(?:com|org|net)$/i.test(url.hostname) || /\/(?:api|bpmax)(?:\/|$)/i.test(runtimePath) || !isSupportedUiRoute) {
|
|
17639
17668
|
invalid.push("runtime_url/ui_route");
|
|
17640
17669
|
}
|
|
17641
17670
|
const pathProjectId = /\/project_detail\/\d+\/(\d+)/.exec(runtimePath)?.[1];
|
|
@@ -19968,7 +19997,10 @@ function assertProjectSearchBody(value) {
|
|
|
19968
19997
|
);
|
|
19969
19998
|
}
|
|
19970
19999
|
}
|
|
19971
|
-
function
|
|
20000
|
+
function isProjectListEsQuery(value) {
|
|
20001
|
+
return ["data_set_id", "data_set_key", "query", "is_select_all", "_source", "aggs"].some((key) => Object.prototype.hasOwnProperty.call(value, key));
|
|
20002
|
+
}
|
|
20003
|
+
function splitProjectListPagination(body, options) {
|
|
19972
20004
|
const data = { ...body };
|
|
19973
20005
|
const normalizePositiveInteger = (value, path16) => {
|
|
19974
20006
|
if (typeof value === "string" && value.trim() === "") {
|
|
@@ -19980,15 +20012,32 @@ function withProjectListPagination(body, options) {
|
|
|
19980
20012
|
}
|
|
19981
20013
|
return number;
|
|
19982
20014
|
};
|
|
19983
|
-
|
|
20015
|
+
const page = normalizePositiveInteger(
|
|
19984
20016
|
options.pageExplicit || data.page === void 0 ? options.page : data.page,
|
|
19985
20017
|
"page"
|
|
19986
20018
|
);
|
|
19987
|
-
|
|
20019
|
+
const pageSize = normalizePositiveInteger(
|
|
19988
20020
|
options.pageSizeExplicit || data.page_size === void 0 ? options.pageSize : data.page_size,
|
|
19989
20021
|
"page_size"
|
|
19990
20022
|
);
|
|
19991
|
-
|
|
20023
|
+
delete data.page;
|
|
20024
|
+
delete data.page_size;
|
|
20025
|
+
if (!isProjectListEsQuery(data)) {
|
|
20026
|
+
return {
|
|
20027
|
+
data: {
|
|
20028
|
+
...data,
|
|
20029
|
+
page,
|
|
20030
|
+
page_size: pageSize
|
|
20031
|
+
}
|
|
20032
|
+
};
|
|
20033
|
+
}
|
|
20034
|
+
return {
|
|
20035
|
+
data,
|
|
20036
|
+
params: {
|
|
20037
|
+
page,
|
|
20038
|
+
page_size: pageSize
|
|
20039
|
+
}
|
|
20040
|
+
};
|
|
19992
20041
|
}
|
|
19993
20042
|
|
|
19994
20043
|
// src/commands/es.ts
|
|
@@ -19997,7 +20046,7 @@ function registerEsCommands(program2) {
|
|
|
19997
20046
|
es.command("project-search").description("Compatibility alias for project search through huanpingtong /api/project/list ES mode").option("--profile <profile>", "Profile name").option("--page <page>", "Page number for project-list payloads", "1").option("--page-size <pageSize>", "Page size for project-list payloads", "20").requiredOption("--body <json>", "Project list body JSON or @file").option("--format <format>", "Output format", "json").action(async (options, command) => {
|
|
19998
20047
|
const body = await parseJsonInput(options.body, "--body");
|
|
19999
20048
|
assertProjectSearchBody(body);
|
|
20000
|
-
const
|
|
20049
|
+
const request = splitProjectListPagination(body, {
|
|
20001
20050
|
page: options.page,
|
|
20002
20051
|
pageSize: options.pageSize,
|
|
20003
20052
|
pageExplicit: command.getOptionValueSource("page") === "cli",
|
|
@@ -20011,7 +20060,7 @@ function registerEsCommands(program2) {
|
|
|
20011
20060
|
"POST",
|
|
20012
20061
|
"/project/list",
|
|
20013
20062
|
{
|
|
20014
|
-
|
|
20063
|
+
...request,
|
|
20015
20064
|
preserveErrorBody: true,
|
|
20016
20065
|
capability: "project.search"
|
|
20017
20066
|
}
|
|
@@ -22776,7 +22825,7 @@ function registerProjectCommands(program2) {
|
|
|
22776
22825
|
project.command("search").description("Search projects through huanpingtong /api/project/list ES mode").option("--profile <profile>", "Profile name").option("--page <page>", "Page number", "1").option("--page-size <pageSize>", "Page size", "20").requiredOption("--body <json>", "Project search body JSON or @file").option("--format <format>", "Output format", "json").action(async (options, command) => {
|
|
22777
22826
|
const body = await parseJsonInput(options.body, "--body");
|
|
22778
22827
|
assertProjectSearchBody(body);
|
|
22779
|
-
const
|
|
22828
|
+
const request = splitProjectListPagination(body, {
|
|
22780
22829
|
page: options.page,
|
|
22781
22830
|
pageSize: options.pageSize,
|
|
22782
22831
|
pageExplicit: command.getOptionValueSource("page") === "cli",
|
|
@@ -22789,7 +22838,7 @@ function registerProjectCommands(program2) {
|
|
|
22789
22838
|
"POST",
|
|
22790
22839
|
"/project/list",
|
|
22791
22840
|
{
|
|
22792
|
-
|
|
22841
|
+
...request,
|
|
22793
22842
|
preserveErrorBody: true,
|
|
22794
22843
|
capability: "project.search"
|
|
22795
22844
|
}
|
|
@@ -22799,7 +22848,7 @@ function registerProjectCommands(program2) {
|
|
|
22799
22848
|
project.command("list").description("List projects").option("--profile <profile>", "Profile name").option("--page <page>", "Page number", "1").option("--page-size <pageSize>", "Page size", "20").option("--body <json>", "Project list body JSON", "{}").option("--format <format>", "Output format", "table").action(async (options, command) => {
|
|
22800
22849
|
const config = await loadConfig();
|
|
22801
22850
|
const profile = resolveProfile(config, options.profile);
|
|
22802
|
-
const
|
|
22851
|
+
const request = splitProjectListPagination(await parseProjectJson(options.body, "--body"), {
|
|
22803
22852
|
page: options.page,
|
|
22804
22853
|
pageSize: options.pageSize,
|
|
22805
22854
|
pageExplicit: command.getOptionValueSource("page") === "cli",
|
|
@@ -22809,7 +22858,7 @@ function registerProjectCommands(program2) {
|
|
|
22809
22858
|
createApiClient(profile),
|
|
22810
22859
|
"POST",
|
|
22811
22860
|
"/project/list",
|
|
22812
|
-
|
|
22861
|
+
request
|
|
22813
22862
|
);
|
|
22814
22863
|
printResult(options.format, result);
|
|
22815
22864
|
});
|