import { type ClientOptions } from './http'; import { Contacts } from './resources/audience/contacts'; import { ContactTags } from './resources/audience/contact-tags'; import { ContactNotes } from './resources/audience/contact-notes'; import { CannedReplies } from './resources/audience/canned-replies'; import { CustomFields } from './resources/audience/custom-fields'; import { Segments } from './resources/audience/segments'; import { CrmTriggers } from './resources/audience/crm-triggers'; import { Imports } from './resources/audience/import-history'; import { Exports } from './resources/audience/export-history'; import { Webhooks } from './resources/audience/webhooks'; import { ScheduledMessages } from './resources/audience/scheduled-messages'; import { InboxMedia } from './resources/audience/inbox-media'; import { Notifications } from './resources/audience/notifications'; import { DataStoreCollections, DataStoreRecords, DataStores } from './resources/data-stores'; import { Channels } from './resources/channels/channels'; import { ChannelOnboarding } from './resources/channels/onboarding'; import { Templates } from './resources/channels/templates'; import { ChannelWebhooks } from './resources/channels/webhooks'; import { Billing } from './resources/channels/billing'; import { Wallet } from './resources/channels/wallet'; import { Activity } from './resources/channels/activity'; import { Campaigns } from './resources/campaigns'; import { CampaignMessages } from './resources/campaign-messages'; /** * One client for the whole gateway. Construct it once and share it: it holds no * per-request state, and every resource below runs over the same HTTP client, * so options such as the token resolver and the timeout apply everywhere. * * ```ts * const crm = new CrmClient({ gatewayUrl, clientId, authToken }); * * const contacts = await crm.contacts.list({ search: 'acme' }); * const channels = await crm.channels.list({ type: 'whatsapp' }); * ``` */ export declare class CrmClient { /** Contacts: the people an account talks to. */ readonly contacts: Contacts; /** Contact tags: the labels a contact can carry. */ readonly contactTags: ContactTags; /** Internal notes on a contact. Addressed under their contact. */ readonly contactNotes: ContactNotes; /** Custom fields: the per-account contact schema. */ readonly customFields: CustomFields; /** * Canned replies: stored message payloads an agent sends without retyping * them. A `CANNED` reply fires its messages as stored; a `QUICK` one lands in * the composer to edit first. * * Addressed by id or by name -- names are unique per account, and the name is * what an agent types after `/` to pick one. */ readonly cannedReplies: CannedReplies; /** Segments: saved contact filters. */ readonly segments: Segments; /** CRM triggers: fire a webhook when a contact changes, plus their delivery logs. */ readonly crmTriggers: CrmTriggers; /** Import history: bulk loads of contacts, and their progress. */ readonly imports: Imports; /** Export history: bulk extracts, and their progress. */ readonly exports: Exports; /** Audience webhooks: subscriptions to contact events. */ readonly webhooks: Webhooks; /** * Scheduled messages: a send with a time, and a condition checked just before * it goes out -- which is what lets a drip stop itself when a lead converts. */ readonly scheduledMessages: ScheduledMessages; /** * Chat media: presigned uploads straight to object storage. * * The only part of the inbox that is HTTP rather than socket, because an * upload is a request with an answer. `upload()` returns the permanent link to * pass to `inbox.messages.sendMedia()`. */ readonly inboxMedia: InboxMedia; /** * Push notification subscriptions: the browsers and apps a user wants * notified. `subscribe()` after the browser hands you a Firebase registration * token, `unsubscribe()` on logout. */ readonly notifications: Notifications; /** * Data stores: a MongoDB you own, registered with the platform. * * The platform holds the credential -- encrypted -- and the schemas you * declare over it. It holds none of your data: every record call is a live * round trip to your own cluster. Deleting a store or a collection forgets * our side of it and leaves your database untouched. */ readonly dataStores: DataStores; /** The collections declared over a data store: a name, and the fields in it. */ readonly dataStoreCollections: DataStoreCollections; /** The records inside one -- documents in your database, read and written live. */ readonly dataStoreRecords: DataStoreRecords; /** Channels, and the provider properties that hang off them. */ readonly channels: Channels; /** * Connecting a new channel. Separate from `channels` because it is the one * channel operation that walks a person through a dialog on Meta's own site. */ readonly channelOnboarding: ChannelOnboarding; /** WhatsApp message templates, per channel. */ readonly templates: Templates; /** Channel webhooks: where a channel's message traffic is delivered. */ readonly channelWebhooks: ChannelWebhooks; /** Conversation billing: what each conversation cost. */ readonly billing: Billing; /** Channel wallet ledger. */ readonly wallet: Wallet; /** Channel activity feed. */ readonly activity: Activity; /** * Campaigns: a message sent to many people at once. * * `createBulk()` is the one to reach for when you hold the recipients * yourself -- numbers or a CSV. It encrypts the list, uploads it, and creates * the campaign pointing at the file, which is otherwise several steps a caller * has to get exactly right. */ readonly campaigns: Campaigns; /** * Campaign reporting: the funnel, the per-recipient rows behind it, and what * people replied -- all counted off the message rows when asked for, so there * is no roll-up to wait for and no export job to poll. */ readonly campaignMessages: CampaignMessages; constructor(options: ClientOptions); }