@trycourier/courier-js
Version:
A browser-safe API wrapper
47 lines (46 loc) • 1.83 kB
TypeScript
import { CourierUserPreferences, CourierUserPreferencesChannel, CourierUserPreferencesStatus, CourierUserPreferencesTopic } from '../types/preference';
import { Client } from './client';
export declare class PreferenceClient extends Client {
/**
* Get all preferences for a user
* @param paginationCursor - Optional cursor for pagination (not used in GraphQL implementation)
* @returns Promise resolving to user preferences
*/
getUserPreferences(props?: {
paginationCursor?: string;
}): Promise<CourierUserPreferences>;
/**
* Get preferences for a specific topic
* @param topicId - The ID of the topic to get preferences for
* @returns Promise resolving to topic preferences
*/
getUserPreferenceTopic(props: {
topicId: string;
}): Promise<CourierUserPreferencesTopic>;
/**
* Update preferences for a specific topic
* @param topicId - The ID of the topic to update preferences for
* @param status - The new status for the topic
* @param hasCustomRouting - Whether the topic has custom routing
* @param customRouting - The custom routing channels for the topic
* @returns Promise resolving when update is complete
*/
putUserPreferenceTopic(props: {
topicId: string;
status: CourierUserPreferencesStatus;
hasCustomRouting: boolean;
customRouting: CourierUserPreferencesChannel[];
}): Promise<void>;
/**
* Get the notification center URL
* @param clientKey - The client key to use for the URL
* @returns The notification center URL
*/
getNotificationCenterUrl(props: {
clientKey: string;
}): string;
/**
* Transform a GraphQL RecipientPreference node to CourierUserPreferencesTopic
*/
private transformToTopic;
}