@oficialapi/sdk 1.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/LICENSE +21 -0
- package/README.md +563 -0
- package/dist/index.d.mts +1079 -0
- package/dist/index.d.ts +1079 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1079 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tipos principais do SDK OficialAPI
|
|
5
|
+
*/
|
|
6
|
+
interface SDKConfig {
|
|
7
|
+
/** Client ID para autenticação */
|
|
8
|
+
clientId: string;
|
|
9
|
+
/** Client Secret para autenticação */
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
/** Timeout das requisições em ms (padrão: 30000) */
|
|
12
|
+
timeout?: number;
|
|
13
|
+
/** Número máximo de tentativas em caso de erro (padrão: 3) */
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
/** Delay entre tentativas em ms (padrão: 1000) */
|
|
16
|
+
retryDelay?: number;
|
|
17
|
+
/** Headers customizados */
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
interface TokenResponse {
|
|
21
|
+
access_token: string;
|
|
22
|
+
token_type: string;
|
|
23
|
+
expires_in: number;
|
|
24
|
+
}
|
|
25
|
+
interface ApiResponse<T = any> {
|
|
26
|
+
success: boolean;
|
|
27
|
+
data?: T;
|
|
28
|
+
message?: string;
|
|
29
|
+
error?: {
|
|
30
|
+
code: number;
|
|
31
|
+
message: string;
|
|
32
|
+
details?: any[];
|
|
33
|
+
};
|
|
34
|
+
timestamp?: string;
|
|
35
|
+
requestId?: string;
|
|
36
|
+
}
|
|
37
|
+
interface Channel {
|
|
38
|
+
id: number;
|
|
39
|
+
token: string;
|
|
40
|
+
nome: string;
|
|
41
|
+
channel: 'whatsapp' | 'facebook' | 'instagram' | 'webchat' | 'email' | 'telegram';
|
|
42
|
+
status: boolean;
|
|
43
|
+
numero?: string | null;
|
|
44
|
+
instagram?: {
|
|
45
|
+
instagramUsername?: string;
|
|
46
|
+
};
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
interface SendWhatsAppTextParams {
|
|
51
|
+
token: string;
|
|
52
|
+
sender: string;
|
|
53
|
+
messageText: string;
|
|
54
|
+
}
|
|
55
|
+
interface SendWhatsAppMediaParams {
|
|
56
|
+
token: string;
|
|
57
|
+
sender: string;
|
|
58
|
+
fileUrl: string;
|
|
59
|
+
type: 'image' | 'video' | 'audio' | 'document';
|
|
60
|
+
caption?: string;
|
|
61
|
+
}
|
|
62
|
+
interface SendWhatsAppTemplateParams {
|
|
63
|
+
token: string;
|
|
64
|
+
sender: string;
|
|
65
|
+
templateName: string;
|
|
66
|
+
languageCode: string;
|
|
67
|
+
components?: Array<{
|
|
68
|
+
type: 'header' | 'body' | 'button';
|
|
69
|
+
parameters?: Array<{
|
|
70
|
+
type: 'text' | 'image' | 'document' | 'video';
|
|
71
|
+
text?: string;
|
|
72
|
+
image?: {
|
|
73
|
+
link?: string;
|
|
74
|
+
id?: string;
|
|
75
|
+
};
|
|
76
|
+
document?: {
|
|
77
|
+
link?: string;
|
|
78
|
+
id?: string;
|
|
79
|
+
};
|
|
80
|
+
video?: {
|
|
81
|
+
link?: string;
|
|
82
|
+
id?: string;
|
|
83
|
+
};
|
|
84
|
+
}>;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
interface SendWhatsAppButtonsParams {
|
|
88
|
+
token: string;
|
|
89
|
+
sender: string;
|
|
90
|
+
messageText: string;
|
|
91
|
+
buttons: Array<{
|
|
92
|
+
type: 'reply';
|
|
93
|
+
reply: {
|
|
94
|
+
id: string;
|
|
95
|
+
title: string;
|
|
96
|
+
};
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
interface SendWhatsAppListParams {
|
|
100
|
+
token: string;
|
|
101
|
+
sender: string;
|
|
102
|
+
messageText: string;
|
|
103
|
+
buttonText: string;
|
|
104
|
+
sections: Array<{
|
|
105
|
+
title: string;
|
|
106
|
+
rows: Array<{
|
|
107
|
+
id: string;
|
|
108
|
+
title: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
}>;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
interface ReplyWhatsAppParams {
|
|
114
|
+
token: string;
|
|
115
|
+
messageId: string;
|
|
116
|
+
messageText: string;
|
|
117
|
+
}
|
|
118
|
+
interface ReactWhatsAppParams {
|
|
119
|
+
token: string;
|
|
120
|
+
messageId: string;
|
|
121
|
+
emoji: string;
|
|
122
|
+
}
|
|
123
|
+
interface CreateTemplateParams {
|
|
124
|
+
token: string;
|
|
125
|
+
name: string;
|
|
126
|
+
language: string;
|
|
127
|
+
category: 'MARKETING' | 'UTILITY' | 'AUTHENTICATION';
|
|
128
|
+
components: Array<{
|
|
129
|
+
type: 'HEADER' | 'BODY' | 'FOOTER' | 'BUTTONS';
|
|
130
|
+
format?: 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT';
|
|
131
|
+
text?: string;
|
|
132
|
+
example?: {
|
|
133
|
+
header_text?: string[];
|
|
134
|
+
body_text?: string[][];
|
|
135
|
+
};
|
|
136
|
+
buttons?: Array<{
|
|
137
|
+
type: 'QUICK_REPLY' | 'URL' | 'PHONE_NUMBER';
|
|
138
|
+
text?: string;
|
|
139
|
+
url?: string;
|
|
140
|
+
phone_number?: string;
|
|
141
|
+
}>;
|
|
142
|
+
}>;
|
|
143
|
+
}
|
|
144
|
+
interface UploadMediaParams {
|
|
145
|
+
token: string;
|
|
146
|
+
file: File | Blob | Buffer;
|
|
147
|
+
filename?: string;
|
|
148
|
+
}
|
|
149
|
+
interface SendOrderDetailsParams {
|
|
150
|
+
token: string;
|
|
151
|
+
sender: string;
|
|
152
|
+
orderId: string;
|
|
153
|
+
orderItems: Array<{
|
|
154
|
+
item_code: string;
|
|
155
|
+
description: string;
|
|
156
|
+
quantity: number;
|
|
157
|
+
price: number;
|
|
158
|
+
}>;
|
|
159
|
+
orderTotal: number;
|
|
160
|
+
currency: string;
|
|
161
|
+
paymentMethods: Array<{
|
|
162
|
+
type: 'PIX' | 'CREDIT_CARD' | 'DEBIT_CARD' | 'BANK_TRANSFER';
|
|
163
|
+
name: string;
|
|
164
|
+
}>;
|
|
165
|
+
}
|
|
166
|
+
interface SendOrderStatusParams {
|
|
167
|
+
token: string;
|
|
168
|
+
sender: string;
|
|
169
|
+
orderId: string;
|
|
170
|
+
status: 'PENDING' | 'CONFIRMED' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED';
|
|
171
|
+
messageText?: string;
|
|
172
|
+
}
|
|
173
|
+
interface SendWhatsAppAudioParams {
|
|
174
|
+
token: string;
|
|
175
|
+
sender: string;
|
|
176
|
+
audioUrl: string;
|
|
177
|
+
}
|
|
178
|
+
interface SendWhatsAppStickerParams {
|
|
179
|
+
token: string;
|
|
180
|
+
sender: string;
|
|
181
|
+
stickerUrl: string;
|
|
182
|
+
}
|
|
183
|
+
interface SendWhatsAppVideoParams {
|
|
184
|
+
token: string;
|
|
185
|
+
sender: string;
|
|
186
|
+
videoUrl: string;
|
|
187
|
+
caption?: string;
|
|
188
|
+
}
|
|
189
|
+
interface SendWhatsAppDocumentParams {
|
|
190
|
+
token: string;
|
|
191
|
+
sender: string;
|
|
192
|
+
documentUrl: string;
|
|
193
|
+
filename?: string;
|
|
194
|
+
caption?: string;
|
|
195
|
+
}
|
|
196
|
+
interface SendWhatsAppContactParams {
|
|
197
|
+
token: string;
|
|
198
|
+
sender: string;
|
|
199
|
+
contacts: Array<{
|
|
200
|
+
name: {
|
|
201
|
+
formatted_name: string;
|
|
202
|
+
first_name?: string;
|
|
203
|
+
last_name?: string;
|
|
204
|
+
middle_name?: string;
|
|
205
|
+
prefix?: string;
|
|
206
|
+
suffix?: string;
|
|
207
|
+
};
|
|
208
|
+
phones?: Array<{
|
|
209
|
+
phone: string;
|
|
210
|
+
type?: string;
|
|
211
|
+
wa_id?: string;
|
|
212
|
+
}>;
|
|
213
|
+
emails?: Array<{
|
|
214
|
+
email: string;
|
|
215
|
+
type?: string;
|
|
216
|
+
}>;
|
|
217
|
+
urls?: Array<{
|
|
218
|
+
url: string;
|
|
219
|
+
type?: string;
|
|
220
|
+
}>;
|
|
221
|
+
addresses?: Array<{
|
|
222
|
+
street?: string;
|
|
223
|
+
city?: string;
|
|
224
|
+
state?: string;
|
|
225
|
+
zip?: string;
|
|
226
|
+
country?: string;
|
|
227
|
+
country_code?: string;
|
|
228
|
+
type?: string;
|
|
229
|
+
}>;
|
|
230
|
+
org?: {
|
|
231
|
+
company?: string;
|
|
232
|
+
department?: string;
|
|
233
|
+
title?: string;
|
|
234
|
+
};
|
|
235
|
+
birthday?: string;
|
|
236
|
+
}>;
|
|
237
|
+
}
|
|
238
|
+
interface SendWhatsAppLocationParams {
|
|
239
|
+
token: string;
|
|
240
|
+
sender: string;
|
|
241
|
+
latitude: number;
|
|
242
|
+
longitude: number;
|
|
243
|
+
name?: string;
|
|
244
|
+
address?: string;
|
|
245
|
+
}
|
|
246
|
+
interface SendWhatsAppLocationRequestParams {
|
|
247
|
+
token: string;
|
|
248
|
+
sender: string;
|
|
249
|
+
messageText: string;
|
|
250
|
+
}
|
|
251
|
+
interface SendWhatsAppCtaUrlParams {
|
|
252
|
+
token: string;
|
|
253
|
+
sender: string;
|
|
254
|
+
messageText: string;
|
|
255
|
+
buttonText: string;
|
|
256
|
+
url: string;
|
|
257
|
+
}
|
|
258
|
+
interface SendWhatsAppMediaCarouselParams {
|
|
259
|
+
token: string;
|
|
260
|
+
sender: string;
|
|
261
|
+
cards: Array<{
|
|
262
|
+
card_index: number;
|
|
263
|
+
media: {
|
|
264
|
+
link?: string;
|
|
265
|
+
id?: string;
|
|
266
|
+
};
|
|
267
|
+
title: string;
|
|
268
|
+
description: string;
|
|
269
|
+
actions: Array<{
|
|
270
|
+
type: 'link';
|
|
271
|
+
value: string;
|
|
272
|
+
}>;
|
|
273
|
+
}>;
|
|
274
|
+
}
|
|
275
|
+
interface SendTelegramTextParams {
|
|
276
|
+
token: string;
|
|
277
|
+
chatId: string | number;
|
|
278
|
+
text: string;
|
|
279
|
+
parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2';
|
|
280
|
+
replyToMessageId?: number;
|
|
281
|
+
disableNotification?: boolean;
|
|
282
|
+
}
|
|
283
|
+
interface SendTelegramMediaParams {
|
|
284
|
+
token: string;
|
|
285
|
+
chatId: string | number;
|
|
286
|
+
fileUrl: string;
|
|
287
|
+
type: 'photo' | 'video' | 'audio' | 'document' | 'voice';
|
|
288
|
+
caption?: string;
|
|
289
|
+
parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2';
|
|
290
|
+
replyToMessageId?: number;
|
|
291
|
+
}
|
|
292
|
+
interface SendTelegramButtonsParams {
|
|
293
|
+
token: string;
|
|
294
|
+
chatId: string | number;
|
|
295
|
+
text: string;
|
|
296
|
+
buttons: Array<Array<{
|
|
297
|
+
text: string;
|
|
298
|
+
url?: string;
|
|
299
|
+
callback_data?: string;
|
|
300
|
+
web_app?: {
|
|
301
|
+
url: string;
|
|
302
|
+
};
|
|
303
|
+
}>>;
|
|
304
|
+
parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2';
|
|
305
|
+
}
|
|
306
|
+
interface SendTelegramLocationParams {
|
|
307
|
+
token: string;
|
|
308
|
+
chatId: string | number;
|
|
309
|
+
latitude: number;
|
|
310
|
+
longitude: number;
|
|
311
|
+
livePeriod?: number;
|
|
312
|
+
}
|
|
313
|
+
interface SendTelegramContactParams {
|
|
314
|
+
token: string;
|
|
315
|
+
chatId: string | number;
|
|
316
|
+
phoneNumber: string;
|
|
317
|
+
firstName: string;
|
|
318
|
+
lastName?: string;
|
|
319
|
+
vcard?: string;
|
|
320
|
+
}
|
|
321
|
+
interface SendTelegramPollParams {
|
|
322
|
+
token: string;
|
|
323
|
+
chatId: string | number;
|
|
324
|
+
question: string;
|
|
325
|
+
options: string[];
|
|
326
|
+
isAnonymous?: boolean;
|
|
327
|
+
type?: 'quiz' | 'regular';
|
|
328
|
+
correctOptionId?: number;
|
|
329
|
+
}
|
|
330
|
+
interface SendTelegramVenueParams {
|
|
331
|
+
token: string;
|
|
332
|
+
chatId: string | number;
|
|
333
|
+
latitude: number;
|
|
334
|
+
longitude: number;
|
|
335
|
+
title: string;
|
|
336
|
+
address: string;
|
|
337
|
+
foursquareId?: string;
|
|
338
|
+
}
|
|
339
|
+
interface SendTelegramDiceParams {
|
|
340
|
+
token: string;
|
|
341
|
+
chatId: string | number;
|
|
342
|
+
emoji?: '🎲' | '🎯' | '🏀' | '⚽' | '🎳' | '🎰';
|
|
343
|
+
}
|
|
344
|
+
interface SendTelegramStickerParams {
|
|
345
|
+
token: string;
|
|
346
|
+
chatId: string | number;
|
|
347
|
+
stickerUrl: string;
|
|
348
|
+
}
|
|
349
|
+
interface SendTelegramVoiceParams {
|
|
350
|
+
token: string;
|
|
351
|
+
chatId: string | number;
|
|
352
|
+
voiceUrl: string;
|
|
353
|
+
caption?: string;
|
|
354
|
+
duration?: number;
|
|
355
|
+
}
|
|
356
|
+
interface SendTelegramVideoNoteParams {
|
|
357
|
+
token: string;
|
|
358
|
+
chatId: string | number;
|
|
359
|
+
videoNoteUrl: string;
|
|
360
|
+
duration?: number;
|
|
361
|
+
length?: number;
|
|
362
|
+
}
|
|
363
|
+
interface SendTelegramMediaGroupParams {
|
|
364
|
+
token: string;
|
|
365
|
+
chatId: string | number;
|
|
366
|
+
media: Array<{
|
|
367
|
+
type: 'photo' | 'video';
|
|
368
|
+
media: string;
|
|
369
|
+
caption?: string;
|
|
370
|
+
}>;
|
|
371
|
+
}
|
|
372
|
+
interface SendTelegramReplyKeyboardParams {
|
|
373
|
+
token: string;
|
|
374
|
+
chatId: string | number;
|
|
375
|
+
text: string;
|
|
376
|
+
keyboard: Array<Array<{
|
|
377
|
+
text: string;
|
|
378
|
+
}>>;
|
|
379
|
+
resizeKeyboard?: boolean;
|
|
380
|
+
oneTimeKeyboard?: boolean;
|
|
381
|
+
}
|
|
382
|
+
interface EditTelegramMessageParams {
|
|
383
|
+
token: string;
|
|
384
|
+
chatId: string | number;
|
|
385
|
+
messageId: number;
|
|
386
|
+
text: string;
|
|
387
|
+
parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2';
|
|
388
|
+
}
|
|
389
|
+
interface DeleteTelegramMessageParams {
|
|
390
|
+
token: string;
|
|
391
|
+
chatId: string | number;
|
|
392
|
+
messageId: number;
|
|
393
|
+
}
|
|
394
|
+
interface SendWebChatTextParams {
|
|
395
|
+
token: string;
|
|
396
|
+
sender: string;
|
|
397
|
+
messageText: string;
|
|
398
|
+
}
|
|
399
|
+
interface SendWebChatMediaParams {
|
|
400
|
+
token: string;
|
|
401
|
+
sender: string;
|
|
402
|
+
fileUrl: string;
|
|
403
|
+
type: 'image' | 'video' | 'audio' | 'file';
|
|
404
|
+
caption?: string;
|
|
405
|
+
}
|
|
406
|
+
interface SendWebChatCarouselParams {
|
|
407
|
+
token: string;
|
|
408
|
+
sender: string;
|
|
409
|
+
cards: Array<{
|
|
410
|
+
title: string;
|
|
411
|
+
description?: string;
|
|
412
|
+
imageUrl?: string;
|
|
413
|
+
buttons?: Array<{
|
|
414
|
+
type: 'url' | 'postback';
|
|
415
|
+
title: string;
|
|
416
|
+
value: string;
|
|
417
|
+
}>;
|
|
418
|
+
}>;
|
|
419
|
+
}
|
|
420
|
+
interface SendWebChatFormParams {
|
|
421
|
+
token: string;
|
|
422
|
+
sender: string;
|
|
423
|
+
title: string;
|
|
424
|
+
fields: Array<{
|
|
425
|
+
type: 'text' | 'email' | 'number' | 'tel' | 'textarea';
|
|
426
|
+
name: string;
|
|
427
|
+
label: string;
|
|
428
|
+
required?: boolean;
|
|
429
|
+
placeholder?: string;
|
|
430
|
+
}>;
|
|
431
|
+
submitButtonText?: string;
|
|
432
|
+
}
|
|
433
|
+
interface SendWebChatQuickRepliesParams {
|
|
434
|
+
token: string;
|
|
435
|
+
sender: string;
|
|
436
|
+
messageText: string;
|
|
437
|
+
quickReplies: Array<{
|
|
438
|
+
type: 'text' | 'location';
|
|
439
|
+
title: string;
|
|
440
|
+
payload?: string;
|
|
441
|
+
}>;
|
|
442
|
+
}
|
|
443
|
+
interface SendWebChatCardParams {
|
|
444
|
+
token: string;
|
|
445
|
+
sender: string;
|
|
446
|
+
title: string;
|
|
447
|
+
description?: string;
|
|
448
|
+
imageUrl?: string;
|
|
449
|
+
buttons?: Array<{
|
|
450
|
+
type: 'url' | 'postback';
|
|
451
|
+
title: string;
|
|
452
|
+
value: string;
|
|
453
|
+
}>;
|
|
454
|
+
}
|
|
455
|
+
interface SendWebChatButtonsParams {
|
|
456
|
+
token: string;
|
|
457
|
+
sender: string;
|
|
458
|
+
messageText: string;
|
|
459
|
+
buttons: Array<{
|
|
460
|
+
type: 'url' | 'postback';
|
|
461
|
+
title: string;
|
|
462
|
+
value: string;
|
|
463
|
+
}>;
|
|
464
|
+
}
|
|
465
|
+
interface ListPostsParams {
|
|
466
|
+
token: string;
|
|
467
|
+
pageId: string;
|
|
468
|
+
limit?: number;
|
|
469
|
+
}
|
|
470
|
+
interface ListCommentsParams {
|
|
471
|
+
token: string;
|
|
472
|
+
postId: string;
|
|
473
|
+
limit?: number;
|
|
474
|
+
}
|
|
475
|
+
interface CreatePostParams {
|
|
476
|
+
token: string;
|
|
477
|
+
pageId: string;
|
|
478
|
+
message: string;
|
|
479
|
+
link?: string;
|
|
480
|
+
}
|
|
481
|
+
interface ReplyCommentParams {
|
|
482
|
+
token: string;
|
|
483
|
+
commentId: string;
|
|
484
|
+
message: string;
|
|
485
|
+
}
|
|
486
|
+
interface DeleteCommentParams {
|
|
487
|
+
token: string;
|
|
488
|
+
commentId: string;
|
|
489
|
+
}
|
|
490
|
+
interface SendFacebookTextParams {
|
|
491
|
+
token: string;
|
|
492
|
+
recipientId: string;
|
|
493
|
+
message: string;
|
|
494
|
+
}
|
|
495
|
+
interface SendFacebookMediaParams {
|
|
496
|
+
token: string;
|
|
497
|
+
recipientId: string;
|
|
498
|
+
fileUrl: string;
|
|
499
|
+
type: 'image' | 'video' | 'audio' | 'file';
|
|
500
|
+
caption?: string;
|
|
501
|
+
}
|
|
502
|
+
interface SendFacebookButtonsParams {
|
|
503
|
+
token: string;
|
|
504
|
+
recipientId: string;
|
|
505
|
+
message: string;
|
|
506
|
+
buttons: Array<{
|
|
507
|
+
type: 'web_url' | 'postback';
|
|
508
|
+
title: string;
|
|
509
|
+
url?: string;
|
|
510
|
+
payload?: string;
|
|
511
|
+
}>;
|
|
512
|
+
}
|
|
513
|
+
interface SendFacebookStickerParams {
|
|
514
|
+
token: string;
|
|
515
|
+
recipientId: string;
|
|
516
|
+
stickerId: number;
|
|
517
|
+
}
|
|
518
|
+
interface ReplyFacebookMessageParams {
|
|
519
|
+
token: string;
|
|
520
|
+
messageId: string;
|
|
521
|
+
message: string;
|
|
522
|
+
}
|
|
523
|
+
interface ReplyFacebookMediaParams {
|
|
524
|
+
token: string;
|
|
525
|
+
messageId: string;
|
|
526
|
+
fileUrl: string;
|
|
527
|
+
type: 'image' | 'video' | 'audio' | 'file';
|
|
528
|
+
caption?: string;
|
|
529
|
+
}
|
|
530
|
+
interface SharePostParams {
|
|
531
|
+
token: string;
|
|
532
|
+
mediaId: string;
|
|
533
|
+
recipientId: string;
|
|
534
|
+
}
|
|
535
|
+
interface SendInstagramPrivateReplyParams {
|
|
536
|
+
token: string;
|
|
537
|
+
commentId: string;
|
|
538
|
+
message: string;
|
|
539
|
+
}
|
|
540
|
+
interface SendInstagramTextParams {
|
|
541
|
+
token: string;
|
|
542
|
+
recipientId: string;
|
|
543
|
+
message: string;
|
|
544
|
+
}
|
|
545
|
+
interface SendInstagramMediaParams {
|
|
546
|
+
token: string;
|
|
547
|
+
recipientId: string;
|
|
548
|
+
fileUrl: string;
|
|
549
|
+
type: 'image' | 'video' | 'audio' | 'file';
|
|
550
|
+
caption?: string;
|
|
551
|
+
}
|
|
552
|
+
interface SendInstagramImagesParams {
|
|
553
|
+
token: string;
|
|
554
|
+
recipientId: string;
|
|
555
|
+
images: Array<{
|
|
556
|
+
url: string;
|
|
557
|
+
caption?: string;
|
|
558
|
+
}>;
|
|
559
|
+
}
|
|
560
|
+
interface SendInstagramStickerParams {
|
|
561
|
+
token: string;
|
|
562
|
+
recipientId: string;
|
|
563
|
+
stickerType: 'like' | 'heart';
|
|
564
|
+
}
|
|
565
|
+
interface ReactInstagramMessageParams {
|
|
566
|
+
token: string;
|
|
567
|
+
messageId: string;
|
|
568
|
+
reactionType: 'like' | 'love' | 'wow' | 'haha' | 'sorry' | 'anger';
|
|
569
|
+
}
|
|
570
|
+
interface SendInstagramQuickRepliesParams {
|
|
571
|
+
token: string;
|
|
572
|
+
recipientId: string;
|
|
573
|
+
message: string;
|
|
574
|
+
quickReplies: Array<{
|
|
575
|
+
content_type: 'text';
|
|
576
|
+
title: string;
|
|
577
|
+
payload: string;
|
|
578
|
+
}>;
|
|
579
|
+
}
|
|
580
|
+
interface SendInstagramGenericTemplateParams {
|
|
581
|
+
token: string;
|
|
582
|
+
recipientId: string;
|
|
583
|
+
elements: Array<{
|
|
584
|
+
title: string;
|
|
585
|
+
subtitle?: string;
|
|
586
|
+
image_url?: string;
|
|
587
|
+
buttons?: Array<{
|
|
588
|
+
type: 'web_url' | 'postback';
|
|
589
|
+
title: string;
|
|
590
|
+
url?: string;
|
|
591
|
+
payload?: string;
|
|
592
|
+
}>;
|
|
593
|
+
}>;
|
|
594
|
+
}
|
|
595
|
+
interface SendInstagramButtonTemplateParams {
|
|
596
|
+
token: string;
|
|
597
|
+
recipientId: string;
|
|
598
|
+
text: string;
|
|
599
|
+
buttons: Array<{
|
|
600
|
+
type: 'web_url' | 'postback';
|
|
601
|
+
title: string;
|
|
602
|
+
url?: string;
|
|
603
|
+
payload?: string;
|
|
604
|
+
}>;
|
|
605
|
+
}
|
|
606
|
+
interface SendInstagramSenderActionParams {
|
|
607
|
+
token: string;
|
|
608
|
+
recipientId: string;
|
|
609
|
+
action: 'typing_on' | 'typing_off' | 'mark_seen';
|
|
610
|
+
}
|
|
611
|
+
interface GetInstagramUserProfileParams {
|
|
612
|
+
token: string;
|
|
613
|
+
userId: string;
|
|
614
|
+
}
|
|
615
|
+
interface ListInstagramPostsParams {
|
|
616
|
+
token: string;
|
|
617
|
+
userId: string;
|
|
618
|
+
limit?: number;
|
|
619
|
+
}
|
|
620
|
+
interface CreateWebhookParams {
|
|
621
|
+
url: string;
|
|
622
|
+
expiresInDays?: number;
|
|
623
|
+
}
|
|
624
|
+
interface Webhook {
|
|
625
|
+
id: number;
|
|
626
|
+
url: string;
|
|
627
|
+
userId: number;
|
|
628
|
+
expiresAt?: string;
|
|
629
|
+
createdAt: string;
|
|
630
|
+
updatedAt: string;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Cliente HTTP robusto com retry automático e tratamento de erros
|
|
635
|
+
*/
|
|
636
|
+
declare class HttpClient {
|
|
637
|
+
private axiosInstance;
|
|
638
|
+
private accessToken;
|
|
639
|
+
private tokenExpiresAt;
|
|
640
|
+
private config;
|
|
641
|
+
private refreshTokenPromise;
|
|
642
|
+
constructor(config: SDKConfig);
|
|
643
|
+
private setupInterceptors;
|
|
644
|
+
/**
|
|
645
|
+
* Obtém um token válido, renovando se necessário
|
|
646
|
+
*/
|
|
647
|
+
private getValidToken;
|
|
648
|
+
/**
|
|
649
|
+
* Renova o token de acesso
|
|
650
|
+
*/
|
|
651
|
+
private refreshAccessToken;
|
|
652
|
+
/**
|
|
653
|
+
* Formata erros da API
|
|
654
|
+
*/
|
|
655
|
+
private formatError;
|
|
656
|
+
/**
|
|
657
|
+
* Faz uma requisição GET
|
|
658
|
+
*/
|
|
659
|
+
get<T = any>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
660
|
+
/**
|
|
661
|
+
* Faz uma requisição POST
|
|
662
|
+
*/
|
|
663
|
+
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
664
|
+
/**
|
|
665
|
+
* Faz uma requisição PUT
|
|
666
|
+
*/
|
|
667
|
+
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
668
|
+
/**
|
|
669
|
+
* Faz uma requisição DELETE
|
|
670
|
+
*/
|
|
671
|
+
delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<ApiResponse<T>>;
|
|
672
|
+
/**
|
|
673
|
+
* Faz upload de arquivo
|
|
674
|
+
*/
|
|
675
|
+
upload<T = any>(url: string, file: File | Blob | Buffer, fieldName?: string, additionalData?: Record<string, any>): Promise<ApiResponse<T>>;
|
|
676
|
+
/**
|
|
677
|
+
* Define um token de acesso manualmente (útil para testes)
|
|
678
|
+
*/
|
|
679
|
+
setAccessToken(token: string, expiresIn?: number): void;
|
|
680
|
+
/**
|
|
681
|
+
* Limpa o token atual
|
|
682
|
+
*/
|
|
683
|
+
clearToken(): void;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Módulo de Autenticação
|
|
688
|
+
*/
|
|
689
|
+
declare class AuthModule {
|
|
690
|
+
private httpClient;
|
|
691
|
+
constructor(httpClient: HttpClient);
|
|
692
|
+
/**
|
|
693
|
+
* Gera um novo token de acesso
|
|
694
|
+
*/
|
|
695
|
+
getToken(clientId: string, clientSecret: string): Promise<TokenResponse>;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Módulo de Canais
|
|
700
|
+
*/
|
|
701
|
+
declare class ChannelsModule {
|
|
702
|
+
private httpClient;
|
|
703
|
+
constructor(httpClient: HttpClient);
|
|
704
|
+
/**
|
|
705
|
+
* Lista todos os canais do usuário
|
|
706
|
+
*/
|
|
707
|
+
list(): Promise<Channel[]>;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Módulo de Integrações
|
|
712
|
+
*/
|
|
713
|
+
declare class IntegrationsModule {
|
|
714
|
+
private httpClient;
|
|
715
|
+
constructor(httpClient: HttpClient);
|
|
716
|
+
/**
|
|
717
|
+
* Cria um novo webhook
|
|
718
|
+
*/
|
|
719
|
+
createWebhook(params: CreateWebhookParams): Promise<Webhook>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Módulo WhatsApp - Envio de mensagens e gerenciamento de templates
|
|
724
|
+
*/
|
|
725
|
+
declare class WhatsAppModule {
|
|
726
|
+
private httpClient;
|
|
727
|
+
constructor(httpClient: HttpClient);
|
|
728
|
+
/**
|
|
729
|
+
* Envia mensagem de texto
|
|
730
|
+
*/
|
|
731
|
+
sendText(params: SendWhatsAppTextParams): Promise<ApiResponse<any>>;
|
|
732
|
+
/**
|
|
733
|
+
* Envia mídia (imagem, vídeo, áudio, documento)
|
|
734
|
+
*/
|
|
735
|
+
sendMedia(params: SendWhatsAppMediaParams): Promise<ApiResponse<any>>;
|
|
736
|
+
/**
|
|
737
|
+
* Envia template
|
|
738
|
+
*/
|
|
739
|
+
sendTemplate(params: SendWhatsAppTemplateParams): Promise<ApiResponse<any>>;
|
|
740
|
+
/**
|
|
741
|
+
* Envia mensagem com botões
|
|
742
|
+
*/
|
|
743
|
+
sendButtons(params: SendWhatsAppButtonsParams): Promise<ApiResponse<any>>;
|
|
744
|
+
/**
|
|
745
|
+
* Envia lista interativa
|
|
746
|
+
*/
|
|
747
|
+
sendList(params: SendWhatsAppListParams): Promise<ApiResponse<any>>;
|
|
748
|
+
/**
|
|
749
|
+
* Responde a uma mensagem
|
|
750
|
+
*/
|
|
751
|
+
replyMessage(params: ReplyWhatsAppParams): Promise<ApiResponse<any>>;
|
|
752
|
+
/**
|
|
753
|
+
* Reage a uma mensagem
|
|
754
|
+
*/
|
|
755
|
+
reactMessage(params: ReactWhatsAppParams): Promise<ApiResponse<any>>;
|
|
756
|
+
/**
|
|
757
|
+
* Cria um template
|
|
758
|
+
*/
|
|
759
|
+
createTemplate(params: CreateTemplateParams): Promise<ApiResponse<any>>;
|
|
760
|
+
/**
|
|
761
|
+
* Lista templates
|
|
762
|
+
*/
|
|
763
|
+
listTemplates(token: string): Promise<ApiResponse<any>>;
|
|
764
|
+
/**
|
|
765
|
+
* Obtém detalhes de um template
|
|
766
|
+
*/
|
|
767
|
+
getTemplate(token: string, templateId: string): Promise<ApiResponse<any>>;
|
|
768
|
+
/**
|
|
769
|
+
* Faz upload de mídia para templates
|
|
770
|
+
*/
|
|
771
|
+
uploadMedia(params: UploadMediaParams): Promise<ApiResponse<any>>;
|
|
772
|
+
/**
|
|
773
|
+
* Envia detalhes do pedido com opções de pagamento
|
|
774
|
+
*/
|
|
775
|
+
sendOrderDetails(params: SendOrderDetailsParams): Promise<ApiResponse<any>>;
|
|
776
|
+
/**
|
|
777
|
+
* Atualiza status do pedido
|
|
778
|
+
*/
|
|
779
|
+
sendOrderStatus(params: SendOrderStatusParams): Promise<ApiResponse<any>>;
|
|
780
|
+
/**
|
|
781
|
+
* Envia áudio
|
|
782
|
+
*/
|
|
783
|
+
sendAudio(params: SendWhatsAppAudioParams): Promise<ApiResponse<any>>;
|
|
784
|
+
/**
|
|
785
|
+
* Envia sticker
|
|
786
|
+
*/
|
|
787
|
+
sendSticker(params: SendWhatsAppStickerParams): Promise<ApiResponse<any>>;
|
|
788
|
+
/**
|
|
789
|
+
* Envia vídeo
|
|
790
|
+
*/
|
|
791
|
+
sendVideo(params: SendWhatsAppVideoParams): Promise<ApiResponse<any>>;
|
|
792
|
+
/**
|
|
793
|
+
* Envia documento
|
|
794
|
+
*/
|
|
795
|
+
sendDocument(params: SendWhatsAppDocumentParams): Promise<ApiResponse<any>>;
|
|
796
|
+
/**
|
|
797
|
+
* Envia contato
|
|
798
|
+
*/
|
|
799
|
+
sendContact(params: SendWhatsAppContactParams): Promise<ApiResponse<any>>;
|
|
800
|
+
/**
|
|
801
|
+
* Envia localização
|
|
802
|
+
*/
|
|
803
|
+
sendLocation(params: SendWhatsAppLocationParams): Promise<ApiResponse<any>>;
|
|
804
|
+
/**
|
|
805
|
+
* Solicita localização
|
|
806
|
+
*/
|
|
807
|
+
sendLocationRequest(params: SendWhatsAppLocationRequestParams): Promise<ApiResponse<any>>;
|
|
808
|
+
/**
|
|
809
|
+
* Envia mensagem com botão CTA URL
|
|
810
|
+
*/
|
|
811
|
+
sendCtaUrl(params: SendWhatsAppCtaUrlParams): Promise<ApiResponse<any>>;
|
|
812
|
+
/**
|
|
813
|
+
* Envia carrossel de mídia
|
|
814
|
+
*/
|
|
815
|
+
sendMediaCarousel(params: SendWhatsAppMediaCarouselParams): Promise<ApiResponse<any>>;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Módulo Telegram - Envio de mensagens e gerenciamento
|
|
820
|
+
*/
|
|
821
|
+
declare class TelegramModule {
|
|
822
|
+
private httpClient;
|
|
823
|
+
constructor(httpClient: HttpClient);
|
|
824
|
+
/**
|
|
825
|
+
* Envia mensagem de texto
|
|
826
|
+
*/
|
|
827
|
+
sendMessage(params: SendTelegramTextParams): Promise<ApiResponse<any>>;
|
|
828
|
+
/**
|
|
829
|
+
* Envia mídia
|
|
830
|
+
*/
|
|
831
|
+
sendMedia(params: SendTelegramMediaParams): Promise<ApiResponse<any>>;
|
|
832
|
+
/**
|
|
833
|
+
* Envia mensagem com botões
|
|
834
|
+
*/
|
|
835
|
+
sendButtons(params: SendTelegramButtonsParams): Promise<ApiResponse<any>>;
|
|
836
|
+
/**
|
|
837
|
+
* Envia localização
|
|
838
|
+
*/
|
|
839
|
+
sendLocation(params: SendTelegramLocationParams): Promise<ApiResponse<any>>;
|
|
840
|
+
/**
|
|
841
|
+
* Envia contato
|
|
842
|
+
*/
|
|
843
|
+
sendContact(params: SendTelegramContactParams): Promise<ApiResponse<any>>;
|
|
844
|
+
/**
|
|
845
|
+
* Envia enquete
|
|
846
|
+
*/
|
|
847
|
+
sendPoll(params: SendTelegramPollParams): Promise<ApiResponse<any>>;
|
|
848
|
+
/**
|
|
849
|
+
* Envia venue (local)
|
|
850
|
+
*/
|
|
851
|
+
sendVenue(params: SendTelegramVenueParams): Promise<ApiResponse<any>>;
|
|
852
|
+
/**
|
|
853
|
+
* Envia dado/emoji animado
|
|
854
|
+
*/
|
|
855
|
+
sendDice(params: SendTelegramDiceParams): Promise<ApiResponse<any>>;
|
|
856
|
+
/**
|
|
857
|
+
* Envia sticker
|
|
858
|
+
*/
|
|
859
|
+
sendSticker(params: SendTelegramStickerParams): Promise<ApiResponse<any>>;
|
|
860
|
+
/**
|
|
861
|
+
* Envia mensagem de voz
|
|
862
|
+
*/
|
|
863
|
+
sendVoice(params: SendTelegramVoiceParams): Promise<ApiResponse<any>>;
|
|
864
|
+
/**
|
|
865
|
+
* Envia video note
|
|
866
|
+
*/
|
|
867
|
+
sendVideoNote(params: SendTelegramVideoNoteParams): Promise<ApiResponse<any>>;
|
|
868
|
+
/**
|
|
869
|
+
* Envia grupo de mídia
|
|
870
|
+
*/
|
|
871
|
+
sendMediaGroup(params: SendTelegramMediaGroupParams): Promise<ApiResponse<any>>;
|
|
872
|
+
/**
|
|
873
|
+
* Envia teclado de resposta
|
|
874
|
+
*/
|
|
875
|
+
sendReplyKeyboard(params: SendTelegramReplyKeyboardParams): Promise<ApiResponse<any>>;
|
|
876
|
+
/**
|
|
877
|
+
* Edita mensagem
|
|
878
|
+
*/
|
|
879
|
+
editMessage(params: EditTelegramMessageParams): Promise<ApiResponse<any>>;
|
|
880
|
+
/**
|
|
881
|
+
* Deleta mensagem
|
|
882
|
+
*/
|
|
883
|
+
deleteMessage(params: DeleteTelegramMessageParams): Promise<ApiResponse<any>>;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Módulo WebChat - Envio de mensagens via WebChat
|
|
888
|
+
*/
|
|
889
|
+
declare class WebChatModule {
|
|
890
|
+
private httpClient;
|
|
891
|
+
constructor(httpClient: HttpClient);
|
|
892
|
+
/**
|
|
893
|
+
* Envia mensagem de texto
|
|
894
|
+
*/
|
|
895
|
+
sendText(params: SendWebChatTextParams): Promise<ApiResponse<any>>;
|
|
896
|
+
/**
|
|
897
|
+
* Envia mídia
|
|
898
|
+
*/
|
|
899
|
+
sendMedia(params: SendWebChatMediaParams): Promise<ApiResponse<any>>;
|
|
900
|
+
/**
|
|
901
|
+
* Envia carousel
|
|
902
|
+
*/
|
|
903
|
+
sendCarousel(params: SendWebChatCarouselParams): Promise<ApiResponse<any>>;
|
|
904
|
+
/**
|
|
905
|
+
* Envia formulário
|
|
906
|
+
*/
|
|
907
|
+
sendForm(params: SendWebChatFormParams): Promise<ApiResponse<any>>;
|
|
908
|
+
/**
|
|
909
|
+
* Envia quick replies
|
|
910
|
+
*/
|
|
911
|
+
sendQuickReplies(params: SendWebChatQuickRepliesParams): Promise<ApiResponse<any>>;
|
|
912
|
+
/**
|
|
913
|
+
* Envia card
|
|
914
|
+
*/
|
|
915
|
+
sendCard(params: SendWebChatCardParams): Promise<ApiResponse<any>>;
|
|
916
|
+
/**
|
|
917
|
+
* Envia botões
|
|
918
|
+
*/
|
|
919
|
+
sendButtons(params: SendWebChatButtonsParams): Promise<ApiResponse<any>>;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Módulo Facebook - Gerenciamento de posts e mensagens
|
|
924
|
+
*/
|
|
925
|
+
declare class FacebookModule {
|
|
926
|
+
private httpClient;
|
|
927
|
+
constructor(httpClient: HttpClient);
|
|
928
|
+
/**
|
|
929
|
+
* Lista posts de uma página
|
|
930
|
+
*/
|
|
931
|
+
listPosts(params: ListPostsParams): Promise<ApiResponse<any>>;
|
|
932
|
+
/**
|
|
933
|
+
* Lista comentários de um post
|
|
934
|
+
*/
|
|
935
|
+
listComments(params: ListCommentsParams): Promise<ApiResponse<any>>;
|
|
936
|
+
/**
|
|
937
|
+
* Cria um post
|
|
938
|
+
*/
|
|
939
|
+
createPost(params: CreatePostParams): Promise<ApiResponse<any>>;
|
|
940
|
+
/**
|
|
941
|
+
* Responde um comentário
|
|
942
|
+
*/
|
|
943
|
+
replyComment(params: ReplyCommentParams): Promise<ApiResponse<any>>;
|
|
944
|
+
/**
|
|
945
|
+
* Deleta um comentário
|
|
946
|
+
*/
|
|
947
|
+
deleteComment(params: DeleteCommentParams): Promise<ApiResponse<any>>;
|
|
948
|
+
/**
|
|
949
|
+
* Envia mensagem de texto
|
|
950
|
+
*/
|
|
951
|
+
sendText(params: SendFacebookTextParams): Promise<ApiResponse<any>>;
|
|
952
|
+
/**
|
|
953
|
+
* Envia mídia
|
|
954
|
+
*/
|
|
955
|
+
sendMedia(params: SendFacebookMediaParams): Promise<ApiResponse<any>>;
|
|
956
|
+
/**
|
|
957
|
+
* Envia mensagem com botões
|
|
958
|
+
*/
|
|
959
|
+
sendButtons(params: SendFacebookButtonsParams): Promise<ApiResponse<any>>;
|
|
960
|
+
/**
|
|
961
|
+
* Envia sticker
|
|
962
|
+
*/
|
|
963
|
+
sendSticker(params: SendFacebookStickerParams): Promise<ApiResponse<any>>;
|
|
964
|
+
/**
|
|
965
|
+
* Responde uma mensagem
|
|
966
|
+
*/
|
|
967
|
+
replyMessage(params: ReplyFacebookMessageParams): Promise<ApiResponse<any>>;
|
|
968
|
+
/**
|
|
969
|
+
* Responde com mídia
|
|
970
|
+
*/
|
|
971
|
+
replyMedia(params: ReplyFacebookMediaParams): Promise<ApiResponse<any>>;
|
|
972
|
+
/**
|
|
973
|
+
* Compartilha um post do Instagram
|
|
974
|
+
*/
|
|
975
|
+
sharePost(params: SharePostParams): Promise<ApiResponse<any>>;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Módulo Instagram - Envio de mensagens e gerenciamento
|
|
980
|
+
*/
|
|
981
|
+
declare class InstagramModule {
|
|
982
|
+
private httpClient;
|
|
983
|
+
constructor(httpClient: HttpClient);
|
|
984
|
+
/**
|
|
985
|
+
* Envia resposta privada a comentário
|
|
986
|
+
*/
|
|
987
|
+
sendPrivateReply(params: SendInstagramPrivateReplyParams): Promise<ApiResponse<any>>;
|
|
988
|
+
/**
|
|
989
|
+
* Envia mensagem de texto
|
|
990
|
+
*/
|
|
991
|
+
sendText(params: SendInstagramTextParams): Promise<ApiResponse<any>>;
|
|
992
|
+
/**
|
|
993
|
+
* Envia mídia
|
|
994
|
+
*/
|
|
995
|
+
sendMedia(params: SendInstagramMediaParams): Promise<ApiResponse<any>>;
|
|
996
|
+
/**
|
|
997
|
+
* Envia múltiplas imagens (carrossel)
|
|
998
|
+
*/
|
|
999
|
+
sendImages(params: SendInstagramImagesParams): Promise<ApiResponse<any>>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Envia sticker (like/heart)
|
|
1002
|
+
*/
|
|
1003
|
+
sendSticker(params: SendInstagramStickerParams): Promise<ApiResponse<any>>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Reage a uma mensagem
|
|
1006
|
+
*/
|
|
1007
|
+
reactMessage(params: ReactInstagramMessageParams): Promise<ApiResponse<any>>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Remove reação de uma mensagem
|
|
1010
|
+
*/
|
|
1011
|
+
removeReaction(token: string, messageId: string): Promise<ApiResponse<any>>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Envia quick replies
|
|
1014
|
+
*/
|
|
1015
|
+
sendQuickReplies(params: SendInstagramQuickRepliesParams): Promise<ApiResponse<any>>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Envia template genérico (carrossel)
|
|
1018
|
+
*/
|
|
1019
|
+
sendGenericTemplate(params: SendInstagramGenericTemplateParams): Promise<ApiResponse<any>>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Envia template de botões
|
|
1022
|
+
*/
|
|
1023
|
+
sendButtonTemplate(params: SendInstagramButtonTemplateParams): Promise<ApiResponse<any>>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Envia ação do remetente (typing, seen)
|
|
1026
|
+
*/
|
|
1027
|
+
sendSenderAction(params: SendInstagramSenderActionParams): Promise<ApiResponse<any>>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Obtém perfil de um usuário
|
|
1030
|
+
*/
|
|
1031
|
+
getUserProfile(params: GetInstagramUserProfileParams): Promise<ApiResponse<any>>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Lista publicações do Instagram
|
|
1034
|
+
*/
|
|
1035
|
+
listPosts(params: ListInstagramPostsParams): Promise<ApiResponse<any>>;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* SDK OficialAPI - Cliente principal
|
|
1040
|
+
*
|
|
1041
|
+
* @example
|
|
1042
|
+
* ```typescript
|
|
1043
|
+
* import { OficialAPISDK } from '@oficialapi/sdk';
|
|
1044
|
+
*
|
|
1045
|
+
* const sdk = new OficialAPISDK({
|
|
1046
|
+
* clientId: 'your-client-id',
|
|
1047
|
+
* clientSecret: 'your-client-secret'
|
|
1048
|
+
* });
|
|
1049
|
+
*
|
|
1050
|
+
* // Enviar mensagem WhatsApp
|
|
1051
|
+
* const result = await sdk.whatsapp.sendText({
|
|
1052
|
+
* token: 'sk_live_...',
|
|
1053
|
+
* sender: '5511999999999',
|
|
1054
|
+
* messageText: 'Olá!'
|
|
1055
|
+
* });
|
|
1056
|
+
* ```
|
|
1057
|
+
*/
|
|
1058
|
+
declare class OficialAPISDK {
|
|
1059
|
+
private httpClient;
|
|
1060
|
+
readonly auth: AuthModule;
|
|
1061
|
+
readonly channels: ChannelsModule;
|
|
1062
|
+
readonly integrations: IntegrationsModule;
|
|
1063
|
+
readonly whatsapp: WhatsAppModule;
|
|
1064
|
+
readonly telegram: TelegramModule;
|
|
1065
|
+
readonly webchat: WebChatModule;
|
|
1066
|
+
readonly facebook: FacebookModule;
|
|
1067
|
+
readonly instagram: InstagramModule;
|
|
1068
|
+
constructor(config: SDKConfig);
|
|
1069
|
+
/**
|
|
1070
|
+
* Define um token de acesso manualmente (útil para testes)
|
|
1071
|
+
*/
|
|
1072
|
+
setAccessToken(token: string, expiresIn?: number): void;
|
|
1073
|
+
/**
|
|
1074
|
+
* Limpa o token atual
|
|
1075
|
+
*/
|
|
1076
|
+
clearToken(): void;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
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 };
|