@devil-fight/baileys 1.0.4 → 1.0.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.
Files changed (107) hide show
  1. package/README.md +3 -3
  2. package/engine-requirements.js +3 -3
  3. package/lib/Defaults/index.d.ts +53 -0
  4. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  5. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  6. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  7. package/lib/Signal/Group/index.d.ts +11 -0
  8. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  9. package/lib/Signal/Group/queue-job.d.ts +1 -0
  10. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  11. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  12. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  13. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  14. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  15. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  16. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  17. package/lib/Signal/libsignal.d.ts +3 -0
  18. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  19. package/lib/Socket/Client/index.d.ts +3 -0
  20. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  21. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  22. package/lib/Socket/business.d.ts +171 -0
  23. package/lib/Socket/chats.d.ts +267 -0
  24. package/lib/Socket/chats.js +16 -48
  25. package/lib/Socket/dugong.d.ts +254 -0
  26. package/lib/Socket/dugong.js +8 -164
  27. package/lib/Socket/groups.d.ts +115 -0
  28. package/lib/Socket/index.d.ts +173 -0
  29. package/lib/Socket/messages-recv.d.ts +161 -0
  30. package/lib/Socket/messages-send.d.ts +149 -0
  31. package/lib/Socket/messages-send.js +210 -132
  32. package/lib/Socket/newsletter.d.ts +134 -0
  33. package/lib/Socket/newsletter.js +29 -148
  34. package/lib/Socket/registration.d.ts +267 -0
  35. package/lib/Socket/socket.d.ts +43 -0
  36. package/lib/Socket/socket.js +2 -2
  37. package/lib/Socket/usync.d.ts +36 -0
  38. package/lib/Store/index.d.ts +3 -0
  39. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  40. package/lib/Store/make-in-memory-store.d.ts +118 -0
  41. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  42. package/lib/Store/object-repository.d.ts +10 -0
  43. package/lib/Types/Auth.d.ts +110 -0
  44. package/lib/Types/Call.d.ts +13 -0
  45. package/lib/Types/Chat.d.ts +102 -0
  46. package/lib/Types/Contact.d.ts +19 -0
  47. package/lib/Types/Events.d.ts +157 -0
  48. package/lib/Types/GroupMetadata.d.ts +55 -0
  49. package/lib/Types/Label.d.ts +35 -0
  50. package/lib/Types/LabelAssociation.d.ts +29 -0
  51. package/lib/Types/Message.d.ts +273 -0
  52. package/lib/Types/Newsletter.d.ts +103 -0
  53. package/lib/Types/Product.d.ts +78 -0
  54. package/lib/Types/Signal.d.ts +57 -0
  55. package/lib/Types/Socket.d.ts +111 -0
  56. package/lib/Types/State.d.ts +27 -0
  57. package/lib/Types/USync.d.ts +25 -0
  58. package/lib/Types/index.d.ts +57 -0
  59. package/lib/Utils/auth-utils.d.ts +18 -0
  60. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  61. package/lib/Utils/business.d.ts +22 -0
  62. package/lib/Utils/chat-utils.d.ts +71 -0
  63. package/lib/Utils/crypto.d.ts +41 -0
  64. package/lib/Utils/decode-wa-message.d.ts +19 -0
  65. package/lib/Utils/event-buffer.d.ts +35 -0
  66. package/lib/Utils/generics.d.ts +92 -0
  67. package/lib/Utils/generics.js +5 -80
  68. package/lib/Utils/history.d.ts +15 -0
  69. package/lib/Utils/index.d.ts +17 -0
  70. package/lib/Utils/link-preview.d.ts +21 -0
  71. package/lib/Utils/logger.d.ts +4 -0
  72. package/lib/Utils/lt-hash.d.ts +12 -0
  73. package/lib/Utils/make-mutex.d.ts +7 -0
  74. package/lib/Utils/messages-media.d.ts +116 -0
  75. package/lib/Utils/messages.d.ts +77 -0
  76. package/lib/Utils/messages.js +33 -4
  77. package/lib/Utils/noise-handler.d.ts +21 -0
  78. package/lib/Utils/process-message.d.ts +41 -0
  79. package/lib/Utils/signal.d.ts +32 -0
  80. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  81. package/lib/Utils/validate-connection.d.ts +11 -0
  82. package/lib/WABinary/constants.d.ts +30 -0
  83. package/lib/WABinary/decode.d.ts +7 -0
  84. package/lib/WABinary/encode.d.ts +3 -0
  85. package/lib/WABinary/generic-utils.d.ts +17 -0
  86. package/lib/WABinary/index.d.ts +5 -0
  87. package/lib/WABinary/jid-utils.d.ts +31 -0
  88. package/lib/WABinary/types.d.ts +18 -0
  89. package/lib/WAM/BinaryInfo.d.ts +17 -0
  90. package/lib/WAM/constants.d.ts +38 -0
  91. package/lib/WAM/encode.d.ts +3 -0
  92. package/lib/WAM/index.d.ts +3 -0
  93. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  94. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  95. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  96. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  97. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  98. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  99. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  100. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  101. package/lib/WAUSync/USyncUser.d.ts +12 -0
  102. package/lib/WAUSync/index.d.ts +3 -0
  103. package/lib/index.d.ts +12 -0
  104. package/lib/index.js +34 -1
  105. package/package.json +4 -3
  106. package/LICENSE +0 -21
  107. package/lib/Defaults/information.json +0 -1
@@ -0,0 +1,9 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ import { USyncUser } from '../USyncUser';
4
+ export declare class USyncContactProtocol implements USyncQueryProtocol {
5
+ name: string;
6
+ getQueryElement(): BinaryNode;
7
+ getUserElement(user: USyncUser): BinaryNode;
8
+ parser(node: BinaryNode): boolean;
9
+ }
@@ -0,0 +1,22 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type KeyIndexData = {
4
+ timestamp: number;
5
+ signedKeyIndex?: Uint8Array;
6
+ expectedTimestamp?: number;
7
+ };
8
+ export type DeviceListData = {
9
+ id: number;
10
+ keyIndex?: number;
11
+ isHosted?: boolean;
12
+ };
13
+ export type ParsedDeviceInfo = {
14
+ deviceList?: DeviceListData[];
15
+ keyIndex?: KeyIndexData;
16
+ };
17
+ export declare class USyncDeviceProtocol implements USyncQueryProtocol {
18
+ name: string;
19
+ getQueryElement(): BinaryNode;
20
+ getUserElement(): BinaryNode | null;
21
+ parser(node: BinaryNode): ParsedDeviceInfo;
22
+ }
@@ -0,0 +1,12 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type DisappearingModeData = {
4
+ duration: number;
5
+ setAt?: Date;
6
+ };
7
+ export declare class USyncDisappearingModeProtocol implements USyncQueryProtocol {
8
+ name: string;
9
+ getQueryElement(): BinaryNode;
10
+ getUserElement(): null;
11
+ parser(node: BinaryNode): DisappearingModeData | undefined;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export type StatusData = {
4
+ status?: string | null;
5
+ setAt?: Date;
6
+ };
7
+ export declare class USyncStatusProtocol implements USyncQueryProtocol {
8
+ name: string;
9
+ getQueryElement(): BinaryNode;
10
+ getUserElement(): null;
11
+ parser(node: BinaryNode): StatusData | undefined;
12
+ }
@@ -0,0 +1,25 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ import { USyncUser } from '../USyncUser';
4
+ export type BotProfileCommand = {
5
+ name: string;
6
+ description: string;
7
+ };
8
+ export type BotProfileInfo = {
9
+ jid: string;
10
+ name: string;
11
+ attributes: string;
12
+ description: string;
13
+ category: string;
14
+ isDefault: boolean;
15
+ prompts: string[];
16
+ personaId: string;
17
+ commands: BotProfileCommand[];
18
+ commandsDescription: string;
19
+ };
20
+ export declare class USyncBotProfileProtocol implements USyncQueryProtocol {
21
+ name: string;
22
+ getQueryElement(): BinaryNode;
23
+ getUserElement(user: USyncUser): BinaryNode;
24
+ parser(node: BinaryNode): BotProfileInfo;
25
+ }
@@ -0,0 +1,8 @@
1
+ import { USyncQueryProtocol } from '../../Types/USync';
2
+ import { BinaryNode } from '../../WABinary';
3
+ export declare class USyncLIDProtocol implements USyncQueryProtocol {
4
+ name: string;
5
+ getQueryElement(): BinaryNode;
6
+ getUserElement(): null;
7
+ parser(node: BinaryNode): string | null;
8
+ }
@@ -0,0 +1,4 @@
1
+ export * from './USyncDeviceProtocol';
2
+ export * from './USyncContactProtocol';
3
+ export * from './USyncStatusProtocol';
4
+ export * from './USyncDisappearingModeProtocol';
@@ -0,0 +1,28 @@
1
+ import { USyncQueryProtocol } from '../Types/USync';
2
+ import { BinaryNode } from '../WABinary';
3
+ import { USyncUser } from './USyncUser';
4
+ export type USyncQueryResultList = {
5
+ [protocol: string]: unknown;
6
+ id: string;
7
+ };
8
+ export type USyncQueryResult = {
9
+ list: USyncQueryResultList[];
10
+ sideList: USyncQueryResultList[];
11
+ };
12
+ export declare class USyncQuery {
13
+ protocols: USyncQueryProtocol[];
14
+ users: USyncUser[];
15
+ context: string;
16
+ mode: string;
17
+ constructor();
18
+ withMode(mode: string): this;
19
+ withContext(context: string): this;
20
+ withUser(user: USyncUser): this;
21
+ parseUSyncQueryResult(result: BinaryNode): USyncQueryResult | undefined;
22
+ withDeviceProtocol(): this;
23
+ withContactProtocol(): this;
24
+ withStatusProtocol(): this;
25
+ withDisappearingModeProtocol(): this;
26
+ withBotProfileProtocol(): this;
27
+ withLIDProtocol(): this;
28
+ }
@@ -0,0 +1,12 @@
1
+ export declare class USyncUser {
2
+ id: string;
3
+ lid: string;
4
+ phone: string;
5
+ type: string;
6
+ personaId: string;
7
+ withId(id: string): this;
8
+ withLid(lid: string): this;
9
+ withPhone(phone: string): this;
10
+ withType(type: string): this;
11
+ withPersonaId(personaId: string): this;
12
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Protocols';
2
+ export * from './USyncQuery';
3
+ export * from './USyncUser';
package/lib/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import makeWASocket from './Socket';
2
+ export * from '../WAProto';
3
+ export * from './Utils';
4
+ export * from './Types';
5
+ export * from './Store';
6
+ export * from './Defaults';
7
+ export * from './WABinary';
8
+ export * from './WAM';
9
+ export * from './WAUSync';
10
+ export type WASocket = ReturnType<typeof makeWASocket>;
11
+ export { makeWASocket };
12
+ export default makeWASocket;
package/lib/index.js CHANGED
@@ -1,5 +1,38 @@
1
1
  "use strict";
2
2
 
3
+ const chalk = require('chalk');
4
+
5
+ console.clear();
6
+
7
+ const banner = `
8
+ ██████╗ ███████╗██╗ ██╗██╗██╗
9
+ ██╔══██╗██╔════╝██║ ██║██║██║
10
+ ██║ ██║█████╗ ██║ ██║██║██║
11
+ ██║ ██║██╔══╝ ╚██╗ ██╔╝██║██║
12
+ ██████╔╝███████╗ ╚████╔╝ ██║███████╗
13
+ ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝╚══════╝
14
+ `;
15
+
16
+ const colors = [
17
+ chalk.red,
18
+ chalk.yellow,
19
+ chalk.green,
20
+ chalk.cyan,
21
+ chalk.blue,
22
+ chalk.magenta
23
+ ];
24
+
25
+ let result = '';
26
+
27
+ for (let i = 0; i < banner.length; i++) {
28
+ const char = banner[i];
29
+ const color = colors[i % colors.length];
30
+ result += char === '\n' ? '\n' : color(char);
31
+ }
32
+
33
+ console.log(result);
34
+
35
+
3
36
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
37
  if (k2 === undefined) k2 = k;
5
38
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -30,4 +63,4 @@ __exportStar(require("./WABinary"), exports);
30
63
  __exportStar(require("./WAM"), exports);
31
64
  __exportStar(require("./WAUSync"), exports);
32
65
 
33
- exports.default = Socket_1.default;
66
+ exports.default = Socket_1.default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devil-fight/baileys",
3
- "version": "1.0.4",
4
- "description": " Baileys Modifikasi",
3
+ "version": "1.0.6",
4
+ "description": "WhatsApp API Modification",
5
5
  "keywords": [
6
6
  "whatsapp",
7
7
  "baileys",
@@ -46,10 +46,11 @@
46
46
  "audio-decode": "^2.1.3",
47
47
  "axios": "^1.3.3",
48
48
  "cache-manager": "4.0.1",
49
+ "chalk": "^4.1.2",
49
50
  "futoin-hkdf": "^1.5.1",
50
51
  "libphonenumber-js": "^1.10.20",
51
52
  "lodash": "^4.17.21",
52
- "libsignal": "npm:@devil-fight/libsignal-node",
53
+ "libsignal": "github:DevilFight/libsignal-node",
53
54
  "music-metadata": "^7.12.3",
54
55
  "node-cache": "^5.1.2",
55
56
  "node-fetch": "^2.6.1",
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Devil Fight
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1 +0,0 @@
1
- ["hello world"]