openyida 2026.9.4-beta.0 → 2026.9.7-beta.0
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 +15 -9
- package/bin/yida.js +7 -1
- package/lib/app/app-list.js +78 -53
- package/lib/app/canvas-compile.js +149 -0
- package/lib/app/create-app.js +11 -115
- package/lib/app/create-form/batch.js +204 -0
- package/lib/app/create-form.js +1 -0
- package/lib/app/inline-css-guard.js +79 -0
- package/lib/app/page-linter.js +24 -0
- package/lib/app/publish.js +3 -0
- package/lib/app/services/canvas-page-schema-builder.js +193 -5
- package/lib/app/theme-from-design.js +88 -0
- package/lib/app/theme-presets.js +7 -0
- package/lib/app/update-app.js +103 -43
- package/lib/bridge/bridge.js +15 -3
- package/lib/connector/api.js +3 -1
- package/lib/connector/connector-add-action.js +2 -0
- package/lib/connector/connector-create-connection.js +119 -16
- package/lib/connector/connector-create.js +40 -32
- package/lib/connector/connector-detail.js +2 -1
- package/lib/connector/connector-gen-template.js +5 -17
- package/lib/connector/connector-list-connections.js +5 -4
- package/lib/connector/connector-test.js +48 -2
- package/lib/connector/contract.js +132 -10
- package/lib/connector/operation-normalizer.js +20 -4
- package/lib/connector/yida-system-token.js +280 -0
- package/lib/core/agent-capabilities.js +38 -2
- package/lib/core/command-manifest.js +95 -18
- package/lib/core/locales/en.js +61 -8
- package/lib/core/locales/zh.js +61 -8
- package/lib/core/redact.js +4 -3
- package/lib/core/sample.js +80 -5
- package/lib/design-plan/design-plan.js +92 -0
- package/lib/design-plan/files.js +73 -0
- package/lib/design-plan/init.js +112 -0
- package/lib/design-plan/materialize.js +898 -0
- package/lib/design-plan/normalize.js +275 -0
- package/lib/design-plan/parallel.js +56 -0
- package/lib/design-plan/patch.js +174 -0
- package/lib/design-plan/preview.js +154 -0
- package/lib/design-plan/validate.js +133 -0
- package/lib/integration/connector-presets.js +95 -9
- package/lib/integration/integration-connector-schema.js +79 -15
- package/lib/integration/integration-create.js +131 -5
- package/lib/integration/integration-readback.js +136 -0
- package/lib/process/configure-process.js +69 -16
- package/lib/samples/openyida-scaffold/canvas-dialog.canvas.jsx +124 -0
- package/lib/samples/openyida-scaffold/canvas-form-drawer.canvas.jsx +265 -68
- package/lib/samples/openyida-scaffold/canvas-nav/data.jsx +60 -0
- package/lib/samples/openyida-scaffold/canvas-nav/dock.jsx +13 -0
- package/lib/samples/openyida-scaffold/canvas-nav/mixed.jsx +34 -0
- package/lib/samples/openyida-scaffold/canvas-nav/shared.jsx +43 -0
- package/lib/samples/openyida-scaffold/canvas-nav/side.jsx +19 -0
- package/lib/samples/openyida-scaffold/canvas-nav/sidebar.jsx +96 -0
- package/lib/samples/openyida-scaffold/canvas-nav/tabs.jsx +31 -0
- package/lib/samples/openyida-scaffold/canvas-nav/top.jsx +31 -0
- package/lib/samples/yida-canvas-table-form/table-form-batch-submit.canvas.jsx +2 -1
- package/lib/samples/yida-rechart/trend-combo.canvas.jsx +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +3 -1
- package/yida-skills/SKILL.md +38 -5
- package/yida-skills/references/field-and-url-reference.md +11 -1
- package/yida-skills/references/resource-context.md +1 -1
- package/yida-skills/skills/yida-app/SKILL.md +40 -5
- package/yida-skills/skills/yida-app/workflow/incremental-preview.md +42 -0
- package/yida-skills/skills/yida-app/workflow/parallel-work.md +69 -0
- package/yida-skills/skills/yida-app/workflow/plan/step-1-understand.md +5 -0
- package/yida-skills/skills/yida-app/workflow/plan/step-2-confirm.md +7 -0
- package/yida-skills/skills/yida-app/workflow/plan/step-4-deliver.md +69 -0
- package/yida-skills/skills/yida-app/workflow/plan/workflow.md +45 -0
- package/yida-skills/skills/yida-app/workflow/step-1-resource-context.md +3 -1
- package/yida-skills/skills/yida-app/workflow/step-2-design.md +21 -21
- package/yida-skills/skills/yida-app/workflow/step-3-create-or-reuse-app.md +24 -6
- package/yida-skills/skills/yida-app/workflow/step-4-forms-processes.md +8 -2
- 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 +15 -5
- package/yida-skills/skills/yida-app/workflow/step-8-publish-navigation.md +22 -10
- package/yida-skills/skills/yida-app/workflow/step-9-output-finish.md +24 -4
- package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +27 -22
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-authoring-examples.md +20 -19
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-style-implementation-guide.md +55 -38
- package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +41 -37
- package/yida-skills/skills/yida-canvas-custom-page/references/dialog-guide.md +35 -0
- package/yida-skills/skills/yida-canvas-custom-page/references/employeefield-verification.md +2 -2
- package/yida-skills/skills/yida-canvas-custom-page/references/native-components-bridge.md +1 -1
- package/yida-skills/skills/yida-canvas-custom-page/references/navigation-and-entry-guide.md +45 -93
- package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +6 -0
- package/yida-skills/skills/yida-canvas-data-binding/SKILL.md +3 -3
- package/yida-skills/skills/yida-canvas-data-binding/references/connector-binding.md +23 -0
- package/yida-skills/skills/yida-canvas-table-form/SKILL.md +2 -2
- package/yida-skills/skills/yida-connector/SKILL.md +15 -8
- package/yida-skills/skills/yida-connector/examples/operations-search-formdata-v2.json +2 -2
- package/yida-skills/skills/yida-connector/references/connector-action-format.md +9 -0
- package/yida-skills/skills/yida-connector/templates/api-document-template.md +6 -19
- package/yida-skills/skills/yida-create-app/SKILL.md +31 -21
- package/yida-skills/skills/yida-create-form-page/SKILL.md +4 -0
- package/yida-skills/skills/yida-create-form-page/references/batch-forms.md +55 -0
- package/yida-skills/skills/yida-create-page/SKILL.md +2 -0
- package/yida-skills/skills/yida-custom-page/references/coding-guide.md +2 -0
- package/yida-skills/skills/yida-data-management/SKILL.md +8 -4
- package/yida-skills/skills/yida-design/SKILL.md +28 -33
- package/yida-skills/skills/yida-design/references/ask-human-interaction-contract.md +187 -0
- package/yida-skills/skills/yida-design/references/design-mode.md +14 -0
- package/yida-skills/skills/yida-design/references/style-design-selection.md +2 -2
- package/yida-skills/skills/yida-design/references/theme/app-custom-theme-template.css +9 -1
- package/yida-skills/skills/yida-design/references/theme/theme-token-presets.md +43 -1
- package/yida-skills/skills/yida-design/references/visual-scaffold-recipes.md +1 -0
- package/yida-skills/skills/yida-design/sub_skill/page-design/SKILL.md +1 -1
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/SKILL.md +26 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/agents/openai.yaml +4 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/README.md +214 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/build-plan-template.html +1181 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/business-flows.png +0 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/data-models.png +0 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/form-normal.svg +4 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/form-process.svg +6 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/graph-fit.svg +3 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/graph-relations.svg +7 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/graph-zoom-in.svg +4 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/graph-zoom-out.svg +4 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/overview.png +0 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/pages.png +0 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/assets/icons/visual-style.png +0 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/references/build-plan-compact-schema.md +138 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/references/build-plan-schema.md +456 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/references/page-patterns.md +204 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/references/visual-design.md +137 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/references/visual-theme-selection.md +168 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/scripts/render_build_plan.py +1172 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/scripts/validate_design_themes.py +190 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/README.md +98 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/airy-media-grid.md +339 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/airy-modular-clarity.md +348 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/airy-structured-clarity.md +344 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/ambient-halo-layered.md +345 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/dark-focus-layered.md +355 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/dark-luminous-modular.md +377 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/deep-stage-duotone.md +352 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/hairline-runway-clarity.md +389 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/high-contrast-modular.md +364 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/index.json +329 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/interlocked-vivid-modules.md +348 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/matrix-grid-focus.md +345 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/media-rail-inspector.md +379 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/mist-layered-signal.md +347 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/modular-rail-signal.md +352 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/mono-grid-signal.md +386 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/ribbon-ledger-lift.md +384 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/segmented-meter-clarity.md +388 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/split-rail-precision.md +341 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/design-themes/status-framed-media-grid.md +361 -0
- package/yida-skills/skills/yida-design/sub_skill/yida-design-plan/templates/page-patterns/index.json +63 -0
- package/yida-skills/skills/yida-design/workflow/output-design.md +39 -3
- package/yida-skills/skills/yida-design/workflow/step-1-read-brief.md +2 -2
- package/yida-skills/skills/yida-design/workflow/step-2-theme-system.md +9 -12
- package/yida-skills/skills/yida-design/workflow/step-4-wireframe-interaction.md +6 -0
- package/yida-skills/skills/yida-design/workflow/step-5-visual-states.md +2 -2
- package/yida-skills/skills/yida-dingtalk-openapi/SKILL.md +75 -0
- package/yida-skills/skills/yida-dingtalk-openapi/references/api-contract.md +98 -0
- package/yida-skills/skills/yida-dingtalk-openapi/references/connector-mapping.md +27 -0
- package/yida-skills/skills/yida-integration/SKILL.md +29 -0
- package/yida-skills/skills/yida-nav-group/SKILL.md +1 -0
- package/yida-skills/skills/yida-nav-shell/SKILL.md +21 -18
- package/yida-skills/skills/yida-nav-shell/references/nav-shell-patterns.md +212 -266
- package/yida-skills/skills/yida-prd/SKILL.md +21 -32
- package/yida-skills/skills/yida-prd/references/plan-content.md +169 -0
- package/yida-skills/skills/yida-prd/workflow/output-prd.md +35 -7
- package/yida-skills/skills/yida-prd/workflow/plan-business.md +12 -0
- package/yida-skills/skills/yida-prd/workflow/step-2-information-architecture.md +7 -3
- package/yida-skills/skills/yida-publish-page/SKILL.md +4 -3
- package/yida-skills/skills/yida-requirement-analysis/SKILL.md +19 -20
- package/yida-skills/skills/yida-requirement-analysis/workflow/prepare-brief.md +68 -0
- package/yida-skills/skills-index.json +56 -1
- package/yida-skills/skills/yida-prd/workflow/step-1-read-brief.md +0 -15
package/README.md
CHANGED
|
@@ -166,10 +166,11 @@ For a user-facing list of supported features and matching CLI commands, see [Ope
|
|
|
166
166
|
### Application and Form Management
|
|
167
167
|
|
|
168
168
|
```bash
|
|
169
|
-
openyida create-app "CRM"
|
|
169
|
+
openyida create-app --name "CRM" --desc "Customer management"
|
|
170
170
|
openyida sample yida-design app-theme --output .cache/openyida/crm/app-theme.css
|
|
171
171
|
openyida create-app --name "CRM" --desc "Customer management" --theme-file .cache/openyida/crm/app-theme.css --nav-theme light --logo-source appIcon --layout l_shape
|
|
172
|
-
openyida app-list --size
|
|
172
|
+
openyida app-list --type managed --page 1 --size 16
|
|
173
|
+
openyida update-app APP_XXX --theme-file .cache/openyida/crm/app-theme.css --nav-theme light --logo-source appIcon --layout l_shape
|
|
173
174
|
openyida corp-efficiency
|
|
174
175
|
openyida create-form create APP_XXX "Customer" .cache/openyida/forms/customer-fields.json
|
|
175
176
|
openyida create-form update APP_XXX FORM_XXX .cache/openyida/forms/customer-changes.json
|
|
@@ -388,9 +389,13 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
388
389
|
|
|
389
390
|
| Command | Description |
|
|
390
391
|
|---------|-------------|
|
|
391
|
-
| `openyida app-list [--size N]` |
|
|
392
|
+
| `openyida app-list [--type managed\|created] [--page N] [--size N]` | Page through apps I manage or created |
|
|
392
393
|
| `openyida corp-efficiency [overview\|details\|detail\|groups\|notify] [options] [--open\|--no-open]` | Query enterprise efficiency overview and detail reports |
|
|
393
394
|
| `openyida create-app "<name>"\|--name <name> [options] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a Yida app |
|
|
395
|
+
| `openyida design-plan init <requirement-brief.json> [--theme-id <id>] [--output-dir <dir>] [--json]` | Initialize a plan draft from confirmed requirements |
|
|
396
|
+
| `openyida design-plan preview <build-plan.json> --part-file <module.json> [--json]` | Update plan drafts by module |
|
|
397
|
+
| `openyida design-plan materialize <build-plan.json> [--from-preview \| --business-file <json> --visual-file <json>] [--output-dir <dir>] [--check] [--json]` | Generate and validate design-plan artifacts from build-plan.json |
|
|
398
|
+
| `openyida design-plan patch <build-plan.json> --set <path=value> [--set <path=value> ...] [--materialize] [--output-dir <dir>] [--json]` | Patch a design plan by field path and invalidate prior confirmation |
|
|
394
399
|
| `openyida update-app <appType> [--name "..."] [--theme-file <css>] [--nav-theme light\|dark\|white\|gray] [--logo-source appIcon\|customImage] [--layout side\|top\|l_shape] [--hide-app-nav\|--show-app-nav]` | Update app info |
|
|
395
400
|
| `openyida app-online <appType> [--to-ding-app-center] [--show-app-center]` | Enable a Yida app |
|
|
396
401
|
| `openyida app-offline <appType> [--to-ding-app-center] [--show-app-center]` | Disable a Yida app |
|
|
@@ -404,6 +409,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
404
409
|
|
|
405
410
|
| Command | Description |
|
|
406
411
|
|---------|-------------|
|
|
412
|
+
| `openyida create-form batch <appType> <plan.json> [--concurrency 1..4] [--check] [--json]` | Create forms concurrently by dependency |
|
|
407
413
|
| `openyida create-form create <appType> "<formTitle>" <fieldsJsonFile> [--icon auto\|<iconName>] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a form page |
|
|
408
414
|
| `openyida create-form icons [--json]` | List available form navigation icons |
|
|
409
415
|
| `openyida create-form validate-fields <fieldsJsonOrFile> [--json]` | Validate form field JSON locally |
|
|
@@ -424,7 +430,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
424
430
|
| `openyida check-page <src> [--compat]` | Check custom page standards |
|
|
425
431
|
| `openyida compile <src>` | Compile custom page locally |
|
|
426
432
|
| `openyida publish <src> <appType> <formUuid> [--health-check] [--force] [--canvas] [--auto-nav-order] [--open\|--no-open]` | Compile and publish custom page |
|
|
427
|
-
| `openyida update-form-config <appType>
|
|
433
|
+
| `openyida update-form-config <appType> <formUuid> <true\|false\|keep> "<title>" [--locale zh_CN\|en_US\|ja_JP]` | Update form configuration |
|
|
428
434
|
| `openyida get-form-config <appType> <formUuid> [--json]` | Query form configuration |
|
|
429
435
|
|
|
430
436
|
### Data & Permissions
|
|
@@ -479,9 +485,9 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
479
485
|
| `openyida connector update-action --connector-id <id> --action <operationId> --query-json JSON --confirm` | Safely update action query defaults |
|
|
480
486
|
| `openyida connector list-actions <id>` | List actions |
|
|
481
487
|
| `openyida connector delete-action <id> <operation-id>` | Delete an action |
|
|
482
|
-
| `openyida connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>]` | Test an action |
|
|
488
|
+
| `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>]` | Test an action |
|
|
483
489
|
| `openyida connector list-connections <id>` | List auth connections |
|
|
484
|
-
| `openyida connector create-connection <id> <name
|
|
490
|
+
| `openyida connector create-connection <id> <name> [--interactive]` | Create an auth connection |
|
|
485
491
|
| `openyida connector smart-create --curl "..."` | Generate a redacted action draft from cURL (no remote create) |
|
|
486
492
|
| `openyida connector parse-api [options]` | Parse API information |
|
|
487
493
|
| `openyida connector gen-template [output]` | Generate API document template |
|
|
@@ -490,7 +496,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
490
496
|
|
|
491
497
|
| Command | Description |
|
|
492
498
|
|---------|-------------|
|
|
493
|
-
| `openyida integration create <appType> ... [--spec file.json]` | Create integration automation flow |
|
|
499
|
+
| `openyida integration create <appType> ... [--spec file.json] [--connector-system-token-app <appType>]` | Create integration automation flow |
|
|
494
500
|
| `openyida integration update <appType> <formUuid> <processCode> --spec <desired-spec.json> [--publish]` | Probe integration update capability (currently blocked without full readback) |
|
|
495
501
|
| `openyida integration list <appType> [--flow-types 1,2,3,5,6] [--form-uuid <uuid>] [--status y\|n] [--json]` | List integration automation flows |
|
|
496
502
|
| `openyida integration enable <appType> <formUuid> <processCode>` | Enable integration automation flow |
|
|
@@ -510,7 +516,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
510
516
|
| `openyida a2a <serve\|agent-card> [options]` | Start local read-only A2A adapter or print Agent Card |
|
|
511
517
|
| `openyida bridge start [--token <pair-token>] [--port 6736] [--origin https://demo.aliwork.com] [--open\|--no-open]` | Start OpenYida local web bridge service |
|
|
512
518
|
| `openyida copy [--force]` | Copy project working directory |
|
|
513
|
-
| `openyida sample [--list]` | Output code samples/templates |
|
|
519
|
+
| `openyida sample [--list] [<skill> <name>] [--output <file>] [--var KEY=VALUE ...] [--design-file <design.md>]` | Output code samples/templates |
|
|
514
520
|
| `openyida doctor [--fix]` | Environment diagnostics & auto-fix |
|
|
515
521
|
| `openyida db-seq-fix [--fix]` | Detect and repair PostgreSQL sequence drift |
|
|
516
522
|
| `openyida formula evaluate <formula\|file> [--schema file]` | Static-check Yida formula syntax and field refs |
|
|
@@ -563,7 +569,7 @@ The CLI package ships the core UI languages `zh` and `en` by default. Other CLI
|
|
|
563
569
|
|
|
564
570
|
#### Forms and Pages
|
|
565
571
|
|
|
566
|
-
Form field definitions can include `alias` or `componentAlias` to populate Yida designer component aliases, stored as `pages[0].componentAlias.items`. Yida runtime resolves these aliases in page JS, so `this.$('phone')` can be used instead of `this.$('textField_xxx')`; OpenYida form rules, validations, and `openyida data ... --resolve-aliases` JSON inputs also accept aliases as field references. For server-side DingTalk OpenAPI calls, use `GET /v2.0/yida/forms/component/alias/{appType}/{formUuid}` to read the `{ fieldId, alias }` mapping, then translate aliases before sending form data/search JSON. That endpoint requires `systemToken`, `userId`, an access token, and the Yida form data read permission
|
|
572
|
+
Form field definitions can include `alias` or `componentAlias` to populate Yida designer component aliases, stored as `pages[0].componentAlias.items`. Yida runtime resolves these aliases in page JS, so `this.$('phone')` can be used instead of `this.$('textField_xxx')`; OpenYida form rules, validations, and `openyida data ... --resolve-aliases` JSON inputs also accept aliases as field references. For server-side DingTalk OpenAPI calls, use `GET /v2.0/yida/forms/component/alias/{appType}/{formUuid}` to read the `{ fieldId, alias }` mapping, then translate aliases before sending form data/search JSON. That endpoint requires `systemToken`, `userId`, an access token, and the Yida form data read permission. Use `connector test --system-token-app <appType>` for a transient test or `integration create --connector-system-token-app <appType>` for a server-side automation; OpenYida resolves `systemToken` internally and never prints it or stores it in page source and Action defaults.
|
|
567
573
|
|
|
568
574
|
`openyida publish` preserves existing custom page data sources by default. Before saving the new compiled JSX Schema, it reads the current page Schema and merges the Page-level `dataSource` with the built-in `urlParams` and `timestamp` sources, so manually configured data sources are not deleted during republish.
|
|
569
575
|
|
package/bin/yida.js
CHANGED
|
@@ -746,6 +746,12 @@ async function main() {
|
|
|
746
746
|
break;
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
+
case 'design-plan': {
|
|
750
|
+
const { run } = require('../lib/design-plan/design-plan');
|
|
751
|
+
await run(args);
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
|
|
749
755
|
case 'create-page': {
|
|
750
756
|
const { run } = require('../lib/app/create-page');
|
|
751
757
|
await run(args);
|
|
@@ -1113,7 +1119,7 @@ async function main() {
|
|
|
1113
1119
|
delete-action <connector-id> <operation-id> 删除执行动作
|
|
1114
1120
|
test --connector-id <id> --action <actionId> [结构化 JSON 参数] 测试执行动作
|
|
1115
1121
|
list-connections <connector-id> 列出鉴权账号
|
|
1116
|
-
create-connection <connector-id> <name>
|
|
1122
|
+
create-connection <connector-id> <name> [--interactive] 创建鉴权账号;钉钉凭据可在本机隐藏输入
|
|
1117
1123
|
smart-create --curl "curl命令" 生成脱敏连接器动作草稿(不创建远端资源)
|
|
1118
1124
|
parse-api [选项] 解析接口信息
|
|
1119
1125
|
gen-template [输出路径] 生成接口文档模板
|
package/lib/app/app-list.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* app-list.js - 查询我的应用列表
|
|
3
3
|
*
|
|
4
|
-
* 用法:openyida app-list [--page <页码>] [--size <每页数量>]
|
|
4
|
+
* 用法:openyida app-list [--type managed|created] [--page <页码>] [--size <每页数量>]
|
|
5
5
|
*
|
|
6
6
|
* 输出字段:
|
|
7
7
|
* appName - 应用名称(zh_CN)
|
|
@@ -12,61 +12,65 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
const { createAuthRef, createYidaClient } = require('../core/yida-client');
|
|
15
|
-
const {
|
|
15
|
+
const { t } = require('../core/i18n');
|
|
16
|
+
const { throwCommandError, throwUsage } = require('../core/command-errors');
|
|
16
17
|
|
|
17
18
|
const API_PATH = '/query/app/getAppList.json';
|
|
19
|
+
const DEFAULT_PAGE_SIZE = 16;
|
|
20
|
+
const DEFAULT_PAGE_INDEX = 1;
|
|
21
|
+
const DEFAULT_TYPE = 'managed';
|
|
22
|
+
const APP_TYPES = Object.freeze({
|
|
23
|
+
managed: true,
|
|
24
|
+
created: false,
|
|
25
|
+
});
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* 拉取单页应用列表
|
|
21
29
|
*/
|
|
22
|
-
function fetchAppListPage(auth, pageIndex, pageSize) {
|
|
30
|
+
function fetchAppListPage(auth, pageIndex, pageSize, isAdmin) {
|
|
23
31
|
return createYidaClient({ authRef: auth }).get(API_PATH, (ref) => ({
|
|
24
32
|
_api: 'nattyFetch',
|
|
25
33
|
_mock: 'false',
|
|
26
34
|
pageIndex,
|
|
27
35
|
pageSize,
|
|
28
36
|
creator: ref.userId,
|
|
37
|
+
isAdmin,
|
|
29
38
|
_stamp: Date.now(),
|
|
30
39
|
}));
|
|
31
40
|
}
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
async function fetchAllApps(auth, pageSize) {
|
|
37
|
-
const firstResult = await fetchAppListPage(auth, 1, pageSize);
|
|
38
|
-
|
|
39
|
-
// 如果首次请求就提示需要登录,直接返回原始结果让外层自动刷新 token 后重试。
|
|
40
|
-
if (firstResult.__needLogin) {
|
|
41
|
-
return firstResult;
|
|
42
|
+
function parsePositiveInteger(value, optionName) {
|
|
43
|
+
if (!/^\d+$/.test(String(value || '')) || Number(value) < 1) {
|
|
44
|
+
throwUsage(t('app_list.invalid_positive_integer', optionName, value || ''));
|
|
42
45
|
}
|
|
46
|
+
return Number(value);
|
|
47
|
+
}
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const totalPages = Math.ceil(totalCount / pageSize);
|
|
52
|
-
const remainingFetches = [];
|
|
53
|
-
|
|
54
|
-
for (let pageIndex = 2; pageIndex <= totalPages; pageIndex++) {
|
|
55
|
-
remainingFetches.push(fetchAppListPage(auth, pageIndex, pageSize));
|
|
56
|
-
}
|
|
49
|
+
function parseArgs(args = []) {
|
|
50
|
+
const options = {
|
|
51
|
+
type: DEFAULT_TYPE,
|
|
52
|
+
pageIndex: DEFAULT_PAGE_INDEX,
|
|
53
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
|
54
|
+
};
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
for (let index = 0; index < args.length; index++) {
|
|
57
|
+
const arg = args[index];
|
|
58
|
+
if (arg === '--type') {
|
|
59
|
+
const type = args[++index];
|
|
60
|
+
if (!Object.prototype.hasOwnProperty.call(APP_TYPES, type)) {
|
|
61
|
+
throwUsage(t('app_list.invalid_type', type || '', Object.keys(APP_TYPES).join(', ')));
|
|
62
|
+
}
|
|
63
|
+
options.type = type;
|
|
64
|
+
} else if (arg === '--page') {
|
|
65
|
+
options.pageIndex = parsePositiveInteger(args[++index], '--page');
|
|
66
|
+
} else if (arg === '--size') {
|
|
67
|
+
options.pageSize = parsePositiveInteger(args[++index], '--size');
|
|
68
|
+
} else {
|
|
69
|
+
throwUsage(t('app_list.invalid_argument', arg));
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
return
|
|
73
|
+
return options;
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
/**
|
|
@@ -86,11 +90,13 @@ function hasHelpFlag(args) {
|
|
|
86
90
|
|
|
87
91
|
function printUsage() {
|
|
88
92
|
process.stderr.write([
|
|
89
|
-
'
|
|
93
|
+
t('app_list.usage'),
|
|
90
94
|
'',
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
'
|
|
95
|
+
t('app_list.options'),
|
|
96
|
+
t('app_list.option_type'),
|
|
97
|
+
t('app_list.option_page'),
|
|
98
|
+
t('app_list.option_size'),
|
|
99
|
+
t('app_list.option_help'),
|
|
94
100
|
'',
|
|
95
101
|
].join('\n'));
|
|
96
102
|
}
|
|
@@ -105,41 +111,60 @@ async function run(args) {
|
|
|
105
111
|
return;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
|
-
const
|
|
109
|
-
const pageSize = pageSizeIndex !== -1 && args[pageSizeIndex + 1]
|
|
110
|
-
? parseInt(args[pageSizeIndex + 1], 10)
|
|
111
|
-
: 20;
|
|
114
|
+
const options = parseArgs(args);
|
|
112
115
|
|
|
113
116
|
const authRef = createAuthRef();
|
|
114
117
|
|
|
115
|
-
let
|
|
118
|
+
let result;
|
|
116
119
|
try {
|
|
117
|
-
|
|
120
|
+
result = await fetchAppListPage(
|
|
121
|
+
authRef,
|
|
122
|
+
options.pageIndex,
|
|
123
|
+
options.pageSize,
|
|
124
|
+
APP_TYPES[options.type]
|
|
125
|
+
);
|
|
118
126
|
} catch (err) {
|
|
119
|
-
throwCommandError(
|
|
127
|
+
throwCommandError(t('app_list.query_failed', err.message));
|
|
120
128
|
}
|
|
121
129
|
|
|
122
130
|
// 如果重试后仍然返回登录失效标记,说明登录态确实不可用
|
|
123
|
-
if (
|
|
124
|
-
throwCommandError('
|
|
131
|
+
if (result && result.__needLogin) {
|
|
132
|
+
throwCommandError(t('app_list.auth_required'), { code: 'CLI_AUTH_REQUIRED' });
|
|
125
133
|
}
|
|
126
134
|
|
|
127
|
-
if (!
|
|
128
|
-
|
|
129
|
-
return;
|
|
135
|
+
if (!result || !result.success) {
|
|
136
|
+
throwCommandError(t('app_list.query_failed', (result && result.errorMsg) || t('app_list.unknown_error')));
|
|
130
137
|
}
|
|
131
138
|
|
|
139
|
+
const content = result.content || {};
|
|
140
|
+
const apps = Array.isArray(content.data) ? content.data : [];
|
|
141
|
+
const totalCount = Number.isFinite(Number(content.totalCount)) ? Number(content.totalCount) : apps.length;
|
|
142
|
+
const totalPages = Math.max(1, Math.ceil(totalCount / options.pageSize));
|
|
143
|
+
const scopeLabel = t(`app_list.scope_${options.type}`);
|
|
132
144
|
const formattedApps = apps.map(formatApp);
|
|
133
145
|
|
|
134
146
|
// stdout 输出 JSON,方便 AI 工具解析
|
|
135
147
|
console.log(JSON.stringify(formattedApps, null, 2));
|
|
136
148
|
|
|
137
149
|
// stderr 输出人类可读摘要
|
|
138
|
-
const { c, success: chalkSuccess, listItem } = require('../core/chalk');
|
|
139
|
-
chalkSuccess(
|
|
150
|
+
const { c, success: chalkSuccess, hint, listItem } = require('../core/chalk');
|
|
151
|
+
chalkSuccess(t(
|
|
152
|
+
'app_list.found',
|
|
153
|
+
scopeLabel,
|
|
154
|
+
options.pageIndex,
|
|
155
|
+
totalPages,
|
|
156
|
+
formattedApps.length,
|
|
157
|
+
totalCount
|
|
158
|
+
));
|
|
140
159
|
for (const app of formattedApps) {
|
|
141
160
|
listItem(`${c.bold}${app.appName}${c.reset} ${c.dim}[${app.appType}]${c.reset} ${c.cyan}${app.systemLink}${c.reset}`);
|
|
142
161
|
}
|
|
162
|
+
if (options.pageIndex < totalPages) {
|
|
163
|
+
hint(t(
|
|
164
|
+
'app_list.next_page',
|
|
165
|
+
`openyida app-list --type ${options.type} --page ${options.pageIndex + 1} --size ${options.pageSize}`
|
|
166
|
+
));
|
|
167
|
+
}
|
|
143
168
|
}
|
|
144
169
|
|
|
145
|
-
module.exports = { run };
|
|
170
|
+
module.exports = { parseArgs, run };
|
|
@@ -49,6 +49,7 @@ const {
|
|
|
49
49
|
formatFormDetailLinkMessage,
|
|
50
50
|
} = require('./form-detail-link-guard');
|
|
51
51
|
const { t } = require('../core/i18n');
|
|
52
|
+
const { assertInlineCssStructure } = require('./inline-css-guard');
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
55
|
* 依赖 → window 别名白名单,用于把 import 改写到运行时全局对象。
|
|
@@ -75,6 +76,7 @@ const MODULE_ALIAS_MAP = {
|
|
|
75
76
|
|
|
76
77
|
const MANUAL_DEPENDENCY_GLOBALS = Object.freeze({
|
|
77
78
|
React: 'react',
|
|
79
|
+
ReactDOM: 'react-dom',
|
|
78
80
|
antd: 'antd',
|
|
79
81
|
icons: '@ant-design/icons',
|
|
80
82
|
ahooks: 'ahooks',
|
|
@@ -88,6 +90,12 @@ const MANUAL_DEPENDENCY_GLOBALS = Object.freeze({
|
|
|
88
90
|
YidaMarkdown: 'yida-plugin-markdown',
|
|
89
91
|
});
|
|
90
92
|
|
|
93
|
+
const DEPENDENCY_RUNTIME_ALIASES = Object.freeze(Object.assign(
|
|
94
|
+
{},
|
|
95
|
+
Object.fromEntries(Object.entries(MODULE_ALIAS_MAP).map(([packageName, alias]) => [alias, packageName])),
|
|
96
|
+
{ LucideReact: 'lucide-react' }
|
|
97
|
+
));
|
|
98
|
+
|
|
91
99
|
const BARE_DEPENDENCY_GLOBALS = Object.freeze({
|
|
92
100
|
antd: {
|
|
93
101
|
packageName: 'antd',
|
|
@@ -209,6 +217,141 @@ function assertNoManualDependencyGlobals(source, options = {}) {
|
|
|
209
217
|
);
|
|
210
218
|
}
|
|
211
219
|
|
|
220
|
+
function findSelfReferentialDependencyBindingIssues(source) {
|
|
221
|
+
const issues = [];
|
|
222
|
+
const dependencyNames = new Set(Object.keys(MANUAL_DEPENDENCY_GLOBALS));
|
|
223
|
+
|
|
224
|
+
const guardPlugin = () => ({
|
|
225
|
+
name: 'yida-self-referential-dependency-binding-guard',
|
|
226
|
+
visitor: {
|
|
227
|
+
VariableDeclarator(path) {
|
|
228
|
+
if (!path.get('id').isIdentifier() || !path.node.init) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const name = path.node.id.name;
|
|
232
|
+
if (!dependencyNames.has(name)) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const binding = path.scope.getBinding(name);
|
|
236
|
+
let selfReference = null;
|
|
237
|
+
const initPath = path.get('init');
|
|
238
|
+
if (
|
|
239
|
+
initPath.isIdentifier({ name })
|
|
240
|
+
&& initPath.scope.getBinding(name) === binding
|
|
241
|
+
) {
|
|
242
|
+
selfReference = initPath.node;
|
|
243
|
+
}
|
|
244
|
+
initPath.traverse({
|
|
245
|
+
ReferencedIdentifier(referencePath) {
|
|
246
|
+
if (
|
|
247
|
+
!selfReference
|
|
248
|
+
&& referencePath.node.name === name
|
|
249
|
+
&& referencePath.scope.getBinding(name) === binding
|
|
250
|
+
) {
|
|
251
|
+
selfReference = referencePath.node;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
if (selfReference) {
|
|
256
|
+
issues.push({
|
|
257
|
+
name,
|
|
258
|
+
packageName: MANUAL_DEPENDENCY_GLOBALS[name],
|
|
259
|
+
line: selfReference.loc && selfReference.loc.start ? selfReference.loc.start.line : 0,
|
|
260
|
+
column: selfReference.loc && selfReference.loc.start ? selfReference.loc.start.column : 0,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
Babel.transform(source, {
|
|
268
|
+
filename: 'canvas.tsx',
|
|
269
|
+
presets: [
|
|
270
|
+
['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
|
|
271
|
+
['react', { runtime: 'classic' }],
|
|
272
|
+
],
|
|
273
|
+
plugins: [guardPlugin],
|
|
274
|
+
sourceType: 'module',
|
|
275
|
+
compact: false,
|
|
276
|
+
babelrc: false,
|
|
277
|
+
configFile: false,
|
|
278
|
+
});
|
|
279
|
+
return issues;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function assertNoSelfReferentialDependencyBindings(source, options = {}) {
|
|
283
|
+
const issues = findSelfReferentialDependencyBindingIssues(source);
|
|
284
|
+
if (issues.length === 0) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
const firstIssue = issues[0];
|
|
288
|
+
throw new CliError(
|
|
289
|
+
`Code Canvas 依赖绑定 ${firstIssue.name} 不能引用自身。请从 "${firstIssue.packageName}" 使用标准 import 引入。`,
|
|
290
|
+
{
|
|
291
|
+
code: 'OPENYIDA_CANVAS_SELF_REFERENTIAL_DEPENDENCY_BINDING',
|
|
292
|
+
details: {
|
|
293
|
+
stage: 'canvas_compile',
|
|
294
|
+
sourcePath: options.sourcePath || '',
|
|
295
|
+
line: firstIssue.line,
|
|
296
|
+
column: firstIssue.column,
|
|
297
|
+
globalName: firstIssue.name,
|
|
298
|
+
packageName: firstIssue.packageName,
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function findDependencyManifestIssues(runtimeCode, importedModules) {
|
|
305
|
+
const importedBaseNames = new Set((importedModules || []).map(packageBaseName));
|
|
306
|
+
const observedAliases = new Set();
|
|
307
|
+
const guardPlugin = ({ types: types }) => ({
|
|
308
|
+
name: 'yida-runtime-dependency-manifest-guard',
|
|
309
|
+
visitor: {
|
|
310
|
+
MemberExpression(path) {
|
|
311
|
+
const node = path.node;
|
|
312
|
+
if (!types.isIdentifier(node.object, { name: 'window' })) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const alias = node.computed && types.isStringLiteral(node.property)
|
|
316
|
+
? node.property.value
|
|
317
|
+
: (!node.computed && types.isIdentifier(node.property) ? node.property.name : '');
|
|
318
|
+
if (DEPENDENCY_RUNTIME_ALIASES[alias]) {
|
|
319
|
+
observedAliases.add(alias);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
Babel.transform(runtimeCode, {
|
|
325
|
+
filename: 'canvas-runtime.js',
|
|
326
|
+
plugins: [guardPlugin],
|
|
327
|
+
sourceType: 'script',
|
|
328
|
+
compact: false,
|
|
329
|
+
babelrc: false,
|
|
330
|
+
configFile: false,
|
|
331
|
+
});
|
|
332
|
+
return Array.from(observedAliases)
|
|
333
|
+
.filter(alias => !importedBaseNames.has(packageBaseName(DEPENDENCY_RUNTIME_ALIASES[alias])))
|
|
334
|
+
.map(alias => ({ alias, packageName: DEPENDENCY_RUNTIME_ALIASES[alias] }));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function assertDependencyManifestConsistent(runtimeCode, importedModules, options = {}) {
|
|
338
|
+
const issues = findDependencyManifestIssues(runtimeCode, importedModules);
|
|
339
|
+
if (issues.length === 0) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
throw new CliError(
|
|
343
|
+
`Code Canvas 运行时代码依赖 ${issues[0].alias},但 importedModules 缺少 "${issues[0].packageName}"。`,
|
|
344
|
+
{
|
|
345
|
+
code: 'OPENYIDA_CANVAS_DEPENDENCY_MANIFEST_MISMATCH',
|
|
346
|
+
details: {
|
|
347
|
+
stage: 'canvas_compile',
|
|
348
|
+
sourcePath: options.sourcePath || '',
|
|
349
|
+
issues,
|
|
350
|
+
},
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
212
355
|
function findBareDependencyGlobalIssues(source) {
|
|
213
356
|
const issues = [];
|
|
214
357
|
const names = new Set(Object.keys(BARE_DEPENDENCY_GLOBALS));
|
|
@@ -820,8 +963,10 @@ function compileCanvasLocal(source, options = {}) {
|
|
|
820
963
|
});
|
|
821
964
|
}
|
|
822
965
|
assertNoUnavailableCanvasInstanceApis(source, options);
|
|
966
|
+
assertNoSelfReferentialDependencyBindings(source, options);
|
|
823
967
|
assertNoBareDependencyGlobals(source, options);
|
|
824
968
|
assertNoManualDependencyGlobals(source, options);
|
|
969
|
+
assertInlineCssStructure(source, options);
|
|
825
970
|
|
|
826
971
|
const importedModules = extractImportedModules(source);
|
|
827
972
|
|
|
@@ -877,6 +1022,7 @@ function compileCanvasLocal(source, options = {}) {
|
|
|
877
1022
|
});
|
|
878
1023
|
const runtimeCode = minifyCanvasRuntime(unminifiedRuntimeCode, options);
|
|
879
1024
|
assertCanvasRuntimeParseable(runtimeCode, options);
|
|
1025
|
+
assertDependencyManifestConsistent(runtimeCode, importedModules, options);
|
|
880
1026
|
return {
|
|
881
1027
|
runtimeCode,
|
|
882
1028
|
importedModules: JSON.stringify(importedModules),
|
|
@@ -944,5 +1090,8 @@ module.exports = {
|
|
|
944
1090
|
assertCanvasRuntimeParseable,
|
|
945
1091
|
minifyCanvasRuntime,
|
|
946
1092
|
findBareDependencyGlobalIssues,
|
|
1093
|
+
findSelfReferentialDependencyBindingIssues,
|
|
1094
|
+
findDependencyManifestIssues,
|
|
1095
|
+
assertDependencyManifestConsistent,
|
|
947
1096
|
MODULE_ALIAS_MAP,
|
|
948
1097
|
};
|