├── .npmignore ├── global.d.ts ├── .gitignore ├── docs ├── chain │ ├── alias.md │ ├── distinct.md │ ├── having.md │ ├── comment.md │ ├── order.md │ ├── table.md │ ├── group.md │ ├── README.md │ ├── limit.md │ ├── page.md │ ├── data.md │ ├── join.md │ ├── field.md │ ├── union.md │ └── where.md ├── curd │ ├── README.md │ ├── delete.md │ ├── update.md │ ├── insert.md │ └── select.md ├── advanced │ ├── sqlsearch.md │ ├── README.md │ ├── qjsearch.md │ ├── childsearch.md │ ├── zhsearch.md │ ├── basesearch.md │ ├── tjsearch.md │ └── bdssearch.md ├── main │ └── main.md └── README.md ├── src ├── types.ts ├── curd.ts ├── main.ts ├── common.ts └── uitl.ts ├── tsconfig.json ├── package.json ├── .github └── workflows │ └── npm-publish.yml ├── LICENSE ├── test └── index.js ├── SUMMARY.md ├── README-CN.md ├── README.md └── yarn.lock /.npmignore: -------------------------------------------------------------------------------- 1 | .cache 2 | /dist 3 | /node_modules 4 | /src 5 | /gulpfile.js 6 | /index.html 7 | /index.js -------------------------------------------------------------------------------- /global.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface global { 3 | this: any; 4 | } 5 | } 6 | 7 | export {} // 注意: 修改"全局声明"必须在模块内部, 所以至少要有 export{}字样 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | .idea/ 4 | .DS_Store 5 | src/.DS_Store 6 | src/assets/.DS_Store 7 | */.DS_Store 8 | */*/.DS_Store 9 | /.cache/* 10 | 11 | -------------------------------------------------------------------------------- /docs/chain/alias.md: -------------------------------------------------------------------------------- 1 | alias用于设置当前数据表的别名,便于使用其他的连贯操作例如join方法等。 2 | 3 | 示例: 4 | 设置别名: 5 | ```js 6 | sql.table('node_table').alias(a).where('id=1').select() 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/curd/README.md: -------------------------------------------------------------------------------- 1 | * [**3.CURD调用**](/docs/curd/README.md) 2 | * [**3.1.SELECT**](/docs/curd/select.md) 3 | * [**3.2.UPDATE**](/docs/curd/update.md) 4 | * [**3.3.INSERT**](/docs/curd/insert.md) 5 | * [**3.4.DELETE**](/docs/curd/delete.md) 6 | -------------------------------------------------------------------------------- /docs/chain/distinct.md: -------------------------------------------------------------------------------- 1 | distinct方法属于链式调用方法之一,方法用于返回唯一不同的值。 2 | 3 | 4 | ### 案例 5 | 6 | ```js 7 | sql.distinct(true).table('node_table').field('name').where('id=1').select() 8 | ``` 9 | 10 | 最终得到 11 | ```js 12 | SELECT DISTINCT name FROM node_table WHERE id=1 13 | ``` 14 | 15 | distinct方法的参数是一个布尔值。 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/curd/delete.md: -------------------------------------------------------------------------------- 1 | delete方法用来删除数据库中数据,使用简单,语法简单 2 | 3 | 在链式调用的最后调用 .delete() 方法 4 | 5 | 6 | ### 案例 7 | 8 | ```js 9 | sql 10 | .table('node_table') 11 | .where({name:'zane'}) 12 | .delet(); 13 | 14 | ``` 15 | 16 | 最终得到 17 | ```js 18 | DELETE FROM node_table WHERE name=`zane` 19 | ``` 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/advanced/sqlsearch.md: -------------------------------------------------------------------------------- 1 | SQL查询,一个库很难做到完全支持所有的sql查询方法,即使能做到,那此库的体量一定会大很多,会有得不偿失的感觉, 2 | 因此直接给一个query方法支持任何的sql原生语句查询: 3 | 4 | ### 案例 5 | 6 | ```js 7 | sql.query('select * from node_table where id=1') 8 | ``` 9 | 10 | 最终得到 11 | ```js 12 | select * from node_table where id=1 13 | ``` 14 | 15 | 16 | 这根原生的sql语法没有任何的区别。 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface Config { 3 | host: string; 4 | user: string; 5 | password: string; 6 | database: string; 7 | port?: number; 8 | ispool?: boolean; // 是否使用连接池链接 9 | waitConnection?: boolean; // 是否等待链接   10 | connectionLimit?: number; // 连接池数 11 | queueLimit?: number; // 排队限制 12 | } 13 | 14 | 15 | export interface AnyOpt { 16 | [props:string]: any; 17 | } -------------------------------------------------------------------------------- /docs/chain/having.md: -------------------------------------------------------------------------------- 1 | HAVING方法属于链式调用方法之一,用于配合group方法完成从分组的结果中筛选(通常是聚合条件)数据。 2 | 3 | ### 案例 4 | 5 | having方法只有一个参数,并且只能使用字符串,例如: 6 | ```js 7 | sql.table('node_table').group('user_id').where('id=1').having('count(number)>3').select() 8 | ``` 9 | 10 | 最终得到 11 | ```js 12 | SELECT * FROM node_table WHERE id=1 GROUP BY user_id HAVING count(number)>3 13 | ``` 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/advanced/README.md: -------------------------------------------------------------------------------- 1 | * [**4.查询方式**](/docs/advanced/README.md) 2 | * [**4.1.基本查询**](/docs/advanced/basesearch.md) 3 | * [**4.2.表达式查询**](/docs/advanced/bdssearch.md) 4 | * [**4.3.区间查询**](/docs/advanced/qjsearch.md) 5 | * [**4.4.组合查询**](/docs/advanced/zhsearch.md) 6 | * [**4.5.统计查询**](/docs/advanced/tjsearch.md) 7 | * [**4.6.SQL查询**](/docs/advanced/sqlsearch.md) 8 | * [**4.7.子查询**](/docs/advanced/childsearch.md) -------------------------------------------------------------------------------- /docs/chain/comment.md: -------------------------------------------------------------------------------- 1 | COMMENT方法 用于在生成的SQL语句中添加注释内容,例如: 2 | 3 | 4 | ### 案例 5 | 6 | 单个字段的排序 7 | ```js 8 | sql 9 | .comment('查询node_table表的所有数据') 10 | .table('node_table') 11 | .order('id desc') 12 | .where('id=1') 13 | .select() 14 | ``` 15 | 16 | 最终得到 17 | ```js 18 | SELECT * FROM node_table WHERE id=1 ORDER BY id desc /* 查询node_table表的所有数据 */ 19 | ``` 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/advanced/qjsearch.md: -------------------------------------------------------------------------------- 1 | 支持多个字段的区间查询 2 | 3 | 例如: 4 | 5 | ```js 6 | id:{gt:1,lt:10} 7 | ``` 8 | 得到的查询条件是: ( id > 1) AND ( id < 10) 9 | 10 | 11 | ```js 12 | id:{neq:6,gt:3} 13 | ``` 14 | 得到的查询条件是: ( id != 6) AND ( id > 3) 15 | 16 | 17 | 默认使用AND链接,传入参数 `_type='or'` 可更改为OR条件 18 | 19 | 20 | ```js 21 | id:{neq:6,gt:3,_type:'or'} 22 | ``` 23 | 得到的查询条件是: ( id != 6) OR ( id > 3) 24 | 25 | 26 | 支持所有的表达式查询,更多请查看表达式查询 27 | * [**4.2.表达式查询**](/docs/advanced/bdssearch.md) -------------------------------------------------------------------------------- /docs/chain/order.md: -------------------------------------------------------------------------------- 1 | order方法属于链式调用方法之一,用于对操作的结果排序。 2 | 3 | ### 案例 4 | 5 | 单个字段的排序 6 | ```js 7 | sql.table('node_table').order('id desc').where('id=1').select() 8 | ``` 9 | 10 | 最终得到 11 | ```js 12 | SELECT * FROM node_table WHERE id=1 ORDER BY id desc 13 | ``` 14 | 15 | 16 | 17 | 多个字段的排序 18 | ```js 19 | sql.table('node_table').order('id desc,status').where('id=1').select() 20 | ``` 21 | 22 | 最终得到 23 | ```js 24 | SELECT * FROM node_table WHERE id=1 ORDER BY id desc,status 25 | ``` 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/chain/table.md: -------------------------------------------------------------------------------- 1 | table链式调用中主要用于指定操作的数据表。 2 | 3 | 例如: 4 | ```js 5 | sql.table('node_table').where('id=1').select() 6 | ``` 7 | 8 | 设置别名: 9 | ```js 10 | sql.table('node_table a').where('id=1').select() 11 | ``` 12 | 13 | 得到: 14 | ``` 15 | SELECT * FROM node_table a WHERE id=1 16 | 17 | ``` 18 | 19 | 多表同时查询: 20 | ```js 21 | sql.table({'node_table1': 'a', 'node_table2': 'b'}).where('id=1').select() 22 | ``` 23 | 得到: 24 | ``` 25 | SELECT * FROM node_table1 AS a, node_table2 AS b WHERE id=1 26 | ``` 27 | 28 | 29 | join方法还需要补充... -------------------------------------------------------------------------------- /docs/advanced/childsearch.md: -------------------------------------------------------------------------------- 1 | 子查询: 2 | 因为此库的调用方式为链式调用,返回的数据为sql语句就注定了它能做到很多的子查询形式: 3 | 4 | 5 | 例如: 6 | 一:先定义一个sql语句得到结果 7 | ``` 8 | let sqlstring = sql.field('id,name').table('node_table').group('field') 9 | ``` 10 | 11 | 二:把上一次生成的sql语句当做.table 方法的参数传入即可 12 | ``` 13 | sql.table(sqlstring).group('field').where('id=1').order('status').select() 14 | ``` 15 | 16 | 17 | 最终得到的sql语句: 18 | ``` 19 | SELECT * FROM (SELECT id,name FROM node_table GROUP BY field ) WHERE id=1 GROUP BY field ORDER BY status 20 | ``` 21 | 22 | 23 | 依据此能力你可以生成任何可以子查询的语句 -------------------------------------------------------------------------------- /docs/chain/group.md: -------------------------------------------------------------------------------- 1 | GROUP方法属于链式调用方法之一,通常用于结合合计函数,根据一个或多个列对结果集进行分组 。 2 | 3 | ### 案例 4 | 5 | 单个字段的分组 6 | ```js 7 | sql.table('node_table').group('user_id').where('id=1').select() 8 | ``` 9 | 10 | 最终得到 11 | ```js 12 | SELECT * FROM node_table WHERE id=1 GROUP BY user_id 13 | ``` 14 | 15 | 16 | 17 | 18 | 也支持对多个字段进行分组,例如: 19 | ```js 20 | sql.table('node_table').field('username,max(score)').group('user_id,test_time').select() 21 | ``` 22 | 23 | 最终得到 24 | ```js 25 | SELECT username,max(score) FROM node_table GROUP BY user_id,test_time 26 | ``` 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/chain/README.md: -------------------------------------------------------------------------------- 1 | * [**2.链式操作**](/docs/chain/README.md) 2 | * [**2.1.WHERE**](/docs/chain/where.md) 3 | * [**2.2.TABLE**](/docs/chain/table.md) 4 | * [**2.3.ALIAS**](/docs/chain/alias.md) 5 | * [**2.4.DATA**](/docs/chain/data.md) 6 | * [**2.5.FIELD**](/docs/chain/field.md) 7 | * [**2.6.ORDER**](/docs/chain/order.md) 8 | * [**2.7.LIMIT**](/docs/chain/limit.md) 9 | * [**2.8.PAGE**](/docs/chain/page.md) 10 | * [**2.9.GROUP**](/docs/chain/group.md) 11 | * [**2.10.HAVING**](/docs/chain/having.md) 12 | * [**2.11.UNION**](/docs/chain/union.md) 13 | * [**2.12.DISTINCT**](/docs/chain/distinct.md) 14 | * [**2.13.COMMENT**](/docs/chain/comment.md) 15 | -------------------------------------------------------------------------------- /docs/chain/limit.md: -------------------------------------------------------------------------------- 1 | limit方法属于链式调用方法之一,主要用于指定查询和操作的数量,特别在分页查询的时候使用较多 2 | 3 | ### 限制结果数量 4 | 5 | 例如获取满足要求的10个用户,如下调用即可: 6 | 7 | ```js 8 | sql.table('node_table').limit(10).where('id=1').select() 9 | ``` 10 | 11 | 最终得到 12 | ```js 13 | SELECT * FROM node_table WHERE id=1 LIMIT 10 14 | ``` 15 | 16 | ### 分页查询 17 | 18 | 用于文章分页查询是limit方法比较常用的场合,例如: 19 | 20 | ```js 21 | sql.table('node_table').limit(10,20).where('id=1').select() 22 | 或者 23 | sql.table('node_table').limit('10,20').where('id=1').select() 24 | ``` 25 | 26 | 最终得到 27 | ```js 28 | SELECT * FROM node_table WHERE id=1 LIMIT 10,20 29 | ``` 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/chain/page.md: -------------------------------------------------------------------------------- 1 | page方法属于链式调用方法之一,是完全为分页查询而诞生的一个人性化操作方法。 2 | 3 | 4 | ### 例如 5 | 6 | ```js 7 | sql.table('node_table').page(1,10).select() //查询第一页数据 8 | sql.table('node_table').page(2,10).select() //查询第二页数据 9 | ``` 10 | 11 | 12 | 也可以用字符串的方式传参 13 | 14 | ```js 15 | sql.table('node_table').page('1,10').select() //查询第一页数据 16 | sql.table('node_table').page('2,10').select() //查询第二页数据 17 | ``` 18 | 19 | 20 | 最终得到 21 | ```js 22 | SELECT * FROM node_table LIMIT 0,9 23 | SELECT * FROM node_table LIMIT 10,19 24 | ``` 25 | 26 | 27 | > **备注:page 方法比 limit方法更适合分页,不用自己算,内部已经处理好** 28 | > **如果同时使用page方法会覆盖掉limit方法** 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/gts/tsconfig-google.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "./build/", 6 | "experimentalDecorators": true, 7 | "emitDecoratorMetadata": true, 8 | "noEmitOnError": false, 9 | "noUnusedLocals": true, 10 | "noUnusedParameters": false, 11 | "moduleResolution": "node", 12 | "strictPropertyInitialization": false, 13 | "module": "commonjs", 14 | "target": "es6", 15 | "sourceMap": false, 16 | "lib": [ 17 | "es2015", 18 | "dom" 19 | ] 20 | }, 21 | "include": [ 22 | "src/**/*.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ] 27 | } -------------------------------------------------------------------------------- /docs/chain/data.md: -------------------------------------------------------------------------------- 1 | alias方法主要用于sql的 插入数据(insert) | 修改数据(update),用于设置当前要操作的数据对象的值 2 | 3 | ### 插入数据 4 | 5 | ```js 6 | let data={ 7 | name:'zhangsan', 8 | age:25 9 | } 10 | sql.table('node_table').data(data).insert() 11 | ``` 12 | 13 | 最终得到 14 | ```js 15 | INSERT INTO node_table (name,age) VALUES (`zhangsan`,25) 16 | ``` 17 | 18 | 19 | ### 更新数据 20 | 21 | ```js 22 | let data={ 23 | name:'zhangsan', 24 | age:25 25 | } 26 | sql.table('node_table').data(data,true).update() 27 | ``` 28 | 29 | 最终得到 30 | ```js 31 | UPDATE node_table SET name=`zhangsan`,age=25 32 | ``` 33 | 34 | 35 | 读和写的区别在于 update 的 data 有第二个参数为真值,最终各自调用各自的方法得到sql数据 36 | 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mysqls", 3 | "version": "1.2.2", 4 | "main": "build/main.js", 5 | "typings": "build/main.d.ts", 6 | "repository": "git@github.com:wangweianger/mysqls.git", 7 | "author": "汪微 <752636052@qq.com>", 8 | "license": "MIT", 9 | "scripts": { 10 | "build": "npm run clean && npm run compile", 11 | "clean": "gts clean", 12 | "compile": "tsc -p .", 13 | "prepublish": "npm run build" 14 | }, 15 | "devDependencies": { 16 | "@types/sqlstring": "^2.3.0", 17 | "gts": "^0.8.0", 18 | "ts-node": "^7.0.1", 19 | "typescript": "~3.4.0" 20 | }, 21 | "dependencies": { 22 | "mysql2": "^2.2.5", 23 | "sqlstring": "^2.3.2" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | publish-npm: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v1 16 | with: 17 | node-version: 12 18 | registry-url: https://registry.npmjs.org/ 19 | - run: yarn 20 | - run: npm publish 21 | env: 22 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 23 | -------------------------------------------------------------------------------- /docs/curd/update.md: -------------------------------------------------------------------------------- 1 | update方法更新数据库中的数据,使用简单,语法简洁 2 | 3 | update方法 主要调用的是 data语法,data('xx') 4 | 最终调用 .updata() 方法 5 | 6 | ### 案例 7 | 8 | 参数字符串方式 9 | ```js 10 | sql 11 | .table('node_table') 12 | .data('name=zane&email=752636052@qq.com') 13 | .update() 14 | 15 | 16 | ``` 17 | 18 | 最终得到 19 | ```js 20 | UPDATE node_table SET name=`zane`,email=`752636052@qq.com` 21 | ``` 22 | 23 | 24 | 参数object对象方式 25 | 26 | ```js 27 | let data={ 28 | name:'zane', 29 | email:'752636052@qq.com', 30 | sex:1 31 | } 32 | sql 33 | .table('node_table') 34 | .data(data) 35 | .where({id:1}) 36 | .update() 37 | 38 | ``` 39 | 40 | 最终得到 41 | ```js 42 | UPDATE node_table SET name=`zane`,email=`752636052@qq.com`,sex=1 43 | ``` 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/chain/join.md: -------------------------------------------------------------------------------- 1 | join方法属于链式调用方法之一, 主要用于联表查询 2 | 3 | 4 | ### 案例 5 | 6 | join参数为Array 或 object类型, 例如: 7 | 8 | 9 | Array类型参数 10 | ```js 11 | sql.table('node_table').join([{ 12 | dir: 'left', 13 | table: ('left_table'), 14 | where: [{'node_talbe.id': ['join_table.id']}] 15 | }, { 16 | dir: 'right', 17 | table: ('right_table'), 18 | where: [{'right_table.id': ['left_table.id']}] 19 | }]).where('node_table.id=1').select() 20 | ``` 21 | 22 | 最终得到 23 | ```js 24 | SELECT * FROM node_table LEFT JOIN left_table ON ((node_talbe.id=join_table.id) ) RIGHT JOIN right_table ON ((right_table.id=left_table.id) ) WHERE node_table.id=1 25 | ``` 26 | 27 | object类型参数 28 | ```js 29 | sql.table('node_table').join({ 30 | dir: 'left', 31 | table: ('left_table'), 32 | where: [{'node_talbe.id': ['join_table.id']}] 33 | }).where('node_table.id=1').select() 34 | ``` 35 | 36 | 最终得到 37 | ```js 38 | SELECT * FROM node_table LEFT JOIN left_table ON ((node_talbe.id=join_table.id) ) WHERE node_table.id=1 39 | ``` 40 | 41 | -------------------------------------------------------------------------------- /docs/advanced/zhsearch.md: -------------------------------------------------------------------------------- 1 | 组合查询的主体主要使用 Object 和 Array 查询 2 | 3 | 4 | ### Object查询 5 | 6 | ```js 7 | let data={ 8 | id:1, 9 | name:'zhangsan', 10 | status:{ neq:1,elt:10 } 11 | _type:'or' 12 | } 13 | sql 14 | .table('node_table') 15 | .where(data) 16 | .select(); 17 | 18 | ``` 19 | 20 | 最终得到 21 | ```js 22 | SELECT * FROM node_table WHERE id=1 OR name=`zhangsan` OR ((status<>1) AND (status<=10) ) 23 | ``` 24 | 25 | 26 | ### Array查询 27 | 28 | ```js 29 | let data=[{ 30 | id:1, 31 | name:'zhangsan', 32 | status:{ neq:1,elt:10 } 33 | _nexttype:'or' 34 | },{ 35 | sex:1, 36 | name:{in:'1,2,3'} 37 | _type:'or', 38 | }] 39 | sql 40 | .table('node_table') 41 | .where(data) 42 | .select(); 43 | 44 | ``` 45 | 46 | 最终得到 47 | ```js 48 | SELECT * FROM node_table WHERE (id=1 AND name=`zhangsan` AND ((status<>1) AND (status<=10))) OR (sex=1 OR ((name IN (1,2,3)))) 49 | ``` 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /docs/chain/field.md: -------------------------------------------------------------------------------- 1 | field方法属于链式调用方法之一,主要目的是标识要返回或者操作的字段,可以用于查询和写入操作。 2 | 3 | ### 案例 4 | 5 | field参数为字符串 6 | ```js 7 | let data={ 8 | id:1 9 | } 10 | sql.table('node_table').field('id,name').where(data).select() 11 | ``` 12 | 13 | 最终得到 14 | ```js 15 | SELECT id,name FROM node_table WHERE id=1 16 | ``` 17 | 18 | field参数为数组 19 | ```js 20 | let data={ 21 | id:1 22 | } 23 | sql.table('node_table').field(['id','name']).where(data).select() 24 | ``` 25 | 26 | 最终得到 27 | ```js 28 | SELECT id,name FROM node_table WHERE id=1 29 | ``` 30 | 31 | ```js 32 | sql.table('node_table').field(['id','name', {'user_id': 'userId', 'user_name': 'userName'}, 'age']).where(data).select() 33 | ``` 34 | 35 | 最终得到 36 | ```js 37 | SELECT id,name, user_id AS userId, user_name AS userName, age FROM node_table WHERE id=1 38 | ``` 39 | 40 | 41 | 如果不调用field方法,就默认为`*`号,即调用所有的字段 42 | ```js 43 | sql.table('node_table').where('id=1').select() 44 | ``` 45 | 46 | 最终得到 47 | ```js 48 | SELECT * FROM node_table WHERE id=1 49 | ``` 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/advanced/basesearch.md: -------------------------------------------------------------------------------- 1 | 基本查询 2 | 基本查询支持 字符串、JSON对象、数组三种查询方式 3 | 4 | 5 | ### 字符串查询 6 | 7 | ```js 8 | sql 9 | .table('node_table') 10 | .where('id=1&name=`zane`') 11 | .select() 12 | ``` 13 | 14 | 最终得到 15 | ```js 16 | SELECT * FROM node_table WHERE id=1&name=`zane` 17 | ``` 18 | 19 | ### JSON对象查询 20 | 21 | ```js 22 | let data={ 23 | id:1, 24 | name:'zane', 25 | sex:1 26 | } 27 | sql 28 | .table('node_table') 29 | .where(data) 30 | .select() 31 | ``` 32 | 33 | 最终得到 34 | ```js 35 | SELECT * FROM node_table WHERE id=1 AND name=`zane` AND sex=1 36 | ``` 37 | 38 | 39 | ### 数组JSON对象查询 40 | 41 | ```js 42 | let data=[{ 43 | id:1, 44 | name:'zane', 45 | _nexttype:'or' 46 | },{ 47 | sex:1, 48 | address:'shenzheng' 49 | }] 50 | sql 51 | .table('node_table') 52 | .where(data) 53 | .select() 54 | ``` 55 | 56 | 最终得到 57 | ```js 58 | SELECT * FROM node_table WHERE (id=1 AND name=`zane`) OR (sex=1 AND address=`shenzheng`) 59 | ``` 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2019 zane 4 | - zane ([@wangweianger](https://github.com/wangweianger)) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | let { init, exec, sql, transaction } = require('../build/main.js') 4 | // let { init, exec, sql, transaction } = require('mysqls') 5 | 6 | async function run() { 7 | 8 | let config = { 9 | host: 'localhost', 10 | user: 'root', 11 | password: '123456', 12 | database: 'web-performance' 13 | } 14 | init(config) 15 | 16 | 17 | 18 | // 获得生成的sql语句 19 | const sqlstr = sql.table('web_system').select() 20 | console.log(sqlstr) 21 | 22 | // 根据生成的sql语句执行 23 | console.log(await exec(sqlstr)) 24 | 25 | // 生成sql语句并立即执行 26 | console.log(await sql.table('web_system').select(true).exec()); 27 | 28 | console.log(sql.table('web_system').data({ slowPageTime: 'slowPageTime-1' }).update()) 29 | 30 | // 事务 31 | try { 32 | let re2 = await transaction([ 33 | sql.table('web_system').data({ slowPageTime: 'slowPageTime-1' }).update(), 34 | sql.table('web_system').data({ slowJsTime: 'slowJsTime+1' }).update() 35 | // 'UPDATE web_system SET slowPageTime=slowPageTime-1', 36 | // 'UPDATE web_system SET slowJsTime=slowJsTime+1' 37 | ]) 38 | console.log(re2) 39 | } catch (err) { 40 | console.log('111111111') 41 | console.log(err) 42 | } 43 | } 44 | 45 | run() 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /docs/curd/insert.md: -------------------------------------------------------------------------------- 1 | insert方法用来在插入数据,使用简单,语法简洁 2 | 3 | insert方法 主要调用的是 data语法,data('xx') 4 | 最终调用 .insert() 方法 5 | 6 | ### 案例 7 | 8 | 参数字符串方式 9 | ```js 10 | sql 11 | .table('node_table') 12 | .data('name=zane&email=752636052@qq.com') 13 | .insert() 14 | 15 | ``` 16 | 17 | 最终得到 18 | ```js 19 | INSERT INTO node_table (name,email) VALUES (`zane`,`752636052@qq.com`) 20 | ``` 21 | 22 | 23 | 参数object对象方式 24 | 25 | ```js 26 | let data={ 27 | name:'zane', 28 | email:'752636052@qq.com', 29 | sex:1 30 | } 31 | sql 32 | .table('node_table') 33 | .data(data) 34 | .insert() 35 | 36 | ``` 37 | 38 | 最终得到 39 | ```js 40 | INSERT INTO node_table (name,email,sex) VALUES (`zane`,`752636052@qq.com`,1) 41 | ``` 42 | 43 | **批量插入** 44 | 45 | ```js 46 | let data = [ 47 | {name:'zane',email:'752636052@qq.com'}, 48 | {name:'zane_1',email:'752636052_1@qq.com'}, 49 | {name:'zane_2',email:'752636052_2@qq.com'}, 50 | ] 51 | sql 52 | .table('node_table') 53 | .data(data) 54 | .insert() 55 | ``` 56 | 57 | 最终得到 58 | ```js 59 | INSERT INTO node_table (name,email) VALUES ('zane','752636052@qq.com'),('zane_1','752636052_1@qq.com'),('zane_2','752636052_2@qq.com') 60 | ``` 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /docs/main/main.md: -------------------------------------------------------------------------------- 1 | ###插件使用方式 2 | 3 | ```js 4 | //import方式 5 | import { execute,sql,transaction } from 'mysqls' 6 | 7 | //require方式 8 | let { execute,sql,transaction } = require('mysqls') 9 | ``` 10 | 11 | 12 | ### 参数说明 13 | 14 | **config配置** 15 | ```js 16 | let config={ 17 | host:'localhost', 18 | user:'root', 19 | password:'123456', 20 | database:'web-performance', 21 | port:'3306', 22 | } 23 | ``` 24 | 25 | 26 | **sql** 27 | > sql参数链式调用相关方法生成sql语句 28 | 参考:[sql链式语法](/docs/README.md) 29 | 30 | 31 | **execute** 32 | > 功能: 执行单个sql语句查询,并得到结果 33 | > 参数: (config,sqlStr) config为数据库配置参数,sqlStr查询的sql语句 34 | 用法: 35 | ```js 36 | let sqlStr = sql.table('table1').where({id:1}).select() 37 | 38 | let result = await execute(config,sqlStr) 39 | 40 | ``` 41 | 42 | 43 | **transaction** 44 | > 事务处理方法 45 | > 参数 :(config,arrStr) config为数据库配置参数,arrStr事务时执行的相关语句,必须为数组 46 | > 所有的语句执行成功者事务执行成功,若有一句执行失败者关闭事务 47 | 用法: 48 | ```js 49 | //需要执行事务的相关语句 table1表的number减少5,table2表的number增加5 50 | let tranSqlArr = [ 51 | sql.table('table1').data({number:number-5}).update(true,true), 52 | sql.table('table2').data({number:number+5}).update(true,true) 53 | ] 54 | let result = await transaction(config,tranSqlArr) 55 | console.log(result) 56 | 57 | ``` 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | ## 文档目录 4 | 5 | * [1.简介](/README.md) 6 | * [**1.1.参数说明与事务**](/docs/main/main.md) 7 | * [2.链式操作](/docs/chain/README.md) 8 | * [2.1.WHERE](/docs/chain/where.md) 9 | * [2.2.TABLE](/docs/chain/table.md) 10 | * [2.3.ALIAS](/docs/chain/alias.md) 11 | * [2.4.DATA](/docs/chain/data.md) 12 | * [2.5.FIELD](/docs/chain/field.md) 13 | * [2.6.ORDER](/docs/chain/order.md) 14 | * [2.7.LIMIT](/docs/chain/limit.md) 15 | * [2.8.PAGE](/docs/chain/page.md) 16 | * [2.9.GROUP](/docs/chain/group.md) 17 | * [2.10.HAVING](/docs/chain/having.md) 18 | * [2.11.UNION](/docs/chain/union.md) 19 | * [2.12.DISTINCT](/docs/chain/distinct.md) 20 | * [2.13.LOCK](/docs/chain/lock.md) 21 | * [2.14.COMMENT](/docs/chain/comment.md) 22 | * [2.14.JOIN](/docs/chain/join.md) 23 | * [3.CURD调用](/docs/curd/README.md) 24 | * [3.1.SELECT](/docs/curd/select.md) 25 | * [3.2.UPDATE](/docs/curd/update.md) 26 | * [3.3.INSERT](/docs/curd/insert.md) 27 | * [3.4.DELETE](/docs/curd/delete.md) 28 | * [4.查询方式](/docs/advanced/README.md) 29 | * [4.1.基本查询](/docs/advanced/basesearch.md) 30 | * [4.2.表达式查询](/docs/advanced/bdssearch.md) 31 | * [4.3.区间查询](/docs/advanced/qjsearch.md) 32 | * [4.4.组合查询](/docs/advanced/zhsearch.md) 33 | * [4.5.统计查询](/docs/advanced/tjsearch.md) 34 | * [4.6.SQL查询](/docs/advanced/sqlsearch.md) 35 | * [4.7.子查询](/docs/advanced/childsearch.md) 36 | 37 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## 文档目录 2 | 3 | * [**1.简介**](/README.md) 4 | * [**1.1.参数说明与事务**](/docs/main/main.md) 5 | * [**2.链式操作**](/docs/chain/README.md) 6 | * [**2.1.WHERE**](/docs/chain/where.md) 7 | * [**2.2.TABLE**](/docs/chain/table.md) 8 | * [**2.3.ALIAS**](/docs/chain/alias.md) 9 | * [**2.4.DATA**](/docs/chain/data.md) 10 | * [**2.5.FIELD**](/docs/chain/field.md) 11 | * [**2.6.ORDER**](/docs/chain/order.md) 12 | * [**2.7.LIMIT**](/docs/chain/limit.md) 13 | * [**2.8.PAGE**](/docs/chain/page.md) 14 | * [**2.9.GROUP**](/docs/chain/group.md) 15 | * [**2.10.HAVING**](/docs/chain/having.md) 16 | * [**2.11.UNION**](/docs/chain/union.md) 17 | * [**2.12.DISTINCT**](/docs/chain/distinct.md) 18 | * [**2.13.COMMENT**](/docs/chain/comment.md) 19 | * [**3.CURD调用**](/docs/curd/README.md) 20 | * [**3.1.SELECT**](/docs/curd/select.md) 21 | * [**3.2.UPDATE**](/docs/curd/update.md) 22 | * [**3.3.INSERT**](/docs/curd/insert.md) 23 | * [**3.4.DELETE**](/docs/curd/delete.md) 24 | * [**4.查询方式**](/docs/advanced/README.md) 25 | * [**4.1.基本查询**](/docs/advanced/basesearch.md) 26 | * [**4.2.表达式查询**](/docs/advanced/bdssearch.md) 27 | * [**4.3.区间查询**](/docs/advanced/qjsearch.md) 28 | * [**4.4.组合查询**](/docs/advanced/zhsearch.md) 29 | * [**4.5.统计查询**](/docs/advanced/tjsearch.md) 30 | * [**4.6.SQL查询**](/docs/advanced/sqlsearch.md) 31 | * [**4.7.子查询**](/docs/advanced/childsearch.md) -------------------------------------------------------------------------------- /docs/advanced/tjsearch.md: -------------------------------------------------------------------------------- 1 | 在应用中我们经常会用到一些统计数据,例如当前所有(或者满足某些条件)的用户数、所有用户的最大积分、用户的平均成绩等等,本库也内置了一些方法,包括: 2 | 3 | |方法 | 说明 | 4 | | ------------- |:-------------: | 5 | | Count | 统计数量,参数是要统计的字段名(可选) | 6 | | Max | 获取最大值,参数是要统计的字段名(必须) | 7 | | Min | 获取最小值,参数是要统计的字段名(必须) | 8 | | Avg | 获取平均值,参数是要统计的字段名(必须) | 9 | | Sum | 获取总分,参数是要统计的字段名(必须) | 10 | 11 | 12 | 用法示例 13 | 14 | 获取用户数: 15 | ``` 16 | sql.count().table('node_table').select() 17 | 18 | SELECT count(1) FROM node_table 19 | ``` 20 | 21 | 或者根据字段统计: 22 | ``` 23 | sql.count('id').table('node_table').select() 24 | 25 | SELECT count(id) FROM node_table 26 | ``` 27 | 28 | 获取用户的最大积分: 29 | ``` 30 | sql.max('score').table('node_table').select() 31 | 32 | SELECT MAX(score) FROM node_table 33 | ``` 34 | 35 | 获取用户的最小积分: 36 | ``` 37 | sql.min('score').table('node_table').select() 38 | 39 | SELECT MIN(score) FROM node_table 40 | ``` 41 | 42 | 获取用户的平均积分: 43 | ``` 44 | sql.avg('score').table('node_table').select() 45 | 46 | SELECT AVG(score) FROM node_table 47 | ``` 48 | 49 | 统计用户的总成绩: 50 | ``` 51 | sql.sum('score').table('node_table').select() 52 | 53 | SELECT SUM(score) FROM node_table 54 | ``` 55 | 56 | 57 | **所有的统计查询均支持连贯操作的使用** 58 | 59 | 例如: 60 | ``` 61 | sql 62 | .count('id') 63 | .min('score') 64 | .max('score') 65 | .field('id,name,score') 66 | .table('node_table') 67 | .select() 68 | 69 | SELECT id,name,score,COUNT(id),MAX(score),MIN(score) FROM node_table 70 | ``` 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/advanced/bdssearch.md: -------------------------------------------------------------------------------- 1 | ### 表达式查询 (直接参考的thinkphp的api)不区分大小写 2 | 3 | **表达式查询支持更多的语法** 4 | 5 | 上面的查询条件仅仅是一个简单的相等判断,可以使用查询表达式支持更多的SQL查询语法,查询表达式的使用格式: 6 | 表达式不分大小写,支持的查询表达式有下面几种,分别表示的含义是: 7 | 8 | |表达式 | 含义 | 9 | | ------------- |:-------------: | 10 | | EQ | 等于(=) | 11 | | NEQ | 不等于(<>) | 12 | | GT | 大于(>) | 13 | | EGT | 大于等于(>=) | 14 | | LT | 小于(<) | 15 | | ELT | 小于等于(<=) | 16 | | LIKE | 模糊查询 | 17 | | [NOT] BETWEEN | 不在)区间查询 | 18 | | [NOT] IN | (不在)IN 查询 | 19 | 20 | 21 | ### 表达式查询的用法示例如下: 22 | 23 | ### EQ :等于(=) 24 | 例如: 25 | ```js 26 | id:{eq:100} 27 | ``` 28 | 和下面的查询等效 29 | ```js 30 | id=100 31 | ``` 32 | 表示的查询条件就是 id = 100 33 | 34 | ### NEQ: 不等于(<>) 35 | 例如: 36 | ```js 37 | id:{neq:100} 38 | ``` 39 | 表示的查询条件就是 id <> 100 40 | 41 | ### GT:大于(>) 42 | 例如: 43 | ```js 44 | id:{gt:100} 45 | ``` 46 | 表示的查询条件就是 id > 100 47 | 48 | ### EGT:大于等于(>=) 49 | 例如: 50 | ```js 51 | id:{egt:100} 52 | ``` 53 | 表示的查询条件就是 id >= 100 54 | 55 | ### LT:小于(<) 56 | 例如: 57 | ```js 58 | id:{lt:100} 59 | ``` 60 | 表示的查询条件就是 id < 100 61 | 62 | ### ELT: 小于等于(<=) 63 | 例如: 64 | ```js 65 | id:{elt:100} 66 | ``` 67 | 表示的查询条件就是 id <= 100 68 | 69 | ### [NOT] LIKE: 同sql的LIKE 70 | 例如: 71 | ```js 72 | name:{like:'%zane%'} 73 | ``` 74 | 表示的查询条件就是 name like %zane% 75 | 76 | ### [NOT] BETWEEN :同sql的[not] between 77 | 例如: 78 | ```js 79 | id:{between:'1,8'} 80 | 81 | ``` 82 | 表示的查询条件就是 id BETWEEN 1 AND 8 83 | 84 | ### [NOT] IN: 同sql的[not] in 85 | 例如: 86 | ```js 87 | id:{notin:'1,5,8'} 88 | 89 | ``` 90 | 表示的查询条件就是 id NOT IN (1,5, 8) 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/chain/union.md: -------------------------------------------------------------------------------- 1 | UNION操作用于合并两个或多个 SELECT 语句的结果集。 2 | 3 | ### 使用示例: 4 | 5 | **UNION 字符串方式** 6 | ```js 7 | sql.union('SELECT name FROM think_user_1') 8 | .union('SELECT name FROM think_user_2') 9 | .select() 10 | ``` 11 | 12 | 13 | UNION 数组用法: 14 | ```js 15 | sql.union(['SELECT name FROM think_user_1','SELECT name FROM think_user_2']).select() 16 | ``` 17 | 18 | 19 | 最终得到SQL 20 | ```js 21 | (SELECT name FROM think_user_1) UNION (SELECT name FROM think_user_2) 22 | ``` 23 | 24 | 25 | **UNION ALL 字符串方式** 26 | ```js 27 | sql.union('SELECT name FROM think_user_1',true) 28 | .union('SELECT name FROM think_user_2',true) 29 | .select() 30 | ``` 31 | 32 | UNION ALL 数组用法 33 | ```js 34 | sql.union(['SELECT name FROM think_user_1','SELECT name FROM think_user_2'],true).select() 35 | ``` 36 | 37 | 38 | 最终得到SQL 39 | ```js 40 | (SELECT name FROM think_user_1) UNION ALL (SELECT name FROM think_user_2) 41 | ``` 42 | 43 | 44 | **UNION 于 UNION ALL 唯一的区别就是有第二个参数并且为 true 即可** 45 | 46 | 47 | **UNION , UNION ALL 组合使用** 48 | ```js 49 | sql 50 | .union('SELECT * FROM think_user_1',true) 51 | .union('SELECT * FROM think_user_2',true) 52 | .union(['SELECT * FROM think_user_3','SELECT name FROM think_user_4']) 53 | .union('SELECT * FROM think_user_5',true) 54 | .select() 55 | ``` 56 | 57 | 最终得到SQL 58 | ```js 59 | (SELECT * FROM think_user_1) UNION ALL 60 | (SELECT * FROM think_user_2) UNION ALL 61 | (SELECT * FROM think_user_3) UNION 62 | (SELECT name FROM think_user_4) UNION 63 | (SELECT * FROM think_user_5) 64 | ``` 65 | 66 | 67 | **你甚至可以这样做** 68 | ```js 69 | sql 70 | .union(sql.table('think_user_1').select(),true) 71 | .union('SELECT * FROM think_user_5') 72 | .select() 73 | ``` 74 | 75 | 最终得到SQL 76 | ```js 77 | (SELECT * FROM think_user_1 WHERE id=1 ) UNION ALL (SELECT * FROM think_user_2) 78 | ``` 79 | 80 | 81 | 82 | 注意:UNION 内部的 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每条 SELECT 语句中的列的顺序必须相同。 83 | 84 | 85 | -------------------------------------------------------------------------------- /docs/curd/select.md: -------------------------------------------------------------------------------- 1 | select方法是用的最广泛、同时也是最复杂的查询条件 2 | 3 | ### 使用方法 4 | 5 | 在所有sql链式调用方法之后 调用 `.select()` 即为查询 6 | 7 | > 所有语法采用链式调用方式 8 | > 默认用 * 查询所有字段,可以使用 .field 方法精确字段查询 9 | > union方法优先级最高,如果查询中有次方法,则其他查询字段无效 10 | > 同时存在 limt 和 page 方法时,page方法将优先于limit方法 11 | > sql的查询方式有很多,尽可能按照正确的sql语句语法查询 12 | > 对所有的方法没有固定的顺序,内部会自动排序 13 | 14 | 15 | ### 简单用法 16 | 17 | ```js 18 | sql 19 | .table('node_table') 20 | .where('id=1') 21 | .select() 22 | 23 | SELECT * FROM node_table WHERE id=1 24 | 25 | sql 26 | .table('node_table') 27 | .field('id,name') 28 | .where({id:1}) 29 | .select() 30 | 31 | SELECT id,name FROM node_table WHERE id=1 32 | ``` 33 | 34 | 35 | ### 高级用法 36 | ```js 37 | //参数json多字段 38 | sql 39 | .table('node_table') 40 | .where({id:1,name:'zane'}) 41 | .select() 42 | 43 | SELECT * FROM node_table WHERE id=1 AND name=`zane` 44 | 45 | //参数数组 46 | let data=[ 47 | {id:1,name:'zhangsan',_type:'or'}, 48 | {sex:1,number:3} 49 | ] 50 | sql.table('node_table').where(data).select() 51 | 52 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan` ) AND (sex=1 AND number=3 ) 53 | 54 | //多字段连接方式 55 | let data=[ 56 | {id:1,name:'zhangsan',_type:'or',_nexttype:'or'}, 57 | {sex:1,number:3,_type:'and'} 58 | ] 59 | sql.table('node_table').where(data).select() 60 | 61 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan`) OR (sex=1 AND number=3) 62 | 63 | //表达式查询 64 | let data={ 65 | id:{eq:100,egt:10,_type:'or'}, 66 | name:'zhangshan' 67 | } 68 | sql.table('node_table').where(data).select() 69 | 70 | SELECT * FROM node_table WHERE ((id=100) OR (id>=10)) AND name=`zhangshan` 71 | 72 | //混合查询 73 | let data=[{ 74 | id:{eq:100,egt:10,_type:'or'}, 75 | name:'zhangshan', 76 | _nexttype:'or' 77 | },{ 78 | status:1, 79 | name:{like:'%zane%'} 80 | }] 81 | sql.table('node_table').where(data).select() 82 | 83 | SELECT * FROM node_table WHERE (((id=100) OR (id>=10)) AND name=`zhangshan`) OR (status=1 AND ((name LIKE `%zane%`))) 84 | 85 | 86 | //UNION , UNION ALL 组合使用 87 | sql 88 | .union('SELECT * FROM think_user_1',true) 89 | .union('SELECT * FROM think_user_2',true) 90 | .union(['SELECT * FROM think_user_3','SELECT name FROM think_user_4']) 91 | .union('SELECT * FROM think_user_5',true) 92 | .select() 93 | 94 | 得到 95 | (SELECT * FROM think_user_1) UNION ALL 96 | (SELECT * FROM think_user_2) UNION ALL 97 | (SELECT * FROM think_user_3) UNION 98 | (SELECT name FROM think_user_4) UNION 99 | (SELECT * FROM think_user_5) 100 | 101 | ``` 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /docs/chain/where.md: -------------------------------------------------------------------------------- 1 | where方法的用法是mysql查询语句的精髓,也是最复杂的部分,任何一个封装的sql库where会是最复杂的一个部分。 2 | where查询支持 字符串:String , JSON对象 ,数组对象查询 , 表达式查询 3 | 4 | ### 字符串查询 5 | 6 | ```js 7 | //这里需要注意的是传入的字符串需要是合格的sql语法,字符串需要有引号 8 | sql.table('node_table').where('id=1 AND name=`张三`').select() 9 | 10 | ``` 11 | 12 | 最后生成的SQL语句是 13 | ```js 14 | SELECT * FROM node_table WHERE id=1 AND name=`张三` 15 | ``` 16 | 17 | 18 | ### JSON对象查询 19 | 20 | ```js 21 | let data={ 22 | id:1, 23 | name:'zhangshan' 24 | } 25 | sql.table('node_table').where(data).select() 26 | ``` 27 | 28 | 最后得出的SQL语句是 29 | ```js 30 | SELECT * FROM node_table WHERE id=1 AND name=`zhangshan` 31 | ``` 32 | 33 | 字段之间默认用 AND 链接,若要指定连接方法可以传参数 `_type:'or' || _type:'and'` 34 | 35 | ```js 36 | let data={ 37 | id:1, 38 | name:'zhangshan', 39 | _type:'or' 40 | } 41 | sql.table('node_table').where(data).select() 42 | ``` 43 | 44 | 最后得出的SQL语句是 45 | ```js 46 | SELECT * FROM node_table WHERE id=1 OR name=`zhangshan` 47 | ``` 48 | 49 | ### JSON对象数组查询 50 | ```js 51 | let data=[{ 52 | id:1, 53 | name:'zhangsan' 54 | }] 55 | sql.table('node_table').where(data).select() 56 | ``` 57 | 58 | 最后得出的SQL语句是 59 | ```js 60 | SELECT * FROM node_table WHERE (id=1 AND name=`zhangsan`) 61 | ``` 62 | 63 | 多条json数组 64 | ```js 65 | let data=[ 66 | {id:1,name:'zhangsan',_type:'or'}, 67 | {sex:1,number:3} 68 | ] 69 | sql.table('node_table').where(data).select() 70 | ``` 71 | 72 | 最后得出的SQL语句是 73 | ```js 74 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan` ) AND (sex=1 AND number=3 ) 75 | ``` 76 | 77 | JSON字段之间默认用 AND 链接,若要指定连接方法可以传参数 `_nexttype:'or' || _nexttype:'and'` 78 | 79 | ```js 80 | let data=[ 81 | {id:1,name:'zhangsan',_type:'or',_nexttype:'or'}, 82 | {sex:1,number:3,_type:'and'} 83 | ] 84 | sql.table('node_table').where(data).select() 85 | ``` 86 | 87 | 最后得出的SQL语句是 88 | ```js 89 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan`) OR (sex=1 AND number=3) 90 | ``` 91 | 92 | 93 | ### 表达式查询 (直接参考的thinkphp的api)不区分大小写 94 | 上面的查询条件仅仅是一个简单的相等判断,可以使用查询表达式支持更多的SQL查询语法,查询表达式的使用格式: 95 | 表达式不分大小写,支持的查询表达式有下面几种,分别表示的含义是: 96 | 97 | |表达式 | 含义 | 98 | | ------------- |:-------------: | 99 | | EQ | 等于(=) | 100 | | NEQ | 不等于(<>) | 101 | | GT | 大于(>) | 102 | | EGT | 大于等于(>=) | 103 | | LT | 小于(<) | 104 | | ELT | 小于等于(<=) | 105 | | LIKE | 模糊查询 | 106 | | [NOT] BETWEEN | 不在)区间查询 | 107 | | [NOT] IN | (不在)IN 查询 | 108 | 109 | 例如: 110 | ```js 111 | let data={ 112 | id:{eq:100,egt:10,_type:'or'}, 113 | name:'zhangshan' 114 | } 115 | sql.table('node_table').where(data).select() 116 | ``` 117 | 118 | 最后得出的SQL语句是 119 | ```js 120 | SELECT * FROM node_table WHERE ((id=100) OR (id>=10)) AND name=`zhangshan` 121 | ``` 122 | 123 | 更多表达式查询请参考:[**4.2.表达式查询**](/docs/advanced/bdssearch.md) 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/curd.ts: -------------------------------------------------------------------------------- 1 | import { 2 | sortSelectSql, 3 | checkOptType, 4 | handleInsertData, 5 | } from './uitl' 6 | import Common from './common' 7 | 8 | 9 | export default class CURD extends Common { 10 | constructor () { 11 | super(); 12 | } 13 | 14 | /** 15 | * 选择 16 | * 17 | * @param {boolean} [type=false] 18 | * @returns 19 | * @memberof Curd 20 | */ 21 | select(type=false){ 22 | let result = '' 23 | if(this.sqlObj.union){ 24 | result = this.sqlObj.union 25 | if(result.substr(-10).indexOf('ALL')!=-1){ 26 | result=result.replace(/\sUNION\sALL\s*$/,'') 27 | }else{ 28 | result=result.replace(/\sUNION\s*$/,'') 29 | } 30 | this.sqlObj = {} 31 | return result 32 | } 33 | 34 | let newSqlObj = sortSelectSql(this.sqlObj) 35 | newSqlObj.sortkeys.forEach((item:any)=>{ 36 | if(newSqlObj.result[item]){ 37 | result = `${result} ${newSqlObj.result[item]}` 38 | } 39 | }) 40 | const sqlStr = `SELECT ${result.replace(/'/g, '\'').replace(/`/g, '\'')} `; 41 | if (type){ 42 | this.sqlObj.sqlStr = sqlStr; return this; 43 | } else { 44 | this.sqlObj = {}; return sqlStr; 45 | } 46 | } 47 | 48 | /** 49 | * 更新 50 | * 51 | * @param {boolean} [type=false] 52 | * @param {boolean} [bol=false] 53 | * @returns 54 | * @memberof Curd 55 | */ 56 | update(type = false, bol = false){ 57 | let result = '' 58 | let datastr = '' 59 | let newopt = this.sqlObj.data 60 | 61 | let keys = Object.keys(newopt) 62 | 63 | keys.forEach((item,index)=>{ 64 | datastr = index==keys.length-1? 65 | `${datastr}${item}=${checkOptType(newopt[item], item, type, bol)}`: 66 | `${datastr}${item}=${checkOptType(newopt[item], item, type, bol)},` 67 | }) 68 | result = this.sqlObj.where ? 69 | `UPDATE ${this.sqlObj.table} SET ${datastr} WHERE ${this.sqlObj.where}` : 70 | `UPDATE ${this.sqlObj.table} SET ${datastr}` 71 | const sqlStr = result.replace(/'/g, '\'').replace(/`/g, '\''); 72 | if (type && !bol) { 73 | this.sqlObj.sqlStr = sqlStr; return this; 74 | } else { 75 | this.sqlObj = {}; return sqlStr; 76 | } 77 | } 78 | 79 | /** 80 | * 插入 81 | * 82 | * @param {boolean} [type=false] 83 | * @returns 84 | * @memberof Curd 85 | */ 86 | insert(type = false){ 87 | let newopt = this.sqlObj.data 88 | const datastr = handleInsertData(newopt); 89 | let result = `INSERT INTO ${this.sqlObj.table} ${datastr}` 90 | const sqlStr = result.replace(/'/g, '\'').replace(/`/g, '\'') 91 | if (type) { 92 | this.sqlObj.sqlStr = sqlStr; return this; 93 | } else { 94 | this.sqlObj = {}; return sqlStr; 95 | } 96 | } 97 | 98 | /** 99 | * 删除 100 | * 101 | * @param {boolean} [type=false] 102 | * @returns 103 | * @memberof Curd 104 | */ 105 | delet(type = false){ 106 | let result = this.sqlObj.where ? 107 | `DELETE FROM ${this.sqlObj.table} WHERE ${this.sqlObj.where}`: 108 | `DELETE FROM ${this.sqlObj.table}` 109 | const sqlStr = result.replace(/'/g, '\'').replace(/`/g, '\'') 110 | if (type) { 111 | this.sqlObj.sqlStr = sqlStr; return this; 112 | } else { 113 | this.sqlObj = {}; return sqlStr; 114 | } 115 | } 116 | 117 | 118 | /** 119 | * query输入sql查询 120 | * 参数为 String 121 | * 案例: query('SELECT * FROM user_name') 122 | * 123 | * @param {string} opt 124 | * @param {boolean} [type=false] 125 | * @returns 126 | * @memberof Curd 127 | */ 128 | query(opt: string, type = false){ 129 | opt = opt ? opt : ''; 130 | if (type) { 131 | this.sqlObj.sqlStr = opt; return this; 132 | } else { 133 | return opt; 134 | } 135 | } 136 | 137 | 138 | } 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | auther : zane 3 | version: 1.0.0 4 | blog:http://blog.seosiwei.com 5 | github: https://github.com/wangweianger/mysqls 6 | npm: https://www.npmjs.com/package/mysqls 7 | */ 8 | import { Config } from './types' 9 | import CURD from './curd' 10 | // @ts-ignore 11 | const mysql2 = require('mysql2') 12 | 13 | 14 | let connection: any = null; 15 | let ispool = true; 16 | 17 | 18 | //建立sql对象 19 | class mysql extends CURD { 20 | istransaction: boolean; 21 | exec: (sqlstring: string, type?: boolean) => Promise; 22 | [propsname:string]: any; 23 | 24 | constructor() { 25 | super(); 26 | this.sqlObj = {} 27 | this.istransaction = false; 28 | } 29 | } 30 | 31 | 32 | mysql.prototype.exec = exec; 33 | 34 | 35 | 36 | /** 37 | * 初始化 38 | * 39 | * @export 40 | * @param {Config} config 41 | */ 42 | export function init(config: Config) { 43 | ispool = typeof(config.ispool) === 'boolean' ? config.ispool : true; 44 | if (ispool) { 45 | connection = mysql2.createPool({ 46 | host: config.host || '127.0.0.1', 47 | user: config.user || 'root', 48 | password: config.password || 'root', 49 | database: config.database || 'test', 50 | port: config.port || 3306, 51 | waitForConnections: config.waitConnection || true, 52 | connectionLimit: config.connectionLimit || 10, 53 | queueLimit: config.queueLimit || 0, 54 | }); 55 | } else { 56 | connection = (mysql as any).createConnection({ 57 | host: config.host || '127.0.0.1', 58 | user: config.user || 'root', 59 | password: config.password || 'root', 60 | database: config.database || 'test', 61 | port: config.port || 3306, 62 | }); 63 | } 64 | } 65 | 66 | 67 | /** 68 | * 运行sql 69 | * 70 | * @export 71 | * @param {string} sqlstring 72 | * @param {boolean} [type=false] 73 | * @returns 74 | */ 75 | export async function exec(sqlstring: string, type = false) { 76 | // @ts-ignore 77 | if (this instanceof mysql){ 78 | // @ts-ignore 79 | sqlstring = this.sqlObj.sqlStr; 80 | // @ts-ignore 81 | this.sqlObj = {}; 82 | } 83 | return new Promise(function(resolve, reject): any|void { 84 | if (!connection){ 85 | reject('Please initialize mysql first.'); 86 | return false; 87 | } 88 | connection.query(sqlstring, function(error: any, results: any, fields: any) { 89 | if (error) { 90 | reject(error); 91 | } else { 92 | resolve(results); 93 | } 94 | if (!ispool && !type) connection.end(); 95 | }); 96 | }) 97 | } 98 | 99 | 100 | /** 101 | * 事务 102 | * 103 | * @export 104 | * @param {string[]} [sqlstringArr=[]] 105 | * @returns 106 | */ 107 | export async function transaction(sqlstringArr: string[] = []) { 108 | return new Promise(async function (resolve, reject): Promise { 109 | if (!connection){ 110 | reject('Please initialize mysql first.'); 111 | return false; 112 | } 113 | if (!sqlstringArr || !sqlstringArr.length){ 114 | reject('The parameter is empty.'); 115 | return false; 116 | } 117 | await exec('start transaction;', true) 118 | let resuarr = [] 119 | for (let i = 0, len = sqlstringArr.length; i < len; i++) { 120 | try { 121 | let result = await exec(sqlstringArr[i], true) 122 | resuarr.push(result) 123 | } catch (err) { 124 | await exec('rollback;', true) 125 | if (!ispool) connection.end() 126 | reject(err) 127 | return 128 | } 129 | } 130 | if (resuarr.length == sqlstringArr.length) { 131 | await exec('commit;', true) 132 | if (!ispool) connection.end() 133 | resolve(resuarr) 134 | } else { 135 | await exec('rollback;', true) 136 | if (!ispool) connection.end() 137 | reject(resuarr) 138 | } 139 | }) 140 | } 141 | 142 | 143 | export const sql = new mysql() 144 | -------------------------------------------------------------------------------- /src/common.ts: -------------------------------------------------------------------------------- 1 | import { AnyOpt } from './types'; 2 | import { getOptToString, sortSelectSql } from './uitl' 3 | 4 | 5 | export default class Common { 6 | sqlObj: AnyOpt; 7 | 8 | //需要查询的table表 参数:String 案例:table('user') 9 | table(opt: string) { 10 | if (opt && opt.indexOf('SELECT') != -1) { 11 | opt = `(${opt})` 12 | } 13 | if (opt) this.sqlObj.table = opt 14 | return this; 15 | } 16 | 17 | 18 | /*where条件 19 | 参数为 String | Object | Array 20 | 案例: 21 | */ 22 | where(opt: string | AnyOpt | AnyOpt[]) { 23 | let result = '' 24 | if (typeof (opt) === 'string') { 25 | result = opt 26 | } else { 27 | result = getOptToString(opt) 28 | } 29 | if (result) this.sqlObj.where = result 30 | return this; 31 | } 32 | 33 | 34 | /*查询字段 35 | 参数为 String | Array 36 | 案例: field('id,name,age,sex') | field(['id','name','age','sex']) 37 | */ 38 | field(opt: string | string[]){ 39 | if(typeof(opt)==='object'){ 40 | opt = opt.join(',') 41 | } 42 | this.sqlObj.field = opt 43 | return this; 44 | } 45 | 46 | /*设置别名 47 | 参数为 String 48 | 案例: alias('a') 49 | */ 50 | alias(opt: string){ 51 | this.sqlObj.alias=opt 52 | return this; 53 | } 54 | 55 | /*设置data数据 56 | 参数为 json | string 57 | 案例: {name:'zane',email:'752636052@qq.com'} | 'name=zane&email=752636052@qq.com' 58 | */ 59 | data(opt: AnyOpt | string){ 60 | let newopt: AnyOpt = {} 61 | if(typeof(opt)==='string'){ 62 | let arr = opt.split('&') 63 | arr.forEach(item=>{ 64 | let itemarr = item.split('=') 65 | newopt[itemarr[0]]=itemarr[1] 66 | }) 67 | }else{ 68 | newopt=opt 69 | } 70 | this.sqlObj.data = newopt 71 | return this 72 | } 73 | 74 | /*order排序 75 | 参数为 Array | string 76 | 案例: order(['id','number asc']) | order('id desc') 77 | */ 78 | order(opt: string[] | string){ 79 | let orderby = 'ORDER BY' 80 | 81 | if(typeof(opt) === 'object'){ 82 | opt = opt.join(',') 83 | } 84 | 85 | this.sqlObj.order = `${orderby} ${opt}` 86 | return this 87 | } 88 | 89 | /*limit 语句 90 | 参数类型 : Number 91 | 案例 limit(10) | limit(10,20) 92 | */ 93 | limit(){ 94 | this.sqlObj.limit = `LIMIT ${Array.prototype.slice.apply(arguments)}` 95 | return this 96 | } 97 | 98 | /*page 语句 99 | 参数类型 : Number | String 100 | 案例 page(1,10) | page(2,10) | page('3,10') 101 | */ 102 | page(option: number | string){ 103 | let opt = [] 104 | if(arguments.length === 1){ 105 | opt = (option as string).split(','); 106 | }else{ 107 | opt = Array.prototype.slice.apply(arguments) 108 | } 109 | if(opt.length==2){ 110 | let begin = parseInt((opt[0]-1) as any) * parseInt(opt[1]); 111 | let end = parseInt(opt[1]) 112 | this.sqlObj.limit = `LIMIT ${begin},${end}` 113 | } 114 | return this 115 | } 116 | 117 | /*group 语句 118 | 参数类型 : String 119 | 案例 group('id,name') 120 | */ 121 | group(opt: string){ 122 | this.sqlObj.group = `GROUP BY ${opt}` 123 | return this 124 | } 125 | 126 | /*having 语句 127 | 参数类型: String 128 | 案例: having('count(number)>3') 129 | */ 130 | having(opt: string){ 131 | this.sqlObj.having = `HAVING ${opt}` 132 | return this 133 | } 134 | 135 | /*union 语句 136 | 参数类型: String | Array 137 | 案例: union('SELECT name FROM node_user_1') | union(['SELECT name FROM node_user_1','SELECT name FROM node_user_2']) 138 | */ 139 | union(opt: string | string[] ,type=false){ 140 | if(typeof(opt) === 'string'){ 141 | if(this.sqlObj.union){ 142 | this.sqlObj.union =`${this.sqlObj.union} (${opt}) ${type?'UNION ALL':'UNION'}` 143 | }else{ 144 | this.sqlObj.union =`(${opt}) ${type?'UNION ALL':'UNION'} ` 145 | } 146 | }else if(typeof(opt)==='object'){ 147 | if(this.sqlObj.union){ 148 | this.sqlObj.union =`${this.sqlObj.union} (${opt.join( type?') UNION ALL (':') UNION (' )}) ${type?'UNION ALL':'UNION'} ` 149 | }else{ 150 | this.sqlObj.union =`(${opt.join( type?') UNION ALL (':') UNION (' )}) ${type?'UNION ALL':'UNION'} ` 151 | } 152 | } 153 | return this 154 | } 155 | 156 | /*distinct 语句 157 | 参数类型: Boolean 158 | 案例: distinct(true) 159 | */ 160 | distinct(opt: boolean){ 161 | if(opt){ 162 | this.sqlObj.distinct = 'DISTINCT' 163 | } 164 | return this 165 | } 166 | 167 | /* lock 锁语法 168 | 参数类型: Boolean 169 | 案例: lock(true) 170 | */ 171 | lock(opt: boolean){ 172 | if(opt){ 173 | this.sqlObj.lock = 'FOR UPDATE' 174 | } 175 | return this 176 | } 177 | 178 | /* comment 为sql语句添加注释 179 | 参数类型: String 180 | 案例: comment('查询用户的姓名') 181 | */ 182 | comment(opt: string){ 183 | if(opt){ 184 | this.sqlObj.comment = `/* ${opt} */` 185 | } 186 | return this 187 | } 188 | 189 | count(opt: string, alias: string){ 190 | let optvalue = opt || 1 191 | this.sqlObj.count = `COUNT(${optvalue})` + (alias ? ` AS ${alias}` : '') 192 | return this 193 | } 194 | 195 | max(opt: string, alias: string){ 196 | if(opt) { 197 | this.sqlObj.max = `MAX(${opt})` + (alias ? ` AS ${alias}` : '') 198 | } 199 | return this 200 | } 201 | 202 | min(opt: string, alias: string){ 203 | if(opt) { 204 | this.sqlObj.min = `MIN(${opt})` + (alias ? ` AS ${alias}` : '') 205 | } 206 | return this 207 | } 208 | 209 | avg(opt: string, alias: string){ 210 | if(opt) { 211 | this.sqlObj.avg = `AVG(${opt})` + (alias ? ` AS ${alias}` : '') 212 | } 213 | return this 214 | } 215 | 216 | sum(opt: string, alias: string){ 217 | if(opt) { 218 | this.sqlObj.sum = `SUM(${opt})` + (alias ? ` AS ${alias}` : '') 219 | } 220 | return this 221 | } 222 | 223 | 224 | /** 225 | * @param {Array|object} opt join参数 226 | * opt.dir 连接方向 227 | * opt.table 连接表名 228 | * opt.where 连接条件 229 | */ 230 | join(opt: AnyOpt | AnyOpt[]) { 231 | let result = '' 232 | switch (Object.prototype.toString.call(opt)) { 233 | case '[object Array]': 234 | for (let i = 0, len = opt.length; i < len; i++) { 235 | if (!(opt as AnyOpt[])[i].dir || !(opt as AnyOpt[])[i].table || !(opt as AnyOpt[])[i].where) continue 236 | result += ` ${(opt as AnyOpt[])[i].dir.toUpperCase()} JOIN ${sortSelectSql((opt as AnyOpt[])[i].table, true).result} ON ${getOptToString((opt as AnyOpt[])[i].where)}` 237 | } 238 | break; 239 | case '[object Object]': 240 | if (!(opt as AnyOpt).dir || !(opt as AnyOpt).table || !(opt as AnyOpt).where) return 241 | result += ` ${(opt as AnyOpt).dir.toUpperCase()} JOIN ${sortSelectSql((opt as AnyOpt).table, true).result} ON ${getOptToString((opt as AnyOpt).where)}` 242 | break 243 | default: 244 | break; 245 | } 246 | if (result) this.sqlObj.join = result 247 | return this 248 | } 249 | 250 | } 251 | 252 | 253 | 254 | 255 | 256 | -------------------------------------------------------------------------------- /README-CN.md: -------------------------------------------------------------------------------- 1 | ### [英文文档](/README.md) | [中文文档](/README-CN.md) 2 | 3 | # mysqls 4 | It is written in JavaScript,crud for mysql.You can also use transactions very easily. 5 | 6 | mysqls 一款专为node.js生成sql语句的插件,链式调用,使用灵活。支持生成sql语法,也支持生成语法之后直接调用,支持事物等特性。 7 | API参考很流行的ThinkPHP模型API。 8 | 9 | * npm地址:https://www.npmjs.com/package/mysqls 10 | 11 | ## 安装: 12 | ```js 13 | npm install mysqls --save-dev 14 | ``` 15 | 16 | ## mysqls参数说明 17 | > * init: sql初始化API 18 | > * exec: 执行sql语句 19 | > * sql: 链式调用生成sql语句,支持生成后直接执行sql语句 20 | > * transaction: 执行事务API 21 | 22 | ## 项目使用: 23 | ```js 24 | //import方式 25 | import { init, exec, sql, transaction } from 'mysqls' 26 | 27 | //require方式 28 | let { init, exec, sql, transaction } = require('mysqls') 29 | ``` 30 | 31 | ## mysql配置初始化: 32 | ```js 33 | // 可在项目的启动时初始化配置 34 | init({ 35 | host: 'localhost', 36 | user: 'root', 37 | password:'123456', 38 | database: 'test', 39 | port: 3306, 40 | }) 41 | ``` 42 | 43 | ### init 参数说明 44 | > * ispool: 是否以连接池的方式初始化 (default:true) 45 | > * host: host地址 (default:'127.0.0.1') 46 | > * user: 用户名 (default:'root') 47 | > * password: 数据库密码 (default:'root') 48 | > * database: 使用的数据库 (default:'test') 49 | > * port: 端口 (default:'3306') 50 | > * waitConnection: 是否等待链接(连接池时使用) (default:true) 51 | > * connectionLimit: 连接池大小 (default:10) 52 | > * queueLimit: 排队限制 (default:0) 53 | 54 | ### 只生成sql语句案例 55 | ```js 56 | sql 57 | .table('node_table') 58 | .field('id,name') 59 | .where({id:1}) 60 | .select() 61 | 62 | // result 63 | SELECT id,name FROM node_table WHERE id=1 64 | ``` 65 | 66 | ### 使用exec函数执行sql语句 67 | ```js 68 | const sqlstr = sql 69 | .table('node_table') 70 | .field('id,name') 71 | .where({id:1}) 72 | .select(); 73 | 74 | const result = await exec(sqlstr); 75 | ``` 76 | 77 | ### 使用sql.prototype.exec链式调用 78 | ```js 79 | const result = sql 80 | .table('node_table') 81 | .field('id,name') 82 | .where({id:1}) 83 | .select(true) 84 | .exec(); 85 | ``` 86 | * 链式调用执行sql时select方法需要传参数:true 87 | * 同样适合update(true),insert(true),delet(true),query(true)方法 88 | 89 | ### 使用Promise方式 90 | ```js 91 | //使用 exec 函数 92 | exec(sql.table('web_pages').where({id:147}).select()) 93 | .then(res=>{ 94 | console.log(res) 95 | }).catch(err=>{ 96 | console.log(err) 97 | }) 98 | 99 | // 使用 exec 方法 100 | sql.table('web_pages').where({id:147}).select(true).exec() 101 | .then(res=>{ 102 | console.log(res) 103 | }).catch(err=>{ 104 | console.log(err) 105 | }) 106 | ``` 107 | 108 | ### 使用async/await 109 | ```js 110 | //使用 exec 函数 111 | const result = await exec(sql.table('web_pages').where({id:147}).select()) 112 | 113 | // 使用 exec 方法 114 | const result = await sql.table('web_pages').where({id:147}).select(true).exec() 115 | ``` 116 | 117 | ### 处理事务 118 | ```js 119 | const tranSqlArr = [ 120 | sql.table('table1').data({number:'number-5'}).update(true,true), 121 | sql.table('table2').data({number:'number+5'}).update(true,true) 122 | ] 123 | const result = await transaction(tranSqlArr) 124 | ``` 125 | 126 | ### 生成sql语句简单用法 127 | * 备注:sql调用方法的顺序内部已经做了排序,因此可以不按严格的sql语句顺序来写 128 | 129 | **查询** 130 | 131 | ```js 132 | sql 133 | .table('node_table') 134 | .field('id,name') 135 | .where({id:1}) 136 | .select() 137 | 138 | SELECT id,name FROM node_table WHERE id=1 139 | ``` 140 | 141 | **插入** 142 | 143 | ```js 144 | sql 145 | .table('node_table') 146 | .data({name:'zane',email:'752636052@qq.com'}) 147 | .insert() 148 | 149 | INSERT INTO node_table (name,email) VALUES (`zane`,`752636052@qq.com`) 150 | ``` 151 | 152 | **批量插入** 153 | 154 | ```js 155 | let data = [ 156 | {name:'zane',email:'752636052@qq.com'}, 157 | {name:'zane_1',email:'752636052_1@qq.com'}, 158 | {name:'zane_2',email:'752636052_2@qq.com'}, 159 | ] 160 | sql 161 | .table('node_table') 162 | .data(data) 163 | .insert() 164 | 165 | INSERT INTO node_table (name,email) VALUES ('zane','752636052@qq.com'),('zane_1','752636052_1@qq.com'),('zane_2','752636052_2@qq.com') 166 | ``` 167 | 168 | **更新** 169 | 170 | ```js 171 | sql 172 | .table('node_table') 173 | .data({name:'zane',email:'752636052@qq.com'}) 174 | .where({id:1}) 175 | .update() 176 | 177 | UPDATE node_table SET name=`zane`,email=`752636052@qq.com` 178 | ``` 179 | 180 | **删除** 181 | 182 | ```js 183 | sql .table('node_table') 184 | .where({name:'zane'}) 185 | .delet(); 186 | 187 | DELETE FROM node_table WHERE name=`zane` 188 | ``` 189 | 190 | ### 生成sql语句高级用法 191 | 192 | ```js 193 | //参数json多字段 194 | sql 195 | .table('node_table') 196 | .where({id:1,name:'zane'}) 197 | .select() 198 | 199 | SELECT * FROM node_table WHERE id=1 AND name=`zane` 200 | 201 | //参数数组 202 | let data=[ 203 | {id:1,name:'zhangsan',_type:'or'}, 204 | {sex:1,number:3} 205 | ] 206 | sql.table('node_table').where(data).select() 207 | 208 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan` ) AND (sex=1 AND number=3 ) 209 | 210 | //多字段连接方式 211 | let data=[ 212 | {id:1,name:'zhangsan',_type:'or',_nexttype:'or'}, 213 | {sex:1,number:3,_type:'and'} 214 | ] 215 | sql.table('node_table').where(data).select() 216 | 217 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan`) OR (sex=1 AND number=3) 218 | 219 | //表达式查询 220 | let data={ 221 | id:{eq:100,egt:10,_type:'or'}, 222 | name:'zhangshan' 223 | } 224 | sql.table('node_table').where(data).select() 225 | 226 | SELECT * FROM node_table WHERE ((id=100) OR (id>=10)) AND name=`zhangshan` 227 | 228 | //混合查询 229 | let data=[{ 230 | id:{eq:100,egt:10,_type:'or'}, 231 | name:'zhangshan', 232 | _nexttype:'or' 233 | },{ 234 | status:1, 235 | name:{like:'%zane%'} 236 | }] 237 | sql.table('node_table').where(data).select() 238 | 239 | SELECT * FROM node_table WHERE (((id=100) OR (id>=10)) AND name=`zhangshan`) OR (status=1 AND ((name LIKE `%zane%`))) 240 | 241 | 242 | //UNION , UNION ALL 组合使用 243 | sql 244 | .union('SELECT * FROM think_user_1',true) 245 | .union('SELECT * FROM think_user_2',true) 246 | .union(['SELECT * FROM think_user_3','SELECT name FROM think_user_4']) 247 | .union('SELECT * FROM think_user_5',true) 248 | .select() 249 | 250 | 得到 251 | (SELECT * FROM think_user_1) UNION ALL 252 | (SELECT * FROM think_user_2) UNION ALL 253 | (SELECT * FROM think_user_3) UNION 254 | (SELECT name FROM think_user_4) UNION 255 | (SELECT * FROM think_user_5) 256 | 257 | ``` 258 | 259 | 更多用法请查看详细文档 260 | 261 | ## 文档目录 262 | 263 | * [**1.简介**](/README.md) 264 | * [**1.1.参数说明与事务**](/docs/main/main.md) 265 | * [**2.链式操作**](/docs/chain/README.md) 266 | * [**2.1.WHERE**](/docs/chain/where.md) 267 | * [**2.2.TABLE**](/docs/chain/table.md) 268 | * [**2.3.ALIAS**](/docs/chain/alias.md) 269 | * [**2.4.DATA**](/docs/chain/data.md) 270 | * [**2.5.FIELD**](/docs/chain/field.md) 271 | * [**2.6.ORDER**](/docs/chain/order.md) 272 | * [**2.7.LIMIT**](/docs/chain/limit.md) 273 | * [**2.8.PAGE**](/docs/chain/page.md) 274 | * [**2.9.GROUP**](/docs/chain/group.md) 275 | * [**2.10.HAVING**](/docs/chain/having.md) 276 | * [**2.11.UNION**](/docs/chain/union.md) 277 | * [**2.12.DISTINCT**](/docs/chain/distinct.md) 278 | * [**2.13.COMMENT**](/docs/chain/comment.md) 279 | * [**3.CURD调用**](/docs/curd/README.md) 280 | * [**3.1.SELECT**](/docs/curd/select.md) 281 | * [**3.2.UPDATE**](/docs/curd/update.md) 282 | * [**3.3.INSERT**](/docs/curd/insert.md) 283 | * [**3.4.DELETE**](/docs/curd/delete.md) 284 | * [**4.查询方式**](/docs/advanced/README.md) 285 | * [**4.1.基本查询**](/docs/advanced/basesearch.md) 286 | * [**4.2.表达式查询**](/docs/advanced/bdssearch.md) 287 | * [**4.3.区间查询**](/docs/advanced/qjsearch.md) 288 | * [**4.4.组合查询**](/docs/advanced/zhsearch.md) 289 | * [**4.5.统计查询**](/docs/advanced/tjsearch.md) 290 | * [**4.6.SQL查询**](/docs/advanced/sqlsearch.md) 291 | * [**4.7.子查询**](/docs/advanced/childsearch.md) 292 | 293 | 294 | 295 | 296 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### [EN](/README.md) | [CN](/README-CN.md) 2 | 3 | # mysqls 4 | It is written in JavaScript. crud for mysql. You can also use transactions very easily. 5 | 6 | mysqls:A plug-in that generates SQL statements for node.js. call chaining .simple to use. support transaction. 7 | 8 | * npm address:https://www.npmjs.com/package/mysqls 9 | 10 | ## install: 11 | ```js 12 | npm install mysqls --save 13 | or 14 | yarn add mysqls 15 | ``` 16 | 17 | ## mysqls parameters 18 | > * init: sql Initialization 19 | > * exec: Executing SQL statements 20 | > * sql: Chain Call Generates SQL Statement 21 | > * transaction: transaction API 22 | 23 | ## Use: 24 | ```js 25 | //import 26 | import { init, exec, sql, transaction } from 'mysqls' 27 | 28 | //require 29 | let { init, exec, sql, transaction } = require('mysqls') 30 | ``` 31 | 32 | ## Config initialization: 33 | ```js 34 | // You can initialize the configuration at project startup 35 | init({ 36 | host: 'localhost', 37 | user: 'root', 38 | password:'123456', 39 | database: 'test', 40 | port: 3306, 41 | }) 42 | ``` 43 | 44 | ### init configs 45 | > * ispool: Is it initialized as a connection pool. (default:true) 46 | > * host: host address. (default:'127.0.0.1') 47 | > * user: user. (default:'root') 48 | > * password: password. (default:'root') 49 | > * database: database. (default:'test') 50 | > * port: port. (default:'3306') 51 | > * waitConnection: wait for connections. (default:true) 52 | > * connectionLimit: connection limit. (default:10) 53 | > * queueLimit: queue limit. (default:0) 54 | 55 | ### Only Generate SQL statements. 56 | ```js 57 | sql 58 | .table('node_table') 59 | .field('id,name') 60 | .where({id:1}) 61 | .select() 62 | 63 | // result 64 | SELECT id,name FROM node_table WHERE id=1 65 | ``` 66 | 67 | ### use exec function 68 | ```js 69 | const sqlstr = sql 70 | .table('node_table') 71 | .field('id,name') 72 | .where({id:1}) 73 | .select(); 74 | 75 | const result = await exec(sqlstr); 76 | ``` 77 | 78 | ### use sql.prototype.exec 79 | ```js 80 | const result = sql 81 | .table('node_table') 82 | .field('id,name') 83 | .where({id:1}) 84 | .select(true) 85 | .exec(); 86 | ``` 87 | * .select(true):true 88 | * It same to use at update(true)、insert(true)、delet(true)、query(true) method. 89 | 90 | ### use Promise 91 | ```js 92 | // use exec function 93 | exec(sql.table('web_pages').where({id:147}).select()) 94 | .then(res=>{ 95 | console.log(res) 96 | }).catch(err=>{ 97 | console.log(err) 98 | }) 99 | 100 | // use exec method 101 | sql.table('web_pages').where({id:147}).select(true).exec() 102 | .then(res=>{ 103 | console.log(res) 104 | }).catch(err=>{ 105 | console.log(err) 106 | }) 107 | ``` 108 | 109 | ### 使用async/await 110 | ```js 111 | // use exec function 112 | const result = await exec(sql.table('web_pages').where({id:147}).select()) 113 | 114 | // use exec method 115 | const result = await sql.table('web_pages').where({id:147}).select(true).exec() 116 | ``` 117 | 118 | ### transaction 119 | ```js 120 | const tranSqlArr = [ 121 | sql.table('table1').data({number:'number-5'}).update(true,true), 122 | sql.table('table2').data({number:'number+5'}).update(true,true) 123 | ] 124 | const result = await transaction(tranSqlArr) 125 | ``` 126 | 127 | ### Simple usage of generating SQL statements. 128 | 129 | **select** 130 | 131 | ```js 132 | sql 133 | .table('node_table') 134 | .field('id,name') 135 | .where({id:1}) 136 | .select() 137 | 138 | SELECT id,name FROM node_table WHERE id=1 139 | ``` 140 | 141 | **insert** 142 | 143 | ```js 144 | sql 145 | .table('node_table') 146 | .data({name:'zane',email:'752636052@qq.com'}) 147 | .insert() 148 | 149 | INSERT INTO node_table (name,email) VALUES (`zane`,`752636052@qq.com`) 150 | ``` 151 | **batch insert** 152 | 153 | ```js 154 | let data = [ 155 | {name:'zane',email:'752636052@qq.com'}, 156 | {name:'zane_1',email:'752636052_1@qq.com'}, 157 | {name:'zane_2',email:'752636052_2@qq.com'}, 158 | ] 159 | sql 160 | .table('node_table') 161 | .data(data) 162 | .insert() 163 | 164 | INSERT INTO node_table (name,email) VALUES ('zane','752636052@qq.com'),('zane_1','752636052_1@qq.com'),('zane_2','752636052_2@qq.com') 165 | ``` 166 | 167 | **update** 168 | 169 | ```js 170 | sql 171 | .table('node_table') 172 | .data({name:'zane',email:'752636052@qq.com'}) 173 | .where({id:1}) 174 | .update() 175 | 176 | UPDATE node_table SET name=`zane`,email=`752636052@qq.com` 177 | ``` 178 | 179 | **delet** 180 | 181 | ```js 182 | sql .table('node_table') 183 | .where({name:'zane'}) 184 | .delet(); 185 | 186 | DELETE FROM node_table WHERE name=`zane` 187 | ``` 188 | 189 | ### Advanced Usage. 190 | 191 | ```js 192 | // parameter json 193 | sql 194 | .table('node_table') 195 | .where({id:1,name:'zane'}) 196 | .select() 197 | 198 | SELECT * FROM node_table WHERE id=1 AND name=`zane` 199 | 200 | // parameter array 201 | let data=[ 202 | {id:1,name:'zhangsan',_type:'or'}, 203 | {sex:1,number:3} 204 | ] 205 | sql.table('node_table').where(data).select() 206 | 207 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan` ) AND (sex=1 AND number=3 ) 208 | 209 | // multiple fields 210 | let data=[ 211 | {id:1,name:'zhangsan',_type:'or',_nexttype:'or'}, 212 | {sex:1,number:3,_type:'and'} 213 | ] 214 | sql.table('node_table').where(data).select() 215 | 216 | SELECT * FROM node_table WHERE (id=1 OR name=`zhangsan`) OR (sex=1 AND number=3) 217 | 218 | // Expression Query 219 | let data={ 220 | id:{eq:100,egt:10,_type:'or'}, 221 | name:'zhangshan' 222 | } 223 | sql.table('node_table').where(data).select() 224 | 225 | SELECT * FROM node_table WHERE ((id=100) OR (id>=10)) AND name=`zhangshan` 226 | 227 | // Multiple queries 228 | let data=[{ 229 | id:{eq:100,egt:10,_type:'or'}, 230 | name:'zhangshan', 231 | _nexttype:'or' 232 | },{ 233 | status:1, 234 | name:{like:'%zane%'} 235 | }] 236 | sql.table('node_table').where(data).select() 237 | 238 | SELECT * FROM node_table WHERE (((id=100) OR (id>=10)) AND name=`zhangshan`) OR (status=1 AND ((name LIKE `%zane%`))) 239 | 240 | 241 | //UNION , UNION ALL 242 | sql 243 | .union('SELECT * FROM think_user_1',true) 244 | .union('SELECT * FROM think_user_2',true) 245 | .union(['SELECT * FROM think_user_3','SELECT name FROM think_user_4']) 246 | .union('SELECT * FROM think_user_5',true) 247 | .select() 248 | 249 | result 250 | (SELECT * FROM think_user_1) UNION ALL 251 | (SELECT * FROM think_user_2) UNION ALL 252 | (SELECT * FROM think_user_3) UNION 253 | (SELECT name FROM think_user_4) UNION 254 | (SELECT * FROM think_user_5) 255 | 256 | ``` 257 | 258 | ## Directory 259 | 260 | * [**1.synopsis**](/README.md) 261 | * [**1.1.Parameter Description and Transaction**](/docs/main/main.md) 262 | * [**2.Chain operation**](/docs/chain/README.md) 263 | * [**2.1.WHERE**](/docs/chain/where.md) 264 | * [**2.2.TABLE**](/docs/chain/table.md) 265 | * [**2.3.ALIAS**](/docs/chain/alias.md) 266 | * [**2.4.DATA**](/docs/chain/data.md) 267 | * [**2.5.FIELD**](/docs/chain/field.md) 268 | * [**2.6.ORDER**](/docs/chain/order.md) 269 | * [**2.7.LIMIT**](/docs/chain/limit.md) 270 | * [**2.8.PAGE**](/docs/chain/page.md) 271 | * [**2.9.GROUP**](/docs/chain/group.md) 272 | * [**2.10.HAVING**](/docs/chain/having.md) 273 | * [**2.11.UNION**](/docs/chain/union.md) 274 | * [**2.12.DISTINCT**](/docs/chain/distinct.md) 275 | * [**2.13.COMMENT**](/docs/chain/comment.md) 276 | * [**3.CURD**](/docs/curd/README.md) 277 | * [**3.1.SELECT**](/docs/curd/select.md) 278 | * [**3.2.UPDATE**](/docs/curd/update.md) 279 | * [**3.3.INSERT**](/docs/curd/insert.md) 280 | * [**3.4.DELETE**](/docs/curd/delete.md) 281 | * [**4.Query mode**](/docs/advanced/README.md) 282 | * [**4.1.Basic query**](/docs/advanced/basesearch.md) 283 | * [**4.2.Expression Query**](/docs/advanced/bdssearch.md) 284 | * [**4.3.Interval query**](/docs/advanced/qjsearch.md) 285 | * [**4.4.Composite query**](/docs/advanced/zhsearch.md) 286 | * [**4.5.Statistical query**](/docs/advanced/tjsearch.md) 287 | * [**4.6.SQL query**](/docs/advanced/sqlsearch.md) 288 | * [**4.7.Subquery**](/docs/advanced/childsearch.md) 289 | 290 | 291 | 292 | 293 | -------------------------------------------------------------------------------- /src/uitl.ts: -------------------------------------------------------------------------------- 1 | import * as sqlstring from 'sqlstring' 2 | import { AnyOpt } from './types' 3 | 4 | 5 | //把查询参数转换为strng 6 | export function getOptToString(opt: string | AnyOpt | AnyOpt[]){ 7 | let result = '' 8 | let optType = Object.prototype.toString.call(opt) 9 | 10 | if(optType==='[object Object]'){ 11 | let _type = (opt as AnyOpt)._type && (opt as AnyOpt)._type.toUpperCase() || 'AND' 12 | let number = (opt as AnyOpt)._type && (opt as AnyOpt)._type.trim()?1:0 13 | 14 | let keys = Object.keys(opt) 15 | keys.forEach((item,index)=>{ 16 | if(item === '_type') return; 17 | if (typeof ((opt as AnyOpt)[item])==='object'){ 18 | if(index === keys.length-1-number){ 19 | result = result + `${checkOptObjType(item, (opt as AnyOpt)[item])}` 20 | }else{ 21 | result = result + `${checkOptObjType(item, (opt as AnyOpt)[item])} ${_type} ` 22 | } 23 | }else{ 24 | if(index === keys.length-1-number){ 25 | result = result + `${item}=${checkOptType((opt as AnyOpt)[item])}` 26 | }else{ 27 | result = result + `${item}=${checkOptType((opt as AnyOpt)[item])} ${_type} ` 28 | } 29 | } 30 | }) 31 | }else if(optType === '[object Array]'){ 32 | (opt as AnyOpt[]).forEach((item,index)=>{ 33 | let result1 ='' 34 | let number = 0 35 | let _type = item._type&&item._type.toUpperCase() || 'AND' 36 | let _nexttype = item._nexttype || 'AND' 37 | number = item._type&&item._type.trim()?number+1:number 38 | number = item._nexttype&&item._nexttype.trim()?number+1:number 39 | 40 | let keys = Object.keys(item) 41 | keys.forEach((chi_item,index)=>{ 42 | if(chi_item === '_type'||chi_item === '_nexttype') return; 43 | if(result1){ 44 | if(typeof(item[chi_item]) === 'object'){ 45 | result1 = result1 + `${_type} ${checkOptObjType(chi_item,item[chi_item])}` 46 | }else{ 47 | result1 = result1 + `${_type} ${chi_item}=${checkOptType(item[chi_item])} ` 48 | } 49 | }else{ 50 | if(typeof(item[chi_item]) === 'object'){ 51 | result1 = `${checkOptObjType(chi_item,item[chi_item])}` 52 | }else{ 53 | result1 = `${chi_item}=${checkOptType(item[chi_item])} ` 54 | } 55 | } 56 | }) 57 | 58 | index === opt.length-1? 59 | result1 = `(${result1})` : 60 | result1 = `(${result1}) ${_nexttype.toUpperCase()}` 61 | 62 | result =`${result} ${result1}` 63 | }) 64 | } 65 | return result 66 | } 67 | 68 | //检查值类型返回相应值 69 | export function checkOptType(opt: any, key?: string, type?:boolean , bol?: boolean){ 70 | let result: any 71 | switch(Object.prototype.toString.call(opt)){ 72 | case "[object String]": 73 | opt = opt.trim(); 74 | opt = sqlstring.escape(opt); 75 | result = type && bol && opt.indexOf(key) > -1 && opt.match(/\+|-|\*|\/|%/) ? opt.slice(1,-1) : `${opt}`; 76 | break; 77 | case "[object Boolean]": case "[object Number]": 78 | result = opt 79 | break; 80 | default: 81 | result = sqlstring.escape(opt); 82 | } 83 | 84 | return result 85 | } 86 | 87 | //检查object值类型 返回相应值 88 | export function checkOptObjType(pre_key: string,val: any){ 89 | let result='' 90 | let type = Object.prototype.toString.call(val) 91 | 92 | if(type === '[object Object]'){ 93 | let keys = Object.keys(val) 94 | let number = val._type&&val._type.trim()?1:0 95 | 96 | keys.forEach((item,index)=>{ 97 | if(item === '_type') return; 98 | 99 | let _type = val._type || 'AND' 100 | result = result + expressionQuery( 101 | pre_key, 102 | item, 103 | val[item], 104 | _type.toUpperCase(), 105 | index === keys.length-1-number?true:false 106 | ) 107 | }) 108 | }else{ 109 | result = `${pre_key}=${val}` 110 | } 111 | return `(${result}) ` 112 | } 113 | 114 | // 表达式匹配查询 115 | export function expressionQuery(par_key: string, chi_key: string, value: string, _type: string, isLastOne: boolean){ 116 | let result='' 117 | switch(chi_key.toUpperCase()){ 118 | case 'EQ': 119 | result = `(${par_key}=${checkOptType(value)})` 120 | break; 121 | case 'NEQ': 122 | result = `(${par_key}<>${checkOptType(value)})` 123 | break; 124 | case 'GT': 125 | result = `(${par_key}>${checkOptType(value)})` 126 | break; 127 | case 'EGT': 128 | result = `(${par_key}>=${checkOptType(value)})` 129 | break; 130 | case 'LT': 131 | result = `(${par_key}<${checkOptType(value)})` 132 | break; 133 | case 'ELT': 134 | result = `(${par_key}<=${checkOptType(value)})` 135 | break; 136 | case 'LIKE': 137 | result = `(${par_key} LIKE ${checkOptType(value)})` 138 | break; 139 | case 'NOTLIKE': 140 | result = `(${par_key} NOT LIKE ${checkOptType(value)})` 141 | break; 142 | case 'BETWEEN': 143 | result = `(${par_key} BETWEEN ${value.replace(',',' AND ')})` 144 | break; 145 | case 'NOTBETWEEN': 146 | result = `(${par_key} NOT BETWEEN ${value.replace(',',' AND ')})` 147 | break; 148 | case 'IN': 149 | result = `(${par_key} IN (${value}))` 150 | break; 151 | case 'NOTIN': 152 | result = `(${par_key} NOT IN (${value}))` 153 | break; 154 | default: 155 | result = `(${par_key}=${checkOptType(value)})` 156 | } 157 | return isLastOne ? `${result} ` : `${result} ${_type} ` 158 | } 159 | 160 | //排序 生成 sql 字符串 161 | export function sortSelectSql(json: AnyOpt , bool = false) { 162 | let result = json || {} 163 | if (bool) { 164 | if (result.table) result.table = `${result.table}` 165 | } else { 166 | if (result.count || result.max || result.min || result.avg || result.sum) { 167 | let concatstr = (result.count ? `,${result.count}` : '') 168 | + (result.max ? `,${result.max}` : '') 169 | + (result.min ? `,${result.min}` : '') 170 | + (result.avg ? `,${result.avg}` : '') 171 | + (result.sum ? `,${result.sum}` : '') 172 | result.count = result.max = result.min = result.avg = result.sum = ''; 173 | result.field ? result.field = (result.field + concatstr) : result.field = concatstr.substring(1) 174 | } 175 | if (!result.field) result.field = '*' 176 | if (result.table) result.table = `FROM ${result.table}` 177 | if (result.where) result.where = `WHERE ${result.where}` 178 | } 179 | 180 | let keys = Object.keys(result) 181 | let keysresult: any = [] 182 | // 查询默认排序数组 183 | let searchSort = ['union', 'distinct', 'field', 'count', 'max', 'min', 'avg', 'sum', 'table', 184 | 'alias', 'join', 'where', 'group', 'having', 'order', 'limit', 'page', 'comment'] 185 | //排序 186 | keys.forEach((item1, index1) => { 187 | searchSort.forEach((item2, index2) => { 188 | if (item1 === item2) { 189 | keysresult[index2] = item1 190 | } 191 | }) 192 | }) 193 | return { 194 | sortkeys: keysresult, 195 | result: result 196 | }; 197 | } 198 | 199 | function sortArray(data: AnyOpt[]){ 200 | const result = []; 201 | const item = Object.keys(data[0]) 202 | for (let i = 1; i < data.length; i++) { 203 | for (let j = 0; j < item.length; j++) { 204 | // @ts-ignore 205 | if (!Object.keys(data[i]).includes(item[j])){ 206 | item.splice(j, 1); 207 | } 208 | } 209 | } 210 | for (let i = 0; i < data.length; i++) { 211 | let json: AnyOpt = {}; 212 | for (let j = 0; j < item.length; j++) { 213 | json[[item[j]] as any] = data[i][item[j]]; 214 | } 215 | result.push(json) 216 | } 217 | return result; 218 | } 219 | 220 | // 处理insert批量插入data参数 221 | export function handleInsertData(data: any) { 222 | if (!data) return ''; 223 | if (Array.isArray(data) && data.length === 1) data = data[0]; 224 | 225 | let keys = '' 226 | let values = '' 227 | let datastr = '' 228 | 229 | if (Array.isArray(data)){ 230 | // array 231 | data = sortArray(data); 232 | keys = Object.keys(data[0]).toString(); 233 | for(let i = 0; i < data.length; i++) { 234 | let items = '' 235 | for (let key in data[i]) { 236 | items = items ? `${items},${checkOptType(data[i][key])}` : checkOptType(data[i][key]) 237 | } 238 | values += `(${items}),` 239 | } 240 | values = values.slice(0, -1) 241 | }else{ 242 | // object 243 | for (let key in data) { 244 | keys = keys ? `${keys},${key}` : key 245 | values = values ? `${values},${checkOptType(data[key])}` : checkOptType(data[key]) 246 | } 247 | values = `(${values})`; 248 | } 249 | datastr = `(${keys}) VALUES ${values}` 250 | return datastr; 251 | } 252 | 253 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.0.0": 6 | version "7.12.11" 7 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" 8 | integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== 9 | dependencies: 10 | "@babel/highlight" "^7.10.4" 11 | 12 | "@babel/helper-validator-identifier@^7.10.4": 13 | version "7.12.11" 14 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" 15 | integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== 16 | 17 | "@babel/highlight@^7.10.4": 18 | version "7.10.4" 19 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" 20 | integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== 21 | dependencies: 22 | "@babel/helper-validator-identifier" "^7.10.4" 23 | chalk "^2.0.0" 24 | js-tokens "^4.0.0" 25 | 26 | "@types/sqlstring@^2.3.0": 27 | version "2.3.0" 28 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/@types/sqlstring/-/sqlstring-2.3.0.tgz#5960ade0166cfaaa4673fc74ec8157a08d06c89e" 29 | integrity sha512-kMFecDYYFk/f5fljO0UFrSPwU1JxY4mIjX6ic7MHv5nD6sEd3NYLoWcOV/3s6Drs7RHdCwTQdD5NdgVl0I2zzg== 30 | 31 | ansi-align@^2.0.0: 32 | version "2.0.0" 33 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" 34 | integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= 35 | dependencies: 36 | string-width "^2.0.0" 37 | 38 | ansi-escapes@^3.2.0: 39 | version "3.2.0" 40 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" 41 | integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== 42 | 43 | ansi-regex@^3.0.0: 44 | version "3.0.0" 45 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 46 | integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= 47 | 48 | ansi-regex@^4.1.0: 49 | version "4.1.0" 50 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" 51 | integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== 52 | 53 | ansi-styles@^3.2.1: 54 | version "3.2.1" 55 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 56 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 57 | dependencies: 58 | color-convert "^1.9.0" 59 | 60 | argparse@^1.0.7: 61 | version "1.0.10" 62 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" 63 | integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== 64 | dependencies: 65 | sprintf-js "~1.0.2" 66 | 67 | array-find-index@^1.0.1: 68 | version "1.0.2" 69 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" 70 | integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= 71 | 72 | arrify@^1.0.0, arrify@^1.0.1: 73 | version "1.0.1" 74 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" 75 | integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= 76 | 77 | async@^1.5.2: 78 | version "1.5.2" 79 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" 80 | integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= 81 | 82 | balanced-match@^1.0.0: 83 | version "1.0.0" 84 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 85 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 86 | 87 | boxen@^1.2.1: 88 | version "1.3.0" 89 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" 90 | integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== 91 | dependencies: 92 | ansi-align "^2.0.0" 93 | camelcase "^4.0.0" 94 | chalk "^2.0.1" 95 | cli-boxes "^1.0.0" 96 | string-width "^2.0.0" 97 | term-size "^1.2.0" 98 | widest-line "^2.0.0" 99 | 100 | brace-expansion@^1.1.7: 101 | version "1.1.11" 102 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 103 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 104 | dependencies: 105 | balanced-match "^1.0.0" 106 | concat-map "0.0.1" 107 | 108 | buffer-from@^1.0.0, buffer-from@^1.1.0: 109 | version "1.1.1" 110 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 111 | integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 112 | 113 | builtin-modules@^1.1.1: 114 | version "1.1.1" 115 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" 116 | integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= 117 | 118 | camelcase-keys@^4.0.0: 119 | version "4.2.0" 120 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" 121 | integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= 122 | dependencies: 123 | camelcase "^4.1.0" 124 | map-obj "^2.0.0" 125 | quick-lru "^1.0.0" 126 | 127 | camelcase@^4.0.0, camelcase@^4.1.0: 128 | version "4.1.0" 129 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" 130 | integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= 131 | 132 | capture-stack-trace@^1.0.0: 133 | version "1.0.1" 134 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" 135 | integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== 136 | 137 | chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: 138 | version "2.4.2" 139 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 140 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 141 | dependencies: 142 | ansi-styles "^3.2.1" 143 | escape-string-regexp "^1.0.5" 144 | supports-color "^5.3.0" 145 | 146 | chardet@^0.7.0: 147 | version "0.7.0" 148 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" 149 | integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== 150 | 151 | ci-info@^1.5.0: 152 | version "1.6.0" 153 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" 154 | integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== 155 | 156 | clang-format@1.2.3: 157 | version "1.2.3" 158 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/clang-format/-/clang-format-1.2.3.tgz#2763561aa7449c43737480f8df3a2b5b66e6cf37" 159 | integrity sha512-x90Hac4ERacGDcZSvHKK58Ga0STuMD+Doi5g0iG2zf7wlJef5Huvhs/3BvMRFxwRYyYSdl6mpQNrtfMxE8MQzw== 160 | dependencies: 161 | async "^1.5.2" 162 | glob "^7.0.0" 163 | resolve "^1.1.6" 164 | 165 | cli-boxes@^1.0.0: 166 | version "1.0.0" 167 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" 168 | integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= 169 | 170 | cli-cursor@^2.1.0: 171 | version "2.1.0" 172 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" 173 | integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= 174 | dependencies: 175 | restore-cursor "^2.0.0" 176 | 177 | cli-width@^2.0.0: 178 | version "2.2.1" 179 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" 180 | integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== 181 | 182 | color-convert@^1.9.0: 183 | version "1.9.3" 184 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 185 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 186 | dependencies: 187 | color-name "1.1.3" 188 | 189 | color-name@1.1.3: 190 | version "1.1.3" 191 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 192 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 193 | 194 | commander@^2.12.1: 195 | version "2.20.3" 196 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" 197 | integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== 198 | 199 | concat-map@0.0.1: 200 | version "0.0.1" 201 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 202 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 203 | 204 | configstore@^3.0.0: 205 | version "3.1.5" 206 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/configstore/-/configstore-3.1.5.tgz#e9af331fadc14dabd544d3e7e76dc446a09a530f" 207 | integrity sha512-nlOhI4+fdzoK5xmJ+NY+1gZK56bwEaWZr8fYuXohZ9Vkc1o3a4T/R3M+yE/w7x/ZVJ1zF8c+oaOvF0dztdUgmA== 208 | dependencies: 209 | dot-prop "^4.2.1" 210 | graceful-fs "^4.1.2" 211 | make-dir "^1.0.0" 212 | unique-string "^1.0.0" 213 | write-file-atomic "^2.0.0" 214 | xdg-basedir "^3.0.0" 215 | 216 | create-error-class@^3.0.0: 217 | version "3.0.2" 218 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" 219 | integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= 220 | dependencies: 221 | capture-stack-trace "^1.0.0" 222 | 223 | cross-spawn@^5.0.1: 224 | version "5.1.0" 225 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" 226 | integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= 227 | dependencies: 228 | lru-cache "^4.0.1" 229 | shebang-command "^1.2.0" 230 | which "^1.2.9" 231 | 232 | crypto-random-string@^1.0.0: 233 | version "1.0.0" 234 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" 235 | integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= 236 | 237 | currently-unhandled@^0.4.1: 238 | version "0.4.1" 239 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" 240 | integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= 241 | dependencies: 242 | array-find-index "^1.0.1" 243 | 244 | decamelize-keys@^1.0.0: 245 | version "1.1.0" 246 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" 247 | integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= 248 | dependencies: 249 | decamelize "^1.1.0" 250 | map-obj "^1.0.0" 251 | 252 | decamelize@^1.1.0: 253 | version "1.2.0" 254 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" 255 | integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= 256 | 257 | deep-extend@^0.6.0: 258 | version "0.6.0" 259 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" 260 | integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== 261 | 262 | denque@^1.4.1: 263 | version "1.5.0" 264 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/denque/-/denque-1.5.0.tgz#773de0686ff2d8ec2ff92914316a47b73b1c73de" 265 | integrity sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ== 266 | 267 | diff@^3.1.0: 268 | version "3.5.0" 269 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" 270 | integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== 271 | 272 | diff@^4.0.1: 273 | version "4.0.2" 274 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" 275 | integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== 276 | 277 | dot-prop@^4.2.1: 278 | version "4.2.1" 279 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/dot-prop/-/dot-prop-4.2.1.tgz#45884194a71fc2cda71cbb4bceb3a4dd2f433ba4" 280 | integrity sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ== 281 | dependencies: 282 | is-obj "^1.0.0" 283 | 284 | duplexer3@^0.1.4: 285 | version "0.1.4" 286 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" 287 | integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= 288 | 289 | error-ex@^1.3.1: 290 | version "1.3.2" 291 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" 292 | integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== 293 | dependencies: 294 | is-arrayish "^0.2.1" 295 | 296 | escape-string-regexp@^1.0.5: 297 | version "1.0.5" 298 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 299 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 300 | 301 | esprima@^4.0.0: 302 | version "4.0.1" 303 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" 304 | integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== 305 | 306 | execa@^0.7.0: 307 | version "0.7.0" 308 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" 309 | integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= 310 | dependencies: 311 | cross-spawn "^5.0.1" 312 | get-stream "^3.0.0" 313 | is-stream "^1.1.0" 314 | npm-run-path "^2.0.0" 315 | p-finally "^1.0.0" 316 | signal-exit "^3.0.0" 317 | strip-eof "^1.0.0" 318 | 319 | external-editor@^3.0.3: 320 | version "3.1.0" 321 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" 322 | integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== 323 | dependencies: 324 | chardet "^0.7.0" 325 | iconv-lite "^0.4.24" 326 | tmp "^0.0.33" 327 | 328 | figures@^2.0.0: 329 | version "2.0.0" 330 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" 331 | integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= 332 | dependencies: 333 | escape-string-regexp "^1.0.5" 334 | 335 | find-up@^2.0.0: 336 | version "2.1.0" 337 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" 338 | integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= 339 | dependencies: 340 | locate-path "^2.0.0" 341 | 342 | fs.realpath@^1.0.0: 343 | version "1.0.0" 344 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 345 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 346 | 347 | function-bind@^1.1.1: 348 | version "1.1.1" 349 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 350 | integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== 351 | 352 | generate-function@^2.3.1: 353 | version "2.3.1" 354 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" 355 | integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== 356 | dependencies: 357 | is-property "^1.0.2" 358 | 359 | get-stream@^3.0.0: 360 | version "3.0.0" 361 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" 362 | integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= 363 | 364 | glob@^7.0.0, glob@^7.1.1, glob@^7.1.3: 365 | version "7.1.6" 366 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" 367 | integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== 368 | dependencies: 369 | fs.realpath "^1.0.0" 370 | inflight "^1.0.4" 371 | inherits "2" 372 | minimatch "^3.0.4" 373 | once "^1.3.0" 374 | path-is-absolute "^1.0.0" 375 | 376 | global-dirs@^0.1.0: 377 | version "0.1.1" 378 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" 379 | integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= 380 | dependencies: 381 | ini "^1.3.4" 382 | 383 | got@^6.7.1: 384 | version "6.7.1" 385 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" 386 | integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= 387 | dependencies: 388 | create-error-class "^3.0.0" 389 | duplexer3 "^0.1.4" 390 | get-stream "^3.0.0" 391 | is-redirect "^1.0.0" 392 | is-retry-allowed "^1.0.0" 393 | is-stream "^1.0.0" 394 | lowercase-keys "^1.0.0" 395 | safe-buffer "^5.0.1" 396 | timed-out "^4.0.0" 397 | unzip-response "^2.0.1" 398 | url-parse-lax "^1.0.0" 399 | 400 | graceful-fs@^4.1.11, graceful-fs@^4.1.2: 401 | version "4.2.4" 402 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" 403 | integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== 404 | 405 | gts@^0.8.0: 406 | version "0.8.0" 407 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/gts/-/gts-0.8.0.tgz#765b758a4217dd2b22336012688877dc04c59c75" 408 | integrity sha512-VB9LQLFR+10cJhDBLYu9i2t7vTkewTXeBJbvw5+M2LqGgjiaKIUTIFbVBLjIknDpuaRpAzVcvhiHWy/30c09jg== 409 | dependencies: 410 | chalk "^2.4.1" 411 | clang-format "1.2.3" 412 | inquirer "^6.0.0" 413 | meow "^5.0.0" 414 | pify "^3.0.0" 415 | rimraf "^2.6.2" 416 | tslint "^5.9.1" 417 | update-notifier "^2.5.0" 418 | write-file-atomic "^2.3.0" 419 | 420 | has-flag@^3.0.0: 421 | version "3.0.0" 422 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 423 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 424 | 425 | has@^1.0.3: 426 | version "1.0.3" 427 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" 428 | integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== 429 | dependencies: 430 | function-bind "^1.1.1" 431 | 432 | hosted-git-info@^2.1.4: 433 | version "2.8.8" 434 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" 435 | integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== 436 | 437 | iconv-lite@^0.4.24: 438 | version "0.4.24" 439 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" 440 | integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== 441 | dependencies: 442 | safer-buffer ">= 2.1.2 < 3" 443 | 444 | iconv-lite@^0.6.2: 445 | version "0.6.2" 446 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" 447 | integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== 448 | dependencies: 449 | safer-buffer ">= 2.1.2 < 3.0.0" 450 | 451 | import-lazy@^2.1.0: 452 | version "2.1.0" 453 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" 454 | integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= 455 | 456 | imurmurhash@^0.1.4: 457 | version "0.1.4" 458 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" 459 | integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= 460 | 461 | indent-string@^3.0.0: 462 | version "3.2.0" 463 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" 464 | integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= 465 | 466 | inflight@^1.0.4: 467 | version "1.0.6" 468 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 469 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 470 | dependencies: 471 | once "^1.3.0" 472 | wrappy "1" 473 | 474 | inherits@2: 475 | version "2.0.4" 476 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 477 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 478 | 479 | ini@^1.3.4, ini@~1.3.0: 480 | version "1.3.8" 481 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" 482 | integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== 483 | 484 | inquirer@^6.0.0: 485 | version "6.5.2" 486 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" 487 | integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== 488 | dependencies: 489 | ansi-escapes "^3.2.0" 490 | chalk "^2.4.2" 491 | cli-cursor "^2.1.0" 492 | cli-width "^2.0.0" 493 | external-editor "^3.0.3" 494 | figures "^2.0.0" 495 | lodash "^4.17.12" 496 | mute-stream "0.0.7" 497 | run-async "^2.2.0" 498 | rxjs "^6.4.0" 499 | string-width "^2.1.0" 500 | strip-ansi "^5.1.0" 501 | through "^2.3.6" 502 | 503 | is-arrayish@^0.2.1: 504 | version "0.2.1" 505 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" 506 | integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= 507 | 508 | is-ci@^1.0.10: 509 | version "1.2.1" 510 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" 511 | integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== 512 | dependencies: 513 | ci-info "^1.5.0" 514 | 515 | is-core-module@^2.1.0: 516 | version "2.2.0" 517 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" 518 | integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== 519 | dependencies: 520 | has "^1.0.3" 521 | 522 | is-fullwidth-code-point@^2.0.0: 523 | version "2.0.0" 524 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 525 | integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= 526 | 527 | is-installed-globally@^0.1.0: 528 | version "0.1.0" 529 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" 530 | integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= 531 | dependencies: 532 | global-dirs "^0.1.0" 533 | is-path-inside "^1.0.0" 534 | 535 | is-npm@^1.0.0: 536 | version "1.0.0" 537 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" 538 | integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= 539 | 540 | is-obj@^1.0.0: 541 | version "1.0.1" 542 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" 543 | integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= 544 | 545 | is-path-inside@^1.0.0: 546 | version "1.0.1" 547 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" 548 | integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= 549 | dependencies: 550 | path-is-inside "^1.0.1" 551 | 552 | is-plain-obj@^1.1.0: 553 | version "1.1.0" 554 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" 555 | integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= 556 | 557 | is-property@^1.0.2: 558 | version "1.0.2" 559 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" 560 | integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= 561 | 562 | is-redirect@^1.0.0: 563 | version "1.0.0" 564 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" 565 | integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= 566 | 567 | is-retry-allowed@^1.0.0: 568 | version "1.2.0" 569 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" 570 | integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== 571 | 572 | is-stream@^1.0.0, is-stream@^1.1.0: 573 | version "1.1.0" 574 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 575 | integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= 576 | 577 | isexe@^2.0.0: 578 | version "2.0.0" 579 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 580 | integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= 581 | 582 | js-tokens@^4.0.0: 583 | version "4.0.0" 584 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 585 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== 586 | 587 | js-yaml@^3.13.1: 588 | version "3.14.1" 589 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" 590 | integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== 591 | dependencies: 592 | argparse "^1.0.7" 593 | esprima "^4.0.0" 594 | 595 | json-parse-better-errors@^1.0.1: 596 | version "1.0.2" 597 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" 598 | integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== 599 | 600 | latest-version@^3.0.0: 601 | version "3.1.0" 602 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" 603 | integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= 604 | dependencies: 605 | package-json "^4.0.0" 606 | 607 | load-json-file@^4.0.0: 608 | version "4.0.0" 609 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" 610 | integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= 611 | dependencies: 612 | graceful-fs "^4.1.2" 613 | parse-json "^4.0.0" 614 | pify "^3.0.0" 615 | strip-bom "^3.0.0" 616 | 617 | locate-path@^2.0.0: 618 | version "2.0.0" 619 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 620 | integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= 621 | dependencies: 622 | p-locate "^2.0.0" 623 | path-exists "^3.0.0" 624 | 625 | lodash@^4.17.12: 626 | version "4.17.20" 627 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" 628 | integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== 629 | 630 | long@^4.0.0: 631 | version "4.0.0" 632 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" 633 | integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== 634 | 635 | loud-rejection@^1.0.0: 636 | version "1.6.0" 637 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" 638 | integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= 639 | dependencies: 640 | currently-unhandled "^0.4.1" 641 | signal-exit "^3.0.0" 642 | 643 | lowercase-keys@^1.0.0: 644 | version "1.0.1" 645 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" 646 | integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== 647 | 648 | lru-cache@^4.0.1, lru-cache@^4.1.3: 649 | version "4.1.5" 650 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" 651 | integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== 652 | dependencies: 653 | pseudomap "^1.0.2" 654 | yallist "^2.1.2" 655 | 656 | lru-cache@^6.0.0: 657 | version "6.0.0" 658 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" 659 | integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== 660 | dependencies: 661 | yallist "^4.0.0" 662 | 663 | make-dir@^1.0.0: 664 | version "1.3.0" 665 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" 666 | integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== 667 | dependencies: 668 | pify "^3.0.0" 669 | 670 | make-error@^1.1.1: 671 | version "1.3.6" 672 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" 673 | integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== 674 | 675 | map-obj@^1.0.0: 676 | version "1.0.1" 677 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" 678 | integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= 679 | 680 | map-obj@^2.0.0: 681 | version "2.0.0" 682 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" 683 | integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= 684 | 685 | meow@^5.0.0: 686 | version "5.0.0" 687 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" 688 | integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== 689 | dependencies: 690 | camelcase-keys "^4.0.0" 691 | decamelize-keys "^1.0.0" 692 | loud-rejection "^1.0.0" 693 | minimist-options "^3.0.1" 694 | normalize-package-data "^2.3.4" 695 | read-pkg-up "^3.0.0" 696 | redent "^2.0.0" 697 | trim-newlines "^2.0.0" 698 | yargs-parser "^10.0.0" 699 | 700 | mimic-fn@^1.0.0: 701 | version "1.2.0" 702 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" 703 | integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== 704 | 705 | minimatch@^3.0.4: 706 | version "3.0.4" 707 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 708 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 709 | dependencies: 710 | brace-expansion "^1.1.7" 711 | 712 | minimist-options@^3.0.1: 713 | version "3.0.2" 714 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" 715 | integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== 716 | dependencies: 717 | arrify "^1.0.1" 718 | is-plain-obj "^1.1.0" 719 | 720 | minimist@^1.2.0, minimist@^1.2.5: 721 | version "1.2.5" 722 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" 723 | integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== 724 | 725 | mkdirp@^0.5.1: 726 | version "0.5.5" 727 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" 728 | integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== 729 | dependencies: 730 | minimist "^1.2.5" 731 | 732 | mute-stream@0.0.7: 733 | version "0.0.7" 734 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" 735 | integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= 736 | 737 | mysql2@^2.2.5: 738 | version "2.2.5" 739 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/mysql2/-/mysql2-2.2.5.tgz#72624ffb4816f80f96b9c97fedd8c00935f9f340" 740 | integrity sha512-XRqPNxcZTpmFdXbJqb+/CtYVLCx14x1RTeNMD4954L331APu75IC74GDqnZMEt1kwaXy6TySo55rF2F3YJS78g== 741 | dependencies: 742 | denque "^1.4.1" 743 | generate-function "^2.3.1" 744 | iconv-lite "^0.6.2" 745 | long "^4.0.0" 746 | lru-cache "^6.0.0" 747 | named-placeholders "^1.1.2" 748 | seq-queue "^0.0.5" 749 | sqlstring "^2.3.2" 750 | 751 | named-placeholders@^1.1.2: 752 | version "1.1.2" 753 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/named-placeholders/-/named-placeholders-1.1.2.tgz#ceb1fbff50b6b33492b5cf214ccf5e39cef3d0e8" 754 | integrity sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA== 755 | dependencies: 756 | lru-cache "^4.1.3" 757 | 758 | normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: 759 | version "2.5.0" 760 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" 761 | integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== 762 | dependencies: 763 | hosted-git-info "^2.1.4" 764 | resolve "^1.10.0" 765 | semver "2 || 3 || 4 || 5" 766 | validate-npm-package-license "^3.0.1" 767 | 768 | npm-run-path@^2.0.0: 769 | version "2.0.2" 770 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" 771 | integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= 772 | dependencies: 773 | path-key "^2.0.0" 774 | 775 | once@^1.3.0: 776 | version "1.4.0" 777 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 778 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 779 | dependencies: 780 | wrappy "1" 781 | 782 | onetime@^2.0.0: 783 | version "2.0.1" 784 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" 785 | integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= 786 | dependencies: 787 | mimic-fn "^1.0.0" 788 | 789 | os-tmpdir@~1.0.2: 790 | version "1.0.2" 791 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 792 | integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= 793 | 794 | p-finally@^1.0.0: 795 | version "1.0.0" 796 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" 797 | integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= 798 | 799 | p-limit@^1.1.0: 800 | version "1.3.0" 801 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" 802 | integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== 803 | dependencies: 804 | p-try "^1.0.0" 805 | 806 | p-locate@^2.0.0: 807 | version "2.0.0" 808 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" 809 | integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= 810 | dependencies: 811 | p-limit "^1.1.0" 812 | 813 | p-try@^1.0.0: 814 | version "1.0.0" 815 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" 816 | integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= 817 | 818 | package-json@^4.0.0: 819 | version "4.0.1" 820 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" 821 | integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= 822 | dependencies: 823 | got "^6.7.1" 824 | registry-auth-token "^3.0.1" 825 | registry-url "^3.0.3" 826 | semver "^5.1.0" 827 | 828 | parse-json@^4.0.0: 829 | version "4.0.0" 830 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" 831 | integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= 832 | dependencies: 833 | error-ex "^1.3.1" 834 | json-parse-better-errors "^1.0.1" 835 | 836 | path-exists@^3.0.0: 837 | version "3.0.0" 838 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" 839 | integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= 840 | 841 | path-is-absolute@^1.0.0: 842 | version "1.0.1" 843 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 844 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 845 | 846 | path-is-inside@^1.0.1: 847 | version "1.0.2" 848 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" 849 | integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= 850 | 851 | path-key@^2.0.0: 852 | version "2.0.1" 853 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" 854 | integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= 855 | 856 | path-parse@^1.0.6: 857 | version "1.0.6" 858 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 859 | integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== 860 | 861 | path-type@^3.0.0: 862 | version "3.0.0" 863 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" 864 | integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== 865 | dependencies: 866 | pify "^3.0.0" 867 | 868 | pify@^3.0.0: 869 | version "3.0.0" 870 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" 871 | integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= 872 | 873 | prepend-http@^1.0.1: 874 | version "1.0.4" 875 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" 876 | integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= 877 | 878 | pseudomap@^1.0.2: 879 | version "1.0.2" 880 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" 881 | integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= 882 | 883 | quick-lru@^1.0.0: 884 | version "1.1.0" 885 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" 886 | integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= 887 | 888 | rc@^1.0.1, rc@^1.1.6: 889 | version "1.2.8" 890 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" 891 | integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== 892 | dependencies: 893 | deep-extend "^0.6.0" 894 | ini "~1.3.0" 895 | minimist "^1.2.0" 896 | strip-json-comments "~2.0.1" 897 | 898 | read-pkg-up@^3.0.0: 899 | version "3.0.0" 900 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" 901 | integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= 902 | dependencies: 903 | find-up "^2.0.0" 904 | read-pkg "^3.0.0" 905 | 906 | read-pkg@^3.0.0: 907 | version "3.0.0" 908 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" 909 | integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= 910 | dependencies: 911 | load-json-file "^4.0.0" 912 | normalize-package-data "^2.3.2" 913 | path-type "^3.0.0" 914 | 915 | redent@^2.0.0: 916 | version "2.0.0" 917 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" 918 | integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= 919 | dependencies: 920 | indent-string "^3.0.0" 921 | strip-indent "^2.0.0" 922 | 923 | registry-auth-token@^3.0.1: 924 | version "3.4.0" 925 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" 926 | integrity sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A== 927 | dependencies: 928 | rc "^1.1.6" 929 | safe-buffer "^5.0.1" 930 | 931 | registry-url@^3.0.3: 932 | version "3.1.0" 933 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" 934 | integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= 935 | dependencies: 936 | rc "^1.0.1" 937 | 938 | resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2: 939 | version "1.19.0" 940 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" 941 | integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== 942 | dependencies: 943 | is-core-module "^2.1.0" 944 | path-parse "^1.0.6" 945 | 946 | restore-cursor@^2.0.0: 947 | version "2.0.0" 948 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" 949 | integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= 950 | dependencies: 951 | onetime "^2.0.0" 952 | signal-exit "^3.0.2" 953 | 954 | rimraf@^2.6.2: 955 | version "2.7.1" 956 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" 957 | integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== 958 | dependencies: 959 | glob "^7.1.3" 960 | 961 | run-async@^2.2.0: 962 | version "2.4.1" 963 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" 964 | integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== 965 | 966 | rxjs@^6.4.0: 967 | version "6.6.3" 968 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" 969 | integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== 970 | dependencies: 971 | tslib "^1.9.0" 972 | 973 | safe-buffer@^5.0.1: 974 | version "5.2.1" 975 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" 976 | integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 977 | 978 | "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": 979 | version "2.1.2" 980 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 981 | integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== 982 | 983 | semver-diff@^2.0.0: 984 | version "2.1.0" 985 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" 986 | integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= 987 | dependencies: 988 | semver "^5.0.3" 989 | 990 | "semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0: 991 | version "5.7.1" 992 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" 993 | integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== 994 | 995 | seq-queue@^0.0.5: 996 | version "0.0.5" 997 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e" 998 | integrity sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4= 999 | 1000 | shebang-command@^1.2.0: 1001 | version "1.2.0" 1002 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" 1003 | integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= 1004 | dependencies: 1005 | shebang-regex "^1.0.0" 1006 | 1007 | shebang-regex@^1.0.0: 1008 | version "1.0.0" 1009 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" 1010 | integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= 1011 | 1012 | signal-exit@^3.0.0, signal-exit@^3.0.2: 1013 | version "3.0.3" 1014 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" 1015 | integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== 1016 | 1017 | source-map-support@^0.5.6: 1018 | version "0.5.19" 1019 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" 1020 | integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== 1021 | dependencies: 1022 | buffer-from "^1.0.0" 1023 | source-map "^0.6.0" 1024 | 1025 | source-map@^0.6.0: 1026 | version "0.6.1" 1027 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 1028 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 1029 | 1030 | spdx-correct@^3.0.0: 1031 | version "3.1.1" 1032 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" 1033 | integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== 1034 | dependencies: 1035 | spdx-expression-parse "^3.0.0" 1036 | spdx-license-ids "^3.0.0" 1037 | 1038 | spdx-exceptions@^2.1.0: 1039 | version "2.3.0" 1040 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" 1041 | integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== 1042 | 1043 | spdx-expression-parse@^3.0.0: 1044 | version "3.0.1" 1045 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" 1046 | integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== 1047 | dependencies: 1048 | spdx-exceptions "^2.1.0" 1049 | spdx-license-ids "^3.0.0" 1050 | 1051 | spdx-license-ids@^3.0.0: 1052 | version "3.0.7" 1053 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" 1054 | integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== 1055 | 1056 | sprintf-js@~1.0.2: 1057 | version "1.0.3" 1058 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" 1059 | integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= 1060 | 1061 | sqlstring@^2.3.2: 1062 | version "2.3.2" 1063 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/sqlstring/-/sqlstring-2.3.2.tgz#cdae7169389a1375b18e885f2e60b3e460809514" 1064 | integrity sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg== 1065 | 1066 | string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: 1067 | version "2.1.1" 1068 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 1069 | integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== 1070 | dependencies: 1071 | is-fullwidth-code-point "^2.0.0" 1072 | strip-ansi "^4.0.0" 1073 | 1074 | strip-ansi@^4.0.0: 1075 | version "4.0.0" 1076 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 1077 | integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= 1078 | dependencies: 1079 | ansi-regex "^3.0.0" 1080 | 1081 | strip-ansi@^5.1.0: 1082 | version "5.2.0" 1083 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" 1084 | integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== 1085 | dependencies: 1086 | ansi-regex "^4.1.0" 1087 | 1088 | strip-bom@^3.0.0: 1089 | version "3.0.0" 1090 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" 1091 | integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= 1092 | 1093 | strip-eof@^1.0.0: 1094 | version "1.0.0" 1095 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" 1096 | integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= 1097 | 1098 | strip-indent@^2.0.0: 1099 | version "2.0.0" 1100 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" 1101 | integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= 1102 | 1103 | strip-json-comments@~2.0.1: 1104 | version "2.0.1" 1105 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" 1106 | integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= 1107 | 1108 | supports-color@^5.3.0: 1109 | version "5.5.0" 1110 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 1111 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 1112 | dependencies: 1113 | has-flag "^3.0.0" 1114 | 1115 | term-size@^1.2.0: 1116 | version "1.2.0" 1117 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" 1118 | integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= 1119 | dependencies: 1120 | execa "^0.7.0" 1121 | 1122 | through@^2.3.6: 1123 | version "2.3.8" 1124 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" 1125 | integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= 1126 | 1127 | timed-out@^4.0.0: 1128 | version "4.0.1" 1129 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" 1130 | integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= 1131 | 1132 | tmp@^0.0.33: 1133 | version "0.0.33" 1134 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" 1135 | integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== 1136 | dependencies: 1137 | os-tmpdir "~1.0.2" 1138 | 1139 | trim-newlines@^2.0.0: 1140 | version "2.0.0" 1141 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" 1142 | integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= 1143 | 1144 | ts-node@^7.0.1: 1145 | version "7.0.1" 1146 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" 1147 | integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== 1148 | dependencies: 1149 | arrify "^1.0.0" 1150 | buffer-from "^1.1.0" 1151 | diff "^3.1.0" 1152 | make-error "^1.1.1" 1153 | minimist "^1.2.0" 1154 | mkdirp "^0.5.1" 1155 | source-map-support "^0.5.6" 1156 | yn "^2.0.0" 1157 | 1158 | tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: 1159 | version "1.14.1" 1160 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" 1161 | integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== 1162 | 1163 | tslint@^5.9.1: 1164 | version "5.20.1" 1165 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" 1166 | integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg== 1167 | dependencies: 1168 | "@babel/code-frame" "^7.0.0" 1169 | builtin-modules "^1.1.1" 1170 | chalk "^2.3.0" 1171 | commander "^2.12.1" 1172 | diff "^4.0.1" 1173 | glob "^7.1.1" 1174 | js-yaml "^3.13.1" 1175 | minimatch "^3.0.4" 1176 | mkdirp "^0.5.1" 1177 | resolve "^1.3.2" 1178 | semver "^5.3.0" 1179 | tslib "^1.8.0" 1180 | tsutils "^2.29.0" 1181 | 1182 | tsutils@^2.29.0: 1183 | version "2.29.0" 1184 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" 1185 | integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== 1186 | dependencies: 1187 | tslib "^1.8.1" 1188 | 1189 | typescript@~3.4.0: 1190 | version "3.4.5" 1191 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" 1192 | integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw== 1193 | 1194 | unique-string@^1.0.0: 1195 | version "1.0.0" 1196 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" 1197 | integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= 1198 | dependencies: 1199 | crypto-random-string "^1.0.0" 1200 | 1201 | unzip-response@^2.0.1: 1202 | version "2.0.1" 1203 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" 1204 | integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= 1205 | 1206 | update-notifier@^2.5.0: 1207 | version "2.5.0" 1208 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" 1209 | integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== 1210 | dependencies: 1211 | boxen "^1.2.1" 1212 | chalk "^2.0.1" 1213 | configstore "^3.0.0" 1214 | import-lazy "^2.1.0" 1215 | is-ci "^1.0.10" 1216 | is-installed-globally "^0.1.0" 1217 | is-npm "^1.0.0" 1218 | latest-version "^3.0.0" 1219 | semver-diff "^2.0.0" 1220 | xdg-basedir "^3.0.0" 1221 | 1222 | url-parse-lax@^1.0.0: 1223 | version "1.0.0" 1224 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" 1225 | integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= 1226 | dependencies: 1227 | prepend-http "^1.0.1" 1228 | 1229 | validate-npm-package-license@^3.0.1: 1230 | version "3.0.4" 1231 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" 1232 | integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== 1233 | dependencies: 1234 | spdx-correct "^3.0.0" 1235 | spdx-expression-parse "^3.0.0" 1236 | 1237 | which@^1.2.9: 1238 | version "1.3.1" 1239 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" 1240 | integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== 1241 | dependencies: 1242 | isexe "^2.0.0" 1243 | 1244 | widest-line@^2.0.0: 1245 | version "2.0.1" 1246 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" 1247 | integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== 1248 | dependencies: 1249 | string-width "^2.1.1" 1250 | 1251 | wrappy@1: 1252 | version "1.0.2" 1253 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 1254 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 1255 | 1256 | write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: 1257 | version "2.4.3" 1258 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" 1259 | integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== 1260 | dependencies: 1261 | graceful-fs "^4.1.11" 1262 | imurmurhash "^0.1.4" 1263 | signal-exit "^3.0.2" 1264 | 1265 | xdg-basedir@^3.0.0: 1266 | version "3.0.0" 1267 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" 1268 | integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= 1269 | 1270 | yallist@^2.1.2: 1271 | version "2.1.2" 1272 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" 1273 | integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= 1274 | 1275 | yallist@^4.0.0: 1276 | version "4.0.0" 1277 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" 1278 | integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== 1279 | 1280 | yargs-parser@^10.0.0: 1281 | version "10.1.0" 1282 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" 1283 | integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== 1284 | dependencies: 1285 | camelcase "^4.1.0" 1286 | 1287 | yn@^2.0.0: 1288 | version "2.0.0" 1289 | resolved "https://nexus.mypaas.com.cn/repository/app-npm/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" 1290 | integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= 1291 | --------------------------------------------------------------------------------