@golemio/core 1.18.1-dev.1592261843 → 1.18.1-dev.1622172793
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/DateTime.js +4 -5
- package/dist/helpers/DateTime.js.map +1 -1
- package/dist/helpers/HealthCheck.js +5 -14
- package/dist/helpers/HealthCheck.js.map +1 -1
- package/dist/helpers/configuration/SimpleConfig.js +4 -1
- package/dist/helpers/configuration/SimpleConfig.js.map +1 -1
- package/dist/helpers/data-access/amqp/AlternateExchangeCreator.js +4 -13
- package/dist/helpers/data-access/amqp/AlternateExchangeCreator.js.map +1 -1
- package/dist/helpers/data-access/amqp/AmqpConnector.js +28 -40
- package/dist/helpers/data-access/amqp/AmqpConnector.js.map +1 -1
- package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.js +2 -13
- package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.js.map +1 -1
- package/dist/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.js +9 -24
- package/dist/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.js.map +1 -1
- package/dist/helpers/data-access/postgres/DatabaseConnector.js +23 -25
- package/dist/helpers/data-access/postgres/DatabaseConnector.js.map +1 -1
- package/dist/helpers/data-access/postgres/repositories/AbstractCachedRepository.js +3 -12
- package/dist/helpers/data-access/postgres/repositories/AbstractCachedRepository.js.map +1 -1
- package/dist/helpers/data-access/pubsub/subscribers/RedisSubscriber.js +15 -30
- package/dist/helpers/data-access/pubsub/subscribers/RedisSubscriber.js.map +1 -1
- package/dist/helpers/data-access/redis/IoRedisConnector.js +8 -17
- package/dist/helpers/data-access/redis/IoRedisConnector.js.map +1 -1
- package/dist/helpers/data-access/storage/AzureBlobStorageService.js +64 -81
- package/dist/helpers/data-access/storage/AzureBlobStorageService.js.map +1 -1
- package/dist/helpers/data-access/storage/NoopStorageService.js +9 -26
- package/dist/helpers/data-access/storage/NoopStorageService.js.map +1 -1
- package/dist/helpers/data-access/table-storage/TableStorageServiceFactory.js +1 -2
- package/dist/helpers/data-access/table-storage/TableStorageServiceFactory.js.map +1 -1
- package/dist/helpers/data-access/table-storage/providers/AzureTableStorageService.js +39 -68
- package/dist/helpers/data-access/table-storage/providers/AzureTableStorageService.js.map +1 -1
- package/dist/helpers/data-access/table-storage/providers/NoopTableStorageService.js +4 -17
- package/dist/helpers/data-access/table-storage/providers/NoopTableStorageService.js.map +1 -1
- package/dist/helpers/logger/LoggerProvider.js +33 -14
- package/dist/helpers/logger/LoggerProvider.js.map +1 -1
- package/dist/helpers/logger/RequestLoggerProvider.js +1 -2
- package/dist/helpers/logger/RequestLoggerProvider.js.map +1 -1
- package/dist/helpers/routing/AbstractGeoJsonRouter.js +16 -34
- package/dist/helpers/routing/AbstractGeoJsonRouter.js.map +1 -1
- package/dist/input-gateway/config/InputGatewayConfiguration.js +1 -2
- package/dist/input-gateway/config/InputGatewayConfiguration.js.map +1 -1
- package/dist/input-gateway/connectors/AMQPConnector.js +52 -68
- package/dist/input-gateway/connectors/AMQPConnector.js.map +1 -1
- package/dist/input-gateway/controllers/BaseController.js +4 -13
- package/dist/input-gateway/controllers/BaseController.js.map +1 -1
- package/dist/integration-engine/connectors/AMQPConnector.js +28 -40
- package/dist/integration-engine/connectors/AMQPConnector.js.map +1 -1
- package/dist/integration-engine/data-access/RawDataStorage.js +7 -16
- package/dist/integration-engine/data-access/RawDataStorage.js.map +1 -1
- package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js +3 -14
- package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js.map +1 -1
- package/dist/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.js +12 -25
- package/dist/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.js.map +1 -1
- package/dist/integration-engine/datasources/DataSource.js +41 -60
- package/dist/integration-engine/datasources/DataSource.js.map +1 -1
- package/dist/integration-engine/datasources/DataSourceStream.js +12 -21
- package/dist/integration-engine/datasources/DataSourceStream.js.map +1 -1
- package/dist/integration-engine/datasources/DataSourceStreamManager.js +4 -13
- package/dist/integration-engine/datasources/DataSourceStreamManager.js.map +1 -1
- package/dist/integration-engine/datasources/DataSourceStreamed.js +37 -51
- package/dist/integration-engine/datasources/DataSourceStreamed.js.map +1 -1
- package/dist/integration-engine/datasources/RetryDataSource.js +25 -40
- package/dist/integration-engine/datasources/RetryDataSource.js.map +1 -1
- package/dist/integration-engine/datasources/datatype-strategy/CSVDataTypeStrategy.js +22 -33
- package/dist/integration-engine/datasources/datatype-strategy/CSVDataTypeStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/datatype-strategy/JSONDataTypeStrategy.js +14 -25
- package/dist/integration-engine/datasources/datatype-strategy/JSONDataTypeStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/datatype-strategy/XMLDataTypeStrategy.js +11 -22
- package/dist/integration-engine/datasources/datatype-strategy/XMLDataTypeStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/datatype-strategy/ZipFileDataTypeStrategy.js +33 -45
- package/dist/integration-engine/datasources/datatype-strategy/ZipFileDataTypeStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/FTPProtocolStrategy.js +17 -26
- package/dist/integration-engine/datasources/protocol-strategy/FTPProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/GoogleCloudStorageProtocolStrategy.js +10 -19
- package/dist/integration-engine/datasources/protocol-strategy/GoogleCloudStorageProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy.js +42 -51
- package/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategy.js +49 -62
- package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed.js +67 -81
- package/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PaginatedHTTPProtocolStrategy.js +29 -38
- package/dist/integration-engine/datasources/protocol-strategy/PaginatedHTTPProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js +37 -42
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js +29 -32
- package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/ProtocolStrategy.js +73 -88
- package/dist/integration-engine/datasources/protocol-strategy/ProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/SFTPProtocolStrategy.js +17 -26
- package/dist/integration-engine/datasources/protocol-strategy/SFTPProtocolStrategy.js.map +1 -1
- package/dist/integration-engine/datasources/protocol-strategy/helpers/FTPFileProcessor.js +37 -49
- package/dist/integration-engine/datasources/protocol-strategy/helpers/FTPFileProcessor.js.map +1 -1
- package/dist/integration-engine/helpers/FileCompressor.js +59 -76
- package/dist/integration-engine/helpers/FileCompressor.js.map +1 -1
- package/dist/integration-engine/helpers/GeocodeApi.js +20 -30
- package/dist/integration-engine/helpers/GeocodeApi.js.map +1 -1
- package/dist/integration-engine/helpers/IntegrationErrorHandler.js +3 -3
- package/dist/integration-engine/helpers/IntegrationErrorHandler.js.map +1 -1
- package/dist/integration-engine/helpers/PaginationHelper.js +1 -2
- package/dist/integration-engine/helpers/PaginationHelper.js.map +1 -1
- package/dist/integration-engine/models/PostgresModel.js +70 -75
- package/dist/integration-engine/models/PostgresModel.js.map +1 -1
- package/dist/integration-engine/models/RedisModel.js +28 -39
- package/dist/integration-engine/models/RedisModel.js.map +1 -1
- package/dist/integration-engine/queueprocessors/QueueProcessor.js +23 -28
- package/dist/integration-engine/queueprocessors/QueueProcessor.js.map +1 -1
- package/dist/integration-engine/transformations/BaseTransformation.js +8 -17
- package/dist/integration-engine/transformations/BaseTransformation.js.map +1 -1
- package/dist/integration-engine/workers/AbstractTask.js +7 -18
- package/dist/integration-engine/workers/AbstractTask.js.map +1 -1
- package/dist/integration-engine/workers/AbstractTaskJsonSchema.js +25 -38
- package/dist/integration-engine/workers/AbstractTaskJsonSchema.js.map +1 -1
- package/dist/integration-engine/workers/AbstractTaskWithoutValidation.js +2 -13
- package/dist/integration-engine/workers/AbstractTaskWithoutValidation.js.map +1 -1
- package/dist/integration-engine/workers/BaseWorker.js +4 -13
- package/dist/integration-engine/workers/BaseWorker.js.map +1 -1
- package/dist/integration-engine/workers/helpers/MessageDataParser.js +1 -2
- package/dist/integration-engine/workers/helpers/MessageDataParser.js.map +1 -1
- package/dist/integration-engine/workers/helpers/MessageDataValidator.js +18 -29
- package/dist/integration-engine/workers/helpers/MessageDataValidator.js.map +1 -1
- package/dist/integration-engine/workers/helpers/WebhookDecorators.js +1 -10
- package/dist/integration-engine/workers/helpers/WebhookDecorators.js.map +1 -1
- package/dist/integration-engine/workers/webhooks/CloudflareCachePurgeWebhook.js +13 -24
- package/dist/integration-engine/workers/webhooks/CloudflareCachePurgeWebhook.js.map +1 -1
- package/dist/monitoring/metrics/metrics-builder.js +21 -17
- package/dist/monitoring/metrics/metrics-builder.js.map +1 -1
- package/dist/monitoring/metrics/metrics-service.js +4 -14
- package/dist/monitoring/metrics/metrics-service.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/amqplib.js +1 -2
- package/dist/monitoring/opentelemetry/instrumentation/configs/amqplib.js.map +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/aws-sdk.js +1 -1
- package/dist/monitoring/opentelemetry/instrumentation/configs/aws-sdk.js.map +1 -1
- package/dist/monitoring/opentelemetry/trace-provider.js +8 -2
- package/dist/monitoring/opentelemetry/trace-provider.js.map +1 -1
- package/dist/monitoring/sentry/sentry-provider.js +1 -1
- package/dist/monitoring/sentry/sentry-provider.js.map +1 -1
- package/dist/monitoring/sentry/sentry-transactions.js +9 -19
- package/dist/monitoring/sentry/sentry-transactions.js.map +1 -1
- package/dist/output-gateway/Geo.js +3 -24
- package/dist/output-gateway/Geo.js.map +1 -1
- package/dist/output-gateway/config/OutputGatewayConfiguration.js +1 -2
- package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -1
- package/dist/output-gateway/database/index.js +3 -12
- package/dist/output-gateway/database/index.js.map +1 -1
- package/dist/output-gateway/ioc/Di.js +1 -10
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/models/SequelizeModel.js +4 -2
- package/dist/output-gateway/models/SequelizeModel.js.map +1 -1
- package/dist/output-gateway/routes/GeoJsonRouter.js +14 -32
- package/dist/output-gateway/routes/GeoJsonRouter.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.base.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AMQPConnector.js","sourceRoot":"","sources":["../../../src/integration-engine/connectors/AMQPConnector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AMQPConnector.js","sourceRoot":"","sources":["../../../src/integration-engine/connectors/AMQPConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,yGAA4E;AAC5E,uHAA0F;AAE1F,gCAAyC;AACzC,4CAAyE;AACzE,sDAA8B;AAC9B,uCAA0D;AAGnD,IAAM,aAAa,2BAAnB,MAAM,aAAa;IAQtB,YACmC,MAAsB,EACtB,GAA6B;QAAZ,QAAG,GAAH,GAAG,CAAS;QAQzD,YAAO,GAAG,KAAK,IAA8B,EAAE;YAClD,IAAI;gBACA,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,OAAO,IAAI,CAAC,OAAO,CAAC;iBACvB;gBAED,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;oBAC9B,MAAM,IAAI,qBAAY,CAAC,0DAA0D,EAAE,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;QACtE,CAAC,CAAC;QAEK,YAAO,GAAG,KAAK,IAAI,EAAE;YACxB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAC;QA3GE,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,oBAAqB,CAAC;QACvD,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,WAAW,CAAC;QACjD,IAAI,CAAC,6BAA6B,GAAG,MAAM,CAAC,iCAAiC,CAAC;IAClF,CAAC;CAwGJ,CAAA;wBAxHY,aAAa;IADzB,IAAA,qBAAU,GAAE;IAUJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;;GAVzB,aAAa,CAwHzB"}
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
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
14
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
16
|
};
|
|
@@ -35,7 +26,7 @@ let RawDataStorage = class RawDataStorage {
|
|
|
35
26
|
constructor(config, storageService, simpleConfig, log) {
|
|
36
27
|
this.storageService = storageService;
|
|
37
28
|
this.log = log;
|
|
38
|
-
this.save = (data, meta, name = "Unknown") =>
|
|
29
|
+
this.save = async (data, meta, name = "Unknown") => {
|
|
39
30
|
if (!this.storageEnabled || !this.rawDataWhitelist[name]) {
|
|
40
31
|
this.log.verbose(`Raw data storage upload not enabled for \`${name}\` datasource.`);
|
|
41
32
|
return;
|
|
@@ -47,27 +38,27 @@ let RawDataStorage = class RawDataStorage {
|
|
|
47
38
|
try {
|
|
48
39
|
headers = JSON.stringify(meta.headers, null, 2);
|
|
49
40
|
}
|
|
50
|
-
catch
|
|
41
|
+
catch {
|
|
51
42
|
null;
|
|
52
43
|
}
|
|
53
44
|
try {
|
|
54
45
|
const parsedMediaType = content_type_1.default.parse(meta.headers["content-type"]);
|
|
55
|
-
if (parsedMediaType
|
|
46
|
+
if (parsedMediaType?.type) {
|
|
56
47
|
ext = ContentTypeHelper_1.contentTypeToExtension[parsedMediaType.type];
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
|
-
catch
|
|
50
|
+
catch {
|
|
60
51
|
null;
|
|
61
52
|
}
|
|
62
53
|
}
|
|
63
54
|
const fileName = `${now.format("y-LL-dd")}/${now.format("HH_mm_ss.SSS")}`;
|
|
64
55
|
// Save data
|
|
65
|
-
|
|
56
|
+
await this.storageService.uploadFile(data, name, ext ?? "", fileName);
|
|
66
57
|
if (this.rawDataWhitelist[name].saveHeaders && headers && meta.statusCode && meta.statusCode !== 200) {
|
|
67
58
|
// Save headers
|
|
68
|
-
|
|
59
|
+
await this.storageService.uploadFile(headers, name, "json", `${fileName}_headers`);
|
|
69
60
|
}
|
|
70
|
-
}
|
|
61
|
+
};
|
|
71
62
|
this.storageEnabled = simpleConfig.getValue("env.STORAGE_ENABLED", "false") === "true";
|
|
72
63
|
this.rawDataWhitelist = config.saveRawDataWhitelist;
|
|
73
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RawDataStorage.js","sourceRoot":"","sources":["../../../src/integration-engine/data-access/RawDataStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RawDataStorage.js","sourceRoot":"","sources":["../../../src/integration-engine/data-access/RawDataStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAA6C;AAE7C,+DAAsE;AACtE,2DAAmD;AAEnD,oEAAuE;AACvE,gCAAyC;AACzC,gEAAuC;AACvC,uCAA8C;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAc;IAI/B,YACmC,MAAsB,EACd,cAA8C,EACrD,YAA2B,EACjC,GAA6B;QAFR,mBAAc,GAAd,cAAc,CAAwB;QAE1C,QAAG,GAAH,GAAG,CAAS;QAMpD,SAAI,GAAG,KAAK,EAAE,IAAS,EAAE,IAAS,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE;YAC3D,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE;gBACtD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,6CAA6C,IAAI,gBAAgB,CAAC,CAAC;gBACpF,OAAO;aACV;YAED,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YAC9D,IAAI,GAAG,GAAG,IAAI,CAAC;YACf,IAAI,OAAO,GAAG,IAAI,CAAC;YAEnB,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI;oBACA,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;iBACnD;gBAAC,MAAM;oBACJ,IAAI,CAAC;iBACR;gBACD,IAAI;oBACA,MAAM,eAAe,GAAG,sBAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CA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,cAAc,CAkDlC;kBAlDoB,cAAc"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
3
|
exports.RedisPubSubChannel = void 0;
|
|
13
4
|
const AbstractPubSubChannel_1 = require("../../../helpers/data-access/pubsub/AbstractPubSubChannel");
|
|
@@ -22,11 +13,9 @@ class RedisPubSubChannel extends AbstractPubSubChannel_1.PubSubChannel {
|
|
|
22
13
|
this.channel = channel;
|
|
23
14
|
this.connector = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.RedisConnector);
|
|
24
15
|
}
|
|
25
|
-
publishMessage(message, options = {}) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
yield this.connector.getConnection().publish(redisChannel, message);
|
|
29
|
-
});
|
|
16
|
+
async publishMessage(message, options = {}) {
|
|
17
|
+
const redisChannel = (0, getRedisChannel_1.getRedisChannel)(this.channel, options.channelSuffix);
|
|
18
|
+
await this.connector.getConnection().publish(redisChannel, message);
|
|
30
19
|
}
|
|
31
20
|
createSubscriber(options) {
|
|
32
21
|
return new RedisSubscriber_1.RedisSubscriber({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisPubSubChannel.js","sourceRoot":"","sources":["../../../../src/integration-engine/data-access/pubsub/RedisPubSubChannel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisPubSubChannel.js","sourceRoot":"","sources":["../../../../src/integration-engine/data-access/pubsub/RedisPubSubChannel.ts"],"names":[],"mappings":";;;AAAA,qGAAkF;AAClF,iGAAsF;AAEtF,yCAAoC;AACpC,mEAAqF;AACrF,2CAAkC;AAClC,mCAAqE;AAUrE,MAAa,kBAAmB,SAAQ,qCAAa;IAGjD,YAA6B,OAAe;QACxC,KAAK,EAAE,CAAC;QADiB,YAAO,GAAP,OAAO,CAAQ;QAExC,IAAI,CAAC,SAAS,GAAG,gCAA0B,CAAC,OAAO,CAAkB,oBAAc,CAAC,cAAc,CAAC,CAAC;IACxG,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAe,EAAE,UAA2B,EAAE;QACtE,MAAM,YAAY,GAAG,IAAA,iCAAe,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAC1E,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAEM,gBAAgB,CAAC,OAA2B;QAC/C,OAAO,IAAI,iCAAe,CAAC;YACvB,WAAW,EAAE,IAAI,CAAC,OAAO;YACzB,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,qBAAqB,EAAE,eAAM,CAAC,UAAU;YACxC,MAAM,EAAE,aAAG;YACX,eAAe,EAAE,OAAO,CAAC,eAAe;SAC3C,CAAC,CAAC;IACP,CAAC;CACJ;AAtBD,gDAsBC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -36,23 +27,19 @@ class RedisSubscriber extends AbstractSubscriber_1.Subscriber {
|
|
|
36
27
|
throw new errors_1.GeneralError("Error while connecting to Redis", this.constructor.name, err);
|
|
37
28
|
});
|
|
38
29
|
}
|
|
39
|
-
subscribe() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return this.connection;
|
|
49
|
-
});
|
|
30
|
+
async subscribe() {
|
|
31
|
+
if (this.connection.status === "ready") {
|
|
32
|
+
this.logger.warn(`Already subscribed to Redis channel ${this.redisChannel}`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
await this.connection.connect();
|
|
36
|
+
await this.connection.subscribe(this.redisChannel);
|
|
37
|
+
}
|
|
38
|
+
return this.connection;
|
|
50
39
|
}
|
|
51
|
-
unsubscribe() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.connection.disconnect();
|
|
55
|
-
});
|
|
40
|
+
async unsubscribe() {
|
|
41
|
+
await this.connection.unsubscribe(this.redisChannel);
|
|
42
|
+
this.connection.disconnect();
|
|
56
43
|
}
|
|
57
44
|
listen(messageCallback) {
|
|
58
45
|
return new Promise((resolve, reject) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisSubscriber.js","sourceRoot":"","sources":["../../../../../src/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisSubscriber.js","sourceRoot":"","sources":["../../../../../src/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.ts"],"names":[],"mappings":";;;;;;AAEA,4CAA+C;AAC/C,sDAAwD;AACxD,oGAAiG;AACjG,8GAAmG;AAYnG;;;GAGG;AAEH,MAAa,eAAgB,SAAQ,+BAAU;IAM3C,YAAY,OAA2B;QACnC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,IAAA,iCAAe,EAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAE/C,IAAI,CAAC,UAAU,GAAG,IAAI,iBAAK,CAAC,OAAO,CAAC,qBAAsB,EAAE;YACxD,cAAc,EAAE,kBAAkB,IAAI,CAAC,YAAY,EAAE;YACrD,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAChC,MAAM,IAAI,qBAAY,CAAC,iCAAiC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC1F,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,SAAS;QAClB,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,OAAO,EAAE;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SAChF;aAAM;YACH,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACtD;QAED,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,WAAW;QACpB,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,eAAgC;QAC1C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,YAAY,GAAG,CAAC,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;gBAC/C,IAAI,OAAO,KAAK,IAAI,CAAC,YAAY,EAAE;oBAC/B,OAAO;iBACV;gBAED,YAAY,EAAE,CAAC;gBACf,IAAI,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,eAAe,CAAC;gBAEnD,IAAI;oBACA,eAAe,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;oBACpD,IAAI,OAAO,EAAE;wBACT,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;wBAC9C,OAAO,EAAE,CAAC;qBACb;iBACJ;gBAAC,OAAO,GAAG,EAAE;oBACV,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;oBAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;oBACrF,MAAM,CAAC,GAAG,CAAC,CAAC;iBACf;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAhED,0CAgEC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
3
|
exports.DataSource = void 0;
|
|
13
4
|
const logger_1 = require("../../helpers/logger");
|
|
@@ -18,7 +9,6 @@ const ioc_1 = require("../ioc");
|
|
|
18
9
|
const errors_1 = require("@golemio/errors");
|
|
19
10
|
class DataSource {
|
|
20
11
|
constructor(name, protocolStrategy, dataTypeStrategy = null, validator = null) {
|
|
21
|
-
var _a;
|
|
22
12
|
this.setProtocolStrategy = (strategy) => {
|
|
23
13
|
this.protocolStrategy = strategy;
|
|
24
14
|
if (this.protocolStrategy.setCallerName) {
|
|
@@ -58,12 +48,12 @@ class DataSource {
|
|
|
58
48
|
try {
|
|
59
49
|
strData = JSON.stringify(data);
|
|
60
50
|
}
|
|
61
|
-
catch
|
|
51
|
+
catch {
|
|
62
52
|
if (data.toString) {
|
|
63
53
|
try {
|
|
64
54
|
strData = data.toString();
|
|
65
55
|
}
|
|
66
|
-
catch
|
|
56
|
+
catch {
|
|
67
57
|
null;
|
|
68
58
|
}
|
|
69
59
|
}
|
|
@@ -77,63 +67,54 @@ class DataSource {
|
|
|
77
67
|
if (this.protocolStrategy && this.protocolStrategy.setCallerName) {
|
|
78
68
|
this.protocolStrategy.setCallerName(this.name);
|
|
79
69
|
}
|
|
80
|
-
if (
|
|
70
|
+
if (this.validator?.setLogger) {
|
|
81
71
|
this.validator.setLogger(helpers_1.log);
|
|
82
72
|
}
|
|
83
73
|
this.loggerEmitter = ioc_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.LoggerEmitter);
|
|
84
74
|
}
|
|
85
|
-
getAll() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return data;
|
|
92
|
-
});
|
|
75
|
+
async getAll() {
|
|
76
|
+
const { data } = await this.getAllWithMetadata();
|
|
77
|
+
if (data instanceof ResourceNotModified_1.ResourceNotModified) {
|
|
78
|
+
throw new errors_1.GeneralError("Data source returned 304 Not Modified, which is not a supported response type for this data source.", this.name);
|
|
79
|
+
}
|
|
80
|
+
return data;
|
|
93
81
|
}
|
|
94
|
-
getAllWithMetadata() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (res.data instanceof ResourceNotModified_1.ResourceNotModified)
|
|
102
|
-
return res;
|
|
103
|
-
try {
|
|
104
|
-
yield this.validator.Validate((0, datasources_1.isFileObject)(res.data) ? res.data.data : res.data);
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
throw new errors_1.GeneralError(`Error while validating source data: ${this.formatDataForError(res.data)}`, this.name, err);
|
|
108
|
-
}
|
|
82
|
+
async getAllWithMetadata() {
|
|
83
|
+
const res = await this.getRawData();
|
|
84
|
+
if (!this.validator) {
|
|
85
|
+
helpers_1.log.warn("DataSource validator is not set.");
|
|
86
|
+
return res;
|
|
87
|
+
}
|
|
88
|
+
if (res.data instanceof ResourceNotModified_1.ResourceNotModified)
|
|
109
89
|
return res;
|
|
110
|
-
|
|
90
|
+
try {
|
|
91
|
+
await this.validator.Validate((0, datasources_1.isFileObject)(res.data) ? res.data.data : res.data);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
throw new errors_1.GeneralError(`Error while validating source data: ${this.formatDataForError(res.data)}`, this.name, err);
|
|
95
|
+
}
|
|
96
|
+
return res;
|
|
111
97
|
}
|
|
112
|
-
getLastModified() {
|
|
113
|
-
return
|
|
114
|
-
return this.protocolStrategy.getLastModified();
|
|
115
|
-
});
|
|
98
|
+
async getLastModified() {
|
|
99
|
+
return this.protocolStrategy.getLastModified();
|
|
116
100
|
}
|
|
117
|
-
getRawData() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (this.getResponseStatusCode(res.metadata) === 304) {
|
|
123
|
-
return { data: new ResourceNotModified_1.ResourceNotModified(), metadata: res.metadata };
|
|
124
|
-
}
|
|
125
|
-
const body = res.data;
|
|
126
|
-
const isFile = (0, datasources_1.isFileObject)(body);
|
|
127
|
-
const content = yield ((_a = this.dataTypeStrategy) === null || _a === void 0 ? void 0 : _a.parseData(isFile ? body.data : body));
|
|
128
|
-
this.notifyNumberOfRecords(content);
|
|
129
|
-
return isFile
|
|
130
|
-
? { data: Object.assign(Object.assign({}, body), { data: content }), metadata: res.metadata }
|
|
131
|
-
: { data: content, metadata: res.metadata };
|
|
101
|
+
async getRawData() {
|
|
102
|
+
try {
|
|
103
|
+
const res = await this.protocolStrategy.getDataWithMetadata();
|
|
104
|
+
if (this.getResponseStatusCode(res.metadata) === 304) {
|
|
105
|
+
return { data: new ResourceNotModified_1.ResourceNotModified(), metadata: res.metadata };
|
|
132
106
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
107
|
+
const body = res.data;
|
|
108
|
+
const isFile = (0, datasources_1.isFileObject)(body);
|
|
109
|
+
const content = await this.dataTypeStrategy?.parseData(isFile ? body.data : body);
|
|
110
|
+
this.notifyNumberOfRecords(content);
|
|
111
|
+
return isFile
|
|
112
|
+
? { data: { ...body, data: content }, metadata: res.metadata }
|
|
113
|
+
: { data: content, metadata: res.metadata };
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
throw new errors_1.GeneralError("Retrieving of the source data failed.", this.name, err);
|
|
117
|
+
}
|
|
137
118
|
}
|
|
138
119
|
getResponseStatusCode(metadata) {
|
|
139
120
|
if (typeof metadata === "object" && metadata !== null && "statusCode" in metadata && metadata.statusCode === 304) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSource.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataSource.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSource.ts"],"names":[],"mappings":";;;AAAA,iDAAiE;AACjE,oCAAoH;AACpH,wCAAkC;AAClC,wEAAsE;AACtE,gCAAqE;AACrE,4CAA+C;AAG/C,MAAa,UAAU;IAQnB,YACI,IAAY,EACZ,gBAAmC,EACnC,mBAA6C,IAAI,EACjD,YAA+B,IAAI;QAkBhC,wBAAmB,GAAG,CAAC,QAA2B,EAAQ,EAAE;YAC/D,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;YACjC,IAAI,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE;gBACrC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAClD;QACL,CAAC,CAAC;QAEK,wBAAmB,GAAG,CAAC,QAAkC,EAAQ,EAAE;YACtE,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACrC,CAAC,CAAC;QAEK,iBAAY,GAAG,CAAC,SAA4B,EAAQ,EAAE;YACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC/B,CAAC,CAAC;QA4DQ,YAAO,GAAG,CAAC,OAAU,EAAW,EAAE;YACxC,IAAI,CAAC,OAAO,EAAE;gBACV,OAAO,IAAI,CAAC;aACf;iBAAM,IAAI,OAAO,YAAY,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACzD,OAAO,IAAI,CAAC;aACf;iBAAM,IAAI,OAAO,YAAY,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBACvE,OA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AAQ,KAAK,IAAI,IAAI,YAAY,IAAI,QAAQ,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE;YAC9G,OAAO,QAAQ,CAAC,UAAU,CAAC;SAC9B;IACL,CAAC;CA0CJ;AA/ID,gCA+IC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
3
|
exports.DataSourceStream = void 0;
|
|
13
4
|
const errors_1 = require("@golemio/errors");
|
|
@@ -24,15 +15,15 @@ class DataSourceStream extends stream_1.Readable {
|
|
|
24
15
|
return this;
|
|
25
16
|
};
|
|
26
17
|
this.setDataProcessor = (onDataFunction) => {
|
|
27
|
-
this.onDataListeners.push((data) =>
|
|
18
|
+
this.onDataListeners.push(async (data) => {
|
|
28
19
|
this.processing++;
|
|
29
20
|
this.pause();
|
|
30
21
|
try {
|
|
31
22
|
if (data instanceof Array) {
|
|
32
|
-
|
|
23
|
+
await onDataFunction([...data]);
|
|
33
24
|
}
|
|
34
25
|
else {
|
|
35
|
-
|
|
26
|
+
await onDataFunction(Object.assign({}, data));
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
29
|
catch (err) {
|
|
@@ -40,10 +31,10 @@ class DataSourceStream extends stream_1.Readable {
|
|
|
40
31
|
}
|
|
41
32
|
this.resume();
|
|
42
33
|
this.processing--;
|
|
43
|
-
})
|
|
34
|
+
});
|
|
44
35
|
return this;
|
|
45
36
|
};
|
|
46
|
-
this.waitForEnd = () =>
|
|
37
|
+
this.waitForEnd = async () => {
|
|
47
38
|
let inputStreamEndedAttempts = 0;
|
|
48
39
|
return new Promise((resolve, reject) => {
|
|
49
40
|
this.on("error", (error) => {
|
|
@@ -54,22 +45,22 @@ class DataSourceStream extends stream_1.Readable {
|
|
|
54
45
|
return reject(new errors_1.GeneralError("DataSourceStream general error", this.constructor.name, error));
|
|
55
46
|
}
|
|
56
47
|
});
|
|
57
|
-
this.on("end", () =>
|
|
48
|
+
this.on("end", async () => {
|
|
58
49
|
if (!this.processing && !this.streamEnded) {
|
|
59
50
|
this.streamEnded = true;
|
|
60
51
|
if (this.onEndFunction) {
|
|
61
|
-
|
|
52
|
+
await this.onEndFunction();
|
|
62
53
|
}
|
|
63
54
|
resolve();
|
|
64
55
|
}
|
|
65
56
|
else {
|
|
66
|
-
const checker = setInterval(() =>
|
|
57
|
+
const checker = setInterval(async () => {
|
|
67
58
|
inputStreamEndedAttempts++;
|
|
68
59
|
if (!this.processing && !this.streamEnded) {
|
|
69
60
|
clearInterval(checker);
|
|
70
61
|
this.streamEnded = true;
|
|
71
62
|
if (this.onEndFunction) {
|
|
72
|
-
|
|
63
|
+
await this.onEndFunction();
|
|
73
64
|
}
|
|
74
65
|
resolve();
|
|
75
66
|
}
|
|
@@ -78,11 +69,11 @@ class DataSourceStream extends stream_1.Readable {
|
|
|
78
69
|
this.push(null);
|
|
79
70
|
clearInterval(checker);
|
|
80
71
|
}
|
|
81
|
-
}
|
|
72
|
+
}, config_1.config.stream.wait_for_end_interval);
|
|
82
73
|
}
|
|
83
|
-
})
|
|
74
|
+
});
|
|
84
75
|
});
|
|
85
|
-
}
|
|
76
|
+
};
|
|
86
77
|
this.proceed = () => {
|
|
87
78
|
this.emit("streamReady");
|
|
88
79
|
return this.waitForEnd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceStream.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSourceStream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataSourceStream.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSourceStream.ts"],"names":[],"mappings":";;;AAAA,4CAAqE;AACrE,mCAAkC;AAClC,sCAAoC;AAEpC,MAAa,gBAAiB,SAAQ,iBAAQ;IAM1C,YAAY,GAAG,IAAS;QACpB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QANZ,oBAAe,GAAe,EAAE,CAAC;QACjC,eAAU,GAAG,CAAC,CAAC;QAEd,gBAAW,GAAG,KAAK,CAAC;QAarB,qBAAgB,GAAG,CAAC,aAAkC,EAAoB,EAAE;YAC/E,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YACnC,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAEK,qBAAgB,GAAG,CAAC,cAA4C,EAAoB,EAAE;YACzF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,IAAS,EAAE,EAAE;gBAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,IAAI;oBACA,IAAI,IAAI,YAAY,KAAK,EAAE;wBACvB,MAAM,cAAc,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;qBACnC;yBAAM;wBACH,MAAM,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;qBACjD;iBACJ;gBAAC,OAAO,GAAG,EAAE;oBACV,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,qBAAY,CAAC,mCAAmC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;iBACzG;gBAED,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,IAAI,CAAC,UAAU,EAAE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AM,CAAC,qBAAqB,EAAE;gCACvE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,qBAAY,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC,CAAC;gCACvF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gCAChB,aAAa,CAAC,OAAO,CAAC,CAAC;6BAC1B;wBACL,CAAC,EAAE,eAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;qBAC3C;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEK,YAAO,GAAG,GAAkB,EAAE;YACjC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,CAAC,CAAC;QA5EE,wFAAwF;QACxF,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACtC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,QAAsB,CAAC,CAAC;YAC5C,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CAuEJ;AAtFD,4CAsFC"}
|
|
@@ -1,33 +1,24 @@
|
|
|
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
|
var _a;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
const errors_1 = require("@golemio/errors");
|
|
14
5
|
class DataSourceStreamManager {
|
|
15
6
|
}
|
|
16
7
|
_a = DataSourceStreamManager;
|
|
17
|
-
DataSourceStreamManager.processDataStream = (dataSourceStream, onDataFunction) =>
|
|
8
|
+
DataSourceStreamManager.processDataStream = async (dataSourceStream, onDataFunction) => {
|
|
18
9
|
let dataStream;
|
|
19
10
|
try {
|
|
20
|
-
dataStream =
|
|
11
|
+
dataStream = await dataSourceStream;
|
|
21
12
|
}
|
|
22
13
|
catch (err) {
|
|
23
14
|
throw new errors_1.GeneralError("Error while getting data", _a.constructor.name, err);
|
|
24
15
|
}
|
|
25
16
|
try {
|
|
26
|
-
|
|
17
|
+
await dataStream.setDataProcessor(onDataFunction).proceed();
|
|
27
18
|
}
|
|
28
19
|
catch (err) {
|
|
29
20
|
throw new errors_1.GeneralError("Error while processing data", _a.constructor.name, err);
|
|
30
21
|
}
|
|
31
|
-
}
|
|
22
|
+
};
|
|
32
23
|
exports.default = DataSourceStreamManager;
|
|
33
24
|
//# sourceMappingURL=DataSourceStreamManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceStreamManager.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSourceStreamManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataSourceStreamManager.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/DataSourceStreamManager.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAG/C,MAAqB,uBAAuB;;;AAC1B,yCAAiB,GAAG,KAAK,EACnC,gBAA2C,EAC3C,cAA4C,EAC/B,EAAE;IACf,IAAI,UAA4B,CAAC;IAEjC,IAAI;QACA,UAAU,GAAG,MAAM,gBAAgB,CAAC;KACvC;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,qBAAY,CAAC,0BAA0B,EAAE,EAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KAClF;IAED,IAAI;QACA,MAAM,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/D;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,qBAAY,CAAC,6BAA6B,EAAE,EAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KACrF;AACL,CAAC,AAjB8B,CAiB7B;kBAlBe,uBAAuB"}
|