zero-ai 0.3.25

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 (276) hide show
  1. package/CNAME +1 -0
  2. package/README.md +54 -0
  3. package/SUMMARY.md +15 -0
  4. package/_config.yml +1 -0
  5. package/_layouts/default.html +60 -0
  6. package/_sass/jekyll-theme-dinky.scss +440 -0
  7. package/_sass/rouge-github.scss +209 -0
  8. package/assets/css/style.scss +4 -0
  9. package/assets/images/arrow-down.png +0 -0
  10. package/assets/images/octocat-small.png +0 -0
  11. package/assets/js/scale.fix.js +20 -0
  12. package/configs/sorts.json +38 -0
  13. package/document/doc-config/jsdoc.json +89 -0
  14. package/document/doc-config/third-part/esdoc.json +9 -0
  15. package/document/doc-config/third-part/yuidoc-example.json +23 -0
  16. package/document/doc-config/third-part/yuidoc.json +11 -0
  17. package/document/doc-config/tpl/publish.js +778 -0
  18. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  19. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  20. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  21. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  22. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  23. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  24. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  25. package/document/doc-config/tpl/static/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  26. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  27. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  28. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  29. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  30. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  31. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  32. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  33. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  34. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  35. package/document/doc-config/tpl/static/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  36. package/document/doc-config/tpl/static/scripts/collapse.js +20 -0
  37. package/document/doc-config/tpl/static/scripts/linenumber.js +25 -0
  38. package/document/doc-config/tpl/static/scripts/nav.js +12 -0
  39. package/document/doc-config/tpl/static/scripts/polyfill.js +4 -0
  40. package/document/doc-config/tpl/static/scripts/prettify/Apache-License-2.0.txt +202 -0
  41. package/document/doc-config/tpl/static/scripts/prettify/lang-css.js +2 -0
  42. package/document/doc-config/tpl/static/scripts/prettify/prettify.js +28 -0
  43. package/document/doc-config/tpl/static/scripts/search.js +83 -0
  44. package/document/doc-config/tpl/static/styles/jsdoc.css +765 -0
  45. package/document/doc-config/tpl/static/styles/prettify.css +79 -0
  46. package/document/doc-config/tpl/static/styles/zero.css +50 -0
  47. package/document/doc-config/tpl/tmpl/augments.tmpl +10 -0
  48. package/document/doc-config/tpl/tmpl/container.tmpl +197 -0
  49. package/document/doc-config/tpl/tmpl/details.tmpl +148 -0
  50. package/document/doc-config/tpl/tmpl/example.tmpl +2 -0
  51. package/document/doc-config/tpl/tmpl/examples.tmpl +13 -0
  52. package/document/doc-config/tpl/tmpl/exceptions.tmpl +32 -0
  53. package/document/doc-config/tpl/tmpl/layout.tmpl +98 -0
  54. package/document/doc-config/tpl/tmpl/mainpage.tmpl +15 -0
  55. package/document/doc-config/tpl/tmpl/members.tmpl +38 -0
  56. package/document/doc-config/tpl/tmpl/method.tmpl +138 -0
  57. package/document/doc-config/tpl/tmpl/modifies.tmpl +14 -0
  58. package/document/doc-config/tpl/tmpl/params.tmpl +132 -0
  59. package/document/doc-config/tpl/tmpl/properties.tmpl +107 -0
  60. package/document/doc-config/tpl/tmpl/returns.tmpl +19 -0
  61. package/document/doc-config/tpl/tmpl/source.tmpl +8 -0
  62. package/document/doc-config/tpl/tmpl/tutorial.tmpl +19 -0
  63. package/document/doc-config/tpl/tmpl/type.tmpl +7 -0
  64. package/document/doc-config/tpl/zero.css +0 -0
  65. package/document/doc-web/E.html +395 -0
  66. package/document/doc-web/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  67. package/document/doc-web/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  68. package/document/doc-web/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  69. package/document/doc-web/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  70. package/document/doc-web/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  71. package/document/doc-web/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  72. package/document/doc-web/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  73. package/document/doc-web/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  74. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  75. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  76. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  77. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  78. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  79. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  80. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  81. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  82. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  83. package/document/doc-web/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  84. package/document/doc-web/index.html +262 -0
  85. package/document/doc-web/module-_debug.html +1104 -0
  86. package/document/doc-web/module-_epic.html +1631 -0
  87. package/document/doc-web/module-ai.html +1701 -0
  88. package/document/doc-web/module-aj.html +1081 -0
  89. package/document/doc-web/scripts/collapse.js +20 -0
  90. package/document/doc-web/scripts/linenumber.js +25 -0
  91. package/document/doc-web/scripts/nav.js +12 -0
  92. package/document/doc-web/scripts/polyfill.js +4 -0
  93. package/document/doc-web/scripts/prettify/Apache-License-2.0.txt +202 -0
  94. package/document/doc-web/scripts/prettify/lang-css.js +2 -0
  95. package/document/doc-web/scripts/prettify/prettify.js +28 -0
  96. package/document/doc-web/scripts/search.js +83 -0
  97. package/document/doc-web/styles/jsdoc.css +765 -0
  98. package/document/doc-web/styles/prettify.css +79 -0
  99. package/document/doc-web/styles/zero.css +50 -0
  100. package/document/markdown/README.md +0 -0
  101. package/document/markdown/gong-cheng-chu-shi-hua.md +79 -0
  102. package/document/markdown/t0002-uuidsheng-cheng-qi.md +142 -0
  103. package/document/markdown/t0003-shu-ju-mo-ni-qi.md +135 -0
  104. package/document/markdown/t0004-zerode-fu-wu-tong-xun-fen-xi-qi.md +64 -0
  105. package/document/markdown/t0005-liquibaseshu-ju-zhuan-huan-qi.md +68 -0
  106. package/document/markdown/zt0001-pagecardchuang-jian.md +71 -0
  107. package/document/markdown/zt0002-formchuang-jian.md +81 -0
  108. package/document/markdown/zt0003-tian-jia-card-an-niu.md +115 -0
  109. package/document/markdown/zt0004-chu-li-modal-zhe-zhao-xiao-guo.md +105 -0
  110. package/document/markdown/ztgong-ju.md +0 -0
  111. package/install-local.sh +3 -0
  112. package/package.json +53 -0
  113. package/run-authorize.sh +32 -0
  114. package/run-doc.sh +16 -0
  115. package/run-update.sh +6 -0
  116. package/script/bootstrap +6 -0
  117. package/script/cibuild +9 -0
  118. package/script/release +42 -0
  119. package/script/validate-html +28 -0
  120. package/script/zrun-doc-generate.sh +18 -0
  121. package/script/zrun-doc-server.sh +13 -0
  122. package/src/ai.js +11 -0
  123. package/src/aj.js +11 -0
  124. package/src/art.js +11 -0
  125. package/src/cab/form/UI.js.tpl +50 -0
  126. package/src/cab/form/UI.json.tpl +38 -0
  127. package/src/cab/list/Op.js.tpl +42 -0
  128. package/src/cab/list/UI.Add.json.tpl +32 -0
  129. package/src/cab/list/UI.Edit.json.tpl +34 -0
  130. package/src/cab/list/UI.Filter.json.tpl +29 -0
  131. package/src/cab/list/UI.Form.js.tpl +64 -0
  132. package/src/cab/list/UI.js.tpl +49 -0
  133. package/src/cab/list/UI.json.tpl +208 -0
  134. package/src/cab/perm/falcon.app.xlsx +0 -0
  135. package/src/cab/perm/falcon.authority.resource.perm.xlsx +0 -0
  136. package/src/cab/perm/falcon.authority.resource.resource.xlsx +0 -0
  137. package/src/cab/perm/falcon.authority.role.action.xlsx +0 -0
  138. package/src/cab/perm/falcon.authority.view.xlsx +0 -0
  139. package/src/cab/perm/falcon.battery.module.xlsx +0 -0
  140. package/src/cab/perm/falcon.epic.form.xlsx +0 -0
  141. package/src/cab/perm/falcon.epic.integration.xlsx +0 -0
  142. package/src/cab/perm/falcon.epic.modeling.entity.xlsx +0 -0
  143. package/src/cab/perm/falcon.epic.modeling.field.xlsx +0 -0
  144. package/src/cab/perm/falcon.epic.modeling.global.xlsx +0 -0
  145. package/src/cab/perm/falcon.epic.modeling.model.xlsx +0 -0
  146. package/src/cab/perm/falcon.epic.page.xlsx +0 -0
  147. package/src/cab/perm/falcon.epic.topology.xlsx +0 -0
  148. package/src/cab/perm/falcon.fm.bank.xlsx +0 -0
  149. package/src/cab/perm/falcon.fm.bill.process.xlsx +0 -0
  150. package/src/cab/perm/falcon.fm.book.xlsx +0 -0
  151. package/src/cab/perm/falcon.fm.currency.xlsx +0 -0
  152. package/src/cab/perm/falcon.fm.debt.xlsx +0 -0
  153. package/src/cab/perm/falcon.fm.settlement.xlsx +0 -0
  154. package/src/cab/perm/falcon.fm.subject.xlsx +0 -0
  155. package/src/cab/perm/falcon.fm.term.xlsx +0 -0
  156. package/src/cab/perm/falcon.i.directory.xlsx +0 -0
  157. package/src/cab/perm/falcon.i.integration.xlsx +0 -0
  158. package/src/cab/perm/falcon.lbs.city.xlsx +0 -0
  159. package/src/cab/perm/falcon.lbs.floor.xlsx +0 -0
  160. package/src/cab/perm/falcon.lbs.query.xlsx +0 -0
  161. package/src/cab/perm/falcon.lbs.state.xlsx +0 -0
  162. package/src/cab/perm/falcon.lbs.tent.xlsx +0 -0
  163. package/src/cab/perm/falcon.login.index.xlsx +0 -0
  164. package/src/cab/perm/falcon.my.menu.xlsx +0 -0
  165. package/src/cab/perm/falcon.organization.brand.xlsx +0 -0
  166. package/src/cab/perm/falcon.organization.company.xlsx +0 -0
  167. package/src/cab/perm/falcon.organization.contract.xlsx +0 -0
  168. package/src/cab/perm/falcon.organization.customer.xlsx +0 -0
  169. package/src/cab/perm/falcon.organization.dept.team.xlsx +0 -0
  170. package/src/cab/perm/falcon.organization.dept.xlsx +0 -0
  171. package/src/cab/perm/falcon.organization.employee.identity.xlsx +0 -0
  172. package/src/cab/perm/falcon.organization.employee.xlsx +0 -0
  173. package/src/cab/perm/falcon.organization.project.xlsx +0 -0
  174. package/src/cab/perm/falcon.psi.pos.xlsx +0 -0
  175. package/src/cab/perm/falcon.psi.wh.xlsx +0 -0
  176. package/src/cab/perm/falcon.rbac.group.xlsx +0 -0
  177. package/src/cab/perm/falcon.rbac.role.xlsx +0 -0
  178. package/src/cab/perm/falcon.rbac.user.xlsx +0 -0
  179. package/src/cab/perm/falcon.system.document.xlsx +0 -0
  180. package/src/cab/perm/falcon.system.job.xlsx +0 -0
  181. package/src/cab/perm/falcon.system.report.xlsx +0 -0
  182. package/src/cab/perm/falcon.system.sync_log.xlsx +0 -0
  183. package/src/cab/perm/falcon.system.todo.xlsx +0 -0
  184. package/src/cab/perm/falcon.system.workflow.xlsx +0 -0
  185. package/src/cab/perm/falcon.ui.app.xlsx +0 -0
  186. package/src/cab/perm/falcon.view.personal.xlsx +0 -0
  187. package/src/cab/perm/falcon.x.activity.xlsx +0 -0
  188. package/src/cab/perm/falcon.x.attachment.xlsx +0 -0
  189. package/src/cab/perm/falcon.x.category.xlsx +0 -0
  190. package/src/cab/perm/falcon.x.integration.xlsx +0 -0
  191. package/src/cab/perm/falcon.x.linkage.xlsx +0 -0
  192. package/src/cab/perm/falcon.x.menu.xlsx +0 -0
  193. package/src/cab/perm/falcon.x.notice.xlsx +0 -0
  194. package/src/cab/perm/falcon.x.tabular.xlsx +0 -0
  195. package/src/cab/perm/falcon.x.tag.xlsx +0 -0
  196. package/src/cab/plugin/Component.java.tpl +52 -0
  197. package/src/cab/plugin/Cv.java.tpl +21 -0
  198. package/src/cab/plugin/ErrorIo.java.tpl +26 -0
  199. package/src/cab/plugin/In.Abstract.java.tpl +30 -0
  200. package/src/cab/plugin/In.java.tpl +25 -0
  201. package/src/cab/plugin/Io.Abstract.java.tpl +36 -0
  202. package/src/cab/plugin/Io.Impl.java.tpl +21 -0
  203. package/src/cab/plugin/Io.java.tpl +73 -0
  204. package/src/cab/plugin/Plugin.After.java.tpl +22 -0
  205. package/src/cab/plugin/Plugin.Before.java.tpl +22 -0
  206. package/src/cab/plugin/Refine.Log.java.tpl +47 -0
  207. package/src/cab/plugin/Refine.Pin.java.tpl +70 -0
  208. package/src/cab/plugin/Refine.java.tpl +67 -0
  209. package/src/cab/plugin/configuration.json.tpl +3 -0
  210. package/src/cab/plugin/infix.xml.tpl +22 -0
  211. package/src/cab/plugin/integration.json.tpl +20 -0
  212. package/src/cab/resource/falcon.resource.xlsx +0 -0
  213. package/src/cab/resource/resource.json +8 -0
  214. package/src/cab/resource/resource.xlsx +0 -0
  215. package/src/commander/ai.zero +10 -0
  216. package/src/commander/aj.zero +8 -0
  217. package/src/commander/ar.zero +4 -0
  218. package/src/commander/option.zero +21 -0
  219. package/src/commander-ai/fn.csv.js +105 -0
  220. package/src/commander-ai/fn.data.js +404 -0
  221. package/src/commander-ai/fn.init.js +106 -0
  222. package/src/commander-ai/fn.key.js +81 -0
  223. package/src/commander-ai/fn.md5.js +76 -0
  224. package/src/commander-ai/fn.random.js +84 -0
  225. package/src/commander-ai/fn.uk.js +70 -0
  226. package/src/commander-ai/fn.uuid.js +80 -0
  227. package/src/commander-ai/index.js +19 -0
  228. package/src/commander-aj/bundle/specification.txt +49 -0
  229. package/src/commander-aj/fn.i.mod.js +26 -0
  230. package/src/commander-aj/fn.i.resource.js +33 -0
  231. package/src/commander-aj/fn.j.bundle.js +51 -0
  232. package/src/commander-aj/fn.j.init.js +72 -0
  233. package/src/commander-aj/fn.j.permission.js +60 -0
  234. package/src/commander-aj/fn.j.plugin.js +120 -0
  235. package/src/commander-aj/fn.j.row.js +5 -0
  236. package/src/commander-aj/index.js +16 -0
  237. package/src/commander-ar/fn.i.complex.js +112 -0
  238. package/src/commander-ar/fn.i.form.js +91 -0
  239. package/src/commander-ar/index.js +7 -0
  240. package/src/epic/ai.economy.impl.fn.excel.js +128 -0
  241. package/src/epic/ai.economy.impl.fn.execute.js +162 -0
  242. package/src/epic/ai.economy.impl.fn.java.js +140 -0
  243. package/src/epic/ai.economy.impl.fn.json.js +23 -0
  244. package/src/epic/ai.economy.impl.fn.plugin.js +160 -0
  245. package/src/epic/ai.economy.impl.fn.react.js +219 -0
  246. package/src/epic/ai.export.impl.fn.parse.js +345 -0
  247. package/src/epic/ai.export.impl.fn.seek.js +42 -0
  248. package/src/epic/ai.export.interface.fn.string.js +5 -0
  249. package/src/epic/ai.export.interface.io.js +69 -0
  250. package/src/epic/ai.export.interface.util.js +17 -0
  251. package/src/epic/ai.path.fn.dir.operation.js +87 -0
  252. package/src/epic/ai.path.fn.io.command.js +43 -0
  253. package/src/epic/ai.path.fn.io.specification.js +59 -0
  254. package/src/epic/ai.path.fn.io.typed.js +63 -0
  255. package/src/epic/ai.path.fn.out.content.js +47 -0
  256. package/src/epic/ai.string.fn.str.util.js +56 -0
  257. package/src/epic/ai.uncork.fn.element.feature.js +52 -0
  258. package/src/epic/ai.uncork.fn.it.feature.js +118 -0
  259. package/src/epic/ai.uncork.fn.to.typed.js +74 -0
  260. package/src/epic/ai.under.fn.cx.evaluate.js +81 -0
  261. package/src/epic/ai.under.fn.fx.terminal.js +143 -0
  262. package/src/epic/ai.unified.fn._.logging.js +45 -0
  263. package/src/epic/ai.unified.fn.fn.error.code.js +114 -0
  264. package/src/epic/ai.unified.fn.is.decision.js +20 -0
  265. package/src/epic/ai.unified.fn.sorter.element.js +26 -0
  266. package/src/epic/index.js +216 -0
  267. package/src/epic/zero.__.fn.find.util.js +37 -0
  268. package/src/epic/zero.__.v.constant.js +5 -0
  269. package/test/csv.json +12 -0
  270. package/test/csv.zero +2 -0
  271. package/test/data.zero +56 -0
  272. package/test/key/key1.json +15 -0
  273. package/test/key/key2.json +12 -0
  274. package/test/key/key3.json +5 -0
  275. package/test/key.json +12 -0
  276. package/test/uk.json +19 -0
@@ -0,0 +1,114 @@
1
+ /**
2
+ * ## `Ec.E`
3
+ *
4
+ * ### 1. 基本介绍
5
+ *
6
+ * 该类为错误信息定义专用类,方法名采用`fn<Code>`的方式执行最终输出的错误信息内容。通常使用下边代码:
7
+ *
8
+ * ```js
9
+ * // 第一种调用方法:第一参直接是错误代码
10
+ * Ec.fxError(10001, arg1, arg2);
11
+ *
12
+ * // 第二种调用方法:第一参是Boolean值,true就输出,第二参是错误代码
13
+ * const checked = true;
14
+ * Ec.fxError(checked, 10001, arg1, arg2);
15
+ *
16
+ * // 第三种调用方法:第一参是Function,执行后结果为true就输出,第二参是错误代码
17
+ * const fnChecked = () => true;
18
+ * Ec.fxError(fnChecked, 10001, arg1, arg2);
19
+ * ```
20
+ *
21
+ * ### 2. 错误代码表
22
+ *
23
+ * |代码|参数表|含义|
24
+ * |---|---|:---|
25
+ * |10001|`arg,type`|输入参数类型不匹配。|
26
+ * |10002|`arg,type,expected`|「带期望」输入参数和期望参数不匹配。|
27
+ * |10003|`fileType`|文件类型无法被解析。|
28
+ * |10004|`command`|无法识别命令名,不在可解析的命令中。|
29
+ * |10005|`command,expected`|「带期望」输入的命令不在期望的命令列表中。|
30
+ * |10006|`arg`|命令执行中丢失了必须的参数。|
31
+ * |10007|`path`|输入的目录不存在,或者输入路径并不是一个目录。|
32
+ * |10008|`path`|目录不存在,或输入路径是一个文件。|
33
+ * |10009|`path`|路径直接不存在,不论目录还是文件都不存在。|
34
+ * |10010|`projects`|系统检测到两个或两个以上的项目目录,系统无法定位操作项目环境。|
35
+ * |10011|`config`|「后端」配置数据中丢失了`api`属性值。|
36
+ * |10012|`member,clazz`|「后端」在查找的`clazz`类名中无法找到(成员变量/成员函数)`member`。|
37
+ * |10013|`lineType`|工具无法分析行类型,输入的文件内容不符合Zero Ai的基本规范,无法解析源代码。|
38
+ * |10014|`pkg`|「后端」系统找到了超过两个以上的`package`语句,这个在定义过程中是非法的,不可连续执行。|
39
+ * |10015|`method,clazz`|「后端」在查找的`clazz`类名中找到了重复的(成员函数/成员变量)`method`,所以非法。|
40
+ * |10016|`command`|「前端」Zero UI规范错误,不可执行当前命令。|
41
+ * |10017|`root`|「前端」Zero项目的目录并非一个合法的项目目录,请定位到合法的项目目录中。|
42
+ * |10018|`resource`|「前端」资源文件绑定过程中出现了资源错误,请检查环境或执行命令。|
43
+ * |10019|`root`|「前端」当前命令只能在项目根目录中执行(带有package.json文件),其他目录不可执行该方法。|
44
+ * |10020|`menuData`|「前端」当前菜单数据必须是一个合法的Array类型,当前类型不对。|
45
+ * |10021|`field,value`|条件`field=value`引起了重复数据记录,导致不匹配UK规范,检查重复数据专用错误。|
46
+ * |10022|`root`|「前端/后端」无法定位项目的根目录,不可执行项目专用类命令。|
47
+ * |10023|`folder`|「前端」初始化项目时检测到输入的文件路径是一个非空目录,不可执行Zero AI的初始化。|
48
+ * |10024|`path`|当前操作和输入的路径冲突,不可在路径中执行操作指令。|
49
+ * |10025|`configKey`|「前端」配置项主键丢失了核心配置,在生成前端Web组件时出现了规范冲突。|
50
+ * |10026|`path`|「前端」输入路径非法,不在支持的Zero Ui专用路径规范中。|
51
+ * |10027|`modulePath`|「前端」输入路径必须是`<module>/<page>`格式,当前路径并非该格式,和规范冲突。|
52
+ * |10028|`arg`|「前端」模块参数不在枚举值中,必须是四者之一:`FORM, FILTER, HALF, EDIT`。|
53
+ * |10029|`zt`|「带期望」环境变量缺失或者格式不对,必须是`<module>/<page>`格式。|
54
+ * |10030|`arg, key`|「开发专用」方法要求资源文件中必须包含`key`属性,当前`key`属性值不对。|
55
+ * |10031|`id`|「开发专用」当前HTML按钮元素要求`btn`前缀,输入前缀不合法。|
56
+ * |10032|`platform`|操作系统不支持当前命令,或者该操作系统平台中还未实现该命令的执行逻辑。|
57
+ * |10033|`path`|当前路径不符合Zero专用规范(基础Java/Maven规范)。|
58
+ * |10034|`path`|当前路径不符合Ox平台专用规范。|
59
+ *
60
+ * ### 3. 规范
61
+ *
62
+ * #### 3.1. Zero规范
63
+ *
64
+ * #### 3.2. Ox规范
65
+ *
66
+ * @class E
67
+ */
68
+ module.exports = {
69
+ // 基础
70
+ fn10001: (arg, type) => `[AI-10001] Argument must be '${type}', but now it's '${arg}'`,
71
+ fn10002: (arg, type, expected) => `[AI-10002] Argument must be in (${expected}), but now it's '${arg}' of '${type}'`,
72
+
73
+ // 命令
74
+ fn10003: (fileType) => `[AI-10003] The fileType='${fileType}' is unknown and could not found parser`,
75
+ fn10004: (command) => `[AI-10004] The executor of command '${command}' could not be found`,
76
+ fn10005: (command = "未输入", expected) => `[AI-10005] The command '${command}' could not be found, expected '${expected}'`,
77
+ fn10006: (arg) => `[AI-10006] The command missed required arguments: '${arg}'`,
78
+
79
+ // 路径
80
+ fn10007: (path) => `[AI-10007] The file '${path}' does not exist or it's a directory.`,
81
+ fn10008: (path) => `[AI-10008] The directory '${path}' does not exist or it's a file.`,
82
+ fn10009: (path) => `[AI-10009] The path '${path}' does not exist.`,
83
+
84
+ // 后端
85
+ fn10010: (projects = []) => `[AI-10010] The tool detect more than one project folders, found '${projects.length}', please switch.`,
86
+ fn10011: (config) => `[AI-10011] 'api' attribute has been missed in current config ${JSON.stringify(config)}`,
87
+ fn10012: (member, clazz) => `[AI-10012] Duplicated member '${member}' found in class '${clazz}', please check.`,
88
+ fn10013: (lineType) => `[AI-10013] Zero system could not analyze the code line type, type = ${lineType} is Unknown`,
89
+ fn10014: (pkg) => `[AI-10014] More than one 'package' sentence found.${JSON.stringify(pkg)}`,
90
+ fn10015: (method, clazz) => `[AI-10015] Duplicated method '${method}' found in class '${clazz}', please check.`,
91
+
92
+ // 前端
93
+ fn10016: (command) => `[AI-10016] Zero UI specification wrong, you could not execute in '${command}'`,
94
+ fn10017: (root) => `[AI-10017] Current folder '${root}' is not project folder, please switch to project root directory`,
95
+ fn10018: (resource) => `[AI-10018] Zero Resource config file missing '${resource}', please check.`,
96
+ fn10019: (root) => `[AI-10019] This command could run in project root folder only, current folder = ${root}`,
97
+ fn10020: (menuData) => `[AI-10020] The menu data file must be json format with 'data' (Array) node, current = ${menuData}`,
98
+ fn10021: (field, value) => `[AI-10021] The condition '${field} = ${value}' hit duplicated record in your file.`,
99
+ fn10022: (root) => `[AI-10022] Could not find root folder of current project. ${root}`,
100
+ fn10023: (folder) => `[AI-10023] Initialized folder must be empty, current ${folder} is invalid`,
101
+ fn10024: (path) => `[AI-10024] This operation is not allowed for current path ${path}`,
102
+ fn10025: (configKey) => `[AI-10025] Web control initialized require "actual.data" must be string, current:${configKey}`,
103
+ fn10026: (path) => `[AI-10026] The path is invalid, ${path}, system support one of ".", "src/components/xxx", "xxx".`,
104
+ fn10027: (modulePath) => `[AI-10027] The path must be formatted with "<module>/<page>", could not be others, current = ${modulePath}`,
105
+ fn10028: (arg) => `[AI-10028] The "module" parameter must be one of "FORM", "FILTER", "HALF", "EDIT" values. current = ${arg}`,
106
+ fn10029: (zt, name) => `[AI-10029] [DEV] You'll use development command, please set "${name}" environment first, current = ${zt}. React format = "<module>/<page>", Java for other.`,
107
+ fn10030: (arg, key) => `[AI-10030] [DEV] This method require "${key}" in your resource file, but current "${key}" = ${arg}`,
108
+ fn10031: (id) => `[AI-10031] [DEV] Button key must start with "btn", current ${id}`,
109
+ fn10032: (platform) => `[AI-10032] This api is not implemented in current platform os.platform() -> '${platform}'`,
110
+ fn10033: (path) => `[AI-10033] (Zero) Current path '${path}' is not correct Zero work folder under specification`,
111
+ fn10034: (path) => `[AI-10034] (Ox) Current path '${path}' is not correct Ox work folder`,
112
+ fn10035: (path) => `[AI-10035] (Mod) The "initialize.json" configuration file has been missed in '${path}'`,
113
+ fn10036: (mode) => `[AI-10036] (Mod) The mode must be in "REPLACE, APPEND", could not been parsed: ${mode}`,
114
+ };
@@ -0,0 +1,20 @@
1
+ const fs = require('fs');
2
+ const U = require("underscore");
3
+ const isFile = (path) => {
4
+ if (fs.existsSync(path)) {
5
+ return fs.statSync(path).isFile();
6
+ }
7
+ };
8
+ const isDirectory = (path) => {
9
+ if (fs.existsSync(path)) {
10
+ return fs.statSync(path).isDirectory();
11
+ }
12
+ };
13
+ const isExist = (path) => fs.existsSync(path);
14
+
15
+ module.exports = {
16
+ isExist,
17
+ isFile,
18
+ isDirectory,
19
+ isFunction: (input) => U.isFunction(input),
20
+ }
@@ -0,0 +1,26 @@
1
+ const sortString = (left = "", right = "", asc = true) => {
2
+ const minLen = Math.max(left.length, right.length);
3
+ let order = 0;
4
+ for (let idx = 0; idx < minLen; idx++) {
5
+ let leftCode = left.charCodeAt(idx);
6
+ let rightCode = right.charCodeAt(idx);
7
+ // 空白的处理
8
+ if (leftCode !== rightCode) {
9
+ // 修正长度不等的时候的基础算法
10
+ if (isNaN(leftCode)) leftCode = 0;
11
+ if (isNaN(rightCode)) rightCode = 0;
12
+ if (asc) {
13
+ order = leftCode - rightCode;
14
+ } else {
15
+ order = rightCode - leftCode;
16
+ }
17
+ break;
18
+ }
19
+ }
20
+ return order;
21
+ };
22
+
23
+ module.exports = {
24
+ sorterSAsc: (left, right) => sortString(left, right, true),
25
+ sorterSDesc: (left, right) => sortString(left, right, false),
26
+ }
@@ -0,0 +1,216 @@
1
+ const func_interface_io = require('./ai.export.interface.io');
2
+ const func_interface_util = require("./ai.export.interface.util");
3
+ const func_interface_string = require('./ai.export.interface.fn.string');
4
+
5
+ const func_impl_parse = require('./ai.export.impl.fn.parse');
6
+ const func_impl_seek = require("./ai.export.impl.fn.seek");
7
+
8
+ const func_impl_excel = require('./ai.economy.impl.fn.excel');
9
+ const func_impl_plugin = require('./ai.economy.impl.fn.plugin');
10
+ const func_impl_react = require('./ai.economy.impl.fn.react');
11
+ const func_impl_java = require('./ai.economy.impl.fn.java');
12
+ const func_impl_execute = require('./ai.economy.impl.fn.execute');
13
+ const func_impl_json = require('./ai.economy.impl.fn.json');
14
+
15
+ const exported = {
16
+ ...func_interface_io,
17
+ ...func_interface_util,
18
+ ...func_interface_string,
19
+
20
+ ...func_impl_parse,
21
+ ...func_impl_seek,
22
+
23
+ ...func_impl_execute,
24
+ ...func_impl_excel,
25
+ ...func_impl_react,
26
+ ...func_impl_plugin,
27
+ ...func_impl_java,
28
+ ...func_impl_json,
29
+ };
30
+ /**
31
+ * @overview
32
+ *
33
+ * # Zero Ai研发文档
34
+ *
35
+ * 该文档提供给研发人员直接研发下列工具专用,最新版本`0.3.2`。
36
+ *
37
+ * ## 1. 命令清单
38
+ *
39
+ * * `ai xxx`:基础命令工具。
40
+ * * `aj xxx`:界面工具集。
41
+ *
42
+ * ## 2. Epic使用方法
43
+ *
44
+ * ```js
45
+ * const Ec = require('./epic');
46
+ * // Ec.xxx 调用全程Api
47
+ * ```
48
+ *
49
+ * ## 3. 命令表
50
+ *
51
+ * ### 3.1. 标准命令
52
+ *
53
+ * |命令执行|含义|
54
+ * |---|:---|
55
+ * |ai csv|读取数据文件中的Array数组数据转换成csv的文件格式并输出。|
56
+ * |ai data|专用数据生成器,可生成`Object/Array`两种数据格式。|
57
+ * |ai key|为输入数据中的Array或Object追加`UUID`格式的字段,字段可配置,默认为`field = key`属性。|
58
+ * |ai uk|检查输入数据中是否包含了`field1,field2,field3`属性中的重复数据,直接输出结果。|
59
+ * |ai uuid|随机生成一定数量的UUID字符串,并且拷贝到剪切板中(MacOs)。|
60
+ * |ai init|「前端」生成项目的初始化代码骨架。|
61
+ *
62
+ * ### 3.2. Zero命令
63
+ *
64
+ * |命令执行|含义|
65
+ * |---|:---|
66
+ * |aj icomplex|「模块」生成`ExListComplex`专用模块。|
67
+ * |aj iform|「组件」生成`ExForm`专用组件。|
68
+ * |aj jperm|「后端」生成权限专用的Excel数据文件。|
69
+ * |aj jplugin|「后端」针对新建的Maven项目执行Ox中集成项目的初始化代码骨架。|
70
+ * |aj jinit|「后端」生成项目的初始化代码骨架。|
71
+ *
72
+ */
73
+ /**
74
+ * ## ai命令
75
+ *
76
+ * ### 1. 基本使用
77
+ *
78
+ * ai命令的专用语法如下:
79
+ *
80
+ * ```shell
81
+ * ai <command> [options1|options2|options3...]
82
+ * ```
83
+ *
84
+ * ### 2. 命令列表
85
+ *
86
+ * |命令执行|含义|
87
+ * |---|:---|
88
+ * |ai csv|读取数据文件中的Array数组数据转换成csv的文件格式并输出。|
89
+ * |ai data|专用数据生成器,可生成`Object/Array`两种数据格式。|
90
+ * |ai key|为输入数据中的Array或Object追加`UUID`格式的字段,字段可配置,默认为`field = key`属性。|
91
+ * |ai uk|检查输入数据中是否包含了`field1,field2,field3`属性中的重复数据,直接输出结果。|
92
+ * |ai uuid|随机生成一定数量的UUID字符串,并且拷贝到剪切板中(MacOs)。|
93
+ *
94
+ * ### 3. 数据通用格式
95
+ *
96
+ * **带data节点**
97
+ *
98
+ * ```json
99
+ * {
100
+ * "data": [
101
+ * {
102
+ * "name": "Lang1",
103
+ * "email": "lang.yu1@hpe.com"
104
+ * },
105
+ * {
106
+ * "name": "Lang2",
107
+ * "email": "lang.yu2@hpe.com"
108
+ * }
109
+ * ]
110
+ * }
111
+ * ```
112
+ *
113
+ * **直接格式**
114
+ *
115
+ * ```json
116
+ * [
117
+ * {
118
+ * "name": "Lang1",
119
+ * "email": "lang.yu1@hpe.com"
120
+ * },
121
+ * {
122
+ * "name": "Lang2",
123
+ * "email": "lang.yu2@hpe.com"
124
+ * }
125
+ * ]
126
+ * ```
127
+ *
128
+ * @module ai
129
+ */
130
+ /**
131
+ * ## aj命令
132
+ *
133
+ * ### 1. 基本使用
134
+ *
135
+ * aj命令的专用语法如下:
136
+ *
137
+ * ```shell
138
+ * aj <command> [options1|options2|options3...]
139
+ * ```
140
+ *
141
+ * ### 2. 命令列表
142
+ *
143
+ * |命令执行|含义|
144
+ * |---|:---|
145
+ * |aj icomplex|「模块」生成`ExListComplex`专用模块。|
146
+ * |aj iform|「组件」生成`ExForm`专用组件。|
147
+ * |aj jperm|「后端」生成权限专用的Excel数据文件。|
148
+ *
149
+ * ### 3. 标准化配置
150
+ *
151
+ * ```js
152
+ * {
153
+ * module: 'ZT环境变量设置的模块',
154
+ * language: 'Z_LANGUAGE语言环境变量设置,默认「cn」',
155
+ * pathRoot: '系统根据执行目录计算的当前项目根目录',
156
+ * pathResource: '资源目录',
157
+ * pathUi: '生成代码目录',
158
+ * namespace: 'Cab.json中所需的名空间值',
159
+ * input: {
160
+ * params: {
161
+ * MODULE: '当前模块的文字描述名称',
162
+ * API: '构造标准接口`/api/xxx`的RESTful接口专用路径替换部分。',
163
+ * IDENTIFIER: '模型的统一标识符,最终会绑定到identifier中。'
164
+ * },
165
+ * tpl: {
166
+ * type: '使用的模板tpl文件目录,cab/下的目录名',
167
+ * source: '「单文件」单文件的拷贝源',
168
+ * target: '「单文件」单文件的目标拷贝文件'
169
+ * }
170
+ * },
171
+ * runtime: {
172
+ * namespaceFile: 'Cab.json文件生成路径',
173
+ * resource: '资源文件的根目录',
174
+ * resourceFiles: {
175
+ * 'fileName1': '资源文件地址,json后缀,模板则是fileName1.tpl文件',
176
+ * 'fileName2': '......'
177
+ * },
178
+ * ui: '代码文件根目录',
179
+ * uiFiles: {
180
+ * 'fileName1': '代码文件地址,js后缀,模板则是fileName1.tpl文件',
181
+ * 'fileName2': '......'
182
+ * }
183
+ * }
184
+ * }
185
+ * ```
186
+ *
187
+ *
188
+ * ### 4. 标准化模板参数
189
+ *
190
+ * > `tpl`文件中替换的部分会使用配置文件中的参数来替换。
191
+ *
192
+ * |参数|替换部分|含义|
193
+ * |:---|---|:---|
194
+ * |MODULE|`#MODULE#`|当前模块的文字描述名称。|
195
+ * |API|`#API#`|构造标准接口`/api/xxx`的RESTful接口专用路径替换部分。|
196
+ * |IDENTIFIER|`#IDENTIFIER#`|模型的统一标识符,最终会绑定到identifier中。|
197
+ * |NAME|`#NAME#`|绑定文件设定,直接赋值`input.params.NAME = tpl.target`生成单文件专用。|
198
+ * |SIGMA|`#SIGMA`|SIGMA统一标识符,用于标识租户、应用。|
199
+ * |ROLE_ID|`#ROLE_ID#`|操作的角色ID。|
200
+ * |PREFIX|无|生成文件专用参数,不在模板中。|
201
+ * |SHEET|无|工作专用的Sheet名,不在模板中。|
202
+ *
203
+ *
204
+ * @module aj
205
+ */
206
+ /**
207
+ * ## 调试专用
208
+ *
209
+ * @module _debug
210
+ */
211
+ /**
212
+ * ## 研发专用
213
+ *
214
+ * @module _epic
215
+ */
216
+ module.exports = exported;
@@ -0,0 +1,37 @@
1
+ const os = require("os");
2
+ const _V = require('./zero.__.v.constant');
3
+
4
+ const findTrace = (path = "") => {
5
+ const folderTrace = path.split(_V.FILE_DELIMITER).filter(each => '' !== each);
6
+ const folderInfo = [];
7
+ folderTrace.forEach((trace, index) => {
8
+ const formatted = `${_V.FILE_DELIMITER}${trace}`;
9
+ const previous = folderInfo[index - 1];
10
+ let item = null;
11
+ if (previous) {
12
+ item = `${previous}${formatted}`;
13
+ } else {
14
+ if (os.platform() === 'win32') {
15
+ item = `${trace}`
16
+ } else {
17
+ item = `${formatted}`;
18
+ }
19
+ }
20
+ folderInfo.push(item);
21
+ });
22
+ return folderInfo
23
+ };
24
+ const findMaxFields = (array = []) => {
25
+ let keys = {};
26
+ for (let idx = 0; idx < array.length; idx++) {
27
+ const length = Object.keys(array[idx]).length;
28
+ if (length > Object.keys(keys).length) {
29
+ keys = array[idx];
30
+ }
31
+ }
32
+ return Object.keys(keys);
33
+ };
34
+ module.exports = {
35
+ findTrace,
36
+ findMaxFields,
37
+ }
@@ -0,0 +1,5 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ FILE_DELIMITER: path.sep,
5
+ }
package/test/csv.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "name": "Lang1",
5
+ "email": "lang.yu1@hpe.com"
6
+ },
7
+ {
8
+ "name": "Lang2",
9
+ "email": "lang.yu2@hpe.com"
10
+ }
11
+ ]
12
+ }
package/test/csv.zero ADDED
@@ -0,0 +1,2 @@
1
+ KV;
2
+ name=Name,email=Email
package/test/data.zero ADDED
@@ -0,0 +1,56 @@
1
+ P;
2
+ key=Guid
3
+ noArray=["A","B","C"]
4
+ noFixed=$FIXED:测试值
5
+ code=Code
6
+ headCount=HeadCount
7
+ mobile=Mobile
8
+ phone=Phone
9
+ http=Http
10
+ https=Https
11
+ ftp=Ftp
12
+ domain=Domain
13
+ protocol=Protocol
14
+ ip=IP
15
+ bool=Bool
16
+ color=Color
17
+ version=Version
18
+ percent=Percent
19
+ zip=Zip
20
+ email=Email
21
+ region=Region
22
+ province=Province
23
+ city=City
24
+ city2=CityFull
25
+ county=County
26
+ countyFull=CountyFull
27
+ tld=Tld
28
+ cnName=CnName
29
+ cnFirst=CnFirst
30
+ cnCompany=CnCompany
31
+ cnDept=CnDept
32
+ cnSection=CnSection
33
+ cnScope=CnScope
34
+ cnAddress=CnAddress
35
+ cnText=CnText
36
+ cnSentence=CnSentence
37
+ cnTitle=CnTitle
38
+ cnGender=CnGender
39
+ enName=EnName
40
+ enFirst=EnFirst
41
+ enLast=EnLast
42
+ enCompany=EnCompany
43
+ enDept=EnDept
44
+ enSection=EnSection
45
+ enScope=EnScope
46
+ enAddress=EnAddress
47
+ enText=EnText
48
+ enSentence=EnSentence
49
+ enTitle=EnTitle
50
+ enGender=EnGender
51
+ iso=Iso
52
+ now=Now
53
+ date=Date
54
+ datetime=DateTime
55
+ time=Time
56
+
@@ -0,0 +1,15 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "name": "Lang1",
5
+ "email": "lang.yu1@hpe.com",
6
+ "key": "d0ebdb57-fa80-43ac-962e-8b2904cd44f0"
7
+ },
8
+ {
9
+ "name": "Lang2",
10
+ "email": "lang.yu2@hpe.com",
11
+ "key": "557ce6cf-e753-44df-9087-a7abc02355fe"
12
+ }
13
+ ],
14
+ "key": "403275c9-d768-4e34-abfa-db91bc388bea"
15
+ }
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "name": "Lang1",
4
+ "email": "lang.yu1@hpe.com",
5
+ "key": "6f1d918c-bf1e-4dd5-8e5b-968c988e56b5"
6
+ },
7
+ {
8
+ "name": "Lang2",
9
+ "email": "lang.yu2@hpe.com",
10
+ "key": "1b41e068-18ad-4041-95dd-a548bcc91bbf"
11
+ }
12
+ ]
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "Lang1",
3
+ "email": "lang.yu1@hpe.com",
4
+ "key": "2fde8d5f-5a29-49ff-a549-11a9c97ecd72"
5
+ }
package/test/key.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "name": "Lang1",
5
+ "email": "lang.yu1@hpe.com"
6
+ },
7
+ {
8
+ "name": "Lang2",
9
+ "email": "lang.yu2@hpe.com"
10
+ }
11
+ ]
12
+ }
package/test/uk.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "name": "Lang1",
5
+ "email": "lang.yu1@hpe.com",
6
+ "age": 17
7
+ },
8
+ {
9
+ "name": "Lang2",
10
+ "email": "lang.yu2@hpe.com",
11
+ "age": 17
12
+ },
13
+ {
14
+ "name": "Lang2",
15
+ "email": "lang.yu3@hpe.com",
16
+ "age": 19
17
+ }
18
+ ]
19
+ }