UNPKG

@point-api/js-sdk

Version:

Javascript SDK for Point API

61 lines (60 loc) 1.57 kB
import { PointApi } from "../main"; export declare type SearchType = "standard" | "keyword" | "hybrid"; export interface Account { emailAddress: string; name: string; preferences: Preferences; subscription: Subscription; } export interface WebsitePreferences { urls: string[]; displayName: string; dropdownEnabled: boolean; usesReact: boolean; supportsRichText: boolean; supportsAutoInsert: boolean; inIframe: boolean; copyPasteNotificationEnabled: boolean; } export interface Preferences { searchType: SearchType; tabCompletion: boolean; websites: WebsitePreferences[]; snippetMenuEverywhere: boolean; } export declare type Preference = { field: 'search_type'; value: 'standard' | 'keyword' | 'hybrid'; } | { field: 'tab_completion'; value: boolean; } | { field: 'gmail_dropdown'; value: boolean; } | { field: 'facebook_dropdown'; value: boolean; } | { field: 'zendesk_dropdown'; value: boolean; } | { field: 'menu_everywhere'; value: boolean; }; export interface Subscription { dailyLimit: number | null; dailyUsage: number; expirationDate: number | null; membershipType: string; willRenew: boolean; } /** Class to manage user's Account */ export default class AccountApiModule { private readonly api; private readonly url; constructor(api: PointApi); get(): Promise<Account>; setPreference(preference: Preference): Promise<Response>; /** Make authenticated request to interactions api */ private authFetch; }