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.
Files changed (58) hide show
  1. package/.temp/getRouteByApiSrc.ts +2 -2
  2. package/.temp/updateRouter.ts +3 -3
  3. package/README.md +7 -1
  4. package/beforebuild.js +1 -2
  5. package/dist/index.js +12 -39
  6. package/dist/utils/createRouter.js +6 -5
  7. package/dist/utils/getRouterInfo.js +5 -10
  8. package/dist/utils/masUtils.js +1 -3
  9. package/dist/utils/meaToken.js +2 -2
  10. package/dist/utils/readApi.js +1 -1
  11. package/dist/utils/validType.js +1 -1
  12. package/package.json +53 -53
  13. package/src/index.ts +25 -72
  14. package/src/typings/index.ts +106 -124
  15. package/src/utils/apiLimit.ts +1 -1
  16. package/src/utils/createRouter.ts +5 -5
  17. package/src/utils/getRouterInfo.ts +5 -9
  18. package/src/utils/masUtils.ts +0 -1
  19. package/src/utils/meaToken.ts +56 -56
  20. package/src/utils/validRouteData.ts +3 -3
  21. package/src/utils/validToken.ts +2 -2
  22. package/test/apiTemplate/curd/del.ts +2 -2
  23. package/test/apiTemplate/curd/get.ts +2 -2
  24. package/test/apiTemplate/curd/set.ts +2 -2
  25. package/test/apiTemplate/defaultApi.ts +8 -0
  26. package/test/config/serverConfig/config.ts +29 -0
  27. package/test/config/{createSqlFormData.ts → sqlConfig/createSqlFormData.ts} +1 -2
  28. package/test/main.ts +20 -17
  29. package/test/scripts/beforeCreated.ts +27 -27
  30. package/test/scripts/createApis.ts +1 -1
  31. package/test/scripts/createSqlForm.ts +4 -4
  32. package/test/scripts/getSqlFormType.ts +1 -1
  33. package/test/src/api/example/ArrValid.ts +3 -4
  34. package/test/src/api/example/per.ts +5 -5
  35. package/test/src/api/example/tip.ts +3 -5
  36. package/test/src/api/example/validReqData.ts +3 -6
  37. package/test/src/api/index.ts +3 -6
  38. package/test/src/debug.ts +0 -5
  39. package/test/src/masState.ts +3 -3
  40. package/dist/apiDoc/assets/empty-3b5fe714.js +0 -1
  41. package/dist/apiDoc/assets/index-2d9f5a8a.js +0 -1427
  42. package/dist/apiDoc/assets/index-b04b459f.css +0 -6
  43. package/dist/apiDoc/assets/jsoneditor-icons-45c98bf0.svg +0 -749
  44. package/dist/apiDoc/favicon.ico +0 -0
  45. package/dist/apiDoc/index.html +0 -15
  46. package/dist/utils/apiDoc.js +0 -33
  47. package/src/apiDoc/assets/empty-3b5fe714.js +0 -1
  48. package/src/apiDoc/assets/index-2d9f5a8a.js +0 -1427
  49. package/src/apiDoc/assets/index-b04b459f.css +0 -6
  50. package/src/apiDoc/assets/jsoneditor-icons-45c98bf0.svg +0 -749
  51. package/src/apiDoc/favicon.ico +0 -0
  52. package/src/apiDoc/index.html +0 -15
  53. package/src/utils/apiDoc.ts +0 -34
  54. package/test/apiTemplate/api.temp.ts +0 -11
  55. package/test/config/config.ts +0 -36
  56. package/test/config/defaultApiConfig.ts +0 -7
  57. package/test/config/docNav.ts +0 -4
  58. package/test/src/sql/selectStudent.ts +0 -7
Binary file
@@ -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>
@@ -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};