data-primals-engine 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-primals-engine",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "data-primals-engine is the package responsible from handling large amount of data in a practical and performant way. It can handle large amount of data in a practical and performant way. It can also get workflow models working (for automation), and fully supports internationalisation.",
5
5
  "main": "src/engine.js",
6
6
  "type": "module",
@@ -34,27 +34,37 @@
34
34
  "@langchain/openai": "^0.5.18",
35
35
  "archiver": "^7.0.1",
36
36
  "aws-sdk": "^2.1692.0",
37
+ "bcrypt": "^5.1.1",
37
38
  "body-parser": "^1.20.3",
38
39
  "chalk": "^5.4.1",
39
40
  "check-disk-space": "^3.4.0",
40
41
  "compression": "^1.8.0",
41
42
  "connect-mongo": "^5.1.0",
42
- "connect-multiparty": "^2.2.0",
43
43
  "cookie-parser": "^1.4.7",
44
44
  "cronstrue": "^3.1.0",
45
45
  "csv-parse": "^5.6.0",
46
46
  "csv-parser": "^3.2.0",
47
+ "date-fns": "^4.1.0",
47
48
  "express": "^4.21.2",
48
49
  "express-csrf-double-submit-cookie": "^1.2.1",
50
+ "express-formidable": "^1.2.0",
51
+ "express-mongo-sanitize": "^2.2.0",
49
52
  "express-rate-limit": "^8.0.1",
50
53
  "express-session": "^1.18.1",
54
+ "i18next": "^24.2.2",
55
+ "i18next-browser-languagedetector": "^8.0.4",
51
56
  "juice": "^11.0.1",
52
57
  "mathjs": "^14.4.0",
53
58
  "mongodb": "^6.12.0",
59
+ "node-cache": "^5.1.2",
54
60
  "node-schedule": "^2.1.1",
55
61
  "nodemailer": "^6.10.0",
62
+ "openai": "^5.8.2",
56
63
  "randomcolor": "^0.6.2",
57
64
  "rate-limiter-flexible": "^5.0.5",
65
+ "react-helmet": "^6.1.0",
66
+ "react-i18next": "^15.4.1",
67
+ "react-markdown": "^10.1.0",
58
68
  "request-ip": "^3.3.0",
59
69
  "sanitize-html": "^2.17.0",
60
70
  "sirv": "^3.0.1",
@@ -63,16 +73,6 @@
63
73
  "tar-fs": "^3.0.8",
64
74
  "uniqid": "^5.4.0",
65
75
  "yaml": "^2.8.0",
66
- "bcrypt": "^5.1.1",
67
- "date-fns": "^4.1.0",
68
- "express-mongo-sanitize": "^2.2.0",
69
- "i18next": "^24.2.2",
70
- "i18next-browser-languagedetector": "^8.0.4",
71
- "node-cache": "^5.1.2",
72
- "openai": "^5.8.2",
73
- "react-helmet": "^6.1.0",
74
- "react-i18next": "^15.4.1",
75
- "react-markdown": "^10.1.0",
76
76
  "zlib": "^1.0.5"
77
77
  },
78
78
  "devDependencies": {
package/src/engine.js CHANGED
@@ -14,6 +14,7 @@ import requestIp from 'request-ip';
14
14
  import {createModel, getModels, installAllPacks, validateModelStructure} from "./modules/data.js";
15
15
  import {defaultModels} from "./defaultModels.js";
16
16
  import {DefaultUserProvider} from "./providers.js";
17
+ import formidableMiddleware from 'express-formidable';
17
18
 
18
19
  // Constants
19
20
  const isProduction = process.env.NODE_ENV === 'production'
@@ -44,13 +45,12 @@ export const Engine = {
44
45
  app.set('port', process.env.PORT || 3000);
45
46
  app.set('engine', engine);
46
47
 
47
- app.use(bodyParser.urlencoded({extended: true, limit: 4096 }))
48
- app.use(bodyParser.json({ limit: maxDataSize }))
48
+ app.use(formidableMiddleware({
49
+ encoding: 'utf-8',
50
+ uploadDir: process.cwd()+'/uploads/tmp',
51
+ multiples: true, // req.files to be arrays of files
52
+ }));
49
53
  app.use(cookieParser(isProduction ? cookiesSecret : 'secret'));
50
-
51
- var multipartMiddleware = multipart();
52
- app.use(multipartMiddleware);
53
-
54
54
  app.use(requestIp.mw())
55
55
 
56
56
  engine.use = (...args) => {
@@ -124,7 +124,7 @@ export const Engine = {
124
124
 
125
125
  process.on('uncaughtException', function (exception) {
126
126
  console.error(exception);
127
- fs.appendFile('bugs.txt', JSON.stringify({ code: exception.code, message: exception.message, stack: exception.stack }), function (err) {
127
+ fs.appendFile('issues.txt', JSON.stringify({ code: exception.code, message: exception.message, stack: exception.stack }), function (err) {
128
128
  if (err){
129
129
  throw err;
130
130
  }