@golemio/pid 3.17.2-dev.1969248519 → 4.0.0-rc.1977811756
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/GtfsStopParser.d.ts +0 -2
- package/dist/helpers/GtfsStopParser.js +8 -11
- package/dist/helpers/GtfsStopParser.js.map +1 -1
- package/dist/input-gateway/index.d.ts +1 -1
- package/dist/input-gateway/index.js +13 -25
- package/dist/input-gateway/index.js.map +1 -1
- package/dist/input-gateway/jis/{JisInfotextsRouter.d.ts → JISRouter.d.ts} +5 -2
- package/dist/input-gateway/jis/{JisInfotextsRouter.js → JISRouter.js} +12 -10
- package/dist/input-gateway/jis/JISRouter.js.map +1 -0
- package/dist/input-gateway/jis/controllers/{JisEventsController.js → JISEventsController.js} +2 -2
- package/dist/input-gateway/jis/controllers/{JisEventsController.js.map → JISEventsController.js.map} +1 -1
- package/dist/input-gateway/jis/controllers/{JisInfotextsController.d.ts → JISInfotextsController.d.ts} +1 -1
- package/dist/input-gateway/jis/controllers/{JisInfotextsController.js → JISInfotextsController.js} +5 -5
- package/dist/input-gateway/jis/controllers/{JisInfotextsController.js.map → JISInfotextsController.js.map} +1 -1
- package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.d.ts +5 -2
- package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js +6 -2
- package/dist/input-gateway/ropid-gtfs/RopidGtfsRouter.js.map +1 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +1 -0
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.d.ts +4 -3
- package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js +6 -4
- package/dist/input-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
- package/dist/integration-engine/jis/ioc/Di.js +0 -8
- package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
- package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +0 -3
- package/dist/integration-engine/jis/ioc/JISContainerToken.js +0 -4
- package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISEventsRepository.js +2 -5
- package/dist/integration-engine/jis/repositories/JISEventsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISEventsRopidGTFSRoutesRepository.js +2 -5
- package/dist/integration-engine/jis/repositories/JISEventsRopidGTFSRoutesRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +1 -14
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +4 -75
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js +2 -5
- package/dist/integration-engine/jis/repositories/JISInfotextsRopidGTFSStopsRepository.js.map +1 -1
- package/dist/integration-engine/jis/workers/JISWorker.js +0 -1
- package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +2 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +4 -5
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +1 -5
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +0 -24
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/index.d.ts +0 -1
- package/dist/integration-engine/ropid-gtfs/index.js +0 -1
- package/dist/integration-engine/ropid-gtfs/index.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +0 -8
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +0 -3
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +0 -3
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +5 -8
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/shared/RepositoryUtils.d.ts +3 -0
- package/dist/integration-engine/shared/RepositoryUtils.js +19 -0
- package/dist/integration-engine/shared/RepositoryUtils.js.map +1 -0
- package/dist/integration-engine/shared/index.d.ts +1 -0
- package/dist/integration-engine/shared/index.js +1 -0
- package/dist/integration-engine/shared/index.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.d.ts +61 -10
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +280 -67
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.d.ts +49 -10
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +229 -16
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
- package/dist/output-gateway/jis/controllers/v1/V1EventsController.d.ts +1 -1
- package/dist/output-gateway/jis/controllers/v1/V1EventsController.js +1 -1
- package/dist/output-gateway/jis/ioc/Di.js +1 -1
- package/dist/output-gateway/jis/{transofrmations → transformations}/JISEventsCustomFormatTransformation.js.map +1 -1
- package/dist/schema-definitions/jis/redis/const.d.ts +0 -1
- package/dist/schema-definitions/jis/redis/const.js +1 -2
- package/dist/schema-definitions/jis/redis/const.js.map +1 -1
- package/dist/schema-definitions/ropid-departures-presets/index.d.ts +0 -1
- package/dist/schema-definitions/ropid-departures-presets/index.js +0 -3
- package/dist/schema-definitions/ropid-departures-presets/index.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +0 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +0 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +1 -2
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
- package/docs/asyncapi.yaml +0 -45
- package/docs/cache/types/redis.md +2 -82
- package/docs/jis/index.md +5 -15
- package/docs/openapi-input.yaml +6 -17
- package/package.json +2 -2
- package/dist/input-gateway/jis/JisInfotextsRouter.js.map +0 -1
- package/dist/input-gateway/vehicle-positions/index.d.ts +0 -2
- package/dist/input-gateway/vehicle-positions/index.js +0 -19
- package/dist/input-gateway/vehicle-positions/index.js.map +0 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.d.ts +0 -9
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js +0 -78
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js.map +0 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.d.ts +0 -11
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js +0 -42
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.d.ts +0 -18
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js +0 -44
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts +0 -12
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +0 -44
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +0 -12
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +0 -87
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/BasePositionsManager.d.ts +0 -90
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/BasePositionsManager.js +0 -316
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/BasePositionsManager.js.map +0 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.d.ts +0 -16
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js +0 -3
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js.map +0 -1
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.d.ts +0 -58
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js +0 -69
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js.map +0 -1
- /package/dist/input-gateway/jis/controllers/{JisEventsController.d.ts → JISEventsController.d.ts} +0 -0
- /package/dist/output-gateway/jis/{transofrmations → transformations}/JISEventsCustomFormatTransformation.d.ts +0 -0
- /package/dist/output-gateway/jis/{transofrmations → transformations}/JISEventsCustomFormatTransformation.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema-definitions/ropid-departures-presets/index.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,+CAA6C;AAE7C,+FAAgF;AAChF,6EAAgG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema-definitions/ropid-departures-presets/index.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,+CAA6C;AAE7C,+FAAgF;AAChF,6EAAgG;AAUhG,MAAM,oBAAoB,GAAG;IACzB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAA6C;YACnD,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,GAAG;aACjB;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,CAAC;gBACV,gBAAgB,EAAE,GAAG;aACxB;YACD,KAAK,EAAE;gBACH,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,GAAG;aACjB;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,CAAC;gBACZ,SAAS,EAAE,GAAG;aACjB;YACD,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,IAAI;aAClB;SACJ;KACJ;CACJ,CAAC;AAEF,MAAM,SAAS,GAAG;IACd,IAAI,EAAE,wBAAwB;IAC9B,oBAAoB;IACpB,gBAAgB,EAAE,6DAAuB;IACzC,yBAAyB,EAAE,8CAAiB;IAC5C,WAAW,EAAE,0BAA0B;CAC1C,CAAC;AAEoB,2CAAsB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PUBLIC_DEPARTURE_NAMESPACE_PREFIX = exports.GTFS_RUN_SCHEDULE_NAMESPACE_PREFIX = void 0;
|
|
4
4
|
exports.GTFS_RUN_SCHEDULE_NAMESPACE_PREFIX = "gtfsRunSchedule";
|
|
5
5
|
exports.PUBLIC_DEPARTURE_NAMESPACE_PREFIX = "gtfsPublicDepartureCache";
|
|
6
|
-
exports.GTFS_STOPS_NAMESPACE_PREFIX = "gtfsStopsCache";
|
|
7
6
|
//# sourceMappingURL=const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,kCAAkC,GAAG,iBAAiB,CAAC;AACvD,QAAA,iCAAiC,GAAG,0BAA0B,CAAC
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,kCAAkC,GAAG,iBAAiB,CAAC;AACvD,QAAA,iCAAiC,GAAG,0BAA0B,CAAC"}
|
package/docs/asyncapi.yaml
CHANGED
|
@@ -48,39 +48,6 @@ channels:
|
|
|
48
48
|
messages:
|
|
49
49
|
empty:
|
|
50
50
|
$ref: "#/components/messages/JISInfotexts"
|
|
51
|
-
jis.refreshJISInfotextsCache:
|
|
52
|
-
address: vehicle-positions.jis.refreshJISInfotextsCache
|
|
53
|
-
description: Refresh JIS infotexts cache in Redis (Valkey)
|
|
54
|
-
bindings:
|
|
55
|
-
amqp:
|
|
56
|
-
is: queue
|
|
57
|
-
queue:
|
|
58
|
-
durable: true
|
|
59
|
-
messages:
|
|
60
|
-
empty:
|
|
61
|
-
$ref: "#/components/messages/emptyMessage"
|
|
62
|
-
ropidgtfs.refreshPublicGtfsDepartureCache:
|
|
63
|
-
address: vehicle-positions.ropidgtfs.refreshPublicGtfsDepartureCache
|
|
64
|
-
description: Refresh PublicGtfsDepartureCache
|
|
65
|
-
bindings:
|
|
66
|
-
amqp:
|
|
67
|
-
is: queue
|
|
68
|
-
queue:
|
|
69
|
-
durable: true
|
|
70
|
-
messages:
|
|
71
|
-
empty:
|
|
72
|
-
$ref: "#/components/messages/emptyMessage"
|
|
73
|
-
ropidgtfs.refreshGtfsStopsCache:
|
|
74
|
-
address: vehicle-positions.ropidgtfs.refreshGtfsStopsCache
|
|
75
|
-
description: Refresh GtfsStopsCache
|
|
76
|
-
bindings:
|
|
77
|
-
amqp:
|
|
78
|
-
is: queue
|
|
79
|
-
queue:
|
|
80
|
-
durable: true
|
|
81
|
-
messages:
|
|
82
|
-
empty:
|
|
83
|
-
$ref: "#/components/messages/emptyMessage"
|
|
84
51
|
updateGTFSTripId:
|
|
85
52
|
address: vehicle-positions.vehiclepositions.updateGTFSTripId
|
|
86
53
|
description: some description
|
|
@@ -327,18 +294,6 @@ operations:
|
|
|
327
294
|
action: "send"
|
|
328
295
|
channel:
|
|
329
296
|
$ref: "#/channels/jis.refreshJISInfotexts"
|
|
330
|
-
jis.refreshJISInfotextsCache:
|
|
331
|
-
action: "send"
|
|
332
|
-
channel:
|
|
333
|
-
$ref: "#/channels/jis.refreshJISInfotextsCache"
|
|
334
|
-
ropidgtfs.refreshPublicGtfsDepartureCache:
|
|
335
|
-
action: "send"
|
|
336
|
-
channel:
|
|
337
|
-
$ref: "#/channels/ropidgtfs.refreshPublicGtfsDepartureCache"
|
|
338
|
-
ropidgtfs.refreshGtfsStopsCache:
|
|
339
|
-
action: "send"
|
|
340
|
-
channel:
|
|
341
|
-
$ref: "#/channels/ropidgtfs.refreshGtfsStopsCache"
|
|
342
297
|
updateGTFSTripId:
|
|
343
298
|
action: "send"
|
|
344
299
|
channel:
|
|
@@ -62,7 +62,7 @@ flowchart TD;
|
|
|
62
62
|
- Pomocný timestamp se načte pomocí `GET` a vrátí se jako hodnota hlavičky `Last-Modified` převedená na ISO string. Pokud timestamp neexistuje, hodnota hlavičky bude unix timestamp 0 jako ISO string. Využívá se především pro monitoring a alerting
|
|
63
63
|
- Feedy se generují nejméně 3x za minutu (rabín 2x) pomocí queue-message
|
|
64
64
|
- Používají redis-mutex na zamykání, aby neběželo více shodných tasků v jeden okamžik
|
|
65
|
-
- Pokud generování stíhá běžet rychleji, task se snaží do ±7 vteřin svého běhu spustit nové generování souborů (opět přes queue-message).
|
|
65
|
+
- Pokud generování stíhá běžet rychleji, task se snaží do ±7 vteřin svého běhu spustit nové generování souborů (opět přes queue-message).
|
|
66
66
|
|
|
67
67
|
### Flowchart
|
|
68
68
|
|
|
@@ -152,7 +152,6 @@ flowchart TD;
|
|
|
152
152
|
- `cis_stop_platform_code` - nástupiště/kolej podle CIS u vlakových zastávek, jinde null
|
|
153
153
|
- `platform_code` - označení zastávky podle GTFS
|
|
154
154
|
- `stop_id` - GTFS id zastávky
|
|
155
|
-
- `stop_name` - název zastávky
|
|
156
155
|
- TTL 1 hodina a 5 minut
|
|
157
156
|
- Automatické promazání dat po úspěšném načtení GTFS jíždních řádů
|
|
158
157
|
- Cca jednou za 5 vteřin se přenačtou stop times pro všechny aktivní spoje. Generování může běžet pouze jednou, po dokončení tasku se spustí znovu (max čekání 4.8 vteřin)
|
|
@@ -314,83 +313,4 @@ flowchart TD;
|
|
|
314
313
|
rt_info["Obohacení o RT informace"];
|
|
315
314
|
get_departures--"Alespoň jedno vozidlo připadá nějakému spoji (aktivní, budoucí i zrušené) na odjezdu"-->rt_info;
|
|
316
315
|
rt_info--"RT informace o spoji"-->redis_repository<-->redis_public_cache;
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
## Cache pro API přestupních tabulí (transfer boards)
|
|
320
|
-
|
|
321
|
-
*(přestupní tabule využívají také cache pro Public API, která je již popsána výše)*
|
|
322
|
-
|
|
323
|
-
### gtfsStopsCache:*
|
|
324
|
-
|
|
325
|
-
- Jednotlivé komponenty cache jsou členěny do sad s `$setId`
|
|
326
|
-
- `$setId` je id vygenerované datové sady (4 náhodné bajty reprezentované hexadecimálně)
|
|
327
|
-
- Nová sada je vytvořena při každém přenačtení cache
|
|
328
|
-
- Id `$setId` nejnovější datové sady se propaguje přes PubSub channel `gtfsStopsCache` a je také uloženo v cache jako hodnota položky `gtfsStopsCache:activeSetName`
|
|
329
|
-
- Komponenty:
|
|
330
|
-
- `gtfsStopsCache:$setId:awsNodeGtfsStops` - Hash mapa, mapující daný ASW node na seznam pod něj spadajících zastávek (GTFS ids zastávek, odděleny čárkami)
|
|
331
|
-
- `gtfsStopsCache:$setId:cisToAswNode` - Hash mapa, mapující dané CIS id zastávky na příslušný ASW node
|
|
332
|
-
- TTL žádné (mimo přenačtení cache, kdy je namísto okamžitého promazání původnímu setu nastaveno TTL 1 minuta)
|
|
333
|
-
- Cache je celá přenačtena vždy po přenačtení jízdních řádů (tedy 1-2x denně při stavu k červenci 2025)
|
|
334
|
-
|
|
335
|
-
### jisCache:*
|
|
336
|
-
|
|
337
|
-
- Jednotlivé komponenty cache jsou členěny do sad s `$setId`
|
|
338
|
-
- `$setId` je id vygenerované datové sady (4 náhodné bajty reprezentované hexadecimálně)
|
|
339
|
-
- Nová sada je vytvořena při každém přenačtení cache
|
|
340
|
-
- Id `$setId` nejnovější datové sady se propaguje přes PubSub channel `jisCache` a je také uloženo v cache jako hodnota položky `jisCache:activeSetName`
|
|
341
|
-
- Komponenty:
|
|
342
|
-
- `jisCache:$setId:infotexts` - Hash mapa, mapující dané id infotextu na informace o onom infotextu (JSON jako string)
|
|
343
|
-
- `jisCache:$setId:stops-infotexts` - Hash mapa, mapující dané GTFS id zástavky na seznam infotextů s ní asociovaných (ids infotextů, odděleny čárkami)
|
|
344
|
-
- TTL žádné (mimo přenačtení cache, kdy je namísto okamžitého promazání původnímu setu nastaveno TTL 1 minuta)
|
|
345
|
-
- Cache je celá přenačtena při každé aktualizaci infotextů (tento proces je více popsán v [Dokumentaci propisu VYMI (JIS) dat do datové platformy](../../jis/index.md))
|
|
346
|
-
|
|
347
|
-
### Flowchart (refresh gtfsStopsCache:*)
|
|
348
|
-
|
|
349
|
-
```mermaid
|
|
350
|
-
flowchart LR
|
|
351
|
-
finish_up_gtfs("`Dokončení zpracování GTFS JŘ`");
|
|
352
|
-
|
|
353
|
-
psql_ropidgtfs_cis_stops[("`PSQL ropidgtfs_cis_stops`")];
|
|
354
|
-
psql_ropidgtfs_stops[("`PSQL ropidgtfs_stops`")];
|
|
355
|
-
|
|
356
|
-
redis_gtfsStopsCache[("`Redis gtfsStopsCache:\*`")];
|
|
357
|
-
|
|
358
|
-
amqp_refreshGtfsStopsCache["`AMQP refreshGtfsStopsCache`"];
|
|
359
|
-
|
|
360
|
-
task_RefreshGtfsStopsCacheTask["`RefreshGtfsStopsCacheTask`"];
|
|
361
|
-
|
|
362
|
-
finish_up_gtfs --> amqp_refreshGtfsStopsCache;
|
|
363
|
-
amqp_refreshGtfsStopsCache --> task_RefreshGtfsStopsCacheTask;
|
|
364
|
-
task_RefreshGtfsStopsCacheTask <-- "`ASW ids a CIS ids zastávek`" --> psql_ropidgtfs_cis_stops;
|
|
365
|
-
task_RefreshGtfsStopsCacheTask <-- "`ASW nodes a GTFS ids zastávek`" --> psql_ropidgtfs_stops;
|
|
366
|
-
task_RefreshGtfsStopsCacheTask -- "`HSET gtfsStopsCache:$setId:awsNodeGtfsStops a gtfsStopsCache:$setId:cisToAswNode, EXPIRE staré sady`" --> redis_gtfsStopsCache;
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Flowchart (refresh jisCache:*)
|
|
370
|
-
|
|
371
|
-
```mermaid
|
|
372
|
-
flowchart LR
|
|
373
|
-
refresh_infotexts("`Aktualizace infotextů`");
|
|
374
|
-
|
|
375
|
-
psql_jis_infotexts[("`PSQL jis_infotexts`")];
|
|
376
|
-
psql_jis_infotexts_ropidgtfs_stops[("`PSQL jis_infotexts_ropidgtfs_stops`")];
|
|
377
|
-
|
|
378
|
-
redis_jisCache[("`Redis jisCache:\*`")];
|
|
379
|
-
|
|
380
|
-
amqp_refreshJISInfotextsCache["`AMQP refreshJISInfotextsCache`"];
|
|
381
|
-
|
|
382
|
-
task_RefreshJISInfotextsTask["`RefreshJISInfotextsTask`"];
|
|
383
|
-
|
|
384
|
-
refresh_infotexts --> amqp_refreshJISInfotextsCache;
|
|
385
|
-
amqp_refreshJISInfotextsCache --> task_RefreshJISInfotextsTask;
|
|
386
|
-
task_RefreshJISInfotextsTask <-- "`Data infotextů`" --> psql_jis_infotexts;
|
|
387
|
-
task_RefreshJISInfotextsTask <-- "`GTFS ids zastávek a ids infotextů`" --> psql_jis_infotexts_ropidgtfs_stops;
|
|
388
|
-
task_RefreshJISInfotextsTask -- "`HSET jisCache:$setId:infotexts a jisCache:$setId:stops-infotexts, EXPIRE staré sady`" --> redis_jisCache;
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
### Flowchart (v4 transferboards API)
|
|
392
|
-
|
|
393
|
-
```mermaid
|
|
394
|
-
flowchart TD;
|
|
395
|
-
todo["TODO"];
|
|
396
|
-
```
|
|
316
|
+
```
|
package/docs/jis/index.md
CHANGED
|
@@ -123,11 +123,9 @@ flowchart TB
|
|
|
123
123
|
subgraph "Golemio VP Integration Engine"
|
|
124
124
|
golemio_refresh_events_task["`RefreshJISEventsTask`"];
|
|
125
125
|
golemio_refresh_infotexts_task["`RefreshJISInfotextsTask`"];
|
|
126
|
-
golemio_refresh_infotexts_cache_task["`RefreshJISInfotextsCacheTask`"];
|
|
127
126
|
end
|
|
128
127
|
|
|
129
128
|
vp_pg[("`VP PostgreSQL`")];
|
|
130
|
-
vp_redis[("`VP Redis (Valkey)`")];
|
|
131
129
|
end
|
|
132
130
|
|
|
133
131
|
vymi_events_controller_create --> vymi_get_events;
|
|
@@ -136,8 +134,8 @@ flowchart TB
|
|
|
136
134
|
vymi_infotexts_controller_create --> vymi_get_infotexts;
|
|
137
135
|
vymi_infotexts_controller_update --> vymi_get_infotexts;
|
|
138
136
|
|
|
139
|
-
vymi_get_events
|
|
140
|
-
vymi_get_infotexts
|
|
137
|
+
vymi_get_events -- "`SELECT aktuálních událostí z tabulek vehicle-positions.pid.jis_events a vehicle-positions.pid.jis_events_ropidgtfs_routes`" --> vymi_pg;
|
|
138
|
+
vymi_get_infotexts -- "`SELECT aktuálních infotextů z tabulek vehicle-positions.pid.jis_infotexts a vehicle-positions.pid.jis_infotexts_ropidgtfs_stops`" --> vymi_pg;
|
|
141
139
|
|
|
142
140
|
vymi_get_events --> golemio_api_post_events;
|
|
143
141
|
vymi_get_infotexts --> golemio_api_post_infotexts;
|
|
@@ -153,12 +151,9 @@ flowchart TB
|
|
|
153
151
|
|
|
154
152
|
golemio_refresh_events_task -- "`UPSERT do tabulek vehicle-positions.pid.jis_events a vehicle-positions.pid.jis_events_ropidgtfs_routes`" --> vp_pg;
|
|
155
153
|
golemio_refresh_infotexts_task -- "`UPSERT do tabulek vehicle-positions.pid.jis_infotexts a vehicle-positions.pid.jis_infotexts_ropidgtfs_stops`" --> vp_pg;
|
|
156
|
-
golemio_refresh_infotexts_task --> golemio_refresh_infotexts_cache_task;
|
|
157
|
-
|
|
158
|
-
golemio_refresh_infotexts_cache_task -- "`Aktualizace cache jisCache:infotexts:* a jisCache:stop-infotexts:*`" --> vp_redis;
|
|
159
154
|
```
|
|
160
155
|
|
|
161
|
-
Formát zasílaných dat je dále více popsán v implementační dokumentaci ([události](../implementation_documentation.md#jis-events-1), [infotexty](../implementation_documentation.md#jis-infotexts-1)), stejně tak jako odkazy na [Input Gateway OpenAPI](../implementation_documentation.md#input-api) a popis [uložení dat](../implementation_documentation.md#uložení-dat) včetně databázového schema a popisu retence.
|
|
156
|
+
Formát zasílaných dat je dále více popsán v implementační dokumentaci ([události](../implementation_documentation.md#jis-events-1), [infotexty](../implementation_documentation.md#jis-infotexts-1)), stejně tak jako odkazy na [Input Gateway OpenAPI](../implementation_documentation.md#input-api) a popis [uložení dat](../implementation_documentation.md#uložení-dat) včetně databázového schema a popisu retence.
|
|
162
157
|
|
|
163
158
|
## Pasivní načítání (pull) dat
|
|
164
159
|
|
|
@@ -205,7 +200,6 @@ flowchart TB
|
|
|
205
200
|
golemio_fetch_infotexts_task["`FetchJISInfotextsTask`"];
|
|
206
201
|
golemio_refresh_events_task["`RefreshJISEventsTask`"];
|
|
207
202
|
golemio_refresh_infotexts_task["`RefreshJISInfotextsTask`"];
|
|
208
|
-
golemio_refresh_infotexts_cache_task["`RefreshJISInfotextsCacheTask`"];
|
|
209
203
|
|
|
210
204
|
%% invisible unicode char due to https://github.com/orgs/community/discussions/106690
|
|
211
205
|
golemio_api_get_events["`HTTPS GET s API klíčem na https://api-vymi.golemio.cz/v1/exports/events/custom-format`"];
|
|
@@ -213,11 +207,10 @@ flowchart TB
|
|
|
213
207
|
end
|
|
214
208
|
|
|
215
209
|
vp_pg[("`VP PostgreSQL`")];
|
|
216
|
-
vp_redis[("`VP Redis (Valkey)`")];
|
|
217
210
|
end
|
|
218
211
|
|
|
219
|
-
vymi_get_events
|
|
220
|
-
vymi_get_infotexts
|
|
212
|
+
vymi_get_events -- "`SELECT aktuálních událostí z tabulek vehicle-positions.pid.jis_events a vehicle-positions.pid.jis_events_ropidgtfs_routes`" --> vymi_pg;
|
|
213
|
+
vymi_get_infotexts -- "`SELECT aktuálních infotextů z tabulek vehicle-positions.pid.jis_infotexts a vehicle-positions.pid.jis_infotexts_ropidgtfs_stops`" --> vymi_pg;
|
|
221
214
|
|
|
222
215
|
golemio_rabbit_fetch_events --> golemio_fetch_events_task;
|
|
223
216
|
golemio_rabbit_fetch_infotexts --> golemio_fetch_infotexts_task;
|
|
@@ -238,9 +231,6 @@ flowchart TB
|
|
|
238
231
|
|
|
239
232
|
golemio_refresh_events_task -- "`UPSERT do tabulek vehicle-positions.pid.jis_events a vehicle-positions.pid.jis_events_ropidgtfs_routes`" --> vp_pg;
|
|
240
233
|
golemio_refresh_infotexts_task -- "`UPSERT do tabulek vehicle-positions.pid.jis_infotexts a vehicle-positions.pid.jis_infotexts_ropidgtfs_stops`" --> vp_pg;
|
|
241
|
-
golemio_refresh_infotexts_task --> golemio_refresh_infotexts_cache_task;
|
|
242
|
-
|
|
243
|
-
golemio_refresh_infotexts_cache_task -- "`Aktualizace cache jisCache:infotexts:* a jisCache:stop-infotexts:*`" --> vp_redis;
|
|
244
234
|
```
|
|
245
235
|
|
|
246
236
|
Zdroj a formát dat pro aktivní stahování jsou dále více popsány v implementační dokumentaci ([události](../implementation_documentation.md#jis-events), [infotexty](../implementation_documentation.md#jis-infotexts)), stejně tak jako [worker a tasky](../implementation_documentation.md#jisworker) a popis [uložení dat](../implementation_documentation.md#uložení-dat) včetně databázového schema a popisu retence.
|
package/docs/openapi-input.yaml
CHANGED
|
@@ -453,12 +453,6 @@ components:
|
|
|
453
453
|
type: array
|
|
454
454
|
items:
|
|
455
455
|
type: object
|
|
456
|
-
required:
|
|
457
|
-
- routeName
|
|
458
|
-
- note
|
|
459
|
-
- apiVersion
|
|
460
|
-
- route
|
|
461
|
-
- query
|
|
462
456
|
properties:
|
|
463
457
|
routeName:
|
|
464
458
|
type: string
|
|
@@ -475,9 +469,6 @@ components:
|
|
|
475
469
|
query:
|
|
476
470
|
type: string
|
|
477
471
|
example: "?minutesAfter=300&limit=8&mode=departures&cisIds=40110"
|
|
478
|
-
isTesting:
|
|
479
|
-
type: boolean
|
|
480
|
-
example: true
|
|
481
472
|
JISEvents:
|
|
482
473
|
title: JIS events
|
|
483
474
|
type: array
|
|
@@ -840,16 +831,14 @@ components:
|
|
|
840
831
|
"note": "Tablo Zahradní město z centra (APEX)",
|
|
841
832
|
"apiVersion": 2,
|
|
842
833
|
"route": "/pid/departureboards",
|
|
843
|
-
"query": "?minutesAfter=40&limit=6&mode=departures&filter=routeHeadingOnceNoGapFill&order=real&aswIds=2781_2&aswIds=2781_52&skip=atStop&airCondition=true"
|
|
844
|
-
"isTesting": true
|
|
834
|
+
"query": "?minutesAfter=40&limit=6&mode=departures&filter=routeHeadingOnceNoGapFill&order=real&aswIds=2781_2&aswIds=2781_52&skip=atStop&airCondition=true"
|
|
845
835
|
},
|
|
846
836
|
{
|
|
847
837
|
"routeName": "apex-zahradnimesto-6048-kopie",
|
|
848
838
|
"note": "Tablo Zahradní město z centra (APEX)",
|
|
849
839
|
"apiVersion": 2,
|
|
850
840
|
"route": "/pid/departureboards",
|
|
851
|
-
"query": "?minutesAfter=40&limit=6&mode=departures&filter=routeHeadingOnceNoGapFill&order=real&aswIds=2781_2&aswIds=2781_52&skip=atStop&airCondition=true"
|
|
852
|
-
"isTesting": false
|
|
841
|
+
"query": "?minutesAfter=40&limit=6&mode=departures&filter=routeHeadingOnceNoGapFill&order=real&aswIds=2781_2&aswIds=2781_52&skip=atStop&airCondition=true"
|
|
853
842
|
}
|
|
854
843
|
]
|
|
855
844
|
JISEventsExample:
|
|
@@ -903,10 +892,10 @@ components:
|
|
|
903
892
|
"informed_entity": {
|
|
904
893
|
"stops": [
|
|
905
894
|
{
|
|
906
|
-
"
|
|
895
|
+
"id": "U31070Z20"
|
|
907
896
|
},
|
|
908
897
|
{
|
|
909
|
-
"
|
|
898
|
+
"id": "U32268Z1"
|
|
910
899
|
}
|
|
911
900
|
]
|
|
912
901
|
},
|
|
@@ -928,10 +917,10 @@ components:
|
|
|
928
917
|
"informed_entity": {
|
|
929
918
|
"stops": [
|
|
930
919
|
{
|
|
931
|
-
"
|
|
920
|
+
"id": "U85Z1P"
|
|
932
921
|
},
|
|
933
922
|
{
|
|
934
|
-
"
|
|
923
|
+
"id": "U876Z1P"
|
|
935
924
|
}
|
|
936
925
|
]
|
|
937
926
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.1977811756",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@golemio/core": ">=1.16.0-rc.1551191551"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.
|
|
79
|
+
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.3",
|
|
80
80
|
"@turf/turf": "^6.5.0",
|
|
81
81
|
"cheap-ruler": "^3.0.2",
|
|
82
82
|
"csv-parser": "^3.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JisInfotextsRouter.js","sourceRoot":"","sources":["../../../src/input-gateway/jis/JisInfotextsRouter.ts"],"names":[],"mappings":";;;AAAA,oHAAiH;AACjH,+DAA4F;AAC5F,2EAAwE;AACxE,iFAA8E;AAE9E,MAAa,kBAAkB;IAK3B;QAcQ,eAAU,GAAG,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAiB,EAAE;YAC1F,IAAI;gBACA,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClD,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAC;QAEM,kBAAa,GAAG,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAiB,EAAE;YAC7F,IAAI;gBACA,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrD,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAC;QA7BE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAClD,IAAI,CAAC,mBAAmB,GAAG,IAAI,+CAAsB,EAAE,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,UAAU;QACd,+FAA+F;QAC/F,kGAAkG;QAClG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAA,uDAA0B,EAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/F,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,IAAA,uDAA0B,EAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACzG,CAAC;CAmBJ;AApCD,gDAoCC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./VehiclePositionsController"), exports);
|
|
18
|
-
__exportStar(require("./VehiclePositionsRouter"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/input-gateway/vehicle-positions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,2DAAyC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
|
|
2
|
-
import { RedisModel } from "@golemio/core/dist/integration-engine";
|
|
3
|
-
export declare class JISInfotextsRedisRepository extends RedisModel {
|
|
4
|
-
static NAMESPACE_PREFIX: string;
|
|
5
|
-
constructor();
|
|
6
|
-
refreshData(infotexts: JISInfotextsModel[]): Promise<void>;
|
|
7
|
-
private createNewCache;
|
|
8
|
-
private deleteOldCache;
|
|
9
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
var JISInfotextsRedisRepository_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.JISInfotextsRedisRepository = void 0;
|
|
14
|
-
const const_1 = require("../../../schema-definitions/jis/redis/const");
|
|
15
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
16
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
17
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
18
|
-
const node_crypto_1 = require("node:crypto");
|
|
19
|
-
const TTL_SECONDS_BEFORE_DELETE = 60;
|
|
20
|
-
let JISInfotextsRedisRepository = exports.JISInfotextsRedisRepository = JISInfotextsRedisRepository_1 = class JISInfotextsRedisRepository extends integration_engine_1.RedisModel {
|
|
21
|
-
constructor() {
|
|
22
|
-
super("JISInfotextsRedisRepository", {
|
|
23
|
-
isKeyConstructedFromData: false,
|
|
24
|
-
prefix: JISInfotextsRedisRepository_1.NAMESPACE_PREFIX,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
async refreshData(infotexts) {
|
|
28
|
-
try {
|
|
29
|
-
const oldSetName = (await this.connection.get(`${this.prefix}:activeSetName`)) ?? "";
|
|
30
|
-
await this.createNewCache(infotexts);
|
|
31
|
-
await this.deleteOldCache(oldSetName);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
throw new golemio_errors_1.GeneralError("refreshData failed", this.constructor.name, err);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async createNewCache(infotexts) {
|
|
38
|
-
try {
|
|
39
|
-
const infotextIdsByStopId = new Map();
|
|
40
|
-
const infotextsByInfotextId = new Map();
|
|
41
|
-
for (const infotext of infotexts) {
|
|
42
|
-
infotextsByInfotextId.set(infotext.id, JSON.stringify(infotext));
|
|
43
|
-
for (const { stop_id } of infotext?.stops ?? []) {
|
|
44
|
-
let stopInfotextsIds = infotextIdsByStopId.get(stop_id) ?? [];
|
|
45
|
-
stopInfotextsIds.push(infotext.id);
|
|
46
|
-
infotextIdsByStopId.set(stop_id, stopInfotextsIds);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const setName = (0, node_crypto_1.randomBytes)(4).toString("hex");
|
|
50
|
-
const pipeline = this.connection.pipeline();
|
|
51
|
-
pipeline.hset(`${this.prefix}:${setName}:infotexts`, infotextsByInfotextId);
|
|
52
|
-
pipeline.hset(`${this.prefix}:${setName}:stops-infotexts`, infotextIdsByStopId);
|
|
53
|
-
pipeline.publish(`${this.prefix}`, `${this.prefix}:${setName}`);
|
|
54
|
-
pipeline.set(`${this.prefix}:activeSetName`, `${this.prefix}:${setName}`);
|
|
55
|
-
await pipeline.exec();
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
throw new golemio_errors_1.GeneralError("createNewCache failed", this.constructor.name, err);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async deleteOldCache(setName) {
|
|
62
|
-
try {
|
|
63
|
-
const pipeline = this.connection.pipeline();
|
|
64
|
-
pipeline.expire(`${setName}:infotexts`, TTL_SECONDS_BEFORE_DELETE);
|
|
65
|
-
pipeline.expire(`${setName}:stops-infotexts`, TTL_SECONDS_BEFORE_DELETE);
|
|
66
|
-
await pipeline.exec();
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
throw new golemio_errors_1.GeneralError("deleteOldCache failed", this.constructor.name, err);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
JISInfotextsRedisRepository.NAMESPACE_PREFIX = const_1.JIS_NAMESPACE_PREFIX;
|
|
74
|
-
exports.JISInfotextsRedisRepository = JISInfotextsRedisRepository = JISInfotextsRedisRepository_1 = __decorate([
|
|
75
|
-
(0, tsyringe_1.injectable)(),
|
|
76
|
-
__metadata("design:paramtypes", [])
|
|
77
|
-
], JISInfotextsRedisRepository);
|
|
78
|
-
//# sourceMappingURL=JISInfotextsRedisRepository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsRedisRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRedisRepository.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { JISInfotextsRedisRepository } from "../../repositories/JISInfotextsRedisRepository";
|
|
2
|
-
import { JISInfotextsRepository } from "../../repositories/JISInfotextsRepository";
|
|
3
|
-
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
4
|
-
export declare class RefreshJISInfotextsCacheTask extends AbstractEmptyTask {
|
|
5
|
-
private infotextsRepository;
|
|
6
|
-
private infotextCacheRepository;
|
|
7
|
-
readonly queueName = "refreshJISInfotextsCache";
|
|
8
|
-
readonly queueTtl: number;
|
|
9
|
-
constructor(infotextsRepository: JISInfotextsRepository, infotextCacheRepository: JISInfotextsRedisRepository);
|
|
10
|
-
protected execute(): Promise<void>;
|
|
11
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RefreshJISInfotextsCacheTask = void 0;
|
|
16
|
-
const JISContainerToken_1 = require("../../ioc/JISContainerToken");
|
|
17
|
-
const JISInfotextsRedisRepository_1 = require("../../repositories/JISInfotextsRedisRepository");
|
|
18
|
-
const JISInfotextsRepository_1 = require("../../repositories/JISInfotextsRepository");
|
|
19
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
20
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
21
|
-
const constants_1 = require("../constants");
|
|
22
|
-
let RefreshJISInfotextsCacheTask = exports.RefreshJISInfotextsCacheTask = class RefreshJISInfotextsCacheTask extends integration_engine_1.AbstractEmptyTask {
|
|
23
|
-
constructor(infotextsRepository, infotextCacheRepository) {
|
|
24
|
-
super(constants_1.JIS_WORKER_NAME.toLowerCase());
|
|
25
|
-
this.infotextsRepository = infotextsRepository;
|
|
26
|
-
this.infotextCacheRepository = infotextCacheRepository;
|
|
27
|
-
this.queueName = "refreshJISInfotextsCache";
|
|
28
|
-
this.queueTtl = 60 * 1000; // 1 minute
|
|
29
|
-
}
|
|
30
|
-
async execute() {
|
|
31
|
-
const infotexts = await this.infotextsRepository.findAll();
|
|
32
|
-
await this.infotextCacheRepository.refreshData(infotexts);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.RefreshJISInfotextsCacheTask = RefreshJISInfotextsCacheTask = __decorate([
|
|
36
|
-
(0, tsyringe_1.injectable)(),
|
|
37
|
-
__param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRepository)),
|
|
38
|
-
__param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRedisRepository)),
|
|
39
|
-
__metadata("design:paramtypes", [JISInfotextsRepository_1.JISInfotextsRepository,
|
|
40
|
-
JISInfotextsRedisRepository_1.JISInfotextsRedisRepository])
|
|
41
|
-
], RefreshJISInfotextsCacheTask);
|
|
42
|
-
//# sourceMappingURL=RefreshJISInfotextsCacheTask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshJISInfotextsCacheTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAkE;AAClE,gGAA+F;AAC/F,sFAAqF;AACrF,8EAA0E;AAC1E,iEAAwE;AACxE,4CAA+C;AAGxC,IAAM,4BAA4B,0CAAlC,MAAM,4BAA6B,SAAQ,sCAAiB;IAI/D,YACsD,mBAAmD,EAC9C,uBAA4D;QAEnH,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAHqB,wBAAmB,GAAnB,mBAAmB,CAAwB;QACtC,4BAAuB,GAAvB,uBAAuB,CAA6B;QALvG,cAAS,GAAG,0BAA0B,CAAC;QACvC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;IAOjD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;QAC3D,MAAM,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;uCAfY,4BAA4B;IADxC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,sBAAsB,CAAC,CAAA;IAChD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,2BAA2B,CAAC,CAAA;qCADyB,+CAAsB;QACb,yDAA2B;GAN9G,4BAA4B,CAexC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IStopCisDto } from "../../schema-definitions/ropid-gtfs/interfaces/IStopCisDto";
|
|
2
|
-
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine";
|
|
3
|
-
import { IValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
4
|
-
import Sequelize from "@golemio/core/dist/shared/sequelize";
|
|
5
|
-
export declare class RopidGTFSCisStopsModel extends PostgresModel implements IModel {
|
|
6
|
-
/** Model name */
|
|
7
|
-
name: string;
|
|
8
|
-
/** The Sequelize Model */
|
|
9
|
-
sequelizeModel: Sequelize.ModelCtor<any>;
|
|
10
|
-
/** The Sequelize Model for temporary table */
|
|
11
|
-
protected tmpSequelizeModel: Sequelize.ModelCtor<any> | null;
|
|
12
|
-
/** Validation helper */
|
|
13
|
-
protected validator: IValidator;
|
|
14
|
-
/** Type/Strategy of saving the data */
|
|
15
|
-
protected savingType: "insertOnly" | "insertOrUpdate";
|
|
16
|
-
constructor();
|
|
17
|
-
getAll: () => Promise<Array<Pick<IStopCisDto, "id" | "cis">>>;
|
|
18
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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.RopidGTFSCisStopsModel = void 0;
|
|
13
|
-
const const_1 = require("../../schema-definitions/const");
|
|
14
|
-
const StopCisDto_1 = require("../../schema-definitions/ropid-gtfs/models/StopCisDto");
|
|
15
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
16
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
17
|
-
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
18
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
19
|
-
let RopidGTFSCisStopsModel = exports.RopidGTFSCisStopsModel = class RopidGTFSCisStopsModel extends integration_engine_1.PostgresModel {
|
|
20
|
-
constructor() {
|
|
21
|
-
super("RopidGTFSCisStopsModel", {
|
|
22
|
-
outputSequelizeAttributes: StopCisDto_1.StopCisDto.attributeModel,
|
|
23
|
-
pgTableName: StopCisDto_1.StopCisDto.tableName,
|
|
24
|
-
pgSchema: const_1.PG_SCHEMA,
|
|
25
|
-
savingType: "insertOnly",
|
|
26
|
-
}, new golemio_validator_1.JSONSchemaValidator(StopCisDto_1.StopCisDto.tableName + "ModelValidator", StopCisDto_1.StopCisDto.jsonSchema));
|
|
27
|
-
this.getAll = async () => {
|
|
28
|
-
try {
|
|
29
|
-
return await this.sequelizeModel.findAll({
|
|
30
|
-
attributes: ["id", "cis"],
|
|
31
|
-
raw: true,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
throw new golemio_errors_1.GeneralError("Database error", this.constructor.name, err, 500);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.RopidGTFSCisStopsModel = RopidGTFSCisStopsModel = __decorate([
|
|
41
|
-
(0, tsyringe_1.injectable)(),
|
|
42
|
-
__metadata("design:paramtypes", [])
|
|
43
|
-
], RopidGTFSCisStopsModel);
|
|
44
|
-
//# sourceMappingURL=RopidGTFSCisStopsModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSCisStopsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAuC;AAEvC,sFAA+D;AAC/D,8EAA8E;AAC9E,6EAAwE;AACxE,mFAA8F;AAE9F,iEAAgE;AAGzD,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,kCAAa;IAYrD;QACI,KAAK,CACD,wBAAwB,EACxB;YACI,yBAAyB,EAAE,uBAAU,CAAC,cAAc;YACpD,WAAW,EAAE,uBAAU,CAAC,SAAS;YACjC,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;SAC3B,EACD,IAAI,uCAAmB,CAAC,uBAAU,CAAC,SAAS,GAAG,gBAAgB,EAAE,uBAAU,CAAC,UAAU,CAAC,CAC1F,CAAC;QAGC,WAAM,GAAG,KAAK,IAAqD,EAAE;YACxE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;oBACzB,GAAG,EAAE,IAAI;iBACZ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC7E;QACL,CAAC,CAAC;IAXF,CAAC;CAYJ,CAAA;iCAnCY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;;GACA,sBAAsB,CAmClC"}
|