@golemio/pid 2.3.3-dev.683686072 → 2.3.3-dev.684348584
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/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.d.ts +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js +7 -11
- package/dist/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.js.map +1 -1
- package/package.json +1 -2
|
@@ -2,7 +2,7 @@ import { BinaryLike } from "crypto";
|
|
|
2
2
|
import { IEventFetchOutput } from "../interfaces/IEventFetchOutput";
|
|
3
3
|
export default class RopidVYMIApiHelper {
|
|
4
4
|
private static _instance;
|
|
5
|
-
private readonly
|
|
5
|
+
private readonly datasource;
|
|
6
6
|
static getInstance: () => RopidVYMIApiHelper;
|
|
7
7
|
private constructor();
|
|
8
8
|
getAllEvents: () => Promise<IEventFetchOutput>;
|
|
@@ -16,23 +16,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
const ropid_vymi_1 = require("../../../../../schema-definitions/ropid-vymi");
|
|
17
17
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
18
18
|
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
19
|
-
const DataSourceStreamManager_1 = __importDefault(require("@golemio/core/dist/integration-engine/datasources/DataSourceStreamManager"));
|
|
20
19
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
21
20
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
22
21
|
const crypto_1 = __importDefault(require("crypto"));
|
|
23
|
-
const JSONStream_1 = __importDefault(require("JSONStream"));
|
|
24
22
|
const RopidVYMIApiOutputLevel_1 = require("./RopidVYMIApiOutputLevel");
|
|
25
23
|
class RopidVYMIApiHelper {
|
|
26
24
|
constructor() {
|
|
27
25
|
this.getAllEvents = () => __awaiter(this, void 0, void 0, function* () {
|
|
28
26
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
data = events;
|
|
32
|
-
digest = this.createDigest(JSON.stringify(data));
|
|
33
|
-
}));
|
|
27
|
+
const events = yield this.datasource.getAll();
|
|
28
|
+
const digest = this.createDigest(JSON.stringify(events));
|
|
34
29
|
return {
|
|
35
|
-
data,
|
|
30
|
+
data: events,
|
|
36
31
|
digest,
|
|
37
32
|
};
|
|
38
33
|
}
|
|
@@ -49,12 +44,13 @@ class RopidVYMIApiHelper {
|
|
|
49
44
|
this.createDigest = (data) => {
|
|
50
45
|
return crypto_1.default.createHash("sha1").update(data).digest("hex");
|
|
51
46
|
};
|
|
52
|
-
this.
|
|
47
|
+
this.datasource = new integration_engine_1.DataSource(ropid_vymi_1.RopidVYMI.events.name + "DataSource", new integration_engine_1.HTTPProtocolStrategy({
|
|
53
48
|
headers: config_1.config.datasources.RopidVYMIApiHeaders,
|
|
54
49
|
method: "GET",
|
|
55
|
-
timeout:
|
|
50
|
+
timeout: 25000,
|
|
56
51
|
url: `${config_1.config.datasources.RopidVYMIApiUrl}?level=${RopidVYMIApiOutputLevel_1.RopidVYMIApiOutputLevel.Standard}`,
|
|
57
|
-
|
|
52
|
+
json: true,
|
|
53
|
+
}), new integration_engine_1.JSONDataTypeStrategy({ resultsPath: "vymi-report.vymi-list" }), new golemio_validator_1.JSONSchemaValidator(ropid_vymi_1.RopidVYMI.events.name + "DataSource", ropid_vymi_1.RopidVYMI.events.datasourceJsonSchema));
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
exports.default = RopidVYMIApiHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidVYMIApiHelper.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-vymi/workers/tasks/helpers/RopidVYMIApiHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"RopidVYMIApiHelper.js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AK;YACd,GAAG,EAAE,GAAG,eAAM,CAAC,WAAW,CAAC,eAAe,UAAU,iDAAuB,CAAC,QAAQ,EAAE;YACtF,IAAI,EAAE,IAAI;SACb,CAAC,EACF,IAAI,yCAAoB,CAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC,EAClE,IAAI,uCAAmB,CAAC,sBAAS,CAAC,MAAM,CAAC,IAAI,GAAG,YAAY,EAAE,sBAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,CACvG,CAAC;IACN,CAAC;;AAzBL,qCAiDC;;AA7CiB,8BAAW,GAAG,GAAG,EAAE;IAC7B,IAAI,CAAC,EAAI,CAAC,SAAS,EAAE;QACjB,EAAI,CAAC,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAC;KAC7C;IAED,OAAO,EAAI,CAAC,SAAS,CAAC;AAC1B,CAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "2.3.3-dev.
|
|
3
|
+
"version": "2.3.3-dev.684348584",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@golemio/ovapi-gtfs-realtime-bindings": "1.0.0",
|
|
75
75
|
"@turf/turf": "^6.5.0",
|
|
76
|
-
"JSONStream": "^1.3.5",
|
|
77
76
|
"cheap-ruler": "^2.5.1",
|
|
78
77
|
"csv-parser": "^3.0.0",
|
|
79
78
|
"csv-stringify": "^5.6.2",
|