template-saas/apps/backend/dist/modules/notifications/services/push-notification.service.d.ts
rckrdmrd 50a821a415
Some checks failed
CI / Backend CI (push) Has been cancelled
CI / Frontend CI (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / CI Summary (push) Has been cancelled
[SIMCO-V38] feat: Actualizar a SIMCO v3.8.0
- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8
- Actualizaciones de configuracion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 08:53:08 -06:00

42 lines
1.4 KiB
TypeScript

import { OnModuleInit } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Repository } from 'typeorm';
import { UserDevice, NotificationLog } from '../entities';
export interface PushPayload {
title: string;
body: string;
icon?: string;
badge?: string;
url?: string;
data?: Record<string, any>;
actions?: Array<{
action: string;
title: string;
}>;
}
export interface SendResult {
deviceId: string;
success: boolean;
error?: string;
statusCode?: number;
}
export declare class PushNotificationService implements OnModuleInit {
private readonly configService;
private readonly deviceRepository;
private readonly logRepository;
private readonly logger;
private isConfigured;
constructor(configService: ConfigService, deviceRepository: Repository<UserDevice>, logRepository: Repository<NotificationLog>);
onModuleInit(): void;
isEnabled(): boolean;
getVapidPublicKey(): string | null;
sendToUser(userId: string, tenantId: string, payload: PushPayload, notificationId?: string): Promise<SendResult[]>;
sendToDevice(device: UserDevice, payload: string, notificationId?: string): Promise<SendResult>;
sendBroadcast(tenantId: string, payload: PushPayload): Promise<{
total: number;
successful: number;
failed: number;
}>;
validateSubscription(subscriptionJson: string): boolean;
}