import type { RelayFileClient } from "./client.js"; import type { ConnectionProvider } from "./connection.js"; import type { FileSemantics } from "./types.js"; export interface AdapterWebhookMetadata { deliveryId?: string; delivery_id?: string; timestamp?: string; [key: string]: unknown; } export interface AdapterWebhook { provider: string; connectionId?: string; eventType: string; objectType: string; objectId: string; payload: Record; metadata?: AdapterWebhookMetadata; raw?: unknown; } export interface IngestError { path: string; error: string; } export interface IngestResult { filesWritten: number; filesUpdated: number; filesDeleted: number; paths: string[]; errors: IngestError[]; } export interface SyncOptions { cursor?: string; limit?: number; signal?: AbortSignal; [key: string]: unknown; } export interface SyncResult { filesWritten: number; filesUpdated: number; filesDeleted: number; paths?: string[]; cursor?: string; nextCursor?: string | null; syncedObjectTypes?: string[]; errors: Array<{ path?: string; objectType?: string; error: string; }>; } export declare abstract class IntegrationAdapter { protected readonly client: RelayFileClient; protected readonly provider: ConnectionProvider; abstract readonly name: string; abstract readonly version: string; constructor(client: RelayFileClient, provider: ConnectionProvider); abstract ingestWebhook(workspaceId: string, event: AdapterWebhook): Promise; abstract computePath(objectType: string, objectId: string): string; abstract computeSemantics(objectType: string, objectId: string, payload: Record): FileSemantics; supportedEvents?(): string[]; writeBack?(workspaceId: string, path: string, content: string): Promise; sync?(workspaceId: string, options?: SyncOptions): Promise; }