sanka-baileyss 2.1.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.
@@ -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
- critical_block: {
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
- export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate
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 {}