openyida 2026.3.21-1 → 2026.3.22

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.
Files changed (63) hide show
  1. package/README.ar.md +2 -2
  2. package/README.de.md +2 -2
  3. package/README.es.md +2 -2
  4. package/README.fr.md +2 -2
  5. package/README.hi.md +2 -2
  6. package/README.ja.md +2 -2
  7. package/README.ko.md +2 -2
  8. package/README.md +2 -2
  9. package/README.pt-BR.md +2 -2
  10. package/README.vi.md +2 -2
  11. package/README.zh-CN.md +2 -2
  12. package/README.zh-HK.md +2 -2
  13. package/README.zh-TW.md +2 -2
  14. package/bin/yida.js +19 -0
  15. package/lib/app/create-form.js +28 -51
  16. package/lib/app/create-page.js +65 -19
  17. package/lib/app/datasource-utils.js +326 -0
  18. package/lib/connector/connector-create.js +0 -1
  19. package/lib/connector/connector-delete.js +1 -1
  20. package/lib/connector/connector-test.js +0 -1
  21. package/lib/core/copy.js +105 -83
  22. package/lib/core/env.js +1 -1
  23. package/lib/core/locales/ar.js +9 -0
  24. package/lib/core/locales/de.js +9 -0
  25. package/lib/core/locales/en.js +9 -0
  26. package/lib/core/locales/es.js +9 -0
  27. package/lib/core/locales/fr.js +9 -0
  28. package/lib/core/locales/hi.js +9 -0
  29. package/lib/core/locales/ja.js +9 -0
  30. package/lib/core/locales/ko.js +9 -0
  31. package/lib/core/locales/pt.js +9 -0
  32. package/lib/core/locales/vi.js +9 -0
  33. package/lib/core/locales/zh-TW.js +9 -0
  34. package/lib/core/locales/zh.js +9 -0
  35. package/lib/core/utils.js +3 -3
  36. package/lib/integration/integration-api.js +239 -0
  37. package/lib/integration/integration-create.js +393 -0
  38. package/lib/integration/integration-node-ids.js +81 -0
  39. package/lib/integration/integration-process-builder.js +291 -0
  40. package/lib/integration/integration-view-builder.js +311 -0
  41. package/lib/report/chart-builder.js +192 -70
  42. package/lib/report/constants.js +79 -0
  43. package/package.json +15 -4
  44. package/scripts/update-contributors.js +152 -0
  45. package/scripts/write_dashboard.py +498 -0
  46. package/yida-skills/SKILL.md +15 -4
  47. package/yida-skills/reference/connector-datasource.md +387 -0
  48. package/yida-skills/reference/vc-yida-report-components-doc.md +615 -0
  49. package/yida-skills/skills/yida-chart/SKILL.md +1525 -0
  50. package/yida-skills/skills/yida-chart/examples/china-map.js +457 -0
  51. package/yida-skills/skills/yida-chart/examples/dashboard-bindform.js +524 -0
  52. package/yida-skills/skills/yida-chart/examples/line-trend.js +391 -0
  53. package/yida-skills/skills/yida-chart/examples/multi-bar-compare.js +331 -0
  54. package/yida-skills/skills/yida-chart/examples/radar-chart.js +430 -0
  55. package/yida-skills/skills/yida-chart/examples/scatter-bindform.js +400 -0
  56. package/yida-skills/skills/yida-chart/examples/stacked-area.js +357 -0
  57. package/yida-skills/skills/yida-connector/SKILL.md +45 -96
  58. package/yida-skills/skills/yida-create-report/SKILL.md +338 -0
  59. package/yida-skills/skills/yida-custom-page/SKILL.md +2 -0
  60. package/yida-skills/skills/yida-integration/SKILL.md +561 -0
  61. package/yida-skills/skills/yida-ppt-slider/SKILL.md +441 -0
  62. package/yida-skills/skills/yida-report/SKILL.md +774 -0
  63. package/yida-skills/skills/yida-report/build-yida-report-schema.js +1284 -0
package/README.ar.md CHANGED
@@ -162,7 +162,7 @@ npx clawhub@latest install nicky1108/yida-app
162
162
 
163
163
  شكراً لجميع من ساهموا في OpenYida! اقرأ [دليل المساهمة](./CONTRIBUTING.md) للمشاركة.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ npx clawhub@latest install nicky1108/yida-app
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.de.md CHANGED
@@ -162,7 +162,7 @@ Scannen Sie den QR-Code, um der OpenYida-Benutzergruppe auf DingTalk beizutreten
162
162
 
163
163
  Danke an alle, die zu OpenYida beigetragen haben! Lesen Sie den [Beitragsleitfaden](./CONTRIBUTING.md).
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ Danke an alle, die zu OpenYida beigetragen haben! Lesen Sie den [Beitragsleitfad
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.es.md CHANGED
@@ -162,7 +162,7 @@ Escanea el código QR para unirte al grupo de usuarios de OpenYida en DingTalk.
162
162
 
163
163
  ¡Gracias a todos los que han contribuido a OpenYida! Lee la [Guía de contribución](./CONTRIBUTING.md) para participar.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ Escanea el código QR para unirte al grupo de usuarios de OpenYida en DingTalk.
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.fr.md CHANGED
@@ -162,7 +162,7 @@ Scannez le QR code pour rejoindre le groupe d'utilisateurs OpenYida sur DingTalk
162
162
 
163
163
  Merci à tous ceux qui ont contribué à OpenYida ! Lisez le [Guide de contribution](./CONTRIBUTING.md) pour participer.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ Merci à tous ceux qui ont contribué à OpenYida ! Lisez le [Guide de contribut
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.hi.md CHANGED
@@ -162,7 +162,7 @@ DingTalk पर OpenYida उपयोगकर्ता समूह में
162
162
 
163
163
  OpenYida में योगदान देने वाले सभी लोगों का धन्यवाद! [योगदान गाइड](./CONTRIBUTING.md) पढ़ें।
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ OpenYida में योगदान देने वाले सभी लो
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.ja.md CHANGED
@@ -162,7 +162,7 @@ DingTalkのQRコードをスキャンしてOpenYidaユーザーグループに
162
162
 
163
163
  OpenYidaに貢献してくださったすべての方に感謝します![コントリビュートガイド](./CONTRIBUTING.md)をお読みください。
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ OpenYidaに貢献してくださったすべての方に感謝します![コ
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.ko.md CHANGED
@@ -162,7 +162,7 @@ DingTalk QR 코드를 스캔하여 OpenYida 사용자 그룹에 참여하고 최
162
162
 
163
163
  OpenYida에 기여해주신 모든 분들께 감사드립니다! [기여 가이드](./CONTRIBUTING.md)를 읽고 함께 만들어가요.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ OpenYida에 기여해주신 모든 분들께 감사드립니다! [기여 가이
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.md CHANGED
@@ -201,7 +201,7 @@ Scan the QR code to join the OpenYida user group on DingTalk for the latest upda
201
201
 
202
202
  Thanks to everyone who has contributed to OpenYida! Read the [Contributing Guide](./CONTRIBUTING.md) to get involved.
203
203
 
204
- <p align="left">
204
+ <p align="left" id="contributors">
205
205
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
206
206
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
207
207
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -212,7 +212,7 @@ Thanks to everyone who has contributed to OpenYida! Read the [Contributing Guide
212
212
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
213
213
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
214
214
  <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
215
- <a href="https://github.com/guchenglin111"><img src="https://avatars.githubusercontent.com/u/10860875?v=4&s=48" width="48" height="48" alt="guchenglin111" title="guchenglin111"/></a>
215
+ <a href="https://github.com/guchenglin111"><img src="https://avatars.githubusercontent.com/u/10860875?v=4&s=48" width="48" height="48" alt="guchenglin111" title="guchenglin111"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
216
216
  </p>
217
217
 
218
218
  ---
package/README.pt-BR.md CHANGED
@@ -162,7 +162,7 @@ Escaneie o QR code para entrar no grupo de usuários do OpenYida no DingTalk.
162
162
 
163
163
  Obrigado a todos que contribuíram para o OpenYida! Leia o [Guia de contribuição](./CONTRIBUTING.md) para participar.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ Obrigado a todos que contribuíram para o OpenYida! Leia o [Guia de contribuiç
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.vi.md CHANGED
@@ -162,7 +162,7 @@ Quét mã QR để tham gia nhóm người dùng OpenYida trên DingTalk.
162
162
 
163
163
  Cảm ơn tất cả những người đã đóng góp cho OpenYida! Đọc [Hướng dẫn đóng góp](./CONTRIBUTING.md) để tham gia.
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ Cảm ơn tất cả những người đã đóng góp cho OpenYida! Đọc [Hư
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.zh-CN.md CHANGED
@@ -162,7 +162,7 @@ npx clawhub@latest install nicky1108/yida-app
162
162
 
163
163
  感谢所有为 OpenYida 做出贡献的开发者!欢迎阅读 [贡献指南](./CONTRIBUTING.md) 参与共建。
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ npx clawhub@latest install nicky1108/yida-app
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.zh-HK.md CHANGED
@@ -162,7 +162,7 @@ npx clawhub@latest install nicky1108/yida-app
162
162
 
163
163
  多謝所有為 OpenYida 做出貢獻嘅開發者!歡迎閱讀 [貢獻指南](./CONTRIBUTING.md) 參與共建。
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ npx clawhub@latest install nicky1108/yida-app
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/README.zh-TW.md CHANGED
@@ -162,7 +162,7 @@ npx clawhub@latest install nicky1108/yida-app
162
162
 
163
163
  感謝所有為 OpenYida 做出貢獻的開發者!歡迎閱讀 [貢獻指南](./CONTRIBUTING.md) 參與共建。
164
164
 
165
- <p align="left">
165
+ <p align="left" id="contributors">
166
166
  <a href="https://github.com/yize"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="九神" title="九神"/></a>
167
167
  <a href="https://github.com/alex-mm"><img src="https://avatars.githubusercontent.com/u/3302053?v=4&s=48" width="48" height="48" alt="天晟" title="天晟"/></a>
168
168
  <a href="https://github.com/nicky1108"><img src="https://avatars.githubusercontent.com/u/4279283?v=4&s=48" width="48" height="48" alt="nicky1108" title="nicky1108"/></a>
@@ -172,7 +172,7 @@ npx clawhub@latest install nicky1108/yida-app
172
172
  <a href="https://github.com/kangjiano"><img src="https://avatars.githubusercontent.com/u/54129385?v=4&s=48" width="48" height="48" alt="kangjiano" title="kangjiano"/></a>
173
173
  <a href="https://github.com/ElZe98"><img src="https://avatars.githubusercontent.com/u/35736727?v=4&s=48" width="48" height="48" alt="ElZe98" title="ElZe98"/></a>
174
174
  <a href="https://github.com/OAHyuhao"><img src="https://avatars.githubusercontent.com/u/99954323?v=4&s=48" width="48" height="48" alt="OAHyuhao" title="OAHyuhao"/></a>
175
- <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a>
175
+ <a href="https://github.com/xiaofu704"><img src="https://avatars.githubusercontent.com/u/209416122?v=4&s=48" width="48" height="48" alt="xiaofu704" title="xiaofu704"/></a> <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/15044477?v=4&s=48" width="48" height="48" alt="liug0911" title="liug0911"/></a> <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> <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>
176
176
  </p>
177
177
 
178
178
  ---
package/bin/yida.js CHANGED
@@ -485,6 +485,25 @@ async function main() {
485
485
  break;
486
486
  }
487
487
 
488
+ case 'integration': {
489
+ const subCommand = args[0];
490
+
491
+ if (!subCommand || subCommand === '--help' || subCommand === '-h') {
492
+ console.error(t('cli.integration_help'));
493
+ break;
494
+ }
495
+
496
+ if (subCommand === 'create') {
497
+ const { run: runIntegration } = require('../lib/integration/integration-create');
498
+ await runIntegration(args);
499
+ } else {
500
+ console.error(t('cli.integration_unknown', subCommand));
501
+ console.error(t('cli.integration_help_hint'));
502
+ process.exit(1);
503
+ }
504
+ break;
505
+ }
506
+
488
507
  default: {
489
508
  console.error(t('cli.unknown_command', command));
490
509
  console.error(t('cli.run_help'));
@@ -63,8 +63,8 @@ const path = require('path');
63
63
  const querystring = require('querystring');
64
64
  const { loadCookieData, triggerLogin, refreshCsrfToken, resolveBaseUrl, isLoginExpired, isCsrfTokenExpired } = require('../core/utils');
65
65
  const { t } = require('../core/i18n');
66
+ const { buildDataSourceList, parseDatasourceArg, enrichDatasourceDefinitionsWithConnectionLabels } = require('./datasource-utils');
66
67
 
67
- // ── 配置读取 ──────────────────────────────────────────
68
68
  // ── 选项类字段类型 ───────────────────────────────────
69
69
  const OPTION_FIELD_TYPES = ['RadioField', 'SelectField', 'CheckboxField', 'MultiSelectField'];
70
70
 
@@ -102,7 +102,7 @@ function parseArgs() {
102
102
  // 复制一份 args 用于解析(避免修改原始数组影响后续处理)
103
103
  const args = [...rawArgs];
104
104
 
105
- // 解析 --layout, --theme, --label-align 参数
105
+ // 解析 --layout, --theme, --label-align, --datasource 参数
106
106
  for (let i = 0; i < args.length; i++) {
107
107
  if (args[i] === '--layout' && i + 1 < args.length) {
108
108
  options.layout = args[i + 1];
@@ -116,6 +116,10 @@ function parseArgs() {
116
116
  options.labelAlign = args[i + 1];
117
117
  args.splice(i, 2);
118
118
  i--;
119
+ } else if (args[i] === '--datasource' && i + 1 < args.length) {
120
+ options.datasource = args[i + 1];
121
+ args.splice(i, 2);
122
+ i--;
119
123
  }
120
124
  }
121
125
 
@@ -171,13 +175,14 @@ function parseArgs() {
171
175
  process.exit(1);
172
176
  }
173
177
 
178
+ // ── 登录态管理 ───────────────────────────────────────
179
+
174
180
 
175
181
  // ── 读取字段定义 ─────────────────────────────────────
176
182
 
177
183
  function readFieldsDefinition(fieldsJsonOrFile) {
178
184
  let rawContent;
179
185
 
180
- // 判断是 JSON 字符串还是文件路径
181
186
  if (fieldsJsonOrFile.trimStart().startsWith('[')) {
182
187
  rawContent = fieldsJsonOrFile;
183
188
  } else if (fieldsJsonOrFile.trimStart().startsWith('{')) {
@@ -193,12 +198,8 @@ function readFieldsDefinition(fieldsJsonOrFile) {
193
198
 
194
199
  try {
195
200
  const parsed = JSON.parse(rawContent);
196
-
197
- // 支持两种格式:
198
- // 1. 数组格式: [{type: "TextField", label: "姓名"}, ...]
199
- // 2. 对象格式: { columns: 2, fields: [{type: "TextField", label: "姓名"}, ...] }
200
201
  let fields;
201
- let columns = 1; // 默认单列
202
+ let columns = 1;
202
203
 
203
204
  if (Array.isArray(parsed)) {
204
205
  fields = parsed;
@@ -221,6 +222,7 @@ function readFieldsDefinition(fieldsJsonOrFile) {
221
222
  }
222
223
 
223
224
  // ── 读取修改定义(update 模式) ─────────────────────
225
+
224
226
  function readChangesDefinition(changesJsonOrFile) {
225
227
  let rawContent;
226
228
 
@@ -293,47 +295,10 @@ function buildOptionDataSource(options) {
293
295
  });
294
296
  }
295
297
 
296
- // ── 字段类型名容错映射 ───────────────────────────────
297
- // 宜搭后端枚举对大小写敏感,此映射自动纠正常见的拼写差异
298
- const FIELD_TYPE_ALIAS = {
299
- TextAreaField: 'TextareaField',
300
- Textareafield: 'TextareaField',
301
- textareaField: 'TextareaField',
302
- textAreaField: 'TextareaField',
303
- Textfield: 'TextField',
304
- textfield: 'TextField',
305
- Numberfield: 'NumberField',
306
- numberfield: 'NumberField',
307
- Selectfield: 'SelectField',
308
- selectfield: 'SelectField',
309
- Radiofield: 'RadioField',
310
- radiofield: 'RadioField',
311
- Checkboxfield: 'CheckboxField',
312
- checkboxfield: 'CheckboxField',
313
- Datefield: 'DateField',
314
- datefield: 'DateField',
315
- Tablefield: 'TableField',
316
- tablefield: 'TableField',
317
- Ratefield: 'RateField',
318
- ratefield: 'RateField',
319
- Imagefield: 'ImageField',
320
- imagefield: 'ImageField',
321
- Attachmentfield: 'AttachmentField',
322
- attachmentfield: 'AttachmentField',
323
- Employeefield: 'EmployeeField',
324
- employeefield: 'EmployeeField',
325
- MultiSelectfield: 'MultiSelectField',
326
- Multiselectfield: 'MultiSelectField',
327
- multiselectfield: 'MultiSelectField',
328
- SerialNumberfield: 'SerialNumberField',
329
- Serialnumberfield: 'SerialNumberField',
330
- serialnumberfield: 'SerialNumberField',
331
- };
332
-
333
298
  // ── 生成字段组件 ─────────────────────────────────────
334
299
 
335
300
  function buildFieldComponent(field) {
336
- const componentName = FIELD_TYPE_ALIAS[field.type] || field.type;
301
+ const componentName = field.type;
337
302
  const fieldId = generateFieldId(componentName);
338
303
  const nodeId = nextNodeId();
339
304
 
@@ -1211,7 +1176,7 @@ function buildGroupedFieldComponents(fields, formLayout) {
1211
1176
 
1212
1177
  // ── 生成表单 Schema ──────────────────────────────────
1213
1178
 
1214
- function buildFormSchema(formTitle, fields, formUuid, corpId, appType, layout, theme, labelAlign) {
1179
+ function buildFormSchema(formTitle, fields, formUuid, corpId, appType, layout, theme, labelAlign, datasourceDefinitions, csrfToken) {
1215
1180
  // 解析布局配置
1216
1181
  const layoutConfig = getLayoutConfig(layout || 'single');
1217
1182
  const columns = layoutConfig.columns;
@@ -1304,8 +1269,8 @@ function buildFormSchema(formTitle, fields, formUuid, corpId, appType, layout, t
1304
1269
  error: {},
1305
1270
  },
1306
1271
  },
1307
- online: [],
1308
- list: [],
1272
+ online: buildDataSourceList(datasourceDefinitions || [], formUuid, csrfToken),
1273
+ list: buildDataSourceList(datasourceDefinitions || [], formUuid, csrfToken),
1309
1274
  sync: true,
1310
1275
  },
1311
1276
  lifeCycles: {
@@ -2192,7 +2157,7 @@ async function saveSchemaAndUpdateConfig(authRef, appType, formUuid, schema, ver
2192
2157
  // ── create 模式主流程 ─────────────────────────────────
2193
2158
 
2194
2159
  async function mainCreate(parsedArgs, csrfToken, cookies, baseUrl, cookieData) {
2195
- const { appType, formTitle, fieldsJsonOrFile, layout, theme, labelAlign } = parsedArgs;
2160
+ const { appType, formTitle, fieldsJsonOrFile, layout, theme, labelAlign, datasource } = parsedArgs;
2196
2161
 
2197
2162
  const SEP = '='.repeat(50);
2198
2163
  console.error(SEP);
@@ -2243,7 +2208,19 @@ async function mainCreate(parsedArgs, csrfToken, cookies, baseUrl, cookieData) {
2243
2208
  console.error(t('create_form.corp_id_ok', corpId));
2244
2209
  }
2245
2210
 
2246
- const schema = buildFormSchema(formTitle, fields, formUuid, corpId, appType, layout, theme, labelAlign);
2211
+ const datasourceDefinitions = parseDatasourceArg(datasource || null);
2212
+ if (datasourceDefinitions.length > 0) {
2213
+ console.error(t('create_form.datasource_count', datasourceDefinitions.length));
2214
+ // 自动查询鉴权账号名称,填充 connectionLabel(有 connectionId 但缺少 connectionLabel 时)
2215
+ await enrichDatasourceDefinitionsWithConnectionLabels(
2216
+ datasourceDefinitions,
2217
+ authRef.baseUrl,
2218
+ authRef.csrfToken,
2219
+ authRef.cookies
2220
+ );
2221
+ }
2222
+
2223
+ const schema = buildFormSchema(formTitle, fields, formUuid, corpId, appType, layout, theme, labelAlign, datasourceDefinitions, authRef.csrfToken);
2247
2224
  const { configResult } = await saveSchemaAndUpdateConfig(authRef, appType, formUuid, schema, 1, 4);
2248
2225
 
2249
2226
  // 输出结果
@@ -1,7 +1,11 @@
1
1
  /**
2
2
  * create-page.js - 宜搭自定义页面创建命令
3
3
  *
4
- * 用法:yidacli create-page <appType> "<pageName>"
4
+ * 用法:yidacli create-page <appType> "<pageName>" [--datasource <jsonOrFile>]
5
+ *
6
+ * --datasource 参数(可选):JSON 字符串或文件路径,用于在页面创建后注入连接器数据源。
7
+ * 数据源定义格式:
8
+ * [{ "id": "myApi", "connectorId": "G-CONN-xxx", "actionId": "G-ACT-xxx" }]
5
9
  */
6
10
 
7
11
  'use strict';
@@ -15,16 +19,21 @@ const {
15
19
  requestWithAutoLogin,
16
20
  } = require('../core/utils');
17
21
  const { t } = require('../core/i18n');
22
+ const { buildDataSourceList, parseDatasourceArg, extractDatasourceArg } = require('./datasource-utils');
18
23
 
19
24
  async function run(args) {
20
- if (args.length < 2) {
25
+ // 从参数中提取 --datasource 选项(会原地修改 args 数组)
26
+ const mutableArgs = [...args];
27
+ const datasourceArg = extractDatasourceArg(mutableArgs);
28
+
29
+ if (mutableArgs.length < 2) {
21
30
  console.error(t('create_page.usage'));
22
31
  console.error(t('create_page.example'));
23
32
  process.exit(1);
24
33
  }
25
34
 
26
- const appType = args[0];
27
- const pageName = args[1];
35
+ const appType = mutableArgs[0];
36
+ const pageName = mutableArgs[1];
28
37
 
29
38
  const SEP = '='.repeat(50);
30
39
  console.error(SEP);
@@ -67,26 +76,63 @@ async function run(args) {
67
76
  );
68
77
  }, authRef);
69
78
 
70
- // 输出结果
71
- const SEP2 = '='.repeat(50);
72
- console.error('\n' + SEP2);
73
- if (response && response.success && response.content) {
74
- const pageId = response.content.formUuid || response.content;
75
- const pageUrl = `${authRef.baseUrl}/${appType}/workbench/${pageId}`;
76
-
77
- console.error(t('create_page.success'));
78
- console.error(t('create_page.page_id_label', pageId));
79
- console.error(t('create_page.url_label', pageUrl));
80
- console.error(SEP2);
81
-
82
- console.log(JSON.stringify({ success: true, pageId, pageName, appType, url: pageUrl }));
83
- } else {
79
+ if (!response || !response.success || !response.content) {
84
80
  const errorMsg = response ? response.errorMsg || t('common.unknown_error') : t('common.request_failed');
85
81
  console.error(t('create_page.failed', errorMsg));
86
- console.error(SEP2);
82
+ console.error('='.repeat(50));
87
83
  console.log(JSON.stringify({ success: false, error: errorMsg }));
88
84
  process.exit(1);
89
85
  }
86
+
87
+ const pageId = response.content.formUuid || response.content;
88
+ const pageUrl = `${authRef.baseUrl}/${appType}/workbench/${pageId}`;
89
+
90
+ // Step 3: 注入连接器数据源(如果提供了 --datasource 参数)
91
+ const datasourceDefinitions = parseDatasourceArg(datasourceArg);
92
+ if (datasourceDefinitions.length > 0) {
93
+ console.error(`[datasource] 正在注入 ${datasourceDefinitions.length} 个连接器数据源...`);
94
+
95
+ const dataSourceList = buildDataSourceList(datasourceDefinitions);
96
+ const schema = {
97
+ schemaType: 'superform',
98
+ schemaVersion: '5.0',
99
+ dataSourceList: dataSourceList,
100
+ };
101
+
102
+ const saveSchemaResponse = await requestWithAutoLogin((auth) => {
103
+ const postData = querystring.stringify({
104
+ _csrf_token: auth.csrfToken,
105
+ formUuid: pageId,
106
+ schemaVersion: 1,
107
+ content: JSON.stringify(schema),
108
+ });
109
+ return httpPost(
110
+ auth.baseUrl,
111
+ `/dingtalk/web/${appType}/query/formdesign/saveFormSchema.json`,
112
+ postData,
113
+ auth.cookies
114
+ );
115
+ }, authRef);
116
+
117
+ if (saveSchemaResponse && saveSchemaResponse.success) {
118
+ console.error('[datasource] 数据源注入成功');
119
+ } else {
120
+ const schemaErrorMsg = saveSchemaResponse
121
+ ? saveSchemaResponse.errorMsg || t('common.unknown_error')
122
+ : t('common.request_failed');
123
+ console.error(`[datasource] 数据源注入失败:${schemaErrorMsg}`);
124
+ }
125
+ }
126
+
127
+ // 输出结果
128
+ const SEP2 = '='.repeat(50);
129
+ console.error('\n' + SEP2);
130
+ console.error(t('create_page.success'));
131
+ console.error(t('create_page.page_id_label', pageId));
132
+ console.error(t('create_page.url_label', pageUrl));
133
+ console.error(SEP2);
134
+
135
+ console.log(JSON.stringify({ success: true, pageId, pageName, appType, url: pageUrl }));
90
136
  }
91
137
 
92
138
  module.exports = { run };