@golemio/pid 5.6.1-dev.2319589982 → 5.6.1-dev.2322628765

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,5 +1,6 @@
1
1
  import { IGtfsRtTripDto } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/IGtfsRtTripDto";
2
- import { IVehicleDescriptor } from "../interfaces/GtfsRealtimeInterfaces";
2
+ import { IVehicleDescriptor, WheelchairAccessible } from "../interfaces/GtfsRealtimeInterfaces";
3
3
  export declare class VehicleDescriptor {
4
+ static wheelchairAccessibleToGtfsRt(accessible: IGtfsRtTripDto["wheelchair_accessible"]): WheelchairAccessible;
4
5
  getVehicleDescriptor(tripRecord: IGtfsRtTripDto): IVehicleDescriptor;
5
6
  }
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VehicleDescriptor = void 0;
4
+ const GtfsRealtimeInterfaces_1 = require("../interfaces/GtfsRealtimeInterfaces");
4
5
  const VehicleIdGenerator_1 = require("./VehicleIdGenerator");
5
6
  class VehicleDescriptor {
7
+ static wheelchairAccessibleToGtfsRt(accessible) {
8
+ if (accessible === null) {
9
+ return GtfsRealtimeInterfaces_1.WheelchairAccessible.UNKNOWN;
10
+ }
11
+ return accessible ? GtfsRealtimeInterfaces_1.WheelchairAccessible.WHEELCHAIR_ACCESSIBLE : GtfsRealtimeInterfaces_1.WheelchairAccessible.WHEELCHAIR_INACCESSIBLE;
12
+ }
6
13
  getVehicleDescriptor(tripRecord) {
7
14
  return {
8
15
  id: VehicleIdGenerator_1.VehicleIdGenerator.getVehicleId(tripRecord.id, tripRecord.gtfs_route_type, tripRecord.provider_source_type, tripRecord.gtfs_route_short_name, tripRecord.cis_trip_number, tripRecord.vehicle_registration_number, tripRecord.run_number, tripRecord.internal_run_number),
9
16
  ...(tripRecord.vehicle_registration_number && {
10
17
  label: tripRecord.vehicle_registration_number.toString(),
11
18
  }),
19
+ wheelchairAccessible: VehicleDescriptor.wheelchairAccessibleToGtfsRt(tripRecord.wheelchair_accessible),
12
20
  ".transit_realtime.ovapiVehicleDescriptor": {
13
- wheelchairAccessible: tripRecord.wheelchair_accessible ?? undefined,
21
+ wheelchairAccessible: tripRecord.wheelchair_accessible ?? null,
14
22
  vehicleType: tripRecord.vehicle_descriptor
15
23
  ? JSON.stringify({
16
24
  airConditioned: tripRecord.vehicle_descriptor.is_air_conditioned,
@@ -1 +1 @@
1
- {"version":3,"file":"VehicleDescriptor.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.ts"],"names":[],"mappings":";;;AAEA,6DAA0D;AAE1D,MAAa,iBAAiB;IACnB,oBAAoB,CAAC,UAA0B;QAClD,OAAO;YACH,EAAE,EAAE,uCAAkB,CAAC,YAAY,CAC/B,UAAU,CAAC,EAAE,EACb,UAAU,CAAC,eAAe,EAC1B,UAAU,CAAC,oBAAoB,EAC/B,UAAU,CAAC,qBAAqB,EAChC,UAAU,CAAC,eAAe,EAC1B,UAAU,CAAC,2BAA2B,EACtC,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,mBAAmB,CACjC;YACD,GAAG,CAAC,UAAU,CAAC,2BAA2B,IAAI;gBAC1C,KAAK,EAAE,UAAU,CAAC,2BAA2B,CAAC,QAAQ,EAAE;aAC3D,CAAC;YACF,0CAA0C,EAAE;gBACxC,oBAAoB,EAAE,UAAU,CAAC,qBAAqB,IAAI,SAAS;gBACnE,WAAW,EAAE,UAAU,CAAC,kBAAkB;oBACtC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;wBACX,cAAc,EAAE,UAAU,CAAC,kBAAkB,CAAC,kBAAkB;wBAChE,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,gBAAgB;qBAC9D,CAAC;oBACJ,CAAC,CAAC,SAAS;aAClB;SACJ,CAAC;IACN,CAAC;CACJ;AA3BD,8CA2BC"}
1
+ {"version":3,"file":"VehicleDescriptor.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/VehicleDescriptor.ts"],"names":[],"mappings":";;;AACA,iFAAgG;AAChG,6DAA0D;AAE1D,MAAa,iBAAiB;IACnB,MAAM,CAAC,4BAA4B,CAAC,UAAmD;QAC1F,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,6CAAoB,CAAC,OAAO,CAAC;QACxC,CAAC;QACD,OAAO,UAAU,CAAC,CAAC,CAAC,6CAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,6CAAoB,CAAC,uBAAuB,CAAC;IAClH,CAAC;IAEM,oBAAoB,CAAC,UAA0B;QAClD,OAAO;YACH,EAAE,EAAE,uCAAkB,CAAC,YAAY,CAC/B,UAAU,CAAC,EAAE,EACb,UAAU,CAAC,eAAe,EAC1B,UAAU,CAAC,oBAAoB,EAC/B,UAAU,CAAC,qBAAqB,EAChC,UAAU,CAAC,eAAe,EAC1B,UAAU,CAAC,2BAA2B,EACtC,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,mBAAmB,CACjC;YACD,GAAG,CAAC,UAAU,CAAC,2BAA2B,IAAI;gBAC1C,KAAK,EAAE,UAAU,CAAC,2BAA2B,CAAC,QAAQ,EAAE;aAC3D,CAAC;YACF,oBAAoB,EAAE,iBAAiB,CAAC,4BAA4B,CAAC,UAAU,CAAC,qBAAqB,CAAC;YACtG,0CAA0C,EAAE;gBACxC,oBAAoB,EAAE,UAAU,CAAC,qBAAqB,IAAI,IAAI;gBAC9D,WAAW,EAAE,UAAU,CAAC,kBAAkB;oBACtC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;wBACX,cAAc,EAAE,UAAU,CAAC,kBAAkB,CAAC,kBAAkB;wBAChE,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,gBAAgB;qBAC9D,CAAC;oBACJ,CAAC,CAAC,SAAS;aAClB;SACJ,CAAC;IACN,CAAC;CACJ;AAnCD,8CAmCC"}
@@ -4,4 +4,5 @@ import IFeedHeader = GtfsOvapi.transit_realtime.IFeedHeader;
4
4
  import ITripDescriptor = GtfsOvapi.transit_realtime.ITripDescriptor;
5
5
  import IStopTimeUpdate = GtfsOvapi.transit_realtime.TripUpdate.IStopTimeUpdate;
6
6
  import IVehicleDescriptor = GtfsOvapi.transit_realtime.IVehicleDescriptor;
7
- export { IFeedEntity, IFeedHeader, ITripDescriptor, IStopTimeUpdate, IVehicleDescriptor };
7
+ import WheelchairAccessible = GtfsOvapi.transit_realtime.VehicleDescriptor.WheelchairAccessible;
8
+ export { IFeedEntity, IFeedHeader, ITripDescriptor, IStopTimeUpdate, IVehicleDescriptor, WheelchairAccessible };
@@ -1,3 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WheelchairAccessible = void 0;
7
+ const ovapi_gtfs_realtime_bindings_1 = __importDefault(require("@golemio/ovapi-gtfs-realtime-bindings"));
8
+ var WheelchairAccessible = ovapi_gtfs_realtime_bindings_1.default.transit_realtime.VehicleDescriptor.WheelchairAccessible;
9
+ exports.WheelchairAccessible = WheelchairAccessible;
3
10
  //# sourceMappingURL=GtfsRealtimeInterfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GtfsRealtimeInterfaces.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/interfaces/GtfsRealtimeInterfaces.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"GtfsRealtimeInterfaces.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/interfaces/GtfsRealtimeInterfaces.ts"],"names":[],"mappings":";;;;;;AAAA,yGAA8D;AAO9D,IAAO,oBAAoB,GAAG,sCAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;AAEP,oDAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "5.6.1-dev.2319589982",
3
+ "version": "5.6.1-dev.2322628765",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",