backend-core-bm 1.0.8 → 1.0.9

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/framework.js CHANGED
@@ -2,6 +2,7 @@ const u = require("awadau");
2
2
  const un = require("./core");
3
3
  const express = require("express");
4
4
  const bodyParser = require("body-parser");
5
+ const cors = require("cors");
5
6
  const tl2 = require("tl2");
6
7
  const loggerHandle = require("./Addon/loggerHandle");
7
8
  const secretHandle = require("./Addon/secretHandle");
@@ -36,6 +37,7 @@ module.exports = class Framework {
36
37
  "post-process": [],
37
38
  "pre-terminate": [],
38
39
  },
40
+ cors: false,
39
41
  logger: {
40
42
  devOverride: true,
41
43
  type: "on",
@@ -64,6 +66,8 @@ module.exports = class Framework {
64
66
  );
65
67
  this.config = config;
66
68
 
69
+ if (this.config.cors) this.app.use(cors());
70
+
67
71
  /**
68
72
  * @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}}
69
73
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-core-bm",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "main": "index.js",
5
5
  "description": "utils",
6
6
  "scripts": {
@@ -20,11 +20,12 @@
20
20
  "archiver": "^5.0.2",
21
21
  "awadau": "^1.1.17",
22
22
  "bcryptjs": "^2.4.3",
23
- "body-parser": "^1.19.0",
23
+ "body-parser": "^1.20.2",
24
24
  "bunyan": "^1.8.15",
25
25
  "colors": "^1.4.0",
26
+ "cors": "^2.8.5",
26
27
  "download": "^8.0.0",
27
- "express": "^4.17.1",
28
+ "express": "^4.18.2",
28
29
  "fs-extra": "^10.0.0",
29
30
  "html-entities": "^1.3.1",
30
31
  "iconv-lite": "^0.6.2",
package/typedef.js CHANGED
@@ -6,6 +6,7 @@
6
6
  * @property {string[]} envAddition
7
7
  * @property {{name:string,pattern:string,operation: () => {}}[]} schedule
8
8
  * @property {{"process" : [],"post-process" : [],"pre-terminate" : []}} perform
9
+ * @property {false} cors
9
10
  * @property {{devOverride:true, type : "on" | "off" | "bunyan-dev" | "bunyan", bunyan : { name : string, baseLevel: "trace" | "debug" | "info" | "warn" | "error" | "fatal" }}} logger
10
11
  * @property {{logger:string, secret:string}} directories
11
12
  * @property {{filename: string, keys: string[], additional: {}}} secret