UNPKG

apptise-core

Version:

Core library for Apptise unified notification system

77 lines 2.49 kB
import { NotificationPlugin } from '../base/plugin.js'; import type { NotificationMessage, NotificationResult, PluginConfig, PluginRegistration } from '../base/types.js'; /** * PushBullet notification plugin * * Supports the following URL formats (templates): * - {schema}://{accesstoken} * - {schema}://{accesstoken}/{targets} * * Where schema is 'pbul' * Targets can be devices, channels (#channel), or email addresses * * @example * ```typescript * const plugin = new PushBulletPlugin(); * const config = plugin.parseUrl('pbul://your-access-token'); * const result = await plugin.send(config, { * title: 'Test Title', * body: 'Test message content' * }); * ``` */ export declare class PushBulletPlugin extends NotificationPlugin { readonly registration: PluginRegistration; private readonly serviceConfig; private readonly templates; private readonly templateTokens; private readonly templateArgs; /** * Parse PushBullet URL and extract configuration * * @param url - PushBullet notification URL * @returns Parsed plugin configuration */ parseUrl(url: string): PluginConfig; /** * Send notification via PushBullet API * * @param config - Plugin configuration * @param message - Notification message * @returns Notification result */ send(config: PluginConfig, message: NotificationMessage): Promise<NotificationResult>; /** * Send notification to a specific target * * @param accesstoken - PushBullet access token * @param target - Target recipient (device, channel, email, or ALL_DEVICES) * @param message - Notification message * @returns Send result */ private sendToTarget; /** * Check if a string is a valid email address * * @param str - String to check * @returns True if string is an email address */ private isEmail; /** * Validate PushBullet plugin configuration * * @param config - Plugin configuration to validate * @returns True if configuration is valid */ validateConfig(config: PluginConfig): boolean; /** * Validate notification message * * @param message - Notification message to validate * @returns True if message is valid */ validateMessage(message: NotificationMessage): boolean; } export declare const pushBulletPlugin: PushBulletPlugin; export default pushBulletPlugin; //# sourceMappingURL=pushbullet.d.ts.map