@botozap/sdk 0.23.0 → 0.25.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 +27 -0
- package/README.md +31 -3
- package/dist/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -6051,11 +6051,29 @@ interface ListWebhookDeliveriesParams extends CursorParams {
|
|
|
6051
6051
|
/** Canal da entrega (`channel_account_id`); `"none"` = sem canal (teste, eventos da WABA). */
|
|
6052
6052
|
channel_account_id?: string;
|
|
6053
6053
|
}
|
|
6054
|
-
/**
|
|
6054
|
+
/** Resultado de `webhookDeliveries.replay`: a entrega voltou para a fila. */
|
|
6055
|
+
interface WebhookDeliveryReplay {
|
|
6056
|
+
id: string;
|
|
6057
|
+
status: "pending";
|
|
6058
|
+
replayed: true;
|
|
6059
|
+
}
|
|
6060
|
+
/**
|
|
6061
|
+
* Histórico de Entregas de webhook e reenvio das esgotadas. Única escrita deste
|
|
6062
|
+
* arquivo; `users` e `apiLogs` seguem só leitura.
|
|
6063
|
+
*/
|
|
6055
6064
|
declare class WebhookDeliveries {
|
|
6056
6065
|
private readonly client;
|
|
6057
6066
|
constructor(client: BotoZap);
|
|
6058
6067
|
list(params?: ListWebhookDeliveriesParams): Promise<CursorList<WebhookDelivery>>;
|
|
6068
|
+
/**
|
|
6069
|
+
* Reenvia uma entrega esgotada (`exhausted`) ou cortada pelo limite de repasse
|
|
6070
|
+
* (`limited`): ela volta para a fila e o evento sai de novo com a mesma
|
|
6071
|
+
* `X-Idempotency-Key`, como o botão Reenviar do painel. Repetir não duplica: a
|
|
6072
|
+
* entrega já na fila responde 409 `delivery_not_replayable`. Outras recusas:
|
|
6073
|
+
* 404 `not_found`, 409 `forward_limit_reached` (limite de repasse do mês
|
|
6074
|
+
* acabou) e 429 `replay_rate_limited`. Exige o escopo `webhooks:write`.
|
|
6075
|
+
*/
|
|
6076
|
+
replay(id: string): Promise<WebhookDeliveryReplay>;
|
|
6059
6077
|
}
|
|
6060
6078
|
|
|
6061
6079
|
/** Identidade e permissões efetivas da credencial autenticada. */
|
|
@@ -6184,12 +6202,19 @@ declare class BotoZap {
|
|
|
6184
6202
|
type SendFailureDetails = {
|
|
6185
6203
|
outcome?: "rejected" | "accepted" | "unknown";
|
|
6186
6204
|
retry?: "backoff" | "after_correction" | "reconcile_first" | "unknown";
|
|
6205
|
+
/**
|
|
6206
|
+
* Código numérico da Meta quando ela recusou o envio (`error.meta_code`, ex.:
|
|
6207
|
+
* 131026), em `messages.send` e afins e em `conversations.requestConsent`.
|
|
6208
|
+
* Só vem quando a Meta informou um código inteiro.
|
|
6209
|
+
*/
|
|
6210
|
+
metaCode?: number;
|
|
6187
6211
|
};
|
|
6188
6212
|
declare class BotoZapError extends Error {
|
|
6189
6213
|
readonly code: string;
|
|
6190
6214
|
readonly status: number;
|
|
6191
6215
|
readonly outcome?: SendFailureDetails["outcome"];
|
|
6192
6216
|
readonly retry?: SendFailureDetails["retry"];
|
|
6217
|
+
readonly metaCode?: SendFailureDetails["metaCode"];
|
|
6193
6218
|
/** Headers da resposta HTTP. Ausente em erros sem resposta (status 0). */
|
|
6194
6219
|
readonly headers?: Record<string, string>;
|
|
6195
6220
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>, details?: SendFailureDetails);
|
|
@@ -6243,8 +6268,14 @@ declare class BotoZapError extends Error {
|
|
|
6243
6268
|
* (`phoneNumbers.getHistoryImport`/`setHistoryImport`):
|
|
6244
6269
|
* `history_import_not_available` (404, número sem importação),
|
|
6245
6270
|
* `history_import_locked` (409, a escolha já foi feita ou o prazo acabou).
|
|
6271
|
+
* Recusa da Meta no envio e no pedido de consentimento: `meta_error`, com o
|
|
6272
|
+
* código da Meta em {@link BotoZapError.metaCode} quando houver. Reenvio de
|
|
6273
|
+
* entrega (`webhookDeliveries.replay`): `delivery_not_replayable` (409, a
|
|
6274
|
+
* entrega não está `exhausted` nem `limited`), `forward_limit_reached` (409,
|
|
6275
|
+
* entrega `limited` e o limite de repasse do mês acabou),
|
|
6276
|
+
* `replay_rate_limited` (429, muitos reenvios seguidos).
|
|
6246
6277
|
*/
|
|
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 & {});
|
|
6278
|
+
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
6279
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
6249
6280
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
6250
6281
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
@@ -6295,4 +6326,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6295
6326
|
*/
|
|
6296
6327
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6297
6328
|
|
|
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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -6051,11 +6051,29 @@ interface ListWebhookDeliveriesParams extends CursorParams {
|
|
|
6051
6051
|
/** Canal da entrega (`channel_account_id`); `"none"` = sem canal (teste, eventos da WABA). */
|
|
6052
6052
|
channel_account_id?: string;
|
|
6053
6053
|
}
|
|
6054
|
-
/**
|
|
6054
|
+
/** Resultado de `webhookDeliveries.replay`: a entrega voltou para a fila. */
|
|
6055
|
+
interface WebhookDeliveryReplay {
|
|
6056
|
+
id: string;
|
|
6057
|
+
status: "pending";
|
|
6058
|
+
replayed: true;
|
|
6059
|
+
}
|
|
6060
|
+
/**
|
|
6061
|
+
* Histórico de Entregas de webhook e reenvio das esgotadas. Única escrita deste
|
|
6062
|
+
* arquivo; `users` e `apiLogs` seguem só leitura.
|
|
6063
|
+
*/
|
|
6055
6064
|
declare class WebhookDeliveries {
|
|
6056
6065
|
private readonly client;
|
|
6057
6066
|
constructor(client: BotoZap);
|
|
6058
6067
|
list(params?: ListWebhookDeliveriesParams): Promise<CursorList<WebhookDelivery>>;
|
|
6068
|
+
/**
|
|
6069
|
+
* Reenvia uma entrega esgotada (`exhausted`) ou cortada pelo limite de repasse
|
|
6070
|
+
* (`limited`): ela volta para a fila e o evento sai de novo com a mesma
|
|
6071
|
+
* `X-Idempotency-Key`, como o botão Reenviar do painel. Repetir não duplica: a
|
|
6072
|
+
* entrega já na fila responde 409 `delivery_not_replayable`. Outras recusas:
|
|
6073
|
+
* 404 `not_found`, 409 `forward_limit_reached` (limite de repasse do mês
|
|
6074
|
+
* acabou) e 429 `replay_rate_limited`. Exige o escopo `webhooks:write`.
|
|
6075
|
+
*/
|
|
6076
|
+
replay(id: string): Promise<WebhookDeliveryReplay>;
|
|
6059
6077
|
}
|
|
6060
6078
|
|
|
6061
6079
|
/** Identidade e permissões efetivas da credencial autenticada. */
|
|
@@ -6184,12 +6202,19 @@ declare class BotoZap {
|
|
|
6184
6202
|
type SendFailureDetails = {
|
|
6185
6203
|
outcome?: "rejected" | "accepted" | "unknown";
|
|
6186
6204
|
retry?: "backoff" | "after_correction" | "reconcile_first" | "unknown";
|
|
6205
|
+
/**
|
|
6206
|
+
* Código numérico da Meta quando ela recusou o envio (`error.meta_code`, ex.:
|
|
6207
|
+
* 131026), em `messages.send` e afins e em `conversations.requestConsent`.
|
|
6208
|
+
* Só vem quando a Meta informou um código inteiro.
|
|
6209
|
+
*/
|
|
6210
|
+
metaCode?: number;
|
|
6187
6211
|
};
|
|
6188
6212
|
declare class BotoZapError extends Error {
|
|
6189
6213
|
readonly code: string;
|
|
6190
6214
|
readonly status: number;
|
|
6191
6215
|
readonly outcome?: SendFailureDetails["outcome"];
|
|
6192
6216
|
readonly retry?: SendFailureDetails["retry"];
|
|
6217
|
+
readonly metaCode?: SendFailureDetails["metaCode"];
|
|
6193
6218
|
/** Headers da resposta HTTP. Ausente em erros sem resposta (status 0). */
|
|
6194
6219
|
readonly headers?: Record<string, string>;
|
|
6195
6220
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>, details?: SendFailureDetails);
|
|
@@ -6243,8 +6268,14 @@ declare class BotoZapError extends Error {
|
|
|
6243
6268
|
* (`phoneNumbers.getHistoryImport`/`setHistoryImport`):
|
|
6244
6269
|
* `history_import_not_available` (404, número sem importação),
|
|
6245
6270
|
* `history_import_locked` (409, a escolha já foi feita ou o prazo acabou).
|
|
6271
|
+
* Recusa da Meta no envio e no pedido de consentimento: `meta_error`, com o
|
|
6272
|
+
* código da Meta em {@link BotoZapError.metaCode} quando houver. Reenvio de
|
|
6273
|
+
* entrega (`webhookDeliveries.replay`): `delivery_not_replayable` (409, a
|
|
6274
|
+
* entrega não está `exhausted` nem `limited`), `forward_limit_reached` (409,
|
|
6275
|
+
* entrega `limited` e o limite de repasse do mês acabou),
|
|
6276
|
+
* `replay_rate_limited` (429, muitos reenvios seguidos).
|
|
6246
6277
|
*/
|
|
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 & {});
|
|
6278
|
+
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
6279
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
6249
6280
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
6250
6281
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
@@ -6295,4 +6326,4 @@ declare function isConsentRevoked(error: unknown): error is BotoZapError;
|
|
|
6295
6326
|
*/
|
|
6296
6327
|
declare function isNotConnected(error: unknown): error is BotoZapError;
|
|
6297
6328
|
|
|
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 };
|
|
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 };
|
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
|
|
@@ -6582,7 +6598,7 @@ var BotoZap = class {
|
|
|
6582
6598
|
const resolvedFetch = options.fetch ?? globalThis.fetch;
|
|
6583
6599
|
if (typeof resolvedFetch !== "function") {
|
|
6584
6600
|
throw new Error(
|
|
6585
|
-
"BotoZap: fetch global n\xE3o encontrado. Use Node
|
|
6601
|
+
"BotoZap: fetch global n\xE3o encontrado. Use Node 22.12+ ou passe a op\xE7\xE3o `fetch`."
|
|
6586
6602
|
);
|
|
6587
6603
|
}
|
|
6588
6604
|
this.fetchImpl = resolvedFetch;
|
|
@@ -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
|
}
|