@alannxd/baileys 6.0.5 → 6.0.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/LICENSE +1 -1
- package/README.md +341 -286
- package/WAProto/WAProto.proto +1782 -359
- package/WAProto/index.d.ts +75133 -9893
- package/WAProto/index.js +205861 -60606
- package/lib/Socket/luxu.js +6 -117
- package/lib/Socket/messages-send.js +637 -493
- package/lib/Socket/newsletter.js +229 -156
- package/lib/Utils/browser-utils.js +26 -6
- package/lib/Utils/decode-wa-message.js +33 -0
- package/lib/Utils/generics.js +10 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/message-composer.js +273 -0
- package/lib/Utils/messages.js +361 -24
- package/lib/WABinary/generic-utils.js +8 -1
- package/lib/WABinary/jid-utils.js +2 -0
- package/lib/index.js +1 -2
- package/package.json +5 -4
- package/lib/Defaults/index.d.ts +0 -75
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
- package/lib/Signal/Group/group-session-builder.d.ts +0 -15
- package/lib/Signal/Group/group_cipher.d.ts +0 -17
- package/lib/Signal/Group/index.d.ts +0 -12
- package/lib/Signal/Group/keyhelper.d.ts +0 -11
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
- package/lib/Signal/Group/sender-key-message.d.ts +0 -19
- package/lib/Signal/Group/sender-key-name.d.ts +0 -18
- package/lib/Signal/Group/sender-key-record.d.ts +0 -31
- package/lib/Signal/Group/sender-key-state.d.ts +0 -39
- package/lib/Signal/Group/sender-message-key.d.ts +0 -12
- package/lib/Signal/libsignal.d.ts +0 -5
- package/lib/Signal/lid-mapping.d.ts +0 -23
- package/lib/Socket/Client/index.d.ts +0 -3
- package/lib/Socket/Client/types.d.ts +0 -16
- package/lib/Socket/Client/websocket.d.ts +0 -13
- package/lib/Socket/business.d.ts +0 -217
- package/lib/Socket/chats.d.ts +0 -124
- package/lib/Socket/communities.d.ts +0 -273
- package/lib/Socket/groups.d.ts +0 -162
- package/lib/Socket/index.d.ts +0 -260
- package/lib/Socket/luxu.d.ts +0 -22
- package/lib/Socket/messages-recv.d.ts +0 -213
- package/lib/Socket/messages-send.d.ts +0 -199
- package/lib/Socket/mex.d.ts +0 -3
- package/lib/Socket/newsletter.d.ts +0 -170
- package/lib/Socket/socket.d.ts +0 -59
- package/lib/Store/index.d.ts +0 -10
- package/lib/Store/keyed-db.d.ts +0 -22
- package/lib/Store/make-cache-manager-store.d.ts +0 -19
- package/lib/Store/make-in-memory-store.d.ts +0 -39
- package/lib/Store/make-ordered-dictionary.d.ts +0 -14
- package/lib/Store/object-repository.d.ts +0 -11
- package/lib/Types/Auth.d.ts +0 -117
- package/lib/Types/Bussines.d.ts +0 -25
- package/lib/Types/Call.d.ts +0 -15
- package/lib/Types/Chat.d.ts +0 -124
- package/lib/Types/Contact.d.ts +0 -26
- package/lib/Types/Events.d.ts +0 -256
- package/lib/Types/GroupMetadata.d.ts +0 -71
- package/lib/Types/Label.d.ts +0 -47
- package/lib/Types/LabelAssociation.d.ts +0 -30
- package/lib/Types/Message.d.ts +0 -320
- package/lib/Types/Mex.d.ts +0 -141
- package/lib/Types/Product.d.ts +0 -79
- package/lib/Types/Signal.d.ts +0 -87
- package/lib/Types/Socket.d.ts +0 -136
- package/lib/Types/State.d.ts +0 -97
- package/lib/Types/USync.d.ts +0 -26
- package/lib/Types/index.d.ts +0 -65
- package/lib/Utils/auth-utils.d.ts +0 -24
- package/lib/Utils/browser-utils.d.ts +0 -4
- package/lib/Utils/business.d.ts +0 -23
- package/lib/Utils/chat-utils.d.ts +0 -100
- package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
- package/lib/Utils/crypto.d.ts +0 -37
- package/lib/Utils/decode-wa-message.d.ts +0 -66
- package/lib/Utils/event-buffer.d.ts +0 -36
- package/lib/Utils/generics.d.ts +0 -91
- package/lib/Utils/history.d.ts +0 -24
- package/lib/Utils/identity-change-handler.d.ts +0 -44
- package/lib/Utils/index.d.ts +0 -22
- package/lib/Utils/link-preview.d.ts +0 -21
- package/lib/Utils/logger.d.ts +0 -12
- package/lib/Utils/lt-hash.d.ts +0 -8
- package/lib/Utils/make-mutex.d.ts +0 -9
- package/lib/Utils/message-retry-manager.d.ts +0 -115
- package/lib/Utils/messages-media.d.ts +0 -133
- package/lib/Utils/messages.d.ts +0 -91
- package/lib/Utils/noise-handler.d.ts +0 -20
- package/lib/Utils/offline-node-processor.d.ts +0 -17
- package/lib/Utils/pre-key-manager.d.ts +0 -28
- package/lib/Utils/process-message.d.ts +0 -60
- package/lib/Utils/reporting-utils.d.ts +0 -11
- package/lib/Utils/signal.d.ts +0 -47
- package/lib/Utils/stanza-ack.d.ts +0 -11
- package/lib/Utils/sync-action-utils.d.ts +0 -19
- package/lib/Utils/tc-token-utils.d.ts +0 -37
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
- package/lib/Utils/validate-connection.d.ts +0 -11
- package/lib/WABinary/constants.d.ts +0 -28
- package/lib/WABinary/decode.d.ts +0 -7
- package/lib/WABinary/encode.d.ts +0 -3
- package/lib/WABinary/generic-utils.d.ts +0 -18
- package/lib/WABinary/index.d.ts +0 -6
- package/lib/WABinary/jid-utils.d.ts +0 -48
- package/lib/WABinary/types.d.ts +0 -19
- package/lib/WAM/BinaryInfo.d.ts +0 -9
- package/lib/WAM/constants.d.ts +0 -40
- package/lib/WAM/encode.d.ts +0 -3
- package/lib/WAM/index.d.ts +0 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -23
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -13
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -13
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/index.d.ts +0 -6
- package/lib/WAUSync/USyncQuery.d.ts +0 -30
- package/lib/WAUSync/USyncUser.d.ts +0 -17
- package/lib/WAUSync/index.d.ts +0 -4
- package/lib/index.d.ts +0 -13
|
@@ -125,9 +125,11 @@ export const getAdditionalNode = (name) => {
|
|
|
125
125
|
const order_response_name = {
|
|
126
126
|
review_and_pay: 'order_details',
|
|
127
127
|
review_order: 'order_status',
|
|
128
|
+
order_status: 'order_status',
|
|
128
129
|
payment_info: 'payment_info',
|
|
129
130
|
payment_status: 'payment_status',
|
|
130
|
-
payment_method: 'payment_method'
|
|
131
|
+
payment_method: 'payment_method',
|
|
132
|
+
catalog_message: 'catalog_message',
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
const flow_name = {
|
|
@@ -137,6 +139,7 @@ export const getAdditionalNode = (name) => {
|
|
|
137
139
|
view_catalog: 'automated_greeting_message_view_catalog',
|
|
138
140
|
wa_pay_detail: 'wa_payment_transaction_details',
|
|
139
141
|
send_location: 'send_location',
|
|
142
|
+
payment_key_info: 'payment_key_info'
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
if(order_response_name[name]) {
|
|
@@ -194,4 +197,8 @@ export const getAdditionalNode = (name) => {
|
|
|
194
197
|
}]
|
|
195
198
|
}]
|
|
196
199
|
}
|
|
200
|
+
}
|
|
201
|
+
export const getBinaryFilteredBizBot = nodeContent => {
|
|
202
|
+
if (!Array.isArray(nodeContent)) return false
|
|
203
|
+
return nodeContent.some(b => ['bot'].includes(b?.tag) && b?.attrs?.biz_bot === '1')
|
|
197
204
|
}
|
|
@@ -77,6 +77,8 @@ export const isJidNewsletter = (jid) => jid?.endsWith('@newsletter');
|
|
|
77
77
|
export const isHostedPnUser = (jid) => jid?.endsWith('@hosted');
|
|
78
78
|
/** is the jid a hosted LID */
|
|
79
79
|
export const isHostedLidUser = (jid) => jid?.endsWith('@hosted.lid');
|
|
80
|
+
/** is the jid a interop */
|
|
81
|
+
export const isInteropUser = (jid) => jid?.endsWith('@interop');
|
|
80
82
|
const botRegexp = /^1313555\d{4}$|^131655500\d{2}$/;
|
|
81
83
|
export const isJidBot = (jid) => jid && botRegexp.test(jid.split('@')[0]) && jid.endsWith('@c.us');
|
|
82
84
|
export const jidNormalizedUser = (jid) => {
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alannxd/baileys",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.9",
|
|
5
5
|
"description": "WhatsApp API Modification",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"whatsapp api",
|
|
12
12
|
"whatsapp web",
|
|
13
13
|
"botwa",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"Holow",
|
|
15
|
+
"AlannXD"
|
|
16
16
|
],
|
|
17
17
|
"homepage": "https://www.npmjs.com/package/@alannxd/baileys",
|
|
18
18
|
"repository": {
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"protobufjs": "^7.5.6",
|
|
55
55
|
"whatsapp-rust-bridge": "0.5.4",
|
|
56
56
|
"ws": "^8.13.0",
|
|
57
|
-
"chalk": "^4.1.2"
|
|
57
|
+
"chalk": "^4.1.2",
|
|
58
|
+
"cache-manager": "^7.2.8"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@eslint/eslintrc": "^3.3.1",
|
package/lib/Defaults/index.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { proto } from '../../WAProto/index.js';
|
|
2
|
-
import type { SocketConfig } from '../Types/index.js';
|
|
3
|
-
export declare const UNAUTHORIZED_CODES: number[];
|
|
4
|
-
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
5
|
-
export declare const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
|
|
6
|
-
export declare const CALL_AUDIO_PREFIX = "https://call.whatsapp.com/voice/";
|
|
7
|
-
export declare const DEF_CALLBACK_PREFIX = "CB:";
|
|
8
|
-
export declare const DEF_TAG_PREFIX = "TAG:";
|
|
9
|
-
export declare const PHONE_CONNECTION_CB = "CB:Pong";
|
|
10
|
-
export declare const WA_ADV_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
11
|
-
export declare const WA_ADV_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
12
|
-
export declare const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
13
|
-
export declare const WA_ADV_HOSTED_DEVICE_SIG_PREFIX: Buffer<ArrayBuffer>;
|
|
14
|
-
export declare const WA_DEFAULT_EPHEMERAL: number;
|
|
15
|
-
/** Status messages older than 24 hours are considered expired */
|
|
16
|
-
export declare const STATUS_EXPIRY_SECONDS: number;
|
|
17
|
-
/** WA Web enforces a 14-day maximum age for placeholder resend requests */
|
|
18
|
-
export declare const PLACEHOLDER_MAX_AGE_SECONDS: number;
|
|
19
|
-
export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
20
|
-
export declare const DICT_VERSION = 3;
|
|
21
|
-
export declare const KEY_BUNDLE_TYPE: Buffer<ArrayBuffer>;
|
|
22
|
-
export declare const NOISE_WA_HEADER: Buffer<ArrayBuffer>;
|
|
23
|
-
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
24
|
-
export declare const URL_REGEX: RegExp;
|
|
25
|
-
export declare const WA_CERT_DETAILS: {
|
|
26
|
-
SERIAL: number;
|
|
27
|
-
ISSUER: string;
|
|
28
|
-
PUBLIC_KEY: Buffer<ArrayBuffer>;
|
|
29
|
-
};
|
|
30
|
-
export declare const PROCESSABLE_HISTORY_TYPES: proto.HistorySync.HistorySyncType[];
|
|
31
|
-
export declare const DEFAULT_CACHE_TTLS: {
|
|
32
|
-
SIGNAL_STORE: number;
|
|
33
|
-
MSG_RETRY: number;
|
|
34
|
-
CALL_OFFER: number;
|
|
35
|
-
USER_DEVICES: number;
|
|
36
|
-
};
|
|
37
|
-
export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
38
|
-
export declare const MEDIA_PATH_MAP: {
|
|
39
|
-
[T in MediaType]?: string;
|
|
40
|
-
};
|
|
41
|
-
export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
42
|
-
audio: string;
|
|
43
|
-
document: string;
|
|
44
|
-
gif: string;
|
|
45
|
-
image: string;
|
|
46
|
-
ppic: string;
|
|
47
|
-
product: string;
|
|
48
|
-
ptt: string;
|
|
49
|
-
sticker: string;
|
|
50
|
-
video: string;
|
|
51
|
-
'thumbnail-document': string;
|
|
52
|
-
'thumbnail-image': string;
|
|
53
|
-
'thumbnail-video': string;
|
|
54
|
-
'thumbnail-link': string;
|
|
55
|
-
'md-msg-hist': string;
|
|
56
|
-
'md-app-state': string;
|
|
57
|
-
'product-catalog-image': string;
|
|
58
|
-
'payment-bg-image': string;
|
|
59
|
-
ptv: string;
|
|
60
|
-
'biz-cover-photo': string;
|
|
61
|
-
};
|
|
62
|
-
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
|
|
63
|
-
export declare const MEDIA_KEYS: MediaType[];
|
|
64
|
-
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
65
|
-
export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
66
|
-
export declare const MIN_PREKEY_COUNT = 5;
|
|
67
|
-
export declare const INITIAL_PREKEY_COUNT = 812;
|
|
68
|
-
export declare const UPLOAD_TIMEOUT = 30000;
|
|
69
|
-
export declare const TimeMs: {
|
|
70
|
-
Minute: number;
|
|
71
|
-
Hour: number;
|
|
72
|
-
Day: number;
|
|
73
|
-
Week: number;
|
|
74
|
-
};
|
|
75
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class CiphertextMessage {
|
|
2
|
-
readonly UNSUPPORTED_VERSION: number;
|
|
3
|
-
readonly CURRENT_VERSION: number;
|
|
4
|
-
readonly WHISPER_TYPE: number;
|
|
5
|
-
readonly PREKEY_TYPE: number;
|
|
6
|
-
readonly SENDERKEY_TYPE: number;
|
|
7
|
-
readonly SENDERKEY_DISTRIBUTION_TYPE: number;
|
|
8
|
-
readonly ENCRYPTED_MESSAGE_OVERHEAD: number;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=ciphertext-message.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
2
|
-
import { SenderKeyName } from './sender-key-name.js';
|
|
3
|
-
import { SenderKeyRecord } from './sender-key-record.js';
|
|
4
|
-
interface SenderKeyStore {
|
|
5
|
-
loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
|
|
6
|
-
storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export declare class GroupSessionBuilder {
|
|
9
|
-
private readonly senderKeyStore;
|
|
10
|
-
constructor(senderKeyStore: SenderKeyStore);
|
|
11
|
-
process(senderKeyName: SenderKeyName, senderKeyDistributionMessage: SenderKeyDistributionMessage): Promise<void>;
|
|
12
|
-
create(senderKeyName: SenderKeyName): Promise<SenderKeyDistributionMessage>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=group-session-builder.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SenderKeyName } from './sender-key-name.js';
|
|
2
|
-
import { SenderKeyRecord } from './sender-key-record.js';
|
|
3
|
-
export interface SenderKeyStore {
|
|
4
|
-
loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
|
|
5
|
-
storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare class GroupCipher {
|
|
8
|
-
private readonly senderKeyStore;
|
|
9
|
-
private readonly senderKeyName;
|
|
10
|
-
constructor(senderKeyStore: SenderKeyStore, senderKeyName: SenderKeyName);
|
|
11
|
-
encrypt(paddedPlaintext: Uint8Array): Promise<Uint8Array>;
|
|
12
|
-
decrypt(senderKeyMessageBytes: Uint8Array): Promise<Uint8Array>;
|
|
13
|
-
private getSenderKey;
|
|
14
|
-
private getPlainText;
|
|
15
|
-
private getCipherText;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=group_cipher.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
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';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { generateKeyPair } from 'libsignal/src/curve.js';
|
|
2
|
-
type KeyPairType = ReturnType<typeof generateKeyPair>;
|
|
3
|
-
export declare function generateSenderKey(): Buffer;
|
|
4
|
-
export declare function generateSenderKeyId(): number;
|
|
5
|
-
export interface SigningKeyPair {
|
|
6
|
-
public: Buffer;
|
|
7
|
-
private: Buffer;
|
|
8
|
-
}
|
|
9
|
-
export declare function generateSenderSigningKey(key?: KeyPairType): SigningKeyPair;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=keyhelper.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SenderMessageKey } from './sender-message-key.js';
|
|
2
|
-
export declare class SenderChainKey {
|
|
3
|
-
private readonly MESSAGE_KEY_SEED;
|
|
4
|
-
private readonly CHAIN_KEY_SEED;
|
|
5
|
-
private readonly iteration;
|
|
6
|
-
private readonly chainKey;
|
|
7
|
-
constructor(iteration: number, chainKey: Uint8Array | Buffer);
|
|
8
|
-
getIteration(): number;
|
|
9
|
-
getSenderMessageKey(): SenderMessageKey;
|
|
10
|
-
getNext(): SenderChainKey;
|
|
11
|
-
getSeed(): Uint8Array;
|
|
12
|
-
private getDerivative;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=sender-chain-key.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CiphertextMessage } from './ciphertext-message.js';
|
|
2
|
-
export declare class SenderKeyDistributionMessage extends CiphertextMessage {
|
|
3
|
-
private readonly id;
|
|
4
|
-
private readonly iteration;
|
|
5
|
-
private readonly chainKey;
|
|
6
|
-
private readonly signatureKey;
|
|
7
|
-
private readonly serialized;
|
|
8
|
-
constructor(id?: number | null, iteration?: number | null, chainKey?: Uint8Array | null, signatureKey?: Uint8Array | null, serialized?: Uint8Array | null);
|
|
9
|
-
private intsToByteHighAndLow;
|
|
10
|
-
serialize(): Uint8Array;
|
|
11
|
-
getType(): number;
|
|
12
|
-
getIteration(): number;
|
|
13
|
-
getChainKey(): Uint8Array;
|
|
14
|
-
getSignatureKey(): Uint8Array;
|
|
15
|
-
getId(): number;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=sender-key-distribution-message.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CiphertextMessage } from './ciphertext-message.js';
|
|
2
|
-
export declare class SenderKeyMessage extends CiphertextMessage {
|
|
3
|
-
private readonly SIGNATURE_LENGTH;
|
|
4
|
-
private readonly messageVersion;
|
|
5
|
-
private readonly keyId;
|
|
6
|
-
private readonly iteration;
|
|
7
|
-
private readonly ciphertext;
|
|
8
|
-
private readonly signature;
|
|
9
|
-
private readonly serialized;
|
|
10
|
-
constructor(keyId?: number | null, iteration?: number | null, ciphertext?: Uint8Array | null, signatureKey?: Uint8Array | null, serialized?: Uint8Array | null);
|
|
11
|
-
getKeyId(): number;
|
|
12
|
-
getIteration(): number;
|
|
13
|
-
getCipherText(): Uint8Array;
|
|
14
|
-
verifySignature(signatureKey: Uint8Array): void;
|
|
15
|
-
private getSignature;
|
|
16
|
-
serialize(): Uint8Array;
|
|
17
|
-
getType(): number;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=sender-key-message.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface Sender {
|
|
2
|
-
id: string;
|
|
3
|
-
deviceId: number;
|
|
4
|
-
toString(): string;
|
|
5
|
-
}
|
|
6
|
-
export declare class SenderKeyName {
|
|
7
|
-
private readonly groupId;
|
|
8
|
-
private readonly sender;
|
|
9
|
-
constructor(groupId: string, sender: Sender);
|
|
10
|
-
getGroupId(): string;
|
|
11
|
-
getSender(): Sender;
|
|
12
|
-
serialize(): string;
|
|
13
|
-
toString(): string;
|
|
14
|
-
equals(other: SenderKeyName | null): boolean;
|
|
15
|
-
hashCode(): number;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=sender-key-name.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { SenderKeyState } from './sender-key-state.js';
|
|
2
|
-
export interface SenderKeyStateStructure {
|
|
3
|
-
senderKeyId: number;
|
|
4
|
-
senderChainKey: {
|
|
5
|
-
iteration: number;
|
|
6
|
-
seed: Uint8Array;
|
|
7
|
-
};
|
|
8
|
-
senderSigningKey: {
|
|
9
|
-
public: Uint8Array;
|
|
10
|
-
private?: Uint8Array;
|
|
11
|
-
};
|
|
12
|
-
senderMessageKeys: Array<{
|
|
13
|
-
iteration: number;
|
|
14
|
-
seed: Uint8Array;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export declare class SenderKeyRecord {
|
|
18
|
-
private readonly MAX_STATES;
|
|
19
|
-
private readonly senderKeyStates;
|
|
20
|
-
constructor(serialized?: SenderKeyStateStructure[]);
|
|
21
|
-
isEmpty(): boolean;
|
|
22
|
-
getSenderKeyState(keyId?: number): SenderKeyState | undefined;
|
|
23
|
-
addSenderKeyState(id: number, iteration: number, chainKey: Uint8Array, signatureKey: Uint8Array): void;
|
|
24
|
-
setSenderKeyState(id: number, iteration: number, chainKey: Uint8Array, keyPair: {
|
|
25
|
-
public: Uint8Array;
|
|
26
|
-
private: Uint8Array;
|
|
27
|
-
}): void;
|
|
28
|
-
serialize(): SenderKeyStateStructure[];
|
|
29
|
-
static deserialize(data: Uint8Array): SenderKeyRecord;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=sender-key-record.d.ts.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { SenderChainKey } from './sender-chain-key.js';
|
|
2
|
-
import { SenderMessageKey } from './sender-message-key.js';
|
|
3
|
-
interface SenderChainKeyStructure {
|
|
4
|
-
iteration: number;
|
|
5
|
-
seed: Uint8Array;
|
|
6
|
-
}
|
|
7
|
-
interface SenderSigningKeyStructure {
|
|
8
|
-
public: Uint8Array;
|
|
9
|
-
private?: Uint8Array;
|
|
10
|
-
}
|
|
11
|
-
interface SenderMessageKeyStructure {
|
|
12
|
-
iteration: number;
|
|
13
|
-
seed: Uint8Array;
|
|
14
|
-
}
|
|
15
|
-
interface SenderKeyStateStructure {
|
|
16
|
-
senderKeyId: number;
|
|
17
|
-
senderChainKey: SenderChainKeyStructure;
|
|
18
|
-
senderSigningKey: SenderSigningKeyStructure;
|
|
19
|
-
senderMessageKeys: SenderMessageKeyStructure[];
|
|
20
|
-
}
|
|
21
|
-
export declare class SenderKeyState {
|
|
22
|
-
private readonly MAX_MESSAGE_KEYS;
|
|
23
|
-
private readonly senderKeyStateStructure;
|
|
24
|
-
constructor(id?: number | null, iteration?: number | null, chainKey?: Uint8Array | null | string, signatureKeyPair?: {
|
|
25
|
-
public: Uint8Array | string;
|
|
26
|
-
private: Uint8Array | string;
|
|
27
|
-
} | null, signatureKeyPublic?: Uint8Array | string | null, signatureKeyPrivate?: Uint8Array | string | null, senderKeyStateStructure?: SenderKeyStateStructure | null);
|
|
28
|
-
getKeyId(): number;
|
|
29
|
-
getSenderChainKey(): SenderChainKey;
|
|
30
|
-
setSenderChainKey(chainKey: SenderChainKey): void;
|
|
31
|
-
getSigningKeyPublic(): Buffer;
|
|
32
|
-
getSigningKeyPrivate(): Buffer | undefined;
|
|
33
|
-
hasSenderMessageKey(iteration: number): boolean;
|
|
34
|
-
addSenderMessageKey(senderMessageKey: SenderMessageKey): void;
|
|
35
|
-
removeSenderMessageKey(iteration: number): SenderMessageKey | null;
|
|
36
|
-
getStructure(): SenderKeyStateStructure;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=sender-key-state.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class SenderMessageKey {
|
|
2
|
-
private readonly iteration;
|
|
3
|
-
private readonly iv;
|
|
4
|
-
private readonly cipherKey;
|
|
5
|
-
private readonly seed;
|
|
6
|
-
constructor(iteration: number, seed: Uint8Array);
|
|
7
|
-
getIteration(): number;
|
|
8
|
-
getIv(): Uint8Array;
|
|
9
|
-
getCipherKey(): Uint8Array;
|
|
10
|
-
getSeed(): Uint8Array;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sender-message-key.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { LIDMapping, SignalAuthState } from '../Types/index.js';
|
|
2
|
-
import type { SignalRepositoryWithLIDStore } from '../Types/Signal.js';
|
|
3
|
-
import type { ILogger } from '../Utils/logger.js';
|
|
4
|
-
export declare function makeLibSignalRepository(auth: SignalAuthState, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>): SignalRepositoryWithLIDStore;
|
|
5
|
-
//# sourceMappingURL=libsignal.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { LIDMapping, SignalKeyStoreWithTransaction } from '../Types/index.js';
|
|
2
|
-
import type { ILogger } from '../Utils/logger.js';
|
|
3
|
-
export declare class LIDMappingStore {
|
|
4
|
-
private readonly mappingCache;
|
|
5
|
-
private readonly keys;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
private pnToLIDFunc?;
|
|
8
|
-
private readonly inflightLIDLookups;
|
|
9
|
-
private readonly inflightPNLookups;
|
|
10
|
-
constructor(keys: SignalKeyStoreWithTransaction, logger: ILogger, pnToLIDFunc?: (jids: string[]) => Promise<LIDMapping[] | undefined>);
|
|
11
|
-
storeLIDPNMappings(pairs: LIDMapping[]): Promise<void>;
|
|
12
|
-
getLIDForPN(pn: string): Promise<string | null>;
|
|
13
|
-
getLIDsForPNs(pns: string[]): Promise<LIDMapping[] | null>;
|
|
14
|
-
private _getLIDsForPNsImpl;
|
|
15
|
-
getPNForLID(lid: string): Promise<string | null>;
|
|
16
|
-
getPNsForLIDs(lids: string[]): Promise<LIDMapping[] | null>;
|
|
17
|
-
private _getPNsForLIDsImpl;
|
|
18
|
-
/**
|
|
19
|
-
* Close the cache and release resources
|
|
20
|
-
*/
|
|
21
|
-
close(): void;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=lid-mapping.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
import { URL } from 'url';
|
|
3
|
-
import type { SocketConfig } from '../../Types/index.js';
|
|
4
|
-
export declare abstract class AbstractSocketClient extends EventEmitter {
|
|
5
|
-
url: URL;
|
|
6
|
-
config: SocketConfig;
|
|
7
|
-
abstract get isOpen(): boolean;
|
|
8
|
-
abstract get isClosed(): boolean;
|
|
9
|
-
abstract get isClosing(): boolean;
|
|
10
|
-
abstract get isConnecting(): boolean;
|
|
11
|
-
constructor(url: URL, config: SocketConfig);
|
|
12
|
-
abstract connect(): void;
|
|
13
|
-
abstract close(): void;
|
|
14
|
-
abstract send(str: Uint8Array | string, cb?: (err?: Error) => void): boolean;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import WebSocket from 'ws';
|
|
2
|
-
import { AbstractSocketClient } from './types.js';
|
|
3
|
-
export declare class WebSocketClient extends AbstractSocketClient {
|
|
4
|
-
protected socket: WebSocket | null;
|
|
5
|
-
get isOpen(): boolean;
|
|
6
|
-
get isClosed(): boolean;
|
|
7
|
-
get isClosing(): boolean;
|
|
8
|
-
get isConnecting(): boolean;
|
|
9
|
-
connect(): void;
|
|
10
|
-
close(): Promise<void>;
|
|
11
|
-
send(str: string | Uint8Array, cb?: (err?: Error) => void): boolean;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=websocket.d.ts.map
|