@botozap/sdk 0.16.1 → 0.18.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 +39 -0
- package/README.md +57 -1
- package/dist/index.cjs +54 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +172 -8
- package/dist/index.d.ts +172 -8
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -115,9 +115,24 @@ interface OffsetParams {
|
|
|
115
115
|
per_page?: number;
|
|
116
116
|
}
|
|
117
117
|
/** Cliente (customer) da sua conta. */
|
|
118
|
+
/** Slot adicional que o Cliente ocupa (ver `billing.get()`). */
|
|
119
|
+
interface CustomerBusinessSlot {
|
|
120
|
+
slot_id: string;
|
|
121
|
+
/**
|
|
122
|
+
* `true` quando o negócio está pausado porque a fatura do slot venceu há
|
|
123
|
+
* mais de 7 dias. Envios respondem 402 `business_payment_required` até o
|
|
124
|
+
* pagamento.
|
|
125
|
+
*/
|
|
126
|
+
paused: boolean;
|
|
127
|
+
}
|
|
118
128
|
interface Customer {
|
|
119
129
|
id: string;
|
|
120
130
|
name?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Slot adicional ocupado pelo Cliente; `null` quando ele está no que o plano
|
|
133
|
+
* inclui. Ausente em servidores antigos.
|
|
134
|
+
*/
|
|
135
|
+
business_slot?: CustomerBusinessSlot | null;
|
|
121
136
|
[key: string]: unknown;
|
|
122
137
|
}
|
|
123
138
|
/**
|
|
@@ -445,15 +460,24 @@ interface MediaAsset {
|
|
|
445
460
|
expires_at: string;
|
|
446
461
|
}
|
|
447
462
|
/**
|
|
448
|
-
* Link de setup de um cliente (Embedded Signup
|
|
463
|
+
* Link de setup de um cliente (Embedded Signup no WhatsApp, login do Instagram
|
|
464
|
+
* no Instagram). Shape do contrato
|
|
449
465
|
* (ver `/v1/customers/:id/setup_links`): a `url` embute o token opaco; o token
|
|
450
466
|
* cru nunca é exposto separadamente.
|
|
451
467
|
*/
|
|
452
468
|
interface SetupLink {
|
|
453
469
|
id: string;
|
|
470
|
+
/** Canal que o link conecta (cada link conecta um canal só). */
|
|
471
|
+
channel: "whatsapp" | "instagram";
|
|
454
472
|
status: string;
|
|
473
|
+
/**
|
|
474
|
+
* Andamento da conexão. Apesar do nome, vale para os dois canais: num link do
|
|
475
|
+
* Instagram passa a `completed` quando a conta do Instagram conecta.
|
|
476
|
+
*/
|
|
455
477
|
whatsapp_setup_status: string;
|
|
478
|
+
/** `/whatsapp/setup/<token>` ou `/instagram/setup/<token>`, conforme o canal. */
|
|
456
479
|
url: string;
|
|
480
|
+
/** Modos do WhatsApp; sempre `[]` em links do Instagram. */
|
|
457
481
|
allowed_connection_types: string[];
|
|
458
482
|
/**
|
|
459
483
|
* Legado: `null` em links novos. A página do link é sempre em português,
|
|
@@ -476,8 +500,37 @@ interface SetupLink {
|
|
|
476
500
|
expires_at: string | null;
|
|
477
501
|
created_at: string;
|
|
478
502
|
updated_at: string;
|
|
503
|
+
/**
|
|
504
|
+
* O que acontece na cobrança quando o Cliente conectar (conferência só de
|
|
505
|
+
* leitura). `null` quando não deu para conferir agora; ausente em servidores
|
|
506
|
+
* antigos.
|
|
507
|
+
*/
|
|
508
|
+
connection_billing?: ConnectionBilling | null;
|
|
479
509
|
[key: string]: unknown;
|
|
480
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* Resultado previsto da conexão: `included` (entra no que o plano inclui),
|
|
513
|
+
* `occupies_slot` (usa um slot vazio), `creates_slot` (compra um slot novo de
|
|
514
|
+
* R$ 47/mês) ou `refused` (a conexão será recusada; veja `reason`).
|
|
515
|
+
*/
|
|
516
|
+
type ConnectionBillingOutcome = "included" | "occupies_slot" | "creates_slot" | "refused" | (string & {});
|
|
517
|
+
/**
|
|
518
|
+
* Por que a conexão será recusada: `free_cap` (Free ou teste: assine o plano),
|
|
519
|
+
* `slot_limit` (já há 2 slots com fatura em aberto: pague uma),
|
|
520
|
+
* `billing_customer_required` (conta sem cadastro de cobrança: fale com o
|
|
521
|
+
* suporte) ou `capacity_required` (compre um slot antes de conectar).
|
|
522
|
+
*/
|
|
523
|
+
type ConnectionBillingRefusal = "free_cap" | "slot_limit" | "billing_customer_required" | "capacity_required" | (string & {});
|
|
524
|
+
/** Cobrança prevista para a conexão de um link de setup. */
|
|
525
|
+
interface ConnectionBilling {
|
|
526
|
+
outcome: ConnectionBillingOutcome;
|
|
527
|
+
/** 4700 em `creates_slot`; `null` nos demais. */
|
|
528
|
+
amount_cents: number | null;
|
|
529
|
+
/** Preenchido só em `refused`. */
|
|
530
|
+
reason: ConnectionBillingRefusal | null;
|
|
531
|
+
/** Texto em português para mostrar ao usuário. */
|
|
532
|
+
message: string;
|
|
533
|
+
}
|
|
481
534
|
|
|
482
535
|
/** Public /api/v1/ai contracts. Revisions are opaque strings unless the endpoint explicitly uses a number. */
|
|
483
536
|
type AiProvider = "anthropic" | "openai" | "google" | "openrouter" | "deepseek" | "xai";
|
|
@@ -3835,13 +3888,26 @@ interface UpdateCustomerParams {
|
|
|
3835
3888
|
* link continua válido. A query string que a sua URL já tiver é preservada e o
|
|
3836
3889
|
* token do link nunca é enviado. Link expirado ou revogado mostra a página de
|
|
3837
3890
|
* erro, sem redirecionar.
|
|
3891
|
+
*
|
|
3892
|
+
* Cada link conecta um canal só (`channel`). No do Instagram, o Cliente
|
|
3893
|
+
* confirma que a conta é profissional e que as mensagens estão liberadas e
|
|
3894
|
+
* entra com o Instagram; sucesso vai para `success_redirect_url` com
|
|
3895
|
+
* `status=completed` e, numa falha, a página oferece voltar para
|
|
3896
|
+
* `failure_redirect_url` com `status=cancelled`.
|
|
3838
3897
|
*/
|
|
3839
3898
|
interface CreateSetupLinkParams {
|
|
3840
3899
|
/**
|
|
3841
|
-
*
|
|
3842
|
-
*
|
|
3900
|
+
* Canal que o link conecta: "whatsapp" (padrão) ou "instagram". Outro valor
|
|
3901
|
+
* responde `422 invalid_channel`. O link do Instagram volta com
|
|
3902
|
+
* `allowed_connection_types: []` e `url` em `/instagram/setup/<token>`.
|
|
3903
|
+
*/
|
|
3904
|
+
channel?: "whatsapp" | "instagram";
|
|
3905
|
+
/**
|
|
3906
|
+
* Só WhatsApp. Tipos de conexão liberados: "dedicated" e/ou "coexistence"
|
|
3907
|
+
* (padrão "dedicated"). Uma lista sem nenhum tipo válido responde
|
|
3843
3908
|
* `422 invalid_connection_types`; tipos desconhecidos ao lado de válidos são
|
|
3844
|
-
* ignorados.
|
|
3909
|
+
* ignorados. Com `channel: "instagram"`, enviar a lista responde
|
|
3910
|
+
* `422 invalid_connection_types`.
|
|
3845
3911
|
*/
|
|
3846
3912
|
allowed_connection_types?: string[];
|
|
3847
3913
|
/**
|
|
@@ -3892,7 +3958,8 @@ declare class Customers {
|
|
|
3892
3958
|
* Cria um link de setup sob um cliente (expira em 30 dias). Envie a `url`
|
|
3893
3959
|
* devolvida ao Cliente; veja em {@link CreateSetupLinkParams} como funcionam
|
|
3894
3960
|
* os redirecionamentos. URL de redirecionamento inválida lança
|
|
3895
|
-
* `BotoZapError` com `code: "invalid_redirect_url"` (422)
|
|
3961
|
+
* `BotoZapError` com `code: "invalid_redirect_url"` (422); canal inválido,
|
|
3962
|
+
* `code: "invalid_channel"` (422).
|
|
3896
3963
|
*/
|
|
3897
3964
|
createSetupLink(customerId: string, params?: CreateSetupLinkParams): Promise<SetupLink>;
|
|
3898
3965
|
/** Atualiza status/expiração de um link de setup. */
|
|
@@ -4855,6 +4922,90 @@ declare class Usage {
|
|
|
4855
4922
|
metaCosts(params?: MetaCostsParams): Promise<MetaCostReport>;
|
|
4856
4923
|
}
|
|
4857
4924
|
|
|
4925
|
+
/**
|
|
4926
|
+
* Plano da Conta: `paid` (plano pago), `free`, `trial` (teste grátis) ou
|
|
4927
|
+
* `courtesy` (conta cortesia ou interna, sem cobrança). Valores novos podem surgir.
|
|
4928
|
+
*/
|
|
4929
|
+
type BillingPlan = "paid" | "free" | "trial" | "courtesy" | (string & {});
|
|
4930
|
+
/**
|
|
4931
|
+
* Slot adicional: cada negócio além do que o plano inclui ocupa um slot com
|
|
4932
|
+
* assinatura própria (R$ 47/mês).
|
|
4933
|
+
*/
|
|
4934
|
+
interface BusinessSlot {
|
|
4935
|
+
id: string;
|
|
4936
|
+
/** `open` (ativo) ou `canceled`. */
|
|
4937
|
+
status: "open" | "canceled" | (string & {});
|
|
4938
|
+
/** Cliente que ocupa o slot; `null` quando o slot está vazio. */
|
|
4939
|
+
customer_id: string | null;
|
|
4940
|
+
customer_name: string | null;
|
|
4941
|
+
/** Valor mensal em centavos (4700). */
|
|
4942
|
+
amount_cents: number;
|
|
4943
|
+
/** `true` quando a fatura atual do slot está paga. */
|
|
4944
|
+
paid: boolean;
|
|
4945
|
+
/** Vencimento em aberto (`YYYY-MM-DD`). */
|
|
4946
|
+
next_due_date: string;
|
|
4947
|
+
/** Link da fatura; `null` enquanto ainda não está disponível. */
|
|
4948
|
+
invoice_url: string | null;
|
|
4949
|
+
/**
|
|
4950
|
+
* `true` quando o negócio que ocupa o slot está pausado porque a fatura
|
|
4951
|
+
* venceu há mais de 7 dias. Pagar libera na hora.
|
|
4952
|
+
*/
|
|
4953
|
+
paused: boolean;
|
|
4954
|
+
/** ISO 8601. */
|
|
4955
|
+
created_at: string;
|
|
4956
|
+
}
|
|
4957
|
+
/** Resposta de `GET /v1/billing`: plano da Conta e slots adicionais. */
|
|
4958
|
+
interface Billing {
|
|
4959
|
+
plan: BillingPlan;
|
|
4960
|
+
/** Negócios incluídos no plano; `null` = sem limite. */
|
|
4961
|
+
included_businesses: number | null;
|
|
4962
|
+
/** Negócios extras do contrato antigo (não usam slot). */
|
|
4963
|
+
legacy_extra_businesses: number;
|
|
4964
|
+
/** Valor de cada slot em centavos (4700). */
|
|
4965
|
+
slot_amount_cents: number;
|
|
4966
|
+
/** `true` quando dá para comprar slot (plano pago com cadastro de cobrança). */
|
|
4967
|
+
can_add_slot: boolean;
|
|
4968
|
+
/** Slots ativos, dos mais antigos aos mais novos. */
|
|
4969
|
+
slots: BusinessSlot[];
|
|
4970
|
+
}
|
|
4971
|
+
/** Opções de {@link BillingSlots.create}. */
|
|
4972
|
+
interface CreateBusinessSlotOptions {
|
|
4973
|
+
/**
|
|
4974
|
+
* Chave da compra (8 a 200 caracteres ASCII, sem espaço). Repetir com a
|
|
4975
|
+
* mesma chave devolve o mesmo slot em vez de comprar outro. Sem ela, cada
|
|
4976
|
+
* chamada compra um slot.
|
|
4977
|
+
*/
|
|
4978
|
+
idempotencyKey?: string;
|
|
4979
|
+
}
|
|
4980
|
+
/** Slots adicionais (`/v1/billing/slots`). */
|
|
4981
|
+
declare class BillingSlots {
|
|
4982
|
+
private readonly client;
|
|
4983
|
+
constructor(client: BotoZap);
|
|
4984
|
+
/**
|
|
4985
|
+
* Compra um slot vazio: gera cobrança de R$ 47/mês. Scope `billing:write`.
|
|
4986
|
+
* `invoice_url` pode vir `null`; a fatura chega em instantes em
|
|
4987
|
+
* {@link BillingResource.get}. Recusas: 402 `plan_required` (Free ou teste: assine o
|
|
4988
|
+
* plano), 402 `slot_limit` (já há 2 slots com fatura em aberto: pague uma),
|
|
4989
|
+
* 402 `billing_customer_required` (conta sem cadastro de cobrança: fale com o
|
|
4990
|
+
* suporte), 422 `invalid_idempotency_key`.
|
|
4991
|
+
*/
|
|
4992
|
+
create(options?: CreateBusinessSlotOptions): Promise<BusinessSlot>;
|
|
4993
|
+
/**
|
|
4994
|
+
* Cancela um slot vazio, sem reembolso. Responde 204, também quando o slot
|
|
4995
|
+
* já estava cancelado. Slot ocupado responde 409 `slot_in_use`: desconecte o
|
|
4996
|
+
* negócio antes. Scope `billing:write`.
|
|
4997
|
+
*/
|
|
4998
|
+
cancel(id: string): Promise<void>;
|
|
4999
|
+
}
|
|
5000
|
+
/** Plano da Conta e slots adicionais (`/v1/billing`). Só chave de API. */
|
|
5001
|
+
declare class BillingResource {
|
|
5002
|
+
private readonly client;
|
|
5003
|
+
readonly slots: BillingSlots;
|
|
5004
|
+
constructor(client: BotoZap);
|
|
5005
|
+
/** Plano, negócios incluídos e slots ativos. Scope `billing:read`. */
|
|
5006
|
+
get(): Promise<Billing>;
|
|
5007
|
+
}
|
|
5008
|
+
|
|
4858
5009
|
/** Membros da conta (somente leitura via API). */
|
|
4859
5010
|
declare class Users {
|
|
4860
5011
|
private readonly client;
|
|
@@ -4969,6 +5120,8 @@ declare class BotoZap {
|
|
|
4969
5120
|
readonly media: Media;
|
|
4970
5121
|
readonly events: Events;
|
|
4971
5122
|
readonly usage: Usage;
|
|
5123
|
+
/** Plano da Conta e slots adicionais (só chave de API). */
|
|
5124
|
+
readonly billing: BillingResource;
|
|
4972
5125
|
readonly users: Users;
|
|
4973
5126
|
readonly apiLogs: ApiLogs;
|
|
4974
5127
|
readonly webhookDeliveries: WebhookDeliveries;
|
|
@@ -5029,12 +5182,23 @@ declare class BotoZapError extends Error {
|
|
|
5029
5182
|
* (429, limite 1:1 do Free). Plano: `plan_restricted` (403, escritas de IA,
|
|
5030
5183
|
* Agenda, Calendário e Jornadas fora do plano), `free_number_cap` (402, setup
|
|
5031
5184
|
* além do teto de Números do Free). IA: `provider_not_enabled` (422, credencial
|
|
5032
|
-
* nova de provedor com `accepts_new_credentials: false`).
|
|
5185
|
+
* nova de provedor com `accepts_new_credentials: false`). Cobrança:
|
|
5186
|
+
* `business_payment_required` (402 no envio: o negócio está pausado porque a
|
|
5187
|
+
* fatura do slot venceu há mais de 7 dias; pague e envie de novo),
|
|
5188
|
+
* `plan_required` (402, comprar slot no Free ou teste), `slot_limit` (402, já há
|
|
5189
|
+
* 2 slots com fatura em aberto), `billing_customer_required` (402, conta sem
|
|
5190
|
+
* cadastro de cobrança), `slot_in_use` (409, cancelar slot ocupado).
|
|
5033
5191
|
*/
|
|
5034
|
-
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" | (string & {});
|
|
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 & {});
|
|
5035
5193
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
5036
5194
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
5037
5195
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
5038
5196
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
5197
|
+
/**
|
|
5198
|
+
* True quando o envio foi recusado porque o negócio está pausado: a fatura do
|
|
5199
|
+
* slot venceu há mais de 7 dias. Pagar a fatura libera na hora; repetir antes
|
|
5200
|
+
* disso não adianta. Não é recusa de plano ({@link isPlanError} é `false`).
|
|
5201
|
+
*/
|
|
5202
|
+
declare function isBusinessPaymentRequired(error: unknown): error is BotoZapError;
|
|
5039
5203
|
|
|
5040
|
-
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, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, 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 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, isPlanError };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -115,9 +115,24 @@ interface OffsetParams {
|
|
|
115
115
|
per_page?: number;
|
|
116
116
|
}
|
|
117
117
|
/** Cliente (customer) da sua conta. */
|
|
118
|
+
/** Slot adicional que o Cliente ocupa (ver `billing.get()`). */
|
|
119
|
+
interface CustomerBusinessSlot {
|
|
120
|
+
slot_id: string;
|
|
121
|
+
/**
|
|
122
|
+
* `true` quando o negócio está pausado porque a fatura do slot venceu há
|
|
123
|
+
* mais de 7 dias. Envios respondem 402 `business_payment_required` até o
|
|
124
|
+
* pagamento.
|
|
125
|
+
*/
|
|
126
|
+
paused: boolean;
|
|
127
|
+
}
|
|
118
128
|
interface Customer {
|
|
119
129
|
id: string;
|
|
120
130
|
name?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Slot adicional ocupado pelo Cliente; `null` quando ele está no que o plano
|
|
133
|
+
* inclui. Ausente em servidores antigos.
|
|
134
|
+
*/
|
|
135
|
+
business_slot?: CustomerBusinessSlot | null;
|
|
121
136
|
[key: string]: unknown;
|
|
122
137
|
}
|
|
123
138
|
/**
|
|
@@ -445,15 +460,24 @@ interface MediaAsset {
|
|
|
445
460
|
expires_at: string;
|
|
446
461
|
}
|
|
447
462
|
/**
|
|
448
|
-
* Link de setup de um cliente (Embedded Signup
|
|
463
|
+
* Link de setup de um cliente (Embedded Signup no WhatsApp, login do Instagram
|
|
464
|
+
* no Instagram). Shape do contrato
|
|
449
465
|
* (ver `/v1/customers/:id/setup_links`): a `url` embute o token opaco; o token
|
|
450
466
|
* cru nunca é exposto separadamente.
|
|
451
467
|
*/
|
|
452
468
|
interface SetupLink {
|
|
453
469
|
id: string;
|
|
470
|
+
/** Canal que o link conecta (cada link conecta um canal só). */
|
|
471
|
+
channel: "whatsapp" | "instagram";
|
|
454
472
|
status: string;
|
|
473
|
+
/**
|
|
474
|
+
* Andamento da conexão. Apesar do nome, vale para os dois canais: num link do
|
|
475
|
+
* Instagram passa a `completed` quando a conta do Instagram conecta.
|
|
476
|
+
*/
|
|
455
477
|
whatsapp_setup_status: string;
|
|
478
|
+
/** `/whatsapp/setup/<token>` ou `/instagram/setup/<token>`, conforme o canal. */
|
|
456
479
|
url: string;
|
|
480
|
+
/** Modos do WhatsApp; sempre `[]` em links do Instagram. */
|
|
457
481
|
allowed_connection_types: string[];
|
|
458
482
|
/**
|
|
459
483
|
* Legado: `null` em links novos. A página do link é sempre em português,
|
|
@@ -476,8 +500,37 @@ interface SetupLink {
|
|
|
476
500
|
expires_at: string | null;
|
|
477
501
|
created_at: string;
|
|
478
502
|
updated_at: string;
|
|
503
|
+
/**
|
|
504
|
+
* O que acontece na cobrança quando o Cliente conectar (conferência só de
|
|
505
|
+
* leitura). `null` quando não deu para conferir agora; ausente em servidores
|
|
506
|
+
* antigos.
|
|
507
|
+
*/
|
|
508
|
+
connection_billing?: ConnectionBilling | null;
|
|
479
509
|
[key: string]: unknown;
|
|
480
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* Resultado previsto da conexão: `included` (entra no que o plano inclui),
|
|
513
|
+
* `occupies_slot` (usa um slot vazio), `creates_slot` (compra um slot novo de
|
|
514
|
+
* R$ 47/mês) ou `refused` (a conexão será recusada; veja `reason`).
|
|
515
|
+
*/
|
|
516
|
+
type ConnectionBillingOutcome = "included" | "occupies_slot" | "creates_slot" | "refused" | (string & {});
|
|
517
|
+
/**
|
|
518
|
+
* Por que a conexão será recusada: `free_cap` (Free ou teste: assine o plano),
|
|
519
|
+
* `slot_limit` (já há 2 slots com fatura em aberto: pague uma),
|
|
520
|
+
* `billing_customer_required` (conta sem cadastro de cobrança: fale com o
|
|
521
|
+
* suporte) ou `capacity_required` (compre um slot antes de conectar).
|
|
522
|
+
*/
|
|
523
|
+
type ConnectionBillingRefusal = "free_cap" | "slot_limit" | "billing_customer_required" | "capacity_required" | (string & {});
|
|
524
|
+
/** Cobrança prevista para a conexão de um link de setup. */
|
|
525
|
+
interface ConnectionBilling {
|
|
526
|
+
outcome: ConnectionBillingOutcome;
|
|
527
|
+
/** 4700 em `creates_slot`; `null` nos demais. */
|
|
528
|
+
amount_cents: number | null;
|
|
529
|
+
/** Preenchido só em `refused`. */
|
|
530
|
+
reason: ConnectionBillingRefusal | null;
|
|
531
|
+
/** Texto em português para mostrar ao usuário. */
|
|
532
|
+
message: string;
|
|
533
|
+
}
|
|
481
534
|
|
|
482
535
|
/** Public /api/v1/ai contracts. Revisions are opaque strings unless the endpoint explicitly uses a number. */
|
|
483
536
|
type AiProvider = "anthropic" | "openai" | "google" | "openrouter" | "deepseek" | "xai";
|
|
@@ -3835,13 +3888,26 @@ interface UpdateCustomerParams {
|
|
|
3835
3888
|
* link continua válido. A query string que a sua URL já tiver é preservada e o
|
|
3836
3889
|
* token do link nunca é enviado. Link expirado ou revogado mostra a página de
|
|
3837
3890
|
* erro, sem redirecionar.
|
|
3891
|
+
*
|
|
3892
|
+
* Cada link conecta um canal só (`channel`). No do Instagram, o Cliente
|
|
3893
|
+
* confirma que a conta é profissional e que as mensagens estão liberadas e
|
|
3894
|
+
* entra com o Instagram; sucesso vai para `success_redirect_url` com
|
|
3895
|
+
* `status=completed` e, numa falha, a página oferece voltar para
|
|
3896
|
+
* `failure_redirect_url` com `status=cancelled`.
|
|
3838
3897
|
*/
|
|
3839
3898
|
interface CreateSetupLinkParams {
|
|
3840
3899
|
/**
|
|
3841
|
-
*
|
|
3842
|
-
*
|
|
3900
|
+
* Canal que o link conecta: "whatsapp" (padrão) ou "instagram". Outro valor
|
|
3901
|
+
* responde `422 invalid_channel`. O link do Instagram volta com
|
|
3902
|
+
* `allowed_connection_types: []` e `url` em `/instagram/setup/<token>`.
|
|
3903
|
+
*/
|
|
3904
|
+
channel?: "whatsapp" | "instagram";
|
|
3905
|
+
/**
|
|
3906
|
+
* Só WhatsApp. Tipos de conexão liberados: "dedicated" e/ou "coexistence"
|
|
3907
|
+
* (padrão "dedicated"). Uma lista sem nenhum tipo válido responde
|
|
3843
3908
|
* `422 invalid_connection_types`; tipos desconhecidos ao lado de válidos são
|
|
3844
|
-
* ignorados.
|
|
3909
|
+
* ignorados. Com `channel: "instagram"`, enviar a lista responde
|
|
3910
|
+
* `422 invalid_connection_types`.
|
|
3845
3911
|
*/
|
|
3846
3912
|
allowed_connection_types?: string[];
|
|
3847
3913
|
/**
|
|
@@ -3892,7 +3958,8 @@ declare class Customers {
|
|
|
3892
3958
|
* Cria um link de setup sob um cliente (expira em 30 dias). Envie a `url`
|
|
3893
3959
|
* devolvida ao Cliente; veja em {@link CreateSetupLinkParams} como funcionam
|
|
3894
3960
|
* os redirecionamentos. URL de redirecionamento inválida lança
|
|
3895
|
-
* `BotoZapError` com `code: "invalid_redirect_url"` (422)
|
|
3961
|
+
* `BotoZapError` com `code: "invalid_redirect_url"` (422); canal inválido,
|
|
3962
|
+
* `code: "invalid_channel"` (422).
|
|
3896
3963
|
*/
|
|
3897
3964
|
createSetupLink(customerId: string, params?: CreateSetupLinkParams): Promise<SetupLink>;
|
|
3898
3965
|
/** Atualiza status/expiração de um link de setup. */
|
|
@@ -4855,6 +4922,90 @@ declare class Usage {
|
|
|
4855
4922
|
metaCosts(params?: MetaCostsParams): Promise<MetaCostReport>;
|
|
4856
4923
|
}
|
|
4857
4924
|
|
|
4925
|
+
/**
|
|
4926
|
+
* Plano da Conta: `paid` (plano pago), `free`, `trial` (teste grátis) ou
|
|
4927
|
+
* `courtesy` (conta cortesia ou interna, sem cobrança). Valores novos podem surgir.
|
|
4928
|
+
*/
|
|
4929
|
+
type BillingPlan = "paid" | "free" | "trial" | "courtesy" | (string & {});
|
|
4930
|
+
/**
|
|
4931
|
+
* Slot adicional: cada negócio além do que o plano inclui ocupa um slot com
|
|
4932
|
+
* assinatura própria (R$ 47/mês).
|
|
4933
|
+
*/
|
|
4934
|
+
interface BusinessSlot {
|
|
4935
|
+
id: string;
|
|
4936
|
+
/** `open` (ativo) ou `canceled`. */
|
|
4937
|
+
status: "open" | "canceled" | (string & {});
|
|
4938
|
+
/** Cliente que ocupa o slot; `null` quando o slot está vazio. */
|
|
4939
|
+
customer_id: string | null;
|
|
4940
|
+
customer_name: string | null;
|
|
4941
|
+
/** Valor mensal em centavos (4700). */
|
|
4942
|
+
amount_cents: number;
|
|
4943
|
+
/** `true` quando a fatura atual do slot está paga. */
|
|
4944
|
+
paid: boolean;
|
|
4945
|
+
/** Vencimento em aberto (`YYYY-MM-DD`). */
|
|
4946
|
+
next_due_date: string;
|
|
4947
|
+
/** Link da fatura; `null` enquanto ainda não está disponível. */
|
|
4948
|
+
invoice_url: string | null;
|
|
4949
|
+
/**
|
|
4950
|
+
* `true` quando o negócio que ocupa o slot está pausado porque a fatura
|
|
4951
|
+
* venceu há mais de 7 dias. Pagar libera na hora.
|
|
4952
|
+
*/
|
|
4953
|
+
paused: boolean;
|
|
4954
|
+
/** ISO 8601. */
|
|
4955
|
+
created_at: string;
|
|
4956
|
+
}
|
|
4957
|
+
/** Resposta de `GET /v1/billing`: plano da Conta e slots adicionais. */
|
|
4958
|
+
interface Billing {
|
|
4959
|
+
plan: BillingPlan;
|
|
4960
|
+
/** Negócios incluídos no plano; `null` = sem limite. */
|
|
4961
|
+
included_businesses: number | null;
|
|
4962
|
+
/** Negócios extras do contrato antigo (não usam slot). */
|
|
4963
|
+
legacy_extra_businesses: number;
|
|
4964
|
+
/** Valor de cada slot em centavos (4700). */
|
|
4965
|
+
slot_amount_cents: number;
|
|
4966
|
+
/** `true` quando dá para comprar slot (plano pago com cadastro de cobrança). */
|
|
4967
|
+
can_add_slot: boolean;
|
|
4968
|
+
/** Slots ativos, dos mais antigos aos mais novos. */
|
|
4969
|
+
slots: BusinessSlot[];
|
|
4970
|
+
}
|
|
4971
|
+
/** Opções de {@link BillingSlots.create}. */
|
|
4972
|
+
interface CreateBusinessSlotOptions {
|
|
4973
|
+
/**
|
|
4974
|
+
* Chave da compra (8 a 200 caracteres ASCII, sem espaço). Repetir com a
|
|
4975
|
+
* mesma chave devolve o mesmo slot em vez de comprar outro. Sem ela, cada
|
|
4976
|
+
* chamada compra um slot.
|
|
4977
|
+
*/
|
|
4978
|
+
idempotencyKey?: string;
|
|
4979
|
+
}
|
|
4980
|
+
/** Slots adicionais (`/v1/billing/slots`). */
|
|
4981
|
+
declare class BillingSlots {
|
|
4982
|
+
private readonly client;
|
|
4983
|
+
constructor(client: BotoZap);
|
|
4984
|
+
/**
|
|
4985
|
+
* Compra um slot vazio: gera cobrança de R$ 47/mês. Scope `billing:write`.
|
|
4986
|
+
* `invoice_url` pode vir `null`; a fatura chega em instantes em
|
|
4987
|
+
* {@link BillingResource.get}. Recusas: 402 `plan_required` (Free ou teste: assine o
|
|
4988
|
+
* plano), 402 `slot_limit` (já há 2 slots com fatura em aberto: pague uma),
|
|
4989
|
+
* 402 `billing_customer_required` (conta sem cadastro de cobrança: fale com o
|
|
4990
|
+
* suporte), 422 `invalid_idempotency_key`.
|
|
4991
|
+
*/
|
|
4992
|
+
create(options?: CreateBusinessSlotOptions): Promise<BusinessSlot>;
|
|
4993
|
+
/**
|
|
4994
|
+
* Cancela um slot vazio, sem reembolso. Responde 204, também quando o slot
|
|
4995
|
+
* já estava cancelado. Slot ocupado responde 409 `slot_in_use`: desconecte o
|
|
4996
|
+
* negócio antes. Scope `billing:write`.
|
|
4997
|
+
*/
|
|
4998
|
+
cancel(id: string): Promise<void>;
|
|
4999
|
+
}
|
|
5000
|
+
/** Plano da Conta e slots adicionais (`/v1/billing`). Só chave de API. */
|
|
5001
|
+
declare class BillingResource {
|
|
5002
|
+
private readonly client;
|
|
5003
|
+
readonly slots: BillingSlots;
|
|
5004
|
+
constructor(client: BotoZap);
|
|
5005
|
+
/** Plano, negócios incluídos e slots ativos. Scope `billing:read`. */
|
|
5006
|
+
get(): Promise<Billing>;
|
|
5007
|
+
}
|
|
5008
|
+
|
|
4858
5009
|
/** Membros da conta (somente leitura via API). */
|
|
4859
5010
|
declare class Users {
|
|
4860
5011
|
private readonly client;
|
|
@@ -4969,6 +5120,8 @@ declare class BotoZap {
|
|
|
4969
5120
|
readonly media: Media;
|
|
4970
5121
|
readonly events: Events;
|
|
4971
5122
|
readonly usage: Usage;
|
|
5123
|
+
/** Plano da Conta e slots adicionais (só chave de API). */
|
|
5124
|
+
readonly billing: BillingResource;
|
|
4972
5125
|
readonly users: Users;
|
|
4973
5126
|
readonly apiLogs: ApiLogs;
|
|
4974
5127
|
readonly webhookDeliveries: WebhookDeliveries;
|
|
@@ -5029,12 +5182,23 @@ declare class BotoZapError extends Error {
|
|
|
5029
5182
|
* (429, limite 1:1 do Free). Plano: `plan_restricted` (403, escritas de IA,
|
|
5030
5183
|
* Agenda, Calendário e Jornadas fora do plano), `free_number_cap` (402, setup
|
|
5031
5184
|
* além do teto de Números do Free). IA: `provider_not_enabled` (422, credencial
|
|
5032
|
-
* nova de provedor com `accepts_new_credentials: false`).
|
|
5185
|
+
* nova de provedor com `accepts_new_credentials: false`). Cobrança:
|
|
5186
|
+
* `business_payment_required` (402 no envio: o negócio está pausado porque a
|
|
5187
|
+
* fatura do slot venceu há mais de 7 dias; pague e envie de novo),
|
|
5188
|
+
* `plan_required` (402, comprar slot no Free ou teste), `slot_limit` (402, já há
|
|
5189
|
+
* 2 slots com fatura em aberto), `billing_customer_required` (402, conta sem
|
|
5190
|
+
* cadastro de cobrança), `slot_in_use` (409, cancelar slot ocupado).
|
|
5033
5191
|
*/
|
|
5034
|
-
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" | (string & {});
|
|
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 & {});
|
|
5035
5193
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
5036
5194
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
5037
5195
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
5038
5196
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
5197
|
+
/**
|
|
5198
|
+
* True quando o envio foi recusado porque o negócio está pausado: a fatura do
|
|
5199
|
+
* slot venceu há mais de 7 dias. Pagar a fatura libera na hora; repetir antes
|
|
5200
|
+
* disso não adianta. Não é recusa de plano ({@link isPlanError} é `false`).
|
|
5201
|
+
*/
|
|
5202
|
+
declare function isBusinessPaymentRequired(error: unknown): error is BotoZapError;
|
|
5039
5203
|
|
|
5040
|
-
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, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, 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 Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, 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 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, isPlanError };
|
|
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 };
|