@trycourier/courier-js
Version:
A browser-safe API wrapper
47 lines (46 loc) • 1.99 kB
TypeScript
import { CourierUserPreferences, CourierUserPreferencesChannel, CourierUserPreferencesStatus, CourierUserPreferencesTopic } from '../types/preference';
import { Client } from './client';
export declare class PreferenceClient extends Client {
private transformer;
/**
* Get all preferences for a user
* @param paginationCursor - Optional cursor for pagination
* @returns Promise resolving to user preferences
* @see https://www.courier.com/docs/reference/user-preferences/list-all-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
* @see https://www.courier.com/docs/reference/user-preferences/get-subscription-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
* @see https://www.courier.com/docs/reference/user-preferences/update-subscription-topic-preferences
*/
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;
}