@botozap/sdk 0.18.0 → 0.19.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 +20 -0
- package/README.md +35 -3
- package/dist/index.cjs +35 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -11
- package/dist/index.d.ts +65 -11
- package/dist/index.js +33 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -114,7 +114,6 @@ interface OffsetParams {
|
|
|
114
114
|
page?: number;
|
|
115
115
|
per_page?: number;
|
|
116
116
|
}
|
|
117
|
-
/** Cliente (customer) da sua conta. */
|
|
118
117
|
/** Slot adicional que o Cliente ocupa (ver `billing.get()`). */
|
|
119
118
|
interface CustomerBusinessSlot {
|
|
120
119
|
slot_id: string;
|
|
@@ -125,6 +124,7 @@ interface CustomerBusinessSlot {
|
|
|
125
124
|
*/
|
|
126
125
|
paused: boolean;
|
|
127
126
|
}
|
|
127
|
+
/** Cliente (customer) da sua conta. */
|
|
128
128
|
interface Customer {
|
|
129
129
|
id: string;
|
|
130
130
|
name?: string;
|
|
@@ -133,6 +133,14 @@ interface Customer {
|
|
|
133
133
|
* inclui. Ausente em servidores antigos.
|
|
134
134
|
*/
|
|
135
135
|
business_slot?: CustomerBusinessSlot | null;
|
|
136
|
+
/**
|
|
137
|
+
* `true` quando o Cliente passou do teto do plano Free (1 negócio, com canal
|
|
138
|
+
* ou não): continua recebendo, mas não conecta canais e o envio responde 402
|
|
139
|
+
* `free_cap`. Volta sozinho ao assinar ou quando a vaga é liberada (apagar o
|
|
140
|
+
* outro Cliente ou desconectar os canais dele). Vem nas leituras
|
|
141
|
+
* (`list`/`get`); ausente em servidores antigos.
|
|
142
|
+
*/
|
|
143
|
+
plan_suspended?: boolean;
|
|
136
144
|
[key: string]: unknown;
|
|
137
145
|
}
|
|
138
146
|
/**
|
|
@@ -321,6 +329,13 @@ interface PhoneNumber {
|
|
|
321
329
|
id: string;
|
|
322
330
|
/** Nome local do Número no BotoZap (até 100 caracteres); `null` se não definido. */
|
|
323
331
|
label?: string | null;
|
|
332
|
+
/**
|
|
333
|
+
* `true` quando o Número não envia pelo teto do plano Free (1 número), ou
|
|
334
|
+
* porque o Cliente dele está suspenso: continua recebendo, mas o envio
|
|
335
|
+
* responde 402 `free_number_cap` (ou `free_cap`, pelo Cliente). Volta sozinho
|
|
336
|
+
* ao assinar ou ao desconectar o outro número. Ausente em servidores antigos.
|
|
337
|
+
*/
|
|
338
|
+
plan_suspended?: boolean;
|
|
324
339
|
[key: string]: unknown;
|
|
325
340
|
}
|
|
326
341
|
interface User {
|
|
@@ -3946,7 +3961,10 @@ declare class Customers {
|
|
|
3946
3961
|
list(params?: OffsetParams): Promise<OffsetList<Customer>>;
|
|
3947
3962
|
/** Busca um cliente pelo id. */
|
|
3948
3963
|
get(id: string): Promise<Customer>;
|
|
3949
|
-
/**
|
|
3964
|
+
/**
|
|
3965
|
+
* Cria um cliente. No plano Free, que permite 1 Cliente (com canal ou não), o
|
|
3966
|
+
* segundo responde 402 `free_cap` (veja `isFreeCap`).
|
|
3967
|
+
*/
|
|
3950
3968
|
create(params: CreateCustomerParams): Promise<Customer>;
|
|
3951
3969
|
/** Atualiza `name` / `external_customer_id` de um cliente. */
|
|
3952
3970
|
update(id: string, params: UpdateCustomerParams): Promise<Customer>;
|
|
@@ -4726,19 +4744,34 @@ declare class ChannelAccounts {
|
|
|
4726
4744
|
listMessageRules(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<MessageRule>>;
|
|
4727
4745
|
/** Busca uma Regra de mensagem. message-rules:read. */
|
|
4728
4746
|
getMessageRule(channelAccountId: string, ruleId: string): Promise<MessageRule>;
|
|
4729
|
-
/**
|
|
4747
|
+
/**
|
|
4748
|
+
* Cria uma Regra de mensagem. message-rules:write. Fora do plano (Free)
|
|
4749
|
+
* responde 403 `plan_restricted`.
|
|
4750
|
+
*/
|
|
4730
4751
|
createMessageRule(channelAccountId: string, params: CreateMessageRuleParams): Promise<MessageRule>;
|
|
4731
|
-
/**
|
|
4752
|
+
/**
|
|
4753
|
+
* PATCH parcial; a API valida o estado final. message-rules:write. No Free,
|
|
4754
|
+
* só `{ is_active: false }` (pausar) passa; o resto responde 403
|
|
4755
|
+
* `plan_restricted`.
|
|
4756
|
+
*/
|
|
4732
4757
|
updateMessageRule(channelAccountId: string, ruleId: string, params: UpdateMessageRuleParams): Promise<MessageRule>;
|
|
4733
4758
|
/** Exclui a Regra preservando Disparos e Eventos. message-rules:write. */
|
|
4734
4759
|
deleteMessageRule(channelAccountId: string, ruleId: string): Promise<DeleteMessageRuleResult>;
|
|
4735
4760
|
/** Lê o espelho salvo (sem consultar a Meta). messenger-profile:read; sem sandbox. */
|
|
4736
4761
|
getMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4737
|
-
/**
|
|
4762
|
+
/**
|
|
4763
|
+
* Salva/aplica apenas as seções enviadas. messenger-profile:write; sem
|
|
4764
|
+
* sandbox. No Free, só remover seções passa; salvar conteúdo responde 403
|
|
4765
|
+
* `plan_restricted`.
|
|
4766
|
+
*/
|
|
4738
4767
|
updateMessengerProfile(channelAccountId: string, params: UpdateMessengerProfileParams): Promise<MessengerProfile>;
|
|
4739
4768
|
/** Remove perguntas e menu, conservando configuração vazia. messenger-profile:write. */
|
|
4740
4769
|
deleteMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4741
|
-
/**
|
|
4770
|
+
/**
|
|
4771
|
+
* Verifica/reaplica explicitamente o desejado salvo. messenger-profile:write.
|
|
4772
|
+
* No Free, reaplicar uma configuração com conteúdo responde 403
|
|
4773
|
+
* `plan_restricted`.
|
|
4774
|
+
*/
|
|
4742
4775
|
syncMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4743
4776
|
}
|
|
4744
4777
|
|
|
@@ -5180,8 +5213,10 @@ declare class BotoZapError extends Error {
|
|
|
5180
5213
|
* `reaction_target_not_found`, `reaction_target_invalid`,
|
|
5181
5214
|
* `reaction_target_expired`, `unsupported_type`, `free_form_limit_reached`
|
|
5182
5215
|
* (429, limite 1:1 do Free). Plano: `plan_restricted` (403, escritas de IA,
|
|
5183
|
-
* Agenda, Calendário
|
|
5184
|
-
* além do teto de Números do Free
|
|
5216
|
+
* Agenda, Calendário, Jornadas, Regras de mensagem do Direct e Perguntas e menu
|
|
5217
|
+
* fora do plano), `free_number_cap` (402, setup além do teto de Números do Free
|
|
5218
|
+
* ou envio por um Número suspenso no Free), `free_cap` (402, criar o 2º Cliente
|
|
5219
|
+
* no Free ou enviar por um Cliente suspenso no Free). IA: `provider_not_enabled` (422, credencial
|
|
5185
5220
|
* nova de provedor com `accepts_new_credentials: false`). Cobrança:
|
|
5186
5221
|
* `business_payment_required` (402 no envio: o negócio está pausado porque a
|
|
5187
5222
|
* fatura do slot venceu há mais de 7 dias; pague e envie de novo),
|
|
@@ -5189,9 +5224,9 @@ declare class BotoZapError extends Error {
|
|
|
5189
5224
|
* 2 slots com fatura em aberto), `billing_customer_required` (402, conta sem
|
|
5190
5225
|
* cadastro de cobrança), `slot_in_use` (409, cancelar slot ocupado).
|
|
5191
5226
|
*/
|
|
5192
|
-
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" | "feature_unavailable" | "provider_not_enabled" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | (string & {});
|
|
5227
|
+
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" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | (string & {});
|
|
5193
5228
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
5194
|
-
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
5229
|
+
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
5195
5230
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
5196
5231
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
5197
5232
|
/**
|
|
@@ -5200,5 +5235,24 @@ declare function isPlanError(error: unknown): error is BotoZapError;
|
|
|
5200
5235
|
* disso não adianta. Não é recusa de plano ({@link isPlanError} é `false`).
|
|
5201
5236
|
*/
|
|
5202
5237
|
declare function isBusinessPaymentRequired(error: unknown): error is BotoZapError;
|
|
5238
|
+
/**
|
|
5239
|
+
* True quando a API recusou por causa do teto de 1 negócio (Cliente) do plano
|
|
5240
|
+
* Free (402 `free_cap`): criar o 2º Cliente (`customers.create`) ou enviar por
|
|
5241
|
+
* um Cliente suspenso. O Cliente suspenso (`plan_suspended: true`) continua
|
|
5242
|
+
* recebendo, mas não conecta canais nem envia. Libera na hora ao assinar; no
|
|
5243
|
+
* Free, apagar o outro Cliente (ou, no envio, desconectar os canais dele)
|
|
5244
|
+
* libera a vaga. Repetir antes disso não adianta. É recusa de plano
|
|
5245
|
+
* ({@link isPlanError} é `true`).
|
|
5246
|
+
*/
|
|
5247
|
+
declare function isFreeCap(error: unknown): error is BotoZapError;
|
|
5248
|
+
/**
|
|
5249
|
+
* True quando a API recusou por causa do teto de 1 número do plano Free (402
|
|
5250
|
+
* `free_number_cap`): enviar por um Número suspenso ou conectar outro número
|
|
5251
|
+
* no setup. O Número suspenso (`plan_suspended: true`) continua recebendo, mas
|
|
5252
|
+
* não envia. Libera na hora ao assinar ou ao desconectar o outro número;
|
|
5253
|
+
* repetir antes disso não adianta. É recusa de plano ({@link isPlanError} é
|
|
5254
|
+
* `true`).
|
|
5255
|
+
*/
|
|
5256
|
+
declare function isFreeNumberCap(error: unknown): error is BotoZapError;
|
|
5203
5257
|
|
|
5204
|
-
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, 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 AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, 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 BillingPlan, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, 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 EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, 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 JourneyConfig, type JourneyEnrollment, 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 ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, 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, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, 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 SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isBusinessPaymentRequired, isPlanError };
|
|
5258
|
+
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, 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 AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, 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 BillingPlan, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, 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 EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, 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 JourneyConfig, type JourneyEnrollment, 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 ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, 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, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, 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 SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isBusinessPaymentRequired, isFreeCap, isFreeNumberCap, isPlanError };
|
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,6 @@ interface OffsetParams {
|
|
|
114
114
|
page?: number;
|
|
115
115
|
per_page?: number;
|
|
116
116
|
}
|
|
117
|
-
/** Cliente (customer) da sua conta. */
|
|
118
117
|
/** Slot adicional que o Cliente ocupa (ver `billing.get()`). */
|
|
119
118
|
interface CustomerBusinessSlot {
|
|
120
119
|
slot_id: string;
|
|
@@ -125,6 +124,7 @@ interface CustomerBusinessSlot {
|
|
|
125
124
|
*/
|
|
126
125
|
paused: boolean;
|
|
127
126
|
}
|
|
127
|
+
/** Cliente (customer) da sua conta. */
|
|
128
128
|
interface Customer {
|
|
129
129
|
id: string;
|
|
130
130
|
name?: string;
|
|
@@ -133,6 +133,14 @@ interface Customer {
|
|
|
133
133
|
* inclui. Ausente em servidores antigos.
|
|
134
134
|
*/
|
|
135
135
|
business_slot?: CustomerBusinessSlot | null;
|
|
136
|
+
/**
|
|
137
|
+
* `true` quando o Cliente passou do teto do plano Free (1 negócio, com canal
|
|
138
|
+
* ou não): continua recebendo, mas não conecta canais e o envio responde 402
|
|
139
|
+
* `free_cap`. Volta sozinho ao assinar ou quando a vaga é liberada (apagar o
|
|
140
|
+
* outro Cliente ou desconectar os canais dele). Vem nas leituras
|
|
141
|
+
* (`list`/`get`); ausente em servidores antigos.
|
|
142
|
+
*/
|
|
143
|
+
plan_suspended?: boolean;
|
|
136
144
|
[key: string]: unknown;
|
|
137
145
|
}
|
|
138
146
|
/**
|
|
@@ -321,6 +329,13 @@ interface PhoneNumber {
|
|
|
321
329
|
id: string;
|
|
322
330
|
/** Nome local do Número no BotoZap (até 100 caracteres); `null` se não definido. */
|
|
323
331
|
label?: string | null;
|
|
332
|
+
/**
|
|
333
|
+
* `true` quando o Número não envia pelo teto do plano Free (1 número), ou
|
|
334
|
+
* porque o Cliente dele está suspenso: continua recebendo, mas o envio
|
|
335
|
+
* responde 402 `free_number_cap` (ou `free_cap`, pelo Cliente). Volta sozinho
|
|
336
|
+
* ao assinar ou ao desconectar o outro número. Ausente em servidores antigos.
|
|
337
|
+
*/
|
|
338
|
+
plan_suspended?: boolean;
|
|
324
339
|
[key: string]: unknown;
|
|
325
340
|
}
|
|
326
341
|
interface User {
|
|
@@ -3946,7 +3961,10 @@ declare class Customers {
|
|
|
3946
3961
|
list(params?: OffsetParams): Promise<OffsetList<Customer>>;
|
|
3947
3962
|
/** Busca um cliente pelo id. */
|
|
3948
3963
|
get(id: string): Promise<Customer>;
|
|
3949
|
-
/**
|
|
3964
|
+
/**
|
|
3965
|
+
* Cria um cliente. No plano Free, que permite 1 Cliente (com canal ou não), o
|
|
3966
|
+
* segundo responde 402 `free_cap` (veja `isFreeCap`).
|
|
3967
|
+
*/
|
|
3950
3968
|
create(params: CreateCustomerParams): Promise<Customer>;
|
|
3951
3969
|
/** Atualiza `name` / `external_customer_id` de um cliente. */
|
|
3952
3970
|
update(id: string, params: UpdateCustomerParams): Promise<Customer>;
|
|
@@ -4726,19 +4744,34 @@ declare class ChannelAccounts {
|
|
|
4726
4744
|
listMessageRules(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<MessageRule>>;
|
|
4727
4745
|
/** Busca uma Regra de mensagem. message-rules:read. */
|
|
4728
4746
|
getMessageRule(channelAccountId: string, ruleId: string): Promise<MessageRule>;
|
|
4729
|
-
/**
|
|
4747
|
+
/**
|
|
4748
|
+
* Cria uma Regra de mensagem. message-rules:write. Fora do plano (Free)
|
|
4749
|
+
* responde 403 `plan_restricted`.
|
|
4750
|
+
*/
|
|
4730
4751
|
createMessageRule(channelAccountId: string, params: CreateMessageRuleParams): Promise<MessageRule>;
|
|
4731
|
-
/**
|
|
4752
|
+
/**
|
|
4753
|
+
* PATCH parcial; a API valida o estado final. message-rules:write. No Free,
|
|
4754
|
+
* só `{ is_active: false }` (pausar) passa; o resto responde 403
|
|
4755
|
+
* `plan_restricted`.
|
|
4756
|
+
*/
|
|
4732
4757
|
updateMessageRule(channelAccountId: string, ruleId: string, params: UpdateMessageRuleParams): Promise<MessageRule>;
|
|
4733
4758
|
/** Exclui a Regra preservando Disparos e Eventos. message-rules:write. */
|
|
4734
4759
|
deleteMessageRule(channelAccountId: string, ruleId: string): Promise<DeleteMessageRuleResult>;
|
|
4735
4760
|
/** Lê o espelho salvo (sem consultar a Meta). messenger-profile:read; sem sandbox. */
|
|
4736
4761
|
getMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4737
|
-
/**
|
|
4762
|
+
/**
|
|
4763
|
+
* Salva/aplica apenas as seções enviadas. messenger-profile:write; sem
|
|
4764
|
+
* sandbox. No Free, só remover seções passa; salvar conteúdo responde 403
|
|
4765
|
+
* `plan_restricted`.
|
|
4766
|
+
*/
|
|
4738
4767
|
updateMessengerProfile(channelAccountId: string, params: UpdateMessengerProfileParams): Promise<MessengerProfile>;
|
|
4739
4768
|
/** Remove perguntas e menu, conservando configuração vazia. messenger-profile:write. */
|
|
4740
4769
|
deleteMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4741
|
-
/**
|
|
4770
|
+
/**
|
|
4771
|
+
* Verifica/reaplica explicitamente o desejado salvo. messenger-profile:write.
|
|
4772
|
+
* No Free, reaplicar uma configuração com conteúdo responde 403
|
|
4773
|
+
* `plan_restricted`.
|
|
4774
|
+
*/
|
|
4742
4775
|
syncMessengerProfile(channelAccountId: string): Promise<MessengerProfile>;
|
|
4743
4776
|
}
|
|
4744
4777
|
|
|
@@ -5180,8 +5213,10 @@ declare class BotoZapError extends Error {
|
|
|
5180
5213
|
* `reaction_target_not_found`, `reaction_target_invalid`,
|
|
5181
5214
|
* `reaction_target_expired`, `unsupported_type`, `free_form_limit_reached`
|
|
5182
5215
|
* (429, limite 1:1 do Free). Plano: `plan_restricted` (403, escritas de IA,
|
|
5183
|
-
* Agenda, Calendário
|
|
5184
|
-
* além do teto de Números do Free
|
|
5216
|
+
* Agenda, Calendário, Jornadas, Regras de mensagem do Direct e Perguntas e menu
|
|
5217
|
+
* fora do plano), `free_number_cap` (402, setup além do teto de Números do Free
|
|
5218
|
+
* ou envio por um Número suspenso no Free), `free_cap` (402, criar o 2º Cliente
|
|
5219
|
+
* no Free ou enviar por um Cliente suspenso no Free). IA: `provider_not_enabled` (422, credencial
|
|
5185
5220
|
* nova de provedor com `accepts_new_credentials: false`). Cobrança:
|
|
5186
5221
|
* `business_payment_required` (402 no envio: o negócio está pausado porque a
|
|
5187
5222
|
* fatura do slot venceu há mais de 7 dias; pague e envie de novo),
|
|
@@ -5189,9 +5224,9 @@ declare class BotoZapError extends Error {
|
|
|
5189
5224
|
* 2 slots com fatura em aberto), `billing_customer_required` (402, conta sem
|
|
5190
5225
|
* cadastro de cobrança), `slot_in_use` (409, cancelar slot ocupado).
|
|
5191
5226
|
*/
|
|
5192
|
-
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" | "feature_unavailable" | "provider_not_enabled" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | (string & {});
|
|
5227
|
+
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" | "business_payment_required" | "plan_required" | "slot_limit" | "slot_in_use" | "billing_customer_required" | (string & {});
|
|
5193
5228
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
5194
|
-
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
5229
|
+
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap", "free_cap"];
|
|
5195
5230
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
5196
5231
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
5197
5232
|
/**
|
|
@@ -5200,5 +5235,24 @@ declare function isPlanError(error: unknown): error is BotoZapError;
|
|
|
5200
5235
|
* disso não adianta. Não é recusa de plano ({@link isPlanError} é `false`).
|
|
5201
5236
|
*/
|
|
5202
5237
|
declare function isBusinessPaymentRequired(error: unknown): error is BotoZapError;
|
|
5238
|
+
/**
|
|
5239
|
+
* True quando a API recusou por causa do teto de 1 negócio (Cliente) do plano
|
|
5240
|
+
* Free (402 `free_cap`): criar o 2º Cliente (`customers.create`) ou enviar por
|
|
5241
|
+
* um Cliente suspenso. O Cliente suspenso (`plan_suspended: true`) continua
|
|
5242
|
+
* recebendo, mas não conecta canais nem envia. Libera na hora ao assinar; no
|
|
5243
|
+
* Free, apagar o outro Cliente (ou, no envio, desconectar os canais dele)
|
|
5244
|
+
* libera a vaga. Repetir antes disso não adianta. É recusa de plano
|
|
5245
|
+
* ({@link isPlanError} é `true`).
|
|
5246
|
+
*/
|
|
5247
|
+
declare function isFreeCap(error: unknown): error is BotoZapError;
|
|
5248
|
+
/**
|
|
5249
|
+
* True quando a API recusou por causa do teto de 1 número do plano Free (402
|
|
5250
|
+
* `free_number_cap`): enviar por um Número suspenso ou conectar outro número
|
|
5251
|
+
* no setup. O Número suspenso (`plan_suspended: true`) continua recebendo, mas
|
|
5252
|
+
* não envia. Libera na hora ao assinar ou ao desconectar o outro número;
|
|
5253
|
+
* repetir antes disso não adianta. É recusa de plano ({@link isPlanError} é
|
|
5254
|
+
* `true`).
|
|
5255
|
+
*/
|
|
5256
|
+
declare function isFreeNumberCap(error: unknown): error is BotoZapError;
|
|
5203
5257
|
|
|
5204
|
-
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, 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 AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, 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 BillingPlan, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, 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 EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, 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 JourneyConfig, type JourneyEnrollment, 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 ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, 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, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, 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 SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isBusinessPaymentRequired, isPlanError };
|
|
5258
|
+
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, 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 AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, 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 BillingPlan, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateBusinessSlotOptions, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, 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 EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, 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 JourneyConfig, type JourneyEnrollment, 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 ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, 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, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, 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 SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isBusinessPaymentRequired, isFreeCap, isFreeNumberCap, isPlanError };
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,8 @@ var BotoZapError = class extends Error {
|
|
|
56
56
|
var PLAN_ERROR_CODES = [
|
|
57
57
|
"plan_restricted",
|
|
58
58
|
"free_form_limit_reached",
|
|
59
|
-
"free_number_cap"
|
|
59
|
+
"free_number_cap",
|
|
60
|
+
"free_cap"
|
|
60
61
|
];
|
|
61
62
|
function isPlanError(error) {
|
|
62
63
|
return error instanceof BotoZapError && PLAN_ERROR_CODES.includes(error.code);
|
|
@@ -64,6 +65,12 @@ function isPlanError(error) {
|
|
|
64
65
|
function isBusinessPaymentRequired(error) {
|
|
65
66
|
return error instanceof BotoZapError && error.code === "business_payment_required";
|
|
66
67
|
}
|
|
68
|
+
function isFreeCap(error) {
|
|
69
|
+
return error instanceof BotoZapError && error.code === "free_cap";
|
|
70
|
+
}
|
|
71
|
+
function isFreeNumberCap(error) {
|
|
72
|
+
return error instanceof BotoZapError && error.code === "free_number_cap";
|
|
73
|
+
}
|
|
67
74
|
|
|
68
75
|
// src/resources/ai/upload.ts
|
|
69
76
|
var receipts = /* @__PURE__ */ new WeakMap();
|
|
@@ -5253,7 +5260,10 @@ var Customers = class {
|
|
|
5253
5260
|
get(id) {
|
|
5254
5261
|
return this.client.requestItem("GET", `/customers/${enc(id)}`);
|
|
5255
5262
|
}
|
|
5256
|
-
/**
|
|
5263
|
+
/**
|
|
5264
|
+
* Cria um cliente. No plano Free, que permite 1 Cliente (com canal ou não), o
|
|
5265
|
+
* segundo responde 402 `free_cap` (veja `isFreeCap`).
|
|
5266
|
+
*/
|
|
5257
5267
|
create(params) {
|
|
5258
5268
|
return this.client.requestItem("POST", "/customers", {
|
|
5259
5269
|
body: params
|
|
@@ -5817,11 +5827,18 @@ var ChannelAccounts = class {
|
|
|
5817
5827
|
getMessageRule(channelAccountId, ruleId) {
|
|
5818
5828
|
return this.client.requestItem("GET", messageRulesPath(channelAccountId, ruleId));
|
|
5819
5829
|
}
|
|
5820
|
-
/**
|
|
5830
|
+
/**
|
|
5831
|
+
* Cria uma Regra de mensagem. message-rules:write. Fora do plano (Free)
|
|
5832
|
+
* responde 403 `plan_restricted`.
|
|
5833
|
+
*/
|
|
5821
5834
|
createMessageRule(channelAccountId, params) {
|
|
5822
5835
|
return this.client.requestItem("POST", messageRulesPath(channelAccountId), { body: params });
|
|
5823
5836
|
}
|
|
5824
|
-
/**
|
|
5837
|
+
/**
|
|
5838
|
+
* PATCH parcial; a API valida o estado final. message-rules:write. No Free,
|
|
5839
|
+
* só `{ is_active: false }` (pausar) passa; o resto responde 403
|
|
5840
|
+
* `plan_restricted`.
|
|
5841
|
+
*/
|
|
5825
5842
|
updateMessageRule(channelAccountId, ruleId, params) {
|
|
5826
5843
|
return this.client.requestItem("PATCH", messageRulesPath(channelAccountId, ruleId), { body: params });
|
|
5827
5844
|
}
|
|
@@ -5833,7 +5850,11 @@ var ChannelAccounts = class {
|
|
|
5833
5850
|
getMessengerProfile(channelAccountId) {
|
|
5834
5851
|
return this.client.requestItem("GET", profilePath(channelAccountId));
|
|
5835
5852
|
}
|
|
5836
|
-
/**
|
|
5853
|
+
/**
|
|
5854
|
+
* Salva/aplica apenas as seções enviadas. messenger-profile:write; sem
|
|
5855
|
+
* sandbox. No Free, só remover seções passa; salvar conteúdo responde 403
|
|
5856
|
+
* `plan_restricted`.
|
|
5857
|
+
*/
|
|
5837
5858
|
updateMessengerProfile(channelAccountId, params) {
|
|
5838
5859
|
return this.client.requestItem("PATCH", profilePath(channelAccountId), { body: params });
|
|
5839
5860
|
}
|
|
@@ -5841,7 +5862,11 @@ var ChannelAccounts = class {
|
|
|
5841
5862
|
deleteMessengerProfile(channelAccountId) {
|
|
5842
5863
|
return this.client.requestItem("DELETE", profilePath(channelAccountId));
|
|
5843
5864
|
}
|
|
5844
|
-
/**
|
|
5865
|
+
/**
|
|
5866
|
+
* Verifica/reaplica explicitamente o desejado salvo. messenger-profile:write.
|
|
5867
|
+
* No Free, reaplicar uma configuração com conteúdo responde 403
|
|
5868
|
+
* `plan_restricted`.
|
|
5869
|
+
*/
|
|
5845
5870
|
syncMessengerProfile(channelAccountId) {
|
|
5846
5871
|
return this.client.requestItem("POST", `${profilePath(channelAccountId)}/sync`);
|
|
5847
5872
|
}
|
|
@@ -6337,6 +6362,8 @@ export {
|
|
|
6337
6362
|
SavedReplies,
|
|
6338
6363
|
WEBHOOK_CATEGORIES,
|
|
6339
6364
|
isBusinessPaymentRequired,
|
|
6365
|
+
isFreeCap,
|
|
6366
|
+
isFreeNumberCap,
|
|
6340
6367
|
isPlanError
|
|
6341
6368
|
};
|
|
6342
6369
|
//# sourceMappingURL=index.js.map
|