@golemio/core 1.2.18 → 1.2.19-dev.651169414

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,9 +1,8 @@
1
1
  import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
2
2
  import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis";
3
- import { RedisInstrumentation } from "@opentelemetry/instrumentation-redis";
4
3
  import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
5
4
  import { SequelizeInstrumentation } from "opentelemetry-instrumentation-sequelize";
6
5
  import { MongooseInstrumentation } from "opentelemetry-instrumentation-mongoose";
7
6
  import { AmqplibInstrumentation } from "@opentelemetry/instrumentation-amqplib";
8
7
  import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";
9
- export declare const getInstrumentation: () => (ExpressInstrumentation | HttpInstrumentation | SequelizeInstrumentation | MongooseInstrumentation | AmqplibInstrumentation | IORedisInstrumentation | RedisInstrumentation | AwsInstrumentation)[];
8
+ export declare const getInstrumentation: () => (ExpressInstrumentation | HttpInstrumentation | SequelizeInstrumentation | MongooseInstrumentation | AmqplibInstrumentation | IORedisInstrumentation | AwsInstrumentation)[];
@@ -4,7 +4,6 @@ exports.getInstrumentation = void 0;
4
4
  // Instrumentation
5
5
  const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
6
6
  const instrumentation_ioredis_1 = require("@opentelemetry/instrumentation-ioredis");
7
- const instrumentation_redis_1 = require("@opentelemetry/instrumentation-redis");
8
7
  const instrumentation_express_1 = require("@opentelemetry/instrumentation-express");
9
8
  const opentelemetry_instrumentation_sequelize_1 = require("opentelemetry-instrumentation-sequelize");
10
9
  const opentelemetry_instrumentation_mongoose_1 = require("opentelemetry-instrumentation-mongoose");
@@ -20,7 +19,6 @@ const getInstrumentation = () => {
20
19
  new opentelemetry_instrumentation_mongoose_1.MongooseInstrumentation(configs_1.mongooseConfig),
21
20
  new instrumentation_amqplib_1.AmqplibInstrumentation(configs_1.amqplibConfig),
22
21
  new instrumentation_ioredis_1.IORedisInstrumentation(),
23
- new instrumentation_redis_1.RedisInstrumentation(),
24
22
  new instrumentation_aws_sdk_1.AwsInstrumentation(configs_1.awsSdkConfig),
25
23
  ];
26
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,gFAA4E;AAC5E,oFAAgF;AAChF,qGAAmF;AACnF,mGAAiF;AACjF,oFAAgF;AAChF,oFAA4E;AAE5E,UAAU;AACV,uCAAqG;AAE9F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,OAAO;QACH,IAAI,gDAAsB,EAAE;QAC5B,IAAI,0CAAmB,CAAC,oBAAU,CAAC;QACnC,IAAI,kEAAwB,CAAC,yBAAe,CAAC;QAC7C,IAAI,gEAAuB,CAAC,wBAAc,CAAC;QAC3C,IAAI,gDAAsB,CAAC,uBAAa,CAAC;QACzC,IAAI,gDAAsB,EAAE;QAC5B,IAAI,4CAAoB,EAAE;QAC1B,IAAI,4CAAkB,CAAC,sBAAY,CAAC;KACvC,CAAC;AACN,CAAC,CAAC;AAXW,QAAA,kBAAkB,sBAW7B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/monitoring/opentelemetry/instrumentation/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,8EAA0E;AAC1E,oFAAgF;AAChF,oFAAgF;AAChF,qGAAmF;AACnF,mGAAiF;AACjF,oFAAgF;AAChF,oFAA4E;AAE5E,UAAU;AACV,uCAAqG;AAE9F,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,OAAO;QACH,IAAI,gDAAsB,EAAE;QAC5B,IAAI,0CAAmB,CAAC,oBAAU,CAAC;QACnC,IAAI,kEAAwB,CAAC,yBAAe,CAAC;QAC7C,IAAI,gEAAuB,CAAC,wBAAc,CAAC;QAC3C,IAAI,gDAAsB,CAAC,uBAAa,CAAC;QACzC,IAAI,gDAAsB,EAAE;QAC5B,IAAI,4CAAkB,CAAC,sBAAY,CAAC;KACvC,CAAC;AACN,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B"}
@@ -4,9 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useCacheMiddleware = exports.CacheMiddleware = void 0;
7
- const apicache_plus_1 = __importDefault(require("apicache-plus"));
8
7
  const config_1 = require("../config");
9
8
  const Logger_1 = require("../Logger");
9
+ const apicache_plus_1 = __importDefault(require("apicache-plus"));
10
+ const ConnectionType_1 = require("./interfaces/ConnectionType");
10
11
  const RedisConnector_1 = require("./RedisConnector");
11
12
  class MyCacheMiddleware {
12
13
  constructor() {
@@ -33,7 +34,7 @@ class MyCacheMiddleware {
33
34
  }
34
35
  init() {
35
36
  if (config_1.config.redis_enable) {
36
- this.redisClient = RedisConnector_1.RedisConnector.getConnection(RedisConnector_1.ConnectionType.APICACHE);
37
+ this.redisClient = RedisConnector_1.RedisConnector.getConnection(ConnectionType_1.ConnectionType.APICACHE);
37
38
  // sets redis to apicache
38
39
  this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
39
40
  defaultDuration: this.defaultCacheTtl.toString(),
@@ -1 +1 @@
1
- {"version":3,"file":"CacheMiddleware.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/CacheMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAqC;AAGrC,sCAAoC;AACpC,sCAAiC;AACjC,qDAAkE;AAElE,MAAM,iBAAiB;IAAvB;QACY,oBAAe,GAAW,QAAQ,CAAC,eAAM,CAAC,SAAS,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;QAI5E,kCAAkC;QAC1B,6BAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;YAChD,eAAe,EAAE,IAAI,C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,IAAI;QACP,IAAI,eAAM,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,WAAW,GAAG,+BAAc,CAAC,aAAa,CAAC,+BAAc,CAAC,QAAQ,CAAC,CAAC;YAEzE,yBAAyB;YACzB,IAAI,CAAC,wBAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;gBAC7C,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;gBAChD,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC,CAAC,UAAU,CAAC;SACjB;aAAM;YACH,YAAG,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;SAC1E;IACL,CAAC;IAEM,kBAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAOM,aAAa,CAAC,MAAwB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CAYJ;AAED,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAGvC,0CAAe;AAFxB,MAAM,kBAAkB,GAAG,CAAC,MAAwB,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAErE,gDAAkB"}
@@ -1,16 +1,13 @@
1
- import { RedisClient } from "redis";
2
- export declare enum ConnectionType {
3
- DEFAULT = "DEFAULT",
4
- APICACHE = "APICACHE"
5
- }
6
- declare class MyRedis {
1
+ import { Redis as RedisInstance } from "ioredis";
2
+ import { ConnectionType } from "./interfaces/ConnectionType";
3
+ import IRedisConnector from "./interfaces/IRedisConnector";
4
+ declare class IORedisConnector implements IRedisConnector<RedisInstance> {
7
5
  private connections;
8
- connect: () => Promise<RedisClient>;
9
- getConnection(connectionType?: ConnectionType): RedisClient;
6
+ connect: () => Promise<RedisInstance>;
7
+ getConnection(connectionType?: ConnectionType): RedisInstance;
10
8
  isConnected(connectionType?: ConnectionType): boolean;
11
9
  disconnect(): Promise<void>;
12
10
  private createConnection;
13
- private checkOnConnect;
14
11
  }
15
- declare const RedisConnector: MyRedis;
12
+ declare const RedisConnector: IORedisConnector;
16
13
  export { RedisConnector };
@@ -12,91 +12,64 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.RedisConnector = exports.ConnectionType = void 0;
16
- const errors_1 = require("@golemio/errors");
17
- const promises_1 = require("timers/promises");
18
- const redis_1 = __importDefault(require("redis"));
15
+ exports.RedisConnector = void 0;
19
16
  const config_1 = require("../config");
20
17
  const Logger_1 = require("../Logger");
21
- var ConnectionType;
22
- (function (ConnectionType) {
23
- ConnectionType["DEFAULT"] = "DEFAULT";
24
- ConnectionType["APICACHE"] = "APICACHE";
25
- })(ConnectionType = exports.ConnectionType || (exports.ConnectionType = {}));
26
- const connectionOptions = {
27
- [ConnectionType.DEFAULT]: {},
28
- [ConnectionType.APICACHE]: { detect_buffers: true },
29
- };
30
- class MyRedis {
18
+ const errors_1 = require("@golemio/errors");
19
+ const ioredis_1 = __importDefault(require("ioredis"));
20
+ const ConnectionType_1 = require("./interfaces/ConnectionType");
21
+ class IORedisConnector {
31
22
  constructor() {
32
23
  this.connections = new Map();
33
24
  this.connect = () => __awaiter(this, void 0, void 0, function* () {
34
- if (this.connections.has(ConnectionType.DEFAULT)) {
35
- return this.connections.get(ConnectionType.DEFAULT);
25
+ if (this.connections.has(ConnectionType_1.ConnectionType.DEFAULT)) {
26
+ return this.connections.get(ConnectionType_1.ConnectionType.DEFAULT);
36
27
  }
37
- for (const connectionType of Object.values(ConnectionType)) {
28
+ for (const connectionType of Object.values(ConnectionType_1.ConnectionType)) {
38
29
  yield this.createConnection(connectionType);
39
30
  }
40
- return this.connections.get(ConnectionType.DEFAULT);
31
+ return this.connections.get(ConnectionType_1.ConnectionType.DEFAULT);
41
32
  });
42
- this.createConnection = (connectionType) => __awaiter(this, void 0, void 0, function* () {
43
- try {
44
- if (!config_1.config.redis_connection) {
45
- throw new errors_1.CustomError("The ENV variable REDIS_CONN cannot be undefined.", true, this.constructor.name);
46
- }
47
- const connection = redis_1.default
48
- .createClient(config_1.config.redis_connection, connectionOptions[connectionType])
49
- .on("message", (message) => Logger_1.log.info(message))
50
- .on("error", (error) => Logger_1.log.warn(error))
51
- .on("connect", () => Logger_1.log.info("Connected to Redis!"));
52
- this.connections.set(connectionType, connection);
53
- // waiting for the redis client to connect
54
- const delay = 500; // millis
55
- const attemps = 4;
56
- yield this.checkOnConnect(connectionType, attemps, attemps, delay);
57
- return connection;
33
+ this.createConnection = (connectionType = ConnectionType_1.ConnectionType.DEFAULT) => __awaiter(this, void 0, void 0, function* () {
34
+ if (!config_1.config.redis_connection) {
35
+ throw new errors_1.CustomError("The ENV variable redis_connection cannot be undefined.", true, this.constructor.name);
58
36
  }
59
- catch (err) {
60
- throw new errors_1.CustomError("Error while connecting to Redis.", false, this.constructor.name, 1001, err);
37
+ const connection = new ioredis_1.default(config_1.config.redis_connection, { lazyConnect: true });
38
+ if (!connection) {
39
+ throw new Error("Connection is undefined.");
61
40
  }
62
- });
63
- this.checkOnConnect = (connectionType, retry, attemps, delay) => __awaiter(this, void 0, void 0, function* () {
64
- while (retry > 0) {
65
- if (this.isConnected(connectionType)) {
66
- return;
67
- }
68
- yield (0, promises_1.setTimeout)(delay);
69
- retry -= 1;
70
- }
71
- throw new Error(`Failed to connect to Redis after ${attemps * delay} millis.`);
41
+ connection.on("error", (err) => {
42
+ Logger_1.log.warn(err);
43
+ });
44
+ connection.on("connect", () => {
45
+ Logger_1.log.info("Connected to Redis!");
46
+ });
47
+ yield connection.connect();
48
+ this.connections.set(connectionType, connection);
72
49
  });
73
50
  }
74
- getConnection(connectionType = ConnectionType.DEFAULT) {
51
+ getConnection(connectionType = ConnectionType_1.ConnectionType.DEFAULT) {
75
52
  const connection = this.connections.get(connectionType);
76
53
  if (!connection) {
77
54
  throw new errors_1.CustomError("Redis connection does not exists. First call connect() method.", false, this.constructor.name, 1002);
78
55
  }
79
56
  return connection;
80
57
  }
81
- isConnected(connectionType = ConnectionType.DEFAULT) {
58
+ isConnected(connectionType = ConnectionType_1.ConnectionType.DEFAULT) {
82
59
  const connection = this.connections.get(connectionType);
83
- return !!connection && connection.connected;
60
+ return !!connection && connection.status === "ready";
84
61
  }
85
62
  disconnect() {
86
63
  return __awaiter(this, void 0, void 0, function* () {
87
64
  Logger_1.log.info("Redis disconnect called");
88
65
  for (const connection of this.connections.values()) {
89
- yield new Promise((resolve, reject) => {
90
- connection.quit((err) => {
91
- if (err)
92
- reject(err);
93
- resolve();
94
- });
95
- });
66
+ if (connection) {
67
+ yield connection.quit();
68
+ }
96
69
  }
97
70
  });
98
71
  }
99
72
  }
100
- const RedisConnector = new MyRedis();
73
+ const RedisConnector = new IORedisConnector();
101
74
  exports.RedisConnector = RedisConnector;
102
75
  //# sourceMappingURL=RedisConnector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedisConnector.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/RedisConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAA8C;AAC9C,8CAAsD;AACtD,kDAAuD;AACvD,sCAAoC;AACpC,sCAAiC;AAEjC,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,MAAM,iBAAiB,GAAuC;IAC1D,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE;IAC5B,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACtD,CAAC;AAEF,MAAM,OAAO;IAAb;QACY,gBAAW,GAAqC,IAAI,GAAG,EAAE,CAAC;QAE3D,YAAO,GAAG,GAA+B,EAAE;YAC9C,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE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U,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE;gBAChD,IAAI,UAAU,EAAE;oBACZ,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;iBAC3B;aACJ;QACL,CAAC;KAAA;CAuBJ;AAED,MAAM,cAAc,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAErC,wCAAc"}
@@ -0,0 +1,4 @@
1
+ export declare enum ConnectionType {
2
+ DEFAULT = "DEFAULT",
3
+ APICACHE = "APICACHE"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectionType = void 0;
4
+ var ConnectionType;
5
+ (function (ConnectionType) {
6
+ ConnectionType["DEFAULT"] = "DEFAULT";
7
+ ConnectionType["APICACHE"] = "APICACHE";
8
+ })(ConnectionType = exports.ConnectionType || (exports.ConnectionType = {}));
9
+ //# sourceMappingURL=ConnectionType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionType.js","sourceRoot":"","sources":["../../../../src/output-gateway/redis/interfaces/ConnectionType.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB"}
@@ -0,0 +1,6 @@
1
+ export default interface IRedisConnector<T> {
2
+ connect(): Promise<T>;
3
+ getConnection(): T;
4
+ isConnected(): boolean;
5
+ disconnect(): void;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IRedisConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRedisConnector.js","sourceRoot":"","sources":["../../../../src/output-gateway/redis/interfaces/IRedisConnector.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,127 +1,125 @@
1
1
  {
2
- "name": "@golemio/core",
3
- "version": "1.2.18",
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 --cache \"{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": "^16.2.1",
31
- "@commitlint/config-conventional": "^16.2.1",
32
- "@golemio/eslint-config": "^1.1.0",
33
- "@ovos-media/ts-transform-paths": "^1.7.18-1",
34
- "@types/amqplib": "^0.5.17",
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/mocha": "^8.2.0",
41
- "@types/morgan": "^1.9.2",
42
- "@types/node": "^16.11.35",
43
- "@types/sinon": "7.0.13",
44
- "@types/ssh2-sftp-client": "^5.3.1",
45
- "@types/supertest": "^2.0.11",
46
- "chai": "4.2.0",
47
- "chai-as-promised": "7.1.1",
48
- "cross-env": "^7.0.3",
49
- "eslint": "^8.1.1",
50
- "husky": "^4.3.7",
51
- "mocha": "^9.1.2",
52
- "nock": "^13.0.5",
53
- "npm-run-all": "^4.1.5",
54
- "nyc": "^15.1.0",
55
- "prettier": "^2.5.1",
56
- "pretty-quick": "^3.1.0",
57
- "rimraf": "^3.0.2",
58
- "sinon": "7.1.1",
59
- "source-map-support": "0.5.9",
60
- "supertest": "^6.1.6",
61
- "ts-node": "^10.7.0",
62
- "ttypescript": "^1.5.13",
63
- "typedoc": "^0.22.15",
64
- "typescript": "4.6.4"
65
- },
66
- "dependencies": {
67
- "@abraham/reflection": "^0.10.0",
68
- "@azure/storage-blob": "^12.11.0",
69
- "@golemio/errors": "^1.0.1",
70
- "@golemio/utils": "^1.0.0",
71
- "@golemio/validator": "0.2.4",
72
- "@google-cloud/storage": "^5.18.0",
73
- "@opentelemetry/api": "1.0.4",
74
- "@opentelemetry/exporter-jaeger": "^1.2.0",
75
- "@opentelemetry/instrumentation-amqplib": "^0.28.0",
76
- "@opentelemetry/instrumentation-aws-sdk": "^0.6.0",
77
- "@opentelemetry/instrumentation-express": "^0.28.0",
78
- "@opentelemetry/instrumentation-http": "^0.27.0",
79
- "@opentelemetry/instrumentation-ioredis": "^0.28.0",
80
- "@opentelemetry/instrumentation-redis": "^0.29.0",
81
- "@opentelemetry/resources": "^1.2.0",
82
- "@opentelemetry/sdk-trace-base": "^1.2.0",
83
- "@opentelemetry/sdk-trace-node": "^1.2.0",
84
- "@sentry/node": "^6.19.7",
85
- "@sentry/tracing": "^6.19.7",
86
- "@types/express": "^4.16.0",
87
- "@types/luxon": "^2.3.1",
88
- "@types/request-promise": "^4.1.45",
89
- "ajv": "^8.10.0",
90
- "amqplib": "^0.7.1",
91
- "apicache-plus": "^2.3.1",
92
- "aws-sdk": "^2.823.0",
93
- "axios": "^0.24.0",
94
- "basic-ftp": "^4.6.6",
95
- "class-transformer": "^0.5.1",
96
- "class-validator": "^0.13.2",
97
- "content-type": "^1.0.4",
98
- "debug": "3.1.0",
99
- "decompress": "^4.2.1",
100
- "dotenv": "^8.2.0",
101
- "express": "^4.16.4",
102
- "express-validator": "^5.3.1",
103
- "fast-csv": "^4.3.6",
104
- "fast-glob": "^3.2.5",
105
- "iconv-lite": "^0.6.2",
106
- "ioredis": "^4.28.5",
107
- "lightship": "^6.7.2",
108
- "luxon": "^2.3.2",
109
- "moment-timezone": "^0.5.26",
110
- "mongodb-restore-dump": "1.0.1",
111
- "mongoose": "^6.5.3",
112
- "morgan": "^1.10.0",
113
- "opentelemetry-instrumentation-mongoose": "^0.27.1",
114
- "opentelemetry-instrumentation-sequelize": "^0.27.1",
115
- "path-to-regexp": "^6.2.0",
116
- "pg": "^8.6.0",
117
- "prom-client": "^14.0.0",
118
- "redis": "^3.1.1",
119
- "request": "2.88.0",
120
- "request-promise": "^4.2.5",
121
- "sequelize": "^6.21.2",
122
- "ssh2-sftp-client": "^7.1.0",
123
- "winston": "^3.3.3",
124
- "xml2js-es6-promise": "^1.1.1"
125
- },
126
- "resolutions": {}
2
+ "name": "@golemio/core",
3
+ "version": "1.2.19-dev.651169414",
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 --cache \"{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": "^16.2.1",
31
+ "@commitlint/config-conventional": "^16.2.1",
32
+ "@golemio/eslint-config": "^1.1.0",
33
+ "@ovos-media/ts-transform-paths": "^1.7.18-1",
34
+ "@types/amqplib": "^0.5.17",
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/mocha": "^8.2.0",
41
+ "@types/morgan": "^1.9.2",
42
+ "@types/node": "^16.11.35",
43
+ "@types/sinon": "7.0.13",
44
+ "@types/ssh2-sftp-client": "^5.3.1",
45
+ "@types/supertest": "^2.0.11",
46
+ "chai": "4.2.0",
47
+ "chai-as-promised": "7.1.1",
48
+ "cross-env": "^7.0.3",
49
+ "eslint": "^8.1.1",
50
+ "husky": "^4.3.7",
51
+ "mocha": "^9.1.2",
52
+ "nock": "^13.0.5",
53
+ "npm-run-all": "^4.1.5",
54
+ "nyc": "^15.1.0",
55
+ "prettier": "^2.5.1",
56
+ "pretty-quick": "^3.1.0",
57
+ "rimraf": "^3.0.2",
58
+ "sinon": "7.1.1",
59
+ "source-map-support": "0.5.9",
60
+ "supertest": "^6.1.6",
61
+ "ts-node": "^10.7.0",
62
+ "ttypescript": "^1.5.13",
63
+ "typedoc": "^0.22.15",
64
+ "typescript": "4.6.4"
65
+ },
66
+ "dependencies": {
67
+ "@abraham/reflection": "^0.10.0",
68
+ "@azure/storage-blob": "^12.11.0",
69
+ "@golemio/errors": "^1.0.1",
70
+ "@golemio/utils": "^1.0.0",
71
+ "@golemio/validator": "0.2.4",
72
+ "@google-cloud/storage": "^5.18.0",
73
+ "@opentelemetry/api": "1.0.4",
74
+ "@opentelemetry/exporter-jaeger": "^1.2.0",
75
+ "@opentelemetry/instrumentation-amqplib": "^0.28.0",
76
+ "@opentelemetry/instrumentation-aws-sdk": "^0.6.0",
77
+ "@opentelemetry/instrumentation-express": "^0.28.0",
78
+ "@opentelemetry/instrumentation-http": "^0.27.0",
79
+ "@opentelemetry/instrumentation-ioredis": "^0.28.0",
80
+ "@opentelemetry/resources": "^1.2.0",
81
+ "@opentelemetry/sdk-trace-base": "^1.2.0",
82
+ "@opentelemetry/sdk-trace-node": "^1.2.0",
83
+ "@sentry/node": "^6.19.7",
84
+ "@sentry/tracing": "^6.19.7",
85
+ "@types/express": "^4.16.0",
86
+ "@types/luxon": "^2.3.1",
87
+ "@types/request-promise": "^4.1.45",
88
+ "ajv": "^8.10.0",
89
+ "amqplib": "^0.7.1",
90
+ "apicache-plus": "^2.3.1",
91
+ "aws-sdk": "^2.823.0",
92
+ "axios": "^0.24.0",
93
+ "basic-ftp": "^4.6.6",
94
+ "class-transformer": "^0.5.1",
95
+ "class-validator": "^0.13.2",
96
+ "content-type": "^1.0.4",
97
+ "debug": "3.1.0",
98
+ "decompress": "^4.2.1",
99
+ "dotenv": "^8.2.0",
100
+ "express": "^4.16.4",
101
+ "express-validator": "^5.3.1",
102
+ "fast-csv": "^4.3.6",
103
+ "fast-glob": "^3.2.5",
104
+ "iconv-lite": "^0.6.2",
105
+ "ioredis": "^4.28.5",
106
+ "lightship": "^6.7.2",
107
+ "luxon": "^2.3.2",
108
+ "moment-timezone": "^0.5.26",
109
+ "mongodb-restore-dump": "1.0.1",
110
+ "mongoose": "^6.5.3",
111
+ "morgan": "^1.10.0",
112
+ "opentelemetry-instrumentation-mongoose": "^0.27.1",
113
+ "opentelemetry-instrumentation-sequelize": "^0.27.1",
114
+ "path-to-regexp": "^6.2.0",
115
+ "pg": "^8.6.0",
116
+ "prom-client": "^14.0.0",
117
+ "request": "2.88.0",
118
+ "request-promise": "^4.2.5",
119
+ "sequelize": "^6.21.2",
120
+ "ssh2-sftp-client": "^7.1.0",
121
+ "winston": "^3.3.3",
122
+ "xml2js-es6-promise": "^1.1.1"
123
+ },
124
+ "resolutions": {}
127
125
  }