openyida 2026.4.2 → 2026.4.14-1
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 +3 -0
- package/bin/yida.js +203 -140
- package/lib/app/app-list.js +134 -0
- package/lib/app/create-app.js +26 -32
- package/lib/app/create-form.js +176 -165
- package/lib/app/create-page.js +19 -24
- package/lib/app/export-app.js +26 -28
- package/lib/app/get-schema.js +24 -35
- package/lib/app/import-app.js +42 -52
- package/lib/app/publish.js +165 -77
- package/lib/app/update-app.js +197 -0
- package/lib/app/update-form-config.js +38 -44
- package/lib/auth/auth.js +29 -27
- package/lib/auth/login.js +43 -45
- package/lib/auth/org.js +36 -36
- package/lib/auth/qr-login.js +42 -39
- package/lib/cdn/cdn-config.js +2 -1
- package/lib/cdn/cdn-refresh.js +14 -13
- package/lib/cdn/cdn-upload.js +12 -11
- package/lib/connector/action-generator.js +23 -9
- package/lib/connector/connector-add-action.js +4 -3
- package/lib/connector/connector-create-connection.js +3 -2
- package/lib/connector/connector-create.js +9 -8
- package/lib/connector/connector-delete-action.js +3 -2
- package/lib/connector/connector-delete.js +2 -1
- package/lib/connector/connector-detail.js +2 -1
- package/lib/connector/connector-gen-template.js +2 -1
- package/lib/connector/connector-list-actions.js +2 -1
- package/lib/connector/connector-list-connections.js +2 -1
- package/lib/connector/connector-parse-api.js +3 -2
- package/lib/connector/connector-smart-create.js +3 -1
- package/lib/connector/connector-test.js +5 -4
- package/lib/conversation/collector.js +9 -8
- package/lib/conversation/export-conversation.js +17 -20
- package/lib/core/chalk.js +344 -0
- package/lib/core/check-data.js +516 -0
- package/lib/core/check-update.js +2 -1
- package/lib/core/copy.js +22 -25
- package/lib/core/doctor.js +24 -19
- package/lib/core/env-cmd.js +385 -0
- package/lib/core/env-manager.js +218 -0
- package/lib/core/env.js +34 -36
- package/lib/core/i18n.js +1 -1
- package/lib/core/locales/ar.js +93 -0
- package/lib/core/locales/de.js +93 -0
- package/lib/core/locales/en.js +326 -21
- package/lib/core/locales/es.js +93 -0
- package/lib/core/locales/fr.js +93 -0
- package/lib/core/locales/hi.js +93 -0
- package/lib/core/locales/ja.js +176 -21
- package/lib/core/locales/ko.js +93 -0
- package/lib/core/locales/pt.js +93 -0
- package/lib/core/locales/vi.js +93 -0
- package/lib/core/locales/zh-TW.js +191 -21
- package/lib/core/locales/zh.js +326 -21
- package/lib/core/query-data.js +39 -3
- package/lib/core/sample.js +140 -0
- package/lib/core/task-center.js +4 -3
- package/lib/core/update.js +149 -0
- package/lib/core/utils.js +100 -17
- package/lib/db/db-seq-fix.js +437 -0
- package/lib/dws/dws-wrapper.js +27 -8
- package/lib/flash-note/flash-to-prd.js +45 -44
- package/lib/integration/integration-create.js +71 -70
- package/lib/page-config/get-page-config.js +18 -22
- package/lib/page-config/save-share-config.js +31 -36
- package/lib/page-config/verify-short-url.js +31 -36
- package/lib/permission/get-permission.js +20 -19
- package/lib/permission/save-permission.js +50 -49
- package/lib/process/configure-process.js +54 -47
- package/lib/process/create-process.js +57 -43
- package/lib/process/preview-process.js +879 -0
- package/lib/report/append.js +42 -41
- package/lib/report/chart-builder.js +9 -8
- package/lib/report/create-report.js +2 -1
- package/lib/report/index.js +45 -43
- package/{yida-skills/skills/yida-custom-page/templates → lib/samples/yida-custom-page}/custom-page-template.js +48 -18
- package/package.json +1 -1
- package/project/pages/src/demo-chip-insight.js +3 -1
- package/project/pages/src/demo-ppt.js +1192 -0
- package/yida-skills/SKILL.md +33 -3
- package/yida-skills/references/yida-api.md +24 -1
- package/yida-skills/skills/large-file-write/SKILL.md +32 -43
- package/yida-skills/skills/large-file-write/references/write-patterns.md +124 -0
- package/yida-skills/skills/yida-app/SKILL.md +47 -14
- package/yida-skills/skills/yida-chart/SKILL.md +5 -5
- package/yida-skills/skills/yida-chart/{reference → references}/echarts-code-template.md +3 -3
- package/yida-skills/skills/yida-chart/references/examples.md +164 -0
- package/yida-skills/skills/yida-connector/SKILL.md +41 -1
- package/yida-skills/skills/yida-create-app/SKILL.md +19 -3
- package/yida-skills/skills/yida-create-form-page/SKILL.md +25 -1
- package/yida-skills/skills/yida-create-page/SKILL.md +23 -2
- package/yida-skills/skills/yida-create-process/SKILL.md +42 -2
- package/yida-skills/skills/yida-custom-page/SKILL.md +101 -239
- package/yida-skills/skills/yida-custom-page/examples/attachment-upload.js +223 -0
- package/yida-skills/skills/yida-custom-page/references/assets-guide.md +3 -3
- package/yida-skills/skills/yida-custom-page/references/attachment-upload-guide.md +459 -0
- package/yida-skills/skills/yida-custom-page/references/coding-guide.md +116 -86
- package/yida-skills/skills/yida-custom-page/references/design-system.md +4 -0
- package/yida-skills/skills/yida-data-management/SKILL.md +51 -0
- package/yida-skills/skills/yida-db-seq-fix/SKILL.md +110 -0
- package/yida-skills/skills/yida-density/SKILL.md +65 -246
- package/yida-skills/skills/yida-export-conversation/SKILL.md +39 -2
- package/yida-skills/skills/yida-flash-note-to-prd/SKILL.md +42 -250
- package/yida-skills/skills/yida-flash-note-to-prd/references/examples.md +124 -0
- package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prd-template.md +42 -0
- package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prompt.md +197 -0
- package/yida-skills/skills/yida-flash-note-to-prd/references/yida-field-types.md +20 -0
- package/yida-skills/skills/yida-form-permission/SKILL.md +36 -2
- package/yida-skills/skills/yida-formula/SKILL.md +37 -21
- package/yida-skills/skills/yida-formula/references/examples.md +149 -0
- package/yida-skills/skills/yida-get-schema/SKILL.md +35 -1
- package/yida-skills/skills/yida-integration/SKILL.md +71 -127
- package/yida-skills/skills/yida-integration/references/examples.md +119 -0
- package/yida-skills/skills/yida-integration/references/integration-node-schemas.md +377 -0
- package/yida-skills/skills/yida-login/SKILL.md +24 -2
- package/yida-skills/skills/yida-logout/SKILL.md +33 -1
- package/yida-skills/skills/yida-page-config/SKILL.md +36 -1
- package/yida-skills/skills/yida-ppt-slider/SKILL.md +750 -1
- package/yida-skills/skills/yida-ppt-slider/references/examples.md +381 -0
- package/yida-skills/skills/yida-process-rule/SKILL.md +30 -320
- package/yida-skills/skills/yida-process-rule/references/examples.md +344 -0
- package/yida-skills/skills/yida-publish-page/SKILL.md +56 -1
- package/yida-skills/skills/yida-report/SKILL.md +25 -341
- package/yida-skills/skills/yida-report/references/examples.md +145 -0
- package/yida-skills/skills/yida-report/references/report-api-guide.md +287 -0
- package/yida-skills/skills/yida-table-form/SKILL.md +65 -437
- package/yida-skills/skills/yida-table-form/references/examples.md +113 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/china-map.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/dashboard-bindform.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/line-trend.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/multi-bar-compare.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/radar-chart.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/scatter-bindform.js +0 -0
- /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/stacked-area.js +0 -0
- /package/{yida-skills/skills/yida-create-app/templates → lib/samples/yida-create-app}/ipd-app-template.js +0 -0
- /package/{yida-skills/skills/yida-custom-page/examples → lib/samples/yida-custom-page}/design-tokens.js +0 -0
- /package/{yida-skills/skills/yida-data-management/templates → lib/samples/yida-data-management}/form-field-template.js +0 -0
- /package/{yida-skills/skills/yida-density/examples → lib/samples/yida-density}/density-switch-page.js +0 -0
- /package/{yida-skills/skills/yida-table-form/examples → lib/samples/yida-table-form}/table-form-batch-submit.js +0 -0
- /package/yida-skills/skills/yida-chart/{reference → references}/echarts-bindding-guide.md +0 -0
- /package/yida-skills/skills/yida-chart/{reference → references}/echarts-design-spec.md +0 -0
package/README.md
CHANGED
|
@@ -99,7 +99,9 @@ openyida create-form # Create / update a form page
|
|
|
99
99
|
openyida create-page # Create a custom display page
|
|
100
100
|
openyida create-process # Create a process form (integrated)
|
|
101
101
|
openyida create-report # Create a Yida report
|
|
102
|
+
openyida process preview # Preview process instance (generate visual flowchart)
|
|
102
103
|
openyida data # Unified data management (form/process/task/subform)
|
|
104
|
+
openyida data check <appType> <formUuid> <rules.json> [options] # Detect anomalous records in process forms based on custom rules
|
|
103
105
|
openyida doctor # Environment diagnostics and auto-repair
|
|
104
106
|
openyida dws <command> [args] # DingTalk CLI (Contacts/Calendar/Todo/Approval, etc.)
|
|
105
107
|
openyida env # Detect current AI tool environment and login status
|
|
@@ -205,6 +207,7 @@ Thanks to everyone who has contributed to OpenYida! Read the [Contributing Guide
|
|
|
205
207
|
<a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="LIUG" title="LIUG"/></a>
|
|
206
208
|
<a href="https://github.com/sunliz-xiuli"><img src="https://avatars.githubusercontent.com/u/76982855?v=4&s=48" width="48" height="48" alt="sunliz-xiuli" title="sunliz-xiuli"/></a>
|
|
207
209
|
<a href="https://github.com/M12REDX"><img src="https://avatars.githubusercontent.com/u/22703542?v=4&s=48" width="48" height="48" alt="M12REDX" title="M12REDX"/></a>
|
|
210
|
+
<a href="https://github.com/key-668"><img src="https://avatars.githubusercontent.com/u/270536058?v=4&s=48" width="48" height="48" alt="再不喝汽水" title="再不喝汽水"/></a>
|
|
208
211
|
</p>
|
|
209
212
|
|
|
210
213
|
---
|
package/bin/yida.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* openyida save-share-config <appType> <formUuid> <url> <isOpen> [openAuth] 保存公开访问/分享配置
|
|
27
27
|
* openyida get-page-config <appType> <formUuid> 查询页面公开访问/分享配置
|
|
28
28
|
* openyida update-form-config <appType> <formUuid> <isRenderNav> <title> 更新表单配置
|
|
29
|
+
* openyida update-app <appType> --name "新名称" [--desc "描述"] [--icon "图标"] 更新应用信息
|
|
29
30
|
* openyida data <action> <resource> [args] 统一数据管理(表单/流程/任务/子表单)
|
|
30
31
|
* openyida task-center <type> [--page N] [--size N] [--keyword TEXT] 全局任务中心(待办/我创建的/我已处理/抄送/代提交)
|
|
31
32
|
* openyida doctor [选项] 检查环境依赖,诊断应用问题
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
* openyida import <file> [name] 导入迁移包,在目标环境重建应用
|
|
34
35
|
* openyida get-permission <appType> <formUuid> 查询表单权限配置
|
|
35
36
|
* openyida save-permission <appType> <formUuid> [--data-permission <json>] [--action-permission <json>] 保存表单权限配置
|
|
37
|
+
* openyida process preview <appType> <processInstanceId> [--output <path>] 预览流程实例(生成可视化流程图)
|
|
36
38
|
* openyida connector list [选项] 列出 HTTP 连接器
|
|
37
39
|
* openyida connector create "名称" "域名" --operations <file> [选项] 创建连接器
|
|
38
40
|
* openyida connector detail <connector-id> 查看连接器详情
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
* openyida create-report <appType> "<报表名称>" <图表定义JSON或文件路径> 创建宜搭报表
|
|
51
53
|
* openyida append-chart <appType> <reportId> <图表定义JSON或文件路径> 向已有报表追加图表
|
|
52
54
|
* openyida dws <command> [args] 钉钉 CLI(通讯录/日历/待办/审批等)
|
|
55
|
+
* openyida update 检查并更新 openyida 到最新版本
|
|
53
56
|
*/
|
|
54
57
|
|
|
55
58
|
'use strict';
|
|
@@ -57,6 +60,7 @@
|
|
|
57
60
|
const { checkUpdate } = require('../lib/core/check-update');
|
|
58
61
|
const { version: currentVersion } = require('../package.json');
|
|
59
62
|
const { t } = require('../lib/core/i18n');
|
|
63
|
+
const { warn, fail } = require('../lib/core/chalk');
|
|
60
64
|
|
|
61
65
|
// 异步检查更新,fire-and-forget,不阻塞主流程
|
|
62
66
|
const updateCheckPromise = checkUpdate(currentVersion);
|
|
@@ -65,106 +69,129 @@ const command = process.argv[2];
|
|
|
65
69
|
const args = process.argv.slice(3);
|
|
66
70
|
|
|
67
71
|
function printHelp() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
72
|
+
const RESET = '\x1b[0m';
|
|
73
|
+
const BOLD = '\x1b[1m';
|
|
74
|
+
const DIM = '\x1b[2m';
|
|
75
|
+
const CYAN = '\x1b[36m';
|
|
76
|
+
const GREEN = '\x1b[32m';
|
|
77
|
+
const YELLOW = '\x1b[33m';
|
|
78
|
+
|
|
79
|
+
const SEP = `${DIM}${'─'.repeat(60)}${RESET}`;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 渲染一组命令列表。
|
|
83
|
+
* @param {string} groupTitle - 分组标题
|
|
84
|
+
* @param {Array<[string, string]>} commands - [命令, 描述] 数组
|
|
85
|
+
*/
|
|
86
|
+
function renderGroup(groupTitle, commands) {
|
|
87
|
+
console.log(`\n ${BOLD}${CYAN}${groupTitle}${RESET}`);
|
|
88
|
+
const maxCmdLen = Math.max(...commands.map(([cmd]) => cmd.length));
|
|
89
|
+
const padWidth = Math.min(maxCmdLen + 2, 50);
|
|
90
|
+
for (const [cmd, desc] of commands) {
|
|
91
|
+
console.log(` ${GREEN}${cmd.padEnd(padWidth)}${RESET}${DIM}${desc}${RESET}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ── 标题 ──
|
|
96
|
+
console.log('');
|
|
97
|
+
console.log(` ${BOLD}${CYAN}OpenYida${RESET} ${DIM}v${currentVersion}${RESET}`);
|
|
98
|
+
console.log(` ${DIM}${t('help.subtitle')}${RESET}`);
|
|
99
|
+
console.log(` ${DIM}"We are on the verge of the Singularity"${RESET}`);
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log(` ${YELLOW}${t('help.usage')}${RESET} openyida <command> [args...]`);
|
|
102
|
+
console.log(` ${DIM}${t('help.alias')}${RESET} yida`);
|
|
103
|
+
console.log(SEP);
|
|
104
|
+
|
|
105
|
+
// ── 环境 & 认证 ──
|
|
106
|
+
renderGroup(t('help.group_auth'), [
|
|
107
|
+
['login [--qr]', t('help.cmd_login')],
|
|
108
|
+
['logout', t('help.cmd_logout')],
|
|
109
|
+
['auth <status|login|refresh|logout>', t('help.cmd_auth')],
|
|
110
|
+
['org <list|switch>', t('help.cmd_org')],
|
|
111
|
+
['env', t('help.cmd_env')],
|
|
112
|
+
]);
|
|
113
|
+
|
|
114
|
+
// ── 应用管理 ──
|
|
115
|
+
renderGroup(t('help.group_app'), [
|
|
116
|
+
['create-app "<name>" [options]', t('help.cmd_create_app')],
|
|
117
|
+
['update-app <appType> --name "..."', t('help.cmd_update_app')],
|
|
118
|
+
['export <appType> [output]', t('help.cmd_export')],
|
|
119
|
+
['import <file> [name]', t('help.cmd_import')],
|
|
120
|
+
]);
|
|
121
|
+
|
|
122
|
+
// ── 表单 & 页面 ──
|
|
123
|
+
renderGroup(t('help.group_form'), [
|
|
124
|
+
['create-form create <appType> ...', t('help.cmd_create_form')],
|
|
125
|
+
['create-form update <appType> ...', t('help.cmd_update_form')],
|
|
126
|
+
['get-schema <appType> <formUuid>', t('help.cmd_get_schema')],
|
|
127
|
+
['create-page <appType> "<name>"', t('help.cmd_create_page')],
|
|
128
|
+
['publish <src> <appType> <formUuid>', t('help.cmd_publish')],
|
|
129
|
+
['update-form-config <appType> ...', t('help.cmd_update_form_config')],
|
|
130
|
+
]);
|
|
131
|
+
|
|
132
|
+
// ── 数据 & 权限 ──
|
|
133
|
+
renderGroup(t('help.group_data'), [
|
|
134
|
+
['data <action> <resource> [args]', t('help.cmd_data')],
|
|
135
|
+
['task-center <type> [options]', t('help.cmd_task_center')],
|
|
136
|
+
['get-permission <appType> <formUuid>', t('help.cmd_get_permission')],
|
|
137
|
+
['save-permission <appType> <formUuid> ...', t('help.cmd_save_permission')],
|
|
138
|
+
]);
|
|
139
|
+
|
|
140
|
+
// ── 流程 ──
|
|
141
|
+
renderGroup(t('help.group_process'), [
|
|
142
|
+
['configure-process <appType> ...', t('help.cmd_configure_process')],
|
|
143
|
+
['create-process <appType> ...', t('help.cmd_create_process')],
|
|
144
|
+
['process preview <appType> ...', t('help.cmd_process_preview')],
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
// ── 页面配置 & 分享 ──
|
|
148
|
+
renderGroup(t('help.group_share'), [
|
|
149
|
+
['verify-short-url <appType> ...', t('help.cmd_verify_url')],
|
|
150
|
+
['save-share-config <appType> ...', t('help.cmd_save_share')],
|
|
151
|
+
['get-page-config <appType> <formUuid>', t('help.cmd_get_page_config')],
|
|
152
|
+
]);
|
|
153
|
+
|
|
154
|
+
// ── 报表 ──
|
|
155
|
+
renderGroup(t('help.group_report'), [
|
|
156
|
+
['create-report <appType> "<name>" ...', t('help.cmd_create_report')],
|
|
157
|
+
['append-chart <appType> <reportId> ...', t('help.cmd_append_chart')],
|
|
158
|
+
]);
|
|
159
|
+
|
|
160
|
+
// ── 连接器 ──
|
|
161
|
+
renderGroup(t('help.group_connector'), [
|
|
162
|
+
['connector list', t('help.cmd_connector_list')],
|
|
163
|
+
['connector create "name" "domain" ...', t('help.cmd_connector_create')],
|
|
164
|
+
['connector detail <id>', t('help.cmd_connector_detail')],
|
|
165
|
+
['connector delete <id>', t('help.cmd_connector_delete')],
|
|
166
|
+
['connector smart-create --curl "..."', t('help.cmd_connector_smart')],
|
|
167
|
+
['connector <sub-command> --help', t('help.cmd_connector_more')],
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
// ── 集成 & 钉钉 ──
|
|
171
|
+
renderGroup(t('help.group_integration'), [
|
|
172
|
+
['integration create <appType> ...', t('help.cmd_integration')],
|
|
173
|
+
['dws <command> [args]', t('help.cmd_dws')],
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
// ── 工具 ──
|
|
177
|
+
renderGroup(t('help.group_utility'), [
|
|
178
|
+
['copy [--force]', t('help.cmd_copy')],
|
|
179
|
+
['doctor [--fix]', t('help.cmd_doctor')],
|
|
180
|
+
['update', t('help.cmd_update')],
|
|
181
|
+
['export-conversation [options]', t('help.cmd_export_conversation')],
|
|
182
|
+
['cdn-config / cdn-upload / cdn-refresh', t('help.cmd_cdn')],
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
// ── 快速上手 ──
|
|
186
|
+
console.log(SEP);
|
|
187
|
+
console.log(`\n ${BOLD}${CYAN}${t('help.quickstart_title')}${RESET}`);
|
|
188
|
+
console.log(` ${DIM}${RESET} openyida login`);
|
|
189
|
+
console.log(` ${DIM}${RESET} openyida create-app "${t('help.quickstart_app_name')}"`);
|
|
190
|
+
console.log(` ${DIM}${RESET} openyida create-form create APP_XXX "${t('help.quickstart_form_name')}" fields.json`);
|
|
191
|
+
console.log(` ${DIM}${RESET} openyida dws contact user search --keyword "张三"`);
|
|
192
|
+
console.log('');
|
|
193
|
+
console.log(` ${DIM}${t('help.docs')} https://openyida.ai · https://github.com/openyida/openyida${RESET}`);
|
|
194
|
+
console.log('');
|
|
168
195
|
}
|
|
169
196
|
|
|
170
197
|
/**
|
|
@@ -299,8 +326,8 @@ async function main() {
|
|
|
299
326
|
} else if (subCommand === 'logout') {
|
|
300
327
|
authLogout();
|
|
301
328
|
} else {
|
|
302
|
-
|
|
303
|
-
|
|
329
|
+
warn(t('cli.auth_usage'));
|
|
330
|
+
warn(t('cli.auth_example'));
|
|
304
331
|
process.exit(1);
|
|
305
332
|
}
|
|
306
333
|
break;
|
|
@@ -314,14 +341,14 @@ async function main() {
|
|
|
314
341
|
if (subCommand === 'list') {
|
|
315
342
|
const cookieData = loadCookieData();
|
|
316
343
|
if (!cookieData || !cookieData.cookies) {
|
|
317
|
-
|
|
344
|
+
warn(t('org.no_login'));
|
|
318
345
|
process.exit(1);
|
|
319
346
|
}
|
|
320
347
|
await listOrganizations(cookieData);
|
|
321
348
|
} else if (subCommand === 'switch') {
|
|
322
349
|
const cookieData = loadCookieData();
|
|
323
350
|
if (!cookieData || !cookieData.cookies) {
|
|
324
|
-
|
|
351
|
+
warn(t('org.no_login'));
|
|
325
352
|
process.exit(1);
|
|
326
353
|
}
|
|
327
354
|
|
|
@@ -335,8 +362,8 @@ async function main() {
|
|
|
335
362
|
await interactiveSwitch(cookieData);
|
|
336
363
|
}
|
|
337
364
|
} else {
|
|
338
|
-
|
|
339
|
-
|
|
365
|
+
warn(t('cli.org_usage'));
|
|
366
|
+
warn(t('cli.org_example'));
|
|
340
367
|
process.exit(1);
|
|
341
368
|
}
|
|
342
369
|
break;
|
|
@@ -373,8 +400,8 @@ async function main() {
|
|
|
373
400
|
const skipLint = args.includes('--skip-lint');
|
|
374
401
|
const filteredArgs = args.filter(arg => arg !== '--skip-lint');
|
|
375
402
|
if (filteredArgs.length < 3) {
|
|
376
|
-
|
|
377
|
-
|
|
403
|
+
warn(t('cli.publish_usage'));
|
|
404
|
+
warn(t('cli.publish_example'));
|
|
378
405
|
process.exit(1);
|
|
379
406
|
}
|
|
380
407
|
const [sourceFile, appType, formUuid] = filteredArgs;
|
|
@@ -390,8 +417,8 @@ async function main() {
|
|
|
390
417
|
|
|
391
418
|
case 'verify-short-url': {
|
|
392
419
|
if (args.length < 3) {
|
|
393
|
-
|
|
394
|
-
|
|
420
|
+
warn(t('cli.verify_usage'));
|
|
421
|
+
warn(t('cli.verify_example'));
|
|
395
422
|
process.exit(1);
|
|
396
423
|
}
|
|
397
424
|
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
@@ -401,8 +428,8 @@ async function main() {
|
|
|
401
428
|
|
|
402
429
|
case 'save-share-config': {
|
|
403
430
|
if (args.length < 4) {
|
|
404
|
-
|
|
405
|
-
|
|
431
|
+
warn(t('cli.share_usage'));
|
|
432
|
+
warn(t('cli.share_example'));
|
|
406
433
|
process.exit(1);
|
|
407
434
|
}
|
|
408
435
|
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
@@ -412,8 +439,8 @@ async function main() {
|
|
|
412
439
|
|
|
413
440
|
case 'get-page-config': {
|
|
414
441
|
if (args.length < 2) {
|
|
415
|
-
|
|
416
|
-
|
|
442
|
+
warn(t('cli.page_config_usage'));
|
|
443
|
+
warn(t('cli.page_config_example'));
|
|
417
444
|
process.exit(1);
|
|
418
445
|
}
|
|
419
446
|
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
@@ -423,8 +450,8 @@ async function main() {
|
|
|
423
450
|
|
|
424
451
|
case 'update-form-config': {
|
|
425
452
|
if (args.length < 4) {
|
|
426
|
-
|
|
427
|
-
|
|
453
|
+
warn(t('cli.form_config_usage'));
|
|
454
|
+
warn(t('cli.form_config_example'));
|
|
428
455
|
process.exit(1);
|
|
429
456
|
}
|
|
430
457
|
process.argv = [process.argv[0], process.argv[1], ...args];
|
|
@@ -432,10 +459,21 @@ async function main() {
|
|
|
432
459
|
break;
|
|
433
460
|
}
|
|
434
461
|
|
|
462
|
+
case 'update-app': {
|
|
463
|
+
if (args.length < 2) {
|
|
464
|
+
warn(t('cli.update_app_usage'));
|
|
465
|
+
warn(t('cli.update_app_example'));
|
|
466
|
+
process.exit(1);
|
|
467
|
+
}
|
|
468
|
+
const { run: runUpdateApp } = require('../lib/app/update-app');
|
|
469
|
+
await runUpdateApp(args);
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
|
|
435
473
|
case 'data': {
|
|
436
474
|
if (args.length < 2) {
|
|
437
|
-
|
|
438
|
-
|
|
475
|
+
warn('用法: openyida data <action> <resource> [args] [options]');
|
|
476
|
+
warn('示例: openyida data query form APP_XXX FORM_XXX --page 1 --size 20');
|
|
439
477
|
process.exit(1);
|
|
440
478
|
}
|
|
441
479
|
const { run: runDataManagement } = require('../lib/core/query-data');
|
|
@@ -451,9 +489,9 @@ async function main() {
|
|
|
451
489
|
|
|
452
490
|
case 'export': {
|
|
453
491
|
if (args.length < 1) {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
492
|
+
warn(t('cli.export_usage'));
|
|
493
|
+
warn(t('cli.export_example1'));
|
|
494
|
+
warn(t('cli.export_example2'));
|
|
457
495
|
process.exit(1);
|
|
458
496
|
}
|
|
459
497
|
const { run: runExport } = require('../lib/app/export-app');
|
|
@@ -463,9 +501,9 @@ async function main() {
|
|
|
463
501
|
|
|
464
502
|
case 'import': {
|
|
465
503
|
if (args.length < 1) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
504
|
+
warn(t('cli.import_usage'));
|
|
505
|
+
warn(t('cli.import_example1'));
|
|
506
|
+
warn(t('cli.import_example2'));
|
|
469
507
|
process.exit(1);
|
|
470
508
|
}
|
|
471
509
|
const { run: runImport } = require('../lib/app/import-app');
|
|
@@ -475,8 +513,8 @@ async function main() {
|
|
|
475
513
|
|
|
476
514
|
case 'get-permission': {
|
|
477
515
|
if (args.length < 2) {
|
|
478
|
-
|
|
479
|
-
|
|
516
|
+
warn(t('cli.get_permission_usage'));
|
|
517
|
+
warn(t('cli.get_permission_example'));
|
|
480
518
|
process.exit(1);
|
|
481
519
|
}
|
|
482
520
|
const { run: runGetPermission } = require('../lib/permission/get-permission');
|
|
@@ -486,8 +524,8 @@ async function main() {
|
|
|
486
524
|
|
|
487
525
|
case 'save-permission': {
|
|
488
526
|
if (args.length < 2) {
|
|
489
|
-
|
|
490
|
-
|
|
527
|
+
warn(t('cli.save_permission_usage'));
|
|
528
|
+
warn(t('cli.save_permission_example'));
|
|
491
529
|
process.exit(1);
|
|
492
530
|
}
|
|
493
531
|
const { run: runSavePermission } = require('../lib/permission/save-permission');
|
|
@@ -497,8 +535,8 @@ async function main() {
|
|
|
497
535
|
|
|
498
536
|
case 'configure-process': {
|
|
499
537
|
if (args.length < 3) {
|
|
500
|
-
|
|
501
|
-
|
|
538
|
+
warn(t('cli.configure_process_usage'));
|
|
539
|
+
warn(t('cli.configure_process_example'));
|
|
502
540
|
process.exit(1);
|
|
503
541
|
}
|
|
504
542
|
const { run: runConfigureProcess } = require('../lib/process/configure-process');
|
|
@@ -508,8 +546,8 @@ async function main() {
|
|
|
508
546
|
|
|
509
547
|
case 'create-process': {
|
|
510
548
|
if (args.length < 2) {
|
|
511
|
-
|
|
512
|
-
|
|
549
|
+
warn(t('cli.create_process_usage'));
|
|
550
|
+
warn(t('cli.create_process_example'));
|
|
513
551
|
process.exit(1);
|
|
514
552
|
}
|
|
515
553
|
const { run: runCreateProcess } = require('../lib/process/create-process');
|
|
@@ -517,6 +555,25 @@ async function main() {
|
|
|
517
555
|
break;
|
|
518
556
|
}
|
|
519
557
|
|
|
558
|
+
case 'process': {
|
|
559
|
+
const subCommand = args[0];
|
|
560
|
+
const subArgs = args.slice(1);
|
|
561
|
+
|
|
562
|
+
if (subCommand === 'preview') {
|
|
563
|
+
if (subArgs.length < 2) {
|
|
564
|
+
warn(t('cli.process_preview_usage'));
|
|
565
|
+
warn(t('cli.process_preview_example'));
|
|
566
|
+
process.exit(1);
|
|
567
|
+
}
|
|
568
|
+
const { run: runPreviewProcess } = require('../lib/process/preview-process');
|
|
569
|
+
await runPreviewProcess(subArgs);
|
|
570
|
+
} else {
|
|
571
|
+
warn(t('cli.process_usage'));
|
|
572
|
+
process.exit(1);
|
|
573
|
+
}
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
|
|
520
577
|
case 'create-report': {
|
|
521
578
|
const { run } = require('../lib/report/create-report');
|
|
522
579
|
await run(args);
|
|
@@ -593,8 +650,8 @@ async function main() {
|
|
|
593
650
|
|
|
594
651
|
const modulePath = connectorSubCommands[subCommand];
|
|
595
652
|
if (!modulePath) {
|
|
596
|
-
|
|
597
|
-
|
|
653
|
+
warn(`未知的 connector 子命令: ${subCommand}`);
|
|
654
|
+
warn('使用 openyida connector --help 查看可用子命令');
|
|
598
655
|
process.exit(1);
|
|
599
656
|
}
|
|
600
657
|
|
|
@@ -614,7 +671,7 @@ async function main() {
|
|
|
614
671
|
const subArgs = args.slice(1); // 路由层消费 subCommand,传递剩余参数
|
|
615
672
|
|
|
616
673
|
if (!subCommand || subCommand === '--help' || subCommand === '-h') {
|
|
617
|
-
|
|
674
|
+
warn(t('cli.integration_help'));
|
|
618
675
|
break;
|
|
619
676
|
}
|
|
620
677
|
|
|
@@ -622,8 +679,8 @@ async function main() {
|
|
|
622
679
|
const { run: runIntegration } = require('../lib/integration/integration-create');
|
|
623
680
|
await runIntegration(subArgs);
|
|
624
681
|
} else {
|
|
625
|
-
|
|
626
|
-
|
|
682
|
+
warn(t('cli.integration_unknown', subCommand));
|
|
683
|
+
warn(t('cli.integration_help_hint'));
|
|
627
684
|
process.exit(1);
|
|
628
685
|
}
|
|
629
686
|
break;
|
|
@@ -659,9 +716,15 @@ async function main() {
|
|
|
659
716
|
break;
|
|
660
717
|
}
|
|
661
718
|
|
|
719
|
+
case 'update': {
|
|
720
|
+
const { runUpdate } = require('../lib/core/update');
|
|
721
|
+
await runUpdate(currentVersion);
|
|
722
|
+
break;
|
|
723
|
+
}
|
|
724
|
+
|
|
662
725
|
default: {
|
|
663
|
-
|
|
664
|
-
|
|
726
|
+
warn(t('cli.unknown_command', command));
|
|
727
|
+
warn(t('cli.run_help'));
|
|
665
728
|
process.exit(1);
|
|
666
729
|
}
|
|
667
730
|
}
|
|
@@ -670,6 +733,6 @@ async function main() {
|
|
|
670
733
|
main()
|
|
671
734
|
.then(() => updateCheckPromise)
|
|
672
735
|
.catch((err) => {
|
|
673
|
-
|
|
736
|
+
warn(t('cli.exec_failed', err.message));
|
|
674
737
|
process.exit(1);
|
|
675
738
|
});
|