@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.
72 lines (71 loc) • 3.02 kB
TypeScript
import { MongoCollectionClass } from '../../common/mongo-collection.js';
import { type CreateGtfsValidationDto, type GtfsValidation, type UpdateGtfsValidationDto } from '@tmlmobilidade/types';
import { type IndexDescription } from 'mongodb';
import { z } from 'zod';
declare class GtfValidationsClass extends MongoCollectionClass<GtfsValidation, CreateGtfsValidationDto, UpdateGtfsValidationDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<GtfValidationsClass>;
/**
* Finds GTFS Validation documents by agency ID.
* @param agencyId The agency ID to search for.
* @returns A promise that resolves to an array of matching documents
*/
findByAgencyId(agencyId: string): Promise<import("mongodb").WithId<{
_id: string;
created_at: number & {
__brand: "UnixTimestamp";
};
created_by: string | null;
is_locked: boolean;
updated_at: number & {
__brand: "UnixTimestamp";
};
file_id: string;
processing_status: "error" | "waiting" | "processing" | "complete" | "skipped";
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;
};
notification_sent: boolean;
validation_attempts: number;
validity_status: "valid" | "unknown" | "invalid";
updated_by?: string | undefined;
summary?: {
messages: {
message: string;
file_name: string;
field: string;
rows: number[];
rule_id: string;
severity: "error" | "warning" | "ignore" | "forbidden";
}[];
total_errors: number;
total_warnings: number;
} | null | undefined;
}>[]>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
}
export declare const gtfsValidations: GtfValidationsClass;
export {};