@badzz88/baileys 8.5.6 → 8.5.7
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/README.md +2 -2
- package/WAProto/WAProto.proto +75 -1256
- package/WAProto/fix-imports.js +79 -69
- package/WAProto/index.d.ts +71491 -15254
- package/WAProto/index.js +126432 -19810
- package/engine-requirements.js +4 -3
- package/lib/Defaults/index.js +187 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.js +92 -0
- package/lib/Signal/Group/group_cipher.js +89 -0
- package/lib/Signal/Group/index.js +136 -0
- package/lib/Signal/Group/keyhelper.js +73 -0
- package/lib/Signal/Group/sender-chain-key.js +32 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.js +50 -0
- package/lib/Signal/Group/sender-key-record.js +44 -0
- package/lib/Signal/Group/sender-key-state.js +97 -0
- package/lib/Signal/Group/sender-message-key.js +30 -0
- package/lib/Signal/libsignal.js +459 -0
- package/lib/Signal/lid-mapping.js +260 -0
- package/lib/Socket/Client/index.js +30 -0
- package/lib/Socket/Client/types.js +13 -0
- package/lib/Socket/Client/websocket.js +62 -0
- package/lib/Socket/aigroups.js +240 -0
- package/lib/Socket/business.js +422 -0
- package/lib/Socket/chats.js +1816 -0
- package/lib/Socket/communities.js +549 -0
- package/lib/Socket/graphql.js +656 -0
- package/lib/Socket/groups.js +764 -0
- package/lib/Socket/index.js +39 -0
- package/lib/Socket/interactive-handler.js +522 -0
- package/lib/Socket/interop.js +549 -0
- package/{src → lib}/Socket/luxu.js +120 -82
- package/lib/Socket/managed-account.js +183 -0
- package/lib/Socket/messages-recv.js +2442 -0
- package/lib/Socket/messages-send.js +1853 -0
- package/lib/Socket/mex.js +60 -0
- package/lib/Socket/newsletter.js +818 -0
- package/lib/Socket/privacy.js +449 -0
- package/lib/Socket/registration.js +427 -0
- package/lib/Socket/socket.js +1092 -0
- package/lib/Socket/text-router.js +83 -0
- package/lib/Socket/username.js +243 -0
- package/lib/Store/index.js +36 -0
- package/{src → lib}/Store/keyed-db.js +11 -21
- package/lib/Store/make-cache-manager-store.js +90 -0
- package/lib/Store/make-in-memory-store.js +604 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.js +29 -0
- package/lib/Types/Auth.js +38 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +4 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.js +9 -0
- package/lib/Types/Message.js +95 -0
- package/lib/Types/Mex.js +112 -0
- package/lib/Types/Newsletter.js +121 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +70 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +55 -0
- package/lib/Utils/auth-utils.js +306 -0
- package/lib/Utils/browser-utils.js +114 -0
- package/lib/Utils/business.js +247 -0
- package/lib/Utils/chat-utils.js +1208 -0
- package/lib/Utils/command-loader.d.ts +31 -0
- package/lib/Utils/command-loader.js +100 -0
- package/lib/Utils/companion-reg-client-utils.js +42 -0
- package/lib/Utils/consumer-application.js +107 -0
- package/lib/Utils/crypto.js +155 -0
- package/lib/Utils/curve25519-js.js +275 -0
- package/lib/Utils/decode-wa-message.js +560 -0
- package/lib/Utils/event-buffer.js +607 -0
- package/lib/Utils/generics.js +563 -0
- package/lib/Utils/group-history.js +60 -0
- package/lib/Utils/history.js +244 -0
- package/lib/Utils/identity-change-handler.js +52 -0
- package/lib/Utils/index.js +57 -0
- package/lib/Utils/jid-display-normalization.js +218 -0
- package/lib/Utils/link-preview.js +143 -0
- package/lib/Utils/logger.js +9 -0
- package/lib/Utils/lt-hash.js +39 -0
- package/lib/Utils/make-mutex.js +36 -0
- package/lib/Utils/message-composer.js +479 -0
- package/lib/Utils/message-retry-manager.js +270 -0
- package/lib/Utils/messages-media.js +896 -0
- package/lib/Utils/messages.js +2904 -0
- package/lib/Utils/meta-ai-msmsg.js +262 -0
- package/lib/Utils/native-bridge.js +82 -0
- package/lib/Utils/noise-handler.js +196 -0
- package/lib/Utils/offline-node-processor.js +42 -0
- package/lib/Utils/pre-key-manager.js +107 -0
- package/lib/Utils/process-message.js +1048 -0
- package/lib/Utils/reporting-utils.js +262 -0
- package/lib/Utils/session-pool.d.ts +16 -0
- package/lib/Utils/session-pool.js +94 -0
- package/lib/Utils/signal.js +224 -0
- package/lib/Utils/stanza-ack.js +40 -0
- package/lib/Utils/sticker.d.ts +17 -0
- package/lib/Utils/sticker.js +145 -0
- package/lib/Utils/sync-action-utils.js +54 -0
- package/lib/Utils/tc-token-utils.js +161 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/validate-connection.js +219 -0
- package/lib/Utils/view-once-cache.d.ts +9 -0
- package/lib/Utils/view-once-cache.js +79 -0
- package/lib/Utils/voip-rekey.js +22 -0
- package/lib/WABinary/constants.js +1304 -0
- package/lib/WABinary/decode.js +343 -0
- package/{src → lib}/WABinary/encode.js +12 -9
- package/lib/WABinary/generic-utils.js +240 -0
- package/lib/WABinary/index.js +33 -0
- package/lib/WABinary/jid-utils.js +361 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.js +39486 -0
- package/lib/WAM/encode.js +142 -0
- package/lib/WAM/index.js +31 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +55 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +43 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +59 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +31 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +29 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +39 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +27 -0
- package/lib/WAUSync/Protocols/index.js +39 -0
- package/lib/WAUSync/USyncQuery.js +133 -0
- package/lib/WAUSync/USyncUser.js +50 -0
- package/lib/WAUSync/index.js +31 -0
- package/lib/antiban.js +4637 -0
- package/{src → lib}/index.js +49 -51
- package/package.json +4 -4
- package/src/Defaults/index.js +0 -186
- package/src/Signal/Group/ciphertext-message.js +0 -15
- package/src/Signal/Group/group-session-builder.js +0 -86
- package/src/Signal/Group/group_cipher.js +0 -82
- package/src/Signal/Group/index.js +0 -140
- package/src/Signal/Group/keyhelper.js +0 -77
- package/src/Signal/Group/sender-chain-key.js +0 -29
- package/src/Signal/Group/sender-key-distribution-message.js +0 -66
- package/src/Signal/Group/sender-key-message.js +0 -69
- package/src/Signal/Group/sender-key-name.js +0 -51
- package/src/Signal/Group/sender-key-record.js +0 -44
- package/src/Signal/Group/sender-key-state.js +0 -87
- package/src/Signal/Group/sender-message-key.js +0 -29
- package/src/Signal/libsignal.js +0 -455
- package/src/Signal/lid-mapping.js +0 -273
- package/src/Socket/Client/index.js +0 -31
- package/src/Socket/Client/types.js +0 -13
- package/src/Socket/Client/websocket.js +0 -61
- package/src/Socket/aigroups.js +0 -221
- package/src/Socket/business.js +0 -411
- package/src/Socket/chats.js +0 -1449
- package/src/Socket/communities.js +0 -463
- package/src/Socket/graphql.js +0 -523
- package/src/Socket/groups.js +0 -516
- package/src/Socket/index.js +0 -31
- package/src/Socket/interactive-handler.js +0 -527
- package/src/Socket/interop.js +0 -339
- package/src/Socket/managed-account.js +0 -98
- package/src/Socket/messages-recv.js +0 -2685
- package/src/Socket/messages-send.js +0 -2047
- package/src/Socket/mex.js +0 -57
- package/src/Socket/newsletter.js +0 -455
- package/src/Socket/privacy.js +0 -125
- package/src/Socket/registration.js +0 -236
- package/src/Socket/socket.js +0 -983
- package/src/Socket/text-router.js +0 -65
- package/src/Socket/username.js +0 -130
- package/src/Store/index.js +0 -33
- package/src/Store/make-cache-manager-store.js +0 -84
- package/src/Store/make-in-memory-store.js +0 -551
- package/src/Store/make-ordered-dictionary.js +0 -81
- package/src/Store/object-repository.js +0 -26
- package/src/Types/Auth.js +0 -31
- package/src/Types/Bussines.js +0 -2
- package/src/Types/Call.js +0 -2
- package/src/Types/Chat.js +0 -4
- package/src/Types/Contact.js +0 -2
- package/src/Types/Events.js +0 -2
- package/src/Types/GroupMetadata.js +0 -2
- package/src/Types/Label.js +0 -26
- package/src/Types/LabelAssociation.js +0 -8
- package/src/Types/Message.js +0 -93
- package/src/Types/Mex.js +0 -112
- package/src/Types/Newsletter.js +0 -109
- package/src/Types/Product.js +0 -2
- package/src/Types/Signal.js +0 -2
- package/src/Types/Socket.js +0 -2
- package/src/Types/State.js +0 -62
- package/src/Types/USync.js +0 -2
- package/src/Types/index.js +0 -56
- package/src/Utils/auth-utils.js +0 -254
- package/src/Utils/browser-utils.js +0 -112
- package/src/Utils/business.js +0 -240
- package/src/Utils/chat-utils.js +0 -1230
- package/src/Utils/command-loader.d.ts +0 -27
- package/src/Utils/command-loader.js +0 -89
- package/src/Utils/companion-reg-client-utils.js +0 -40
- package/src/Utils/consumer-application.js +0 -105
- package/src/Utils/crypto.js +0 -118
- package/src/Utils/curve25519-js.js +0 -242
- package/src/Utils/decode-wa-message.js +0 -529
- package/src/Utils/event-buffer.js +0 -580
- package/src/Utils/generics.js +0 -483
- package/src/Utils/group-history.js +0 -44
- package/src/Utils/history.js +0 -232
- package/src/Utils/identity-change-handler.js +0 -52
- package/src/Utils/index.js +0 -58
- package/src/Utils/jid-display-normalization.js +0 -195
- package/src/Utils/link-preview.js +0 -135
- package/src/Utils/logger.js +0 -8
- package/src/Utils/lt-hash.js +0 -25
- package/src/Utils/make-mutex.js +0 -36
- package/src/Utils/message-composer.js +0 -471
- package/src/Utils/message-retry-manager.js +0 -217
- package/src/Utils/messages-media.js +0 -843
- package/src/Utils/messages.js +0 -2817
- package/src/Utils/meta-ai-msmsg.js +0 -222
- package/src/Utils/native-bridge.js +0 -68
- package/src/Utils/noise-handler.js +0 -169
- package/src/Utils/offline-node-processor.js +0 -34
- package/src/Utils/pre-key-manager.js +0 -90
- package/src/Utils/process-message.js +0 -950
- package/src/Utils/reporting-utils.js +0 -261
- package/src/Utils/session-pool.d.ts +0 -14
- package/src/Utils/session-pool.js +0 -70
- package/src/Utils/signal.js +0 -217
- package/src/Utils/stanza-ack.js +0 -30
- package/src/Utils/sticker.d.ts +0 -13
- package/src/Utils/sticker.js +0 -123
- package/src/Utils/sync-action-utils.js +0 -45
- package/src/Utils/tc-token-utils.js +0 -158
- package/src/Utils/use-multi-file-auth-state.js +0 -111
- package/src/Utils/validate-connection.js +0 -209
- package/src/Utils/view-once-cache.d.ts +0 -12
- package/src/Utils/view-once-cache.js +0 -63
- package/src/Utils/voip-rekey.js +0 -22
- package/src/WABinary/constants.js +0 -1304
- package/src/WABinary/decode.js +0 -342
- package/src/WABinary/generic-utils.js +0 -238
- package/src/WABinary/index.js +0 -34
- package/src/WABinary/jid-utils.js +0 -351
- package/src/WABinary/types.js +0 -2
- package/src/WAM/BinaryInfo.js +0 -13
- package/src/WAM/constants.js +0 -39484
- package/src/WAM/encode.js +0 -149
- package/src/WAM/index.js +0 -32
- package/src/WAUSync/Protocols/USyncBotProfileProtocol.js +0 -53
- package/src/WAUSync/Protocols/USyncBusinessProtocol.js +0 -44
- package/src/WAUSync/Protocols/USyncContactProtocol.js +0 -55
- package/src/WAUSync/Protocols/USyncDeviceProtocol.js +0 -55
- package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -31
- package/src/WAUSync/Protocols/USyncFeatureProtocol.js +0 -54
- package/src/WAUSync/Protocols/USyncLIDProtocol.js +0 -32
- package/src/WAUSync/Protocols/USyncNewsletterProtocol.js +0 -473
- package/src/WAUSync/Protocols/USyncPictureProtocol.js +0 -34
- package/src/WAUSync/Protocols/USyncSidelistProtocol.js +0 -29
- package/src/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
- package/src/WAUSync/Protocols/USyncTextStatusProtocol.js +0 -38
- package/src/WAUSync/Protocols/USyncUsernameProtocol.js +0 -28
- package/src/WAUSync/Protocols/index.js +0 -40
- package/src/WAUSync/USyncQuery.js +0 -126
- package/src/WAUSync/USyncUser.js +0 -50
- package/src/WAUSync/index.js +0 -32
- package/src/antiban.js +0 -4152
- /package/{src → lib}/Defaults/phonenumber-mcc.json +0 -0
package/{src → lib}/index.js
RENAMED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
34
|
-
exports.makeWASocket = void 0
|
|
35
|
-
const chalk = require('chalk')
|
|
1
|
+
'use strict'
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k)
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc)
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k
|
|
20
|
+
o[k2] = m[k]
|
|
21
|
+
})
|
|
22
|
+
var __exportStar =
|
|
23
|
+
(this && this.__exportStar) ||
|
|
24
|
+
function (m, exports) {
|
|
25
|
+
for (var p in m)
|
|
26
|
+
if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
27
|
+
}
|
|
28
|
+
var __importDefault =
|
|
29
|
+
(this && this.__importDefault) ||
|
|
30
|
+
function (mod) {
|
|
31
|
+
return mod && mod.__esModule ? mod : { default: mod }
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(exports, '__esModule', { value: true })
|
|
34
|
+
exports.makeWASocket = void 0
|
|
35
|
+
const chalk = require('chalk')
|
|
36
36
|
console.log(chalk.bold.gray("-----------------------------------------\n"));
|
|
37
37
|
console.log(chalk.bold.cyan(`
|
|
38
|
-
|
|
39
38
|
⠀⠀⣠⠂⢀⣠⡴⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢤⣄⠀⠐⣄⠀⠀⠀
|
|
40
39
|
⠀⢀⣾⠃⢰⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⡆⠸⣧⠀⠀
|
|
41
40
|
⢀⣾⡇⠀⠘⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⠁⠀⢹⣧⠀
|
|
@@ -54,25 +53,24 @@ console.log(chalk.bold.cyan(`
|
|
|
54
53
|
⠀⠀⠈⠻⣧⡀⠀⠀⢻⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⡟⠀⠀⢀⣾⠟⠁⠀⠀
|
|
55
54
|
⠀⠀⠀⠀⠀⠁⠀⠀⠈⢿⣿⡆⠀⠀⠀⠀⠀⠀⣸⣿⡟⠀⠀⠀⠉⠀⠀⠀⠀⠀
|
|
56
55
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⡄⠀⠀⠀⠀⣰⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
57
|
-
|
|
58
|
-
⠀⠀⠀
|
|
56
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠆⠀⠀⠐⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
59
57
|
¤═―— ⎧ 𝐁𝐀𝐃𝐙𝐙 𝐁𝐀𝐈𝐋𝐄𝐘𝐒 ⎭ ⊱―—═¤
|
|
60
58
|
Information:
|
|
61
59
|
Developer: @badzzne2
|
|
62
|
-
Version: 12.
|
|
60
|
+
Version: 12.3
|
|
63
61
|
Status: Baileys Berhasil Terinstall
|
|
64
|
-
Update date:
|
|
62
|
+
Update date: 18/08/26
|
|
65
63
|
`));
|
|
66
64
|
console.log(chalk.bold.cyan("Follow Our Telegram Channel To See Update Information: t.me/FoxsSql\n"));
|
|
67
65
|
console.log(chalk.bold.gray("--------------------------------------------\n"));
|
|
68
|
-
const index_1 = __importDefault(require('./Socket/index'))
|
|
69
|
-
exports.makeWASocket = index_1.default
|
|
70
|
-
__exportStar(require('../WAProto/index.js'), exports)
|
|
71
|
-
__exportStar(require('./Utils/index'), exports)
|
|
72
|
-
__exportStar(require('./Types/index'), exports)
|
|
73
|
-
__exportStar(require('./Defaults/index'), exports)
|
|
74
|
-
__exportStar(require('./WABinary/index'), exports)
|
|
75
|
-
__exportStar(require('./WAM/index'), exports)
|
|
76
|
-
__exportStar(require('./WAUSync/index'), exports)
|
|
77
|
-
__exportStar(require('./Store/index'), exports)
|
|
78
|
-
exports.default = index_1.default
|
|
66
|
+
const index_1 = __importDefault(require('./Socket/index'))
|
|
67
|
+
exports.makeWASocket = index_1.default
|
|
68
|
+
__exportStar(require('../WAProto/index.js'), exports)
|
|
69
|
+
__exportStar(require('./Utils/index'), exports)
|
|
70
|
+
__exportStar(require('./Types/index'), exports)
|
|
71
|
+
__exportStar(require('./Defaults/index'), exports)
|
|
72
|
+
__exportStar(require('./WABinary/index'), exports)
|
|
73
|
+
__exportStar(require('./WAM/index'), exports)
|
|
74
|
+
__exportStar(require('./WAUSync/index'), exports)
|
|
75
|
+
__exportStar(require('./Store/index'), exports)
|
|
76
|
+
exports.default = index_1.default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@badzz88/baileys",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.7",
|
|
4
4
|
"description": "Baileys Whatsapp Api Modification By Badzz88",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"author": "Badzz88",
|
|
22
|
-
"main": "
|
|
22
|
+
"main": "lib/index.js",
|
|
23
23
|
"files": [
|
|
24
|
-
"
|
|
24
|
+
"lib/**/*",
|
|
25
25
|
"WAProto/**/*",
|
|
26
26
|
"engine-requirements.js"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"ncu": "npm-check-updates",
|
|
30
|
-
"format": "prettier --write \"
|
|
30
|
+
"format": "prettier --write \"lib/**/*.{js,json,md}\"",
|
|
31
31
|
"lint": "tsc && eslint src --ext .js",
|
|
32
32
|
"lint:fix": "npm run format && npm run lint -- --fix",
|
|
33
33
|
"test": "jest --runInBand"
|
package/src/Defaults/index.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __importDefault = (this && this.__importDefault) ||
|
|
3
|
-
function (mod) {
|
|
4
|
-
return mod && mod.__esModule ? mod : { default: mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
|
-
exports.VERSION =
|
|
8
|
-
exports.TimeMs =
|
|
9
|
-
exports.DEFAULT_CACHE_TTLS =
|
|
10
|
-
exports.MIN_UPLOAD_INTERVAL =
|
|
11
|
-
exports.UPLOAD_TIMEOUT =
|
|
12
|
-
exports.INITIAL_PREKEY_COUNT =
|
|
13
|
-
exports.MIN_PREKEY_COUNT =
|
|
14
|
-
exports.MEDIA_KEYS =
|
|
15
|
-
exports.MEDIA_HKDF_KEY_MAPPING =
|
|
16
|
-
exports.MEDIA_PATH_MAP =
|
|
17
|
-
exports.DEFAULT_CONNECTION_CONFIG =
|
|
18
|
-
exports.PROCESSABLE_HISTORY_TYPES =
|
|
19
|
-
exports.WA_CERT_DETAILS =
|
|
20
|
-
exports.URL_REGEX =
|
|
21
|
-
exports.NOISE_WA_HEADER =
|
|
22
|
-
exports.KEY_BUNDLE_TYPE =
|
|
23
|
-
exports.DICT_VERSION =
|
|
24
|
-
exports.NOISE_MODE =
|
|
25
|
-
exports.PLACEHOLDER_MAX_AGE_SECONDS =
|
|
26
|
-
exports.STATUS_EXPIRY_SECONDS =
|
|
27
|
-
exports.WA_DEFAULT_EPHEMERAL =
|
|
28
|
-
exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX =
|
|
29
|
-
exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX =
|
|
30
|
-
exports.WA_ADV_DEVICE_SIG_PREFIX =
|
|
31
|
-
exports.WA_ADV_ACCOUNT_SIG_PREFIX =
|
|
32
|
-
exports.PHONE_CONNECTION_CB =
|
|
33
|
-
exports.DEF_TAG_PREFIX =
|
|
34
|
-
exports.DEF_CALLBACK_PREFIX =
|
|
35
|
-
exports.CALL_AUDIO_PREFIX =
|
|
36
|
-
exports.CALL_VIDEO_PREFIX =
|
|
37
|
-
exports.DEFAULT_ORIGIN =
|
|
38
|
-
exports.UNAUTHORIZED_CODES =
|
|
39
|
-
void 0;
|
|
40
|
-
const index_js_1 = require('../../WAProto/index.js');
|
|
41
|
-
const libsignal_1 = require('../Signal/libsignal');
|
|
42
|
-
const browser_utils_1 = require('../Utils/browser-utils');
|
|
43
|
-
const logger_1 = __importDefault(require('../Utils/logger'));
|
|
44
|
-
const version = [2, 3000, 1041467552];
|
|
45
|
-
exports.VERSION = version;
|
|
46
|
-
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
47
|
-
exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
48
|
-
exports.CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
|
|
49
|
-
exports.CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/';
|
|
50
|
-
exports.DEF_CALLBACK_PREFIX = 'CB:';
|
|
51
|
-
exports.DEF_TAG_PREFIX = 'TAG:';
|
|
52
|
-
exports.PHONE_CONNECTION_CB = 'CB:Pong';
|
|
53
|
-
exports.WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0]);
|
|
54
|
-
exports.WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1]);
|
|
55
|
-
exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 5]);
|
|
56
|
-
exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX = Buffer.from([6, 6]);
|
|
57
|
-
exports.WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60;
|
|
58
|
-
exports.STATUS_EXPIRY_SECONDS = 24 * 60 * 60;
|
|
59
|
-
exports.PLACEHOLDER_MAX_AGE_SECONDS = 14 * 24 * 60 * 60;
|
|
60
|
-
exports.NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0';
|
|
61
|
-
exports.DICT_VERSION = 3;
|
|
62
|
-
exports.KEY_BUNDLE_TYPE = Buffer.from([5]);
|
|
63
|
-
exports.NOISE_WA_HEADER = Buffer.from([87, 65, 6, exports.DICT_VERSION]);
|
|
64
|
-
exports.URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g;
|
|
65
|
-
exports.WA_CERT_DETAILS = {
|
|
66
|
-
SERIAL: 0,
|
|
67
|
-
ISSUER: 'WhatsAppLongTerm1',
|
|
68
|
-
PUBLIC_KEY: Buffer.from('142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b', 'hex')
|
|
69
|
-
};
|
|
70
|
-
exports.HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
71
|
-
exports.PROCESSABLE_HISTORY_TYPES = [
|
|
72
|
-
index_js_1.proto.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
73
|
-
index_js_1.proto.HistorySync.HistorySyncType.PUSH_NAME,
|
|
74
|
-
index_js_1.proto.HistorySync.HistorySyncType.RECENT,
|
|
75
|
-
index_js_1.proto.HistorySync.HistorySyncType.FULL,
|
|
76
|
-
index_js_1.proto.HistorySync.HistorySyncType.ON_DEMAND,
|
|
77
|
-
index_js_1.proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
|
|
78
|
-
index_js_1.proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3
|
|
79
|
-
];
|
|
80
|
-
exports.DEFAULT_CONNECTION_CONFIG = {
|
|
81
|
-
version: version,
|
|
82
|
-
browser: browser_utils_1.Browsers.windows('Firefox'),
|
|
83
|
-
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
84
|
-
connectTimeoutMs: 20000,
|
|
85
|
-
keepAliveIntervalMs: 30000,
|
|
86
|
-
aiLabel: true,
|
|
87
|
-
logger: logger_1.default.child({ class: 'baileys' }),
|
|
88
|
-
emitOwnEvents: true,
|
|
89
|
-
defaultQueryTimeoutMs: 60000,
|
|
90
|
-
customUploadHosts: [],
|
|
91
|
-
retryRequestDelayMs: 250,
|
|
92
|
-
maxMsgRetryCount: 5,
|
|
93
|
-
fireInitQueries: true,
|
|
94
|
-
auth: undefined,
|
|
95
|
-
markOnlineOnConnect: true,
|
|
96
|
-
syncFullHistory: false,
|
|
97
|
-
patchMessageBeforeSending: msg => msg,
|
|
98
|
-
shouldSyncHistoryMessage: ({ syncType }) => {
|
|
99
|
-
return syncType !== index_js_1.proto.HistorySync.HistorySyncType.FULL;
|
|
100
|
-
},
|
|
101
|
-
shouldIgnoreJid: () => false,
|
|
102
|
-
masqueradeAsPrimary: false,
|
|
103
|
-
linkPreviewImageThumbnailWidth: 192,
|
|
104
|
-
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
105
|
-
generateHighQualityLinkPreview: false,
|
|
106
|
-
enableAutoSessionRecreation: true,
|
|
107
|
-
enableRecentMessageCache: true,
|
|
108
|
-
options: {},
|
|
109
|
-
appStateMacVerification: {
|
|
110
|
-
patch: false,
|
|
111
|
-
snapshot: false
|
|
112
|
-
},
|
|
113
|
-
countryCode: 'US',
|
|
114
|
-
getMessage: async () => undefined,
|
|
115
|
-
cachedGroupMetadata: async () => undefined,
|
|
116
|
-
makeSignalRepository: libsignal_1.makeLibSignalRepository,
|
|
117
|
-
maxConcurrentUploads: 3,
|
|
118
|
-
presenceUpdateIntervalMs: 5000,
|
|
119
|
-
groupMetadataCacheTTL: 30 * 60 * 1000,
|
|
120
|
-
useCachedGroupMetadata: false,
|
|
121
|
-
enableCallHistory: false,
|
|
122
|
-
reconnectOnNetworkChange: false
|
|
123
|
-
};
|
|
124
|
-
exports.MEDIA_PATH_MAP = {
|
|
125
|
-
image: '/mms/image',
|
|
126
|
-
video: '/mms/video',
|
|
127
|
-
document: '/mms/document',
|
|
128
|
-
audio: '/mms/audio',
|
|
129
|
-
sticker: '/mms/image',
|
|
130
|
-
'thumbnail-link': '/mms/image',
|
|
131
|
-
'thumbnail-image': '/mms/image',
|
|
132
|
-
'thumbnail-video': '/mms/video',
|
|
133
|
-
'thumbnail-document': '/mms/document',
|
|
134
|
-
'product-catalog-image': '/product/image',
|
|
135
|
-
'md-app-state': '',
|
|
136
|
-
'md-msg-hist': '/mms/md-app-state',
|
|
137
|
-
'biz-cover-photo': '/pps/biz-cover-photo',
|
|
138
|
-
ptv: '/mms/video'
|
|
139
|
-
};
|
|
140
|
-
exports.MEDIA_HKDF_KEY_MAPPING = {
|
|
141
|
-
audio: 'Audio',
|
|
142
|
-
document: 'Document',
|
|
143
|
-
gif: 'Video',
|
|
144
|
-
image: 'Image',
|
|
145
|
-
ppic: '',
|
|
146
|
-
product: 'Image',
|
|
147
|
-
ptt: 'Audio',
|
|
148
|
-
sticker: 'Image',
|
|
149
|
-
video: 'Video',
|
|
150
|
-
'thumbnail-document': 'Document Thumbnail',
|
|
151
|
-
'thumbnail-image': 'Image Thumbnail',
|
|
152
|
-
'thumbnail-video': 'Video Thumbnail',
|
|
153
|
-
'thumbnail-link': 'Link Thumbnail',
|
|
154
|
-
'md-msg-hist': 'History',
|
|
155
|
-
'md-app-state': 'App State',
|
|
156
|
-
'product-catalog-image': 'Product Catalog Image',
|
|
157
|
-
'payment-bg-image': 'Payment Background',
|
|
158
|
-
ptv: 'Video',
|
|
159
|
-
'biz-cover-photo': 'Image',
|
|
160
|
-
location: 'Location',
|
|
161
|
-
contact: 'Contact',
|
|
162
|
-
'voip-token': 'Voip Token'
|
|
163
|
-
};
|
|
164
|
-
exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP);
|
|
165
|
-
exports.MIN_PREKEY_COUNT = 5;
|
|
166
|
-
exports.INITIAL_PREKEY_COUNT = 812;
|
|
167
|
-
exports.UPLOAD_TIMEOUT = 30000;
|
|
168
|
-
exports.MIN_UPLOAD_INTERVAL = 5000;
|
|
169
|
-
exports.DEFAULT_CACHE_TTLS = {
|
|
170
|
-
SIGNAL_STORE: 5 * 60,
|
|
171
|
-
MSG_RETRY: 60 * 60,
|
|
172
|
-
CALL_OFFER: 5 * 60,
|
|
173
|
-
USER_DEVICES: 5 * 60,
|
|
174
|
-
GROUP_METADATA: 30 * 60,
|
|
175
|
-
CALL_SESSION: 10 * 60,
|
|
176
|
-
USYNC_RESULTS: 10 * 60,
|
|
177
|
-
IDENTITY_PROOF: 60 * 60
|
|
178
|
-
};
|
|
179
|
-
exports.TimeMs = {
|
|
180
|
-
Second: 1000,
|
|
181
|
-
Minute: 60 * 1000,
|
|
182
|
-
Hour: 60 * 60 * 1000,
|
|
183
|
-
Day: 24 * 60 * 60 * 1000,
|
|
184
|
-
Week: 7 * 24 * 60 * 60 * 1000,
|
|
185
|
-
Month: 30 * 24 * 60 * 60 * 1000
|
|
186
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
exports.CiphertextMessage = void 0;
|
|
4
|
-
class CiphertextMessage {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.UNSUPPORTED_VERSION = 1;
|
|
7
|
-
this.CURRENT_VERSION = 3;
|
|
8
|
-
this.WHISPER_TYPE = 2;
|
|
9
|
-
this.PREKEY_TYPE = 3;
|
|
10
|
-
this.SENDERKEY_TYPE = 4;
|
|
11
|
-
this.SENDERKEY_DISTRIBUTION_TYPE = 5;
|
|
12
|
-
this.ENCRYPTED_MESSAGE_OVERHEAD = 53;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.CiphertextMessage = CiphertextMessage;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __createBinding = (this && this.__createBinding) ||
|
|
3
|
-
(Object.create
|
|
4
|
-
? function (o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined)
|
|
6
|
-
k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return m[k];
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc);
|
|
17
|
-
}
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined)
|
|
20
|
-
k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
});
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) ||
|
|
24
|
-
(Object.create
|
|
25
|
-
? function (o, v) {
|
|
26
|
-
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
-
}
|
|
28
|
-
: function (o, v) {
|
|
29
|
-
o['default'] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) ||
|
|
32
|
-
(function () {
|
|
33
|
-
var ownKeys = function (o) {
|
|
34
|
-
ownKeys =
|
|
35
|
-
Object.getOwnPropertyNames ||
|
|
36
|
-
function (o) {
|
|
37
|
-
var ar = [];
|
|
38
|
-
for (var k in o)
|
|
39
|
-
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
40
|
-
ar[ar.length] = k;
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
return ownKeys(o);
|
|
44
|
-
};
|
|
45
|
-
return function (mod) {
|
|
46
|
-
if (mod && mod.__esModule)
|
|
47
|
-
return mod;
|
|
48
|
-
var result = {};
|
|
49
|
-
if (mod != null)
|
|
50
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
51
|
-
if (k[i] !== 'default')
|
|
52
|
-
__createBinding(result, mod, k[i]);
|
|
53
|
-
__setModuleDefault(result, mod);
|
|
54
|
-
return result;
|
|
55
|
-
};
|
|
56
|
-
})();
|
|
57
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
58
|
-
exports.GroupSessionBuilder = void 0;
|
|
59
|
-
const keyhelper = __importStar(require('./keyhelper'));
|
|
60
|
-
const sender_key_distribution_message_1 = require('./sender-key-distribution-message');
|
|
61
|
-
class GroupSessionBuilder {
|
|
62
|
-
constructor(senderKeyStore) {
|
|
63
|
-
this.senderKeyStore = senderKeyStore;
|
|
64
|
-
}
|
|
65
|
-
async process(senderKeyName, senderKeyDistributionMessage) {
|
|
66
|
-
const senderKeyRecord = await this.senderKeyStore.loadSenderKey(senderKeyName);
|
|
67
|
-
senderKeyRecord.addSenderKeyState(senderKeyDistributionMessage.getId(), senderKeyDistributionMessage.getIteration(), senderKeyDistributionMessage.getChainKey(), senderKeyDistributionMessage.getSignatureKey());
|
|
68
|
-
await this.senderKeyStore.storeSenderKey(senderKeyName, senderKeyRecord);
|
|
69
|
-
}
|
|
70
|
-
async create(senderKeyName) {
|
|
71
|
-
const senderKeyRecord = await this.senderKeyStore.loadSenderKey(senderKeyName);
|
|
72
|
-
if (senderKeyRecord.isEmpty()) {
|
|
73
|
-
const keyId = keyhelper.generateSenderKeyId();
|
|
74
|
-
const senderKey = keyhelper.generateSenderKey();
|
|
75
|
-
const signingKey = keyhelper.generateSenderSigningKey();
|
|
76
|
-
senderKeyRecord.setSenderKeyState(keyId, 0, senderKey, signingKey);
|
|
77
|
-
await this.senderKeyStore.storeSenderKey(senderKeyName, senderKeyRecord);
|
|
78
|
-
}
|
|
79
|
-
const state = senderKeyRecord.getSenderKeyState();
|
|
80
|
-
if (!state) {
|
|
81
|
-
throw new Error('No session state available');
|
|
82
|
-
}
|
|
83
|
-
return new sender_key_distribution_message_1.SenderKeyDistributionMessage(state.getKeyId(), state.getSenderChainKey().getIteration(), state.getSenderChainKey().getSeed(), state.getSigningKeyPublic());
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.GroupSessionBuilder = GroupSessionBuilder;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
-
exports.GroupCipher = void 0;
|
|
4
|
-
const Crypto_1 = require('../../Utils/crypto');
|
|
5
|
-
const sender_key_message_1 = require('./sender-key-message');
|
|
6
|
-
class GroupCipher {
|
|
7
|
-
constructor(senderKeyStore, senderKeyName) {
|
|
8
|
-
this.senderKeyStore = senderKeyStore;
|
|
9
|
-
this.senderKeyName = senderKeyName;
|
|
10
|
-
}
|
|
11
|
-
async encrypt(paddedPlaintext) {
|
|
12
|
-
const record = await this.senderKeyStore.loadSenderKey(this.senderKeyName);
|
|
13
|
-
if (!record) {
|
|
14
|
-
throw new Error('No SenderKeyRecord found for encryption');
|
|
15
|
-
}
|
|
16
|
-
const senderKeyState = record.getSenderKeyState();
|
|
17
|
-
if (!senderKeyState) {
|
|
18
|
-
throw new Error('No session to encrypt message');
|
|
19
|
-
}
|
|
20
|
-
const iteration = senderKeyState.getSenderChainKey().getIteration();
|
|
21
|
-
const senderKey = this.getSenderKey(senderKeyState, iteration === 0 ? 0 : iteration + 1);
|
|
22
|
-
const ciphertext = await this.getCipherText(senderKey.getIv(), senderKey.getCipherKey(), paddedPlaintext);
|
|
23
|
-
const senderKeyMessage = new sender_key_message_1.SenderKeyMessage(senderKeyState.getKeyId(), senderKey.getIteration(), ciphertext, senderKeyState.getSigningKeyPrivate());
|
|
24
|
-
await this.senderKeyStore.storeSenderKey(this.senderKeyName, record);
|
|
25
|
-
return senderKeyMessage.serialize();
|
|
26
|
-
}
|
|
27
|
-
async decrypt(senderKeyMessageBytes) {
|
|
28
|
-
const record = await this.senderKeyStore.loadSenderKey(this.senderKeyName);
|
|
29
|
-
if (!record) {
|
|
30
|
-
throw new Error('No SenderKeyRecord found for decryption');
|
|
31
|
-
}
|
|
32
|
-
const senderKeyMessage = new sender_key_message_1.SenderKeyMessage(null, null, null, null, senderKeyMessageBytes);
|
|
33
|
-
const senderKeyState = record.getSenderKeyState(senderKeyMessage.getKeyId());
|
|
34
|
-
if (!senderKeyState) {
|
|
35
|
-
throw new Error('No session found to decrypt message');
|
|
36
|
-
}
|
|
37
|
-
senderKeyMessage.verifySignature(senderKeyState.getSigningKeyPublic());
|
|
38
|
-
const senderKey = this.getSenderKey(senderKeyState, senderKeyMessage.getIteration());
|
|
39
|
-
const plaintext = await this.getPlainText(senderKey.getIv(), senderKey.getCipherKey(), senderKeyMessage.getCipherText());
|
|
40
|
-
await this.senderKeyStore.storeSenderKey(this.senderKeyName, record);
|
|
41
|
-
return plaintext;
|
|
42
|
-
}
|
|
43
|
-
getSenderKey(senderKeyState, iteration) {
|
|
44
|
-
let senderChainKey = senderKeyState.getSenderChainKey();
|
|
45
|
-
if (senderChainKey.getIteration() > iteration) {
|
|
46
|
-
if (senderKeyState.hasSenderMessageKey(iteration)) {
|
|
47
|
-
const messageKey = senderKeyState.removeSenderMessageKey(iteration);
|
|
48
|
-
if (!messageKey) {
|
|
49
|
-
throw new Error('No sender message key found for iteration');
|
|
50
|
-
}
|
|
51
|
-
return messageKey;
|
|
52
|
-
}
|
|
53
|
-
throw new Error(`Received message with old counter: ${senderChainKey.getIteration()}, ${iteration}`);
|
|
54
|
-
}
|
|
55
|
-
if (iteration - senderChainKey.getIteration() > 2000) {
|
|
56
|
-
throw new Error('Over 2000 messages into the future!');
|
|
57
|
-
}
|
|
58
|
-
while (senderChainKey.getIteration() < iteration) {
|
|
59
|
-
senderKeyState.addSenderMessageKey(senderChainKey.getSenderMessageKey());
|
|
60
|
-
senderChainKey = senderChainKey.getNext();
|
|
61
|
-
}
|
|
62
|
-
senderKeyState.setSenderChainKey(senderChainKey.getNext());
|
|
63
|
-
return senderChainKey.getSenderMessageKey();
|
|
64
|
-
}
|
|
65
|
-
async getPlainText(iv, key, ciphertext) {
|
|
66
|
-
try {
|
|
67
|
-
return Buffer.from(Crypto_1.aesDecryptWithIV(ciphertext, key, iv));
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
throw new Error('InvalidMessageException');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async getCipherText(iv, key, plaintext) {
|
|
74
|
-
try {
|
|
75
|
-
return Buffer.from(Crypto_1.aesEncrypWithIV(plaintext, key, iv));
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
throw new Error('InvalidMessageException');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.GroupCipher = GroupCipher;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __createBinding = (this && this.__createBinding) ||
|
|
3
|
-
(Object.create
|
|
4
|
-
? function (o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined)
|
|
6
|
-
k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return m[k];
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc);
|
|
17
|
-
}
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined)
|
|
20
|
-
k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
});
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) ||
|
|
24
|
-
(Object.create
|
|
25
|
-
? function (o, v) {
|
|
26
|
-
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
-
}
|
|
28
|
-
: function (o, v) {
|
|
29
|
-
o['default'] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) ||
|
|
32
|
-
(function () {
|
|
33
|
-
var ownKeys = function (o) {
|
|
34
|
-
ownKeys =
|
|
35
|
-
Object.getOwnPropertyNames ||
|
|
36
|
-
function (o) {
|
|
37
|
-
var ar = [];
|
|
38
|
-
for (var k in o)
|
|
39
|
-
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
40
|
-
ar[ar.length] = k;
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
return ownKeys(o);
|
|
44
|
-
};
|
|
45
|
-
return function (mod) {
|
|
46
|
-
if (mod && mod.__esModule)
|
|
47
|
-
return mod;
|
|
48
|
-
var result = {};
|
|
49
|
-
if (mod != null)
|
|
50
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
51
|
-
if (k[i] !== 'default')
|
|
52
|
-
__createBinding(result, mod, k[i]);
|
|
53
|
-
__setModuleDefault(result, mod);
|
|
54
|
-
return result;
|
|
55
|
-
};
|
|
56
|
-
})();
|
|
57
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
58
|
-
exports.keyhelper =
|
|
59
|
-
exports.CiphertextMessage =
|
|
60
|
-
exports.SenderChainKey =
|
|
61
|
-
exports.SenderMessageKey =
|
|
62
|
-
exports.SenderKeyMessage =
|
|
63
|
-
exports.SenderKeyState =
|
|
64
|
-
exports.GroupCipher =
|
|
65
|
-
exports.SenderKeyName =
|
|
66
|
-
exports.SenderKeyRecord =
|
|
67
|
-
exports.SenderKeyDistributionMessage =
|
|
68
|
-
exports.GroupSessionBuilder =
|
|
69
|
-
void 0;
|
|
70
|
-
var group_session_builder_1 = require('./group-session-builder');
|
|
71
|
-
Object.defineProperty(exports, 'GroupSessionBuilder', {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
get: function () {
|
|
74
|
-
return group_session_builder_1.GroupSessionBuilder;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
var sender_key_distribution_message_1 = require('./sender-key-distribution-message');
|
|
78
|
-
Object.defineProperty(exports, 'SenderKeyDistributionMessage', {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return sender_key_distribution_message_1.SenderKeyDistributionMessage;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
var sender_key_record_1 = require('./sender-key-record');
|
|
85
|
-
Object.defineProperty(exports, 'SenderKeyRecord', {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function () {
|
|
88
|
-
return sender_key_record_1.SenderKeyRecord;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
var sender_key_name_1 = require('./sender-key-name');
|
|
92
|
-
Object.defineProperty(exports, 'SenderKeyName', {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function () {
|
|
95
|
-
return sender_key_name_1.SenderKeyName;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
var group_cipher_1 = require('./group_cipher');
|
|
99
|
-
Object.defineProperty(exports, 'GroupCipher', {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function () {
|
|
102
|
-
return group_cipher_1.GroupCipher;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
var sender_key_state_1 = require('./sender-key-state');
|
|
106
|
-
Object.defineProperty(exports, 'SenderKeyState', {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function () {
|
|
109
|
-
return sender_key_state_1.SenderKeyState;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
var sender_key_message_1 = require('./sender-key-message');
|
|
113
|
-
Object.defineProperty(exports, 'SenderKeyMessage', {
|
|
114
|
-
enumerable: true,
|
|
115
|
-
get: function () {
|
|
116
|
-
return sender_key_message_1.SenderKeyMessage;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
var sender_message_key_1 = require('./sender-message-key');
|
|
120
|
-
Object.defineProperty(exports, 'SenderMessageKey', {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return sender_message_key_1.SenderMessageKey;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
var sender_chain_key_1 = require('./sender-chain-key');
|
|
127
|
-
Object.defineProperty(exports, 'SenderChainKey', {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function () {
|
|
130
|
-
return sender_chain_key_1.SenderChainKey;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
var ciphertext_message_1 = require('./ciphertext-message');
|
|
134
|
-
Object.defineProperty(exports, 'CiphertextMessage', {
|
|
135
|
-
enumerable: true,
|
|
136
|
-
get: function () {
|
|
137
|
-
return ciphertext_message_1.CiphertextMessage;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
exports.keyhelper = __importStar(require('./keyhelper'));
|