@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.
27 lines (26 loc) • 1.21 kB
TypeScript
import { MongoCollectionClass } from '../../common/mongo-collection.js';
import { type CreateNotificationDto, type Notification, UpdateNotificationDto, User } from '@tmlmobilidade/types';
import { IndexDescription } from 'mongodb';
import { z } from 'zod';
declare class NotificationsClass extends MongoCollectionClass<Notification, CreateNotificationDto, UpdateNotificationDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<NotificationsClass>;
sendNotification(scope: string, topic: string, user: User, id: string, title: string, description: string): Promise<void>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
/**
* Collects all effective permissions of a user (direct + via roles),
* merging duplicates by (scope:action).
*/
private collectUserPermissions;
/**
* Determines whether a user can receive email notifications for a topic.
*/
private getNotificationPermission;
}
export declare const notifications: NotificationsClass;
export {};