@vanzxy/baileys 1.3.7 → 1.3.9
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/NOTICE.md +41 -0
- package/README.md +1 -1
- package/WAProto/index.d.ts +9 -0
- package/lib/Defaults/index.d.ts +147 -0
- package/lib/Defaults/index.js +2 -2
- package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
- package/lib/Signal/Group/group-session-builder.d.ts +7 -0
- package/lib/Signal/Group/group_cipher.d.ts +10 -0
- package/lib/Signal/Group/index.d.ts +11 -0
- package/lib/Signal/Group/keyhelper.d.ts +6 -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 +11 -0
- package/lib/Signal/Group/sender-key-record.d.ts +12 -0
- package/lib/Signal/Group/sender-key-state.d.ts +16 -0
- package/lib/Signal/Group/sender-message-key.d.ts +11 -0
- package/lib/Signal/libsignal.d.ts +54 -0
- package/lib/Signal/lid-mapping.d.ts +20 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/types.d.ts +5 -0
- package/lib/Socket/Client/websocket.d.ts +12 -0
- package/lib/Socket/business.d.ts +395 -0
- package/lib/Socket/chats.d.ts +136 -0
- package/lib/Socket/communities.d.ts +561 -0
- package/lib/Socket/communities.js +4 -2
- package/lib/Socket/dugong.d.ts +117 -0
- package/lib/Socket/dugong.js +26 -1
- package/lib/Socket/groups.d.ts +285 -0
- package/lib/Socket/index.d.ts +531 -0
- package/lib/Socket/messages-recv.d.ts +333 -0
- package/lib/Socket/messages-send.d.ts +329 -0
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/newsletter.d.ts +281 -0
- package/lib/Socket/newsletter.js +19 -19
- package/lib/Socket/socket.d.ts +60 -0
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/make-in-memory-store.d.ts +62 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Types/Auth.d.ts +117 -0
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Call.d.ts +15 -0
- package/lib/Types/Chat.d.ts +124 -0
- package/lib/Types/Contact.d.ts +26 -0
- package/lib/Types/Events.d.ts +256 -0
- package/lib/Types/GroupMetadata.d.ts +71 -0
- package/lib/Types/Label.d.ts +2 -0
- package/lib/Types/LabelAssociation.d.ts +2 -0
- package/lib/Types/Message.d.ts +11 -0
- package/lib/Types/Mex.d.ts +2 -0
- package/lib/Types/Product.d.ts +79 -0
- package/lib/Types/RichType.d.ts +2 -0
- package/lib/Types/Signal.d.ts +87 -0
- package/lib/Types/Socket.d.ts +136 -0
- package/lib/Types/State.d.ts +5 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/index.d.ts +66 -0
- package/lib/Utils/MessageBuilder.js +2297 -0
- package/lib/Utils/auth-utils.d.ts +57 -0
- package/lib/Utils/browser-utils.d.ts +8 -0
- package/lib/Utils/business.d.ts +49 -0
- package/lib/Utils/business.js +2 -1
- package/lib/Utils/chat-utils.d.ts +407 -0
- package/lib/Utils/chat-utils.js +15 -1
- package/lib/Utils/companion-reg-client-utils.d.ts +4 -0
- package/lib/Utils/crypto.d.ts +41 -0
- package/lib/Utils/decode-wa-message.d.ts +83 -0
- package/lib/Utils/decode-wa-message.js +1 -3
- package/lib/Utils/event-buffer.d.ts +12 -0
- package/lib/Utils/generics.d.ts +63 -0
- package/lib/Utils/generics.js +2 -4
- package/lib/Utils/history.d.ts +90 -0
- package/lib/Utils/identity-change-handler.d.ts +13 -0
- package/lib/Utils/index.d.ts +24 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.d.ts +12 -0
- package/lib/Utils/logger.d.ts +2 -0
- package/lib/Utils/lt-hash.d.ts +12 -0
- package/lib/Utils/lt-hash.js +21 -2
- package/lib/Utils/make-mutex.d.ts +6 -0
- package/lib/Utils/message-retry-manager.d.ts +79 -0
- package/lib/Utils/messages-media.d.ts +135 -0
- package/lib/Utils/messages.d.ts +44 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/offline-node-processor.d.ts +9 -0
- package/lib/Utils/pre-key-manager.d.ts +25 -0
- package/lib/Utils/process-message.d.ts +82 -0
- package/lib/Utils/reporting-utils.d.ts +12 -0
- package/lib/Utils/rich-message-utils.d.ts +48 -0
- package/lib/Utils/rich-message-utils.js +32 -7
- package/lib/Utils/signal.d.ts +82 -0
- package/lib/Utils/stanza-ack.d.ts +16 -0
- package/lib/Utils/sync-action-utils.d.ts +2 -0
- package/lib/Utils/tc-token-utils.d.ts +29 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +10 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +10 -0
- package/lib/Utils/use-single-file-auth-state.js +6 -1
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.js +12 -0
- package/lib/Utils/validate-connection.d.ts +42 -0
- package/lib/WABinary/constants.d.ts +61 -0
- package/lib/WABinary/decode.d.ts +9 -0
- package/lib/WABinary/encode.d.ts +2 -0
- package/lib/WABinary/generic-utils.d.ts +74 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/jid-utils.d.ts +28 -0
- package/lib/WABinary/types.d.ts +19 -0
- package/lib/WAM/BinaryInfo.d.ts +7 -0
- package/lib/WAM/constants.d.ts +34926 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +29 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
- package/lib/WAUSync/Protocols/index.d.ts +7 -0
- package/lib/WAUSync/USyncQuery.d.ts +20 -0
- package/lib/WAUSync/USyncUser.d.ts +16 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/index.d.ts +12 -0
- package/package.json +17 -7
- package/postinstall-banner.js +23 -0
- package/LICENSE +0 -23
package/NOTICE.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
This project (`@vanzxy/baileys`) is built on top of, and includes code
|
|
4
|
+
adapted from, the following projects. Attribution kept here per their
|
|
5
|
+
original license terms, instead of inline in each source file.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## lib/Utils/MessageBuilder.js — AIRich / Button / ButtonV2 / Carousel / Toolkit
|
|
10
|
+
|
|
11
|
+
Base implementation ("NIXCODE — Advanced WhatsApp Interactive Message
|
|
12
|
+
Builder") originally created by **Nixel**, with contributions from
|
|
13
|
+
**Ahmad tumbuh kembang**. Obtained via the `@blurose/baileys` (1.1.13) fork.
|
|
14
|
+
|
|
15
|
+
- WhatsApp: wa.me/6285188349341
|
|
16
|
+
- Channel: https://whatsapp.com/channel/0029VbCV1ck8fewpdNb2TY2k
|
|
17
|
+
- Copyright (c) 2026 Nixel
|
|
18
|
+
|
|
19
|
+
Original license terms:
|
|
20
|
+
> Permission is granted to use and modify this library for personal or
|
|
21
|
+
> commercial projects. Reuploading, reselling, relicensing, or
|
|
22
|
+
> redistributing this library as a standalone product is prohibited.
|
|
23
|
+
> Do not claim this project as your own original work.
|
|
24
|
+
|
|
25
|
+
Ported into `@vanzxy/baileys` 1.3.9 with modifications (see git history /
|
|
26
|
+
inline `Vanz@` comments for specifics): lazy-loading of optional
|
|
27
|
+
`sharp`/`fluent-ffmpeg` dependencies, faster default behavior for
|
|
28
|
+
`addVideo()`, `verificationMetadata` signing added to `AIRich.build()`,
|
|
29
|
+
and neutral fallback text (previously referenced the original author's
|
|
30
|
+
name in a small number of user-facing fallback strings).
|
|
31
|
+
|
|
32
|
+
Additional performance/authenticity reference drawn from `arslan-baileys`
|
|
33
|
+
(1.1.0), which shares the same underlying builder API.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## rich-message-utils.js — AIRICH inline-image bug fix
|
|
38
|
+
|
|
39
|
+
Original implementation is this project's own; fixed 2026-08-15 (bad
|
|
40
|
+
protobuf field shape for `AIRichResponseInlineImageMetadata.imageUrl`
|
|
41
|
+
causing silently-dropped image data on encode).
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
> Built for modern WhatsApp bot development with extended interactive messages, native flow enhancements, status tools, and quality-of-life improvements.
|
|
5
5
|
|
|
6
6
|

|
|
7
|
-

|
|
8
8
|

|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Vanz@Fix: hand-written shim, not tsc-generated.
|
|
2
|
+
// WAProto/index.js is auto-generated protobufjs codegen from the WhatsApp .proto
|
|
3
|
+
// schema (115k+ lines, dynamic prototype-based message classes). Without the
|
|
4
|
+
// original .proto source we can't regenerate faithful per-field types, so `proto`
|
|
5
|
+
// is typed loosely as `any` here. This still lets `tsc` emit real .d.ts for the
|
|
6
|
+
// rest of lib/ (which re-exports `proto` via `export * from '../WAProto/index.js'`)
|
|
7
|
+
// instead of failing declaration emit for the whole package.
|
|
8
|
+
export declare const proto: any;
|
|
9
|
+
export default proto;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export const UNAUTHORIZED_CODES: number[];
|
|
2
|
+
export const BIZ_BOT_SUPPORT_PAYLOAD: "{\"version\":1,\"is_ai_message\":true,\"should_upload_client_logs\":false,\"should_show_system_message\":false,\"ticket_id\":\"7004947587700716\",\"citation_items\":[],\"ticket_locale\":\"us\"}";
|
|
3
|
+
export const DEFAULT_ORIGIN: "https://web.whatsapp.com";
|
|
4
|
+
export const CALL_VIDEO_PREFIX: "https://call.whatsapp.com/video/";
|
|
5
|
+
export const CALL_AUDIO_PREFIX: "https://call.whatsapp.com/voice/";
|
|
6
|
+
export const DONATE_URL: "";
|
|
7
|
+
export const LIBRARY_NAME: "vanzxy/baileys";
|
|
8
|
+
export const DEF_CALLBACK_PREFIX: "CB:";
|
|
9
|
+
export const DEF_TAG_PREFIX: "TAG:";
|
|
10
|
+
export const PHONE_CONNECTION_CB: "CB:Pong";
|
|
11
|
+
export const WA_ADV_ACCOUNT_SIG_PREFIX: any;
|
|
12
|
+
export const WA_ADV_DEVICE_SIG_PREFIX: any;
|
|
13
|
+
export const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: any;
|
|
14
|
+
export const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: any;
|
|
15
|
+
export const WA_DEFAULT_EPHEMERAL: number;
|
|
16
|
+
/** Status messages older than 24 hours are considered expired */
|
|
17
|
+
export const STATUS_EXPIRY_SECONDS: number;
|
|
18
|
+
/** WA Web enforces a 14-day maximum age for placeholder resend requests */
|
|
19
|
+
export const PLACEHOLDER_MAX_AGE_SECONDS: number;
|
|
20
|
+
export const NOISE_MODE: "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
21
|
+
export const DICT_VERSION: 3;
|
|
22
|
+
export const KEY_BUNDLE_TYPE: any;
|
|
23
|
+
export const NOISE_WA_HEADER: any;
|
|
24
|
+
export const LEXER_REGEX: RegExp;
|
|
25
|
+
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
26
|
+
export const URL_REGEX: RegExp;
|
|
27
|
+
export namespace WA_CERT_DETAILS {
|
|
28
|
+
let SERIAL: number;
|
|
29
|
+
let ISSUER: string;
|
|
30
|
+
let PUBLIC_KEY: any;
|
|
31
|
+
}
|
|
32
|
+
export const PROCESSABLE_HISTORY_TYPES: any[];
|
|
33
|
+
export namespace DEFAULT_CACHE_TTLS {
|
|
34
|
+
let SIGNAL_STORE: number;
|
|
35
|
+
let MSG_RETRY: number;
|
|
36
|
+
let CALL_OFFER: number;
|
|
37
|
+
let USER_DEVICES: number;
|
|
38
|
+
}
|
|
39
|
+
export namespace DEFAULT_CONNECTION_CONFIG {
|
|
40
|
+
export { version };
|
|
41
|
+
export let browser: any[];
|
|
42
|
+
export let waWebSocketUrl: string;
|
|
43
|
+
export let connectTimeoutMs: number;
|
|
44
|
+
export let keepAliveIntervalMs: number;
|
|
45
|
+
export let logger: any;
|
|
46
|
+
export let emitOwnEvents: boolean;
|
|
47
|
+
export let defaultQueryTimeoutMs: number;
|
|
48
|
+
export let customUploadHosts: never[];
|
|
49
|
+
export let retryRequestDelayMs: number;
|
|
50
|
+
export let maxMsgRetryCount: number;
|
|
51
|
+
export let fireInitQueries: boolean;
|
|
52
|
+
export let auth: undefined;
|
|
53
|
+
export let markOnlineOnConnect: boolean;
|
|
54
|
+
export let syncFullHistory: boolean;
|
|
55
|
+
export function patchMessageBeforeSending(msg: any): any;
|
|
56
|
+
export function shouldSyncHistoryMessage({ syncType }: {
|
|
57
|
+
syncType: any;
|
|
58
|
+
}): boolean;
|
|
59
|
+
export function shouldIgnoreJid(): boolean;
|
|
60
|
+
export let linkPreviewImageThumbnailWidth: number;
|
|
61
|
+
export namespace transactionOpts {
|
|
62
|
+
let maxCommitRetries: number;
|
|
63
|
+
let delayBetweenTriesMs: number;
|
|
64
|
+
}
|
|
65
|
+
export let eventBufferTimeoutMs: number;
|
|
66
|
+
export let statusBroadcastDelayMs: number;
|
|
67
|
+
export let albumDelayMs: number;
|
|
68
|
+
export let phashRetryEnabled: boolean;
|
|
69
|
+
export let generateHighQualityLinkPreview: boolean;
|
|
70
|
+
export let enableAutoSessionRecreation: boolean;
|
|
71
|
+
export let enableRecentMessageCache: boolean;
|
|
72
|
+
export let options: {};
|
|
73
|
+
export namespace appStateMacVerification {
|
|
74
|
+
let patch: boolean;
|
|
75
|
+
let snapshot: boolean;
|
|
76
|
+
}
|
|
77
|
+
export let countryCode: string;
|
|
78
|
+
export function getMessage(): Promise<undefined>;
|
|
79
|
+
export function cachedGroupMetadata(): Promise<undefined>;
|
|
80
|
+
export { makeLibSignalRepository as makeSignalRepository };
|
|
81
|
+
}
|
|
82
|
+
export const MEDIA_PATH_MAP: {
|
|
83
|
+
image: string;
|
|
84
|
+
video: string;
|
|
85
|
+
document: string;
|
|
86
|
+
audio: string;
|
|
87
|
+
sticker: string;
|
|
88
|
+
'sticker-pack': string;
|
|
89
|
+
'thumbnail-sticker-pack': string;
|
|
90
|
+
'thumbnail-link': string;
|
|
91
|
+
'thumbnail-image': string;
|
|
92
|
+
'thumbnail-video': string;
|
|
93
|
+
'thumbnail-document': string;
|
|
94
|
+
'product-catalog-image': string;
|
|
95
|
+
'md-app-state': string;
|
|
96
|
+
'md-msg-hist': string;
|
|
97
|
+
'biz-cover-photo': string;
|
|
98
|
+
};
|
|
99
|
+
export const NEWSLETTER_MEDIA_PATH_MAP: {
|
|
100
|
+
image: string;
|
|
101
|
+
video: string;
|
|
102
|
+
document: string;
|
|
103
|
+
audio: string;
|
|
104
|
+
sticker: string;
|
|
105
|
+
'thumbnail-link': string;
|
|
106
|
+
};
|
|
107
|
+
export const MEDIA_HKDF_KEY_MAPPING: {
|
|
108
|
+
audio: string;
|
|
109
|
+
document: string;
|
|
110
|
+
gif: string;
|
|
111
|
+
image: string;
|
|
112
|
+
ppic: string;
|
|
113
|
+
product: string;
|
|
114
|
+
ptt: string;
|
|
115
|
+
'sticker-pack': string;
|
|
116
|
+
'thumbnail-sticker-pack': string;
|
|
117
|
+
sticker: string;
|
|
118
|
+
video: string;
|
|
119
|
+
'thumbnail-document': string;
|
|
120
|
+
'thumbnail-image': string;
|
|
121
|
+
'thumbnail-video': string;
|
|
122
|
+
'thumbnail-link': string;
|
|
123
|
+
'md-msg-hist': string;
|
|
124
|
+
'md-app-state': string;
|
|
125
|
+
'product-catalog-image': string;
|
|
126
|
+
'payment-bg-image': string;
|
|
127
|
+
ptv: string;
|
|
128
|
+
'biz-cover-photo': string;
|
|
129
|
+
location: string;
|
|
130
|
+
contact: string;
|
|
131
|
+
'voip-token': string;
|
|
132
|
+
};
|
|
133
|
+
export const MEDIA_KEYS: string[];
|
|
134
|
+
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
135
|
+
export const HISTORY_SYNC_PAUSED_TIMEOUT_MS: 120000;
|
|
136
|
+
export const MIN_PREKEY_COUNT: 5;
|
|
137
|
+
export const INITIAL_PREKEY_COUNT: 812;
|
|
138
|
+
export const UPLOAD_TIMEOUT: 30000;
|
|
139
|
+
export namespace TimeMs {
|
|
140
|
+
let Minute: number;
|
|
141
|
+
let Hour: number;
|
|
142
|
+
let Day: number;
|
|
143
|
+
let Week: number;
|
|
144
|
+
}
|
|
145
|
+
declare const version: number[];
|
|
146
|
+
import { makeLibSignalRepository } from '../Signal/libsignal.js';
|
|
147
|
+
export {};
|
package/lib/Defaults/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { proto } from '../../WAProto/index.js';
|
|
|
2
2
|
import { makeLibSignalRepository } from '../Signal/libsignal.js';
|
|
3
3
|
import { Browsers } from '../Utils/browser-utils.js';
|
|
4
4
|
import logger from '../Utils/logger.js';
|
|
5
|
-
// Vanz@Fix: dinaikin ke angka yang sama kayak baileys resmi (per
|
|
5
|
+
// Vanz@Fix: dinaikin ke angka yang sama kayak baileys resmi (per 14/8/2026)
|
|
6
6
|
// — ini cuma fallback kalau fetchLatestBaileysVersion() gagal total
|
|
7
7
|
// (mis. GitHub gak bisa diakses), jadi tetap worth di-update berkala.
|
|
8
|
-
const version = [2, 3000,
|
|
8
|
+
const version = [2, 3000, 1045191189];
|
|
9
9
|
export const UNAUTHORIZED_CODES = [401, 403, 419];
|
|
10
10
|
export const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"should_upload_client_logs":false,"should_show_system_message":false,"ticket_id":"7004947587700716","citation_items":[],"ticket_locale":"us"}';
|
|
11
11
|
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export class GroupSessionBuilder {
|
|
2
|
+
constructor(senderKeyStore: any);
|
|
3
|
+
senderKeyStore: any;
|
|
4
|
+
process(senderKeyName: any, senderKeyDistributionMessage: any): Promise<void>;
|
|
5
|
+
create(senderKeyName: any): Promise<SenderKeyDistributionMessage>;
|
|
6
|
+
}
|
|
7
|
+
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class GroupCipher {
|
|
2
|
+
constructor(senderKeyStore: any, senderKeyName: any);
|
|
3
|
+
senderKeyStore: any;
|
|
4
|
+
senderKeyName: any;
|
|
5
|
+
encrypt(paddedPlaintext: any): Promise<any>;
|
|
6
|
+
decrypt(senderKeyMessageBytes: any): Promise<any>;
|
|
7
|
+
getSenderKey(senderKeyState: any, iteration: any): any;
|
|
8
|
+
getPlainText(iv: any, key: any, ciphertext: any): Promise<any>;
|
|
9
|
+
getCipherText(iv: any, key: any, plaintext: any): Promise<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { GroupSessionBuilder } from "./group-session-builder.js";
|
|
2
|
+
export { SenderKeyDistributionMessage } from "./sender-key-distribution-message.js";
|
|
3
|
+
export { SenderKeyRecord } from "./sender-key-record.js";
|
|
4
|
+
export { SenderKeyName } from "./sender-key-name.js";
|
|
5
|
+
export { GroupCipher } from "./group_cipher.js";
|
|
6
|
+
export { SenderKeyState } from "./sender-key-state.js";
|
|
7
|
+
export { SenderKeyMessage } from "./sender-key-message.js";
|
|
8
|
+
export { SenderMessageKey } from "./sender-message-key.js";
|
|
9
|
+
export { SenderChainKey } from "./sender-chain-key.js";
|
|
10
|
+
export { CiphertextMessage } from "./ciphertext-message.js";
|
|
11
|
+
export * as keyhelper from "./keyhelper.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class SenderChainKey {
|
|
2
|
+
constructor(iteration: any, chainKey: any);
|
|
3
|
+
MESSAGE_KEY_SEED: any;
|
|
4
|
+
CHAIN_KEY_SEED: any;
|
|
5
|
+
iteration: any;
|
|
6
|
+
chainKey: any;
|
|
7
|
+
getIteration(): any;
|
|
8
|
+
getSenderMessageKey(): SenderMessageKey;
|
|
9
|
+
getNext(): SenderChainKey;
|
|
10
|
+
getSeed(): any;
|
|
11
|
+
getDerivative(seed: any, key: any): any;
|
|
12
|
+
}
|
|
13
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class SenderKeyDistributionMessage extends CiphertextMessage {
|
|
2
|
+
constructor(id: any, iteration: any, chainKey: any, signatureKey: any, serialized: any);
|
|
3
|
+
serialized: any;
|
|
4
|
+
id: any;
|
|
5
|
+
iteration: any;
|
|
6
|
+
chainKey: any;
|
|
7
|
+
signatureKey: any;
|
|
8
|
+
intsToByteHighAndLow(highValue: any, lowValue: any): number;
|
|
9
|
+
serialize(): any;
|
|
10
|
+
getType(): number;
|
|
11
|
+
getIteration(): any;
|
|
12
|
+
getChainKey(): any;
|
|
13
|
+
getSignatureKey(): any;
|
|
14
|
+
getId(): any;
|
|
15
|
+
}
|
|
16
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class SenderKeyMessage extends CiphertextMessage {
|
|
2
|
+
constructor(keyId: any, iteration: any, ciphertext: any, signatureKey: any, serialized: any);
|
|
3
|
+
SIGNATURE_LENGTH: number;
|
|
4
|
+
serialized: any;
|
|
5
|
+
messageVersion: number;
|
|
6
|
+
keyId: any;
|
|
7
|
+
iteration: any;
|
|
8
|
+
ciphertext: any;
|
|
9
|
+
signature: any;
|
|
10
|
+
getKeyId(): any;
|
|
11
|
+
getIteration(): any;
|
|
12
|
+
getCipherText(): any;
|
|
13
|
+
verifySignature(signatureKey: any): void;
|
|
14
|
+
getSignature(signatureKey: any, serialized: any): any;
|
|
15
|
+
serialize(): any;
|
|
16
|
+
getType(): number;
|
|
17
|
+
}
|
|
18
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class SenderKeyRecord {
|
|
2
|
+
static deserialize(data: any): SenderKeyRecord;
|
|
3
|
+
constructor(serialized: any);
|
|
4
|
+
MAX_STATES: number;
|
|
5
|
+
senderKeyStates: SenderKeyState[];
|
|
6
|
+
isEmpty(): boolean;
|
|
7
|
+
getSenderKeyState(keyId: any): SenderKeyState | undefined;
|
|
8
|
+
addSenderKeyState(id: any, iteration: any, chainKey: any, signatureKey: any): void;
|
|
9
|
+
setSenderKeyState(id: any, iteration: any, chainKey: any, keyPair: any): void;
|
|
10
|
+
serialize(): any[];
|
|
11
|
+
}
|
|
12
|
+
import { SenderKeyState } from './sender-key-state.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class SenderKeyState {
|
|
2
|
+
constructor(id: any, iteration: any, chainKey: any, signatureKeyPair: any, signatureKeyPublic: any, signatureKeyPrivate: any, senderKeyStateStructure: any);
|
|
3
|
+
MAX_MESSAGE_KEYS: number;
|
|
4
|
+
senderKeyStateStructure: any;
|
|
5
|
+
getKeyId(): any;
|
|
6
|
+
getSenderChainKey(): SenderChainKey;
|
|
7
|
+
setSenderChainKey(chainKey: any): void;
|
|
8
|
+
getSigningKeyPublic(): any;
|
|
9
|
+
getSigningKeyPrivate(): any;
|
|
10
|
+
hasSenderMessageKey(iteration: any): any;
|
|
11
|
+
addSenderMessageKey(senderMessageKey: any): void;
|
|
12
|
+
removeSenderMessageKey(iteration: any): SenderMessageKey | null;
|
|
13
|
+
getStructure(): any;
|
|
14
|
+
}
|
|
15
|
+
import { SenderChainKey } from './sender-chain-key.js';
|
|
16
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export function makeLibSignalRepository(auth: any, logger: any, pnToLIDFunc: any): {
|
|
2
|
+
decryptGroupMessage({ group, authorJid, msg }: {
|
|
3
|
+
group: any;
|
|
4
|
+
authorJid: any;
|
|
5
|
+
msg: any;
|
|
6
|
+
}): any;
|
|
7
|
+
processSenderKeyDistributionMessage({ item, authorJid }: {
|
|
8
|
+
item: any;
|
|
9
|
+
authorJid: any;
|
|
10
|
+
}): Promise<any>;
|
|
11
|
+
decryptMessage({ jid, type, ciphertext }: {
|
|
12
|
+
jid: any;
|
|
13
|
+
type: any;
|
|
14
|
+
ciphertext: any;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
encryptMessage({ jid, data }: {
|
|
17
|
+
jid: any;
|
|
18
|
+
data: any;
|
|
19
|
+
}): Promise<any>;
|
|
20
|
+
encryptGroupMessage({ group, meId, data }: {
|
|
21
|
+
group: any;
|
|
22
|
+
meId: any;
|
|
23
|
+
data: any;
|
|
24
|
+
}): Promise<any>;
|
|
25
|
+
getSenderKeyDistributionMessage({ group, meId }: {
|
|
26
|
+
group: any;
|
|
27
|
+
meId: any;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
hasSenderKey({ group, meId }: {
|
|
30
|
+
group: any;
|
|
31
|
+
meId: any;
|
|
32
|
+
}): Promise<boolean>;
|
|
33
|
+
getSessionInfo(jid: any): Promise<{
|
|
34
|
+
baseKey: Uint8Array<any>;
|
|
35
|
+
registrationId: number;
|
|
36
|
+
} | null>;
|
|
37
|
+
injectE2ESession({ jid, session }: {
|
|
38
|
+
jid: any;
|
|
39
|
+
session: any;
|
|
40
|
+
}): Promise<any>;
|
|
41
|
+
jidToSignalProtocolAddress(jid: any): any;
|
|
42
|
+
lidMapping: LIDMappingStore;
|
|
43
|
+
validateSession(jid: any): Promise<{
|
|
44
|
+
exists: boolean;
|
|
45
|
+
reason: string;
|
|
46
|
+
} | {
|
|
47
|
+
exists: boolean;
|
|
48
|
+
reason?: undefined;
|
|
49
|
+
}>;
|
|
50
|
+
deleteSession(jids: any): Promise<any>;
|
|
51
|
+
close(): void;
|
|
52
|
+
migrateSession(fromJid: any, toJid: any): Promise<any>;
|
|
53
|
+
};
|
|
54
|
+
import { LIDMappingStore } from './lid-mapping.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class LIDMappingStore {
|
|
2
|
+
constructor(keys: any, logger: any, pnToLIDFunc: any);
|
|
3
|
+
mappingCache: any;
|
|
4
|
+
inflightLIDLookups: Map<any, any>;
|
|
5
|
+
inflightPNLookups: Map<any, any>;
|
|
6
|
+
keys: any;
|
|
7
|
+
pnToLIDFunc: any;
|
|
8
|
+
logger: any;
|
|
9
|
+
storeLIDPNMappings(pairs: any): Promise<void>;
|
|
10
|
+
getLIDForPN(pn: any): Promise<any>;
|
|
11
|
+
getLIDsForPNs(pns: any): Promise<any>;
|
|
12
|
+
_getLIDsForPNsImpl(pns: any): Promise<any[] | null>;
|
|
13
|
+
getPNForLID(lid: any): Promise<any>;
|
|
14
|
+
getPNsForLIDs(lids: any): Promise<any>;
|
|
15
|
+
_getPNsForLIDsImpl(lids: any): Promise<any[] | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Close the cache and release resources
|
|
18
|
+
*/
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class WebSocketClient extends AbstractSocketClient {
|
|
2
|
+
constructor(...args: any[]);
|
|
3
|
+
socket: any;
|
|
4
|
+
get isOpen(): boolean;
|
|
5
|
+
get isClosed(): boolean;
|
|
6
|
+
get isClosing(): boolean;
|
|
7
|
+
get isConnecting(): boolean;
|
|
8
|
+
connect(): void;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
send(str: any, cb: any): boolean;
|
|
11
|
+
}
|
|
12
|
+
import { AbstractSocketClient } from './types.js';
|