Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
chore(notifications): remove APPROACHING_LIMIT and LIMIT_REACHED notification types (#3338)
firecrawl-spring[bot]17c86533042a
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.tsindex 1cdb743d1..cd6a04fe6 100644--- a/apps/api/src/services/billing/credit_billing.ts+++ b/apps/api/src/services/billing/credit_billing.ts@@ -202,26 +202,6 @@ async function supaCheckTeamCredits(// }// }- // TODO: Re-enable credit notifications once they are derived from Autumn balances- // instead of ACUC, which is no longer the source of truth.- // if (chunk.adjusted_credits_used > (chunk.total_credits_sum ?? 100000000)) {- // sendNotification(- // team_id,- // NotificationType.LIMIT_REACHED,- // chunk.sub_current_period_start,- // chunk.sub_current_period_end,- // chunk,- // );- // } else if (creditUsagePercentage >= 0.8 && creditUsagePercentage < 1) {- // sendNotification(- // team_id,- // NotificationType.APPROACHING_LIMIT,- // chunk.sub_current_period_start,- // chunk.sub_current_period_end,- // chunk,- // );- // }-// Compare the adjusted total credits used with the credits allowed by the plan (and graceful)if (!success) {logger.warn("Credit check failed - insufficient credits", {diff --git a/apps/api/src/services/notification/email_notification.ts b/apps/api/src/services/notification/email_notification.tsindex 8854410dd..ffc400ab6 100644--- a/apps/api/src/services/notification/email_notification.ts+++ b/apps/api/src/services/notification/email_notification.ts@@ -21,15 +21,6 @@ type EmailTemplate = {};const emailTemplates: Record<NotificationType, EmailTemplate> = {- [NotificationType.APPROACHING_LIMIT]: {- subject: "You've used 80% of your credit limit - Firecrawl",- html: "Hey there,<br/><p>You are approaching your credit limit for this billing period. Your usage right now is around 80% of your total credit limit. Consider upgrading your plan to avoid hitting the limit. Check out our <a href='https://firecrawl.dev/pricing'>pricing page</a> for more info.</p><br/>Thanks,<br/>Firecrawl Team<br/>",- },- [NotificationType.LIMIT_REACHED]: {- subject:- "Credit Limit Reached! Take action now to resume usage - Firecrawl",- html: "Hey there,<br/><p>You have reached your credit limit for this billing period. To resume usage, please upgrade your plan. Check out our <a href='https://firecrawl.dev/pricing'>pricing page</a> for more info.</p><br/>Thanks,<br/>Firecrawl Team<br/>",- },[NotificationType.RATE_LIMIT_REACHED]: {subject: "Rate Limit Reached - Firecrawl",html: "Hey there,<br/><p>You've hit one of the Firecrawl endpoint's rate limit! Take a breather and try again in a few moments. If you need higher rate limits, consider upgrading your plan. Check out our <a href='https://firecrawl.dev/pricing'>pricing page</a> for more info.</p><p>If you have any questions, feel free to reach out to us at <a href='mailto:[email protected]'>[email protected]</a></p><br/>Thanks,<br/>Firecrawl Team<br/><br/>Ps. this email is only sent once every 7 days if you reach a rate limit.",@@ -74,8 +65,6 @@ const notificationToEmailCategory: Record<NotificationType,"rate_limit_warnings" | "system_alerts"> = {- [NotificationType.APPROACHING_LIMIT]: "system_alerts",- [NotificationType.LIMIT_REACHED]: "system_alerts",[NotificationType.RATE_LIMIT_REACHED]: "rate_limit_warnings",[NotificationType.AUTO_RECHARGE_SUCCESS]: "system_alerts",[NotificationType.AUTO_RECHARGE_FAILED]: "system_alerts",diff --git a/apps/api/src/services/notification/notification_string.ts b/apps/api/src/services/notification/notification_string.tsindex 39ba608db..b68b81b96 100644--- a/apps/api/src/services/notification/notification_string.ts+++ b/apps/api/src/services/notification/notification_string.ts@@ -5,10 +5,6 @@ export function getNotificationString(notificationType: NotificationType,): string {switch (notificationType) {- case NotificationType.APPROACHING_LIMIT:- return "Approaching the limit (80%)";- case NotificationType.LIMIT_REACHED:- return "Limit reached (100%)";case NotificationType.RATE_LIMIT_REACHED:return "Rate limit reached";case NotificationType.AUTO_RECHARGE_SUCCESS:diff --git a/apps/api/src/types.ts b/apps/api/src/types.tsindex 9e68367d8..b5d4815fb 100644--- a/apps/api/src/types.ts+++ b/apps/api/src/types.ts@@ -163,8 +163,6 @@ export type AuthResponse =};export enum NotificationType {- APPROACHING_LIMIT = "approachingLimit",- LIMIT_REACHED = "limitReached",RATE_LIMIT_REACHED = "rateLimitReached",AUTO_RECHARGE_SUCCESS = "autoRechargeSuccess",AUTO_RECHARGE_FAILED = "autoRechargeFailed",