@jiancodes/baileys 1.7.4 → 2.0.3
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/WAProto/index.js +131281 -59270
- package/lib/Defaults/baileys-version.json +3 -1
- package/lib/Defaults/index.d.ts +53 -0
- package/lib/Defaults/index.js +6 -6
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/group-session-builder.d.ts +14 -0
- package/lib/Signal/Group/group_cipher.d.ts +17 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/keyhelper.d.ts +10 -0
- package/lib/Signal/Group/queue-job.d.ts +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/lib/Signal/Group/sender-key-message.d.ts +18 -0
- package/lib/Signal/Group/sender-key-name.d.ts +17 -0
- package/lib/Signal/Group/sender-key-record.d.ts +30 -0
- package/lib/Signal/Group/sender-key-state.d.ts +38 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/libsignal.d.ts +3 -0
- package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/web-socket-client.d.ts +12 -0
- package/lib/Socket/business.d.ts +171 -0
- package/lib/Socket/chats.d.ts +267 -0
- package/lib/Socket/chats.js +28 -15
- package/lib/Socket/dugong.d.ts +254 -0
- package/lib/Socket/dugong.js +484 -0
- package/lib/Socket/groups.d.ts +115 -0
- package/lib/Socket/index.d.ts +173 -0
- package/lib/Socket/messages-recv.d.ts +161 -0
- package/lib/Socket/messages-send.js +14 -21
- package/lib/Socket/newsletter.d.ts +134 -0
- package/lib/Socket/newsletter.js +25 -3
- package/lib/Socket/newsletter.js.bak +351 -0
- package/lib/Socket/registration.d.ts +267 -0
- package/lib/Socket/socket.d.ts +43 -0
- package/lib/Socket/socket.js +1 -1
- package/lib/Socket/usync.d.ts +36 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/make-cache-manager-store.d.ts +13 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Types/Auth.d.ts +110 -0
- package/lib/Types/Call.d.ts +13 -0
- package/lib/Types/Contact.d.ts +19 -0
- package/lib/Types/Events.d.ts +157 -0
- package/lib/Types/GroupMetadata.d.ts +55 -0
- package/lib/Types/Label.d.ts +35 -0
- package/lib/Types/LabelAssociation.d.ts +29 -0
- package/lib/Types/Message.d.ts +273 -0
- package/lib/Types/Newsletter.d.ts +103 -0
- package/lib/Types/Product.d.ts +78 -0
- package/lib/Types/Signal.d.ts +57 -0
- package/lib/Types/Socket.d.ts +111 -0
- package/lib/Types/State.d.ts +27 -0
- package/lib/Types/USync.d.ts +25 -0
- package/lib/Types/index.d.ts +57 -0
- package/lib/Utils/auth-utils.d.ts +18 -0
- package/lib/Utils/baileys-event-stream.d.ts +16 -0
- package/lib/Utils/business.d.ts +22 -0
- package/lib/Utils/chat-utils.d.ts +71 -0
- package/lib/Utils/crypto.d.ts +41 -0
- package/lib/Utils/decode-wa-message.d.ts +19 -0
- package/lib/Utils/event-buffer.d.ts +35 -0
- package/lib/Utils/generics.d.ts +92 -0
- package/lib/Utils/generics.js +80 -5
- package/lib/Utils/history.d.ts +15 -0
- package/lib/Utils/index.d.ts +17 -0
- package/lib/Utils/link-preview.d.ts +21 -0
- package/lib/Utils/logger.d.ts +4 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/messages-media.d.ts +116 -0
- package/lib/Utils/messages.d.ts +77 -0
- package/lib/Utils/messages.js +0 -32
- package/lib/Utils/noise-handler.d.ts +21 -0
- package/lib/Utils/process-message.d.ts +41 -0
- package/lib/Utils/signal.d.ts +32 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
- package/lib/Utils/validate-connection.d.ts +11 -0
- package/lib/WABinary/constants.d.ts +30 -0
- package/lib/WABinary/decode.d.ts +7 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/generic-utils.d.ts +17 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/jid-utils.d.ts +31 -0
- package/lib/WABinary/types.d.ts +18 -0
- package/lib/WAM/BinaryInfo.d.ts +17 -0
- package/lib/WAM/constants.d.ts +38 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
- package/lib/WAUSync/Protocols/index.d.ts +4 -0
- package/lib/WAUSync/USyncQuery.d.ts +28 -0
- package/lib/WAUSync/USyncUser.d.ts +12 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +17 -10
- package/package.json +13 -10
- package/WAProto/fix-import.js +0 -29
- package/lib/Socket/luxu.js +0 -620
|
@@ -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
|
+
}
|
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
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
console.log(chalk.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
console.log(chalk.magentaBright(`
|
|
6
|
+
/$$$$$ /$$ /$$ /$$
|
|
7
|
+
|__ $$|__/ | $$ / $$
|
|
8
|
+
| $$ /$$ /$$$$$$ /$$$$$$$ | $$/ $$/ /$$$$$$
|
|
9
|
+
| $$| $$ |____ $$| $$__ $$ \ $$$$/ /$$__ $$
|
|
10
|
+
/$$ | $$| $$ /$$$$$$$| $$ \ $$ >$$ $$ | $$$$$$$$
|
|
11
|
+
| $$ | $$| $$ /$$__ $$| $$ | $$ /$$/\ $$| $$_____/
|
|
12
|
+
| $$$$$$/| $$| $$$$$$$| $$ | $$| $$ \ $$| $$$$$$$
|
|
13
|
+
\______/ |__/ \_______/|__/ |__/|__/ |__/ \_______/
|
|
14
|
+
|
|
15
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
12
16
|
`));
|
|
13
|
-
console.log(chalk.
|
|
14
|
-
console.log(chalk.
|
|
17
|
+
console.log(chalk.redBright(` Holla \n`));
|
|
18
|
+
console.log(chalk.magentaBright(" Telegram: ") + chalk.redBright("@JianCode"));
|
|
19
|
+
console.log(chalk.magenta(`\n✰──────────────────────────────────────✰\n`));
|
|
20
|
+
|
|
21
|
+
|
|
15
22
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
23
|
if (k2 === undefined) k2 = k;
|
|
17
24
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -42,4 +49,4 @@ __exportStar(require("./WABinary"), exports);
|
|
|
42
49
|
__exportStar(require("./WAM"), exports);
|
|
43
50
|
__exportStar(require("./WAUSync"), exports);
|
|
44
51
|
|
|
45
|
-
exports.default = Socket_1.default;
|
|
52
|
+
exports.default = Socket_1.default;
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiancodes/baileys",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "WhatsApp
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"description": "WhatsApp API Modification By J",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"whatsapp
|
|
6
|
+
"whatsapp",
|
|
7
|
+
"laurine-wabot",
|
|
8
|
+
"baileys",
|
|
9
|
+
"whatsapp-web",
|
|
10
|
+
"whatsapp-chat",
|
|
11
|
+
"whatsapp-group",
|
|
12
|
+
"botwa"
|
|
7
13
|
],
|
|
8
|
-
"homepage": "https://github.com/jiancodes/baileys",
|
|
14
|
+
"homepage": "https://github.com/jiancodes/baileys.git",
|
|
9
15
|
"repository": {
|
|
10
16
|
"url": "https://github.com/jiancodes/baileys"
|
|
11
17
|
},
|
|
12
18
|
"license": "MIT",
|
|
13
|
-
"author": "
|
|
19
|
+
"author": "Adhiraj Singh",
|
|
14
20
|
"main": "lib/index.js",
|
|
15
21
|
"types": "lib/index.d.ts",
|
|
16
22
|
"files": [
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"futoin-hkdf": "^1.5.1",
|
|
46
52
|
"libphonenumber-js": "^1.10.20",
|
|
47
53
|
"lodash": "^4.17.21",
|
|
48
|
-
"libsignal": "github:
|
|
54
|
+
"libsignal": "github:tenka-san/libsignal-node",
|
|
49
55
|
"music-metadata": "^7.12.3",
|
|
50
56
|
"node-cache": "^5.1.2",
|
|
51
57
|
"node-fetch": "^2.6.1",
|
|
@@ -73,7 +79,7 @@
|
|
|
73
79
|
"ts-jest": "^27.0.3",
|
|
74
80
|
"ts-node": "^10.8.1",
|
|
75
81
|
"typedoc": "^0.24.7",
|
|
76
|
-
"typescript": "^4.6.4",
|
|
82
|
+
"typescript": "^4.6.4",
|
|
77
83
|
"json": "^11.0.0"
|
|
78
84
|
},
|
|
79
85
|
"peerDependencies": {
|
|
@@ -99,8 +105,5 @@
|
|
|
99
105
|
"packageManager": "yarn@1.22.19",
|
|
100
106
|
"engines": {
|
|
101
107
|
"node": ">=20.0.0"
|
|
102
|
-
},
|
|
103
|
-
"bugs": {
|
|
104
|
-
"url": "https://github.com/jiancodes/baileys/issues"
|
|
105
108
|
}
|
|
106
109
|
}
|
package/WAProto/fix-import.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const { readFileSync, writeFileSync } = require 'fs';
|
|
2
|
-
const { exit } = require 'process';
|
|
3
|
-
|
|
4
|
-
const filePath = './index.js';
|
|
5
|
-
|
|
6
|
-
try {
|
|
7
|
-
// Read the file
|
|
8
|
-
let content = readFileSync(filePath, 'utf8');
|
|
9
|
-
|
|
10
|
-
// Fix the import statement
|
|
11
|
-
content = content.replace(
|
|
12
|
-
/import \* as (\$protobuf) from/g,
|
|
13
|
-
'import $1 from'
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
// add missing extension to the import
|
|
17
|
-
content = content.replace(
|
|
18
|
-
/(['"])protobufjs\/minimal(['"])/g,
|
|
19
|
-
'$1protobufjs/minimal.js$2'
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
// Write back
|
|
23
|
-
writeFileSync(filePath, content, 'utf8');
|
|
24
|
-
|
|
25
|
-
console.log(`✅ Fixed imports in ${filePath}`);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.error(`❌ Error fixing imports: ${error.message}`);
|
|
28
|
-
exit(1);
|
|
29
|
-
}
|