mas-server 2.0.64 → 3.0.0
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/getRouteByApiSrc.ts +2 -2
- package/.temp/updateRouter.ts +3 -3
- package/README.md +7 -1
- package/beforebuild.js +1 -2
- package/dist/index.js +12 -39
- package/dist/utils/createRouter.js +6 -5
- package/dist/utils/getRouterInfo.js +5 -10
- package/dist/utils/masUtils.js +1 -3
- package/dist/utils/meaToken.js +2 -2
- package/dist/utils/readApi.js +1 -1
- package/dist/utils/validType.js +1 -1
- package/package.json +53 -53
- package/src/index.ts +25 -72
- package/src/typings/index.ts +106 -124
- package/src/utils/apiLimit.ts +1 -1
- package/src/utils/createRouter.ts +5 -5
- package/src/utils/getRouterInfo.ts +5 -9
- package/src/utils/masUtils.ts +0 -1
- package/src/utils/meaToken.ts +56 -56
- package/src/utils/validRouteData.ts +3 -3
- package/src/utils/validToken.ts +2 -2
- package/test/apiTemplate/curd/del.ts +2 -2
- package/test/apiTemplate/curd/get.ts +2 -2
- package/test/apiTemplate/curd/set.ts +2 -2
- package/test/apiTemplate/defaultApi.ts +8 -0
- package/test/config/serverConfig/config.ts +29 -0
- package/test/config/{createSqlFormData.ts → sqlConfig/createSqlFormData.ts} +1 -2
- package/test/main.ts +20 -17
- package/test/scripts/beforeCreated.ts +27 -27
- package/test/scripts/createApis.ts +1 -1
- package/test/scripts/createSqlForm.ts +4 -4
- package/test/scripts/getSqlFormType.ts +1 -1
- package/test/src/api/example/ArrValid.ts +3 -4
- package/test/src/api/example/per.ts +5 -5
- package/test/src/api/example/tip.ts +3 -5
- package/test/src/api/example/validReqData.ts +3 -6
- package/test/src/api/index.ts +3 -6
- package/test/src/debug.ts +0 -5
- package/test/src/masState.ts +3 -3
- package/dist/apiDoc/assets/empty-3b5fe714.js +0 -1
- package/dist/apiDoc/assets/index-2d9f5a8a.js +0 -1427
- package/dist/apiDoc/assets/index-b04b459f.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/apiDoc.js +0 -33
- package/src/apiDoc/assets/empty-3b5fe714.js +0 -1
- package/src/apiDoc/assets/index-2d9f5a8a.js +0 -1427
- package/src/apiDoc/assets/index-b04b459f.css +0 -6
- package/src/apiDoc/assets/jsoneditor-icons-45c98bf0.svg +0 -749
- package/src/apiDoc/favicon.ico +0 -0
- package/src/apiDoc/index.html +0 -15
- package/src/utils/apiDoc.ts +0 -34
- package/test/apiTemplate/api.temp.ts +0 -11
- package/test/config/config.ts +0 -36
- package/test/config/defaultApiConfig.ts +0 -7
- package/test/config/docNav.ts +0 -4
- package/test/src/sql/selectStudent.ts +0 -7
package/dist/apiDoc/favicon.ico
DELETED
|
Binary file
|
package/dist/apiDoc/index.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<link rel="icon" href="./favicon.ico">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Vite App</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-2d9f5a8a.js"></script>
|
|
9
|
-
<link rel="stylesheet" href="./assets/index-b04b459f.css">
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"></div>
|
|
13
|
-
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|
package/dist/utils/apiDoc.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const state_1 = require("../state");
|
|
4
|
-
exports.default = (app) => {
|
|
5
|
-
const router = JSON.stringify(state_1.state.Router, (key, value) => {
|
|
6
|
-
if (typeof value === "function") {
|
|
7
|
-
return value.toString().replace(/function\s+(\w+)\(\)\s+\{.*\}/, "$1");
|
|
8
|
-
}
|
|
9
|
-
return value;
|
|
10
|
-
});
|
|
11
|
-
const newRouter = JSON.parse(router);
|
|
12
|
-
// 有的描述没有类型,尝试从validFormat里取
|
|
13
|
-
for (const key in newRouter) {
|
|
14
|
-
const item = newRouter[key];
|
|
15
|
-
if (item.validFormat && item.validFormatDes) {
|
|
16
|
-
for (const validFormatDesItem of item.validFormatDes) {
|
|
17
|
-
if (!validFormatDesItem.type &&
|
|
18
|
-
item.validFormat[validFormatDesItem.name]) {
|
|
19
|
-
validFormatDesItem.type = item.validFormat[validFormatDesItem.name];
|
|
20
|
-
}
|
|
21
|
-
else if (!validFormatDesItem.type) {
|
|
22
|
-
validFormatDesItem.type = "String";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
app.post("/apidoc/router", (req, res) => {
|
|
28
|
-
res.return(newRouter);
|
|
29
|
-
});
|
|
30
|
-
app.post("/apidoc/cn", (req, res) => {
|
|
31
|
-
res.return(state_1.state.apiCN);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./index-2d9f5a8a.js";const r={};function t(c,n){return null}const o=e(r,[["render",t]]);export{o as default};
|