import { ModuleAdapterInterface } from '@defikitdotnet/agent-framework-core'; import type { DatabaseAdapter } from '@elizaos/core'; import type { Database } from 'better-sqlite3'; import { Account, MiniApp, MiniAppStatus } from '../models'; import { Account as Ac } from '@defikitdotnet/agent-framework-core'; /** * SQL schema for miniapp related tables */ export declare const sqliteTables = "\nPRAGMA foreign_keys=ON;\nBEGIN TRANSACTION;\n\n-- Miniapps table for storing published agents\nCREATE TABLE IF NOT EXISTS \"miniapps\" ( \n \"agentId\" TEXT PRIMARY KEY REFERENCES accounts(id) ON DELETE CASCADE, \n \"publishedAt\" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, \n \"status\" TEXT DEFAULT 'published' CHECK(status IN ('published', 'unpublished')),\n \"questions\" TEXT\n);\n\n-- Create indexes for faster queries\nCREATE INDEX IF NOT EXISTS \"idx_miniapps_status\" ON \"miniapps\" (\"status\");\nCREATE INDEX IF NOT EXISTS \"idx_miniapps_publishedAt\" ON \"miniapps\" (\"publishedAt\");\n\nCOMMIT;\n"; /** * MiniApp with account details */ export interface MiniAppWithAccount extends MiniApp { account: Account; } export interface MiniAppWithAccountResult { agentId: string; publishedAt: string; status: MiniAppStatus; id: string; createdAt: string; name: string; username: string; email: string; avatarUrl?: string; details: string | null; character: string | null; questions: string | null; createdBy: string; isExportData: boolean; type: string; } /** * MiniAppAdapter for database operations */ export declare class MiniAppAdapter implements ModuleAdapterInterface { protected databaseAdapter: D; /** * Constructor */ constructor(databaseAdapter: D); /**` * Initialize database tables */ init(): void; /** * Get the database adapter */ getDatabase(): D; /** * Get database adapter with type */ getDatabaseAdapter(): DatabaseAdapter; /** * Get a miniapp by agentId */ getMiniApp(agentId: string): Promise; /** * Get a miniapp with account details */ getMiniAppWithAccount(agentId: string): Promise; /** * Publish an agent */ publishAgent(agentId: string): Promise; /** * Unpublish an agent */ unpublishAgent(agentId: string): Promise; /** * Remove an agent from public listing */ removeMiniApp(agentId: string): Promise; /** * Get all published agents with account details */ getPublishedMiniApps(params: { page: number; limit: number; search: string; }): Promise<{ agents: MiniAppWithAccount[]; total: number; }>; updateAccount(account: Ac): Promise; } //# sourceMappingURL=MiniAppAdapter.d.ts.map