Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(codex): typecheck catalog sync options and redeem DbClient

Alfredo Lopez55ff8ba1e8b9
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index bff1abf2b..63275ff3e 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.491",
+ "version": "0.1.492",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.491",
+ "version": "0.1.492",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index f4fad6068..c57856d50 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.491",
+ "version": "0.1.492",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/services/codexSubscriptionCatalog.ts b/control-api/src/services/codexSubscriptionCatalog.ts
index 060651cc3..f064879a0 100644
--- a/control-api/src/services/codexSubscriptionCatalog.ts
+++ b/control-api/src/services/codexSubscriptionCatalog.ts
@@ -255,7 +255,7 @@ export async function syncCodexSubscriptionCatalog(
db: DbClient,
transport: CodexCatalogTransport,
accessToken: string,
- expected?: { credentialRevision: number; catalogRevision: number; connectionKey?: string }
+ expected?: { credentialRevision?: number; catalogRevision?: number; connectionKey?: string }
): Promise<{
outcome: CodexCatalogOutcome
connection: CodexSubscriptionSafeConnection | null
diff --git a/control-api/src/services/llmProviderAttemptRedemption.ts b/control-api/src/services/llmProviderAttemptRedemption.ts
index b3cf21501..1aa457d7d 100644
--- a/control-api/src/services/llmProviderAttemptRedemption.ts
+++ b/control-api/src/services/llmProviderAttemptRedemption.ts
@@ -1,6 +1,6 @@
import { createHash } from 'node:crypto'
import { config } from '../config.js'
-import { pool, withTransaction } from '../db.js'
+import { type DbClient, pool, withTransaction } from '../db.js'
import { deriveOAuthEncryptionKey } from '../oauth/encryption.js'
import { rootLogger } from '../observability/logger.js'
import { chatgptAccountIdFromJwt } from './chatgptAccountId.js'
@@ -83,7 +83,7 @@ export function opaqueAttemptReceipt(input: {
export type RedeemAttemptDeps = {
enabled: boolean
- db: { query: (text: string, values?: unknown[]) => Promise<{ rows: unknown[] }> }
+ db: DbClient
withTransaction: typeof withTransaction
loadSecrets: typeof loadCodexSubscriptionSecrets
getConnectionById: typeof getSafeCodexSubscriptionConnectionById
@@ -93,7 +93,7 @@ export type RedeemAttemptDeps = {
const defaultRedeemDeps = (): RedeemAttemptDeps => ({
enabled: config.codexSubscriptionEnabled,
- db: { query: (text, values) => pool.query(text, values) },
+ db: pool,
withTransaction,
loadSecrets: loadCodexSubscriptionSecrets,
getConnectionById: getSafeCodexSubscriptionConnectionById,