@botozap/sdk 0.4.1 → 0.7.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 +32 -0
- package/README.md +28 -6
- package/dist/index.cjs +6 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -76
- package/dist/index.d.ts +73 -76
- package/dist/index.js +6 -82
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -109,6 +109,8 @@ interface Assignment {
|
|
|
109
109
|
}
|
|
110
110
|
interface Webhook {
|
|
111
111
|
id: string;
|
|
112
|
+
/** Cliente cujas entregas o endpoint recebe; `null` = todos os da Conta. */
|
|
113
|
+
customer_id?: string | null;
|
|
112
114
|
url: string;
|
|
113
115
|
events?: string[];
|
|
114
116
|
active?: boolean;
|
|
@@ -122,13 +124,6 @@ interface PhoneNumber {
|
|
|
122
124
|
id: string;
|
|
123
125
|
[key: string]: unknown;
|
|
124
126
|
}
|
|
125
|
-
interface Flow {
|
|
126
|
-
id: string;
|
|
127
|
-
[key: string]: unknown;
|
|
128
|
-
}
|
|
129
|
-
interface FlowVersion {
|
|
130
|
-
[key: string]: unknown;
|
|
131
|
-
}
|
|
132
127
|
interface User {
|
|
133
128
|
id: string;
|
|
134
129
|
[key: string]: unknown;
|
|
@@ -147,8 +142,17 @@ interface BotoZapEvent {
|
|
|
147
142
|
/** Cursor monotônico e contíguo, serializado como string. */
|
|
148
143
|
cursor: string;
|
|
149
144
|
type: string;
|
|
150
|
-
/**
|
|
151
|
-
|
|
145
|
+
/**
|
|
146
|
+
* WAMID da mensagem do WhatsApp que originou o Evento. `null` fora do
|
|
147
|
+
* WhatsApp (ex.: Instagram) ou em Eventos sem mensagem; use `external_id`
|
|
148
|
+
* para o identificador genérico do canal.
|
|
149
|
+
*/
|
|
150
|
+
message_id: string | null;
|
|
151
|
+
/**
|
|
152
|
+
* Identificador da mensagem no canal de origem: o `wamid` no WhatsApp, o
|
|
153
|
+
* `mid` no Instagram. Pode ser `null` em Eventos sem mensagem.
|
|
154
|
+
*/
|
|
155
|
+
external_id: string | null;
|
|
152
156
|
/** UUID interno da Mensagem; pode ser null em status de Broadcast. */
|
|
153
157
|
message_resource_id: string | null;
|
|
154
158
|
occurred_at: string;
|
|
@@ -383,6 +387,14 @@ type AiAgent = {
|
|
|
383
387
|
archived: boolean;
|
|
384
388
|
published_version_id: string | null;
|
|
385
389
|
updated_at: string;
|
|
390
|
+
/** Estado do ciclo de vida. Presente em `ai.agents.list` e `ai.agents.get`. */
|
|
391
|
+
lifecycle?: "draft" | "published" | "active" | "paused" | "archived";
|
|
392
|
+
/** `true` só quando o agente está de fato respondendo no canal. Presente em list/get. */
|
|
393
|
+
serving?: boolean;
|
|
394
|
+
/** Como o agente atende: vínculo direto ou membro de roteador ativo; `null` quando não atende. */
|
|
395
|
+
serving_via?: "direct" | "router" | null;
|
|
396
|
+
/** Conta de canal da versão publicada; `null` sem versão publicada. */
|
|
397
|
+
channel_account_id?: string | null;
|
|
386
398
|
};
|
|
387
399
|
type AiAgentVersion = {
|
|
388
400
|
id: string;
|
|
@@ -2677,8 +2689,16 @@ interface Appointment extends Required<AppointmentFields> {
|
|
|
2677
2689
|
google_conflict: Record<string, unknown> | null;
|
|
2678
2690
|
google_event_id: string | null;
|
|
2679
2691
|
google_selection_id: string | null;
|
|
2680
|
-
|
|
2681
|
-
|
|
2692
|
+
/**
|
|
2693
|
+
* @deprecated Dado interno da sincronização com o Google Calendar. A API deixa de
|
|
2694
|
+
* enviar este campo a partir de 26/10/2026; não dependa dele.
|
|
2695
|
+
*/
|
|
2696
|
+
google_etag?: string | null;
|
|
2697
|
+
/**
|
|
2698
|
+
* @deprecated Dado interno da sincronização com o Google Calendar. A API deixa de
|
|
2699
|
+
* enviar este campo a partir de 26/10/2026; não dependa dele.
|
|
2700
|
+
*/
|
|
2701
|
+
google_base_data?: Record<string, unknown> | null;
|
|
2682
2702
|
google_synced_revision: number | null;
|
|
2683
2703
|
buffer_before_minutes: number;
|
|
2684
2704
|
buffer_after_minutes: number;
|
|
@@ -3482,11 +3502,27 @@ interface ListRecipientsParams extends CursorParams {
|
|
|
3482
3502
|
/** Filtra por status do destinatário (ex.: "pending", "sent", "failed"). */
|
|
3483
3503
|
status?: string;
|
|
3484
3504
|
}
|
|
3505
|
+
/**
|
|
3506
|
+
* Um destinatário de `addRecipients`. `to_recipient` é telefone internacional
|
|
3507
|
+
* (E.164) ou BSUID; `components` são os parâmetros do template
|
|
3508
|
+
* PARA ESTE destinatário, no mesmo formato de `POST /v1/messages` (até 20
|
|
3509
|
+
* objetos, 16 KB serializados).
|
|
3510
|
+
*/
|
|
3511
|
+
interface BroadcastRecipientInput {
|
|
3512
|
+
to_recipient: string;
|
|
3513
|
+
components?: Record<string, unknown>[];
|
|
3514
|
+
}
|
|
3515
|
+
/** Erro por item de `addRecipients`; `index` aponta a posição no array enviado. */
|
|
3516
|
+
interface AddRecipientsError {
|
|
3517
|
+
index: number;
|
|
3518
|
+
to_recipient?: string;
|
|
3519
|
+
reason: string;
|
|
3520
|
+
}
|
|
3485
3521
|
/** Resultado de `addRecipients`: quantos entraram, quantos eram duplicados, erros. */
|
|
3486
3522
|
interface AddRecipientsResult {
|
|
3487
3523
|
added: number;
|
|
3488
3524
|
duplicates: number;
|
|
3489
|
-
errors:
|
|
3525
|
+
errors: AddRecipientsError[];
|
|
3490
3526
|
}
|
|
3491
3527
|
/** Transmissões: criar, adicionar destinatários, agendar/enviar/cancelar. */
|
|
3492
3528
|
declare class Broadcasts {
|
|
@@ -3499,8 +3535,13 @@ declare class Broadcasts {
|
|
|
3499
3535
|
update(id: string, params: UpdateBroadcastParams): Promise<Broadcast>;
|
|
3500
3536
|
/** Lista os destinatários de uma transmissão (paginação por cursor). */
|
|
3501
3537
|
listRecipients(id: string, params?: ListRecipientsParams): Promise<CursorList<BroadcastRecipient>>;
|
|
3502
|
-
/**
|
|
3503
|
-
|
|
3538
|
+
/**
|
|
3539
|
+
* Adiciona destinatários a uma transmissão em `draft` (até 1000 por chamada).
|
|
3540
|
+
* Cada item é um objeto `{ to_recipient, components? }` — strings soltas não
|
|
3541
|
+
* são aceitas. Itens inválidos não derrubam o lote: voltam em `errors`.
|
|
3542
|
+
* Duplicatas (no lote ou já cadastradas) contam em `duplicates`.
|
|
3543
|
+
*/
|
|
3544
|
+
addRecipients(id: string, recipients: BroadcastRecipientInput[]): Promise<AddRecipientsResult>;
|
|
3504
3545
|
/** Remove TODOS os destinatários. Responde 204 (sem corpo). */
|
|
3505
3546
|
removeRecipients(id: string): Promise<void>;
|
|
3506
3547
|
schedule(id: string, params: ScheduleBroadcastParams): Promise<Broadcast>;
|
|
@@ -3621,8 +3662,20 @@ interface CreateWebhookParams {
|
|
|
3621
3662
|
secret?: string;
|
|
3622
3663
|
/** `{ Authorization: "Bearer …" }` — persistido no Vault; ausente na resposta. */
|
|
3623
3664
|
headers?: WebhookAuthorizationHeaders;
|
|
3665
|
+
/**
|
|
3666
|
+
* Limita as entregas a um Cliente (UUID) da Conta da chave. Omitido, `null`
|
|
3667
|
+
* ou vazio = sem filtro. UUID inválido → 422 `invalid_customer_id`; Cliente
|
|
3668
|
+
* de outra Conta → 404 `customer_not_found`.
|
|
3669
|
+
*/
|
|
3670
|
+
customer_id?: string | null;
|
|
3624
3671
|
}
|
|
3625
3672
|
interface UpdateWebhookParams {
|
|
3673
|
+
/**
|
|
3674
|
+
* Rotaciona o secret de assinatura (16 a 256 caracteres, sem quebra de
|
|
3675
|
+
* linha). Vale a partir da próxima tentativa de entrega; a resposta não
|
|
3676
|
+
* devolve o valor. Formato inválido responde `422 invalid_secret`.
|
|
3677
|
+
*/
|
|
3678
|
+
secret?: string;
|
|
3626
3679
|
url?: string;
|
|
3627
3680
|
events?: string[];
|
|
3628
3681
|
active?: boolean;
|
|
@@ -3633,6 +3686,11 @@ interface UpdateWebhookParams {
|
|
|
3633
3686
|
headers?: {
|
|
3634
3687
|
Authorization?: string | null;
|
|
3635
3688
|
};
|
|
3689
|
+
/**
|
|
3690
|
+
* Omitido = não mexe. UUID de um Cliente da Conta limita as entregas a ele;
|
|
3691
|
+
* `null` (ou string vazia) remove o filtro sem invalidar a verificação.
|
|
3692
|
+
*/
|
|
3693
|
+
customer_id?: string | null;
|
|
3636
3694
|
}
|
|
3637
3695
|
/** Webhooks: endpoints assinados que recebem os eventos da conta. */
|
|
3638
3696
|
declare class Webhooks {
|
|
@@ -3667,66 +3725,6 @@ declare class PhoneNumbers {
|
|
|
3667
3725
|
health(id: string): Promise<Record<string, unknown>>;
|
|
3668
3726
|
}
|
|
3669
3727
|
|
|
3670
|
-
interface CreateFlowParams {
|
|
3671
|
-
name?: string;
|
|
3672
|
-
[key: string]: unknown;
|
|
3673
|
-
}
|
|
3674
|
-
/**
|
|
3675
|
-
* Filtros de `flows.list` (paginação por offset). Flows vivem na Meta e a lista
|
|
3676
|
-
* é por WABA — a rota GET /v1/flows EXIGE `phone_number_id` OU
|
|
3677
|
-
* `waba_connection_id` (sem um deles responde 422 missing_target). Informe um.
|
|
3678
|
-
*/
|
|
3679
|
-
interface ListFlowsParams extends OffsetParams {
|
|
3680
|
-
/** phone_number_id (Meta) → resolve a conexão do número (escopado por conta). */
|
|
3681
|
-
phone_number_id?: string;
|
|
3682
|
-
/** Alternativa a `phone_number_id`: a conexão WABA cujos flows listar. */
|
|
3683
|
-
waba_connection_id?: string;
|
|
3684
|
-
}
|
|
3685
|
-
/**
|
|
3686
|
-
* Flows vivem na Meta, não no nosso banco — a amarração flow → conta é via
|
|
3687
|
-
* `phone_number_id` (resolve a WABA e o token). Por isso get/delete/publish/
|
|
3688
|
-
* setup_encryption/versions/data_endpoint EXIGEM `phone_number_id`.
|
|
3689
|
-
*/
|
|
3690
|
-
interface FlowPhoneParams {
|
|
3691
|
-
/** phone_number_id (Meta) do número cuja WABA hospeda o flow. */
|
|
3692
|
-
phone_number_id: string;
|
|
3693
|
-
}
|
|
3694
|
-
/** Corpo de `POST /v1/flows/:id/versions` — sobe um novo flow.json. */
|
|
3695
|
-
interface CreateFlowVersionParams {
|
|
3696
|
-
phone_number_id: string;
|
|
3697
|
-
/** JSON do flow (objeto ou string JSON válida). */
|
|
3698
|
-
flow_json: unknown;
|
|
3699
|
-
[key: string]: unknown;
|
|
3700
|
-
}
|
|
3701
|
-
/** Corpo de `POST /v1/flows/:id/data_endpoint` — conecta a forward URL do dev. */
|
|
3702
|
-
interface SetFlowDataEndpointParams {
|
|
3703
|
-
phone_number_id: string;
|
|
3704
|
-
/** URL HTTPS do backend do dev que recebe o data_exchange. */
|
|
3705
|
-
forward_url: string;
|
|
3706
|
-
[key: string]: unknown;
|
|
3707
|
-
}
|
|
3708
|
-
/** WhatsApp Flows: criar, versionar, publicar e configurar data endpoint. */
|
|
3709
|
-
declare class Flows {
|
|
3710
|
-
private readonly client;
|
|
3711
|
-
constructor(client: BotoZap);
|
|
3712
|
-
/**
|
|
3713
|
-
* Lista os flows de uma WABA (paginação por offset/página). Informe
|
|
3714
|
-
* `phone_number_id` OU `waba_connection_id` — a rota exige um deles.
|
|
3715
|
-
*/
|
|
3716
|
-
list(params?: ListFlowsParams): Promise<OffsetList<Flow>>;
|
|
3717
|
-
get(id: string, params: FlowPhoneParams): Promise<Flow>;
|
|
3718
|
-
create(params: CreateFlowParams): Promise<Flow>;
|
|
3719
|
-
/** Remove um flow (só DRAFT, regra da Meta). Responde 204 (sem corpo). */
|
|
3720
|
-
delete(id: string, params: FlowPhoneParams): Promise<void>;
|
|
3721
|
-
publish(id: string, params: FlowPhoneParams): Promise<Flow>;
|
|
3722
|
-
/** Lista as versões de um flow (paginação por offset/página). */
|
|
3723
|
-
listVersions(id: string, params?: OffsetParams): Promise<OffsetList<FlowVersion>>;
|
|
3724
|
-
createVersion(id: string, params: CreateFlowVersionParams): Promise<FlowVersion>;
|
|
3725
|
-
setupEncryption(id: string, params: FlowPhoneParams): Promise<Record<string, unknown>>;
|
|
3726
|
-
getDataEndpoint(id: string): Promise<Record<string, unknown>>;
|
|
3727
|
-
setDataEndpoint(id: string, params: SetFlowDataEndpointParams): Promise<Record<string, unknown>>;
|
|
3728
|
-
}
|
|
3729
|
-
|
|
3730
3728
|
/** Corpo do `POST /v1/media` — espelha o contrato real da rota. */
|
|
3731
3729
|
interface UploadMediaParams {
|
|
3732
3730
|
/** URL http(s) de origem do arquivo. A BotoZap baixa (com guard SSRF) e sobe pra Cloud API. */
|
|
@@ -3871,7 +3869,6 @@ declare class BotoZap {
|
|
|
3871
3869
|
readonly opportunities: CrmResource<OpportunityFields, Opportunity>;
|
|
3872
3870
|
readonly demands: CrmResource<DemandFields, Demand>;
|
|
3873
3871
|
readonly radar: Radar;
|
|
3874
|
-
readonly flows: Flows;
|
|
3875
3872
|
readonly media: Media;
|
|
3876
3873
|
readonly events: Events;
|
|
3877
3874
|
readonly users: Users;
|
|
@@ -3917,4 +3914,4 @@ declare class BotoZapError extends Error {
|
|
|
3917
3914
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>);
|
|
3918
3915
|
}
|
|
3919
3916
|
|
|
3920
|
-
export { AI_CONFIGURABLE_PURPOSES, AI_OPERATIONS, AI_PURPOSES, 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 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 BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationNote, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type
|
|
3917
|
+
export { AI_CONFIGURABLE_PURPOSES, 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 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 BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationNote, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, 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 Demand, type DemandFields, type EventList, type EventPaging, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type Journey, type JourneyConfig, type JourneyEnrollment, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type MediaAsset, type MediaUploadResult, type Message, type MessageStatus, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, type PhoneNumber, 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 SendImageParams, type SendMediaParams, 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 UpdateContactParams, type UpdateCustomerParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, type Webhook, type WebhookAuthorizationHeaders, type WebhookDelivery };
|
package/dist/index.d.ts
CHANGED
|
@@ -109,6 +109,8 @@ interface Assignment {
|
|
|
109
109
|
}
|
|
110
110
|
interface Webhook {
|
|
111
111
|
id: string;
|
|
112
|
+
/** Cliente cujas entregas o endpoint recebe; `null` = todos os da Conta. */
|
|
113
|
+
customer_id?: string | null;
|
|
112
114
|
url: string;
|
|
113
115
|
events?: string[];
|
|
114
116
|
active?: boolean;
|
|
@@ -122,13 +124,6 @@ interface PhoneNumber {
|
|
|
122
124
|
id: string;
|
|
123
125
|
[key: string]: unknown;
|
|
124
126
|
}
|
|
125
|
-
interface Flow {
|
|
126
|
-
id: string;
|
|
127
|
-
[key: string]: unknown;
|
|
128
|
-
}
|
|
129
|
-
interface FlowVersion {
|
|
130
|
-
[key: string]: unknown;
|
|
131
|
-
}
|
|
132
127
|
interface User {
|
|
133
128
|
id: string;
|
|
134
129
|
[key: string]: unknown;
|
|
@@ -147,8 +142,17 @@ interface BotoZapEvent {
|
|
|
147
142
|
/** Cursor monotônico e contíguo, serializado como string. */
|
|
148
143
|
cursor: string;
|
|
149
144
|
type: string;
|
|
150
|
-
/**
|
|
151
|
-
|
|
145
|
+
/**
|
|
146
|
+
* WAMID da mensagem do WhatsApp que originou o Evento. `null` fora do
|
|
147
|
+
* WhatsApp (ex.: Instagram) ou em Eventos sem mensagem; use `external_id`
|
|
148
|
+
* para o identificador genérico do canal.
|
|
149
|
+
*/
|
|
150
|
+
message_id: string | null;
|
|
151
|
+
/**
|
|
152
|
+
* Identificador da mensagem no canal de origem: o `wamid` no WhatsApp, o
|
|
153
|
+
* `mid` no Instagram. Pode ser `null` em Eventos sem mensagem.
|
|
154
|
+
*/
|
|
155
|
+
external_id: string | null;
|
|
152
156
|
/** UUID interno da Mensagem; pode ser null em status de Broadcast. */
|
|
153
157
|
message_resource_id: string | null;
|
|
154
158
|
occurred_at: string;
|
|
@@ -383,6 +387,14 @@ type AiAgent = {
|
|
|
383
387
|
archived: boolean;
|
|
384
388
|
published_version_id: string | null;
|
|
385
389
|
updated_at: string;
|
|
390
|
+
/** Estado do ciclo de vida. Presente em `ai.agents.list` e `ai.agents.get`. */
|
|
391
|
+
lifecycle?: "draft" | "published" | "active" | "paused" | "archived";
|
|
392
|
+
/** `true` só quando o agente está de fato respondendo no canal. Presente em list/get. */
|
|
393
|
+
serving?: boolean;
|
|
394
|
+
/** Como o agente atende: vínculo direto ou membro de roteador ativo; `null` quando não atende. */
|
|
395
|
+
serving_via?: "direct" | "router" | null;
|
|
396
|
+
/** Conta de canal da versão publicada; `null` sem versão publicada. */
|
|
397
|
+
channel_account_id?: string | null;
|
|
386
398
|
};
|
|
387
399
|
type AiAgentVersion = {
|
|
388
400
|
id: string;
|
|
@@ -2677,8 +2689,16 @@ interface Appointment extends Required<AppointmentFields> {
|
|
|
2677
2689
|
google_conflict: Record<string, unknown> | null;
|
|
2678
2690
|
google_event_id: string | null;
|
|
2679
2691
|
google_selection_id: string | null;
|
|
2680
|
-
|
|
2681
|
-
|
|
2692
|
+
/**
|
|
2693
|
+
* @deprecated Dado interno da sincronização com o Google Calendar. A API deixa de
|
|
2694
|
+
* enviar este campo a partir de 26/10/2026; não dependa dele.
|
|
2695
|
+
*/
|
|
2696
|
+
google_etag?: string | null;
|
|
2697
|
+
/**
|
|
2698
|
+
* @deprecated Dado interno da sincronização com o Google Calendar. A API deixa de
|
|
2699
|
+
* enviar este campo a partir de 26/10/2026; não dependa dele.
|
|
2700
|
+
*/
|
|
2701
|
+
google_base_data?: Record<string, unknown> | null;
|
|
2682
2702
|
google_synced_revision: number | null;
|
|
2683
2703
|
buffer_before_minutes: number;
|
|
2684
2704
|
buffer_after_minutes: number;
|
|
@@ -3482,11 +3502,27 @@ interface ListRecipientsParams extends CursorParams {
|
|
|
3482
3502
|
/** Filtra por status do destinatário (ex.: "pending", "sent", "failed"). */
|
|
3483
3503
|
status?: string;
|
|
3484
3504
|
}
|
|
3505
|
+
/**
|
|
3506
|
+
* Um destinatário de `addRecipients`. `to_recipient` é telefone internacional
|
|
3507
|
+
* (E.164) ou BSUID; `components` são os parâmetros do template
|
|
3508
|
+
* PARA ESTE destinatário, no mesmo formato de `POST /v1/messages` (até 20
|
|
3509
|
+
* objetos, 16 KB serializados).
|
|
3510
|
+
*/
|
|
3511
|
+
interface BroadcastRecipientInput {
|
|
3512
|
+
to_recipient: string;
|
|
3513
|
+
components?: Record<string, unknown>[];
|
|
3514
|
+
}
|
|
3515
|
+
/** Erro por item de `addRecipients`; `index` aponta a posição no array enviado. */
|
|
3516
|
+
interface AddRecipientsError {
|
|
3517
|
+
index: number;
|
|
3518
|
+
to_recipient?: string;
|
|
3519
|
+
reason: string;
|
|
3520
|
+
}
|
|
3485
3521
|
/** Resultado de `addRecipients`: quantos entraram, quantos eram duplicados, erros. */
|
|
3486
3522
|
interface AddRecipientsResult {
|
|
3487
3523
|
added: number;
|
|
3488
3524
|
duplicates: number;
|
|
3489
|
-
errors:
|
|
3525
|
+
errors: AddRecipientsError[];
|
|
3490
3526
|
}
|
|
3491
3527
|
/** Transmissões: criar, adicionar destinatários, agendar/enviar/cancelar. */
|
|
3492
3528
|
declare class Broadcasts {
|
|
@@ -3499,8 +3535,13 @@ declare class Broadcasts {
|
|
|
3499
3535
|
update(id: string, params: UpdateBroadcastParams): Promise<Broadcast>;
|
|
3500
3536
|
/** Lista os destinatários de uma transmissão (paginação por cursor). */
|
|
3501
3537
|
listRecipients(id: string, params?: ListRecipientsParams): Promise<CursorList<BroadcastRecipient>>;
|
|
3502
|
-
/**
|
|
3503
|
-
|
|
3538
|
+
/**
|
|
3539
|
+
* Adiciona destinatários a uma transmissão em `draft` (até 1000 por chamada).
|
|
3540
|
+
* Cada item é um objeto `{ to_recipient, components? }` — strings soltas não
|
|
3541
|
+
* são aceitas. Itens inválidos não derrubam o lote: voltam em `errors`.
|
|
3542
|
+
* Duplicatas (no lote ou já cadastradas) contam em `duplicates`.
|
|
3543
|
+
*/
|
|
3544
|
+
addRecipients(id: string, recipients: BroadcastRecipientInput[]): Promise<AddRecipientsResult>;
|
|
3504
3545
|
/** Remove TODOS os destinatários. Responde 204 (sem corpo). */
|
|
3505
3546
|
removeRecipients(id: string): Promise<void>;
|
|
3506
3547
|
schedule(id: string, params: ScheduleBroadcastParams): Promise<Broadcast>;
|
|
@@ -3621,8 +3662,20 @@ interface CreateWebhookParams {
|
|
|
3621
3662
|
secret?: string;
|
|
3622
3663
|
/** `{ Authorization: "Bearer …" }` — persistido no Vault; ausente na resposta. */
|
|
3623
3664
|
headers?: WebhookAuthorizationHeaders;
|
|
3665
|
+
/**
|
|
3666
|
+
* Limita as entregas a um Cliente (UUID) da Conta da chave. Omitido, `null`
|
|
3667
|
+
* ou vazio = sem filtro. UUID inválido → 422 `invalid_customer_id`; Cliente
|
|
3668
|
+
* de outra Conta → 404 `customer_not_found`.
|
|
3669
|
+
*/
|
|
3670
|
+
customer_id?: string | null;
|
|
3624
3671
|
}
|
|
3625
3672
|
interface UpdateWebhookParams {
|
|
3673
|
+
/**
|
|
3674
|
+
* Rotaciona o secret de assinatura (16 a 256 caracteres, sem quebra de
|
|
3675
|
+
* linha). Vale a partir da próxima tentativa de entrega; a resposta não
|
|
3676
|
+
* devolve o valor. Formato inválido responde `422 invalid_secret`.
|
|
3677
|
+
*/
|
|
3678
|
+
secret?: string;
|
|
3626
3679
|
url?: string;
|
|
3627
3680
|
events?: string[];
|
|
3628
3681
|
active?: boolean;
|
|
@@ -3633,6 +3686,11 @@ interface UpdateWebhookParams {
|
|
|
3633
3686
|
headers?: {
|
|
3634
3687
|
Authorization?: string | null;
|
|
3635
3688
|
};
|
|
3689
|
+
/**
|
|
3690
|
+
* Omitido = não mexe. UUID de um Cliente da Conta limita as entregas a ele;
|
|
3691
|
+
* `null` (ou string vazia) remove o filtro sem invalidar a verificação.
|
|
3692
|
+
*/
|
|
3693
|
+
customer_id?: string | null;
|
|
3636
3694
|
}
|
|
3637
3695
|
/** Webhooks: endpoints assinados que recebem os eventos da conta. */
|
|
3638
3696
|
declare class Webhooks {
|
|
@@ -3667,66 +3725,6 @@ declare class PhoneNumbers {
|
|
|
3667
3725
|
health(id: string): Promise<Record<string, unknown>>;
|
|
3668
3726
|
}
|
|
3669
3727
|
|
|
3670
|
-
interface CreateFlowParams {
|
|
3671
|
-
name?: string;
|
|
3672
|
-
[key: string]: unknown;
|
|
3673
|
-
}
|
|
3674
|
-
/**
|
|
3675
|
-
* Filtros de `flows.list` (paginação por offset). Flows vivem na Meta e a lista
|
|
3676
|
-
* é por WABA — a rota GET /v1/flows EXIGE `phone_number_id` OU
|
|
3677
|
-
* `waba_connection_id` (sem um deles responde 422 missing_target). Informe um.
|
|
3678
|
-
*/
|
|
3679
|
-
interface ListFlowsParams extends OffsetParams {
|
|
3680
|
-
/** phone_number_id (Meta) → resolve a conexão do número (escopado por conta). */
|
|
3681
|
-
phone_number_id?: string;
|
|
3682
|
-
/** Alternativa a `phone_number_id`: a conexão WABA cujos flows listar. */
|
|
3683
|
-
waba_connection_id?: string;
|
|
3684
|
-
}
|
|
3685
|
-
/**
|
|
3686
|
-
* Flows vivem na Meta, não no nosso banco — a amarração flow → conta é via
|
|
3687
|
-
* `phone_number_id` (resolve a WABA e o token). Por isso get/delete/publish/
|
|
3688
|
-
* setup_encryption/versions/data_endpoint EXIGEM `phone_number_id`.
|
|
3689
|
-
*/
|
|
3690
|
-
interface FlowPhoneParams {
|
|
3691
|
-
/** phone_number_id (Meta) do número cuja WABA hospeda o flow. */
|
|
3692
|
-
phone_number_id: string;
|
|
3693
|
-
}
|
|
3694
|
-
/** Corpo de `POST /v1/flows/:id/versions` — sobe um novo flow.json. */
|
|
3695
|
-
interface CreateFlowVersionParams {
|
|
3696
|
-
phone_number_id: string;
|
|
3697
|
-
/** JSON do flow (objeto ou string JSON válida). */
|
|
3698
|
-
flow_json: unknown;
|
|
3699
|
-
[key: string]: unknown;
|
|
3700
|
-
}
|
|
3701
|
-
/** Corpo de `POST /v1/flows/:id/data_endpoint` — conecta a forward URL do dev. */
|
|
3702
|
-
interface SetFlowDataEndpointParams {
|
|
3703
|
-
phone_number_id: string;
|
|
3704
|
-
/** URL HTTPS do backend do dev que recebe o data_exchange. */
|
|
3705
|
-
forward_url: string;
|
|
3706
|
-
[key: string]: unknown;
|
|
3707
|
-
}
|
|
3708
|
-
/** WhatsApp Flows: criar, versionar, publicar e configurar data endpoint. */
|
|
3709
|
-
declare class Flows {
|
|
3710
|
-
private readonly client;
|
|
3711
|
-
constructor(client: BotoZap);
|
|
3712
|
-
/**
|
|
3713
|
-
* Lista os flows de uma WABA (paginação por offset/página). Informe
|
|
3714
|
-
* `phone_number_id` OU `waba_connection_id` — a rota exige um deles.
|
|
3715
|
-
*/
|
|
3716
|
-
list(params?: ListFlowsParams): Promise<OffsetList<Flow>>;
|
|
3717
|
-
get(id: string, params: FlowPhoneParams): Promise<Flow>;
|
|
3718
|
-
create(params: CreateFlowParams): Promise<Flow>;
|
|
3719
|
-
/** Remove um flow (só DRAFT, regra da Meta). Responde 204 (sem corpo). */
|
|
3720
|
-
delete(id: string, params: FlowPhoneParams): Promise<void>;
|
|
3721
|
-
publish(id: string, params: FlowPhoneParams): Promise<Flow>;
|
|
3722
|
-
/** Lista as versões de um flow (paginação por offset/página). */
|
|
3723
|
-
listVersions(id: string, params?: OffsetParams): Promise<OffsetList<FlowVersion>>;
|
|
3724
|
-
createVersion(id: string, params: CreateFlowVersionParams): Promise<FlowVersion>;
|
|
3725
|
-
setupEncryption(id: string, params: FlowPhoneParams): Promise<Record<string, unknown>>;
|
|
3726
|
-
getDataEndpoint(id: string): Promise<Record<string, unknown>>;
|
|
3727
|
-
setDataEndpoint(id: string, params: SetFlowDataEndpointParams): Promise<Record<string, unknown>>;
|
|
3728
|
-
}
|
|
3729
|
-
|
|
3730
3728
|
/** Corpo do `POST /v1/media` — espelha o contrato real da rota. */
|
|
3731
3729
|
interface UploadMediaParams {
|
|
3732
3730
|
/** URL http(s) de origem do arquivo. A BotoZap baixa (com guard SSRF) e sobe pra Cloud API. */
|
|
@@ -3871,7 +3869,6 @@ declare class BotoZap {
|
|
|
3871
3869
|
readonly opportunities: CrmResource<OpportunityFields, Opportunity>;
|
|
3872
3870
|
readonly demands: CrmResource<DemandFields, Demand>;
|
|
3873
3871
|
readonly radar: Radar;
|
|
3874
|
-
readonly flows: Flows;
|
|
3875
3872
|
readonly media: Media;
|
|
3876
3873
|
readonly events: Events;
|
|
3877
3874
|
readonly users: Users;
|
|
@@ -3917,4 +3914,4 @@ declare class BotoZapError extends Error {
|
|
|
3917
3914
|
constructor(code: string, message: string, status: number, headers?: Record<string, string>);
|
|
3918
3915
|
}
|
|
3919
3916
|
|
|
3920
|
-
export { AI_CONFIGURABLE_PURPOSES, AI_OPERATIONS, AI_PURPOSES, 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 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 BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationNote, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type
|
|
3917
|
+
export { AI_CONFIGURABLE_PURPOSES, 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 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 BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationNote, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, 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 Demand, type DemandFields, type EventList, type EventPaging, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type Journey, type JourneyConfig, type JourneyEnrollment, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type MediaAsset, type MediaUploadResult, type Message, type MessageStatus, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, type PhoneNumber, 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 SendImageParams, type SendMediaParams, 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 UpdateContactParams, type UpdateCustomerParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, type Webhook, type WebhookAuthorizationHeaders, type WebhookDelivery };
|
package/dist/index.js
CHANGED
|
@@ -5300,7 +5300,12 @@ var Broadcasts = class {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
);
|
|
5302
5302
|
}
|
|
5303
|
-
/**
|
|
5303
|
+
/**
|
|
5304
|
+
* Adiciona destinatários a uma transmissão em `draft` (até 1000 por chamada).
|
|
5305
|
+
* Cada item é um objeto `{ to_recipient, components? }` — strings soltas não
|
|
5306
|
+
* são aceitas. Itens inválidos não derrubam o lote: voltam em `errors`.
|
|
5307
|
+
* Duplicatas (no lote ou já cadastradas) contam em `duplicates`.
|
|
5308
|
+
*/
|
|
5304
5309
|
addRecipients(id, recipients) {
|
|
5305
5310
|
return this.client.requestItem(
|
|
5306
5311
|
"POST",
|
|
@@ -5578,85 +5583,6 @@ function enc6(id) {
|
|
|
5578
5583
|
return encodeURIComponent(id);
|
|
5579
5584
|
}
|
|
5580
5585
|
|
|
5581
|
-
// src/resources/flows.ts
|
|
5582
|
-
var Flows = class {
|
|
5583
|
-
constructor(client) {
|
|
5584
|
-
this.client = client;
|
|
5585
|
-
}
|
|
5586
|
-
client;
|
|
5587
|
-
/**
|
|
5588
|
-
* Lista os flows de uma WABA (paginação por offset/página). Informe
|
|
5589
|
-
* `phone_number_id` OU `waba_connection_id` — a rota exige um deles.
|
|
5590
|
-
*/
|
|
5591
|
-
list(params = {}) {
|
|
5592
|
-
return this.client.requestOffsetList("GET", "/flows", {
|
|
5593
|
-
query: {
|
|
5594
|
-
page: params.page,
|
|
5595
|
-
per_page: params.per_page,
|
|
5596
|
-
phone_number_id: params.phone_number_id,
|
|
5597
|
-
waba_connection_id: params.waba_connection_id
|
|
5598
|
-
}
|
|
5599
|
-
});
|
|
5600
|
-
}
|
|
5601
|
-
get(id, params) {
|
|
5602
|
-
return this.client.requestItem("GET", `/flows/${enc7(id)}`, {
|
|
5603
|
-
query: { phone_number_id: params.phone_number_id }
|
|
5604
|
-
});
|
|
5605
|
-
}
|
|
5606
|
-
create(params) {
|
|
5607
|
-
return this.client.requestItem("POST", "/flows", { body: params });
|
|
5608
|
-
}
|
|
5609
|
-
/** Remove um flow (só DRAFT, regra da Meta). Responde 204 (sem corpo). */
|
|
5610
|
-
delete(id, params) {
|
|
5611
|
-
return this.client.request("DELETE", `/flows/${enc7(id)}`, {
|
|
5612
|
-
query: { phone_number_id: params.phone_number_id }
|
|
5613
|
-
});
|
|
5614
|
-
}
|
|
5615
|
-
publish(id, params) {
|
|
5616
|
-
return this.client.requestItem("POST", `/flows/${enc7(id)}/publish`, {
|
|
5617
|
-
body: { phone_number_id: params.phone_number_id }
|
|
5618
|
-
});
|
|
5619
|
-
}
|
|
5620
|
-
/** Lista as versões de um flow (paginação por offset/página). */
|
|
5621
|
-
listVersions(id, params = {}) {
|
|
5622
|
-
return this.client.requestOffsetList(
|
|
5623
|
-
"GET",
|
|
5624
|
-
`/flows/${enc7(id)}/versions`,
|
|
5625
|
-
{ query: { page: params.page, per_page: params.per_page } }
|
|
5626
|
-
);
|
|
5627
|
-
}
|
|
5628
|
-
createVersion(id, params) {
|
|
5629
|
-
return this.client.requestItem(
|
|
5630
|
-
"POST",
|
|
5631
|
-
`/flows/${enc7(id)}/versions`,
|
|
5632
|
-
{ body: params }
|
|
5633
|
-
);
|
|
5634
|
-
}
|
|
5635
|
-
setupEncryption(id, params) {
|
|
5636
|
-
return this.client.requestItem(
|
|
5637
|
-
"POST",
|
|
5638
|
-
`/flows/${enc7(id)}/setup_encryption`,
|
|
5639
|
-
{ body: { phone_number_id: params.phone_number_id } }
|
|
5640
|
-
);
|
|
5641
|
-
}
|
|
5642
|
-
getDataEndpoint(id) {
|
|
5643
|
-
return this.client.requestItem(
|
|
5644
|
-
"GET",
|
|
5645
|
-
`/flows/${enc7(id)}/data_endpoint`
|
|
5646
|
-
);
|
|
5647
|
-
}
|
|
5648
|
-
setDataEndpoint(id, params) {
|
|
5649
|
-
return this.client.requestItem(
|
|
5650
|
-
"POST",
|
|
5651
|
-
`/flows/${enc7(id)}/data_endpoint`,
|
|
5652
|
-
{ body: params }
|
|
5653
|
-
);
|
|
5654
|
-
}
|
|
5655
|
-
};
|
|
5656
|
-
function enc7(id) {
|
|
5657
|
-
return encodeURIComponent(id);
|
|
5658
|
-
}
|
|
5659
|
-
|
|
5660
5586
|
// src/resources/media.ts
|
|
5661
5587
|
var Media = class {
|
|
5662
5588
|
constructor(client) {
|
|
@@ -5792,7 +5718,6 @@ var BotoZap = class {
|
|
|
5792
5718
|
opportunities;
|
|
5793
5719
|
demands;
|
|
5794
5720
|
radar;
|
|
5795
|
-
flows;
|
|
5796
5721
|
media;
|
|
5797
5722
|
events;
|
|
5798
5723
|
users;
|
|
@@ -5833,7 +5758,6 @@ var BotoZap = class {
|
|
|
5833
5758
|
this.conversations = new Conversations(this);
|
|
5834
5759
|
this.webhooks = new Webhooks(this);
|
|
5835
5760
|
this.phoneNumbers = new PhoneNumbers(this);
|
|
5836
|
-
this.flows = new Flows(this);
|
|
5837
5761
|
this.media = new Media(this);
|
|
5838
5762
|
this.events = new Events(this);
|
|
5839
5763
|
this.users = new Users(this);
|