@golemio/ndic 1.1.4-dev.856047480 → 1.1.4-dev.869103701

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,3 @@
1
- drop table if exists public.rsd_tmc_osm_mapping;
2
- CREATE TABLE public.rsd_tmc_osm_mapping (
3
- lt_start int8 NULL,
4
- lt_end int8 NULL,
5
- osm_path text NULL
6
- );
7
- CREATE INDEX rsd_tmc_osm_mapping_idx ON public.rsd_tmc_osm_mapping USING btree (lt_start, lt_end);
8
-
9
-
10
1
  -- Drop table
11
2
 
12
3
  DROP TABLE if exists public.rsd_tmc_points;
@@ -9,11 +9,3 @@ VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}':
9
9
  INSERT INTO ndic_traffic_restrictions
10
10
  (exchange, publication_time, publication_creator, situation_id, situation_version, situation_version_time, situation_confidentiality, situation_information_status, situation_urgency, situation_record_version, situation_record_type, situation_record_id, situation_record_creation_time, situation_record_version_time, probability_of_occurrence, "source", validity_status, validity_overall_start_time, validity_overall_end_time, impact_capacity_remaining, impact_number_of_lanes_restricted, impact_number_of_operational_lanes, impact_original_number_of_lanes, impact_traffic_constriction_type, impact_delays_type, impact_delay_time_value, cause, general_public_comment, group_of_locations_type, supplementary_positional_description, destination, alert_c_linear, linear_within_linear_element, global_network_linear, linear_extension, geom_gn_line, geom_openlr_line, situation_record_extension, number_of_obstructions, mobility_of_obstruction, compliance_option, applicable_for_traffic_direction, applicable_for_traffic_type, places_at_which_applicable, for_vehicles_with_characteristics_of, roadworks_duration, roadworks_scale, under_traffic, urgent_roadworks, mobility, subjects, maintenance_vehicles, abnormal_traffic_type, accident_type, group_of_vehicles_involved, car_park_identity, car_park_occupancy, number_of_vacant_parking_spaces, driving_condition_type, construction_work_type, disturbance_activity_type, environmental_obstruction_type, general_instruction_to_road_users_type, general_message_to_road_users, general_network_management_type, traffic_manually_directed_by, infrastructure_damage_type, road_maintenance_type, non_weather_related_road_condition_type, poor_environment_type, public_event_type, rerouting_management_type, rerouting_itinerary_description, signed_rerouting, entry, "exit", road_or_junction_number, road_or_carriageway_or_lane_management_type, minimum_car_occupancy, roadside_assistance_type, speed_management_type, temporary_speed_limit, vehicle_obstruction_type, obstructing_vehicle, winter_equipment_management_type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, geom_alert_c_line, alert_c_direction)
11
11
  VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'MaintenanceWorks', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_MaintenanceWorks', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"RSD","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '2021-06-24 09:53:27.000', NULL, 1, 2, 2, NULL, NULL, NULL, NULL, '{"comment":{"values":{"value":{"_":"D1, mezi km 52 a 49, ve směru Praha, práce na silnici, zpevněná krajnice uzavřena, Od 21.06.2021 07:15 Do 21.06.2021 17:00, Sečení trávy strojně., sekání trávy a údržba travních porostů, pracovní místo DM - Krátkodobé pohyblivé (mobilní), zdroj: ŘSD","$":{"lang":"cs"}}}}}', 'Linear', '{"affectedCarriagewayAndLanes":{"carriageway":"mainCarriageway","lane":["hardShoulder","hardShoulder"]}}'::json, NULL, '{"$":{"xsi:type":"AlertCMethod2Linear"},"alertCLocationCountryCode":"CZ","alertCLocationTableNumber":"25","alertCLocationTableVersion":"8.0","alertCDirection":{"alertCDirectionCoded":"negative"},"alertCMethod2PrimaryPointLocation":{"alertCLocation":{"specificLocation":"1279"}},"alertCMethod2SecondaryPointLocation":{"alertCLocation":{"specificLocation":"25540"}}}'::json, '{"directionRelativeOnLinearSection":"opposite","linearElement":{"roadNumber":"D1"},"fromPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"52000"},"toPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"48999"}}'::json, '{"networkVersion":{"values":{"value":{"_":"20.12","$":{"lang":"cs"}}}},"linearGeometryType":"continuous","startPoint":{"sjtskPointCoordinates":{"sjtskX":"-705367.665475001","sjtskY":"-1085484.320675"}},"endPoint":{"sjtskPointCoordinates":{"sjtskX":"-708220.292120583","sjtskY":"-1085240.94330743"}},"linearWithinLinearGNElement":[{"sectionId":"716168","directionRelativeOnLinearSection":"aligned","orderOfSection":"0","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.25"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731284","directionRelativeOnLinearSection":"aligned","orderOfSection":"1","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731283","directionRelativeOnLinearSection":"aligned","orderOfSection":"2","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3776298","directionRelativeOnLinearSection":"aligned","orderOfSection":"3","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3737940","directionRelativeOnLinearSection":"aligned","orderOfSection":"4","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709908","directionRelativeOnLinearSection":"aligned","orderOfSection":"5","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709909","directionRelativeOnLinearSection":"aligned","orderOfSection":"6","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663080","directionRelativeOnLinearSection":"aligned","orderOfSection":"7","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"1358023","directionRelativeOnLinearSection":"aligned","orderOfSection":"8","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663072","directionRelativeOnLinearSection":"aligned","orderOfSection":"9","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721196","directionRelativeOnLinearSection":"aligned","orderOfSection":"10","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721193","directionRelativeOnLinearSection":"aligned","orderOfSection":"11","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3513651","directionRelativeOnLinearSection":"aligned","orderOfSection":"12","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.801408450704281"}}]}'::json, '{"openlrExtendedLinear":{"firstDirection":{"openlrLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.751823499059107","longitude":"15.024250722599788"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"304"},"openlrPathAttributes":{"openlrLowestFRCToNextLRPoint":"FRC0","openlrDistanceToNextLRPoint":"3918"}},"openlrLastLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.754080738289225","longitude":"14.973070308369639"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"128"}},"openlrOffsets":{"openlrPositiveOffset":"606","openlrNegativeOffset":"321"}}}}'::json, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'roadworks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, NULL);
12
-
13
- -- TO DO Add data for rsd_tmc_osm_mapping
14
- INSERT INTO public.rsd_tmc_osm_mapping
15
- (lt_start, lt_end, osm_path)
16
- VALUES(1279, 25540, '[74256918, 191823166, 191823171, 74269338, 262869174, 189021819, 189021825, 74177021, 189021808, 191834725, 189021814, 189021813, 191834765, 191823161, 5506226185, 191823018, 74084348, 74282499, 1600950538, 156250951, 1600950600, 156250948, 1600950646, 74177697, 74238396, 74244807, 156250944, 156250941, 976485311, 74153579, 156250937, 156250932, 74168337, 74279965, 151003135]');
17
- INSERT INTO public.rsd_tmc_osm_mapping
18
- (lt_start, lt_end, osm_path)
19
- VALUES(25631, 25632, '[156250932, 156250937, 74153579, 976485311]');
@@ -133,7 +133,7 @@ export interface IOutputApiSituationRecord {
133
133
  };
134
134
  };
135
135
  };
136
- osmPath: Record<string, any>;
136
+ osmPath?: number[];
137
137
  }
138
138
  export declare enum OutputApiSituationRecordType {
139
139
  ConstructionWorks = "CONSTRUCTION_WORKS",
@@ -2,10 +2,11 @@
2
2
  import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
3
3
  import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
4
4
  import { TrafficRestrictionsModel } from "./models";
5
+ import { OutputTrafficRestrictionsTransformation } from "./transformations/OutputTrafficRestrictionsTransformation";
5
6
  export declare class TrafficRouter extends BaseRouter {
6
7
  protected trafficRestrictionsModel: TrafficRestrictionsModel;
7
8
  private outputTrafficRestrictionsTransformation;
8
- constructor();
9
+ constructor(trafficRestrictionsModel: TrafficRestrictionsModel, outputTrafficRestrictionsTransformation: OutputTrafficRestrictionsTransformation);
9
10
  GetTrafficRestrictions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
10
11
  }
11
12
  declare const trafficRouter: Router;
@@ -17,9 +17,12 @@ const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRoute
17
17
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
18
18
  const models_1 = require("./models");
19
19
  const OutputTrafficRestrictionsTransformation_1 = require("./transformations/OutputTrafficRestrictionsTransformation");
20
+ const output_gateway_1 = require("@golemio/traffic-common/dist/output-gateway");
20
21
  class TrafficRouter extends BaseRouter_1.BaseRouter {
21
- constructor() {
22
+ constructor(trafficRestrictionsModel, outputTrafficRestrictionsTransformation) {
22
23
  super();
24
+ this.trafficRestrictionsModel = trafficRestrictionsModel;
25
+ this.outputTrafficRestrictionsTransformation = outputTrafficRestrictionsTransformation;
23
26
  this.GetTrafficRestrictions = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
24
27
  try {
25
28
  const dataFromDb = yield this.trafficRestrictionsModel.GetAll({
@@ -38,12 +41,10 @@ class TrafficRouter extends BaseRouter_1.BaseRouter {
38
41
  next(err);
39
42
  }
40
43
  });
41
- this.trafficRestrictionsModel = new models_1.TrafficRestrictionsModel();
42
- this.outputTrafficRestrictionsTransformation = new OutputTrafficRestrictionsTransformation_1.OutputTrafficRestrictionsTransformation();
43
44
  this.router.get("/restrictions", [(0, express_validator_1.query)("moment").optional().isISO8601(), (0, express_validator_1.query)("situationRecordType").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("TrafficRouter"), (0, redis_1.useCacheMiddleware)(), this.GetTrafficRestrictions);
44
45
  }
45
46
  }
46
47
  exports.TrafficRouter = TrafficRouter;
47
- const trafficRouter = new TrafficRouter().router;
48
+ const trafficRouter = new TrafficRouter(new models_1.TrafficRestrictionsModel(), new OutputTrafficRestrictionsTransformation_1.OutputTrafficRestrictionsTransformation(new output_gateway_1.RsdTmcOsmMappingRepository())).router;
48
49
  exports.trafficRouter = trafficRouter;
49
50
  //# sourceMappingURL=TrafficRouter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAoD;AACpD,uHAAsH;AAEtH,MAAa,aAAc,SAAQ,uBAAU;IAIzC;QACI,KAAK,EAAE,CAAC;QAeL,2BAAsB,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACtF,IAAI;gBACA,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,M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CAAC,CAAC;iBACtE;gBACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,uCAAuC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBACjG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACzC;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QA3BE,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,eAAe,EACf,CAAC,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,IAAA,yBAAK,EAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAC5F,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,eAAe,CAAC,EAC1C,IAAA,0BAAkB,GAAE,EACpB,IAAI,CAAC,sBAAsB,CAC9B,CAAC;IACN,CAAC;CAmBJ;AAnCD,sCAmCC;AAED,MAAM,aAAa,GAAW,IAAI,aAAa,CAC3C,IAAI,iCAAwB,EAAE,EAC9B,IAAI,iFAAuC,CAAC,IAAI,2CAA0B,EAAE,CAAC,CAChF,CAAC,MAAM,CAAC;AAEA,sCAAa"}
@@ -1,2 +1 @@
1
1
  export * from "./TrafficRestrictionsModel";
2
- export * from "./RsdTmcOsmMappingModel";
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./TrafficRestrictionsModel"), exports);
18
- __exportStar(require("./RsdTmcOsmMappingModel"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C"}
@@ -1,9 +1,9 @@
1
1
  import { ITrafficRestrictionsModel, IOutputApiRestrictions, OutputApiSituationRecordType } from "../../integration-engine/transformations/TrafficRestrictionsInterface";
2
- import { RsdTmcOsmMappingModel } from "../models";
2
+ import { RsdTmcOsmMappingRepository } from "@golemio/traffic-common/dist/output-gateway";
3
3
  export declare class OutputTrafficRestrictionsTransformation {
4
4
  name: string;
5
- protected rsdTmcOsmMappingModel: RsdTmcOsmMappingModel;
6
- constructor();
5
+ protected rsdTmcOsmMappingRepository: RsdTmcOsmMappingRepository;
6
+ constructor(rsdTmcOsmMappingRepository: RsdTmcOsmMappingRepository);
7
7
  transform: (data: ITrafficRestrictionsModel[]) => Promise<IOutputApiRestrictions>;
8
8
  private transformSituationsArr;
9
9
  private transformRecordsArr;
@@ -11,4 +11,5 @@ export declare class OutputTrafficRestrictionsTransformation {
11
11
  private generalPublicCommentParsing;
12
12
  private sourceNameParsing;
13
13
  private groupByOneProperty;
14
+ private getRsdTmcOsmMapping;
14
15
  }
@@ -16,10 +16,9 @@ exports.OutputTrafficRestrictionsTransformation = void 0;
16
16
  const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
17
17
  const _sch_1 = require("../../schema-definitions");
18
18
  const TrafficRestrictionsInterface_1 = require("../../integration-engine/transformations/TrafficRestrictionsInterface");
19
- const models_1 = require("../models");
20
19
  const ParserHelper_1 = require("../../integration-engine/transformations/ParserHelper");
21
20
  class OutputTrafficRestrictionsTransformation {
22
- constructor() {
21
+ constructor(rsdTmcOsmMappingRepository) {
23
22
  this.transform = (data) => __awaiter(this, void 0, void 0, function* () {
24
23
  // Format needed: "publicationTime": "2022-03-31T14:12:11+02:00",
25
24
  const publicationTime = data.reduce((acc, curr) => acc.publication_time > curr.publication_time ? acc : curr).publication_time;
@@ -45,8 +44,7 @@ class OutputTrafficRestrictionsTransformation {
45
44
  return previous;
46
45
  }, {});
47
46
  this.name = _sch_1.Ndic.traffic_restrictions.name;
48
- this.rsdTmcOsmMappingModel = new models_1.RsdTmcOsmMappingModel();
49
- this.rsdTmcOsmMappingModel.sequelizeModel.removeAttribute("id");
47
+ this.rsdTmcOsmMappingRepository = rsdTmcOsmMappingRepository;
50
48
  }
51
49
  transformSituationsArr(dataFromDbArr) {
52
50
  return __awaiter(this, void 0, void 0, function* () {
@@ -84,18 +82,13 @@ class OutputTrafficRestrictionsTransformation {
84
82
  });
85
83
  }
86
84
  transformRecordsArr(oneSituationArr) {
87
- var _a, _b, _c, _d, _e, _f, _g, _h;
85
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
88
86
  return __awaiter(this, void 0, void 0, function* () {
89
87
  const resultRecordsArr = [];
90
88
  for (const record of oneSituationArr) {
91
89
  const ltStart = ((_a = record.alert_c_linear) === null || _a === void 0 ? void 0 : _a.alertCMethod2PrimaryPointLocation.alertCLocation.specificLocation) || null;
92
90
  const ltEnd = ((_b = record.alert_c_linear) === null || _b === void 0 ? void 0 : _b.alertCMethod2SecondaryPointLocation.alertCLocation.specificLocation) || null;
93
91
  const ltDirection = (_c = record.alert_c_linear) === null || _c === void 0 ? void 0 : _c.alertCDirection.alertCDirectionCoded;
94
- const rsdTmcOsmMappingModelOptions = {
95
- ltStart,
96
- ltEnd,
97
- ltDirection,
98
- };
99
92
  resultRecordsArr.push({
100
93
  id: record.situation_record_id,
101
94
  situationRecordCreationTime: (0, moment_timezone_1.default)(record.situation_record_creation_time).tz("Europe/Prague").format(),
@@ -134,7 +127,7 @@ class OutputTrafficRestrictionsTransformation {
134
127
  },
135
128
  },
136
129
  },
137
- osmPath: yield this.rsdTmcOsmMappingModel.GetOne(rsdTmcOsmMappingModelOptions),
130
+ osmPath: (_j = (yield this.getRsdTmcOsmMapping(Number(ltStart), Number(ltEnd), ltDirection))) !== null && _j !== void 0 ? _j : undefined,
138
131
  });
139
132
  }
140
133
  return resultRecordsArr;
@@ -189,6 +182,15 @@ class OutputTrafficRestrictionsTransformation {
189
182
  }
190
183
  return source;
191
184
  }
185
+ getRsdTmcOsmMapping(ltStart, ltEnd, ltDirection) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ const osmPath = yield this.rsdTmcOsmMappingRepository.GetOne({ ltStart, ltEnd });
188
+ if (Array.isArray(osmPath) && ltDirection === "negative") {
189
+ return osmPath.reverse();
190
+ }
191
+ return osmPath;
192
+ });
193
+ }
192
194
  }
193
195
  exports.OutputTrafficRestrictionsTransformation = OutputTrafficRestrictionsTransformation;
194
196
  //# sourceMappingURL=OutputTrafficRestrictionsTransformation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OutputTrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputTrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA+D;AAC/D,mDAA4B;AAC5B,wHAM0D;AAE1D,sCAAmD;AACnD,wFAA+D;AAE/D,MAAa,uCAAuC;IAIhD;QAMO,cAAS,GAAG,CAAO,IAAiC,EAAE,EAAE;YAC3D,iEAAiE;YACjE,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAC9C,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAC5D,CAAC,gBAAgB,CAAC;YAEnB,MAAM,MAAM,GAA2B;gBACnC,gBAAgB,EAAE,GAAG;gBACrB,yBAAyB,EAAE;oBACvB,IAAI,EAAE,IAAI;oBACV,eAAe,EAAE,IAAA,yBAAM,EAAC,eAAe,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE;oBACrE,kBAAkB,EAAE;wBAChB,OAAO,EAAE,IAAI;wBACb,kBAAkB,EAAE,MAAM;qBAC7B;oB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IAAI,cAAc,EAAE;oBAChD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBACrD,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBAC/F;gBACD,OAAO,SAAS,CAAC;aACpB;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO;YACH,EAAE,EAAE,OAAO;SACd,CAAC;IACN,CAAC;IAEO,iBAAiB,CAAC,MAA0B;QAChD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACnB,IAAI;gBACA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACrC,OAAO,SAAS,CAAC,oBAAoB,CAAC;aACzC;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CASJ;AAvLD,0FAuLC"}
1
+ {"version":3,"file":"OutputTrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputTrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA+D;AAC/D,mDAA4B;AAC5B,wHAM0D;AAE1D,wFAA+D;AAG/D,MAAa,uCAAuC;IAIhD,YAAY,0BAAsD;QAK3D,cAAS,GAAG,CAAO,IAAiC,EAAE,EAAE;YAC3D,iEAAiE;YACjE,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAC9C,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,C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AAI,WAAW,KAAK,UAAU,EAAE;gBACtD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAC5B;YACD,OAAO,OAAO,CAAC;QACnB,CAAC;KAAA;CACJ;AAxLD,0FAwLC"}
@@ -6,7 +6,6 @@ const traffic_restrictions_datasource_schema_1 = require("./schemas/traffic_rest
6
6
  const traffic_info_output_schema_1 = require("./schemas/traffic_info_output_schema");
7
7
  const traffic_restrictions_output_schema_1 = require("./schemas/traffic_restrictions_output_schema");
8
8
  const rsd_tmc_points_output_schema_1 = require("./schemas/rsd_tmc_points_output_schema");
9
- const rsd_tmc_osm_mapping_output_schema_1 = require("./schemas/rsd_tmc_osm_mapping_output_schema");
10
9
  const forExport = {
11
10
  name: "Ndic",
12
11
  pgSchema: "ndic",
@@ -30,12 +29,6 @@ const forExport = {
30
29
  outputSequelizeAttributes: rsd_tmc_points_output_schema_1.outputRsdTmcPointsSDMA,
31
30
  pgTableName: "rsd_tmc_points",
32
31
  },
33
- rsd_tmc_osm_mapping: {
34
- name: "LtOsmMapping",
35
- outputSchema: rsd_tmc_osm_mapping_output_schema_1.outputRsdTmcOsmMappingSchema,
36
- outputSequelizeAttributes: rsd_tmc_osm_mapping_output_schema_1.outputRsdTmcOsmMappingSDMA,
37
- pgTableName: "rsd_tmc_osm_mapping",
38
- },
39
32
  };
40
33
  exports.Ndic = forExport;
41
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,6FAA0F;AAC1F,6GAA0G;AAE1G,qFAAyG;AACzG,qGAAiI;AACjI,yFAA6G;AAC7G,mGAA0H;AAE1H,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,4DAA2B;QAC7C,YAAY,EAAE,oDAAuB;QACrC,yBAAyB,EAAE,kDAAqB;QAChD,WAAW,EAAE,mBAAmB;KACnC;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,yBAAyB;QAC/B,gBAAgB,EAAE,4EAAmC;QACrD,YAAY,EAAE,oEAA+B;QAC7C,yBAAyB,EAAE,kEAA6B;QACxD,WAAW,EAAE,2BAA2B;KAC3C;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,uDAAwB;QACtC,yBAAyB,EAAE,qDAAsB;QACjD,WAAW,EAAE,gBAAgB;KAChC;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,gEAA4B;QAC1C,yBAAyB,EAAE,8DAA0B;QACrD,WAAW,EAAE,qBAAqB;KACrC;CACJ,CAAC;AAEoB,yBAAI"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,6FAA0F;AAC1F,6GAA0G;AAE1G,qFAAyG;AACzG,qGAAiI;AACjI,yFAA6G;AAG7G,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,4DAA2B;QAC7C,YAAY,EAAE,oDAAuB;QACrC,yBAAyB,EAAE,kDAAqB;QAChD,WAAW,EAAE,mBAAmB;KACnC;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,yBAAyB;QAC/B,gBAAgB,EAAE,4EAAmC;QACrD,YAAY,EAAE,oEAA+B;QAC7C,yBAAyB,EAAE,kEAA6B;QACxD,WAAW,EAAE,2BAA2B;KAC3C;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,uDAAwB;QACtC,yBAAyB,EAAE,qDAAsB;QACjD,WAAW,EAAE,gBAAgB;KAChC;CACJ,CAAC;AAEoB,yBAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/ndic",
3
- "version": "1.1.4-dev.856047480",
3
+ "version": "1.1.4-dev.869103701",
4
4
  "description": "Golemio NDIC Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,6 +37,7 @@
37
37
  "@golemio/cli": "1.4.2",
38
38
  "@golemio/core": "1.6.8",
39
39
  "@golemio/db-common": "1.1.1",
40
+ "@golemio/traffic-common": "0.1.0-dev.864393677",
40
41
  "@golemio/eslint-config": "1.1.0",
41
42
  "@ovos-media/ts-transform-paths": "^1.7.18-1",
42
43
  "@types/body-parser-xml": "^1.1.0",
@@ -69,6 +70,7 @@
69
70
  "typescript": "4.6.4"
70
71
  },
71
72
  "peerDependencies": {
72
- "@golemio/core": ">=1.5.0"
73
+ "@golemio/core": ">=1.5.0",
74
+ "@golemio/traffic-common": "0.1.0-dev.864393677"
73
75
  }
74
76
  }
@@ -1,17 +0,0 @@
1
- import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
2
- export declare class RsdTmcOsmMappingModel extends SequelizeModel {
3
- constructor();
4
- /**
5
- * @param {object} [options] Options object with params
6
- * @param {number} [options.ltStart] Options object with params
7
- * @param {number} [options.ltEnd] Options object with params
8
- * @param {number} [options.ltDirection] Options object with params
9
- * @returns Array of the retrieved records
10
- */
11
- GetOne: (options: {
12
- ltStart: string;
13
- ltEnd: string;
14
- ltDirection: string;
15
- }) => Promise<any>;
16
- GetAll: () => Promise<object | null>;
17
- }
@@ -1,71 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.RsdTmcOsmMappingModel = void 0;
16
- const _sch_1 = require("../../schema-definitions");
17
- const models_1 = require("@golemio/core/dist/output-gateway/models");
18
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
19
- const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
20
- class RsdTmcOsmMappingModel extends models_1.SequelizeModel {
21
- constructor() {
22
- super(_sch_1.Ndic.rsd_tmc_osm_mapping.name + "Model", _sch_1.Ndic.rsd_tmc_osm_mapping.pgTableName, _sch_1.Ndic.rsd_tmc_osm_mapping.outputSequelizeAttributes);
23
- /**
24
- * @param {object} [options] Options object with params
25
- * @param {number} [options.ltStart] Options object with params
26
- * @param {number} [options.ltEnd] Options object with params
27
- * @param {number} [options.ltDirection] Options object with params
28
- * @returns Array of the retrieved records
29
- */
30
- this.GetOne = (options) => __awaiter(this, void 0, void 0, function* () {
31
- let { ltStart, ltEnd, ltDirection } = options;
32
- if (!ltStart || !ltEnd || !ltDirection)
33
- return null;
34
- try {
35
- const and = sequelize_1.default.Op.and;
36
- const where = {
37
- [and]: [],
38
- };
39
- where[and].push({
40
- lt_start: +ltStart,
41
- });
42
- where[and].push({
43
- lt_end: +ltEnd,
44
- });
45
- const rsdTmcOsmMappingFromDB = yield this.sequelizeModel.findOne({
46
- attributes: ["lt_start", "lt_end", "osm_path"],
47
- raw: true,
48
- where,
49
- });
50
- try {
51
- let resultArr = JSON.parse(rsdTmcOsmMappingFromDB === null || rsdTmcOsmMappingFromDB === void 0 ? void 0 : rsdTmcOsmMappingFromDB.osm_path);
52
- if (Array.isArray(resultArr) && ltDirection === "negative") {
53
- return resultArr.reverse();
54
- }
55
- return resultArr;
56
- }
57
- catch (e) {
58
- return null;
59
- }
60
- }
61
- catch (err) {
62
- throw new golemio_errors_1.CustomError("Database error", true, "RsdTmcOsmMappingModel.GetOne", 500, err);
63
- }
64
- });
65
- this.GetAll = () => __awaiter(this, void 0, void 0, function* () {
66
- throw new golemio_errors_1.CustomError("Not implemented", true, "Method RsdTmcOsmMappingModel.GetAll is not implemented");
67
- });
68
- }
69
- }
70
- exports.RsdTmcOsmMappingModel = RsdTmcOsmMappingModel;
71
- //# sourceMappingURL=RsdTmcOsmMappingModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RsdTmcOsmMappingModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/RsdTmcOsmMappingModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA4B;AAC5B,qEAA0E;AAC1E,6EAAuE;AACvE,oFAA4D;AAE5D,MAAa,qBAAsB,SAAQ,uBAAc;IACrD;QACI,KAAK,CACD,WAAI,CAAC,mBAAmB,CAAC,IAAI,GAAG,OAAO,EACvC,WAAI,CAAC,mBAAmB,CAAC,WAAW,EACpC,WAAI,CAAC,mBAAmB,CAAC,yBAAyB,CACrD,CAAC;QAGN;;;;;;WAMG;QAEI,WAAM,GAAG,CAAO,OAAgE,EAAgB,EAAE;YACrG,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAC9C,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAC;YACpD,IAAI;gBACA,MAAM,GAAG,GAAG,mBAAS,CAAC,EAAE,CAAC,GAAG,CAAC;gBAC7B,MAAM,KAAK,GAAQ;oBACf,CAAC,GAAG,CAAC,EAAE,EAAE;iBACZ,CAAC;gBACF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACZ,QAAQ,EAAE,CAAC,OAAO;iBACrB,CAAC,CAAC;gBACH,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBAC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