import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
import { ApiKeyCreateResult, CreateApiKeyParams, PaginationConfig } from "../../types/utility.js";
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
import { ApiKeyInsert, ApiKeySelect, ApiKeyUpdate } from "../../types/entities.js";

//#region src/data-access/runtime/apiKeys.d.ts
declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  id: string;
}) => Promise<{
  id: string;
  name: string | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  agentId: string;
  expiresAt: string | null;
  publicId: string;
  keyHash: string;
  keyPrefix: string;
  lastUsedAt: string | null;
} | undefined>;
declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
  id: string;
  name: string | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  agentId: string;
  expiresAt: string | null;
  publicId: string;
  keyHash: string;
  keyPrefix: string;
  lastUsedAt: string | null;
} | undefined>;
declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  agentId?: string;
}) => Promise<{
  id: string;
  name: string | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  agentId: string;
  expiresAt: string | null;
  publicId: string;
  keyHash: string;
  keyPrefix: string;
  lastUsedAt: string | null;
}[]>;
declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  pagination?: PaginationConfig;
  agentId?: string;
}) => Promise<{
  data: ApiKeySelect[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    pages: number;
  };
}>;
declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
  id: string;
  name: string | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  agentId: string;
  expiresAt: string | null;
  publicId: string;
  keyHash: string;
  keyPrefix: string;
  lastUsedAt: string | null;
}>;
declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  id: string;
  data: ApiKeyUpdate;
}) => Promise<{
  createdAt: string;
  updatedAt: string;
  agentId: string;
  publicId: string;
  keyHash: string;
  keyPrefix: string;
  name: string | null;
  lastUsedAt: string | null;
  expiresAt: string | null;
  projectId: string;
  tenantId: string;
  id: string;
}>;
declare const deleteApiKey: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  id: string;
}) => Promise<boolean>;
declare const hasApiKey: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  id: string;
}) => Promise<boolean>;
declare const updateApiKeyLastUsed: (db: AgentsRunDatabaseClient) => (params: {
  id: string;
  scopes: ProjectScopeConfig;
}) => Promise<void>;
declare const countApiKeys: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  agentId?: string;
}) => Promise<number>;
/**
 * Create a new API key
 * Returns both the API key record and the full key (which should be shown to the user only once)
 */
declare const generateAndCreateApiKey: (params: CreateApiKeyParams, db: AgentsRunDatabaseClient) => Promise<ApiKeyCreateResult>;
declare const validateAndGetApiKey: (key: string, db: AgentsRunDatabaseClient) => Promise<ApiKeySelect | null>;
//#endregion
export { countApiKeys, createApiKey, deleteApiKey, generateAndCreateApiKey, getApiKeyById, getApiKeyByPublicId, hasApiKey, listApiKeys, listApiKeysPaginated, updateApiKey, updateApiKeyLastUsed, validateAndGetApiKey };