@golemio/core 1.2.25-dev.723880707 → 1.2.25-dev.724698177
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/dist/helpers/connector/interfaces/IQueueConnector.d.ts +8 -0
- package/dist/helpers/connector/interfaces/IQueueConnector.js +3 -0
- package/dist/helpers/connector/interfaces/IQueueConnector.js.map +1 -0
- package/dist/helpers/ioc/Di.d.ts +2 -0
- package/dist/helpers/ioc/Di.js +7 -0
- package/dist/helpers/ioc/Di.js.map +1 -0
- package/dist/helpers/ioc/index.d.ts +1 -0
- package/dist/helpers/ioc/index.js +18 -0
- package/dist/helpers/ioc/index.js.map +1 -0
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.js +6 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/input-gateway/config/InputGatewayConfiguration.d.ts +52 -0
- package/dist/input-gateway/config/InputGatewayConfiguration.js +77 -0
- package/dist/input-gateway/config/InputGatewayConfiguration.js.map +1 -0
- package/dist/input-gateway/config/abstract.d.ts +1 -2
- package/dist/input-gateway/config/config.d.ts +3 -0
- package/dist/input-gateway/config/config.js +5 -56
- package/dist/input-gateway/config/config.js.map +1 -1
- package/dist/input-gateway/connectors/AMQPConnector.d.ts +11 -24
- package/dist/input-gateway/connectors/AMQPConnector.js +45 -39
- package/dist/input-gateway/connectors/AMQPConnector.js.map +1 -1
- package/dist/input-gateway/connectors/index.d.ts +6 -1
- package/dist/input-gateway/connectors/index.js +4 -15
- package/dist/input-gateway/connectors/index.js.map +1 -1
- package/dist/input-gateway/controllers/BaseController.js +2 -2
- package/dist/input-gateway/controllers/BaseController.js.map +1 -1
- package/dist/input-gateway/helpers/Logger.d.ts +16 -20
- package/dist/input-gateway/helpers/Logger.js +16 -38
- package/dist/input-gateway/helpers/Logger.js.map +1 -1
- package/dist/input-gateway/helpers/LoggerEvents.d.ts +11 -0
- package/dist/input-gateway/helpers/LoggerEvents.js +55 -0
- package/dist/input-gateway/helpers/LoggerEvents.js.map +1 -0
- package/dist/input-gateway/helpers/index.d.ts +3 -0
- package/dist/input-gateway/helpers/index.js +5 -0
- package/dist/input-gateway/helpers/index.js.map +1 -1
- package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.d.ts +5 -0
- package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.js +3 -0
- package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.js.map +1 -0
- package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.d.ts +6 -0
- package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.js +3 -0
- package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.js.map +1 -0
- package/dist/input-gateway/ioc/ContainerToken.d.ts +8 -0
- package/dist/input-gateway/ioc/ContainerToken.js +12 -0
- package/dist/input-gateway/ioc/ContainerToken.js.map +1 -0
- package/dist/input-gateway/ioc/Di.d.ts +2 -0
- package/dist/input-gateway/ioc/Di.js +32 -0
- package/dist/input-gateway/ioc/Di.js.map +1 -0
- package/dist/input-gateway/ioc/index.d.ts +2 -0
- package/dist/input-gateway/ioc/index.js +19 -0
- package/dist/input-gateway/ioc/index.js.map +1 -0
- package/dist/integration-engine/config/IntegrationEngineConfiguration.d.ts +78 -0
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js +109 -0
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js.map +1 -0
- package/dist/integration-engine/config/config.d.ts +5 -1
- package/dist/integration-engine/config/config.js +6 -88
- package/dist/integration-engine/config/config.js.map +1 -1
- package/dist/integration-engine/connectors/AMQPConnector.d.ts +12 -5
- package/dist/integration-engine/connectors/AMQPConnector.js +59 -35
- package/dist/integration-engine/connectors/AMQPConnector.js.map +1 -1
- package/dist/integration-engine/connectors/MongoConnector.d.ts +9 -3
- package/dist/integration-engine/connectors/MongoConnector.js +36 -14
- package/dist/integration-engine/connectors/MongoConnector.js.map +1 -1
- package/dist/integration-engine/connectors/PostgresConnector.d.ts +12 -3
- package/dist/integration-engine/connectors/PostgresConnector.js +40 -16
- package/dist/integration-engine/connectors/PostgresConnector.js.map +1 -1
- package/dist/integration-engine/connectors/RedisConnector.d.ts +9 -3
- package/dist/integration-engine/connectors/RedisConnector.js +32 -10
- package/dist/integration-engine/connectors/RedisConnector.js.map +1 -1
- package/dist/integration-engine/connectors/index.d.ts +24 -4
- package/dist/integration-engine/connectors/index.js +22 -19
- package/dist/integration-engine/connectors/index.js.map +1 -1
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.d.ts +7 -0
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.js +3 -0
- package/dist/integration-engine/connectors/interfaces/IMongoConnector.js.map +1 -0
- package/dist/integration-engine/connectors/interfaces/IPostgresConnector.d.ts +7 -0
- package/dist/integration-engine/connectors/interfaces/IPostgresConnector.js +3 -0
- package/dist/integration-engine/connectors/interfaces/IPostgresConnector.js.map +1 -0
- package/dist/integration-engine/connectors/interfaces/IRedisConnector.d.ts +7 -0
- package/dist/integration-engine/connectors/interfaces/IRedisConnector.js +3 -0
- package/dist/integration-engine/connectors/interfaces/IRedisConnector.js.map +1 -0
- package/dist/integration-engine/data-access/RawDataStorage.d.ts +11 -0
- package/dist/integration-engine/data-access/RawDataStorage.js +81 -0
- package/dist/integration-engine/data-access/RawDataStorage.js.map +1 -0
- package/dist/integration-engine/data-access/StorageService.d.ts +10 -4
- package/dist/integration-engine/data-access/StorageService.js +40 -18
- package/dist/integration-engine/data-access/StorageService.js.map +1 -1
- package/dist/integration-engine/data-access/index.d.ts +6 -1
- package/dist/integration-engine/data-access/index.js +7 -15
- package/dist/integration-engine/data-access/index.js.map +1 -1
- package/dist/integration-engine/data-access/interfaces/IStorageService.d.ts +3 -0
- package/dist/integration-engine/data-access/interfaces/IStorageService.js +3 -0
- package/dist/integration-engine/data-access/interfaces/IStorageService.js.map +1 -0
- package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js +2 -2
- package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js +6 -4
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.d.ts +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js +4 -3
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js.map +1 -1
- package/dist/integration-engine/helpers/GeocodeApi.d.ts +8 -3
- package/dist/integration-engine/helpers/GeocodeApi.js +32 -11
- package/dist/integration-engine/helpers/GeocodeApi.js.map +1 -1
- package/dist/integration-engine/helpers/Logger.d.ts +16 -10
- package/dist/integration-engine/helpers/Logger.js +13 -71
- package/dist/integration-engine/helpers/Logger.js.map +1 -1
- package/dist/integration-engine/helpers/LoggerEvents.d.ts +11 -0
- package/dist/integration-engine/helpers/LoggerEvents.js +91 -0
- package/dist/integration-engine/helpers/LoggerEvents.js.map +1 -0
- package/dist/integration-engine/helpers/RawDataStore.d.ts +3 -0
- package/dist/integration-engine/helpers/RawDataStore.js +5 -39
- package/dist/integration-engine/helpers/RawDataStore.js.map +1 -1
- package/dist/integration-engine/helpers/index.d.ts +8 -2
- package/dist/integration-engine/helpers/index.js +10 -2
- package/dist/integration-engine/helpers/index.js.map +1 -1
- package/dist/integration-engine/ioc/ContainerToken.d.ts +14 -0
- package/dist/integration-engine/ioc/ContainerToken.js +18 -0
- package/dist/integration-engine/ioc/ContainerToken.js.map +1 -0
- package/dist/integration-engine/ioc/Di.d.ts +2 -0
- package/dist/integration-engine/ioc/Di.js +46 -0
- package/dist/integration-engine/ioc/Di.js.map +1 -0
- package/dist/integration-engine/ioc/index.d.ts +2 -0
- package/dist/integration-engine/ioc/index.js +19 -0
- package/dist/integration-engine/ioc/index.js.map +1 -0
- package/dist/integration-engine/models/MongoModel.js +6 -6
- package/dist/integration-engine/models/MongoModel.js.map +1 -1
- package/dist/integration-engine/models/PostgresModel.d.ts +3 -1
- package/dist/integration-engine/models/PostgresModel.js +19 -14
- package/dist/integration-engine/models/PostgresModel.js.map +1 -1
- package/dist/integration-engine/models/RedisModel.js +2 -2
- package/dist/integration-engine/models/RedisModel.js.map +1 -1
- package/dist/output-gateway/Logger.d.ts +10 -2
- package/dist/output-gateway/Logger.js +9 -8
- package/dist/output-gateway/Logger.js.map +1 -1
- package/dist/output-gateway/config/OutputGatewayConfiguration.d.ts +51 -0
- package/dist/output-gateway/config/OutputGatewayConfiguration.js +90 -0
- package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -0
- package/dist/output-gateway/config/config.d.ts +5 -48
- package/dist/output-gateway/config/config.js +5 -69
- package/dist/output-gateway/config/config.js.map +1 -1
- package/dist/output-gateway/database/MongoDatabase.d.ts +7 -4
- package/dist/output-gateway/database/MongoDatabase.js +37 -16
- package/dist/output-gateway/database/MongoDatabase.js.map +1 -1
- package/dist/output-gateway/database/PostgreDatabase.d.ts +20 -3
- package/dist/output-gateway/database/PostgreDatabase.js +40 -17
- package/dist/output-gateway/database/PostgreDatabase.js.map +1 -1
- package/dist/output-gateway/database/index.d.ts +64 -1
- package/dist/output-gateway/database/index.js +17 -1
- package/dist/output-gateway/database/index.js.map +1 -1
- package/dist/output-gateway/ioc/ContainerToken.d.ts +13 -0
- package/dist/output-gateway/ioc/ContainerToken.js +17 -0
- package/dist/output-gateway/ioc/ContainerToken.js.map +1 -0
- package/dist/output-gateway/ioc/Di.d.ts +2 -0
- package/dist/output-gateway/ioc/Di.js +40 -0
- package/dist/output-gateway/ioc/Di.js.map +1 -0
- package/dist/output-gateway/ioc/index.d.ts +2 -0
- package/dist/output-gateway/ioc/index.js +19 -0
- package/dist/output-gateway/ioc/index.js.map +1 -0
- package/dist/output-gateway/models/GeoJsonModel.d.ts +1 -0
- package/dist/output-gateway/models/GeoJsonModel.js +7 -6
- package/dist/output-gateway/models/GeoJsonModel.js.map +1 -1
- package/dist/output-gateway/models/SequelizeModel.js +2 -2
- package/dist/output-gateway/models/SequelizeModel.js.map +1 -1
- package/dist/output-gateway/redis/CacheMiddleware.d.ts +9 -5
- package/dist/output-gateway/redis/CacheMiddleware.js +36 -17
- package/dist/output-gateway/redis/CacheMiddleware.js.map +1 -1
- package/dist/output-gateway/redis/RedisConnector.d.ts +6 -3
- package/dist/output-gateway/redis/RedisConnector.js +33 -13
- package/dist/output-gateway/redis/RedisConnector.js.map +1 -1
- package/dist/output-gateway/redis/index.d.ts +15 -1
- package/dist/output-gateway/redis/index.js +16 -1
- package/dist/output-gateway/redis/index.js.map +1 -1
- package/dist/shared/pino.d.ts +2 -0
- package/dist/shared/pino.js +29 -0
- package/dist/shared/pino.js.map +1 -0
- package/dist/shared/tsyringe.d.ts +1 -0
- package/dist/shared/tsyringe.js +18 -0
- package/dist/shared/tsyringe.js.map +1 -0
- package/package.json +3 -2
package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js
CHANGED
|
@@ -10,11 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PostgresProtocolStrategyStreamed = void 0;
|
|
13
|
-
const errors_1 = require("@golemio/errors");
|
|
14
13
|
const config_1 = require("../../config");
|
|
15
|
-
const
|
|
14
|
+
const PostgresConnector_1 = require("../../connectors/PostgresConnector");
|
|
16
15
|
const datasources_1 = require("./..");
|
|
17
16
|
const PostgresProtocolStrategy_1 = require("./PostgresProtocolStrategy");
|
|
17
|
+
const helpers_1 = require("../../helpers");
|
|
18
|
+
const errors_1 = require("@golemio/errors");
|
|
18
19
|
class PostgresProtocolStrategyStreamed extends PostgresProtocolStrategy_1.PostgresProtocolStrategy {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -34,7 +35,7 @@ class PostgresProtocolStrategyStreamed extends PostgresProtocolStrategy_1.Postgr
|
|
|
34
35
|
batchLimit = +config_1.config.DATA_BATCH_SIZE;
|
|
35
36
|
}
|
|
36
37
|
try {
|
|
37
|
-
const connector = new
|
|
38
|
+
const connector = new PostgresConnector_1.PostgresConnector(config_1.config, helpers_1.log); //TODO zeptat se k čemu se používá
|
|
38
39
|
const connection = yield connector.connect(this.connectionSettings.connectionString);
|
|
39
40
|
dbConnectionOpened = true;
|
|
40
41
|
const model = connection.define(this.connectionSettings.tableName, this.connectionSettings.modelAttributes, Object.assign(Object.assign({}, (this.connectionSettings.sequelizeAdditionalSettings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresProtocolStrategyStreamed.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"PostgresProtocolStrategyStreamed.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAoC;AACpC,0EAAqE;AACrE,sCAAmD;AAEnD,yEAAsG;AACtG,2CAAkC;AAClC,4CAA8C;AAE9C,MAAa,gCAAiC,SAAQ,mDAAwB;IAA9E;;QACW,eAAU,GAAG,GAAuB,EAAE;YACzC,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC;YAExD,IAAI,UAAkB,CAAC;YACvB,IAAI,kBAAkB,GAAG,KAAK,CAAC;YAC/B,IAAI,MAAM,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;YACrE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;YAChE,IAAI,UAAU,GAAG,KAAK,CAAC;YACvB,IAAI,YAAY,GAAG,CAAC,CAAC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uC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aAC1G;QACL,CAAC,CAAA,CAAC;IACN,CAAC;CAAA;AA5FD,4EA4FC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ILogger } from "../../helpers";
|
|
2
|
+
import { IConfiguration } from "../config";
|
|
1
3
|
export interface IPostalAddress {
|
|
2
4
|
address_formatted: string;
|
|
3
5
|
street_address?: string;
|
|
@@ -9,7 +11,12 @@ export interface IPostalAddress {
|
|
|
9
11
|
/**
|
|
10
12
|
* Helper class for requesting additional data from OpenStreetMap API.
|
|
11
13
|
*/
|
|
12
|
-
declare class GeocodeApi {
|
|
14
|
+
export declare class GeocodeApi {
|
|
15
|
+
private readonly log;
|
|
16
|
+
private openStreetApiUrlSearch;
|
|
17
|
+
private openStreetApiUrlReverse;
|
|
18
|
+
private photonApiUrlReverse;
|
|
19
|
+
constructor(config: IConfiguration, log: ILogger);
|
|
13
20
|
/**
|
|
14
21
|
* Gets Address by Coordinates by OpenStreetMap API.
|
|
15
22
|
*
|
|
@@ -32,5 +39,3 @@ declare class GeocodeApi {
|
|
|
32
39
|
*/
|
|
33
40
|
getAddressByLatLngFromPhoton: (lat: number, lng: number) => Promise<IPostalAddress>;
|
|
34
41
|
}
|
|
35
|
-
declare const geocodeApi: GeocodeApi;
|
|
36
|
-
export { geocodeApi as GeocodeApi };
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
16
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -13,15 +25,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
25
|
};
|
|
14
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
27
|
exports.GeocodeApi = void 0;
|
|
28
|
+
const ioc_1 = require("../ioc");
|
|
16
29
|
const errors_1 = require("@golemio/errors");
|
|
17
30
|
const axios_1 = __importDefault(require("axios"));
|
|
18
|
-
const
|
|
19
|
-
const helpers_1 = require("./");
|
|
31
|
+
const tsyringe_1 = require("tsyringe");
|
|
20
32
|
/**
|
|
21
33
|
* Helper class for requesting additional data from OpenStreetMap API.
|
|
22
34
|
*/
|
|
23
|
-
class GeocodeApi {
|
|
24
|
-
constructor() {
|
|
35
|
+
let GeocodeApi = class GeocodeApi {
|
|
36
|
+
constructor(config, log) {
|
|
37
|
+
this.log = log;
|
|
25
38
|
/**
|
|
26
39
|
* Gets Address by Coordinates by OpenStreetMap API.
|
|
27
40
|
*
|
|
@@ -34,7 +47,7 @@ class GeocodeApi {
|
|
|
34
47
|
"Cache-Control": "no-cache",
|
|
35
48
|
Referer: "https://www.golemio.cz",
|
|
36
49
|
},
|
|
37
|
-
url:
|
|
50
|
+
url: this.openStreetApiUrlReverse + "&lat=" + lat + "&lon=" + lng,
|
|
38
51
|
};
|
|
39
52
|
try {
|
|
40
53
|
const resp = yield axios_1.default.request(options);
|
|
@@ -84,7 +97,7 @@ class GeocodeApi {
|
|
|
84
97
|
"Cache-Control": "no-cache",
|
|
85
98
|
Referer: "https://www.golemio.cz",
|
|
86
99
|
},
|
|
87
|
-
url:
|
|
100
|
+
url: this.openStreetApiUrlSearch + "&street=" + encodeURI(street) + "&city=" + encodeURI(city),
|
|
88
101
|
};
|
|
89
102
|
try {
|
|
90
103
|
const resp = yield axios_1.default.request(options);
|
|
@@ -95,7 +108,7 @@ class GeocodeApi {
|
|
|
95
108
|
return [parseFloat(result[0].lon), parseFloat(result[0].lat)];
|
|
96
109
|
}
|
|
97
110
|
catch (err) {
|
|
98
|
-
|
|
111
|
+
this.log.error(err);
|
|
99
112
|
throw new errors_1.CustomError("Retrieving of the open street map nominatim data failed.", true, this.constructor.name, 6002, err);
|
|
100
113
|
}
|
|
101
114
|
});
|
|
@@ -107,7 +120,7 @@ class GeocodeApi {
|
|
|
107
120
|
*/
|
|
108
121
|
this.getAddressByLatLngFromPhoton = (lat, lng) => __awaiter(this, void 0, void 0, function* () {
|
|
109
122
|
const options = {
|
|
110
|
-
url:
|
|
123
|
+
url: this.photonApiUrlReverse,
|
|
111
124
|
params: {
|
|
112
125
|
lon: lng,
|
|
113
126
|
lat: lat,
|
|
@@ -139,8 +152,16 @@ class GeocodeApi {
|
|
|
139
152
|
throw new errors_1.CustomError("Retrieving address from Photon failed.", true, this.constructor.name, 6002, err);
|
|
140
153
|
}
|
|
141
154
|
});
|
|
155
|
+
this.openStreetApiUrlReverse = config.OPEN_STREET_MAP_API_URL_REVERSE;
|
|
156
|
+
this.openStreetApiUrlSearch = config.OPEN_STREET_MAP_API_URL_SEARCH;
|
|
157
|
+
this.photonApiUrlReverse = config.PHOTON_MAP_API_URL_REVERSE;
|
|
142
158
|
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
159
|
+
};
|
|
160
|
+
GeocodeApi = __decorate([
|
|
161
|
+
(0, tsyringe_1.injectable)(),
|
|
162
|
+
__param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Config)),
|
|
163
|
+
__param(1, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Logger)),
|
|
164
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
165
|
+
], GeocodeApi);
|
|
166
|
+
exports.GeocodeApi = GeocodeApi;
|
|
146
167
|
//# sourceMappingURL=GeocodeApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeocodeApi.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/GeocodeApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GeocodeApi.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/GeocodeApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gCAAyC;AACzC,4CAA8C;AAC9C,kDAA0B;AAC1B,uCAA8C;AAW9C;;GAEG;AAEH,IAAa,UAAU,GAAvB,MAAa,UAAU;IAKnB,YACmC,MAAsB,EACL,GAAY;QAAZ,QAAG,GAAH,GAAG,CAAS;QAOhE;;;;;WAKG;QACI,uBAAkB,GAAG,CAAO,GAAW,EAAE,GAAW,EAA2B,EAAE;YACpF,MAAM,OAAO,GAAG;gBACZ,OAAO,EAAE;oBACL,eAAe,EAAE,UAAU;oBAC3B,OAAO,EAAE,wBAAwB;iBACpC;gBACD,GAAG,EAAE,IAAI,CAAC,uBAAuB,GAAG,OAAO,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG;aACpE,CAAC;YAEF,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBACrC,IAAI,OAAO,GAAG;oBACV,eAAe,EAAE,EAAE;oBACnB,iBAAiB,EAAE,EAAE;iBACxB,C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;oBAC5C,cAAc,EAAE,sBAAsB,CAAC,MAAM;iBAChD,CAAC;gBAEF,OAAO,OAAO,CAAC;aAClB;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,oBAAW,CAAC,wCAAwC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aAC3G;QACL,CAAC,CAAA,CAAC;QAjJE,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,+BAA+B,CAAC;QACtE,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,8BAA8B,CAAC;QACpE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,0BAA0B,CAAC;IACjE,CAAC;CA+IJ,CAAA;AA3JY,UAAU;IADtB,IAAA,qBAAU,GAAE;IAOJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;;GAPzB,UAAU,CA2JtB;AA3JY,gCAAU"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ILogger } from "../../helpers/logger";
|
|
2
|
+
import { HttpLogger } from "pino-http";
|
|
3
|
+
import LoggerEvents from "./LoggerEvents";
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
6
|
+
*/
|
|
7
|
+
declare const log: ILogger;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
10
|
+
*/
|
|
11
|
+
declare const loggerEvents: LoggerEvents;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
14
|
+
*/
|
|
15
|
+
declare const requestLogger: HttpLogger;
|
|
16
|
+
export { log, loggerEvents, requestLogger };
|
|
@@ -1,78 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.requestLogger = exports.
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const models_1 = require("../models");
|
|
20
|
-
var LoggerEventType;
|
|
21
|
-
(function (LoggerEventType) {
|
|
22
|
-
LoggerEventType["NumberOfRecords"] = "number-of-records";
|
|
23
|
-
LoggerEventType["PostgresErrorLog"] = "postgres-error-log";
|
|
24
|
-
})(LoggerEventType || (LoggerEventType = {}));
|
|
25
|
-
exports.LoggerEventType = LoggerEventType;
|
|
26
|
-
const logger = (0, logger_1.createLogger)({
|
|
27
|
-
projectName: "integration-engine",
|
|
28
|
-
nodeEnv: config_1.config.NODE_ENV,
|
|
29
|
-
logLevel: config_1.config.LOG_LEVEL,
|
|
30
|
-
});
|
|
31
|
-
exports.log = logger;
|
|
32
|
-
const requestLogger = (0, logger_1.createRequestLogger)(config_1.config.NODE_ENV, logger);
|
|
33
|
-
exports.requestLogger = requestLogger;
|
|
34
|
-
const loggerEvents = new events_1.EventEmitter();
|
|
35
|
-
exports.loggerEvents = loggerEvents;
|
|
36
|
-
loggerEvents.on(LoggerEventType.NumberOfRecords, ({ name, numberOfRecords }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
logger.verbose(`NumberOfRecordsLogger: ${name} : ${numberOfRecords}`);
|
|
38
|
-
}));
|
|
39
|
-
loggerEvents.on("error", (error) => {
|
|
40
|
-
errors_1.ErrorHandler.handle(error, logger);
|
|
41
|
-
});
|
|
3
|
+
exports.requestLogger = exports.loggerEvents = exports.log = void 0;
|
|
4
|
+
const ioc_1 = require("../ioc");
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
7
|
+
*/
|
|
8
|
+
const log = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.Logger);
|
|
9
|
+
exports.log = log;
|
|
42
10
|
/**
|
|
43
|
-
*
|
|
11
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
44
12
|
*/
|
|
45
|
-
|
|
13
|
+
const loggerEvents = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.LoggerEvents);
|
|
14
|
+
exports.loggerEvents = loggerEvents;
|
|
46
15
|
/**
|
|
47
|
-
*
|
|
16
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
48
17
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
pgErrorLogModel = new models_1.PostgresModel(ErrorLog_1.ErrorLog.name + "Model", {
|
|
52
|
-
outputSequelizeAttributes: ErrorLog_1.ErrorLog.outputSequelizeAttributes,
|
|
53
|
-
pgTableName: ErrorLog_1.ErrorLog.pgTableName,
|
|
54
|
-
savingType: "insertOnly",
|
|
55
|
-
}, new validator_1.Validator(ErrorLog_1.ErrorLog.name + "ModelValidator", ErrorLog_1.ErrorLog.outputMongooseSchemaObject));
|
|
56
|
-
}
|
|
57
|
-
try {
|
|
58
|
-
const transformedData = {
|
|
59
|
-
class_name: null,
|
|
60
|
-
info: null,
|
|
61
|
-
message: error.message,
|
|
62
|
-
service: "integration-engine",
|
|
63
|
-
stack_trace: error.stack || null,
|
|
64
|
-
status: null,
|
|
65
|
-
};
|
|
66
|
-
if (error instanceof errors_1.CustomError) {
|
|
67
|
-
const errorObject = error.toObject();
|
|
68
|
-
transformedData.class_name = errorObject.error_class_name || null;
|
|
69
|
-
transformedData.info = errorObject.error_info || null;
|
|
70
|
-
transformedData.status = errorObject.error_status || null;
|
|
71
|
-
}
|
|
72
|
-
yield pgErrorLogModel.save(transformedData);
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
loggerEvents.emit(err);
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
18
|
+
const requestLogger = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.RequestLogger);
|
|
19
|
+
exports.requestLogger = requestLogger;
|
|
78
20
|
//# sourceMappingURL=Logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/Logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/Logger.ts"],"names":[],"mappings":";;;AACA,gCAAqE;AAIrE;;GAEG;AACH,MAAM,GAAG,GAAG,gCAA0B,CAAC,OAAO,CAAU,oBAAc,CAAC,MAAM,CAAC,CAAC;AAUtE,kBAAG;AATZ;;GAEG;AACH,MAAM,YAAY,GAAG,gCAA0B,CAAC,OAAO,CAAe,oBAAc,CAAC,YAAY,CAAC,CAAC;AAMrF,oCAAY;AAL1B;;GAEG;AACH,MAAM,aAAa,GAAG,gCAA0B,CAAC,OAAO,CAAa,oBAAc,CAAC,aAAa,CAAC,CAAC;AAEvE,sCAAa"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ILogger } from "../../helpers/logger";
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
|
+
export declare enum LoggerEventType {
|
|
5
|
+
NumberOfRecords = "number-of-records",
|
|
6
|
+
PostgresErrorLog = "postgres-error-log"
|
|
7
|
+
}
|
|
8
|
+
export default class LoggerEvents extends EventEmitter {
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(logger: ILogger);
|
|
11
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.LoggerEventType = void 0;
|
|
25
|
+
const PostgresModel_1 = require("../models/PostgresModel");
|
|
26
|
+
const ioc_1 = require("../ioc");
|
|
27
|
+
const ErrorLog_1 = require("../../schema-definitions/ErrorLog");
|
|
28
|
+
const errors_1 = require("@golemio/errors");
|
|
29
|
+
const validator_1 = require("@golemio/validator");
|
|
30
|
+
const events_1 = require("events");
|
|
31
|
+
const tsyringe_1 = require("tsyringe");
|
|
32
|
+
var LoggerEventType;
|
|
33
|
+
(function (LoggerEventType) {
|
|
34
|
+
LoggerEventType["NumberOfRecords"] = "number-of-records";
|
|
35
|
+
LoggerEventType["PostgresErrorLog"] = "postgres-error-log";
|
|
36
|
+
})(LoggerEventType = exports.LoggerEventType || (exports.LoggerEventType = {}));
|
|
37
|
+
let LoggerEvents = class LoggerEvents extends events_1.EventEmitter {
|
|
38
|
+
constructor(logger) {
|
|
39
|
+
super();
|
|
40
|
+
this.logger = logger;
|
|
41
|
+
this.on(LoggerEventType.NumberOfRecords, ({ name, numberOfRecords }) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
this.logger.verbose(`NumberOfRecordsLogger: ${name} : ${numberOfRecords}`);
|
|
43
|
+
}));
|
|
44
|
+
this.on("error", (error) => {
|
|
45
|
+
errors_1.ErrorHandler.handle(error, this.logger);
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Postgres Error Log Model
|
|
49
|
+
*/
|
|
50
|
+
let pgErrorLogModel;
|
|
51
|
+
/**
|
|
52
|
+
* Postgres Error Log
|
|
53
|
+
*/
|
|
54
|
+
this.on(LoggerEventType.PostgresErrorLog, ({ error }) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
if (!pgErrorLogModel) {
|
|
56
|
+
pgErrorLogModel = new PostgresModel_1.PostgresModel(ErrorLog_1.ErrorLog.name + "Model", {
|
|
57
|
+
outputSequelizeAttributes: ErrorLog_1.ErrorLog.outputSequelizeAttributes,
|
|
58
|
+
pgTableName: ErrorLog_1.ErrorLog.pgTableName,
|
|
59
|
+
savingType: "insertOnly",
|
|
60
|
+
}, new validator_1.Validator(ErrorLog_1.ErrorLog.name + "ModelValidator", ErrorLog_1.ErrorLog.outputMongooseSchemaObject));
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const transformedData = {
|
|
64
|
+
class_name: null,
|
|
65
|
+
info: null,
|
|
66
|
+
message: error.message,
|
|
67
|
+
service: "integration-engine",
|
|
68
|
+
stack_trace: error.stack || null,
|
|
69
|
+
status: null,
|
|
70
|
+
};
|
|
71
|
+
if (error instanceof errors_1.CustomError) {
|
|
72
|
+
const errorObject = error.toObject();
|
|
73
|
+
transformedData.class_name = errorObject.error_class_name || null;
|
|
74
|
+
transformedData.info = errorObject.error_info || null;
|
|
75
|
+
transformedData.status = errorObject.error_status || null;
|
|
76
|
+
}
|
|
77
|
+
yield pgErrorLogModel.save(transformedData);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
this.emit(err);
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
LoggerEvents = __decorate([
|
|
86
|
+
(0, tsyringe_1.injectable)(),
|
|
87
|
+
__param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Logger)),
|
|
88
|
+
__metadata("design:paramtypes", [Object])
|
|
89
|
+
], LoggerEvents);
|
|
90
|
+
exports.default = LoggerEvents;
|
|
91
|
+
//# sourceMappingURL=LoggerEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoggerEvents.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/LoggerEvents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,2DAAyD;AACzD,gCAAyC;AACzC,gEAAyC;AACzC,4CAA4D;AAC5D,kDAA+C;AAC/C,mCAAsC;AACtC,uCAA8C;AAE9C,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,w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AE,oBAAoB;oBAC7B,WAAW,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI;oBAChC,MAAM,EAAE,IAAI;iBACf,CAAC;gBAEF,IAAI,KAAK,YAAY,oBAAW,EAAE;oBAC9B,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACrC,eAAe,CAAC,UAAU,GAAG,WAAW,CAAC,gBAAgB,IAAI,IAAI,CAAC;oBAClE,eAAe,CAAC,IAAI,GAAG,WAAW,CAAC,UAAU,IAAI,IAAI,CAAC;oBACtD,eAAe,CAAC,MAAM,GAAG,WAAW,CAAC,YAAY,IAAI,IAAI,CAAC;iBAC7D;gBAED,MAAM,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC/C;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAClB;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAtDoB,YAAY;IADhC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;;GADzB,YAAY,CAsDhC;kBAtDoB,YAAY"}
|
|
@@ -8,48 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.save = void 0;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const data_access_1 = require("../data-access");
|
|
13
|
+
const ioc_1 = require("../ioc");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
16
|
+
*/
|
|
21
17
|
const save = (data, meta, name = "Unknown") => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
helpers_1.log.verbose(`Raw data S3 upload not enabled for \`${name}\` datasource.`);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const now = (0, moment_timezone_1.default)().tz("Europe/Prague");
|
|
27
|
-
let ext = null;
|
|
28
|
-
let headers = null;
|
|
29
|
-
if (meta.headers) {
|
|
30
|
-
try {
|
|
31
|
-
headers = JSON.stringify(meta.headers, null, 2);
|
|
32
|
-
}
|
|
33
|
-
catch (_a) {
|
|
34
|
-
null;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const parsedMediaType = content_type_1.default.parse(meta.headers["content-type"]);
|
|
38
|
-
if (parsedMediaType === null || parsedMediaType === void 0 ? void 0 : parsedMediaType.type) {
|
|
39
|
-
ext = helpers_1.contentTypeToExtension[parsedMediaType.type];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (_b) {
|
|
43
|
-
null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const fileName = `${now.format("YYYY-MM-DD")}/${now.format("HH_mm_ss.SSS")}`;
|
|
47
|
-
// Save data
|
|
48
|
-
yield data_access_1.storageService.saveData(data, name, ext !== null && ext !== void 0 ? ext : "", fileName);
|
|
49
|
-
if (config_1.config.saveRawDataWhitelist[name].saveHeaders && headers && meta.statusCode && meta.statusCode !== 200) {
|
|
50
|
-
// Save headers
|
|
51
|
-
yield data_access_1.storageService.saveData(headers, name, "json", `${fileName}_headers`);
|
|
52
|
-
}
|
|
18
|
+
yield ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.RawDataStorage).save(data, meta, name);
|
|
53
19
|
});
|
|
54
20
|
exports.save = save;
|
|
55
21
|
//# sourceMappingURL=RawDataStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RawDataStore.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/RawDataStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RawDataStore.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/RawDataStore.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAAqE;AAErE;;GAEG;AACI,MAAM,IAAI,GAAG,CAAO,IAAS,EAAE,IAAS,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE;IACjE,MAAM,gCAA0B,CAAC,OAAO,CAAiB,oBAAc,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnH,CAAC,CAAA,CAAC;AAFW,QAAA,IAAI,QAEf"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { GeocodeApi, IPostalAddress } from "./GeocodeApi";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
4
|
+
*/
|
|
5
|
+
declare const geocodeApi: GeocodeApi;
|
|
1
6
|
export * from "./ContentTypeHelper";
|
|
2
|
-
export * from "./GeocodeApi";
|
|
3
7
|
export * from "./IntegrationErrorHandler";
|
|
4
|
-
export * from "./Logger";
|
|
5
8
|
export * from "./Jtsk2wgs84";
|
|
9
|
+
export * from "./Logger";
|
|
10
|
+
export { LoggerEventType } from "./LoggerEvents";
|
|
11
|
+
export { geocodeApi as GeocodeApi, IPostalAddress };
|
|
@@ -14,10 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.GeocodeApi = exports.LoggerEventType = void 0;
|
|
18
|
+
const ioc_1 = require("../ioc");
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
21
|
+
*/
|
|
22
|
+
const geocodeApi = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.GeocodeApi);
|
|
23
|
+
exports.GeocodeApi = geocodeApi;
|
|
17
24
|
/* ie/helpers/index.ts */
|
|
18
25
|
__exportStar(require("./ContentTypeHelper"), exports);
|
|
19
|
-
__exportStar(require("./GeocodeApi"), exports);
|
|
20
26
|
__exportStar(require("./IntegrationErrorHandler"), exports);
|
|
21
|
-
__exportStar(require("./Logger"), exports);
|
|
22
27
|
__exportStar(require("./Jtsk2wgs84"), exports);
|
|
28
|
+
__exportStar(require("./Logger"), exports);
|
|
29
|
+
var LoggerEvents_1 = require("./LoggerEvents");
|
|
30
|
+
Object.defineProperty(exports, "LoggerEventType", { enumerable: true, get: function () { return LoggerEvents_1.LoggerEventType; } });
|
|
23
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gCAAqE;AAGrE;;GAEG;AACH,MAAM,UAAU,GAAG,gCAA0B,CAAC,OAAO,CAAa,oBAAc,CAAC,UAAU,CAAC,CAAC;AAQtE,gCAAU;AANjC,yBAAyB;AACzB,sDAAoC;AACpC,4DAA0C;AAC1C,+CAA6B;AAC7B,2CAAyB;AACzB,+CAAiD;AAAxC,+GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const ContainerToken: {
|
|
2
|
+
Config: symbol;
|
|
3
|
+
Logger: symbol;
|
|
4
|
+
LoggerEvents: symbol;
|
|
5
|
+
RequestLogger: symbol;
|
|
6
|
+
AmqpConnector: symbol;
|
|
7
|
+
MongoConnector: symbol;
|
|
8
|
+
PostgresConnector: symbol;
|
|
9
|
+
RedisConnector: symbol;
|
|
10
|
+
StorageService: symbol;
|
|
11
|
+
GeocodeApi: symbol;
|
|
12
|
+
RawDataStorage: symbol;
|
|
13
|
+
};
|
|
14
|
+
export { ContainerToken };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContainerToken = void 0;
|
|
4
|
+
const ContainerToken = {
|
|
5
|
+
Config: Symbol(),
|
|
6
|
+
Logger: Symbol(),
|
|
7
|
+
LoggerEvents: Symbol(),
|
|
8
|
+
RequestLogger: Symbol(),
|
|
9
|
+
AmqpConnector: Symbol(),
|
|
10
|
+
MongoConnector: Symbol(),
|
|
11
|
+
PostgresConnector: Symbol(),
|
|
12
|
+
RedisConnector: Symbol(),
|
|
13
|
+
StorageService: Symbol(),
|
|
14
|
+
GeocodeApi: Symbol(),
|
|
15
|
+
RawDataStorage: Symbol(),
|
|
16
|
+
};
|
|
17
|
+
exports.ContainerToken = ContainerToken;
|
|
18
|
+
//# sourceMappingURL=ContainerToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContainerToken.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/ContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACnB,MAAM,EAAE,MAAM,EAAE;IAChB,MAAM,EAAE,MAAM,EAAE;IAChB,YAAY,EAAE,MAAM,EAAE;IACtB,aAAa,EAAE,MAAM,EAAE;IACvB,aAAa,EAAE,MAAM,EAAE;IACvB,cAAc,EAAE,MAAM,EAAE;IACxB,iBAAiB,EAAE,MAAM,EAAE;IAC3B,cAAc,EAAE,MAAM,EAAE;IACxB,cAAc,EAAE,MAAM,EAAE;IACxB,UAAU,EAAE,MAAM,EAAE;IACpB,cAAc,EAAE,MAAM,EAAE;CAC3B,CAAC;AAEO,wCAAc"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IntegrationEngineContainer = void 0;
|
|
7
|
+
const _helpers_1 = require("../../helpers");
|
|
8
|
+
const Di_1 = require("../../helpers/ioc/Di");
|
|
9
|
+
const IntegrationEngineConfiguration_1 = require("../config/IntegrationEngineConfiguration");
|
|
10
|
+
const AMQPConnector_1 = require("../connectors/AMQPConnector");
|
|
11
|
+
const MongoConnector_1 = require("../connectors/MongoConnector");
|
|
12
|
+
const PostgresConnector_1 = require("../connectors/PostgresConnector");
|
|
13
|
+
const RedisConnector_1 = require("../connectors/RedisConnector");
|
|
14
|
+
const RawDataStorage_1 = __importDefault(require("../data-access/RawDataStorage"));
|
|
15
|
+
const StorageService_1 = require("../data-access/StorageService");
|
|
16
|
+
const GeocodeApi_1 = require("../helpers/GeocodeApi");
|
|
17
|
+
const LoggerEvents_1 = __importDefault(require("../helpers/LoggerEvents"));
|
|
18
|
+
const tsyringe_1 = require("tsyringe");
|
|
19
|
+
const ContainerToken_1 = require("./ContainerToken");
|
|
20
|
+
//#region Initialization
|
|
21
|
+
const singletonOptions = { lifecycle: tsyringe_1.Lifecycle.Singleton };
|
|
22
|
+
const IntegrationEngineContainer = Di_1.GlobalContainer.createChildContainer();
|
|
23
|
+
exports.IntegrationEngineContainer = IntegrationEngineContainer;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region General
|
|
26
|
+
IntegrationEngineContainer.register(ContainerToken_1.ContainerToken.Config, { useClass: IntegrationEngineConfiguration_1.IntegrationEngineConfiguration }, singletonOptions);
|
|
27
|
+
const config = IntegrationEngineContainer.resolve(ContainerToken_1.ContainerToken.Config);
|
|
28
|
+
IntegrationEngineContainer.register(ContainerToken_1.ContainerToken.Logger, {
|
|
29
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => (0, _helpers_1.createLogger)({
|
|
30
|
+
projectName: "integration-engine",
|
|
31
|
+
nodeEnv: config.NODE_ENV,
|
|
32
|
+
logLevel: config.LOG_LEVEL,
|
|
33
|
+
})),
|
|
34
|
+
})
|
|
35
|
+
.register(ContainerToken_1.ContainerToken.LoggerEvents, { useClass: LoggerEvents_1.default }, singletonOptions)
|
|
36
|
+
.registerInstance(ContainerToken_1.ContainerToken.RequestLogger, (0, _helpers_1.createRequestLogger)(config.NODE_ENV, IntegrationEngineContainer.resolve(ContainerToken_1.ContainerToken.Logger)));
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region Data Access
|
|
39
|
+
IntegrationEngineContainer.register(ContainerToken_1.ContainerToken.AmqpConnector, { useClass: AMQPConnector_1.AMQPConnector }, singletonOptions)
|
|
40
|
+
.register(ContainerToken_1.ContainerToken.MongoConnector, { useClass: MongoConnector_1.MongoConnector }, singletonOptions)
|
|
41
|
+
.register(ContainerToken_1.ContainerToken.PostgresConnector, { useClass: PostgresConnector_1.PostgresConnector }, singletonOptions)
|
|
42
|
+
.register(ContainerToken_1.ContainerToken.RedisConnector, { useClass: RedisConnector_1.RedisConnector }, singletonOptions)
|
|
43
|
+
.register(ContainerToken_1.ContainerToken.StorageService, { useClass: StorageService_1.StorageService }, singletonOptions)
|
|
44
|
+
.register(ContainerToken_1.ContainerToken.GeocodeApi, { useClass: GeocodeApi_1.GeocodeApi }, singletonOptions)
|
|
45
|
+
.registerSingleton(ContainerToken_1.ContainerToken.RawDataStorage, RawDataStorage_1.default);
|
|
46
|
+
//# sourceMappingURL=Di.js.map
|