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,105 @@
1
+ const Ec = require('../epic');
2
+ module.exports = () => {
3
+ const actual = Ec.executeInput(
4
+ ['-p', '--path'],
5
+ [
6
+ ['-p', '--path'],
7
+ ['-c', '--config', null],
8
+ ['-s', '--separator', ',']
9
+ ]
10
+ );
11
+ const inputData = Ec.ioDataA(actual.path);
12
+ let mapping = Ec.fxContinue(Ec.isExist(actual.config), () => Ec.parseZero(actual.config));
13
+ // Csv
14
+ Ec.info(`映射配置数据:\n${JSON.stringify(mapping, null, 4)}`)
15
+ Ec.info(`使用分隔符:${actual.separator.green}`);
16
+ const csvArr = Ec.toCsv(inputData, mapping, actual.separator);
17
+ const csvData = csvArr.join('\n');
18
+ Ec.outString('.' + Ec.SEPARATOR + Ec.strUuid() + ".csv", csvData);
19
+ };
20
+
21
+ /**
22
+ * ## `ai csv`
23
+ *
24
+ * ### 1. 命令
25
+ *
26
+ * 使用该命令将读取的Array数组数据转换成csv的文件格式
27
+ *
28
+ * ### 2. 执行
29
+ *
30
+ * ```shell
31
+ * # 2.1. 命令语法
32
+ * ai csv -p <path>
33
+ *
34
+ * # 2.2. 执行测试
35
+ * ai csv -p csv.json
36
+ * # ...省略部分...
37
+ * [Zero AI] Zero AI 系统启动......
38
+ * [Zero AI] Zero AI 加载输入参数:
39
+ * {
40
+ * "path": "csv.json",
41
+ * "config": null,
42
+ * "separator": ","
43
+ * }
44
+ * [Zero AI] 使用分隔符:,
45
+ * [Zero AI] (Async)成功将数据写入到文件:./9bfe660a-d1be-48af-914f-97d996278086.csv!
46
+ * ```
47
+ *
48
+ * 输出的格式如下
49
+ *
50
+ * ```csv
51
+ * name,email
52
+ * Lang1,lang.yu1@hpe.com
53
+ * Lang2,lang.yu2@hpe.com
54
+ * ```
55
+ *
56
+ * ### 3. 选项
57
+ *
58
+ * |短参|全参|类型|默认|含义|
59
+ * |---|---|---|---|:---|
60
+ * |-p|--path|String|(无)|「统一格式」数据文件路径。|
61
+ * |-c|--config|String|null|配置文件路径。|
62
+ * |-s|--separator|String|`,`|Csv文件的分隔符设置。|
63
+ *
64
+ * ### 4. 特殊说明
65
+ *
66
+ * #### 4.1. 数据文件格式
67
+ *
68
+ * 「通用(略)」数据部分必须对等,从第一个元素开始执行所有的字段解析,如果字段不匹配则直接跳过。
69
+ *
70
+ * #### 4.2. 带mapping配置文件
71
+ *
72
+ * **csv.zero**
73
+ *
74
+ * ```shell
75
+ * # KV; 为文件前缀
76
+ * KV;
77
+ * name=Name,email=Email
78
+ * ```
79
+ *
80
+ * **多余的输出**
81
+ *
82
+ * ```shell
83
+ * .......
84
+ * [Zero AI] 映射配置数据:
85
+ * {
86
+ * "name": "Name",
87
+ * "email": "Email"
88
+ * }
89
+ * [Zero AI] 使用分隔符:,
90
+ * [Zero AI] 字段执行转换:name -> Name
91
+ * [Zero AI] 字段执行转换:email -> Email
92
+ * .......
93
+ * ```
94
+ *
95
+ * **最终数据**
96
+ *
97
+ * ```csv
98
+ * Name,Email
99
+ * Lang1,lang.yu1@hpe.com
100
+ * Lang2,lang.yu2@hpe.com
101
+ * ```
102
+ *
103
+ * @memberOf module:ai
104
+ * @method csv
105
+ */
@@ -0,0 +1,404 @@
1
+ const Ec = require('../epic');
2
+ const U = require('underscore');
3
+ const Mock = require('mockjs');
4
+ const Random = Mock.Random;
5
+ const GENERATOR = {
6
+ "Guid": () => Ec.strUuid(), // GUID格式
7
+ "Code": () => Random.string('ABCDEFGHIJKLMNOPQRSTUVWXYZ.', 6), // 大写专用格式,可带点的编码
8
+ "HeadCount": () => Random.natural(10, 1000), // 职员数量
9
+ "Mobile": () => "1" + Random.string("123456789", 10), // 手机号
10
+ // 座机
11
+ "Phone": () => "(0" + Random.string("0123456789", 2) + ") " + Random.string("0123456789", 4) + " " + Random.string("0123456789", 4),
12
+
13
+ "Http": () => Random.url('http'), // Http地址
14
+ "Https": () => Random.url('https'), // Https地址
15
+ "Ftp": () => Random.url('ftp'), // FTP地址
16
+ "Domain": () => Random.domain(), // 域名
17
+ "Protocol": () => Random.protocol(), // 协议名
18
+ "IP": () => Random.ip(), // IP地址
19
+ "Bool": () => Random.bool(), // 布尔值
20
+ "Color": () => Random.color(), // Web色彩
21
+ "Version": () => Random.natural(1, 20) + "." + Random.natural(1, 999), // 版本号
22
+ "Percent": () => Random.float(0, 0, 1, 99).toFixed(2), // 百分数
23
+
24
+ // 地理专用
25
+ "Zip": () => Random.zip(), // 邮编
26
+ "Email": () => Random.email(), // 邮箱
27
+ "Region": () => Random.region(), // 区域
28
+ "Province": () => Random.province(), // 省会
29
+ "City": () => Random.city(), // 城市
30
+ "CityFull": () => Random.city(true), // 城规全称(带前缀)
31
+ "County": () => Random.county(), // 二级县
32
+ "CountyFull": () => Random.county(true), // 二级县全称
33
+ "Tld": () => Random.tld(), // 专用
34
+
35
+ // 中文
36
+ "CnName": () => Random.cname(), // 姓名
37
+ "CnFirst": () => Random.cfirst(), // 姓
38
+ "CnCompany": () => Random.ctitle() + "公司", // 公司
39
+ "CnDept": () => Random.ctitle(2, 4) + "部", // 部门
40
+ "CnSection": () => Random.ctitle(2, 4) + "科室", // 科室
41
+ "CnScope": () => "范围" + Random.ctitle(3), // 范围
42
+ "CnAddress": () => Random.region() + Random.county(true) + Random.ctitle(), // 地址
43
+ "CnText": () => Random.cparagraph(), // 段落
44
+ "CnSentence": () => Random.csentence(), // 句子
45
+ "CnTitle": () => Random.ctitle(3, 9), // 标题
46
+ "CnGender": () => Random.pick(["男", "女"]), // 性别
47
+
48
+ // 英文
49
+ "EnName": () => Random.name(), // 英文姓名
50
+ "EnFirst": () => Random.first(), // 英文 First Name
51
+ "EnLast": () => Random.last(), // 英文 Last Name
52
+ "EnCompany": () => Random.title() + " Company", // 公司
53
+ "EnDept": () => Random.title(2, 4) + " Department", // 部门
54
+ "EnSection": () => Random.title(2, 4) + " Section", // 科室
55
+ "EnScope": () => "Scope: " + Random.ctitle(2), // 范围
56
+ "EnAddress": () => Random.first() + ', State ' + Random.title(1) + ", Street " + Random.last(), // 地址
57
+ "EnText": () => Random.paragraph(), // 段楼
58
+ "EnSentence": () => Random.sentence(), // 句子
59
+ "EnTitle": () => Random.title(3, 9), // 标题
60
+ "EnGender": () => Random.pick(["Female", "Male"]), // 性别
61
+
62
+ // 时间部分
63
+ "Iso": () => new Date(), // 当前时间:Iso格式
64
+ "Now": () => Random.now(), // 当前时间
65
+ "Date": () => Random.date(), // 日期
66
+ "DateTime": () => Random.datetime(), // 全日期/时间
67
+ "Time": () => Random.time(), // 时间
68
+ }
69
+ /*
70
+ * 1 - 10
71
+ */
72
+ for (let idx = 0; idx < 11; idx++) {
73
+ GENERATOR[`Number${idx + 1}`] = () => Random.string("0123456789", idx + 1);
74
+ GENERATOR[`EnString${idx + 1}`] = () => Random.string(idx + 1);
75
+ GENERATOR[`CnString${idx + 1}`] = () => Random.ctitle(idx + 1);
76
+ }
77
+
78
+ const generateRecord = (config = {}) => {
79
+ const record = {};
80
+ Ec.itObject(config, (field, generator) => {
81
+ if (U.isArray(generator)) {
82
+ // 随机提取数组中的某个元素,格式为数组格式
83
+ record[field] = Random.pick(generator);
84
+ } else if (generator.startsWith("$FIXED")) {
85
+ // $FIXED执行器专用
86
+ record[field] = generator.substring(generator.indexOf(":") + 1).trim();
87
+ } else {
88
+ // 标准执行器
89
+ if (GENERATOR.hasOwnProperty(generator)) {
90
+ record[field] = GENERATOR[generator]();
91
+ }
92
+ }
93
+ })
94
+ return record;
95
+ }
96
+
97
+ const generateData = (input = {}) => {
98
+ const {json = false, number = 23, config = {}} = input;
99
+ if (json) {
100
+ // Object类型
101
+ return generateRecord(config);
102
+ } else {
103
+ // Array类型
104
+ let records = [];
105
+ for (let idx = 0; idx < number; idx++) {
106
+ records.push(generateRecord(config));
107
+ }
108
+ return records;
109
+ }
110
+ }
111
+ module.exports = () => {
112
+ const actual = Ec.executeInput(
113
+ ['-c', '--config'],
114
+ [
115
+ ['-c', '--config'],
116
+ ['-o', '--out', '.'],
117
+ ['-j', '--json', false],
118
+ ['-n', '--number', 23],
119
+ ]
120
+ );
121
+ const fields = Ec.parseZero(actual.config);
122
+ if (fields) {
123
+ // 构造配置
124
+ const prepared = {};
125
+ prepared.number = actual.number;
126
+ prepared.json = actual.json;
127
+ prepared.config = fields;
128
+
129
+ // 根据配置生成数据
130
+ Ec.info(`处理过后的完整配置信息:\n${JSON.stringify(prepared, null, 4).yellow}`);
131
+ const data = generateData(prepared);
132
+
133
+ // 输出处理
134
+ if (data) {
135
+ let out = actual.out;
136
+ // 是否带有扩展名
137
+ if (!out.endsWith('json')) {
138
+ // 追加尾符
139
+ if (!out.endsWith(Ec.SEPARATOR)) {
140
+ out = out + Ec.SEPARATOR;
141
+ }
142
+ //
143
+ out = out + Ec.strUuid() + ".json";
144
+ }
145
+ // 基础数据规范
146
+ let content = {};
147
+ content.data = data;
148
+ if (U.isArray(data)) {
149
+ content.count = actual.number;
150
+ }
151
+ Ec.outJson(out, content);
152
+ } else {
153
+ Ec.warn(`生成数据失败!!!`)
154
+ }
155
+ }
156
+ }
157
+
158
+ /**
159
+ * ## `ai data`
160
+ *
161
+ * ### 1. 命令
162
+ *
163
+ * 根据规则随机生成数据Object/Array的专用命令。
164
+ *
165
+ * ### 2. 执行
166
+ *
167
+ * ```shell
168
+ * # 2.1. 命令语法
169
+ * ai data -c <config>
170
+ *
171
+ * # 2.2. 执行测试
172
+ * ai data -c data.zero -j true
173
+ * # ...省略部分...
174
+ * [Zero AI] Zero AI 系统启动......
175
+ * [Zero AI] Zero AI 加载输入参数:
176
+ * {
177
+ * "config": "data.zero",
178
+ * "out": ".",
179
+ * "json": "true",
180
+ * "number": 23
181
+ * }
182
+ * [Zero AI] 处理过后的完整配置信息:
183
+ * {
184
+ * "number": 23,
185
+ * "json": "true",
186
+ * "config": {
187
+ * "key": "Guid",
188
+ * "code": "Code",
189
+ * "array1": [
190
+ * "A",
191
+ * "B",
192
+ * "C"
193
+ * ],
194
+ * "fixed": "$FIXED:测试值",
195
+ * "date1": "ISO"
196
+ * }
197
+ * }
198
+ * [Zero AI] (Async)成功将数据写入到文件:./4f945df8-9d27-4169-9b18-d6d6385a310c.json!
199
+ * ```
200
+ *
201
+ * ### 3. 选项
202
+ *
203
+ * |短参|全参|类型|默认|含义|
204
+ * |---|---|---|---|:---|
205
+ * |-c|--config|String|(无)|配置文件路径。|
206
+ * |-o|--out|String|`.`|输出目录文件路径,文件名随机UUID。|
207
+ * |-j|--json|Boolean|false|是否生成Object数据格式,true则生成,否则生成Array格式。|
208
+ * |-n|--number|Number|23|只有`json = false`时生效,生成Array的数据条数。|
209
+ *
210
+ * ### 4. 生成器设置
211
+ *
212
+ * #### 4.1. 生成器说明
213
+ *
214
+ * |生成规则|说明|
215
+ * |---|:---|
216
+ * |[]|从数组中随机读取一个元素执行赋值。|
217
+ * |$FIX:X|生成固定值`X`赋值给记录中的属性。|
218
+ * |Guid|随机生成UUID字符串。|
219
+ * |Code|系统编码字符串(只支持大写和点操作符27个字符),生成长度为6。|
220
+ * |HeadCount|企业内部员工数量。|
221
+ * |Mobile|手机号码。|
222
+ * |Phone|座机号码。|
223
+ * |Http|生成`http://`链接。|
224
+ * |Https|生成`https://`链接。|
225
+ * |Ftp|生成`ftp://`链接。|
226
+ * |Domain|生成随机域名。|
227
+ * |Protocol|随机生成协议。|
228
+ * |IP|随机生成IP地址。|
229
+ * |Bool|随机布尔值。|
230
+ * |Color|随机Web色彩:`#xxxxxx`格式。|
231
+ * |Version|生成版本号(通常是软件版本号)。|
232
+ * |Percent|随机百分数。|
233
+ * |Zip|随机邮编。|
234
+ * |Email|随机电子信箱。|
235
+ * |Region|随机区域信息。|
236
+ * |Province|随机省会信息。|
237
+ * |City|随机城市信息。|
238
+ * |CityFull|随机城市全称,带区域。|
239
+ * |County|随机二级县。|
240
+ * |CountyFull|随机二级县全称。|
241
+ * |Tld|随机顶级域名。|
242
+ * |CnName|随机姓名。|
243
+ * |CnFirst|随机姓。|
244
+ * |CnCompany|随机公司。|
245
+ * |CnDept|随机部门。|
246
+ * |CnSection|随机科室。|
247
+ * |CnScope|随机范围。|
248
+ * |CnAddress|随机地址。|
249
+ * |CnText|随机段落文字。|
250
+ * |CnSentence|随机句子。|
251
+ * |CnTitle|随机标题。|
252
+ * |CnGender|随机性别。|
253
+ * |EnName|随机姓名。|
254
+ * |EnFirst|随机 First Name。|
255
+ * |EnLast|随机 Last Name。|
256
+ * |EnCompany|随机公司。|
257
+ * |EnDept|随机部门。|
258
+ * |EnSection|随机科室。|
259
+ * |EnScope|随机范围。|
260
+ * |EnAddress|随机地址。|
261
+ * |EnText|随机段落文字。|
262
+ * |EnSentence|随机句子。|
263
+ * |EnTitle|随机标题。|
264
+ * |EnGender|随机性别。|
265
+ * |Iso|ISO时间格式。|
266
+ * |Now|当前时间格式。|
267
+ * |Date|日期。|
268
+ * |DateTime|日期/时间。|
269
+ * |Time|时间。|
270
+ * |NumberX|随机数字。|
271
+ * |EnStringX|随机字符串。|
272
+ * |CnStringX|随机字符串。|
273
+ *
274
+ * * `En/Cn`前缀分别代表中文和英文。
275
+ * * `NumberX, EnStringX, CnStringX`可使用数字当后缀,数值表示长度,从`1 - 10`。
276
+ *
277
+ * #### 4.2. data.zero例子
278
+ *
279
+ * **配置文件**
280
+ *
281
+ * ```shell
282
+ * P;
283
+ * key=Guid
284
+ * noArray=["A","B","C"]
285
+ * noFixed=$FIXED:测试值
286
+ * code=Code
287
+ * headCount=HeadCount
288
+ * mobile=Mobile
289
+ * phone=Phone
290
+ * http=Http
291
+ * https=Https
292
+ * ftp=Ftp
293
+ * domain=Domain
294
+ * protocol=Protocol
295
+ * ip=IP
296
+ * bool=Bool
297
+ * color=Color
298
+ * version=Version
299
+ * percent=Percent
300
+ * zip=Zip
301
+ * email=Email
302
+ * region=Region
303
+ * province=Province
304
+ * city=City
305
+ * city2=CityFull
306
+ * county=County
307
+ * countyFull=CountyFull
308
+ * tld=Tld
309
+ * cnName=CnName
310
+ * cnFirst=CnFirst
311
+ * cnCompany=CnCompany
312
+ * cnDept=CnDept
313
+ * cnSection=CnSection
314
+ * cnScope=CnScope
315
+ * cnAddress=CnAddress
316
+ * cnText=CnText
317
+ * cnSentence=CnSentence
318
+ * cnTitle=CnTitle
319
+ * cnGender=CnGender
320
+ * enName=EnName
321
+ * enFirst=EnFirst
322
+ * enLast=EnLast
323
+ * enCompany=EnCompany
324
+ * enDept=EnDept
325
+ * enSection=EnSection
326
+ * enScope=EnScope
327
+ * enAddress=EnAddress
328
+ * enText=EnText
329
+ * enSentence=EnSentence
330
+ * enTitle=EnTitle
331
+ * enGender=EnGender
332
+ * iso=Iso
333
+ * now=Now
334
+ * date=Date
335
+ * datetime=DateTime
336
+ * time=Time
337
+ * ```
338
+ *
339
+ * **数据内容**
340
+ *
341
+ * ```json
342
+ * {
343
+ "data": {
344
+ "key": "23121742-2dab-4ac6-b578-2f6720410cfb",
345
+ "noArray": "C",
346
+ "noFixed": "测试值",
347
+ "code": "KPEX.T",
348
+ "headCount": 929,
349
+ "mobile": "18488562585",
350
+ "phone": "(012) 4610 1140",
351
+ "http": "http://atrtyq.lu/oqkpau",
352
+ "https": "https://qpvpuuvfk.do/hrfmjfp",
353
+ "ftp": "ftp://osonkoesp.bf/tzghunec",
354
+ "domain": "vqjxomib.hk",
355
+ "protocol": "mid",
356
+ "ip": "64.198.160.131",
357
+ "bool": false,
358
+ "color": "#f2d779",
359
+ "version": "3.569",
360
+ "percent": "0.09",
361
+ "zip": "664855",
362
+ "email": "w.omwjnhtfyg@ydjyl.ml",
363
+ "region": "华南",
364
+ "province": "山东省",
365
+ "city": "来宾市",
366
+ "city2": "台湾 基隆市",
367
+ "county": "普兰店市",
368
+ "countyFull": "吉林省 辽源市 东辽县",
369
+ "tld": "gi",
370
+ "cnName": "梁桂英",
371
+ "cnFirst": "何",
372
+ "cnCompany": "除成地界记头布公司",
373
+ "cnDept": "形东严克部",
374
+ "cnSection": "及着系科室",
375
+ "cnScope": "范围效教对",
376
+ "cnAddress": "华南湖南省 郴州市 临武县克加头被",
377
+ "cnText": "地量好和儿县国主然格作提阶行。见快油个革想除当术取且可强地及至接院......",
378
+ "cnSentence": "每光越主识比习接问织眼导社连且到教。",
379
+ "cnTitle": "来却后市定越下较",
380
+ "cnGender": "男",
381
+ "enName": "Matthew Clark",
382
+ "enFirst": "Frank",
383
+ "enLast": "Allen",
384
+ "enCompany": "Rvo Ynfg Ickxlfloy Vuux Company",
385
+ "enDept": "Wnqxdzhse Ysericfry Vfewslfgdf Wqlxd Department",
386
+ "enSection": "Vxdialugp Rdwicyvh Section",
387
+ "enScope": "Scope: 持太",
388
+ "enAddress": "Sandra, State Hinp, Street Martinez",
389
+ "enText": "Nlebzn thwuouuth holdtxltqm npqb fzlsr smhjohs .......",
390
+ "enSentence": "Ufhnqddg eikesnc xawwb vsmuvop qhorlgvel .......",
391
+ "enTitle": "Feyv Apareaaif Ygnddotmr Jryvw",
392
+ "enGender": "Female",
393
+ "iso": "2021-03-16T09:54:43.442Z",
394
+ "now": "2021-03-16 17:54:43",
395
+ "date": "1988-11-05",
396
+ "datetime": "1989-04-05 17:40:52",
397
+ "time": "23:16:00"
398
+ }
399
+ }
400
+ * ```
401
+ *
402
+ * @memberOf module:ai
403
+ * @method data
404
+ */
@@ -0,0 +1,106 @@
1
+ const Ec = require("../epic");
2
+ const child = require('child_process');
3
+ module.exports = () => {
4
+ const actual = Ec.executeInput(
5
+ [
6
+ ['-n', '--name']
7
+ ],
8
+ [
9
+ ['-n', '--name']
10
+ ]
11
+ );
12
+ // 第一步:环境检查
13
+ if (Ec.isExist(".git")) {
14
+ Ec.error("请选择不带`.git`或`vertx-ui`的目录执行当前命令,最好使用空目录!");
15
+ return;
16
+ }
17
+ // 第二步:检查 vertx-ui
18
+ const target = actual.name;
19
+ Ec.info(`工程构建目录:${target}`);
20
+ const cmd = `git clone https://gitee.com/silentbalanceyh/vertx-ui.git ${target}`;
21
+ child.execSync(cmd, {stdio: 'inherit'});
22
+ // 删除目标目录中的 .git 文件夹
23
+ Ec.info(`执行工程初始化:${target}`);
24
+ const cmdGit = `rm -rf ${target}/.git`;
25
+ child.execSync(cmdGit, {stdio: 'inherit'});
26
+ // 读取目标目录
27
+ const content = Ec.ioJObject(`${target}/package.json`);
28
+ content.name = target;
29
+ Ec.outJson(`${target}/package.json`, content, true);
30
+ // 后期脚本
31
+ const commands = [
32
+ `rm -rf ${target}/.zero/*`,
33
+ `rm -rf ${target}/document/doc-web/*`,
34
+ `rm -rf ${target}/document/doc-web-extension/*`,
35
+ `rm -rf ${target}/guide/`,
36
+ `rm -rf ${target}/_config.yml`,
37
+ `rm -rf ${target}/CNAME`,
38
+ `rm -rf ${target}/data.json`,
39
+ `rm -rf ${target}/LICENSE`,
40
+ `rm -rf ${target}/package-lock.json`,
41
+ `rm -rf ${target}/yarn.lock`,
42
+ ]
43
+ Ec.info(`执行后期处理:......`.yellow);
44
+ commands.forEach(command => {
45
+ Ec.info(`资源清理中:${command.prompt}`);
46
+ child.execSync(command, {stdio: 'inherit'})
47
+ })
48
+ Ec.info(`工程初始化完成:${target},您可以开始您的Zero Ui之行了!`.help);
49
+ }
50
+ /**
51
+ * ## `ai init`
52
+ *
53
+ * ### 1. 命令
54
+ *
55
+ * vertx-ui项目脚手架初始化专用命令。
56
+ *
57
+ * ### 2. 执行
58
+ *
59
+ * ```shell
60
+ * # 2.1. 命令语法
61
+ * ai init -name <name>
62
+ *
63
+ * # 2.2. 执行测试
64
+ * ai init -name test-demo
65
+ * [Zero AI] Zero AI 代码生成工具 : <标准工具>
66
+ * [Zero AI] HomePage : http://www.vertxai.cn
67
+ * [Zero AI] Github : https://github.com/silentbalanceyh/vertx-ai.git
68
+ * [Zero AI] Version : 0.3.2 「确认您的Node版本 ( >= 14.x ) 支持ES6, ES7.」
69
+ * [Zero AI] Zero AI 系统启动......
70
+ * [Zero AI] Zero AI 加载输入参数:
71
+ * {
72
+ "name": "test-demo"
73
+ * }
74
+ * [Zero AI] 工程构建目录:test-demo
75
+ * Cloning into 'test-demo'...
76
+ * remote: Enumerating objects: 888, done.
77
+ * remote: Counting objects: 100% (888/888), done.
78
+ * remote: Compressing objects: 100% (538/538), done.
79
+ * remote: Total 36593 (delta 445), reused 610 (delta 339), pack-reused 35705
80
+ * Receiving objects: 100% (36593/36593), 29.09 MiB | 151.00 KiB/s, done.
81
+ * Resolving deltas: 100% (24009/24009), done.
82
+ * [Zero AI] 执行工程初始化:test-demo
83
+ * [Zero AI] (Sync)成功将数据写入到文件:test-demo/package.json!
84
+ * [Zero AI] 执行后期处理:......
85
+ * [Zero AI] 资源清理中:rm -rf test-demo/.zero/*
86
+ * [Zero AI] 资源清理中:rm -rf test-demo/document/doc-web/*
87
+ * [Zero AI] 资源清理中:rm -rf test-demo/document/doc-web-extension/*
88
+ * [Zero AI] 资源清理中:rm -rf test-demo/guide/
89
+ * [Zero AI] 资源清理中:rm -rf test-demo/_config.yml
90
+ * [Zero AI] 资源清理中:rm -rf test-demo/CNAME
91
+ * [Zero AI] 资源清理中:rm -rf test-demo/data.json
92
+ * [Zero AI] 资源清理中:rm -rf test-demo/LICENSE
93
+ * [Zero AI] 资源清理中:rm -rf test-demo/package-lock.json
94
+ * [Zero AI] 资源清理中:rm -rf test-demo/yarn.lock
95
+ * [Zero AI] 工程初始化完成:test-demo,您可以开始您的Zero Ui之行了!
96
+ * ```
97
+ *
98
+ * ### 3. 选项
99
+ *
100
+ * |短参|全参|类型|默认|含义|
101
+ * |---|---|---|---|:---|
102
+ * |-n|--name|String|(无)|项目名称以及目录名称。|
103
+ *
104
+ * @memberOf module:ai
105
+ * @method init
106
+ */
@@ -0,0 +1,81 @@
1
+ const Ec = require('../epic');
2
+ const U = require('underscore');
3
+
4
+ const applyEach = (data = {}, field = 'key') => {
5
+ if (U.isArray(data)) {
6
+ data.forEach(element => {
7
+ if ("object" === typeof element) {
8
+ applyEach(element, field);
9
+ }
10
+ })
11
+ } else {
12
+ Ec.itObject(data, (key, value) => {
13
+ if ("object" === typeof value) {
14
+ applyEach(value, field);
15
+ }
16
+ })
17
+ if (!data[field]) {
18
+ data[field] = Ec.strUuid();
19
+ }
20
+ }
21
+ };
22
+ module.exports = () => {
23
+ const actual = Ec.executeInput(
24
+ [
25
+ ['-p', '--path']
26
+ ],
27
+ [
28
+ ['-p', '--path'],
29
+ ['-f', '--field', 'key']
30
+ ]
31
+ );
32
+
33
+ Ec.cxExist(actual.path);
34
+ Ec.itFileSync(actual.path, (item) => {
35
+ // 读取基础数据信息
36
+ const content = Ec.ioString(item);
37
+ // 顶层引用
38
+ const rootRef = JSON.parse(content);
39
+ applyEach(rootRef, actual.field);
40
+ // 路径替换
41
+ Ec.outJson(item, rootRef);
42
+ });
43
+ }
44
+
45
+ /**
46
+ * ## `ai key`
47
+ *
48
+ * ### 1. 命令
49
+ *
50
+ * 使用该命令针对数据中的所有节点追加`field = key`的UUID值。
51
+ *
52
+ * ### 2. 执行
53
+ *
54
+ * ```shell
55
+ * # 2.1. 命令语法
56
+ * ai key -p <path>
57
+ *
58
+ * # 2.2. 执行测试
59
+ * ai key -p key
60
+ * # ...省略部分...
61
+ * [Zero AI] Zero AI 系统启动......
62
+ * [Zero AI] Zero AI 加载输入参数:
63
+ * {
64
+ * "path": "key",
65
+ * "field": "key"
66
+ * }
67
+ * [Zero AI] (Async)成功将数据写入到文件:key/key2.json!
68
+ * [Zero AI] (Async)成功将数据写入到文件:key/key3.json!
69
+ * [Zero AI] (Async)成功将数据写入到文件:key/key1.json!
70
+ * ```
71
+ *
72
+ * ### 3. 选项
73
+ *
74
+ * |短参|全参|类型|默认|含义|
75
+ * |---|---|---|---|:---|
76
+ * |-p|--path|String|(无)|「统一格式」数据文件路径。|
77
+ * |-f|--field|String|key|追加的UUID的字段名。|
78
+ *
79
+ * @memberOf module:ai
80
+ * @method key
81
+ */