UNPKG

friday-sdk

Version:

Official JavaScript/TypeScript SDK for the Friday API

121 lines (97 loc) 2.28 kB
export interface SDKOptions { apiKey: string; baseUrl?: string; } export interface ApiResponse<T = any> { success: boolean; data?: T; error?: string; } export type OutputFormat = "html" | "markdown" | "links" | "text"; export interface GetProfileOptions { profileUrl: string; realtime?: boolean; prompt?: string; customSchema?: string; } export interface AnalyzeCompanyOptions { linkedinUrl: string; realtime?: boolean; } export interface ScrapeOptions { formats?: OutputFormat[]; } export interface CrawlOptions { formats?: OutputFormat[]; maxPages?: number; } export interface ExtractOptions { customSchema?: Record<string, any> | Array<Record<string, any>>; } export interface SearchOptions { location?: string; numResults?: number; } export interface RedditSearchOptions { sort?: "top" | "hot" | "new" | "relevance"; timeFilter?: "hour" | "day" | "week" | "month" | "year" | "all"; limit?: number; } export interface RedditSubredditSearchOptions extends RedditSearchOptions { subreddit: string; query: string; } export interface RedditUserPostsOptions { username: string; limit?: number; } export interface TwitterProfileOptions { profileUrl: string; tweetCount?: number; } export interface XLatestOptions { handle: string; limit?: number; refresh?: string; } export interface XSearchOptions { q?: string; query?: string; limit?: number; refresh?: string; } export interface XNewsOptions { limit?: number; aiOnly?: string; withTweets?: string; tabs?: string; refresh?: string; } export interface XAboutOptions { handle: string; refresh?: string; } export interface XWhoamiOptions { refresh?: string; } export interface LinkedInProfilePostsOptions { profileUrl: string; } export interface LinkedInCompanyPostsOptions { companyUrl: string; } export interface CreateApiKeyOptions { client: string; rateLimit: number; keyType: "free_trial" | "basic" | "pro" | "growth"; description?: string; } export interface UserAuthOptions { jwtToken: string; } export interface CreateUserApiKeyOptions extends UserAuthOptions { keyType: "free_trial" | "basic" | "pro" | "growth"; } export interface RegenerateUserApiKeyOptions extends UserAuthOptions { oldKey: string; }