Skip to content

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

chore(acuc): migrate rpc.ts callers to v49 (#3916)

firecrawl-spring[bot]cc0519fc76e2
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index e27ed6ffa..9cd1d5e22 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -281,7 +281,7 @@ export async function getACUC(
while (retries < maxRetries) {
const database = Math.random() > 2 / 3 ? dbRr : db;
try {
- data = await authCreditUsageChunk(database, api_key, isExtract);
+ data = await authCreditUsageChunk(database, api_key);
break;
} catch (error) {
logger.warn(
@@ -401,7 +401,7 @@ export async function getACUCTeam(
while (retries < maxRetries) {
const database = Math.random() > 2 / 3 ? dbRr : db;
try {
- data = await authCreditUsageChunkFromTeam(database, team_id, isExtract);
+ data = await authCreditUsageChunkFromTeam(database, team_id);
break;
} catch (error) {
logger.warn(
diff --git a/apps/api/src/db/rpc.ts b/apps/api/src/db/rpc.ts
index 56e034d54..92f136649 100644
--- a/apps/api/src/db/rpc.ts
+++ b/apps/api/src/db/rpc.ts
@@ -31,11 +31,10 @@ export type AuthCreditUsageChunkRow = Record<string, any> & {
export async function authCreditUsageChunk(
database: DB,
input_key: string,
- i_is_extract: boolean,
): Promise<AuthCreditUsageChunkRow[]> {
const rows = await execRows<AuthCreditUsageChunkRow>(
database,
- sql`select * from auth_credit_usage_chunk_48(input_key => ${input_key}, i_is_extract => ${i_is_extract}, tally_untallied_credits => ${true})`,
+ sql`select * from auth_credit_usage_chunk_49(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) {
@@ -49,11 +48,10 @@ export async function authCreditUsageChunk(
export function authCreditUsageChunkFromTeam(
database: DB,
input_team: string,
- i_is_extract: boolean,
): Promise<AuthCreditUsageChunkRow[]> {
return execRows(
database,
- sql`select * from auth_credit_usage_chunk_48_from_team(input_team => ${input_team}, i_is_extract => ${i_is_extract}, tally_untallied_credits => ${true})`,
+ sql`select * from auth_credit_usage_chunk_49_from_team(input_team => ${input_team})`,
);
}