zero-ai 0.3.32 → 0.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -20
- package/package.json +3 -4
- package/run-authorize.sh +1 -1
- package/src/_template/SERVICE/database/database-reinit.sh +3 -0
- package/src/_template/SERVICE/database/database-reinit.sql +5 -0
- package/src/_template/SERVICE/database/init-db.sh +5 -0
- package/src/_template/SERVICE/pom.xml.ejs +20 -0
- package/src/_template/SERVICE/source-api/pom.xml.ejs +21 -0
- package/src/_template/SERVICE/source-domain/pom.xml.ejs +37 -0
- package/src/_template/SERVICE/source-provider/pom.xml.ejs +21 -0
- package/src/ai.js +11 -5
- package/src/cab/perm/falcon.fm.bill.process.xlsx +0 -0
- package/src/cab/perm/falcon.fm.trans.xlsx +0 -0
- package/src/cab/perm/falcon.i.message.xlsx +0 -0
- package/src/cab/perm/falcon.my.notify.xlsx +0 -0
- package/src/cab/perm/falcon.system.ticket.xlsx +0 -0
- package/src/commander/ai.zero +7 -11
- package/src/commander/app.json +18 -0
- package/src/commander/help.json +7 -0
- package/src/commander/md5.json +12 -0
- package/src/commander/mod.json +24 -0
- package/src/commander/option.zero +1 -0
- package/src/commander/str.json +25 -0
- package/src/commander/sync.json +19 -0
- package/src/commander/uuid.json +13 -0
- package/src/commander/web.json +12 -0
- package/src/commander-ai/fn.help.metadata.js +20 -0
- package/src/commander-ai/{fn.md5.js → fn.random.md5.js} +6 -12
- package/src/commander-ai/{fn.random.js → fn.random.string.js} +10 -13
- package/src/commander-ai/{fn.uuid.js → fn.random.uuid.js} +5 -9
- package/src/commander-ai/fn.source.app.js +15 -0
- package/src/commander-ai/fn.source.front.js +106 -0
- package/src/commander-ai/fn.source.mod.js +15 -0
- package/src/commander-ai/{fn.sync.js → fn.source.sync.js} +12 -17
- package/src/commander-ai/index.js +18 -23
- package/src/commander-shared/ai.fn.initialize.io.js +86 -0
- package/src/commander-shared/ai.fn.initialize.module.js +56 -0
- package/src/commander-shared/ai.fn.parse.argument.js +92 -0
- package/src/commander-shared/index.js +6 -0
- package/src/epic/ai.economy.impl.fn.execute.js +11 -56
- package/src/epic/ai.string.fn.str.util.js +9 -2
- package/src/epic/ai.unified.fn._.logging.js +4 -25
- package/src/epic/ai.unified.fn.fn.error.code.js +1 -1
- package/src/epic/index.js +2 -2
- package/src/{aj.js → previous/aj.js} +1 -1
- package/src/{art.js → previous/art.js} +1 -1
- package/src/{commander-aj → previous/commander-aj}/fn.i.mod.js +1 -1
- package/src/{commander-aj → previous/commander-aj}/fn.i.resource.js +1 -1
- package/src/{commander-aj → previous/commander-aj}/fn.j.bundle.js +1 -1
- package/src/{commander-aj → previous/commander-aj}/fn.j.init.js +2 -2
- package/src/{commander-aj → previous/commander-aj}/fn.j.permission.js +1 -1
- package/src/{commander-aj → previous/commander-aj}/fn.j.plugin.js +1 -1
- package/src/{commander-ar → previous/commander-ar}/fn.i.complex.js +1 -1
- package/src/{commander-ar → previous/commander-ar}/fn.i.form.js +1 -1
- /package/src/{commander → previous}/aj.zero +0 -0
- /package/src/{commander → previous}/ar.zero +0 -0
- /package/src/{commander-aj → previous/commander-aj}/bundle/specification.txt +0 -0
- /package/src/{commander-aj → previous/commander-aj}/index.js +0 -0
- /package/src/{commander-ar → previous/commander-ar}/index.js +0 -0
- /package/src/{commander-ai → previous}/fn.csv.js +0 -0
- /package/src/{commander-ai → previous}/fn.data.js +0 -0
- /package/src/{commander-ai → previous}/fn.init.js +0 -0
- /package/src/{commander-ai → previous}/fn.key.js +0 -0
- /package/src/{commander-ai → previous}/fn.uk.js +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Zero工具箱
|
|
2
2
|
|
|
3
|
-
Zero
|
|
3
|
+
Zero工具箱为一个工具类型的项目,主要为后端项目和前端项目打造的辅助开发人员进行快速开发的命令行工具,该工具可以帮助开发人员执行
|
|
4
|
+
`Zero/Zero Ui`
|
|
4
5
|
的智能化开发,版本会持续发布到npm社区。
|
|
5
6
|
|
|
6
7
|
* 详细文档:[Zero Ai命令](http://www.vertxai.cn/document/doc-web/index.html)
|
|
@@ -26,31 +27,13 @@ npm install -g zero-ai
|
|
|
26
27
|
|
|
27
28
|
```
|
|
28
29
|
/usr/local/bin/ai -> /usr/local/lib/node_modules/vertx-ai/src/ai.js
|
|
29
|
-
/usr/local/bin/aj -> /usr/local/lib/node_modules/vertx-ai/src/aj.js
|
|
30
|
-
/usr/local/bin/art -> /usr/local/lib/node_modules/vertx-ai/src/ar.js
|
|
31
30
|
+ zero-ai@0.3.25
|
|
32
31
|
added 77 packages from 119 contributors in 8.417s
|
|
33
32
|
```
|
|
34
33
|
|
|
35
34
|
## 2. 常用命令说明
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- ai:标准命令
|
|
40
|
-
- aj:后端专用命令(For Java)
|
|
41
|
-
- art:前端开发命令(For React)
|
|
42
|
-
|
|
43
|
-
### 2.2. 工程初始化
|
|
44
|
-
|
|
45
|
-
```shell
|
|
46
|
-
# 前端工程初始化
|
|
47
|
-
ai init -name <name>
|
|
48
|
-
# 前端工程更新
|
|
49
|
-
ai sync
|
|
50
|
-
|
|
51
|
-
# 后端工程初始化
|
|
52
|
-
aj init
|
|
53
|
-
```
|
|
36
|
+
核心命令处理:`ai <command> [options]`
|
|
54
37
|
|
|
55
38
|
|
|
56
39
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zero-ai",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "Zero Ecotope AI",
|
|
5
5
|
"main": "src/ai.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ai": "./src/ai.js"
|
|
8
|
-
"aj": "./src/aj.js",
|
|
9
|
-
"art": "./src/art.js"
|
|
7
|
+
"ai": "./src/ai.js"
|
|
10
8
|
},
|
|
11
9
|
"scripts": {
|
|
12
10
|
"test": "src/index.test.js"
|
|
@@ -33,6 +31,7 @@
|
|
|
33
31
|
"commander": "^11.0.0",
|
|
34
32
|
"crypto-js": "^4.1.1",
|
|
35
33
|
"dox": "^1.0.0",
|
|
34
|
+
"ejs": "^3.1.10",
|
|
36
35
|
"exceljs": "^4.3.0",
|
|
37
36
|
"extend": "^3.0.2",
|
|
38
37
|
"handlebars": "^4.7.7",
|
package/run-authorize.sh
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
export ROOT=/Users/lang/zero-cloud/
|
|
2
|
+
export ROOT=/Users/lang/zero-cloud/web-app/workshop/zero-ws/zero-extension
|
|
3
3
|
echo "拷贝 zero-ambient 权限"
|
|
4
4
|
cp -rf ${ROOT}/zero-ambient/src/main/resources/plugin/ambient/oob/role/ADMIN.SUPER/* ./src/cab/perm/
|
|
5
5
|
echo "拷贝 zero-atom 权限"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
+
<modelVersion>4.0.0</modelVersion>
|
|
6
|
+
<parent>
|
|
7
|
+
<groupId>io.zerows</groupId>
|
|
8
|
+
<artifactId>zero-plugins-extension</artifactId>
|
|
9
|
+
<version>1.0.0</version>
|
|
10
|
+
</parent>
|
|
11
|
+
|
|
12
|
+
<artifactId><%= id %></artifactId>
|
|
13
|
+
<name>(POM) 📚️ - Zero::Extension::<%= name %></name>
|
|
14
|
+
<modules>
|
|
15
|
+
<module><%= id %>-domain</module>
|
|
16
|
+
<module><%= id %>-provider</module>
|
|
17
|
+
<module><%= id %>-api</module>
|
|
18
|
+
</modules>
|
|
19
|
+
<packaging>pom</packaging>
|
|
20
|
+
</project>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
+
<modelVersion>4.0.0</modelVersion>
|
|
6
|
+
<parent>
|
|
7
|
+
<groupId>io.zerows</groupId>
|
|
8
|
+
<artifactId><%= id %></artifactId>
|
|
9
|
+
<version>1.0.0</version>
|
|
10
|
+
</parent>
|
|
11
|
+
|
|
12
|
+
<artifactId><%= id %>-api</artifactId>
|
|
13
|
+
<name>Zero::Extension💎 - <%= name %>::Api</name>
|
|
14
|
+
<dependencies>
|
|
15
|
+
<dependency>
|
|
16
|
+
<groupId>io.zerows</groupId>
|
|
17
|
+
<artifactId><%= id %>-provider</artifactId>
|
|
18
|
+
<version>${project.version}</version>
|
|
19
|
+
</dependency>
|
|
20
|
+
</dependencies>
|
|
21
|
+
</project>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
+
<modelVersion>4.0.0</modelVersion>
|
|
6
|
+
<parent>
|
|
7
|
+
<groupId>io.zerows</groupId>
|
|
8
|
+
<artifactId><%= id %></artifactId>
|
|
9
|
+
<version>1.0.0</version>
|
|
10
|
+
</parent>
|
|
11
|
+
|
|
12
|
+
<artifactId><%= id %>-domain</artifactId>
|
|
13
|
+
<name>Zero::Extension💎 - <%= name %>::Domain</name>
|
|
14
|
+
<dependencies>
|
|
15
|
+
<dependency>
|
|
16
|
+
<groupId>io.zerows</groupId>
|
|
17
|
+
<artifactId>zero-extension-skeleton</artifactId>
|
|
18
|
+
</dependency>
|
|
19
|
+
</dependencies>
|
|
20
|
+
<build>
|
|
21
|
+
<plugins>
|
|
22
|
+
<plugin>
|
|
23
|
+
<groupId>org.liquibase</groupId>
|
|
24
|
+
<artifactId>liquibase-maven-plugin</artifactId>
|
|
25
|
+
<configuration>
|
|
26
|
+
<propertyProviderClass>io.zerows.plugins.liquibase.LiquibaseEncryptionZero</propertyProviderClass>
|
|
27
|
+
<!-- 配置文件路径 -->
|
|
28
|
+
<propertyFile>plugins/${project.parent.artifactId}/database/MYSQL.properties</propertyFile>
|
|
29
|
+
<changeLogFile>plugins/${project.parent.artifactId}/database/MYSQL.yml</changeLogFile>
|
|
30
|
+
<!-- 配置参数 -->
|
|
31
|
+
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
|
|
32
|
+
<outputFileEncoding>UTF-8</outputFileEncoding>
|
|
33
|
+
</configuration>
|
|
34
|
+
</plugin>
|
|
35
|
+
</plugins>
|
|
36
|
+
</build>
|
|
37
|
+
</project>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
5
|
+
<modelVersion>4.0.0</modelVersion>
|
|
6
|
+
<parent>
|
|
7
|
+
<groupId>io.zerows</groupId>
|
|
8
|
+
<artifactId><%= id %></artifactId>
|
|
9
|
+
<version>1.0.0</version>
|
|
10
|
+
</parent>
|
|
11
|
+
|
|
12
|
+
<artifactId><%= id %>-provider</artifactId>
|
|
13
|
+
<name>Zero::Extension💎 - <%= name %>::Provider</name>
|
|
14
|
+
<dependencies>
|
|
15
|
+
<dependency>
|
|
16
|
+
<groupId>io.zerows</groupId>
|
|
17
|
+
<artifactId><%= id %>-domain</artifactId>
|
|
18
|
+
<version>${project.version}</version>
|
|
19
|
+
</dependency>
|
|
20
|
+
</dependencies>
|
|
21
|
+
</project>
|
package/src/ai.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const Ec = require('./epic');
|
|
3
|
+
const Ut = require('./commander-shared');
|
|
3
4
|
const Executor = require('./commander-ai');
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// 输出头部
|
|
8
|
+
Ec.executeHeader("Rachel Momo Command");
|
|
9
|
+
|
|
10
|
+
|
|
5
11
|
// 读取配置文件
|
|
6
|
-
|
|
7
|
-
configArr = Ec.itArray(configArr, (config) => Ec.itCompress(config, "option"));
|
|
8
|
-
// Commander的执行
|
|
12
|
+
const configArr = Ut.parseMetadata();
|
|
9
13
|
Ec.executeBody(configArr, Executor);
|
|
10
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// 输出尾部
|
|
11
17
|
Ec.executeEnd();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/commander/ai.zero
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
A;
|
|
2
|
-
command, executor,
|
|
3
|
-
uuid, executeUuid,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
md5, executeMD5, 加密字符串,可直接拷贝, i=输入字符串
|
|
10
|
-
init, executeInit, 初始化Zero Ui工程, n=项目名称(必须填写,最终写入package.json)
|
|
11
|
-
sync, executeSync, 同步Zero Ui最新框架, p=配置文件路径,前端项目根目录,m=是否本地模式
|
|
12
|
-
|
|
2
|
+
command, executor, description, option1,option2, option3, option4
|
|
3
|
+
uuid, executeUuid, 生成UUID的值,可直接拷贝, n=「20」生成的数量
|
|
4
|
+
str, executeString, 生成随机字符串,可直接拷贝, n=「1」生成的数量, l=「64」长度信息(默认64),f=是否完全生成
|
|
5
|
+
md5, executeMD5, 加密字符串,可直接拷贝, i=输入字符串
|
|
6
|
+
sync, executeFrontendSync, 同步Zero Ui最新框架, p=配置文件路径,前端项目根目录,m=是否本地模式
|
|
7
|
+
app, executeApp, 生成Zero 微服务实例, p=配置文件路径,n=名称(最小模式)
|
|
8
|
+
mod, executeMod, 生成Zero 扩展模块实例, p=配置文件路径,n=名称(完整模式)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executor": "executeApp",
|
|
3
|
+
"description": "(后端)创建一个新的 Zero App 脚手架!",
|
|
4
|
+
"command": "app",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"name": "name",
|
|
8
|
+
"alias": "n",
|
|
9
|
+
"description": "创建应用的名称!"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "path",
|
|
13
|
+
"alias": "p",
|
|
14
|
+
"description": "默认应用的输出路径,若不制定为当前路径!",
|
|
15
|
+
"default": "."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executor": "executeMod",
|
|
3
|
+
"description": "(后端)创建一个新的 Zero Extension 模块脚手架!",
|
|
4
|
+
"command": "mod",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"name": "module",
|
|
8
|
+
"alias": "m",
|
|
9
|
+
"description": "创建模块的名称!"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "config",
|
|
13
|
+
"alias": "c",
|
|
14
|
+
"description": "配置文件路径,默认读取 mod.json 文件!",
|
|
15
|
+
"default": "mod.json"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "output",
|
|
19
|
+
"alias": "o",
|
|
20
|
+
"description": "默认应用的输出路径,若不制定为当前路径!",
|
|
21
|
+
"default": "."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executor": "executeString",
|
|
3
|
+
"description": "生成随机字符串",
|
|
4
|
+
"command": "str",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"name": "number",
|
|
8
|
+
"alias": "n",
|
|
9
|
+
"description": "生成随机数的数量,默认 1 个",
|
|
10
|
+
"default": 1
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "length",
|
|
14
|
+
"alias": "l",
|
|
15
|
+
"description": "生成随机字符串的长度,默认 10 个字符",
|
|
16
|
+
"default": 10
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "full",
|
|
20
|
+
"alias": "f",
|
|
21
|
+
"description": "是否使用全字符集,默认 false,只使用字母和数字",
|
|
22
|
+
"default": false
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executor": "executeFrontendSync",
|
|
3
|
+
"description": "同步 Zero Ui 的最新框架",
|
|
4
|
+
"command": "sync",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"name": "path",
|
|
8
|
+
"alias": "p",
|
|
9
|
+
"description": "本地配置文件路径,默认 .zero",
|
|
10
|
+
"default": ".zero"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "mode",
|
|
14
|
+
"alias": "m",
|
|
15
|
+
"description": "指定同步模块的模式,是否本地同步",
|
|
16
|
+
"default": false
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Ec = require('../epic');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const Ut = require("../commander-shared");
|
|
4
|
+
module.exports = (options) => {
|
|
5
|
+
const metadata = Ut.parseMetadata();
|
|
6
|
+
metadata.forEach(runner => {
|
|
7
|
+
Ec.execute(`命令:` + `ai ${runner.command} [-options]`.green);
|
|
8
|
+
Ec.execute(`说明:${runner.description}`.yellow);
|
|
9
|
+
runner.options.forEach(option => {
|
|
10
|
+
if (option.hasOwnProperty('default')) {
|
|
11
|
+
const str = option.default + '';
|
|
12
|
+
Ec.execute(`\t-${option.alias},--${option.name}`.red + `\t${option.description}, 默认值:\uD83C\uDF37 ` + str.blue);
|
|
13
|
+
} else {
|
|
14
|
+
Ec.execute(`\t-${option.alias},--${option.name}`.red + `\t${option.description}`);
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
Ec.execute();
|
|
18
|
+
});
|
|
19
|
+
Ec.info("命令执行完成!")
|
|
20
|
+
}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
const Ec = require('../epic');
|
|
2
2
|
const os = require('os');
|
|
3
|
+
const Ut = require("../commander-shared");
|
|
3
4
|
|
|
4
5
|
const os_compatible = ['darwin', 'win32'];
|
|
5
6
|
|
|
6
|
-
module.exports = () => {
|
|
7
|
-
|
|
8
|
-
* 参数解析
|
|
9
|
-
*/
|
|
10
|
-
const actual = Ec.executeInput(
|
|
11
|
-
['-i', '--input'],
|
|
12
|
-
[
|
|
13
|
-
["-i", "--input"]
|
|
14
|
-
]
|
|
15
|
-
);
|
|
7
|
+
module.exports = (options) => {
|
|
8
|
+
const parsed = Ut.parseArgument(options);
|
|
16
9
|
/*
|
|
17
10
|
* 基本信息
|
|
18
11
|
*/
|
|
19
|
-
const input =
|
|
12
|
+
const input = parsed.input;
|
|
20
13
|
const platform = os.platform();
|
|
21
14
|
Ec.info(`当前操作系统:${platform}`);
|
|
22
15
|
|
|
23
16
|
if (os_compatible.indexOf(platform) > -1) {
|
|
24
17
|
const content = Ec.strMD5(input);
|
|
25
|
-
|
|
18
|
+
Ec.execute(`明文值:${input}`)
|
|
19
|
+
Ec.execute(`加密值:${content}`);
|
|
26
20
|
Ec.outCopy(content)
|
|
27
21
|
.then(sign => Ec.info(`加密的字符串已经成功拷贝到剪切板中!`))
|
|
28
22
|
} else {
|
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
const Ec = require('../epic');
|
|
2
2
|
const os = require('os');
|
|
3
|
+
const Ut = require("../commander-shared");
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const os_compatible = ['darwin', 'win32'];
|
|
6
|
+
|
|
7
|
+
module.exports = (options) => {
|
|
5
8
|
/*
|
|
6
9
|
* 参数解析
|
|
7
10
|
*/
|
|
8
|
-
const
|
|
9
|
-
[],
|
|
10
|
-
[
|
|
11
|
-
['-n', '--number', 1],
|
|
12
|
-
['-l', '--length', 64]
|
|
13
|
-
]
|
|
14
|
-
);
|
|
11
|
+
const parsed = Ut.parseArgument(options);
|
|
15
12
|
/*
|
|
16
13
|
* 基本信息
|
|
17
14
|
*/
|
|
18
|
-
const number =
|
|
19
|
-
const length =
|
|
15
|
+
const number = parsed.number;
|
|
16
|
+
const length = parsed.length;
|
|
20
17
|
const platform = os.platform();
|
|
21
18
|
Ec.info(`随机字符串,生成数量:${number},长度:${length}`);
|
|
22
19
|
Ec.info(`当前操作系统:${platform}`);
|
|
23
20
|
|
|
24
|
-
if (
|
|
21
|
+
if (os_compatible.indexOf(platform) > -1) {
|
|
25
22
|
const content = [];
|
|
26
23
|
for (let idx = 0; idx < number; idx++) {
|
|
27
|
-
const generated = Ec.strRandom(length);
|
|
28
|
-
|
|
24
|
+
const generated = Ec.strRandom(length, parsed.full);
|
|
25
|
+
Ec.execute(generated);
|
|
29
26
|
content.push(generated);
|
|
30
27
|
}
|
|
31
28
|
Ec.outCopy(content.join('\n'))
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
const Ec = require('../epic');
|
|
2
|
+
const Ut = require("../commander-shared");
|
|
2
3
|
const os = require('os');
|
|
3
4
|
|
|
4
5
|
const os_compatible = ['darwin', 'win32'];
|
|
5
6
|
|
|
6
|
-
module.exports = () => {
|
|
7
|
+
module.exports = (options) => {
|
|
7
8
|
/*
|
|
8
9
|
* 参数解析
|
|
9
10
|
*/
|
|
10
|
-
const
|
|
11
|
-
[],
|
|
12
|
-
[
|
|
13
|
-
['-n', '--number', 20]
|
|
14
|
-
]
|
|
15
|
-
);
|
|
11
|
+
const parsed = Ut.parseArgument(options);
|
|
16
12
|
/*
|
|
17
13
|
* 基本信息
|
|
18
14
|
*/
|
|
19
|
-
const number =
|
|
15
|
+
const number = parsed.number;
|
|
20
16
|
const platform = os.platform();
|
|
21
17
|
Ec.info(`UUID生成器,生成数量:${number}`);
|
|
22
18
|
Ec.info(`当前操作系统:${platform}`);
|
|
@@ -24,7 +20,7 @@ module.exports = () => {
|
|
|
24
20
|
const content = [];
|
|
25
21
|
for (let idx = 0; idx < number; idx++) {
|
|
26
22
|
const generated = Ec.strUuid();
|
|
27
|
-
|
|
23
|
+
Ec.execute(generated);
|
|
28
24
|
content.push(generated);
|
|
29
25
|
}
|
|
30
26
|
Ec.outCopy(content.join('\n'))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const Ec = require("../epic");
|
|
2
|
+
const Ut = require("../commander-shared");
|
|
3
|
+
|
|
4
|
+
module.exports = (options) => {
|
|
5
|
+
/*
|
|
6
|
+
* 参数解析
|
|
7
|
+
*/
|
|
8
|
+
const parsed = Ut.parseArgument(options);
|
|
9
|
+
/*
|
|
10
|
+
* 基本信息验证
|
|
11
|
+
*/
|
|
12
|
+
const name = parsed.name;
|
|
13
|
+
console.log(parsed);
|
|
14
|
+
Ec.info(`生成应用信息,应用名称:${name}`);
|
|
15
|
+
}
|