@microi.net/cli 5.8.4 → 5.8.6

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 (212) hide show
  1. package/.codebuddy-plugin/marketplace.json +2 -2
  2. package/.codebuddy-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.mcp.json +1 -1
  5. package/.workbuddy-plugin/marketplace.json +2 -2
  6. package/.workbuddy-plugin/plugin.json +1 -1
  7. package/LICENSE +21 -21
  8. package/README.md +71 -71
  9. package/assets/build-meta.json +7 -7
  10. package/assets/feature-matrix.json +138 -138
  11. package/assets/logo.svg +4 -4
  12. package/cordis.patch.yml +1 -1
  13. package/package.json +1 -1
  14. package/scripts/codex-marketplace.json +20 -20
  15. package/scripts/mcp-codex-stdio-adapter.js +189 -189
  16. package/scripts/mcp-server.js +5 -0
  17. package/scripts/mcp-trae-windows-launcher.cmd +21 -21
  18. package/scripts/microi-cli-mcp.js +7 -7
  19. package/scripts/microi-cli.js +67 -66
  20. package/scripts/microi-codex-broker.js +450 -450
  21. package/scripts/microi-codex-router.js +618 -582
  22. package/scripts/microi-skills.meta.json +384 -384
  23. package/skills/.microi-skills-version.json +2 -2
  24. package/skills/.progressive-disclosure-manifest.json +3566 -3566
  25. package/skills/README.md +287 -287
  26. package/skills/ai-engine/SKILL.md +269 -265
  27. package/skills/ai-engine/agents/openai.yaml +4 -4
  28. package/skills/ai-engine/references/ai-employees.md +48 -48
  29. package/skills/ai-engine/references/self-hosted-digital-human.md +59 -59
  30. package/skills/ai-platform-governance/SKILL.md +177 -177
  31. package/skills/ai-platform-governance/references/progressive-01-/345/212/237/350/203/275/345/274/200/345/205/263.md +190 -190
  32. package/skills/app-store/SKILL.md +525 -525
  33. package/skills/app-store/agents/openai.yaml +4 -4
  34. package/skills/business-blueprint/SKILL.md +193 -193
  35. package/skills/datasource-engine/SKILL.md +93 -93
  36. package/skills/datasource-engine/agents/openai.yaml +4 -4
  37. package/skills/dos-orm/SKILL.md +97 -97
  38. package/skills/dos-orm/references/api-reference.md +229 -229
  39. package/skills/email-engine/SKILL.md +81 -81
  40. package/skills/email-engine/references/v8-email.md +34 -34
  41. package/skills/job-engine/SKILL.md +176 -176
  42. package/skills/job-engine/agents/openai.yaml +4 -4
  43. package/skills/message-notification/SKILL.md +156 -156
  44. package/skills/message-notification/agents/openai.yaml +5 -5
  45. package/skills/message-notification/references/contracts.md +102 -102
  46. package/skills/microi/SKILL.md +14 -14
  47. package/skills/microi-ai-app-auth.js +652 -652
  48. package/skills/microi-ai-application/SKILL.md +115 -115
  49. package/skills/microi-ai-application/agents/openai.yaml +4 -4
  50. package/skills/microi-ai-application/references/frontend-baseline.md +164 -164
  51. package/skills/microi-client-frontend/SKILL.md +244 -244
  52. package/skills/microi-client-frontend/references/progressive-01-3-/345/212/250/346/200/201/346/214/211/351/222/256/347/263/273/347/273/237.md +144 -144
  53. package/skills/microi-client-frontend/references/progressive-02-8-/350/277/220/350/241/214/346/227/266/351/253/230/351/242/221/345/235/221/345/244/215/347/233/230.md +196 -196
  54. package/skills/microi-client-frontend/references/progressive-03-vue3-/345/211/215/347/253/257/345/276/256/346/234/215/345/212/241/345/256/277/344/270/273/350/247/204/345/210/231.md +167 -167
  55. package/skills/microi-codex/SKILL.md +102 -100
  56. package/skills/microi-codex-installer/SKILL.md +231 -227
  57. package/skills/microi-codex-installer/agents/openai.yaml +7 -7
  58. package/skills/microi-datasource-mapping/SKILL.md +122 -122
  59. package/skills/microi-db-schema/SKILL.md +175 -175
  60. package/skills/microi-db-schema/agents/openai.yaml +4 -4
  61. package/skills/microi-db-schema/references/core-tables.md +695 -695
  62. package/skills/microi-db-schema/references/form-component-options.md +256 -256
  63. package/skills/microi-db-schema/references/schema-overview.md +202 -202
  64. package/skills/microi-db-schema/references/schema.md +646 -646
  65. package/skills/microi-db-schema/references/table-catalog.md +1599 -1599
  66. package/skills/microi-deployment/SKILL.md +221 -221
  67. package/skills/microi-deployment/references/deployment-matrix.md +109 -109
  68. package/skills/microi-docs-coverage/SKILL.md +133 -133
  69. package/skills/microi-docs-coverage/references/capability-map.md +91 -91
  70. package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
  71. package/skills/microi-form-engine/SKILL.md +333 -333
  72. package/skills/microi-form-engine/references/component-catalog.md +218 -218
  73. package/skills/microi-form-engine/references/data-source-events.md +124 -124
  74. package/skills/microi-form-layout/SKILL.md +205 -205
  75. package/skills/microi-form-layout/references/progressive-01-3-/344/270/211/347/247/215/345/210/206/347/273/204/347/232/204/345/255/230/345/202/250/344/270/216/351/205/215/347/275/256.md +235 -235
  76. package/skills/microi-frontend-sdk/SKILL.md +194 -194
  77. package/skills/microi-frontend-sdk/references/progressive-01-token-/345/275/223/345/211/215/347/231/273/345/275/225/347/224/250/346/210/267/344/270/216/345/275/223/345/211/215/347/273/210/347/253/257/347/231/273/345/275/225/345/215/217/350/256/256.md +176 -176
  78. package/skills/microi-left-right-layout/SKILL.md +141 -141
  79. package/skills/microi-microservice/SKILL.md +326 -324
  80. package/skills/microi-microservice/references/runtime-delivery.md +278 -278
  81. package/skills/microi-mobile-app-quality/SKILL.md +185 -185
  82. package/skills/microi-mobile-app-quality/references/progressive-01-4-/351/207/215/350/246/201/346/214/211/351/222/256/345/277/205/351/241/273/345/270/246/345/233/276/346/240/207.md +213 -213
  83. package/skills/microi-mobile-app-quality/references/progressive-02-9-/344/270/273/351/242/230/345/210/207/346/215/242/345/277/205/351/241/273/347/234/237/345/256/236/344/270/224/345/205/250/345/261/200/347/224/237/346/225/210.md +128 -128
  84. package/skills/microi-solution-quotation/SKILL.md +78 -78
  85. package/skills/microi-solution-quotation/agents/openai.yaml +4 -4
  86. package/skills/microi-solution-quotation/scripts/build_solution_quote.py +296 -296
  87. package/skills/microi-sso/SKILL.md +92 -92
  88. package/skills/microi-sso/references/acceptance.md +49 -49
  89. package/skills/microi-sso/references/configuration-and-security.md +53 -53
  90. package/skills/microi-sso/references/inbound.md +53 -53
  91. package/skills/microi-sso/references/outbound.md +39 -39
  92. package/skills/microi-system-delivery/SKILL.md +137 -137
  93. package/skills/microi-system-delivery/references/progressive-01-/346/240/207/345/207/206/345/267/245/344/275/234/346/265/201.md +193 -193
  94. package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +217 -217
  95. package/skills/microi-ui/SKILL.md +192 -192
  96. package/skills/microi-ui/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/234/272/346/231/257/350/223/235/345/233/276.md +183 -183
  97. package/skills/microi-uniapp-frontend/SKILL.md +193 -193
  98. package/skills/microi-uniapp-frontend/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/210/206/347/261/273-/345/217/214/346/240/217/345/210/227/350/241/250/347/213/254/347/253/213/346/273/232/345/212/250.md +225 -225
  99. package/skills/microi-uniapp-frontend/references/progressive-02-/345/205/263/351/224/256/344/270/232/345/212/241/350/265/204/344/272/247/344/270/215/345/276/227/351/273/230/350/256/244/351/200/211/344/270/255.md +154 -154
  100. package/skills/microi.v8.js +1921 -1921
  101. package/skills/module-engine/SKILL.md +255 -255
  102. package/skills/module-engine/references/module-config.md +204 -204
  103. package/skills/ocr-engine/SKILL.md +113 -113
  104. package/skills/ocr-engine/agents/openai.yaml +4 -4
  105. package/skills/page-engine/SKILL.md +206 -206
  106. package/skills/page-engine/examples/compact-dashboard.json +1444 -1444
  107. package/skills/page-engine/references/progressive-01-/346/211/200/346/234/211/347/273/204/344/273/266/347/261/273/345/236/213.md +234 -234
  108. package/skills/page-engine/references/progressive-02-/347/211/210/346/234/254/345/216/206/345/217/262-/345/271/266/345/217/221/344/277/235/345/255/230/344/270/216/345/233/236/346/273/232.md +60 -60
  109. package/skills/performance-testing/SKILL.md +221 -221
  110. package/skills/playwright-e2e/SKILL.md +196 -196
  111. package/skills/playwright-e2e/references/progressive-01-/345/205/250/350/207/252/345/212/250/347/231/273/345/275/225-/345/205/215/351/252/214/350/257/201/347/240/201-/344/275/206/344/270/215/345/205/215/345/257/206/347/240/201-/345/277/205/350/257/273.md +173 -173
  112. package/skills/playwright-e2e/references/progressive-02-/346/226/207/345/255/227/345/257/271/346/257/224/345/272/246/344/270/216/345/217/257/350/257/273/346/200/247/350/207/252/345/212/250/345/214/226/346/243/200/346/237/245-/345/277/205/345/201/232.md +183 -183
  113. package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +221 -221
  114. package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +115 -115
  115. package/skills/print-engine/SKILL.md +259 -259
  116. package/skills/production-readonly-audit/SKILL.md +41 -41
  117. package/skills/report-engine/SKILL.md +71 -71
  118. package/skills/report-engine/agents/openai.yaml +4 -4
  119. package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
  120. package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
  121. package/skills/scripts/sync-embedded-skills.mjs +46 -46
  122. package/skills/scripts/validate-progressive-disclosure.mjs +57 -57
  123. package/skills/search-engine/SKILL.md +75 -75
  124. package/skills/search-engine/agents/openai.yaml +4 -4
  125. package/skills/spider-engine/SKILL.md +190 -190
  126. package/skills/system-observability/SKILL.md +248 -248
  127. package/skills/system-observability/references/memory-incident-triage.md +77 -77
  128. package/skills/translate-engine/SKILL.md +140 -140
  129. package/skills/translate-engine/agents/openai.yaml +4 -4
  130. package/skills/ui-design/SKILL.md +223 -223
  131. package/skills/ui-design/assets/pattern-showcase/app.js +54 -54
  132. package/skills/ui-design/assets/pattern-showcase/index.html +163 -163
  133. package/skills/ui-design/assets/pattern-showcase/styles.css +311 -311
  134. package/skills/ui-design/assets/templates/MCI-DESIGN.md +206 -206
  135. package/skills/ui-design/references/design-pattern-library.md +184 -184
  136. package/skills/ui-design/references/mci-design-contract.md +163 -163
  137. package/skills/ui-design/references/motion-and-media.md +78 -78
  138. package/skills/ui-design/references/product-flow-recipes.md +94 -94
  139. package/skills/ui-design/references/progressive-01-/351/242/234/350/211/262/344/275/223/347/263/273-css-variables-/346/224/257/346/214/201/344/270/273/351/242/230/345/210/207/346/215/242.md +218 -218
  140. package/skills/ui-design/references/progressive-02-/345/255/227/344/275/223.md +164 -164
  141. package/skills/ui-design/references/progressive-03-/345/212/250/346/225/210/350/247/204/350/214/203-/344/270/260/345/257/214/344/275/206/344/270/215/345/215/241.md +235 -235
  142. package/skills/ui-design/references/progressive-04-/347/273/204/344/273/266/351/243/216/346/240/274/351/200/237/346/237/245.md +152 -152
  143. package/skills/ui-design/references/progressive-05-/347/247/273/345/212/250/347/253/257/344/270/223/347/224/250/350/247/204/350/214/203.md +238 -238
  144. package/skills/ui-design/references/progressive-06-/344/270/273/351/242/230/345/210/207/346/215/242/345/256/236/347/216/260.md +194 -194
  145. package/skills/ui-design/references/progressive-07-/351/200/237/346/237/245-/344/273/216/345/244/264/346/220/255/345/273/272/344/270/200/344/270/252/347/247/273/345/212/250/347/253/257/351/241/265/351/235/242.md +207 -207
  146. package/skills/ui-design/references/progressive-08-/350/241/250/345/215/225/345/210/206/347/273/204/350/247/204/350/214/203-tabs-vs-collapsegroup-/345/274/272/345/210/266.md +142 -142
  147. package/skills/uniapp-mall-assets/SKILL.md +176 -176
  148. package/skills/unity-integration/SKILL.md +171 -171
  149. package/skills/unity-integration/agents/openai.yaml +4 -4
  150. package/skills/unity-integration/references/ai-app-delivery.md +119 -119
  151. package/skills/unity-integration/references/sdk-api.md +82 -82
  152. package/skills/unity-integration/references/toolbox-migration.md +66 -66
  153. package/skills/unity-integration/references/webgl-hosting.md +57 -57
  154. package/skills/v8-api-config/SKILL.md +388 -388
  155. package/skills/v8-cache-pattern/SKILL.md +312 -312
  156. package/skills/v8-crud-api/SKILL.md +178 -178
  157. package/skills/v8-crud-api/references/progressive-01-/346/237/245/350/257/242/345/210/227/350/241/250-/345/210/206/351/241/265.md +226 -226
  158. package/skills/v8-crud-api/references/progressive-02-where-/346/235/241/344/273/266/350/257/255/346/263/225/351/200/237/346/237/245.md +49 -49
  159. package/skills/v8-debugging/SKILL.md +284 -284
  160. package/skills/v8-explorer-tree/SKILL.md +228 -228
  161. package/skills/v8-export-import/SKILL.md +219 -219
  162. package/skills/v8-export-import/references/progressive-01-excellayout-/351/253/230/347/272/247/350/207/252/347/224/261/345/270/203/345/261/200.md +211 -211
  163. package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +202 -202
  164. package/skills/v8-export-import/references/progressive-03-/345/256/211/345/205/250-/346/200/247/350/203/275/346/263/250/346/204/217.md +42 -42
  165. package/skills/v8-file-upload/SKILL.md +284 -284
  166. package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +263 -263
  167. package/skills/v8-file-upload/references/progressive-02-office-/346/226/207/344/273/266/345/234/250/347/272/277/347/274/226/350/276/221/347/211/210/346/234/254/345/217/267/350/247/204/345/210/231.md +161 -161
  168. package/skills/v8-formengine-http/SKILL.md +238 -238
  169. package/skills/v8-frontend-events/SKILL.md +180 -180
  170. package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
  171. package/skills/v8-frontend-events/references/bluetooth-print.md +258 -258
  172. package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +219 -219
  173. package/skills/v8-http-integration/SKILL.md +182 -182
  174. package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +220 -220
  175. package/skills/v8-http-integration/references/progressive-02-/351/224/231/350/257/257/345/244/204/347/220/206/346/250/241/345/274/217.md +44 -44
  176. package/skills/v8-image-processing/SKILL.md +190 -190
  177. package/skills/v8-image-processing/agents/openai.yaml +4 -4
  178. package/skills/v8-image-processing/references/api-reference.md +623 -623
  179. package/skills/v8-menu-buttons/SKILL.md +186 -186
  180. package/skills/v8-menu-buttons/references/progressive-01-2-/346/214/211/351/222/256/345/257/271/350/261/241-schema.md +222 -222
  181. package/skills/v8-menu-buttons/references/progressive-02-8-/346/250/241/345/274/217-f-/345/220/216/345/217/260/344/273/273/345/212/241/346/214/211/351/222/256-/351/225/277/344/273/273/345/212/241.md +228 -228
  182. package/skills/v8-menu-buttons/references/progressive-03-10-/345/217/215/346/250/241/345/274/217-/351/201/277/345/205/215.md +104 -104
  183. package/skills/v8-mongodb/SKILL.md +200 -200
  184. package/skills/v8-mq-mqtt/SKILL.md +176 -176
  185. package/skills/v8-mq-mqtt/references/mqtt-production.md +342 -342
  186. package/skills/v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-/347/211/251/350/201/224/347/275/221.md +181 -181
  187. package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
  188. package/skills/v8-saas-multi-tenant/SKILL.md +305 -305
  189. package/skills/v8-security/SKILL.md +210 -210
  190. package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +200 -200
  191. package/skills/v8-security/references/progressive-02-7-/346/227/245/345/277/227/350/256/260/345/275/225.md +160 -160
  192. package/skills/v8-sql-query/SKILL.md +302 -302
  193. package/skills/v8-table-event/SKILL.md +176 -176
  194. package/skills/v8-table-event/references/progressive-01-informv8-js-/350/241/250/345/215/225/346/211/223/345/274/200/344/272/213/344/273/266.md +216 -216
  195. package/skills/v8-table-event/references/progressive-02-/345/211/215/347/253/257/344/272/213/344/273/266/345/220/215-v8-eventname-/345/217/257/350/203/275/347/232/204/345/200/274.md +46 -46
  196. package/skills/v8-tcp-integration/SKILL.md +147 -147
  197. package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
  198. package/skills/v8-template-engine/SKILL.md +167 -167
  199. package/skills/v8-utilities/SKILL.md +104 -104
  200. package/skills/v8-utilities/references/client-api-index.md +143 -143
  201. package/skills/v8-utilities/references/platform-http-routes.md +83 -83
  202. package/skills/v8-utilities/references/server-api-index.md +188 -188
  203. package/skills/v8-workflow/SKILL.md +252 -252
  204. package/skills/v8-workflow/references/progressive-01-/350/212/202/347/202/271/345/274/200/345/247/213-v8-/344/272/213/344/273/266.md +180 -180
  205. package/skills/v8-workflow/references/workflow-configuration.md +49 -49
  206. package/skills/vision-engine/SKILL.md +160 -160
  207. package/skills/vision-engine/agents/openai.yaml +4 -4
  208. package/skills/vision-engine/references/architecture-and-acceptance.md +194 -194
  209. package/skills/workspace-conventions/SKILL.md +273 -270
  210. package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +209 -209
  211. package/skills/workspace-conventions/references/progressive-02-microi-net-api-/346/234/254/345/234/260/345/220/257/345/212/250/347/272/246/345/256/232.md +217 -217
  212. package/skills/workspace-conventions/references/progressive-03-cli-/344/270/216-ide-/346/217/222/344/273/266/351/224/231/347/211/210/345/205/261/345/255/230/347/272/246/345/256/232.md +27 -27
@@ -1,104 +1,104 @@
1
- ---
2
- name: v8-utilities
3
- description: Microi V8 全局对象、上下文变量和通用函数索引。用于查询某个 V8 函数是否存在、区分前端与后端 API,或使用 V8.Method、Base64、EncryptHelper、V8.WeChat、Action、CurrentUser、SysConfig、OsClient、扫码和客户端导航工具。
4
- ---
5
-
6
- > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
-
8
- # Microi V8 通用能力与函数索引
9
-
10
- 本 Skill 是 V8 能力的路由入口,不替代 CRUD、HTTP、缓存、文件、图片、Office、
11
- 工作流等专项 Skill。遇到“吾码有没有某个函数”“这个 API 在前端还是后端”
12
- 或官网函数列表同步任务时,先在这里确定运行端和正式名称,再读取专项 Skill。
13
-
14
- ## 先判断运行端
15
-
16
- | 运行端 | 典型位置 | API 特征 |
17
- |---|---|---|
18
- | 前端 | 字段事件、按钮、列表、InFormV8、SubmitFormV8、OutFormV8 | 浏览器 Promise/回调、弹窗、路由、`V8.Print`、扫码 |
19
- | 后端 | 接口引擎、SubmitBeforeServerV8、SubmitAfterServerV8、DataFilterV8 | `V8.Db`、事务、缓存、Office、加密、服务端 HTTP |
20
-
21
- 同名对象不保证两端方法一致。例如前端 `V8.Base64.encode/decode` 与后端
22
- `V8.Base64.StringToBase64/Base64ToString` 不同;前端标准运行时没有公开
23
- `V8.ModuleEngine`,后端才有模块引擎对象。
24
-
25
- ## 必读索引
26
-
27
- - 前端全部上下文、表单/列表、导航、网络、引擎和工具:
28
- `references/client-api-index.md`
29
- - 后端上下文、`V8.Method`、Base64、加密、异步与扩展对象:
30
- `references/server-api-index.md`
31
- - 平台 HTTP 路由、动态路由与管理接口边界:
32
- `references/platform-http-routes.md`
33
- - 蓝牙标签/小票打印:
34
- `../v8-frontend-events/references/bluetooth-print.md`
35
-
36
- 若函数未出现在上述索引或当前源码定义中,不得按名字猜测。先搜索
37
- `Microi.Client/src/views/form-engine/diy-components/v8-api-definitions.js`、
38
- `v8-api-server-definitions.js`、V8 宿主接口和官网中文函数列表。
39
-
40
- 邮箱相关能力读取 [email-engine](../email-engine/SKILL.md):`V8.Email` 包含
41
- `ProtectCredential / TestConnection / ListFolders / Fetch / Inspect / GetMessage /
42
- GetAttachment / SetFlags / Move / Send / StoreSent`。
43
- 业务使用 `mci-email` 接口引擎,MCP 使用 `microi_email_query / microi_email_manage / microi_email_send`。
44
-
45
- ## 常用通用写法
46
-
47
- ```javascript
48
- // 两端通用的租户/用户上下文,具体字段按当前上下文判空
49
- var osClient = V8.OsClient;
50
- var userId = V8.CurrentUser && V8.CurrentUser.Id;
51
-
52
- // 后端稳定标识与时间
53
- var id = V8.Method.NewUlid();
54
- var now = DateNow('yyyy-MM-dd HH:mm:ss');
55
- var timestamp = V8.Method.GetTimestamp();
56
-
57
- // 后端 Base64
58
- var encoded = V8.Base64.StringToBase64('吾码');
59
- var decoded = V8.Base64.Base64ToString(encoded);
60
-
61
- // 前端 Base64
62
- var clientEncoded = V8.Base64.encode('吾码');
63
- var clientDecoded = V8.Base64.decode(clientEncoded);
64
- ```
65
-
66
- ## 能力选择
67
-
68
- - 日期基础函数由新版后端运行时自举,不能要求租户先配置 DateNow 才能安装应用。全局函数管理使用系统设置子表 `mci_global_function`,按 `SysConfigId + Runtime(Client/Server) + FunctionName` 隔离,一行一个同名 function 声明;用 `V8.Method.ValidateGlobalFunction` 只解析验证,不执行源码。
69
- - 原有前后端全局 V8 必须保留,合并顺序为内置日期、函数库、租户原有代码;同名原有函数优先。不得用官方全局脚本整段覆盖客户脚本。函数库种子 `InsertIfMissing`,不得升级覆盖客户已改源码。
70
- - 列表和合并代码走 L1/Redis,表单引擎真实提交后更新租户版本并通知其它节点;回滚不变更版本。禁止通过直接 SQL 修改函数库规避失效。前端已打开页面需要刷新。
71
-
72
- ## 受信固定步长运行时发现
73
-
74
- `V8.Method.RunPlatformApiRuntime({RuntimeKey:'fixed-step-simulation',Action,Param})` 属于需后端正式安装的通用原子。动作是 DescribeInvocation/CreateInitialState/AdvanceBatch/Project/ObserveOwnedRoom/StopOwnedRoom/DrainOwnedRoom;精确引擎Key由后台已审批目录限制,不能用通用private转发接口原样接受玩家信封。Param只能承载经接口引擎授权后的数据,不能指定Tenant/EngineKey/NodeId/客户端时钟作为真实上下文。Observe是提交前有界调度提示,后续须重新核DB,不是提交回执;终局用Drain保留当前请求提交机会,Stop则立即取消。规则程序集入口与hash须由私有后端发行组合固定,V8/MCP不提供上传即执行的注册能力。详细边界见unity-integration及后端V8主文档;线上缺原子时明确未安装,不能用Job/SignalR冒充。
75
-
76
- 固定步运行时的临时拒绝仅使用 `DataAppend.ErrorCode` 六码白名单:KernelBusy/HostMemoryPressure/RoomStillDraining/CoordinatorStopping/StaleLease/ComputeBudgetExceeded,并要求 `Retryable===true`。Managed须显式catch-return稳定Code0并回滚,客户端有界同键重试;禁止按中文Msg或带行号异常猜测重试,更不能把授权/来源/未知失败当临时成功。此兼容扩展不增加审批表/配置或MCP任意注册入口。
77
-
78
- 普通租户的编译证明默认 `TenantInstallation`,保留真实 Installed 回执及旧摘要。官方同租户发布源禁止安装自己,只能由后端发行组合明确固定 `OfficialPublishedSnapshot`:`InstallRecordId` 绑定 `mic_data_version.Id`,原始 `Data` 的UTF-8 SHA-256另固定于编译回执并参与独立审批摘要。该类别与快照摘要不从Param或自由表字段选择、不新增表字段、不伪造Installed。受信官方身份、当前Published/审批有效指针、Verified包hash/size/HDFS、不可变快照、V3 Completed源码hash及实际DLL依赖须全部匹配;当前状态变化、软删或主库不可用下次调用立即拒绝,旧历史存在不足以授权。跨租户仍拒绝,结构发布不等于后端安装或代码审批。审批表纳入通用强制管理员清单,普通用户即使误授表/菜单权限仍不得改授权状态;V8Limit和ReadPrimary不是写权限。
79
-
80
- ## 平台兼容入口索引
81
-
82
- 下列旧 HTTP 地址仍由受控兼容链路识别,不能据此绕过 DiyToken、租户或权限校验:`/api/FormEngine/GetSysConfig`、`/api/Os/GetDateTimeNow`、`/api/SysLog/AddSysLog`、`/api/SysUser/`。畅捷通 V2 回调在接口引擎中编排,可信后端只提供当前租户绑定的 `V8.Method.DecodeChanjetCallbackV2` 原子。
83
-
84
- | 需求 | 专项 Skill |
85
- |---|---|
86
- | 表单 CRUD、`_Where` | `v8-crud-api`、`v8-sql-query` |
87
- | HTTP/第三方接口 | `v8-http-integration` |
88
- | TCP 原始字节/网络小票机/设备 | `v8-tcp-integration` |
89
- | Redis/Hash | `v8-cache-pattern` |
90
- | 文件/HDFS | `v8-file-upload` |
91
- | 图片 | `v8-image-processing` |
92
- | Excel/Word/PPT/邮件 | `v8-export-import` |
93
- | 微信支付签名、授权头、API v3 AES-GCM 解密 | `references/server-api-index.md`;安全边界见 `v8-security` |
94
- | 前端事件/打印/扫码 | `v8-frontend-events` |
95
- | 后端表单事件 | `v8-table-event` |
96
- | 接口配置/流式响应/异步/后台任务 | `v8-api-config` |
97
-
98
- ## 不可越过的边界
99
-
100
- - 平台能力优先使用 `V8.*`,不要假设全局 `System` 可访问任意 CLR 类型。
101
- - `V8.SysConfig`、`V8.OsClientModel`、`V8.ClientModel` 可能含连接串、密钥和供应商配置,不直接返回前端或写日志。
102
- - 摘要算法不是密码存储。新密码不使用 MD5/SHA1/SHA256 直接保存。
103
- - `setTimeout`、`Task.Run` 不能承担请求返回后的可靠后台执行。
104
- - 前端值只可用于交互;权限、事务和最终业务校验必须在可信后端执行。
1
+ ---
2
+ name: v8-utilities
3
+ description: Microi V8 全局对象、上下文变量和通用函数索引。用于查询某个 V8 函数是否存在、区分前端与后端 API,或使用 V8.Method、Base64、EncryptHelper、V8.WeChat、Action、CurrentUser、SysConfig、OsClient、扫码和客户端导航工具。
4
+ ---
5
+
6
+ > **Microi吾码基础规范(强制):** 任何 AI 模型与宿主每次新建或接续吾码任务,先完整读取 `../workspace-conventions/SKILL.md`,必须执行版本播报、`@microi.net/cli` 后台自动升级、Skills/MCP 同步和进度播报。安装与诊断读取 `../microi-codex-installer/SKILL.md`;更新失败延后重试,不阻断当前工作。
7
+
8
+ # Microi V8 通用能力与函数索引
9
+
10
+ 本 Skill 是 V8 能力的路由入口,不替代 CRUD、HTTP、缓存、文件、图片、Office、
11
+ 工作流等专项 Skill。遇到“吾码有没有某个函数”“这个 API 在前端还是后端”
12
+ 或官网函数列表同步任务时,先在这里确定运行端和正式名称,再读取专项 Skill。
13
+
14
+ ## 先判断运行端
15
+
16
+ | 运行端 | 典型位置 | API 特征 |
17
+ |---|---|---|
18
+ | 前端 | 字段事件、按钮、列表、InFormV8、SubmitFormV8、OutFormV8 | 浏览器 Promise/回调、弹窗、路由、`V8.Print`、扫码 |
19
+ | 后端 | 接口引擎、SubmitBeforeServerV8、SubmitAfterServerV8、DataFilterV8 | `V8.Db`、事务、缓存、Office、加密、服务端 HTTP |
20
+
21
+ 同名对象不保证两端方法一致。例如前端 `V8.Base64.encode/decode` 与后端
22
+ `V8.Base64.StringToBase64/Base64ToString` 不同;前端标准运行时没有公开
23
+ `V8.ModuleEngine`,后端才有模块引擎对象。
24
+
25
+ ## 必读索引
26
+
27
+ - 前端全部上下文、表单/列表、导航、网络、引擎和工具:
28
+ `references/client-api-index.md`
29
+ - 后端上下文、`V8.Method`、Base64、加密、异步与扩展对象:
30
+ `references/server-api-index.md`
31
+ - 平台 HTTP 路由、动态路由与管理接口边界:
32
+ `references/platform-http-routes.md`
33
+ - 蓝牙标签/小票打印:
34
+ `../v8-frontend-events/references/bluetooth-print.md`
35
+
36
+ 若函数未出现在上述索引或当前源码定义中,不得按名字猜测。先搜索
37
+ `Microi.Client/src/views/form-engine/diy-components/v8-api-definitions.js`、
38
+ `v8-api-server-definitions.js`、V8 宿主接口和官网中文函数列表。
39
+
40
+ 邮箱相关能力读取 [email-engine](../email-engine/SKILL.md):`V8.Email` 包含
41
+ `ProtectCredential / TestConnection / ListFolders / Fetch / Inspect / GetMessage /
42
+ GetAttachment / SetFlags / Move / Send / StoreSent`。
43
+ 业务使用 `mci-email` 接口引擎,MCP 使用 `microi_email_query / microi_email_manage / microi_email_send`。
44
+
45
+ ## 常用通用写法
46
+
47
+ ```javascript
48
+ // 两端通用的租户/用户上下文,具体字段按当前上下文判空
49
+ var osClient = V8.OsClient;
50
+ var userId = V8.CurrentUser && V8.CurrentUser.Id;
51
+
52
+ // 后端稳定标识与时间
53
+ var id = V8.Method.NewUlid();
54
+ var now = DateNow('yyyy-MM-dd HH:mm:ss');
55
+ var timestamp = V8.Method.GetTimestamp();
56
+
57
+ // 后端 Base64
58
+ var encoded = V8.Base64.StringToBase64('吾码');
59
+ var decoded = V8.Base64.Base64ToString(encoded);
60
+
61
+ // 前端 Base64
62
+ var clientEncoded = V8.Base64.encode('吾码');
63
+ var clientDecoded = V8.Base64.decode(clientEncoded);
64
+ ```
65
+
66
+ ## 能力选择
67
+
68
+ - 日期基础函数由新版后端运行时自举,不能要求租户先配置 DateNow 才能安装应用。全局函数管理使用系统设置子表 `mci_global_function`,按 `SysConfigId + Runtime(Client/Server) + FunctionName` 隔离,一行一个同名 function 声明;用 `V8.Method.ValidateGlobalFunction` 只解析验证,不执行源码。
69
+ - 原有前后端全局 V8 必须保留,合并顺序为内置日期、函数库、租户原有代码;同名原有函数优先。不得用官方全局脚本整段覆盖客户脚本。函数库种子 `InsertIfMissing`,不得升级覆盖客户已改源码。
70
+ - 列表和合并代码走 L1/Redis,表单引擎真实提交后更新租户版本并通知其它节点;回滚不变更版本。禁止通过直接 SQL 修改函数库规避失效。前端已打开页面需要刷新。
71
+
72
+ ## 受信固定步长运行时发现
73
+
74
+ `V8.Method.RunPlatformApiRuntime({RuntimeKey:'fixed-step-simulation',Action,Param})` 属于需后端正式安装的通用原子。动作是 DescribeInvocation/CreateInitialState/AdvanceBatch/Project/ObserveOwnedRoom/StopOwnedRoom/DrainOwnedRoom;精确引擎Key由后台已审批目录限制,不能用通用private转发接口原样接受玩家信封。Param只能承载经接口引擎授权后的数据,不能指定Tenant/EngineKey/NodeId/客户端时钟作为真实上下文。Observe是提交前有界调度提示,后续须重新核DB,不是提交回执;终局用Drain保留当前请求提交机会,Stop则立即取消。规则程序集入口与hash须由私有后端发行组合固定,V8/MCP不提供上传即执行的注册能力。详细边界见unity-integration及后端V8主文档;线上缺原子时明确未安装,不能用Job/SignalR冒充。
75
+
76
+ 固定步运行时的临时拒绝仅使用 `DataAppend.ErrorCode` 六码白名单:KernelBusy/HostMemoryPressure/RoomStillDraining/CoordinatorStopping/StaleLease/ComputeBudgetExceeded,并要求 `Retryable===true`。Managed须显式catch-return稳定Code0并回滚,客户端有界同键重试;禁止按中文Msg或带行号异常猜测重试,更不能把授权/来源/未知失败当临时成功。此兼容扩展不增加审批表/配置或MCP任意注册入口。
77
+
78
+ 普通租户的编译证明默认 `TenantInstallation`,保留真实 Installed 回执及旧摘要。官方同租户发布源禁止安装自己,只能由后端发行组合明确固定 `OfficialPublishedSnapshot`:`InstallRecordId` 绑定 `mic_data_version.Id`,原始 `Data` 的UTF-8 SHA-256另固定于编译回执并参与独立审批摘要。该类别与快照摘要不从Param或自由表字段选择、不新增表字段、不伪造Installed。受信官方身份、当前Published/审批有效指针、Verified包hash/size/HDFS、不可变快照、V3 Completed源码hash及实际DLL依赖须全部匹配;当前状态变化、软删或主库不可用下次调用立即拒绝,旧历史存在不足以授权。跨租户仍拒绝,结构发布不等于后端安装或代码审批。审批表纳入通用强制管理员清单,普通用户即使误授表/菜单权限仍不得改授权状态;V8Limit和ReadPrimary不是写权限。
79
+
80
+ ## 平台兼容入口索引
81
+
82
+ 下列旧 HTTP 地址仍由受控兼容链路识别,不能据此绕过 DiyToken、租户或权限校验:`/api/FormEngine/GetSysConfig`、`/api/Os/GetDateTimeNow`、`/api/SysLog/AddSysLog`、`/api/SysUser/`。畅捷通 V2 回调在接口引擎中编排,可信后端只提供当前租户绑定的 `V8.Method.DecodeChanjetCallbackV2` 原子。
83
+
84
+ | 需求 | 专项 Skill |
85
+ |---|---|
86
+ | 表单 CRUD、`_Where` | `v8-crud-api`、`v8-sql-query` |
87
+ | HTTP/第三方接口 | `v8-http-integration` |
88
+ | TCP 原始字节/网络小票机/设备 | `v8-tcp-integration` |
89
+ | Redis/Hash | `v8-cache-pattern` |
90
+ | 文件/HDFS | `v8-file-upload` |
91
+ | 图片 | `v8-image-processing` |
92
+ | Excel/Word/PPT/邮件 | `v8-export-import` |
93
+ | 微信支付签名、授权头、API v3 AES-GCM 解密 | `references/server-api-index.md`;安全边界见 `v8-security` |
94
+ | 前端事件/打印/扫码 | `v8-frontend-events` |
95
+ | 后端表单事件 | `v8-table-event` |
96
+ | 接口配置/流式响应/异步/后台任务 | `v8-api-config` |
97
+
98
+ ## 不可越过的边界
99
+
100
+ - 平台能力优先使用 `V8.*`,不要假设全局 `System` 可访问任意 CLR 类型。
101
+ - `V8.SysConfig`、`V8.OsClientModel`、`V8.ClientModel` 可能含连接串、密钥和供应商配置,不直接返回前端或写日志。
102
+ - 摘要算法不是密码存储。新密码不使用 MD5/SHA1/SHA256 直接保存。
103
+ - `setTimeout`、`Task.Run` 不能承担请求返回后的可靠后台执行。
104
+ - 前端值只可用于交互;权限、事务和最终业务校验必须在可信后端执行。
@@ -1,143 +1,143 @@
1
- # 前端 V8 API 索引
2
-
3
- 本索引对应 `microi.doc/docs/doc/v8-engine/v8-client.md` 和当前
4
- `Microi.Client` V8 定义。业务表字段如 `V8.Form.OrderNo` 不属于平台函数,
5
- 应按实际表结构理解。
6
-
7
- ## 上下文与状态
8
-
9
- | API/变量 | 说明 |
10
- |---|---|
11
- | `V8.Form`、`V8.OldForm` | 当前表单与已加载旧值 |
12
- | `V8.FormMode` | `Add`、`Edit`、`View` |
13
- | `V8.FormSubmitAction` | 提交动作 |
14
- | `V8.FormOutAction`、`V8.FormOutAfterAction` | 表单关闭/保存后的动作状态 |
15
- | `V8.LoadMode` | `Design` 或真实运行模式 |
16
- | `V8.EventName`、`V8.Event`、`V8.KeyCode` | 当前事件、原生事件和键码 |
17
- | `V8.ThisValue`、`V8.OldValue` | 当前字段值;`OldValue` 主要用于表格行内事件 |
18
- | `V8.TableId`、`V8.TableName`、`V8.TableModel` | 当前表/表单元数据 |
19
- | `V8.Row`、`V8.Rows`、`V8.RowIndex`、`V8.TableRowId` | 行事件上下文 |
20
- | `V8.TableRowSelected`、`V8.SelectedData` | 批量选中行,兼容别名 |
21
- | `V8.CurrentTableData` | 当前页表格数据 |
22
- | `V8.SearchParam` | 当前搜索快照 |
23
- | `V8.SysMenuId`、`V8.SysMenuModel` | 当前授权菜单 |
24
- | `V8.CurrentUser`、`V8.CurrentToken` | 当前用户和 Token;不得输出到日志/URL |
25
- | `V8.OsClient`、`V8.SysConfig`、`V8.ClientType` | 租户、客户端配置和终端类型 |
26
- | `V8.DataAppend` | 打开表单、列表或弹窗时传入的附加数据 |
27
- | `V8.ParentV8`、`V8.ParentForm` | 子表/弹窗访问父上下文 |
28
- | `V8.ParentV8.Form` | 读取父级表单数据 |
29
- | `V8.ParentV8.FormSet(field,value)` | 从子表调用父表字段赋值与联动 |
30
- | `V8.ApiReplace` | 当前表单/列表接口替换配置,只读使用 |
31
- | `V8.Result` | 模板或事件输出槽 |
32
-
33
- ## 表单与字段
34
-
35
- | API | 说明 |
36
- |---|---|
37
- | `V8.FormSet(field,value)` | 设置字段值并触发相应联动 |
38
- | `V8.Field` | 当前字段模型集合 |
39
- | `V8.FieldSet(field,prop,value)` | 修改 `Visible/Required/Readonly/Data` 等属性 |
40
- | `V8.FormSubmit(options)` | 提交表单;SubmitFormV8 内不得再次调用 |
41
- | `V8.FormClose()` | 强制关闭表单 |
42
- | `V8.CloseThisDialog()` | 关闭当前宿主弹窗/微应用弹窗 |
43
- | `V8.ReloadForm()` | 重新加载当前表单 |
44
- | `V8.HideFormBtn(...)` | 隐藏表单按钮 |
45
- | `V8.HideFormTab(name)`、`V8.ShowFormTab(name)`、`V8.ClickFormTab(name)` | 页签显隐与切换 |
46
- | `V8.GetFormTabs()` | 获取当前表单页签 |
47
- | `V8.ShowTableChildHideField(child,fields)` | 强制显示子表隐藏列并刷新 |
48
- | `V8.GetChildTableData(fieldName)` | 获取指定子表数据 |
49
- | `V8.RefreshChildTable(field,row?)` | 刷新子表 |
50
-
51
- ## 列表与搜索
52
-
53
- | API | 说明 |
54
- |---|---|
55
- | `V8.RefreshTable({_PageIndex})` | 刷新当前列表 |
56
- | `V8.SearchSet(value)` | 替换当前模块搜索条件 |
57
- | `V8.SearchAppend(value)` | 追加当前模块搜索条件 |
58
- | `V8.OpenTableSetWhere(field,where)` | 设置弹出表格不可被临时搜索覆盖的固定范围 |
59
- | `V8.AppendSearchChildTable(field,value)` | 历史兼容;新代码优先 `OpenTableSetWhere` |
60
- | `V8.TableSearchSet(field,value)` | 替换指定子表/表格搜索 |
61
- | `V8.TableSearchAppend(field,value)` | 追加指定子表/表格搜索 |
62
- | `V8.TableRefresh(field,param)` | 刷新指定子表/表格 |
63
- | `V8.ClearTableSelection()` | 清空当前列表勾选 |
64
-
65
- ## 交互与导航
66
-
67
- | API | 说明 |
68
- |---|---|
69
- | `V8.Tips(msg,ok?)` | 消息提示 |
70
- | `V8.ConfirmTips(content,callback,options?)` | HTML 模式确认框,只传可信/转义内容 |
71
- | `V8.Router.Push(...)` | 站内路由 |
72
- | `V8.Window.Open(...)` | 打开窗口 |
73
- | `V8.OpenForm(...)`、`V8.OpenFormWF(...)` | 历史表单/工作流打开入口 |
74
- | `V8.OpenAnyForm(options)` | 打开任意表单 |
75
- | `V8.OpenAnyTable(options)` | 打开任意列表 |
76
- | `V8.OpenDialog(options)` | 打开主前端已注册 Vue 组件 |
77
- | `V8.OpenAppDialog(options)` | 打开已发布 MicroService 页面 |
78
- | `V8.WF.StartWork(...)`、`V8.FormWF` | 前端工作流入口/当前工作流数据 |
79
-
80
- 三个以上输入、上传、表格、步骤条、Tab 或代码编辑器使用
81
- `V8.OpenAppDialog`,不要在 V8 代码中拼大段 HTML。
82
-
83
- ## 网络与引擎
84
-
85
- | API | 说明 |
86
- |---|---|
87
- | `V8.Http.Get(options)`、`V8.Http.Post(options)`、`V8.Http.PatchResponse(options)` | 推荐前端 HTTP Promise API |
88
- | `V8.Post(...)`、`V8.Get(...)` | 历史回调 API,兼容保留 |
89
- | `V8.ApiEngine.Run(...)` | 调用接口引擎,支持 Promise/回调 |
90
- | `V8.ApiEngine.RunBackground(...)` | 提交持久后台任务 |
91
- | `V8.DataSourceEngine` | 前端数据源引擎对象 |
92
- | `V8.DataSourceEngine.Run(...)` | 运行数据源引擎;旧 `GetData` 已弃用 |
93
- | `V8.FormEngine.GetTableData(...)` | 查询列表 |
94
- | `V8.FormEngine.GetFormData(...)` | 查询单条 |
95
- | `V8.FormEngine.DelFormData(...)` | 删除;权限仍由服务端校验 |
96
-
97
- 前端 `V8.FormEngine` 真实方法以当前客户端定义为准,均可按 Promise 使用;
98
- 不要给前端方法虚构后端专用的 `GetTableDataAsync` 名称。标准前端运行时没有公开
99
- `V8.ModuleEngine`,模块关联查询使用接口引擎、数据源引擎或受控 FormEngine。
100
-
101
- ## 工具能力
102
-
103
- | API | 说明 |
104
- |---|---|
105
- | `V8.IsNull(value)` | 兼容判断 `null/undefined/''/'null'/'undefined'` |
106
- | `V8.ChineseToPinyin(text,fullPyLen,type)` | 中文转拼音 |
107
- | `V8.NewGuid()` | 前端生成 GUID |
108
- | `await V8.NewServerGuid()` | 请求服务端生成 GUID |
109
- | `V8.Base64.encode(value)` | 前端 Base64 编码 |
110
- | `V8.Base64.decode(value)` | 前端 Base64 解码 |
111
- | `V8.Base64.isValid(value)` | 判断字符串是否为有效 Base64 |
112
- | `V8._` | Underscore 实例,如 `V8._.where(...)` |
113
- | `V8.Action.GetDateTimeNow()` | 兼容的前端全局时间函数 |
114
- | `V8.AddSysLog(...)` | 前端发起系统日志记录;不得含秘密 |
115
- | `V8.SendSystemMessage(...)` | 发送站内系统消息 |
116
- | `await V8.Method.ScanCode()` | 扫码;成功值同时写入 `V8.ScanCodeRes` |
117
- | `V8.Print.*` | TSPL/CPCL/ESC-POS 蓝牙标签与小票打印,兼容 GP-M322、CC4,见蓝牙打印参考 |
118
- | `V8.Identity.GetCapabilities()` | 读取当前租户强身份能力和本人登记状态 |
119
- | `V8.Identity.CreateActionHash(value)` | 为稳定业务命令生成 SHA-256 摘要 |
120
- | `V8.Identity.RegisterPasskey(options?)` | 登记当前用户 Passkey |
121
- | `V8.Identity.Verify({Purpose,ActionHash,Method,Code?})` | 完成 Passkey、Authenticator TOTP 或严格人脸验证并取得一次性后端票据;Totp 需 6 位 Code |
122
-
123
- 扫码应优先接收 Promise 返回值;兼容代码可在调用后读取 `V8.ScanCodeRes`。
124
- `V8.Identity` 是强身份验证模块。`V8.Identity.Verify` 的成功结果不能直接授权业务;后端必须重读权威数据、重算摘要并调用 `V8.Method.ConsumeIdentityVerificationTicket`。
125
- 蓝牙打印完整 API 包含 `V8.Print.createNew`、`V8.Print.createNewESC`、
126
- `V8.Print.OpenBluetoothPage`、`V8.Print.isConnected`、
127
- `V8.Print.reconnect`、`V8.Print.getConnectionState`、`V8.Print.subscribeConnection`、
128
- `V8.Print.getPrinterProfile`、`V8.Print.setPrinterProfile`、
129
- `V8.Print.prepareSend`、`V8.Print.Send`、`V8.Print.setOneTimeData`、
130
- `V8.Print.setPrinterNum`、`V8.Print.disconnect` 和
131
- `V8.Print.BLEInformation`。其中 `Send` 依赖 `prepareSend` 设置的共享分包游标,
132
- 只作内部状态机入口;业务代码必须调用并 `await prepareSend`。当前挂载范围、连接
133
- 真实性、佳博原 TSPL 回归、CC4 CPCL 适配、Android SPP 与串行约束见
134
- [`bluetooth-print.md`](../../v8-frontend-events/references/bluetooth-print.md),TSC/ESC
135
- 完整方法见
136
- [`bluetooth-print-api.md`](../../v8-frontend-events/references/bluetooth-print-api.md)。
137
-
138
- ## 主前端源码帮助对象
139
-
140
- `DiyCommon.GetApiBase()` 是 `Microi.Client` 主前端源码内部取得 API 根地址的帮助
141
- 方法,不属于租户前端 V8 的稳定公开对象。V8 代码优先使用受控 `V8.Http` 和
142
- `V8.SysConfig.ApiBase`;MicroService 从宿主数据读取 `apiBase`,不要假设子应用
143
- 全局存在 `DiyCommon`。
1
+ # 前端 V8 API 索引
2
+
3
+ 本索引对应 `microi.doc/docs/doc/v8-engine/v8-client.md` 和当前
4
+ `Microi.Client` V8 定义。业务表字段如 `V8.Form.OrderNo` 不属于平台函数,
5
+ 应按实际表结构理解。
6
+
7
+ ## 上下文与状态
8
+
9
+ | API/变量 | 说明 |
10
+ |---|---|
11
+ | `V8.Form`、`V8.OldForm` | 当前表单与已加载旧值 |
12
+ | `V8.FormMode` | `Add`、`Edit`、`View` |
13
+ | `V8.FormSubmitAction` | 提交动作 |
14
+ | `V8.FormOutAction`、`V8.FormOutAfterAction` | 表单关闭/保存后的动作状态 |
15
+ | `V8.LoadMode` | `Design` 或真实运行模式 |
16
+ | `V8.EventName`、`V8.Event`、`V8.KeyCode` | 当前事件、原生事件和键码 |
17
+ | `V8.ThisValue`、`V8.OldValue` | 当前字段值;`OldValue` 主要用于表格行内事件 |
18
+ | `V8.TableId`、`V8.TableName`、`V8.TableModel` | 当前表/表单元数据 |
19
+ | `V8.Row`、`V8.Rows`、`V8.RowIndex`、`V8.TableRowId` | 行事件上下文 |
20
+ | `V8.TableRowSelected`、`V8.SelectedData` | 批量选中行,兼容别名 |
21
+ | `V8.CurrentTableData` | 当前页表格数据 |
22
+ | `V8.SearchParam` | 当前搜索快照 |
23
+ | `V8.SysMenuId`、`V8.SysMenuModel` | 当前授权菜单 |
24
+ | `V8.CurrentUser`、`V8.CurrentToken` | 当前用户和 Token;不得输出到日志/URL |
25
+ | `V8.OsClient`、`V8.SysConfig`、`V8.ClientType` | 租户、客户端配置和终端类型 |
26
+ | `V8.DataAppend` | 打开表单、列表或弹窗时传入的附加数据 |
27
+ | `V8.ParentV8`、`V8.ParentForm` | 子表/弹窗访问父上下文 |
28
+ | `V8.ParentV8.Form` | 读取父级表单数据 |
29
+ | `V8.ParentV8.FormSet(field,value)` | 从子表调用父表字段赋值与联动 |
30
+ | `V8.ApiReplace` | 当前表单/列表接口替换配置,只读使用 |
31
+ | `V8.Result` | 模板或事件输出槽 |
32
+
33
+ ## 表单与字段
34
+
35
+ | API | 说明 |
36
+ |---|---|
37
+ | `V8.FormSet(field,value)` | 设置字段值并触发相应联动 |
38
+ | `V8.Field` | 当前字段模型集合 |
39
+ | `V8.FieldSet(field,prop,value)` | 修改 `Visible/Required/Readonly/Data` 等属性 |
40
+ | `V8.FormSubmit(options)` | 提交表单;SubmitFormV8 内不得再次调用 |
41
+ | `V8.FormClose()` | 强制关闭表单 |
42
+ | `V8.CloseThisDialog()` | 关闭当前宿主弹窗/微应用弹窗 |
43
+ | `V8.ReloadForm()` | 重新加载当前表单 |
44
+ | `V8.HideFormBtn(...)` | 隐藏表单按钮 |
45
+ | `V8.HideFormTab(name)`、`V8.ShowFormTab(name)`、`V8.ClickFormTab(name)` | 页签显隐与切换 |
46
+ | `V8.GetFormTabs()` | 获取当前表单页签 |
47
+ | `V8.ShowTableChildHideField(child,fields)` | 强制显示子表隐藏列并刷新 |
48
+ | `V8.GetChildTableData(fieldName)` | 获取指定子表数据 |
49
+ | `V8.RefreshChildTable(field,row?)` | 刷新子表 |
50
+
51
+ ## 列表与搜索
52
+
53
+ | API | 说明 |
54
+ |---|---|
55
+ | `V8.RefreshTable({_PageIndex})` | 刷新当前列表 |
56
+ | `V8.SearchSet(value)` | 替换当前模块搜索条件 |
57
+ | `V8.SearchAppend(value)` | 追加当前模块搜索条件 |
58
+ | `V8.OpenTableSetWhere(field,where)` | 设置弹出表格不可被临时搜索覆盖的固定范围 |
59
+ | `V8.AppendSearchChildTable(field,value)` | 历史兼容;新代码优先 `OpenTableSetWhere` |
60
+ | `V8.TableSearchSet(field,value)` | 替换指定子表/表格搜索 |
61
+ | `V8.TableSearchAppend(field,value)` | 追加指定子表/表格搜索 |
62
+ | `V8.TableRefresh(field,param)` | 刷新指定子表/表格 |
63
+ | `V8.ClearTableSelection()` | 清空当前列表勾选 |
64
+
65
+ ## 交互与导航
66
+
67
+ | API | 说明 |
68
+ |---|---|
69
+ | `V8.Tips(msg,ok?)` | 消息提示 |
70
+ | `V8.ConfirmTips(content,callback,options?)` | HTML 模式确认框,只传可信/转义内容 |
71
+ | `V8.Router.Push(...)` | 站内路由 |
72
+ | `V8.Window.Open(...)` | 打开窗口 |
73
+ | `V8.OpenForm(...)`、`V8.OpenFormWF(...)` | 历史表单/工作流打开入口 |
74
+ | `V8.OpenAnyForm(options)` | 打开任意表单 |
75
+ | `V8.OpenAnyTable(options)` | 打开任意列表 |
76
+ | `V8.OpenDialog(options)` | 打开主前端已注册 Vue 组件 |
77
+ | `V8.OpenAppDialog(options)` | 打开已发布 MicroService 页面 |
78
+ | `V8.WF.StartWork(...)`、`V8.FormWF` | 前端工作流入口/当前工作流数据 |
79
+
80
+ 三个以上输入、上传、表格、步骤条、Tab 或代码编辑器使用
81
+ `V8.OpenAppDialog`,不要在 V8 代码中拼大段 HTML。
82
+
83
+ ## 网络与引擎
84
+
85
+ | API | 说明 |
86
+ |---|---|
87
+ | `V8.Http.Get(options)`、`V8.Http.Post(options)`、`V8.Http.PatchResponse(options)` | 推荐前端 HTTP Promise API |
88
+ | `V8.Post(...)`、`V8.Get(...)` | 历史回调 API,兼容保留 |
89
+ | `V8.ApiEngine.Run(...)` | 调用接口引擎,支持 Promise/回调 |
90
+ | `V8.ApiEngine.RunBackground(...)` | 提交持久后台任务 |
91
+ | `V8.DataSourceEngine` | 前端数据源引擎对象 |
92
+ | `V8.DataSourceEngine.Run(...)` | 运行数据源引擎;旧 `GetData` 已弃用 |
93
+ | `V8.FormEngine.GetTableData(...)` | 查询列表 |
94
+ | `V8.FormEngine.GetFormData(...)` | 查询单条 |
95
+ | `V8.FormEngine.DelFormData(...)` | 删除;权限仍由服务端校验 |
96
+
97
+ 前端 `V8.FormEngine` 真实方法以当前客户端定义为准,均可按 Promise 使用;
98
+ 不要给前端方法虚构后端专用的 `GetTableDataAsync` 名称。标准前端运行时没有公开
99
+ `V8.ModuleEngine`,模块关联查询使用接口引擎、数据源引擎或受控 FormEngine。
100
+
101
+ ## 工具能力
102
+
103
+ | API | 说明 |
104
+ |---|---|
105
+ | `V8.IsNull(value)` | 兼容判断 `null/undefined/''/'null'/'undefined'` |
106
+ | `V8.ChineseToPinyin(text,fullPyLen,type)` | 中文转拼音 |
107
+ | `V8.NewGuid()` | 前端生成 GUID |
108
+ | `await V8.NewServerGuid()` | 请求服务端生成 GUID |
109
+ | `V8.Base64.encode(value)` | 前端 Base64 编码 |
110
+ | `V8.Base64.decode(value)` | 前端 Base64 解码 |
111
+ | `V8.Base64.isValid(value)` | 判断字符串是否为有效 Base64 |
112
+ | `V8._` | Underscore 实例,如 `V8._.where(...)` |
113
+ | `V8.Action.GetDateTimeNow()` | 兼容的前端全局时间函数 |
114
+ | `V8.AddSysLog(...)` | 前端发起系统日志记录;不得含秘密 |
115
+ | `V8.SendSystemMessage(...)` | 发送站内系统消息 |
116
+ | `await V8.Method.ScanCode()` | 扫码;成功值同时写入 `V8.ScanCodeRes` |
117
+ | `V8.Print.*` | TSPL/CPCL/ESC-POS 蓝牙标签与小票打印,兼容 GP-M322、CC4,见蓝牙打印参考 |
118
+ | `V8.Identity.GetCapabilities()` | 读取当前租户强身份能力和本人登记状态 |
119
+ | `V8.Identity.CreateActionHash(value)` | 为稳定业务命令生成 SHA-256 摘要 |
120
+ | `V8.Identity.RegisterPasskey(options?)` | 登记当前用户 Passkey |
121
+ | `V8.Identity.Verify({Purpose,ActionHash,Method,Code?})` | 完成 Passkey、Authenticator TOTP 或严格人脸验证并取得一次性后端票据;Totp 需 6 位 Code |
122
+
123
+ 扫码应优先接收 Promise 返回值;兼容代码可在调用后读取 `V8.ScanCodeRes`。
124
+ `V8.Identity` 是强身份验证模块。`V8.Identity.Verify` 的成功结果不能直接授权业务;后端必须重读权威数据、重算摘要并调用 `V8.Method.ConsumeIdentityVerificationTicket`。
125
+ 蓝牙打印完整 API 包含 `V8.Print.createNew`、`V8.Print.createNewESC`、
126
+ `V8.Print.OpenBluetoothPage`、`V8.Print.isConnected`、
127
+ `V8.Print.reconnect`、`V8.Print.getConnectionState`、`V8.Print.subscribeConnection`、
128
+ `V8.Print.getPrinterProfile`、`V8.Print.setPrinterProfile`、
129
+ `V8.Print.prepareSend`、`V8.Print.Send`、`V8.Print.setOneTimeData`、
130
+ `V8.Print.setPrinterNum`、`V8.Print.disconnect` 和
131
+ `V8.Print.BLEInformation`。其中 `Send` 依赖 `prepareSend` 设置的共享分包游标,
132
+ 只作内部状态机入口;业务代码必须调用并 `await prepareSend`。当前挂载范围、连接
133
+ 真实性、佳博原 TSPL 回归、CC4 CPCL 适配、Android SPP 与串行约束见
134
+ [`bluetooth-print.md`](../../v8-frontend-events/references/bluetooth-print.md),TSC/ESC
135
+ 完整方法见
136
+ [`bluetooth-print-api.md`](../../v8-frontend-events/references/bluetooth-print-api.md)。
137
+
138
+ ## 主前端源码帮助对象
139
+
140
+ `DiyCommon.GetApiBase()` 是 `Microi.Client` 主前端源码内部取得 API 根地址的帮助
141
+ 方法,不属于租户前端 V8 的稳定公开对象。V8 代码优先使用受控 `V8.Http` 和
142
+ `V8.SysConfig.ApiBase`;MicroService 从宿主数据读取 `apiBase`,不要假设子应用
143
+ 全局存在 `DiyCommon`。