@stalfh233/omc-cli 0.6.53 → 0.6.55
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/coverage/m1-coverage-manifest-v1.json +64 -2
- package/dist/capability-overview.js +4 -4
- package/dist/endpoints.js +41 -0
- package/dist/field-change.js +27 -3
- package/dist/field-families.js +130 -13
- package/dist/lanes/app-contract.js +32 -0
- package/dist/lanes/app-coverage.js +5 -0
- package/dist/lanes/app.js +396 -1
- package/dist/lanes/datarule.js +1 -1
- package/dist/lanes/dictionary.js +2 -2
- package/dist/lanes/field-contract.js +31 -2
- package/dist/lanes/field.js +9 -3
- package/dist/lanes/form.js +1 -1
- package/dist/lanes/list-view.js +23 -3
- package/dist/lanes/model.js +1 -1
- package/dist/lanes/report.js +2 -2
- package/dist/lanes/runtime-data.js +3 -3
- package/dist/lanes/workflow-contract.js +17 -0
- package/dist/lanes/workflow-coverage.js +16 -0
- package/dist/lanes/workflow.js +203 -2
- package/dist/recipes/field.js +33 -3
- package/dist/tool-search.js +7 -4
- package/dist/wire.js +57 -0
- package/package.json +3 -3
- package/skills/omc-capabilities.md +6 -5
|
@@ -1313,7 +1313,7 @@
|
|
|
1313
1313
|
"capability": "Application package (app) lifecycle: list, create, update (group move), admin delete",
|
|
1314
1314
|
"status": "executable",
|
|
1315
1315
|
"scope": "Application package list create update delete absence",
|
|
1316
|
-
"excluded_or_unsupported_reason": "Design-time test environments only; production environments permanently refuse writes. App publish and environment-wide
|
|
1316
|
+
"excluded_or_unsupported_reason": "Design-time test environments only; production environments permanently refuse writes. App PUBLISH stays an out-of-boundary manual designer action (publish is not modelled as a CLI write); app-package and environment-wide export ARE covered by the r64b item below (read-only).",
|
|
1317
1317
|
"version_family": "8.6",
|
|
1318
1318
|
"anchor_version": "8.6.26",
|
|
1319
1319
|
"evidence": [
|
|
@@ -1340,6 +1340,34 @@
|
|
|
1340
1340
|
"app package delete absence"
|
|
1341
1341
|
]
|
|
1342
1342
|
},
|
|
1343
|
+
{
|
|
1344
|
+
"capability": "r64b application package export",
|
|
1345
|
+
"status": "executable",
|
|
1346
|
+
"scope": "App package export (single app) and environment-wide lifecycle export (all app packages + app groups + biz services + datasources), binary ZIP landed with bytes/sha256/entry/asset readback",
|
|
1347
|
+
"version_family": "8.6",
|
|
1348
|
+
"anchor_version": "8.6.26",
|
|
1349
|
+
"evidence": [
|
|
1350
|
+
{
|
|
1351
|
+
"path": "packages/omc-cli/src/lanes/app.ts",
|
|
1352
|
+
"anchor": "app.export"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
"path": "packages/omc-cli/test/r64b-app-export.test.ts",
|
|
1356
|
+
"anchor": "contract tests"
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"path": "packages/omc-cli/src/wire.ts",
|
|
1360
|
+
"anchor": "wireDownloadPackageStream (ZIP stream vs HTTP-200 JSON refusal)"
|
|
1361
|
+
}
|
|
1362
|
+
],
|
|
1363
|
+
"lane": "app-management",
|
|
1364
|
+
"tools": [
|
|
1365
|
+
"app.export"
|
|
1366
|
+
],
|
|
1367
|
+
"scopes": [
|
|
1368
|
+
"app package export"
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1343
1371
|
{
|
|
1344
1372
|
"capability": "R1 report page and BI chart lifecycle",
|
|
1345
1373
|
"status": "executable",
|
|
@@ -1508,6 +1536,40 @@
|
|
|
1508
1536
|
"scopes": [
|
|
1509
1537
|
"rule execution log search (trigger-time desc, row match client-side)"
|
|
1510
1538
|
]
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
"capability": "r64 runtime workflow admin operations (transfer/activate/finish)",
|
|
1542
|
+
"status": "executable",
|
|
1543
|
+
"scope": "Admin workflow-ops trio for test acceleration: ADJUST_PARTICIPANT (reassign current approver), ACTIVATE_ACTIVITY (jump to a chosen node), finish_instance_by_post (manual finish; end-handler rules still fire). Live-proven r64 2026-11-14 (sandbox r64ops_wfo).",
|
|
1544
|
+
"excluded_or_unsupported_reason": "Live-proven 2026-09-11: startWorkflow -> workitem.list discovered workItemId 970fe802baba463d97c1d97f3695bb3a + bizObjectId c607b77af4ab4293a1f6ce314ec9327c -> approval submit -> list count 0 and record COMPLETED. Evidence in .scratch/omc-app-management/issues/06-workitem-list-capability.md. r4-training 2026-10-20: a stalled instance (data.submit -> PROCESSING, no next todo) exposed nothing; list_workflow_instance_activity (WorkflowMaintenanceAssembler.listActivateActivity) now backs workflow.instanceActivity with per-activity status/participants so \"where did it stop\" is a read, not a MySQL+container-log dig.",
|
|
1545
|
+
"version_family": "8.6",
|
|
1546
|
+
"anchor_version": "8.6.26",
|
|
1547
|
+
"evidence": [
|
|
1548
|
+
{
|
|
1549
|
+
"path": "packages/omc-cli/src/lanes/workflow.ts",
|
|
1550
|
+
"anchor": "workitem.list"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"path": ".scratch/omc-app-management/issues/06-workitem-list-capability.md",
|
|
1554
|
+
"anchor": "静态取证"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
"path": "packages/omc-cli/src/workflow-support.ts",
|
|
1558
|
+
"anchor": "listInstanceActivities"
|
|
1559
|
+
}
|
|
1560
|
+
],
|
|
1561
|
+
"lane": "W7-S29-greenfield",
|
|
1562
|
+
"tools": [
|
|
1563
|
+
"workflow.transfer",
|
|
1564
|
+
"workflow.activate",
|
|
1565
|
+
"workflow.finish"
|
|
1566
|
+
],
|
|
1567
|
+
"scopes": [
|
|
1568
|
+
"runtime workflow admin adjust participant",
|
|
1569
|
+
"runtime workflow admin activate activity",
|
|
1570
|
+
"runtime workflow admin finish instance"
|
|
1571
|
+
],
|
|
1572
|
+
"revision_note": "r64(2026-11-14)新增:用户需求的流程运维三件套,真机全链实证(workflow_operation approval 对象形状 / adjust_workItem=加签面 / finish=正常完结语义)。定位=测试提速:运维过的实例不能用于真实流程/权限验证。"
|
|
1511
1573
|
}
|
|
1512
1574
|
]
|
|
1513
|
-
}
|
|
1575
|
+
}
|
|
@@ -32,11 +32,11 @@ const SURFACES = [
|
|
|
32
32
|
id: "app",
|
|
33
33
|
title: "应用包(app)",
|
|
34
34
|
lane: LANES.app,
|
|
35
|
-
description: "应用包(app.*)生命周期:列出、创建、更新(分组移动)、admin
|
|
36
|
-
operations: ["create", "update", "delete"],
|
|
35
|
+
description: "应用包(app.*)生命周期:列出、创建、更新(分组移动)、admin 删除、应用包导出(单应用/整环境备份)。不是应用内的目录节点——目录用 folder。",
|
|
36
|
+
operations: ["create", "update", "delete", "export"],
|
|
37
37
|
requires: [],
|
|
38
38
|
intent: { level: "none", note: "未覆盖;用 omc call app.*。" },
|
|
39
|
-
notes: "环境已带默认 applicationCode,建模不必先建应用。新建应用平台会自动塞一个默认分组(folder.isDefault);有模型/报表等非目录节点时 app.delete 拒 app-not-empty。",
|
|
39
|
+
notes: "环境已带默认 applicationCode,建模不必先建应用。新建应用平台会自动塞一个默认分组(folder.isDefault);有模型/报表等非目录节点时 app.delete 拒 app-not-empty。r64b 导出:省略 applicationCode = 环境级生命周期包(全部应用包+应用分组+业务集成+数据源;平台固定空 references,环境级字典/组织/角色不在包内);指定 applicationCode = 单应用包,includeDependencies 可把引用的字典/角色/业务集成/数据源一起打进去。ZIP 同步返回,工具核 PK 头与条目数后落盘并回 bytes/sha256;平台无按资产类型筛选参数。",
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
id: "folder",
|
|
@@ -142,7 +142,7 @@ const SURFACES = [
|
|
|
142
142
|
operations: ["create", "update", "publish", "bindRule", "delete"],
|
|
143
143
|
requires: ["model"],
|
|
144
144
|
intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批)仍走 escape hatch。" },
|
|
145
|
-
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。",
|
|
145
|
+
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。",
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
id: "onlinejs",
|
package/dist/endpoints.js
CHANGED
|
@@ -11,6 +11,38 @@ export const ENDPOINTS = {
|
|
|
11
11
|
applicationUpdate: "/api/api/app/apppackage/update",
|
|
12
12
|
applicationDelete: "/api/api/app/apppackage/delete",
|
|
13
13
|
applicationTree: "/api/api/app/apppackage/trees",
|
|
14
|
+
/**
|
|
15
|
+
* App package export/import (AppImportExportController, decompiled
|
|
16
|
+
* AI-Platform-v1.1.25 / 8.6 family: @RequestMapping("/api/app/apppackage")
|
|
17
|
+
* + @PostMapping("/export")). exportApp(AppExportParamVO) streams a ZIP
|
|
18
|
+
* (Content-Type application/octet-stream); refusals still arrive HTTP 200 +
|
|
19
|
+
* JSON envelope (10005 应用编码不能为空 / 600005 应用不存在!). body:
|
|
20
|
+
* {appCode, references:{relativeDictionary, relativeRole,
|
|
21
|
+
* relativeBizService, relativeAdvanceDataSource,
|
|
22
|
+
* relativeReportAdvanceDataSource}}; the five keys are exactly the design
|
|
23
|
+
* UI's refTabsKey selection (admin bundle exportApp → {appCode, references}).
|
|
24
|
+
*
|
|
25
|
+
* The dependency picker reads GET /dependencies?appCode= (live 1.1.25:
|
|
26
|
+
* relativeApps/relativeSchemas/relativeDepartment/relativeUser/relativeRole/
|
|
27
|
+
* relativeDictionary/relativeBizService/relativeEnvironment/relativeAppPage/
|
|
28
|
+
* relativeDashboard/relativeAdvanceDataSource/relativeReportAdvanceDataSource/
|
|
29
|
+
* inheritSchemas/templateSchema/relativeCustomPage).
|
|
30
|
+
*/
|
|
31
|
+
appPackageExport: "/api/api/app/apppackage/export",
|
|
32
|
+
appPackageDependencies: "/api/api/app/apppackage/dependencies",
|
|
33
|
+
/**
|
|
34
|
+
* Environment-wide lifecycle export (LifeCycleImportExportController:
|
|
35
|
+
* @RequestMapping("/api/lifeCycle/apppackage") + @PostMapping
|
|
36
|
+
* ("/lifeCycleExport")). LifeCycleIEFacadeImpl.exportLifeCycle enumerates
|
|
37
|
+
* getAppPackageListByDeleteStatus(false) and writes every app package under
|
|
38
|
+
* metadata/app/applist/<appCode>/, plus appgroup.json, ALL biz services
|
|
39
|
+
* (metadata/bizservice/manifest.json + servicegroup.json), datasources, and
|
|
40
|
+
* the root metadata/manifest.json; the zipped download is named
|
|
41
|
+
* metadata.zip. body {name?,version?,description?,author?} (all optional —
|
|
42
|
+
* the root manifest still carries the platform lifecycle version); GET
|
|
43
|
+
* answers 40007 请求方法不正确. There is no per-app or per-asset filter.
|
|
44
|
+
*/
|
|
45
|
+
environmentLifeCycleExport: "/api/api/lifeCycle/apppackage/lifeCycleExport",
|
|
14
46
|
modelList: "/api/api/app/bizmodels/list_schema",
|
|
15
47
|
modelGet: "/api/api/app/bizmodels/get_all",
|
|
16
48
|
modelCreate: "/api/api/app/bizmodels/create",
|
|
@@ -221,6 +253,15 @@ export const ENDPOINTS = {
|
|
|
221
253
|
workflowDeleteInstance: "/api/api/runtime/workflow/delete_instance",
|
|
222
254
|
workflowGetBizObjectByWfInstanceId: "/api/api/runtime/workflow/getBizObjectByWfInstanceId",
|
|
223
255
|
workflowListInstanceActivity: "/api/api/runtime/workflow/list_workflow_instance_activity",
|
|
256
|
+
// r64(流程运维三件套,真机实证):管理面统一操作端点是 workflow_operation
|
|
257
|
+
// (operationType:ADJUST_PARTICIPANT 换审批人 / ACTIVATE_ACTIVITY 运维跳转节点
|
|
258
|
+
// / MODIFY_OWNER / PAUSE_INSTANCE / RESUME_INSTANCE;approval 是对象
|
|
259
|
+
// {activityCode,commonSet,deleted,resources,content},传字符串 10009)。
|
|
260
|
+
// 注意 adjust_workItem_participators 是**加签**面(402512「不允许加签给自己」),
|
|
261
|
+
// 不是换人。finish_instance_by_post 是发起人「手动结束」(正常完结语义,
|
|
262
|
+
// end 规则照常触发);abort_instance 才是终止(规则不一定跑)。
|
|
263
|
+
workflowOperation: "/api/api/runtime/workflow/workflow_operation",
|
|
264
|
+
workflowFinishInstance: "/api/api/runtime/workflow/finish_instance_by_post",
|
|
224
265
|
workflowListFinishedWorkItems: "/api/api/runtime/workflow/list_finished_workitems",
|
|
225
266
|
workflowGetInstanceBaseInfo: "/api/api/runtime/workflow/get_instance_baseinfo",
|
|
226
267
|
organizationRoleList: "/api/api/organization/role/list",
|
package/dist/field-change.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FIELD_PROPERTY_TYPES } from "./field-families.js";
|
|
2
|
-
import { assertFormConditions, assertNumericalScale, assertFieldOptionsAllowed, buildChildTableSubSchema, buildFieldOptions, ensureRelationDisplayFieldOptions, normalizeFieldPropertyType, optionShapeFamily, relationDisplayFieldCode, withLegacyOptionSetKeys, } from "./field-families.js";
|
|
2
|
+
import { assertFormConditions, assertNumericalScale, assertFieldOptionsAllowed, buildChildTableSubSchema, buildFieldOptions, canonicalNumericalFormat, ensureRelationDisplayFieldOptions, normalizeFieldPropertyType, optionShapeFamily, relationDisplayFieldCode, withLegacyOptionSetKeys, } from "./field-families.js";
|
|
3
3
|
import { nameI18nJson } from "./field-families.js";
|
|
4
4
|
import { decodeJsonObjectColumn } from "./json-column.js";
|
|
5
5
|
import { normalizeFormConditionOptions } from "./lanes/datarule-protocol.js";
|
|
@@ -38,6 +38,25 @@ function assertRelationTargetPresent(propertyType, options, relativeCode, code)
|
|
|
38
38
|
message: "关联字段缺少目标模型:options.schemaCode 与顶层 relativeCode 都为空。平台建字段时接受它,但 field.publish 会以 300010『数据模型编码不能为空』拒绝,之后该列不可用。请传 relativeCode:'<目标模型code>'(工具会自动补全 options.schemaCode/queryCode),或在 options 里直接给 schemaCode",
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* r64b (live 2026-11-14): NUMERICAL `options.format` is read LITERALLY by the
|
|
43
|
+
* runtime — a semantic word (`percent`, `currency`, `¥`) stored on the field
|
|
44
|
+
* row is not understood and the portal renders the raw decimal. Canonicalise at
|
|
45
|
+
* the write seam so callers can keep using the semantic aliases while the wire
|
|
46
|
+
* carries the designer's constant (`ratio.percentile`, `RMB.percentile`, …).
|
|
47
|
+
*/
|
|
48
|
+
function canonicaliseNumericalFormat(propertyType, options, requested) {
|
|
49
|
+
if (propertyType !== FIELD_PROPERTY_TYPES.NUMERICAL)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (requested === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
const to = canonicalNumericalFormat(requested, options.scale);
|
|
54
|
+
if (to === undefined)
|
|
55
|
+
return undefined;
|
|
56
|
+
options.format = to;
|
|
57
|
+
const from = String(requested);
|
|
58
|
+
return from === to ? undefined : { from, to };
|
|
59
|
+
}
|
|
41
60
|
/** Normalize one field change and run every reproduced write gate exactly once. */
|
|
42
61
|
export function prepareFieldChange(input) {
|
|
43
62
|
const propertyType = normalizeFieldPropertyType({ propertyType: input.propertyType });
|
|
@@ -58,13 +77,17 @@ export function prepareFieldChange(input) {
|
|
|
58
77
|
assertNumericalScale(propertyType, raw);
|
|
59
78
|
assertFormConditions(raw);
|
|
60
79
|
const options = ensureRelationDisplayFieldOptions(propertyType, raw);
|
|
80
|
+
const formatNormalized = canonicaliseNumericalFormat(propertyType, options, raw.format);
|
|
61
81
|
const displayCode = relationDisplayFieldCode(propertyType, options);
|
|
62
82
|
const optionRelationTarget = typeof options.schemaCode === "string" ? options.schemaCode.trim() : "";
|
|
63
83
|
const normalizedRelation = (propertyType === FIELD_PROPERTY_TYPES.WORK_SHEET || propertyType === FIELD_PROPERTY_TYPES.MULT_WORK_SHEET) &&
|
|
64
84
|
optionRelationTarget.length > 0 && !(typeof input.relativeCode === "string" && input.relativeCode.trim().length > 0)
|
|
65
85
|
? { relationTarget: "options.schemaCode→relativeCode" }
|
|
66
86
|
: undefined;
|
|
67
|
-
|
|
87
|
+
const normalized = normalizedRelation === undefined && formatNormalized === undefined
|
|
88
|
+
? undefined
|
|
89
|
+
: { ...(normalizedRelation ?? {}), ...(formatNormalized ? { format: formatNormalized } : {}) };
|
|
90
|
+
return { propertyType, isChildTable, options, ...(displayCode ? { displayCode } : {}), ...(normalized ? { normalized } : {}) };
|
|
68
91
|
}
|
|
69
92
|
/** The single platform wire body for a field create. */
|
|
70
93
|
export function fieldChangeWireBody(input, prepared) {
|
|
@@ -193,6 +216,7 @@ export function prepareFieldUpdate(input) {
|
|
|
193
216
|
: rebuiltOptions;
|
|
194
217
|
if (!isChildTable && !effectiveOptions && !input.choices)
|
|
195
218
|
Object.assign(nextOptions, currentOptions);
|
|
219
|
+
const formatNormalized = isChildTable ? undefined : canonicaliseNumericalFormat(recordType, nextOptions, effectiveOptions?.format);
|
|
196
220
|
if (!isChildTable) {
|
|
197
221
|
// An update that touches a relation's options must keep a resolvable target:
|
|
198
222
|
// backfill schemaCode from relativeCode (top-level or already stored) so
|
|
@@ -214,7 +238,7 @@ export function prepareFieldUpdate(input) {
|
|
|
214
238
|
: input.name !== undefined
|
|
215
239
|
? nameI18nJson(input.name)
|
|
216
240
|
: (typeof input.base.name_i18n === "string" ? input.base.name_i18n : undefined);
|
|
217
|
-
return { propertyType: recordType, isChildTable, options: nextOptions, ...(conditionCompiled.length > 0 ? { conditionCompiled } : {}), ...(displayCode !== undefined ? { displayCode } : {}), ...(name !== undefined ? { name } : {}), ...(nameI18n !== undefined ? { nameI18n } : {}) };
|
|
241
|
+
return { propertyType: recordType, isChildTable, options: nextOptions, ...(conditionCompiled.length > 0 ? { conditionCompiled } : {}), ...(formatNormalized ? { formatNormalized } : {}), ...(displayCode !== undefined ? { displayCode } : {}), ...(name !== undefined ? { name } : {}), ...(nameI18n !== undefined ? { nameI18n } : {}) };
|
|
218
242
|
}
|
|
219
243
|
/** The single field-update wire body: the stored row spread with changed keys. */
|
|
220
244
|
export function fieldUpdateWireBody(input, prepared) {
|
package/dist/field-families.js
CHANGED
|
@@ -191,6 +191,7 @@ export const fieldOptionsArg = z
|
|
|
191
191
|
// assertNumericalScale (not zod min/max) so scale:9 still returns the
|
|
192
192
|
// teaching refusal, not a generic tool-input-invalid.
|
|
193
193
|
scale: z.number().optional().describe("NUMERICAL 必填:小数位数(0=整数,1=1位,2=2位 … 8=8位)。金额两位小数用 2;不是 listview displayFormat 枚举"),
|
|
194
|
+
format: z.unknown().optional().describe("NUMERICAL 显示格式族(平台常量):`ratio`/`ratio.tenths`/`ratio.percentile`=20%/20.0%/20.00%,`integer`/`tenths`/`percentile`=普通数字,`RMB.*`/`dollar.*`/`HK.*` 等=货币,`none`=裸值。**百分比存比值** 0.5→50.00%(存 50 显示 5000.00%),`scale` 与小数位对齐。别名 percent/currency/¥ 由 CLI 归一;字段行 format 优先于表单控件"),
|
|
194
195
|
nested: z.boolean().optional().describe("nested child-table metadata — refused (coverage boundary)"),
|
|
195
196
|
relationLinkage: z.boolean().optional().describe("advanced relation linkage — refused (coverage boundary)"),
|
|
196
197
|
})
|
|
@@ -500,19 +501,120 @@ const RATIO_DECIMALS_FORMAT = Object.freeze({
|
|
|
500
501
|
1: "ratio.tenths",
|
|
501
502
|
2: "ratio.percentile",
|
|
502
503
|
});
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
504
|
+
/**
|
|
505
|
+
* THE platform's numeric display-format enum, as the designer itself emits it
|
|
506
|
+
* (r64b live 2026-11-14, Playwright on the real designer at
|
|
507
|
+
* `/admin#/apps/model/<app>/<schema>/data/dataModel` → 数据项 Edit → DataItem
|
|
508
|
+
* Attributes → Default Format; the same 47-option list also backs the form
|
|
509
|
+
* control's Display Format select).
|
|
510
|
+
*
|
|
511
|
+
* The decimals word is the SECOND half of the constant; the family prefix is
|
|
512
|
+
* the first. `format` stored on the field row (`bizproperty.options.format`)
|
|
513
|
+
* is this constant VERBATIM, e.g. `ratio.percentile` for `20.00%`,
|
|
514
|
+
* `RMB.percentile` for `¥2,000.00`. The runtime reads it literally: a
|
|
515
|
+
* non-canonical word there is not "unknown → fall back", it renders the raw
|
|
516
|
+
* decimal (proved by nf_h/nf_i: field `format:"percent"` → portal shows 0.5).
|
|
517
|
+
*/
|
|
518
|
+
export const NUMERICAL_FORMAT_DECIMALS = Object.freeze({
|
|
519
|
+
integer: 0,
|
|
520
|
+
tenths: 1,
|
|
521
|
+
percentile: 2,
|
|
522
|
+
Millimeter: 3,
|
|
523
|
+
tenThousand: 4,
|
|
524
|
+
hundredThousand: 5,
|
|
525
|
+
millionDecimals: 6,
|
|
526
|
+
tenMillionDecimals: 7,
|
|
527
|
+
billionDecimals: 8,
|
|
528
|
+
});
|
|
529
|
+
/** Family prefixes as spelled by the designer (case matters on the wire). */
|
|
530
|
+
export const NUMERICAL_FORMAT_PREFIXES = Object.freeze({
|
|
531
|
+
ratio: "ratio.",
|
|
532
|
+
rmb: "RMB.",
|
|
533
|
+
dollar: "dollar.",
|
|
534
|
+
euro: "euro.",
|
|
535
|
+
hk: "HK.",
|
|
536
|
+
});
|
|
537
|
+
/** `none` = the designer's "Null" option: no grouping, no forced decimals. */
|
|
538
|
+
export const NUMERICAL_FORMAT_NONE = "none";
|
|
539
|
+
/**
|
|
540
|
+
* The currency families are NOT offered below two decimals by the designer
|
|
541
|
+
* (its 47-item list starts each currency at `<CUR>.percentile` = ¥2,000.00);
|
|
542
|
+
* a 0/1-decimal currency request therefore clamps up to `percentile` instead of
|
|
543
|
+
* emitting `RMB.tenths`, which the runtime would not render.
|
|
544
|
+
*/
|
|
545
|
+
const CURRENCY_MIN_DECIMALS = 2;
|
|
546
|
+
const NUMERICAL_DECIMALS_BY_LOWER = new Map(Object.entries(NUMERICAL_FORMAT_DECIMALS).map(([word, decimals]) => [word.toLowerCase(), { word, decimals }]));
|
|
547
|
+
/** Semantic aliases the CLI accepts as sugar; canonicalised before the wire. */
|
|
548
|
+
function numericalAliasFamily(value) {
|
|
549
|
+
if (value === "percent" || value === "percentage" || value === "ratio" || value === "%" || value === "percentile")
|
|
550
|
+
return undefined; // `percentile` alone = 2-decimals, handled below
|
|
551
|
+
if (value === "currency" || value === "rmb" || value === "cny" || value === "¥" || value === "¥")
|
|
552
|
+
return "rmb";
|
|
553
|
+
if (value === "dollar" || value === "usd" || value === "$")
|
|
554
|
+
return "dollar";
|
|
555
|
+
if (value === "euro" || value === "eur" || value === "€")
|
|
556
|
+
return "euro";
|
|
511
557
|
if (value === "hk" || value === "hkd" || value === "hk$")
|
|
512
|
-
return "
|
|
513
|
-
if (value === "
|
|
514
|
-
return "
|
|
515
|
-
return
|
|
558
|
+
return "hk";
|
|
559
|
+
if (value === "decimal" || value === "number" || value === "numeric" || value === "none")
|
|
560
|
+
return "";
|
|
561
|
+
return undefined;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Normalise a caller-supplied numeric `format` to the platform constant the
|
|
565
|
+
* runtime actually understands.
|
|
566
|
+
*
|
|
567
|
+
* - a canonical constant passes through (case-corrected: `ratio.percentile`,
|
|
568
|
+
* `RMB.percentile`, `Millimeter`, …) — so `ratio.Millimeter` (20.000%, a
|
|
569
|
+
* value the live designer offers) survives;
|
|
570
|
+
* - semantic aliases (`percent` / `currency` / `¥` / `dollar` / `euro` / `hk`)
|
|
571
|
+
* compose from `scale`; percent clamps to the three documented `ratio.*`
|
|
572
|
+
* values so 8.6.26 stays inside its evidenced domain;
|
|
573
|
+
* - `none`/absent stays `none`.
|
|
574
|
+
*
|
|
575
|
+
* Returns `undefined` when there is no format to write (leave the key out).
|
|
576
|
+
*/
|
|
577
|
+
/** Compose `<family><decimals-word>` with the currency floors the designer offers. */
|
|
578
|
+
function numericalFamilyFormat(family, decimals) {
|
|
579
|
+
const floored = family === "" || family === "ratio." ? decimals : Math.max(decimals, CURRENCY_MIN_DECIMALS);
|
|
580
|
+
return `${family}${NUMERICAL_DECIMALS_FORMAT[floored] ?? NUMERICAL_DECIMALS_FORMAT[2]}`;
|
|
581
|
+
}
|
|
582
|
+
export function canonicalNumericalFormat(format, scale) {
|
|
583
|
+
if (format === undefined || format === null)
|
|
584
|
+
return undefined;
|
|
585
|
+
const raw = String(format).trim();
|
|
586
|
+
if (raw === "")
|
|
587
|
+
return undefined;
|
|
588
|
+
const lower = raw.toLowerCase();
|
|
589
|
+
if (lower === NUMERICAL_FORMAT_NONE)
|
|
590
|
+
return NUMERICAL_FORMAT_NONE;
|
|
591
|
+
const decimals = isNumericalScale(scale) ? scale : 0;
|
|
592
|
+
// Canonical constant, optionally family-prefixed.
|
|
593
|
+
const dot = raw.indexOf(".");
|
|
594
|
+
if (dot > 0) {
|
|
595
|
+
const family = NUMERICAL_FORMAT_PREFIXES[lower.slice(0, dot)];
|
|
596
|
+
const word = NUMERICAL_DECIMALS_BY_LOWER.get(lower.slice(dot + 1));
|
|
597
|
+
if (family !== undefined && word !== undefined) {
|
|
598
|
+
// An explicit word always wins over `scale`; only the currency floor applies.
|
|
599
|
+
return numericalFamilyFormat(family, word.decimals);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
const bare = NUMERICAL_DECIMALS_BY_LOWER.get(lower);
|
|
603
|
+
if (bare !== undefined)
|
|
604
|
+
return bare.word;
|
|
605
|
+
// Semantic aliases.
|
|
606
|
+
if (lower === "percent" || lower === "percentage" || lower === "ratio" || lower === "%") {
|
|
607
|
+
return RATIO_DECIMALS_FORMAT[Math.min(decimals, 2)];
|
|
608
|
+
}
|
|
609
|
+
const alias = numericalAliasFamily(lower);
|
|
610
|
+
if (alias === undefined)
|
|
611
|
+
return raw; // unknown value: leave the caller's word (fail-open like the wire, documented)
|
|
612
|
+
return numericalFamilyFormat(alias === "" ? "" : NUMERICAL_FORMAT_PREFIXES[alias], decimals);
|
|
613
|
+
}
|
|
614
|
+
function numericalFormatPrefix(format) {
|
|
615
|
+
const canonical = canonicalNumericalFormat(format, 2) ?? "";
|
|
616
|
+
const dot = canonical.indexOf(".");
|
|
617
|
+
return dot > 0 ? canonical.slice(0, dot + 1) : "";
|
|
516
618
|
}
|
|
517
619
|
export function numericalControlFormat(fieldOptions) {
|
|
518
620
|
const scale = fieldOptions?.scale;
|
|
@@ -522,7 +624,22 @@ export function numericalControlFormat(fieldOptions) {
|
|
|
522
624
|
// rebuild silently turn existing integer money fields into "2,000.00".
|
|
523
625
|
const valid = isNumericalScale(scale);
|
|
524
626
|
const decimals = valid ? scale : 0;
|
|
525
|
-
const
|
|
627
|
+
const format = fieldOptions?.format;
|
|
628
|
+
// r64b: the Designer itself stores the canonical constant on the field row
|
|
629
|
+
// (`ratio.percentile`, `RMB.percentile`, …). Pass it through untouched —
|
|
630
|
+
// re-deriving from `scale` here used to turn `ratio.percentile` into plain
|
|
631
|
+
// `percentile`, so a rebuilt form showed 2,000.00 where the field asked 20.00%.
|
|
632
|
+
const canonical = canonicalNumericalFormat(format, decimals);
|
|
633
|
+
if (canonical === NUMERICAL_FORMAT_NONE)
|
|
634
|
+
return NUMERICAL_FORMAT_NONE;
|
|
635
|
+
if (canonical !== undefined) {
|
|
636
|
+
const dot = canonical.indexOf(".");
|
|
637
|
+
if (dot > 0)
|
|
638
|
+
return canonical;
|
|
639
|
+
if (canonical === "ratio" || NUMERICAL_DECIMALS_BY_LOWER.has(canonical.toLowerCase()))
|
|
640
|
+
return canonical;
|
|
641
|
+
}
|
|
642
|
+
const prefix = numericalFormatPrefix(format);
|
|
526
643
|
if (prefix === "ratio.")
|
|
527
644
|
return RATIO_DECIMALS_FORMAT[Math.min(decimals, 2)];
|
|
528
645
|
return `${prefix}${NUMERICAL_DECIMALS_FORMAT[decimals]}`;
|
|
@@ -14,6 +14,10 @@ export const APP_WIRE = Object.freeze({
|
|
|
14
14
|
deleteBody: "apppackage/delete?appCode=; APP_PACKAGE_HAS_NODE / 600006 refuses when the app still has non-Folder nodes (models/reports/pages); tool pre-checks folder.tree and refuses app-not-empty with children[{id,type,path}] + nextCommand folder.tree (empty folders including isDefault default group do NOT block)",
|
|
15
15
|
deletePoll: "apppackage/list polls to exact absence",
|
|
16
16
|
defaultFolderSeed: "apppackage/create seeds one top-level Folder with name_i18n.en=defaultGroup (display「默认分组」); app.create readback surfaces defaultFolder{id,path,isDefault:true}; folder.tree marks the same node isDefault:true",
|
|
17
|
+
exportBody: "apppackage/export POST body {appCode, references} (AppImportExportController.exportApp(AppExportParamVO) — decompiled AI-Platform-v1.1.25) streams a ZIP: <appCode>-<uuid>/manifest.json + meta/{dm,form,view,workflow,report} + dependencies/platform/*; refusals stay HTTP 200 JSON envelopes (10005 应用编码不能为空, 600005 应用不存在!)",
|
|
18
|
+
exportReferences: "references accepts the design UI's five refTabsKey arrays (relativeDictionary/relativeRole/relativeBizService/relativeAdvanceDataSource/relativeReportAdvanceDataSource) taken verbatim from apppackage/dependencies?appCode=; {} (or omitted) exports zero selected dependencies",
|
|
19
|
+
exportBinaryStream: "both exporters answer a non-envelope ZIP stream (Content-Type application/octet-stream) on success; a JSON body on a 200 is a refusal/malformed answer, never a package — bytes are validated for the PK local-header magic and non-zero entry count before reporting success",
|
|
20
|
+
environmentExport: "lifeCycle/apppackage/lifeCycleExport POST {} → metadata.zip (LifeCycleIEFacadeImpl.exportLifeCycle): metadata/app/applist/<appCode>/… for EVERY app + metadata/app/appgroup.json + ALL biz services (metadata/bizservice/manifest.json + servicegroup.json) + bizdatasource.json + metadata/manifest.json; GET answers 40007 请求方法不正确; no per-app/per-asset filter, per-app packages use empty references",
|
|
17
21
|
});
|
|
18
22
|
export const APP_LANE_CONTRACT = Object.freeze({
|
|
19
23
|
lane: LANES.app,
|
|
@@ -26,6 +30,9 @@ export const APP_LANE_CONTRACT = Object.freeze({
|
|
|
26
30
|
create: "applicationCreate",
|
|
27
31
|
update: "applicationUpdate",
|
|
28
32
|
delete: "applicationDelete",
|
|
33
|
+
export: "appPackageExport",
|
|
34
|
+
exportDependencies: "appPackageDependencies",
|
|
35
|
+
environmentExport: "environmentLifeCycleExport",
|
|
29
36
|
}),
|
|
30
37
|
wire: Object.freeze({
|
|
31
38
|
createBody: APP_WIRE.createBody,
|
|
@@ -36,6 +43,10 @@ export const APP_LANE_CONTRACT = Object.freeze({
|
|
|
36
43
|
deleteBody: APP_WIRE.deleteBody,
|
|
37
44
|
deletePoll: APP_WIRE.deletePoll,
|
|
38
45
|
defaultFolderSeed: APP_WIRE.defaultFolderSeed,
|
|
46
|
+
exportBody: APP_WIRE.exportBody,
|
|
47
|
+
exportReferences: APP_WIRE.exportReferences,
|
|
48
|
+
exportBinaryStream: APP_WIRE.exportBinaryStream,
|
|
49
|
+
environmentExport: APP_WIRE.environmentExport,
|
|
39
50
|
}),
|
|
40
51
|
wireBindings: Object.freeze({
|
|
41
52
|
createBody: Object.freeze([behaviorBinding("test/app-management.test.ts#app.create plans, executes under approval, and reads back presence", assertAppContract)]),
|
|
@@ -46,6 +57,10 @@ export const APP_LANE_CONTRACT = Object.freeze({
|
|
|
46
57
|
deleteBody: Object.freeze([behaviorBinding("test/app-management.test.ts#app.delete removes the app via the admin delete endpoint", assertAppContract)]),
|
|
47
58
|
deletePoll: Object.freeze([behaviorBinding("test/app-management.test.ts#app.delete of an absent app is a no-op with proven absence", assertAppContract)]),
|
|
48
59
|
defaultFolderSeed: Object.freeze([behaviorBinding("test/app-folder-and-model-move.test.ts#r28d F2: app.create surfaces defaultFolder; folder.tree marks isDefault", assertAppContract)]),
|
|
60
|
+
exportBody: Object.freeze([behaviorBinding("test/r64b-app-export.test.ts#app.export writes a single-app package and verifies bytes/sha256/entries", assertAppContract)]),
|
|
61
|
+
exportReferences: Object.freeze([behaviorBinding("test/r64b-app-export.test.ts#app.export includeDependencies selects the five refTabsKey arrays", assertAppContract)]),
|
|
62
|
+
exportBinaryStream: Object.freeze([behaviorBinding("test/r64b-app-export.test.ts#app.export refuses a 200 JSON envelope instead of reporting a fake package", assertAppContract)]),
|
|
63
|
+
environmentExport: Object.freeze([behaviorBinding("test/r64b-app-export.test.ts#app.export without applicationCode writes the environment lifecycle package", assertAppContract)]),
|
|
49
64
|
}),
|
|
50
65
|
evidence: Object.freeze([
|
|
51
66
|
"packages/omc-cli/test/app-management.test.ts",
|
|
@@ -70,6 +85,10 @@ export const APP_LANE_CONTRACT = Object.freeze({
|
|
|
70
85
|
scope: "app package delete absence",
|
|
71
86
|
description: "删除一个应用包(apppackage/delete?appCode=,管理员面)。应用下还有模型/报表/自定义页等非目录节点时以 app-not-empty(平台 APP_PACKAGE_HAS_NODE / 600006)拒绝,回执列 children[{id,type,path}] 且 nextCommand 指向 folder.tree;空目录(含默认分组)不挡删除。以 apppackage/list 轮询读回精确缺席。必须显式传 `code`,没有默认应用,避免误删。",
|
|
72
87
|
}),
|
|
88
|
+
"app.export": Object.freeze({
|
|
89
|
+
scope: "app package export",
|
|
90
|
+
description: "导出配置包(备份/迁移):applicationCode 省略 → 环境级生命周期包(/lifeCycle/apppackage/lifeCycleExport,全部应用包+应用分组+业务集成服务+数据源,metadata/…)。指定 applicationCode → 单应用包(apppackage/export,body {appCode,references},meta/{dm,form,view,workflow,report}+dependencies/platform/*)。includeDependencies 仅单应用有效:先读 apppackage/dependencies,把引用全选后传 references;环境包平台固定空引用,故环境范围传 true 直接拒。ZIP 同步返回(实测 1–3s;超时回 uncertain,勿当成功)。产物落盘:默认会话 artifacts,out 指定配置根内路径(0600)。回执只给 outPath/bytes/sha256/条目清单/资产计数,永不内联包内容。平台没有按资产类型筛选的参数,不收 assetTypes。",
|
|
91
|
+
}),
|
|
73
92
|
}),
|
|
74
93
|
});
|
|
75
94
|
export function assertAppContract() {
|
|
@@ -82,6 +101,7 @@ export function assertAppContract() {
|
|
|
82
101
|
throw new Error("app contract must pin the zero-wire prerequisite refusal");
|
|
83
102
|
assertDescriptionCarries(APP_LANE_CONTRACT, "app.update", ["apppackage/update", "groupId", "enabled", "原样保留", "AppPackageController.update"]);
|
|
84
103
|
assertDescriptionCarries(APP_LANE_CONTRACT, "app.delete", ["apppackage/delete", "APP_PACKAGE_HAS_NODE", "app-not-empty", "缺席"]);
|
|
104
|
+
assertDescriptionCarries(APP_LANE_CONTRACT, "app.export", ["lifeCycle/apppackage/lifeCycleExport", "apppackage/export", "references", "sha256", "assetTypes"]);
|
|
85
105
|
if (!APP_WIRE.createBody.includes("apppackage/create"))
|
|
86
106
|
throw new Error("app contract must pin the create endpoint");
|
|
87
107
|
if (!APP_WIRE.defaultGroupResolution.includes("auto-first-group"))
|
|
@@ -98,5 +118,17 @@ export function assertAppContract() {
|
|
|
98
118
|
throw new Error("app contract must pin the delete absence poll");
|
|
99
119
|
if (!APP_WIRE.defaultFolderSeed.includes("defaultGroup"))
|
|
100
120
|
throw new Error("app contract must pin the default-folder seed token");
|
|
121
|
+
if (!APP_WIRE.exportBody.includes("AppExportParamVO"))
|
|
122
|
+
throw new Error("app contract must pin the export VO and body shape");
|
|
123
|
+
if (!APP_WIRE.exportBody.includes("600005"))
|
|
124
|
+
throw new Error("app contract must pin the export refusal errcode");
|
|
125
|
+
if (!APP_WIRE.exportReferences.includes("relativeDictionary"))
|
|
126
|
+
throw new Error("app contract must pin the references keys");
|
|
127
|
+
if (!APP_WIRE.exportBinaryStream.includes("PK local-header magic"))
|
|
128
|
+
throw new Error("app contract must pin the ZIP validation");
|
|
129
|
+
if (!APP_WIRE.environmentExport.includes("EVERY app"))
|
|
130
|
+
throw new Error("app contract must pin the environment export scope");
|
|
131
|
+
if (!APP_WIRE.environmentExport.includes("40007"))
|
|
132
|
+
throw new Error("app contract must pin the lifecycle GET refusal");
|
|
101
133
|
}
|
|
102
134
|
//# sourceMappingURL=app-contract.js.map
|
|
@@ -12,5 +12,10 @@ export const APP_COVERAGE = declareLaneCoverage(APP_LANE_CONTRACT.lane, [
|
|
|
12
12
|
claim("app.delete", T["app.delete"].scope),
|
|
13
13
|
],
|
|
14
14
|
},
|
|
15
|
+
{
|
|
16
|
+
capability: "r64b application package export",
|
|
17
|
+
evidence: ["packages/omc-cli/test/r64b-app-export.test.ts", "packages/omc-cli/src/lanes/app.ts"],
|
|
18
|
+
tools: [claim("app.export", T["app.export"].scope)],
|
|
19
|
+
},
|
|
15
20
|
]);
|
|
16
21
|
//# sourceMappingURL=app-coverage.js.map
|