@botozap/sdk 0.12.0 → 0.14.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 +14 -0
- package/README.md +17 -0
- package/dist/index.cjs +30 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -5
- package/dist/index.d.ts +72 -5
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -171,6 +171,12 @@ interface BroadcastRecipient {
|
|
|
171
171
|
[key: string]: unknown;
|
|
172
172
|
}
|
|
173
173
|
interface Contact {
|
|
174
|
+
/** Perfil Instagram, somente leitura; null quando desconhecido. */
|
|
175
|
+
readonly ig_follows_business?: boolean | null;
|
|
176
|
+
readonly ig_followed_by_business?: boolean | null;
|
|
177
|
+
readonly ig_follower_count?: number | null;
|
|
178
|
+
readonly ig_verified?: boolean | null;
|
|
179
|
+
readonly ig_follow_checked_at?: string | null;
|
|
174
180
|
id: string;
|
|
175
181
|
wa_id?: string;
|
|
176
182
|
/** Nome do perfil no canal; a ingestão o sobrescreve a cada inbound. */
|
|
@@ -303,8 +309,9 @@ interface BotoZapEvent {
|
|
|
303
309
|
* `instagram.message.received`). No Instagram, `instagram.message.edited`
|
|
304
310
|
* traz o texto novo em `data.edit` e o conteúdo atualizado (com
|
|
305
311
|
* `content.edited`) em `data.message`; `instagram.message.revoked` traz
|
|
306
|
-
* `data.message.revoked_at`, sem o conteúdo apagado.
|
|
307
|
-
*
|
|
312
|
+
* `data.message.revoked_at`, sem o conteúdo apagado.
|
|
313
|
+
* `instagram.message_rule.failed` registra uma falha de automação e pode
|
|
314
|
+
* ter `message_id: null` (referral sem mensagem). Valores novos podem surgir.
|
|
308
315
|
*/
|
|
309
316
|
type: string;
|
|
310
317
|
/**
|
|
@@ -1447,7 +1454,14 @@ type AiInferenceSummary = {
|
|
|
1447
1454
|
};
|
|
1448
1455
|
type AiKnowledgeHit = AiKnowledgeChunk & {
|
|
1449
1456
|
source_name: string;
|
|
1450
|
-
|
|
1457
|
+
/** Similaridade vetorial (0–1); `null` quando o trecho veio só da busca textual. */
|
|
1458
|
+
similarity: number | null;
|
|
1459
|
+
/** Pontuação da fusão híbrida (Reciprocal Rank Fusion, k=60); não é percentual. */
|
|
1460
|
+
score: number;
|
|
1461
|
+
/** Posição na busca vetorial; `null` quando não apareceu nela. */
|
|
1462
|
+
vector_rank: number | null;
|
|
1463
|
+
/** Posição na busca textual; `null` quando não apareceu nela. */
|
|
1464
|
+
text_rank: number | null;
|
|
1451
1465
|
};
|
|
1452
1466
|
type AiKnowledgeSearchDiagnostics = {
|
|
1453
1467
|
hits: AiKnowledgeHit[];
|
|
@@ -3952,6 +3966,8 @@ declare class Broadcasts {
|
|
|
3952
3966
|
}
|
|
3953
3967
|
|
|
3954
3968
|
interface ListContactsParams extends CursorParams {
|
|
3969
|
+
/** Só valores conhecidos; null não casa nem com false. */
|
|
3970
|
+
ig_follows_business?: boolean;
|
|
3955
3971
|
/** Filtra pelos números do cliente (derivado da conexão do número). */
|
|
3956
3972
|
customer_id?: string;
|
|
3957
3973
|
/**
|
|
@@ -4016,6 +4032,8 @@ declare class Contacts {
|
|
|
4016
4032
|
}
|
|
4017
4033
|
|
|
4018
4034
|
interface ListConversationsParams extends CursorParams {
|
|
4035
|
+
/** Só valores conhecidos; null não casa nem com false. */
|
|
4036
|
+
ig_follows_business?: boolean;
|
|
4019
4037
|
/** Recorta as conversas pelos canais do negócio autorizado. */
|
|
4020
4038
|
customer_id?: string;
|
|
4021
4039
|
/** true: somente conversas com agente pausado aguardando humano. */
|
|
@@ -4225,6 +4243,25 @@ interface ListChannelAccountsParams extends OffsetParams {
|
|
|
4225
4243
|
/** UUID do Cliente dono das Contas de canal. */
|
|
4226
4244
|
customer_id?: string;
|
|
4227
4245
|
}
|
|
4246
|
+
/** Estado confirmado da conexão; nunca inclui tokens. */
|
|
4247
|
+
interface InstagramConnection {
|
|
4248
|
+
status: string;
|
|
4249
|
+
username: string | null;
|
|
4250
|
+
subscribed_at: string | null;
|
|
4251
|
+
token_expires_at: string | null;
|
|
4252
|
+
revoked_reason: string | null;
|
|
4253
|
+
health: "conectado" | "pendente" | "reconexao_necessaria" | "revogado" | (string & {});
|
|
4254
|
+
subscribed_fields: string[];
|
|
4255
|
+
diagnostic: {
|
|
4256
|
+
code: string;
|
|
4257
|
+
message: string;
|
|
4258
|
+
next_step: string;
|
|
4259
|
+
help_url: string;
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
4262
|
+
interface MessageRuleQrParams {
|
|
4263
|
+
format?: "png" | "svg";
|
|
4264
|
+
}
|
|
4228
4265
|
/** Estado de uma Regra de comentário. `paused_plan`: ativa, mas pausada pelo plano. */
|
|
4229
4266
|
type CommentRuleStatus = "active" | "inactive" | "paused_plan" | (string & {});
|
|
4230
4267
|
/**
|
|
@@ -4244,9 +4281,14 @@ interface CommentRule {
|
|
|
4244
4281
|
reply_variations?: string[];
|
|
4245
4282
|
/** Aguarda o próximo post quando true e media_id é null. */
|
|
4246
4283
|
next_post?: boolean;
|
|
4284
|
+
/** Durante lives; não combinar com media_id ou next_post. Servidor sem suporte: 422 feature_unavailable. */
|
|
4285
|
+
live?: boolean;
|
|
4247
4286
|
next_post_activated_at?: string | null;
|
|
4248
4287
|
/** Abertura: 1000 bytes sem botão; 640 caracteres com botão. */
|
|
4249
4288
|
dm_text: string;
|
|
4289
|
+
require_follow?: boolean;
|
|
4290
|
+
/** Com require_follow, obrigatório (640 caracteres) e exige botão de entrega. */
|
|
4291
|
+
non_follower_text?: string | null;
|
|
4250
4292
|
/** Título do botão (20 caracteres); null mantém direct simples. */
|
|
4251
4293
|
dm_button_title?: string | null;
|
|
4252
4294
|
/** Texto entregue após o toque (1000 bytes). */
|
|
@@ -4272,6 +4314,9 @@ interface CommentRule {
|
|
|
4272
4314
|
interface CreateCommentRuleParams {
|
|
4273
4315
|
/** Texto do direct enviado a quem comentou (obrigatório). */
|
|
4274
4316
|
dm_text: string;
|
|
4317
|
+
require_follow?: boolean;
|
|
4318
|
+
/** Com require_follow, obrigatório (640 caracteres) e exige botão de entrega. */
|
|
4319
|
+
non_follower_text?: string | null;
|
|
4275
4320
|
/** Botão de até 20 caracteres; com botão dm_text aceita até 640 caracteres. */
|
|
4276
4321
|
dm_button_title?: string | null;
|
|
4277
4322
|
/** Obrigatório com botão; até 1000 bytes. null remove. */
|
|
@@ -4288,6 +4333,8 @@ interface CreateCommentRuleParams {
|
|
|
4288
4333
|
reply_variations?: string[];
|
|
4289
4334
|
/** Próximo post; não combinar com media_id explícito. */
|
|
4290
4335
|
next_post?: boolean;
|
|
4336
|
+
/** Durante lives; não combinar com media_id ou next_post. Servidor sem suporte: 422 feature_unavailable. */
|
|
4337
|
+
live?: boolean;
|
|
4291
4338
|
/** Resposta pública ao comentário; `null`/vazio = sem resposta. */
|
|
4292
4339
|
reply_text?: string | null;
|
|
4293
4340
|
/** Id numérico do post; `null`/vazio = todos os posts. */
|
|
@@ -4357,6 +4404,9 @@ interface CreateMessageRuleParams {
|
|
|
4357
4404
|
is_active?: boolean;
|
|
4358
4405
|
/** 1–5 ações; no máximo uma de cada tipo. */
|
|
4359
4406
|
actions: MessageRuleAction[];
|
|
4407
|
+
require_follow?: boolean;
|
|
4408
|
+
/** Até 1000 bytes; null remove. */
|
|
4409
|
+
non_follower_text?: string | null;
|
|
4360
4410
|
}
|
|
4361
4411
|
type UpdateMessageRuleParams = Partial<CreateMessageRuleParams>;
|
|
4362
4412
|
interface MessageRule {
|
|
@@ -4369,10 +4419,15 @@ interface MessageRule {
|
|
|
4369
4419
|
excluded_keywords: string[];
|
|
4370
4420
|
story_contains: string | null;
|
|
4371
4421
|
ref: string | null;
|
|
4422
|
+
/** Link ig.me pronto; null sem ref ou username válido. */
|
|
4423
|
+
ref_link: string | null;
|
|
4372
4424
|
ad_id: string | null;
|
|
4373
4425
|
priority: number;
|
|
4374
4426
|
is_active: boolean;
|
|
4375
4427
|
actions: MessageRuleAction[];
|
|
4428
|
+
require_follow?: boolean;
|
|
4429
|
+
/** Até 1000 bytes; null remove. */
|
|
4430
|
+
non_follower_text?: string | null;
|
|
4376
4431
|
created_at: string;
|
|
4377
4432
|
updated_at: string;
|
|
4378
4433
|
}
|
|
@@ -4400,6 +4455,7 @@ interface CommentRuleMetrics extends CommentRuleMetricsParams {
|
|
|
4400
4455
|
totals: CommentRuleCounters;
|
|
4401
4456
|
posts: (CommentRuleCounters & {
|
|
4402
4457
|
media_id: string | null;
|
|
4458
|
+
live: boolean;
|
|
4403
4459
|
})[];
|
|
4404
4460
|
}
|
|
4405
4461
|
interface InstagramIceBreaker {
|
|
@@ -4443,6 +4499,14 @@ declare class ChannelAccounts {
|
|
|
4443
4499
|
list(params?: ListChannelAccountsParams): Promise<OffsetList<ChannelAccount>>;
|
|
4444
4500
|
/** Busca uma Conta de canal pelo UUID interno ou pelo id na Meta (`external_id`). numbers:read. */
|
|
4445
4501
|
get(id: string): Promise<ChannelAccount>;
|
|
4502
|
+
/** Estado e diagnóstico da conexão Instagram. numbers:read; sem sandbox. */
|
|
4503
|
+
getConnection(id: string): Promise<InstagramConnection>;
|
|
4504
|
+
/** Reassina webhooks usando a autorização existente. numbers:write; sem sandbox. */
|
|
4505
|
+
resubscribeConnection(id: string): Promise<InstagramConnection>;
|
|
4506
|
+
/** Desconecta a conta. numbers:write; por chave de API (OAuth: somente painel). */
|
|
4507
|
+
disconnect(id: string): Promise<InstagramConnection>;
|
|
4508
|
+
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
4509
|
+
getMessageRuleQr(id: string, ruleId: string, params?: MessageRuleQrParams): Promise<ArrayBuffer>;
|
|
4446
4510
|
/** Lista as Regras de comentário de uma Conta do Instagram (UUID). comment-rules:read. */
|
|
4447
4511
|
listCommentRules(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<CommentRule>>;
|
|
4448
4512
|
/** Busca uma Regra de comentário. comment-rules:read. */
|
|
@@ -4788,6 +4852,9 @@ declare class BotoZap {
|
|
|
4788
4852
|
putArtifact(url: string, contentType: string, file: Blob): Promise<void>;
|
|
4789
4853
|
/** Faz uma requisição autenticada e devolve o corpo já parseado. */
|
|
4790
4854
|
request<T>(method: string, path: string, opts?: RequestOptions): Promise<T>;
|
|
4855
|
+
/** Baixa um arquivo autenticado, preservando os erros JSON e headers da API. */
|
|
4856
|
+
requestBinary(method: string, path: string, opts?: RequestOptions): Promise<ArrayBuffer>;
|
|
4857
|
+
private requestResponse;
|
|
4791
4858
|
/**
|
|
4792
4859
|
* Requisição a um endpoint de ITEM (singular). A API embrulha essas respostas
|
|
4793
4860
|
* em `{ data: <obj> }` (helper `ok`); este método desempacota e devolve a
|
|
@@ -4835,10 +4902,10 @@ declare class BotoZapError extends Error {
|
|
|
4835
4902
|
* além do teto de Números do Free). IA: `provider_not_enabled` (422, credencial
|
|
4836
4903
|
* nova de provedor com `accepts_new_credentials: false`).
|
|
4837
4904
|
*/
|
|
4838
|
-
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" | "provider_not_enabled" | (string & {});
|
|
4905
|
+
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 & {});
|
|
4839
4906
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
4840
4907
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
4841
4908
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
4842
4909
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
4843
4910
|
|
|
4844
|
-
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 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 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 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 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 WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
|
4911
|
+
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 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 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 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 WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
package/dist/index.d.ts
CHANGED
|
@@ -171,6 +171,12 @@ interface BroadcastRecipient {
|
|
|
171
171
|
[key: string]: unknown;
|
|
172
172
|
}
|
|
173
173
|
interface Contact {
|
|
174
|
+
/** Perfil Instagram, somente leitura; null quando desconhecido. */
|
|
175
|
+
readonly ig_follows_business?: boolean | null;
|
|
176
|
+
readonly ig_followed_by_business?: boolean | null;
|
|
177
|
+
readonly ig_follower_count?: number | null;
|
|
178
|
+
readonly ig_verified?: boolean | null;
|
|
179
|
+
readonly ig_follow_checked_at?: string | null;
|
|
174
180
|
id: string;
|
|
175
181
|
wa_id?: string;
|
|
176
182
|
/** Nome do perfil no canal; a ingestão o sobrescreve a cada inbound. */
|
|
@@ -303,8 +309,9 @@ interface BotoZapEvent {
|
|
|
303
309
|
* `instagram.message.received`). No Instagram, `instagram.message.edited`
|
|
304
310
|
* traz o texto novo em `data.edit` e o conteúdo atualizado (com
|
|
305
311
|
* `content.edited`) em `data.message`; `instagram.message.revoked` traz
|
|
306
|
-
* `data.message.revoked_at`, sem o conteúdo apagado.
|
|
307
|
-
*
|
|
312
|
+
* `data.message.revoked_at`, sem o conteúdo apagado.
|
|
313
|
+
* `instagram.message_rule.failed` registra uma falha de automação e pode
|
|
314
|
+
* ter `message_id: null` (referral sem mensagem). Valores novos podem surgir.
|
|
308
315
|
*/
|
|
309
316
|
type: string;
|
|
310
317
|
/**
|
|
@@ -1447,7 +1454,14 @@ type AiInferenceSummary = {
|
|
|
1447
1454
|
};
|
|
1448
1455
|
type AiKnowledgeHit = AiKnowledgeChunk & {
|
|
1449
1456
|
source_name: string;
|
|
1450
|
-
|
|
1457
|
+
/** Similaridade vetorial (0–1); `null` quando o trecho veio só da busca textual. */
|
|
1458
|
+
similarity: number | null;
|
|
1459
|
+
/** Pontuação da fusão híbrida (Reciprocal Rank Fusion, k=60); não é percentual. */
|
|
1460
|
+
score: number;
|
|
1461
|
+
/** Posição na busca vetorial; `null` quando não apareceu nela. */
|
|
1462
|
+
vector_rank: number | null;
|
|
1463
|
+
/** Posição na busca textual; `null` quando não apareceu nela. */
|
|
1464
|
+
text_rank: number | null;
|
|
1451
1465
|
};
|
|
1452
1466
|
type AiKnowledgeSearchDiagnostics = {
|
|
1453
1467
|
hits: AiKnowledgeHit[];
|
|
@@ -3952,6 +3966,8 @@ declare class Broadcasts {
|
|
|
3952
3966
|
}
|
|
3953
3967
|
|
|
3954
3968
|
interface ListContactsParams extends CursorParams {
|
|
3969
|
+
/** Só valores conhecidos; null não casa nem com false. */
|
|
3970
|
+
ig_follows_business?: boolean;
|
|
3955
3971
|
/** Filtra pelos números do cliente (derivado da conexão do número). */
|
|
3956
3972
|
customer_id?: string;
|
|
3957
3973
|
/**
|
|
@@ -4016,6 +4032,8 @@ declare class Contacts {
|
|
|
4016
4032
|
}
|
|
4017
4033
|
|
|
4018
4034
|
interface ListConversationsParams extends CursorParams {
|
|
4035
|
+
/** Só valores conhecidos; null não casa nem com false. */
|
|
4036
|
+
ig_follows_business?: boolean;
|
|
4019
4037
|
/** Recorta as conversas pelos canais do negócio autorizado. */
|
|
4020
4038
|
customer_id?: string;
|
|
4021
4039
|
/** true: somente conversas com agente pausado aguardando humano. */
|
|
@@ -4225,6 +4243,25 @@ interface ListChannelAccountsParams extends OffsetParams {
|
|
|
4225
4243
|
/** UUID do Cliente dono das Contas de canal. */
|
|
4226
4244
|
customer_id?: string;
|
|
4227
4245
|
}
|
|
4246
|
+
/** Estado confirmado da conexão; nunca inclui tokens. */
|
|
4247
|
+
interface InstagramConnection {
|
|
4248
|
+
status: string;
|
|
4249
|
+
username: string | null;
|
|
4250
|
+
subscribed_at: string | null;
|
|
4251
|
+
token_expires_at: string | null;
|
|
4252
|
+
revoked_reason: string | null;
|
|
4253
|
+
health: "conectado" | "pendente" | "reconexao_necessaria" | "revogado" | (string & {});
|
|
4254
|
+
subscribed_fields: string[];
|
|
4255
|
+
diagnostic: {
|
|
4256
|
+
code: string;
|
|
4257
|
+
message: string;
|
|
4258
|
+
next_step: string;
|
|
4259
|
+
help_url: string;
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
4262
|
+
interface MessageRuleQrParams {
|
|
4263
|
+
format?: "png" | "svg";
|
|
4264
|
+
}
|
|
4228
4265
|
/** Estado de uma Regra de comentário. `paused_plan`: ativa, mas pausada pelo plano. */
|
|
4229
4266
|
type CommentRuleStatus = "active" | "inactive" | "paused_plan" | (string & {});
|
|
4230
4267
|
/**
|
|
@@ -4244,9 +4281,14 @@ interface CommentRule {
|
|
|
4244
4281
|
reply_variations?: string[];
|
|
4245
4282
|
/** Aguarda o próximo post quando true e media_id é null. */
|
|
4246
4283
|
next_post?: boolean;
|
|
4284
|
+
/** Durante lives; não combinar com media_id ou next_post. Servidor sem suporte: 422 feature_unavailable. */
|
|
4285
|
+
live?: boolean;
|
|
4247
4286
|
next_post_activated_at?: string | null;
|
|
4248
4287
|
/** Abertura: 1000 bytes sem botão; 640 caracteres com botão. */
|
|
4249
4288
|
dm_text: string;
|
|
4289
|
+
require_follow?: boolean;
|
|
4290
|
+
/** Com require_follow, obrigatório (640 caracteres) e exige botão de entrega. */
|
|
4291
|
+
non_follower_text?: string | null;
|
|
4250
4292
|
/** Título do botão (20 caracteres); null mantém direct simples. */
|
|
4251
4293
|
dm_button_title?: string | null;
|
|
4252
4294
|
/** Texto entregue após o toque (1000 bytes). */
|
|
@@ -4272,6 +4314,9 @@ interface CommentRule {
|
|
|
4272
4314
|
interface CreateCommentRuleParams {
|
|
4273
4315
|
/** Texto do direct enviado a quem comentou (obrigatório). */
|
|
4274
4316
|
dm_text: string;
|
|
4317
|
+
require_follow?: boolean;
|
|
4318
|
+
/** Com require_follow, obrigatório (640 caracteres) e exige botão de entrega. */
|
|
4319
|
+
non_follower_text?: string | null;
|
|
4275
4320
|
/** Botão de até 20 caracteres; com botão dm_text aceita até 640 caracteres. */
|
|
4276
4321
|
dm_button_title?: string | null;
|
|
4277
4322
|
/** Obrigatório com botão; até 1000 bytes. null remove. */
|
|
@@ -4288,6 +4333,8 @@ interface CreateCommentRuleParams {
|
|
|
4288
4333
|
reply_variations?: string[];
|
|
4289
4334
|
/** Próximo post; não combinar com media_id explícito. */
|
|
4290
4335
|
next_post?: boolean;
|
|
4336
|
+
/** Durante lives; não combinar com media_id ou next_post. Servidor sem suporte: 422 feature_unavailable. */
|
|
4337
|
+
live?: boolean;
|
|
4291
4338
|
/** Resposta pública ao comentário; `null`/vazio = sem resposta. */
|
|
4292
4339
|
reply_text?: string | null;
|
|
4293
4340
|
/** Id numérico do post; `null`/vazio = todos os posts. */
|
|
@@ -4357,6 +4404,9 @@ interface CreateMessageRuleParams {
|
|
|
4357
4404
|
is_active?: boolean;
|
|
4358
4405
|
/** 1–5 ações; no máximo uma de cada tipo. */
|
|
4359
4406
|
actions: MessageRuleAction[];
|
|
4407
|
+
require_follow?: boolean;
|
|
4408
|
+
/** Até 1000 bytes; null remove. */
|
|
4409
|
+
non_follower_text?: string | null;
|
|
4360
4410
|
}
|
|
4361
4411
|
type UpdateMessageRuleParams = Partial<CreateMessageRuleParams>;
|
|
4362
4412
|
interface MessageRule {
|
|
@@ -4369,10 +4419,15 @@ interface MessageRule {
|
|
|
4369
4419
|
excluded_keywords: string[];
|
|
4370
4420
|
story_contains: string | null;
|
|
4371
4421
|
ref: string | null;
|
|
4422
|
+
/** Link ig.me pronto; null sem ref ou username válido. */
|
|
4423
|
+
ref_link: string | null;
|
|
4372
4424
|
ad_id: string | null;
|
|
4373
4425
|
priority: number;
|
|
4374
4426
|
is_active: boolean;
|
|
4375
4427
|
actions: MessageRuleAction[];
|
|
4428
|
+
require_follow?: boolean;
|
|
4429
|
+
/** Até 1000 bytes; null remove. */
|
|
4430
|
+
non_follower_text?: string | null;
|
|
4376
4431
|
created_at: string;
|
|
4377
4432
|
updated_at: string;
|
|
4378
4433
|
}
|
|
@@ -4400,6 +4455,7 @@ interface CommentRuleMetrics extends CommentRuleMetricsParams {
|
|
|
4400
4455
|
totals: CommentRuleCounters;
|
|
4401
4456
|
posts: (CommentRuleCounters & {
|
|
4402
4457
|
media_id: string | null;
|
|
4458
|
+
live: boolean;
|
|
4403
4459
|
})[];
|
|
4404
4460
|
}
|
|
4405
4461
|
interface InstagramIceBreaker {
|
|
@@ -4443,6 +4499,14 @@ declare class ChannelAccounts {
|
|
|
4443
4499
|
list(params?: ListChannelAccountsParams): Promise<OffsetList<ChannelAccount>>;
|
|
4444
4500
|
/** Busca uma Conta de canal pelo UUID interno ou pelo id na Meta (`external_id`). numbers:read. */
|
|
4445
4501
|
get(id: string): Promise<ChannelAccount>;
|
|
4502
|
+
/** Estado e diagnóstico da conexão Instagram. numbers:read; sem sandbox. */
|
|
4503
|
+
getConnection(id: string): Promise<InstagramConnection>;
|
|
4504
|
+
/** Reassina webhooks usando a autorização existente. numbers:write; sem sandbox. */
|
|
4505
|
+
resubscribeConnection(id: string): Promise<InstagramConnection>;
|
|
4506
|
+
/** Desconecta a conta. numbers:write; por chave de API (OAuth: somente painel). */
|
|
4507
|
+
disconnect(id: string): Promise<InstagramConnection>;
|
|
4508
|
+
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
4509
|
+
getMessageRuleQr(id: string, ruleId: string, params?: MessageRuleQrParams): Promise<ArrayBuffer>;
|
|
4446
4510
|
/** Lista as Regras de comentário de uma Conta do Instagram (UUID). comment-rules:read. */
|
|
4447
4511
|
listCommentRules(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<CommentRule>>;
|
|
4448
4512
|
/** Busca uma Regra de comentário. comment-rules:read. */
|
|
@@ -4788,6 +4852,9 @@ declare class BotoZap {
|
|
|
4788
4852
|
putArtifact(url: string, contentType: string, file: Blob): Promise<void>;
|
|
4789
4853
|
/** Faz uma requisição autenticada e devolve o corpo já parseado. */
|
|
4790
4854
|
request<T>(method: string, path: string, opts?: RequestOptions): Promise<T>;
|
|
4855
|
+
/** Baixa um arquivo autenticado, preservando os erros JSON e headers da API. */
|
|
4856
|
+
requestBinary(method: string, path: string, opts?: RequestOptions): Promise<ArrayBuffer>;
|
|
4857
|
+
private requestResponse;
|
|
4791
4858
|
/**
|
|
4792
4859
|
* Requisição a um endpoint de ITEM (singular). A API embrulha essas respostas
|
|
4793
4860
|
* em `{ data: <obj> }` (helper `ok`); este método desempacota e devolve a
|
|
@@ -4835,10 +4902,10 @@ declare class BotoZapError extends Error {
|
|
|
4835
4902
|
* além do teto de Números do Free). IA: `provider_not_enabled` (422, credencial
|
|
4836
4903
|
* nova de provedor com `accepts_new_credentials: false`).
|
|
4837
4904
|
*/
|
|
4838
|
-
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" | "provider_not_enabled" | (string & {});
|
|
4905
|
+
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 & {});
|
|
4839
4906
|
/** Códigos que indicam limite ou restrição do plano contratado. */
|
|
4840
4907
|
declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_reached", "free_number_cap"];
|
|
4841
4908
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
4842
4909
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
4843
4910
|
|
|
4844
|
-
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 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 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 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 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 WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
|
4911
|
+
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 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 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 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 WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
package/dist/index.js
CHANGED
|
@@ -5434,6 +5434,7 @@ var Contacts = class {
|
|
|
5434
5434
|
return this.client.requestCursorList("GET", "/contacts", {
|
|
5435
5435
|
query: {
|
|
5436
5436
|
limit: params.limit,
|
|
5437
|
+
ig_follows_business: params.ig_follows_business === void 0 ? void 0 : String(params.ig_follows_business),
|
|
5437
5438
|
after: params.after,
|
|
5438
5439
|
before: params.before,
|
|
5439
5440
|
customer_id: params.customer_id,
|
|
@@ -5489,6 +5490,7 @@ var Conversations = class {
|
|
|
5489
5490
|
{
|
|
5490
5491
|
query: {
|
|
5491
5492
|
limit: params.limit,
|
|
5493
|
+
ig_follows_business: params.ig_follows_business === void 0 ? void 0 : String(params.ig_follows_business),
|
|
5492
5494
|
customer_id: params.customer_id,
|
|
5493
5495
|
agent_paused: params.agent_paused === void 0 ? void 0 : String(params.agent_paused),
|
|
5494
5496
|
after: params.after,
|
|
@@ -5710,6 +5712,22 @@ var ChannelAccounts = class {
|
|
|
5710
5712
|
get(id) {
|
|
5711
5713
|
return this.client.requestItem("GET", `/channel_accounts/${enc7(id)}`);
|
|
5712
5714
|
}
|
|
5715
|
+
/** Estado e diagnóstico da conexão Instagram. numbers:read; sem sandbox. */
|
|
5716
|
+
getConnection(id) {
|
|
5717
|
+
return this.client.requestItem("GET", `/channel_accounts/${enc7(id)}/connection`);
|
|
5718
|
+
}
|
|
5719
|
+
/** Reassina webhooks usando a autorização existente. numbers:write; sem sandbox. */
|
|
5720
|
+
resubscribeConnection(id) {
|
|
5721
|
+
return this.client.requestItem("POST", `/channel_accounts/${enc7(id)}/connection/resubscribe`);
|
|
5722
|
+
}
|
|
5723
|
+
/** Desconecta a conta. numbers:write; por chave de API (OAuth: somente painel). */
|
|
5724
|
+
disconnect(id) {
|
|
5725
|
+
return this.client.requestItem("DELETE", `/channel_accounts/${enc7(id)}/connection`);
|
|
5726
|
+
}
|
|
5727
|
+
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
5728
|
+
getMessageRuleQr(id, ruleId, params = {}) {
|
|
5729
|
+
return this.client.requestBinary("GET", `${messageRulesPath(id, ruleId)}/qr`, { query: { format: params.format } });
|
|
5730
|
+
}
|
|
5713
5731
|
/** Lista as Regras de comentário de uma Conta do Instagram (UUID). comment-rules:read. */
|
|
5714
5732
|
listCommentRules(channelAccountId, params = {}) {
|
|
5715
5733
|
return this.client.requestOffsetList(
|
|
@@ -6070,6 +6088,13 @@ var BotoZap = class {
|
|
|
6070
6088
|
}
|
|
6071
6089
|
/** Faz uma requisição autenticada e devolve o corpo já parseado. */
|
|
6072
6090
|
async request(method, path, opts = {}) {
|
|
6091
|
+
return this.requestResponse(method, path, opts);
|
|
6092
|
+
}
|
|
6093
|
+
/** Baixa um arquivo autenticado, preservando os erros JSON e headers da API. */
|
|
6094
|
+
requestBinary(method, path, opts = {}) {
|
|
6095
|
+
return this.requestResponse(method, path, opts, true);
|
|
6096
|
+
}
|
|
6097
|
+
async requestResponse(method, path, opts, binary = false) {
|
|
6073
6098
|
const url = new URL(this.baseUrl + path);
|
|
6074
6099
|
if (opts.query) {
|
|
6075
6100
|
for (const [key, value] of Object.entries(opts.query)) {
|
|
@@ -6087,7 +6112,7 @@ var BotoZap = class {
|
|
|
6087
6112
|
headers: {
|
|
6088
6113
|
Authorization: `Bearer ${credential}`,
|
|
6089
6114
|
...opts.body instanceof FormData ? {} : { "Content-Type": "application/json" },
|
|
6090
|
-
Accept: "application/json",
|
|
6115
|
+
Accept: binary ? "image/png, image/svg+xml, application/json" : "application/json",
|
|
6091
6116
|
...opts.idempotencyKey ? { "Idempotency-Key": opts.idempotencyKey } : {}
|
|
6092
6117
|
},
|
|
6093
6118
|
body: opts.body instanceof FormData ? opts.body : opts.body === void 0 ? void 0 : JSON.stringify(opts.body),
|
|
@@ -6102,6 +6127,9 @@ var BotoZap = class {
|
|
|
6102
6127
|
0
|
|
6103
6128
|
);
|
|
6104
6129
|
}
|
|
6130
|
+
if (binary && res.ok && !res.headers.get("content-type")?.includes("json")) {
|
|
6131
|
+
return await res.arrayBuffer();
|
|
6132
|
+
}
|
|
6105
6133
|
const raw = await res.text();
|
|
6106
6134
|
const data = raw ? safeJson(raw) : void 0;
|
|
6107
6135
|
const envelope = data;
|
|
@@ -6122,6 +6150,7 @@ var BotoZap = class {
|
|
|
6122
6150
|
}
|
|
6123
6151
|
);
|
|
6124
6152
|
}
|
|
6153
|
+
if (binary) throw malformed("resposta JSON em endpoint de arquivo bin\xE1rio");
|
|
6125
6154
|
return data;
|
|
6126
6155
|
}
|
|
6127
6156
|
/**
|