import type { BentoClient } from '../client'; import type { Subscriber } from '../subscribers/types'; import type { AddFieldParameters, AddTagParameters, ChangeEmailParameters, RemoveFieldParameters, RemoveTagParameters, SubscribeParameters, UnsubscribeParameters } from './types'; export declare class BentoCommands { private readonly _client; private readonly _url; constructor(_client: BentoClient); /** * **This does not trigger automations!** - If you wish to trigger automations, please use the * core module's `tagSubscriber` method. * * Adds a tag to the subscriber with the matching email. * * Note that both the tag and the subscriber will be created if either is missing * from system. * * * @param parameters \{ email: string, tagName: string \} * @returns Promise\ */ addTag(parameters: AddTagParameters): Promise | null>; /** * Removes the specified tag from the subscriber with the matching email. * * @param parameters \{ email: string, tagName: string \} * @returns Promise\ */ removeTag(parameters: RemoveTagParameters): Promise | null>; /** * **This does not trigger automations!** - If you wish to trigger automations, please use the * core module's `updateFields` method. * * Adds a field to the subscriber with the matching email. * * Note that both the field and the subscriber will be created if either is missing * from system. * * @param parameters \{ email: string, field: \{ key: string; value: string; \} \} * @returns Promise\ */ addField(parameters: AddFieldParameters): Promise | null>; /** * Removes a field to the subscriber with the matching email. * * @param parameters \{ email: string, fieldName: string \} * @returns Promise\ */ removeField(parameters: RemoveFieldParameters): Promise | null>; /** * **This does not trigger automations!** - If you wish to trigger automations, please use the * core module's `addSubscriber` method. * * Subscribes the supplied email to Bento. If the email does not exist, it is created. * If the subscriber had previously unsubscribed, they will be re-subscribed. * * @param parameters \{ email: string \} * @returns Promise\ */ subscribe(parameters: SubscribeParameters): Promise | null>; /** * **This does not trigger automations!** - If you wish to trigger automations, please use the * core module's `removeSubscriber` method. * * Unsubscribes the supplied email to Bento. If the email does not exist, it is created and * immediately unsubscribed. If they had already unsubscribed, the `unsubscribed_at` property * is updated. * * @param parameters \{ email: string \} * @returns Promise\ */ unsubscribe(parameters: UnsubscribeParameters): Promise | null>; /** * Updates the email of a user in Bento. * * @param parameters \{ oldEmail: string, newEmail: string \} * @returns Promise\ */ changeEmail(parameters: ChangeEmailParameters): Promise | null>; }