@builderbot/provider-meta 1.2.6-y.0 → 1.2.6
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.cjs +83 -41
- package/dist/interface/meta.d.ts +12 -12
- package/dist/interface/meta.d.ts.map +1 -1
- package/dist/meta/core.d.ts.map +1 -1
- package/dist/meta/provider.d.ts +22 -22
- package/dist/meta/provider.d.ts.map +1 -1
- package/dist/types.d.ts +13 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/number.d.ts.map +1 -1
- package/dist/utils/processIncomingMsg.d.ts +1 -1
- package/dist/utils/processIncomingMsg.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -12169,7 +12169,7 @@ async function getMediaUrl(version, IdMedia, numberId, Token) {
|
|
|
12169
12169
|
}
|
|
12170
12170
|
}
|
|
12171
12171
|
|
|
12172
|
-
const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, message, to, jwtToken, version, numberId, }) => {
|
|
12172
|
+
const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, message, to, jwtToken, version, numberId, fileData }) => {
|
|
12173
12173
|
let responseObj;
|
|
12174
12174
|
switch (message.type) {
|
|
12175
12175
|
case 'text': {
|
|
@@ -12220,6 +12220,7 @@ const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, m
|
|
|
12220
12220
|
type: message.type,
|
|
12221
12221
|
from: message.from,
|
|
12222
12222
|
url: imageUrl,
|
|
12223
|
+
fileData,
|
|
12223
12224
|
caption: message?.image?.caption,
|
|
12224
12225
|
to,
|
|
12225
12226
|
body: bot.utils.generateRefProvider('_event_media_'),
|
|
@@ -12234,6 +12235,7 @@ const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, m
|
|
|
12234
12235
|
type: message.type,
|
|
12235
12236
|
from: message.from,
|
|
12236
12237
|
url: documentUrl,
|
|
12238
|
+
fileData,
|
|
12237
12239
|
to,
|
|
12238
12240
|
body: bot.utils.generateRefProvider('_event_document_'),
|
|
12239
12241
|
pushName,
|
|
@@ -12247,6 +12249,7 @@ const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, m
|
|
|
12247
12249
|
type: message.type,
|
|
12248
12250
|
from: message.from,
|
|
12249
12251
|
url: videoUrl,
|
|
12252
|
+
fileData,
|
|
12250
12253
|
caption: message?.video?.caption,
|
|
12251
12254
|
to,
|
|
12252
12255
|
body: bot.utils.generateRefProvider('_event_media_'),
|
|
@@ -12274,6 +12277,7 @@ const processIncomingMessage = async ({ messageId, messageTimestamp, pushName, m
|
|
|
12274
12277
|
type: message.type,
|
|
12275
12278
|
from: message.from,
|
|
12276
12279
|
url: audioUrl,
|
|
12280
|
+
fileData,
|
|
12277
12281
|
to,
|
|
12278
12282
|
body: bot.utils.generateRefProvider('_event_voice_note_'),
|
|
12279
12283
|
pushName,
|
|
@@ -12402,26 +12406,42 @@ class MetaCoreVendor extends EventEmitter {
|
|
|
12402
12406
|
res.end('empty endpoint');
|
|
12403
12407
|
return;
|
|
12404
12408
|
}
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
to
|
|
12413
|
-
pushName
|
|
12414
|
-
message
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12409
|
+
try {
|
|
12410
|
+
await Promise.all(messages.map((message) => async () => {
|
|
12411
|
+
let contact;
|
|
12412
|
+
if (Array.isArray(contacts)) {
|
|
12413
|
+
;
|
|
12414
|
+
[contact] = contacts;
|
|
12415
|
+
}
|
|
12416
|
+
const to = body.entry[0].changes[0].value?.metadata?.display_phone_number;
|
|
12417
|
+
const pushName = contact?.profile?.name ?? 'Unknown';
|
|
12418
|
+
const fileData = message?.audio ?? message?.image ?? message?.video ?? message?.document ?? message?.sticker ?? null;
|
|
12419
|
+
const response = await processIncomingMessage({
|
|
12420
|
+
messageId,
|
|
12421
|
+
messageTimestamp,
|
|
12422
|
+
to,
|
|
12423
|
+
pushName,
|
|
12424
|
+
message,
|
|
12425
|
+
jwtToken,
|
|
12426
|
+
numberId,
|
|
12427
|
+
version,
|
|
12428
|
+
fileData,
|
|
12429
|
+
});
|
|
12430
|
+
if (response) {
|
|
12431
|
+
await this.queue.enqueue(() => this.processMessage(response));
|
|
12432
|
+
}
|
|
12433
|
+
}));
|
|
12434
|
+
res.statusCode = 200;
|
|
12435
|
+
res.end('Messages enqueued');
|
|
12436
|
+
}
|
|
12437
|
+
catch (error) {
|
|
12438
|
+
this.emit('notice', {
|
|
12439
|
+
title: '🔔 META ALERT 🔔',
|
|
12440
|
+
instructions: [error.message || 'An error occurred while processing messages.'],
|
|
12418
12441
|
});
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
});
|
|
12423
|
-
res.statusCode = 200;
|
|
12424
|
-
res.end('Messages enqueued');
|
|
12442
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
12443
|
+
res.end(JSON.stringify({ error: error.message || 'An error occurred while processing messages.' }));
|
|
12444
|
+
}
|
|
12425
12445
|
};
|
|
12426
12446
|
/**
|
|
12427
12447
|
* Process incoming message.
|
|
@@ -12518,6 +12538,9 @@ async function getProfile(version, numberId, token) {
|
|
|
12518
12538
|
}
|
|
12519
12539
|
|
|
12520
12540
|
const parseMetaNumber = (number) => {
|
|
12541
|
+
if (typeof number !== 'string') {
|
|
12542
|
+
return number;
|
|
12543
|
+
}
|
|
12521
12544
|
number = number.replace(/\+/g, '').replace(/\s/g, '');
|
|
12522
12545
|
return number;
|
|
12523
12546
|
};
|
|
@@ -12603,7 +12626,7 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12603
12626
|
},
|
|
12604
12627
|
},
|
|
12605
12628
|
];
|
|
12606
|
-
this.sendImage = async (to, mediaInput = null, caption) => {
|
|
12629
|
+
this.sendImage = async (to, mediaInput = null, caption, context = null) => {
|
|
12607
12630
|
to = parseMetaNumber(to);
|
|
12608
12631
|
if (!mediaInput)
|
|
12609
12632
|
throw new Error(`MEDIA_INPUT_NULL_: ${mediaInput}`);
|
|
@@ -12628,9 +12651,11 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12628
12651
|
caption,
|
|
12629
12652
|
},
|
|
12630
12653
|
};
|
|
12654
|
+
if (context)
|
|
12655
|
+
body.context = context;
|
|
12631
12656
|
return this.sendMessageMeta(body);
|
|
12632
12657
|
};
|
|
12633
|
-
this.sendImageUrl = async (to, url, caption = '') => {
|
|
12658
|
+
this.sendImageUrl = async (to, url, caption = '', context = null) => {
|
|
12634
12659
|
to = parseMetaNumber(to);
|
|
12635
12660
|
const body = {
|
|
12636
12661
|
messaging_product: 'whatsapp',
|
|
@@ -12642,9 +12667,11 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12642
12667
|
caption,
|
|
12643
12668
|
},
|
|
12644
12669
|
};
|
|
12670
|
+
if (context)
|
|
12671
|
+
body.context = context;
|
|
12645
12672
|
return this.sendMessageMeta(body);
|
|
12646
12673
|
};
|
|
12647
|
-
this.sendVideo = async (to, pathVideo = null, caption) => {
|
|
12674
|
+
this.sendVideo = async (to, pathVideo = null, caption, context = null) => {
|
|
12648
12675
|
to = parseMetaNumber(to);
|
|
12649
12676
|
if (!pathVideo)
|
|
12650
12677
|
throw new Error(`MEDIA_INPUT_NULL_: ${pathVideo}`);
|
|
@@ -12669,9 +12696,11 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12669
12696
|
caption,
|
|
12670
12697
|
},
|
|
12671
12698
|
};
|
|
12699
|
+
if (context)
|
|
12700
|
+
body.context = context;
|
|
12672
12701
|
return this.sendMessageMeta(body);
|
|
12673
12702
|
};
|
|
12674
|
-
this.sendVideoUrl = async (to, url, caption = '') => {
|
|
12703
|
+
this.sendVideoUrl = async (to, url, caption = '', context = null) => {
|
|
12675
12704
|
to = parseMetaNumber(to);
|
|
12676
12705
|
const body = {
|
|
12677
12706
|
messaging_product: 'whatsapp',
|
|
@@ -12683,22 +12712,24 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12683
12712
|
caption,
|
|
12684
12713
|
},
|
|
12685
12714
|
};
|
|
12715
|
+
if (context)
|
|
12716
|
+
body.context = context;
|
|
12686
12717
|
return this.sendMessageMeta(body);
|
|
12687
12718
|
};
|
|
12688
|
-
this.sendMedia = async (to, text = '', mediaInput) => {
|
|
12719
|
+
this.sendMedia = async (to, text = '', mediaInput, context = null) => {
|
|
12689
12720
|
to = parseMetaNumber(to);
|
|
12690
12721
|
const fileDownloaded = await bot.utils.generalDownload(mediaInput);
|
|
12691
12722
|
const mimeType = mime$1.lookup(fileDownloaded);
|
|
12692
12723
|
mediaInput = fileDownloaded;
|
|
12693
12724
|
if (mimeType.includes('image'))
|
|
12694
|
-
return this.sendImage(to, mediaInput, text);
|
|
12725
|
+
return this.sendImage(to, mediaInput, text, context);
|
|
12695
12726
|
if (mimeType.includes('video'))
|
|
12696
|
-
return this.sendVideo(to, fileDownloaded, text);
|
|
12727
|
+
return this.sendVideo(to, fileDownloaded, text, context);
|
|
12697
12728
|
if (mimeType.includes('audio')) {
|
|
12698
12729
|
const fileOpus = await bot.utils.convertAudio(mediaInput, 'mp3');
|
|
12699
|
-
return this.sendAudio(to, fileOpus);
|
|
12730
|
+
return this.sendAudio(to, fileOpus, context);
|
|
12700
12731
|
}
|
|
12701
|
-
return this.sendFile(to, mediaInput, text);
|
|
12732
|
+
return this.sendFile(to, mediaInput, text, context);
|
|
12702
12733
|
};
|
|
12703
12734
|
this.sendList = async (to, list) => {
|
|
12704
12735
|
to = parseMetaNumber(to);
|
|
@@ -12845,7 +12876,7 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12845
12876
|
};
|
|
12846
12877
|
return this.sendMessageMeta(body);
|
|
12847
12878
|
};
|
|
12848
|
-
this.sendFlow = async (to, headerText, bodyText, footerText, flowID, flowCta, screenName, data) => {
|
|
12879
|
+
this.sendFlow = async (to, headerText, bodyText, footerText, flowMessageVer, flowAction, flowID, flowToken, flowCta, isDraftFlow, screenName, data) => {
|
|
12849
12880
|
to = parseMetaNumber(to);
|
|
12850
12881
|
const body = {
|
|
12851
12882
|
messaging_product: 'whatsapp',
|
|
@@ -12867,15 +12898,16 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12867
12898
|
action: {
|
|
12868
12899
|
name: 'flow',
|
|
12869
12900
|
parameters: {
|
|
12870
|
-
flow_message_version: '3',
|
|
12871
|
-
flow_action: 'navigate',
|
|
12872
|
-
flow_token: '<FLOW_TOKEN>',
|
|
12901
|
+
flow_message_version: flowMessageVer ?? '3',
|
|
12902
|
+
flow_action: flowAction ?? 'navigate',
|
|
12903
|
+
flow_token: flowToken ?? '<FLOW_TOKEN>',
|
|
12873
12904
|
flow_id: flowID,
|
|
12874
|
-
flow_cta: flowCta,
|
|
12905
|
+
flow_cta: flowCta,
|
|
12875
12906
|
flow_action_payload: {
|
|
12876
12907
|
screen: screenName,
|
|
12877
12908
|
data: data ? data : { '<CUSTOM_KEY>': '<CUSTOM_VALUE>' },
|
|
12878
12909
|
},
|
|
12910
|
+
...(isDraftFlow && { mode: 'draft' })
|
|
12879
12911
|
},
|
|
12880
12912
|
},
|
|
12881
12913
|
},
|
|
@@ -12914,16 +12946,16 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12914
12946
|
};
|
|
12915
12947
|
return this.sendMessageMeta(body);
|
|
12916
12948
|
};
|
|
12917
|
-
this.sendMessage = async (to, message, options) => {
|
|
12949
|
+
this.sendMessage = async (to, message, options, context) => {
|
|
12918
12950
|
to = parseMetaNumber(to);
|
|
12919
12951
|
options = { ...options, ...options['options'] };
|
|
12920
12952
|
if (options?.buttons?.length)
|
|
12921
12953
|
return this.sendButtons(to, options.buttons, message);
|
|
12922
12954
|
if (options?.media)
|
|
12923
|
-
return this.sendMedia(to, message, options.media);
|
|
12924
|
-
this.sendText(to, message);
|
|
12955
|
+
return this.sendMedia(to, message, options.media, context);
|
|
12956
|
+
return this.sendText(to, message, context);
|
|
12925
12957
|
};
|
|
12926
|
-
this.sendFile = async (to, mediaInput = null, caption) => {
|
|
12958
|
+
this.sendFile = async (to, mediaInput = null, caption, context = null) => {
|
|
12927
12959
|
to = parseMetaNumber(to);
|
|
12928
12960
|
if (!mediaInput)
|
|
12929
12961
|
throw new Error(`MEDIA_INPUT_NULL_: ${mediaInput}`);
|
|
@@ -12950,9 +12982,11 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12950
12982
|
caption,
|
|
12951
12983
|
},
|
|
12952
12984
|
};
|
|
12985
|
+
if (context)
|
|
12986
|
+
body.context = context;
|
|
12953
12987
|
return this.sendMessageMeta(body);
|
|
12954
12988
|
};
|
|
12955
|
-
this.sendAudio = async (to, pathVideo = null) => {
|
|
12989
|
+
this.sendAudio = async (to, pathVideo = null, context = null) => {
|
|
12956
12990
|
to = parseMetaNumber(to);
|
|
12957
12991
|
if (!pathVideo)
|
|
12958
12992
|
throw new Error(`MEDIA_INPUT_NULL_: ${pathVideo}`);
|
|
@@ -12982,6 +13016,8 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
12982
13016
|
id: mediaId,
|
|
12983
13017
|
},
|
|
12984
13018
|
};
|
|
13019
|
+
if (context)
|
|
13020
|
+
body.context = context;
|
|
12985
13021
|
return this.sendMessageMeta(body);
|
|
12986
13022
|
};
|
|
12987
13023
|
this.sendReaction = async (to, react) => {
|
|
@@ -13052,7 +13088,7 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
13052
13088
|
};
|
|
13053
13089
|
return this.sendMessageMeta(body);
|
|
13054
13090
|
};
|
|
13055
|
-
this.sendText = async (to, message) => {
|
|
13091
|
+
this.sendText = async (to, message, context = null) => {
|
|
13056
13092
|
to = parseMetaNumber(to);
|
|
13057
13093
|
const body = {
|
|
13058
13094
|
messaging_product: 'whatsapp',
|
|
@@ -13064,10 +13100,15 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
13064
13100
|
body: message,
|
|
13065
13101
|
},
|
|
13066
13102
|
};
|
|
13103
|
+
if (context)
|
|
13104
|
+
body.context = context;
|
|
13067
13105
|
return this.sendMessageMeta(body);
|
|
13068
13106
|
};
|
|
13069
13107
|
this.sendMessageMeta = (body) => {
|
|
13070
|
-
return this.queue.add(() =>
|
|
13108
|
+
return new Promise((resolve) => this.queue.add(async () => {
|
|
13109
|
+
const resp = await this.sendMessageToApi(body);
|
|
13110
|
+
resolve(resp);
|
|
13111
|
+
}));
|
|
13071
13112
|
};
|
|
13072
13113
|
this.sendMessageToApi = async (body) => {
|
|
13073
13114
|
body.to = this.fixPrefixMetaNumber(body.to);
|
|
@@ -13078,6 +13119,7 @@ class MetaProvider extends bot.ProviderClass {
|
|
|
13078
13119
|
Authorization: `Bearer ${this.globalVendorArgs.jwtToken}`,
|
|
13079
13120
|
},
|
|
13080
13121
|
});
|
|
13122
|
+
response.data.payload = body;
|
|
13081
13123
|
return response.data;
|
|
13082
13124
|
}
|
|
13083
13125
|
catch (error) {
|
package/dist/interface/meta.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type { TextMessageBody, Reaction, Localization, Message, SaveFileOptions,
|
|
|
4
4
|
export interface MetaInterface {
|
|
5
5
|
sendMessageMeta: (body: TextMessageBody) => void;
|
|
6
6
|
sendMessageToApi: (body: TextMessageBody) => Promise<any>;
|
|
7
|
-
sendText: (to: string, message: string) => Promise<any>;
|
|
8
|
-
sendImage: (to: string, mediaInput: string | null, caption: string) => Promise<any>;
|
|
9
|
-
sendImageUrl: (to: string, url: string, caption: string) => Promise<void>;
|
|
10
|
-
sendVideo: (to: string, pathVideo: string | null, caption: string) => Promise<any>;
|
|
11
|
-
sendVideoUrl: (to: string, url: string, caption: string) => Promise<void>;
|
|
12
|
-
sendMedia: (to: string, text: string, mediaInput: string) => Promise<any>;
|
|
7
|
+
sendText: (to: string, message: string, context: string | null) => Promise<any>;
|
|
8
|
+
sendImage: (to: string, mediaInput: string | null, caption: string, context: string | null) => Promise<any>;
|
|
9
|
+
sendImageUrl: (to: string, url: string, caption: string, context: string | null) => Promise<void>;
|
|
10
|
+
sendVideo: (to: string, pathVideo: string | null, caption: string, context: string | null) => Promise<any>;
|
|
11
|
+
sendVideoUrl: (to: string, url: string, caption: string, context: string | null) => Promise<void>;
|
|
12
|
+
sendMedia: (to: string, text: string, mediaInput: string, context: string | null) => Promise<any>;
|
|
13
13
|
sendList: (to: string, list: MetaList) => Promise<any>;
|
|
14
14
|
sendListComplete: (to: string, header: string, text: string, footer: string, button: string, list: Record<string, any>) => Promise<void>;
|
|
15
15
|
sendButtons: (to: string, buttons: Button[], text: string) => Promise<any>;
|
|
@@ -18,15 +18,15 @@ export interface MetaInterface {
|
|
|
18
18
|
}, text: string) => Promise<any>;
|
|
19
19
|
sendButtonsMedia: (to: string, media_type: string, buttons: Button[], text: string, mediaInput: string) => Promise<any>;
|
|
20
20
|
sendTemplate: (to: string, template: string, languageCode: string, components: Record<string, any>) => Promise<any>;
|
|
21
|
-
sendFlow: (to: string, headerText: string, bodyText: string, footerText: string, flowID: string, flowCta: string, screenName: string, data: Record<string, any>) => Promise<void>;
|
|
21
|
+
sendFlow: (to: string, headerText: string, bodyText: string, footerText: string, flowMessageVer: string, flowAction: string, flowID: string, flowToken: string, flowCta: string, isDraftFlow: boolean, screenName: string, data: Record<string, any>) => Promise<void>;
|
|
22
22
|
sendContacts: (to: string, contact: any[]) => Promise<any>;
|
|
23
23
|
sendCatalog: (number: any, bodyText: any, itemCatalogId: any) => Promise<any>;
|
|
24
|
-
sendMessage: (number: string, message: string, options?: SendOptions) => Promise<any>;
|
|
24
|
+
sendMessage: (number: string, message: string, options?: SendOptions, context?: string) => Promise<any>;
|
|
25
25
|
sendReaction: (number: string, react: Reaction) => Promise<any>;
|
|
26
|
-
sendLocation: (to: string, localization: Localization) => Promise<any>;
|
|
27
|
-
sendLocationRequest: (to: string, bodyText: string) => Promise<any>;
|
|
26
|
+
sendLocation: (to: string, localization: Localization, context: string | null) => Promise<any>;
|
|
27
|
+
sendLocationRequest: (to: string, bodyText: string, context: string | null) => Promise<any>;
|
|
28
28
|
saveFile: (ctx: Partial<Message & BotContext>, options?: SaveFileOptions) => Promise<string>;
|
|
29
|
-
sendFile: (to: string, mediaInput: string | null, caption: string) => Promise<any>;
|
|
30
|
-
sendAudio: (to: string, fileOpus: string) => void;
|
|
29
|
+
sendFile: (to: string, mediaInput: string | null, caption: string, context: string | null) => Promise<any>;
|
|
30
|
+
sendAudio: (to: string, fileOpus: string, context: string | null) => void;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/interface/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE1G,MAAM,WAAW,aAAa;IAC1B,eAAe,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAA;IAChD,gBAAgB,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACzD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/interface/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE1G,MAAM,WAAW,aAAa;IAC1B,eAAe,EAAE,CAAC,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}
|
package/dist/meta/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/meta/core.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAItC,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/meta/core.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAItC,OAAO,KAAK,EAAE,OAAO,EAAsD,MAAM,SAAS,CAAA;AAE1F;;;GAGG;AACH,qBAAa,cAAe,SAAQ,YAAY;IAC5C,KAAK,EAAE,KAAK,CAAA;IAEZ;;;OAGG;gBACS,MAAM,EAAE,KAAK;IAKzB;;;OAGG;IACI,SAAS,EAAE,KAAK,CAAC,UAAU,CAEjC;IAED;;;;;;OAMG;IACI,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAI9E,OAAO,CAAC,aAAa;IAwBrB;;;OAGG;IACI,WAAW,EAAE,KAAK,CAAC,UAAU,CAqBnC;IAED;;;OAGG;IACI,WAAW,EAAE,KAAK,CAAC,UAAU,CAgEnC;IAED;;;;OAIG;IACI,cAAc,YAAa,OAAO,KAAG,OAAO,CAAC,IAAI,CAAC,CASxD;CACJ"}
|
package/dist/meta/provider.d.ts
CHANGED
|
@@ -30,31 +30,31 @@ declare class MetaProvider extends ProviderClass<MetaInterface> implements MetaI
|
|
|
30
30
|
event: string;
|
|
31
31
|
func: (payload: any) => void;
|
|
32
32
|
}[];
|
|
33
|
-
sendImage: (to: string, mediaInput: any, caption: string) => Promise<
|
|
34
|
-
sendImageUrl: (to: string, url: string, caption?: string) => Promise<
|
|
35
|
-
sendVideo: (to: string, pathVideo: any, caption: string) => Promise<
|
|
36
|
-
sendVideoUrl: (to: string, url: string, caption?: string) => Promise<
|
|
37
|
-
sendMedia: (to: string, text: string, mediaInput: string) => Promise<
|
|
38
|
-
sendList: (to: string, list: MetaList) => Promise<
|
|
39
|
-
sendListComplete: (to: string, header: string, text: string, footer: string, button: string, list: Record<string, any>) => Promise<
|
|
40
|
-
sendButtons: (to: string, buttons: Button[], text: string) => Promise<
|
|
33
|
+
sendImage: (to: string, mediaInput: any, caption: string, context?: any) => Promise<any>;
|
|
34
|
+
sendImageUrl: (to: string, url: string, caption?: string, context?: any) => Promise<any>;
|
|
35
|
+
sendVideo: (to: string, pathVideo: any, caption: string, context?: any) => Promise<any>;
|
|
36
|
+
sendVideoUrl: (to: string, url: string, caption?: string, context?: any) => Promise<any>;
|
|
37
|
+
sendMedia: (to: string, text: string, mediaInput: string, context?: any) => Promise<any>;
|
|
38
|
+
sendList: (to: string, list: MetaList) => Promise<any>;
|
|
39
|
+
sendListComplete: (to: string, header: string, text: string, footer: string, button: string, list: Record<string, any>) => Promise<any>;
|
|
40
|
+
sendButtons: (to: string, buttons: Button[], text: string) => Promise<any>;
|
|
41
41
|
sendButtonUrl: (to: string, button: Button & {
|
|
42
42
|
url: string;
|
|
43
43
|
}, text: string) => Promise<any>;
|
|
44
|
-
sendButtonsMedia: (to: string, media_type: string, buttons: any[], text: string, url: string) => Promise<
|
|
45
|
-
sendTemplate: (to: string, template: string, languageCode: string, components?: any[]) => Promise<
|
|
46
|
-
sendFlow: (to: string, headerText: string, bodyText: string, footerText: string, flowID: string, flowCta: string, screenName: string, data: Record<string, any>) => Promise<
|
|
47
|
-
sendContacts: (to: string, contacts?: ParsedContact[]) => Promise<
|
|
48
|
-
sendCatalog: (to: string, text: string, itemCatalogId: string) => Promise<
|
|
49
|
-
sendMessage: (to: string, message: string, options?: SendOptions) => Promise<any>;
|
|
50
|
-
sendFile: (to: string, mediaInput: any, caption: string) => Promise<
|
|
51
|
-
sendAudio: (to: string, pathVideo?: any) => Promise<
|
|
52
|
-
sendReaction: (to: string, react: Reaction) => Promise<
|
|
53
|
-
requestLocation: (to: any, bodyText: any) => Promise<
|
|
54
|
-
sendLocation: (to: string, localization: Localization) => Promise<
|
|
55
|
-
sendLocationRequest: (to: string, bodyText: string) => Promise<
|
|
56
|
-
sendText: (to: string, message: string) => Promise<
|
|
57
|
-
sendMessageMeta: (body: TextMessageBody) =>
|
|
44
|
+
sendButtonsMedia: (to: string, media_type: string, buttons: any[], text: string, url: string) => Promise<any>;
|
|
45
|
+
sendTemplate: (to: string, template: string, languageCode: string, components?: any[]) => Promise<any>;
|
|
46
|
+
sendFlow: (to: string, headerText: string, bodyText: string, footerText: string, flowMessageVer: string, flowAction: string, flowID: string, flowToken: string, flowCta: string, isDraftFlow: boolean, screenName: string, data: Record<string, any>) => Promise<any>;
|
|
47
|
+
sendContacts: (to: string, contacts?: ParsedContact[]) => Promise<any>;
|
|
48
|
+
sendCatalog: (to: string, text: string, itemCatalogId: string) => Promise<any>;
|
|
49
|
+
sendMessage: (to: string, message: string, options?: SendOptions, context?: string) => Promise<any>;
|
|
50
|
+
sendFile: (to: string, mediaInput: any, caption: string, context?: any) => Promise<any>;
|
|
51
|
+
sendAudio: (to: string, pathVideo?: any, context?: any) => Promise<any>;
|
|
52
|
+
sendReaction: (to: string, react: Reaction) => Promise<any>;
|
|
53
|
+
requestLocation: (to: any, bodyText: any) => Promise<any>;
|
|
54
|
+
sendLocation: (to: string, localization: Localization) => Promise<any>;
|
|
55
|
+
sendLocationRequest: (to: string, bodyText: string) => Promise<any>;
|
|
56
|
+
sendText: (to: string, message: string, context?: any) => Promise<any>;
|
|
57
|
+
sendMessageMeta: (body: TextMessageBody) => Promise<any>;
|
|
58
58
|
sendMessageToApi: (body: TextMessageBody) => Promise<any>;
|
|
59
59
|
}
|
|
60
60
|
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AgB,YAAY,kBAe3D;IAED,mBAAmB,OAAc,MAAM,YAAY,MAAM,kBAkBxD;IAED,QAAQ,OAAc,MAAM,WAAW,MAAM,iCAc5C;IAED,eAAe,SAAU,eAAe,KAAG,OAAO,CAAC,GAAG,CAAC,CAOtD;IAED,gBAAgB,SAAgB,eAAe,KAAG,OAAO,CAAC,GAAG,CAAC,CAgB7D;CACJ;AACD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { GlobalVendorArgs } from '@builderbot/bot/dist/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
link?: string;
|
|
6
|
-
}
|
|
7
|
-
interface Video {
|
|
2
|
+
export declare class File {
|
|
3
|
+
mime_type?: string;
|
|
4
|
+
sha256?: string;
|
|
8
5
|
id?: string;
|
|
6
|
+
voice?: boolean;
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
filename?: string;
|
|
9
9
|
caption?: string;
|
|
10
10
|
link?: string;
|
|
11
11
|
}
|
|
@@ -77,6 +77,7 @@ export interface Message {
|
|
|
77
77
|
pushName: string;
|
|
78
78
|
name: string;
|
|
79
79
|
url?: string;
|
|
80
|
+
fileData?: File | null;
|
|
80
81
|
payload?: string;
|
|
81
82
|
title_button_reply?: string;
|
|
82
83
|
title_list_reply?: string;
|
|
@@ -97,6 +98,7 @@ export interface ParamsIncomingMessage {
|
|
|
97
98
|
numberId: string;
|
|
98
99
|
version: string;
|
|
99
100
|
message: any;
|
|
101
|
+
fileData?: File | null;
|
|
100
102
|
}
|
|
101
103
|
export type TextGenericParams = {
|
|
102
104
|
messaging_product: 'whatsapp';
|
|
@@ -127,10 +129,13 @@ export interface TextMessageBody {
|
|
|
127
129
|
preview_url: boolean;
|
|
128
130
|
body: string;
|
|
129
131
|
};
|
|
130
|
-
image?:
|
|
131
|
-
video?:
|
|
132
|
+
image?: File;
|
|
133
|
+
video?: File;
|
|
134
|
+
audio?: File;
|
|
135
|
+
document?: File;
|
|
132
136
|
interactive?: any;
|
|
133
137
|
contacts?: any[];
|
|
138
|
+
context?: string;
|
|
134
139
|
template?: TemplateMessage;
|
|
135
140
|
}
|
|
136
141
|
export interface Reaction {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAclE,qBAAa,IAAI;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,eAAe;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IACD,UAAU,EAAE,iBAAiB,EAAE,CAAA;CAClC;AAED,UAAU,iBAAiB;IACvB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;IAClC,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACnC;AAED,UAAU,OAAO;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,EAAE,CAAA;CACd;AAED,UAAU,GAAG;IACT,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE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M,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,KAAK,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,KAAK;IAClB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,QAAQ;IACrB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/utils/number.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAAY,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/utils/number.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,WAAY,MAAM,KAAG,MAMhD,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Message, ParamsIncomingMessage as ParamsIncomingMessage } from '../types';
|
|
2
|
-
export declare const processIncomingMessage: ({ messageId, messageTimestamp, pushName, message, to, jwtToken, version, numberId, }: ParamsIncomingMessage) => Promise<Message>;
|
|
2
|
+
export declare const processIncomingMessage: ({ messageId, messageTimestamp, pushName, message, to, jwtToken, version, numberId, fileData }: ParamsIncomingMessage) => Promise<Message>;
|
|
3
3
|
//# sourceMappingURL=processIncomingMsg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processIncomingMsg.d.ts","sourceRoot":"","sources":["../../src/utils/processIncomingMsg.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEvF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"processIncomingMsg.d.ts","sourceRoot":"","sources":["../../src/utils/processIncomingMsg.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEvF,eAAO,MAAM,sBAAsB,kGAUhC,qBAAqB,KAAG,OAAO,CAAC,OAAO,CA2KzC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builderbot/provider-meta",
|
|
3
|
-
"version": "1.2.6
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "vicente1992 <vic_ortiz20@hotmail.es>",
|
|
6
6
|
"homepage": "https://github.com/vicente1992/bot-whatsapp#readme",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"queue-promise": "^2.2.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@builderbot/bot": "^1.2.6
|
|
41
|
+
"@builderbot/bot": "^1.2.6",
|
|
42
42
|
"@jest/globals": "^29.7.0",
|
|
43
43
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
44
44
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"tslib": "^2.6.2",
|
|
62
62
|
"tsm": "^2.3.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "cea9cfbbbb7f6e80c80a10ed8ab0da89010f5b11"
|
|
65
65
|
}
|