supunmd-bail 2.0.2 → 2.1.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/LICENSE +1 -1
- package/README.md +2 -2
- package/WAProto/index.js +130529 -45236
- package/engine-requirements.js +1 -1
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +9 -18
- package/lib/Defaults/index.js +136 -104
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -1
- package/lib/Signal/Group/ciphertext-message.js +5 -2
- package/lib/Signal/Group/group-session-builder.d.ts +3 -4
- package/lib/Signal/Group/group-session-builder.js +41 -7
- package/lib/Signal/Group/group_cipher.d.ts +4 -4
- package/lib/Signal/Group/group_cipher.js +51 -37
- package/lib/Signal/Group/index.d.ts +11 -12
- package/lib/Signal/Group/index.js +57 -12
- package/lib/Signal/Group/keyhelper.d.ts +1 -2
- package/lib/Signal/Group/keyhelper.js +44 -7
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +5 -2
- package/lib/Signal/Group/sender-chain-key.d.ts +2 -3
- package/lib/Signal/Group/sender-chain-key.js +15 -7
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -2
- package/lib/Signal/Group/sender-key-distribution-message.js +11 -8
- package/lib/Signal/Group/sender-key-message.d.ts +1 -2
- package/lib/Signal/Group/sender-key-message.js +12 -9
- package/lib/Signal/Group/sender-key-name.d.ts +0 -1
- package/lib/Signal/Group/sender-key-name.js +5 -2
- package/lib/Signal/Group/sender-key-record.d.ts +2 -3
- package/lib/Signal/Group/sender-key-record.js +21 -9
- package/lib/Signal/Group/sender-key-state.d.ts +6 -7
- package/lib/Signal/Group/sender-key-state.js +42 -27
- package/lib/Signal/Group/sender-message-key.d.ts +0 -1
- package/lib/Signal/Group/sender-message-key.js +7 -4
- package/lib/Signal/libsignal.d.ts +3 -5
- package/lib/Signal/libsignal.js +90 -258
- package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +3 -2
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +19 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -2
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.d.ts +108 -125
- package/lib/Socket/business.js +43 -159
- package/lib/Socket/chats.d.ts +239 -70
- package/lib/Socket/chats.js +384 -363
- package/lib/Socket/dugong.d.ts +254 -0
- package/lib/Socket/dugong.js +484 -0
- package/lib/Socket/groups.d.ts +56 -78
- package/lib/Socket/groups.js +96 -106
- package/lib/Socket/index.d.ts +115 -173
- package/lib/Socket/index.js +10 -17
- package/lib/Socket/messages-recv.d.ts +79 -91
- package/lib/Socket/messages-recv.js +521 -639
- package/lib/Socket/messages-send.d.ts +91 -111
- package/lib/Socket/messages-send.js +438 -599
- package/lib/Socket/newsletter.d.ts +84 -97
- package/lib/Socket/newsletter.js +1 -181
- package/lib/Socket/registration.d.ts +267 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +18 -26
- package/lib/Socket/socket.js +230 -448
- package/lib/Socket/usync.d.ts +16 -17
- package/lib/Socket/usync.js +26 -19
- package/lib/Store/index.d.ts +3 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.d.ts +13 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.d.ts +118 -0
- package/lib/Store/make-in-memory-store.js +427 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.d.ts +12 -13
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Call.d.ts +1 -2
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +13 -34
- package/lib/Types/Chat.js +4 -8
- package/lib/Types/Contact.d.ts +1 -6
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +15 -60
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +5 -17
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +0 -12
- package/lib/Types/Label.js +5 -3
- package/lib/Types/LabelAssociation.d.ts +0 -1
- package/lib/Types/LabelAssociation.js +5 -3
- package/lib/Types/Message.d.ts +54 -84
- package/lib/Types/Message.js +9 -11
- package/lib/Types/Newsletter.d.ts +98 -130
- package/lib/Types/Newsletter.js +38 -31
- package/lib/Types/Product.d.ts +1 -2
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +1 -20
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +25 -47
- package/lib/Types/Socket.js +2 -3
- package/lib/Types/State.d.ts +2 -14
- package/lib/Types/State.js +2 -13
- package/lib/Types/USync.d.ts +2 -3
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +14 -22
- package/lib/Types/index.js +31 -15
- package/lib/Utils/auth-utils.d.ts +6 -7
- package/lib/Utils/auth-utils.js +148 -199
- package/lib/Utils/baileys-event-stream.d.ts +1 -2
- package/lib/Utils/baileys-event-stream.js +22 -15
- package/lib/Utils/business.d.ts +2 -3
- package/lib/Utils/business.js +69 -66
- package/lib/Utils/chat-utils.d.ts +22 -21
- package/lib/Utils/chat-utils.js +226 -260
- package/lib/Utils/crypto.d.ts +19 -19
- package/lib/Utils/crypto.js +86 -77
- package/lib/Utils/decode-wa-message.d.ts +8 -37
- package/lib/Utils/decode-wa-message.js +83 -164
- package/lib/Utils/event-buffer.d.ts +8 -7
- package/lib/Utils/event-buffer.js +76 -110
- package/lib/Utils/generics.d.ts +29 -27
- package/lib/Utils/generics.js +210 -168
- package/lib/Utils/history.d.ts +8 -12
- package/lib/Utils/history.js +46 -34
- package/lib/Utils/index.d.ts +17 -20
- package/lib/Utils/index.js +33 -20
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +22 -14
- package/lib/Utils/logger.d.ts +3 -11
- package/lib/Utils/logger.js +7 -3
- package/lib/Utils/lt-hash.d.ts +8 -9
- package/lib/Utils/lt-hash.js +28 -25
- package/lib/Utils/make-mutex.d.ts +2 -3
- package/lib/Utils/make-mutex.js +10 -7
- package/lib/Utils/messages-media.d.ts +44 -42
- package/lib/Utils/messages-media.js +475 -319
- package/lib/Utils/messages.d.ts +18 -17
- package/lib/Utils/messages.js +259 -383
- package/lib/Utils/noise-handler.d.ts +15 -14
- package/lib/Utils/noise-handler.js +38 -30
- package/lib/Utils/process-message.d.ts +13 -14
- package/lib/Utils/process-message.js +147 -239
- package/lib/Utils/signal.d.ts +5 -7
- package/lib/Utils/signal.js +72 -78
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +27 -29
- package/lib/Utils/validate-connection.d.ts +7 -7
- package/lib/Utils/validate-connection.js +106 -72
- package/lib/WABinary/constants.d.ts +27 -25
- package/lib/WABinary/constants.js +20 -1281
- package/lib/WABinary/decode.d.ts +5 -5
- package/lib/WABinary/decode.js +42 -28
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +154 -105
- package/lib/WABinary/generic-utils.d.ts +7 -5
- package/lib/WABinary/generic-utils.js +63 -56
- package/lib/WABinary/index.d.ts +5 -6
- package/lib/WABinary/index.js +21 -6
- package/lib/WABinary/jid-utils.d.ts +8 -25
- package/lib/WABinary/jid-utils.js +40 -74
- package/lib/WABinary/types.d.ts +1 -2
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +11 -3
- package/lib/WAM/BinaryInfo.js +5 -2
- package/lib/WAM/constants.d.ts +3 -5
- package/lib/WAM/constants.js +11958 -19461
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +22 -17
- package/lib/WAM/index.d.ts +3 -4
- package/lib/WAM/index.js +19 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +11 -8
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +14 -11
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -9
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -3
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +13 -9
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -4
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +22 -20
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -5
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +8 -13
- package/lib/WAUSync/Protocols/index.d.ts +4 -5
- package/lib/WAUSync/Protocols/index.js +20 -5
- package/lib/WAUSync/USyncQuery.d.ts +4 -5
- package/lib/WAUSync/USyncQuery.js +35 -40
- package/lib/WAUSync/USyncUser.d.ts +5 -6
- package/lib/WAUSync/USyncUser.js +5 -2
- package/lib/WAUSync/index.d.ts +3 -4
- package/lib/WAUSync/index.js +19 -4
- package/lib/index.d.ts +9 -19
- package/lib/index.js +1 -36
- package/package.json +109 -103
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/WAProto.proto +0 -5519
- package/WAProto/fix-imports.js +0 -29
- package/WAProto/index.d.ts +0 -11969
- package/lib/Signal/lid-mapping.d.ts +0 -23
- package/lib/Signal/lid-mapping.js +0 -171
- package/lib/Socket/Client/types.js +0 -11
- package/lib/Socket/Client/websocket.js +0 -50
- package/lib/Socket/communities.d.ts +0 -244
- package/lib/Socket/communities.js +0 -431
- package/lib/Socket/mex.d.ts +0 -3
- package/lib/Socket/mex.js +0 -42
- package/lib/Types/Bussines.d.ts +0 -25
- package/lib/Types/Bussines.js +0 -2
- package/lib/Utils/browser-utils.d.ts +0 -4
- package/lib/Utils/browser-utils.js +0 -28
- package/lib/Utils/message-retry-manager.d.ts +0 -82
- package/lib/Utils/message-retry-manager.js +0 -149
- package/lib/Utils/pre-key-manager.d.ts +0 -28
- package/lib/Utils/pre-key-manager.js +0 -106
- /package/lib/{supun → supunmd} +0 -0
|
@@ -1,32 +1,27 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
1
4
|
import { Boom } from '@hapi/boom';
|
|
5
|
+
import { AxiosRequestConfig } from 'axios';
|
|
6
|
+
import type { Logger } from 'pino';
|
|
2
7
|
import { Readable, Transform } from 'stream';
|
|
3
8
|
import { URL } from 'url';
|
|
4
|
-
import { proto } from '../../WAProto
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { type BinaryNode } from '../WABinary/index.js';
|
|
8
|
-
import type { ILogger } from './logger.js';
|
|
9
|
+
import { proto } from '../../WAProto';
|
|
10
|
+
import { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, MediaType, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types';
|
|
11
|
+
import { BinaryNode } from '../WABinary';
|
|
9
12
|
export declare const hkdfInfoKey: (type: MediaType) => string;
|
|
10
|
-
export declare const getRawMediaUploadData: (media: WAMediaUpload, mediaType: MediaType, logger?: ILogger) => Promise<{
|
|
11
|
-
filePath: string;
|
|
12
|
-
fileSha256: Buffer<ArrayBufferLike>;
|
|
13
|
-
fileLength: number;
|
|
14
|
-
}>;
|
|
15
13
|
/** generates all the keys required to encrypt/decrypt & sign a media message */
|
|
16
|
-
export declare function getMediaKeys(buffer: Uint8Array | string | null | undefined, mediaType: MediaType):
|
|
14
|
+
export declare function getMediaKeys(buffer: Uint8Array | string | null | undefined, mediaType: MediaType): MediaDecryptionKeyInfo;
|
|
17
15
|
export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string, width?: number) => Promise<{
|
|
18
|
-
buffer:
|
|
16
|
+
buffer: Buffer;
|
|
19
17
|
original: {
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
18
|
+
width: number | undefined;
|
|
19
|
+
height: number | undefined;
|
|
22
20
|
};
|
|
23
21
|
}>;
|
|
24
22
|
export declare const encodeBase64EncodedStringForUpload: (b64: string) => string;
|
|
25
|
-
export declare const generateProfilePicture: (mediaUpload: WAMediaUpload
|
|
26
|
-
|
|
27
|
-
height: number;
|
|
28
|
-
}) => Promise<{
|
|
29
|
-
img: Buffer<ArrayBufferLike>;
|
|
23
|
+
export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Promise<{
|
|
24
|
+
img: Buffer;
|
|
30
25
|
}>;
|
|
31
26
|
/** gets the SHA256 of the given media message */
|
|
32
27
|
export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string | null | undefined;
|
|
@@ -34,12 +29,10 @@ export declare function getAudioDuration(buffer: Buffer | string | Readable): Pr
|
|
|
34
29
|
/**
|
|
35
30
|
referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
|
|
36
31
|
*/
|
|
37
|
-
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?:
|
|
32
|
+
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: Logger): Promise<Uint8Array | undefined>;
|
|
38
33
|
export declare const toReadable: (buffer: Buffer) => Readable;
|
|
39
|
-
export declare const toBuffer: (stream: Readable) => Promise<Buffer
|
|
40
|
-
export declare const getStream: (item: WAMediaUpload, opts?:
|
|
41
|
-
maxContentLength?: number;
|
|
42
|
-
}) => Promise<{
|
|
34
|
+
export declare const toBuffer: (stream: Readable) => Promise<Buffer>;
|
|
35
|
+
export declare const getStream: (item: WAMediaUpload, opts?: AxiosRequestConfig) => Promise<{
|
|
43
36
|
readonly stream: Readable;
|
|
44
37
|
readonly type: "buffer";
|
|
45
38
|
} | {
|
|
@@ -54,7 +47,7 @@ export declare const getStream: (item: WAMediaUpload, opts?: RequestInit & {
|
|
|
54
47
|
}>;
|
|
55
48
|
/** generates a thumbnail for a given media, if required */
|
|
56
49
|
export declare function generateThumbnail(file: string, mediaType: 'video' | 'image', options: {
|
|
57
|
-
logger?:
|
|
50
|
+
logger?: Logger;
|
|
58
51
|
}): Promise<{
|
|
59
52
|
thumbnail: string | undefined;
|
|
60
53
|
originalImageDimensions: {
|
|
@@ -62,27 +55,37 @@ export declare function generateThumbnail(file: string, mediaType: 'video' | 'im
|
|
|
62
55
|
height: number;
|
|
63
56
|
} | undefined;
|
|
64
57
|
}>;
|
|
65
|
-
export declare const getHttpStream: (url: string | URL, options?:
|
|
58
|
+
export declare const getHttpStream: (url: string | URL, options?: AxiosRequestConfig & {
|
|
66
59
|
isStream?: true;
|
|
67
60
|
}) => Promise<Readable>;
|
|
68
61
|
type EncryptedStreamOptions = {
|
|
69
62
|
saveOriginalFileIfRequired?: boolean;
|
|
70
|
-
logger?:
|
|
71
|
-
opts?:
|
|
63
|
+
logger?: Logger;
|
|
64
|
+
opts?: AxiosRequestConfig;
|
|
72
65
|
};
|
|
66
|
+
export declare const prepareStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions) => Promise<{
|
|
67
|
+
mediaKey: undefined;
|
|
68
|
+
encWriteStream: Buffer;
|
|
69
|
+
fileLength: number;
|
|
70
|
+
fileSha256: Buffer;
|
|
71
|
+
fileEncSha256: undefined;
|
|
72
|
+
bodyPath: string | undefined;
|
|
73
|
+
didSaveToTmpPath: boolean;
|
|
74
|
+
}>;
|
|
73
75
|
export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions) => Promise<{
|
|
74
|
-
mediaKey: Buffer
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
mac: Buffer
|
|
78
|
-
fileEncSha256: Buffer
|
|
79
|
-
fileSha256: Buffer
|
|
76
|
+
mediaKey: Buffer;
|
|
77
|
+
encWriteStream: Readable;
|
|
78
|
+
bodyPath: string | undefined;
|
|
79
|
+
mac: Buffer;
|
|
80
|
+
fileEncSha256: Buffer;
|
|
81
|
+
fileSha256: Buffer;
|
|
80
82
|
fileLength: number;
|
|
83
|
+
didSaveToTmpPath: boolean;
|
|
81
84
|
}>;
|
|
82
85
|
export type MediaDownloadOptions = {
|
|
83
86
|
startByte?: number;
|
|
84
87
|
endByte?: number;
|
|
85
|
-
options?:
|
|
88
|
+
options?: AxiosRequestConfig<any>;
|
|
86
89
|
};
|
|
87
90
|
export declare const getUrlFromDirectPath: (directPath: string) => string;
|
|
88
91
|
export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<Transform>;
|
|
@@ -96,19 +99,18 @@ export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logg
|
|
|
96
99
|
/**
|
|
97
100
|
* Generate a binary node that will request the phone to re-upload the media & return the newly uploaded URL
|
|
98
101
|
*/
|
|
99
|
-
export declare const encryptMediaRetryRequest: (key:
|
|
102
|
+
export declare const encryptMediaRetryRequest: (key: proto.IMessageKey, mediaKey: Buffer | Uint8Array, meId: string) => BinaryNode;
|
|
100
103
|
export declare const decodeMediaRetryNode: (node: BinaryNode) => {
|
|
101
|
-
key:
|
|
104
|
+
key: proto.IMessageKey;
|
|
102
105
|
media?: {
|
|
103
106
|
ciphertext: Uint8Array;
|
|
104
107
|
iv: Uint8Array;
|
|
105
|
-
};
|
|
106
|
-
error?: Boom;
|
|
108
|
+
} | undefined;
|
|
109
|
+
error?: Boom<any> | undefined;
|
|
107
110
|
};
|
|
108
111
|
export declare const decryptMediaRetryData: ({ ciphertext, iv }: {
|
|
109
112
|
ciphertext: Uint8Array;
|
|
110
113
|
iv: Uint8Array;
|
|
111
|
-
}, mediaKey: Uint8Array, msgId: string) =>
|
|
112
|
-
export declare const getStatusCodeForMediaRetry: (code: number) =>
|
|
114
|
+
}, mediaKey: Uint8Array, msgId: string) => proto.MediaRetryNotification;
|
|
115
|
+
export declare const getStatusCodeForMediaRetry: (code: number) => any;
|
|
113
116
|
export {};
|
|
114
|
-
//# sourceMappingURL=messages-media.d.ts.map
|