@botozap/sdk 0.14.0 → 0.16.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 +22 -0
- package/README.md +46 -1
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +124 -1
- package/dist/index.d.ts +124 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -142,6 +142,10 @@ interface MessageContent {
|
|
|
142
142
|
body?: string;
|
|
143
143
|
/** Presente quando o contato editou a mensagem: o conteúdo já é o editado. */
|
|
144
144
|
edited?: MessageEdit;
|
|
145
|
+
/** Private Reply gerada pela IA de comentários do Instagram. */
|
|
146
|
+
source?: string;
|
|
147
|
+
ai_execution_id?: string;
|
|
148
|
+
comment_id?: string;
|
|
145
149
|
[key: string]: unknown;
|
|
146
150
|
}
|
|
147
151
|
interface Message {
|
|
@@ -254,10 +258,41 @@ interface Assignment {
|
|
|
254
258
|
id: string;
|
|
255
259
|
[key: string]: unknown;
|
|
256
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Estado de entrega de um canal com falha. `paused` para só esse canal (na 15ª
|
|
263
|
+
* falha seguida); os outros canais do Endpoint seguem recebendo.
|
|
264
|
+
*/
|
|
265
|
+
type WebhookChannelHealthStatus = "degraded" | "paused" | (string & {});
|
|
266
|
+
/** Saúde de entrega por canal (`Webhook.channels_health`): só canais com falha. */
|
|
267
|
+
interface WebhookChannelHealth {
|
|
268
|
+
/** Conta de canal (`channel_account.id`); `null` = eventos sem canal. */
|
|
269
|
+
channel_account_id: string | null;
|
|
270
|
+
health_status: WebhookChannelHealthStatus;
|
|
271
|
+
failure_streak: number;
|
|
272
|
+
next_attempt_at: string | null;
|
|
273
|
+
paused_at: string | null;
|
|
274
|
+
last_success_at: string | null;
|
|
275
|
+
last_failure_at: string | null;
|
|
276
|
+
last_response_code: number | null;
|
|
277
|
+
}
|
|
257
278
|
interface Webhook {
|
|
258
279
|
id: string;
|
|
259
280
|
/** Cliente cujas entregas o endpoint recebe; `null` = todos os da Conta. */
|
|
260
281
|
customer_id?: string | null;
|
|
282
|
+
/**
|
|
283
|
+
* Canais cujos eventos o Endpoint recebe (ids de `channelAccounts.list`, os
|
|
284
|
+
* mesmos de `channel_account.id` nos payloads). `null` = todos os canais.
|
|
285
|
+
* Vazio quando os canais marcados foram excluídos: o Endpoint não recebe
|
|
286
|
+
* eventos até ser reconfigurado.
|
|
287
|
+
*/
|
|
288
|
+
channel_account_ids?: string[] | null;
|
|
289
|
+
/**
|
|
290
|
+
* Saúde por canal, só dos canais com falha (vazio = tudo saudável). A espera,
|
|
291
|
+
* as falhas seguidas e a pausa contam por canal. `health_status` e
|
|
292
|
+
* `failure_streak` do Endpoint resumem o pior canal: `paused` só quando todos
|
|
293
|
+
* os canais com falha estão pausados.
|
|
294
|
+
*/
|
|
295
|
+
channels_health?: WebhookChannelHealth[];
|
|
261
296
|
url: string;
|
|
262
297
|
events?: (WebhookCategory | (string & {}))[];
|
|
263
298
|
active?: boolean;
|
|
@@ -331,6 +366,28 @@ interface BotoZapEvent {
|
|
|
331
366
|
created_at: string;
|
|
332
367
|
data: Record<string, unknown>;
|
|
333
368
|
}
|
|
369
|
+
/** Automação confirmada no evento instagram.comment.replied. */
|
|
370
|
+
interface InstagramCommentAiAutomation {
|
|
371
|
+
kind: "instagram_comment_ai";
|
|
372
|
+
execution_id: string;
|
|
373
|
+
comment_id: string;
|
|
374
|
+
}
|
|
375
|
+
type InstagramCommentAiRepliedEvent = BotoZapEvent & {
|
|
376
|
+
type: "instagram.comment.replied";
|
|
377
|
+
data: {
|
|
378
|
+
channel: "instagram";
|
|
379
|
+
channel_account: ChannelAccountRef;
|
|
380
|
+
external_id: string;
|
|
381
|
+
comment: {
|
|
382
|
+
id: string;
|
|
383
|
+
reply_id: string;
|
|
384
|
+
text: string;
|
|
385
|
+
timestamp: string;
|
|
386
|
+
};
|
|
387
|
+
automation: InstagramCommentAiAutomation;
|
|
388
|
+
[key: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
};
|
|
334
391
|
/** Paginação crescente do stream; `cursor` é seguro para o próximo `after`. */
|
|
335
392
|
interface EventPaging {
|
|
336
393
|
cursor: string;
|
|
@@ -631,7 +688,10 @@ type AiExecution = {
|
|
|
631
688
|
}[];
|
|
632
689
|
usage?: AiUsageTokens | null;
|
|
633
690
|
measurement_status: "measured" | "partial" | "unavailable";
|
|
691
|
+
/** Comentários do Instagram usam comment_ai_*; source continua live. */
|
|
634
692
|
finish_reason: string | null;
|
|
693
|
+
/** Apenas em execuções de comentários; null quando falta preço ou medição. */
|
|
694
|
+
estimated_cost_usd?: number | null;
|
|
635
695
|
error_code: string | null;
|
|
636
696
|
created_at: string;
|
|
637
697
|
completed_at: string | null;
|
|
@@ -4110,6 +4170,13 @@ interface CreateWebhookParams {
|
|
|
4110
4170
|
* de outra Conta → 404 `customer_not_found`.
|
|
4111
4171
|
*/
|
|
4112
4172
|
customer_id?: string | null;
|
|
4173
|
+
/**
|
|
4174
|
+
* Limita as entregas a estes canais (1 a 100 ids de `channelAccounts.list`).
|
|
4175
|
+
* Omitido ou `null` = todos os canais da Conta. Id malformado → 422
|
|
4176
|
+
* `invalid_channel_account_ids`; canal de outra Conta → 404
|
|
4177
|
+
* `channel_account_not_found`.
|
|
4178
|
+
*/
|
|
4179
|
+
channel_account_ids?: string[] | null;
|
|
4113
4180
|
}
|
|
4114
4181
|
interface UpdateWebhookParams {
|
|
4115
4182
|
/**
|
|
@@ -4133,6 +4200,11 @@ interface UpdateWebhookParams {
|
|
|
4133
4200
|
* `null` (ou string vazia) remove o filtro sem invalidar a verificação.
|
|
4134
4201
|
*/
|
|
4135
4202
|
customer_id?: string | null;
|
|
4203
|
+
/**
|
|
4204
|
+
* Omitido = não mexe. `null` volta a receber de todos os canais; um array
|
|
4205
|
+
* (1 a 100 ids) limita as entregas a esses canais.
|
|
4206
|
+
*/
|
|
4207
|
+
channel_account_ids?: string[] | null;
|
|
4136
4208
|
}
|
|
4137
4209
|
/** Webhooks: endpoints assinados que recebem os eventos da conta. */
|
|
4138
4210
|
declare class Webhooks {
|
|
@@ -4262,6 +4334,47 @@ interface InstagramConnection {
|
|
|
4262
4334
|
interface MessageRuleQrParams {
|
|
4263
4335
|
format?: "png" | "svg";
|
|
4264
4336
|
}
|
|
4337
|
+
/** Configuração e prontidão da IA de comentários; desligada por padrão. */
|
|
4338
|
+
interface InstagramCommentAi {
|
|
4339
|
+
enabled: boolean;
|
|
4340
|
+
agent_id: string | null;
|
|
4341
|
+
/** Inteiro 1–200; padrão 50. */
|
|
4342
|
+
daily_limit: number;
|
|
4343
|
+
status: "inactive" | "active" | "testing" | "paused" | (string & {});
|
|
4344
|
+
/** Respostas públicas confirmadas no dia. */
|
|
4345
|
+
answered_today: number;
|
|
4346
|
+
/** Tentativas admitidas, inclusive incertas; podem superar answered_today. */
|
|
4347
|
+
reserved_today: number;
|
|
4348
|
+
timezone: "America/Sao_Paulo" | (string & {});
|
|
4349
|
+
gate_mode: "pre_go_live" | "allowlist" | "open" | (string & {});
|
|
4350
|
+
readiness: string[];
|
|
4351
|
+
}
|
|
4352
|
+
/** PATCH parcial; envie ao menos um campo. Ausente preserva; null limpa o agente. */
|
|
4353
|
+
interface UpdateCommentAiParams {
|
|
4354
|
+
enabled?: boolean;
|
|
4355
|
+
agent_id?: string | null;
|
|
4356
|
+
/** Inteiro de 1 a 200. */
|
|
4357
|
+
daily_limit?: number;
|
|
4358
|
+
}
|
|
4359
|
+
type CommentAiDeliveryStatus = "pending" | "sending" | "sent" | "failed" | "unknown" | "skipped" | (string & {});
|
|
4360
|
+
/** Histórico público da decisão e dos envios, sem claims ou credenciais. */
|
|
4361
|
+
interface InstagramCommentAiRun {
|
|
4362
|
+
id: string;
|
|
4363
|
+
comment_id: string;
|
|
4364
|
+
comment_text: string | null;
|
|
4365
|
+
author_username: string | null;
|
|
4366
|
+
media_id: string | null;
|
|
4367
|
+
execution_id: string | null;
|
|
4368
|
+
status: "processing" | "ready" | "completed" | "skipped" | "failed" | "unknown" | (string & {});
|
|
4369
|
+
action: "public" | "private" | "ignore" | (string & {}) | null;
|
|
4370
|
+
reason: string | null;
|
|
4371
|
+
reason_message: string;
|
|
4372
|
+
reply_text: string | null;
|
|
4373
|
+
dm_status: CommentAiDeliveryStatus;
|
|
4374
|
+
reply_status: CommentAiDeliveryStatus;
|
|
4375
|
+
created_at: string;
|
|
4376
|
+
completed_at: string | null;
|
|
4377
|
+
}
|
|
4265
4378
|
/** Estado de uma Regra de comentário. `paused_plan`: ativa, mas pausada pelo plano. */
|
|
4266
4379
|
type CommentRuleStatus = "active" | "inactive" | "paused_plan" | (string & {});
|
|
4267
4380
|
/**
|
|
@@ -4505,6 +4618,16 @@ declare class ChannelAccounts {
|
|
|
4505
4618
|
resubscribeConnection(id: string): Promise<InstagramConnection>;
|
|
4506
4619
|
/** Desconecta a conta. numbers:write; por chave de API (OAuth: somente painel). */
|
|
4507
4620
|
disconnect(id: string): Promise<InstagramConnection>;
|
|
4621
|
+
/** Configuração, uso diário e prontidão. agents:read; sem sandbox. */
|
|
4622
|
+
getCommentAi(channelAccountId: string): Promise<InstagramCommentAi>;
|
|
4623
|
+
/**
|
|
4624
|
+
* PATCH parcial. Ativar pode publicar respostas e enviar DMs automáticas.
|
|
4625
|
+
* agents:write e capacidade ai (desligar somente é livre); sem sandbox.
|
|
4626
|
+
* Chave de API; no OAuth a configuração é exclusiva do painel.
|
|
4627
|
+
*/
|
|
4628
|
+
updateCommentAi(channelAccountId: string, params: UpdateCommentAiParams): Promise<InstagramCommentAi>;
|
|
4629
|
+
/** Histórico, mais recente primeiro, com paginação offset. agents:read; sem sandbox. */
|
|
4630
|
+
listCommentAiRuns(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<InstagramCommentAiRun>>;
|
|
4508
4631
|
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
4509
4632
|
getMessageRuleQr(id: string, ruleId: string, params?: MessageRuleQrParams): Promise<ArrayBuffer>;
|
|
4510
4633
|
/** Lista as Regras de comentário de uma Conta do Instagram (UUID). comment-rules:read. */
|
|
@@ -4908,4 +5031,4 @@ declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_re
|
|
|
4908
5031
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
4909
5032
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
4910
5033
|
|
|
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 };
|
|
5034
|
+
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, type AiBudget, type AiBudgetInput, type AiCapabilitySignal, type AiCapabilityUsage, type AiCapabilityUsageList, type AiCase, type AiCaseChat, type AiCaseEvent, type AiCaseKind, type AiCaseReply, type AiCaseReplyInput, type AiCaseSource, AiCasesResource, type AiCatalogItems, type AiCatalogModel, type AiCatalogProduct, type AiCatalogSyncInput, type AiCatalogSyncResult, type AiChannelGate, type AiCommercialDecision, type AiCommercialEffect, type AiCommercialJob, type AiCommercialProposal, AiCommercialProposalsResource, type AiCommercialRequest, type AiCommercialSettings, type AiConfigurablePurpose, type AiContactAuthorization, type AiConversationCheckpoint, type AiCredential, AiCredentialsResource, type AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, type AiEnrollment, type AiEvolution, AiEvolutionResource, type AiEvolutionSource, type AiExecution, type AiExecutionCitations, type AiExecutionSecurity, AiExecutionsResource, type AiField, type AiFlow, type AiFlowGraph, type AiFlowInput, type AiFlowSettings, type AiFlowVersion, type AiFollowupEffect, type AiFollowupEvent, AiFollowupFlowsResource, type AiFollowupPromise, type AiFollowupPromiseDetail, type AiFollowupPromiseStatus, type AiFollowupQueueFilters, type AiFollowupQueuePage, type AiFollowupQueueRow, AiFollowupsResource, type AiGateMode, type AiInference, type AiInferenceOrigin, type AiInferenceOutcome, type AiInferenceSummary, AiInferencesResource, type AiKnowledgeChunk, type AiKnowledgeCitation, type AiKnowledgeConversation, type AiKnowledgeHit, type AiKnowledgeImport, type AiKnowledgePreview, AiKnowledgeResource, type AiKnowledgeSearchDiagnostics, type AiKnowledgeSource, type AiMemory, type AiMemoryEntry, type AiMemoryEntryEvent, AiMemoryResource, type AiModelCatalogSnapshot, type AiModelCatalogSync, type AiNoticeCheck, type AiNoticeEffect, type AiNoticeField, type AiNoticeJob, type AiNoticeSettings, AiNoticesResource, type AiOperation, type AiOperatorMetrics, AiOperatorResource, type AiPage, type AiPlatformSkill, type AiPlatformSkillComposition, type AiPreparedUpload, type AiProposal, AiProposalsResource, type AiProvider, type AiProviderInfo, type AiProviderModel, AiProvidersResource, type AiPurpose, type AiRate, type AiRateInput, type AiRecord, type AiRevision, type AiRouter, type AiRouterConfig, type AiRouterTest, AiRoutersResource, type AiScope, type AiSkill, type AiSkillInput, type AiSkillNearMiss, type AiSkillVersion, AiSkillsResource, type AiSourceKind, type AiStyleAdjustment, type AiStyleAdjustmentId, AiStyleAdjustmentsResource, type AiToolId, type AiTurnPromise, type AiUploadReceiptCallback, AiUploadsResource, AiUsageResource, type AiUsageSummary, type AiUsageTokens, type AiWindow, type ApiLog, type Appointment, type AppointmentAvailability, type AppointmentExceptionInput, type AppointmentFields, type AppointmentHistory, type AppointmentQuery, type AppointmentScheduleInput, type AppointmentServiceInput, type AppointmentStatus, Appointments, type Assignment, type AvailabilityQuery, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type ChannelAccount, type ChannelAccountRef, ChannelAccounts, type CommentAiDeliveryStatus, type CommentRule, type CommentRuleCounters, type CommentRuleMetrics, type CommentRuleMetricsParams, type CommentRuleStatus, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, type CreateSetupLinkParams, type CreateTemplateParams, type CreateWebhookParams, type CrmActivity, type CrmConversation, type CrmFields, type CrmMetadata, type CrmQuery, type CrmRecord, CrmResource, type CursorList, type CursorPaging, type CursorParams, type Customer, type DeleteCommentRuleResult, type DeleteMessageRuleResult, type Demand, type DemandFields, type EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type InstagramCommentAi, type InstagramCommentAiAutomation, type InstagramCommentAiRepliedEvent, type InstagramCommentAiRun, type InstagramConnection, type InstagramGenericElement, type InstagramIceBreaker, type InstagramInteractiveButton, type InstagramInteractiveButtonPayload, type InstagramInteractiveGenericPayload, type InstagramInteractivePayload, type InstagramPersistentMenuItem, type InstagramTokenStatus, type InteractiveButtonPayload, type InteractiveCtaUrlPayload, type InteractiveHeader, type InteractiveListPayload, type InteractivePayload, type Journey, type JourneyConfig, type JourneyEnrollment, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListChannelAccountsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, type MessageRule, type MessageRuleAction, type MessageRuleQrParams, type MessageRuleTrigger, type MessageSort, type MessageSource, type MessageStatus, type MessengerProfile, type MessengerProfileConfig, type MetaCostCategory, type MetaCostDay, type MetaCostEstimate, type MetaCostGroup, type MetaCostReport, type MetaCostSource, type MetaCostSync, type MetaCostUnavailableReason, type MetaCostsParams, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, PLAN_ERROR_CODES, type PhoneNumber, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, type RequestOptions, SavedReplies, type SavedReply, type SavedReplyInput, type SavedReplyQuery, type ScheduleBroadcastParams, type SendAudioParams, type SendDocumentParams, type SendFailureDetails, type SendImageParams, type SendInteractiveParams, type SendLocationParams, type SendMediaParams, type SendOptions, type SendReactionParams, type SendReactionResult, type SendResult, type SendTemplateParams, type SendTextParams, type SendVideoParams, type SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,10 @@ interface MessageContent {
|
|
|
142
142
|
body?: string;
|
|
143
143
|
/** Presente quando o contato editou a mensagem: o conteúdo já é o editado. */
|
|
144
144
|
edited?: MessageEdit;
|
|
145
|
+
/** Private Reply gerada pela IA de comentários do Instagram. */
|
|
146
|
+
source?: string;
|
|
147
|
+
ai_execution_id?: string;
|
|
148
|
+
comment_id?: string;
|
|
145
149
|
[key: string]: unknown;
|
|
146
150
|
}
|
|
147
151
|
interface Message {
|
|
@@ -254,10 +258,41 @@ interface Assignment {
|
|
|
254
258
|
id: string;
|
|
255
259
|
[key: string]: unknown;
|
|
256
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Estado de entrega de um canal com falha. `paused` para só esse canal (na 15ª
|
|
263
|
+
* falha seguida); os outros canais do Endpoint seguem recebendo.
|
|
264
|
+
*/
|
|
265
|
+
type WebhookChannelHealthStatus = "degraded" | "paused" | (string & {});
|
|
266
|
+
/** Saúde de entrega por canal (`Webhook.channels_health`): só canais com falha. */
|
|
267
|
+
interface WebhookChannelHealth {
|
|
268
|
+
/** Conta de canal (`channel_account.id`); `null` = eventos sem canal. */
|
|
269
|
+
channel_account_id: string | null;
|
|
270
|
+
health_status: WebhookChannelHealthStatus;
|
|
271
|
+
failure_streak: number;
|
|
272
|
+
next_attempt_at: string | null;
|
|
273
|
+
paused_at: string | null;
|
|
274
|
+
last_success_at: string | null;
|
|
275
|
+
last_failure_at: string | null;
|
|
276
|
+
last_response_code: number | null;
|
|
277
|
+
}
|
|
257
278
|
interface Webhook {
|
|
258
279
|
id: string;
|
|
259
280
|
/** Cliente cujas entregas o endpoint recebe; `null` = todos os da Conta. */
|
|
260
281
|
customer_id?: string | null;
|
|
282
|
+
/**
|
|
283
|
+
* Canais cujos eventos o Endpoint recebe (ids de `channelAccounts.list`, os
|
|
284
|
+
* mesmos de `channel_account.id` nos payloads). `null` = todos os canais.
|
|
285
|
+
* Vazio quando os canais marcados foram excluídos: o Endpoint não recebe
|
|
286
|
+
* eventos até ser reconfigurado.
|
|
287
|
+
*/
|
|
288
|
+
channel_account_ids?: string[] | null;
|
|
289
|
+
/**
|
|
290
|
+
* Saúde por canal, só dos canais com falha (vazio = tudo saudável). A espera,
|
|
291
|
+
* as falhas seguidas e a pausa contam por canal. `health_status` e
|
|
292
|
+
* `failure_streak` do Endpoint resumem o pior canal: `paused` só quando todos
|
|
293
|
+
* os canais com falha estão pausados.
|
|
294
|
+
*/
|
|
295
|
+
channels_health?: WebhookChannelHealth[];
|
|
261
296
|
url: string;
|
|
262
297
|
events?: (WebhookCategory | (string & {}))[];
|
|
263
298
|
active?: boolean;
|
|
@@ -331,6 +366,28 @@ interface BotoZapEvent {
|
|
|
331
366
|
created_at: string;
|
|
332
367
|
data: Record<string, unknown>;
|
|
333
368
|
}
|
|
369
|
+
/** Automação confirmada no evento instagram.comment.replied. */
|
|
370
|
+
interface InstagramCommentAiAutomation {
|
|
371
|
+
kind: "instagram_comment_ai";
|
|
372
|
+
execution_id: string;
|
|
373
|
+
comment_id: string;
|
|
374
|
+
}
|
|
375
|
+
type InstagramCommentAiRepliedEvent = BotoZapEvent & {
|
|
376
|
+
type: "instagram.comment.replied";
|
|
377
|
+
data: {
|
|
378
|
+
channel: "instagram";
|
|
379
|
+
channel_account: ChannelAccountRef;
|
|
380
|
+
external_id: string;
|
|
381
|
+
comment: {
|
|
382
|
+
id: string;
|
|
383
|
+
reply_id: string;
|
|
384
|
+
text: string;
|
|
385
|
+
timestamp: string;
|
|
386
|
+
};
|
|
387
|
+
automation: InstagramCommentAiAutomation;
|
|
388
|
+
[key: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
};
|
|
334
391
|
/** Paginação crescente do stream; `cursor` é seguro para o próximo `after`. */
|
|
335
392
|
interface EventPaging {
|
|
336
393
|
cursor: string;
|
|
@@ -631,7 +688,10 @@ type AiExecution = {
|
|
|
631
688
|
}[];
|
|
632
689
|
usage?: AiUsageTokens | null;
|
|
633
690
|
measurement_status: "measured" | "partial" | "unavailable";
|
|
691
|
+
/** Comentários do Instagram usam comment_ai_*; source continua live. */
|
|
634
692
|
finish_reason: string | null;
|
|
693
|
+
/** Apenas em execuções de comentários; null quando falta preço ou medição. */
|
|
694
|
+
estimated_cost_usd?: number | null;
|
|
635
695
|
error_code: string | null;
|
|
636
696
|
created_at: string;
|
|
637
697
|
completed_at: string | null;
|
|
@@ -4110,6 +4170,13 @@ interface CreateWebhookParams {
|
|
|
4110
4170
|
* de outra Conta → 404 `customer_not_found`.
|
|
4111
4171
|
*/
|
|
4112
4172
|
customer_id?: string | null;
|
|
4173
|
+
/**
|
|
4174
|
+
* Limita as entregas a estes canais (1 a 100 ids de `channelAccounts.list`).
|
|
4175
|
+
* Omitido ou `null` = todos os canais da Conta. Id malformado → 422
|
|
4176
|
+
* `invalid_channel_account_ids`; canal de outra Conta → 404
|
|
4177
|
+
* `channel_account_not_found`.
|
|
4178
|
+
*/
|
|
4179
|
+
channel_account_ids?: string[] | null;
|
|
4113
4180
|
}
|
|
4114
4181
|
interface UpdateWebhookParams {
|
|
4115
4182
|
/**
|
|
@@ -4133,6 +4200,11 @@ interface UpdateWebhookParams {
|
|
|
4133
4200
|
* `null` (ou string vazia) remove o filtro sem invalidar a verificação.
|
|
4134
4201
|
*/
|
|
4135
4202
|
customer_id?: string | null;
|
|
4203
|
+
/**
|
|
4204
|
+
* Omitido = não mexe. `null` volta a receber de todos os canais; um array
|
|
4205
|
+
* (1 a 100 ids) limita as entregas a esses canais.
|
|
4206
|
+
*/
|
|
4207
|
+
channel_account_ids?: string[] | null;
|
|
4136
4208
|
}
|
|
4137
4209
|
/** Webhooks: endpoints assinados que recebem os eventos da conta. */
|
|
4138
4210
|
declare class Webhooks {
|
|
@@ -4262,6 +4334,47 @@ interface InstagramConnection {
|
|
|
4262
4334
|
interface MessageRuleQrParams {
|
|
4263
4335
|
format?: "png" | "svg";
|
|
4264
4336
|
}
|
|
4337
|
+
/** Configuração e prontidão da IA de comentários; desligada por padrão. */
|
|
4338
|
+
interface InstagramCommentAi {
|
|
4339
|
+
enabled: boolean;
|
|
4340
|
+
agent_id: string | null;
|
|
4341
|
+
/** Inteiro 1–200; padrão 50. */
|
|
4342
|
+
daily_limit: number;
|
|
4343
|
+
status: "inactive" | "active" | "testing" | "paused" | (string & {});
|
|
4344
|
+
/** Respostas públicas confirmadas no dia. */
|
|
4345
|
+
answered_today: number;
|
|
4346
|
+
/** Tentativas admitidas, inclusive incertas; podem superar answered_today. */
|
|
4347
|
+
reserved_today: number;
|
|
4348
|
+
timezone: "America/Sao_Paulo" | (string & {});
|
|
4349
|
+
gate_mode: "pre_go_live" | "allowlist" | "open" | (string & {});
|
|
4350
|
+
readiness: string[];
|
|
4351
|
+
}
|
|
4352
|
+
/** PATCH parcial; envie ao menos um campo. Ausente preserva; null limpa o agente. */
|
|
4353
|
+
interface UpdateCommentAiParams {
|
|
4354
|
+
enabled?: boolean;
|
|
4355
|
+
agent_id?: string | null;
|
|
4356
|
+
/** Inteiro de 1 a 200. */
|
|
4357
|
+
daily_limit?: number;
|
|
4358
|
+
}
|
|
4359
|
+
type CommentAiDeliveryStatus = "pending" | "sending" | "sent" | "failed" | "unknown" | "skipped" | (string & {});
|
|
4360
|
+
/** Histórico público da decisão e dos envios, sem claims ou credenciais. */
|
|
4361
|
+
interface InstagramCommentAiRun {
|
|
4362
|
+
id: string;
|
|
4363
|
+
comment_id: string;
|
|
4364
|
+
comment_text: string | null;
|
|
4365
|
+
author_username: string | null;
|
|
4366
|
+
media_id: string | null;
|
|
4367
|
+
execution_id: string | null;
|
|
4368
|
+
status: "processing" | "ready" | "completed" | "skipped" | "failed" | "unknown" | (string & {});
|
|
4369
|
+
action: "public" | "private" | "ignore" | (string & {}) | null;
|
|
4370
|
+
reason: string | null;
|
|
4371
|
+
reason_message: string;
|
|
4372
|
+
reply_text: string | null;
|
|
4373
|
+
dm_status: CommentAiDeliveryStatus;
|
|
4374
|
+
reply_status: CommentAiDeliveryStatus;
|
|
4375
|
+
created_at: string;
|
|
4376
|
+
completed_at: string | null;
|
|
4377
|
+
}
|
|
4265
4378
|
/** Estado de uma Regra de comentário. `paused_plan`: ativa, mas pausada pelo plano. */
|
|
4266
4379
|
type CommentRuleStatus = "active" | "inactive" | "paused_plan" | (string & {});
|
|
4267
4380
|
/**
|
|
@@ -4505,6 +4618,16 @@ declare class ChannelAccounts {
|
|
|
4505
4618
|
resubscribeConnection(id: string): Promise<InstagramConnection>;
|
|
4506
4619
|
/** Desconecta a conta. numbers:write; por chave de API (OAuth: somente painel). */
|
|
4507
4620
|
disconnect(id: string): Promise<InstagramConnection>;
|
|
4621
|
+
/** Configuração, uso diário e prontidão. agents:read; sem sandbox. */
|
|
4622
|
+
getCommentAi(channelAccountId: string): Promise<InstagramCommentAi>;
|
|
4623
|
+
/**
|
|
4624
|
+
* PATCH parcial. Ativar pode publicar respostas e enviar DMs automáticas.
|
|
4625
|
+
* agents:write e capacidade ai (desligar somente é livre); sem sandbox.
|
|
4626
|
+
* Chave de API; no OAuth a configuração é exclusiva do painel.
|
|
4627
|
+
*/
|
|
4628
|
+
updateCommentAi(channelAccountId: string, params: UpdateCommentAiParams): Promise<InstagramCommentAi>;
|
|
4629
|
+
/** Histórico, mais recente primeiro, com paginação offset. agents:read; sem sandbox. */
|
|
4630
|
+
listCommentAiRuns(channelAccountId: string, params?: OffsetParams): Promise<OffsetList<InstagramCommentAiRun>>;
|
|
4508
4631
|
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
4509
4632
|
getMessageRuleQr(id: string, ruleId: string, params?: MessageRuleQrParams): Promise<ArrayBuffer>;
|
|
4510
4633
|
/** Lista as Regras de comentário de uma Conta do Instagram (UUID). comment-rules:read. */
|
|
@@ -4908,4 +5031,4 @@ declare const PLAN_ERROR_CODES: readonly ["plan_restricted", "free_form_limit_re
|
|
|
4908
5031
|
/** True quando o erro é recusa por plano (upgrade resolve; retry não). */
|
|
4909
5032
|
declare function isPlanError(error: unknown): error is BotoZapError;
|
|
4910
5033
|
|
|
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 };
|
|
5034
|
+
export { AI_CONFIGURABLE_PURPOSES, AI_CREDENTIAL_PROVIDERS, AI_OPERATIONS, AI_PURPOSES, type AddRecipientsError, type AddRecipientsResult, AgendaConfiguration, AgendaExceptions, type AgendaRecord, Ai, type AiAgent, type AiAgentConfig, type AiAgentCoverage, type AiAgentInput, type AiAgentVersion, AiAgentsResource, type AiAlert, type AiAlertBulkFilters, type AiAlertListItem, AiAlertsResource, type AiArtifactUploadInput, type AiAudioPricing, type AiBinding, type AiBindingTarget, type AiBudget, type AiBudgetInput, type AiCapabilitySignal, type AiCapabilityUsage, type AiCapabilityUsageList, type AiCase, type AiCaseChat, type AiCaseEvent, type AiCaseKind, type AiCaseReply, type AiCaseReplyInput, type AiCaseSource, AiCasesResource, type AiCatalogItems, type AiCatalogModel, type AiCatalogProduct, type AiCatalogSyncInput, type AiCatalogSyncResult, type AiChannelGate, type AiCommercialDecision, type AiCommercialEffect, type AiCommercialJob, type AiCommercialProposal, AiCommercialProposalsResource, type AiCommercialRequest, type AiCommercialSettings, type AiConfigurablePurpose, type AiContactAuthorization, type AiConversationCheckpoint, type AiCredential, AiCredentialsResource, type AiDraftResult, type AiEligibilityOverview, AiEligibilityResource, type AiEligibilitySettings, type AiEnrollment, type AiEvolution, AiEvolutionResource, type AiEvolutionSource, type AiExecution, type AiExecutionCitations, type AiExecutionSecurity, AiExecutionsResource, type AiField, type AiFlow, type AiFlowGraph, type AiFlowInput, type AiFlowSettings, type AiFlowVersion, type AiFollowupEffect, type AiFollowupEvent, AiFollowupFlowsResource, type AiFollowupPromise, type AiFollowupPromiseDetail, type AiFollowupPromiseStatus, type AiFollowupQueueFilters, type AiFollowupQueuePage, type AiFollowupQueueRow, AiFollowupsResource, type AiGateMode, type AiInference, type AiInferenceOrigin, type AiInferenceOutcome, type AiInferenceSummary, AiInferencesResource, type AiKnowledgeChunk, type AiKnowledgeCitation, type AiKnowledgeConversation, type AiKnowledgeHit, type AiKnowledgeImport, type AiKnowledgePreview, AiKnowledgeResource, type AiKnowledgeSearchDiagnostics, type AiKnowledgeSource, type AiMemory, type AiMemoryEntry, type AiMemoryEntryEvent, AiMemoryResource, type AiModelCatalogSnapshot, type AiModelCatalogSync, type AiNoticeCheck, type AiNoticeEffect, type AiNoticeField, type AiNoticeJob, type AiNoticeSettings, AiNoticesResource, type AiOperation, type AiOperatorMetrics, AiOperatorResource, type AiPage, type AiPlatformSkill, type AiPlatformSkillComposition, type AiPreparedUpload, type AiProposal, AiProposalsResource, type AiProvider, type AiProviderInfo, type AiProviderModel, AiProvidersResource, type AiPurpose, type AiRate, type AiRateInput, type AiRecord, type AiRevision, type AiRouter, type AiRouterConfig, type AiRouterTest, AiRoutersResource, type AiScope, type AiSkill, type AiSkillInput, type AiSkillNearMiss, type AiSkillVersion, AiSkillsResource, type AiSourceKind, type AiStyleAdjustment, type AiStyleAdjustmentId, AiStyleAdjustmentsResource, type AiToolId, type AiTurnPromise, type AiUploadReceiptCallback, AiUploadsResource, AiUsageResource, type AiUsageSummary, type AiUsageTokens, type AiWindow, type ApiLog, type Appointment, type AppointmentAvailability, type AppointmentExceptionInput, type AppointmentFields, type AppointmentHistory, type AppointmentQuery, type AppointmentScheduleInput, type AppointmentServiceInput, type AppointmentStatus, Appointments, type Assignment, type AvailabilityQuery, BotoZap, BotoZapError, type BotoZapErrorCode, type BotoZapEvent, type BotoZapOptions, type Broadcast, type BroadcastRecipient, type BroadcastRecipientInput, Calendar, type CalendarConnection, type CalendarJob, type CalendarSelection, type ChannelAccount, type ChannelAccountRef, ChannelAccounts, type CommentAiDeliveryStatus, type CommentRule, type CommentRuleCounters, type CommentRuleMetrics, type CommentRuleMetricsParams, type CommentRuleStatus, type Contact, type ContactField, ContactFields, type ContactStage, ContactStages, type Conversation, type ConversationEntryPoint, type ConversationNote, type ConversationReferral, type ConversationReminder, type CreateAppointment, type CreateAssignmentParams, type CreateBroadcastParams, type CreateCommentRuleParams, type CreateContactParams, type CreateCustomerParams, type CreateDemand, type CreateMessageRuleParams, type CreateOpportunity, type CreateSetupLinkParams, type CreateTemplateParams, type CreateWebhookParams, type CrmActivity, type CrmConversation, type CrmFields, type CrmMetadata, type CrmQuery, type CrmRecord, CrmResource, type CursorList, type CursorPaging, type CursorParams, type Customer, type DeleteCommentRuleResult, type DeleteMessageRuleResult, type Demand, type DemandFields, type EventList, type EventPaging, type FixedRuleMessage, Inbox, type InboxMutation, type InboxMutationResult, type InboxState, type InboxTools, type InstagramCommentAi, type InstagramCommentAiAutomation, type InstagramCommentAiRepliedEvent, type InstagramCommentAiRun, type InstagramConnection, type InstagramGenericElement, type InstagramIceBreaker, type InstagramInteractiveButton, type InstagramInteractiveButtonPayload, type InstagramInteractiveGenericPayload, type InstagramInteractivePayload, type InstagramPersistentMenuItem, type InstagramTokenStatus, type InteractiveButtonPayload, type InteractiveCtaUrlPayload, type InteractiveHeader, type InteractiveListPayload, type InteractivePayload, type Journey, type JourneyConfig, type JourneyEnrollment, type JourneyQuery, type JourneyRun, type JourneyStep, Journeys, type ListApiLogsParams, type ListBroadcastsParams, type ListChannelAccountsParams, type ListContactsParams, type ListConversationsParams, type ListEventsParams, type ListMessagesParams, type ListPhoneNumbersParams, type ListRecipientsParams, type ListTemplatesParams, type ListWebhookDeliveriesParams, type Me, type MediaAsset, type MediaUploadResult, type Message, type MessageChannel, type MessageContent, type MessageEdit, type MessageRule, type MessageRuleAction, type MessageRuleQrParams, type MessageRuleTrigger, type MessageSort, type MessageSource, type MessageStatus, type MessengerProfile, type MessengerProfileConfig, type MetaCostCategory, type MetaCostDay, type MetaCostEstimate, type MetaCostGroup, type MetaCostReport, type MetaCostSource, type MetaCostSync, type MetaCostUnavailableReason, type MetaCostsParams, type OffsetList, type OffsetMeta, type OffsetParams, type Opportunity, type OpportunityFields, PLAN_ERROR_CODES, type PhoneNumber, type QuickReply, Radar, type RadarEntry, type RadarPage, type RadarQuery, type ReplyConversationParams, type RequestOptions, SavedReplies, type SavedReply, type SavedReplyInput, type SavedReplyQuery, type ScheduleBroadcastParams, type SendAudioParams, type SendDocumentParams, type SendFailureDetails, type SendImageParams, type SendInteractiveParams, type SendLocationParams, type SendMediaParams, type SendOptions, type SendReactionParams, type SendReactionResult, type SendResult, type SendTemplateParams, type SendTextParams, type SendVideoParams, type SetupLink, type StageColor, type StageRule, type StageRuleInput, type Template, type TemplatePayload, type UpdateAppointment, type UpdateBroadcastParams, type UpdateCommentAiParams, type UpdateCommentRuleParams, type UpdateContactParams, type UpdateCustomerParams, type UpdateMessageRuleParams, type UpdateMessengerProfileParams, type UpdatePhoneNumberParams, type UpdateSetupLinkParams, type UpdateWebhookParams, type UploadMediaParams, type User, WEBHOOK_CATEGORIES, type Webhook, type WebhookAuthorizationHeaders, type WebhookCategory, type WebhookChannelHealth, type WebhookChannelHealthStatus, type WebhookDelivery, type WebhookDeliveryStatus, isPlanError };
|
package/dist/index.js
CHANGED
|
@@ -5724,6 +5724,26 @@ var ChannelAccounts = class {
|
|
|
5724
5724
|
disconnect(id) {
|
|
5725
5725
|
return this.client.requestItem("DELETE", `/channel_accounts/${enc7(id)}/connection`);
|
|
5726
5726
|
}
|
|
5727
|
+
/** Configuração, uso diário e prontidão. agents:read; sem sandbox. */
|
|
5728
|
+
getCommentAi(channelAccountId) {
|
|
5729
|
+
return this.client.requestItem("GET", `/channel_accounts/${enc7(channelAccountId)}/comment-ai`);
|
|
5730
|
+
}
|
|
5731
|
+
/**
|
|
5732
|
+
* PATCH parcial. Ativar pode publicar respostas e enviar DMs automáticas.
|
|
5733
|
+
* agents:write e capacidade ai (desligar somente é livre); sem sandbox.
|
|
5734
|
+
* Chave de API; no OAuth a configuração é exclusiva do painel.
|
|
5735
|
+
*/
|
|
5736
|
+
updateCommentAi(channelAccountId, params) {
|
|
5737
|
+
return this.client.requestItem("PATCH", `/channel_accounts/${enc7(channelAccountId)}/comment-ai`, { body: params });
|
|
5738
|
+
}
|
|
5739
|
+
/** Histórico, mais recente primeiro, com paginação offset. agents:read; sem sandbox. */
|
|
5740
|
+
listCommentAiRuns(channelAccountId, params = {}) {
|
|
5741
|
+
return this.client.requestOffsetList(
|
|
5742
|
+
"GET",
|
|
5743
|
+
`/channel_accounts/${enc7(channelAccountId)}/comment-ai/runs`,
|
|
5744
|
+
{ query: { page: params.page, per_page: params.per_page } }
|
|
5745
|
+
);
|
|
5746
|
+
}
|
|
5727
5747
|
/** QR do ref_link, PNG por padrão; 404 sem link. message-rules:read. */
|
|
5728
5748
|
getMessageRuleQr(id, ruleId, params = {}) {
|
|
5729
5749
|
return this.client.requestBinary("GET", `${messageRulesPath(id, ruleId)}/qr`, { query: { format: params.format } });
|