@golemio/core 1.2.5 → 1.2.6-dev.507011079

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,5 +1,12 @@
1
+ import { S3 } from "aws-sdk";
1
2
  import { NextFunction, Request, Response } from "express";
3
+ export declare const routesRegexp: RegExp;
4
+ export declare const headersRegexp: RegExp;
2
5
  /**
3
- * Middleware function to saving raw data to file
6
+ * Middleware function for saving raw data to file
4
7
  */
5
8
  export declare const saveRawDataMiddleware: (req: Request, res: Response, next: NextFunction) => void;
9
+ /**
10
+ * Helper function for saving data to S3
11
+ */
12
+ export declare const uploadDataToS3: (data: S3.Types.PutObjectRequest, options: S3.ManagedUpload.ManagedUploadOptions, requestUrlPath: string) => void;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.saveRawDataMiddleware = void 0;
6
+ exports.uploadDataToS3 = exports.saveRawDataMiddleware = exports.headersRegexp = exports.routesRegexp = void 0;
7
7
  const errors_1 = require("@golemio/errors");
8
8
  const aws_sdk_1 = require("aws-sdk");
9
9
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
@@ -13,7 +13,7 @@ const helpers_1 = require("./");
13
13
  // load all whitelisted datasets
14
14
  let regexpRoutesString = "";
15
15
  let regexpHeadersString = "";
16
- config_1.config.saveRawDataWhitelist.forEach((dataset) => {
16
+ for (const dataset of config_1.config.saveRawDataWhitelist) {
17
17
  if (regexpRoutesString.length !== 0) {
18
18
  regexpRoutesString += "|";
19
19
  }
@@ -25,10 +25,10 @@ config_1.config.saveRawDataWhitelist.forEach((dataset) => {
25
25
  }
26
26
  regexpHeadersString += routeRegexp;
27
27
  }
28
- });
28
+ }
29
29
  // regexp for matching all whitelisted datasets
30
- const routesRegexp = regexpRoutesString !== "" ? RegExp(regexpRoutesString) : RegExp(/.^/);
31
- const headersRegexp = regexpHeadersString !== "" ? RegExp(regexpHeadersString) : RegExp(/.^/);
30
+ exports.routesRegexp = regexpRoutesString !== "" ? RegExp(regexpRoutesString) : RegExp(/.^/);
31
+ exports.headersRegexp = regexpHeadersString !== "" ? RegExp(regexpHeadersString) : RegExp(/.^/);
32
32
  const s3 = new aws_sdk_1.S3({
33
33
  accessKeyId: config_1.config.s3.access_key_id,
34
34
  endpoint: config_1.config.s3.endpoint,
@@ -37,24 +37,25 @@ const s3 = new aws_sdk_1.S3({
37
37
  signatureVersion: "v4",
38
38
  });
39
39
  /**
40
- * Middleware function to saving raw data to file
40
+ * Middleware function for saving raw data to file
41
41
  */
42
42
  const saveRawDataMiddleware = (req, res, next) => {
43
+ const requestUrlPath = req.path;
43
44
  // save file only if S3 is enabled and the method is POST and the url match one of whitelisted route
44
- if (config_1.config.s3.enabled && req.method === "POST" && routesRegexp.exec(req.url)) {
45
+ if (config_1.config.s3.enabled && req.method === "POST" && exports.routesRegexp.exec(requestUrlPath)) {
45
46
  // file name (path) in format {url}/{YYYY-MM-DD}/{HH_mm_ss.s}, e.g. mos-be/accounts/2020-04-17/12_59_42.456
46
47
  const now = (0, moment_timezone_1.default)().tz("Europe/Prague");
47
- const name = `${req.url.slice(1)}/${now.format("YYYY-MM-DD")}/${now.format("HH_mm_ss.SSS")}`;
48
+ const name = `${requestUrlPath.slice(1)}/${now.format("YYYY-MM-DD")}/${now.format("HH_mm_ss.SSS")}`;
48
49
  // file extension by content-type
49
50
  const contentType = (0, helpers_1.getContentType)(req);
50
51
  const ext = helpers_1.contentTypeToExtension[contentType];
51
52
  // content-type checking
52
53
  if (!ext) {
53
- errors_1.ErrorHandler.handle(new errors_1.CustomError(`Saving raw data failed. (${req.url})`, true, "SaveRawDataMiddleware", 406, new Error(`Extension for content-type ${contentType} was not found.`)));
54
+ errors_1.ErrorHandler.handle(new errors_1.CustomError(`Saving raw data failed. (${requestUrlPath})`, true, "SaveRawDataMiddleware", 406, new Error(`Extension for content-type ${contentType} was not found.`)));
54
55
  return next();
55
56
  }
56
57
  // save file with body of the matched route
57
- const paramsBody = {
58
+ const dataPutRequest = {
58
59
  Body: req,
59
60
  Bucket: config_1.config.s3.bucket_name,
60
61
  Key: `${name}.${ext}`,
@@ -63,36 +64,31 @@ const saveRawDataMiddleware = (req, res, next) => {
63
64
  partSize: config_1.config.s3.upload_part_size * 1024 * 1024,
64
65
  queueSize: config_1.config.s3.upload_queue_size,
65
66
  };
66
- s3.upload(paramsBody, options, (err, data) => {
67
- if (err) {
68
- errors_1.ErrorHandler.handle(
69
- // @ts-ignore
70
- new errors_1.CustomError(`Saving raw data failed. (${req.url})`, true, "SaveRawDataMiddleware", err.statusCode, err));
71
- }
72
- })
73
- .on("httpUploadProgress", (httpUploadProgress) => {
74
- helpers_1.log.debug(`S3 file upload progress: ${httpUploadProgress.loaded} / ${httpUploadProgress.total}`);
75
- })
76
- .on("error", (err) => {
77
- errors_1.ErrorHandler.handle(new errors_1.CustomError(`Saving raw data failed. (${req.url})`, true, "SaveRawDataMiddleware", err.statusCode, err));
78
- });
67
+ (0, exports.uploadDataToS3)(dataPutRequest, options, requestUrlPath);
79
68
  // save file with headers of the matched route
80
- if (headersRegexp.exec(req.url)) {
81
- const paramsHeaders = {
69
+ if (exports.headersRegexp.exec(requestUrlPath)) {
70
+ const headersPutRequest = {
82
71
  Body: JSON.stringify(req.headers),
83
72
  Bucket: config_1.config.s3.bucket_name,
84
73
  Key: `${name}_headers.json`,
85
74
  };
86
- s3.upload(paramsHeaders, options, (err, data) => {
87
- if (err) {
88
- errors_1.ErrorHandler.handle(new errors_1.CustomError(`Saving headers of raw data failed. (${req.url})`, true, "SaveRawDataMiddleware",
89
- // @ts-ignore
90
- err.statusCode, err));
91
- }
92
- });
75
+ (0, exports.uploadDataToS3)(headersPutRequest, options, requestUrlPath);
93
76
  }
94
77
  }
95
78
  next();
96
79
  };
97
80
  exports.saveRawDataMiddleware = saveRawDataMiddleware;
81
+ /**
82
+ * Helper function for saving data to S3
83
+ */
84
+ const uploadDataToS3 = (data, options, requestUrlPath) => {
85
+ s3.upload(data, options, (err, _data) => {
86
+ if (err) {
87
+ errors_1.ErrorHandler.handle(new errors_1.CustomError(`Uploading data failed to S3 failed. (${requestUrlPath})`, true, "SaveRawDataMiddleware", err.statusCode, err));
88
+ }
89
+ }).on("httpUploadProgress", (httpUploadProgress) => {
90
+ helpers_1.log.debug(`S3 file upload progress: ${httpUploadProgress.loaded} / ${httpUploadProgress.total}`);
91
+ });
92
+ };
93
+ exports.uploadDataToS3 = uploadDataToS3;
98
94
  //# sourceMappingURL=SaveRawDataMiddleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveRawDataMiddleware.js","sourceRoot":"","sources":["../../../src/input-gateway/helpers/SaveRawDataMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA4D;AAC5D,qCAA6B;AAE7B,sEAAqC;AACrC,mDAA8C;AAC9C,sCAAoC;AACpC,gCAA0E;AAE1E,gCAAgC;AAChC,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAC5B,IAAI,mBAAmB,GAAG,EAAE,CAAC;AAC7B,eAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IAC5C,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,kBAAkB,IAAI,GAAG,CAAC;KAC7B;IACD,MAAM,WAAW,GAAG,IAAI,IAAA,6BAAY,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;IAC9D,kBAAkB,IAAI,WAAW,CAAC;IAElC,IAAI,OAAO,CAAC,WAAW,EAAE;QACrB,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,mBAAmB,IAAI,GAAG,CAAC;SAC9B;QACD,mBAAmB,IAAI,WAAW,CAAC;KACtC;AACL,CAAC,CAAC,CAAC;AACH,+CAA+C;AAC/C,MAAM,YAAY,GAAG,kBAAkB,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C;QACN,CAAC,CAAC,CAAC;QAEP,8CAA8C;QAC9C,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC7B,MAAM,aAAa,GAAG;gBAClB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC;gBACjC,MAAM,EAAE,eAAM,CAAC,EAAE,CAAC,WAAW;gBAC7B,GAAG,EAAE,GAAG,IAAI,eAAe;aAC9B,CAAC;YACF,EAAE,CAAC,MAAM,CAAC,aAAoB,EAAE,OAAO,EAAE,CAAC,GAAU,EAAE,IAA+B,EAAE,EAAE;gBACrF,IAAI,GAAG,EAAE;oBACL,qBAAY,CAAC,MAAM,CACf,IAAI,oBAAW,CACX,uCAAuC,GAAG,CAAC,GAAG,GAAG,EACjD,IAAI,EACJ,uBAAuB;oBACvB,aAAa;oBACb,GAAG,CAAC,UAAU,EACd,GAAG,CACN,CACJ,CAAC;iBACL;YACL,CAAC,CAAC,CAAC;SACN;KACJ;IACD,IAAI,EAAE,CAAC;AACX,CAAC,CAAC;AA3EW,QAAA,qBAAqB,yBA2EhC"}
1
+ {"version":3,"file":"SaveRawDataMiddleware.js","sourceRoot":"","sources":["../../../src/input-gateway/helpers/SaveRawDataMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA4D;AAC5D,qCAA6B;AAE7B,sEAAqC;AACrC,mDAA8C;AAC9C,sCAAoC;AACpC,gCAA0E;AAM1E,gCAAgC;AAChC,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAC5B,IAAI,mBAAmB,GAAG,EAAE,CAAC;AAE7B,KAAK,MAAM,OAAO,IAAI,eAAM,CAAC,oBAAoB,EAAE;IAC/C,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,kBAAkB,IAAI,GAAG,CAAC;KAC7B;IACD,MAAM,WAAW,GAAG,IAAI,IAAA,6BAAY,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,GAA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AC;AACX,CAAC,CAAC;AArDW,QAAA,qBAAqB,yBAqDhC;AAEF;;GAEG;AACI,MAAM,cAAc,GAAG,CAC1B,IAA+B,EAC/B,OAA8C,EAC9C,cAAsB,EACxB,EAAE;IACA,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAqB,EAAE,KAAgC,EAAE,EAAE;QACjF,IAAI,GAAG,EAAE;YACL,qBAAY,CAAC,MAAM,CACf,IAAI,oBAAW,CACX,wCAAwC,cAAc,GAAG,EACzD,IAAI,EACJ,uBAAuB,EACvB,GAAG,CAAC,UAAU,EACd,GAAG,CACN,CACJ,CAAC;SACL;IACL,CAAC,CAAC,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,kBAAkB,EAAE,EAAE;QAC/C,aAAG,CAAC,KAAK,CAAC,4BAA4B,kBAAkB,CAAC,MAAM,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
package/package.json CHANGED
@@ -1,132 +1,132 @@
1
1
  {
2
- "name": "@golemio/core",
3
- "version": "1.2.5",
4
- "description": "Golemio Core Module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "golemio-import-test-data": "bin/import-test-data.js"
9
- },
10
- "scripts": {
11
- "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
12
- "build-minimal": "run-s 'build --sourceMap false --declaration false'",
13
- "build-watch": "run-s 'build --watch --preserveWatchOutput'",
14
- "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
15
- "test-debug": "run-s 'test --inspect-brk=9230'",
16
- "code-coverage": "nyc run-s 'test -r source-map-support/register'",
17
- "generate-docs": "typedoc --out docs/typedoc src",
18
- "lint": "eslint \"{src,test}/**/*.ts\""
19
- },
20
- "keywords": [
21
- "golemio"
22
- ],
23
- "author": "Operator ICT, a.s.",
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "https://gitlab.com/operator-ict/golemio/code/modules/core"
28
- },
29
- "devDependencies": {
30
- "@commitlint/cli": "^11.0.0",
31
- "@commitlint/config-conventional": "^11.0.0",
32
- "@golemio/eslint-config": "^1.1.0",
33
- "@types/amqplib": "^0.5.17",
34
- "@types/apicache": "^1.2.3",
35
- "@types/chai": "4.2.3",
36
- "@types/chai-as-promised": "7.1.2",
37
- "@types/content-type": "^1.1.3",
38
- "@types/debug": "0.0.31",
39
- "@types/decompress": "^4.2.3",
40
- "@types/ioredis": "^4.17.10",
41
- "@types/lodash": "^4.14.165",
42
- "@types/mocha": "^8.2.0",
43
- "@types/morgan": "^1.9.2",
44
- "@types/node": "^14.14.20",
45
- "@types/redis": "^2.8.28",
46
- "@types/sinon": "7.0.13",
47
- "@types/ssh2-sftp-client": "^5.3.1",
48
- "@types/supertest": "^2.0.11",
49
- "@zerollup/ts-transform-paths": "^1.7.18",
50
- "chai": "4.2.0",
51
- "chai-as-promised": "7.1.1",
52
- "cross-env": "^7.0.3",
53
- "eslint": "^8.1.1",
54
- "husky": "^4.3.7",
55
- "mocha": "^9.1.2",
56
- "nock": "^13.0.5",
57
- "npm-run-all": "^4.1.5",
58
- "nyc": "^15.1.0",
59
- "prettier": "^2.5.1",
60
- "pretty-quick": "^3.1.0",
61
- "rimraf": "^3.0.2",
62
- "sinon": "7.1.1",
63
- "source-map-support": "0.5.9",
64
- "supertest": "^6.1.6",
65
- "ts-node": "^9.1.1",
66
- "ttypescript": "^1.5.13",
67
- "typedoc": "^0.21.4",
68
- "typescript": "4.4.4"
69
- },
70
- "dependencies": {
71
- "@golemio/errors": "^1.0.1",
72
- "@golemio/utils": "^1.0.0",
73
- "@golemio/validator": "0.2.0",
74
- "@google-cloud/storage": "^5.18.0",
75
- "@opentelemetry/api": "^1.0.2",
76
- "@opentelemetry/exporter-jaeger": "^0.24.0",
77
- "@opentelemetry/instrumentation-express": "^0.24.0",
78
- "@opentelemetry/instrumentation-http": "^0.24.0",
79
- "@opentelemetry/instrumentation-ioredis": "^0.24.0",
80
- "@opentelemetry/node": "^0.24.0",
81
- "@opentelemetry/resources": "^0.24.0",
82
- "@opentelemetry/tracing": "^0.24.0",
83
- "@sentry/node": "^6.11.0",
84
- "@sentry/tracing": "^6.11.0",
85
- "@types/express": "^4.16.0",
86
- "@types/request-promise": "^4.1.45",
87
- "ajv": "^8.10.0",
88
- "amqplib": "^0.7.1",
89
- "apicache": "^1.6.3",
90
- "aws-sdk": "^2.823.0",
91
- "axios": "^0.24.0",
92
- "basic-ftp": "^4.6.6",
93
- "content-type": "^1.0.4",
94
- "debug": "3.1.0",
95
- "decompress": "^4.2.1",
96
- "dotenv": "^8.2.0",
97
- "express": "^4.16.4",
98
- "express-validator": "^5.3.1",
99
- "fast-csv": "^4.3.6",
100
- "fast-glob": "^3.2.5",
101
- "iconv-lite": "^0.6.2",
102
- "influx": "^5.6.3",
103
- "ioredis": "^4.19.4",
104
- "lightship": "^6.7.2",
105
- "lodash": "^4.17.21",
106
- "moment-timezone": "^0.5.26",
107
- "mongodb-restore-dump": "1.0.1",
108
- "mongoose": "^5.3.6",
109
- "morgan": "^1.10.0",
110
- "opentelemetry-instrumentation-amqplib": "^0.24.0",
111
- "opentelemetry-instrumentation-aws-sdk": "^0.24.1",
112
- "opentelemetry-instrumentation-mongoose": "^0.24.0",
113
- "opentelemetry-instrumentation-sequelize": "^0.24.0",
114
- "path-to-regexp": "^6.2.0",
115
- "pg": "^8.6.0",
116
- "prom-client": "^14.0.0",
117
- "redis": "^3.1.1",
118
- "request": "2.88.0",
119
- "request-promise": "^4.2.5",
120
- "sequelize": "^6.6.5",
121
- "ssh2-sftp-client": "^7.1.0",
122
- "winston": "^3.3.3",
123
- "xml2js-es6-promise": "^1.1.1"
124
- },
125
- "resolutions": {
126
- "mpath": "^0.8.4",
127
- "url-parse": "^1.5.6",
128
- "minimist": "^1.2.6",
129
- "@google-cloud/storage/**/node-forge": "^1.3.0",
130
- "**/axios/follow-redirects": "^1.14.7"
131
- }
2
+ "name": "@golemio/core",
3
+ "version": "1.2.6-dev.507011079",
4
+ "description": "Golemio Core Module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "golemio-import-test-data": "bin/import-test-data.js"
9
+ },
10
+ "scripts": {
11
+ "build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
12
+ "build-minimal": "run-s 'build --sourceMap false --declaration false'",
13
+ "build-watch": "run-s 'build --watch --preserveWatchOutput'",
14
+ "test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
15
+ "test-debug": "run-s 'test --inspect-brk=9230'",
16
+ "code-coverage": "nyc run-s 'test -r source-map-support/register'",
17
+ "generate-docs": "typedoc --out docs/typedoc src",
18
+ "lint": "eslint \"{src,test}/**/*.ts\""
19
+ },
20
+ "keywords": [
21
+ "golemio"
22
+ ],
23
+ "author": "Operator ICT, a.s.",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://gitlab.com/operator-ict/golemio/code/modules/core"
28
+ },
29
+ "devDependencies": {
30
+ "@commitlint/cli": "^11.0.0",
31
+ "@commitlint/config-conventional": "^11.0.0",
32
+ "@golemio/eslint-config": "^1.1.0",
33
+ "@types/amqplib": "^0.5.17",
34
+ "@types/apicache": "^1.2.3",
35
+ "@types/chai": "4.2.3",
36
+ "@types/chai-as-promised": "7.1.2",
37
+ "@types/content-type": "^1.1.3",
38
+ "@types/debug": "0.0.31",
39
+ "@types/decompress": "^4.2.3",
40
+ "@types/ioredis": "^4.17.10",
41
+ "@types/lodash": "^4.14.165",
42
+ "@types/mocha": "^8.2.0",
43
+ "@types/morgan": "^1.9.2",
44
+ "@types/node": "^14.14.20",
45
+ "@types/redis": "^2.8.28",
46
+ "@types/sinon": "7.0.13",
47
+ "@types/ssh2-sftp-client": "^5.3.1",
48
+ "@types/supertest": "^2.0.11",
49
+ "@zerollup/ts-transform-paths": "^1.7.18",
50
+ "chai": "4.2.0",
51
+ "chai-as-promised": "7.1.1",
52
+ "cross-env": "^7.0.3",
53
+ "eslint": "^8.1.1",
54
+ "husky": "^4.3.7",
55
+ "mocha": "^9.1.2",
56
+ "nock": "^13.0.5",
57
+ "npm-run-all": "^4.1.5",
58
+ "nyc": "^15.1.0",
59
+ "prettier": "^2.5.1",
60
+ "pretty-quick": "^3.1.0",
61
+ "rimraf": "^3.0.2",
62
+ "sinon": "7.1.1",
63
+ "source-map-support": "0.5.9",
64
+ "supertest": "^6.1.6",
65
+ "ts-node": "^9.1.1",
66
+ "ttypescript": "^1.5.13",
67
+ "typedoc": "^0.21.4",
68
+ "typescript": "4.4.4"
69
+ },
70
+ "dependencies": {
71
+ "@golemio/errors": "^1.0.1",
72
+ "@golemio/utils": "^1.0.0",
73
+ "@golemio/validator": "0.2.0",
74
+ "@google-cloud/storage": "^5.18.0",
75
+ "@opentelemetry/api": "^1.0.2",
76
+ "@opentelemetry/exporter-jaeger": "^0.24.0",
77
+ "@opentelemetry/instrumentation-express": "^0.24.0",
78
+ "@opentelemetry/instrumentation-http": "^0.24.0",
79
+ "@opentelemetry/instrumentation-ioredis": "^0.24.0",
80
+ "@opentelemetry/node": "^0.24.0",
81
+ "@opentelemetry/resources": "^0.24.0",
82
+ "@opentelemetry/tracing": "^0.24.0",
83
+ "@sentry/node": "^6.11.0",
84
+ "@sentry/tracing": "^6.11.0",
85
+ "@types/express": "^4.16.0",
86
+ "@types/request-promise": "^4.1.45",
87
+ "ajv": "^8.10.0",
88
+ "amqplib": "^0.7.1",
89
+ "apicache": "^1.6.3",
90
+ "aws-sdk": "^2.823.0",
91
+ "axios": "^0.24.0",
92
+ "basic-ftp": "^4.6.6",
93
+ "content-type": "^1.0.4",
94
+ "debug": "3.1.0",
95
+ "decompress": "^4.2.1",
96
+ "dotenv": "^8.2.0",
97
+ "express": "^4.16.4",
98
+ "express-validator": "^5.3.1",
99
+ "fast-csv": "^4.3.6",
100
+ "fast-glob": "^3.2.5",
101
+ "iconv-lite": "^0.6.2",
102
+ "influx": "^5.6.3",
103
+ "ioredis": "^4.19.4",
104
+ "lightship": "^6.7.2",
105
+ "lodash": "^4.17.21",
106
+ "moment-timezone": "^0.5.26",
107
+ "mongodb-restore-dump": "1.0.1",
108
+ "mongoose": "^5.3.6",
109
+ "morgan": "^1.10.0",
110
+ "opentelemetry-instrumentation-amqplib": "^0.24.0",
111
+ "opentelemetry-instrumentation-aws-sdk": "^0.24.1",
112
+ "opentelemetry-instrumentation-mongoose": "^0.24.0",
113
+ "opentelemetry-instrumentation-sequelize": "^0.24.0",
114
+ "path-to-regexp": "^6.2.0",
115
+ "pg": "^8.6.0",
116
+ "prom-client": "^14.0.0",
117
+ "redis": "^3.1.1",
118
+ "request": "2.88.0",
119
+ "request-promise": "^4.2.5",
120
+ "sequelize": "^6.6.5",
121
+ "ssh2-sftp-client": "^7.1.0",
122
+ "winston": "^3.3.3",
123
+ "xml2js-es6-promise": "^1.1.1"
124
+ },
125
+ "resolutions": {
126
+ "mpath": "^0.8.4",
127
+ "url-parse": "^1.5.6",
128
+ "minimist": "^1.2.6",
129
+ "@google-cloud/storage/**/node-forge": "^1.3.0",
130
+ "**/axios/follow-redirects": "^1.14.7"
131
+ }
132
132
  }