import { BentoBatch, BentoCommands, BentoEmailTemplates, BentoExperimental, BentoFields, BentoForms, BentoSequences, BentoSubscribers, BentoTags, BentoWorkflows } from '../../sdk'; import type { AnalyticsOptions } from '../../sdk/interfaces'; import type { AddSubscriberParameters, RemoveSubscriberParameters, TagSubscriberParameters, TrackParameters, TrackPurchaseParameters, UpdateFieldsParameters } from './types'; import { BentoBroadcasts } from '../../sdk/broadcasts'; import { BentoStats } from '../../sdk/stats'; import type { Subscriber } from '../../sdk/subscribers/types'; export declare class BentoAPIV1 { private readonly _client; readonly Broadcasts: BentoBroadcasts; readonly EmailTemplates: BentoEmailTemplates; readonly Stats: BentoStats; readonly Batch: BentoBatch; readonly Commands: BentoCommands; readonly Experimental: BentoExperimental; readonly Fields: BentoFields; readonly Forms: BentoForms; readonly Sequences: BentoSequences; readonly Subscribers: BentoSubscribers; readonly Tags: BentoTags; readonly Workflows: BentoWorkflows; constructor(options: AnalyticsOptions); /** * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the * `Commands.addTag` method. * * Tags a subscriber with the specified email and tag. If either the tag or the user * do not exist, they will be created in the system. If the user already has the tag, * another tag event will be sent, triggering any automations that take place upon a * tag being added to a subscriber. Please be aware of the potential consequences. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters TagSubscriberParameters * @returns Promise\ */ tagSubscriber(parameters: TagSubscriberParameters): Promise; /** * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the * `Commands.subscribe` method. * * Creates a subscriber in the system. If the subscriber already exists, another subscribe event * will be sent, triggering any automations that take place upon subscription. Please be aware * of the potential consequences. * * You may optionally pass any fields that you wish to be set on the subscriber during creation * as well as a `Date` which will backdate the event. If no date is supplied, then the event will * default to the current time. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters AddSubscriberParameters * @returns Promise\ */ addSubscriber(parameters: AddSubscriberParameters): Promise; /** * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the * `Commands.unsubscribe` method. * * Unsubscribes an email in the system. If the email is already unsubscribed, another unsubscribe event * will be sent, triggering any automations that take place upon an unsubscribe happening. Please be aware * of the potential consequences. * * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event * will default to the current time. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters RemoveSubscriberParameters * @returns Promise\ */ removeSubscriber(parameters: RemoveSubscriberParameters): Promise; /** * **This TRIGGERS automations!** - If you do not wish to trigger automations, please use the * `Commands.addField` method. * * Sets the passed-in custom fields on the subscriber, creating the subscriber if it does not exist. * If the fields are already set on the subscriber, the event will be sent, triggering any automations * that take place upon fields being updated. Please be aware of the potential consequences. * * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event * will default to the current time. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters UpdateFieldsParameters\ * @returns Promise\ */ updateFields(parameters: UpdateFieldsParameters): Promise; /** * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering * automations. * * Tracks a purchase in Bento, used to calculate LTV for your subscribers. The values that are received * should be numbers, in cents. For example, `$1.00` should be `100`. * * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event * will default to the current time. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters TrackPurchaseParameters * @returns Promise\ */ trackPurchase(parameters: TrackPurchaseParameters): Promise; /** * **This TRIGGERS automations!** - There is no way to achieve this same behavior without triggering * automations. * * Tracks a custom event in Bento. * * You may optionally pass a `Date` which will backdate the event. If no date is supplied, then the event * will default to the current time. * * Because this method uses the batch API, the tag may take between 1 and 3 minutes * to appear in the system. * * Returns `true` if the event was successfully dispatched. Returns `false` otherwise. * * @param parameters TrackParameters * @returns Promise\ */ track(parameters: TrackParameters): Promise; /** * Upserts a subscriber in Bento. If the subscriber exists, their data will be updated. * If they don't exist, they will be created with the provided data. * * This method still relies on the batch import queue (which can take 1-5 minutes to * finish processing), but it automatically attempts to fetch and return the subscriber * record after the import has been queued. * * @example * ```typescript * const subscriber = await analytics.V1.upsertSubscriber({ * email: 'user@example.com', * fields: { * firstName: 'John', * lastName: 'Doe' * }, * tags: 'lead,mql', * remove_tags: 'customer' * }); * ``` * * @param parameters Object containing subscriber data including email, fields, and tags * @returns Promise | null> The created or updated subscriber */ upsertSubscriber(parameters: Omit, 'date'> & { tags?: string; remove_tags?: string; }): Promise | null>; }