bpmax-cli 0.2.1-beta.33 → 0.2.1-beta.35

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
@@ -311,6 +311,7 @@ function capabilityForRequest(method, path16) {
311
311
  if (normalizedMethod === "DELETE" && /^\/form_template\/[^/]+$/.test(normalizedPath)) return "config.form_template.delete";
312
312
  if (normalizedMethod === "POST" && normalizedPath === "/form_template/publish") return "config.form_template.submit";
313
313
  if (normalizedMethod === "POST" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.create`;
314
+ if (normalizedMethod === "GET" && normalizedPath === "/flow_page_template") return `${pageTemplatePrefix}.export`;
314
315
  if (normalizedMethod === "GET" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.export`;
315
316
  if (normalizedMethod === "PUT" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.submit`;
316
317
  if (normalizedMethod === "DELETE" && /^\/flow_page_template\/[^/]+$/.test(normalizedPath)) return `${pageTemplatePrefix}.delete`;
@@ -455,6 +456,9 @@ function flowPageTemplateCapabilityPrefix(path16) {
455
456
  if (type === "4") {
456
457
  return "config.console_template";
457
458
  }
459
+ if (type === "5") {
460
+ return "config.flow_detail_template";
461
+ }
458
462
  if (type === "6") {
459
463
  return "config.step_detail_template";
460
464
  }
@@ -492,7 +496,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
492
496
  // package.json
493
497
  var package_default = {
494
498
  name: "bpmax-cli",
495
- version: "0.2.1-beta.33",
499
+ version: "0.2.1-beta.35",
496
500
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
497
501
  type: "module",
498
502
  bin: {
@@ -4301,6 +4305,7 @@ var LOCAL_UUID_DOMAIN_DIR = {
4301
4305
  "list-template": "think_flow_page_template",
4302
4306
  "filter-template": "think_flow_page_template",
4303
4307
  "project-detail-template": "think_flow_page_template",
4308
+ "flow-detail-template": "think_flow_page_template",
4304
4309
  "step-detail-template": "think_flow_page_template",
4305
4310
  "console-template": "think_flow_page_template",
4306
4311
  dataset: "think_data_set",
@@ -4317,6 +4322,7 @@ var REMOTE_UUID_EXPORT_PATH = {
4317
4322
  "list-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4318
4323
  "filter-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4319
4324
  "project-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4325
+ "flow-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4320
4326
  "step-detail-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4321
4327
  "console-template": (uuid) => `/flow_page_template/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
4322
4328
  "user-model": (uuid) => `/user_model/get_by_uuid?uuid=${encodeURIComponent(uuid)}`,
@@ -4434,6 +4440,23 @@ var CONFIG_DOMAINS = {
4434
4440
  writeEndpoints: ["POST /api/flow_page_template", "PUT /api/flow_page_template/:id", "DELETE /api/flow_page_template/:id"],
4435
4441
  notes: ["type=2 project detail template. Create and edit both use the typed flow_page_template adapter; create automatically finalizes data_set_id/flow_type through PUT when needed; activate/delete remain domain-specific operations."]
4436
4442
  },
4443
+ "flow-detail-template": {
4444
+ capability: "config.flow_detail_template",
4445
+ exportPath: (id) => `/flow_page_template/${id}?type=5&skip_i18n=true`,
4446
+ exportStatus: "supported",
4447
+ buildStatus: "supported",
4448
+ submitStatus: "supported",
4449
+ createPath: "/flow_page_template",
4450
+ createMethod: "POST",
4451
+ deletePath: (id) => `/flow_page_template/${id}`,
4452
+ deleteMethod: "DELETE",
4453
+ submitPath: (id) => `/flow_page_template/${id}`,
4454
+ submitMethod: "PUT",
4455
+ expectedType: 5,
4456
+ readEndpoints: ["GET /api/flow_page_template?type=5&flow_type=:flow_type&flow_key=:flow_key", "GET /api/flow_page_template/:id?type=5&skip_i18n=true"],
4457
+ writeEndpoints: ["POST /api/flow_page_template", "PUT /api/flow_page_template/:id", "DELETE /api/flow_page_template/:id"],
4458
+ notes: ["type=5 flow report/document template managed by the report_template editor. The flow-detail-template command name is retained for compatibility; this domain is distinct from type=2 project detail templates and type=6 step detail templates."]
4459
+ },
4437
4460
  "step-detail-template": {
4438
4461
  capability: "config.step_detail_template",
4439
4462
  exportPath: (id) => `/flow_page_template/${id}?type=6&skip_i18n=true`,
@@ -7372,6 +7395,63 @@ function validatePageTemplateName(work, errors) {
7372
7395
  }
7373
7396
  throw new Error(message);
7374
7397
  }
7398
+ function lintFlowDetailTemplateWork(work, errors, warnings = []) {
7399
+ const configuredType = pageTemplateType(work);
7400
+ if (configuredType !== void 0 && configuredType !== 5) {
7401
+ errors.push(`flow-detail-template \u5FC5\u987B\u4F7F\u7528 flow_page_template.type=5\uFF0C\u5F53\u524D\u4E3A ${configuredType}\u3002`);
7402
+ }
7403
+ const content = parseTemplateContent(work, errors);
7404
+ if (!isRecord3(content)) {
7405
+ errors.push("flow-detail-template content \u5FC5\u987B\u662F\u5305\u542B fields \u548C templateFile \u7684 JSON \u5BF9\u8C61\u3002");
7406
+ return;
7407
+ }
7408
+ if (!Array.isArray(content.fields)) {
7409
+ errors.push("flow-detail-template content.fields \u5FC5\u987B\u662F\u6570\u7EC4\u3002");
7410
+ } else {
7411
+ const seenFields = /* @__PURE__ */ new Set();
7412
+ content.fields.forEach((item, index) => {
7413
+ const itemPath = `flow-detail-template content.fields[${index}]`;
7414
+ if (!isRecord3(item)) {
7415
+ errors.push(`${itemPath} \u5FC5\u987B\u662F\u5BF9\u8C61\u3002`);
7416
+ return;
7417
+ }
7418
+ for (const key of ["field", "desc", "expression"]) {
7419
+ if (typeof item[key] !== "string" || !item[key].trim()) {
7420
+ errors.push(`${itemPath}.${key} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
7421
+ }
7422
+ }
7423
+ const field = typeof item.field === "string" ? item.field.trim() : "";
7424
+ if (field) {
7425
+ if (seenFields.has(field)) {
7426
+ errors.push(`${itemPath}.field \u4E0E\u5DF2\u6709\u62A5\u544A\u5B57\u6BB5 ${JSON.stringify(field)} \u91CD\u590D\u3002`);
7427
+ }
7428
+ seenFields.add(field);
7429
+ }
7430
+ });
7431
+ }
7432
+ if (!Array.isArray(content.templateFile)) {
7433
+ errors.push("flow-detail-template content.templateFile \u5FC5\u987B\u662F\u6570\u7EC4\u3002");
7434
+ } else {
7435
+ if (content.templateFile.length === 0) {
7436
+ errors.push("flow-detail-template content.templateFile \u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u62A5\u544A\u6A21\u677F\u6587\u4EF6\uFF1B\u5E73\u53F0\u751F\u6210\u62A5\u544A\u65F6\u8BFB\u53D6\u7B2C\u4E00\u4E2A\u6587\u4EF6\u3002");
7437
+ }
7438
+ content.templateFile.forEach((item, index) => {
7439
+ const itemPath = `flow-detail-template content.templateFile[${index}]`;
7440
+ if (!isRecord3(item)) {
7441
+ errors.push(`${itemPath} \u5FC5\u987B\u662F\u5BF9\u8C61\u3002`);
7442
+ return;
7443
+ }
7444
+ for (const key of ["name", "url"]) {
7445
+ if (typeof item[key] !== "string" || !item[key].trim()) {
7446
+ errors.push(`${itemPath}.${key} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
7447
+ }
7448
+ }
7449
+ });
7450
+ if (content.templateFile.length > 1) {
7451
+ warnings.push("flow-detail-template \u914D\u7F6E\u4E86\u591A\u4E2A templateFile\uFF1B\u5E73\u53F0\u751F\u6210\u62A5\u544A\u65F6\u53EA\u4F7F\u7528\u7B2C\u4E00\u4E2A\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u6392\u5E8F\u3002");
7452
+ }
7453
+ }
7454
+ }
7375
7455
  function normalizePageTemplatePayload(domain, work) {
7376
7456
  const definition = CONFIG_DOMAINS[domain];
7377
7457
  validatePageTemplateName(work);
@@ -7401,6 +7481,13 @@ function normalizePageTemplatePayload(domain, work) {
7401
7481
  throw new Error(`step-detail-template lint failed: ${errors.join("; ")}`);
7402
7482
  }
7403
7483
  }
7484
+ if (domain === "flow-detail-template") {
7485
+ const errors = [];
7486
+ lintFlowDetailTemplateWork(work, errors);
7487
+ if (errors.length) {
7488
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
7489
+ }
7490
+ }
7404
7491
  const basic = isRecord3(work.basic) ? work.basic : work;
7405
7492
  const rawContent = work.content ?? basic.content;
7406
7493
  const type = definition.expectedType;
@@ -10210,7 +10297,7 @@ function buildDomainSubmitPayload(domain, work, options = {}, raw) {
10210
10297
  if (domain === "nav-config") {
10211
10298
  return buildNavConfigSubmitPayload(work, isRecord3(raw) ? raw : void 0, options);
10212
10299
  }
10213
- if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template" || domain === "console-template") {
10300
+ if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template" || domain === "console-template") {
10214
10301
  return normalizePageTemplatePayload(domain, work);
10215
10302
  }
10216
10303
  throw new Error(`${CONFIG_SUBMIT_UNSUPPORTED_MESSAGE} Domain: ${domain}.`);
@@ -11397,7 +11484,7 @@ function normalizeTypedReadbackComparable(domain, value) {
11397
11484
  normalized.sub_ids = [...new Set(normalized.sub_ids.map(normalizeComparableId))].sort((left, right) => String(left).localeCompare(String(right)));
11398
11485
  }
11399
11486
  }
11400
- if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template" || domain === "console-template") {
11487
+ if (domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template" || domain === "console-template") {
11401
11488
  if (Object.prototype.hasOwnProperty.call(normalized, "data_set_id")) {
11402
11489
  normalized.data_set_id = normalizeComparableId(normalized.data_set_id);
11403
11490
  }
@@ -11455,7 +11542,7 @@ function assertJsonSubset(expected, actual, label) {
11455
11542
  }
11456
11543
  }
11457
11544
  function isPageTemplateCreateFinalizeDomain(domain) {
11458
- return domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "step-detail-template";
11545
+ return domain === "list-template" || domain === "filter-template" || domain === "project-detail-template" || domain === "flow-detail-template" || domain === "step-detail-template";
11459
11546
  }
11460
11547
  function pageTemplateCreateNeedsFinalize(domain, payload, comparison) {
11461
11548
  if (!isPageTemplateCreateFinalizeDomain(domain)) {
@@ -11482,6 +11569,64 @@ async function readbackConfigDomain(config, profile, domain, id) {
11482
11569
  readback: data
11483
11570
  };
11484
11571
  }
11572
+ async function listFlowDetailTemplates(profile, options) {
11573
+ const flowType = options.flowType.trim();
11574
+ if (!flowType) {
11575
+ throw new Error("flow-detail-template list requires --flow-type.");
11576
+ }
11577
+ const page = options.page ?? 1;
11578
+ const pageSize = options.pageSize ?? 100;
11579
+ if (!Number.isSafeInteger(page) || page < 1) {
11580
+ throw new Error("flow-detail-template list --page \u5FC5\u987B\u662F\u5927\u4E8E\u7B49\u4E8E 1 \u7684\u6574\u6570\u3002");
11581
+ }
11582
+ if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 1e3) {
11583
+ throw new Error("flow-detail-template list --page-size \u5FC5\u987B\u662F 1-1000 \u7684\u6574\u6570\u3002");
11584
+ }
11585
+ const definition = CONFIG_DOMAINS["flow-detail-template"];
11586
+ await ensureConfigCapability(profile, `${definition.capability}.export`);
11587
+ const params = new URLSearchParams({
11588
+ type: "5",
11589
+ flow_type: flowType,
11590
+ flow_key: options.flowKey?.trim() ?? "",
11591
+ page: String(page),
11592
+ page_size: String(pageSize),
11593
+ sort: "-create_time"
11594
+ });
11595
+ const name = options.name?.trim();
11596
+ if (name) params.set("name", name);
11597
+ const endpoint = `/flow_page_template?${params.toString()}`;
11598
+ const response = await apiRequest(
11599
+ createApiClient(profile),
11600
+ "GET",
11601
+ endpoint,
11602
+ { capability: `${definition.capability}.export` }
11603
+ );
11604
+ const templates = extractListData(response).filter((record) => Number(record.type) === 5).map((record) => ({
11605
+ id: record.id ?? null,
11606
+ uuid: record.uuid ?? null,
11607
+ name: record.name ?? "",
11608
+ desc: record.desc ?? "",
11609
+ status: record.status ?? null,
11610
+ flow_type: record.flow_type ?? "",
11611
+ flow_key: record.flow_key ?? "",
11612
+ create_time: record.create_time ?? null,
11613
+ update_time: record.update_time ?? null,
11614
+ readback_hash: hashJson(record)
11615
+ }));
11616
+ const pagination = isRecord3(response) ? pickDefined(response, ["currentPage", "pageSize", "totalPages", "count"]) : {};
11617
+ return {
11618
+ domain: "flow-detail-template",
11619
+ semantic_type: "flow-report-template",
11620
+ flow_type: flowType,
11621
+ flow_key: options.flowKey?.trim() ?? "",
11622
+ name: name ?? "",
11623
+ source_api: `GET /api${endpoint}`,
11624
+ ...pagination,
11625
+ match_count: templates.length,
11626
+ templates,
11627
+ verified_at: (/* @__PURE__ */ new Date()).toISOString()
11628
+ };
11629
+ }
11485
11630
  async function resolveFlowAppContextFlowId(profile, flow) {
11486
11631
  const trimmed = flow.trim();
11487
11632
  if (!trimmed) {
@@ -11871,7 +12016,14 @@ async function resolveConfigUuidId(options) {
11871
12016
  { capability: `${definition.capability}.export` }
11872
12017
  );
11873
12018
  const remoteRecord = isRecord3(response) && isRecord3(response.data) ? response.data : response;
11874
- const remote = isRecord3(remoteRecord) ? {
12019
+ const hasRemoteIdentity = isRecord3(remoteRecord) && [
12020
+ remoteRecord.id,
12021
+ remoteRecord.origin_template_id,
12022
+ remoteRecord.uuid,
12023
+ remoteRecord.type,
12024
+ remoteRecord.name
12025
+ ].some((value) => value !== void 0 && value !== null && value !== "");
12026
+ const remote = hasRemoteIdentity && isRecord3(remoteRecord) ? {
11875
12027
  id: numericIdString(remoteRecord.id),
11876
12028
  origin_template_id: numericIdString(remoteRecord.origin_template_id),
11877
12029
  name: remoteRecord.name ?? remoteRecord.title ?? null,
@@ -12030,6 +12182,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12030
12182
  }
12031
12183
  const raw = typeof meta.raw_file === "string" ? await readJsonFile(meta.raw_file) : void 0;
12032
12184
  let formTemplateWarnings = [];
12185
+ let flowDetailTemplateWarnings = [];
12033
12186
  let stepDetailReferenceAudit;
12034
12187
  let stepDetailAnalysis;
12035
12188
  if (domain === "flow-template" && isRecord3(work)) {
@@ -12068,6 +12221,14 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12068
12221
  throw new Error(`step-detail-template lint failed: ${errors.join("; ")}`);
12069
12222
  }
12070
12223
  }
12224
+ if (domain === "flow-detail-template" && isRecord3(work)) {
12225
+ const errors = [];
12226
+ flowDetailTemplateWarnings = [];
12227
+ lintFlowDetailTemplateWork(work, errors, flowDetailTemplateWarnings);
12228
+ if (errors.length) {
12229
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12230
+ }
12231
+ }
12071
12232
  const payloadWork = (domain === "dataset" || domain === "dataset-field") && createMode && isRecord3(work) ? { ...work, mode: "create" } : work;
12072
12233
  const payload = buildDomainSubmitPayload(domain, payloadWork, options, raw);
12073
12234
  if (domain === "flow-template" && options.publishLive) {
@@ -12088,6 +12249,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12088
12249
  base_hash: createMode ? null : typeof meta.base_hash === "string" ? meta.base_hash : null,
12089
12250
  payload,
12090
12251
  ...formTemplateWarnings.length ? { form_template_warnings: formTemplateWarnings } : {},
12252
+ ...flowDetailTemplateWarnings.length ? { flow_detail_template_warnings: flowDetailTemplateWarnings } : {},
12091
12253
  ...stepDetailReferenceAudit ? {
12092
12254
  step_detail_references: stepDetailReferenceAudit.references,
12093
12255
  step_detail_warnings: stepDetailReferenceAudit.warnings,
@@ -12107,6 +12269,7 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
12107
12269
  submit_file: outFile,
12108
12270
  payload_keys: Object.keys(payload),
12109
12271
  ...formTemplateWarnings.length ? { warnings: formTemplateWarnings } : {},
12272
+ ...flowDetailTemplateWarnings.length ? { warnings: flowDetailTemplateWarnings } : {},
12110
12273
  ...stepDetailReferenceAudit ? {
12111
12274
  step_detail_references: stepDetailReferenceAudit.references,
12112
12275
  warnings: stepDetailReferenceAudit.warnings,
@@ -12253,6 +12416,9 @@ async function lintConfigWorkFile(file, options = {}) {
12253
12416
  if (options.domain === "step-detail-template") {
12254
12417
  stepDetailAnalysis = lintStepDetailTemplateWork(value, errors, warnings);
12255
12418
  }
12419
+ if (options.domain === "flow-detail-template") {
12420
+ lintFlowDetailTemplateWork(value, errors, warnings);
12421
+ }
12256
12422
  if ((Object.prototype.hasOwnProperty.call(value, "content") || isRecord3(value.basic)) && pageTemplateType(value) === 1) {
12257
12423
  validateListTemplateActionGate(value, errors);
12258
12424
  }
@@ -12631,6 +12797,13 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
12631
12797
  throw new Error(`step-detail-template lint failed: ${stepDetailAnalysis.errors.join("; ")}`);
12632
12798
  }
12633
12799
  }
12800
+ if (domain === "flow-detail-template") {
12801
+ const errors = [];
12802
+ lintFlowDetailTemplateWork(submit.payload, errors);
12803
+ if (errors.length) {
12804
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12805
+ }
12806
+ }
12634
12807
  if (domain === "dataset-field") {
12635
12808
  validateDatasetFieldCreatePayload(submit.payload);
12636
12809
  }
@@ -12815,6 +12988,13 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
12815
12988
  throw new Error(`step-detail-template lint failed: ${stepDetailAnalysis.errors.join("; ")}`);
12816
12989
  }
12817
12990
  }
12991
+ if (domain === "flow-detail-template") {
12992
+ const errors = [];
12993
+ lintFlowDetailTemplateWork(submit.payload, errors);
12994
+ if (errors.length) {
12995
+ throw new Error(`flow-detail-template lint failed: ${errors.join("; ")}`);
12996
+ }
12997
+ }
12818
12998
  if (domain === "form-template" && submitMode === "create") {
12819
12999
  validateNonEmptyFormCreatePayload(submit.payload);
12820
13000
  await ensureConfigCapability(profile, `${definition.capability}.create`);
@@ -13410,6 +13590,7 @@ var CONFIG_DOMAINS2 = [
13410
13590
  ["list-template", "bpmax-list-template-editor", "\u5217\u8868\u6A21\u677F"],
13411
13591
  ["filter-template", "bpmax-filter-template-editor", "\u7B5B\u9009\u6A21\u677F"],
13412
13592
  ["project-detail-template", "bpmax-project-detail-template-editor", "\u9879\u76EE\u8BE6\u60C5\u6A21\u677F"],
13593
+ ["flow-detail-template", "bpmax-flow-detail-template-editor", "\u6D41\u7A0B\u62A5\u544A\u6A21\u677F\uFF08type=5\uFF09"],
13413
13594
  ["console-template", "bpmax-console-template-editor", "\u63A7\u5236\u53F0\u6A21\u677F"],
13414
13595
  ["dataset", "bpmax-dataset-template-editor", "\u6570\u636E\u96C6"],
13415
13596
  ["dataset-field", "bpmax-dataset-field-template-editor", "\u6570\u636E\u96C6\u5B57\u6BB5"],
@@ -15379,6 +15560,21 @@ function registerConfigCommands(program2) {
15379
15560
  await writeResponseOut(options.responseOut, result);
15380
15561
  printResult(options.format, result);
15381
15562
  });
15563
+ if (domain === "flow-detail-template") {
15564
+ domainCommand.command("list").description("List type=5 flow report/document templates for a flow").requiredOption("--flow-type <flowType>", "Main flow type, e.g. flow48198545").option("--flow-key <flowKey>", "Subflow key; omit or pass empty for the main flow", "").option("--name <name>", "Optional template name filter").option("--page <page>", "Page number", (value) => Number(value), 1).option("--page-size <pageSize>", "Page size, 1-1000", (value) => Number(value), 100).option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "json").action(async (options) => {
15565
+ const configData = await loadConfig();
15566
+ const resolved = resolveProfile(configData, options.profile);
15567
+ const result = await listFlowDetailTemplates(resolved, {
15568
+ flowType: options.flowType,
15569
+ flowKey: options.flowKey,
15570
+ name: options.name,
15571
+ page: options.page,
15572
+ pageSize: options.pageSize
15573
+ });
15574
+ await saveConfig(configData);
15575
+ printResult(options.format, result);
15576
+ });
15577
+ }
15382
15578
  if (domain === "project-detail-template") {
15383
15579
  domainCommand.command("resolve-default").description("Resolve the flow-specific default project detail template used by /project_detail/0/<project_id>").requiredOption("--flow-type <flowType>", "Flow type, e.g. flow48198545").option("--flow-key <flowKey>", "Flow key for subflow defaults", "").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "json").action(async (options) => {
15384
15580
  const configData = await loadConfig();
@@ -15658,6 +15854,31 @@ var PRIORITIES = /* @__PURE__ */ new Set(["P0", "P1", "P2"]);
15658
15854
  var CASE_TYPES = /* @__PURE__ */ new Set(["positive", "negative", "boundary", "permission", "data_consistency", "regression"]);
15659
15855
  var STATUSES = /* @__PURE__ */ new Set(["active", "deprecated", "draft"]);
15660
15856
  var CASE_STEP_RUNNERS = /* @__PURE__ */ new Set(["browser", "e2e_create_page", "e2e_step_run", "observe"]);
15857
+ var CASE_STEP_ACTION_VERBS = [
15858
+ "\u6253\u5F00",
15859
+ "\u8FDB\u5165",
15860
+ "\u70B9\u51FB",
15861
+ "\u586B\u5199",
15862
+ "\u8F93\u5165",
15863
+ "\u9009\u62E9",
15864
+ "\u63D0\u4EA4",
15865
+ "\u5BA1\u6279",
15866
+ "\u9A73\u56DE",
15867
+ "\u56DE\u9000",
15868
+ "\u7B49\u5F85",
15869
+ "\u68C0\u67E5",
15870
+ "\u6838\u5BF9",
15871
+ "\u9A8C\u8BC1",
15872
+ "\u622A\u56FE",
15873
+ "\u5207\u6362",
15874
+ "\u6062\u590D",
15875
+ "\u521B\u5EFA",
15876
+ "\u641C\u7D22",
15877
+ "\u67E5\u770B",
15878
+ "\u786E\u8BA4",
15879
+ "\u4E0A\u4F20"
15880
+ ];
15881
+ var CASE_STEP_ACTION_RE = new RegExp(CASE_STEP_ACTION_VERBS.join("|"));
15661
15882
  var REVIEW_STATUSES = /* @__PURE__ */ new Set(["passed", "fixed"]);
15662
15883
  var REVIEW_REQUIRED_PERSPECTIVES = /* @__PURE__ */ new Set([
15663
15884
  "structure_lint",
@@ -16212,8 +16433,11 @@ function validateCaseSteps(filePath, cases, steps) {
16212
16433
  if (/[>>]|(?:^|\s)\d+[.)、]\s*.*\d+[.)、]/.test(step.action) || /(然后|接着|随后|再然后)/.test(step.action)) {
16213
16434
  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
16435
  }
16215
- if (step.action.trim().length < 4 || !/(打开|进入|点击|填写|输入|选择|提交|审批|驳回|回退|等待|检查|核对|验证|截图|切换|恢复|创建|搜索|查看|确认)/.test(step.action)) {
16216
- fail(`${location}: action \u5FC5\u987B\u5199\u6E05\u5355\u4E00\u53EF\u6267\u884C\u52A8\u4F5C`, { rule_id: "test_suite.case_step.action_operable", path: filePath });
16436
+ if (step.action.trim().length < 4 || !CASE_STEP_ACTION_RE.test(step.action)) {
16437
+ 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")}`, {
16438
+ rule_id: "test_suite.case_step.action_operable",
16439
+ path: filePath
16440
+ });
16217
16441
  }
16218
16442
  if (/^(页面|按钮|系统|表单|字段|项目|流程|环节|详情|列表)$/i.test(step.target.trim())) {
16219
16443
  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 +17859,8 @@ function reportRuntimeEvidenceInvalid(text5) {
17635
17859
  const hashRoute = url.hash.startsWith("#/") ? new URL(url.hash.slice(1), url.origin) : null;
17636
17860
  const runtimePath = hashRoute?.pathname || url.pathname;
17637
17861
  const runtimeParams = hashRoute?.searchParams || url.searchParams;
17638
- if (/(^|\.)example\.(?:com|org|net)$/i.test(url.hostname) || /\/(?:api|bpmax)(?:\/|$)/i.test(runtimePath) || !/(?:\/project(?:$|\/|\?|_detail)|\/myProject|\/projectContinue|\/pages\/)/i.test(runtimePath)) {
17862
+ const isSupportedUiRoute = /(?:\/project(?:$|\/|\?|_detail)|\/myProject|\/projectContinue|\/pages\/)/i.test(runtimePath) || /^\/w:[^/]+\/(?:userManagement|console)(?:\/|$)/i.test(runtimePath);
17863
+ if (/(^|\.)example\.(?:com|org|net)$/i.test(url.hostname) || /\/(?:api|bpmax)(?:\/|$)/i.test(runtimePath) || !isSupportedUiRoute) {
17639
17864
  invalid.push("runtime_url/ui_route");
17640
17865
  }
17641
17866
  const pathProjectId = /\/project_detail\/\d+\/(\d+)/.exec(runtimePath)?.[1];
@@ -19968,7 +20193,10 @@ function assertProjectSearchBody(value) {
19968
20193
  );
19969
20194
  }
19970
20195
  }
19971
- function withProjectListPagination(body, options) {
20196
+ function isProjectListEsQuery(value) {
20197
+ return ["data_set_id", "data_set_key", "query", "is_select_all", "_source", "aggs"].some((key) => Object.prototype.hasOwnProperty.call(value, key));
20198
+ }
20199
+ function splitProjectListPagination(body, options) {
19972
20200
  const data = { ...body };
19973
20201
  const normalizePositiveInteger = (value, path16) => {
19974
20202
  if (typeof value === "string" && value.trim() === "") {
@@ -19980,15 +20208,32 @@ function withProjectListPagination(body, options) {
19980
20208
  }
19981
20209
  return number;
19982
20210
  };
19983
- data.page = normalizePositiveInteger(
20211
+ const page = normalizePositiveInteger(
19984
20212
  options.pageExplicit || data.page === void 0 ? options.page : data.page,
19985
20213
  "page"
19986
20214
  );
19987
- data.page_size = normalizePositiveInteger(
20215
+ const pageSize = normalizePositiveInteger(
19988
20216
  options.pageSizeExplicit || data.page_size === void 0 ? options.pageSize : data.page_size,
19989
20217
  "page_size"
19990
20218
  );
19991
- return data;
20219
+ delete data.page;
20220
+ delete data.page_size;
20221
+ if (!isProjectListEsQuery(data)) {
20222
+ return {
20223
+ data: {
20224
+ ...data,
20225
+ page,
20226
+ page_size: pageSize
20227
+ }
20228
+ };
20229
+ }
20230
+ return {
20231
+ data,
20232
+ params: {
20233
+ page,
20234
+ page_size: pageSize
20235
+ }
20236
+ };
19992
20237
  }
19993
20238
 
19994
20239
  // src/commands/es.ts
@@ -19997,7 +20242,7 @@ function registerEsCommands(program2) {
19997
20242
  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
20243
  const body = await parseJsonInput(options.body, "--body");
19999
20244
  assertProjectSearchBody(body);
20000
- const data = withProjectListPagination(body, {
20245
+ const request = splitProjectListPagination(body, {
20001
20246
  page: options.page,
20002
20247
  pageSize: options.pageSize,
20003
20248
  pageExplicit: command.getOptionValueSource("page") === "cli",
@@ -20011,7 +20256,7 @@ function registerEsCommands(program2) {
20011
20256
  "POST",
20012
20257
  "/project/list",
20013
20258
  {
20014
- data,
20259
+ ...request,
20015
20260
  preserveErrorBody: true,
20016
20261
  capability: "project.search"
20017
20262
  }
@@ -22776,7 +23021,7 @@ function registerProjectCommands(program2) {
22776
23021
  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
23022
  const body = await parseJsonInput(options.body, "--body");
22778
23023
  assertProjectSearchBody(body);
22779
- const data = withProjectListPagination(body, {
23024
+ const request = splitProjectListPagination(body, {
22780
23025
  page: options.page,
22781
23026
  pageSize: options.pageSize,
22782
23027
  pageExplicit: command.getOptionValueSource("page") === "cli",
@@ -22789,7 +23034,7 @@ function registerProjectCommands(program2) {
22789
23034
  "POST",
22790
23035
  "/project/list",
22791
23036
  {
22792
- data,
23037
+ ...request,
22793
23038
  preserveErrorBody: true,
22794
23039
  capability: "project.search"
22795
23040
  }
@@ -22799,7 +23044,7 @@ function registerProjectCommands(program2) {
22799
23044
  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
23045
  const config = await loadConfig();
22801
23046
  const profile = resolveProfile(config, options.profile);
22802
- const data = withProjectListPagination(await parseProjectJson(options.body, "--body"), {
23047
+ const request = splitProjectListPagination(await parseProjectJson(options.body, "--body"), {
22803
23048
  page: options.page,
22804
23049
  pageSize: options.pageSize,
22805
23050
  pageExplicit: command.getOptionValueSource("page") === "cli",
@@ -22809,17 +23054,24 @@ function registerProjectCommands(program2) {
22809
23054
  createApiClient(profile),
22810
23055
  "POST",
22811
23056
  "/project/list",
22812
- { data }
23057
+ request
22813
23058
  );
22814
23059
  printResult(options.format, result);
22815
23060
  });
22816
- project.command("get <id>").description("Get project detail").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "pretty").action(async (id, options) => {
23061
+ project.command("get [id]").description("Get project detail").option("--project-id <projectId>", "Project id (compatibility alias for the positional id)").option("--profile <profile>", "Profile name").option("--format <format>", "Output format", "pretty").action(async (id, options) => {
23062
+ const resolvedId = id?.trim() || options.projectId?.trim();
23063
+ if (!resolvedId) {
23064
+ throw new Error("project get requires <id> or --project-id <id>.");
23065
+ }
23066
+ if (id?.trim() && options.projectId?.trim() && id.trim() !== options.projectId.trim()) {
23067
+ throw new Error(`project get received conflicting ids: positional=${id.trim()}, --project-id=${options.projectId.trim()}.`);
23068
+ }
22817
23069
  const config = await loadConfig();
22818
23070
  const profile = resolveProfile(config, options.profile);
22819
23071
  const result = await apiRequest(
22820
23072
  createApiClient(profile),
22821
23073
  "GET",
22822
- `/project/${id}`
23074
+ `/project/${resolvedId}`
22823
23075
  );
22824
23076
  printResult(options.format, attachProjectDetailUrl(profile, result));
22825
23077
  });
@@ -23525,6 +23777,10 @@ var schemaEntries = [
23525
23777
  { name: "config.project_detail_template.create", description: "Create project detail template config through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23526
23778
  { name: "config.project_detail_template.delete", description: "Delete project detail template config through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
23527
23779
  { name: "config.project_detail_template.submit", description: "Submit project detail template edits through a verified typed adapter.", method: "PUT", path: "/api/flow_page_template/:id" },
23780
+ { name: "config.flow_detail_template.export", description: "List or export type=5 flow report/document template config.", method: "GET", path: "/api/flow_page_template/:id?type=5&skip_i18n=true" },
23781
+ { name: "config.flow_detail_template.create", description: "Create a type=5 flow report/document template through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23782
+ { name: "config.flow_detail_template.delete", description: "Delete a type=5 flow report/document template through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
23783
+ { name: "config.flow_detail_template.submit", description: "Submit type=5 flow report/document template edits through a verified typed adapter.", method: "PUT", path: "/api/flow_page_template/:id" },
23528
23784
  { name: "config.console_template.export", description: "Export console template config.", method: "GET", path: "/api/flow_page_template/:id?skip_i18n=true" },
23529
23785
  { name: "config.console_template.create", description: "Create console template config through a verified typed adapter.", method: "POST", path: "/api/flow_page_template" },
23530
23786
  { name: "config.console_template.delete", description: "Delete console template config through a verified typed adapter.", method: "DELETE", path: "/api/flow_page_template/:id" },
@@ -23859,6 +24115,15 @@ var CONFIG_TASK_RULES = [
23859
24115
  constraintEvidence: /默认详情模板|resolve-default|详情页|project_detail|project-detail-template lint/i,
23860
24116
  mentionPattern: /项目详情模板|项目详情页|project-detail-template|project_detail/
23861
24117
  },
24118
+ {
24119
+ domain: "flow-detail-template",
24120
+ skill: "bpmax-flow-detail-template-editor",
24121
+ lockPattern: /flow-detail-template:(?:\d+|new-[A-Za-z0-9_-]+)/,
24122
+ writeEvidence: [/bpmax-cli config flow-detail-template lint/, /bpmax-cli config flow-detail-template build/, /bpmax-cli config flow-detail-template submit/, /bpmax-cli config flow-detail-template verify/],
24123
+ readonlyEvidence: [/bpmax-cli config flow-detail-template (?:list|export)|流程报告.*回读|流程报表.*回读|readback/i],
24124
+ constraintEvidence: /type=5|流程报告模板|流程报表模板|flow-detail-template lint/i,
24125
+ mentionPattern: /流程报告模板|流程报表模板|flow-detail-template|flow_detail_template/
24126
+ },
23862
24127
  {
23863
24128
  domain: "step-detail-template",
23864
24129
  skill: "bpmax-flow-template-editor",
@@ -24496,6 +24761,7 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
24496
24761
  "| \u6D41\u7A0B\u6A21\u677F | bpmax-flow-template-editor | bpmax-cli config flow-template export/lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | project_after_create_path\u3001message_template\u3001matrix_owner\u3001\u6D41\u7A0B\u6A21\u677F\u7EA6\u675F |",
24497
24762
  "| \u8868\u5355\u6A21\u677F | bpmax-form-template-editor | bpmax-cli config form-template export/lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | \u5B57\u6BB5 schema\u3001\u8868\u5355\u987A\u5E8F\u3001raw.value\u3001layout\u3001sub_form\u3001form-template inspect |",
24498
24763
  "| \u5217\u8868\u6A21\u677F | bpmax-list-template-editor | bpmax-cli config list-template lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | \u64CD\u4F5C\u5217\u3001\u8BE6\u60C5\u52A8\u4F5C\u3001\u5220\u9664\u6743\u9650 guard\uFF08\u9996\u9009 ctx.$CAN_DELETE\uFF0C\u7981\u6B62\u5F53\u524D\u73AF\u8282\u4E3A\u7A7A\u6761\u4EF6\uFF09\u3001icon\u3001\u67E5\u8BE2\u5B89\u5168\u3001\u771F\u5B9E\u5217\u8868\u9875 |",
24764
+ "| \u6D41\u7A0B\u62A5\u544A\u6A21\u677F | bpmax-flow-detail-template-editor | bpmax-cli config flow-detail-template list/export/lint/build/submit/verify | type=5\uFF0C\u5185\u5BB9\u4E3A fields + templateFile\uFF0C\u4E0D\u80FD\u4E0E\u9879\u76EE\u8BE6\u60C5 type=2 \u6216\u73AF\u8282\u8BE6\u60C5 type=6 \u6DF7\u7528 |",
24499
24765
  "| \u73AF\u8282\u8BE6\u60C5\u6A21\u677F | bpmax-flow-template-editor | bpmax-cli config step-detail-template export/lint/build/submit/verify\uFF1B\u6D41\u7A0B\u7ED1\u5B9A\u8FD8\u9700 flow-template verify | type=6\u3001content.layout\u3001\u6A21\u5757\u58F0\u660E\u3001step_detail_id \u8FDC\u7AEF\u5B58\u5728\u6027\u4E0E\u8282\u70B9\u9002\u914D |",
24500
24766
  "| \u5BFC\u822A\u914D\u7F6E | bpmax-nav-config-editor | bpmax-cli config nav-config lint/build/submit/verify\uFF1B\u5199\u4EFB\u52A1\u5148\u8DD1 bpmax-cli config adapters --format json \u6838\u5BF9 capability/adapter | PC/H5 \u5BFC\u822A\u3001\u5FEB\u6377\u5165\u53E3\u3001\u6D4F\u89C8\u5668\u6253\u5F00\u9A8C\u8BC1 |",
24501
24767
  "",
@@ -25498,6 +25764,7 @@ function commandEndpointHint(argv) {
25498
25764
  "list-template": "/flow_page_template",
25499
25765
  "filter-template": "/flow_page_template",
25500
25766
  "project-detail-template": "/flow_page_template",
25767
+ "flow-detail-template": "/flow_page_template",
25501
25768
  "step-detail-template": "/flow_page_template",
25502
25769
  "console-template": "/flow_page_template"
25503
25770
  };