/** * Astrid OAuth API Client * * Client for accessing Astrid tasks via OAuth 2.0 Client Credentials flow */ import type { AstridTask, AstridList } from '../types/index.js'; interface APIResponse { success: boolean; data?: T; error?: string; } interface Comment { id: string; content: string; createdAt: string; authorId: string; authorEmail?: string; } interface CreateTaskData { title: string; description?: string; priority?: number; listId?: string; dueDateTime?: string; } interface UpdateTaskData { title?: string; description?: string; priority?: number; isCompleted?: boolean; dueDateTime?: string; assigneeId?: string | null; } export interface AstridOAuthConfig { baseUrl?: string; clientId?: string; clientSecret?: string; } export declare class AstridOAuthClient { private readonly baseUrl; private readonly clientId; private readonly clientSecret; private accessToken; private tokenExpiry; constructor(config?: AstridOAuthConfig); /** * Check if the client is properly configured */ isConfigured(): boolean; /** * Obtain an access token using client credentials flow */ private obtainAccessToken; /** * Make an authenticated API request */ private makeRequest; /** * Get all lists accessible to the authenticated user */ getLists(): Promise>; /** * Get a specific list by ID */ getList(listId: string): Promise>; /** * Get all tasks, optionally filtered by list */ getTasks(listId?: string, includeCompleted?: boolean): Promise>; /** * Get a specific task by ID with comments */ getTask(taskId: string): Promise>; /** * Get comments for a task */ getComments(taskId: string): Promise>; /** * Create a new task */ createTask(taskData: CreateTaskData): Promise>; /** * Update an existing task */ updateTask(taskId: string, updates: UpdateTaskData): Promise>; /** * Mark a task as complete */ completeTask(taskId: string): Promise>; /** * Reassign a task to a different user * @param taskId - The task ID * @param assigneeId - The user ID to assign to, or null to unassign */ reassignTask(taskId: string, assigneeId: string | null): Promise>; /** * Add a comment to a task * @param taskId - The task ID to add the comment to * @param content - The comment content * @param aiAgentId - Optional AI agent user ID to post the comment as */ addComment(taskId: string, content: string, aiAgentId?: string): Promise>; /** * Get AI agent user ID by email * Used to post comments as the AI agent instead of the OAuth client owner */ getAgentIdByEmail(email: string): Promise; /** * Test the connection to the API */ testConnection(): Promise; } export type { APIResponse, Comment, CreateTaskData, UpdateTaskData }; //# sourceMappingURL=astrid-oauth.d.ts.map