rebranding work
This commit is contained in:
@@ -4,7 +4,7 @@ import { drizzle } from "drizzle-orm/libsql";
|
||||
import * as schema from "./schema";
|
||||
|
||||
const client = createClient({
|
||||
url: process.env.DATABASE_URL ?? "libsql://shieldai-dev-mikefreno.aws-us-east-1.turso.io",
|
||||
url: process.env.DATABASE_URL ?? "libsql://kordant-dev-mikefreno.aws-us-east-1.turso.io",
|
||||
authToken: process.env.DATABASE_AUTH_TOKEN,
|
||||
});
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ function createRedisAdapter(): QueueAdapter {
|
||||
maxRetriesPerRequest: null,
|
||||
});
|
||||
|
||||
const queue = new BullMQ.Queue("shieldai-jobs", { connection });
|
||||
const queue = new BullMQ.Queue("kordant-jobs", { connection });
|
||||
let bullJobs = new Map<string, any>();
|
||||
|
||||
async function toJob(bullJob: any): Promise<Job> {
|
||||
|
||||
@@ -48,7 +48,7 @@ export async function publishAlert(userId: string, alert: PublishableAlert): Pro
|
||||
if (user?.email) {
|
||||
await sendEmail(
|
||||
user.email,
|
||||
`[ShieldAI] ${alert.title}`,
|
||||
`[Kordant] ${alert.title}`,
|
||||
`<p>${alert.message}</p>`,
|
||||
alert.message,
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ describe("welcomeEmail", () => {
|
||||
expect(result.subject).toContain("Welcome");
|
||||
expect(result.html).toContain("Alice");
|
||||
expect(result.text).toContain("Alice");
|
||||
expect(result.html).toContain("ShieldAI");
|
||||
expect(result.html).toContain("Kordant");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,30 +37,30 @@ describe("alertNotificationEmail", () => {
|
||||
|
||||
describe("passwordResetEmail", () => {
|
||||
it("includes the reset link", () => {
|
||||
const result = passwordResetEmail("https://shieldai.app/reset/token123");
|
||||
expect(result.html).toContain("https://shieldai.app/reset/token123");
|
||||
expect(result.text).toContain("https://shieldai.app/reset/token123");
|
||||
const result = passwordResetEmail("https://kordant.ai/reset/token123");
|
||||
expect(result.html).toContain("https://kordant.ai/reset/token123");
|
||||
expect(result.text).toContain("https://kordant.ai/reset/token123");
|
||||
expect(result.subject).toContain("Reset");
|
||||
});
|
||||
});
|
||||
|
||||
describe("familyInviteEmail", () => {
|
||||
it("includes inviter name and group name", () => {
|
||||
const result = familyInviteEmail("Bob", "Smith Family", "https://shieldai.app/invite/abc");
|
||||
const result = familyInviteEmail("Bob", "Smith Family", "https://kordant.ai/invite/abc");
|
||||
expect(result.html).toContain("Bob");
|
||||
expect(result.html).toContain("Smith Family");
|
||||
expect(result.html).toContain("https://shieldai.app/invite/abc");
|
||||
expect(result.html).toContain("https://kordant.ai/invite/abc");
|
||||
expect(result.subject).toContain("Bob");
|
||||
});
|
||||
});
|
||||
|
||||
describe("billingReceiptEmail", () => {
|
||||
it("includes payment details", () => {
|
||||
const result = billingReceiptEmail("Premium Plan", "$19.99", "Mar 15, 2025", "https://shieldai.app/receipt/r1");
|
||||
const result = billingReceiptEmail("Premium Plan", "$19.99", "Mar 15, 2025", "https://kordant.ai/receipt/r1");
|
||||
expect(result.html).toContain("Premium Plan");
|
||||
expect(result.html).toContain("$19.99");
|
||||
expect(result.html).toContain("Mar 15, 2025");
|
||||
expect(result.html).toContain("https://shieldai.app/receipt/r1");
|
||||
expect(result.html).toContain("https://kordant.ai/receipt/r1");
|
||||
expect(result.subject).toContain("Premium Plan");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ function brandedWrapper(title: string, body: string) {
|
||||
<table width="480" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border-radius:8px;overflow:hidden">
|
||||
<tr>
|
||||
<td style="background-color:#1a1a2e;padding:24px;text-align:center">
|
||||
<h1 style="color:#ffffff;margin:0;font-size:20px;font-weight:700">🛡️ ShieldAI</h1>
|
||||
<h1 style="color:#ffffff;margin:0;font-size:20px;font-weight:700">🛡️ Kordant</h1>
|
||||
<p style="color:#94a3b8;margin:4px 0 0;font-size:13px">Intelligent Protection</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -21,7 +21,7 @@ function brandedWrapper(title: string, body: string) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#f8fafc;padding:16px 24px;text-align:center;border-top:1px solid #e2e8f0">
|
||||
<p style="color:#64748b;margin:0;font-size:12px">ShieldAI — Your intelligent digital protection platform</p>
|
||||
<p style="color:#64748b;margin:0;font-size:12px">Kordant — Your intelligent digital protection platform</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -33,7 +33,7 @@ function brandedWrapper(title: string, body: string) {
|
||||
}
|
||||
|
||||
function brandedText(text: string) {
|
||||
return `ShieldAI - Intelligent Protection\n\n${text}\n\n---\nShieldAI - Your intelligent digital protection platform`;
|
||||
return `Kordant - Intelligent Protection\n\n${text}\n\n---\nKordant - Your intelligent digital protection platform`;
|
||||
}
|
||||
|
||||
export interface EmailTemplate {
|
||||
@@ -44,16 +44,16 @@ export interface EmailTemplate {
|
||||
|
||||
export function welcomeEmail(name: string): EmailTemplate {
|
||||
return {
|
||||
subject: "Welcome to ShieldAI",
|
||||
subject: "Welcome to Kordant",
|
||||
html: brandedWrapper(
|
||||
"Welcome to ShieldAI!",
|
||||
"Welcome to Kordant!",
|
||||
`<p style="color:#334155;margin:0 0 12px;line-height:1.6">Hi ${name},</p>
|
||||
<p style="color:#334155;margin:0 0 12px;line-height:1.6">Thank you for joining ShieldAI. We're here to help you monitor and protect your digital identity.</p>
|
||||
<p style="color:#334155;margin:0 0 12px;line-height:1.6">Thank you for joining Kordant. We're here to help you monitor and protect your digital identity.</p>
|
||||
<p style="color:#334155;margin:0 0 12px;line-height:1.6">Get started by adding your first watchlist item, and we'll alert you to any exposures or threats.</p>
|
||||
<p style="color:#334155;margin:0;line-height:1.6">Stay safe,<br>The ShieldAI Team</p>`,
|
||||
<p style="color:#334155;margin:0;line-height:1.6">Stay safe,<br>The Kordant Team</p>`,
|
||||
),
|
||||
text: brandedText(
|
||||
`Hi ${name},\n\nThank you for joining ShieldAI. We're here to help you monitor and protect your digital identity.\n\nGet started by adding your first watchlist item, and we'll alert you to any exposures or threats.\n\nStay safe,\nThe ShieldAI Team`,
|
||||
`Hi ${name},\n\nThank you for joining Kordant. We're here to help you monitor and protect your digital identity.\n\nGet started by adding your first watchlist item, and we'll alert you to any exposures or threats.\n\nStay safe,\nThe Kordant Team`,
|
||||
),
|
||||
};
|
||||
}
|
||||
@@ -68,22 +68,22 @@ export function alertNotificationEmail(
|
||||
severity === "warning" ? "#d97706" : "#2563eb";
|
||||
|
||||
return {
|
||||
subject: `[${severity.toUpperCase()}] ShieldAI Alert: ${alertTitle}`,
|
||||
subject: `[${severity.toUpperCase()}] Kordant Alert: ${alertTitle}`,
|
||||
html: brandedWrapper(
|
||||
`Alert: ${alertTitle}`,
|
||||
`<div style="display:inline-block;padding:4px 10px;border-radius:4px;font-size:12px;font-weight:600;text-transform:uppercase;color:#ffffff;background-color:${severityColor};margin-bottom:16px">${severity}</div>
|
||||
<p style="color:#334155;margin:0 0 12px;line-height:1.6">${alertMessage}</p>
|
||||
<p style="color:#64748b;margin:0;line-height:1.6;font-size:13px">Log in to ShieldAI for more details.</p>`,
|
||||
<p style="color:#64748b;margin:0;line-height:1.6;font-size:13px">Log in to Kordant for more details.</p>`,
|
||||
),
|
||||
text: brandedText(
|
||||
`[${severity.toUpperCase()}] Alert: ${alertTitle}\n\n${alertMessage}\n\nLog in to ShieldAI for more details.`,
|
||||
`[${severity.toUpperCase()}] Alert: ${alertTitle}\n\n${alertMessage}\n\nLog in to Kordant for more details.`,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
export function passwordResetEmail(resetLink: string): EmailTemplate {
|
||||
return {
|
||||
subject: "Reset your ShieldAI password",
|
||||
subject: "Reset your Kordant password",
|
||||
html: brandedWrapper(
|
||||
"Password Reset",
|
||||
`<p style="color:#334155;margin:0 0 12px;line-height:1.6">You requested a password reset. Click the button below to set a new password.</p>
|
||||
@@ -108,10 +108,10 @@ export function familyInviteEmail(
|
||||
acceptLink: string,
|
||||
): EmailTemplate {
|
||||
return {
|
||||
subject: `${inviterName} invited you to ${groupName} on ShieldAI`,
|
||||
subject: `${inviterName} invited you to ${groupName} on Kordant`,
|
||||
html: brandedWrapper(
|
||||
"Family Invitation",
|
||||
`<p style="color:#334155;margin:0 0 12px;line-height:1.6"><strong>${inviterName}</strong> has invited you to join <strong>${groupName}</strong> on ShieldAI.</p>
|
||||
`<p style="color:#334155;margin:0 0 12px;line-height:1.6"><strong>${inviterName}</strong> has invited you to join <strong>${groupName}</strong> on Kordant.</p>
|
||||
<p style="color:#334155;margin:0 0 12px;line-height:1.6">As a family member, you'll get shared protection and alerts for your digital identity.</p>
|
||||
<table cellpadding="0" cellspacing="0" style="margin:24px 0">
|
||||
<tr>
|
||||
@@ -122,7 +122,7 @@ export function familyInviteEmail(
|
||||
</table>`,
|
||||
),
|
||||
text: brandedText(
|
||||
`Family Invitation\n\n${inviterName} has invited you to join ${groupName} on ShieldAI.\n\nAs a family member, you'll get shared protection and alerts for your digital identity.\n\nAccept the invitation: ${acceptLink}`,
|
||||
`Family Invitation\n\n${inviterName} has invited you to join ${groupName} on Kordant.\n\nAs a family member, you'll get shared protection and alerts for your digital identity.\n\nAccept the invitation: ${acceptLink}`,
|
||||
),
|
||||
};
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export function billingReceiptEmail(
|
||||
receiptUrl: string,
|
||||
): EmailTemplate {
|
||||
return {
|
||||
subject: `ShieldAI receipt — ${planName} (${date})`,
|
||||
subject: `Kordant receipt — ${planName} (${date})`,
|
||||
html: brandedWrapper(
|
||||
"Payment Receipt",
|
||||
`<p style="color:#334155;margin:0 0 8px;line-height:1.6">Thank you for your payment.</p>
|
||||
|
||||
@@ -43,7 +43,7 @@ describe("sendEmail", () => {
|
||||
const result = await sendEmail("test@example.com", "Subject", "<p>Body</p>", "Text body");
|
||||
|
||||
expect(mockResendSend).toHaveBeenCalledWith({
|
||||
from: "noreply@shieldai.app",
|
||||
from: "noreply@kordant.ai",
|
||||
to: "test@example.com",
|
||||
subject: "Subject",
|
||||
html: "<p>Body</p>",
|
||||
|
||||
@@ -20,7 +20,7 @@ export async function sendEmail(
|
||||
|
||||
try {
|
||||
const { data, error } = await resend.emails.send({
|
||||
from: process.env.RESEND_FROM_EMAIL ?? "noreply@shieldai.app",
|
||||
from: process.env.RESEND_FROM_EMAIL ?? "noreply@kordant.ai",
|
||||
to,
|
||||
subject,
|
||||
html,
|
||||
|
||||
@@ -93,7 +93,7 @@ export async function generateReport(
|
||||
const periodEnd = periodEndStr ? new Date(periodEndStr) : undefined;
|
||||
|
||||
const reportLabel = getReportTypeLabel(reportType);
|
||||
const title = `ShieldAI ${reportLabel} Security Report`;
|
||||
const title = `Kordant ${reportLabel} Security Report`;
|
||||
|
||||
const [report] = await db
|
||||
.insert(securityReports)
|
||||
|
||||
@@ -165,13 +165,13 @@ export async function compileData(
|
||||
day: "numeric",
|
||||
});
|
||||
|
||||
const title = `ShieldAI ${reportType === "WEEKLY_DIGEST" ? "Weekly" : reportType === "MONTHLY_PLUS" ? "Monthly" : "Annual"} Security Report`;
|
||||
const title = `Kordant ${reportType === "WEEKLY_DIGEST" ? "Weekly" : reportType === "MONTHLY_PLUS" ? "Monthly" : "Annual"} Security Report`;
|
||||
|
||||
return {
|
||||
title,
|
||||
periodStart: ps.toLocaleDateString(),
|
||||
periodEnd: pe.toLocaleDateString(),
|
||||
summary: `During this period, ShieldAI detected ${alertCount} security alerts, ${exposureCount} data exposures, ${voiceAnalysisCount} voice analysis events, ${spamDetectionCount} spam detections, and ${propTotal.count} property changes.`,
|
||||
summary: `During this period, Kordant detected ${alertCount} security alerts, ${exposureCount} data exposures, ${voiceAnalysisCount} voice analysis events, ${spamDetectionCount} spam detections, and ${propTotal.count} property changes.`,
|
||||
threatScore,
|
||||
threatLevel,
|
||||
threatTrend,
|
||||
@@ -206,7 +206,7 @@ function compileRecommendations(
|
||||
}
|
||||
if (voiceAnalysisCount > 0) {
|
||||
items.push(
|
||||
`<div class="recommendation">🟢 <strong>Voice Security:</strong> Monitor voice call activity regularly. ShieldAI flagged ${voiceAnalysisCount} analysis event(s) this period.</div>`,
|
||||
`<div class="recommendation">🟢 <strong>Voice Security:</strong> Monitor voice call activity regularly. Kordant flagged ${voiceAnalysisCount} analysis event(s) this period.</div>`,
|
||||
);
|
||||
}
|
||||
if (spamDetectionCount > 5) {
|
||||
@@ -215,7 +215,7 @@ function compileRecommendations(
|
||||
);
|
||||
}
|
||||
items.push(
|
||||
`<div class="recommendation">ℹ️ <strong>Stay Proactive:</strong> Regularly review your ShieldAI dashboard for real-time security updates and run DarkWatch scans weekly.</div>`,
|
||||
`<div class="recommendation">ℹ️ <strong>Stay Proactive:</strong> Regularly review your Kordant dashboard for real-time security updates and run DarkWatch scans weekly.</div>`,
|
||||
);
|
||||
|
||||
return items.join("\n");
|
||||
|
||||
Reference in New Issue
Block a user