
- Complete NestJS TypeScript implementation with WebSocket support - Direct messaging (DM) and group chat functionality - End-to-end encryption with AES encryption and key pairs - Media file support (images, videos, audio, documents) up to 100MB - Push notifications with Firebase Cloud Messaging integration - Mention alerts and real-time typing indicators - User authentication with JWT and Passport - SQLite database with TypeORM entities and relationships - Comprehensive API documentation with Swagger/OpenAPI - File upload handling with secure access control - Online/offline status tracking and presence management - Message editing, deletion, and reply functionality - Notification management with automatic cleanup - Health check endpoint for monitoring - CORS configuration for cross-origin requests - Environment-based configuration management - Structured for Flutter SDK integration Features implemented: ✅ Real-time messaging with Socket.IO ✅ User registration and authentication ✅ Direct messages and group chats ✅ Media file uploads and management ✅ End-to-end encryption ✅ Push notifications ✅ Mention alerts ✅ Typing indicators ✅ Message read receipts ✅ Online status tracking ✅ File access control ✅ Comprehensive API documentation Ready for Flutter SDK development and production deployment.
87 lines
3.4 KiB
TypeScript
87 lines
3.4 KiB
TypeScript
import { LoggerService, LogLevel } from './logger.service';
|
|
export interface ConsoleLoggerOptions {
|
|
/**
|
|
* Enabled log levels.
|
|
*/
|
|
logLevels?: LogLevel[];
|
|
/**
|
|
* If enabled, will print timestamp (time difference) between current and previous log message.
|
|
*/
|
|
timestamp?: boolean;
|
|
}
|
|
export declare class ConsoleLogger implements LoggerService {
|
|
protected context?: string;
|
|
protected options: ConsoleLoggerOptions;
|
|
private static lastTimestampAt?;
|
|
private originalContext?;
|
|
constructor();
|
|
constructor(context: string);
|
|
constructor(context: string, options: ConsoleLoggerOptions);
|
|
/**
|
|
* Write a 'log' level log, if the configured level allows for it.
|
|
* Prints to `stdout` with newline.
|
|
*/
|
|
log(message: any, context?: string): void;
|
|
log(message: any, ...optionalParams: [...any, string?]): void;
|
|
/**
|
|
* Write an 'error' level log, if the configured level allows for it.
|
|
* Prints to `stderr` with newline.
|
|
*/
|
|
error(message: any, stackOrContext?: string): void;
|
|
error(message: any, stack?: string, context?: string): void;
|
|
error(message: any, ...optionalParams: [...any, string?, string?]): void;
|
|
/**
|
|
* Write a 'warn' level log, if the configured level allows for it.
|
|
* Prints to `stdout` with newline.
|
|
*/
|
|
warn(message: any, context?: string): void;
|
|
warn(message: any, ...optionalParams: [...any, string?]): void;
|
|
/**
|
|
* Write a 'debug' level log, if the configured level allows for it.
|
|
* Prints to `stdout` with newline.
|
|
*/
|
|
debug(message: any, context?: string): void;
|
|
debug(message: any, ...optionalParams: [...any, string?]): void;
|
|
/**
|
|
* Write a 'verbose' level log, if the configured level allows for it.
|
|
* Prints to `stdout` with newline.
|
|
*/
|
|
verbose(message: any, context?: string): void;
|
|
verbose(message: any, ...optionalParams: [...any, string?]): void;
|
|
/**
|
|
* Write a 'fatal' level log, if the configured level allows for it.
|
|
* Prints to `stdout` with newline.
|
|
*/
|
|
fatal(message: any, context?: string): void;
|
|
fatal(message: any, ...optionalParams: [...any, string?]): void;
|
|
/**
|
|
* Set log levels
|
|
* @param levels log levels
|
|
*/
|
|
setLogLevels(levels: LogLevel[]): void;
|
|
/**
|
|
* Set logger context
|
|
* @param context context
|
|
*/
|
|
setContext(context: string): void;
|
|
/**
|
|
* Resets the logger context to the value that was passed in the constructor.
|
|
*/
|
|
resetContext(): void;
|
|
isLevelEnabled(level: LogLevel): boolean;
|
|
protected getTimestamp(): string;
|
|
protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, writeStreamType?: 'stdout' | 'stderr'): void;
|
|
protected formatPid(pid: number): string;
|
|
protected formatContext(context: string): string;
|
|
protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string): string;
|
|
protected stringifyMessage(message: unknown, logLevel: LogLevel): any;
|
|
protected colorize(message: string, logLevel: LogLevel): string;
|
|
protected printStackTrace(stack: string): void;
|
|
protected updateAndGetTimestampDiff(): string;
|
|
protected formatTimestampDiff(timestampDiff: number): string;
|
|
private getContextAndMessagesToPrint;
|
|
private getContextAndStackAndMessagesToPrint;
|
|
private isStackFormat;
|
|
private getColorByLogLevel;
|
|
}
|