@oficialapi/sdk 2.0.0 → 4.0.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/dist/index.d.mts CHANGED
@@ -272,6 +272,10 @@ interface SendWhatsAppMediaCarouselParams {
272
272
  }>;
273
273
  }>;
274
274
  }
275
+ interface DownloadWhatsAppMediaParams {
276
+ token: string;
277
+ url: string;
278
+ }
275
279
  interface SendTelegramTextParams {
276
280
  token: string;
277
281
  chatId: string | number;
@@ -391,6 +395,10 @@ interface DeleteTelegramMessageParams {
391
395
  chatId: string | number;
392
396
  messageId: number;
393
397
  }
398
+ interface DownloadTelegramMediaParams {
399
+ token: string;
400
+ fileId: string;
401
+ }
394
402
  interface SendWebChatTextParams {
395
403
  token: string;
396
404
  sender: string;
@@ -532,6 +540,18 @@ interface SharePostParams {
532
540
  mediaId: string;
533
541
  recipientId: string;
534
542
  }
543
+ interface GetFacebookUserProfileParams {
544
+ token: string;
545
+ userId: string;
546
+ }
547
+ interface GetFacebookPageProfileParams {
548
+ token: string;
549
+ pageId: string;
550
+ }
551
+ interface DownloadFacebookMediaParams {
552
+ token: string;
553
+ url: string;
554
+ }
535
555
  interface SendInstagramPrivateReplyParams {
536
556
  token: string;
537
557
  commentId: string;
@@ -567,6 +587,11 @@ interface ReactInstagramMessageParams {
567
587
  messageId: string;
568
588
  reactionType: 'like' | 'love' | 'wow' | 'haha' | 'sorry' | 'anger';
569
589
  }
590
+ interface RemoveInstagramReactionParams {
591
+ token: string;
592
+ recipientId: string;
593
+ messageId: string;
594
+ }
570
595
  interface SendInstagramQuickRepliesParams {
571
596
  token: string;
572
597
  recipientId: string;
@@ -614,9 +639,16 @@ interface GetInstagramUserProfileParams {
614
639
  }
615
640
  interface ListInstagramPostsParams {
616
641
  token: string;
617
- userId: string;
642
+ userId?: string;
618
643
  limit?: number;
619
644
  }
645
+ interface GetInstagramBusinessProfileParams {
646
+ token: string;
647
+ }
648
+ interface DownloadInstagramMediaParams {
649
+ token: string;
650
+ url: string;
651
+ }
620
652
  interface CreateWebhookParams {
621
653
  url: string;
622
654
  expiresInDays?: number;
@@ -661,8 +693,9 @@ declare class HttpClient {
661
693
  /**
662
694
  * Faz uma requisição DELETE
663
695
  * @param accessToken Token de acesso (obrigatório para endpoints autenticados)
696
+ * @param data Dados a serem enviados no body (opcional)
664
697
  */
665
- delete<T = any>(url: string, accessToken?: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
698
+ delete<T = any>(url: string, accessToken?: string, data?: any, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
666
699
  /**
667
700
  * Faz upload de arquivo
668
701
  * @param accessToken Token de acesso (obrigatório para endpoints autenticados)
@@ -848,6 +881,12 @@ declare class WhatsAppModule {
848
881
  * @param accessToken Token de acesso do usuário
849
882
  */
850
883
  sendMediaCarousel(params: SendWhatsAppMediaCarouselParams, accessToken: string): Promise<ApiResponse<any>>;
884
+ /**
885
+ * Baixa uma mídia descriptografada do WhatsApp usando a URL
886
+ * @param params Parâmetros do download
887
+ * @param accessToken Token de acesso do usuário
888
+ */
889
+ downloadMedia(params: DownloadWhatsAppMediaParams, accessToken: string): Promise<ApiResponse<any>>;
851
890
  }
852
891
 
853
892
  /**
@@ -946,6 +985,12 @@ declare class TelegramModule {
946
985
  * @param accessToken Token de acesso do usuário
947
986
  */
948
987
  deleteMessage(params: DeleteTelegramMessageParams, accessToken: string): Promise<ApiResponse<any>>;
988
+ /**
989
+ * Baixa uma mídia descriptografada do Telegram usando o file_id
990
+ * @param params Parâmetros do download
991
+ * @param accessToken Token de acesso do usuário
992
+ */
993
+ downloadMedia(params: DownloadTelegramMediaParams, accessToken: string): Promise<ApiResponse<any>>;
949
994
  }
950
995
 
951
996
  /**
@@ -1076,6 +1121,24 @@ declare class FacebookModule {
1076
1121
  * @param accessToken Token de acesso do usuário
1077
1122
  */
1078
1123
  sharePost(params: SharePostParams, accessToken: string): Promise<ApiResponse<any>>;
1124
+ /**
1125
+ * Obtém perfil de um usuário do Facebook
1126
+ * @param params Parâmetros do perfil
1127
+ * @param accessToken Token de acesso do usuário
1128
+ */
1129
+ getUserProfile(params: GetFacebookUserProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1130
+ /**
1131
+ * Obtém informações de uma página do Facebook
1132
+ * @param params Parâmetros da página
1133
+ * @param accessToken Token de acesso do usuário
1134
+ */
1135
+ getPageProfile(params: GetFacebookPageProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1136
+ /**
1137
+ * Baixa uma mídia descriptografada do Facebook/Instagram usando a URL
1138
+ * @param params Parâmetros do download
1139
+ * @param accessToken Token de acesso do usuário
1140
+ */
1141
+ downloadMedia(params: DownloadFacebookMediaParams, accessToken: string): Promise<ApiResponse<any>>;
1079
1142
  }
1080
1143
 
1081
1144
  /**
@@ -1122,11 +1185,10 @@ declare class InstagramModule {
1122
1185
  reactMessage(params: ReactInstagramMessageParams, accessToken: string): Promise<ApiResponse<any>>;
1123
1186
  /**
1124
1187
  * Remove reação de uma mensagem
1125
- * @param token Token do canal
1126
- * @param messageId ID da mensagem
1188
+ * @param params Parâmetros da remoção
1127
1189
  * @param accessToken Token de acesso do usuário
1128
1190
  */
1129
- removeReaction(token: string, messageId: string, accessToken: string): Promise<ApiResponse<any>>;
1191
+ removeReaction(params: RemoveInstagramReactionParams, accessToken: string): Promise<ApiResponse<any>>;
1130
1192
  /**
1131
1193
  * Envia quick replies
1132
1194
  * @param params Parâmetros dos quick replies
@@ -1152,8 +1214,25 @@ declare class InstagramModule {
1152
1214
  */
1153
1215
  sendSenderAction(params: SendInstagramSenderActionParams, accessToken: string): Promise<ApiResponse<any>>;
1154
1216
  /**
1155
- * Obtém perfil de um usuário
1217
+ * Obtém perfil de um usuário do Instagram
1218
+ *
1219
+ * Obtém informações de perfil de um usuário do Instagram.
1220
+ *
1221
+ * Campos retornados:
1222
+ * - id: ID do usuário
1223
+ * - name: Nome do usuário (pode ser nulo)
1224
+ * - username: Nome de usuário do Instagram
1225
+ *
1226
+ * ⚠️ Nota: A API do Instagram Graph API para usuários regulares (tipo User)
1227
+ * retorna apenas campos básicos. Campos como foto de perfil, número de seguidores
1228
+ * e status de verificação não estão disponíveis para usuários regulares.
1229
+ *
1230
+ * ⚠️ O usuário deve ter enviado mensagem direta para sua conta.
1231
+ * Não é possível obter perfil de quem apenas comentou.
1232
+ *
1156
1233
  * @param params Parâmetros do perfil
1234
+ * @param params.token Token do canal
1235
+ * @param params.userId ID do usuário (IGSID)
1157
1236
  * @param accessToken Token de acesso do usuário
1158
1237
  */
1159
1238
  getUserProfile(params: GetInstagramUserProfileParams, accessToken: string): Promise<ApiResponse<any>>;
@@ -1163,6 +1242,18 @@ declare class InstagramModule {
1163
1242
  * @param accessToken Token de acesso do usuário
1164
1243
  */
1165
1244
  listPosts(params: ListInstagramPostsParams, accessToken: string): Promise<ApiResponse<any>>;
1245
+ /**
1246
+ * Obtém perfil da conta comercial do Instagram
1247
+ * @param params Parâmetros do perfil
1248
+ * @param accessToken Token de acesso do usuário
1249
+ */
1250
+ getBusinessProfile(params: GetInstagramBusinessProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1251
+ /**
1252
+ * Baixa uma mídia descriptografada do Instagram usando a URL
1253
+ * @param params Parâmetros do download
1254
+ * @param accessToken Token de acesso do usuário
1255
+ */
1256
+ downloadMedia(params: DownloadInstagramMediaParams, accessToken: string): Promise<ApiResponse<any>>;
1166
1257
  }
1167
1258
 
1168
1259
  /**
@@ -1198,4 +1289,4 @@ declare class OficialAPISDK {
1198
1289
  constructor(config: SDKConfig);
1199
1290
  }
1200
1291
 
1201
- export { type ApiResponse, type Channel, type CreatePostParams, type CreateTemplateParams, type CreateWebhookParams, type DeleteCommentParams, type DeleteTelegramMessageParams, type EditTelegramMessageParams, type GetInstagramUserProfileParams, type ListCommentsParams, type ListInstagramPostsParams, type ListPostsParams, OficialAPISDK, type ReactInstagramMessageParams, type ReactWhatsAppParams, type ReplyCommentParams, type ReplyFacebookMediaParams, type ReplyFacebookMessageParams, type ReplyWhatsAppParams, type SDKConfig, type SendFacebookButtonsParams, type SendFacebookMediaParams, type SendFacebookStickerParams, type SendFacebookTextParams, type SendInstagramButtonTemplateParams, type SendInstagramGenericTemplateParams, type SendInstagramImagesParams, type SendInstagramMediaParams, type SendInstagramPrivateReplyParams, type SendInstagramQuickRepliesParams, type SendInstagramSenderActionParams, type SendInstagramStickerParams, type SendInstagramTextParams, type SendOrderDetailsParams, type SendOrderStatusParams, type SendTelegramButtonsParams, type SendTelegramContactParams, type SendTelegramDiceParams, type SendTelegramLocationParams, type SendTelegramMediaGroupParams, type SendTelegramMediaParams, type SendTelegramPollParams, type SendTelegramReplyKeyboardParams, type SendTelegramStickerParams, type SendTelegramTextParams, type SendTelegramVenueParams, type SendTelegramVideoNoteParams, type SendTelegramVoiceParams, type SendWebChatButtonsParams, type SendWebChatCardParams, type SendWebChatCarouselParams, type SendWebChatFormParams, type SendWebChatMediaParams, type SendWebChatQuickRepliesParams, type SendWebChatTextParams, type SendWhatsAppAudioParams, type SendWhatsAppButtonsParams, type SendWhatsAppContactParams, type SendWhatsAppCtaUrlParams, type SendWhatsAppDocumentParams, type SendWhatsAppListParams, type SendWhatsAppLocationParams, type SendWhatsAppLocationRequestParams, type SendWhatsAppMediaCarouselParams, type SendWhatsAppMediaParams, type SendWhatsAppStickerParams, type SendWhatsAppTemplateParams, type SendWhatsAppTextParams, type SendWhatsAppVideoParams, type SharePostParams, type TokenResponse, type UploadMediaParams, type Webhook, OficialAPISDK as default };
1292
+ export { type ApiResponse, type Channel, type CreatePostParams, type CreateTemplateParams, type CreateWebhookParams, type DeleteCommentParams, type DeleteTelegramMessageParams, type DownloadFacebookMediaParams, type DownloadInstagramMediaParams, type DownloadTelegramMediaParams, type DownloadWhatsAppMediaParams, type EditTelegramMessageParams, type GetFacebookPageProfileParams, type GetFacebookUserProfileParams, type GetInstagramBusinessProfileParams, type GetInstagramUserProfileParams, type ListCommentsParams, type ListInstagramPostsParams, type ListPostsParams, OficialAPISDK, type ReactInstagramMessageParams, type ReactWhatsAppParams, type RemoveInstagramReactionParams, type ReplyCommentParams, type ReplyFacebookMediaParams, type ReplyFacebookMessageParams, type ReplyWhatsAppParams, type SDKConfig, type SendFacebookButtonsParams, type SendFacebookMediaParams, type SendFacebookStickerParams, type SendFacebookTextParams, type SendInstagramButtonTemplateParams, type SendInstagramGenericTemplateParams, type SendInstagramImagesParams, type SendInstagramMediaParams, type SendInstagramPrivateReplyParams, type SendInstagramQuickRepliesParams, type SendInstagramSenderActionParams, type SendInstagramStickerParams, type SendInstagramTextParams, type SendOrderDetailsParams, type SendOrderStatusParams, type SendTelegramButtonsParams, type SendTelegramContactParams, type SendTelegramDiceParams, type SendTelegramLocationParams, type SendTelegramMediaGroupParams, type SendTelegramMediaParams, type SendTelegramPollParams, type SendTelegramReplyKeyboardParams, type SendTelegramStickerParams, type SendTelegramTextParams, type SendTelegramVenueParams, type SendTelegramVideoNoteParams, type SendTelegramVoiceParams, type SendWebChatButtonsParams, type SendWebChatCardParams, type SendWebChatCarouselParams, type SendWebChatFormParams, type SendWebChatMediaParams, type SendWebChatQuickRepliesParams, type SendWebChatTextParams, type SendWhatsAppAudioParams, type SendWhatsAppButtonsParams, type SendWhatsAppContactParams, type SendWhatsAppCtaUrlParams, type SendWhatsAppDocumentParams, type SendWhatsAppListParams, type SendWhatsAppLocationParams, type SendWhatsAppLocationRequestParams, type SendWhatsAppMediaCarouselParams, type SendWhatsAppMediaParams, type SendWhatsAppStickerParams, type SendWhatsAppTemplateParams, type SendWhatsAppTextParams, type SendWhatsAppVideoParams, type SharePostParams, type TokenResponse, type UploadMediaParams, type Webhook, OficialAPISDK as default };
package/dist/index.d.ts CHANGED
@@ -272,6 +272,10 @@ interface SendWhatsAppMediaCarouselParams {
272
272
  }>;
273
273
  }>;
274
274
  }
275
+ interface DownloadWhatsAppMediaParams {
276
+ token: string;
277
+ url: string;
278
+ }
275
279
  interface SendTelegramTextParams {
276
280
  token: string;
277
281
  chatId: string | number;
@@ -391,6 +395,10 @@ interface DeleteTelegramMessageParams {
391
395
  chatId: string | number;
392
396
  messageId: number;
393
397
  }
398
+ interface DownloadTelegramMediaParams {
399
+ token: string;
400
+ fileId: string;
401
+ }
394
402
  interface SendWebChatTextParams {
395
403
  token: string;
396
404
  sender: string;
@@ -532,6 +540,18 @@ interface SharePostParams {
532
540
  mediaId: string;
533
541
  recipientId: string;
534
542
  }
543
+ interface GetFacebookUserProfileParams {
544
+ token: string;
545
+ userId: string;
546
+ }
547
+ interface GetFacebookPageProfileParams {
548
+ token: string;
549
+ pageId: string;
550
+ }
551
+ interface DownloadFacebookMediaParams {
552
+ token: string;
553
+ url: string;
554
+ }
535
555
  interface SendInstagramPrivateReplyParams {
536
556
  token: string;
537
557
  commentId: string;
@@ -567,6 +587,11 @@ interface ReactInstagramMessageParams {
567
587
  messageId: string;
568
588
  reactionType: 'like' | 'love' | 'wow' | 'haha' | 'sorry' | 'anger';
569
589
  }
590
+ interface RemoveInstagramReactionParams {
591
+ token: string;
592
+ recipientId: string;
593
+ messageId: string;
594
+ }
570
595
  interface SendInstagramQuickRepliesParams {
571
596
  token: string;
572
597
  recipientId: string;
@@ -614,9 +639,16 @@ interface GetInstagramUserProfileParams {
614
639
  }
615
640
  interface ListInstagramPostsParams {
616
641
  token: string;
617
- userId: string;
642
+ userId?: string;
618
643
  limit?: number;
619
644
  }
645
+ interface GetInstagramBusinessProfileParams {
646
+ token: string;
647
+ }
648
+ interface DownloadInstagramMediaParams {
649
+ token: string;
650
+ url: string;
651
+ }
620
652
  interface CreateWebhookParams {
621
653
  url: string;
622
654
  expiresInDays?: number;
@@ -661,8 +693,9 @@ declare class HttpClient {
661
693
  /**
662
694
  * Faz uma requisição DELETE
663
695
  * @param accessToken Token de acesso (obrigatório para endpoints autenticados)
696
+ * @param data Dados a serem enviados no body (opcional)
664
697
  */
665
- delete<T = any>(url: string, accessToken?: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
698
+ delete<T = any>(url: string, accessToken?: string, data?: any, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
666
699
  /**
667
700
  * Faz upload de arquivo
668
701
  * @param accessToken Token de acesso (obrigatório para endpoints autenticados)
@@ -848,6 +881,12 @@ declare class WhatsAppModule {
848
881
  * @param accessToken Token de acesso do usuário
849
882
  */
850
883
  sendMediaCarousel(params: SendWhatsAppMediaCarouselParams, accessToken: string): Promise<ApiResponse<any>>;
884
+ /**
885
+ * Baixa uma mídia descriptografada do WhatsApp usando a URL
886
+ * @param params Parâmetros do download
887
+ * @param accessToken Token de acesso do usuário
888
+ */
889
+ downloadMedia(params: DownloadWhatsAppMediaParams, accessToken: string): Promise<ApiResponse<any>>;
851
890
  }
852
891
 
853
892
  /**
@@ -946,6 +985,12 @@ declare class TelegramModule {
946
985
  * @param accessToken Token de acesso do usuário
947
986
  */
948
987
  deleteMessage(params: DeleteTelegramMessageParams, accessToken: string): Promise<ApiResponse<any>>;
988
+ /**
989
+ * Baixa uma mídia descriptografada do Telegram usando o file_id
990
+ * @param params Parâmetros do download
991
+ * @param accessToken Token de acesso do usuário
992
+ */
993
+ downloadMedia(params: DownloadTelegramMediaParams, accessToken: string): Promise<ApiResponse<any>>;
949
994
  }
950
995
 
951
996
  /**
@@ -1076,6 +1121,24 @@ declare class FacebookModule {
1076
1121
  * @param accessToken Token de acesso do usuário
1077
1122
  */
1078
1123
  sharePost(params: SharePostParams, accessToken: string): Promise<ApiResponse<any>>;
1124
+ /**
1125
+ * Obtém perfil de um usuário do Facebook
1126
+ * @param params Parâmetros do perfil
1127
+ * @param accessToken Token de acesso do usuário
1128
+ */
1129
+ getUserProfile(params: GetFacebookUserProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1130
+ /**
1131
+ * Obtém informações de uma página do Facebook
1132
+ * @param params Parâmetros da página
1133
+ * @param accessToken Token de acesso do usuário
1134
+ */
1135
+ getPageProfile(params: GetFacebookPageProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1136
+ /**
1137
+ * Baixa uma mídia descriptografada do Facebook/Instagram usando a URL
1138
+ * @param params Parâmetros do download
1139
+ * @param accessToken Token de acesso do usuário
1140
+ */
1141
+ downloadMedia(params: DownloadFacebookMediaParams, accessToken: string): Promise<ApiResponse<any>>;
1079
1142
  }
1080
1143
 
1081
1144
  /**
@@ -1122,11 +1185,10 @@ declare class InstagramModule {
1122
1185
  reactMessage(params: ReactInstagramMessageParams, accessToken: string): Promise<ApiResponse<any>>;
1123
1186
  /**
1124
1187
  * Remove reação de uma mensagem
1125
- * @param token Token do canal
1126
- * @param messageId ID da mensagem
1188
+ * @param params Parâmetros da remoção
1127
1189
  * @param accessToken Token de acesso do usuário
1128
1190
  */
1129
- removeReaction(token: string, messageId: string, accessToken: string): Promise<ApiResponse<any>>;
1191
+ removeReaction(params: RemoveInstagramReactionParams, accessToken: string): Promise<ApiResponse<any>>;
1130
1192
  /**
1131
1193
  * Envia quick replies
1132
1194
  * @param params Parâmetros dos quick replies
@@ -1152,8 +1214,25 @@ declare class InstagramModule {
1152
1214
  */
1153
1215
  sendSenderAction(params: SendInstagramSenderActionParams, accessToken: string): Promise<ApiResponse<any>>;
1154
1216
  /**
1155
- * Obtém perfil de um usuário
1217
+ * Obtém perfil de um usuário do Instagram
1218
+ *
1219
+ * Obtém informações de perfil de um usuário do Instagram.
1220
+ *
1221
+ * Campos retornados:
1222
+ * - id: ID do usuário
1223
+ * - name: Nome do usuário (pode ser nulo)
1224
+ * - username: Nome de usuário do Instagram
1225
+ *
1226
+ * ⚠️ Nota: A API do Instagram Graph API para usuários regulares (tipo User)
1227
+ * retorna apenas campos básicos. Campos como foto de perfil, número de seguidores
1228
+ * e status de verificação não estão disponíveis para usuários regulares.
1229
+ *
1230
+ * ⚠️ O usuário deve ter enviado mensagem direta para sua conta.
1231
+ * Não é possível obter perfil de quem apenas comentou.
1232
+ *
1156
1233
  * @param params Parâmetros do perfil
1234
+ * @param params.token Token do canal
1235
+ * @param params.userId ID do usuário (IGSID)
1157
1236
  * @param accessToken Token de acesso do usuário
1158
1237
  */
1159
1238
  getUserProfile(params: GetInstagramUserProfileParams, accessToken: string): Promise<ApiResponse<any>>;
@@ -1163,6 +1242,18 @@ declare class InstagramModule {
1163
1242
  * @param accessToken Token de acesso do usuário
1164
1243
  */
1165
1244
  listPosts(params: ListInstagramPostsParams, accessToken: string): Promise<ApiResponse<any>>;
1245
+ /**
1246
+ * Obtém perfil da conta comercial do Instagram
1247
+ * @param params Parâmetros do perfil
1248
+ * @param accessToken Token de acesso do usuário
1249
+ */
1250
+ getBusinessProfile(params: GetInstagramBusinessProfileParams, accessToken: string): Promise<ApiResponse<any>>;
1251
+ /**
1252
+ * Baixa uma mídia descriptografada do Instagram usando a URL
1253
+ * @param params Parâmetros do download
1254
+ * @param accessToken Token de acesso do usuário
1255
+ */
1256
+ downloadMedia(params: DownloadInstagramMediaParams, accessToken: string): Promise<ApiResponse<any>>;
1166
1257
  }
1167
1258
 
1168
1259
  /**
@@ -1198,4 +1289,4 @@ declare class OficialAPISDK {
1198
1289
  constructor(config: SDKConfig);
1199
1290
  }
1200
1291
 
1201
- export { type ApiResponse, type Channel, type CreatePostParams, type CreateTemplateParams, type CreateWebhookParams, type DeleteCommentParams, type DeleteTelegramMessageParams, type EditTelegramMessageParams, type GetInstagramUserProfileParams, type ListCommentsParams, type ListInstagramPostsParams, type ListPostsParams, OficialAPISDK, type ReactInstagramMessageParams, type ReactWhatsAppParams, type ReplyCommentParams, type ReplyFacebookMediaParams, type ReplyFacebookMessageParams, type ReplyWhatsAppParams, type SDKConfig, type SendFacebookButtonsParams, type SendFacebookMediaParams, type SendFacebookStickerParams, type SendFacebookTextParams, type SendInstagramButtonTemplateParams, type SendInstagramGenericTemplateParams, type SendInstagramImagesParams, type SendInstagramMediaParams, type SendInstagramPrivateReplyParams, type SendInstagramQuickRepliesParams, type SendInstagramSenderActionParams, type SendInstagramStickerParams, type SendInstagramTextParams, type SendOrderDetailsParams, type SendOrderStatusParams, type SendTelegramButtonsParams, type SendTelegramContactParams, type SendTelegramDiceParams, type SendTelegramLocationParams, type SendTelegramMediaGroupParams, type SendTelegramMediaParams, type SendTelegramPollParams, type SendTelegramReplyKeyboardParams, type SendTelegramStickerParams, type SendTelegramTextParams, type SendTelegramVenueParams, type SendTelegramVideoNoteParams, type SendTelegramVoiceParams, type SendWebChatButtonsParams, type SendWebChatCardParams, type SendWebChatCarouselParams, type SendWebChatFormParams, type SendWebChatMediaParams, type SendWebChatQuickRepliesParams, type SendWebChatTextParams, type SendWhatsAppAudioParams, type SendWhatsAppButtonsParams, type SendWhatsAppContactParams, type SendWhatsAppCtaUrlParams, type SendWhatsAppDocumentParams, type SendWhatsAppListParams, type SendWhatsAppLocationParams, type SendWhatsAppLocationRequestParams, type SendWhatsAppMediaCarouselParams, type SendWhatsAppMediaParams, type SendWhatsAppStickerParams, type SendWhatsAppTemplateParams, type SendWhatsAppTextParams, type SendWhatsAppVideoParams, type SharePostParams, type TokenResponse, type UploadMediaParams, type Webhook, OficialAPISDK as default };
1292
+ export { type ApiResponse, type Channel, type CreatePostParams, type CreateTemplateParams, type CreateWebhookParams, type DeleteCommentParams, type DeleteTelegramMessageParams, type DownloadFacebookMediaParams, type DownloadInstagramMediaParams, type DownloadTelegramMediaParams, type DownloadWhatsAppMediaParams, type EditTelegramMessageParams, type GetFacebookPageProfileParams, type GetFacebookUserProfileParams, type GetInstagramBusinessProfileParams, type GetInstagramUserProfileParams, type ListCommentsParams, type ListInstagramPostsParams, type ListPostsParams, OficialAPISDK, type ReactInstagramMessageParams, type ReactWhatsAppParams, type RemoveInstagramReactionParams, type ReplyCommentParams, type ReplyFacebookMediaParams, type ReplyFacebookMessageParams, type ReplyWhatsAppParams, type SDKConfig, type SendFacebookButtonsParams, type SendFacebookMediaParams, type SendFacebookStickerParams, type SendFacebookTextParams, type SendInstagramButtonTemplateParams, type SendInstagramGenericTemplateParams, type SendInstagramImagesParams, type SendInstagramMediaParams, type SendInstagramPrivateReplyParams, type SendInstagramQuickRepliesParams, type SendInstagramSenderActionParams, type SendInstagramStickerParams, type SendInstagramTextParams, type SendOrderDetailsParams, type SendOrderStatusParams, type SendTelegramButtonsParams, type SendTelegramContactParams, type SendTelegramDiceParams, type SendTelegramLocationParams, type SendTelegramMediaGroupParams, type SendTelegramMediaParams, type SendTelegramPollParams, type SendTelegramReplyKeyboardParams, type SendTelegramStickerParams, type SendTelegramTextParams, type SendTelegramVenueParams, type SendTelegramVideoNoteParams, type SendTelegramVoiceParams, type SendWebChatButtonsParams, type SendWebChatCardParams, type SendWebChatCarouselParams, type SendWebChatFormParams, type SendWebChatMediaParams, type SendWebChatQuickRepliesParams, type SendWebChatTextParams, type SendWhatsAppAudioParams, type SendWhatsAppButtonsParams, type SendWhatsAppContactParams, type SendWhatsAppCtaUrlParams, type SendWhatsAppDocumentParams, type SendWhatsAppListParams, type SendWhatsAppLocationParams, type SendWhatsAppLocationRequestParams, type SendWhatsAppMediaCarouselParams, type SendWhatsAppMediaParams, type SendWhatsAppStickerParams, type SendWhatsAppTemplateParams, type SendWhatsAppTextParams, type SendWhatsAppVideoParams, type SharePostParams, type TokenResponse, type UploadMediaParams, type Webhook, OficialAPISDK as default };
package/dist/index.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * @version 1.0.0
4
4
  * @license MIT
5
5
  */
6
- var T="https://api.oficialapi.com.br",a=class{constructor(e){this.config={clientId:e.clientId,clientSecret:e.clientSecret,timeout:e.timeout||3e4,maxRetries:e.maxRetries||3,retryDelay:e.retryDelay||1e3,headers:e.headers||{}},this.axiosInstance=I__default.default.create({baseURL:T,timeout:this.config.timeout,headers:{"Content-Type":"application/json",...this.config.headers}}),this.setupInterceptors();}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{if(e.url?.includes("/auth/token"))return e;let t=e;return t.accessToken&&e.headers&&(e.headers.Authorization=`Bearer ${t.accessToken}`),e},e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,async e=>{let t=e.config;if(!t)return Promise.reject(this.formatError(e));if((!e.response||e.response.status>=500&&e.response.status<600)&&(!t._retryCount||t._retryCount<this.config.maxRetries)){t._retryCount=(t._retryCount||0)+1;let i=this.config.retryDelay*t._retryCount;return await new Promise(s=>setTimeout(s,i)),this.axiosInstance(t)}return Promise.reject(this.formatError(e))});}formatError(e){if(e.response){let t=e.response.data,n=t?.error?.message||t?.message||e.message,i=t?.error?.details||[],s=new Error(n);return s.status=e.response.status,s.data=e.response.data,s.details=i,s}return e.request?new Error("Erro de conex\xE3o com a API. Verifique sua conex\xE3o com a internet."):e}async get(e,t,n){let i={...n,accessToken:t};return (await this.axiosInstance.get(e,i)).data}async post(e,t,n,i){let s={...i,accessToken:n};return (await this.axiosInstance.post(e,t,s)).data}async put(e,t,n,i){let s={...i,accessToken:n};return (await this.axiosInstance.put(e,t,s)).data}async delete(e,t,n){let i={...n,accessToken:t};return (await this.axiosInstance.delete(e,i)).data}async upload(e,t,n,i="file",s){let r=new FormData;if(t instanceof Buffer){let k=new Blob([t]);r.append(i,k);}else r.append(i,t);s&&Object.entries(s).forEach(([k,C])=>{r.append(k,typeof C=="string"?C:JSON.stringify(C));});let P={headers:{"Content-Type":"multipart/form-data"},accessToken:n};return (await this.axiosInstance.post(e,r,P)).data}};var d=class{constructor(e){this.httpClient=e;}async getToken(e,t){let n=await this.httpClient.post("/api/v1/auth/token",{client_id:e,client_secret:t});if(!n.success||!n.data)throw new Error(n.error?.message||"Falha ao obter token");return n.data}};var p=class{constructor(e){this.httpClient=e;}async list(e){let t=await this.httpClient.get("/api/v1/channels",e);if(!t.success||!t.data)throw new Error(t.error?.message||"Falha ao listar canais");return Array.isArray(t.data)?t.data:[t.data]}};var c=class{constructor(e){this.httpClient=e;}async createWebhook(e,t){let n=await this.httpClient.post("/api/v1/integrations",{url:e.url,expiresInDays:e.expiresInDays},t);if(!n.success||!n.data)throw new Error(n.error?.message||"Falha ao criar webhook");return n.data}};var l=class{constructor(e){this.httpClient=e;}async sendText(e,t){return this.httpClient.post("/api/v1/whatsapp/send-message",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/whatsapp/send-media",{token:e.token,sender:e.sender,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendTemplate(e,t){return this.httpClient.post("/api/v1/whatsapp/send-template",{token:e.token,sender:e.sender,templateName:e.templateName,languageCode:e.languageCode,components:e.components},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/whatsapp/send-buttons",{token:e.token,sender:e.sender,messageText:e.messageText,buttons:e.buttons},t)}async sendList(e,t){return this.httpClient.post("/api/v1/whatsapp/send-list",{token:e.token,sender:e.sender,messageText:e.messageText,buttonText:e.buttonText,sections:e.sections},t)}async replyMessage(e,t){return this.httpClient.post("/api/v1/whatsapp/reply-message",{token:e.token,messageId:e.messageId,messageText:e.messageText},t)}async reactMessage(e,t){return this.httpClient.post("/api/v1/whatsapp/react-message",{token:e.token,messageId:e.messageId,emoji:e.emoji},t)}async createTemplate(e,t){return this.httpClient.post("/api/v1/whatsapp/create-template",{token:e.token,name:e.name,language:e.language,category:e.category,components:e.components},t)}async listTemplates(e,t){return this.httpClient.get(`/api/v1/whatsapp/templates?token=${encodeURIComponent(e)}`,t)}async getTemplate(e,t,n){return this.httpClient.get(`/api/v1/whatsapp/templates/${t}?token=${encodeURIComponent(e)}`,n)}async uploadMedia(e,t){return this.httpClient.upload("/api/v1/whatsapp/upload-media",e.file,t,"file",{token:e.token,filename:e.filename})}async sendOrderDetails(e,t){return this.httpClient.post("/api/v1/whatsapp/send-order-details",{token:e.token,sender:e.sender,orderId:e.orderId,orderItems:e.orderItems,orderTotal:e.orderTotal,currency:e.currency,paymentMethods:e.paymentMethods},t)}async sendOrderStatus(e,t){return this.httpClient.post("/api/v1/whatsapp/send-order-status",{token:e.token,sender:e.sender,orderId:e.orderId,status:e.status,messageText:e.messageText},t)}async sendAudio(e,t){return this.httpClient.post("/api/v1/whatsapp/send-audio",{token:e.token,sender:e.sender,audioUrl:e.audioUrl},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/whatsapp/send-sticker",{token:e.token,sender:e.sender,stickerUrl:e.stickerUrl},t)}async sendVideo(e,t){return this.httpClient.post("/api/v1/whatsapp/send-video",{token:e.token,sender:e.sender,videoUrl:e.videoUrl,caption:e.caption},t)}async sendDocument(e,t){return this.httpClient.post("/api/v1/whatsapp/send-document",{token:e.token,sender:e.sender,documentUrl:e.documentUrl,filename:e.filename,caption:e.caption},t)}async sendContact(e,t){return this.httpClient.post("/api/v1/whatsapp/send-contact",{token:e.token,sender:e.sender,contacts:e.contacts},t)}async sendLocation(e,t){return this.httpClient.post("/api/v1/whatsapp/send-location",{token:e.token,sender:e.sender,latitude:e.latitude,longitude:e.longitude,name:e.name,address:e.address},t)}async sendLocationRequest(e,t){return this.httpClient.post("/api/v1/whatsapp/send-location-request",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendCtaUrl(e,t){return this.httpClient.post("/api/v1/whatsapp/send-cta-url",{token:e.token,sender:e.sender,messageText:e.messageText,buttonText:e.buttonText,url:e.url},t)}async sendMediaCarousel(e,t){return this.httpClient.post("/api/v1/whatsapp/send-media-carousel",{token:e.token,sender:e.sender,cards:e.cards},t)}};var h=class{constructor(e){this.httpClient=e;}async sendMessage(e,t){return this.httpClient.post("/api/v1/telegram/send-message",{token:e.token,chatId:e.chatId,text:e.text,parseMode:e.parseMode,replyToMessageId:e.replyToMessageId,disableNotification:e.disableNotification},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/telegram/send-media",{token:e.token,chatId:e.chatId,fileUrl:e.fileUrl,type:e.type,caption:e.caption,parseMode:e.parseMode,replyToMessageId:e.replyToMessageId},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/telegram/send-buttons",{token:e.token,chatId:e.chatId,text:e.text,buttons:e.buttons,parseMode:e.parseMode},t)}async sendLocation(e,t){return this.httpClient.post("/api/v1/telegram/send-location",{token:e.token,chatId:e.chatId,latitude:e.latitude,longitude:e.longitude,livePeriod:e.livePeriod},t)}async sendContact(e,t){return this.httpClient.post("/api/v1/telegram/send-contact",{token:e.token,chatId:e.chatId,phoneNumber:e.phoneNumber,firstName:e.firstName,lastName:e.lastName,vcard:e.vcard},t)}async sendPoll(e,t){return this.httpClient.post("/api/v1/telegram/send-poll",{token:e.token,chatId:e.chatId,question:e.question,options:e.options,isAnonymous:e.isAnonymous,type:e.type,correctOptionId:e.correctOptionId},t)}async sendVenue(e,t){return this.httpClient.post("/api/v1/telegram/send-venue",{token:e.token,chatId:e.chatId,latitude:e.latitude,longitude:e.longitude,title:e.title,address:e.address,foursquareId:e.foursquareId},t)}async sendDice(e,t){return this.httpClient.post("/api/v1/telegram/send-dice",{token:e.token,chatId:e.chatId,emoji:e.emoji},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/telegram/send-sticker",{token:e.token,chatId:e.chatId,stickerUrl:e.stickerUrl},t)}async sendVoice(e,t){return this.httpClient.post("/api/v1/telegram/send-voice",{token:e.token,chatId:e.chatId,voiceUrl:e.voiceUrl,caption:e.caption,duration:e.duration},t)}async sendVideoNote(e,t){return this.httpClient.post("/api/v1/telegram/send-video-note",{token:e.token,chatId:e.chatId,videoNoteUrl:e.videoNoteUrl,duration:e.duration,length:e.length},t)}async sendMediaGroup(e,t){return this.httpClient.post("/api/v1/telegram/send-media-group",{token:e.token,chatId:e.chatId,media:e.media},t)}async sendReplyKeyboard(e,t){return this.httpClient.post("/api/v1/telegram/send-reply-keyboard",{token:e.token,chatId:e.chatId,text:e.text,keyboard:e.keyboard,resizeKeyboard:e.resizeKeyboard,oneTimeKeyboard:e.oneTimeKeyboard},t)}async editMessage(e,t){return this.httpClient.post("/api/v1/telegram/edit-message",{token:e.token,chatId:e.chatId,messageId:e.messageId,text:e.text,parseMode:e.parseMode},t)}async deleteMessage(e,t){return this.httpClient.post("/api/v1/telegram/delete-message",{token:e.token,chatId:e.chatId,messageId:e.messageId},t)}};var g=class{constructor(e){this.httpClient=e;}async sendText(e,t){return this.httpClient.post("/api/v1/webchat/send-text",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/webchat/send-media",{token:e.token,sender:e.sender,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendCarousel(e,t){return this.httpClient.post("/api/v1/webchat/send-carousel",{token:e.token,sender:e.sender,cards:e.cards},t)}async sendForm(e,t){return this.httpClient.post("/api/v1/webchat/send-form",{token:e.token,sender:e.sender,title:e.title,fields:e.fields,submitButtonText:e.submitButtonText},t)}async sendQuickReplies(e,t){return this.httpClient.post("/api/v1/webchat/send-quick-replies",{token:e.token,sender:e.sender,messageText:e.messageText,quickReplies:e.quickReplies},t)}async sendCard(e,t){return this.httpClient.post("/api/v1/webchat/send-card",{token:e.token,sender:e.sender,title:e.title,description:e.description,imageUrl:e.imageUrl,buttons:e.buttons},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/webchat/send-buttons",{token:e.token,sender:e.sender,messageText:e.messageText,buttons:e.buttons},t)}};var m=class{constructor(e){this.httpClient=e;}async listPosts(e,t){return this.httpClient.post("/api/v1/facebook/list-posts",{token:e.token,pageId:e.pageId,limit:e.limit},t)}async listComments(e,t){return this.httpClient.post("/api/v1/facebook/list-comments",{token:e.token,postId:e.postId,limit:e.limit},t)}async createPost(e,t){return this.httpClient.post("/api/v1/facebook/create-post",{token:e.token,pageId:e.pageId,message:e.message,link:e.link},t)}async replyComment(e,t){return this.httpClient.post("/api/v1/facebook/reply-comment",{token:e.token,commentId:e.commentId,message:e.message},t)}async deleteComment(e,t){return this.httpClient.post("/api/v1/facebook/delete-comment",{token:e.token,commentId:e.commentId},t)}async sendText(e,t){return this.httpClient.post("/api/v1/facebook/send-text",{token:e.token,recipientId:e.recipientId,message:e.message},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/facebook/send-media",{token:e.token,recipientId:e.recipientId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/facebook/send-buttons",{token:e.token,recipientId:e.recipientId,message:e.message,buttons:e.buttons},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/facebook/send-sticker",{token:e.token,recipientId:e.recipientId,stickerId:e.stickerId},t)}async replyMessage(e,t){return this.httpClient.post("/api/v1/facebook/reply-message",{token:e.token,messageId:e.messageId,message:e.message},t)}async replyMedia(e,t){return this.httpClient.post("/api/v1/facebook/reply-media",{token:e.token,messageId:e.messageId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sharePost(e,t){return this.httpClient.post("/api/v1/facebook/share-post",{token:e.token,mediaId:e.mediaId,recipientId:e.recipientId},t)}};var u=class{constructor(e){this.httpClient=e;}async sendPrivateReply(e,t){return this.httpClient.post("/api/v1/instagram/private-reply",{token:e.token,commentId:e.commentId,message:e.message},t)}async sendText(e,t){return this.httpClient.post("/api/v1/instagram/messages/text",{token:e.token,recipientId:e.recipientId,message:e.message},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/instagram/messages/media",{token:e.token,recipientId:e.recipientId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendImages(e,t){return this.httpClient.post("/api/v1/instagram/messages/images",{token:e.token,recipientId:e.recipientId,images:e.images},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/instagram/messages/sticker",{token:e.token,recipientId:e.recipientId,stickerType:e.stickerType},t)}async reactMessage(e,t){return this.httpClient.post("/api/v1/instagram/messages/reaction",{token:e.token,messageId:e.messageId,reactionType:e.reactionType},t)}async removeReaction(e,t,n){return this.httpClient.delete(`/api/v1/instagram/messages/reaction?token=${encodeURIComponent(e)}&messageId=${encodeURIComponent(t)}`,n)}async sendQuickReplies(e,t){return this.httpClient.post("/api/v1/instagram/messages/quick-replies",{token:e.token,recipientId:e.recipientId,message:e.message,quickReplies:e.quickReplies},t)}async sendGenericTemplate(e,t){return this.httpClient.post("/api/v1/instagram/messages/generic-template",{token:e.token,recipientId:e.recipientId,elements:e.elements},t)}async sendButtonTemplate(e,t){return this.httpClient.post("/api/v1/instagram/messages/button-template",{token:e.token,recipientId:e.recipientId,text:e.text,buttons:e.buttons},t)}async sendSenderAction(e,t){return this.httpClient.post("/api/v1/instagram/messages/sender-action",{token:e.token,recipientId:e.recipientId,action:e.action},t)}async getUserProfile(e,t){return this.httpClient.post("/api/v1/instagram/user-profile",{token:e.token,userId:e.userId},t)}async listPosts(e,t){return this.httpClient.post("/api/v1/instagram/posts",{token:e.token,userId:e.userId,limit:e.limit},t)}};var y=class{constructor(e){this.httpClient=new a(e),this.auth=new d(this.httpClient),this.channels=new p(this.httpClient),this.integrations=new c(this.httpClient),this.whatsapp=new l(this.httpClient),this.telegram=new h(this.httpClient),this.webchat=new g(this.httpClient),this.facebook=new m(this.httpClient),this.instagram=new u(this.httpClient);}},O=y;
7
- exports.OficialAPISDK=y;exports.default=O;//# sourceMappingURL=index.js.map
6
+ var f="https://api.oficialapi.com.br",r=class{constructor(e){this.config={clientId:e.clientId,clientSecret:e.clientSecret,timeout:e.timeout||3e4,maxRetries:e.maxRetries||3,retryDelay:e.retryDelay||1e3,headers:e.headers||{}},this.axiosInstance=I__default.default.create({baseURL:f,timeout:this.config.timeout,headers:{"Content-Type":"application/json",...this.config.headers}}),this.setupInterceptors();}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{if(e.url?.includes("/auth/token"))return e;let t=e;return t.accessToken&&e.headers&&(e.headers.Authorization=`Bearer ${t.accessToken}`),e},e=>Promise.reject(e)),this.axiosInstance.interceptors.response.use(e=>e,async e=>{let t=e.config;if(!t)return Promise.reject(this.formatError(e));if((!e.response||e.response.status>=500&&e.response.status<600)&&(!t._retryCount||t._retryCount<this.config.maxRetries)){t._retryCount=(t._retryCount||0)+1;let i=this.config.retryDelay*t._retryCount;return await new Promise(s=>setTimeout(s,i)),this.axiosInstance(t)}return Promise.reject(this.formatError(e))});}formatError(e){if(e.response){let t=e.response.data,n=t?.error?.message||t?.message||e.message,i=t?.error?.details||[],s=new Error(n);return s.status=e.response.status,s.data=e.response.data,s.details=i,s}return e.request?new Error("Erro de conex\xE3o com a API. Verifique sua conex\xE3o com a internet."):e}async get(e,t,n){let i={...n,accessToken:t};return (await this.axiosInstance.get(e,i)).data}async post(e,t,n,i){let s={...i,accessToken:n};return (await this.axiosInstance.post(e,t,s)).data}async put(e,t,n,i){let s={...i,accessToken:n};return (await this.axiosInstance.put(e,t,s)).data}async delete(e,t,n,i){let s={...i,accessToken:t,data:n};return (await this.axiosInstance.delete(e,s)).data}async upload(e,t,n,i="file",s){let a=new FormData;if(t instanceof Buffer){let k=new Blob([t]);a.append(i,k);}else a.append(i,t);s&&Object.entries(s).forEach(([k,C])=>{a.append(k,typeof C=="string"?C:JSON.stringify(C));});let y={headers:{"Content-Type":"multipart/form-data"},accessToken:n};return (await this.axiosInstance.post(e,a,y)).data}};var d=class{constructor(e){this.httpClient=e;}async getToken(e,t){let n=await this.httpClient.post("/api/v1/auth/token",{client_id:e,client_secret:t});if(!n.success||!n.data)throw new Error(n.error?.message||"Falha ao obter token");return n.data}};var p=class{constructor(e){this.httpClient=e;}async list(e){let t=await this.httpClient.get("/api/v1/channels",e);if(!t.success||!t.data)throw new Error(t.error?.message||"Falha ao listar canais");return Array.isArray(t.data)?t.data:[t.data]}};var l=class{constructor(e){this.httpClient=e;}async createWebhook(e,t){let n=await this.httpClient.post("/api/v1/integrations",{url:e.url,expiresInDays:e.expiresInDays},t);if(!n.success||!n.data)throw new Error(n.error?.message||"Falha ao criar webhook");return n.data}};var c=class{constructor(e){this.httpClient=e;}async sendText(e,t){return this.httpClient.post("/api/v1/whatsapp/send-message",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/whatsapp/send-media",{token:e.token,sender:e.sender,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendTemplate(e,t){return this.httpClient.post("/api/v1/whatsapp/send-template",{token:e.token,sender:e.sender,templateName:e.templateName,languageCode:e.languageCode,components:e.components},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/whatsapp/send-buttons",{token:e.token,sender:e.sender,messageText:e.messageText,buttons:e.buttons},t)}async sendList(e,t){return this.httpClient.post("/api/v1/whatsapp/send-list",{token:e.token,sender:e.sender,messageText:e.messageText,buttonText:e.buttonText,sections:e.sections},t)}async replyMessage(e,t){return this.httpClient.post("/api/v1/whatsapp/reply-message",{token:e.token,messageId:e.messageId,messageText:e.messageText},t)}async reactMessage(e,t){return this.httpClient.post("/api/v1/whatsapp/react-message",{token:e.token,messageId:e.messageId,emoji:e.emoji},t)}async createTemplate(e,t){return this.httpClient.post("/api/v1/whatsapp/create-template",{token:e.token,name:e.name,language:e.language,category:e.category,components:e.components},t)}async listTemplates(e,t){return this.httpClient.get(`/api/v1/whatsapp/templates?token=${encodeURIComponent(e)}`,t)}async getTemplate(e,t,n){return this.httpClient.get(`/api/v1/whatsapp/templates/${t}?token=${encodeURIComponent(e)}`,n)}async uploadMedia(e,t){return this.httpClient.upload("/api/v1/whatsapp/upload-media",e.file,t,"file",{token:e.token,filename:e.filename})}async sendOrderDetails(e,t){return this.httpClient.post("/api/v1/whatsapp/send-order-details",{token:e.token,sender:e.sender,orderId:e.orderId,orderItems:e.orderItems,orderTotal:e.orderTotal,currency:e.currency,paymentMethods:e.paymentMethods},t)}async sendOrderStatus(e,t){return this.httpClient.post("/api/v1/whatsapp/send-order-status",{token:e.token,sender:e.sender,orderId:e.orderId,status:e.status,messageText:e.messageText},t)}async sendAudio(e,t){return this.httpClient.post("/api/v1/whatsapp/send-audio",{token:e.token,sender:e.sender,audioUrl:e.audioUrl},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/whatsapp/send-sticker",{token:e.token,sender:e.sender,stickerUrl:e.stickerUrl},t)}async sendVideo(e,t){return this.httpClient.post("/api/v1/whatsapp/send-video",{token:e.token,sender:e.sender,videoUrl:e.videoUrl,caption:e.caption},t)}async sendDocument(e,t){return this.httpClient.post("/api/v1/whatsapp/send-document",{token:e.token,sender:e.sender,documentUrl:e.documentUrl,filename:e.filename,caption:e.caption},t)}async sendContact(e,t){return this.httpClient.post("/api/v1/whatsapp/send-contact",{token:e.token,sender:e.sender,contacts:e.contacts},t)}async sendLocation(e,t){return this.httpClient.post("/api/v1/whatsapp/send-location",{token:e.token,sender:e.sender,latitude:e.latitude,longitude:e.longitude,name:e.name,address:e.address},t)}async sendLocationRequest(e,t){return this.httpClient.post("/api/v1/whatsapp/send-location-request",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendCtaUrl(e,t){return this.httpClient.post("/api/v1/whatsapp/send-cta-url",{token:e.token,sender:e.sender,messageText:e.messageText,buttonText:e.buttonText,url:e.url},t)}async sendMediaCarousel(e,t){return this.httpClient.post("/api/v1/whatsapp/send-media-carousel",{token:e.token,sender:e.sender,cards:e.cards},t)}async downloadMedia(e,t){return this.httpClient.post("/api/v1/whatsapp/download-media",{token:e.token,url:e.url},t)}};var h=class{constructor(e){this.httpClient=e;}async sendMessage(e,t){return this.httpClient.post("/api/v1/telegram/send-message",{token:e.token,chatId:e.chatId,text:e.text,parseMode:e.parseMode,replyToMessageId:e.replyToMessageId,disableNotification:e.disableNotification},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/telegram/send-media",{token:e.token,chatId:e.chatId,fileUrl:e.fileUrl,type:e.type,caption:e.caption,parseMode:e.parseMode,replyToMessageId:e.replyToMessageId},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/telegram/send-buttons",{token:e.token,chatId:e.chatId,text:e.text,buttons:e.buttons,parseMode:e.parseMode},t)}async sendLocation(e,t){return this.httpClient.post("/api/v1/telegram/send-location",{token:e.token,chatId:e.chatId,latitude:e.latitude,longitude:e.longitude,livePeriod:e.livePeriod},t)}async sendContact(e,t){return this.httpClient.post("/api/v1/telegram/send-contact",{token:e.token,chatId:e.chatId,phoneNumber:e.phoneNumber,firstName:e.firstName,lastName:e.lastName,vcard:e.vcard},t)}async sendPoll(e,t){return this.httpClient.post("/api/v1/telegram/send-poll",{token:e.token,chatId:e.chatId,question:e.question,options:e.options,isAnonymous:e.isAnonymous,type:e.type,correctOptionId:e.correctOptionId},t)}async sendVenue(e,t){return this.httpClient.post("/api/v1/telegram/send-venue",{token:e.token,chatId:e.chatId,latitude:e.latitude,longitude:e.longitude,title:e.title,address:e.address,foursquareId:e.foursquareId},t)}async sendDice(e,t){return this.httpClient.post("/api/v1/telegram/send-dice",{token:e.token,chatId:e.chatId,emoji:e.emoji},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/telegram/send-sticker",{token:e.token,chatId:e.chatId,stickerUrl:e.stickerUrl},t)}async sendVoice(e,t){return this.httpClient.post("/api/v1/telegram/send-voice",{token:e.token,chatId:e.chatId,voiceUrl:e.voiceUrl,caption:e.caption,duration:e.duration},t)}async sendVideoNote(e,t){return this.httpClient.post("/api/v1/telegram/send-video-note",{token:e.token,chatId:e.chatId,videoNoteUrl:e.videoNoteUrl,duration:e.duration,length:e.length},t)}async sendMediaGroup(e,t){return this.httpClient.post("/api/v1/telegram/send-media-group",{token:e.token,chatId:e.chatId,media:e.media},t)}async sendReplyKeyboard(e,t){return this.httpClient.post("/api/v1/telegram/send-reply-keyboard",{token:e.token,chatId:e.chatId,text:e.text,keyboard:e.keyboard,resizeKeyboard:e.resizeKeyboard,oneTimeKeyboard:e.oneTimeKeyboard},t)}async editMessage(e,t){return this.httpClient.post("/api/v1/telegram/edit-message",{token:e.token,chatId:e.chatId,messageId:e.messageId,text:e.text,parseMode:e.parseMode},t)}async deleteMessage(e,t){return this.httpClient.post("/api/v1/telegram/delete-message",{token:e.token,chatId:e.chatId,messageId:e.messageId},t)}async downloadMedia(e,t){return this.httpClient.post("/api/v1/telegram/download-media",{token:e.token,fileId:e.fileId},t)}};var g=class{constructor(e){this.httpClient=e;}async sendText(e,t){return this.httpClient.post("/api/v1/webchat/send-text",{token:e.token,sender:e.sender,messageText:e.messageText},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/webchat/send-media",{token:e.token,sender:e.sender,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendCarousel(e,t){return this.httpClient.post("/api/v1/webchat/send-carousel",{token:e.token,sender:e.sender,cards:e.cards},t)}async sendForm(e,t){return this.httpClient.post("/api/v1/webchat/send-form",{token:e.token,sender:e.sender,title:e.title,fields:e.fields,submitButtonText:e.submitButtonText},t)}async sendQuickReplies(e,t){return this.httpClient.post("/api/v1/webchat/send-quick-replies",{token:e.token,sender:e.sender,messageText:e.messageText,quickReplies:e.quickReplies},t)}async sendCard(e,t){return this.httpClient.post("/api/v1/webchat/send-card",{token:e.token,sender:e.sender,title:e.title,description:e.description,imageUrl:e.imageUrl,buttons:e.buttons},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/webchat/send-buttons",{token:e.token,sender:e.sender,messageText:e.messageText,buttons:e.buttons},t)}};var m=class{constructor(e){this.httpClient=e;}async listPosts(e,t){return this.httpClient.post("/api/v1/facebook/list-posts",{token:e.token,pageId:e.pageId,limit:e.limit},t)}async listComments(e,t){return this.httpClient.post("/api/v1/facebook/list-comments",{token:e.token,postId:e.postId,limit:e.limit},t)}async createPost(e,t){return this.httpClient.post("/api/v1/facebook/create-post",{token:e.token,pageId:e.pageId,message:e.message,link:e.link},t)}async replyComment(e,t){return this.httpClient.post("/api/v1/facebook/reply-comment",{token:e.token,commentId:e.commentId,message:e.message},t)}async deleteComment(e,t){return this.httpClient.post("/api/v1/facebook/delete-comment",{token:e.token,commentId:e.commentId},t)}async sendText(e,t){return this.httpClient.post("/api/v1/facebook/send-text",{token:e.token,recipientId:e.recipientId,message:e.message},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/facebook/send-media",{token:e.token,recipientId:e.recipientId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendButtons(e,t){return this.httpClient.post("/api/v1/facebook/send-buttons",{token:e.token,recipientId:e.recipientId,message:e.message,buttons:e.buttons},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/facebook/send-sticker",{token:e.token,recipientId:e.recipientId,stickerId:e.stickerId},t)}async replyMessage(e,t){return this.httpClient.post("/api/v1/facebook/reply-message",{token:e.token,messageId:e.messageId,message:e.message},t)}async replyMedia(e,t){return this.httpClient.post("/api/v1/facebook/reply-media",{token:e.token,messageId:e.messageId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sharePost(e,t){return this.httpClient.post("/api/v1/facebook/share-post",{token:e.token,mediaId:e.mediaId,recipientId:e.recipientId},t)}async getUserProfile(e,t){return this.httpClient.post("/api/v1/facebook/user-profile",{token:e.token,userId:e.userId},t)}async getPageProfile(e,t){return this.httpClient.post("/api/v1/facebook/page-profile",{token:e.token,pageId:e.pageId},t)}async downloadMedia(e,t){return this.httpClient.post("/api/v1/facebook/download-media",{token:e.token,url:e.url},t)}};var u=class{constructor(e){this.httpClient=e;}async sendPrivateReply(e,t){return this.httpClient.post("/api/v1/instagram/private-reply",{token:e.token,commentId:e.commentId,message:e.message},t)}async sendText(e,t){return this.httpClient.post("/api/v1/instagram/messages/text",{token:e.token,recipientId:e.recipientId,message:e.message},t)}async sendMedia(e,t){return this.httpClient.post("/api/v1/instagram/messages/media",{token:e.token,recipientId:e.recipientId,fileUrl:e.fileUrl,type:e.type,caption:e.caption},t)}async sendImages(e,t){return this.httpClient.post("/api/v1/instagram/messages/images",{token:e.token,recipientId:e.recipientId,images:e.images},t)}async sendSticker(e,t){return this.httpClient.post("/api/v1/instagram/messages/sticker",{token:e.token,recipientId:e.recipientId,stickerType:e.stickerType},t)}async reactMessage(e,t){return this.httpClient.post("/api/v1/instagram/messages/reaction",{token:e.token,messageId:e.messageId,reactionType:e.reactionType},t)}async removeReaction(e,t){return this.httpClient.delete("/api/v1/instagram/messages/reaction",t,{token:e.token,recipientId:e.recipientId,messageId:e.messageId})}async sendQuickReplies(e,t){return this.httpClient.post("/api/v1/instagram/messages/quick-replies",{token:e.token,recipientId:e.recipientId,message:e.message,quickReplies:e.quickReplies},t)}async sendGenericTemplate(e,t){return this.httpClient.post("/api/v1/instagram/messages/generic-template",{token:e.token,recipientId:e.recipientId,elements:e.elements},t)}async sendButtonTemplate(e,t){return this.httpClient.post("/api/v1/instagram/messages/button-template",{token:e.token,recipientId:e.recipientId,text:e.text,buttons:e.buttons},t)}async sendSenderAction(e,t){return this.httpClient.post("/api/v1/instagram/messages/sender-action",{token:e.token,recipientId:e.recipientId,action:e.action},t)}async getUserProfile(e,t){return this.httpClient.post("/api/v1/instagram/user-profile",{token:e.token,userId:e.userId},t)}async listPosts(e,t){return this.httpClient.post("/api/v1/instagram/posts",{token:e.token,userId:e.userId,limit:e.limit},t)}async getBusinessProfile(e,t){return this.httpClient.post("/api/v1/instagram/business-profile",{token:e.token},t)}async downloadMedia(e,t){return this.httpClient.post("/api/v1/instagram/download-media",{token:e.token,url:e.url},t)}};var P=class{constructor(e){this.httpClient=new r(e),this.auth=new d(this.httpClient),this.channels=new p(this.httpClient),this.integrations=new l(this.httpClient),this.whatsapp=new c(this.httpClient),this.telegram=new h(this.httpClient),this.webchat=new g(this.httpClient),this.facebook=new m(this.httpClient),this.instagram=new u(this.httpClient);}},j=P;
7
+ exports.OficialAPISDK=P;exports.default=j;//# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map