@heliyos/heliyos-api-core 1.0.49 → 1.0.51

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.
@@ -20,7 +20,7 @@ const allowedOrigin = (origin) => {
20
20
  local: ["http://dev.heliyos.ai"],
21
21
  development: ["https://dev.heliyos.ai"],
22
22
  staging: ["https://staging.heliyos.ai"],
23
- production: ["https://app.heliyos.ai"],
23
+ production: ["https://gtm.heliyos.ai"],
24
24
  };
25
25
  // Construct the final URL
26
26
  const allowed_origin_urls = urls[env];
@@ -12,6 +12,7 @@ exports.middleware = middleware;
12
12
  /* eslint-disable @typescript-eslint/naming-convention */
13
13
  /* eslint-disable no-restricted-syntax */
14
14
  const body_parser_1 = __importDefault(require("body-parser"));
15
+ const compression_1 = __importDefault(require("compression"));
15
16
  const cookie_parser_1 = __importDefault(require("cookie-parser"));
16
17
  const helmet_1 = __importDefault(require("helmet"));
17
18
  const serve_static_1 = __importDefault(require("serve-static"));
@@ -40,6 +41,8 @@ const route_not_found = (_, __, next) => {
40
41
  function middleware(app, routes, options) {
41
42
  const { skipExternals, skipInternals, staticDir } = options;
42
43
  if (!skipExternals) {
44
+ // Enable gzip compression for all responses
45
+ app.use((0, compression_1.default)());
43
46
  app.use((0, helmet_1.default)());
44
47
  app.use((0, cookie_parser_1.default)());
45
48
  app.use(body_parser_1.default.json({ limit: "5mb" }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heliyos/heliyos-api-core",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "Heliyos's core api functions and middlewares. Its a private package hosted on npm.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -33,6 +33,7 @@
33
33
  "axios": "^1.7.7",
34
34
  "basic-auth": "^2.0.1",
35
35
  "body-parser": "^1.20.3",
36
+ "compression": "1.8.1",
36
37
  "cookie-parser": "^1.4.7",
37
38
  "dotenv": "16.4.5",
38
39
  "express-serve-static-core": "0.1.1",
@@ -52,6 +53,7 @@
52
53
  "devDependencies": {
53
54
  "@types/aws-lambda": "8.10.145",
54
55
  "@types/basic-auth": "^1.1.8",
56
+ "@types/compression": "1.8.1",
55
57
  "@types/cookie-parser": "^1.4.7",
56
58
  "@types/express-serve-static-core": "^5.0.1",
57
59
  "@types/helmet": "^4.0.0",