kage-baileys 25.3.41 → 25.4.2

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.
Files changed (58) hide show
  1. package/README.md +42 -0
  2. package/WAProto/WAProto.proto +83 -0
  3. package/helpers/interactive-pay.d.ts +5 -0
  4. package/helpers/interactive-pay.js +29 -4
  5. package/lib/Defaults/index.d.ts +1 -0
  6. package/lib/Defaults/index.js +2 -0
  7. package/lib/Extensions/bootstrap.cjs +3 -3
  8. package/lib/Types/Kage.d.ts +1 -1
  9. package/lib/Utils/auth-store.d.ts +30 -0
  10. package/lib/Utils/auth-store.js +77 -0
  11. package/lib/Utils/group-metadata-cache.d.ts +5 -0
  12. package/lib/Utils/group-metadata-cache.js +26 -0
  13. package/lib/Utils/html-app.d.ts +19 -0
  14. package/lib/Utils/html-app.js +97 -0
  15. package/lib/Utils/html-multiplayer.d.ts +10 -0
  16. package/lib/Utils/html-multiplayer.js +95 -0
  17. package/lib/Utils/index.d.ts +21 -0
  18. package/lib/Utils/index.js +22 -0
  19. package/lib/Utils/link-preview-metadata.d.ts +47 -0
  20. package/lib/Utils/link-preview-metadata.js +89 -0
  21. package/lib/Utils/modern-messages.d.ts +150 -0
  22. package/lib/Utils/modern-messages.js +496 -0
  23. package/lib/Utils/newsletter-status.d.ts +158 -0
  24. package/lib/Utils/newsletter-status.js +651 -0
  25. package/lib/Utils/scheduled-message.d.ts +51 -0
  26. package/lib/Utils/scheduled-message.js +113 -0
  27. package/lib/Utils/sender-key-memory.d.ts +20 -0
  28. package/lib/Utils/sender-key-memory.js +52 -0
  29. package/lib/Utils/status-stickers.d.ts +127 -0
  30. package/lib/Utils/status-stickers.js +261 -0
  31. package/lib/Utils/ttl-cache.d.ts +29 -0
  32. package/lib/Utils/ttl-cache.js +121 -0
  33. package/lib/Utils/use-mongo-auth-state.d.ts +22 -0
  34. package/lib/Utils/use-mongo-auth-state.js +68 -0
  35. package/lib/Utils/use-mysql-auth-state.d.ts +20 -0
  36. package/lib/Utils/use-mysql-auth-state.js +80 -0
  37. package/lib/Utils/use-postgres-auth-state.d.ts +20 -0
  38. package/lib/Utils/use-postgres-auth-state.js +80 -0
  39. package/lib/Utils/use-redis-auth-state.d.ts +20 -0
  40. package/lib/Utils/use-redis-auth-state.js +90 -0
  41. package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
  42. package/lib/Utils/use-single-file-auth-state.js +109 -0
  43. package/lib/Utils/use-sqlite-auth-state.d.ts +13 -0
  44. package/lib/Utils/use-sqlite-auth-state.js +121 -0
  45. package/lib/Utils/useNekoDBAuth.d.ts +19 -0
  46. package/lib/Utils/useNekoDBAuth.js +111 -0
  47. package/lib/Utils/username-validation.d.ts +5 -0
  48. package/lib/Utils/username-validation.js +23 -0
  49. package/lib/Utils/voice-recognition.d.ts +53 -0
  50. package/lib/Utils/voice-recognition.js +219 -0
  51. package/lib/index.d.ts +24 -0
  52. package/licenses/dnuzi-MIT.txt +21 -0
  53. package/licenses/itsliaaa-MIT.txt +22 -0
  54. package/licenses/kage-antigua-MIT.txt +21 -0
  55. package/licenses/rexxhayanasi-MIT.txt +22 -0
  56. package/package.json +20 -3
  57. package/test/cross-fork-helpers.test.js +54 -0
  58. package/test/native-flow-payment.test.js +22 -2
@@ -0,0 +1,97 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+
3
+ export const HTML_APP_MESSAGE_CEILING = 1024 * 1024;
4
+
5
+ export const HTML_APP_BYTE_BUDGET = 960 * 1024;
6
+
7
+ export const HTML_APP_BYTE_LIMIT = HTML_APP_BYTE_BUDGET;
8
+
9
+ export const wireBytes = (html) => Buffer.byteLength(
10
+ JSON.stringify(String(html)).replace(/[\u007f-\uffff]/g, (c) => '\\u' + c.charCodeAt(0).toString(16).padStart(4, '0')),
11
+ 'utf-8'
12
+ );
13
+
14
+ const STORAGE_APIS = ['localStorage', 'sessionStorage', 'indexedDB', 'document.cookie', 'caches'];
15
+
16
+ const strip = (html) => html
17
+ .replace(/<!--[\s\S]*?-->/g, '')
18
+ .replace(/data:[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]*;base64,[A-Za-z0-9+/=]+/gi, 'data:');
19
+
20
+ const hasVisibilityGuard = (source) => /document\.(hidden|visibilityState)|visibilitychange|IntersectionObserver|cancelAnimationFrame|clearInterval/.test(source);
21
+
22
+ export const checkHtmlApp = (html, { height, maxBytes = HTML_APP_BYTE_BUDGET } = {}) => {
23
+ if (typeof html !== 'string') {
24
+ throw new TypeError('checkHtmlApp requires an HTML string');
25
+ }
26
+
27
+ const bytes = Buffer.byteLength(html, 'utf-8');
28
+ const wire = wireBytes(html);
29
+ const source = strip(html);
30
+ const problems = [];
31
+ const warnings = [];
32
+
33
+ if (wire > maxBytes) {
34
+ problems.push(`${Math.round(wire / 1024)}KB on the wire, over the ${Math.round(maxBytes / 1024)}KB budget — a message past ${Math.round(HTML_APP_MESSAGE_CEILING / 1024)}KB is dropped by the receiving client, which logs it and renders nothing, so this one would arrive as silence`);
35
+ }
36
+
37
+ if (wire > bytes * 1.15) {
38
+ warnings.push(`escaping inflates this page from ${Math.round(bytes / 1024)}KB to ${Math.round(wire / 1024)}KB — every non-ASCII character is rewritten as \\uXXXX, so emoji and accents cost up to three times their size`);
39
+ }
40
+
41
+ const remote = [...source.matchAll(/\b(?:src|href)\s*=\s*["']?(https?:)?\/\//gi)];
42
+ if (remote.length) {
43
+ problems.push(`${remote.length} remote subresource${remote.length === 1 ? '' : 's'} — the page runs in an opaque origin with no network, so every one of them fails silently; embed as data: URIs instead`);
44
+ }
45
+
46
+ if (/\bfetch\s*\(|XMLHttpRequest|navigator\.sendBeacon|new\s+EventSource/.test(source)) {
47
+ problems.push('a call over the HTTP stack — fetch, XHR, sendBeacon and EventSource were measured dead in this WebView, and no securitypolicyviolation fires to tell the page why');
48
+ }
49
+
50
+ const socket = /new\s+WebSocket/.test(source);
51
+ const peer = /RTCPeerConnection/.test(source);
52
+ if (socket && !/wss:\/\//.test(source)) {
53
+ problems.push('a WebSocket on something other than wss:// — the page is not a secure context, and a cleartext ws:// endpoint sends the room and every move in the open');
54
+ }
55
+ if ((socket || peer) && !hasVisibilityGuard(source)) {
56
+ warnings.push('a live connection with nothing closing it — the bubble outlives the screen, so close or pause the socket on visibilitychange');
57
+ }
58
+
59
+ const storage = STORAGE_APIS.filter(api => source.includes(api));
60
+ if (storage.length) {
61
+ problems.push(`${storage.join(', ')} — every storage API throws SecurityError in an opaque origin, so the catch branch always runs`);
62
+ }
63
+
64
+ if (/crypto\.subtle/.test(source)) {
65
+ problems.push('crypto.subtle needs a secure context and this page is not one');
66
+ }
67
+
68
+ const rafLoop = /requestAnimationFrame/.test(source);
69
+ const interval = /setInterval\s*\(/.test(source);
70
+ if ((rafLoop || interval) && !hasVisibilityGuard(source)) {
71
+ problems.push('an animation or timer loop with nothing to stop it — the bubble stays alive while the chat scrolls, so it keeps burning CPU and battery off-screen; gate it on document.hidden or an IntersectionObserver');
72
+ }
73
+
74
+ const reportsHeight = /AndroidBridge\s*\.\s*updateSize/.test(source);
75
+ if (height === undefined && !reportsHeight) {
76
+ const pinned = /(?:html|body)[^{}]*\{[^{}]*height\s*:\s*\d/i.test(source);
77
+ if (!pinned) {
78
+ warnings.push('no height settled — pass height or autoHeight to sendHtmlApp, or call AndroidBridge.updateSize yourself, or the host and the page measure each other and the card shudders');
79
+ }
80
+ }
81
+
82
+ if (/aspect-ratio\s*:/i.test(source)) {
83
+ warnings.push('aspect-ratio makes the height depend on the width, which is the layout chase the host cannot settle');
84
+ }
85
+
86
+ if (/<canvas[^>]*style\s*=\s*["'][^"']*height\s*:\s*auto/i.test(source)) {
87
+ warnings.push('a canvas at height:auto resizes with the bubble; give it pixel dimensions');
88
+ }
89
+
90
+ const dataUris = [...html.matchAll(/data:[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]*;base64,([A-Za-z0-9+/=]+)/gi)];
91
+ const embedded = dataUris.reduce((total, match) => total + match[1].length, 0);
92
+ if (embedded > bytes * 0.6 && dataUris.length) {
93
+ warnings.push(`${Math.round(embedded / 1024)}KB of the page is embedded media — shrink it before the byte budget forces you to`);
94
+ }
95
+
96
+ return { ok: problems.length === 0, bytes, wireBytes: wire, embeddedBytes: embedded, problems, warnings };
97
+ };
@@ -0,0 +1,10 @@
1
+ export interface HtmlMultiplayerOptions {
2
+ url: string
3
+ room: string
4
+ seat?: string | number | null
5
+ reconnectMs?: number
6
+ maxReconnectMs?: number
7
+ }
8
+
9
+ export declare function htmlMultiplayerPrelude(options: HtmlMultiplayerOptions): string
10
+ export declare function withHtmlMultiplayer(html: string, options: HtmlMultiplayerOptions): string
@@ -0,0 +1,95 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+
3
+ const escapeForScript = (value) => JSON.stringify(value).replace(/</g, '\\u003c').replace(/>/g, '\\u003e');
4
+
5
+ export const htmlMultiplayerPrelude = ({ url, room, seat, reconnectMs = 1500, maxReconnectMs = 15000 } = {}) => {
6
+ if (typeof url !== 'string' || !url.startsWith('wss://')) {
7
+ throw new TypeError('htmlMultiplayerPrelude requires a wss:// url, since the page is not a secure context');
8
+ }
9
+ if (typeof room !== 'string' || room.trim() === '') {
10
+ throw new TypeError('htmlMultiplayerPrelude requires a non-empty room id');
11
+ }
12
+
13
+ const config = escapeForScript({ url, room, seat: seat ?? null, reconnectMs, maxReconnectMs });
14
+
15
+ return `<script>
16
+ (function () {
17
+ var cfg = ${config};
18
+ var listeners = [];
19
+ var queue = [];
20
+ var sock = null;
21
+ var backoff = cfg.reconnectMs;
22
+ var closed = false;
23
+
24
+ var api = {
25
+ room: cfg.room,
26
+ seat: cfg.seat,
27
+ connected: false,
28
+ send: function (payload) {
29
+ var frame = JSON.stringify({ room: cfg.room, seat: cfg.seat, data: payload });
30
+ if (sock && sock.readyState === 1) sock.send(frame); else queue.push(frame);
31
+ },
32
+ on: function (fn) { listeners.push(fn); return function () { listeners = listeners.filter(function (f) { return f !== fn }) } },
33
+ close: function () { closed = true; if (sock) try { sock.close() } catch (e) {} }
34
+ };
35
+
36
+ function emit(kind, detail) {
37
+ for (var i = 0; i < listeners.length; i++) {
38
+ try { listeners[i](kind, detail) } catch (e) {}
39
+ }
40
+ }
41
+
42
+ function open() {
43
+ if (closed || (sock && (sock.readyState === 0 || sock.readyState === 1))) return;
44
+ try { sock = new WebSocket(cfg.url) } catch (e) { emit('error', e); return schedule() }
45
+
46
+ sock.onopen = function () {
47
+ backoff = cfg.reconnectMs;
48
+ api.connected = true;
49
+ sock.send(JSON.stringify({ join: cfg.room, seat: cfg.seat }));
50
+ while (queue.length && sock.readyState === 1) sock.send(queue.shift());
51
+ emit('open', null);
52
+ };
53
+ sock.onmessage = function (event) {
54
+ var parsed = event.data;
55
+ try { parsed = JSON.parse(event.data) } catch (e) {}
56
+ emit('message', parsed);
57
+ };
58
+ sock.onclose = function (event) {
59
+ api.connected = false;
60
+ emit('close', event.code);
61
+ schedule();
62
+ };
63
+ sock.onerror = function () { api.connected = false };
64
+ }
65
+
66
+ function schedule() {
67
+ if (closed || document.hidden) return;
68
+ setTimeout(open, backoff);
69
+ backoff = Math.min(backoff * 2, cfg.maxReconnectMs);
70
+ }
71
+
72
+ document.addEventListener('visibilitychange', function () {
73
+ if (document.hidden) {
74
+ if (sock) try { sock.close() } catch (e) {}
75
+ } else if (!closed) {
76
+ backoff = cfg.reconnectMs;
77
+ open();
78
+ }
79
+ });
80
+
81
+ window.addEventListener('pagehide', function () { api.close() });
82
+
83
+ window.room = api;
84
+ open();
85
+ })();
86
+ </script>
87
+ `;
88
+ };
89
+
90
+ export const withHtmlMultiplayer = (html, options) => {
91
+ if (typeof html !== 'string' || html.trim() === '') {
92
+ throw new TypeError('withHtmlMultiplayer requires an HTML string');
93
+ }
94
+ return htmlMultiplayerPrelude(options) + html;
95
+ };
@@ -29,3 +29,24 @@ export * from './stanza-ack.js';
29
29
  export * from './native-flow.js';
30
30
  export * from './payment-messages.js';
31
31
  export * from './photo.js';
32
+
33
+ export * from './ttl-cache.js';
34
+ export * from './auth-store.js';
35
+ export * from './use-mysql-auth-state.js';
36
+ export * from './use-mongo-auth-state.js';
37
+ export * from './use-postgres-auth-state.js';
38
+ export * from './use-redis-auth-state.js';
39
+ export * from './use-single-file-auth-state.js';
40
+ export * from './use-sqlite-auth-state.js';
41
+ export * from './useNekoDBAuth.js';
42
+ export * from './sender-key-memory.js';
43
+ export * from './link-preview-metadata.js';
44
+ export * from './group-metadata-cache.js';
45
+ export * from './voice-recognition.js';
46
+ export * from './modern-messages.js';
47
+ export * from './status-stickers.js';
48
+ export * from './html-app.js';
49
+ export * from './html-multiplayer.js';
50
+ export * from './newsletter-status.js';
51
+ export * from './scheduled-message.js';
52
+ export * from './username-validation.js';
@@ -29,3 +29,25 @@ export * from './stanza-ack.js';
29
29
  export * from './native-flow.js';
30
30
  export * from './payment-messages.js';
31
31
  export * from './photo.js';
32
+
33
+ // Additional standalone helpers integrated from compatible Kage/Elaina/Dnuzi branches.
34
+ export * from './ttl-cache.js';
35
+ export * from './auth-store.js';
36
+ export * from './use-mysql-auth-state.js';
37
+ export * from './use-mongo-auth-state.js';
38
+ export * from './use-postgres-auth-state.js';
39
+ export * from './use-redis-auth-state.js';
40
+ export * from './use-single-file-auth-state.js';
41
+ export * from './use-sqlite-auth-state.js';
42
+ export * from './useNekoDBAuth.js';
43
+ export * from './sender-key-memory.js';
44
+ export * from './link-preview-metadata.js';
45
+ export * from './group-metadata-cache.js';
46
+ export * from './voice-recognition.js';
47
+ export * from './modern-messages.js';
48
+ export * from './status-stickers.js';
49
+ export * from './html-app.js';
50
+ export * from './html-multiplayer.js';
51
+ export * from './newsletter-status.js';
52
+ export * from './scheduled-message.js';
53
+ export * from './username-validation.js';
@@ -0,0 +1,47 @@
1
+ import type { proto } from '../../WAProto/index.js';
2
+
3
+ export declare const SocialMediaPostType: Readonly<{
4
+ NONE: 0;
5
+ REEL: 1;
6
+ LIVE_VIDEO: 2;
7
+ LONG_VIDEO: 3;
8
+ SINGLE_IMAGE: 4;
9
+ CAROUSEL: 5;
10
+ }>;
11
+
12
+ export declare function videoEndCard(options?: {
13
+ username?: string;
14
+ caption?: string;
15
+ thumbnailUrl?: string;
16
+ profilePictureUrl?: string;
17
+ }): proto.Message.IVideoEndCard;
18
+
19
+ export interface SocialPreviewOptions {
20
+ postType?: number;
21
+ videoUrl?: string;
22
+ videoCaption?: string;
23
+ muted?: boolean;
24
+ /** Seconds, not milliseconds — the client stores link_media_duration_seconds. */
25
+ durationSeconds?: number;
26
+ experimentId?: number;
27
+ music?: proto.IEmbeddedMusic;
28
+ endCards?: proto.Message.IVideoEndCard[];
29
+ }
30
+
31
+ export declare function buildSocialPreview(options?: SocialPreviewOptions): {
32
+ linkPreviewMetadata?: proto.Message.ILinkPreviewMetadata;
33
+ videoContentUrl?: string;
34
+ musicMetadata?: proto.IEmbeddedMusic;
35
+ endCardTiles?: proto.Message.IVideoEndCard[];
36
+ };
37
+
38
+ export declare function readSocialPreview(msg: any): {
39
+ postType?: number;
40
+ durationSeconds?: number;
41
+ muted?: boolean;
42
+ videoUrl?: string;
43
+ videoCaption?: string;
44
+ music?: proto.IEmbeddedMusic;
45
+ experimentId?: number;
46
+ endCards?: proto.Message.IVideoEndCard[];
47
+ } | null;
@@ -0,0 +1,89 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+
3
+ export const SocialMediaPostType = Object.freeze({
4
+ NONE: 0,
5
+ REEL: 1,
6
+ LIVE_VIDEO: 2,
7
+ LONG_VIDEO: 3,
8
+ SINGLE_IMAGE: 4,
9
+ CAROUSEL: 5
10
+ })
11
+
12
+ const drop = (object) => {
13
+ for (const key of Object.keys(object)) {
14
+ if (object[key] === undefined || object[key] === null) {
15
+ delete object[key]
16
+ }
17
+ }
18
+ return object
19
+ }
20
+
21
+ export const videoEndCard = ({ username, caption, thumbnailUrl, profilePictureUrl } = {}) =>
22
+ drop({
23
+ username,
24
+ caption,
25
+ thumbnailImageUrl: thumbnailUrl,
26
+ profilePictureUrl
27
+ })
28
+
29
+ /**
30
+ * The same video url and music node exist twice, once nested in
31
+ * LinkPreviewMetadata and once directly on ExtendedTextMessage. Which one the
32
+ * client reads is not visible from the client, so both carry the same value.
33
+ */
34
+ export const buildSocialPreview = ({
35
+ postType,
36
+ videoUrl,
37
+ videoCaption,
38
+ muted,
39
+ durationSeconds,
40
+ experimentId,
41
+ music,
42
+ endCards
43
+ } = {}) => {
44
+ if (postType !== undefined && !Object.values(SocialMediaPostType).includes(postType)) {
45
+ throw new TypeError(`postType ${postType} is not one of ${Object.keys(SocialMediaPostType).join(', ')}`)
46
+ }
47
+ if (durationSeconds !== undefined && (!Number.isFinite(Number(durationSeconds)) || Number(durationSeconds) < 0)) {
48
+ throw new TypeError('durationSeconds must be a non-negative number of seconds, not milliseconds')
49
+ }
50
+
51
+ const metadata = drop({
52
+ socialMediaPostType: postType,
53
+ linkMediaDuration: durationSeconds === undefined ? undefined : Math.round(Number(durationSeconds)),
54
+ linkInlineVideoMuted: muted === undefined ? undefined : !!muted,
55
+ videoContentUrl: videoUrl,
56
+ videoContentCaption: videoCaption,
57
+ musicMetadata: music,
58
+ fbExperimentId: experimentId
59
+ })
60
+
61
+ return drop({
62
+ linkPreviewMetadata: Object.keys(metadata).length ? metadata : undefined,
63
+ videoContentUrl: videoUrl,
64
+ musicMetadata: music,
65
+ endCardTiles: endCards?.length ? endCards : undefined
66
+ })
67
+ }
68
+
69
+ export const readSocialPreview = (msg) => {
70
+ const message = msg?.message ?? msg
71
+ const text = message?.extendedTextMessage
72
+ if (!text) {
73
+ return null
74
+ }
75
+ const metadata = text.linkPreviewMetadata
76
+ if (!metadata && !text.endCardTiles?.length && !text.videoContentUrl) {
77
+ return null
78
+ }
79
+ return drop({
80
+ postType: metadata?.socialMediaPostType,
81
+ durationSeconds: metadata?.linkMediaDuration,
82
+ muted: metadata?.linkInlineVideoMuted,
83
+ videoUrl: metadata?.videoContentUrl ?? text.videoContentUrl,
84
+ videoCaption: metadata?.videoContentCaption,
85
+ music: metadata?.musicMetadata ?? text.musicMetadata,
86
+ experimentId: metadata?.fbExperimentId,
87
+ endCards: text.endCardTiles?.length ? text.endCardTiles : undefined
88
+ })
89
+ }
@@ -0,0 +1,150 @@
1
+ import { proto } from '../../WAProto/index.js'
2
+
3
+ export declare function makeQuestionMessage(input: {
4
+ text: string
5
+ contextInfo?: proto.IContextInfo
6
+ }): proto.IMessage
7
+
8
+ export declare function makeQuestionResponseMessage(input: {
9
+ key: proto.IMessageKey
10
+ text?: string
11
+ }): proto.IMessage
12
+
13
+ export declare function makeQuestionReplyMessage(input: {
14
+ text: string
15
+ serverQuestionId: number | string
16
+ quotedQuestion?: proto.IMessage
17
+ quotedResponse?: proto.IMessage
18
+ contextInfo?: proto.IContextInfo
19
+ }): proto.IMessage
20
+
21
+ export declare function makeStatusQuestionAnswerMessage(input: {
22
+ key: proto.IMessageKey
23
+ text?: string
24
+ }): proto.IMessage
25
+
26
+ export declare function makeStatusQuotedMessage(input: {
27
+ type?: number | string
28
+ text?: string
29
+ thumbnail?: Uint8Array
30
+ originalStatusId: proto.IMessageKey
31
+ }): proto.IMessage
32
+
33
+ export declare function makeStatusStickerInteractionMessage(input: {
34
+ key: proto.IMessageKey
35
+ stickerKey: string
36
+ type?: number | string
37
+ }): proto.IMessage
38
+
39
+ export declare function makeStatusNotificationMessage(input: {
40
+ responseMessageKey: proto.IMessageKey
41
+ originalMessageKey: proto.IMessageKey
42
+ type?: number | string
43
+ }): proto.IMessage
44
+
45
+ export declare function makeNewsletterAdminInviteMessage(input: {
46
+ newsletterJid: string
47
+ newsletterName?: string
48
+ jpegThumbnail?: Uint8Array
49
+ caption?: string
50
+ inviteExpiration?: number
51
+ contextInfo?: proto.IContextInfo
52
+ }): proto.IMessage
53
+
54
+ export declare function makeNewsletterFollowerInviteMessage(input: {
55
+ newsletterJid: string
56
+ newsletterName?: string
57
+ jpegThumbnail?: Uint8Array
58
+ caption?: string
59
+ contextInfo?: proto.IContextInfo
60
+ }): proto.IMessage
61
+
62
+ export declare function makePollAddOptionMessage(input: {
63
+ pollCreationMessageKey: proto.IMessageKey
64
+ option?: string | proto.Message.PollCreationMessage.IOption
65
+ addOption?: proto.Message.PollCreationMessage.IOption
66
+ metadata?: proto.Message.IPollUpdateMessageMetadata
67
+ }): proto.IMessage
68
+
69
+ export declare function makeCommentMessage(input: {
70
+ message?: proto.IMessage
71
+ content?: Record<string, any>
72
+ targetMessageKey: proto.IMessageKey
73
+ }): proto.IMessage
74
+
75
+ export declare function makeEventInviteMessage(input: {
76
+ eventId: string
77
+ eventTitle?: string
78
+ jpegThumbnail?: Uint8Array
79
+ startTime?: number | Date
80
+ caption?: string
81
+ isCanceled?: boolean
82
+ endTime?: number | Date
83
+ callLink?: string
84
+ contextInfo?: proto.IContextInfo
85
+ }): proto.IMessage
86
+
87
+ export declare function makeScheduledCallCreationMessage(input: {
88
+ scheduledTimestampMs: number | Date
89
+ callType?: number | string
90
+ title?: string
91
+ }): proto.IMessage
92
+
93
+ export declare function makeScheduledCallEditMessage(input: {
94
+ key: proto.IMessageKey
95
+ editType?: number | string
96
+ }): proto.IMessage
97
+
98
+ export declare function makeGroupStatusReactionMessage(input: {
99
+ key: proto.IMessageKey
100
+ text?: string
101
+ groupingKey?: string
102
+ senderTimestampMs?: number
103
+ }): proto.IMessage
104
+
105
+ export declare function makeNewsletterStatusAttribution(input: {
106
+ newsletterJid: string
107
+ messageId: string | number
108
+ duration?: number
109
+ hasMultipleReshares?: boolean
110
+ actionUrl?: string
111
+ }): proto.IStatusAttribution
112
+
113
+ export declare function makeGroupStatusAttribution(input: {
114
+ authorJid: string
115
+ actionUrl?: string
116
+ }): proto.IStatusAttribution
117
+
118
+ export declare const STATUS_AUDIENCE_DEFAULT_LIST_NAME: string
119
+ export declare const STATUS_AUDIENCE_DEFAULT_EMOJI: string
120
+
121
+ export declare function makeStatusAudienceMetadata(input: string | {
122
+ listName?: string
123
+ listEmoji?: string
124
+ audienceType?: number | string
125
+ }): proto.ContextInfo.IStatusAudienceMetadata
126
+
127
+ export declare const STATUS_NOTIFICATION_TYPES: Readonly<Record<string, number>>
128
+
129
+ export declare function makeMessageAssociation(input: {
130
+ parentMessageKey?: proto.IMessageKey
131
+ key?: proto.IMessageKey
132
+ associationType?: number | string
133
+ type?: number | string
134
+ messageIndex?: number
135
+ }): proto.IMessageAssociation
136
+
137
+ export declare function makeStatusAddYoursAssociation(input: proto.IMessageKey | {
138
+ key?: proto.IMessageKey
139
+ parentMessageKey?: proto.IMessageKey
140
+ type?: number | string
141
+ associationType?: number | string
142
+ messageIndex?: number
143
+ }): proto.IMessageAssociation
144
+
145
+ export declare function makeStatusMentionMessage(input: {
146
+ key: proto.IMessageKey
147
+ group?: boolean
148
+ }): any
149
+
150
+ export declare function prepareModernMessageContent(content: any): any