UNPKG

@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.

125 lines (124 loc) • 6.08 kB
import { MongoCollectionClass } from '../../common/mongo-collection.js'; import { type Alert, type CreateAlertDto, type UpdateAlertDto } from '@tmlmobilidade/types'; import { IndexDescription } from 'mongodb'; import { z } from 'zod'; declare class AlertsClass extends MongoCollectionClass<Alert, CreateAlertDto, UpdateAlertDto> { private static _instance; protected createSchema: z.ZodSchema; protected updateSchema: z.ZodSchema; private constructor(); static getInstance(): Promise<AlertsClass>; findByExternalId(external_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"; }; description: string; active_period_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; active_period_start_date: number & { __brand: "UnixTimestamp"; }; agency_id: string; auto_texts: boolean; cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_ISSUE" | "WEATHER" | "ABUSIVE_PARKING" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "NETWORK_UPDATE" | "ROAD_ISSUE" | "TRAFFIC_JAM" | "PUBLIC_DISORDER" | "VEHICLE_ISSUE"; coordinates: [number, number] | null; effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_SERVICE" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "REALTIME_INFO_ISSUE" | "ON_BOARD_SALE_ISSUE"; external_id: string | null; file_id: string | null; info_url: string | null; municipality_ids: string[]; publish_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_start_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_status: "published" | "archived" | "draft"; reference_type: "agency" | "lines" | "stops" | "rides"; references: { child_ids: string[]; parent_id: string; }[]; title: string; user_instructions: string; updated_by?: string | undefined; }>>; findByMunicipalityId(municipality_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"; }; description: string; active_period_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; active_period_start_date: number & { __brand: "UnixTimestamp"; }; agency_id: string; auto_texts: boolean; cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_ISSUE" | "WEATHER" | "ABUSIVE_PARKING" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "NETWORK_UPDATE" | "ROAD_ISSUE" | "TRAFFIC_JAM" | "PUBLIC_DISORDER" | "VEHICLE_ISSUE"; coordinates: [number, number] | null; effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_SERVICE" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "REALTIME_INFO_ISSUE" | "ON_BOARD_SALE_ISSUE"; external_id: string | null; file_id: string | null; info_url: string | null; municipality_ids: string[]; publish_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_start_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_status: "published" | "archived" | "draft"; reference_type: "agency" | "lines" | "stops" | "rides"; references: { child_ids: string[]; parent_id: string; }[]; title: string; user_instructions: string; updated_by?: string | undefined; }>[]>; findByTitle(title: string): Promise<import("mongodb").WithId<{ _id: string; created_at: number & { __brand: "UnixTimestamp"; }; created_by: string | null; is_locked: boolean; updated_at: number & { __brand: "UnixTimestamp"; }; description: string; active_period_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; active_period_start_date: number & { __brand: "UnixTimestamp"; }; agency_id: string; auto_texts: boolean; cause: "ACCIDENT" | "CONSTRUCTION" | "DEMONSTRATION" | "MEDICAL_EMERGENCY" | "POLICE_ACTIVITY" | "STRIKE" | "TECHNICAL_ISSUE" | "WEATHER" | "ABUSIVE_PARKING" | "DRIVER_ABSENCE" | "DRIVER_ISSUE" | "HIGH_PASSENGER_LOAD" | "NETWORK_UPDATE" | "ROAD_ISSUE" | "TRAFFIC_JAM" | "PUBLIC_DISORDER" | "VEHICLE_ISSUE"; coordinates: [number, number] | null; effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_SERVICE" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "REALTIME_INFO_ISSUE" | "ON_BOARD_SALE_ISSUE"; external_id: string | null; file_id: string | null; info_url: string | null; municipality_ids: string[]; publish_end_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_start_date: import("@tmlmobilidade/types").UnixTimestamp | null; publish_status: "published" | "archived" | "draft"; reference_type: "agency" | "lines" | "stops" | "rides"; references: { child_ids: string[]; parent_id: string; }[]; title: string; user_instructions: string; updated_by?: string | undefined; }>>; protected getCollectionIndexes(): IndexDescription[]; protected getCollectionName(): string; protected getEnvName(): string; } export declare const alerts: AlertsClass; export {};