@botozap/sdk 0.24.0 → 0.26.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 +35 -0
- package/README.md +32 -3
- package/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -6
- package/dist/index.d.ts +44 -6
- package/dist/index.js +18 -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;
|
|
@@ -6051,11 +6058,29 @@ interface ListWebhookDeliveriesParams extends CursorParams {
|
|
|
6051
6058
|
/** Canal da entrega (`channel_account_id`); `"none"` = sem canal (teste, eventos da WABA). */
|
|
6052
6059
|
channel_account_id?: string;
|
|
6053
6060
|
}
|
|
6054
|
-
/**
|
|
6061
|
+
/** Resultado de `webhookDeliveries.replay`: a entrega voltou para a fila. */
|
|
6062
|
+
interface WebhookDeliveryReplay {
|
|
6063
|
+
id: string;
|
|
6064
|
+
status: "pending";
|
|
6065
|
+
replayed: true;
|
|
6066
|
+
}
|
|
6067
|
+
/**
|
|
6068
|
+
* Histórico de Entregas de webhook e reenvio das esgotadas. Única escrita deste
|
|
6069
|
+
* arquivo; `users` e `apiLogs` seguem só leitura.
|
|
6070
|
+
*/
|
|
6055
6071
|
declare class WebhookDeliveries {
|
|
6056
6072
|
private readonly client;
|
|
6057
6073
|
constructor(client: BotoZap);
|
|
6058
6074
|
list(params?: ListWebhookDeliveriesParams): Promise<CursorList<WebhookDelivery>>;
|
|
6075
|
+
/**
|
|
6076
|
+
* Reenvia uma entrega esgotada (`exhausted`) ou cortada pelo limite de repasse
|
|
6077
|
+
* (`limited`): ela volta para a fila e o evento sai de novo com a mesma
|
|
6078
|
+
* `X-Idempotency-Key`, como o botão Reenviar do painel. Repetir não duplica: a
|
|
6079
|
+
* entrega já na fila responde 409 `delivery_not_replayable`. Outras recusas:
|
|
6080
|
+
* 404 `not_found`, 409 `forward_limit_reached` (limite de repasse do mês
|
|
6081
|
+
* acabou) e 429 `replay_rate_limited`. Exige o escopo `webhooks:write`.
|
|
6082
|
+
*/
|
|
6083
|
+
replay(id: string): Promise<WebhookDeliveryReplay>;
|
|
6059
6084
|
}
|
|
6060
6085
|
|
|
6061
6086
|
/** Identidade e permissões efetivas da credencial autenticada. */
|
|
@@ -6184,12 +6209,19 @@ declare class BotoZap {
|
|
|
6184
6209
|
type SendFailureDetails = {
|
|
6185
6210
|
outcome?: "rejected" | "accepted" | "unknown";
|
|
6186
6211
|
retry?: "backoff" | "after_correction" | "reconcile_first" | "unknown";
|
|
6212
|
+
/**
|
|
6213
|
+
* Código numérico da Meta quando ela recusou o envio (`error.meta_code`, ex.:
|
|
6214
|
+
* 131026), em `messages.send` e afins e em `conversations.requestConsent`.
|
|
6215
|
+
* Só vem quando a Meta informou um código inteiro.
|
|
6216
|
+
*/
|
|
6217
|
+
metaCode?: number;
|
|
6187
6218
|
};
|
|
6188
6219
|
declare class BotoZapError extends Error {
|
|
6189
6220
|
readonly code: string;
|
|
6190
6221
|
readonly status: number;
|
|
6191
6222
|
readonly outcome?: SendFailureDetails["outcome"];
|
|
6192
6223
|
readonly retry?: SendFailureDetails["retry"];
|
|
6224
|
+
readonly metaCode?: SendFailureDetails["metaCode"];
|
|
6193
6225
|
/** Headers da resposta HTTP. Ausente em erros sem resposta (status 0). */
|
|
6194
6226
|
readonly headers?: Record<string, string>;
|
|
6195
6227
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>, details?: SendFailureDetails);
|
|
@@ -6243,8 +6275,14 @@ declare class BotoZapError extends Error {
|
|
|
6243
6275
|
* (`phoneNumbers.getHistoryImport`/`setHistoryImport`):
|
|
6244
6276
|
* `history_import_not_available` (404, número sem importação),
|
|
6245
6277
|
* `history_import_locked` (409, a escolha já foi feita ou o prazo acabou).
|
|
6278
|
+
* Recusa da Meta no envio e no pedido de consentimento: `meta_error`, com o
|
|
6279
|
+
* código da Meta em {@link BotoZapError.metaCode} quando houver. Reenvio de
|
|
6280
|
+
* entrega (`webhookDeliveries.replay`): `delivery_not_replayable` (409, a
|
|
6281
|
+
* entrega não está `exhausted` nem `limited`), `forward_limit_reached` (409,
|
|
6282
|
+
* entrega `limited` e o limite de repasse do mês acabou),
|
|
6283
|
+
* `replay_rate_limited` (429, muitos reenvios seguidos).
|
|
6246
6284
|
*/
|
|
6247
|
-
type BotoZapErrorCode = "invalid_request" | "unsupported_type" | "invalid_reaction" | "missing_reaction_target" | "reaction_target_not_found" | "reaction_target_invalid" | "reaction_target_expired" | "free_form_limit_reached" | "quota_exceeded" | "plan_restricted" | "free_number_cap" | "free_cap" | "feature_unavailable" | "provider_not_enabled" | "consent_opted_out" | "consent_revoked" | "outside_window" | "window_closed" | "channel_not_supported" | "not_connected" | "ip_not_allowed" | "admin_required" | "gone" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | "no_inbound_message" | "meta_error" | "sandbox_not_supported" | "connection_inactive" | "reconnect_required" | "coexistence_not_supported" | "meta_rate_limited" | "meta_permission_denied" | "meta_invalid_parameter" | "meta_unavailable" | "meta_unconfirmed" | "saved_unread" | "invalid_picture" | "block_window_closed" | "cannot_block_self" | "blocklist_full" | "contact_other_number" | "reply_target_not_found" | "reply_target_unavailable" | "invalid_voice" | "unsupported_voice" | "history_import_not_available" | "history_import_locked" | (string & {});
|
|
6285
|
+
type BotoZapErrorCode = "invalid_request" | "unsupported_type" | "invalid_reaction" | "missing_reaction_target" | "reaction_target_not_found" | "reaction_target_invalid" | "reaction_target_expired" | "free_form_limit_reached" | "quota_exceeded" | "plan_restricted" | "free_number_cap" | "free_cap" | "feature_unavailable" | "provider_not_enabled" | "consent_opted_out" | "consent_revoked" | "outside_window" | "window_closed" | "channel_not_supported" | "not_connected" | "ip_not_allowed" | "admin_required" | "gone" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | "no_inbound_message" | "meta_error" | "sandbox_not_supported" | "connection_inactive" | "reconnect_required" | "coexistence_not_supported" | "meta_rate_limited" | "meta_permission_denied" | "meta_invalid_parameter" | "meta_unavailable" | "meta_unconfirmed" | "saved_unread" | "invalid_picture" | "block_window_closed" | "cannot_block_self" | "blocklist_full" | "contact_other_number" | "reply_target_not_found" | "reply_target_unavailable" | "invalid_voice" | "unsupported_voice" | "history_import_not_available" | "history_import_locked" | "delivery_not_replayable" | "forward_limit_reached" | "replay_rate_limited" | (string & {});
|
|
6248
6286
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
6249
6287
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
6250
6288
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
@@ -6295,4 +6333,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6295
6333
|
*/
|
|
6296
6334
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6297
6335
|
|
|
6298
|
-
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 WebhookDeliveryStatus, type WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
|
|
6336
|
+
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 };
|
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;
|
|
@@ -6051,11 +6058,29 @@ interface ListWebhookDeliveriesParams extends CursorParams {
|
|
|
6051
6058
|
/** Canal da entrega (`channel_account_id`); `"none"` = sem canal (teste, eventos da WABA). */
|
|
6052
6059
|
channel_account_id?: string;
|
|
6053
6060
|
}
|
|
6054
|
-
/**
|
|
6061
|
+
/** Resultado de `webhookDeliveries.replay`: a entrega voltou para a fila. */
|
|
6062
|
+
interface WebhookDeliveryReplay {
|
|
6063
|
+
id: string;
|
|
6064
|
+
status: "pending";
|
|
6065
|
+
replayed: true;
|
|
6066
|
+
}
|
|
6067
|
+
/**
|
|
6068
|
+
* Histórico de Entregas de webhook e reenvio das esgotadas. Única escrita deste
|
|
6069
|
+
* arquivo; `users` e `apiLogs` seguem só leitura.
|
|
6070
|
+
*/
|
|
6055
6071
|
declare class WebhookDeliveries {
|
|
6056
6072
|
private readonly client;
|
|
6057
6073
|
constructor(client: BotoZap);
|
|
6058
6074
|
list(params?: ListWebhookDeliveriesParams): Promise<CursorList<WebhookDelivery>>;
|
|
6075
|
+
/**
|
|
6076
|
+
* Reenvia uma entrega esgotada (`exhausted`) ou cortada pelo limite de repasse
|
|
6077
|
+
* (`limited`): ela volta para a fila e o evento sai de novo com a mesma
|
|
6078
|
+
* `X-Idempotency-Key`, como o botão Reenviar do painel. Repetir não duplica: a
|
|
6079
|
+
* entrega já na fila responde 409 `delivery_not_replayable`. Outras recusas:
|
|
6080
|
+
* 404 `not_found`, 409 `forward_limit_reached` (limite de repasse do mês
|
|
6081
|
+
* acabou) e 429 `replay_rate_limited`. Exige o escopo `webhooks:write`.
|
|
6082
|
+
*/
|
|
6083
|
+
replay(id: string): Promise<WebhookDeliveryReplay>;
|
|
6059
6084
|
}
|
|
6060
6085
|
|
|
6061
6086
|
/** Identidade e permissões efetivas da credencial autenticada. */
|
|
@@ -6184,12 +6209,19 @@ declare class BotoZap {
|
|
|
6184
6209
|
type SendFailureDetails = {
|
|
6185
6210
|
outcome?: "rejected" | "accepted" | "unknown";
|
|
6186
6211
|
retry?: "backoff" | "after_correction" | "reconcile_first" | "unknown";
|
|
6212
|
+
/**
|
|
6213
|
+
* Código numérico da Meta quando ela recusou o envio (`error.meta_code`, ex.:
|
|
6214
|
+
* 131026), em `messages.send` e afins e em `conversations.requestConsent`.
|
|
6215
|
+
* Só vem quando a Meta informou um código inteiro.
|
|
6216
|
+
*/
|
|
6217
|
+
metaCode?: number;
|
|
6187
6218
|
};
|
|
6188
6219
|
declare class BotoZapError extends Error {
|
|
6189
6220
|
readonly code: string;
|
|
6190
6221
|
readonly status: number;
|
|
6191
6222
|
readonly outcome?: SendFailureDetails["outcome"];
|
|
6192
6223
|
readonly retry?: SendFailureDetails["retry"];
|
|
6224
|
+
readonly metaCode?: SendFailureDetails["metaCode"];
|
|
6193
6225
|
/** Headers da resposta HTTP. Ausente em erros sem resposta (status 0). */
|
|
6194
6226
|
readonly headers?: Record<string, string>;
|
|
6195
6227
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>, details?: SendFailureDetails);
|
|
@@ -6243,8 +6275,14 @@ declare class BotoZapError extends Error {
|
|
|
6243
6275
|
* (`phoneNumbers.getHistoryImport`/`setHistoryImport`):
|
|
6244
6276
|
* `history_import_not_available` (404, número sem importação),
|
|
6245
6277
|
* `history_import_locked` (409, a escolha já foi feita ou o prazo acabou).
|
|
6278
|
+
* Recusa da Meta no envio e no pedido de consentimento: `meta_error`, com o
|
|
6279
|
+
* código da Meta em {@link BotoZapError.metaCode} quando houver. Reenvio de
|
|
6280
|
+
* entrega (`webhookDeliveries.replay`): `delivery_not_replayable` (409, a
|
|
6281
|
+
* entrega não está `exhausted` nem `limited`), `forward_limit_reached` (409,
|
|
6282
|
+
* entrega `limited` e o limite de repasse do mês acabou),
|
|
6283
|
+
* `replay_rate_limited` (429, muitos reenvios seguidos).
|
|
6246
6284
|
*/
|
|
6247
|
-
type BotoZapErrorCode = "invalid_request" | "unsupported_type" | "invalid_reaction" | "missing_reaction_target" | "reaction_target_not_found" | "reaction_target_invalid" | "reaction_target_expired" | "free_form_limit_reached" | "quota_exceeded" | "plan_restricted" | "free_number_cap" | "free_cap" | "feature_unavailable" | "provider_not_enabled" | "consent_opted_out" | "consent_revoked" | "outside_window" | "window_closed" | "channel_not_supported" | "not_connected" | "ip_not_allowed" | "admin_required" | "gone" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | "no_inbound_message" | "meta_error" | "sandbox_not_supported" | "connection_inactive" | "reconnect_required" | "coexistence_not_supported" | "meta_rate_limited" | "meta_permission_denied" | "meta_invalid_parameter" | "meta_unavailable" | "meta_unconfirmed" | "saved_unread" | "invalid_picture" | "block_window_closed" | "cannot_block_self" | "blocklist_full" | "contact_other_number" | "reply_target_not_found" | "reply_target_unavailable" | "invalid_voice" | "unsupported_voice" | "history_import_not_available" | "history_import_locked" | (string & {});
|
|
6285
|
+
type BotoZapErrorCode = "invalid_request" | "unsupported_type" | "invalid_reaction" | "missing_reaction_target" | "reaction_target_not_found" | "reaction_target_invalid" | "reaction_target_expired" | "free_form_limit_reached" | "quota_exceeded" | "plan_restricted" | "free_number_cap" | "free_cap" | "feature_unavailable" | "provider_not_enabled" | "consent_opted_out" | "consent_revoked" | "outside_window" | "window_closed" | "channel_not_supported" | "not_connected" | "ip_not_allowed" | "admin_required" | "gone" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | "no_inbound_message" | "meta_error" | "sandbox_not_supported" | "connection_inactive" | "reconnect_required" | "coexistence_not_supported" | "meta_rate_limited" | "meta_permission_denied" | "meta_invalid_parameter" | "meta_unavailable" | "meta_unconfirmed" | "saved_unread" | "invalid_picture" | "block_window_closed" | "cannot_block_self" | "blocklist_full" | "contact_other_number" | "reply_target_not_found" | "reply_target_unavailable" | "invalid_voice" | "unsupported_voice" | "history_import_not_available" | "history_import_locked" | "delivery_not_replayable" | "forward_limit_reached" | "replay_rate_limited" | (string & {});
|
|
6248
6286
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
6249
6287
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
6250
6288
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
@@ -6295,4 +6333,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6295
6333
|
*/
|
|
6296
6334
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6297
6335
|
|
|
6298
|
-
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 WebhookDeliveryStatus, type WhatsAppBusinessProfile, type WhatsAppBusinessVertical, type WhatsAppQrCode, isBusinessPaymentRequired, isConsentOptedOut, isConsentRevoked, isFreeCap, isFreeNumberCap, isNotConnected, isPlanError };
|
|
6336
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ var BotoZapError = class extends Error {
|
|
|
41
41
|
status;
|
|
42
42
|
outcome;
|
|
43
43
|
retry;
|
|
44
|
+
metaCode;
|
|
44
45
|
/** Headers da resposta HTTP. Ausente em erros sem resposta (status 0). */
|
|
45
46
|
headers;
|
|
46
47
|
constructor(code, message, status, headers, details) {
|
|
@@ -51,6 +52,7 @@ var BotoZapError = class extends Error {
|
|
|
51
52
|
this.headers = headers;
|
|
52
53
|
this.outcome = details?.outcome;
|
|
53
54
|
this.retry = details?.retry;
|
|
55
|
+
this.metaCode = details?.metaCode;
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
var PLAN_ERROR_CODES = [
|
|
@@ -6519,6 +6521,20 @@ var WebhookDeliveries = class {
|
|
|
6519
6521
|
}
|
|
6520
6522
|
);
|
|
6521
6523
|
}
|
|
6524
|
+
/**
|
|
6525
|
+
* Reenvia uma entrega esgotada (`exhausted`) ou cortada pelo limite de repasse
|
|
6526
|
+
* (`limited`): ela volta para a fila e o evento sai de novo com a mesma
|
|
6527
|
+
* `X-Idempotency-Key`, como o botão Reenviar do painel. Repetir não duplica: a
|
|
6528
|
+
* entrega já na fila responde 409 `delivery_not_replayable`. Outras recusas:
|
|
6529
|
+
* 404 `not_found`, 409 `forward_limit_reached` (limite de repasse do mês
|
|
6530
|
+
* acabou) e 429 `replay_rate_limited`. Exige o escopo `webhooks:write`.
|
|
6531
|
+
*/
|
|
6532
|
+
replay(id) {
|
|
6533
|
+
return this.client.requestItem(
|
|
6534
|
+
"POST",
|
|
6535
|
+
`/webhook_deliveries/${encodeURIComponent(id)}/replay`
|
|
6536
|
+
);
|
|
6537
|
+
}
|
|
6522
6538
|
};
|
|
6523
6539
|
|
|
6524
6540
|
// src/resources/me.ts
|
|
@@ -6709,7 +6725,8 @@ var BotoZap = class {
|
|
|
6709
6725
|
headers,
|
|
6710
6726
|
{
|
|
6711
6727
|
outcome: envelope?.error?.outcome === "rejected" || envelope?.error?.outcome === "accepted" || envelope?.error?.outcome === "unknown" ? envelope.error.outcome : void 0,
|
|
6712
|
-
retry: envelope?.error?.retry === "backoff" || envelope?.error?.retry === "after_correction" || envelope?.error?.retry === "reconcile_first" || envelope?.error?.retry === "unknown" ? envelope.error.retry : void 0
|
|
6728
|
+
retry: envelope?.error?.retry === "backoff" || envelope?.error?.retry === "after_correction" || envelope?.error?.retry === "reconcile_first" || envelope?.error?.retry === "unknown" ? envelope.error.retry : void 0,
|
|
6729
|
+
metaCode: Number.isSafeInteger(envelope?.error?.meta_code) ? envelope?.error?.meta_code : void 0
|
|
6713
6730
|
}
|
|
6714
6731
|
);
|
|
6715
6732
|
}
|