/** * This file defines default types provided by the platform. * DO NOT EDIT THIS FILE. You can define your own types in `shared/types.ts` file. */ export interface ApiResponse { success: boolean; data?: T; error?: string; } /** * Response from a Nango action or sync trigger */ export interface NangoActionResponse { success: boolean; data?: T; error?: string; /** True if error is due to missing integration connection (user hasn't connected yet) */ isConnectionError?: boolean; /** True if error is due to insufficient permissions/scopes (401/403 from external API) */ isPermissionError?: boolean; /** HTTP status code from the external API (if available) */ statusCode?: number; } /** * Nango proxy request options - used for direct API calls through Nango */ export interface NangoProxyOptions { method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; endpoint: string; providerConfigKey: string; data?: Record; headers?: Record; params?: Record; retries?: number; } /** * Metadata for a stored file */ export interface FileMetadata { id: string; key: string; name: string; size: number; contentType: string; uploadedAt: number; uploadedBy?: string; customMetadata?: Record; } /** * Options for uploading a file */ export interface UploadOptions { key?: string; name?: string; contentType?: string; uploadedBy?: string; customMetadata?: Record; } /** * Options for downloading a file */ export interface DownloadOptions { range?: { offset?: number; length?: number; }; } /** * Options for listing files */ export interface ListFilesOptions { prefix?: string; limit?: number; cursor?: string; delimiter?: string; } /** * Result of listing files */ export interface ListFilesResult { files: FileMetadata[]; cursor?: string; truncated: boolean; } /** * Request for generating a presigned URL */ export interface PresignedUrlRequest { appId: string; key: string; action: 'read' | 'write'; contentType?: string; expiresIn?: number; } /** * Response containing a presigned URL */ export interface PresignedUrlResponse { url: string; expiresAt: number; }