@botozap/sdk 0.25.0 → 0.28.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/CHANGELOG.md +26 -0
- package/README.md +2 -1
- package/dist/index.cjs +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -276,10 +276,11 @@ type ConsentState = "granted" | "revoked";
|
|
|
276
276
|
* saída), `conversation_button` (botão do pedido de consentimento na conversa),
|
|
277
277
|
* `contact_keyword` (o próprio contato mandou uma Palavra de volta cadastrada
|
|
278
278
|
* pelo Cliente), `template_button` (o contato tocou num botão de saída marcado
|
|
279
|
-
* no template)
|
|
280
|
-
*
|
|
279
|
+
* no template), `meta_opt_out` (a Meta informou a recusa, erro 131050) e
|
|
280
|
+
* `owner_declaration` (aceite gravado no envio de um follow-up de Marketing com a
|
|
281
|
+
* declaração do dono). Valores novos podem surgir.
|
|
281
282
|
*/
|
|
282
|
-
type ConsentOrigin = "manual" | "import" | "api" | "keyword" | "conversation_button" | "contact_keyword" | "template_button" | "meta_opt_out" | (string & {});
|
|
283
|
+
type ConsentOrigin = "manual" | "import" | "api" | "keyword" | "conversation_button" | "contact_keyword" | "template_button" | "meta_opt_out" | "owner_declaration" | (string & {});
|
|
283
284
|
/** Um registro de Consentimento do Contato (por canal e finalidade). */
|
|
284
285
|
interface Consent {
|
|
285
286
|
id: string;
|
|
@@ -1097,6 +1098,12 @@ type AiFlowSettings = {
|
|
|
1097
1098
|
send_days: number[];
|
|
1098
1099
|
timezone: string;
|
|
1099
1100
|
purpose: "utility" | "marketing";
|
|
1101
|
+
/**
|
|
1102
|
+
* Só em `marketing`. `declared`: quem publica (pessoa ou chave) declara que os contatos do
|
|
1103
|
+
* fluxo autorizaram marketing; no envio, contato sem registro ganha `granted` com origem
|
|
1104
|
+
* `owner_declaration`. `revoked` sempre bloqueia. Omitido ou `required`: só quem autorizou.
|
|
1105
|
+
*/
|
|
1106
|
+
marketing_consent?: "required" | "declared";
|
|
1100
1107
|
environment: "live" | "sandbox";
|
|
1101
1108
|
/** Agent responsible for automatic triggers when several enable the flow; omitted = the only eligible one. */
|
|
1102
1109
|
trigger_agent_id?: string | null;
|
|
@@ -4418,6 +4425,23 @@ interface CreateTemplateParams {
|
|
|
4418
4425
|
opt_out_buttons?: string[];
|
|
4419
4426
|
}
|
|
4420
4427
|
/** Corpo de `PATCH /v1/templates/:id`. */
|
|
4428
|
+
interface SyncTemplatesParams {
|
|
4429
|
+
/** Só as conexões deste Cliente; sem ele, todas as conexões ativas da conta. */
|
|
4430
|
+
customer_id?: string;
|
|
4431
|
+
}
|
|
4432
|
+
/** Resultado de `templates.sync()`. */
|
|
4433
|
+
interface TemplateSyncResult {
|
|
4434
|
+
/** Conexões ativas do WhatsApp conferidas. */
|
|
4435
|
+
connections: number;
|
|
4436
|
+
/** Templates que a Meta tem e foram gravados aqui. */
|
|
4437
|
+
synced: number;
|
|
4438
|
+
/** Templates tirados daqui porque foram excluídos na Meta. */
|
|
4439
|
+
removed: number;
|
|
4440
|
+
/** Conexões sem autorização guardada, puladas (reconecte o número). */
|
|
4441
|
+
skipped_without_token: number;
|
|
4442
|
+
/** Uma régua de modelo não acompanhou a mudança de status: sincronize de novo. */
|
|
4443
|
+
automations_outdated: boolean;
|
|
4444
|
+
}
|
|
4421
4445
|
interface UpdateTemplateParams {
|
|
4422
4446
|
/**
|
|
4423
4447
|
* Textos dos botões de resposta rápida que são de saída; `[]` limpa a marcação.
|
|
@@ -4442,6 +4466,14 @@ declare class Templates {
|
|
|
4442
4466
|
* Scope `templates:write`.
|
|
4443
4467
|
*/
|
|
4444
4468
|
update(id: string, params: UpdateTemplateParams): Promise<Template>;
|
|
4469
|
+
/**
|
|
4470
|
+
* O Sincronizar da tela de Templates: traz da Meta status, categoria,
|
|
4471
|
+
* conteúdo e `rejection_reason` dos templates das conexões ativas (ou de um
|
|
4472
|
+
* Cliente), importa os criados no WhatsApp Manager e tira daqui os excluídos
|
|
4473
|
+
* lá. Use quando um status parecer parado. Autorização recusada pela Meta
|
|
4474
|
+
* responde 409 `reconnect_required`. Scope `templates:write`.
|
|
4475
|
+
*/
|
|
4476
|
+
sync(params?: SyncTemplatesParams): Promise<TemplateSyncResult>;
|
|
4445
4477
|
}
|
|
4446
4478
|
|
|
4447
4479
|
interface ListBroadcastsParams extends OffsetParams {
|
|
@@ -4990,6 +5022,16 @@ interface UnblockUserResult {
|
|
|
4990
5022
|
* (`skipped` quando a escolha foi 0 dias).
|
|
4991
5023
|
*/
|
|
4992
5024
|
type HistoryImportStatus = "awaiting_choice" | "queued" | "requested" | "declined" | "failed" | "expired" | "unconfirmed" | "skipped";
|
|
5025
|
+
/**
|
|
5026
|
+
* Inscrição do BotoZap para receber as mensagens do número na Meta:
|
|
5027
|
+
* `subscribed` (recebe), `missing` (a Meta parou de mandar) ou `unknown`
|
|
5028
|
+
* (a Meta não respondeu).
|
|
5029
|
+
*/
|
|
5030
|
+
type WebhookSubscriptionState = "subscribed" | "missing" | "unknown";
|
|
5031
|
+
/** Resultado de `resubscribeWebhooks`. */
|
|
5032
|
+
interface WebhookSubscription {
|
|
5033
|
+
webhook_subscription: WebhookSubscriptionState;
|
|
5034
|
+
}
|
|
4993
5035
|
/** Janela de conversas antigas a importar, em dias (0 = não importar). */
|
|
4994
5036
|
type HistoryImportWindowDays = 0 | 30 | 180;
|
|
4995
5037
|
/** Importação das conversas antigas do número (`GET|PUT …/history-import`). */
|
|
@@ -5154,8 +5196,19 @@ declare class PhoneNumbers {
|
|
|
5154
5196
|
* o último mês vale 20 h depois da conexão. Scope `numbers:write`.
|
|
5155
5197
|
*/
|
|
5156
5198
|
setHistoryImport(id: string, params: SetHistoryImportParams): Promise<HistoryImport>;
|
|
5157
|
-
/**
|
|
5199
|
+
/**
|
|
5200
|
+
* Prontidão do número. Com a conexão ativa, confere ao vivo o token
|
|
5201
|
+
* (`checks.token_validity`) e se a Meta manda as mensagens para o BotoZap
|
|
5202
|
+
* (`checks.webhook_subscription`).
|
|
5203
|
+
*/
|
|
5158
5204
|
health(id: string): Promise<Record<string, unknown>>;
|
|
5205
|
+
/**
|
|
5206
|
+
* Inscreve o BotoZap de novo para receber as mensagens do número, com a
|
|
5207
|
+
* autorização já guardada, sem refazer a conexão. Resolve a prontidão
|
|
5208
|
+
* `webhooks_lost`; autorização recusada pela Meta responde 409
|
|
5209
|
+
* `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
|
|
5210
|
+
*/
|
|
5211
|
+
resubscribeWebhooks(id: string): Promise<WebhookSubscription>;
|
|
5159
5212
|
}
|
|
5160
5213
|
|
|
5161
5214
|
/**
|
|
@@ -6326,4 +6379,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6326
6379
|
*/
|
|
6327
6380
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6328
6381
|
|
|
6329
|
-
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 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 TeamEvent, type TeamEventActor, type TeamEventTarget, type Template, type TemplatePayload, 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 WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
|
|
6382
|
+
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 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.d.ts
CHANGED
|
@@ -276,10 +276,11 @@ type ConsentState = "granted" | "revoked";
|
|
|
276
276
|
* saída), `conversation_button` (botão do pedido de consentimento na conversa),
|
|
277
277
|
* `contact_keyword` (o próprio contato mandou uma Palavra de volta cadastrada
|
|
278
278
|
* pelo Cliente), `template_button` (o contato tocou num botão de saída marcado
|
|
279
|
-
* no template)
|
|
280
|
-
*
|
|
279
|
+
* no template), `meta_opt_out` (a Meta informou a recusa, erro 131050) e
|
|
280
|
+
* `owner_declaration` (aceite gravado no envio de um follow-up de Marketing com a
|
|
281
|
+
* declaração do dono). Valores novos podem surgir.
|
|
281
282
|
*/
|
|
282
|
-
type ConsentOrigin = "manual" | "import" | "api" | "keyword" | "conversation_button" | "contact_keyword" | "template_button" | "meta_opt_out" | (string & {});
|
|
283
|
+
type ConsentOrigin = "manual" | "import" | "api" | "keyword" | "conversation_button" | "contact_keyword" | "template_button" | "meta_opt_out" | "owner_declaration" | (string & {});
|
|
283
284
|
/** Um registro de Consentimento do Contato (por canal e finalidade). */
|
|
284
285
|
interface Consent {
|
|
285
286
|
id: string;
|
|
@@ -1097,6 +1098,12 @@ type AiFlowSettings = {
|
|
|
1097
1098
|
send_days: number[];
|
|
1098
1099
|
timezone: string;
|
|
1099
1100
|
purpose: "utility" | "marketing";
|
|
1101
|
+
/**
|
|
1102
|
+
* Só em `marketing`. `declared`: quem publica (pessoa ou chave) declara que os contatos do
|
|
1103
|
+
* fluxo autorizaram marketing; no envio, contato sem registro ganha `granted` com origem
|
|
1104
|
+
* `owner_declaration`. `revoked` sempre bloqueia. Omitido ou `required`: só quem autorizou.
|
|
1105
|
+
*/
|
|
1106
|
+
marketing_consent?: "required" | "declared";
|
|
1100
1107
|
environment: "live" | "sandbox";
|
|
1101
1108
|
/** Agent responsible for automatic triggers when several enable the flow; omitted = the only eligible one. */
|
|
1102
1109
|
trigger_agent_id?: string | null;
|
|
@@ -4418,6 +4425,23 @@ interface CreateTemplateParams {
|
|
|
4418
4425
|
opt_out_buttons?: string[];
|
|
4419
4426
|
}
|
|
4420
4427
|
/** Corpo de `PATCH /v1/templates/:id`. */
|
|
4428
|
+
interface SyncTemplatesParams {
|
|
4429
|
+
/** Só as conexões deste Cliente; sem ele, todas as conexões ativas da conta. */
|
|
4430
|
+
customer_id?: string;
|
|
4431
|
+
}
|
|
4432
|
+
/** Resultado de `templates.sync()`. */
|
|
4433
|
+
interface TemplateSyncResult {
|
|
4434
|
+
/** Conexões ativas do WhatsApp conferidas. */
|
|
4435
|
+
connections: number;
|
|
4436
|
+
/** Templates que a Meta tem e foram gravados aqui. */
|
|
4437
|
+
synced: number;
|
|
4438
|
+
/** Templates tirados daqui porque foram excluídos na Meta. */
|
|
4439
|
+
removed: number;
|
|
4440
|
+
/** Conexões sem autorização guardada, puladas (reconecte o número). */
|
|
4441
|
+
skipped_without_token: number;
|
|
4442
|
+
/** Uma régua de modelo não acompanhou a mudança de status: sincronize de novo. */
|
|
4443
|
+
automations_outdated: boolean;
|
|
4444
|
+
}
|
|
4421
4445
|
interface UpdateTemplateParams {
|
|
4422
4446
|
/**
|
|
4423
4447
|
* Textos dos botões de resposta rápida que são de saída; `[]` limpa a marcação.
|
|
@@ -4442,6 +4466,14 @@ declare class Templates {
|
|
|
4442
4466
|
* Scope `templates:write`.
|
|
4443
4467
|
*/
|
|
4444
4468
|
update(id: string, params: UpdateTemplateParams): Promise<Template>;
|
|
4469
|
+
/**
|
|
4470
|
+
* O Sincronizar da tela de Templates: traz da Meta status, categoria,
|
|
4471
|
+
* conteúdo e `rejection_reason` dos templates das conexões ativas (ou de um
|
|
4472
|
+
* Cliente), importa os criados no WhatsApp Manager e tira daqui os excluídos
|
|
4473
|
+
* lá. Use quando um status parecer parado. Autorização recusada pela Meta
|
|
4474
|
+
* responde 409 `reconnect_required`. Scope `templates:write`.
|
|
4475
|
+
*/
|
|
4476
|
+
sync(params?: SyncTemplatesParams): Promise<TemplateSyncResult>;
|
|
4445
4477
|
}
|
|
4446
4478
|
|
|
4447
4479
|
interface ListBroadcastsParams extends OffsetParams {
|
|
@@ -4990,6 +5022,16 @@ interface UnblockUserResult {
|
|
|
4990
5022
|
* (`skipped` quando a escolha foi 0 dias).
|
|
4991
5023
|
*/
|
|
4992
5024
|
type HistoryImportStatus = "awaiting_choice" | "queued" | "requested" | "declined" | "failed" | "expired" | "unconfirmed" | "skipped";
|
|
5025
|
+
/**
|
|
5026
|
+
* Inscrição do BotoZap para receber as mensagens do número na Meta:
|
|
5027
|
+
* `subscribed` (recebe), `missing` (a Meta parou de mandar) ou `unknown`
|
|
5028
|
+
* (a Meta não respondeu).
|
|
5029
|
+
*/
|
|
5030
|
+
type WebhookSubscriptionState = "subscribed" | "missing" | "unknown";
|
|
5031
|
+
/** Resultado de `resubscribeWebhooks`. */
|
|
5032
|
+
interface WebhookSubscription {
|
|
5033
|
+
webhook_subscription: WebhookSubscriptionState;
|
|
5034
|
+
}
|
|
4993
5035
|
/** Janela de conversas antigas a importar, em dias (0 = não importar). */
|
|
4994
5036
|
type HistoryImportWindowDays = 0 | 30 | 180;
|
|
4995
5037
|
/** Importação das conversas antigas do número (`GET|PUT …/history-import`). */
|
|
@@ -5154,8 +5196,19 @@ declare class PhoneNumbers {
|
|
|
5154
5196
|
* o último mês vale 20 h depois da conexão. Scope `numbers:write`.
|
|
5155
5197
|
*/
|
|
5156
5198
|
setHistoryImport(id: string, params: SetHistoryImportParams): Promise<HistoryImport>;
|
|
5157
|
-
/**
|
|
5199
|
+
/**
|
|
5200
|
+
* Prontidão do número. Com a conexão ativa, confere ao vivo o token
|
|
5201
|
+
* (`checks.token_validity`) e se a Meta manda as mensagens para o BotoZap
|
|
5202
|
+
* (`checks.webhook_subscription`).
|
|
5203
|
+
*/
|
|
5158
5204
|
health(id: string): Promise<Record<string, unknown>>;
|
|
5205
|
+
/**
|
|
5206
|
+
* Inscreve o BotoZap de novo para receber as mensagens do número, com a
|
|
5207
|
+
* autorização já guardada, sem refazer a conexão. Resolve a prontidão
|
|
5208
|
+
* `webhooks_lost`; autorização recusada pela Meta responde 409
|
|
5209
|
+
* `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
|
|
5210
|
+
*/
|
|
5211
|
+
resubscribeWebhooks(id: string): Promise<WebhookSubscription>;
|
|
5159
5212
|
}
|
|
5160
5213
|
|
|
5161
5214
|
/**
|
|
@@ -6326,4 +6379,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6326
6379
|
*/
|
|
6327
6380
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6328
6381
|
|
|
6329
|
-
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 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 TeamEvent, type TeamEventActor, type TeamEventTarget, type Template, type TemplatePayload, 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 WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
|
|
6382
|
+
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 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
|
@@ -5444,6 +5444,16 @@ var Templates = class {
|
|
|
5444
5444
|
{ body: params }
|
|
5445
5445
|
);
|
|
5446
5446
|
}
|
|
5447
|
+
/**
|
|
5448
|
+
* O Sincronizar da tela de Templates: traz da Meta status, categoria,
|
|
5449
|
+
* conteúdo e `rejection_reason` dos templates das conexões ativas (ou de um
|
|
5450
|
+
* Cliente), importa os criados no WhatsApp Manager e tira daqui os excluídos
|
|
5451
|
+
* lá. Use quando um status parecer parado. Autorização recusada pela Meta
|
|
5452
|
+
* responde 409 `reconnect_required`. Scope `templates:write`.
|
|
5453
|
+
*/
|
|
5454
|
+
sync(params = {}) {
|
|
5455
|
+
return this.client.requestItem("POST", "/templates/sync", { body: params });
|
|
5456
|
+
}
|
|
5447
5457
|
};
|
|
5448
5458
|
|
|
5449
5459
|
// src/resources/broadcasts.ts
|
|
@@ -6080,13 +6090,26 @@ var PhoneNumbers = class {
|
|
|
6080
6090
|
body: { window_days: params.window_days }
|
|
6081
6091
|
});
|
|
6082
6092
|
}
|
|
6083
|
-
/**
|
|
6093
|
+
/**
|
|
6094
|
+
* Prontidão do número. Com a conexão ativa, confere ao vivo o token
|
|
6095
|
+
* (`checks.token_validity`) e se a Meta manda as mensagens para o BotoZap
|
|
6096
|
+
* (`checks.webhook_subscription`).
|
|
6097
|
+
*/
|
|
6084
6098
|
health(id) {
|
|
6085
6099
|
return this.client.requestItem(
|
|
6086
6100
|
"GET",
|
|
6087
6101
|
`/phone_numbers/${enc6(id)}/health`
|
|
6088
6102
|
);
|
|
6089
6103
|
}
|
|
6104
|
+
/**
|
|
6105
|
+
* Inscreve o BotoZap de novo para receber as mensagens do número, com a
|
|
6106
|
+
* autorização já guardada, sem refazer a conexão. Resolve a prontidão
|
|
6107
|
+
* `webhooks_lost`; autorização recusada pela Meta responde 409
|
|
6108
|
+
* `reconnect_required` (aí só o link de setup resolve). Scope `numbers:write`.
|
|
6109
|
+
*/
|
|
6110
|
+
resubscribeWebhooks(id) {
|
|
6111
|
+
return this.client.requestItem("POST", `/phone_numbers/${enc6(id)}/webhook-subscription`);
|
|
6112
|
+
}
|
|
6090
6113
|
};
|
|
6091
6114
|
function enc6(id) {
|
|
6092
6115
|
return encodeURIComponent(id);
|