sanka-baileyss 1.9.4 → 1.9.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/WAProto/CompanionReg/CompanionReg.d.ts +6 -0
- package/WAProto/CompanionReg/CompanionReg.js +36 -0
- package/WAProto/CompanionReg/CompanionReg.proto +1 -0
- package/WAProto/E2E/E2E.d.ts +434 -6
- package/WAProto/E2E/E2E.js +1427 -2
- package/WAProto/E2E/E2E.proto +33 -0
- package/WAProto/HistorySync/HistorySync.d.ts +434 -6
- package/WAProto/HistorySync/HistorySync.js +1427 -2
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +434 -6
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1427 -2
- package/WAProto/StatusAttributions/StatusAttributions.d.ts +95 -3
- package/WAProto/StatusAttributions/StatusAttributions.js +270 -2
- package/WAProto/StatusAttributions/StatusAttributions.proto +8 -0
- package/WAProto/Web/Web.d.ts +434 -6
- package/WAProto/Web/Web.js +1427 -2
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +1 -1
- package/lib/Socket/business.js +3 -3
- package/lib/Socket/chats.js +7 -7
- package/lib/Socket/groups.d.ts +117 -123
- package/lib/Socket/groups.js +355 -303
- package/lib/Socket/messages-recv.js +31 -30
- package/lib/Socket/messages-send.js +981 -981
- package/lib/Socket/newsletter.js +3 -3
- package/lib/Socket/socket.js +748 -621
- package/lib/Socket/usync.js +3 -3
- package/lib/Store/make-cache-manager-store.js +9 -17
- package/lib/Store/make-in-memory-store.d.ts +2 -2
- package/lib/Store/make-in-memory-store.js +5 -5
- package/lib/Types/Contact.d.ts +35 -24
- package/lib/Types/GroupMetadata.d.ts +70 -47
- package/lib/Types/Message.d.ts +348 -259
- package/lib/Utils/business.js +4 -0
- package/lib/Utils/chat-utils.d.ts +47 -45
- package/lib/Utils/chat-utils.js +731 -723
- package/lib/Utils/decode-wa-message.d.ts +250 -34
- package/lib/Utils/decode-wa-message.js +4 -0
- package/lib/Utils/generics.js +6 -6
- package/lib/Utils/history.d.ts +20 -10
- package/lib/Utils/history.js +88 -72
- package/lib/Utils/messages.js +1657 -1370
- package/lib/Utils/process-message.js +14 -1
- package/lib/index.js +13 -53
- package/package.json +1 -1
- package/lib/Socket/messages-recv.js.bak +0 -1072
package/lib/Utils/business.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
3
3
|
const boom_1 = require("@hapi/boom")
|
|
4
4
|
const crypto_1 = require("crypto")
|
|
5
|
+
const path_1 = require("path")
|
|
6
|
+
const os_1 = require("os")
|
|
7
|
+
const fs_1 = require("fs")
|
|
5
8
|
const WABinary_1 = require("../WABinary")
|
|
9
|
+
const generics_1 = require("./generics")
|
|
6
10
|
const messages_media_1 = require("./messages-media")
|
|
7
11
|
const parseCatalogNode = (node) => {
|
|
8
12
|
const catalogNode = WABinary_1.getBinaryNodeChild(node, 'product_catalog')
|
|
@@ -3,68 +3,70 @@ import { proto } from '../../WAProto'
|
|
|
3
3
|
import { BaileysEventEmitter, ChatModification, ChatMutation, Contact, InitialAppStateSyncOptions, LTHashState, WAPatchCreate, WAPatchName } from '../Types'
|
|
4
4
|
import { BinaryNode } from '../WABinary'
|
|
5
5
|
import { ILogger } from './logger'
|
|
6
|
+
import { LabelAssociationType } from '../Types/LabelAssociation'
|
|
7
|
+
|
|
6
8
|
type FetchAppStateSyncKey = (keyId: string) => Promise<proto.Message.IAppStateSyncKeyData | null | undefined>
|
|
9
|
+
|
|
7
10
|
export type ChatMutationMap = {
|
|
8
|
-
[index: string]: ChatMutation
|
|
11
|
+
[index: string]: ChatMutation
|
|
9
12
|
}
|
|
13
|
+
|
|
10
14
|
export declare const newLTHashState: () => LTHashState
|
|
15
|
+
|
|
11
16
|
export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{
|
|
12
|
-
patch: proto.ISyncdPatch
|
|
13
|
-
state: LTHashState
|
|
17
|
+
patch: proto.ISyncdPatch
|
|
18
|
+
state: LTHashState
|
|
14
19
|
}>
|
|
20
|
+
|
|
15
21
|
export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, onMutation: (mutation: ChatMutation) => void, validateMacs: boolean) => Promise<{
|
|
16
|
-
hash: Buffer
|
|
17
|
-
indexValueMap: {
|
|
18
|
-
[indexMacBase64: string]: {
|
|
19
|
-
valueMac: Uint8Array | Buffer
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
+
hash: Buffer
|
|
23
|
+
indexValueMap: {
|
|
24
|
+
[indexMacBase64: string]: {
|
|
25
|
+
valueMac: Uint8Array | Buffer
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
}>
|
|
29
|
+
|
|
23
30
|
export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, onMutation: (mutation: ChatMutation) => void, validateMacs: boolean) => Promise<{
|
|
24
|
-
hash: Buffer
|
|
25
|
-
indexValueMap: {
|
|
26
|
-
[indexMacBase64: string]: {
|
|
27
|
-
valueMac: Uint8Array | Buffer
|
|
28
|
-
}
|
|
29
|
-
}
|
|
31
|
+
hash: Buffer
|
|
32
|
+
indexValueMap: {
|
|
33
|
+
[indexMacBase64: string]: {
|
|
34
|
+
valueMac: Uint8Array | Buffer
|
|
35
|
+
}
|
|
36
|
+
}
|
|
30
37
|
}>
|
|
38
|
+
|
|
31
39
|
export declare const extractSyncdPatches: (result: BinaryNode, options: AxiosRequestConfig<{}>) => Promise<{
|
|
32
|
-
|
|
33
|
-
patches: proto.ISyncdPatch[]
|
|
34
|
-
hasMorePatches: boolean
|
|
35
|
-
snapshot?: proto.ISyncdSnapshot | undefined
|
|
36
|
-
}
|
|
37
|
-
critical_unblock_low: {
|
|
38
|
-
patches: proto.ISyncdPatch[]
|
|
39
|
-
hasMorePatches: boolean
|
|
40
|
-
snapshot?: proto.ISyncdSnapshot | undefined
|
|
41
|
-
}
|
|
42
|
-
regular_high: {
|
|
43
|
-
patches: proto.ISyncdPatch[]
|
|
44
|
-
hasMorePatches: boolean
|
|
45
|
-
snapshot?: proto.ISyncdSnapshot | undefined
|
|
46
|
-
}
|
|
47
|
-
regular_low: {
|
|
48
|
-
patches: proto.ISyncdPatch[]
|
|
49
|
-
hasMorePatches: boolean
|
|
50
|
-
snapshot?: proto.ISyncdSnapshot | undefined
|
|
51
|
-
}
|
|
52
|
-
regular: {
|
|
53
|
-
patches: proto.ISyncdPatch[]
|
|
54
|
-
hasMorePatches: boolean
|
|
55
|
-
snapshot?: proto.ISyncdSnapshot | undefined
|
|
56
|
-
}
|
|
40
|
+
[T in WAPatchName]: {
|
|
41
|
+
patches: proto.ISyncdPatch[]
|
|
42
|
+
hasMorePatches: boolean
|
|
43
|
+
snapshot?: proto.ISyncdSnapshot | undefined
|
|
44
|
+
}
|
|
57
45
|
}>
|
|
46
|
+
|
|
58
47
|
export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference, options: AxiosRequestConfig<{}>) => Promise<Buffer>
|
|
59
48
|
export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference, options: AxiosRequestConfig<{}>) => Promise<proto.SyncdMutations>
|
|
49
|
+
|
|
60
50
|
export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{
|
|
61
|
-
state: LTHashState
|
|
62
|
-
mutationMap: ChatMutationMap
|
|
51
|
+
state: LTHashState
|
|
52
|
+
mutationMap: ChatMutationMap
|
|
63
53
|
}>
|
|
54
|
+
|
|
64
55
|
export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, options: AxiosRequestConfig<{}>, minimumVersionNumber?: number, logger?: ILogger, validateMacs?: boolean) => Promise<{
|
|
65
|
-
state: LTHashState
|
|
66
|
-
mutationMap: ChatMutationMap
|
|
56
|
+
state: LTHashState
|
|
57
|
+
mutationMap: ChatMutationMap
|
|
67
58
|
}>
|
|
68
|
-
|
|
59
|
+
|
|
60
|
+
export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate & {
|
|
61
|
+
syncAction: {
|
|
62
|
+
timestamp?: number
|
|
63
|
+
contactAction?: {
|
|
64
|
+
fullName?: string
|
|
65
|
+
lidJid?: string
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
69
70
|
export declare const processSyncAction: (syncAction: ChatMutation, ev: BaileysEventEmitter, me: Contact, initialSyncOpts?: InitialAppStateSyncOptions, logger?: ILogger) => void
|
|
71
|
+
|
|
70
72
|
export {}
|