openyida 2026.11.16 → 2026.11.17
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/README.md +9 -2
- package/bin/yida.js +17 -2
- package/lib/app/check-prd-completeness.js +99 -14
- package/lib/app/create-page.js +62 -13
- package/lib/app/fast-build.js +2 -2
- package/lib/app/portal-schema.js +431 -0
- package/lib/app/portal.js +165 -0
- package/lib/app/update-app.js +212 -41
- package/lib/connector/action-generator.js +8 -14
- package/lib/connector/api.js +3 -1
- package/lib/connector/connector-action-update.js +12 -3
- package/lib/connector/connector-add-action.js +2 -0
- package/lib/connector/connector-create-connection.js +152 -2
- package/lib/connector/connector-create.js +1 -0
- package/lib/connector/connector-delete-action.js +1 -1
- package/lib/connector/connector-delete.js +2 -1
- package/lib/connector/contract.js +26 -6
- package/lib/connector/doc-parser.js +3 -53
- package/lib/connector/operation-normalizer.js +16 -6
- package/lib/connector/response-parser.js +35 -0
- package/lib/core/agent-capabilities.js +4 -0
- package/lib/core/command-manifest.js +70 -5
- package/lib/core/form-edit-permissions.js +3 -1
- package/lib/core/locales/en.js +43 -6
- package/lib/core/locales/zh.js +43 -6
- package/lib/core/query-data.js +140 -9
- package/lib/core/redact.js +31 -2
- package/lib/design-plan/entry-navigation.js +14 -5
- package/lib/design-plan/init.js +1 -1
- package/lib/design-plan/materialize.js +8 -5
- package/lib/design-plan/render-html.js +1 -1
- package/lib/integration/connector-presets.js +36 -12
- package/lib/integration/integration-create.js +1 -0
- package/lib/integration/integration-process-builder.js +132 -4
- package/lib/integration/integration-readback.js +22 -0
- package/lib/integration/integration-spec-builder.js +2 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +3 -1
- package/yida-skills/SKILL.md +3 -2
- package/yida-skills/skills/yida-app/SKILL.md +1 -0
- package/yida-skills/skills/yida-app/references/entry-navigation.md +1 -1
- package/yida-skills/skills/yida-app/workflow/fast-build.md +6 -2
- package/yida-skills/skills/yida-app/workflow/plan/workflow.md +1 -1
- package/yida-skills/skills/yida-app/workflow/step-6-main-page.md +2 -0
- package/yida-skills/skills/yida-app/workflow/step-7-page-code.md +2 -0
- package/yida-skills/skills/yida-app/workflow/step-8-publish-navigation.md +8 -12
- package/yida-skills/skills/yida-app/workflow/step-9-output-finish.md +10 -4
- package/yida-skills/skills/yida-canvas-custom-page/references/navigation-and-entry-guide.md +3 -0
- package/yida-skills/skills/yida-connector/SKILL.md +15 -5
- package/yida-skills/skills/yida-connector/references/connector-action-format.md +11 -3
- package/yida-skills/skills/yida-create-app/SKILL.md +8 -0
- package/yida-skills/skills/yida-create-page/SKILL.md +8 -7
- package/yida-skills/skills/yida-create-portal/SKILL.md +20 -0
- package/yida-skills/skills/yida-create-portal/references/native-portal.md +67 -0
- package/yida-skills/skills/yida-dashboard/references/structure-and-layout.md +6 -0
- package/yida-skills/skills/yida-data-management/SKILL.md +7 -3
- package/yida-skills/skills/yida-flow-node-config/references/extensions.md +23 -0
- package/yida-skills/skills/yida-integration/SKILL.md +13 -2
- package/yida-skills/skills/yida-integration/references/operations.md +4 -1
- package/yida-skills/skills/yida-integration/references/spec-authoring.md +2 -0
- package/yida-skills/skills/yida-nav-shell/SKILL.md +2 -0
- package/yida-skills/skills/yida-requirement-analysis/references/experience-groups.md +2 -2
- package/yida-skills/skills/yida-requirement-analysis/references/handoff.md +1 -1
- package/yida-skills/skills/yida-requirement-analysis/workflow/prepare-brief.md +3 -2
- package/yida-skills/skills-index.json +31 -2
package/README.md
CHANGED
|
@@ -269,6 +269,8 @@ For the current custom page native-component support matrix, see [Yida native co
|
|
|
269
269
|
|
|
270
270
|
### Workflow, Data, and Permissions
|
|
271
271
|
|
|
272
|
+
Historical ordinary-form updates do not request an upgrade by default. Explicitly pass `--use-latest-version y` to request an upgrade; submitted fields and the instance version are then always verified. An ineffective upgrade fails without replaying the write. See [historical record updates](docs/guides/form-version-update.md).
|
|
273
|
+
|
|
272
274
|
```bash
|
|
273
275
|
openyida create-process APP_XXX "Purchase Request" .cache/openyida/process/fields.json .cache/openyida/process/process.json
|
|
274
276
|
openyida configure-process APP_XXX FORM_XXX .cache/openyida/process/process.json
|
|
@@ -547,10 +549,14 @@ When preparing a PR that needs a personal Fork, or when you ask how to support t
|
|
|
547
549
|
| `openyida custom-button <list\|inspect\|options\|create\|update\|delete> <appType> <formUuid> [buttonUuid] [--config <file>] [--expected-hash <hash>] [--backup <file>] [--yes] [--json]` | Native custom buttons: inspect and configure form edits, automation flows and page links |
|
|
548
550
|
| `openyida form-message <list\|inspect\|options\|create\|update\|delete> <appType> <formUuid> [messageId] [--config <file>] [--expected-hash <hash>] [--backup <file>] [--yes] [--json]` | Native form notifications: inspect triggers, recipients and templates, then safely maintain bindings |
|
|
549
551
|
| `openyida get-schema <appType> <formUuid\|--all> [--summary-json\|--field-map-json\|--analysis-json]` | Get one form Schema or all form Schemas |
|
|
550
|
-
| `openyida check-prd-completeness (<prd.md> [--build-manifest <file>] \| --build-spec <build-context.json> [--build-manifest <file>] \| --manifest-only --build-manifest <file>) --app-type <appType> [--json]` | Check resources,
|
|
552
|
+
| `openyida check-prd-completeness (<prd.md> [--build-manifest <file>] \| --build-spec <build-context.json> [--build-manifest <file>] \| --manifest-only --build-manifest <file>) --app-type <appType> [--json]` | Check resources, navigation visibility and application theme |
|
|
551
553
|
| `openyida check-design <design.md> [--prd <prd.md>] [--base-dir <dir>] [--json]` | Validate design documents, theme tokens and PRD handoff |
|
|
552
554
|
| `openyida er <appType> [--format mermaid\|json] [--output file] [--include-system] [--include-pages]` | Export app entity relationship diagram |
|
|
553
|
-
| `openyida create-page <appType> "<name>" [--mode dashboard] [--hide-nav] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a custom
|
|
555
|
+
| `openyida create-page <appType> "<name>" [--mode dashboard] [--hide-nav] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a custom page |
|
|
556
|
+
| `openyida create-portal <appType> "<name>" [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a native YiDA portal |
|
|
557
|
+
| `openyida portal catalog [componentName] [--json]` | List configurable native portal components and theme options |
|
|
558
|
+
| `openyida portal inspect <appType> <formUuid> [--editable] [--json]` | Inspect native portal tiles and revision |
|
|
559
|
+
| `openyida portal configure <appType> <formUuid> <file> [--expected-revision <revision>] [--dry-run] [--json]` | Configure native portal tiles and layout |
|
|
554
560
|
| `openyida build-page <sourceFile> [--output file\|--write]` | Build Yida-compatible page source |
|
|
555
561
|
| `openyida check-page <src> [--compat] [--json]` | Check custom page standards |
|
|
556
562
|
| `openyida compile <src> [--canvas] [--compat] [--skip-lint] [--strict-theme\|--allow-fixed-brand] [--json]` | Compile custom page locally |
|
|
@@ -616,6 +622,7 @@ When preparing a PR that needs a personal Fork, or when you ask how to support t
|
|
|
616
622
|
| `openyida connector delete-action <id> <operation-id>` | Delete an action |
|
|
617
623
|
| `openyida connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>] [--system-token-app <appType>] [--ignore-defaults]` | Test an action |
|
|
618
624
|
| `openyida connector list-connections <id>` | List auth connections |
|
|
625
|
+
| `openyida connector connection <detail\|update> <connector-id> <connection-id> [--name <name>] [--confirm --interactive] [--json]` | Read account metadata or replace complete credentials using hidden terminal input. |
|
|
619
626
|
| `openyida connector create-connection <id> <name> [--interactive] [--repair-api-key-scheme]` | Create an auth connection |
|
|
620
627
|
| `openyida connector smart-create --curl "..."` | Generate a redacted action draft from cURL (no remote create) |
|
|
621
628
|
| `openyida connector parse-api [options]` | Parse API information |
|
package/bin/yida.js
CHANGED
|
@@ -854,6 +854,18 @@ async function dispatchCommand() {
|
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
+
case 'create-portal': {
|
|
858
|
+
const { runPortal } = require('../lib/app/create-page');
|
|
859
|
+
await runPortal(args);
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
case 'portal': {
|
|
864
|
+
const { run } = require('../lib/app/portal');
|
|
865
|
+
await run(args);
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
|
|
857
869
|
case 'create-form': {
|
|
858
870
|
const { run } = require('../lib/app/create-form');
|
|
859
871
|
await run(args);
|
|
@@ -1238,6 +1250,7 @@ async function dispatchCommand() {
|
|
|
1238
1250
|
'test': '../lib/connector/connector-test',
|
|
1239
1251
|
'list-connections': '../lib/connector/connector-list-connections',
|
|
1240
1252
|
'create-connection': '../lib/connector/connector-create-connection',
|
|
1253
|
+
'connection': '../lib/connector/connector-create-connection',
|
|
1241
1254
|
'smart-create': '../lib/connector/connector-smart-create',
|
|
1242
1255
|
'parse-api': '../lib/connector/connector-parse-api',
|
|
1243
1256
|
'gen-template': '../lib/connector/connector-gen-template',
|
|
@@ -1251,13 +1264,14 @@ async function dispatchCommand() {
|
|
|
1251
1264
|
list 列出 HTTP 连接器
|
|
1252
1265
|
create "名称" "域名" --operations <file> 创建连接器
|
|
1253
1266
|
detail <connector-id> 查看连接器详情
|
|
1254
|
-
delete <connector-id> [--force]
|
|
1267
|
+
delete <connector-id> [--force] ${t('help.cmd_connector_delete')}
|
|
1255
1268
|
add-action --operations <file> --connector-id <id> 添加执行动作
|
|
1256
1269
|
update-action --connector-id <id> --action <id> --query-json <JSON> --confirm 安全更新动作 Query 默认值
|
|
1257
1270
|
list-actions <connector-id> 列出执行动作
|
|
1258
1271
|
delete-action <connector-id> <operation-id> 删除执行动作
|
|
1259
1272
|
test --connector-id <id> --action <actionId> [结构化 JSON 参数] 测试执行动作
|
|
1260
1273
|
list-connections <connector-id> 列出鉴权账号
|
|
1274
|
+
connection <detail|update> <connector-id> <account-id> [--confirm --interactive] 鉴权账号维护
|
|
1261
1275
|
create-connection <connector-id> <name> [--interactive] 创建鉴权账号;钉钉凭据可在本机隐藏输入
|
|
1262
1276
|
smart-create --curl "curl命令" 生成脱敏连接器动作草稿(不创建远端资源)
|
|
1263
1277
|
parse-api [选项] 解析接口信息
|
|
@@ -1273,7 +1287,8 @@ async function dispatchCommand() {
|
|
|
1273
1287
|
throwCliUsage(`未知的 connector 子命令: ${subCommand}`, '使用 openyida connector --help 查看可用子命令');
|
|
1274
1288
|
}
|
|
1275
1289
|
|
|
1276
|
-
const
|
|
1290
|
+
const connectorCommand = require(modulePath);
|
|
1291
|
+
const runConnector = subCommand === 'connection' ? connectorCommand.runConnection : connectorCommand.run;
|
|
1277
1292
|
await runConnector(subArgs);
|
|
1278
1293
|
break;
|
|
1279
1294
|
}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const { createAuthRef, isAuthRefReady } = require('../core/yida-client');
|
|
5
|
+
const { createAuthRef, isAuthRefReady, unwrapYidaResponse } = require('../core/yida-client');
|
|
6
6
|
const { t } = require('../core/i18n');
|
|
7
7
|
const { throwCommandError, throwUsage } = require('../core/command-errors');
|
|
8
8
|
const { auditAssetExecution } = require('../asset/asset-execution');
|
|
9
9
|
const { fetchFormPageList } = require('./form-navigation');
|
|
10
|
+
const { fetchFormSchemaInfo } = require('./get-form-config');
|
|
11
|
+
const { buildDisplayPageEntryUrls } = require('./application-entry-urls');
|
|
10
12
|
|
|
11
|
-
const CHECKABLE_RESOURCE_KINDS = new Set(['display-page', 'normal-form', 'process-form']);
|
|
13
|
+
const CHECKABLE_RESOURCE_KINDS = new Set(['display-page', 'normal-form', 'process-form', 'native-portal']);
|
|
12
14
|
const APP_TYPE_OPTIONS = Object.freeze(['--app-type', '--appType', '--app_type']);
|
|
13
15
|
|
|
14
16
|
function parseArgs(args = [], options = {}) {
|
|
@@ -207,6 +209,9 @@ function classifyResourceType(typeValue) {
|
|
|
207
209
|
if (!value) {
|
|
208
210
|
return 'unknown';
|
|
209
211
|
}
|
|
212
|
+
if (value === 'portal' || /原生门户|nativeportal/.test(value)) {
|
|
213
|
+
return 'native-portal';
|
|
214
|
+
}
|
|
210
215
|
if (/process|流程|审批/.test(value)) {
|
|
211
216
|
return 'process-form';
|
|
212
217
|
}
|
|
@@ -221,6 +226,9 @@ function classifyResourceType(typeValue) {
|
|
|
221
226
|
|
|
222
227
|
function classifyActualFormType(formType) {
|
|
223
228
|
const value = normalizeComparable(formType);
|
|
229
|
+
if (value === 'portal') {
|
|
230
|
+
return 'native-portal';
|
|
231
|
+
}
|
|
224
232
|
if (/display|custom|自定义|展示/.test(value)) {
|
|
225
233
|
return 'display-page';
|
|
226
234
|
}
|
|
@@ -273,17 +281,23 @@ function extractResources(markdown) {
|
|
|
273
281
|
|
|
274
282
|
function parsePrdMarkdown(markdown) {
|
|
275
283
|
const navigationVisibility = [];
|
|
284
|
+
const pageNavigation = [];
|
|
276
285
|
let applicationTheme;
|
|
286
|
+
let hideAppNav;
|
|
277
287
|
for (const match of String(markdown || '').matchAll(/```json\s*\n([\s\S]*?)\n```/g)) {
|
|
278
288
|
try {
|
|
279
289
|
const handoff = JSON.parse(match[1]);
|
|
280
290
|
if (Array.isArray(handoff.navigationVisibility)) {navigationVisibility.push(...handoff.navigationVisibility);}
|
|
291
|
+
if (Array.isArray(handoff.pageNavigation)) {pageNavigation.push(...handoff.pageNavigation);}
|
|
292
|
+
if (['y', 'n'].includes(handoff.appConfig?.hideAppNav)) {hideAppNav = handoff.appConfig.hideAppNav;}
|
|
281
293
|
if (Object.prototype.hasOwnProperty.call(handoff, 'applicationTheme')) {applicationTheme = handoff.applicationTheme;}
|
|
282
294
|
} catch { /* Other fenced examples are not the structured execution handoff. */ }
|
|
283
295
|
}
|
|
284
296
|
return {
|
|
285
297
|
resources: extractResources(markdown),
|
|
286
298
|
navigationVisibility,
|
|
299
|
+
pageNavigation,
|
|
300
|
+
...(hideAppNav !== undefined ? { hideAppNav } : {}),
|
|
287
301
|
...(applicationTheme !== undefined ? { applicationTheme } : {}),
|
|
288
302
|
};
|
|
289
303
|
}
|
|
@@ -467,14 +481,22 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
467
481
|
resources: [...fast.resources, ...fast.pages.map(page => ({ ...page, type: 'display-page' }))]
|
|
468
482
|
.map(resource => ({ name: resource.name, type: resource.type, kind: resource.type, source: 'fast.resources' }))
|
|
469
483
|
.filter(resource => CHECKABLE_RESOURCE_KINDS.has(resource.kind)),
|
|
470
|
-
navigationVisibility: fast.navigationVisibility || [],
|
|
484
|
+
navigationVisibility: fast.navigationVisibility?.length ? fast.navigationVisibility : options.buildManifest?.navigationVisibility || [],
|
|
471
485
|
...(fast.applicationTheme ? { applicationTheme: fast.applicationTheme } : {}),
|
|
472
486
|
} : options.manifestOnly ? { resources: [], navigationVisibility: options.buildManifest?.navigationVisibility || [],
|
|
473
487
|
...(options.buildManifest?.applicationTheme ? { applicationTheme: options.buildManifest.applicationTheme } : {}) } : parsePrdMarkdown(markdown);
|
|
474
488
|
const parsedManifest = parseBuildManifest(options.buildManifest);
|
|
489
|
+
const expectedAppNavigation = parsedPrd.hideAppNav ?? (fast || options.manifestOnly
|
|
490
|
+
? options.buildManifest?.appConfig?.hideAppNav : undefined);
|
|
491
|
+
const pageNavigation = [
|
|
492
|
+
...(parsedPrd.pageNavigation || []),
|
|
493
|
+
...asArray(options.buildManifest?.pageNavigation),
|
|
494
|
+
].filter(page => page?.type === 'display-page' && page.isRenderNav === false);
|
|
495
|
+
const pageNavigationVerification = [];
|
|
475
496
|
const items = [];
|
|
476
497
|
const assetExecution = auditAssetExecution(options.buildManifest?.assetExecution, options.buildManifest?.assetTasks);
|
|
477
498
|
let themeVerification;
|
|
499
|
+
let applicationNavigationVerification;
|
|
478
500
|
|
|
479
501
|
function addItem(id, source, status, severity, message, details = {}) {
|
|
480
502
|
items.push(makeRiskItem(id, source, status, severity, message, details));
|
|
@@ -489,7 +511,9 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
489
511
|
verdict,
|
|
490
512
|
mode: 'delivery_risk_radar',
|
|
491
513
|
assetExecution,
|
|
514
|
+
...(pageNavigationVerification.length ? { pageNavigationVerification } : {}),
|
|
492
515
|
...(themeVerification ? { themeVerification } : {}),
|
|
516
|
+
...(applicationNavigationVerification ? { applicationNavigationVerification } : {}),
|
|
493
517
|
appType,
|
|
494
518
|
prdPath: options.prdPath || '',
|
|
495
519
|
buildManifestPath: options.buildManifestPath || '',
|
|
@@ -548,6 +572,29 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
548
572
|
const actualResources = forms.map(makeActualResource);
|
|
549
573
|
const manifestResources = parsedManifest.resources.filter(resource => resource.required);
|
|
550
574
|
|
|
575
|
+
const checkAppNavigation = ['y', 'n'].includes(expectedAppNavigation);
|
|
576
|
+
let appSettings;
|
|
577
|
+
if (checkAppNavigation || parsedPrd.applicationTheme !== undefined) {
|
|
578
|
+
const { fetchCurrentApp } = require('./update-app');
|
|
579
|
+
try {
|
|
580
|
+
const app = await (deps.fetchApp || fetchCurrentApp)(appType, authRef);
|
|
581
|
+
if (app && typeof app === 'object' && !Array.isArray(app) && Object.keys(app).length) {appSettings = app;}
|
|
582
|
+
} catch { /* The individual checks report missing readback. */ }
|
|
583
|
+
}
|
|
584
|
+
if (checkAppNavigation) {
|
|
585
|
+
const { getNavigationSettings } = require('./update-app');
|
|
586
|
+
const stored = appSettings ? getNavigationSettings(appSettings, ['hideAppNav']).hideAppNav : null;
|
|
587
|
+
// The workbench uses the visible default when the application has no override.
|
|
588
|
+
const actual = appSettings && stored === null ? 'n' : stored;
|
|
589
|
+
const verified = actual === expectedAppNavigation;
|
|
590
|
+
applicationNavigationVerification = { expected: expectedAppNavigation, actual, verified };
|
|
591
|
+
if (!verified) {
|
|
592
|
+
addItem('application_navigation_unverified', 'remote.application_navigation', 'fail', 'blocker',
|
|
593
|
+
'应用设置里的平台导航显隐未通过校验。请按已确认的应用导航方案检查设置并重新回读。',
|
|
594
|
+
{ expected: { hideAppNav: expectedAppNavigation }, actual: { hideAppNav: actual } });
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
551
598
|
if (parsedPrd.applicationTheme !== undefined) {
|
|
552
599
|
const expected = parsedPrd.applicationTheme;
|
|
553
600
|
const { normalizeCssColorToHex } = require('./custom-theme');
|
|
@@ -555,11 +602,10 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
555
602
|
themeVerification = { configurationReadback: false, verified: false, runtimeVerified: false };
|
|
556
603
|
try {
|
|
557
604
|
if (!expectedColor || !['light', 'dark'].includes(expected?.navTheme)) {throw new Error('INVALID_THEME_EXPECTATION');}
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
const rawNav = getNavigationSettings(app, ['navTheme']).navTheme;
|
|
605
|
+
if (!appSettings) {throw new Error('APP_SETTINGS_UNAVAILABLE');}
|
|
606
|
+
const { getThemeSettings, getNavigationSettings } = require('./update-app');
|
|
607
|
+
const settings = getThemeSettings(appSettings);
|
|
608
|
+
const rawNav = getNavigationSettings(appSettings, ['navTheme']).navTheme;
|
|
563
609
|
const actual = {
|
|
564
610
|
colour: settings.colour,
|
|
565
611
|
themeColor: normalizeCssColorToHex(settings.themeColor),
|
|
@@ -580,12 +626,12 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
580
626
|
}
|
|
581
627
|
}
|
|
582
628
|
|
|
583
|
-
//
|
|
584
|
-
// independent; a successful publication cannot prove the latter.
|
|
629
|
+
// Workbench menu visibility is independent of the standalone page setting.
|
|
585
630
|
for (const expected of parsedPrd.navigationVisibility) {
|
|
586
631
|
const matches = parsedManifest.resources.filter(resource => resource.name === expected?.name && resource.kind === 'display-page');
|
|
587
|
-
const ids = [...new Set(matches.map(resource => resource.formUuid).filter(Boolean))];
|
|
588
|
-
const actual = ids.length === 1 ?
|
|
632
|
+
const ids = expected?.formUuid ? [expected.formUuid] : [...new Set(matches.map(resource => resource.formUuid).filter(Boolean))];
|
|
633
|
+
const actual = ids.length === 1 ? actualResources.find(resource => resource.formUuid === ids[0]
|
|
634
|
+
&& resource.kind === 'display-page')?.raw : undefined;
|
|
589
635
|
const known = value => typeof value === 'boolean';
|
|
590
636
|
const valid = expected?.hidden === true && expected?.mobileHidden === true;
|
|
591
637
|
if (valid && actual && (actual.hidden === false || actual.mobileHidden === false)) {
|
|
@@ -597,14 +643,53 @@ async function evaluatePrdCompleteness(markdown, options = {}, deps = {}) {
|
|
|
597
643
|
}
|
|
598
644
|
}
|
|
599
645
|
|
|
646
|
+
const checkedStandalonePages = new Set();
|
|
647
|
+
for (const page of pageNavigation) {
|
|
648
|
+
const recorded = parsedManifest.resources
|
|
649
|
+
.filter(resource => resource.kind === 'display-page' && resource.name === page.name)
|
|
650
|
+
.map(resource => resource.formUuid).filter(Boolean);
|
|
651
|
+
const ids = page.formUuid ? [page.formUuid] : [...new Set(recorded.length ? recorded : actualResources
|
|
652
|
+
.filter(resource => resource.kind === 'display-page' && resource.name === page.name)
|
|
653
|
+
.map(resource => resource.formUuid).filter(Boolean))];
|
|
654
|
+
const resource = ids.length === 1 && actualResources.find(item => item.formUuid === ids[0] && item.kind === 'display-page');
|
|
655
|
+
const key = resource?.formUuid || page.formUuid || page.name;
|
|
656
|
+
if (checkedStandalonePages.has(key)) {continue;}
|
|
657
|
+
checkedStandalonePages.add(key);
|
|
658
|
+
const actual = { name: page.name, formUuid: resource?.formUuid || null, renderNav: null, standaloneUrl: null };
|
|
659
|
+
if (resource) {
|
|
660
|
+
const menuIds = parsedPrd.navigationVisibility
|
|
661
|
+
.filter(item => item?.name === page.name && item.hidden === true && item.mobileHidden === true)
|
|
662
|
+
.flatMap(item => item.formUuid ? [item.formUuid] : recorded);
|
|
663
|
+
if (menuIds.some(id => id !== resource.formUuid)) {
|
|
664
|
+
addItem('frontend_navigation_page_mismatch', 'remote.navigation', 'fail', 'blocker',
|
|
665
|
+
`「${page.name}」的独立入口和后台菜单隐藏指向不同页面。请按同一页面 ID 核对发布与菜单显隐。`,
|
|
666
|
+
{ expected: { formUuid: resource.formUuid }, actual: { formUuids: menuIds } });
|
|
667
|
+
}
|
|
668
|
+
try {
|
|
669
|
+
const response = await (deps.fetchPageConfig || fetchFormSchemaInfo)(authRef, appType, resource.formUuid);
|
|
670
|
+
const payload = unwrapYidaResponse(response, { action: 'Read standalone page configuration' });
|
|
671
|
+
const config = payload === response ? response.result ?? response.data ?? payload : payload;
|
|
672
|
+
const entry = buildDisplayPageEntryUrls({ appType, formUuid: resource.formUuid, baseUrl: authRef.baseUrl, config, formType: 'display' });
|
|
673
|
+
actual.renderNav = entry.navigationVerification?.renderNav ?? null;
|
|
674
|
+
actual.standaloneUrl = entry.standaloneUrl || null;
|
|
675
|
+
} catch { /* Report missing readback as an unverified standalone entry. */ }
|
|
676
|
+
}
|
|
677
|
+
pageNavigationVerification.push({ ...actual, verified: !!actual.standaloneUrl });
|
|
678
|
+
if (!actual.standaloneUrl) {
|
|
679
|
+
addItem('standalone_page_navigation_unverified', 'remote.page_navigation', 'fail', 'blocker',
|
|
680
|
+
`独立入口「${page.name || key}」未确认隐藏本页平台导航。请核对页面 ID,更新并回读 renderNav=false,再使用 standaloneUrl。`,
|
|
681
|
+
{ expected: { renderNav: false, route: 'custom' }, actual });
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
600
685
|
if (!options.buildManifest) {
|
|
601
686
|
addItem('build_manifest_missing', 'build_manifest', 'not_checked', 'info', '未提供 build-manifest.json,只能基于 PRD 资源 hints 做风险提示', {
|
|
602
687
|
expected: '--build-manifest <file>',
|
|
603
688
|
actual: null,
|
|
604
689
|
});
|
|
605
690
|
} else if (parsedManifest.resources.length === 0) {
|
|
606
|
-
addItem('build_manifest_empty', 'build_manifest', 'not_checked', 'warning', 'build-manifest.json
|
|
607
|
-
expected: [
|
|
691
|
+
addItem('build_manifest_empty', 'build_manifest', 'not_checked', 'warning', 'build-manifest.json 未记录可核验的页面或表单资源,无法确认数量完整性', {
|
|
692
|
+
expected: [...CHECKABLE_RESOURCE_KINDS],
|
|
608
693
|
actual: [],
|
|
609
694
|
});
|
|
610
695
|
}
|
package/lib/app/create-page.js
CHANGED
|
@@ -44,8 +44,11 @@ function parseArgs(args) {
|
|
|
44
44
|
|
|
45
45
|
for (let i = 0; i < openOption.args.length; i++) {
|
|
46
46
|
const arg = openOption.args[i];
|
|
47
|
-
if (arg === '--mode'
|
|
48
|
-
mode = openOption.args[++i];
|
|
47
|
+
if (arg === '--mode' || arg.startsWith('--mode=')) {
|
|
48
|
+
mode = arg === '--mode' ? openOption.args[++i] : arg.slice('--mode='.length);
|
|
49
|
+
if (!mode || mode.startsWith('--')) {
|
|
50
|
+
throw new Error('--mode requires a value.');
|
|
51
|
+
}
|
|
49
52
|
continue;
|
|
50
53
|
}
|
|
51
54
|
if ((arg === '--locale' || arg === '--content-locale' || arg === '--lang') && openOption.args[i + 1]) {
|
|
@@ -179,34 +182,51 @@ async function configureNavigationVisibility(authRef, appType, pageId, pageName,
|
|
|
179
182
|
return verification;
|
|
180
183
|
}
|
|
181
184
|
|
|
182
|
-
|
|
185
|
+
const PORTAL_USAGE = 'openyida create-portal <appType> "<pageName>" [--locale zh_CN|en_US|ja_JP] [--open|--no-open]';
|
|
186
|
+
|
|
187
|
+
async function createPage(args, formType) {
|
|
188
|
+
const nativePortal = formType === 'portal';
|
|
183
189
|
let options;
|
|
184
190
|
try {
|
|
185
191
|
options = parseArgs(args || []);
|
|
186
192
|
} catch (err) {
|
|
187
193
|
const { error: chalkError } = require('../core/chalk');
|
|
188
|
-
chalkError(err.message, { hint: t('create_page.usage') });
|
|
194
|
+
chalkError(err.message, { hint: nativePortal ? PORTAL_USAGE : t('create_page.usage') });
|
|
189
195
|
}
|
|
190
196
|
|
|
191
197
|
if (options.help) {
|
|
192
198
|
const { usage, hint } = require('../core/chalk');
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
if (nativePortal) {
|
|
200
|
+
usage(PORTAL_USAGE, 'openyida create-portal APP_XXX "运营门户"');
|
|
201
|
+
} else {
|
|
202
|
+
usage(t('create_page.usage'), t('create_page.example'));
|
|
203
|
+
hint(t('create_page.mode_hint'));
|
|
204
|
+
}
|
|
195
205
|
return options;
|
|
196
206
|
}
|
|
197
207
|
|
|
198
208
|
if (options.args.length < 2) {
|
|
199
209
|
const { error: chalkError } = require('../core/chalk');
|
|
200
|
-
chalkError(t('create_page.usage'), { hint: t('create_page.example') });
|
|
210
|
+
chalkError(nativePortal ? PORTAL_USAGE : t('create_page.usage'), { hint: nativePortal ? undefined : t('create_page.example') });
|
|
201
211
|
}
|
|
202
212
|
|
|
203
213
|
const appType = options.appType;
|
|
204
214
|
const pageName = options.pageName;
|
|
205
|
-
|
|
206
|
-
|
|
215
|
+
if (!nativePortal && options.mode === 'portal') {
|
|
216
|
+
throwCommandError(PORTAL_USAGE + ' (only for an explicitly requested native portal)', {
|
|
217
|
+
code: 'CREATE_PAGE_USE_PORTAL_COMMAND',
|
|
218
|
+
details: { recovery: { command: 'create-portal', args: [appType, pageName] } },
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (nativePortal && ((args || []).some(arg => /^--(?:mode|hide-nav(?:igation)?|no-nav|render-nav|is-render-nav|isRenderNav)(?:=|$)/.test(arg)) ||
|
|
222
|
+
options.args.length !== 2)) {
|
|
223
|
+
throwCommandError(PORTAL_USAGE, { code: 'CREATE_PORTAL_USAGE' });
|
|
224
|
+
}
|
|
225
|
+
if (!nativePortal && !['default', 'dashboard'].includes(options.mode)) {
|
|
207
226
|
const { error: chalkError } = require('../core/chalk');
|
|
208
|
-
chalkError(t('create_page.err_mode_invalid', mode), { hint: t('create_page.mode_hint') });
|
|
227
|
+
chalkError(t('create_page.err_mode_invalid', options.mode), { hint: t('create_page.mode_hint') });
|
|
209
228
|
}
|
|
229
|
+
const mode = nativePortal ? 'portal' : options.mode;
|
|
210
230
|
|
|
211
231
|
const { c, banner, step, label, info, warn, success: chalkSuccess, result: chalkResult } = require('../core/chalk');
|
|
212
232
|
|
|
@@ -231,7 +251,7 @@ async function run(args) {
|
|
|
231
251
|
(auth) => {
|
|
232
252
|
const postData = querystring.stringify({
|
|
233
253
|
_csrf_token: auth.csrfToken,
|
|
234
|
-
formType
|
|
254
|
+
formType,
|
|
235
255
|
title: JSON.stringify(buildYidaI18n(pageName, { en_US: pageName, ja_JP: pageName })),
|
|
236
256
|
});
|
|
237
257
|
return httpPost(
|
|
@@ -252,6 +272,31 @@ async function run(args) {
|
|
|
252
272
|
if (response && response.success && response.content) {
|
|
253
273
|
const pageId = response.content.formUuid || response.content;
|
|
254
274
|
const workbenchUrl = `${authRef.baseUrl}/${appType}/workbench/${pageId}`;
|
|
275
|
+
let portalResult = {};
|
|
276
|
+
if (formType === 'portal') {
|
|
277
|
+
const designerUrl = `${authRef.baseUrl}/alibaba/web/${encodeURIComponent(appType)}/design/portalDesigner?formUuid=${encodeURIComponent(pageId)}`;
|
|
278
|
+
let actualType = null;
|
|
279
|
+
try {
|
|
280
|
+
const readback = await fetchFormSchemaInfo(authRef, appType, pageId);
|
|
281
|
+
if (readback && readback.success !== false && !readback.__needLogin && !readback.__csrfExpired) {
|
|
282
|
+
const config = readback.content || readback.result || readback.data;
|
|
283
|
+
actualType = config?.formType ?? null;
|
|
284
|
+
}
|
|
285
|
+
} catch {
|
|
286
|
+
// Creation already succeeded. Report the resource for read-only recovery.
|
|
287
|
+
}
|
|
288
|
+
if (actualType !== 'portal') {
|
|
289
|
+
throwCommandError(t('create_page.portal_unverified'), {
|
|
290
|
+
code: 'CREATE_PAGE_PORTAL_NOT_VERIFIED',
|
|
291
|
+
details: {
|
|
292
|
+
pageCreated: true, appType, pageId, actualType, designerUrl, workbenchUrl,
|
|
293
|
+
retrySafe: false, sideEffectState: 'applied',
|
|
294
|
+
recovery: { command: 'get-form-config', args: [appType, pageId, '--json'] },
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
portalResult = { formType, designerUrl, readbackVerified: true };
|
|
299
|
+
}
|
|
255
300
|
let pageUrl = workbenchUrl;
|
|
256
301
|
let dashboardConfigWarning = null;
|
|
257
302
|
let navigationVerification = null;
|
|
@@ -278,6 +323,7 @@ async function run(args) {
|
|
|
278
323
|
hideNav: options.hideNav ? (navigationVerification.renderNav === null ? null : !navigationVerification.renderNav) : false,
|
|
279
324
|
chromeless: options.hideNav && navigationVerification.verified,
|
|
280
325
|
navigationVerification, url: pageUrl, workbenchUrl, dashboardConfigWarning,
|
|
326
|
+
...portalResult,
|
|
281
327
|
};
|
|
282
328
|
if (!complete) {
|
|
283
329
|
result.errorCode = 'CREATE_PAGE_NAVIGATION_NOT_VERIFIED';
|
|
@@ -293,7 +339,7 @@ async function run(args) {
|
|
|
293
339
|
|
|
294
340
|
console.log(JSON.stringify(complete ? withBrowserHandoff(
|
|
295
341
|
result,
|
|
296
|
-
pageUrl,
|
|
342
|
+
portalResult.designerUrl || pageUrl,
|
|
297
343
|
{ stage: 'create_page_success', title: pageName },
|
|
298
344
|
options.openMode
|
|
299
345
|
) : result));
|
|
@@ -309,4 +355,7 @@ async function run(args) {
|
|
|
309
355
|
}
|
|
310
356
|
}
|
|
311
357
|
|
|
312
|
-
|
|
358
|
+
const run = args => createPage(args, 'display');
|
|
359
|
+
const runPortal = args => createPage(args, 'portal');
|
|
360
|
+
|
|
361
|
+
module.exports = { run, runPortal, parseArgs, buildPageInfoPostData };
|
package/lib/app/fast-build.js
CHANGED
|
@@ -43,8 +43,8 @@ function validateFastBuild(spec) {
|
|
|
43
43
|
if (!filled(resource.key) || keys.has(resource.key)) {add(`${field}.key`, 'unique nonempty key');}
|
|
44
44
|
if (!filled(resource.name) || names.has(resource.name)) {add(`${field}.name`, 'unique nonempty name');}
|
|
45
45
|
keys.add(resource.key); names.add(resource.name);
|
|
46
|
-
if (!['normal-form', 'process-form', 'report', 'integration'].includes(resource.type)) {
|
|
47
|
-
add(`${field}.type`, 'normal-form | process-form | report | integration; display pages belong in pages');
|
|
46
|
+
if (!['normal-form', 'process-form', 'report', 'integration', 'native-portal'].includes(resource.type)) {
|
|
47
|
+
add(`${field}.type`, 'normal-form | process-form | report | integration | native-portal; display pages belong in pages');
|
|
48
48
|
}
|
|
49
49
|
if (['normal-form', 'process-form'].includes(resource.type) && !resource.formUuid
|
|
50
50
|
&& (!Array.isArray(resource.fields) || !resource.fields.length || !resource.fields.every(object))) {
|