@golemio/pid 2.2.10-dev.590640408 → 2.2.10-dev.597228873
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/db/example/10_cancelledTrip_example.sql +6 -0
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsModel.js +9 -20
- package/dist/integration-engine/ropid-vymi/models/RopidVYMIEventsModel.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/VehiclePositionsWorker.js +1 -1
- package/dist/integration-engine/vehicle-positions/VehiclePositionsWorker.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/helpers/ValidToCalculator.d.ts +2 -1
- package/dist/integration-engine/vehicle-positions/helpers/ValidToCalculator.js +9 -3
- package/dist/integration-engine/vehicle-positions/helpers/ValidToCalculator.js.map +1 -1
- package/dist/output-gateway/pid/PIDRouter.d.ts +7 -17
- package/dist/output-gateway/pid/PIDRouter.js +33 -146
- package/dist/output-gateway/pid/PIDRouter.js.map +1 -1
- package/dist/output-gateway/pid/constants/index.d.ts +1 -0
- package/dist/output-gateway/pid/constants/index.js +18 -0
- package/dist/output-gateway/pid/constants/index.js.map +1 -0
- package/dist/output-gateway/pid/constants/validations.d.ts +7 -0
- package/dist/output-gateway/pid/constants/validations.js +29 -0
- package/dist/output-gateway/pid/constants/validations.js.map +1 -0
- package/dist/output-gateway/pid/controllers/DepartureBoardsController.d.ts +7 -0
- package/dist/output-gateway/pid/controllers/DepartureBoardsController.js +79 -0
- package/dist/output-gateway/pid/controllers/DepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/pid/controllers/InfotextsController.d.ts +7 -0
- package/dist/output-gateway/pid/controllers/InfotextsController.js +36 -0
- package/dist/output-gateway/pid/controllers/InfotextsController.js.map +1 -0
- package/dist/output-gateway/pid/controllers/index.d.ts +2 -0
- package/dist/output-gateway/pid/controllers/index.js +19 -0
- package/dist/output-gateway/pid/controllers/index.js.map +1 -0
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.d.ts +17 -0
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js +67 -0
- package/dist/output-gateway/pid/dto/DepartureBoardsDTO.js.map +1 -0
- package/dist/output-gateway/pid/dto/index.d.ts +1 -0
- package/dist/output-gateway/pid/dto/index.js +18 -0
- package/dist/output-gateway/pid/dto/index.js.map +1 -0
- package/dist/output-gateway/pid/middleware/checkTimeFromMiddleware.d.ts +6 -0
- package/dist/output-gateway/pid/middleware/checkTimeFromMiddleware.js +28 -0
- package/dist/output-gateway/pid/middleware/checkTimeFromMiddleware.js.map +1 -0
- package/dist/output-gateway/pid/middleware/index.d.ts +1 -0
- package/dist/output-gateway/pid/middleware/index.js +18 -0
- package/dist/output-gateway/pid/middleware/index.js.map +1 -0
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.d.ts +1 -2
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +0 -6
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.d.ts +1 -17
- package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js +1 -17
- package/dist/output-gateway/pid/models/RopidDeparturesDirectionsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/RopidVYMIEventsRoutesModel.d.ts +9 -0
- package/dist/output-gateway/pid/models/RopidVYMIEventsRoutesModel.js +21 -0
- package/dist/output-gateway/pid/models/RopidVYMIEventsRoutesModel.js.map +1 -0
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.d.ts +28 -18
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js +89 -26
- package/dist/output-gateway/pid/models/RopidVYMIEventsStopsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/index.d.ts +1 -0
- package/dist/output-gateway/pid/models/index.js +1 -0
- package/dist/output-gateway/pid/models/index.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopModel.d.ts +1 -1
- package/dist/output-gateway/shared/RopidRouterUtils.d.ts +5 -0
- package/dist/output-gateway/shared/RopidRouterUtils.js +7 -0
- package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
- package/dist/output-gateway/shared/decorators/index.d.ts +1 -0
- package/dist/output-gateway/shared/decorators/index.js +18 -0
- package/dist/output-gateway/shared/decorators/index.js.map +1 -0
- package/dist/output-gateway/shared/decorators/transformers.d.ts +2 -0
- package/dist/output-gateway/shared/decorators/transformers.js +9 -0
- package/dist/output-gateway/shared/decorators/transformers.js.map +1 -0
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js +0 -1
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PIDRouter.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/PIDRouter.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"PIDRouter.js","sourceRoot":"","sources":["../../../src/output-gateway/pid/PIDRouter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAC3D,mFAA2E;AAC3E,oFAAiF;AACjF,6EAAkH;AAClH,mEAA6E;AAC7E,6CAAuD;AACvD,2CAA8D;AAC9D,+CAA+E;AAE/E,MAAa,SAAU,SAAQ,uBAAU;IAKrC;QACI,KAAK,EAAE,CAAC;QALI,WAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QAc1B,kCAA6B,GAAG,GAAG,EAAE;YACzC,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,2CAA+B,CAAC;YAClG,MAAM,UAAU,GAAG;gBACf,IAAA,yBAAK,EAAC;oBACF,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;oBAClC,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE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EAAE,CAAC;QAErD,kBAAkB;QAClB,IAAI,CAAC,6BAA6B,EAAE,CAAC;QACrC,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACnC,CAAC;CAmDJ;AAhED,8BAgEC;AAED,MAAM,SAAS,GAAW,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC;AACxC,8BAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./validations";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./validations"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.departureBoardsValidationArrays = void 0;
|
|
7
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
8
|
+
exports.departureBoardsValidationArrays = {
|
|
9
|
+
departureMode: ["departures", "arrivals", "mixed"],
|
|
10
|
+
order: ["real", "timetable"],
|
|
11
|
+
filter: [
|
|
12
|
+
"none",
|
|
13
|
+
"routeOnce",
|
|
14
|
+
"routeHeadingOnce",
|
|
15
|
+
"routeOnceFill",
|
|
16
|
+
"routeHeadingOnceFill",
|
|
17
|
+
"routeHeadingOnceNoGap",
|
|
18
|
+
"routeHeadingOnceNoGapFill",
|
|
19
|
+
],
|
|
20
|
+
skip: ["untracked", "canceled", "atStop" /*, "onInfotext"*/],
|
|
21
|
+
// TODO replace moment.tz.names() with Intl.supportedValuesOf("timeZone") after migrating to Node 18
|
|
22
|
+
prefferedTimezone: moment_timezone_1.default.tz.names().concat(moment_timezone_1.default.tz
|
|
23
|
+
.names()
|
|
24
|
+
// concats only those names that have character /
|
|
25
|
+
.filter((name) => name.match(/\//g))
|
|
26
|
+
// that is replaced with _
|
|
27
|
+
.map((name) => name.replace(/\//g, "_"))),
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=validations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/constants/validations.ts"],"names":[],"mappings":";;;;;;AAAA,gGAA+D;AAElD,QAAA,+BAA+B,GAAG;IAC3C,aAAa,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC;IAClD,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;IAC5B,MAAM,EAAE;QACJ,MAAM;QACN,WAAW;QACX,kBAAkB;QAClB,eAAe;QACf,sBAAsB;QACtB,uBAAuB;QACvB,2BAA2B;KAC9B;IACD,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAC5D,oGAAoG;IACpG,iBAAiB,EAAE,yBAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CACvC,yBAAM,CAAC,EAAE;SACJ,KAAK,EAAE;QACR,iDAAiD;SAChD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,0BAA0B;SACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAC/C;CACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.DepartureBoardsController = void 0;
|
|
16
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
17
|
+
const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
|
|
18
|
+
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
19
|
+
const shared_1 = require("../../shared");
|
|
20
|
+
const models_1 = require("../models");
|
|
21
|
+
const dto_1 = require("../dto");
|
|
22
|
+
class DepartureBoardsController {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.getDepartureBoard = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
|
+
const query = shared_1.RopidRouterUtils.mapObjectToDTOInstance(dto_1.DepartureBoardsQueryDTO, req.query);
|
|
27
|
+
const preferredTimezone = shared_1.RopidRouterUtils.validateAndReturnTimezone(query.preferredTimezone, this.constructor.name);
|
|
28
|
+
// datetime is valid ISO 8601 (by express validator)
|
|
29
|
+
// it matches:
|
|
30
|
+
// 2020-10-10T10:00:00Z
|
|
31
|
+
// 2020-10-10 10:00:00.00Z
|
|
32
|
+
// 2020-10-10T10:00:00+02
|
|
33
|
+
// 2020-10-10T10:00:00+02:00
|
|
34
|
+
const timezoneDefinedRegexp = /[T ][\d:\.]+([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)/;
|
|
35
|
+
// use timezone from ?preferredTimezone if not set in ?timeFrom
|
|
36
|
+
const timeFrom = query.timeFrom
|
|
37
|
+
? query.timeFrom.match(timezoneDefinedRegexp)
|
|
38
|
+
? (0, moment_timezone_1.default)(query.timeFrom)
|
|
39
|
+
: moment_timezone_1.default.tz(query.timeFrom, preferredTimezone)
|
|
40
|
+
: undefined;
|
|
41
|
+
const span = (0, trace_provider_1.createChildSpan)("DepartureBoardsController.getDepartureBoard", config_1.config.telemetry);
|
|
42
|
+
try {
|
|
43
|
+
const data = yield this.departureBoardsModel.GetAll({
|
|
44
|
+
aswIds: query.aswIds,
|
|
45
|
+
cisIds: query.cisIds,
|
|
46
|
+
gtfsIds: query.ids,
|
|
47
|
+
names: query.names,
|
|
48
|
+
minutesAfter: query.minutesAfter,
|
|
49
|
+
minutesBefore: query.minutesBefore,
|
|
50
|
+
timeFrom,
|
|
51
|
+
mode: query.mode,
|
|
52
|
+
order: query.order,
|
|
53
|
+
filter: query.filter,
|
|
54
|
+
skip: query.skip,
|
|
55
|
+
limit: query.limit,
|
|
56
|
+
offset: query.offset,
|
|
57
|
+
total: (_a = query.total) !== null && _a !== void 0 ? _a : query.limit,
|
|
58
|
+
timezone: preferredTimezone,
|
|
59
|
+
});
|
|
60
|
+
// allow access response Date header
|
|
61
|
+
res.setHeader("access-control-expose-headers", "date");
|
|
62
|
+
res.status(200).send({
|
|
63
|
+
stops: data.stops,
|
|
64
|
+
departures: data.departures,
|
|
65
|
+
infotexts: data.infotexts,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
next(err);
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
span === null || span === void 0 ? void 0 : span.end();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
this.departureBoardsModel = new models_1.PIDDepartureBoardsModel();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.DepartureBoardsController = DepartureBoardsController;
|
|
79
|
+
//# sourceMappingURL=DepartureBoardsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DepartureBoardsController.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/controllers/DepartureBoardsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gGAA2E;AAE3E,+FAA6F;AAC7F,qEAAkE;AAClE,yCAA8C;AAC9C,sCAAyD;AACzD,gCAAsD;AAEtD,MAAa,yBAAyB;IAGlC;QAIO,sBAAiB,GAAmB,CAAO,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;;YAChE,MAAM,KAAK,GAAG,yBAAgB,CAAC,sBAAsB,CAAC,6BAAuB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YAC1F,MAAM,iBAAiB,GAAG,yBAAgB,CAAC,yBAAyB,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAErH,oDAAoD;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AE,MAAM,CAAC,CAAC;gBACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;iBAC5B,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;oBAAS;gBACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;aACf;QACL,CAAC,CAAA,CAAC;QApDE,IAAI,CAAC,oBAAoB,GAAG,IAAI,gCAAuB,EAAE,CAAC;IAC9D,CAAC;CAoDJ;AAzDD,8DAyDC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InfotextsController = void 0;
|
|
13
|
+
const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
|
|
14
|
+
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
15
|
+
const models_1 = require("../models");
|
|
16
|
+
class InfotextsController {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.getInfotexts = (_req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const span = (0, trace_provider_1.createChildSpan)("InfotextsController.getInfotexts", config_1.config.telemetry);
|
|
20
|
+
try {
|
|
21
|
+
const preferredTimezone = config_1.config.vehiclePositions.defaultTimezone;
|
|
22
|
+
const data = yield this.eventsStopsModel.GetAllWithRoutes(preferredTimezone);
|
|
23
|
+
res.status(200).send(data);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
next(err);
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
span === null || span === void 0 ? void 0 : span.end();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
this.eventsStopsModel = new models_1.RopidVYMIEventsStopsModel();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.InfotextsController = InfotextsController;
|
|
36
|
+
//# sourceMappingURL=InfotextsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfotextsController.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/controllers/InfotextsController.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+FAA6F;AAC7F,qEAAkE;AAClE,sCAA2D;AAE3D,MAAa,mBAAmB;IAG5B;QAIO,iBAAY,GAAmB,CAAO,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5D,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,kCAAkC,EAAE,eAAM,CAAC,SAAS,CAAC,CAAC;YAEnF,IAAI;gBACA,MAAM,iBAAiB,GAAG,eAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC;gBAClE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;gBAC7E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;oBAAS;gBACN,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,EAAE,CAAC;aACf;QACL,CAAC,CAAA,CAAC;QAfE,IAAI,CAAC,gBAAgB,GAAG,IAAI,kCAAyB,EAAE,CAAC;IAC5D,CAAC;CAeJ;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DepartureBoardsController"), exports);
|
|
18
|
+
__exportStar(require("./InfotextsController"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,wDAAsC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class DepartureBoardsQueryDTO {
|
|
2
|
+
aswIds: string[];
|
|
3
|
+
cisIds: string[];
|
|
4
|
+
ids: string[];
|
|
5
|
+
names: string[];
|
|
6
|
+
skip: string[];
|
|
7
|
+
limit: number;
|
|
8
|
+
minutesAfter: number;
|
|
9
|
+
minutesBefore: number;
|
|
10
|
+
total?: number;
|
|
11
|
+
preferredTimezone?: string;
|
|
12
|
+
timeFrom?: string;
|
|
13
|
+
mode?: string;
|
|
14
|
+
order?: string;
|
|
15
|
+
filter?: string;
|
|
16
|
+
offset?: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DepartureBoardsQueryDTO = void 0;
|
|
13
|
+
const decorators_1 = require("../../shared/decorators");
|
|
14
|
+
class DepartureBoardsQueryDTO {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.aswIds = [];
|
|
17
|
+
this.cisIds = [];
|
|
18
|
+
this.ids = [];
|
|
19
|
+
this.names = [];
|
|
20
|
+
this.skip = [];
|
|
21
|
+
this.limit = 20;
|
|
22
|
+
this.minutesAfter = 180;
|
|
23
|
+
this.minutesBefore = 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, decorators_1.TransformArray)(),
|
|
28
|
+
__metadata("design:type", Array)
|
|
29
|
+
], DepartureBoardsQueryDTO.prototype, "aswIds", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, decorators_1.TransformArray)(),
|
|
32
|
+
__metadata("design:type", Array)
|
|
33
|
+
], DepartureBoardsQueryDTO.prototype, "cisIds", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, decorators_1.TransformArray)(),
|
|
36
|
+
__metadata("design:type", Array)
|
|
37
|
+
], DepartureBoardsQueryDTO.prototype, "ids", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, decorators_1.TransformArray)(),
|
|
40
|
+
__metadata("design:type", Array)
|
|
41
|
+
], DepartureBoardsQueryDTO.prototype, "names", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, decorators_1.TransformArray)(),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], DepartureBoardsQueryDTO.prototype, "skip", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, decorators_1.TransformInteger)(),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], DepartureBoardsQueryDTO.prototype, "limit", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, decorators_1.TransformInteger)(),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], DepartureBoardsQueryDTO.prototype, "minutesAfter", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, decorators_1.TransformInteger)(),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], DepartureBoardsQueryDTO.prototype, "minutesBefore", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, decorators_1.TransformInteger)(),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], DepartureBoardsQueryDTO.prototype, "total", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, decorators_1.TransformInteger)(),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], DepartureBoardsQueryDTO.prototype, "offset", void 0);
|
|
66
|
+
exports.DepartureBoardsQueryDTO = DepartureBoardsQueryDTO;
|
|
67
|
+
//# sourceMappingURL=DepartureBoardsDTO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DepartureBoardsDTO.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/dto/DepartureBoardsDTO.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAyE;AAEzE,MAAa,uBAAuB;IAApC;QAEI,WAAM,GAAa,EAAE,CAAC;QAGtB,WAAM,GAAa,EAAE,CAAC;QAGtB,QAAG,GAAa,EAAE,CAAC;QAGnB,UAAK,GAAa,EAAE,CAAC;QAGrB,SAAI,GAAa,EAAE,CAAC;QAGpB,UAAK,GAAW,EAAE,CAAC;QAGnB,iBAAY,GAAW,GAAG,CAAC;QAG3B,kBAAa,GAAW,CAAC,CAAC;IAiB9B,CAAC;CAAA;AAtCG;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;uDACK;AAGtB;IADC,IAAA,2BAAc,GAAE;;oDACE;AAGnB;IADC,IAAA,2BAAc,GAAE;;sDACI;AAGrB;IADC,IAAA,2BAAc,GAAE;;qDACG;AAGpB;IADC,IAAA,6BAAgB,GAAE;;sDACA;AAGnB;IADC,IAAA,6BAAgB,GAAE;;6DACQ;AAG3B;IADC,IAAA,6BAAgB,GAAE;;8DACO;AAG1B;IADC,IAAA,6BAAgB,GAAE;;sDACJ;AAaf;IADC,IAAA,6BAAgB,GAAE;;uDACH;AAvCpB,0DAwCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DepartureBoardsDTO";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DepartureBoardsDTO"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkTimeFromMiddleware = exports.defaultTimeQueryParams = void 0;
|
|
7
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
8
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
9
|
+
const class_transformer_1 = require("class-transformer");
|
|
10
|
+
const dto_1 = require("../dto");
|
|
11
|
+
exports.defaultTimeQueryParams = {
|
|
12
|
+
hoursBefore: 6,
|
|
13
|
+
hoursAfter: 7 * 24,
|
|
14
|
+
};
|
|
15
|
+
const checkTimeFromMiddleware = (routerName) => {
|
|
16
|
+
return (req, _res, next) => {
|
|
17
|
+
const query = (0, class_transformer_1.plainToInstance)(dto_1.DepartureBoardsQueryDTO, req.query, { excludeExtraneousValues: true });
|
|
18
|
+
const timeFrom = query.timeFrom ? (0, moment_timezone_1.default)(query.timeFrom) : null;
|
|
19
|
+
const currentMoment = (0, moment_timezone_1.default)();
|
|
20
|
+
if (timeFrom &&
|
|
21
|
+
!timeFrom.isBetween(currentMoment.clone().subtract(exports.defaultTimeQueryParams.hoursBefore, "hours"), currentMoment.clone().add(exports.defaultTimeQueryParams.hoursAfter, "hours"), undefined, "[]")) {
|
|
22
|
+
return next(new golemio_errors_1.CustomError("Parameter timeFrom must be in interval [-6h; +7d]", true, routerName || "BaseRouter", 400));
|
|
23
|
+
}
|
|
24
|
+
return next();
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.checkTimeFromMiddleware = checkTimeFromMiddleware;
|
|
28
|
+
//# sourceMappingURL=checkTimeFromMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkTimeFromMiddleware.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/middleware/checkTimeFromMiddleware.ts"],"names":[],"mappings":";;;;;;AACA,6EAAuE;AACvE,gGAA+D;AAC/D,yDAAoD;AACpD,gCAAsD;AAEzC,QAAA,sBAAsB,GAAG;IAClC,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC,GAAG,EAAE;CACrB,CAAC;AAEK,MAAM,uBAAuB,GAAG,CAAC,UAAmB,EAAkB,EAAE;IAC3E,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,mCAAe,EAAC,6BAAuB,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC;QACrG,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,yBAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,MAAM,aAAa,GAAG,IAAA,yBAAM,GAAE,CAAC;QAE/B,IACI,QAAQ;YACR,CAAC,QAAQ,CAAC,SAAS,CACf,aAAa,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,8BAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,EAC3E,aAAa,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,8BAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,EACrE,SAAS,EACT,IAAI,CACP,EACH;YACE,OAAO,IAAI,CACP,IAAI,4BAAW,CAAC,mDAAmD,EAAE,IAAI,EAAE,UAAU,IAAI,YAAY,EAAE,GAAG,CAAC,CAC9G,CAAC;SACL;QACD,OAAO,IAAI,EAAE,CAAC;IAClB,CAAC,CAAC;AACN,CAAC,CAAC;AArBW,QAAA,uBAAuB,2BAqBlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./checkTimeFromMiddleware";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./checkTimeFromMiddleware"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/middleware/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Moment } from "@golemio/core/dist/shared/moment-timezone";
|
|
2
2
|
declare class PIDDepartureBoardsModel {
|
|
3
3
|
private stopsMaxCount;
|
|
4
|
-
private ropidVYMIEventsModel;
|
|
5
4
|
private ropidVYMIEventsStopsModel;
|
|
6
5
|
private ropidDeparturesDirectionsModel;
|
|
7
6
|
private ropidDeparturesModel;
|
|
@@ -12,7 +11,7 @@ declare class PIDDepartureBoardsModel {
|
|
|
12
11
|
*/
|
|
13
12
|
GetAll: (options: {
|
|
14
13
|
aswIds?: string[];
|
|
15
|
-
cisIds?:
|
|
14
|
+
cisIds?: string[];
|
|
16
15
|
gtfsIds?: string[];
|
|
17
16
|
names?: string[];
|
|
18
17
|
total: number;
|
|
@@ -94,15 +94,9 @@ class PIDDepartureBoardsModel {
|
|
|
94
94
|
throw new golemio_errors_1.CustomError("Database error", true, "DepartureBoardsModel", 500, err);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
this.ropidVYMIEventsModel = new _1.RopidVYMIEventsModel();
|
|
98
97
|
this.ropidVYMIEventsStopsModel = new _1.RopidVYMIEventsStopsModel();
|
|
99
98
|
this.ropidDeparturesDirectionsModel = new _1.RopidDeparturesDirectionsModel();
|
|
100
99
|
this.ropidDeparturesModel = new RopidDeparturesModel_1.RopidDeparturesModel();
|
|
101
|
-
this.ropidVYMIEventsStopsModel.sequelizeModel.belongsTo(this.ropidVYMIEventsModel.sequelizeModel, {
|
|
102
|
-
as: "event",
|
|
103
|
-
targetKey: "vymi_id",
|
|
104
|
-
foreignKey: "event_id",
|
|
105
|
-
});
|
|
106
100
|
}
|
|
107
101
|
}
|
|
108
102
|
exports.PIDDepartureBoardsModel = PIDDepartureBoardsModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PIDDepartureBoardsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/PIDDepartureBoardsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAAuE;AACvE,gGAA2E;AAC3E,oDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"PIDDepartureBoardsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/PIDDepartureBoardsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6EAAuE;AACvE,gGAA2E;AAC3E,oDAA+C;AAC/C,wBAA8E;AAC9E,0BAAkG;AAElG,iEAA8D;AAC9D,qEAAkE;AAClE,+FAA6F;AAE7F,oFAA6D;AAE7D,MAAM,uBAAuB;IAMzB;QALQ,kBAAa,GAAG,GAAG,CAAC;QAW5B;;;WAGG;QACI,WAAM,GAAG,CAAO,OAgBtB,EAAgB,EAAE;;YACf,iCAAiC;YACjC,MAAM,aAAa,GAAG,IAAA,yBAAM,GAAE,CAAC;YAC/B,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7F,MAAM,IAAI,GAAI,OAAO,CAAC,IAAsB,IAAI,iBAAa,CAAC,UAAU,CAAC;YACzE,MAAM,KAAK,GAAI,OAAO,CAAC,KAAwB,IAAI,kBAAc,CAAC,IAAI,CAAC;YACvE,MAAM,MAAM,GAAI,OAAO,CAAC,MAA0B,IAAI,mBAAe,CAAC,IAAI,CAAC;YAC3E,MAAM,IAAI,GAAI,OAAO,CAAC,IAAwB,IAAK,EAAsB,CAAC;YAE1E,MAAM,SAAS,GAAG,IAAA,gCAAe,EAAC,oBAAoB,EAAE,eAAM,CA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AAC,yBAAyB,GAAG,IAAI,4BAAyB,EAAE,CAAC;QACjE,IAAI,CAAC,8BAA8B,GAAG,IAAI,iCAA8B,EAAE,CAAC;QAC3E,IAAI,CAAC,oBAAoB,GAAG,IAAI,2CAAoB,EAAE,CAAC;IAC3D,CAAC;CAuGJ;AAEQ,0DAAuB"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { SequelizeModel } from "@golemio/core/dist/output-gateway";
|
|
2
2
|
import { IRopidDeparturesDirectionsOutput } from "../../../schema-definitions/ropid-departures-directions";
|
|
3
3
|
/**
|
|
4
|
-
* Custom Postgres model for Ropid
|
|
4
|
+
* Custom Postgres model for Ropid Departures Directions
|
|
5
5
|
*/
|
|
6
6
|
export declare class RopidDeparturesDirectionsModel extends SequelizeModel {
|
|
7
7
|
constructor();
|
|
8
8
|
GetOne(id: any): Promise<any>;
|
|
9
|
-
/** Convert joined stops attributes to root infotext element
|
|
10
|
-
*
|
|
11
|
-
* @param {IInfotextsStopsModel} item - One infotext record with joined stops from DB
|
|
12
|
-
* @returns {IInfotextsStopsOutputModel} Transformed result
|
|
13
|
-
*/
|
|
14
9
|
private convertItem;
|
|
15
|
-
/** Converts each item one by one
|
|
16
|
-
*
|
|
17
|
-
* @param {IInfotextsStopsModel[]} items - Array of items to be converted
|
|
18
|
-
* @returns {IInfotextsStopsOutputModel[]} Array of final infotexts
|
|
19
|
-
*/
|
|
20
10
|
private convertItems;
|
|
21
|
-
/** Retrieves all infotexts, could be inner joined with set of stops
|
|
22
|
-
*
|
|
23
|
-
* @param {string[]} stopsIds - Array of GTFS stop ids to be inner joined with corresponding infotexts
|
|
24
|
-
* @param {Moment} timeFrom - Timestamp to filter out specified expiration_date column greater than this value
|
|
25
|
-
* @returns {Promise<IInfotextsStopsOutputModel[]>} Array of the retrieved records
|
|
26
|
-
*/
|
|
27
11
|
GetAll(stopsIds: string[]): Promise<IRopidDeparturesDirectionsOutput[]>;
|
|
28
12
|
}
|
|
@@ -18,25 +18,15 @@ const ropid_departures_directions_1 = require("../../../schema-definitions/ropid
|
|
|
18
18
|
const lodash_1 = __importDefault(require("lodash"));
|
|
19
19
|
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
20
20
|
/**
|
|
21
|
-
* Custom Postgres model for Ropid
|
|
21
|
+
* Custom Postgres model for Ropid Departures Directions
|
|
22
22
|
*/
|
|
23
23
|
class RopidDeparturesDirectionsModel extends output_gateway_1.SequelizeModel {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(ropid_departures_directions_1.RopidDeparturesDirections.departureDirections.name + "Model", ropid_departures_directions_1.RopidDeparturesDirections.departureDirections.pgTableName, ropid_departures_directions_1.RopidDeparturesDirections.departureDirections.outputSequelizeAttributes, { schema: ropid_departures_directions_1.RopidDeparturesDirections.pgSchema });
|
|
26
|
-
/** Convert joined stops attributes to root infotext element
|
|
27
|
-
*
|
|
28
|
-
* @param {IInfotextsStopsModel} item - One infotext record with joined stops from DB
|
|
29
|
-
* @returns {IInfotextsStopsOutputModel} Transformed result
|
|
30
|
-
*/
|
|
31
26
|
this.convertItem = (item) => {
|
|
32
27
|
// converting types
|
|
33
28
|
return Object.assign(Object.assign({}, item), { next_stop_id_regexp: new RegExp(item.next_stop_id_regexp), direction: item.direction });
|
|
34
29
|
};
|
|
35
|
-
/** Converts each item one by one
|
|
36
|
-
*
|
|
37
|
-
* @param {IInfotextsStopsModel[]} items - Array of items to be converted
|
|
38
|
-
* @returns {IInfotextsStopsOutputModel[]} Array of final infotexts
|
|
39
|
-
*/
|
|
40
30
|
this.convertItems = (items) => {
|
|
41
31
|
return items.map((item) => this.convertItem(item));
|
|
42
32
|
};
|
|
@@ -44,12 +34,6 @@ class RopidDeparturesDirectionsModel extends output_gateway_1.SequelizeModel {
|
|
|
44
34
|
GetOne(id) {
|
|
45
35
|
throw new Error("Method not implemented.");
|
|
46
36
|
}
|
|
47
|
-
/** Retrieves all infotexts, could be inner joined with set of stops
|
|
48
|
-
*
|
|
49
|
-
* @param {string[]} stopsIds - Array of GTFS stop ids to be inner joined with corresponding infotexts
|
|
50
|
-
* @param {Moment} timeFrom - Timestamp to filter out specified expiration_date column greater than this value
|
|
51
|
-
* @returns {Promise<IInfotextsStopsOutputModel[]>} Array of the retrieved records
|
|
52
|
-
*/
|
|
53
37
|
GetAll(stopsIds) {
|
|
54
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
39
|
if (lodash_1.default.isEmpty(stopsIds)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidDeparturesDirectionsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/RopidDeparturesDirectionsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sEAAmE;AACnE,yGAK0C;AAC1C,oDAAuB;AACvB,oFAA4D;AAE5D;;GAEG;AACH,MAAa,8BAA+B,SAAQ,+BAAc;IAC9D;QACI,KAAK,CACD,uDAAyB,CAAC,mBAAmB,CAAC,IAAI,GAAG,OAAO,EAC5D,uDAAyB,CAAC,mBAAmB,CAAC,WAAW,EACzD,uDAAyB,CAAC,mBAAmB,CAAC,yBAAyB,EACvE,EAAE,MAAM,EAAE,uDAAyB,CAAC,QAAQ,EAAE,CACjD,CAAC;
|
|
1
|
+
{"version":3,"file":"RopidDeparturesDirectionsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/pid/models/RopidDeparturesDirectionsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sEAAmE;AACnE,yGAK0C;AAC1C,oDAAuB;AACvB,oFAA4D;AAE5D;;GAEG;AACH,MAAa,8BAA+B,SAAQ,+BAAc;IAC9D;QACI,KAAK,CACD,uDAAyB,CAAC,mBAAmB,CAAC,IAAI,GAAG,OAAO,EAC5D,uDAAyB,CAAC,mBAAmB,CAAC,WAAW,EACzD,uDAAyB,CAAC,mBAAmB,CAAC,yBAAyB,EACvE,EAAE,MAAM,EAAE,uDAAyB,CAAC,QAAQ,EAAE,CACjD,CAAC;QAOE,gBAAW,GAAG,CAAC,IAA0C,EAAoC,EAAE;YACnG,mBAAmB;YACnB,OAAO,gCACA,IAAI,KACP,mBAAmB,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,EACzD,SAAS,EAAE,IAAI,CAAC,SAAqC,GACpB,CAAC;QAC1C,CAAC,CAAC;QAEM,iBAAY,GAAG,CAAC,KAA6C,EAAsC,EAAE;YACzG,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC;IAjBF,CAAC;IAED,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAeK,MAAM,CAAC,QAAkB;;YAC3B,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACrB,OAAO,EAAwC,CAAC;aACnD;YACD,OAAO,IAAI,CAAC,YAAY,CACpB,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBAC/B,KAAK,EAAE;oBACH,iBAAiB,EAAE;wBACf,CAAC,mBAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ;qBAC9B;iBACJ;gBACD,KAAK,EAAE;oBACH,CAAC,mBAAmB,EAAE,KAAK,CAAC;oBAC5B,CAAC,YAAY,EAAE,KAAK,CAAC;iBACxB;gBACD,GAAG,EAAE,IAAI;aACZ,CAAC,CAA2C,CAChD,CAAC;QACN,CAAC;KAAA;CACJ;AA9CD,wEA8CC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SequelizeModel } from "@golemio/core/dist/output-gateway";
|
|
2
|
+
/**
|
|
3
|
+
* Custom Postgres model for Ropid VYMI Events Routes
|
|
4
|
+
*/
|
|
5
|
+
export declare class RopidVYMIEventsRoutesModel extends SequelizeModel {
|
|
6
|
+
GetAll(options?: any): Promise<any>;
|
|
7
|
+
GetOne(id: any): Promise<any>;
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RopidVYMIEventsRoutesModel = void 0;
|
|
4
|
+
const output_gateway_1 = require("@golemio/core/dist/output-gateway");
|
|
5
|
+
const ropid_vymi_1 = require("../../../schema-definitions/ropid-vymi");
|
|
6
|
+
/**
|
|
7
|
+
* Custom Postgres model for Ropid VYMI Events Routes
|
|
8
|
+
*/
|
|
9
|
+
class RopidVYMIEventsRoutesModel extends output_gateway_1.SequelizeModel {
|
|
10
|
+
GetAll(options) {
|
|
11
|
+
throw new Error("Method not implemented.");
|
|
12
|
+
}
|
|
13
|
+
GetOne(id) {
|
|
14
|
+
throw new Error("Method not implemented.");
|
|
15
|
+
}
|
|
16
|
+
constructor() {
|
|
17
|
+
super(ropid_vymi_1.RopidVYMI.eventsRoutes.name + "Model", ropid_vymi_1.RopidVYMI.eventsRoutes.pgTableName, ropid_vymi_1.RopidVYMI.eventsRoutes.outputSequelizeAttributes, { schema: ropid_vymi_1.RopidVYMI.pgSchema });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.RopidVYMIEventsRoutesModel = RopidVYMIEventsRoutesModel;
|
|
21
|
+
//# sourceMappingURL=RopidVYMIEventsRoutesModel.js.map
|