@golemio/pid
Version:
Golemio PID Module
47 lines (46 loc) • 2.31 kB
TypeScript
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers";
export declare class GenerateFilesTask extends AbstractEmptyTask {
private static readonly config;
readonly queueName = "generateFiles";
readonly queueTtl: number;
private readonly logger;
private readonly stopTimeRepository;
private readonly tripsRepository;
private readonly gtfsRtRedisRepository;
private readonly alertsGenerator;
private readonly vehicleDescriptor;
constructor(queuePrefix: string);
protected execute(): Promise<void>;
/**
* Get rid of vehicle descriptors with duplicate IDs from a given GTFS-RT message
*
* @param message The message to get rid of duplicate vehicle descriptors from
* @param tripData The trip data to get start timestamps from
* @param options Options for the duplicate removal process
* @param options.removeVehicleOnly Whether to only remove the duplicate vehicle descriptor from the message entity, instead
* of removing the whole entity. Defaults to `false`. Note that if an entity with a duplicate vehicle descriptor does not
* contain any other valuable data, it will be removed regardless of this option.
*/
private removeDuplicateVehicleDescriptors;
/**
* Update a given `EntityWithTripStartByVehicleId` Map with given values if the new entity has a lower trip start date/time
* and is not canceled. The entity that does not end up in the map (either the new entity if it does not meet the conditions
* for the update or the original entity if the new entity does) is returned.
*
* @param entityWithTripStartByVehicleId The Map to update
* @param vehicleId The vehicle ID to use as a key
* @param entity The entity to use as part of the new value, if the conditions are met
* @param entityTripStart The entity trip start date/time to use as part of the new value, if the conditions are met
*/
private conditionallyUpdateEntityByVehicleId;
private generateStopTimeUpdate;
private createFeedHeader;
/**
* Parse UTC date from ISO timestamp
* @example 20230101
*/
private parseUTCDateFromISO;
private validateAndSaveBuffer;
private shouldFallbackToScheduleTime;
private handleCanceledTrip;
}