Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

chore(api): bump ACUC to v54 (drop dead subscription/price fields) (#4021)

firecrawl-spring[bot]70446820a92e
diff --git a/apps/api/src/__tests__/controllers/fireclaw.test.ts b/apps/api/src/__tests__/controllers/fireclaw.test.ts
index 4d5642511..ac206848a 100644
--- a/apps/api/src/__tests__/controllers/fireclaw.test.ts
+++ b/apps/api/src/__tests__/controllers/fireclaw.test.ts
@@ -40,7 +40,7 @@ function buildReq(overrides: any = {}): any {
return {
body: { plays: 1 },
auth: { team_id: "team_test", org_id: "org_test" },
- acuc: { sub_id: "sub_1", api_key_id: 1 },
+ acuc: { api_key_id: 1 },
...overrides,
};
}
@@ -104,7 +104,6 @@ describe("fireclawController credit gating (Autumn)", () => {
);
expect(billTeamMock).toHaveBeenCalledWith(
"team_test",
- "sub_1",
200,
1,
expect.objectContaining({ endpoint: "fireclaw" }),
@@ -129,7 +128,6 @@ describe("fireclawController credit gating (Autumn)", () => {
expect(billTeamMock).toHaveBeenCalledWith(
"team_test",
- "sub_1",
300,
1,
expect.objectContaining({ endpoint: "fireclaw" }),
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index b19c01aec..59e6dc8c7 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -79,11 +79,7 @@ const mockPreviewACUC: (
api_key: "preview",
api_key_id: 0,
team_id,
- sub_id: null,
- sub_current_period_start: null,
- sub_current_period_end: null,
sub_user_id: null,
- price_id: null,
rate_limits: {
crawl: 2,
scrape: 10,
@@ -96,8 +92,6 @@ const mockPreviewACUC: (
extractAgentPreview: 1,
scrapeAgentPreview: 5,
},
- price_should_be_graceful: false,
- price_associated_auto_recharge_price_id: null,
plan_priority: {
bucketLimit: 25,
planModifier: 0.1,
@@ -111,13 +105,7 @@ const mockACUC: () => AuthCreditUsageChunk = () => ({
api_key: "bypass",
api_key_id: 0,
team_id: "bypass",
- sub_id: "bypass",
- sub_current_period_start: new Date().toISOString(),
- sub_current_period_end: new Date(
- new Date().getTime() + 30 * 24 * 60 * 60 * 1000,
- ).toISOString(),
sub_user_id: "bypass",
- price_id: "bypass",
rate_limits: {
crawl: 99999999,
scrape: 99999999,
@@ -130,8 +118,6 @@ const mockACUC: () => AuthCreditUsageChunk = () => ({
extractAgentPreview: 99999999,
scrapeAgentPreview: 99999999,
},
- price_should_be_graceful: false,
- price_associated_auto_recharge_price_id: null,
plan_priority: {
bucketLimit: 25,
planModifier: 0.1,
@@ -702,7 +688,6 @@ async function supaAuthenticateUser(
let normalizedApi: string;
let teamId: string | null = null;
- let priceId: string | null = null;
let chunk: AuthCreditUsageChunk | null = null;
if (token == "this_is_just_a_preview_token") {
throw new Error(
@@ -743,7 +728,6 @@ async function supaAuthenticateUser(
}
teamId = chunk.team_id;
- priceId = chunk.price_id;
subscriptionData = {
team_id: teamId,
@@ -774,7 +758,6 @@ async function supaAuthenticateUser(
}
teamId = chunk.team_id;
- priceId = chunk.price_id;
subscriptionData = {
team_id: teamId,
@@ -824,7 +807,6 @@ async function supaAuthenticateUser(
} catch (rateLimiterRes) {
// logger.error(`Rate limit exceeded: ${rateLimiterRes}`, {
// teamId,
- // priceId,
// mode,
// rateLimits: chunk?.rate_limits,
// rateLimiterRes,
diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts
index 444b6adef..da61bfb1c 100644
--- a/apps/api/src/controllers/v1/types.ts
+++ b/apps/api/src/controllers/v1/types.ts
@@ -1257,13 +1257,7 @@ export type AuthCreditUsageChunk = {
api_key_id: number;
team_id: string;
org_id?: string | null;
- sub_id: string | null;
- sub_current_period_start: string | null;
- sub_current_period_end: string | null;
sub_user_id: string | null;
- price_id: string | null;
- price_should_be_graceful: boolean;
- price_associated_auto_recharge_price_id: string | null;
plan_priority: {
bucketLimit: number;
planModifier: number;
diff --git a/apps/api/src/db/rpc.ts b/apps/api/src/db/rpc.ts
index a5ebf9fd3..b4c805462 100644
--- a/apps/api/src/db/rpc.ts
+++ b/apps/api/src/db/rpc.ts
@@ -34,7 +34,7 @@ export async function authCreditUsageChunk(
): Promise<AuthCreditUsageChunkRow[]> {
const rows = await execRows<AuthCreditUsageChunkRow>(
database,
- sql`select * from auth_credit_usage_chunk_53(input_key => ${input_key})`,
+ sql`select * from auth_credit_usage_chunk_54(input_key => ${input_key})`,
);
// api_key_id is a bigint column, so the pg driver hands it back as a string.
for (const row of rows) {
@@ -51,7 +51,7 @@ export function authCreditUsageChunkFromTeam(
): Promise<AuthCreditUsageChunkRow[]> {
return execRows(
database,
- sql`select * from auth_credit_usage_chunk_53_from_team(input_team => ${input_team})`,
+ sql`select * from auth_credit_usage_chunk_54_from_team(input_team => ${input_team})`,
);
}