@botozap/sdk 0.29.0 → 0.30.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/dist/index.d.ts CHANGED
@@ -758,7 +758,9 @@ type AiWindow = {
758
758
  };
759
759
  type AiToolId = "contacts.read" | "contacts.update" | "conversations.read" | "conversations.note" | "crm.opportunities.read" | "crm.opportunities.write" | "crm.demands.read" | "crm.demands.write" | "crm.stages.read" | "crm.stages.write" | "agenda.availability" | "agenda.propose" | "agenda.appointments.read" | "agenda.appointments.reschedule" | "agenda.appointments.cancel" | "knowledge.search" | "memory.read" | "memory.propose" | "skills.read" | "followups.enroll" | "followups.pause" | "followups.cancel" | "cases.open" | "cases.update" | "followups.schedule" | "followups.list" | "handoff" | "alerts.create" | "contacts.search" | "contacts.get" | "contacts.propose_update" | "conversations.list" | "conversations.get" | "conversations.history" | "conversations.assign" | "team.members.read" | "inbox.queue.read" | "tags.read" | "tags.manage" | "saved_replies.read" | "saved_replies.render" | "automations.read" | "automations.runs.read" | "radar.read" | "radar.propose_reactivation" | "catalog.products.search" | "privacy.consent.read" | "knowledge.sources.read" | "proposals.read" | "cases.read" | "crm.search" | "agenda.schedule.read" | "agenda.appointments.confirm" | "cases.note" | "cases.close"
760
760
  /** Opções para o contato tocar (botões ou lista), anexadas à resposta final do turno. Só o agente; o operador é recusado. */
761
- | "conversations.reply_options";
761
+ | "conversations.reply_options"
762
+ /** Anexa à resposta final fotos, vídeos e PDFs da biblioteca escolhidos em `file_ids` (#1447). Só o agente. */
763
+ | "conversations.attach_files";
762
764
  /**
763
765
  * Configuração do agente na ENTRADA (`ai.agents.create` e `saveDraft`): o
764
766
  * provedor só pode ser `openai` ou `anthropic`. A leitura devolve
@@ -801,6 +803,8 @@ interface AiAgentConfig {
801
803
  allowed_stage_ids?: string[];
802
804
  knowledge_source_ids?: string[];
803
805
  skill_ids?: string[];
806
+ /** Arquivos da biblioteca (`ai.files`) que o agente pode mandar, até 40; com `conversations.attach_files` em `tool_ids` (#1447). */
807
+ file_ids?: string[];
804
808
  /** Opt-in platform skills composed at runtime; Customer copies override them. */
805
809
  platform_skills?: "none" | "all";
806
810
  memory_enabled?: boolean;
@@ -822,6 +826,11 @@ interface AiAgentConfig {
822
826
  enabled?: boolean;
823
827
  flow_ids?: string[];
824
828
  send_window?: AiWindow | null;
829
+ /** Template aprovado que o retorno agendado pelo agente envia com a janela de 24h fechada (só WhatsApp); null = alertar a equipe. */
830
+ return_template?: {
831
+ template_id: string;
832
+ variable_map?: Record<string, string>;
833
+ } | null;
825
834
  };
826
835
  safety?: {
827
836
  disclose_ai?: boolean;
@@ -1031,6 +1040,8 @@ type AiRouterConfig = {
1031
1040
  intent_description: string;
1032
1041
  examples?: string[];
1033
1042
  position?: number;
1043
+ /** Agente fixo: escolhido, fica com a conversa até ela ser fechada (padrão false). */
1044
+ keep_until_closed?: boolean;
1034
1045
  }[];
1035
1046
  };
1036
1047
  type AiRouter = Omit<AiRouterConfig, "classifier"> & {
@@ -1158,7 +1169,7 @@ type AiCase = {
1158
1169
  contact_name?: string | null;
1159
1170
  };
1160
1171
  type AiCaseKind = "agendamento" | "duvida" | "problema" | "financeiro" | "acesso" | "outro";
1161
- type AiCaseSource = "agent" | "guardrail" | "human" | "operator";
1172
+ type AiCaseSource = "agent" | "guardrail" | "human" | "operator" | "followup";
1162
1173
  type AiCaseEvent = {
1163
1174
  id: string;
1164
1175
  case_id: string;
@@ -1207,7 +1218,7 @@ type AiAlertBulkFilters = {
1207
1218
  severity?: AiAlert["severity"];
1208
1219
  status?: "open" | "acknowledged";
1209
1220
  };
1210
- type AiNoticeField = "case_title" | "case_summary" | "case_url" | "contact_name" | "agent_name";
1221
+ type AiNoticeField = "case_title" | "case_summary" | "case_url" | "contact_name" | "contact_phone" | "contact_name_and_phone" | "agent_name";
1211
1222
  type AiNoticeSettings = {
1212
1223
  enabled: boolean;
1213
1224
  contact_id: string | null;
@@ -1538,15 +1549,56 @@ type AiPlatformSkill = {
1538
1549
  installed_version_id: string | null;
1539
1550
  };
1540
1551
  type AiArtifactUploadInput = AiScope & {
1541
- kind: "knowledge" | "skill";
1552
+ kind: "knowledge" | "skill" | "file";
1542
1553
  file_name: string;
1543
1554
  mime_type: string;
1544
1555
  byte_size: number;
1545
1556
  sha256: string;
1546
1557
  name?: string;
1558
+ /** kind=file: quando o agente deve mandar o arquivo (obrigatório, até 500). */
1559
+ description?: string;
1560
+ /** kind=file: legenda opcional (até 1.024 caracteres e 1.000 bytes). */
1561
+ caption?: string | null;
1547
1562
  skill_id?: string;
1548
1563
  expected_revision?: string;
1549
1564
  };
1565
+ /** Arquivo da biblioteca do agente (#1447): foto, vídeo ou PDF que o agente pode mandar na conversa. */
1566
+ interface AiAgentFile {
1567
+ id: string;
1568
+ customer_id: string;
1569
+ name: string;
1570
+ /** Quando o agente deve mandar (o agente lê). */
1571
+ description: string;
1572
+ caption: string | null;
1573
+ media_type: "image" | "video" | "document";
1574
+ mime_type: string;
1575
+ file_name: string;
1576
+ byte_size: number;
1577
+ /** processing enquanto converte; failed com o motivo em last_error. */
1578
+ status: "processing" | "ready" | "failed";
1579
+ last_error: string | null;
1580
+ active: boolean;
1581
+ revision: string;
1582
+ created_at: string;
1583
+ updated_at: string;
1584
+ }
1585
+ interface AiAgentFileDetail extends AiAgentFile {
1586
+ usages: {
1587
+ agent_id: string;
1588
+ name: string;
1589
+ version_number: number;
1590
+ published: boolean;
1591
+ }[];
1592
+ /** Link curto para ver o arquivo; null sem armazenamento. Não guarde nem registre. */
1593
+ preview_url: string | null;
1594
+ preview_expires_at: string | null;
1595
+ }
1596
+ type AiAgentFilePatch = {
1597
+ name?: string;
1598
+ description?: string;
1599
+ caption?: string | null;
1600
+ active?: boolean;
1601
+ };
1550
1602
  interface AiPreparedUpload {
1551
1603
  upload_id: string;
1552
1604
  upload_url: string;
@@ -2873,6 +2925,8 @@ declare class AiRoutersResource {
2873
2925
  request_key: string;
2874
2926
  sticky_agent_id?: string | null;
2875
2927
  sticky_intent?: string | null;
2928
+ /** Última mensagem enviada ao contato, que o classificador lê como contexto. */
2929
+ last_sent_message?: string | null;
2876
2930
  }): Promise<AiRouterTest>;
2877
2931
  /** Ativa membro sem criar vínculo direto com canal. */
2878
2932
  activateMember(input: AiScope & {
@@ -3058,7 +3112,7 @@ declare class AiUploadsResource {
3058
3112
  prepare(input: AiArtifactUploadInput): Promise<AiPreparedUpload>;
3059
3113
  complete(input: AiScope & {
3060
3114
  id: string;
3061
- }): Promise<AiKnowledgeSource | AiSkill>;
3115
+ }): Promise<AiKnowledgeSource | AiSkill | AiAgentFile>;
3062
3116
  }
3063
3117
  declare class AiCommercialProposalsResource {
3064
3118
  private readonly client;
@@ -3177,9 +3231,42 @@ declare class AiStyleAdjustmentsResource {
3177
3231
  enabled: boolean;
3178
3232
  }): Promise<AiStyleAdjustment>;
3179
3233
  }
3234
+ /** Biblioteca de fotos, vídeos e PDFs que o agente manda na conversa (#1447). */
3235
+ declare class AiFilesResource {
3236
+ private readonly client;
3237
+ constructor(client: BotoZap);
3238
+ /** GET /ai/files */
3239
+ list(input: AiScope): Promise<AiAgentFile[]>;
3240
+ /** GET /ai/files/:id — com quem usa e o link curto de prévia. */
3241
+ get(input: AiScope & {
3242
+ id: string;
3243
+ }): Promise<AiAgentFileDetail>;
3244
+ /** PATCH /ai/files/:id — vale na hora para os agentes publicados que usam o arquivo. */
3245
+ update(input: AiRevision & {
3246
+ id: string;
3247
+ } & AiAgentFilePatch): Promise<AiAgentFile>;
3248
+ /** DELETE /ai/files/:id — 409 in_use se o arquivo está numa versão publicada. */
3249
+ remove(input: AiRevision & {
3250
+ id: string;
3251
+ }): Promise<void>;
3252
+ /**
3253
+ * Sobe foto (JPG/PNG), vídeo (MP4/MOV) ou PDF de até 25 MiB pelo upload direto (prepare, PUT na URL
3254
+ * assinada, complete). Repetir com os mesmos bytes e dados reaproveita o envio. Vídeo do iPhone e foto
3255
+ * grande voltam `processing` e ficam `ready` depois da conversão.
3256
+ */
3257
+ upload(input: AiScope & {
3258
+ file: Blob;
3259
+ file_name: string;
3260
+ name: string;
3261
+ description: string;
3262
+ caption?: string | null;
3263
+ onUploadPrepared?: AiUploadReceiptCallback;
3264
+ }): Promise<AiAgentFile>;
3265
+ }
3180
3266
  declare class Ai {
3181
3267
  private readonly client;
3182
3268
  readonly uploads: AiUploadsResource;
3269
+ readonly files: AiFilesResource;
3183
3270
  readonly agents: AiAgentsResource;
3184
3271
  readonly credentials: AiCredentialsResource;
3185
3272
  readonly providers: AiProvidersResource;
@@ -3426,7 +3513,8 @@ declare class Calendar {
3426
3513
  type StageColor = "zinc" | "green" | "amber" | "pink";
3427
3514
  interface ContactStage {
3428
3515
  id: string;
3429
- key: string;
3516
+ /** Só as quatro etapas padrão têm chave fixa; a criada pelo cliente vem `null`. */
3517
+ key: string | null;
3430
3518
  label: string;
3431
3519
  color: StageColor;
3432
3520
  position: number;
@@ -4001,7 +4089,13 @@ interface SendTemplateParams {
4001
4089
  interface SendImageParams {
4002
4090
  to: string;
4003
4091
  type: "image";
4004
- link: string;
4092
+ /** URL https pública do arquivo; ou `file_id` no lugar dele (um dos dois). */
4093
+ link?: string;
4094
+ /**
4095
+ * Arquivo pronto da biblioteca do agente (`GET /ai/files`) no lugar do `link` (#1447): sai por um link
4096
+ * curto assinado do armazenamento; a legenda da biblioteca não entra sozinha. Chave sandbox: 403.
4097
+ */
4098
+ file_id?: string;
4005
4099
  caption?: string;
4006
4100
  from?: string;
4007
4101
  /**
@@ -4035,7 +4129,13 @@ interface SendAudioParams {
4035
4129
  interface SendVideoParams {
4036
4130
  to: string;
4037
4131
  type: "video";
4038
- link: string;
4132
+ /** URL https pública do arquivo; ou `file_id` no lugar dele (um dos dois). */
4133
+ link?: string;
4134
+ /**
4135
+ * Arquivo pronto da biblioteca do agente (`GET /ai/files`) no lugar do `link` (#1447): sai por um link
4136
+ * curto assinado do armazenamento; a legenda da biblioteca não entra sozinha. Chave sandbox: 403.
4137
+ */
4138
+ file_id?: string;
4039
4139
  caption?: string;
4040
4140
  from?: string;
4041
4141
  /**
@@ -4049,7 +4149,13 @@ interface SendVideoParams {
4049
4149
  interface SendDocumentParams {
4050
4150
  to: string;
4051
4151
  type: "document";
4052
- link: string;
4152
+ /** URL https pública do arquivo; ou `file_id` no lugar dele (um dos dois). */
4153
+ link?: string;
4154
+ /**
4155
+ * Arquivo pronto da biblioteca do agente (`GET /ai/files`) no lugar do `link` (#1447): sai por um link
4156
+ * curto assinado do armazenamento; a legenda da biblioteca não entra sozinha. Chave sandbox: 403.
4157
+ */
4158
+ file_id?: string;
4053
4159
  caption?: string;
4054
4160
  filename?: string;
4055
4161
  from?: string;
@@ -4758,6 +4864,25 @@ interface ConversationReadResult {
4758
4864
  /** Momento da leitura gravado (ISO 8601). */
4759
4865
  last_read_at: string;
4760
4866
  }
4867
+ /**
4868
+ * Envio manual do WhatsApp (API ou painel) que a Meta não confirmou (timeout ou erro de rede) em
4869
+ * cerca de 5 minutos, em `conversations.listPendingSends`. Antes desse prazo a confirmação ainda
4870
+ * pode chegar, e o envio não aparece.
4871
+ */
4872
+ interface PendingSend {
4873
+ id: string;
4874
+ status: "unconfirmed";
4875
+ /** Tipo da mensagem guardada no envio (`text`, `template`, `image`...), quando há. */
4876
+ kind: string | null;
4877
+ /** O texto que identifica o envio (corpo, legenda ou nome do template), quando há. */
4878
+ preview: string | null;
4879
+ created_at: string;
4880
+ }
4881
+ /** Resposta de `conversations.markPendingSend` (200). */
4882
+ interface PendingSendMarkResult {
4883
+ id: string;
4884
+ status: "sent" | "not_sent";
4885
+ }
4761
4886
  /** Conversas (read + status) e atribuições a membros. */
4762
4887
  declare class Conversations {
4763
4888
  private readonly client;
@@ -4821,6 +4946,19 @@ declare class Conversations {
4821
4946
  * (grava a leitura sem avisar a Meta).
4822
4947
  */
4823
4948
  markRead(id: string): Promise<ConversationReadResult>;
4949
+ /**
4950
+ * Envios manuais do WhatsApp da conversa que a Meta não confirmou em cerca de 5 minutos, como o
4951
+ * aviso na conversa no painel. Quando a Meta confirma, a mensagem entra no histórico sozinha.
4952
+ * Envios da IA, respostas automáticas, transmissões, réguas e Instagram têm conciliação própria
4953
+ * e não aparecem. Conversa de outra Conta: 404. Scope `conversations:read`.
4954
+ */
4955
+ listPendingSends(id: string): Promise<PendingSend[]>;
4956
+ /**
4957
+ * Diz se o envio sem confirmação chegou ao contato, como "Saiu" e "Não saiu" no painel:
4958
+ * `sent` põe a mensagem no histórico (sem o id da Meta); `not_sent` libera para enviar de novo.
4959
+ * Nada é reenviado. Envio já resolvido: 409 `send_not_pending`. Scope `messages:send`.
4960
+ */
4961
+ markPendingSend(id: string, sendId: string, outcome: "sent" | "not_sent"): Promise<PendingSendMarkResult>;
4824
4962
  /**
4825
4963
  * Exclui a conversa, com efeito imediato e sem volta: mensagens, notas,
4826
4964
  * atribuições, vínculos com oportunidades e demandas e o que a IA guardou
@@ -5225,8 +5363,11 @@ declare class PhoneNumbers {
5225
5363
  /**
5226
5364
  * Inscreve o BotoZap de novo para receber as mensagens do número, com a
5227
5365
  * autorização já guardada, sem refazer a conexão. Resolve a prontidão
5228
- * `webhooks_lost`; autorização recusada pela Meta responde 409
5229
- * `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
5366
+ * `webhooks_lost` quando o app saiu da conta do WhatsApp. Se a conta mudou de
5367
+ * portfólio na Meta, devolve `missing`, e autorização recusada pela Meta
5368
+ * responde 409 `reconnect_required`: nos dois casos, só o link de setup
5369
+ * resolve. `unknown` = a Meta não confirmou agora; confira com `health` em
5370
+ * instantes. Scope `numbers:write`.
5230
5371
  */
5231
5372
  resubscribeWebhooks(id: string): Promise<WebhookSubscription>;
5232
5373
  }
@@ -6399,4 +6540,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
6399
6540
  */
6400
6541
  declare function isNotConnected(error: unknown): error is BotoZapError;
6401
6542
 
6402
- export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AccountExport, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentConfigRead, type AiAgentCoverage, type AiAgentDiagnostic, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, type AiBindingTargetRead, type AiBudget, type AiBudgetInput, type AiCapabilitySignal, type AiCapabilityUsage, type AiCapabilityUsageList, type AiCase, type AiCaseChat, type AiCaseEvent, type AiCaseKind, type AiCaseReply, type AiCaseReplyInput, type AiCaseSource, AiCasesResource, type AiCatalogItems, type AiCatalogModel, type AiCatalogProduct, type AiCatalogSyncInput, type AiCatalogSyncResult, type AiChannelGate, type AiCommercialDecision, type AiCommercialEffect, type AiCommercialJob, type AiCommercialProposal, AiCommercialProposalsResource, type AiCommercialRequest, type AiCommercialSettings, type AiConfigurablePurpose, type AiContactAuthorization, type AiConversationCheckpoint, type AiCredential, AiCredentialsResource, type AiDiagnosticCheck, type AiDiagnosticStatus, type AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, type AiEnabledProvider, type AiEnrollment, type AiEvolution, AiEvolutionResource, type AiEvolutionSource, type AiExecution, type AiExecutionCitations, type AiExecutionSecurity, AiExecutionsResource, type AiField, type AiFlow, type AiFlowGraph, type AiFlowInput, type AiFlowSettings, type AiFlowVersion, type AiFollowupEffect, type AiFollowupEvent, AiFollowupFlowsResource, type AiFollowupPromise, type AiFollowupPromiseDetail, type AiFollowupPromiseStatus, type AiFollowupQueueFilters, type AiFollowupQueuePage, type AiFollowupQueueRow, AiFollowupsResource, type AiGateMode, type AiInference, type AiInferenceOrigin, type AiInferenceOutcome, type AiInferenceSummary, AiInferencesResource, type AiKnowledgeChunk, type AiKnowledgeCitation, type AiKnowledgeConversation, type AiKnowledgeHit, type AiKnowledgeImport, type AiKnowledgePreview, AiKnowledgeResource, type AiKnowledgeSearchDiagnostics, type AiKnowledgeSource, type AiMemory, type AiMemoryEntry, type AiMemoryEntryEvent, AiMemoryResource, type AiModelCatalogSnapshot, type AiModelCatalogSync, type AiNoticeCheck, type AiNoticeEffect, type AiNoticeField, type AiNoticeJob, type AiNoticeSettings, AiNoticesResource, type AiOperation, type AiOperatorMetrics, AiOperatorResource, type AiPage, type AiPlatformSkill, type AiPlatformSkillComposition, type AiPreparedUpload, type AiProposal, AiProposalsResource, type AiProvider, type AiProviderInfo, type AiProviderModel, AiProvidersResource, type AiPurpose, type AiRate, type AiRateInput, type AiRecord, type AiRevision, type AiRouter, type AiRouterConfig, type AiRouterTest, AiRoutersResource, type AiScope, type AiSkill, type AiSkillInput, type AiSkillNearMiss, type AiSkillVersion, AiSkillsResource, type AiSourceKind, type AiStyleAdjustment, type AiStyleAdjustmentId, AiStyleAdjustmentsResource, type AiToolId, type AiTurnPromise, type AiUploadReceiptCallback, AiUploadsResource, AiUsageResource, type AiUsageSummary, type AiUsageTokens, type AiWindow, type ApiLog, type Appointment, type AppointmentAvailability, type AppointmentExceptionInput, type AppointmentFields, type AppointmentHistory, type AppointmentQuery, type AppointmentScheduleInput, type AppointmentServiceInput, type AppointmentStatus, Appointments, type Assignment, type AvailabilityQuery, type Billing, type BillingGuarantee, type BillingPlan, type BlockUserParams, type BlockUserResult, type BlockedUser, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, type BusinessSlot, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type ChannelAccount, type ChannelAccountRef, ChannelAccounts, type CommentAiDeliveryStatus, type CommentRule, type CommentRuleCounters, type CommentRuleMetrics, type CommentRuleMetricsParams, type CommentRuleStatus, type ConnectionBilling, type ConnectionBillingOutcome, type ConnectionBillingRefusal, type Consent, type ConsentChannel, type ConsentOrigin, type ConsentPurpose, type ConsentRequestResult, type ConsentState, type Contact, type ContactConsents, type ContactField, ContactFields, type ContactStage, ContactStages, type ContactWarning, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReadResult, type ConversationReferral, type ConversationReminder, type ConversationTypingResult, type ConversationalAutomation, type ConversationalCommand, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateExportParams, type CreateMessageRuleParams, type CreateOpportunity, type CreateQrCodeParams, type CreateSetupLinkParams, type CreateTemplateParams, type CreateWebhookParams, type CrmActivity, type CrmConversation, type CrmFields, type CrmMetadata, type CrmQuery, type CrmRecord, CrmResource, type CursorList, type CursorPaging, type CursorParams, type Customer, type CustomerBusinessSlot, type DeleteCommentRuleResult, type DeleteMessageRuleResult, type DeletedTemplate, type Demand, type DemandFields, type EnableJourneyModelParams, type EventList, type EventPaging, type ExportDownload, type ExportFormat, type ExportScope, type ExportStatus, type FixedRuleMessage, type HistoryImport, type HistoryImportStatus, type HistoryImportWindowDays, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type InitialConsent, type InstagramCommentAi, type InstagramCommentAiAutomation, type InstagramCommentAiRepliedEvent, type InstagramCommentAiRun, type InstagramConnection, type InstagramGenericElement, type InstagramIceBreaker, type InstagramInteractiveButton, type InstagramInteractiveButtonPayload, type InstagramInteractiveGenericPayload, type InstagramInteractivePayload, type InstagramPersistentMenuItem, type InstagramTokenStatus, type InteractiveButtonPayload, type InteractiveCtaUrlPayload, type InteractiveHeader, type InteractiveListPayload, type InteractivePayload, type Journey, type JourneyCatalogItem, type JourneyCatalogSegment, type JourneyCatalogTrigger, type JourneyConfig, type JourneyEnrollment, type JourneyModelEnableResult, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListChannelAccountsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTeamEventsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, type MessageReplyTo, type MessageRule, type MessageRuleAction, type MessageRuleQrParams, type MessageRuleTrigger, type MessageSort, type MessageSource, type MessageStatus, type MessengerProfile, type MessengerProfileConfig, type MetaCostCategory, type MetaCostDay, type MetaCostEstimate, type MetaCostGroup, type MetaCostReport, type MetaCostSource, type MetaCostSync, type MetaCostUnavailableReason, type MetaCostsParams, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, PLAN_ERROR_CODES, type PhoneNumber, PhoneNumberBlockedUsers, PhoneNumberQrCodes, type QrImageFormat, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type RecordConsentParams, type ReplyConversationParams, type ReplyToParam, type RequestConsentParams, type RequestOptions, SavedReplies, type SavedReply, type SavedReplyInput, type SavedReplyQuery, type ScheduleBroadcastParams, type SendAudioParams, type SendDocumentParams, type SendFailureDetails, type SendImageParams, type SendInteractiveParams, type SendLocationParams, type SendMediaParams, type SendOptions, type SendReactionParams, type SendReactionResult, type SendResult, type SendTemplateParams, type SendTextParams, type SendVideoParams, type SetHistoryImportParams, type SetupLink, type StageColor, type StageRule, type StageRuleInput, type SyncTemplatesParams, type TeamEvent, type TeamEventActor, type TeamEventTarget, type Template, type TemplatePayload, type TemplateSyncResult, type UnblockUserResult, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateConversationalAutomationParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateTemplateParams, type UpdateWebhookParams, type UpdateWhatsAppProfileParams, type UploadMediaParams, type UploadProfilePhotoParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryReplay, type WebhookDeliveryStatus, type WebhookSubscription, type WebhookSubscriptionState, type WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
6543
+ export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AccountExport, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentConfigRead, type AiAgentCoverage, type AiAgentDiagnostic, type AiAgentFile, type AiAgentFileDetail, type AiAgentFilePatch, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, type AiBindingTargetRead, type AiBudget, type AiBudgetInput, type AiCapabilitySignal, type AiCapabilityUsage, type AiCapabilityUsageList, type AiCase, type AiCaseChat, type AiCaseEvent, type AiCaseKind, type AiCaseReply, type AiCaseReplyInput, type AiCaseSource, AiCasesResource, type AiCatalogItems, type AiCatalogModel, type AiCatalogProduct, type AiCatalogSyncInput, type AiCatalogSyncResult, type AiChannelGate, type AiCommercialDecision, type AiCommercialEffect, type AiCommercialJob, type AiCommercialProposal, AiCommercialProposalsResource, type AiCommercialRequest, type AiCommercialSettings, type AiConfigurablePurpose, type AiContactAuthorization, type AiConversationCheckpoint, type AiCredential, AiCredentialsResource, type AiDiagnosticCheck, type AiDiagnosticStatus, type AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, type AiEnabledProvider, type AiEnrollment, type AiEvolution, AiEvolutionResource, type AiEvolutionSource, type AiExecution, type AiExecutionCitations, type AiExecutionSecurity, AiExecutionsResource, type AiField, AiFilesResource, type AiFlow, type AiFlowGraph, type AiFlowInput, type AiFlowSettings, type AiFlowVersion, type AiFollowupEffect, type AiFollowupEvent, AiFollowupFlowsResource, type AiFollowupPromise, type AiFollowupPromiseDetail, type AiFollowupPromiseStatus, type AiFollowupQueueFilters, type AiFollowupQueuePage, type AiFollowupQueueRow, AiFollowupsResource, type AiGateMode, type AiInference, type AiInferenceOrigin, type AiInferenceOutcome, type AiInferenceSummary, AiInferencesResource, type AiKnowledgeChunk, type AiKnowledgeCitation, type AiKnowledgeConversation, type AiKnowledgeHit, type AiKnowledgeImport, type AiKnowledgePreview, AiKnowledgeResource, type AiKnowledgeSearchDiagnostics, type AiKnowledgeSource, type AiMemory, type AiMemoryEntry, type AiMemoryEntryEvent, AiMemoryResource, type AiModelCatalogSnapshot, type AiModelCatalogSync, type AiNoticeCheck, type AiNoticeEffect, type AiNoticeField, type AiNoticeJob, type AiNoticeSettings, AiNoticesResource, type AiOperation, type AiOperatorMetrics, AiOperatorResource, type AiPage, type AiPlatformSkill, type AiPlatformSkillComposition, type AiPreparedUpload, type AiProposal, AiProposalsResource, type AiProvider, type AiProviderInfo, type AiProviderModel, AiProvidersResource, type AiPurpose, type AiRate, type AiRateInput, type AiRecord, type AiRevision, type AiRouter, type AiRouterConfig, type AiRouterTest, AiRoutersResource, type AiScope, type AiSkill, type AiSkillInput, type AiSkillNearMiss, type AiSkillVersion, AiSkillsResource, type AiSourceKind, type AiStyleAdjustment, type AiStyleAdjustmentId, AiStyleAdjustmentsResource, type AiToolId, type AiTurnPromise, type AiUploadReceiptCallback, AiUploadsResource, AiUsageResource, type AiUsageSummary, type AiUsageTokens, type AiWindow, type ApiLog, type Appointment, type AppointmentAvailability, type AppointmentExceptionInput, type AppointmentFields, type AppointmentHistory, type AppointmentQuery, type AppointmentScheduleInput, type AppointmentServiceInput, type AppointmentStatus, Appointments, type Assignment, type AvailabilityQuery, type Billing, type BillingGuarantee, type BillingPlan, type BlockUserParams, type BlockUserResult, type BlockedUser, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, type BusinessSlot, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type ChannelAccount, type ChannelAccountRef, ChannelAccounts, type CommentAiDeliveryStatus, type CommentRule, type CommentRuleCounters, type CommentRuleMetrics, type CommentRuleMetricsParams, type CommentRuleStatus, type ConnectionBilling, type ConnectionBillingOutcome, type ConnectionBillingRefusal, type Consent, type ConsentChannel, type ConsentOrigin, type ConsentPurpose, type ConsentRequestResult, type ConsentState, type Contact, type ContactConsents, type ContactField, ContactFields, type ContactStage, ContactStages, type ContactWarning, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReadResult, type ConversationReferral, type ConversationReminder, type ConversationTypingResult, type ConversationalAutomation, type ConversationalCommand, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateExportParams, type CreateMessageRuleParams, type CreateOpportunity, type CreateQrCodeParams, type CreateSetupLinkParams, type CreateTemplateParams, type CreateWebhookParams, type CrmActivity, type CrmConversation, type CrmFields, type CrmMetadata, type CrmQuery, type CrmRecord, CrmResource, type CursorList, type CursorPaging, type CursorParams, type Customer, type CustomerBusinessSlot, type DeleteCommentRuleResult, type DeleteMessageRuleResult, type DeletedTemplate, type Demand, type DemandFields, type EnableJourneyModelParams, type EventList, type EventPaging, type ExportDownload, type ExportFormat, type ExportScope, type ExportStatus, type FixedRuleMessage, type HistoryImport, type HistoryImportStatus, type HistoryImportWindowDays, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type InitialConsent, type InstagramCommentAi, type InstagramCommentAiAutomation, type InstagramCommentAiRepliedEvent, type InstagramCommentAiRun, type InstagramConnection, type InstagramGenericElement, type InstagramIceBreaker, type InstagramInteractiveButton, type InstagramInteractiveButtonPayload, type InstagramInteractiveGenericPayload, type InstagramInteractivePayload, type InstagramPersistentMenuItem, type InstagramTokenStatus, type InteractiveButtonPayload, type InteractiveCtaUrlPayload, type InteractiveHeader, type InteractiveListPayload, type InteractivePayload, type Journey, type JourneyCatalogItem, type JourneyCatalogSegment, type JourneyCatalogTrigger, type JourneyConfig, type JourneyEnrollment, type JourneyModelEnableResult, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListChannelAccountsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTeamEventsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, type MessageReplyTo, type MessageRule, type MessageRuleAction, type MessageRuleQrParams, type MessageRuleTrigger, type MessageSort, type MessageSource, type MessageStatus, type MessengerProfile, type MessengerProfileConfig, type MetaCostCategory, type MetaCostDay, type MetaCostEstimate, type MetaCostGroup, type MetaCostReport, type MetaCostSource, type MetaCostSync, type MetaCostUnavailableReason, type MetaCostsParams, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, PLAN_ERROR_CODES, type PhoneNumber, PhoneNumberBlockedUsers, PhoneNumberQrCodes, type QrImageFormat, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type RecordConsentParams, type ReplyConversationParams, type ReplyToParam, type RequestConsentParams, type RequestOptions, SavedReplies, type SavedReply, type SavedReplyInput, type SavedReplyQuery, type ScheduleBroadcastParams, type SendAudioParams, type SendDocumentParams, type SendFailureDetails, type SendImageParams, type SendInteractiveParams, type SendLocationParams, type SendMediaParams, type SendOptions, type SendReactionParams, type SendReactionResult, type SendResult, type SendTemplateParams, type SendTextParams, type SendVideoParams, type SetHistoryImportParams, type SetupLink, type StageColor, type StageRule, type StageRuleInput, type SyncTemplatesParams, type TeamEvent, type TeamEventActor, type TeamEventTarget, type Template, type TemplatePayload, type TemplateSyncResult, type UnblockUserResult, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateConversationalAutomationParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateTemplateParams, type UpdateWebhookParams, type UpdateWhatsAppProfileParams, type UploadMediaParams, type UploadProfilePhotoParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryReplay, type WebhookDeliveryStatus, type WebhookSubscription, type WebhookSubscriptionState, type WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
package/dist/index.js CHANGED
@@ -100,7 +100,12 @@ async function uploadArtifact(client, input) {
100
100
  pdf: "application/pdf",
101
101
  txt: "text/plain",
102
102
  md: "text/markdown",
103
- csv: "text/csv"
103
+ csv: "text/csv",
104
+ jpg: "image/jpeg",
105
+ jpeg: "image/jpeg",
106
+ png: "image/png",
107
+ mp4: "video/mp4",
108
+ mov: "video/quicktime"
104
109
  }[ext] || file.type || "application/octet-stream";
105
110
  const metadata = {
106
111
  customer_id: String(input.customer_id),
@@ -109,7 +114,12 @@ async function uploadArtifact(client, input) {
109
114
  mime_type: mime,
110
115
  byte_size: file.size,
111
116
  sha256,
112
- ...kind === "knowledge" ? { name: String(input.name ?? "") } : {
117
+ ...kind === "file" ? {
118
+ name: String(input.name ?? ""),
119
+ description: String(input.description ?? ""),
120
+ ...input.caption ? { caption: String(input.caption) } : {}
121
+ } : {},
122
+ ...kind === "knowledge" ? { name: String(input.name ?? "") } : kind === "file" ? {} : {
113
123
  ...input.id ? {
114
124
  skill_id: String(input.id),
115
125
  expected_revision: String(input.expected_revision ?? "")
@@ -1884,6 +1894,10 @@ var AI_OPERATIONS = [
1884
1894
  sticky_intent: {
1885
1895
  type: "nullableString",
1886
1896
  optional: true
1897
+ },
1898
+ last_sent_message: {
1899
+ type: "nullableString",
1900
+ optional: true
1887
1901
  }
1888
1902
  }
1889
1903
  },
@@ -2758,14 +2772,14 @@ var AI_OPERATIONS = [
2758
2772
  method: "POST",
2759
2773
  path: "/ai/uploads",
2760
2774
  shape: "item",
2761
- description: "Prepara upload direto. Envie bytes por PUT na URL assinada com os headers retornados, sem Authorization BotoZap. Guarde upload_id para finalizar a mesma importa\xE7\xE3o.",
2775
+ description: "Prepara upload direto. Envie bytes por PUT na URL assinada com os headers retornados, sem Authorization BotoZap. Guarde upload_id para finalizar a mesma importa\xE7\xE3o. kind=file (foto JPG/PNG, v\xEDdeo MP4/MOV ou PDF at\xE9 25 MiB, para o agente mandar na conversa) exige name (at\xE9 80) e description (quando o agente deve mandar, at\xE9 500); caption \xE9 opcional (at\xE9 1.024 caracteres e 1.000 bytes).",
2762
2776
  fields: {
2763
2777
  customer_id: {
2764
2778
  type: "uuid",
2765
2779
  optional: false
2766
2780
  },
2767
2781
  kind: {
2768
- type: "knowledge|skill",
2782
+ type: "knowledge|skill|file",
2769
2783
  optional: false
2770
2784
  },
2771
2785
  file_name: {
@@ -2788,6 +2802,14 @@ var AI_OPERATIONS = [
2788
2802
  type: "string",
2789
2803
  optional: true
2790
2804
  },
2805
+ description: {
2806
+ type: "string",
2807
+ optional: true
2808
+ },
2809
+ caption: {
2810
+ type: "string",
2811
+ optional: true
2812
+ },
2791
2813
  skill_id: {
2792
2814
  type: "uuid",
2793
2815
  optional: true
@@ -3861,6 +3883,99 @@ var AI_OPERATIONS = [
3861
3883
  optional: false
3862
3884
  }
3863
3885
  }
3886
+ },
3887
+ // #1447 arquivos do agente: appended so existing indexes stay stable.
3888
+ {
3889
+ group: "files",
3890
+ name: "list",
3891
+ method: "GET",
3892
+ path: "/ai/files",
3893
+ shape: "item",
3894
+ description: "Biblioteca de fotos, v\xEDdeos e PDFs que o agente pode mandar na conversa, do mais novo ao mais antigo, com status (processing enquanto converte, ready, failed com last_error).",
3895
+ fields: {
3896
+ customer_id: {
3897
+ type: "uuid",
3898
+ optional: false
3899
+ }
3900
+ }
3901
+ },
3902
+ {
3903
+ group: "files",
3904
+ name: "get",
3905
+ method: "GET",
3906
+ path: "/ai/files/:id",
3907
+ shape: "item",
3908
+ description: "Um arquivo da biblioteca, as vers\xF5es de agente que o usam (usages) e um link curto para ver (preview_url, vence em preview_expires_at; n\xE3o guarde nem registre).",
3909
+ fields: {
3910
+ customer_id: {
3911
+ type: "uuid",
3912
+ optional: false
3913
+ },
3914
+ id: {
3915
+ type: "uuid",
3916
+ optional: false
3917
+ }
3918
+ }
3919
+ },
3920
+ {
3921
+ group: "files",
3922
+ name: "update",
3923
+ method: "PATCH",
3924
+ path: "/ai/files/:id",
3925
+ shape: "item",
3926
+ description: "Edita nome, description (quando o agente deve mandar), caption e active (false arquiva) com expected_revision. Vale na hora para os agentes publicados que usam o arquivo. Arquivar o que est\xE1 numa vers\xE3o publicada \xE9 recusado (409 in_use).",
3927
+ fields: {
3928
+ customer_id: {
3929
+ type: "uuid",
3930
+ optional: false
3931
+ },
3932
+ id: {
3933
+ type: "uuid",
3934
+ optional: false
3935
+ },
3936
+ expected_revision: {
3937
+ type: "revision",
3938
+ optional: false
3939
+ },
3940
+ name: {
3941
+ type: "string",
3942
+ optional: true
3943
+ },
3944
+ description: {
3945
+ type: "string",
3946
+ optional: true
3947
+ },
3948
+ caption: {
3949
+ type: "string",
3950
+ optional: true
3951
+ },
3952
+ active: {
3953
+ type: "boolean",
3954
+ optional: true
3955
+ }
3956
+ }
3957
+ },
3958
+ {
3959
+ group: "files",
3960
+ name: "remove",
3961
+ method: "DELETE",
3962
+ path: "/ai/files/:id",
3963
+ shape: "empty",
3964
+ description: "Apaga de vez (pelo OAuth, s\xF3 Administrador). Arquivo numa vers\xE3o publicada de agente \xE9 recusado (409 in_use); as mensagens que j\xE1 o mandaram continuam com a m\xEDdia.",
3965
+ fields: {
3966
+ customer_id: {
3967
+ type: "uuid",
3968
+ optional: false
3969
+ },
3970
+ id: {
3971
+ type: "uuid",
3972
+ optional: false
3973
+ },
3974
+ expected_revision: {
3975
+ type: "revision",
3976
+ optional: false
3977
+ }
3978
+ }
3864
3979
  }
3865
3980
  ];
3866
3981
 
@@ -4657,10 +4772,42 @@ var AiStyleAdjustmentsResource = class {
4657
4772
  return request(this.client, named("styleAdjustments", "save"), input);
4658
4773
  }
4659
4774
  };
4775
+ var AiFilesResource = class {
4776
+ constructor(client) {
4777
+ this.client = client;
4778
+ }
4779
+ client;
4780
+ /** GET /ai/files */
4781
+ list(input) {
4782
+ return request(this.client, named("files", "list"), input);
4783
+ }
4784
+ /** GET /ai/files/:id — com quem usa e o link curto de prévia. */
4785
+ get(input) {
4786
+ return request(this.client, named("files", "get"), input);
4787
+ }
4788
+ /** PATCH /ai/files/:id — vale na hora para os agentes publicados que usam o arquivo. */
4789
+ update(input) {
4790
+ return request(this.client, named("files", "update"), input);
4791
+ }
4792
+ /** DELETE /ai/files/:id — 409 in_use se o arquivo está numa versão publicada. */
4793
+ remove(input) {
4794
+ return request(this.client, named("files", "remove"), input);
4795
+ }
4796
+ /**
4797
+ * Sobe foto (JPG/PNG), vídeo (MP4/MOV) ou PDF de até 25 MiB pelo upload direto (prepare, PUT na URL
4798
+ * assinada, complete). Repetir com os mesmos bytes e dados reaproveita o envio. Vídeo do iPhone e foto
4799
+ * grande voltam `processing` e ficam `ready` depois da conversão.
4800
+ */
4801
+ upload(input) {
4802
+ if (!input.file.size || input.file.size > 25 * 1024 * 1024) throw new Error("Arquivo vazio ou maior que 25 MiB.");
4803
+ return uploadArtifact(this.client, { ...input, kind: "file" });
4804
+ }
4805
+ };
4660
4806
  var Ai = class {
4661
4807
  constructor(client) {
4662
4808
  this.client = client;
4663
4809
  this.uploads = new AiUploadsResource(client);
4810
+ this.files = new AiFilesResource(client);
4664
4811
  this.agents = new AiAgentsResource(client);
4665
4812
  this.credentials = new AiCredentialsResource(client);
4666
4813
  this.providers = new AiProvidersResource(client);
@@ -4685,6 +4832,7 @@ var Ai = class {
4685
4832
  }
4686
4833
  client;
4687
4834
  uploads;
4835
+ files;
4688
4836
  agents;
4689
4837
  credentials;
4690
4838
  providers;
@@ -5207,7 +5355,11 @@ var Messages = class {
5207
5355
  }
5208
5356
  /** Envia mídia por URL pública. */
5209
5357
  async sendMedia(params, options = {}) {
5210
- const media = { link: params.link };
5358
+ const fileId = "file_id" in params ? params.file_id : void 0;
5359
+ if (fileId === void 0 === (params.link === void 0)) {
5360
+ throw new Error("Informe link ou file_id (um dos dois).");
5361
+ }
5362
+ const media = fileId !== void 0 ? { file_id: fileId } : { link: params.link };
5211
5363
  if ("caption" in params && params.caption !== void 0) {
5212
5364
  media.caption = params.caption;
5213
5365
  }
@@ -5775,6 +5927,27 @@ var Conversations = class {
5775
5927
  `/conversations/${enc4(id)}/read`
5776
5928
  );
5777
5929
  }
5930
+ /**
5931
+ * Envios manuais do WhatsApp da conversa que a Meta não confirmou em cerca de 5 minutos, como o
5932
+ * aviso na conversa no painel. Quando a Meta confirma, a mensagem entra no histórico sozinha.
5933
+ * Envios da IA, respostas automáticas, transmissões, réguas e Instagram têm conciliação própria
5934
+ * e não aparecem. Conversa de outra Conta: 404. Scope `conversations:read`.
5935
+ */
5936
+ listPendingSends(id) {
5937
+ return this.client.requestItem("GET", `/conversations/${enc4(id)}/pending-sends`);
5938
+ }
5939
+ /**
5940
+ * Diz se o envio sem confirmação chegou ao contato, como "Saiu" e "Não saiu" no painel:
5941
+ * `sent` põe a mensagem no histórico (sem o id da Meta); `not_sent` libera para enviar de novo.
5942
+ * Nada é reenviado. Envio já resolvido: 409 `send_not_pending`. Scope `messages:send`.
5943
+ */
5944
+ markPendingSend(id, sendId, outcome) {
5945
+ return this.client.requestItem(
5946
+ "POST",
5947
+ `/conversations/${enc4(id)}/pending-sends/${enc4(sendId)}`,
5948
+ { body: { outcome } }
5949
+ );
5950
+ }
5778
5951
  /**
5779
5952
  * Exclui a conversa, com efeito imediato e sem volta: mensagens, notas,
5780
5953
  * atribuições, vínculos com oportunidades e demandas e o que a IA guardou
@@ -6113,8 +6286,11 @@ var PhoneNumbers = class {
6113
6286
  /**
6114
6287
  * Inscreve o BotoZap de novo para receber as mensagens do número, com a
6115
6288
  * autorização já guardada, sem refazer a conexão. Resolve a prontidão
6116
- * `webhooks_lost`; autorização recusada pela Meta responde 409
6117
- * `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
6289
+ * `webhooks_lost` quando o app saiu da conta do WhatsApp. Se a conta mudou de
6290
+ * portfólio na Meta, devolve `missing`, e autorização recusada pela Meta
6291
+ * responde 409 `reconnect_required`: nos dois casos, só o link de setup
6292
+ * resolve. `unknown` = a Meta não confirmou agora; confira com `health` em
6293
+ * instantes. Scope `numbers:write`.
6118
6294
  */
6119
6295
  resubscribeWebhooks(id) {
6120
6296
  return this.client.requestItem("POST", `/phone_numbers/${enc6(id)}/webhook-subscription`);
@@ -6849,6 +7025,7 @@ export {
6849
7025
  AiEligibilityResource,
6850
7026
  AiEvolutionResource,
6851
7027
  AiExecutionsResource,
7028
+ AiFilesResource,
6852
7029
  AiFollowupFlowsResource,
6853
7030
  AiFollowupsResource,
6854
7031
  AiInferencesResource,