more package declarations

This commit is contained in:
2026-05-17 21:52:38 -04:00
parent a8a5930ced
commit f118d3a4f3
44 changed files with 14019 additions and 1918 deletions

View File

@@ -1,6 +1,7 @@
export { EmailService } from './services/email.service';
export { SMSService } from './services/sms.service';
export { PushService } from './services/push.service';
export { APNSService } from './services/apns.service';
export { NotificationService, RateLimitResult } from './services/notification.service';
export { RedisService } from './services/redis.service';
export { TemplateService } from './services/template.service';

View File

@@ -66,7 +66,7 @@ export class EmailService {
data: att.content,
contentType: att.mimeType,
})),
});
} as any);
if (error) {
return {

View File

@@ -45,7 +45,7 @@ export class SMSService {
from: notification.from || config.twilio.messagingServiceSid,
to: notification.to,
metadata: notification.metadata,
});
} as any);
this.sentCount.set(rateLimitKey, currentCount + 1);

View File

@@ -120,6 +120,67 @@ export const DefaultEmailTemplates: TemplateDefinition[] = [
{ name: 'pdf_url', type: 'string', required: true },
],
},
{
id: 'weekly_digest',
name: 'Weekly Digest',
channel: 'email',
locale: 'en',
category: 'report',
subject: 'Your ShieldAI Weekly Digest — {{period_start}} to {{period_end}}',
body: 'Hi {{name}},\n\nHere is your ShieldAI Weekly Digest for {{period_start}} to {{period_end}}.\n\nProtection Score: {{protection_score}}/100\nNew Exposures: {{new_exposures}}\nSpam Events Blocked: {{spam_events_blocked}}\nVoice Threats Detected: {{voice_threats}}\nProperties Monitored: {{properties_monitored}}\n\nView your full report: {{report_url}}\n\nBest regards,\nThe ShieldAI Team',
htmlBody: `
<h2>Your ShieldAI Weekly Digest</h2>
<p>Hi {{name}},</p>
<p>Here is your weekly protection summary for <strong>{{period_start}} to {{period_end}}</strong>.</p>
<h3>Protection Score</h3>
<p>Your protection score is <strong>{{protection_score}}/100</strong>.</p>
<h3>Exposure Summary</h3>
<ul>
<li>New exposures: {{new_exposures}}</li>
<li>Critical exposures: {{critical_exposures}}</li>
</ul>
<h3>Spam Shield</h3>
<ul>
<li>Spam events blocked: {{spam_events_blocked}}</li>
<li>Calls blocked: {{calls_blocked}}</li>
<li>Texts blocked: {{texts_blocked}}</li>
</ul>
<h3>VoicePrint</h3>
<ul>
<li>Voice threats detected: {{voice_threats}}</li>
<li>Active enrollments: {{enrollments_active}}</li>
</ul>
<h3>Home Title Monitoring</h3>
<ul>
<li>Properties monitored: {{properties_monitored}}</li>
<li>Changes detected: {{changes_detected}}</li>
</ul>
<p><a href="{{report_url}}">View Full Report</a></p>
<p>Best regards,<br>The ShieldAI Team</p>
`,
variables: [
{ name: 'name', type: 'string', required: true },
{ name: 'period_start', type: 'string', required: true },
{ name: 'period_end', type: 'string', required: true },
{ name: 'protection_score', type: 'number', required: true },
{ name: 'new_exposures', type: 'number', required: false, defaultValue: '0' },
{ name: 'critical_exposures', type: 'number', required: false, defaultValue: '0' },
{ name: 'spam_events_blocked', type: 'number', required: false, defaultValue: '0' },
{ name: 'calls_blocked', type: 'number', required: false, defaultValue: '0' },
{ name: 'texts_blocked', type: 'number', required: false, defaultValue: '0' },
{ name: 'voice_threats', type: 'number', required: false, defaultValue: '0' },
{ name: 'enrollments_active', type: 'number', required: false, defaultValue: '0' },
{ name: 'properties_monitored', type: 'number', required: false, defaultValue: '0' },
{ name: 'changes_detected', type: 'number', required: false, defaultValue: '0' },
{ name: 'report_url', type: 'string', required: true },
],
},
];
export const DefaultSMSTemplates: TemplateDefinition[] = [