@adatechnology/meta-whatsapp-module 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -0
- package/dist/index.cjs +341 -162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -23
- package/dist/index.d.ts +79 -23
- package/dist/index.js +304 -127
- package/dist/index.js.map +1 -1
- package/dist/migrations-journal/0000_freezing_switch.sql +41 -0
- package/dist/migrations-journal/0001_military_leper_queen.sql +15 -0
- package/dist/migrations-journal/0002_illegal_black_tarantula.sql +5 -0
- package/dist/migrations-journal/0003_normal_viper.sql +10 -0
- package/dist/migrations-journal/0004_widen_message_type.sql +1 -0
- package/dist/migrations-journal/0005_message_moderation.sql +3 -0
- package/dist/migrations-journal/0006_conversation_documents.sql +19 -0
- package/dist/migrations-journal/0007_flow_media.sql +18 -0
- package/dist/migrations-journal/0008_message_transcription.sql +5 -0
- package/dist/migrations-journal/0009_settings_transcription_policy.sql +2 -0
- package/dist/migrations-journal/0010_flow_media_meta_ids.sql +10 -0
- package/dist/migrations-journal/meta/_journal.json +83 -0
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgAsyncDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
3
|
import * as _adatechnology_meta_whatsapp_contracts from '@adatechnology/meta-whatsapp-contracts';
|
|
4
|
-
import { TranscriptionMode, SessionState, SessionMode, ConversationSummary, MessageDirection, MessageSender, MessageStatus, WhatsAppStatusError, CacheInterface, FlowGraphData, FlowGraphSummary, LiveFlowPosition, WhatsAppSettings, RealtimeNotifierInterface, ChannelAdapterInterface, ObjectStorageInterface, FlowActionKind, FlowActionHandler, ConversationSession, WhatsAppMessage, WhatsAppStatus,
|
|
4
|
+
import { TranscriptionMode, SessionState, SessionMode, ConversationSummary, MessageDirection, MessageSender, MessageStatus, WhatsAppStatusError, CacheInterface, FlowGraphData, FlowGraphSummary, LiveFlowPosition, WhatsAppSettings, RealtimeNotifierInterface, ChannelAdapterInterface, ObjectStorageInterface, InteractiveMessage, MetaWhatsAppHooks, FlowActionKind, FlowActionHandler, ConversationSession, WhatsAppMessage, WhatsAppStatus, SubjectResolverInterface, CatalogPort, SendChannelMediaParams, ChannelInteractiveListParams, ChannelInteractiveButtonsParams } from '@adatechnology/meta-whatsapp-contracts';
|
|
5
5
|
export { PREVIEW_MEDIA_ID_PREFIX, TranscriptionMode, resolvePreviewUploadId, toPreviewMediaId } from '@adatechnology/meta-whatsapp-contracts';
|
|
6
6
|
import { WhatsAppMessageProvider } from '@adatechnology/meta-whatsapp-provider';
|
|
7
7
|
export { WEBHOOK_CLAIM_TTL_SECONDS, WEBHOOK_NONCE_TTL_SECONDS } from '@adatechnology/meta-graph-core';
|
|
@@ -1746,6 +1746,8 @@ declare class DocumentRepository {
|
|
|
1746
1746
|
deleteById(companyId: string, id: string): Promise<void>;
|
|
1747
1747
|
}
|
|
1748
1748
|
|
|
1749
|
+
/** Rótulo da lista quando o canal não sabe enviar botão e os botões viram lista. */
|
|
1750
|
+
declare const DEFAULT_FALLBACK_LIST_LABEL = "Op\u00E7\u00F5es";
|
|
1749
1751
|
type SendTextParams = {
|
|
1750
1752
|
companyId: string;
|
|
1751
1753
|
whatsappNumber: string;
|
|
@@ -1775,6 +1777,20 @@ type SendTemplateParams = {
|
|
|
1775
1777
|
agentUserId?: string;
|
|
1776
1778
|
startState: SessionState;
|
|
1777
1779
|
};
|
|
1780
|
+
type SendInteractiveParams = {
|
|
1781
|
+
companyId: string;
|
|
1782
|
+
whatsappNumber: string;
|
|
1783
|
+
/** Botões (até 3) ou lista (até 10 linhas em até 10 seções). Validado contra `WHATSAPP_CHOICE_LIMIT`. */
|
|
1784
|
+
interactive: InteractiveMessage;
|
|
1785
|
+
sender: 'bot' | 'agent';
|
|
1786
|
+
agentUserId?: string;
|
|
1787
|
+
startState: SessionState;
|
|
1788
|
+
/**
|
|
1789
|
+
* Rótulo da lista quando `interactive.kind === 'buttons'` e o canal não implementa
|
|
1790
|
+
* `sendInteractiveButtons` — os botões saem como lista. Padrão `DEFAULT_FALLBACK_LIST_LABEL`.
|
|
1791
|
+
*/
|
|
1792
|
+
fallbackListLabel?: string;
|
|
1793
|
+
};
|
|
1778
1794
|
declare class SendMessageUseCase {
|
|
1779
1795
|
private readonly channel;
|
|
1780
1796
|
private readonly sessionRepository;
|
|
@@ -1785,6 +1801,16 @@ declare class SendMessageUseCase {
|
|
|
1785
1801
|
private assertWithinWindow;
|
|
1786
1802
|
sendText(params: SendTextParams): Promise<MessageRow | undefined>;
|
|
1787
1803
|
sendMedia(params: SendMediaParams): Promise<MessageRow | undefined>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Botões ou lista, pelo mesmo caminho do `sendText`: janela, envio, transcript (idempotente pelo
|
|
1806
|
+
* `waMessageId`). Os limites da Meta são conferidos ANTES de tudo — mensagem fora do teto a Graph
|
|
1807
|
+
* API recusa inteira, e o erro local (`InteractiveLimitExceededError`) diz qual campo corrigir.
|
|
1808
|
+
*
|
|
1809
|
+
* O transcript guarda `type: 'interactive'`, o corpo em `content` e a mensagem inteira (ids e
|
|
1810
|
+
* títulos das opções) em `payload.interactive`, para o histórico mostrar o que foi oferecido.
|
|
1811
|
+
*/
|
|
1812
|
+
sendInteractive(params: SendInteractiveParams): Promise<MessageRow | undefined>;
|
|
1813
|
+
private sendInteractiveThroughChannel;
|
|
1788
1814
|
sendTemplate(params: SendTemplateParams): Promise<MessageRow | undefined>;
|
|
1789
1815
|
}
|
|
1790
1816
|
|
|
@@ -1792,25 +1818,53 @@ type TakeoverConversationParams = {
|
|
|
1792
1818
|
companyId: string;
|
|
1793
1819
|
whatsappNumber: string;
|
|
1794
1820
|
agentUserId: string;
|
|
1821
|
+
/**
|
|
1822
|
+
* Quem executou a ação, quando não é o próprio atendente (ex.: supervisor atribuindo a conversa a
|
|
1823
|
+
* outra pessoa). Omitido, o ator é `agentUserId`.
|
|
1824
|
+
*/
|
|
1825
|
+
actorId?: string;
|
|
1795
1826
|
};
|
|
1796
1827
|
declare class TakeoverConversationUseCase {
|
|
1797
1828
|
private readonly sessionRepository;
|
|
1798
1829
|
private readonly realtime?;
|
|
1799
|
-
|
|
1830
|
+
private readonly hooks?;
|
|
1831
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onConversationModeChanged"> | undefined);
|
|
1800
1832
|
execute(params: TakeoverConversationParams): Promise<void>;
|
|
1801
1833
|
}
|
|
1802
1834
|
|
|
1803
1835
|
type ReleaseConversationParams = {
|
|
1804
1836
|
companyId: string;
|
|
1805
1837
|
whatsappNumber: string;
|
|
1838
|
+
/** Quem devolveu a conversa ao bot. Omitido, `null` — o próprio sistema (ex.: job de inatividade). */
|
|
1839
|
+
actorId?: string | null;
|
|
1806
1840
|
};
|
|
1807
1841
|
declare class ReleaseConversationUseCase {
|
|
1808
1842
|
private readonly sessionRepository;
|
|
1809
1843
|
private readonly realtime?;
|
|
1810
|
-
|
|
1844
|
+
private readonly hooks?;
|
|
1845
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onConversationModeChanged"> | undefined);
|
|
1811
1846
|
execute(params: ReleaseConversationParams): Promise<void>;
|
|
1812
1847
|
}
|
|
1813
1848
|
|
|
1849
|
+
type RequestHumanConversationParams = {
|
|
1850
|
+
companyId: string;
|
|
1851
|
+
whatsappNumber: string;
|
|
1852
|
+
/** Quem pediu. Omitido, `null` — o cliente pelo menu ou o bot decidindo encaminhar. */
|
|
1853
|
+
actorId?: string | null;
|
|
1854
|
+
};
|
|
1855
|
+
/**
|
|
1856
|
+
* Coloca a conversa na fila "aguardando atendimento" (`humanRequestedAt`) sem tirá-la do bot: quem
|
|
1857
|
+
* assume é o `takeover`. Dispara `onHumanRequested` (o host decide como avisar a equipe) e
|
|
1858
|
+
* `onConversationModeChanged` com `kind: 'human-requested'` (trilha de auditoria).
|
|
1859
|
+
*/
|
|
1860
|
+
declare class RequestHumanConversationUseCase {
|
|
1861
|
+
private readonly sessionRepository;
|
|
1862
|
+
private readonly realtime?;
|
|
1863
|
+
private readonly hooks?;
|
|
1864
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onHumanRequested" | "onConversationModeChanged"> | undefined);
|
|
1865
|
+
execute(params: RequestHumanConversationParams): Promise<void>;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1814
1868
|
type ListConversationsParams = {
|
|
1815
1869
|
companyId: string;
|
|
1816
1870
|
filters?: ListConversationsFilters;
|
|
@@ -2239,6 +2293,8 @@ declare function confirmWebhookDelivery(params: {
|
|
|
2239
2293
|
* A segunda metade rodava dentro da requisição do webhook. Um deploy no meio de uma conversa
|
|
2240
2294
|
* matava a chamada em voo, e o cliente ficava sem resposta sem que nada registrasse a perda. Com
|
|
2241
2295
|
* uma fila no host, derrubar o processo vira atraso: o job espera e é retomado.
|
|
2296
|
+
*
|
|
2297
|
+
* Guia de implementação: `docs/webhook-durability.md`.
|
|
2242
2298
|
*/
|
|
2243
2299
|
|
|
2244
2300
|
type InboundMediaDescriptor = {
|
|
@@ -2313,7 +2369,8 @@ declare class InboundEffectsDispatcher {
|
|
|
2313
2369
|
*/
|
|
2314
2370
|
declare class ProcessInboundDispatchUseCase {
|
|
2315
2371
|
private readonly dispatcher;
|
|
2316
|
-
|
|
2372
|
+
private readonly hooks?;
|
|
2373
|
+
constructor(dispatcher: InboundEffectsDispatcher, hooks?: Pick<MetaWhatsAppHooks, "onInboundEffectRejected"> | undefined);
|
|
2317
2374
|
execute(job: InboundDispatchJob): Promise<void>;
|
|
2318
2375
|
}
|
|
2319
2376
|
|
|
@@ -2631,6 +2688,13 @@ interface MetaWhatsAppTranscriptionConfig {
|
|
|
2631
2688
|
languageHint?: string;
|
|
2632
2689
|
}
|
|
2633
2690
|
interface MetaWhatsAppModuleProviders {
|
|
2691
|
+
/**
|
|
2692
|
+
* Fila durável para os efeitos do webhook (hooks, realtime). Ausente, rodam dentro da requisição,
|
|
2693
|
+
* como sempre. Presente, o webhook só persiste e enfileira; o worker do host chama
|
|
2694
|
+
* `webhook.processInboundDispatch.execute(job)`. Ver docs/webhook-durability.md — qualquer fila
|
|
2695
|
+
* com durabilidade e retentativa serve, inclusive uma tabela no Postgres.
|
|
2696
|
+
*/
|
|
2697
|
+
inboundQueue?: InboundDispatchQueueInterface;
|
|
2634
2698
|
objectStorage?: ObjectStorageInterface;
|
|
2635
2699
|
cache?: CacheInterface;
|
|
2636
2700
|
realtime?: RealtimeNotifierInterface;
|
|
@@ -2660,6 +2724,7 @@ declare function createMetaWhatsAppModule(params: CreateMetaWhatsAppModuleParams
|
|
|
2660
2724
|
send: SendMessageUseCase;
|
|
2661
2725
|
takeover: TakeoverConversationUseCase;
|
|
2662
2726
|
release: ReleaseConversationUseCase;
|
|
2727
|
+
requestHuman: RequestHumanConversationUseCase;
|
|
2663
2728
|
list: ListConversationsUseCase;
|
|
2664
2729
|
listMessages: ListMessagesUseCase;
|
|
2665
2730
|
listDocuments: ListConversationDocumentsUseCase;
|
|
@@ -2696,6 +2761,7 @@ declare function createMetaWhatsAppModule(params: CreateMetaWhatsAppModuleParams
|
|
|
2696
2761
|
token: string | null;
|
|
2697
2762
|
challenge: string | null;
|
|
2698
2763
|
}) => string;
|
|
2764
|
+
processInboundDispatch: ProcessInboundDispatchUseCase;
|
|
2699
2765
|
};
|
|
2700
2766
|
flows: {
|
|
2701
2767
|
interpreter: FlowInterpreter;
|
|
@@ -2759,25 +2825,10 @@ declare class WhatsAppChannelAdapter implements ChannelAdapterInterface {
|
|
|
2759
2825
|
}): Promise<{
|
|
2760
2826
|
externalMessageId: string | null;
|
|
2761
2827
|
}>;
|
|
2762
|
-
sendInteractiveList(params: {
|
|
2763
|
-
to: string;
|
|
2764
|
-
body: string;
|
|
2765
|
-
buttonLabel: string;
|
|
2766
|
-
rows: {
|
|
2767
|
-
id: string;
|
|
2768
|
-
title: string;
|
|
2769
|
-
}[];
|
|
2770
|
-
}): Promise<{
|
|
2828
|
+
sendInteractiveList(params: ChannelInteractiveListParams): Promise<{
|
|
2771
2829
|
externalMessageId: string | null;
|
|
2772
2830
|
}>;
|
|
2773
|
-
sendInteractiveButtons(params: {
|
|
2774
|
-
to: string;
|
|
2775
|
-
body: string;
|
|
2776
|
-
buttons: {
|
|
2777
|
-
id: string;
|
|
2778
|
-
title: string;
|
|
2779
|
-
}[];
|
|
2780
|
-
}): Promise<{
|
|
2831
|
+
sendInteractiveButtons(params: ChannelInteractiveButtonsParams): Promise<{
|
|
2781
2832
|
externalMessageId: string | null;
|
|
2782
2833
|
}>;
|
|
2783
2834
|
sendProductList(params: {
|
|
@@ -2811,13 +2862,18 @@ declare class WhatsAppChannelAdapter implements ChannelAdapterInterface {
|
|
|
2811
2862
|
declare const INBOUND_LOCATION_CONTENT = "\uD83D\uDCCD Localiza\u00E7\u00E3o";
|
|
2812
2863
|
|
|
2813
2864
|
declare const META_WHATSAPP_MIGRATIONS_TABLE = "meta_whatsapp_migrations";
|
|
2814
|
-
|
|
2865
|
+
type MetaWhatsAppMigrationsLayout = 'v1' | 'journal';
|
|
2866
|
+
type MetaWhatsAppMigrationsFolderParams = {
|
|
2867
|
+
readonly layout?: MetaWhatsAppMigrationsLayout;
|
|
2868
|
+
};
|
|
2869
|
+
declare function metaWhatsAppMigrationsFolder(params?: MetaWhatsAppMigrationsFolderParams): string;
|
|
2815
2870
|
type RunMetaWhatsAppMigrationsParams = {
|
|
2816
2871
|
db: MetaWhatsAppDatabase;
|
|
2817
2872
|
migrate: (db: never, config: {
|
|
2818
2873
|
migrationsFolder: string;
|
|
2819
2874
|
migrationsTable?: string;
|
|
2820
2875
|
}) => Promise<void>;
|
|
2876
|
+
layout?: MetaWhatsAppMigrationsLayout;
|
|
2821
2877
|
};
|
|
2822
2878
|
declare function runMetaWhatsAppMigrations(params: RunMetaWhatsAppMigrationsParams): Promise<void>;
|
|
2823
2879
|
|
|
@@ -2975,4 +3031,4 @@ declare class FlowMediaIdRepository implements FlowMediaIdStore {
|
|
|
2975
3031
|
}): Promise<void>;
|
|
2976
3032
|
}
|
|
2977
3033
|
|
|
2978
|
-
export { type AttachFlowMediaParams, type AudioTranscriber, type CompanyDocumentView, type CompanyDocumentsPage, type ConversationDocumentView, type ConversationDocumentsPage, type CountInboundLocationsParams, type CountInboundLocationsResult, CountInboundLocationsUseCase, type CreateFlowGraphParams, CreateFlowGraphUseCase, type CreateMetaWhatsAppModuleParams, type CreateSendMediaActionParams, type CreateSendProductListActionParams, DEFAULT_FLOW_GRAPH_CACHE_TTL_SECONDS, type DeleteConversationParams, type DeleteConversationResult, DeleteConversationUseCase, DeleteFlowGraphUseCase, DocumentRepository, type DocumentRow, type DrizzleMigrateFunction, type ExportConversationParams, type ExportConversationResult, ExportConversationUseCase, FlowGraphCache, FlowGraphRepository, type FlowGraphRow, FlowInterpreter, type FlowMediaIdCache, FlowMediaIdRepository, type FlowMediaIdStore, type FlowMediaLocation, FlowMediaRepository, type FlowMediaRow, type FlowMediaTranscriptLogger, type FlowRunResult, type FlowStepInput, type FlowStepResult, GetFlowGraphUseCase, GetLiveFlowPositionsUseCase, INBOUND_LOCATION_CONTENT, type InboundDispatchJob, type InboundDispatchQueueInterface, InboundEffectsDispatcher, type InboundMediaDescriptor, type InboundMessageEffectsJob, type InboundStatusEffectsJob, type IngestInboundMediaParams, type IngestInboundMediaResult, IngestInboundMediaUseCase, type IngestTranscriptionOptions, type InsertMessageParams, InvalidFlowGraphError, type LinkDocumentParams, type ListCompanyDocumentsParams, ListCompanyDocumentsUseCase, type ListConversationDocumentsParams, ListConversationDocumentsUseCase, type ListConversationsFilters, type ListConversationsParams, ListConversationsUseCase, type ListDocumentsParams, type ListDocumentsResult, ListFlowGraphsUseCase, type ListMessagesParams, ListMessagesUseCase, type LogMessageParams, LogMessageUseCase, META_WHATSAPP_MIGRATIONS_TABLE, type MessageModerator, MessageRepository, type MessageRow, type MetaWhatsAppDatabase, type MetaWhatsAppModule, type MetaWhatsAppModuleConfig, type MetaWhatsAppModuleFeatures, type MetaWhatsAppModuleProviders, type MetaWhatsAppTranscriptionConfig, type NewDocumentRow, type NewFlowGraphRow, type NewFlowMediaRow, type NewMessageRow, type NewSessionRow, type NewSettingsRow, type NonceStoreInterface, OptimisticLockError, PRODUCT_LIST_LIMIT, type PreviewMediaSupport, ProcessInboundDispatchUseCase, type PurgeExpiredDocumentsParams, type PurgeExpiredDocumentsResult, PurgeExpiredDocumentsUseCase, type RealtimeRelay, type ReceiveWebhookParams, type ReceiveWebhookResult, ReceiveWebhookUseCase, type RedactInboundLocationsParams, type RedactInboundLocationsResult, RedactInboundLocationsUseCase, type ReleaseConversationParams, ReleaseConversationUseCase, type ListMessagesParams$1 as RepositoryListMessagesParams, type ResolveTranscriptionPolicyDependencies, type RunMetaWhatsAppMigrationsParams, type SaveFlowGraphParams, SaveFlowGraphUseCase, type SaveTranscriptionByWaMessageIdParams, type SaveTranscriptionParams, type SendMediaParams, SendMessageUseCase, type SendTemplateParams, type SendTextParams, SessionRepository, type SessionRow, SettingsRepository, type SettingsRow, SseHub, type SseListener, type StorePreviewMediaParams, type StorePreviewMediaResult, StorePreviewMediaUseCase, TRANSCRIPTION_MODE, TRANSCRIPTION_STATUS, type TakeoverConversationParams, TakeoverConversationUseCase, type TicketStoreInterface, type TranscribeAudioDependencies, type TranscribeAudioParams, type TranscribeAudioResult, TranscribeAudioUseCase, type TranscriptionPolicy, type TranscriptionPolicyDefaults, type TranscriptionPolicyResolver, type TranscriptionStatus, type UpdateFlowMediaParams, WhatsAppChannelAdapter, buildInboundJobId, claimWebhookDelivery, confirmWebhookDelivery, createMetaWhatsAppModule, createSendMediaAction, createSendProductListAction, createTranscriptionPolicyResolver, documents, extractMediaDescriptor, flowGraphs, flowMedia, isAudioMimeType, isRetriableTranscriptionError, isUnsupportedTranscriptionError, issueSseTicket, messages, metaWhatsAppMigrationsFolder, metaWhatsAppSchema, redeemSseTicket, resolveFailureStatus, runMetaWhatsAppMigrations, sessions, settings, toSessionContract, transcriptionRetryAfterSeconds, verifyWebhookChallenge, verifyWebhookSignature };
|
|
3034
|
+
export { type AttachFlowMediaParams, type AudioTranscriber, type CompanyDocumentView, type CompanyDocumentsPage, type ConversationDocumentView, type ConversationDocumentsPage, type CountInboundLocationsParams, type CountInboundLocationsResult, CountInboundLocationsUseCase, type CreateFlowGraphParams, CreateFlowGraphUseCase, type CreateMetaWhatsAppModuleParams, type CreateSendMediaActionParams, type CreateSendProductListActionParams, DEFAULT_FALLBACK_LIST_LABEL, DEFAULT_FLOW_GRAPH_CACHE_TTL_SECONDS, type DeleteConversationParams, type DeleteConversationResult, DeleteConversationUseCase, DeleteFlowGraphUseCase, DocumentRepository, type DocumentRow, type DrizzleMigrateFunction, type ExportConversationParams, type ExportConversationResult, ExportConversationUseCase, FlowGraphCache, FlowGraphRepository, type FlowGraphRow, FlowInterpreter, type FlowMediaIdCache, FlowMediaIdRepository, type FlowMediaIdStore, type FlowMediaLocation, FlowMediaRepository, type FlowMediaRow, type FlowMediaTranscriptLogger, type FlowRunResult, type FlowStepInput, type FlowStepResult, GetFlowGraphUseCase, GetLiveFlowPositionsUseCase, INBOUND_LOCATION_CONTENT, type InboundDispatchJob, type InboundDispatchQueueInterface, InboundEffectsDispatcher, type InboundMediaDescriptor, type InboundMessageEffectsJob, type InboundStatusEffectsJob, type IngestInboundMediaParams, type IngestInboundMediaResult, IngestInboundMediaUseCase, type IngestTranscriptionOptions, type InsertMessageParams, InvalidFlowGraphError, type LinkDocumentParams, type ListCompanyDocumentsParams, ListCompanyDocumentsUseCase, type ListConversationDocumentsParams, ListConversationDocumentsUseCase, type ListConversationsFilters, type ListConversationsParams, ListConversationsUseCase, type ListDocumentsParams, type ListDocumentsResult, ListFlowGraphsUseCase, type ListMessagesParams, ListMessagesUseCase, type LogMessageParams, LogMessageUseCase, META_WHATSAPP_MIGRATIONS_TABLE, type MessageModerator, MessageRepository, type MessageRow, type MetaWhatsAppDatabase, type MetaWhatsAppMigrationsFolderParams, type MetaWhatsAppMigrationsLayout, type MetaWhatsAppModule, type MetaWhatsAppModuleConfig, type MetaWhatsAppModuleFeatures, type MetaWhatsAppModuleProviders, type MetaWhatsAppTranscriptionConfig, type NewDocumentRow, type NewFlowGraphRow, type NewFlowMediaRow, type NewMessageRow, type NewSessionRow, type NewSettingsRow, type NonceStoreInterface, OptimisticLockError, PRODUCT_LIST_LIMIT, type PreviewMediaSupport, ProcessInboundDispatchUseCase, type PurgeExpiredDocumentsParams, type PurgeExpiredDocumentsResult, PurgeExpiredDocumentsUseCase, type RealtimeRelay, type ReceiveWebhookParams, type ReceiveWebhookResult, ReceiveWebhookUseCase, type RedactInboundLocationsParams, type RedactInboundLocationsResult, RedactInboundLocationsUseCase, type ReleaseConversationParams, ReleaseConversationUseCase, type ListMessagesParams$1 as RepositoryListMessagesParams, type RequestHumanConversationParams, RequestHumanConversationUseCase, type ResolveTranscriptionPolicyDependencies, type RunMetaWhatsAppMigrationsParams, type SaveFlowGraphParams, SaveFlowGraphUseCase, type SaveTranscriptionByWaMessageIdParams, type SaveTranscriptionParams, type SendInteractiveParams, type SendMediaParams, SendMessageUseCase, type SendTemplateParams, type SendTextParams, SessionRepository, type SessionRow, SettingsRepository, type SettingsRow, SseHub, type SseListener, type StorePreviewMediaParams, type StorePreviewMediaResult, StorePreviewMediaUseCase, TRANSCRIPTION_MODE, TRANSCRIPTION_STATUS, type TakeoverConversationParams, TakeoverConversationUseCase, type TicketStoreInterface, type TranscribeAudioDependencies, type TranscribeAudioParams, type TranscribeAudioResult, TranscribeAudioUseCase, type TranscriptionPolicy, type TranscriptionPolicyDefaults, type TranscriptionPolicyResolver, type TranscriptionStatus, type UpdateFlowMediaParams, WhatsAppChannelAdapter, buildInboundJobId, claimWebhookDelivery, confirmWebhookDelivery, createMetaWhatsAppModule, createSendMediaAction, createSendProductListAction, createTranscriptionPolicyResolver, documents, extractMediaDescriptor, flowGraphs, flowMedia, isAudioMimeType, isRetriableTranscriptionError, isUnsupportedTranscriptionError, issueSseTicket, messages, metaWhatsAppMigrationsFolder, metaWhatsAppSchema, redeemSseTicket, resolveFailureStatus, runMetaWhatsAppMigrations, sessions, settings, toSessionContract, transcriptionRetryAfterSeconds, verifyWebhookChallenge, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgAsyncDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
3
|
import * as _adatechnology_meta_whatsapp_contracts from '@adatechnology/meta-whatsapp-contracts';
|
|
4
|
-
import { TranscriptionMode, SessionState, SessionMode, ConversationSummary, MessageDirection, MessageSender, MessageStatus, WhatsAppStatusError, CacheInterface, FlowGraphData, FlowGraphSummary, LiveFlowPosition, WhatsAppSettings, RealtimeNotifierInterface, ChannelAdapterInterface, ObjectStorageInterface, FlowActionKind, FlowActionHandler, ConversationSession, WhatsAppMessage, WhatsAppStatus,
|
|
4
|
+
import { TranscriptionMode, SessionState, SessionMode, ConversationSummary, MessageDirection, MessageSender, MessageStatus, WhatsAppStatusError, CacheInterface, FlowGraphData, FlowGraphSummary, LiveFlowPosition, WhatsAppSettings, RealtimeNotifierInterface, ChannelAdapterInterface, ObjectStorageInterface, InteractiveMessage, MetaWhatsAppHooks, FlowActionKind, FlowActionHandler, ConversationSession, WhatsAppMessage, WhatsAppStatus, SubjectResolverInterface, CatalogPort, SendChannelMediaParams, ChannelInteractiveListParams, ChannelInteractiveButtonsParams } from '@adatechnology/meta-whatsapp-contracts';
|
|
5
5
|
export { PREVIEW_MEDIA_ID_PREFIX, TranscriptionMode, resolvePreviewUploadId, toPreviewMediaId } from '@adatechnology/meta-whatsapp-contracts';
|
|
6
6
|
import { WhatsAppMessageProvider } from '@adatechnology/meta-whatsapp-provider';
|
|
7
7
|
export { WEBHOOK_CLAIM_TTL_SECONDS, WEBHOOK_NONCE_TTL_SECONDS } from '@adatechnology/meta-graph-core';
|
|
@@ -1746,6 +1746,8 @@ declare class DocumentRepository {
|
|
|
1746
1746
|
deleteById(companyId: string, id: string): Promise<void>;
|
|
1747
1747
|
}
|
|
1748
1748
|
|
|
1749
|
+
/** Rótulo da lista quando o canal não sabe enviar botão e os botões viram lista. */
|
|
1750
|
+
declare const DEFAULT_FALLBACK_LIST_LABEL = "Op\u00E7\u00F5es";
|
|
1749
1751
|
type SendTextParams = {
|
|
1750
1752
|
companyId: string;
|
|
1751
1753
|
whatsappNumber: string;
|
|
@@ -1775,6 +1777,20 @@ type SendTemplateParams = {
|
|
|
1775
1777
|
agentUserId?: string;
|
|
1776
1778
|
startState: SessionState;
|
|
1777
1779
|
};
|
|
1780
|
+
type SendInteractiveParams = {
|
|
1781
|
+
companyId: string;
|
|
1782
|
+
whatsappNumber: string;
|
|
1783
|
+
/** Botões (até 3) ou lista (até 10 linhas em até 10 seções). Validado contra `WHATSAPP_CHOICE_LIMIT`. */
|
|
1784
|
+
interactive: InteractiveMessage;
|
|
1785
|
+
sender: 'bot' | 'agent';
|
|
1786
|
+
agentUserId?: string;
|
|
1787
|
+
startState: SessionState;
|
|
1788
|
+
/**
|
|
1789
|
+
* Rótulo da lista quando `interactive.kind === 'buttons'` e o canal não implementa
|
|
1790
|
+
* `sendInteractiveButtons` — os botões saem como lista. Padrão `DEFAULT_FALLBACK_LIST_LABEL`.
|
|
1791
|
+
*/
|
|
1792
|
+
fallbackListLabel?: string;
|
|
1793
|
+
};
|
|
1778
1794
|
declare class SendMessageUseCase {
|
|
1779
1795
|
private readonly channel;
|
|
1780
1796
|
private readonly sessionRepository;
|
|
@@ -1785,6 +1801,16 @@ declare class SendMessageUseCase {
|
|
|
1785
1801
|
private assertWithinWindow;
|
|
1786
1802
|
sendText(params: SendTextParams): Promise<MessageRow | undefined>;
|
|
1787
1803
|
sendMedia(params: SendMediaParams): Promise<MessageRow | undefined>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Botões ou lista, pelo mesmo caminho do `sendText`: janela, envio, transcript (idempotente pelo
|
|
1806
|
+
* `waMessageId`). Os limites da Meta são conferidos ANTES de tudo — mensagem fora do teto a Graph
|
|
1807
|
+
* API recusa inteira, e o erro local (`InteractiveLimitExceededError`) diz qual campo corrigir.
|
|
1808
|
+
*
|
|
1809
|
+
* O transcript guarda `type: 'interactive'`, o corpo em `content` e a mensagem inteira (ids e
|
|
1810
|
+
* títulos das opções) em `payload.interactive`, para o histórico mostrar o que foi oferecido.
|
|
1811
|
+
*/
|
|
1812
|
+
sendInteractive(params: SendInteractiveParams): Promise<MessageRow | undefined>;
|
|
1813
|
+
private sendInteractiveThroughChannel;
|
|
1788
1814
|
sendTemplate(params: SendTemplateParams): Promise<MessageRow | undefined>;
|
|
1789
1815
|
}
|
|
1790
1816
|
|
|
@@ -1792,25 +1818,53 @@ type TakeoverConversationParams = {
|
|
|
1792
1818
|
companyId: string;
|
|
1793
1819
|
whatsappNumber: string;
|
|
1794
1820
|
agentUserId: string;
|
|
1821
|
+
/**
|
|
1822
|
+
* Quem executou a ação, quando não é o próprio atendente (ex.: supervisor atribuindo a conversa a
|
|
1823
|
+
* outra pessoa). Omitido, o ator é `agentUserId`.
|
|
1824
|
+
*/
|
|
1825
|
+
actorId?: string;
|
|
1795
1826
|
};
|
|
1796
1827
|
declare class TakeoverConversationUseCase {
|
|
1797
1828
|
private readonly sessionRepository;
|
|
1798
1829
|
private readonly realtime?;
|
|
1799
|
-
|
|
1830
|
+
private readonly hooks?;
|
|
1831
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onConversationModeChanged"> | undefined);
|
|
1800
1832
|
execute(params: TakeoverConversationParams): Promise<void>;
|
|
1801
1833
|
}
|
|
1802
1834
|
|
|
1803
1835
|
type ReleaseConversationParams = {
|
|
1804
1836
|
companyId: string;
|
|
1805
1837
|
whatsappNumber: string;
|
|
1838
|
+
/** Quem devolveu a conversa ao bot. Omitido, `null` — o próprio sistema (ex.: job de inatividade). */
|
|
1839
|
+
actorId?: string | null;
|
|
1806
1840
|
};
|
|
1807
1841
|
declare class ReleaseConversationUseCase {
|
|
1808
1842
|
private readonly sessionRepository;
|
|
1809
1843
|
private readonly realtime?;
|
|
1810
|
-
|
|
1844
|
+
private readonly hooks?;
|
|
1845
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onConversationModeChanged"> | undefined);
|
|
1811
1846
|
execute(params: ReleaseConversationParams): Promise<void>;
|
|
1812
1847
|
}
|
|
1813
1848
|
|
|
1849
|
+
type RequestHumanConversationParams = {
|
|
1850
|
+
companyId: string;
|
|
1851
|
+
whatsappNumber: string;
|
|
1852
|
+
/** Quem pediu. Omitido, `null` — o cliente pelo menu ou o bot decidindo encaminhar. */
|
|
1853
|
+
actorId?: string | null;
|
|
1854
|
+
};
|
|
1855
|
+
/**
|
|
1856
|
+
* Coloca a conversa na fila "aguardando atendimento" (`humanRequestedAt`) sem tirá-la do bot: quem
|
|
1857
|
+
* assume é o `takeover`. Dispara `onHumanRequested` (o host decide como avisar a equipe) e
|
|
1858
|
+
* `onConversationModeChanged` com `kind: 'human-requested'` (trilha de auditoria).
|
|
1859
|
+
*/
|
|
1860
|
+
declare class RequestHumanConversationUseCase {
|
|
1861
|
+
private readonly sessionRepository;
|
|
1862
|
+
private readonly realtime?;
|
|
1863
|
+
private readonly hooks?;
|
|
1864
|
+
constructor(sessionRepository: SessionRepository, realtime?: RealtimeNotifierInterface | undefined, hooks?: Pick<MetaWhatsAppHooks, "onHumanRequested" | "onConversationModeChanged"> | undefined);
|
|
1865
|
+
execute(params: RequestHumanConversationParams): Promise<void>;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1814
1868
|
type ListConversationsParams = {
|
|
1815
1869
|
companyId: string;
|
|
1816
1870
|
filters?: ListConversationsFilters;
|
|
@@ -2239,6 +2293,8 @@ declare function confirmWebhookDelivery(params: {
|
|
|
2239
2293
|
* A segunda metade rodava dentro da requisição do webhook. Um deploy no meio de uma conversa
|
|
2240
2294
|
* matava a chamada em voo, e o cliente ficava sem resposta sem que nada registrasse a perda. Com
|
|
2241
2295
|
* uma fila no host, derrubar o processo vira atraso: o job espera e é retomado.
|
|
2296
|
+
*
|
|
2297
|
+
* Guia de implementação: `docs/webhook-durability.md`.
|
|
2242
2298
|
*/
|
|
2243
2299
|
|
|
2244
2300
|
type InboundMediaDescriptor = {
|
|
@@ -2313,7 +2369,8 @@ declare class InboundEffectsDispatcher {
|
|
|
2313
2369
|
*/
|
|
2314
2370
|
declare class ProcessInboundDispatchUseCase {
|
|
2315
2371
|
private readonly dispatcher;
|
|
2316
|
-
|
|
2372
|
+
private readonly hooks?;
|
|
2373
|
+
constructor(dispatcher: InboundEffectsDispatcher, hooks?: Pick<MetaWhatsAppHooks, "onInboundEffectRejected"> | undefined);
|
|
2317
2374
|
execute(job: InboundDispatchJob): Promise<void>;
|
|
2318
2375
|
}
|
|
2319
2376
|
|
|
@@ -2631,6 +2688,13 @@ interface MetaWhatsAppTranscriptionConfig {
|
|
|
2631
2688
|
languageHint?: string;
|
|
2632
2689
|
}
|
|
2633
2690
|
interface MetaWhatsAppModuleProviders {
|
|
2691
|
+
/**
|
|
2692
|
+
* Fila durável para os efeitos do webhook (hooks, realtime). Ausente, rodam dentro da requisição,
|
|
2693
|
+
* como sempre. Presente, o webhook só persiste e enfileira; o worker do host chama
|
|
2694
|
+
* `webhook.processInboundDispatch.execute(job)`. Ver docs/webhook-durability.md — qualquer fila
|
|
2695
|
+
* com durabilidade e retentativa serve, inclusive uma tabela no Postgres.
|
|
2696
|
+
*/
|
|
2697
|
+
inboundQueue?: InboundDispatchQueueInterface;
|
|
2634
2698
|
objectStorage?: ObjectStorageInterface;
|
|
2635
2699
|
cache?: CacheInterface;
|
|
2636
2700
|
realtime?: RealtimeNotifierInterface;
|
|
@@ -2660,6 +2724,7 @@ declare function createMetaWhatsAppModule(params: CreateMetaWhatsAppModuleParams
|
|
|
2660
2724
|
send: SendMessageUseCase;
|
|
2661
2725
|
takeover: TakeoverConversationUseCase;
|
|
2662
2726
|
release: ReleaseConversationUseCase;
|
|
2727
|
+
requestHuman: RequestHumanConversationUseCase;
|
|
2663
2728
|
list: ListConversationsUseCase;
|
|
2664
2729
|
listMessages: ListMessagesUseCase;
|
|
2665
2730
|
listDocuments: ListConversationDocumentsUseCase;
|
|
@@ -2696,6 +2761,7 @@ declare function createMetaWhatsAppModule(params: CreateMetaWhatsAppModuleParams
|
|
|
2696
2761
|
token: string | null;
|
|
2697
2762
|
challenge: string | null;
|
|
2698
2763
|
}) => string;
|
|
2764
|
+
processInboundDispatch: ProcessInboundDispatchUseCase;
|
|
2699
2765
|
};
|
|
2700
2766
|
flows: {
|
|
2701
2767
|
interpreter: FlowInterpreter;
|
|
@@ -2759,25 +2825,10 @@ declare class WhatsAppChannelAdapter implements ChannelAdapterInterface {
|
|
|
2759
2825
|
}): Promise<{
|
|
2760
2826
|
externalMessageId: string | null;
|
|
2761
2827
|
}>;
|
|
2762
|
-
sendInteractiveList(params: {
|
|
2763
|
-
to: string;
|
|
2764
|
-
body: string;
|
|
2765
|
-
buttonLabel: string;
|
|
2766
|
-
rows: {
|
|
2767
|
-
id: string;
|
|
2768
|
-
title: string;
|
|
2769
|
-
}[];
|
|
2770
|
-
}): Promise<{
|
|
2828
|
+
sendInteractiveList(params: ChannelInteractiveListParams): Promise<{
|
|
2771
2829
|
externalMessageId: string | null;
|
|
2772
2830
|
}>;
|
|
2773
|
-
sendInteractiveButtons(params: {
|
|
2774
|
-
to: string;
|
|
2775
|
-
body: string;
|
|
2776
|
-
buttons: {
|
|
2777
|
-
id: string;
|
|
2778
|
-
title: string;
|
|
2779
|
-
}[];
|
|
2780
|
-
}): Promise<{
|
|
2831
|
+
sendInteractiveButtons(params: ChannelInteractiveButtonsParams): Promise<{
|
|
2781
2832
|
externalMessageId: string | null;
|
|
2782
2833
|
}>;
|
|
2783
2834
|
sendProductList(params: {
|
|
@@ -2811,13 +2862,18 @@ declare class WhatsAppChannelAdapter implements ChannelAdapterInterface {
|
|
|
2811
2862
|
declare const INBOUND_LOCATION_CONTENT = "\uD83D\uDCCD Localiza\u00E7\u00E3o";
|
|
2812
2863
|
|
|
2813
2864
|
declare const META_WHATSAPP_MIGRATIONS_TABLE = "meta_whatsapp_migrations";
|
|
2814
|
-
|
|
2865
|
+
type MetaWhatsAppMigrationsLayout = 'v1' | 'journal';
|
|
2866
|
+
type MetaWhatsAppMigrationsFolderParams = {
|
|
2867
|
+
readonly layout?: MetaWhatsAppMigrationsLayout;
|
|
2868
|
+
};
|
|
2869
|
+
declare function metaWhatsAppMigrationsFolder(params?: MetaWhatsAppMigrationsFolderParams): string;
|
|
2815
2870
|
type RunMetaWhatsAppMigrationsParams = {
|
|
2816
2871
|
db: MetaWhatsAppDatabase;
|
|
2817
2872
|
migrate: (db: never, config: {
|
|
2818
2873
|
migrationsFolder: string;
|
|
2819
2874
|
migrationsTable?: string;
|
|
2820
2875
|
}) => Promise<void>;
|
|
2876
|
+
layout?: MetaWhatsAppMigrationsLayout;
|
|
2821
2877
|
};
|
|
2822
2878
|
declare function runMetaWhatsAppMigrations(params: RunMetaWhatsAppMigrationsParams): Promise<void>;
|
|
2823
2879
|
|
|
@@ -2975,4 +3031,4 @@ declare class FlowMediaIdRepository implements FlowMediaIdStore {
|
|
|
2975
3031
|
}): Promise<void>;
|
|
2976
3032
|
}
|
|
2977
3033
|
|
|
2978
|
-
export { type AttachFlowMediaParams, type AudioTranscriber, type CompanyDocumentView, type CompanyDocumentsPage, type ConversationDocumentView, type ConversationDocumentsPage, type CountInboundLocationsParams, type CountInboundLocationsResult, CountInboundLocationsUseCase, type CreateFlowGraphParams, CreateFlowGraphUseCase, type CreateMetaWhatsAppModuleParams, type CreateSendMediaActionParams, type CreateSendProductListActionParams, DEFAULT_FLOW_GRAPH_CACHE_TTL_SECONDS, type DeleteConversationParams, type DeleteConversationResult, DeleteConversationUseCase, DeleteFlowGraphUseCase, DocumentRepository, type DocumentRow, type DrizzleMigrateFunction, type ExportConversationParams, type ExportConversationResult, ExportConversationUseCase, FlowGraphCache, FlowGraphRepository, type FlowGraphRow, FlowInterpreter, type FlowMediaIdCache, FlowMediaIdRepository, type FlowMediaIdStore, type FlowMediaLocation, FlowMediaRepository, type FlowMediaRow, type FlowMediaTranscriptLogger, type FlowRunResult, type FlowStepInput, type FlowStepResult, GetFlowGraphUseCase, GetLiveFlowPositionsUseCase, INBOUND_LOCATION_CONTENT, type InboundDispatchJob, type InboundDispatchQueueInterface, InboundEffectsDispatcher, type InboundMediaDescriptor, type InboundMessageEffectsJob, type InboundStatusEffectsJob, type IngestInboundMediaParams, type IngestInboundMediaResult, IngestInboundMediaUseCase, type IngestTranscriptionOptions, type InsertMessageParams, InvalidFlowGraphError, type LinkDocumentParams, type ListCompanyDocumentsParams, ListCompanyDocumentsUseCase, type ListConversationDocumentsParams, ListConversationDocumentsUseCase, type ListConversationsFilters, type ListConversationsParams, ListConversationsUseCase, type ListDocumentsParams, type ListDocumentsResult, ListFlowGraphsUseCase, type ListMessagesParams, ListMessagesUseCase, type LogMessageParams, LogMessageUseCase, META_WHATSAPP_MIGRATIONS_TABLE, type MessageModerator, MessageRepository, type MessageRow, type MetaWhatsAppDatabase, type MetaWhatsAppModule, type MetaWhatsAppModuleConfig, type MetaWhatsAppModuleFeatures, type MetaWhatsAppModuleProviders, type MetaWhatsAppTranscriptionConfig, type NewDocumentRow, type NewFlowGraphRow, type NewFlowMediaRow, type NewMessageRow, type NewSessionRow, type NewSettingsRow, type NonceStoreInterface, OptimisticLockError, PRODUCT_LIST_LIMIT, type PreviewMediaSupport, ProcessInboundDispatchUseCase, type PurgeExpiredDocumentsParams, type PurgeExpiredDocumentsResult, PurgeExpiredDocumentsUseCase, type RealtimeRelay, type ReceiveWebhookParams, type ReceiveWebhookResult, ReceiveWebhookUseCase, type RedactInboundLocationsParams, type RedactInboundLocationsResult, RedactInboundLocationsUseCase, type ReleaseConversationParams, ReleaseConversationUseCase, type ListMessagesParams$1 as RepositoryListMessagesParams, type ResolveTranscriptionPolicyDependencies, type RunMetaWhatsAppMigrationsParams, type SaveFlowGraphParams, SaveFlowGraphUseCase, type SaveTranscriptionByWaMessageIdParams, type SaveTranscriptionParams, type SendMediaParams, SendMessageUseCase, type SendTemplateParams, type SendTextParams, SessionRepository, type SessionRow, SettingsRepository, type SettingsRow, SseHub, type SseListener, type StorePreviewMediaParams, type StorePreviewMediaResult, StorePreviewMediaUseCase, TRANSCRIPTION_MODE, TRANSCRIPTION_STATUS, type TakeoverConversationParams, TakeoverConversationUseCase, type TicketStoreInterface, type TranscribeAudioDependencies, type TranscribeAudioParams, type TranscribeAudioResult, TranscribeAudioUseCase, type TranscriptionPolicy, type TranscriptionPolicyDefaults, type TranscriptionPolicyResolver, type TranscriptionStatus, type UpdateFlowMediaParams, WhatsAppChannelAdapter, buildInboundJobId, claimWebhookDelivery, confirmWebhookDelivery, createMetaWhatsAppModule, createSendMediaAction, createSendProductListAction, createTranscriptionPolicyResolver, documents, extractMediaDescriptor, flowGraphs, flowMedia, isAudioMimeType, isRetriableTranscriptionError, isUnsupportedTranscriptionError, issueSseTicket, messages, metaWhatsAppMigrationsFolder, metaWhatsAppSchema, redeemSseTicket, resolveFailureStatus, runMetaWhatsAppMigrations, sessions, settings, toSessionContract, transcriptionRetryAfterSeconds, verifyWebhookChallenge, verifyWebhookSignature };
|
|
3034
|
+
export { type AttachFlowMediaParams, type AudioTranscriber, type CompanyDocumentView, type CompanyDocumentsPage, type ConversationDocumentView, type ConversationDocumentsPage, type CountInboundLocationsParams, type CountInboundLocationsResult, CountInboundLocationsUseCase, type CreateFlowGraphParams, CreateFlowGraphUseCase, type CreateMetaWhatsAppModuleParams, type CreateSendMediaActionParams, type CreateSendProductListActionParams, DEFAULT_FALLBACK_LIST_LABEL, DEFAULT_FLOW_GRAPH_CACHE_TTL_SECONDS, type DeleteConversationParams, type DeleteConversationResult, DeleteConversationUseCase, DeleteFlowGraphUseCase, DocumentRepository, type DocumentRow, type DrizzleMigrateFunction, type ExportConversationParams, type ExportConversationResult, ExportConversationUseCase, FlowGraphCache, FlowGraphRepository, type FlowGraphRow, FlowInterpreter, type FlowMediaIdCache, FlowMediaIdRepository, type FlowMediaIdStore, type FlowMediaLocation, FlowMediaRepository, type FlowMediaRow, type FlowMediaTranscriptLogger, type FlowRunResult, type FlowStepInput, type FlowStepResult, GetFlowGraphUseCase, GetLiveFlowPositionsUseCase, INBOUND_LOCATION_CONTENT, type InboundDispatchJob, type InboundDispatchQueueInterface, InboundEffectsDispatcher, type InboundMediaDescriptor, type InboundMessageEffectsJob, type InboundStatusEffectsJob, type IngestInboundMediaParams, type IngestInboundMediaResult, IngestInboundMediaUseCase, type IngestTranscriptionOptions, type InsertMessageParams, InvalidFlowGraphError, type LinkDocumentParams, type ListCompanyDocumentsParams, ListCompanyDocumentsUseCase, type ListConversationDocumentsParams, ListConversationDocumentsUseCase, type ListConversationsFilters, type ListConversationsParams, ListConversationsUseCase, type ListDocumentsParams, type ListDocumentsResult, ListFlowGraphsUseCase, type ListMessagesParams, ListMessagesUseCase, type LogMessageParams, LogMessageUseCase, META_WHATSAPP_MIGRATIONS_TABLE, type MessageModerator, MessageRepository, type MessageRow, type MetaWhatsAppDatabase, type MetaWhatsAppMigrationsFolderParams, type MetaWhatsAppMigrationsLayout, type MetaWhatsAppModule, type MetaWhatsAppModuleConfig, type MetaWhatsAppModuleFeatures, type MetaWhatsAppModuleProviders, type MetaWhatsAppTranscriptionConfig, type NewDocumentRow, type NewFlowGraphRow, type NewFlowMediaRow, type NewMessageRow, type NewSessionRow, type NewSettingsRow, type NonceStoreInterface, OptimisticLockError, PRODUCT_LIST_LIMIT, type PreviewMediaSupport, ProcessInboundDispatchUseCase, type PurgeExpiredDocumentsParams, type PurgeExpiredDocumentsResult, PurgeExpiredDocumentsUseCase, type RealtimeRelay, type ReceiveWebhookParams, type ReceiveWebhookResult, ReceiveWebhookUseCase, type RedactInboundLocationsParams, type RedactInboundLocationsResult, RedactInboundLocationsUseCase, type ReleaseConversationParams, ReleaseConversationUseCase, type ListMessagesParams$1 as RepositoryListMessagesParams, type RequestHumanConversationParams, RequestHumanConversationUseCase, type ResolveTranscriptionPolicyDependencies, type RunMetaWhatsAppMigrationsParams, type SaveFlowGraphParams, SaveFlowGraphUseCase, type SaveTranscriptionByWaMessageIdParams, type SaveTranscriptionParams, type SendInteractiveParams, type SendMediaParams, SendMessageUseCase, type SendTemplateParams, type SendTextParams, SessionRepository, type SessionRow, SettingsRepository, type SettingsRow, SseHub, type SseListener, type StorePreviewMediaParams, type StorePreviewMediaResult, StorePreviewMediaUseCase, TRANSCRIPTION_MODE, TRANSCRIPTION_STATUS, type TakeoverConversationParams, TakeoverConversationUseCase, type TicketStoreInterface, type TranscribeAudioDependencies, type TranscribeAudioParams, type TranscribeAudioResult, TranscribeAudioUseCase, type TranscriptionPolicy, type TranscriptionPolicyDefaults, type TranscriptionPolicyResolver, type TranscriptionStatus, type UpdateFlowMediaParams, WhatsAppChannelAdapter, buildInboundJobId, claimWebhookDelivery, confirmWebhookDelivery, createMetaWhatsAppModule, createSendMediaAction, createSendProductListAction, createTranscriptionPolicyResolver, documents, extractMediaDescriptor, flowGraphs, flowMedia, isAudioMimeType, isRetriableTranscriptionError, isUnsupportedTranscriptionError, issueSseTicket, messages, metaWhatsAppMigrationsFolder, metaWhatsAppSchema, redeemSseTicket, resolveFailureStatus, runMetaWhatsAppMigrations, sessions, settings, toSessionContract, transcriptionRetryAfterSeconds, verifyWebhookChallenge, verifyWebhookSignature };
|