backend-core-bm 1.0.2 → 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.
@@ -1,3 +1,5 @@
1
+ const u = require("awadau");
2
+
1
3
  module.exports = (logger, callback) => {
2
4
  let throwError = (e, req) =>
3
5
  logger.error({
package/core.js CHANGED
@@ -120,10 +120,11 @@ un.fileMkdirTouch = (path, recursive = true) => {
120
120
  });
121
121
  };
122
122
 
123
- un.fileMove = async (source, target, mkdir = true, overwrite = true) => {
123
+ un.fileMove = async (source, target, mkdir = true, overwrite = true, onlyCopy = false) => {
124
124
  source = un.filePathNormalize(source);
125
125
  target = un.filePathNormalize(target);
126
126
  if (mkdir) fse.mkdirpSync(paths.dirname(target));
127
+ if (onlyCopy) return fse.copySync(source, target, { overwrite });
127
128
  return fse.moveSync(source, target, { overwrite });
128
129
  };
129
130
 
package/framework.js CHANGED
@@ -21,6 +21,7 @@ module.exports = class Framework {
21
21
  this.express = express;
22
22
  this.app = express();
23
23
  this.app.use(bodyParser.json({ type: "application/json" }));
24
+ this.app.use(bodyParser.text({ type: "text/*" }));
24
25
  this.app.use(bodyParser.urlencoded({ extended: true }));
25
26
 
26
27
  config = u.mapMergeDeep(
@@ -67,9 +68,6 @@ module.exports = class Framework {
67
68
  * @type {{trace: (msg: any) => any, debug: (msg: any) => any, info: (msg: any) => any, warn: (msg: any) => any, error: (msg: any) => any, fatal: (msg: any) => any}}
68
69
  */
69
70
  this.logger = loggerHandle(this.config);
70
- this.runtime = {
71
- scheduler: {},
72
- };
73
71
  }
74
72
 
75
73
  addSecretKey(map) {
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const un = require("./core.js");
2
2
  const Framework = require("./framework");
3
+ const typedef = () => require("./typedef");
3
4
 
4
- module.exports = { un, Framework };
5
+ module.exports = { un, Framework, typedef };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-core-bm",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "main": "index.js",
5
5
  "description": "utils",
6
6
  "scripts": {
@@ -18,14 +18,14 @@
18
18
  "homepage": "https://github.com/Truth1984/backend-core#readme",
19
19
  "dependencies": {
20
20
  "archiver": "^5.0.2",
21
- "awadau": "^1.1.9",
21
+ "awadau": "^1.1.15",
22
22
  "bcryptjs": "^2.4.3",
23
23
  "body-parser": "^1.19.0",
24
24
  "bunyan": "^1.8.14",
25
25
  "colors": "^1.4.0",
26
26
  "download": "^6.2.5",
27
27
  "express": "^4.17.1",
28
- "fs-extra": "^9.0.1",
28
+ "fs-extra": "^10.0.0",
29
29
  "html-entities": "^1.3.1",
30
30
  "iconv-lite": "^0.6.2",
31
31
  "readdirp": "^3.4.0",