@golemio/pid 5.4.3-dev.2278927547 → 5.4.3-rc.2281268611
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-gtfs/facade/DeparturePresetsFacade.js +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.d.ts +7 -3
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +9 -3
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.d.ts +8 -3
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js +26 -19
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.d.ts +7 -3
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js +14 -5
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.d.ts +4 -3
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +6 -6
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.d.ts +5 -3
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js +13 -3
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/interfaces/IPresetLogTransformation.d.ts +4 -2
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts +3 -15
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.d.ts +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +4 -13
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.d.ts +4 -4
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js +15 -9
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.d.ts +3 -3
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js +8 -4
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.d.ts +7 -5
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +10 -11
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.d.ts +4 -3
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js +4 -3
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.d.ts +4 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.js +10 -6
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.d.ts +4 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js +13 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +7 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +27 -20
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/package.json +2 -1
|
@@ -43,7 +43,7 @@ let DeparturePresetsFacade = class DeparturePresetsFacade {
|
|
|
43
43
|
value: lastModified,
|
|
44
44
|
version: dbLastModified.version + 1,
|
|
45
45
|
});
|
|
46
|
-
const transformedData = this.transformationDeparturesPresets.
|
|
46
|
+
const transformedData = await this.transformationDeparturesPresets.transform(data);
|
|
47
47
|
await this.metadataRepository.save({
|
|
48
48
|
dataset: DatasetEnum_1.DatasetEnum.DEPARTURES_PRESETS,
|
|
49
49
|
key: "departuresPresets",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAAyD;AACzD,yEAAoE;AACpE,0IAAqI;AACrI,wEAAoG;AAKpG,6FAA0F;AAC1F,iEAAwE;AACxE,gEAA6D;AAC7D,gFAA6E;AAC7E,0FAAuF;AACvF,wDAAqD;AACrD,4EAAyE;AACzE,kHAA+G;AAGxG,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YACyE,kBAA+C,EACvD,mBAAwC,EACpC,0BAAsD,EAE/G,8CAA8F,EAE9F,+BAAqE,EACtC,MAAe;QAPe,uBAAkB,GAAlB,kBAAkB,CAA6B;QACvD,wBAAmB,GAAnB,mBAAmB,CAAqB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QAE/G,mDAA8C,GAA9C,8CAA8C,CAAgD;QAE9F,oCAA+B,GAA/B,+BAA+B,CAAsC;QACtC,WAAM,GAAN,MAAM,CAAS;IACvD,CAAC;IAEG,KAAK,CAAC,yBAAyB,CAAC,IAA8B,EAAE,YAAoB;QACvF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,yBAAW,CAAC,kBAAkB,CAAC,CAAC;QACrG,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC/B,OAAO,EAAE,yBAAW,CAAC,kBAAkB;YACvC,GAAG,EAAE,2CAAsB,CAAC,aAAa;YACzC,IAAI,EAAE,iCAAY,CAAC,YAAY;YAC/B,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC;SACtC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAI,CAAC,+BAA+B,CAAC,
|
|
1
|
+
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAAyD;AACzD,yEAAoE;AACpE,0IAAqI;AACrI,wEAAoG;AAKpG,6FAA0F;AAC1F,iEAAwE;AACxE,gEAA6D;AAC7D,gFAA6E;AAC7E,0FAAuF;AACvF,wDAAqD;AACrD,4EAAyE;AACzE,kHAA+G;AAGxG,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YACyE,kBAA+C,EACvD,mBAAwC,EACpC,0BAAsD,EAE/G,8CAA8F,EAE9F,+BAAqE,EACtC,MAAe;QAPe,uBAAkB,GAAlB,kBAAkB,CAA6B;QACvD,wBAAmB,GAAnB,mBAAmB,CAAqB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QAE/G,mDAA8C,GAA9C,8CAA8C,CAAgD;QAE9F,oCAA+B,GAA/B,+BAA+B,CAAsC;QACtC,WAAM,GAAN,MAAM,CAAS;IACvD,CAAC;IAEG,KAAK,CAAC,yBAAyB,CAAC,IAA8B,EAAE,YAAoB;QACvF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,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,KAAK,CAAC,EAAE,CAAC;oBACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,0CAA0C,CAAC,CAAC;oBAC1E,SAAS;gBACb,CAAC;gBAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACvB,0BAA0B,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrF,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,0BAA0B,CAAC;IACtC,CAAC;CACJ,CAAA;AArFY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAC3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,mBAAmB,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,0BAA0B,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,8CAA8C,CAAC,CAAA;IAE9E,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,oCAAoC,CAAC,CAAA;IAEjE,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAP2D,yDAA2B;QAClC,yCAAmB;QACR,uDAA0B;QAE/D,+FAA8C;QAE7D,2EAAoC;GARxE,sBAAsB,CAqFlC"}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { IRopidDeparturesPreset, IRopidDeparturesPresetsOutput } from "../../../schema-definitions/ropid-departures-presets";
|
|
2
|
-
import {
|
|
3
|
-
export declare class RopidDeparturesPresetsTransformation extends
|
|
2
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
3
|
+
export declare class RopidDeparturesPresetsTransformation extends BaseTransformation implements ITransformation {
|
|
4
4
|
name: string;
|
|
5
5
|
constructor();
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Overrides BaseTransformation::transform
|
|
8
|
+
*/
|
|
9
|
+
transform: (data: IRopidDeparturesPreset[]) => Promise<IRopidDeparturesPresetsOutput[]>;
|
|
10
|
+
protected transformElement: (element: IRopidDeparturesPreset) => IRopidDeparturesPresetsOutput;
|
|
7
11
|
}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidDeparturesPresetsTransformation = void 0;
|
|
4
4
|
const ropid_departures_presets_1 = require("../../../schema-definitions/ropid-departures-presets");
|
|
5
|
-
const
|
|
6
|
-
class RopidDeparturesPresetsTransformation extends
|
|
5
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
6
|
+
class RopidDeparturesPresetsTransformation extends transformations_1.BaseTransformation {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Overrides BaseTransformation::transform
|
|
11
|
+
*/
|
|
12
|
+
this.transform = (data) => {
|
|
13
|
+
return Promise.resolve(data.map((element) => this.transformElement(element)));
|
|
14
|
+
};
|
|
15
|
+
this.transformElement = (element) => {
|
|
10
16
|
return {
|
|
11
17
|
route_name: element.routeName,
|
|
12
18
|
api_version: element.apiVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidDeparturesPresetsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.ts"],"names":[],"mappings":";;;AAAA,mGAA8H;AAC9H,
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.ts"],"names":[],"mappings":";;;AAAA,mGAA8H;AAC9H,2FAA4G;AAE5G,MAAa,oCAAqC,SAAQ,oCAAkB;IAGxE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,CAAC,IAA8B,EAA4C,EAAE;YAC5F,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClF,CAAC,CAAC;QAEQ,qBAAgB,GAAG,CAAC,OAA+B,EAAiC,EAAE;YAC5F,OAAO;gBACH,UAAU,EAAE,OAAO,CAAC,SAAS;gBAC7B,WAAW,EAAE,OAAO,CAAC,UAAU;gBAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,gBAAgB,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBAC/D,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;aACxE,CAAC;QACN,CAAC,CAAC;QAnBE,IAAI,CAAC,IAAI,GAAG,iDAAsB,CAAC,IAAI,CAAC;IAC5C,CAAC;CAmBJ;AAzBD,oFAyBC"}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
1
2
|
import { IRopidGTFSCisStopsData, IRopidGTFSCisStopsInputData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSCisStops";
|
|
2
3
|
import { IRopidGTFSCisStopGroupsData, IRopidGTFSCisStopGroupsInputData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSCisStopGroups";
|
|
3
|
-
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
4
4
|
export interface ICisStopsTransformationData {
|
|
5
5
|
data: IInputDataset[];
|
|
6
6
|
name: string;
|
|
@@ -12,9 +12,14 @@ export interface ICisStopsTransformedData {
|
|
|
12
12
|
cis_stop_groups: IRopidGTFSCisStopGroupsData[];
|
|
13
13
|
cis_stops: IRopidGTFSCisStopsData[];
|
|
14
14
|
}
|
|
15
|
-
export declare class RopidGTFSCisStopsTransformation extends
|
|
15
|
+
export declare class RopidGTFSCisStopsTransformation extends BaseTransformation implements ITransformation {
|
|
16
16
|
name: string;
|
|
17
|
-
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Overrides BaseTransformation::transform
|
|
20
|
+
*/
|
|
21
|
+
transform: ({ data }: ICisStopsTransformationData) => Promise<ICisStopsTransformedData>;
|
|
22
|
+
protected transformElement: () => Promise<any>;
|
|
18
23
|
private getUniqueStopGroups;
|
|
19
24
|
}
|
|
20
25
|
export {};
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidGTFSCisStopsTransformation = void 0;
|
|
4
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
4
5
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
5
6
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
6
|
-
|
|
7
|
-
class RopidGTFSCisStopsTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
7
|
+
class RopidGTFSCisStopsTransformation extends transformations_1.BaseTransformation {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
super();
|
|
10
|
+
/**
|
|
11
|
+
* Overrides BaseTransformation::transform
|
|
12
|
+
*/
|
|
13
|
+
this.transform = async ({ data }) => {
|
|
14
|
+
const res = {
|
|
15
|
+
cis_stop_groups: [],
|
|
16
|
+
cis_stops: [],
|
|
17
|
+
};
|
|
18
|
+
const promises = data.map(async (stopGroup) => {
|
|
19
|
+
const promisesStops = stopGroup.stops.map((stop) => {
|
|
20
|
+
return {
|
|
17
21
|
alt_idos_name: stop.altIdosName,
|
|
18
22
|
cis: stopGroup.cis,
|
|
19
23
|
id: stop.id,
|
|
@@ -24,9 +28,10 @@ class RopidGTFSCisStopsTransformation extends AbstractTransformation_1.AbstractT
|
|
|
24
28
|
platform: stop.platform,
|
|
25
29
|
wheelchair_access: stop.wheelchairAccess,
|
|
26
30
|
zone: stop.zone,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
res.cis_stops.push(...(await Promise.all(promisesStops)));
|
|
34
|
+
return {
|
|
30
35
|
avg_jtsk_x: stopGroup.avgJtskX,
|
|
31
36
|
avg_jtsk_y: stopGroup.avgJtskY,
|
|
32
37
|
avg_lat: stopGroup.avgLat,
|
|
@@ -40,14 +45,15 @@ class RopidGTFSCisStopsTransformation extends AbstractTransformation_1.AbstractT
|
|
|
40
45
|
name: stopGroup.name,
|
|
41
46
|
node: stopGroup.node,
|
|
42
47
|
unique_name: stopGroup.uniqueName,
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
cis_stop_groups: this.getUniqueStopGroups(stopGroups),
|
|
48
|
-
};
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
res.cis_stop_groups = this.getUniqueStopGroups(await Promise.all(promises));
|
|
51
|
+
return res;
|
|
49
52
|
};
|
|
53
|
+
this.transformElement = async () => { };
|
|
50
54
|
this.getUniqueStopGroups = (data) => {
|
|
55
|
+
// duplicity checking
|
|
56
|
+
// TODO is it ok if all duplicate items are removed?
|
|
51
57
|
const uniqueMap = new Map();
|
|
52
58
|
const duplicateCisStopGroups = [];
|
|
53
59
|
data.forEach((item) => {
|
|
@@ -65,6 +71,7 @@ class RopidGTFSCisStopsTransformation extends AbstractTransformation_1.AbstractT
|
|
|
65
71
|
}
|
|
66
72
|
return [...uniqueMap.values()];
|
|
67
73
|
};
|
|
74
|
+
this.name = ropid_gtfs_1.RopidGTFS.name + "CisStops";
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
exports.RopidGTFSCisStopsTransformation = RopidGTFSCisStopsTransformation;
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSCisStopsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.ts"],"names":[],"mappings":";;;AAAA,uEAA4C;AAC5C,2EAAoE;
|
|
1
|
+
{"version":3,"file":"RopidGTFSCisStopsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.ts"],"names":[],"mappings":";;;AAAA,2FAA4G;AAC5G,uEAA4C;AAC5C,2EAAoE;AAkBpE,MAAa,+BAAgC,SAAQ,oCAAkB;IAGnE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,KAAK,EAAE,EAAE,IAAI,EAA+B,EAAqC,EAAE;YAClG,MAAM,GAAG,GAA6B;gBAClC,eAAe,EAAE,EAAE;gBACnB,SAAS,EAAE,EAAE;aAChB,CAAC;YAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;gBAC1C,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAiC,EAAE,EAAE;oBAC5E,OAAO;wBACH,aAA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AAG,KAAK,IAAkB,EAAE,GAAE,CAAC,CAAC;QAElD,wBAAmB,GAAG,CAAC,IAAmC,EAAiC,EAAE;YACjG,qBAAqB;YACrB,oDAAoD;YACpD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;YAC5B,MAAM,sBAAsB,GAAa,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1B,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACtC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC/B,CAAC;qBAAM,CAAC;oBACJ,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBAClC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,aAAG,CAAC,IAAI,CACJ,2EAA2E;oBACvE,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAC7C,CAAC;YACN,CAAC;YAED,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC,CAAC;QAxEE,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,IAAI,GAAG,UAAU,CAAC;IAC5C,CAAC;CAwEJ;AA9ED,0EA8EC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
1
2
|
import { IRopidGTFSOisMappingInputData, IRopidGTFSOisMappingData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSOisMapping";
|
|
2
|
-
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
3
3
|
export interface IOisMappingTransformationData {
|
|
4
4
|
data: IRopidGTFSOisMappingInputData[];
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export declare class RopidGTFSOisMappingTransformation extends
|
|
7
|
+
export declare class RopidGTFSOisMappingTransformation extends BaseTransformation implements ITransformation {
|
|
8
8
|
name: string;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Overrides BaseTransformation::transform
|
|
12
|
+
*/
|
|
13
|
+
transform: ({ data }: IOisMappingTransformationData) => Promise<IRopidGTFSOisMappingData[]>;
|
|
14
|
+
protected transformElement: (element: IRopidGTFSOisMappingInputData) => IRopidGTFSOisMappingData;
|
|
11
15
|
}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidGTFSOisMappingTransformation = void 0;
|
|
4
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
4
5
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
5
|
-
|
|
6
|
-
class RopidGTFSOisMappingTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
6
|
+
class RopidGTFSOisMappingTransformation extends transformations_1.BaseTransformation {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Overrides BaseTransformation::transform
|
|
11
|
+
*/
|
|
12
|
+
this.transform = async ({ data }) => {
|
|
13
|
+
const promises = data.map((element) => {
|
|
14
|
+
return this.transformElement(element);
|
|
15
|
+
});
|
|
16
|
+
return await Promise.all(promises);
|
|
17
|
+
};
|
|
18
|
+
this.transformElement = (element) => {
|
|
19
|
+
return {
|
|
11
20
|
ois: element.ois,
|
|
12
21
|
node: element.node,
|
|
13
22
|
name: element.name,
|
|
14
|
-
}
|
|
23
|
+
};
|
|
15
24
|
};
|
|
16
25
|
this.name = ropid_gtfs_1.RopidGTFS.ois.name;
|
|
17
26
|
}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSOisTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidGTFSOisTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.ts"],"names":[],"mappings":";;;AAAA,2FAA4G;AAC5G,uEAA4C;AAQ5C,MAAa,iCAAkC,SAAQ,oCAAkB;IAGrE;QACI,KAAK,EAAE,CAAC;QAIZ;;WAEG;QACI,cAAS,GAAG,KAAK,EAAE,EAAE,IAAI,EAAiC,EAAuC,EAAE;YACtG,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;gBAClC,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC,CAAC;QAEQ,qBAAgB,GAAG,CAAC,OAAsC,EAA4B,EAAE;YAC9F,OAAO;gBACH,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;aACrB,CAAC;QACN,CAAC,CAAC;QAnBE,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,GAAG,CAAC,IAAI,CAAC;IACnC,CAAC;CAmBJ;AAzBD,8EAyBC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
2
2
|
import { Readable } from "stream";
|
|
3
3
|
export interface IRopidGtfsTransformationData {
|
|
4
4
|
sourceStream: Readable;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export declare class RopidGTFSTransformation extends
|
|
7
|
+
export declare class RopidGTFSTransformation extends BaseTransformation implements ITransformation {
|
|
8
8
|
name: string;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
10
|
+
transform: (input: IRopidGtfsTransformationData) => Promise<Readable>;
|
|
11
|
+
protected transformElement: () => void;
|
|
11
12
|
}
|
|
@@ -15,15 +15,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.RopidGTFSTransformation = void 0;
|
|
16
16
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
17
17
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
18
|
-
const
|
|
18
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
19
19
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
20
20
|
const csv_parser_1 = __importDefault(require("csv-parser"));
|
|
21
21
|
const csv_stringify_1 = __importDefault(require("csv-stringify"));
|
|
22
22
|
const stream_1 = require("stream");
|
|
23
|
-
let RopidGTFSTransformation = class RopidGTFSTransformation extends
|
|
23
|
+
let RopidGTFSTransformation = class RopidGTFSTransformation extends transformations_1.BaseTransformation {
|
|
24
24
|
constructor() {
|
|
25
25
|
super();
|
|
26
|
-
this.
|
|
26
|
+
this.transform = async (input) => {
|
|
27
27
|
// create object by table structure and fill its values with null
|
|
28
28
|
const tableToObjectFilledWithNulls = Object.keys(ropid_gtfs_1.RopidGTFS[input.name].outputSequelizeAttributes)
|
|
29
29
|
.filter((column) => !column.startsWith("computed_"))
|
|
@@ -36,7 +36,7 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends AbstractTran
|
|
|
36
36
|
...tableToObjectFilledWithNulls,
|
|
37
37
|
// filter redundant properties and fill data to prepared structure
|
|
38
38
|
...Object.keys(chunk)
|
|
39
|
-
.filter((key) =>
|
|
39
|
+
.filter((key) => Object.keys(tableToObjectFilledWithNulls).includes(key))
|
|
40
40
|
.reduce((obj, key) => {
|
|
41
41
|
obj[key] = chunk[key];
|
|
42
42
|
return obj;
|
|
@@ -45,7 +45,7 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends AbstractTran
|
|
|
45
45
|
callback();
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
return (0, stream_1.pipeline)(input.sourceStream, (0, csv_parser_1.default)(), addColumns, (0, csv_stringify_1.default)({ header: true }), (err) => {
|
|
49
49
|
if (err) {
|
|
50
50
|
integration_engine_1.log.error(`Datasets: transformation error (${input.name}): ${err.toString()}`);
|
|
51
51
|
throw err;
|
|
@@ -54,8 +54,8 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends AbstractTran
|
|
|
54
54
|
integration_engine_1.log.info(`Datasets: transformation success (${input.name})`);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
return out;
|
|
58
57
|
};
|
|
58
|
+
this.transformElement = () => { };
|
|
59
59
|
this.name = ropid_gtfs_1.RopidGTFS.name;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,2FAA4G;AAC5G,iEAAgE;AAChE,4DAA6B;AAC7B,kEAAsC;AACtC,mCAAuD;AAQhD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,oCAAkB;IAG3D;QACI,KAAK,EAAE,CA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G,EAAE,EAAE;gBACxF,IAAI,GAAG,EAAE,CAAC;oBACN,wBAAG,CAAC,KAAK,CAAC,mCAAmC,KAAK,CAAC,IAAI,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBAC/E,MAAM,GAAG,CAAC;gBACd,CAAC;qBAAM,CAAC;oBACJ,wBAAG,CAAC,IAAI,CAAC,qCAAqC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;gBACjE,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEQ,qBAAgB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QArClC,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,IAAI,CAAC;IAC/B,CAAC;CAqCJ,CAAA;AA3CY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,qBAAU,GAAE;;GACA,uBAAuB,CA2CnC"}
|
|
@@ -41,7 +41,7 @@ class CollectAndSaveLogsTask extends workers_1.AbstractTask {
|
|
|
41
41
|
}
|
|
42
42
|
const validLogEntries = this.logFilter.getValidLogEntries(queryResult);
|
|
43
43
|
if (validLogEntries.length > 0) {
|
|
44
|
-
const presetLogDtos = this.logTransformation.
|
|
44
|
+
const presetLogDtos = await this.logTransformation.transform(queryResult);
|
|
45
45
|
this.logger.info(`${this.constructor.name}: ${presetLogDtos.length} log entries collected`);
|
|
46
46
|
await this.logRepository.saveData(presetLogDtos);
|
|
47
47
|
}
|
package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectAndSaveLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,+EAAoE;AAEpE,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAAiG;AAEjG,wFAAiF;AAEjF,g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,GAAG,EAAE,CAAC;YACX,IAAI,GAAG,YAAY,qCAAoB,EAAE,CAAC;gBACtC,MAAM,GAAG,CAAC;YACd,CAAC;YAED,MAAM,IAAI,gCAAe,CAAC,kCAAkC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvE,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"CollectAndSaveLogsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAC1C,+EAAoE;AAEpE,wEAAqE;AAErE,2FAAqF;AACrF,2EAA6E;AAC7E,6EAAiG;AAEjG,wFAAiF;AAEjF,gEAA6D;AAG7D,uEAA8E;AAG9E,MAAa,sBAAuB,SAAQ,sBAAkC;IAW1E,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAXP,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACnC,WAAM,GAAG,mDAA6B,CAAC;QAUnD,IAAI,CAAC,iBAAiB,GAAG,iBAAY,CAAC,OAAO,CACzC,2CAAoB,CAAC,0BAA0B,CAClD,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,iBAAY,CAAC,OAAO,CAA2B,2CAAoB,CAAC,uBAAuB,CAAC,CAAC;QACtH,IAAI,CAAC,aAAa,GAAG,iBAAY,CAAC,OAAO,CAAuB,2CAAoB,CAAC,mBAAmB,CAAC,CAAC;QAC1G,IAAI,CAAC,SAAS,GAAG,iBAAY,CAAC,OAAO,CAAa,2CAAoB,CAA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a,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,kCAAkC,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;CACJ;AAtDD,wDAsDC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ILogQueryData } from "../../../../../schema-definitions/ropid-departures-preset-logs/datasources/interfaces";
|
|
2
2
|
import { IPresetLogOutputDto } from "../../../../../schema-definitions/ropid-departures-preset-logs/models/interfaces";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { BaseTransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
4
|
+
import { IPresetLogTransformation } from "./interfaces/IPresetLogTransformation";
|
|
5
|
+
export declare class PresetLogTransformation extends BaseTransformation implements IPresetLogTransformation {
|
|
5
6
|
name: string;
|
|
6
|
-
|
|
7
|
+
transform: (data: ILogQueryData[]) => Promise<IPresetLogOutputDto[]>;
|
|
8
|
+
protected transformElement: (dataItem: Required<ILogQueryData>) => IPresetLogOutputDto;
|
|
7
9
|
}
|
|
@@ -7,13 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.PresetLogTransformation = void 0;
|
|
10
|
-
const
|
|
10
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
11
11
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
-
let PresetLogTransformation = class PresetLogTransformation extends
|
|
12
|
+
let PresetLogTransformation = class PresetLogTransformation extends transformations_1.BaseTransformation {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.name = "PresetLogTransformation";
|
|
16
|
-
this.
|
|
16
|
+
this.transform = (data) => {
|
|
17
|
+
const dto = [];
|
|
18
|
+
for (const dataItem of data) {
|
|
19
|
+
const dtoItem = this.transformElement(dataItem);
|
|
20
|
+
if (dtoItem) {
|
|
21
|
+
dto.push(dtoItem);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return Promise.resolve(dto);
|
|
25
|
+
};
|
|
26
|
+
this.transformElement = (dataItem) => {
|
|
17
27
|
// Use dummy hostname to parse relative URLs
|
|
18
28
|
// we want to normalize the relative URL without query params, leading slashes and other irregularities
|
|
19
29
|
const url = new URL(dataItem.stream.req_url, "http://golemio");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresetLogTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"PresetLogTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,2FAA2F;AAC3F,iEAAgE;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,oCAAkB;IAAxD;;QACI,SAAI,GAAG,yBAAyB,CAAC;QAEjC,cAAS,GAAG,CAAC,IAAqB,EAAkC,EAAE;YACzE,MAAM,GAAG,GAA0B,EAAE,CAAC;YACtC,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;gBAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAmC,CAAC,CAAC;gBAC3E,IAAI,OAAO,EAAE,CAAC;oBACV,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACtB,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC;QAEQ,qBAAgB,GAAG,CAAC,QAAiC,EAAuB,EAAE;YACpF,4CAA4C;YAC5C,uGAAuG;YACvG,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAC/D,MAAM,yBAAyB,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChE,MAAM,oBAAoB,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,yBAAyB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAE3F,OAAO;gBACH,WAAW,EAAE,oBAAoB;gBACjC,YAAY,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;gBAClE,YAAY,EAAE,KAAK;gBACnB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO;gBACpC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU;gBAC1C,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE;gBACvD,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC5D,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;aAClE,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;AAjCY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,qBAAU,GAAE;GACA,uBAAuB,CAiCnC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ILogQueryData } from "../../../../../../schema-definitions/ropid-departures-preset-logs/datasources/interfaces";
|
|
2
2
|
import { IPresetLogOutputDto } from "../../../../../../schema-definitions/ropid-departures-preset-logs/models/interfaces";
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
3
|
+
import { ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
4
|
+
export interface IPresetLogTransformation extends ITransformation {
|
|
5
|
+
transform: (data: ILogQueryData[]) => Promise<IPresetLogOutputDto[]>;
|
|
6
|
+
}
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { DatasetEnum } from "../../../../helpers/DatasetEnum";
|
|
2
|
-
import { ICisStopsTransformationData, ICisStopsTransformedData } from "../../../../transformations/RopidGTFSCisStopsTransformation";
|
|
3
|
-
import { IOisMappingTransformationData } from "../../../../transformations/RopidGTFSOisTransformation";
|
|
4
|
-
import { IRopidGtfsTransformationData } from "../../../../transformations/RopidGTFSTransformation";
|
|
5
2
|
import { DatasetModelName } from "../../../../../../schema-definitions/ropid-gtfs";
|
|
6
|
-
import { IRopidGTFSOisMappingData } from "../../../../../../schema-definitions/ropid-gtfs/RopidGTFSOisMapping";
|
|
7
|
-
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
8
3
|
import { RetryDataSource } from "@golemio/core/dist/integration-engine/datasources/RetryDataSource";
|
|
9
4
|
import { IFile } from "@golemio/core/dist/integration-engine/datasources/protocol-strategy/IProtocolStrategy";
|
|
10
|
-
import {
|
|
5
|
+
import { ITransformation } from "@golemio/core/dist/integration-engine/transformations/ITransformation";
|
|
11
6
|
export declare const ORIGIN_HOSTNAME_HEADER = "x-origin-hostname";
|
|
12
7
|
export type ICachedFileMeta = Omit<IFile, "data">;
|
|
13
8
|
export type ICachedDataset = ICachedFileMeta & {
|
|
@@ -18,16 +13,10 @@ export declare enum CacheContentType {
|
|
|
18
13
|
JSON = "JSON"
|
|
19
14
|
}
|
|
20
15
|
export type GTFSDatasets = Exclude<DatasetEnum, DatasetEnum.DEPARTURES_PRESETS>;
|
|
21
|
-
type DatasetTransformationMap = {
|
|
22
|
-
[DatasetEnum.PID_GTFS]: AbstractTransformation<IRopidGtfsTransformationData, Readable>;
|
|
23
|
-
[DatasetEnum.RUN_NUMBERS]: AbstractTransformation<IRopidGtfsTransformationData, Readable>;
|
|
24
|
-
[DatasetEnum.CIS_STOPS]: AbstractTransformation<ICisStopsTransformationData, ICisStopsTransformedData>;
|
|
25
|
-
[DatasetEnum.OIS_MAPPING]: AbstractTransformation<IOisMappingTransformationData, IRopidGTFSOisMappingData[]>;
|
|
26
|
-
};
|
|
27
16
|
export type DatasetMap = {
|
|
28
|
-
[
|
|
17
|
+
[key in GTFSDatasets]: {
|
|
29
18
|
datasource: RetryDataSource;
|
|
30
|
-
transformation:
|
|
19
|
+
transformation: ITransformation;
|
|
31
20
|
cacheContentType: CacheContentType;
|
|
32
21
|
};
|
|
33
22
|
};
|
|
@@ -38,4 +27,3 @@ export declare enum SaveMethod {
|
|
|
38
27
|
STREAM = "stream",
|
|
39
28
|
SEQUELIZE = "sequelize"
|
|
40
29
|
}
|
|
41
|
-
export {};
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelperTypes.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.ts"],"names":[],"mappings":";;;AAAA,iEAAiE;
|
|
1
|
+
{"version":3,"file":"HelperTypes.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.ts"],"names":[],"mappings":";;;AAAA,iEAAiE;AACjE,gFAAiF;AAKpE,QAAA,sBAAsB,GAAG,mBAAmB,CAAC;AAQ1D,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,iCAAa,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAYM,MAAM,eAAe,GAAG,CA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fsRouteSubAgencyTransformation;
|
|
15
15
|
constructor();
|
|
16
16
|
getDatasetMap(): DatasetMap;
|
|
17
|
-
getTransformation(dataset: GTFSDatasets): import("@golemio/core/dist/
|
|
17
|
+
getTransformation(dataset: GTFSDatasets): import("@golemio/core/dist/integration-engine").ITransformation;
|
|
18
18
|
getSaveMethod(dataset: DatasetEnum, modelName: string): SaveMethod;
|
|
19
19
|
loadAndTransformDataset(inputData: ICachedDataset, modelName: DatasetModelName): Promise<any>;
|
|
20
20
|
}
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js
CHANGED
|
@@ -19,7 +19,6 @@ const RopidGTFSTransformation_1 = require("../../../../transformations/RopidGTFS
|
|
|
19
19
|
const RopidGtfsRouteSubAgencyTransformation_1 = require("../../../../transformations/RopidGtfsRouteSubAgencyTransformation");
|
|
20
20
|
const ropid_gtfs_1 = require("../../../../../../schema-definitions/ropid-gtfs");
|
|
21
21
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
22
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
23
22
|
const RetryDataSource_1 = require("@golemio/core/dist/integration-engine/datasources/RetryDataSource");
|
|
24
23
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
25
24
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
@@ -124,26 +123,18 @@ let RopidGtfsFactory = class RopidGtfsFactory {
|
|
|
124
123
|
}
|
|
125
124
|
else if (inputData.dataset === DatasetEnum_1.DatasetEnum.PID_GTFS || inputData.dataset === DatasetEnum_1.DatasetEnum.RUN_NUMBERS) {
|
|
126
125
|
const sourceStream = this.staticFileRedisRepository.getReadableStream(inputData.filepath);
|
|
127
|
-
return this.transformationGtfs.
|
|
126
|
+
return await this.transformationGtfs.transform({
|
|
128
127
|
sourceStream,
|
|
129
128
|
name: modelName,
|
|
130
129
|
});
|
|
131
130
|
}
|
|
132
|
-
else
|
|
131
|
+
else {
|
|
133
132
|
const data = await this.staticFileRedisRepository.get(inputData.filepath);
|
|
134
|
-
return this.
|
|
135
|
-
data: JSON.parse(data),
|
|
133
|
+
return await this.datasetMap[inputData.dataset].transformation.transform({
|
|
134
|
+
data: this.datasetMap[inputData.dataset].cacheContentType === HelperTypes_1.CacheContentType.JSON ? JSON.parse(data) : data,
|
|
136
135
|
name: inputData.name,
|
|
137
136
|
});
|
|
138
137
|
}
|
|
139
|
-
else if (inputData.dataset === DatasetEnum_1.DatasetEnum.OIS_MAPPING) {
|
|
140
|
-
const data = await this.staticFileRedisRepository.get(inputData.filepath);
|
|
141
|
-
return this.transformationOisMapping.transformElement({
|
|
142
|
-
data: JSON.parse(data),
|
|
143
|
-
name: inputData.name,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
throw new golemio_errors_1.GeneralError(`Unknown dataset: ${inputData.dataset}`, this.constructor.name);
|
|
147
138
|
}
|
|
148
139
|
};
|
|
149
140
|
exports.RopidGtfsFactory = RopidGtfsFactory;
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGtfsFactory.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iEAAiE;AACjE,2CAA2D;AAC3D,qFAAqF;AACrF,iHAAiH;AACjH,uGAA8G;AAC9G,iGAAiG;AACjG,6HAA6H;AAC7H,gFAA8D;AAC9D,8EAM+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"RopidGtfsFactory.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iEAAiE;AACjE,2CAA2D;AAC3D,qFAAqF;AACrF,iHAAiH;AACjH,uGAA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AAE,SAAS,CAAC,IAAI;aACvB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ,CAAA;AA7JY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,qBAAU,GAAE;;GACA,gBAAgB,CA6J5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
2
2
|
import { IRopidVYMIEvent, IRopidVYMIEventOutput, IRopidVYMIEventRouteOutput, IRopidVYMIEventStopOutput } from "../../schema-definitions/ropid-vymi";
|
|
3
3
|
interface ITransformElementOutput {
|
|
4
4
|
event: IRopidVYMIEventOutput;
|
|
@@ -8,12 +8,12 @@ interface ITransformElementOutput {
|
|
|
8
8
|
interface ITransformedData extends Omit<ITransformElementOutput, "event"> {
|
|
9
9
|
events: IRopidVYMIEventOutput[];
|
|
10
10
|
}
|
|
11
|
-
export declare class RopidVYMIEventsTransformation extends
|
|
11
|
+
export declare class RopidVYMIEventsTransformation extends BaseTransformation implements ITransformation {
|
|
12
12
|
private static ROPID_DATE_TIME_FORMAT;
|
|
13
13
|
name: string;
|
|
14
14
|
constructor();
|
|
15
|
-
transform: (data: IRopidVYMIEvent[]) => ITransformedData
|
|
16
|
-
protected
|
|
15
|
+
transform: (data: IRopidVYMIEvent[]) => Promise<ITransformedData>;
|
|
16
|
+
protected transformElement: (event: IRopidVYMIEvent) => ITransformElementOutput;
|
|
17
17
|
private transformRoutes;
|
|
18
18
|
private transformStops;
|
|
19
19
|
private formatRopidAuditDateTime;
|