import { Client } from '../client'; import type { Models } from '../models'; import { SmtpEncryption } from '../enums/smtp-encryption'; export declare class Messaging { client: Client; constructor(client: Client); /** * List messages * * Get a list of all messages from the current Appwrite project. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listMessages(queries?: string[], search?: string): Promise; /** * Create email * * Create a new email message. * * @param {string} messageId * @param {string} subject * @param {string} content * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {string[]} cc * @param {string[]} bcc * @param {string[]} attachments * @param {boolean} draft * @param {boolean} html * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise; /** * Update email * * Update an email message by its unique ID. * * @param {string} messageId * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {string} subject * @param {string} content * @param {boolean} draft * @param {boolean} html * @param {string[]} cc * @param {string[]} bcc * @param {string} scheduledAt * @param {string[]} attachments * @throws {AppwriteException} * @returns {Promise} */ updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise; /** * Create push notification * * Create a new push notification. * * @param {string} messageId * @param {string} title * @param {string} body * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {object} data * @param {string} action * @param {string} image * @param {string} icon * @param {string} sound * @param {string} color * @param {string} tag * @param {string} badge * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise; /** * Update push notification * * Update a push notification by its unique ID. * * @param {string} messageId * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {string} title * @param {string} body * @param {object} data * @param {string} action * @param {string} image * @param {string} icon * @param {string} sound * @param {string} color * @param {string} tag * @param {number} badge * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise; /** * Create SMS * * Create a new SMS message. * * @param {string} messageId * @param {string} content * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise; /** * Update SMS * * Update an email message by its unique ID. * * @param {string} messageId * @param {string[]} topics * @param {string[]} users * @param {string[]} targets * @param {string} content * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise; /** * Get message * * Get a message by its unique ID. * * @param {string} messageId * @throws {AppwriteException} * @returns {Promise} */ getMessage(messageId: string): Promise; /** * Delete message * * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. * * @param {string} messageId * @throws {AppwriteException} * @returns {Promise<{}>} */ delete(messageId: string): Promise<{}>; /** * List message logs * * Get the message activity logs listed by its unique ID. * * @param {string} messageId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listMessageLogs(messageId: string, queries?: string[]): Promise; /** * List message targets * * Get a list of the targets associated with a message. * * @param {string} messageId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listTargets(messageId: string, queries?: string[]): Promise; /** * List providers * * Get a list of all providers from the current Appwrite project. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listProviders(queries?: string[], search?: string): Promise; /** * Create APNS provider * * Create a new Apple Push Notification service provider. * * @param {string} providerId * @param {string} name * @param {string} authKey * @param {string} authKeyId * @param {string} teamId * @param {string} bundleId * @param {boolean} sandbox * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise; /** * Update APNS provider * * Update a Apple Push Notification service provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} authKey * @param {string} authKeyId * @param {string} teamId * @param {string} bundleId * @param {boolean} sandbox * @throws {AppwriteException} * @returns {Promise} */ updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise; /** * Create FCM provider * * Create a new Firebase Cloud Messaging provider. * * @param {string} providerId * @param {string} name * @param {object} serviceAccountJSON * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise; /** * Update FCM provider * * Update a Firebase Cloud Messaging provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {object} serviceAccountJSON * @throws {AppwriteException} * @returns {Promise} */ updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise; /** * Create Mailgun provider * * Create a new Mailgun provider. * * @param {string} providerId * @param {string} name * @param {string} apiKey * @param {string} domain * @param {boolean} isEuRegion * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; /** * Update Mailgun provider * * Update a Mailgun provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {string} apiKey * @param {string} domain * @param {boolean} isEuRegion * @param {boolean} enabled * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @throws {AppwriteException} * @returns {Promise} */ updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise; /** * Create Msg91 provider * * Create a new MSG91 provider. * * @param {string} providerId * @param {string} name * @param {string} templateId * @param {string} senderId * @param {string} authKey * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createMsg91Provider(providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise; /** * Update Msg91 provider * * Update a MSG91 provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} templateId * @param {string} senderId * @param {string} authKey * @throws {AppwriteException} * @returns {Promise} */ updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string): Promise; /** * Create Sendgrid provider * * Create a new Sendgrid provider. * * @param {string} providerId * @param {string} name * @param {string} apiKey * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; /** * Update Sendgrid provider * * Update a Sendgrid provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} apiKey * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @throws {AppwriteException} * @returns {Promise} */ updateSendgridProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise; /** * Create SMTP provider * * Create a new SMTP provider. * * @param {string} providerId * @param {string} name * @param {string} host * @param {number} port * @param {string} username * @param {string} password * @param {SmtpEncryption} encryption * @param {boolean} autoTLS * @param {string} mailer * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; /** * Update SMTP provider * * Update a SMTP provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {string} host * @param {number} port * @param {string} username * @param {string} password * @param {SmtpEncryption} encryption * @param {boolean} autoTLS * @param {string} mailer * @param {string} fromName * @param {string} fromEmail * @param {string} replyToName * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; /** * Create Telesign provider * * Create a new Telesign provider. * * @param {string} providerId * @param {string} name * @param {string} from * @param {string} customerId * @param {string} apiKey * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise; /** * Update Telesign provider * * Update a Telesign provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} customerId * @param {string} apiKey * @param {string} from * @throws {AppwriteException} * @returns {Promise} */ updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise; /** * Create Textmagic provider * * Create a new Textmagic provider. * * @param {string} providerId * @param {string} name * @param {string} from * @param {string} username * @param {string} apiKey * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise; /** * Update Textmagic provider * * Update a Textmagic provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} username * @param {string} apiKey * @param {string} from * @throws {AppwriteException} * @returns {Promise} */ updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise; /** * Create Twilio provider * * Create a new Twilio provider. * * @param {string} providerId * @param {string} name * @param {string} from * @param {string} accountSid * @param {string} authToken * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise; /** * Update Twilio provider * * Update a Twilio provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} accountSid * @param {string} authToken * @param {string} from * @throws {AppwriteException} * @returns {Promise} */ updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise; /** * Create Vonage provider * * Create a new Vonage provider. * * @param {string} providerId * @param {string} name * @param {string} from * @param {string} apiKey * @param {string} apiSecret * @param {boolean} enabled * @throws {AppwriteException} * @returns {Promise} */ createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise; /** * Update Vonage provider * * Update a Vonage provider by its unique ID. * * @param {string} providerId * @param {string} name * @param {boolean} enabled * @param {string} apiKey * @param {string} apiSecret * @param {string} from * @throws {AppwriteException} * @returns {Promise} */ updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise; /** * Get provider * * Get a provider by its unique ID. * * @param {string} providerId * @throws {AppwriteException} * @returns {Promise} */ getProvider(providerId: string): Promise; /** * Delete provider * * Delete a provider by its unique ID. * * @param {string} providerId * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteProvider(providerId: string): Promise<{}>; /** * List provider logs * * Get the provider activity logs listed by its unique ID. * * @param {string} providerId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listProviderLogs(providerId: string, queries?: string[]): Promise; /** * List subscriber logs * * Get the subscriber activity logs listed by its unique ID. * * @param {string} subscriberId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listSubscriberLogs(subscriberId: string, queries?: string[]): Promise; /** * List topics * * Get a list of all topics from the current Appwrite project. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listTopics(queries?: string[], search?: string): Promise; /** * Create topic * * Create a new topic. * * @param {string} topicId * @param {string} name * @param {string[]} subscribe * @throws {AppwriteException} * @returns {Promise} */ createTopic(topicId: string, name: string, subscribe?: string[]): Promise; /** * Get topic * * Get a topic by its unique ID. * * @param {string} topicId * @throws {AppwriteException} * @returns {Promise} */ getTopic(topicId: string): Promise; /** * Update topic * * Update a topic by its unique ID. * * @param {string} topicId * @param {string} name * @param {string[]} subscribe * @throws {AppwriteException} * @returns {Promise} */ updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise; /** * Delete topic * * Delete a topic by its unique ID. * * @param {string} topicId * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteTopic(topicId: string): Promise<{}>; /** * List topic logs * * Get the topic activity logs listed by its unique ID. * * @param {string} topicId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listTopicLogs(topicId: string, queries?: string[]): Promise; /** * List subscribers * * Get a list of all subscribers from the current Appwrite project. * * @param {string} topicId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listSubscribers(topicId: string, queries?: string[], search?: string): Promise; /** * Create subscriber * * Create a new subscriber. * * @param {string} topicId * @param {string} subscriberId * @param {string} targetId * @throws {AppwriteException} * @returns {Promise} */ createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise; /** * Get subscriber * * Get a subscriber by its unique ID. * * @param {string} topicId * @param {string} subscriberId * @throws {AppwriteException} * @returns {Promise} */ getSubscriber(topicId: string, subscriberId: string): Promise; /** * Delete subscriber * * Delete a subscriber by its unique ID. * * @param {string} topicId * @param {string} subscriberId * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>; }