mas-server 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.temp/merge/validType.ts +98 -0
- package/dist/index.js +8 -47
- package/dist/src/index.js +100 -0
- package/dist/src/state.js +4 -0
- package/dist/src/typings/index.js +2 -0
- package/dist/src/utils/apiDoc.js +33 -0
- package/dist/src/utils/createRouter.js +51 -0
- package/dist/src/utils/getLog.js +18 -0
- package/dist/src/utils/getRouterInfo.js +34 -0
- package/dist/src/utils/masUtils.js +12 -0
- package/dist/src/utils/meaToken.js +57 -0
- package/dist/src/utils/quickSend.js +32 -0
- package/dist/src/utils/readApi.js +50 -0
- package/dist/src/utils/validRouteData.js +37 -0
- package/dist/src/utils/validToken.js +24 -0
- package/dist/src/utils/validType.js +84 -0
- package/dist/test/apiTemplate/api.temp.js +24 -0
- package/dist/test/apiTemplate/curd/del.js +21 -0
- package/dist/test/apiTemplate/curd/get.js +21 -0
- package/dist/test/apiTemplate/curd/set.js +21 -0
- package/dist/test/config/config.js +31 -0
- package/dist/test/config/createSqlFormData.js +15 -0
- package/dist/test/config/defaultApiConfig.js +7 -0
- package/dist/test/config/docNav.js +0 -0
- package/dist/test/main.js +31 -0
- package/dist/test/scripts/beforeCreated.js +62 -0
- package/dist/test/scripts/createApiFile.js +52 -0
- package/dist/test/scripts/createApis.js +81 -0
- package/dist/test/scripts/createSqlForm.js +10 -0
- package/dist/test/scripts/getSqlFormType.js +56 -0
- package/dist/test/scripts/run.js +6 -0
- package/dist/test/src/api/example/ArrValid.js +21 -0
- package/dist/test/src/api/example/per.js +37 -0
- package/dist/test/src/api/example/tip.js +22 -0
- package/dist/test/src/api/example/validReqData.js +98 -0
- package/dist/test/src/api/index.js +24 -0
- package/dist/test/src/debug.js +10 -0
- package/dist/test/src/masState.js +4 -0
- package/dist/test/src/sql/selectStudent.js +10 -0
- package/dist/test/src/sqlform.json +1 -0
- package/dist/test/test.js +3 -0
- package/dist/utils/apiDoc.js +17 -2
- package/dist/utils/createRouter.js +51 -0
- package/dist/utils/getRouterInfo.js +34 -0
- package/dist/utils/validRouteData.js +1 -1
- package/dist/utils/validToken.js +1 -1
- package/dist/utils/validType.js +0 -17
- package/package.json +5 -5
- package/{dist/apiDoc/assets/empty-907982e4.js → src/apiDoc/assets/empty-a6de4920.js} +1 -1
- package/src/apiDoc/assets/index-be53fe8f.css +6 -0
- package/src/apiDoc/assets/index-f9ab4187.js +1427 -0
- package/src/apiDoc/assets/jsoneditor-icons-45c98bf0.svg +749 -749
- package/src/apiDoc/index.html +2 -2
- package/src/index.ts +20 -24
- package/src/typings/index.ts +5 -5
- package/src/utils/apiDoc.ts +18 -2
- package/src/utils/createRouter.ts +22 -0
- package/src/utils/getRouterInfo.ts +28 -0
- package/src/utils/readApi.ts +0 -2
- package/src/utils/validRouteData.ts +1 -2
- package/src/utils/validToken.ts +1 -1
- package/src/utils/validType.ts +0 -17
- package/test/apiTemplate/api.temp.ts +8 -3
- package/test/config/config.ts +1 -1
- package/test/config/defaultApiConfig.ts +7 -0
- package/test/config/docNav.ts +0 -0
- package/test/main.ts +1 -0
- package/test/scripts/beforeCreated.ts +2 -41
- package/test/scripts/createApiFile.ts +0 -1
- package/test/scripts/createApis.ts +0 -48
- package/test/scripts/getSqlFormType.ts +2 -13
- package/test/src/api/example/ArrValid.ts +11 -0
- package/test/src/api/example/per.ts +34 -0
- package/test/src/api/example/tip.ts +9 -0
- package/test/src/api/example/validReqData.ts +85 -0
- package/test/src/api/index.ts +8 -1
- package/test/src/debug.ts +3 -50
- package/test/src/sqlform.json +1 -12
- package/test/test.ts +0 -12
- package/test//345/276/205/345/274/200/345/217/221.md +12 -6
- package/tsconfig-build.json +20 -0
- package/tsconfig.json +1 -3
- package/.temp/validType.ts +0 -96
- package/dist/apiDoc/assets/index-b56e6bc6.js +0 -1414
- package/dist/apiDoc/assets/index-bb16d834.css +0 -6
- package/dist/apiDoc/assets/jsoneditor-icons-45c98bf0.svg +0 -749
- package/dist/apiDoc/favicon.ico +0 -0
- package/dist/apiDoc/index.html +0 -15
- package/dist/utils/getRouteByApiSrc.js +0 -54
- package/dist/utils/mas-encrypt.min.js +0 -3072
- package/src/apiDoc/assets/empty-907982e4.js +0 -1
- package/src/apiDoc/assets/index-b56e6bc6.js +0 -1414
- package/src/apiDoc/assets/index-bb16d834.css +0 -6
- package/test/config/api.config.ts +0 -3
- package/test/config/api.key.ts +0 -14
- package/test/src/api/curd/student/del.ts +0 -9
- package/test/src/api/curd/student/get.ts +0 -9
- package/test/src/api/curd/student/set.ts +0 -9
- package/test/src/api/per.ts +0 -6
- package/test/src/api/person/del.ts +0 -4
- package/test/src/api/person/get.ts +0 -4
- package/test/src/api/person/set.ts +0 -4
- package/test/src/api/test.ts +0 -7
- package/test/src/api/validtest/boolArr.ts +0 -4
- package/test/typings/studentSF.ts +0 -6
- package/test/typings/test11SF.ts +0 -1
- package/test/typings/test22SF.ts +0 -1
- package/test/typings/testformSF.ts +0 -1
- /package/.temp/{logs/.keep → .keep} +0 -0
- /package/{src/utils → .temp}/getRouteByApiSrc.ts +0 -0
- /package/.temp/{a.ts → merge/a.ts} +0 -0
- /package/.temp/{as.ts → merge/as.ts} +0 -0
- /package/.temp/{b.ts → merge/b.ts} +0 -0
- /package/.temp/{i.js → merge/i.js} +0 -0
- /package/{test/typings → .temp/merge/logs}/.keep +0 -0
- /package/.temp/{test.ts → merge/test.ts} +0 -0
- /package/.temp/{validType copy.ts → merge/validType copy.ts} +0 -0
- /package/.temp/{validTypeOptimize.ts → merge/validTypeOptimize.ts} +0 -0
- /package/{test/scripts → .temp}/updateRouter.ts +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { apiConfigType } from "@/index";
|
|
2
|
-
const apiConfig: apiConfigType = {"/api/curd/student/del":{"name":"删除数据","methods":"all","des":"","validFormat":{"id":Number}},"/api/curd/student/get":{"name":"得到数据","methods":"all","des":"","validFormat":null},"/api/curd/student/set":{"name":"修改或添加数据","methods":"all","des":"","validFormat":null},"/api/index":{"name":"默认接口","methods":"post","des":"一个默认接口","validFormat":{"arr":[{"name":String,"age":Number}]},"header":[{"name":"token","type":String,"des":"token密钥"}],"validFormatDes":[{"name":"arr","type":{"arr":[{"name":String,"age":Number}]},"des":"学生数组"},{"name":"arg1","type":Number,"des":"可选参数","optional":true}],"example":{"arr":[{"name":"小明","age":18}]},"resExample":{"status":1,"data":"hello mas!","msg":""}},"/api/per":{"name":"新建接口","methods":"all","des":"","validFormat":null},"/api/person/del":{"name":"新建接口","methods":"all","des":"","validFormat":{"arr":[String]}},"/api/person/get":{"name":"新建接口","methods":"all","des":""},"/api/person/set":{"name":"新建接口","methods":"all","des":""},"/api/test":{"name":"新建接口","methods":"all","des":"","validFormat":null},"/api/validtest/boolArr":{"name":"新建接口","methods":"all","des":"","validFormat":[{"name":String}]}};
|
|
3
|
-
export default apiConfig;
|
package/test/config/api.key.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { masReq, masRes } from "@/index";
|
|
2
|
-
import masState from "@@/test/src/masState";
|
|
3
|
-
import sqlform from "@@/test/src/sqlform.json";
|
|
4
|
-
|
|
5
|
-
export default async (req: masReq, res: masRes) => {
|
|
6
|
-
const { sql } = masState;
|
|
7
|
-
const sqlRes = await sql.use(sqlform.student).delete(req.body).go();
|
|
8
|
-
res.return(sqlRes);
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { masReq, masRes } from "@/index";
|
|
2
|
-
import masState from "@@/test/src/masState";
|
|
3
|
-
import sqlform from "@@/test/src/sqlform.json";
|
|
4
|
-
|
|
5
|
-
export default async (req: masReq, res: masRes) => {
|
|
6
|
-
const { sql } = masState;
|
|
7
|
-
const sqlRes = await sql.use(sqlform.student).select(req.body).paging().go();
|
|
8
|
-
res.return(sqlRes);
|
|
9
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { masReq, masRes } from "@/index";
|
|
2
|
-
import masState from "@@/test/src/masState";
|
|
3
|
-
import sqlform from "@@/test/src/sqlform.json";
|
|
4
|
-
|
|
5
|
-
export default async (req: masReq, res: masRes) => {
|
|
6
|
-
const { sql } = masState;
|
|
7
|
-
const sqlRes = await sql.use(sqlform.student).set(req.body).go();
|
|
8
|
-
res.return(sqlRes, sqlRes);
|
|
9
|
-
};
|
package/test/src/api/per.ts
DELETED
package/test/src/api/test.ts
DELETED
package/test/typings/test11SF.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type test11SF = { id?: number; name?: string; age?: number };
|
package/test/typings/test22SF.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type test22SF = {id?:number;name?:string;age?:number;}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type testformSF = { id?: number; testA?: string; numB?: number };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|