apptise-core
Version:
Core library for Apptise unified notification system
59 lines • 2.04 kB
TypeScript
import { NotificationPlugin } from '../base/plugin.js';
import type { NotificationMessage, NotificationResult, PluginConfig, PluginRegistration } from '../base/types.js';
/**
* Nextcloud Talk notification plugin
*
* Supports the following URL formats (templates):
* - {schema}://{user}:{password}@{host}/{targets}
* - {schema}://{user}:{password}@{host}:{port}/{targets}
*
* Where schema can be 'nctalk' (insecure) or 'nctalks' (secure)
*
* @example
* ```typescript
* const plugin = new NextcloudTalkPlugin();
* const config = plugin.parseUrl('nctalk://user:pass@localhost/roomid');
* const result = await plugin.send(config, {
* title: 'Test Title',
* body: 'Test message content'
* });
* ```
*/
export declare class NextcloudTalkPlugin extends NotificationPlugin {
readonly registration: PluginRegistration;
private readonly serviceConfig;
private readonly templates;
private readonly templateTokens;
private readonly templateArgs;
/**
* Parse Nextcloud Talk URL and extract configuration
*
* @param url - Nextcloud Talk URL to parse
* @returns Parsed plugin configuration
*/
parseUrl(url: string): PluginConfig;
/**
* Send notification to Nextcloud Talk
*
* @param config - Plugin configuration
* @param message - Notification message to send
* @returns Notification result
*/
send(config: PluginConfig, message: NotificationMessage): Promise<NotificationResult>;
/**
* Validate Nextcloud Talk 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 nextcloudTalkPlugin: NextcloudTalkPlugin;
//# sourceMappingURL=nextcloudtalk.d.ts.map