@golemio/pid
Version:
Golemio PID Module
85 lines (84 loc) • 3.89 kB
TypeScript
import { ITripWithOptionalAssociationsDto } from "../../../schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto";
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
import Sequelize from "@golemio/core/dist/shared/sequelize";
export declare class GTFSTripsModel extends SequelizeModel {
private dbConnector;
private tripScheduleRepository;
constructor();
Associate: (models: any) => void;
/** Retrieves all gtfs trips
* @param {object} options Options object with params
* @param {number} [options.limit] Limit
* @param {number} [options.offset] Offset
* @param {boolean} [options.route] Enhance response with route data
* @param {string} [options.stopId] Filter routes by specific stop
* @param {string} [options.date] Filter by specific date in the 'YYYY-MM-DD' format
* @returns Array of the retrieved records
*/
GetAll: (options?: {
limit?: number;
offset?: number;
stopId?: string;
date?: string;
}) => Promise<any>;
/** Retrieves specific GTFS trip
* @param {string} id Id of the trip
* @param {object} [options] Options object with params
* @param {boolean} [options.route] Enhance response with route data
* @param {boolean} [options.shapes] Enhance response with shape data
* @param {boolean} [options.service] Enhance response with service data
* @param {boolean} [options.stops] Enhance response with stop data
* @param {boolean} [options.stopTimes] Enhance response with stop times data
* @param {string} [options.date] Filter by specific date in the 'YYYY-MM-DD' format
* @returns Object of the retrieved record or null
*/
GetOne: (id: string, options?: {
route?: boolean;
shapes?: boolean;
service?: boolean;
stops?: boolean;
stopTimes?: boolean;
date?: string;
}) => Promise<object>;
getOneForPublicGtfsLookup: (id: string, options?: {
shouldIncludeStopTimes?: boolean;
shouldIncludeShapes?: boolean;
}) => Promise<ITripWithOptionalAssociationsDto | null>;
/** Prepare ORM query with selected params
* @param {object} options Options object with params
* @param {boolean} [options.route] Enhance response with route data
* @param {boolean} [options.shapes] Enhance response with shape data
* @param {boolean} [options.service] Enhance response with service data
* @param {boolean} [options.stops] Enhance response with stop data
* @param {boolean} [options.stopTimes] Enhance response with stop times data
* @param {string} [options.date] Filter by specific date in the 'YYYY-MM-DD' format
* @returns Array of inclusions
*/
protected GetInclusions: (options: {
route?: boolean;
shapes?: boolean;
service?: boolean;
stops?: boolean;
stopTimes?: boolean;
date?: string;
}) => Sequelize.Includeable[];
private getInclusionsForPublicGtfsLookup;
/**
* Convert a single db result to proper output format with all its included sub-elements
* @param {object} trip Trip object
* @param {object} options Options object with params
* @param {boolean} [options.shapes] If shapes were included in filter then convert shapes payload
* @param {boolean} [options.stops] If stops were included in filter then convert stops payload
* @returns A converted item of the result
*/
protected ConvertItem: (trip: any, options: {
route?: boolean;
stops?: boolean;
shapes?: boolean;
stopTimes?: boolean;
}) => any;
/**
* Builds the correct format of a response data
*/
protected BuildResponse: (responseObject: any, longLoc: string, latLoc: string) => import("@golemio/core/dist/output-gateway/Geo").IGeoJSONFeature;
}