@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.
28 lines (27 loc) • 1.06 kB
TypeScript
import { MongoCollectionClass } from '../../mongo-collection.js';
import { CreateRoleDto, Role, UpdateRoleDto } from '@tmlmobilidade/types';
import { IndexDescription, UpdateResult } from 'mongodb';
import { z } from 'zod';
declare class RolesClass extends MongoCollectionClass<Role, CreateRoleDto, UpdateRoleDto> {
private static _instance;
protected createSchema: z.ZodSchema;
protected updateSchema: z.ZodSchema;
private constructor();
static getInstance(): Promise<RolesClass>;
/**
* Finds a role by its name
*
* @param name - The name of the role to find
* @returns A promise that resolves to the matching role document or null if not found
*/
findByName(name: string): Promise<import("mongodb").WithId<Role> | null>;
/**
* Disable Update Many
*/
updateMany(): Promise<UpdateResult<Role>>;
protected getCollectionIndexes(): IndexDescription[];
protected getCollectionName(): string;
protected getEnvName(): string;
}
export declare const roles: RolesClass;
export {};