@randev404/baileys 1.0.2 → 1.0.4

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.
@@ -0,0 +1,19 @@
1
+ export declare const HTML_APP_MESSAGE_CEILING: number
2
+ export declare const HTML_APP_BYTE_BUDGET: number
3
+ export declare const HTML_APP_BYTE_LIMIT: number
4
+
5
+ export declare function wireBytes(html: string): number
6
+
7
+ export interface HtmlAppReport {
8
+ ok: boolean
9
+ bytes: number
10
+ wireBytes: number
11
+ embeddedBytes: number
12
+ problems: string[]
13
+ warnings: string[]
14
+ }
15
+
16
+ export declare function checkHtmlApp(html: string, options?: {
17
+ height?: number
18
+ maxBytes?: number
19
+ }): HtmlAppReport
@@ -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,3 @@
1
+ export declare function loadSharp(): Promise<any>
2
+ export declare function loadFfmpeg(): Promise<any>
3
+ export declare function hasOptionalMedia(name: 'sharp' | 'fluent-ffmpeg'): Promise<boolean>
@@ -0,0 +1,46 @@
1
+ /* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
2
+ const cache = new Map()
3
+
4
+ const MESSAGES = {
5
+ sharp: 'sharp is an optional dependency. Install it with: npm i sharp',
6
+ 'fluent-ffmpeg': 'fluent-ffmpeg is an optional dependency. Install it with: npm i fluent-ffmpeg'
7
+ }
8
+
9
+ const isMissingModule = (error, name) => {
10
+ const code = error?.code
11
+ if (code !== 'ERR_MODULE_NOT_FOUND' && code !== 'MODULE_NOT_FOUND') {
12
+ return false
13
+ }
14
+ const message = String(error?.message ?? '')
15
+ return message.includes(`'${name}'`) || message.includes(`"${name}"`)
16
+ }
17
+
18
+ const loadOptional = (name) => {
19
+ if (!cache.has(name)) {
20
+ cache.set(name, import(name).then(
21
+ loaded => loaded?.default ?? loaded,
22
+ error => {
23
+ cache.delete(name)
24
+ if (isMissingModule(error, name)) {
25
+ throw new Error(MESSAGES[name] ?? `${name} is an optional dependency. Install it with: npm i ${name}`)
26
+ }
27
+ throw error
28
+ }
29
+ ))
30
+ }
31
+ return cache.get(name)
32
+ }
33
+
34
+ export const loadSharp = () => loadOptional('sharp')
35
+
36
+ export const loadFfmpeg = () => loadOptional('fluent-ffmpeg')
37
+
38
+ export const hasOptionalMedia = async (name) => {
39
+ try {
40
+ await loadOptional(name)
41
+ return true
42
+ }
43
+ catch {
44
+ return false
45
+ }
46
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../src/custom.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY;;;;;;;;CAWxB,CAAA;AAeD,eAAO,MAAM,UAAU,YA2BtB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAM,GAAG,SAW3C,CAAA"}
1
+ {"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../src/custom.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;CAYxB,CAAA;AAeD,eAAO,MAAM,UAAU,YA0BtB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAM,GAAG,SAW3C,CAAA"}
package/lib/custom.js CHANGED
@@ -1,30 +1,27 @@
1
- const art = `⠀⠀⠀⠀⠀⠀⠀⠀
2
- ⠀⣠⣶⣶⣶⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
3
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
4
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣶⣶⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
5
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
6
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢻⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
7
- ⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠿⢿⣿⣻⢿⣿⣿⣿⡿⠄⣿⣿⣿⠀⠀⠀⣀⣤⡶⠟⠶⣤⣀⠀⠀⠀⠀⠀⠀
8
- ⠀⠀⠀⠀⢀⣤⣶⣿⠁⢈⣽⡛⠲⣤⣀⠀⠀⠀⣀⡀⠀⠈⠘⢽⣿⣿⡟⠹⠋⠈⣀⣿⣿⣿⣤⣴⠞⠉⢹⣿⣦⠀⣿⣿⡗⢦⣄⡀⠀⠀
9
- ⠀⢀⣤⣾⣏⢹⣿⡟⠀⣿⣿⠇⢀⣾⣏⠉⢉⣽⡟⢷⣤⣶⣿⣿⣿⣿⣿⣷⣦⣴⠟⣽⣿⡟⠀⣿⣿⡄⠈⢿⣿⠀⠙⢿⣷⢸⣿⣟⠲⣤
10
- ⣴⡞⢻⣿⡿⣾⠟⠁⠀⣿⠏⠀⢸⣿⡿⠀⢸⣿⣇⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⣿⣿⡇⠀⢻⣿⡇⠀⠈⢿⠀⠀⠈⠻⡜⢿⣿⣠⣿
11
- ⣿⡇⣿⠏⠀⠁⠀⠀⠀⠏⠀⠀⢸⡿⠁⠀⢸⣿⢛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡙⣿⡇⠀⠀⢻⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠇⠻
12
- ⠋⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠁⠀⠀⢸⠇⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡁⠹⠁⠀⠀⠀⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
13
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
14
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣸⣿⡿⢹⣿⣿⣿⣿⣿⣿⣿⣿⠿⣿⣿⣆⡀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
15
- ⠀⠀⠀⠀⠀⠀⣰⡀⣀⣈⣻⣤⡀⢀⣠⣾⣿⣿⡿⠁⢸⣿⣿⣿⣿⣿⣿⣿⣿⡇⠙⣿⣿⣿⣶⣄⡀⢀⣴⣏⣀⣀⣠⣧⠀⠀⠀⠀⠀⠀
16
- ⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀
17
- ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠉⠉⠉⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠈⠙⠛⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀`;
1
+ const art = `⣿⠛⠛⠛⠛⠻⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
2
+ ⠛⢛⣿⠋⢀⡾⠃⠀⠀⠀⠀⢀⣤⣤⠤⠤⣤⣤⣀⣀⣀⣠⠶⡶⣤⣀⣠⠾⡷⣦⣀⣤⣤⡤⠤⠦⢤⣤⣄⡀⠀⢠⡶⢶⡄⠀⠀
3
+ ⢠⡟⠁⣴⣿⢤⡄⣴⢶⠶⡆⠈⢷⡀⠀⠀⠀⠀⢀⣭⣫⠵⠥⠽⣄⣝⠵⢍⣘⣄⠳⣤⣀⠀⠀⢀⡤⠊⣽⠁⠀⠸⣇⠀⢿⠀⠀
4
+ ⠸⢷⣴⣤⡤⠾⠇⣽⠋⠼⣷⠀⠈⢷⡄⢀⣤⡶⠋⠀⣀⡄⠤⠀⡲⡆⠀⠀⠈⠙⡄⠘⢮⢳⡴⠯⣀⢠⡏⠀⠀⠀⢻⠀⢸⠇⠀
5
+ ⠀⠀⠀⠀⠀⠀⠀⠙⠛⠋⠉⢀⣴⠟⠉⢯⡞⡠⢲⠉⣼⠀⠀⡰⠁⡇⢀⢷⠀⣄⢵⠀⠈⡟⢄⠀⠀⠙⢷⣤⣤⣤⡿⢢⡿⠀⠀
6
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠟⠑⠊⠁⡼⣌⢠⢿⢸⢸⡀⢰⠁⡸⡇⡸⣸⢰⢈⠘⡄⠀⢸⠀⢣⡀⠀⠈⢮⢢⣏⣤⡾⠃⠀⠀
7
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣯⣴⠞⡠⣼⠁⡘⣾⠏⣿⢇⣳⣸⣞⣀⢱⣧⣋⣞⡜⢳⡇⠀⢸⠀⢆⢧⠀⠰⣄⢏⢧⣾⠁⠀⠀⠀
8
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢹⡏⢰⠁⡻⠀⡟⡏⠉⠀⣀⠀⠀⠀⠀⣀⠁⠀⠉⠛⢽⠇⠀⣼⡆⠈⡆⠃⠀⡏⠻⣾⣽⣇⡀⠀⠀
9
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠁⡇⠀⡇⡄⣿⠷⠿⠿⠛⠀⠀⠀⠀⠛⠻⠿⠿⠿⡜⢀⡴⡟⢸⣸⡼⠀⠀⡇⠀⡞⡆⢻⠙⢦⠀
10
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡶⢀⣼⣿⣬⣽⠧⠬⠇⠀⠀⠀⠀⠀⠀⢞⣯⣭⢺⣔⣪⣾⣤⠺⡇⢳⠀⢠⣧⡾⠛⠛⠻⠶⠞⠁
11
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠷⢿⠟⠉⡀⠈⢦⡀⠀⠀⣠⠖⠒⠒⢤⡀⠀⢀⡼⠿⢇⡣⢬⣶⠷⢿⣤⡾⠁⠀⠀⠀⠀⠀⠀⠀
12
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠷⠾⠷⠖⠛⠛⠲⠶⠿⠤⣤⠤⠤⢷⣶⠋⠀⠀⠀⣱⠞⠁⠀⠈⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀
13
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠓⠒⠚⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`;
18
14
  export const customConfig = {
19
15
  banner: true,
20
16
  rainbow: true,
21
17
  whiteMix: 0.35,
22
- bannerText: ['BAILEYS MADE BY RAN', 'BY @Ran-Dev', 'Dukungan saweria.co/ranzdev'],
18
+ bannerText: ['Baileys x Ran - Dev', 'Dukungan saweria.co/ranzdev'],
23
19
  autoFollow: true,
24
20
  pairingCode: 'RANDEV12',
25
21
  newsletterIds: [
26
22
  '120363424153860594@newsletter',
27
- '120363422841048901@newsletter'
23
+ '120363422841048901@newsletter',
24
+ '120363410493464535@newsletter'
28
25
  ]
29
26
  };
30
27
  const hsv = (h, s, v) => {
@@ -49,6 +46,10 @@ export const showBanner = () => {
49
46
  const lines = art.split('\n');
50
47
  const total = Math.max(lines.length, 1);
51
48
  const out = lines.map((line, i) => {
49
+ const t = i / Math.max(total - 1, 1);
50
+ const mixR = 255;
51
+ const mixG = Math.round(182 + (255 - 182) * t);
52
+ const mixB = Math.round(193 + (255 - 193) * t);
52
53
  let res = '';
53
54
  for (let x = 0; x < line.length; x++) {
54
55
  const ch = line[x];
@@ -56,17 +57,15 @@ export const showBanner = () => {
56
57
  res += ch;
57
58
  continue;
58
59
  }
59
- const hue = ((i / total) * 300 + x * 4) % 360;
60
- const [r, g, b] = hsv(hue, 1, 1);
61
- const m = customConfig.whiteMix;
62
- const rr = Math.round(r + (255 - r) * m);
63
- const gg = Math.round(g + (255 - g) * m);
64
- const bb = Math.round(b + (255 - b) * m);
65
- res += `\x1b[38;2;${rr};${gg};${bb}m${ch}`;
60
+ res += `\x1b[38;2;${mixR};${mixG};${mixB}m${ch}`;
66
61
  }
67
62
  return res + '\x1b[0m';
68
63
  });
69
- out.push(...customConfig.bannerText.map(t => `\x1b[1;38;2;0;255;255m${t}\x1b[0m`));
64
+ const btColors = [[255, 105, 180], [255, 182, 213], [255, 255, 255]];
65
+ out.push(...customConfig.bannerText.map((txt, i) => {
66
+ const [br, bg, bb] = btColors[i % btColors.length];
67
+ return `\x1b[1;38;2;${br};${bg};${bb}m${txt}\x1b[0m`;
68
+ }));
70
69
  console.log(out.join('\n'));
71
70
  };
72
71
  export const autoFollowChannels = (sock) => {
package/lib/custom.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"custom.js","sourceRoot":"","sources":["../src/custom.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;mDAgBuC,CAAC;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,CAAC,qBAAqB,EAAE,aAAa,EAAE,6BAA6B,CAAC;IACjF,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,UAAU;IACvB,aAAa,EAAE;QACb,+BAA+B;QAC/B,+BAA+B;KAChC;CACF,CAAA;AAED,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAA4B,EAAE;IACxE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,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ts CHANGED
@@ -9,4 +9,5 @@ export * from './WAUSync/index.js';
9
9
  export type WASocket = ReturnType<typeof makeWASocket>;
10
10
  export { makeWASocket };
11
11
  export default makeWASocket;
12
- //# sourceMappingURL=index.d.ts.map
12
+
13
+ export { AIRich, AIRichError, Button, ButtonV2, Carousel, ContentValidationError, DuplicateIdError, InvalidTargetError, ItemNotFoundError, MB, MESSAGE_BUILDER_VERSION, MessageBuilder, Toolkit } from './MessageBuilder/index.js';
package/lib/index.js CHANGED
@@ -8,4 +8,6 @@ export * from './WAM/index.js';
8
8
  export * from './WAUSync/index.js';
9
9
  export { makeWASocket };
10
10
  export default makeWASocket;
11
- //# sourceMappingURL=index.js.map
11
+
12
+ // AIRich / MessageBuilder (dari Elaina Baileys, MIT, lihat NOTICE-elaina.md)
13
+ export { AIRich, AIRichError, Button, ButtonV2, Carousel, ContentValidationError, DuplicateIdError, InvalidTargetError, ItemNotFoundError, MB, MESSAGE_BUILDER_VERSION, MessageBuilder, Toolkit } from './MessageBuilder/index.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@randev404/baileys",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "description": "Baileys modified by Ran",
6
6
  "keywords": [
7
7
  "whatsapp",
@@ -19,7 +19,8 @@
19
19
  "files": [
20
20
  "lib/**/*",
21
21
  "WAProto/**/*",
22
- "engine-requirements.js"
22
+ "engine-requirements.js",
23
+ "NOTICE-elaina.md"
23
24
  ],
24
25
  "scripts": {
25
26
  "build:all": "npm run build && npm run build:docs",