@tmlmobilidade/interfaces
Version:
This package provides SDK-style connectors for interacting with databases (e.g., stops, plans, rides, alerts) and external providers (e.g., authentication, storage). It simplifies data access and integration across projects.
84 lines (83 loc) • 3.45 kB
TypeScript
import { MongoCollectionClass } from '../../common/mongo-collection.js';
import { type CreatePlanDto, type Plan, type UpdatePlanDto } from '@tmlmobilidade/types';
import { IndexDescription } from 'mongodb';
import { z } from 'zod';
declare class PlansClass extends MongoCollectionClass<Plan, CreatePlanDto, UpdatePlanDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<PlansClass>;
/**
* Finds Plan documents by agency ID.
*
* @param id - The agency ID to search for
* @returns A promise that resolves to an array of matching documents
*/
findByAgencyId(id: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
is_locked: boolean;
updated_at: number & {
__brand: "UnixTimestamp";
};
gtfs_agency: {
agency_id: string;
agency_name: string;
agency_timezone: string;
agency_email?: string | null | undefined;
agency_fare_url?: string | null | undefined;
agency_lang?: string | null | undefined;
agency_phone?: string | null | undefined;
agency_url?: string | null | undefined;
};
gtfs_feed_info: {
feed_lang: string;
feed_end_date?: import("@tmlmobilidade/types").OperationalDate | null | undefined;
feed_start_date?: import("@tmlmobilidade/types").OperationalDate | null | undefined;
default_lang?: string | null | undefined;
feed_contact_email?: string | null | undefined;
feed_contact_url?: string | null | undefined;
feed_publisher_name?: string | null | undefined;
feed_publisher_url?: string | null | undefined;
feed_version?: string | null | undefined;
};
apex_file_id: string | null;
apps: {
controller: {
status: "error" | "waiting" | "processing" | "complete" | "skipped";
last_hash: string | null;
timestamp: import("@tmlmobilidade/types").UnixTimestamp | null;
};
hub_gtfs: {
status: "error" | "waiting" | "processing" | "complete" | "skipped";
last_hash: string | null;
timestamp: import("@tmlmobilidade/types").UnixTimestamp | null;
};
hub_schedules: {
status: "error" | "waiting" | "processing" | "complete" | "skipped";
last_hash: string | null;
timestamp: import("@tmlmobilidade/types").UnixTimestamp | null;
};
merger: {
status: "error" | "waiting" | "processing" | "complete" | "skipped";
last_hash: string | null;
timestamp: import("@tmlmobilidade/types").UnixTimestamp | null;
};
};
hash: string;
operation_file_id: string;
pcgi_legacy: {
operation_plan_id: string | null;
};
updated_by?: string | undefined;
}>[]>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
}
export declare const plans: PlansClass;
export {};