@bee.js/node 0.0.92 → 0.0.93

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/lib/DBA/beeDBA.js CHANGED
@@ -54,14 +54,13 @@ module.exports.actions = {
54
54
  },
55
55
 
56
56
  MODEL_CREATE_DB: function (req, res) {
57
- let configsDB = global.configs.databases.default;
58
- let models = global.models;
59
- let SQL = ["", ""];
57
+ const configsDB = global.configs.databases.default;
58
+ const models = global.models;
59
+ const SQL = ["", ""];
60
60
 
61
61
  //TODO create db with user permissions
62
-
63
62
  Object.keys(models).map((model) => {
64
- if (!req.body.models[model]._checked) return;
63
+ if (!req.body?.models?.[model]?._checked) return;
65
64
 
66
65
  SQL[0] += this.MODEL_CREATE_TABLE(models[model], configsDB);
67
66
  SQL[1] += models[model].relations
@@ -1,9 +1,9 @@
1
1
  const express = require("express");
2
- const log = require("./log");
3
2
  const route = require("../WEB/route");
4
- const bodyParser = require("body-parser");
5
- const headers = require("./headers");
6
3
  const freeRoute = require("../WEB/freeRoute");
4
+ const log = require("./log");
5
+ const headers = require("./headers");
6
+ const bodyParser = require("body-parser");
7
7
 
8
8
  module.exports = function () {
9
9
  if (!global.routes) return;
@@ -35,17 +35,19 @@ module.exports = function () {
35
35
 
36
36
  router.use(
37
37
  bodyParser.urlencoded({
38
- limit: "10mb",
38
+ limit: "20mb",
39
39
  extended: true,
40
40
  parameterLimit: 50000,
41
41
  })
42
42
  );
43
- router.use(bodyParser.json({ extended: true, limit: "10mb" }));
43
+
44
+ router.use(bodyParser.json({ extended: true, limit: "20mb" }));
44
45
  router.use(bodyParser.raw());
45
46
  router.use((req, res, next) => headers({ req, res, next, router, configs }));
46
47
  });
47
48
 
48
- log(`${Object.keys(global.routes).length} route(s)`);
49
+ log(`${Object.keys(global.routes).length} route(s) 222222
50
+ `);
49
51
 
50
52
  return router;
51
53
  };
@@ -1,5 +1,6 @@
1
1
  const log = require("./log");
2
2
  const beeDEV = require("../DEV/beeDEV");
3
+ const bodyParser = require('body-parser');
3
4
  const http = require("http");
4
5
  const https = require("https");
5
6
  const fs = require("fs");
@@ -8,12 +9,13 @@ const WebSocket = require("ws");
8
9
  const servers = { http: null, https: null };
9
10
 
10
11
  module.exports = function (app, options = {}) {
12
+ if (process.argv.includes("--dev"))
13
+ app.post("/beedev/:action", bodyParser.json(), beeDEV);
14
+
11
15
  const ports = (global.configs.port || global.configs.ports || 1987.443)
12
16
  .toString()
13
17
  .split(".");
14
18
 
15
- app.post("/beedev/:action", beeDEV); //TODO check security and create a method for define enable/disable
16
-
17
19
  servers.http = http.createServer(app);
18
20
 
19
21
  if (options.ws) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bee.js/node",
3
- "version": "0.0.92",
3
+ "version": "0.0.93",
4
4
  "description": "A JavaScript framework for making Node.js API´s",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,7 +19,9 @@
19
19
  "MySQL GUID",
20
20
  "JWT",
21
21
  "Scheduler",
22
- "Deploy"
22
+ "Deploy",
23
+ "AI",
24
+ "MCP"
23
25
  ],
24
26
  "author": "Arnaldo Liberal dos Santos - arnaldo.liberal@outlook.com",
25
27
  "homepage": "https://beejs.org",